Re: [ROOT] TChain usage

From: Rene Brun (Rene.Brun@cern.ch)
Date: Wed Oct 30 2002 - 12:43:37 MET


Hi Tohru,

If you call chain.Add("file.root",0), the Add function will check
that the Tree exists in the file. If the Tree does not exist,
the file is not added to the TChain.
By default, if you do not specify the second argument to TChain::Add,
the function does not open the file. It only adds the file name
to the list of files in the chain. The file is only open 
when it is needed.

Specifying the second argument to Add introduces more safety
with the overhead to open the file to read the number of entries
in the Tree.

Rene Brun

On Wed, 30 Oct 2002, Tohru Ohnuki wrote:

> Hello fellow root users, i have a question regarding adding files to a
> TChain. If the file doesn't have the tree you are trying to add it barfs
> with: Error in <TChain::LoadTree>: cannot find tree with name... Now the
> chain seems broken, for instance GetEntries returns
> 1.23456789000000000e+09. My question: Is there a way to back up and
> unchain the last file or do i need to start over adding to the chain? Or
> is there a way to test for proper file chaining? Or should i ensure that
> all files are homogeneous? Thanks...
> 
> Regards
> 
> Tohru O.
> 
> --
> UCLA Physics and Astronomy Department
> GSR-IV Data Monkey
> ohnuki@physics.ucla.edu
> 



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