Re: [ROOT] Problem with compiled code

From: Rene Brun (Rene.Brun@cern.ch)
Date: Mon Feb 25 2002 - 17:53:07 MET


Hi Frank,

I cannot reproduce the problem with the PRO version (3.02/07) or
the development version.

If you do not use the PRO version, please make a test with 3.02/07 or newer.

If you do, send me two small files myfile1,2.root 

Rene Brun

Franck DELAUNAY wrote:
> 
> 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