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 |
|
---|
33 | #include "BlockClasses.h"
|
---|
34 | #include "BlockCompare.h"
|
---|
35 | #include "TLorentzVector.h"
|
---|
36 | #include <cstdlib> // abs(int)
|
---|
37 |
|
---|
38 | TCompare *TRootGenParticle::fgCompare = 0;
|
---|
39 | TCompare *TRootGenFwdParticle::fgCompare = 0;
|
---|
40 | TCompare *TRootC::GenParticle::fgCompare = 0;
|
---|
41 | TCompare *TRootElectron::fgCompare = TComparePT<TRootElectron>::Instance();
|
---|
42 | TCompare *TRootMuon::fgCompare = TComparePT<TRootMuon>::Instance();
|
---|
43 | TCompare *TRootPhoton::fgCompare = TComparePT<TRootPhoton>::Instance();
|
---|
44 | TCompare *TRootTauJet::fgCompare = TComparePT<TRootTauJet>::Instance();
|
---|
45 | TCompare *TRootJet::fgCompare = TComparePT<TRootJet>::Instance();
|
---|
46 | TCompare *TRootTracks::fgCompare = 0;
|
---|
47 | TCompare *TRootETmis::fgCompare = 0;
|
---|
48 | TCompare *TRootCalo::fgCompare = 0;
|
---|
49 | TCompare *TRootZdcHits::fgCompare = 0;
|
---|
50 | TCompare *TRootGenEvent:: fgCompare = 0;
|
---|
51 | TCompare *TRootParticle::fgCompare=0;
|
---|
52 | TCompare *TRootLHEFParticle::fgCompare = 0;
|
---|
53 | TCompare *TRootRomanPotHits::fgCompare =0;
|
---|
54 | TCompare *TRootForwardTaggerHits::fgCompare =0;
|
---|
55 | TCompare *TRootTrigger::fgCompare =0;
|
---|
56 |
|
---|
57 | void TRootParticle::Set(const TLorentzVector& momentum) {
|
---|
58 | E = momentum.E();
|
---|
59 | Px = momentum.Px();
|
---|
60 | Py = momentum.Py();
|
---|
61 | Pz = momentum.Pz();
|
---|
62 | PT = momentum.Pt();
|
---|
63 | Eta = momentum.Eta();
|
---|
64 | Phi = momentum.Phi();
|
---|
65 | }
|
---|
66 |
|
---|
67 | void TRootGenFwdParticle::Set(const TLorentzVector& momentum) {
|
---|
68 | genE = momentum.E();
|
---|
69 | genPx = momentum.Px();
|
---|
70 | genPy = momentum.Py();
|
---|
71 | genPz = momentum.Pz();
|
---|
72 | genPT = momentum.Pt();
|
---|
73 | genEta = momentum.Eta();
|
---|
74 | genPhi = momentum.Phi();
|
---|
75 | }
|
---|
76 |
|
---|
77 |
|
---|
78 | void TRootTauJet::Set(const TLorentzVector& momentum) {
|
---|
79 |
|
---|
80 | E = momentum.E();
|
---|
81 | Px = momentum.Px();
|
---|
82 | Py = momentum.Py();
|
---|
83 | Pz = momentum.Pz();
|
---|
84 | PT = momentum.Pt();
|
---|
85 | Eta = momentum.Eta();
|
---|
86 | Phi = momentum.Phi();
|
---|
87 |
|
---|
88 | }
|
---|
89 |
|
---|
90 | void TRootParticle::Set(const float px, const float py, const float pz, const float e) {
|
---|
91 | TLorentzVector toFill;
|
---|
92 | toFill.SetPxPyPzE(px,py,pz,e);
|
---|
93 | E = e;
|
---|
94 | Px = px;
|
---|
95 | Py = py;
|
---|
96 | Pz = pz;
|
---|
97 | PT = toFill.Pt();
|
---|
98 | Eta = toFill.Eta();
|
---|
99 | Phi = toFill.Phi();
|
---|
100 | }
|
---|
101 |
|
---|
102 | void TRootGenFwdParticle::Set(const float px, const float py, const float pz, const float e) {
|
---|
103 | TLorentzVector toFill;
|
---|
104 | toFill.SetPxPyPzE(px,py,pz,e);
|
---|
105 | genE = e;
|
---|
106 | genPx = px;
|
---|
107 | genPy = py;
|
---|
108 | genPz = pz;
|
---|
109 | genPT = toFill.Pt();
|
---|
110 | genEta = toFill.Eta();
|
---|
111 | genPhi = toFill.Phi();
|
---|
112 | }
|
---|
113 |
|
---|
114 |
|
---|
115 | void TRootParticle::SetEtaPhiEET(const float eta, const float phi, const float e, const float et) {
|
---|
116 | Eta = eta; Phi = phi; E = e; PT = et;
|
---|
117 | //float theta = 2* atan(exp(-Eta);
|
---|
118 | Px = PT*cos(Phi); Py = PT*sin(Phi);
|
---|
119 | }
|
---|
120 |
|
---|
121 | void TRootGenFwdParticle::SetEtaPhiEET(const float eta, const float phi, const float e, const float et) {
|
---|
122 | genEta = eta; genPhi = phi; genE = e; genPT = et;
|
---|
123 | genPx = genPT*cos(genPhi); genPy = genPT*sin(genPhi);
|
---|
124 | }
|
---|
125 |
|
---|
126 |
|
---|
127 | TRootGenFwdParticle::TRootGenFwdParticle(const TRootGenFwdParticle& p): TSortableObject(),
|
---|
128 | genE(p.genE), genPx(p.genPx), genPy(p.genPy), genPz(p.genPz), genPT(p.genPT), genEta(p.genEta), genPhi(p.genPhi) {}
|
---|
129 |
|
---|
130 | TRootGenFwdParticle& TRootGenFwdParticle::operator=(const TRootGenFwdParticle& p){
|
---|
131 | if(this == &p) return *this;
|
---|
132 | genE=p.genE; genPx=p.genPx; genPy=p.genPy; genPz=p.genPz;
|
---|
133 | genPT=p.genPT; genEta=p.genEta; genPhi=p.genPhi;
|
---|
134 | return *this;
|
---|
135 | }
|
---|
136 |
|
---|
137 | namespace TRootC {
|
---|
138 | GenParticle::GenParticle(const TRootGenParticle& p) :
|
---|
139 | PID(p.PID), Status(p.Status), M1(p.M1), M2(p.M2), D1(p.D1), D2(p.D2), Charge(p.Charge),
|
---|
140 | T(p.T), X(p.X), Y(p.Y), Z(p.Z), M(p.M) {
|
---|
141 | }
|
---|
142 | }
|
---|
143 |
|
---|
144 | TRootGenParticle::TRootGenParticle(TRootC::GenParticle* part) :
|
---|
145 | PID(part->PID),Status(part->Status),M1(part->M1),M2(part->M2),D1(part->D1),D2(part->D2),
|
---|
146 | T(part->T),X(part->X),Y(part->Y),Z(part->Z),M(part->M){
|
---|
147 | E=part->E;
|
---|
148 | Px=part->Px;
|
---|
149 | Py=part->Py;
|
---|
150 | Pz=part->Pz;
|
---|
151 | Eta=part->Eta;
|
---|
152 | Phi=part->Phi;
|
---|
153 | PT=part->PT;
|
---|
154 | _initialised=false;
|
---|
155 | }
|
---|
156 |
|
---|
157 |
|
---|
158 | void TRootGenParticle::setFractions() {
|
---|
159 | switch(abs(PID)) {
|
---|
160 | default: _Fem = 0; _Fhad=1; break;
|
---|
161 | case(pE):
|
---|
162 | case(pGAMMA):
|
---|
163 | case(pPI0):
|
---|
164 | _Fem = 1; _Fhad=0; break;
|
---|
165 | case(pNU1):
|
---|
166 | case(pNU2):
|
---|
167 | case(pNU3):
|
---|
168 | case(pMU):
|
---|
169 | _Fem =0; _Fhad=0; break;
|
---|
170 | case(pK0S):
|
---|
171 | case(pLAMBDA):
|
---|
172 | _Fem=0.3; _Fhad=0.7; break;
|
---|
173 | }
|
---|
174 | _initialised=true;
|
---|
175 | }
|
---|
176 |
|
---|
177 | /* float Eta, Phi; // (eta,phi) at the beginning of the track
|
---|
178 | float EtaOuter, PhiOuter; // (eta,phi) at the end of the track
|
---|
179 | float PT, E, Px, Py, Pz; */
|
---|
180 |
|
---|
181 | TRootTracks::TRootTracks() :
|
---|
182 | Eta(UNDEFINED), Phi(UNDEFINED), EtaOuter(UNDEFINED), PhiOuter(UNDEFINED),
|
---|
183 | PT(UNDEFINED), E(UNDEFINED), Px(UNDEFINED), Py(UNDEFINED), Pz(UNDEFINED),
|
---|
184 | Charge(UNDEFINED) {}
|
---|
185 |
|
---|
186 | TRootTracks::TRootTracks(const float inEta, const float inPhi, const float outEta, const float outPhi, const float pt) :
|
---|
187 | Eta(inEta), Phi(inPhi), EtaOuter(outEta), PhiOuter(outPhi),
|
---|
188 | PT(pt) {
|
---|
189 | TLorentzVector p; p.SetPtEtaPhiE(PT,Eta,Phi,PT*cosh(Eta));
|
---|
190 | Px = p.Px(); Py = p.Py(); Pz = p.Pz(); E=p.E();
|
---|
191 | Charge = UNDEFINED;
|
---|
192 | }
|
---|
193 | TRootTracks::TRootTracks(const TRootTracks& track) : TSortableObject(),
|
---|
194 | Eta(track.Eta), Phi(track.Phi),
|
---|
195 | EtaOuter(track.EtaOuter), PhiOuter(track.PhiOuter),
|
---|
196 | PT(track.PT), E(track.E), Px(track.Px), Py(track.Py), Pz(track.Pz), Charge(track.Charge) {}
|
---|
197 |
|
---|
198 | TRootTracks& TRootTracks::operator=(const TRootTracks& track) {
|
---|
199 | if(this == &track) return *this;
|
---|
200 | Eta = track.Eta; Phi = track.Phi;
|
---|
201 | EtaOuter = track.EtaOuter; PhiOuter = track.PhiOuter;
|
---|
202 | PT = track.PT; E = track.E; Px = track.Px; Py= track.Py; Pz =track.Pz;
|
---|
203 | Charge = track.Charge;
|
---|
204 | return *this;
|
---|
205 | }
|
---|
206 |
|
---|
207 | void TRootTracks::Set(const float inEta, const float inPhi, const float outEta, const float outPhi, const float pt, const float charge) {
|
---|
208 | Eta= inEta; Phi=inPhi; EtaOuter=outEta; PhiOuter=outPhi; PT=pt;
|
---|
209 | TLorentzVector p; p.SetPtEtaPhiE(PT,Eta,Phi,PT*cosh(Eta));
|
---|
210 | Px = p.Px(); Py = p.Py(); Pz = p.Pz(); E=p.E();
|
---|
211 | Charge = charge;
|
---|
212 | }
|
---|
213 |
|
---|
214 | const TLorentzVector TRootTracks::GetFourVector() const {
|
---|
215 | TLorentzVector v;
|
---|
216 | v.SetPtEtaPhiE(PT,Eta,Phi,PT*cosh(Eta));
|
---|
217 | return TLorentzVector(v);
|
---|
218 | }
|
---|
219 |
|
---|
220 | TRootCalo::TRootCalo() :
|
---|
221 | E_em(UNDEFINED), E_had(UNDEFINED), ET(UNDEFINED) {}
|
---|
222 | //Eta(UNDEFINED), Phi(UNDEFINED), E_em(UNDEFINED), E_had(UNDEFINED), E(UNDEFINED), ET(UNDEFINED) {}
|
---|
223 |
|
---|
224 | TRootCalo::TRootCalo(const TRootCalo& cal) : TSortableObject() {
|
---|
225 | E_em=cal.E_em; E_had=cal.E_had; ET=cal.ET;
|
---|
226 | //Eta =cal.Eta; Phi=cal.Phi; E_em=cal.E_em; E_had=cal.E_had; E=cal.E; ET=cal.ET;
|
---|
227 | }
|
---|
228 |
|
---|
229 | TRootCalo& TRootCalo::operator=(const TRootCalo& cal) {
|
---|
230 | if(this==&cal) return *this;
|
---|
231 | Eta =cal.Eta; Phi=cal.Phi; E_em=cal.E_em; E_had=cal.E_had; E=cal.E; ET=cal.ET;
|
---|
232 | return *this;
|
---|
233 | }
|
---|
234 |
|
---|
235 | void TRootCalo::set(const D_CaloTower& cal) {
|
---|
236 | Eta =cal.getEta(); Phi=cal.getPhi();
|
---|
237 | E_em=cal.getEem(); E_had=cal.getEhad();
|
---|
238 | E =cal.getE(); ET =cal.getET();
|
---|
239 | }
|
---|
240 |
|
---|
241 | TRootZdcHits::TRootZdcHits(const float e, const float t, const int side, const bool had) : E(e), T(t), side(side), hadronic_hit(had) {}
|
---|
242 |
|
---|
243 | TRootZdcHits::TRootZdcHits(const TRootZdcHits& zdc) : TRootGenFwdParticle(zdc), E(zdc.E), T(zdc.T), side(zdc.side), hadronic_hit(zdc.hadronic_hit) {}
|
---|
244 |
|
---|
245 | TRootZdcHits& TRootZdcHits::operator=(const TRootZdcHits& zdc) {
|
---|
246 | if(this==&zdc) return *this;
|
---|
247 | E = zdc.E; T = zdc.T; side = zdc.side; hadronic_hit = zdc.hadronic_hit;
|
---|
248 | return *this;
|
---|
249 | }
|
---|
250 |
|
---|
251 |
|
---|
252 | void TRootGenParticle:: print(){
|
---|
253 | cout << "pid = " << PID << "\tM=" << M << "\tQ= " << Charge << "\tStatus = " << Status << "\t E= " << E << endl;
|
---|
254 | // cout << "T = " << T << "\t X = " << X << "\t Y = " << Y << "\t Z = " << Z << endl;
|
---|
255 | }
|
---|
256 |
|
---|