[268] | 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 | ***********************************************************************/
|
---|
[3] | 31 |
|
---|
[220] | 32 | #include "BlockClasses.h"
|
---|
| 33 | #include "BlockCompare.h"
|
---|
[73] | 34 | #include "TLorentzVector.h"
|
---|
[264] | 35 | #include <cmath>
|
---|
[73] | 36 |
|
---|
[3] | 37 | TCompare *TRootGenParticle::fgCompare = 0;
|
---|
[270] | 38 | TCompare *GenParticle::fgCompare = 0;
|
---|
[3] | 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();
|
---|
[267] | 43 | TCompare *TRootJet::fgCompare = TComparePT<TRootJet>::Instance();
|
---|
[268] | 44 | TCompare *TRootTracks::fgCompare = 0;
|
---|
[3] | 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;
|
---|
[67] | 52 | TCompare *TRootTrigger::fgCompare =0;
|
---|
[3] | 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 | }
|
---|
[85] | 63 |
|
---|
[267] | 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 |
|
---|
[176] | 76 | void TRootParticle::Set(const float px, const float py, const float pz, const float e) {
|
---|
[73] | 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 | }
|
---|
[3] | 87 |
|
---|
[264] | 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 | }
|
---|
[73] | 94 |
|
---|
[270] | 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 | }
|
---|
[264] | 107 |
|
---|
[270] | 108 |
|
---|
[264] | 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 |
|
---|
[268] | 132 | TRootTracks::TRootTracks() :
|
---|
[278] | 133 | TRootParticle(),
|
---|
| 134 | EtaOuter(UNDEFINED), PhiOuter(UNDEFINED) {}
|
---|
| 135 | /* Eta = UNDEFINED;
|
---|
| 136 | Phi = UNDEFINED;
|
---|
| 137 | PT = UNDEFINED;
|
---|
| 138 | E = UNDEFINED;
|
---|
| 139 | Px = UNDEFINED;
|
---|
| 140 | Py = UNDEFINED;
|
---|
| 141 | Pz = UNDEFINED;
|
---|
[264] | 142 |
|
---|
[278] | 143 | }*/
|
---|
| 144 |
|
---|
[268] | 145 | TRootTracks::TRootTracks(const float inEta, const float inPhi, const float outEta, const float outPhi, const float pt) :
|
---|
[278] | 146 | EtaOuter(outEta), PhiOuter(outPhi) {
|
---|
| 147 | Eta = inEta;
|
---|
| 148 | Phi = inPhi;
|
---|
| 149 | PT = pt;
|
---|
[264] | 150 | TLorentzVector p; p.SetPtEtaPhiE(PT,Eta,Phi,PT*cosh(Eta));
|
---|
| 151 | Px = p.Px(); Py = p.Py(); Pz = p.Pz(); E=p.E();
|
---|
| 152 | }
|
---|
[268] | 153 | TRootTracks::TRootTracks(const TRootTracks& track) :
|
---|
[278] | 154 | EtaOuter(track.EtaOuter), PhiOuter(track.PhiOuter)
|
---|
| 155 | {
|
---|
| 156 | Eta = track.Eta;
|
---|
| 157 | Phi = track.Phi;
|
---|
| 158 | PT = track.PT;
|
---|
| 159 | E = track.E;
|
---|
| 160 | Px = track.Px;
|
---|
| 161 | Py = track.Py;
|
---|
| 162 | Pz = track.Pz;
|
---|
| 163 | }
|
---|
[264] | 164 |
|
---|
[268] | 165 | TRootTracks& TRootTracks::operator=(const TRootTracks& track) {
|
---|
[264] | 166 | if(this == &track) return *this;
|
---|
| 167 | Eta = track.Eta; Phi = track.Phi;
|
---|
| 168 | EtaOuter = track.EtaOuter; PhiOuter = track.PhiOuter;
|
---|
| 169 | PT = track.PT; E = track.E; Px = track.Px; Py= track.Py; Pz =track.Pz;
|
---|
| 170 | return *this;
|
---|
| 171 | }
|
---|
| 172 |
|
---|
[268] | 173 | void TRootTracks::Set(const float inEta, const float inPhi, const float outEta, const float outPhi, const float pt) {
|
---|
[264] | 174 | Eta= inEta; Phi=inPhi; EtaOuter=outEta; PhiOuter=outPhi; PT=pt;
|
---|
| 175 | TLorentzVector p; p.SetPtEtaPhiE(PT,Eta,Phi,PT*cosh(Eta));
|
---|
| 176 | Px = p.Px(); Py = p.Py(); Pz = p.Pz(); E=p.E();
|
---|
| 177 | }
|
---|
| 178 |
|
---|
[268] | 179 | const TLorentzVector TRootTracks::GetFourVector() const {
|
---|
[264] | 180 | TLorentzVector v;
|
---|
| 181 | v.SetPtEtaPhiE(PT,Eta,Phi,PT*cosh(Eta));
|
---|
| 182 | return TLorentzVector(v);
|
---|
| 183 | }
|
---|
| 184 |
|
---|
| 185 | TRootCalo::TRootCalo() :
|
---|
| 186 | E_em(UNDEFINED), E_had(UNDEFINED), ET(UNDEFINED) {}
|
---|
| 187 | //Eta(UNDEFINED), Phi(UNDEFINED), E_em(UNDEFINED), E_had(UNDEFINED), E(UNDEFINED), ET(UNDEFINED) {}
|
---|
| 188 |
|
---|
| 189 | TRootCalo::TRootCalo(const TRootCalo& cal) {
|
---|
| 190 | E_em=cal.E_em; E_had=cal.E_had; ET=cal.ET;
|
---|
| 191 | //Eta =cal.Eta; Phi=cal.Phi; E_em=cal.E_em; E_had=cal.E_had; E=cal.E; ET=cal.ET;
|
---|
| 192 | }
|
---|
| 193 |
|
---|
| 194 | TRootCalo& TRootCalo::operator=(const TRootCalo& cal) {
|
---|
| 195 | if(this==&cal) return *this;
|
---|
| 196 | Eta =cal.Eta; Phi=cal.Phi; E_em=cal.E_em; E_had=cal.E_had; E=cal.E; ET=cal.ET;
|
---|
| 197 | return *this;
|
---|
| 198 | }
|
---|
| 199 |
|
---|
| 200 | void TRootCalo::set(const D_CaloTower& cal) {
|
---|
| 201 | Eta =cal.getEta(); Phi=cal.getPhi();
|
---|
| 202 | E_em=cal.getEem(); E_had=cal.getEhad();
|
---|
| 203 | E =cal.getE(); ET =cal.getET();
|
---|
| 204 | }
|
---|