[ROOT] Problem with compiled code

From: Franck DELAUNAY (delaunay@ipno.in2p3.fr)
Date: Mon Feb 25 2002 - 16:41:28 MET


Hi rooters,

I used the "MakeClass" method to generate an analysis skeleton.
I generated this skeleton with a certain tree, and I am trying to run it 
with another tree, identical to the first one.

In an interactive root session, I do this ("tganil" is the class generated 
with MakeClass, "h1000" is the name of the trees contained in "myfile1" 
and "myfile2") :

   .L tganil.cxx
   ch = new TChain("h1000")
   ch->Add("myfile1.root")
   ch->Add("myfile2.root")
   tganil t(ch)
   t.Loop()

... and then everything goes well.

But when I try to run this code (after having compiled it) :

   #include "tganil.cxx"
   int main()
   {
     TChain *ch = new TChain("h1000");
     ch->Add("myfile1.root");
     ch->Add("myfile2.root");
     tganil t(ch);
     t.Loop();
     return 0;
   }

... I get a "Segmentation fault" which seems to be correlated to the 
instruction "tganil t(ch)".

The code "tganil.cxx" contains just a loop on all events, in which I fill 
some histograms according to certain conditions.

Does anybody have an idea ?

Thanks,

Franck



This archive was generated by hypermail 2b29 : Sat Jan 04 2003 - 23:50:42 MET