[3] | 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 | *
|
---|
[73] | 13 | * $Date: 2008-12-03 16:22:43 $
|
---|
| 14 | * $Revision: 1.4 $
|
---|
[3] | 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 |
|
---|
[73] | 24 | #include "TLorentzVector.h"
|
---|
| 25 |
|
---|
[3] | 26 | TCompare *TRootGenParticle::fgCompare = 0;
|
---|
| 27 | TCompare *TRootJet::fgCompare = TComparePT<TRootJet>::Instance();
|
---|
| 28 | TCompare *TRootElectron::fgCompare = TComparePT<TRootElectron>::Instance();
|
---|
| 29 | TCompare *TRootMuon::fgCompare = TComparePT<TRootMuon>::Instance();
|
---|
| 30 | TCompare *TRootPhoton::fgCompare = TComparePT<TRootPhoton>::Instance();
|
---|
| 31 | TCompare *TRootTauJet::fgCompare = TComparePT<TRootTauJet>::Instance();
|
---|
| 32 | TCompare *TRootTracks::fgCompare = TComparePT<TRootTracks>::Instance();
|
---|
| 33 | TCompare *TRootETmis::fgCompare = 0;
|
---|
| 34 | TCompare *TRootCalo::fgCompare = 0;
|
---|
| 35 | TCompare *TRootZdcHits::fgCompare = 0;
|
---|
| 36 | TCompare *TRootGenEvent:: fgCompare = 0;
|
---|
| 37 | TCompare *TRootParticle::fgCompare=0;
|
---|
| 38 | TCompare *TRootLHEFParticle::fgCompare = 0;
|
---|
| 39 | TCompare *TRootRomanPotHits::fgCompare =0;
|
---|
[67] | 40 | TCompare *TRootTrigger::fgCompare =0;
|
---|
[3] | 41 |
|
---|
| 42 | void 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 | }
|
---|
[73] | 51 | void TRootParticle::Set(float px,float py,float pz, float e) {
|
---|
| 52 | TLorentzVector toFill;
|
---|
| 53 | toFill.SetPxPyPzE(px,py,pz,e);
|
---|
| 54 | E = e;
|
---|
| 55 | Px = px;
|
---|
| 56 | Py = py;
|
---|
| 57 | Pz = pz;
|
---|
| 58 | PT = toFill.Pt();
|
---|
| 59 | Eta = toFill.Eta();
|
---|
| 60 | Phi = toFill.Phi();
|
---|
| 61 | }
|
---|
[3] | 62 |
|
---|
[73] | 63 |
|
---|