Fork me on GitHub

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

Last change on this file since 79 was 73, checked in by uid677, 16 years ago

new PartUtil class

File size: 2.0 KB
RevLine 
[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]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;
[67]40TCompare *TRootTrigger::fgCompare =0;
[3]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}
[73]51void 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
Note: See TracBrowser for help on using the repository browser.