Re: [ROOT] Bug in TChain ?

From: Rene Brun (Rene.Brun@cern.ch)
Date: Wed Sep 18 2002 - 18:23:23 MEST


Hi Peter,

See the documentation of TChain::Add at;
http://root.cern.ch/root/htmldoc/TChain.html#TChain:Add

You do not need to specify the second argument. Note that the default
value for this argument is not -1 but kBigNumber.
In your case, to use the wildcarding facility, simply do:

 tc->Add( "file_*.root");

Rene Brun


On Wed, 18 Sep 2002, Peter Skensved wrote:

>     Hi,
>  If I do the following :
> 
> TChain *tc = new TChain( "T" );
> tc->Add( "file.root", -1 );
> tc->Add( "file_1.root", -1 );
> (Int_t)tc->GetEntries()
> 
> I get the total number of events in the two files as expected.
> 
>  However, if I do :
> 
> TChain *tc = new TChain( "T" );
> tc->Add( "file_*.root", -1 );
> (Int_t)tc->GetEntries()
> 
> which according to the documentation should do the same I get 
> the number of events in file_1.root only.
> 
>   Is this a bug or a feature ?
> 
>  I'd like to be able to use the 2.nd construct since it I do not
> have to know the number of files apriori.
> 
>                                          peter
> 
> ----
> 
> Peter Skensved                          Email : peter@SNO.Phy.QueensU.CA
> Dept. of Physics,
> Queen's University,
> Kingston, Ontario,
> Canada
> 



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