Re: How to draw Members of an Object in a TTree

From: Rene Brun (Rene.Brun@cern.ch)
Date: Fri Mar 03 2000 - 18:04:24 MET


Hi Joachim,
If you have two TLorentzVectors in your class, you can force Root
to distinguish each vector when you build the Tree by adding a "." (dot)
at the end of the two branch names.
 T.Branch("LV1.","TLorentzVector",&lv1,16000,1)
 T.Branch("LV2.","TLorentzVector",&lv2,16000,1)

Then interactively, you can do
 T.Draw("lv1.E")

In a future version (hope in 2.24) one should be able to access
data members of an object saved in one branch with split=0

Rene Brun


> 
> Subject:
> Date: Thu, 2 Mar 2000 02:58:54 +0100 (MET)
> From: USENET News System <News.Support@cern.ch>
> Reply-To: cern-root@listbox3.cern.ch
> 
> >From news Thu Mar  2 02:58 MET 2000
> Path: cern.ch!claire.desy.de!tandler
> From: tandler@zenbonn1.desy.de (Joachim Tandler)
> Newsgroups: cern.root
> Subject: How to draw Members of an Object in a TTree
> Date: 2 Mar 2000 01:41:33 GMT
> Organization: Deutsches Elektronen Synchotron
> Lines: 19
> Message-ID: <slrn8brhm2.dsq.tandler@zenbonn1.desy.de>
> NNTP-Posting-Host: zenbonn1.desy.de
> X-Newsreader: slrn (0.9.5.2 UNIX)
> Xref: cern.ch cern.root:6391
> Content-Type: text
> Content-Length: 798
> 
> Hi rooters!
> After having managed with help from Fons to use TLorentzVectors, I have stored
> them in a TBranch of a TTree with various splitlevels. It would be great, if I
> could make Histograms out of them like with simple data types:
> tree->Draw("vector.E()")
> Unfortunately this doesn't work.
> If I use splitlevel 0, I can get the data members of the first
> TLorentzVector:
> tree->Draw("fE")
> But I have no idea how to get the others, as their Branches are named
> equally.
> 
> Can you help?     Cheers, Joachim.
> 
> -------------------------------------------------------------------------
> Joachim Tandler              |
> Physikalisches Institut Bonn | http://www-zeus.physik.uni-bonn.de/~tandler/
> Z.Zt. DESY (ZEUS, Zi. 146)   | Email: tandler@mail.desy.de
> Notkestr. 85, 22607 Hamburg  | Tel.:  040 / 8998 3642



This archive was generated by hypermail 2b29 : Tue Jan 02 2001 - 11:50:20 MET