Re: Getting a primitive from a sub pad

From: OKUMURA, Akira <oxon_at_astro.isas.jaxa.jp>
Date: Sun, 10 Jul 2011 23:58:35 -0700


Hello Olivier,

I tried gROOT->SetBatch(1) before sending the first post. But I got the following segmentation fault. This does not happen when I execute root with -b option. I prefer using gROOT->SetBatch(1) to using -b, because I will draw some other graphs in the same script after calling gROOT->SetBatch(0).

$ root

root [0] gROOT->SetBatch(1)
root [1] TFile f("can.root")
root [2] TCanvas* can = (TCanvas*)f.Get("can")
root [3] can->Draw()

Root >

Regards,

--
OKUMURA, Akira oxon@{astro.isas.jaxa.jp,stanford.edu}
Institute of Space and Astronautical Science (ISAS/JAXA)
Now at KIPAC/SLAC/Stanford
Varian Physics #306, 382 Via Pueblo Mall, MC 4060
Stanford, CA 94305-4060
TEL 650-736-0971/FAX 650-724-5065
Skype : okumura.akira

On 2011/07/10, at 23:35, Olivier Couet wrote:

> May be you can turn on the batch mode with:
> 
> gROOT->SetBatch(kTRUE);
> 
> On 7/11/11 8:32 AM, "OKUMURA, Akira" <oxon_at_astro.isas.jaxa.jp> wrote:
> 
>> Hello Olivier,
>> 
>> Thank you for your advice. But as I wrote,
>> 
>>> But I have thousands of ROOT files, I do not want to draw each TCanvas.
>> 
>> there are so many files already created. So if possible, I would like to
>> access the sub pad in batch mode or similar way. Is this impossible?
>> 
>> Regards,
>> 
>> --
>> OKUMURA, Akira oxon@{astro.isas.jaxa.jp,stanford.edu}
>> Institute of Space and Astronautical Science (ISAS/JAXA)
>> Now at KIPAC/SLAC/Stanford
>> Varian Physics #306, 382 Via Pueblo Mall, MC 4060
>> Stanford, CA 94305-4060
>> TEL 650-736-0971/FAX 650-724-5065
>> Skype : okumura.akira
>> 
>> On 2011/07/10, at 21:14, Olivier Couet wrote:
>> 
>>> If you do
>>> 
>>> can->Draw();
>>> 
>>> Just after
>>> 
>>> TCanvas* can = (TCanvas*)f.Get("can")
>>> 
>>> 
>>> Then it works.....
>>> 
>>> On 7/11/11 2:36 AM, "OKUMURA, Akira" <oxon_at_astro.isas.jaxa.jp> wrote:
>>> 
>>>> TCanvas* can = (TCanvas*)f.Get("can")
>>> 
>> 
> 
Received on Mon Jul 11 2011 - 08:58:59 CEST

This archive was generated by hypermail 2.2.0 : Mon Jul 11 2011 - 11:50:01 CEST