Fork me on GitHub

source: svn/trunk/Utilities/ExRootAnalysis/src/BlockClasses.cc@ 176

Last change on this file since 176 was 176, checked in by Xavier Rouby, 16 years ago

TRootTracks

File size: 2.1 KB
Line 
1/** \class BlockClasses
2 *
3 * Initialization of static fgCompare functions. At the moment a number of
4 * functions TCompare*** are implemented (see BlockCompare.h).
5 * Function TCompareXX sorts objects
6 * by the variable "XX" that MUST be present in the data members of the
7 * Block TRoot class.
8 * By default most objects are sorted by PT or ET.
9 * Only calorimeter cells and basic cluster are sorted by E
10 * TRootGenParticle particle is not sorted by default
11 * to preserve mother-dautherlinks between particles.
12 *
13 * $Date: 2009-01-12 23:36:06 $
14 * $Revision: 1.6 $
15 *
16 *
17 * \author S. Ovyn - UCL, Louvain-la-Neuve
18 *
19 */
20
21#include "Utilities/ExRootAnalysis/interface/BlockClasses.h"
22#include "Utilities/ExRootAnalysis/interface/BlockCompare.h"
23
24#include "TLorentzVector.h"
25
26TCompare *TRootGenParticle::fgCompare = 0;
27TCompare *TRootJet::fgCompare = TComparePT<TRootJet>::Instance();
28TCompare *TRootElectron::fgCompare = TComparePT<TRootElectron>::Instance();
29TCompare *TRootMuon::fgCompare = TComparePT<TRootMuon>::Instance();
30TCompare *TRootPhoton::fgCompare = TComparePT<TRootPhoton>::Instance();
31TCompare *TRootTauJet::fgCompare = TComparePT<TRootTauJet>::Instance();
32TCompare *TRootTracks::fgCompare = TComparePT<TRootTracks>::Instance();
33TCompare *TRootETmis::fgCompare = 0;
34TCompare *TRootCalo::fgCompare = 0;
35TCompare *TRootZdcHits::fgCompare = 0;
36TCompare *TRootGenEvent:: fgCompare = 0;
37TCompare *TRootParticle::fgCompare=0;
38TCompare *TRootLHEFParticle::fgCompare = 0;
39TCompare *TRootRomanPotHits::fgCompare =0;
40TCompare *TRootTrigger::fgCompare =0;
41
42void TRootParticle::Set(const TLorentzVector& momentum) {
43 E = momentum.E();
44 Px = momentum.Px();
45 Py = momentum.Py();
46 Pz = momentum.Pz();
47 PT = momentum.Pt();
48 Eta = momentum.Eta();
49 Phi = momentum.Phi();
50}
51
52void TRootParticle::Set(const float px, const float py, const float pz, const float e) {
53 TLorentzVector toFill;
54 toFill.SetPxPyPzE(px,py,pz,e);
55 E = e;
56 Px = px;
57 Py = py;
58 Pz = pz;
59 PT = toFill.Pt();
60 Eta = toFill.Eta();
61 Phi = toFill.Phi();
62}
63
64
Note: See TracBrowser for help on using the repository browser.