Re: Error: Symbol myTree is not defined in current scope sphericalLEFS60.cc:14

From: Bruno Morgado <jb.morgado_at_gmail.com>
Date: Fri, 18 Dec 2009 13:24:46 +0000


Oh, sorry I should have clarified that. sphericalLEFs60.cc is the macro file (the one I show the code in my 1st email). I run it using: root -l sphericalLEFs60.cc

My ROOT version is 5.22/00b.

On Fri, Dec 18, 2009 at 1:22 PM, Rene Brun <Rene.Brun_at_cern.ch> wrote:

> Your error report shows an error in your file sphericalLEFs60.cc file, not
> in your init script!
> Could you clarify which version of ROOT you use?
> Post the code in sphericalLEFs60.cc?
>
> Rene Brun
>
>
> Bruno Morgado wrote:
>
>> Hello all,
>>
>> I'm trying to analyse some data I created in GEANT4 using ROOT and I'm
>> using the ROOT book Trees chapter Example 4: A Tree with an Event Class.
>>
>> The problem is that it doesn't work as expected. I get the error:
>> Error: Symbol myTree is not defined in current scope
>> sphericalLEFS60.cc:14:
>> Error: Failed to evaluate myTree->SetCacheSize(100000000)
>>
>> Whats bugging me here is that: myTree->Print(); works as expected and
>> shows all my tree structure, but other operations in myTree simply don't
>> work (that is, it's not just myTree->SetCacheSize(100000000); that gives my
>> problems it's also many other things, like: TBranch* bEvent =
>> myTree->GetBranch("EventBranch");) I really don't know what to do, since I
>> cannot see any problem with the code and it's exactly as the example on the
>> book.
>>
>> { // init macro
>>
>> gROOT->Reset();
>>
>> if(!TClassTable::GetDict("hiscaleSimEventTree")) {
>>
>> gSystem->Load("../libs/libhiscaleSimEventTree.so");
>>
>> }
>>
>>
>> // read the tree file generated in GEANT4
>>
>> TFile* treeFile = new TFile("sphericalLEFS60.root");
>>
>> treeFile->ls();
>>
>> TTree *myTree = (TTree*)treeFile->Get("hiscaleSim");
>>
>> myTree->Print();
>>
>> myTree->SetCacheSize(100000000); // or many other stuuf like: TBranch*
>> bEvent = myTree->GetBranch("EventBranch");
>>
>> }
>>
>>
>>
>>
>>
>
Received on Fri Dec 18 2009 - 14:25:09 CET

This archive was generated by hypermail 2.2.0 : Fri Dec 18 2009 - 17:50:03 CET