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 *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 | namespace TRootC {
|
---|
96 | GenParticle::GenParticle(const TRootGenParticle& p) :
|
---|
97 | PID(p.PID), Status(p.Status), M1(p.M1), M2(p.M2), D1(p.D1), D2(p.D2), Charge(p.Charge),
|
---|
98 | T(p.T), X(p.X), Y(p.Y), Z(p.Z), M(p.M) {
|
---|
99 | }
|
---|
100 | }
|
---|
101 |
|
---|
102 | TRootGenParticle::TRootGenParticle(TRootC::GenParticle* part) :
|
---|
103 | PID(part->PID),Status(part->Status),M1(part->M1),M2(part->M2),D1(part->D1),D2(part->D2),
|
---|
104 | T(part->T),X(part->X),Y(part->Y),Z(part->Z),M(part->M){
|
---|
105 | E=part->E;
|
---|
106 | Px=part->Px;
|
---|
107 | Py=part->Py;
|
---|
108 | Pz=part->Pz;
|
---|
109 | Eta=part->Eta;
|
---|
110 | Phi=part->Phi;
|
---|
111 | PT=part->PT;
|
---|
112 | _initialised=false;
|
---|
113 | }
|
---|
114 |
|
---|
115 |
|
---|
116 | void TRootGenParticle::setFractions() {
|
---|
117 | switch(abs(PID)) {
|
---|
118 | default: _Fem = 0; _Fhad=1; break;
|
---|
119 | case(pE):
|
---|
120 | case(pGAMMA):
|
---|
121 | case(pPI0):
|
---|
122 | _Fem = 1; _Fhad=0; break;
|
---|
123 | case(pNU1):
|
---|
124 | case(pNU2):
|
---|
125 | case(pNU3):
|
---|
126 | case(pMU):
|
---|
127 | _Fem =0; _Fhad=0; break;
|
---|
128 | case(pK0S):
|
---|
129 | case(pLAMBDA):
|
---|
130 | _Fem=0.3; _Fhad=0.7; break;
|
---|
131 | }
|
---|
132 | _initialised=true;
|
---|
133 | }
|
---|
134 |
|
---|
135 | /* float Eta, Phi; // (eta,phi) at the beginning of the track
|
---|
136 | float EtaOuter, PhiOuter; // (eta,phi) at the end of the track
|
---|
137 | float PT, E, Px, Py, Pz; */
|
---|
138 |
|
---|
139 | TRootTracks::TRootTracks() :
|
---|
140 | Eta(UNDEFINED), Phi(UNDEFINED), EtaOuter(UNDEFINED), PhiOuter(UNDEFINED),
|
---|
141 | PT(UNDEFINED), E(UNDEFINED), Px(UNDEFINED), Py(UNDEFINED), Pz(UNDEFINED),
|
---|
142 | Charge(UNDEFINED) {}
|
---|
143 |
|
---|
144 | TRootTracks::TRootTracks(const float inEta, const float inPhi, const float outEta, const float outPhi, const float pt) :
|
---|
145 | Eta(inEta), Phi(inPhi), EtaOuter(outEta), PhiOuter(outPhi),
|
---|
146 | PT(pt) {
|
---|
147 | TLorentzVector p; p.SetPtEtaPhiE(PT,Eta,Phi,PT*cosh(Eta));
|
---|
148 | Px = p.Px(); Py = p.Py(); Pz = p.Pz(); E=p.E();
|
---|
149 | Charge = UNDEFINED;
|
---|
150 | }
|
---|
151 | TRootTracks::TRootTracks(const TRootTracks& track) :
|
---|
152 | Eta(track.Eta), Phi(track.Phi),
|
---|
153 | EtaOuter(track.EtaOuter), PhiOuter(track.PhiOuter),
|
---|
154 | PT(track.PT), E(track.E), Px(track.Px), Py(track.Py), Pz(track.Pz), Charge(track.Charge) {}
|
---|
155 |
|
---|
156 | TRootTracks& TRootTracks::operator=(const TRootTracks& track) {
|
---|
157 | if(this == &track) return *this;
|
---|
158 | Eta = track.Eta; Phi = track.Phi;
|
---|
159 | EtaOuter = track.EtaOuter; PhiOuter = track.PhiOuter;
|
---|
160 | PT = track.PT; E = track.E; Px = track.Px; Py= track.Py; Pz =track.Pz;
|
---|
161 | Charge = track.Charge;
|
---|
162 | return *this;
|
---|
163 | }
|
---|
164 |
|
---|
165 | void TRootTracks::Set(const float inEta, const float inPhi, const float outEta, const float outPhi, const float pt, const float charge) {
|
---|
166 | Eta= inEta; Phi=inPhi; EtaOuter=outEta; PhiOuter=outPhi; PT=pt;
|
---|
167 | TLorentzVector p; p.SetPtEtaPhiE(PT,Eta,Phi,PT*cosh(Eta));
|
---|
168 | Px = p.Px(); Py = p.Py(); Pz = p.Pz(); E=p.E();
|
---|
169 | Charge = charge;
|
---|
170 | }
|
---|
171 |
|
---|
172 | const TLorentzVector TRootTracks::GetFourVector() const {
|
---|
173 | TLorentzVector v;
|
---|
174 | v.SetPtEtaPhiE(PT,Eta,Phi,PT*cosh(Eta));
|
---|
175 | return TLorentzVector(v);
|
---|
176 | }
|
---|
177 |
|
---|
178 | TRootCalo::TRootCalo() :
|
---|
179 | E_em(UNDEFINED), E_had(UNDEFINED), ET(UNDEFINED) {}
|
---|
180 | //Eta(UNDEFINED), Phi(UNDEFINED), E_em(UNDEFINED), E_had(UNDEFINED), E(UNDEFINED), ET(UNDEFINED) {}
|
---|
181 |
|
---|
182 | TRootCalo::TRootCalo(const TRootCalo& cal) {
|
---|
183 | E_em=cal.E_em; E_had=cal.E_had; ET=cal.ET;
|
---|
184 | //Eta =cal.Eta; Phi=cal.Phi; E_em=cal.E_em; E_had=cal.E_had; E=cal.E; ET=cal.ET;
|
---|
185 | }
|
---|
186 |
|
---|
187 | TRootCalo& TRootCalo::operator=(const TRootCalo& cal) {
|
---|
188 | if(this==&cal) return *this;
|
---|
189 | Eta =cal.Eta; Phi=cal.Phi; E_em=cal.E_em; E_had=cal.E_had; E=cal.E; ET=cal.ET;
|
---|
190 | return *this;
|
---|
191 | }
|
---|
192 |
|
---|
193 | void TRootCalo::set(const D_CaloTower& cal) {
|
---|
194 | Eta =cal.getEta(); Phi=cal.getPhi();
|
---|
195 | E_em=cal.getEem(); E_had=cal.getEhad();
|
---|
196 | E =cal.getE(); ET =cal.getET();
|
---|
197 | }
|
---|