RE: [ROOT] difference between tree name and the name of tree object

From: Philippe Canal (pcanal@fnal.gov)
Date: Tue Jul 29 2003 - 01:43:24 MEST


> If yes, how can I chain root files with trees of different names.

Check http://root.cern.ch/root/html/TChain.html#TChain:Add
For example:
	chain.Add("file1.root/tree1");
       chain.Add("file2.root/tree2");

In treeviewer the name is the name of the chain itself (I think, it might
also be the name of the tree in the first file).

To check the actually name of the tree object in the file use either:
	file->ls()
or the TBrowser.

Cheers,
Philippe.

-----Original Message-----
From: owner-roottalk@pcroot.cern.ch
[mailto:owner-roottalk@pcroot.cern.ch]On Behalf Of tcli
Sent: Monday, July 28, 2003 5:52 PM
To: roottalk@pcroot.cern.ch
Subject: [ROOT] difference between tree name and the name of tree object


Dear root users,
     I know from a root user that tree name is different from the name
of tree object. One of the arguments in creating a TChain is the tree
name. I check the tree name of 2 root TTree file from the Tree Viewer. I
think the name written next to the small tree picture is the tree name.
However, when I put it in the argument as "TChain chain("tre")" for
creating a TChain object and later opened Tree Viewer (with
"chain.StartViewer()"), ROOT said "cannot file tree with name tre in
myfile.root". So I would like to know if the "tree name" that I found
from Tree Viewer is really the intended argument in "TChain
chain("..")". If no, how can I check it?
    Also, from the user guide, a TChain object is a list of root files
containing the same tree. Does this means the trees of those root files
to be chained must be of the same name? If yes, how can I chain root
files with trees of different names?

Thanks in advance,
Lesley


#################################################################
#################################################################
#################################################################
#####
#####
#####
#################################################################
#################################################################
#################################################################



This archive was generated by hypermail 2b29 : Thu Jan 01 2004 - 17:50:14 MET