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 *TRootC::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 *TRootForwardTaggerHits::fgCompare =0;
|
---|
53 | TCompare *TRootTrigger::fgCompare =0;
|
---|
54 |
|
---|
55 | void TRootParticle::Set(const TLorentzVector& momentum) {
|
---|
56 | E = momentum.E();
|
---|
57 | Px = momentum.Px();
|
---|
58 | Py = momentum.Py();
|
---|
59 | Pz = momentum.Pz();
|
---|
60 | PT = momentum.Pt();
|
---|
61 | Eta = momentum.Eta();
|
---|
62 | Phi = momentum.Phi();
|
---|
63 | }
|
---|
64 |
|
---|
65 | void TRootTauJet::Set(const TLorentzVector& momentum) {
|
---|
66 |
|
---|
67 | E = momentum.E();
|
---|
68 | Px = momentum.Px();
|
---|
69 | Py = momentum.Py();
|
---|
70 | Pz = momentum.Pz();
|
---|
71 | PT = momentum.Pt();
|
---|
72 | Eta = momentum.Eta();
|
---|
73 | Phi = momentum.Phi();
|
---|
74 |
|
---|
75 | }
|
---|
76 |
|
---|
77 | void TRootParticle::Set(const float px, const float py, const float pz, const float e) {
|
---|
78 | TLorentzVector toFill;
|
---|
79 | toFill.SetPxPyPzE(px,py,pz,e);
|
---|
80 | E = e;
|
---|
81 | Px = px;
|
---|
82 | Py = py;
|
---|
83 | Pz = pz;
|
---|
84 | PT = toFill.Pt();
|
---|
85 | Eta = toFill.Eta();
|
---|
86 | Phi = toFill.Phi();
|
---|
87 | }
|
---|
88 |
|
---|
89 | void TRootParticle::SetEtaPhiEET(const float eta, const float phi, const float e, const float et) {
|
---|
90 | Eta = eta; Phi = phi; E = e; PT = et;
|
---|
91 | //float theta = 2* atan(exp(-Eta);
|
---|
92 | Px = PT*cos(Phi);
|
---|
93 | Py = PT*sin(Phi);
|
---|
94 | }
|
---|
95 |
|
---|
96 | namespace TRootC {
|
---|
97 | GenParticle::GenParticle(const TRootGenParticle& p) :
|
---|
98 | PID(p.PID), Status(p.Status), M1(p.M1), M2(p.M2), D1(p.D1), D2(p.D2), Charge(p.Charge),
|
---|
99 | T(p.T), X(p.X), Y(p.Y), Z(p.Z), M(p.M) {
|
---|
100 | }
|
---|
101 | }
|
---|
102 |
|
---|
103 | TRootGenParticle::TRootGenParticle(TRootC::GenParticle* part) :
|
---|
104 | PID(part->PID),Status(part->Status),M1(part->M1),M2(part->M2),D1(part->D1),D2(part->D2),
|
---|
105 | T(part->T),X(part->X),Y(part->Y),Z(part->Z),M(part->M){
|
---|
106 | E=part->E;
|
---|
107 | Px=part->Px;
|
---|
108 | Py=part->Py;
|
---|
109 | Pz=part->Pz;
|
---|
110 | Eta=part->Eta;
|
---|
111 | Phi=part->Phi;
|
---|
112 | PT=part->PT;
|
---|
113 | _initialised=false;
|
---|
114 | }
|
---|
115 |
|
---|
116 |
|
---|
117 | void TRootGenParticle::setFractions() {
|
---|
118 | switch(abs(PID)) {
|
---|
119 | default: _Fem = 0; _Fhad=1; break;
|
---|
120 | case(pE):
|
---|
121 | case(pGAMMA):
|
---|
122 | case(pPI0):
|
---|
123 | _Fem = 1; _Fhad=0; break;
|
---|
124 | case(pNU1):
|
---|
125 | case(pNU2):
|
---|
126 | case(pNU3):
|
---|
127 | case(pMU):
|
---|
128 | _Fem =0; _Fhad=0; break;
|
---|
129 | case(pK0S):
|
---|
130 | case(pLAMBDA):
|
---|
131 | _Fem=0.3; _Fhad=0.7; break;
|
---|
132 | }
|
---|
133 | _initialised=true;
|
---|
134 | }
|
---|
135 |
|
---|
136 | /* float Eta, Phi; // (eta,phi) at the beginning of the track
|
---|
137 | float EtaOuter, PhiOuter; // (eta,phi) at the end of the track
|
---|
138 | float PT, E, Px, Py, Pz; */
|
---|
139 |
|
---|
140 | TRootTracks::TRootTracks() :
|
---|
141 | Eta(UNDEFINED), Phi(UNDEFINED), EtaOuter(UNDEFINED), PhiOuter(UNDEFINED),
|
---|
142 | PT(UNDEFINED), E(UNDEFINED), Px(UNDEFINED), Py(UNDEFINED), Pz(UNDEFINED),
|
---|
143 | Charge(UNDEFINED) {}
|
---|
144 |
|
---|
145 | TRootTracks::TRootTracks(const float inEta, const float inPhi, const float outEta, const float outPhi, const float pt) :
|
---|
146 | Eta(inEta), Phi(inPhi), EtaOuter(outEta), PhiOuter(outPhi),
|
---|
147 | PT(pt) {
|
---|
148 | TLorentzVector p; p.SetPtEtaPhiE(PT,Eta,Phi,PT*cosh(Eta));
|
---|
149 | Px = p.Px(); Py = p.Py(); Pz = p.Pz(); E=p.E();
|
---|
150 | Charge = UNDEFINED;
|
---|
151 | }
|
---|
152 | TRootTracks::TRootTracks(const TRootTracks& track) :
|
---|
153 | Eta(track.Eta), Phi(track.Phi),
|
---|
154 | EtaOuter(track.EtaOuter), PhiOuter(track.PhiOuter),
|
---|
155 | PT(track.PT), E(track.E), Px(track.Px), Py(track.Py), Pz(track.Pz), Charge(track.Charge) {}
|
---|
156 |
|
---|
157 | TRootTracks& TRootTracks::operator=(const TRootTracks& track) {
|
---|
158 | if(this == &track) return *this;
|
---|
159 | Eta = track.Eta; Phi = track.Phi;
|
---|
160 | EtaOuter = track.EtaOuter; PhiOuter = track.PhiOuter;
|
---|
161 | PT = track.PT; E = track.E; Px = track.Px; Py= track.Py; Pz =track.Pz;
|
---|
162 | Charge = track.Charge;
|
---|
163 | return *this;
|
---|
164 | }
|
---|
165 |
|
---|
166 | void TRootTracks::Set(const float inEta, const float inPhi, const float outEta, const float outPhi, const float pt, const float charge) {
|
---|
167 | Eta= inEta; Phi=inPhi; EtaOuter=outEta; PhiOuter=outPhi; PT=pt;
|
---|
168 | TLorentzVector p; p.SetPtEtaPhiE(PT,Eta,Phi,PT*cosh(Eta));
|
---|
169 | Px = p.Px(); Py = p.Py(); Pz = p.Pz(); E=p.E();
|
---|
170 | Charge = charge;
|
---|
171 | }
|
---|
172 |
|
---|
173 | const TLorentzVector TRootTracks::GetFourVector() const {
|
---|
174 | TLorentzVector v;
|
---|
175 | v.SetPtEtaPhiE(PT,Eta,Phi,PT*cosh(Eta));
|
---|
176 | return TLorentzVector(v);
|
---|
177 | }
|
---|
178 |
|
---|
179 | TRootCalo::TRootCalo() :
|
---|
180 | E_em(UNDEFINED), E_had(UNDEFINED), ET(UNDEFINED) {}
|
---|
181 | //Eta(UNDEFINED), Phi(UNDEFINED), E_em(UNDEFINED), E_had(UNDEFINED), E(UNDEFINED), ET(UNDEFINED) {}
|
---|
182 |
|
---|
183 | TRootCalo::TRootCalo(const TRootCalo& cal) {
|
---|
184 | E_em=cal.E_em; E_had=cal.E_had; ET=cal.ET;
|
---|
185 | //Eta =cal.Eta; Phi=cal.Phi; E_em=cal.E_em; E_had=cal.E_had; E=cal.E; ET=cal.ET;
|
---|
186 | }
|
---|
187 |
|
---|
188 | TRootCalo& TRootCalo::operator=(const TRootCalo& cal) {
|
---|
189 | if(this==&cal) return *this;
|
---|
190 | Eta =cal.Eta; Phi=cal.Phi; E_em=cal.E_em; E_had=cal.E_had; E=cal.E; ET=cal.ET;
|
---|
191 | return *this;
|
---|
192 | }
|
---|
193 |
|
---|
194 | void TRootCalo::set(const D_CaloTower& cal) {
|
---|
195 | Eta =cal.getEta(); Phi=cal.getPhi();
|
---|
196 | E_em=cal.getEem(); E_had=cal.getEhad();
|
---|
197 | E =cal.getE(); ET =cal.getET();
|
---|
198 | }
|
---|
199 |
|
---|
200 | TRootZdcHits::TRootZdcHits(const float e, const float t, const int side, const bool had) : E(e), T(t), side(side), hadronic_hit(had) {}
|
---|
201 | TRootZdcHits::TRootZdcHits(const TRootZdcHits& zdc) : E(zdc.E), T(zdc.T), side(zdc.side), hadronic_hit(zdc.hadronic_hit) {}
|
---|
202 | TRootZdcHits& TRootZdcHits::operator=(const TRootZdcHits& zdc) {
|
---|
203 | if(this==&zdc) return *this;
|
---|
204 | E = zdc.E; T = zdc.T; side = zdc.side; hadronic_hit = zdc.hadronic_hit;
|
---|
205 | return *this;
|
---|
206 | }
|
---|
207 |
|
---|
208 | void TRootGenParticle:: print(){
|
---|
209 | cout << "pid = " << PID << "\tM=" << M << "\tQ= " << Charge << "\tStatus = " << Status << "\t E= " << E << endl;
|
---|
210 | // cout << "T = " << T << "\t X = " << X << "\t Y = " << Y << "\t Z = " << Z << endl;
|
---|
211 | }
|
---|
212 |
|
---|