1 | /***********************************************************************
|
---|
2 | ** **
|
---|
3 | ** /----------------------------------------------\ **
|
---|
4 | ** | Delphes, a framework for the fast simulation | **
|
---|
5 | ** | of a generic collider experiment | **
|
---|
6 | ** \----------------------------------------------/ **
|
---|
7 | ** **
|
---|
8 | ** **
|
---|
9 | ** This package uses: **
|
---|
10 | ** ------------------ **
|
---|
11 | ** FastJet algorithm: Phys. Lett. B641 (2006) [hep-ph/0512210] **
|
---|
12 | ** Hector: JINST 2:P09005 (2007) [physics.acc-ph:0707.1198v2] **
|
---|
13 | ** FROG: [hep-ex/0901.2718v1] **
|
---|
14 | ** **
|
---|
15 | ** ------------------------------------------------------------------ **
|
---|
16 | ** **
|
---|
17 | ** Main authors: **
|
---|
18 | ** ------------- **
|
---|
19 | ** **
|
---|
20 | ** Severine Ovyn Xavier Rouby **
|
---|
21 | ** severine.ovyn@uclouvain.be xavier.rouby@cern **
|
---|
22 | ** **
|
---|
23 | ** Center for Particle Physics and Phenomenology (CP3) **
|
---|
24 | ** Universite catholique de Louvain (UCL) **
|
---|
25 | ** Louvain-la-Neuve, Belgium **
|
---|
26 | ** **
|
---|
27 | ** Copyright (C) 2008-2009, **
|
---|
28 | ** All rights reserved. **
|
---|
29 | ** **
|
---|
30 | ***********************************************************************/
|
---|
31 |
|
---|
32 | #include "BlockClasses.h"
|
---|
33 | #include "BlockCompare.h"
|
---|
34 | #include "TLorentzVector.h"
|
---|
35 | #include <cmath>
|
---|
36 |
|
---|
37 | TCompare *TRootGenParticle::fgCompare = 0;
|
---|
38 | TCompare *GenParticle::fgCompare = 0;
|
---|
39 | TCompare *TRootElectron::fgCompare = TComparePT<TRootElectron>::Instance();
|
---|
40 | TCompare *TRootMuon::fgCompare = TComparePT<TRootMuon>::Instance();
|
---|
41 | TCompare *TRootPhoton::fgCompare = TComparePT<TRootPhoton>::Instance();
|
---|
42 | TCompare *TRootTauJet::fgCompare = TComparePT<TRootTauJet>::Instance();
|
---|
43 | TCompare *TRootJet::fgCompare = TComparePT<TRootJet>::Instance();
|
---|
44 | TCompare *TRootTracks::fgCompare = 0;
|
---|
45 | TCompare *TRootETmis::fgCompare = 0;
|
---|
46 | TCompare *TRootCalo::fgCompare = 0;
|
---|
47 | TCompare *TRootZdcHits::fgCompare = 0;
|
---|
48 | TCompare *TRootGenEvent:: fgCompare = 0;
|
---|
49 | TCompare *TRootParticle::fgCompare=0;
|
---|
50 | TCompare *TRootLHEFParticle::fgCompare = 0;
|
---|
51 | TCompare *TRootRomanPotHits::fgCompare =0;
|
---|
52 | TCompare *TRootTrigger::fgCompare =0;
|
---|
53 |
|
---|
54 | void TRootParticle::Set(const TLorentzVector& momentum) {
|
---|
55 | E = momentum.E();
|
---|
56 | Px = momentum.Px();
|
---|
57 | Py = momentum.Py();
|
---|
58 | Pz = momentum.Pz();
|
---|
59 | PT = momentum.Pt();
|
---|
60 | Eta = momentum.Eta();
|
---|
61 | Phi = momentum.Phi();
|
---|
62 | }
|
---|
63 |
|
---|
64 | void TRootTauJet::Set(const TLorentzVector& momentum) {
|
---|
65 |
|
---|
66 | E = momentum.E();
|
---|
67 | Px = momentum.Px();
|
---|
68 | Py = momentum.Py();
|
---|
69 | Pz = momentum.Pz();
|
---|
70 | PT = momentum.Pt();
|
---|
71 | Eta = momentum.Eta();
|
---|
72 | Phi = momentum.Phi();
|
---|
73 |
|
---|
74 | }
|
---|
75 |
|
---|
76 | void TRootParticle::Set(const float px, const float py, const float pz, const float e) {
|
---|
77 | TLorentzVector toFill;
|
---|
78 | toFill.SetPxPyPzE(px,py,pz,e);
|
---|
79 | E = e;
|
---|
80 | Px = px;
|
---|
81 | Py = py;
|
---|
82 | Pz = pz;
|
---|
83 | PT = toFill.Pt();
|
---|
84 | Eta = toFill.Eta();
|
---|
85 | Phi = toFill.Phi();
|
---|
86 | }
|
---|
87 |
|
---|
88 | void TRootParticle::SetEtaPhiEET(const float eta, const float phi, const float e, const float et) {
|
---|
89 | Eta = eta; Phi = phi; E = e; PT = et;
|
---|
90 | //float theta = 2* atan(exp(-Eta);
|
---|
91 | Px = PT*cos(Phi);
|
---|
92 | Py = PT*sin(Phi);
|
---|
93 | }
|
---|
94 |
|
---|
95 | TRootGenParticle::TRootGenParticle(GenParticle* part) :
|
---|
96 | PID(part->PID),Status(part->Status),M1(part->M1),M2(part->M2),D1(part->D1),D2(part->D2),
|
---|
97 | T(part->T),X(part->X),Y(part->Y),Z(part->Z),M(part->M){
|
---|
98 | E=part->E;
|
---|
99 | Px=part->Px;
|
---|
100 | Py=part->Py;
|
---|
101 | Pz=part->Pz;
|
---|
102 | Eta=part->Eta;
|
---|
103 | Phi=part->Phi;
|
---|
104 | PT=part->PT;
|
---|
105 | _initialised=false;
|
---|
106 | }
|
---|
107 |
|
---|
108 |
|
---|
109 | void TRootGenParticle::setFractions() {
|
---|
110 | switch(abs(PID)) {
|
---|
111 | default: _Fem = 0; _Fhad=1; break;
|
---|
112 | case(pE):
|
---|
113 | case(pGAMMA):
|
---|
114 | case(pPI0):
|
---|
115 | _Fem = 1; _Fhad=0; break;
|
---|
116 | case(pNU1):
|
---|
117 | case(pNU2):
|
---|
118 | case(pNU3):
|
---|
119 | case(pMU):
|
---|
120 | _Fem =0; _Fhad=0; break;
|
---|
121 | case(pK0S):
|
---|
122 | case(pLAMBDA):
|
---|
123 | _Fem=0.3; _Fhad=0.7; break;
|
---|
124 | }
|
---|
125 | _initialised=true;
|
---|
126 | }
|
---|
127 |
|
---|
128 | float Eta, Phi; // (eta,phi) at the beginning of the track
|
---|
129 | float EtaOuter, PhiOuter; // (eta,phi) at the end of the track
|
---|
130 | float PT, E, Px, Py, Pz;
|
---|
131 |
|
---|
132 | TRootTracks::TRootTracks() :
|
---|
133 | Eta(UNDEFINED), Phi(UNDEFINED), EtaOuter(UNDEFINED), PhiOuter(UNDEFINED),
|
---|
134 | PT(UNDEFINED), E(UNDEFINED), Px(UNDEFINED), Py(UNDEFINED), Pz(UNDEFINED) {}
|
---|
135 |
|
---|
136 | TRootTracks::TRootTracks(const float inEta, const float inPhi, const float outEta, const float outPhi, const float pt) :
|
---|
137 | Eta(inEta), Phi(inPhi), EtaOuter(outEta), PhiOuter(outPhi),
|
---|
138 | PT(pt) {
|
---|
139 | TLorentzVector p; p.SetPtEtaPhiE(PT,Eta,Phi,PT*cosh(Eta));
|
---|
140 | Px = p.Px(); Py = p.Py(); Pz = p.Pz(); E=p.E();
|
---|
141 | }
|
---|
142 | TRootTracks::TRootTracks(const TRootTracks& track) :
|
---|
143 | Eta(track.Eta), Phi(track.Phi),
|
---|
144 | EtaOuter(track.EtaOuter), PhiOuter(track.PhiOuter),
|
---|
145 | PT(track.PT), E(track.E), Px(track.Px), Py(track.Py), Pz(track.Pz) {}
|
---|
146 |
|
---|
147 | TRootTracks& TRootTracks::operator=(const TRootTracks& track) {
|
---|
148 | if(this == &track) return *this;
|
---|
149 | Eta = track.Eta; Phi = track.Phi;
|
---|
150 | EtaOuter = track.EtaOuter; PhiOuter = track.PhiOuter;
|
---|
151 | PT = track.PT; E = track.E; Px = track.Px; Py= track.Py; Pz =track.Pz;
|
---|
152 | return *this;
|
---|
153 | }
|
---|
154 |
|
---|
155 | void TRootTracks::Set(const float inEta, const float inPhi, const float outEta, const float outPhi, const float pt) {
|
---|
156 | Eta= inEta; Phi=inPhi; EtaOuter=outEta; PhiOuter=outPhi; PT=pt;
|
---|
157 | TLorentzVector p; p.SetPtEtaPhiE(PT,Eta,Phi,PT*cosh(Eta));
|
---|
158 | Px = p.Px(); Py = p.Py(); Pz = p.Pz(); E=p.E();
|
---|
159 | }
|
---|
160 |
|
---|
161 | const TLorentzVector TRootTracks::GetFourVector() const {
|
---|
162 | TLorentzVector v;
|
---|
163 | v.SetPtEtaPhiE(PT,Eta,Phi,PT*cosh(Eta));
|
---|
164 | return TLorentzVector(v);
|
---|
165 | }
|
---|
166 |
|
---|
167 | TRootCalo::TRootCalo() :
|
---|
168 | E_em(UNDEFINED), E_had(UNDEFINED), ET(UNDEFINED) {}
|
---|
169 | //Eta(UNDEFINED), Phi(UNDEFINED), E_em(UNDEFINED), E_had(UNDEFINED), E(UNDEFINED), ET(UNDEFINED) {}
|
---|
170 |
|
---|
171 | TRootCalo::TRootCalo(const TRootCalo& cal) {
|
---|
172 | E_em=cal.E_em; E_had=cal.E_had; ET=cal.ET;
|
---|
173 | //Eta =cal.Eta; Phi=cal.Phi; E_em=cal.E_em; E_had=cal.E_had; E=cal.E; ET=cal.ET;
|
---|
174 | }
|
---|
175 |
|
---|
176 | TRootCalo& TRootCalo::operator=(const TRootCalo& cal) {
|
---|
177 | if(this==&cal) return *this;
|
---|
178 | Eta =cal.Eta; Phi=cal.Phi; E_em=cal.E_em; E_had=cal.E_had; E=cal.E; ET=cal.ET;
|
---|
179 | return *this;
|
---|
180 | }
|
---|
181 |
|
---|
182 | void TRootCalo::set(const D_CaloTower& cal) {
|
---|
183 | Eta =cal.getEta(); Phi=cal.getPhi();
|
---|
184 | E_em=cal.getEem(); E_had=cal.getEhad();
|
---|
185 | E =cal.getE(); ET =cal.getET();
|
---|
186 | }
|
---|