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

From: Rene Brun <Rene.Brun_at_cern.ch>
Date: Fri, 18 Dec 2009 18:23:29 +0100


We are interested by the root data file in addition to the script. my suggestions:
  -make your macro a named macro
  -remove the statement gROOT->Reset() (side-effects next time you run with you library).
  -send us the result of treeFile->ls()

Rene Brun

Bruno Morgado wrote:
> Here it goes in attachment (I hope ROOTTalk accepts attachments):
>
>
> On Fri, Dec 18, 2009 at 2:00 PM, Axel Naumann <Axel.Naumann_at_cern.ch
> <mailto:Axel.Naumann_at_cern.ch>> wrote:
>
> Hi Bruno,
>
> please send the actual file.
>
> Cheers, Axel.
>
> Bruno Morgado wrote on 12/18/2009 02:24 PM:
>
> 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
> <mailto:Rene.Brun_at_cern.ch> <mailto:Rene.Brun_at_cern.ch
> <mailto: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 - 18:23:35 CET

This archive was generated by hypermail 2.2.0 : Fri Dec 18 2009 - 23:50:02 CET