Re: [ROOT] TChain, TFile and TSystemFile

From: Rene Brun (Rene.Brun@cern.ch)
Date: Mon Dec 02 2002 - 18:49:50 MET


Hi Sebastien,

OK, thanks for this confirmation.
Note that the code generated by MakeClass has (I believe) a clear
indication about the problem, eg:

   for (Int_t jentry=0; jentry<nentries;jentry++) {
      Int_t ientry = LoadTree(jentry); //in case of a TChain, ientry is
the entry number in the current file
      if (ientry < 0) break;
      nb = fChain->GetEntry(jentry);   nbytes += nb;
      // if (Cut(ientry) < 0) continue;
   }

Rene Brun

On Mon, 2 Dec 2002, Sebastien Greder wrote:

> Hello Rene,
> 
> I guess I finally found out where the pb occured : when 
> writing :
> 
> Int_t ientry = LoadEntry(i_evt)
> 
> b_branchname->GetEntry(i_evt) <== to be replaced by :
> 
> b_branchname->GetEntry(ientry)
> 
> and now it seems to work fine.
> 
> Just a suggestion :
> 
> it would be helpful to notice this in the Loop() method created by 
> MakeClass() and maybe also in the TTree's GetEntry() method description.
> 
> sebastien.
> 
> 
> On Mon, 2 Dec 2002, Sebastien Greder wrote:
> 
> > Hello Rene,
> > 
> > Sorry I did a mistake and didn't really understood what was done by
> > TCanvas ... so those files are really TFile files !
> > 
> > Anyway, I even have a problem with these files !
> > 
> > I've put a script on : 
> > 
> > /afs/in2p3.fr/home/g/greder/public/test.tar.gz
> > 
> > One has just to run Compile_Classes.C first (i.e .x Compile_Classes.C)
> > and then .x Run_Analyze.C it will launch the Loop() method.
> > 
> > I get a seg. fault when running over the second file, when jentry = 1250
> > and ientry = 0. 
> > 
> > I found out that this came from the method GetChargedParticle(Int_t i)
> > but cannot figure out why it crashes here
> > (this method is owned by TMBJets.hpp in the dir.
> > tmb_classes/tmb_tree/tmb_tree/TMBJets.hpp).
> > 
> > The pb looks coming from the TRefArray but I don't know what to check out
> > to protect my prog from this, maybe I missed something ??
> > 
> > Any help will be welcome,
> > thanks,
> > 
> > sebastien.
> > 
> > 
> > 
> > 
> > 
> > On Thu, 28 Nov 2002, Rene Brun wrote:
> > 
> > > Hi Sebastien,
> > > 
> > > I have taken your two data files, but there is no script to analyse
> > > these data sets. Could you send me the script that crashes?
> > > 
> > > Rene Brun
> > > 
> > > On Thu, 28 Nov 2002, Sebastien Greder wrote:
> > > 
> > > > Hello Rooters,
> > > > 
> > > > I'm currently encountering a strange pb.
> > > > 
> > > > I have 2 files : mujet_01_tmbtree.root and mujet_02_tmbtree.root
> > > > 
> > > > IF I use a TBrowser() and applying the Dump() method, it looks 
> > > > that the first one is a TSystemFile and not a TFile as I expected.
> > > > 
> > > > But when instantiating a TFile or adding it in a TChain, I don't get any
> > > > message, warning and so on.
> > > > 
> > > > So in my prog I chain a list of files with a Tree (TMBTree), the
> > > > TSystemFile one owning to this list, and give the corresponding TTree
> > > > as an input to my prog unfortenatly this file brings my prog in a crash
> > > > (segmentation fault) when trying to get the first event corresp. to the
> > > > next file.
> > > > 
> > > > So my question is : is it possible to recover this file 
> > > > 
> > > > If not, what do you think about protectiong TChain and TFile ?
> > > > 
> > > > thanks,
> > > > 
> > > > sebastien,
> > > > 
> > > > ps : I'm running under RH 7.2, gcc 2.96, version 03.09
> > > > note : one can find the files in : /afs/in2p3.fr/home/g/greder/public/
> > > > 
> > > > 
> > > > 
> > > 
> > > 
> > 
> > 
> > 
> 
> 



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