Fork me on GitHub

source: svn/trunk/Utilities/ExRootAnalysis/src/BlockClasses.cc@ 268

Last change on this file since 268 was 268, checked in by severine ovyn, 16 years ago

nettoyage

File size: 6.7 KB
Line 
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
37TCompare *TRootGenParticle::fgCompare = 0;
38TCompare *TRootElectron::fgCompare = TComparePT<TRootElectron>::Instance();
39TCompare *TRootMuon::fgCompare = TComparePT<TRootMuon>::Instance();
40TCompare *TRootPhoton::fgCompare = TComparePT<TRootPhoton>::Instance();
41TCompare *TRootTauJet::fgCompare = TComparePT<TRootTauJet>::Instance();
42TCompare *TRootJet::fgCompare = TComparePT<TRootJet>::Instance();
43TCompare *TRootTracks::fgCompare = 0;
44TCompare *TRootETmis::fgCompare = 0;
45TCompare *TRootCalo::fgCompare = 0;
46TCompare *TRootZdcHits::fgCompare = 0;
47TCompare *TRootGenEvent:: fgCompare = 0;
48TCompare *TRootParticle::fgCompare=0;
49TCompare *TRootLHEFParticle::fgCompare = 0;
50TCompare *TRootRomanPotHits::fgCompare =0;
51TCompare *TRootTrigger::fgCompare =0;
52
53void TRootParticle::Set(const TLorentzVector& momentum) {
54 E = momentum.E();
55 Px = momentum.Px();
56 Py = momentum.Py();
57 Pz = momentum.Pz();
58 PT = momentum.Pt();
59 Eta = momentum.Eta();
60 Phi = momentum.Phi();
61}
62
63void TRootTauJet::Set(const TLorentzVector& momentum) {
64
65 E = momentum.E();
66 Px = momentum.Px();
67 Py = momentum.Py();
68 Pz = momentum.Pz();
69 PT = momentum.Pt();
70 Eta = momentum.Eta();
71 Phi = momentum.Phi();
72
73}
74
75void TRootParticle::Set(const float px, const float py, const float pz, const float e) {
76 TLorentzVector toFill;
77 toFill.SetPxPyPzE(px,py,pz,e);
78 E = e;
79 Px = px;
80 Py = py;
81 Pz = pz;
82 PT = toFill.Pt();
83 Eta = toFill.Eta();
84 Phi = toFill.Phi();
85}
86
87void TRootParticle::SetEtaPhiEET(const float eta, const float phi, const float e, const float et) {
88 Eta = eta; Phi = phi; E = e; PT = et;
89 //float theta = 2* atan(exp(-Eta);
90 Px = PT*cos(Phi);
91 Py = PT*sin(Phi);
92}
93
94
95void TRootGenParticle::setFractions() {
96 switch(abs(PID)) {
97 default: _Fem = 0; _Fhad=1; break;
98 case(pE):
99 case(pGAMMA):
100 case(pPI0):
101 _Fem = 1; _Fhad=0; break;
102 case(pNU1):
103 case(pNU2):
104 case(pNU3):
105 case(pMU):
106 _Fem =0; _Fhad=0; break;
107 case(pK0S):
108 case(pLAMBDA):
109 _Fem=0.3; _Fhad=0.7; break;
110 }
111 _initialised=true;
112}
113
114 float Eta, Phi; // (eta,phi) at the beginning of the track
115 float EtaOuter, PhiOuter; // (eta,phi) at the end of the track
116 float PT, E, Px, Py, Pz;
117
118TRootTracks::TRootTracks() :
119 Eta(UNDEFINED), Phi(UNDEFINED), EtaOuter(UNDEFINED), PhiOuter(UNDEFINED),
120 PT(UNDEFINED), E(UNDEFINED), Px(UNDEFINED), Py(UNDEFINED), Pz(UNDEFINED) {}
121
122TRootTracks::TRootTracks(const float inEta, const float inPhi, const float outEta, const float outPhi, const float pt) :
123 Eta(inEta), Phi(inPhi), EtaOuter(outEta), PhiOuter(outPhi),
124 PT(pt) {
125 TLorentzVector p; p.SetPtEtaPhiE(PT,Eta,Phi,PT*cosh(Eta));
126 Px = p.Px(); Py = p.Py(); Pz = p.Pz(); E=p.E();
127}
128TRootTracks::TRootTracks(const TRootTracks& track) :
129 Eta(track.Eta), Phi(track.Phi),
130 EtaOuter(track.EtaOuter), PhiOuter(track.PhiOuter),
131 PT(track.PT), E(track.E), Px(track.Px), Py(track.Py), Pz(track.Pz) {}
132
133TRootTracks& TRootTracks::operator=(const TRootTracks& track) {
134 if(this == &track) return *this;
135 Eta = track.Eta; Phi = track.Phi;
136 EtaOuter = track.EtaOuter; PhiOuter = track.PhiOuter;
137 PT = track.PT; E = track.E; Px = track.Px; Py= track.Py; Pz =track.Pz;
138 return *this;
139}
140
141void TRootTracks::Set(const float inEta, const float inPhi, const float outEta, const float outPhi, const float pt) {
142 Eta= inEta; Phi=inPhi; EtaOuter=outEta; PhiOuter=outPhi; PT=pt;
143 TLorentzVector p; p.SetPtEtaPhiE(PT,Eta,Phi,PT*cosh(Eta));
144 Px = p.Px(); Py = p.Py(); Pz = p.Pz(); E=p.E();
145}
146
147const TLorentzVector TRootTracks::GetFourVector() const {
148 TLorentzVector v;
149 v.SetPtEtaPhiE(PT,Eta,Phi,PT*cosh(Eta));
150 return TLorentzVector(v);
151}
152
153TRootCalo::TRootCalo() :
154 E_em(UNDEFINED), E_had(UNDEFINED), ET(UNDEFINED) {}
155 //Eta(UNDEFINED), Phi(UNDEFINED), E_em(UNDEFINED), E_had(UNDEFINED), E(UNDEFINED), ET(UNDEFINED) {}
156
157TRootCalo::TRootCalo(const TRootCalo& cal) {
158 E_em=cal.E_em; E_had=cal.E_had; ET=cal.ET;
159 //Eta =cal.Eta; Phi=cal.Phi; E_em=cal.E_em; E_had=cal.E_had; E=cal.E; ET=cal.ET;
160}
161
162TRootCalo& TRootCalo::operator=(const TRootCalo& cal) {
163 if(this==&cal) return *this;
164 Eta =cal.Eta; Phi=cal.Phi; E_em=cal.E_em; E_had=cal.E_had; E=cal.E; ET=cal.ET;
165 return *this;
166}
167
168void TRootCalo::set(const D_CaloTower& cal) {
169 Eta =cal.getEta(); Phi=cal.getPhi();
170 E_em=cal.getEem(); E_had=cal.getEhad();
171 E =cal.getE(); ET =cal.getET();
172}
Note: See TracBrowser for help on using the repository browser.