Re: TChain does not work on the 2nd file.

From: Pasha Murat (murat@cdfsga.fnal.gov)
Date: Mon May 04 1998 - 02:51:12 MEST


Wei Xie writes:
 > 
 > Dear ROOTers
 > 
 > I'd better to describe my problem in some more detail.
 > A file "htree.root" are produced by the attached files in which 
 > there're one TTree object "T" and two Branchs varible "point" and 
 > "eventn". A 2nd file "htree2.root" are produced by the same file but 
 > the Branch variable name has been changed to "circle" and "neve", that
 > means two new branches has been produced in the 2nd file. 
 > I combine the two files in a chain(Just for understanding the TChain)
 > by typing:
 > 
 > **   TChain chain("T");
 > **   chain.Add("htree.root");
 > **   chain.Add("htree2.root");
 > **   chain.Draw("point");
 > **   chain.Draw("circle");
 > 
 > It'll draw distribution of "point" sucessfully but show the following
 > message for "circle":
 > 
 > **  *ERROR 26 : 
 > **  Unknown name : "circle"
 > 
 > But if change the sequence of adding the two files, i.e.
 >    
 > **   TChain chain("T");
 > **   chain.Add("htree2.root");
 > **   chain.Add("htree.root");
 > **   chain.Draw("point");
 > **   chain.Draw("circle");
 >       
 > It'll draw distribution of "circle" sucessfully but show the following
 > message for "point" this time:
 >  
 > **  *ERROR 26 :
 > **  Unknown name : "point"
 > 
 > Since Chain is intended for concatenating several pieces of the same tree
 > residing in several files, I assume it should be able to deal with Branch
 > "point" and "circle" together since they're in the same tree. Could you
 > tell me where's the mistake of my operation ?
 > 

	When the first file in the chain gets opened, ROOT reads the definition
	of the tree (Rene, correct me if I'm wrong here). After this it knows 
	that TTree named "T" has branches with the names "point" and "event".
	When you are asking for a branch named "circle", which tree "T" does not
	contain, ROOT complains about it.

						Regards, Pasha.



This archive was generated by hypermail 2b29 : Tue Jan 04 2000 - 00:34:32 MET