[ROOT] Some beginners questions: TTrees

From: Ole Streicher (ole.streicher@gmx.de)
Date: Mon Aug 12 2002 - 11:12:00 MEST


Dear Roottalk!

My message seem to be lost within the others; I didn't get any
reply. Is there something wrong with my question? Bad question style? 
Too simple or too difficult? Or not understandable?

Could anyone please look there and help me?

Thank you

Tschuessi

Ole

Ole Streicher writes:
 > Hello!
 > 
 > I am just starting in using ROOT, and I have some questions in how to 
 > organize a TTree. I want to have there a structure like
 > 
 > event -+- branch1 -+- subbranch1 -+- var1
 >        |           |              +- var2
 >        |           |              :
 >        |           |
 >        |           +- subbranch2 -+- var3
 >        |           |              +- var4
 >        |           |              :
 >        |           :
 >        |          
 >        +- branch2 -+- subbranch3 -+- var5
 >        |           |              |
 >        :           :              :
 > 
 > But all tutorials describe only how to get *one* level into (first
 > argument of ttree->Branch()), and not how tu build a second one.
 > 
 > Also I am curious in how it would be possible to add another leaf to
 > an existing branch. Using
 > 
 > int i, j;
 > TTree tree("mytree", "Example tree");
 > tree.Branch("branch", &i, "i/I");
 > tree.Branch("branch", &j, "j/I");
 > 
 > seems to add *two* branches with the same name to the tree - at least
 > if I execute "tree.StartViewer()" afterwards.
 > 
 > Is it possible to put a complete "C" structure into a TTree without
 > the need to specify every of its elements? (would rootcint help here?)
 > 
 > The last question I have for Trees is in how can I view a tree
 > together with all its friends in a viewer. If I just execute
 > tree.StartViewer(), I can see the tree itself but not its friends. Is
 > there a possibility to combine them?
 > 
 > And one more (very last ;-) ) question: How can I link a TTree to a
 > certain TFile? I have the feeling that TTree uses the last TFile that
 > was created before the TTree was created - is that right? Can one
 > change this?
 > 
 > Thank you!
 > 
 > Tschuessi
 > 
 > Ole



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