RE: [ROOT] TTree::Draw and TLorentzVectors

From: Philippe Canal (pcanal@fnal.gov)
Date: Thu Nov 20 2003 - 19:00:27 MET


Hi Andre,

>   tree->Draw("(tau1 + tau2).Mag()")

We have not (yet?) implemented call to overloaded operators from TTree::Draw.
You can only call 'regular data members' of the classes.

Hence you sorrowfully have to write down the calculation in term of the numerical values from tau1 and tau2.

Cheers,
Philippe.

PS. When creating several branch containing the same type of 
object, to remove ambiguities we recommend to use a '.' at 
the end of the branch name

   tree->Branch("tau1.","TLorentzVector",&tau1);
   tree->Branch("tau2.","TLorentzVector",&tau2);


-----Original Message-----
From: owner-roottalk@pcroot.cern.ch
[mailto:owner-roottalk@pcroot.cern.ch]On Behalf Of André Holzner
Sent: Thursday, November 20, 2003 10:10 AM
To: roottalk@pcroot.cern.ch
Subject: [ROOT] TTree::Draw and TLorentzVectors


Hello,

I create a tree containing two TLorentzVectors per event:

   TLorentzVector *tau1 = new TLorentzVector;
   TLorentzVector *tau2 = new TLorentzVector;

   tree->Branch("tau1","TLorentzVector",&tau1);
   tree->Branch("tau2","TLorentzVector",&tau2);


   for (...)
     {
       tau1->Set...
       tau2->Set...

       tree->Fill();
     }


Is it possible to plot e.g. the invariant mass of tau1 and
tau2 in each event (without having to loop over each event
by hand) ?

I tried things like:

   tree->Draw("(tau1 + tau2).Mag()")

but it seems not to work (using 3.10/01)...


thanks for any advice,

André



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