Fork me on GitHub

source: svn/trunk/Utilities/ExRootAnalysis/interface/BlockClasses.h@ 265

Last change on this file since 265 was 264, checked in by Xavier Rouby, 16 years ago

first test 2.0

File size: 13.0 KB
Line 
1#ifndef BLOCKCLASSES_H
2#define BLOCKCLASSES_H
3
4/** \class BlockClasses
5 *
6 * Definition of classes to be stored in root tree.
7 * You can decide to have the objects in each event to be sorted according
8 * to one of the data member of the class. If you decide so then a class
9 * inheriting from class TCompare should be implemented.
10 * There are already several functions TCompare*** implemented
11 * (see BlockCompare.h).
12 * Function TCompareXX sorts objects by the variable "XX" that MUST be
13 * present in the data members of the Block TRoot class.
14 *
15 * $Date: 2009-02-11 09:19:14 $
16 * $Revision: 1.12 $
17 *
18 *
19 * \author P. Demin - UCL, Louvain-la-Neuve
20 *
21 */
22
23#include "TLorentzVector.h"
24#include "TObject.h"
25#include "BlockCompare.h"
26#include "interface/D_Constants.h"
27#include "interface/CaloUtil.h"
28
29class TSortableObject: public TObject
30{
31public:
32 TSortableObject() {};
33 Bool_t IsSortable() const { return GetCompare() ? GetCompare()->IsSortable(this) : kFALSE; }
34 Int_t Compare(const TObject *obj) const { return GetCompare()->Compare(this, obj); }
35
36 virtual const TCompare *GetCompare() const = 0;
37
38 ClassDef(TSortableObject, 1)
39};
40
41//---------------------------------------------------------------------------
42//
43class TRootLHEFEvent: public TObject
44{
45public:
46 TRootLHEFEvent() {};
47
48 Long64_t Number; // event number
49
50 int Nparticles; // number of particles in the event | hepup.NUP
51 int ProcessID; // subprocess code for the event | hepup.IDPRUP
52
53 Double_t Weight; // weight for the event | hepup.XWGTUP
54 Double_t ScalePDF; // scale in GeV used in the calculation of the PDFs in the event | hepup.SCALUP
55 Double_t CouplingQED; // value of the QED coupling used in the event | hepup.AQEDUP
56 Double_t CouplingQCD; // value of the QCD coupling used in the event | hepup.AQCDUP
57
58 ClassDef(TRootLHEFEvent, 2)
59};
60
61//---------------------------------------------------------------------------
62
63class TRootLHEFParticle: public TSortableObject
64{
65public:
66 TRootLHEFParticle() {};
67 int PID; // particle HEP ID number | hepup.IDUP[number]
68 int Status; // particle status code | hepup.ISTUP[number]
69 int Mother1; // index for the particle first mother | hepup.MOTHUP[number][0]
70 int Mother2; // index for the particle last mother | hepup.MOTHUP[number][1]
71 int ColorLine1; // index for the particle color-line | hepup.ICOLUP[number][0]
72 int ColorLine2; // index for the particle anti-color-line | hepup.ICOLUP[number][1]
73
74 double Px; // particle momentum vector (x component) | hepup.PUP[number][0]
75 double Py; // particle momentum vector (y component) | hepup.PUP[number][1]
76 double Pz; // particle momentum vector (z component) | hepup.PUP[number][2]
77 double E; // particle energy | hepup.PUP[number][3]
78 double M; // particle mass | hepup.PUP[number][4]
79
80 double PT; // particle transverse momentum
81 double Eta; // particle pseudorapidity
82 double Phi; // particle azimuthal angle
83
84 double Rapidity; // particle rapidity
85
86 double LifeTime; // particle invariant lifetime
87 // (c*tau, distance from production to decay in mm)
88 // | hepup.VTIMUP[number]
89
90 double Spin; // cosine of the angle between the particle spin vector
91 // and the decaying particle 3-momentum,
92 // specified in the lab frame. | hepup.SPINUP[number]
93
94 static TCompare *fgCompare; //!
95 const TCompare *GetCompare() const { return fgCompare; }
96 ClassDef(TRootLHEFParticle, 2)
97
98};
99
100//---------------------------------------------------------------------------
101
102class TRootSelectorInfo: public TObject
103{
104public:
105 TRootSelectorInfo() {};
106 int Processed; // current number of processed events
107 int Accepted; // current number of accepted events
108
109 ClassDef(TRootSelectorInfo, 1)
110};
111
112
113class TRootGenEvent: public TObject
114{
115public:
116 TRootGenEvent() {};
117 Long64_t Number; // event number | hepevt.nevhep
118
119 static TCompare *fgCompare; //!
120 const TCompare *GetCompare() const { return fgCompare; }
121
122 ClassDef(TRootGenEvent, 1)
123};
124
125
126class TRootEvent: public TObject {
127
128public:
129 TRootEvent() {};
130 int Run; // run number [G3EventProxy::simSignal().id().runNumber()]
131 int Event; // event number [G3EventProxy::simSignal().id().eventInRun()]
132
133// Short_t L1Decision; // L1 trigger global decision [L1Trigger::decision()]
134// Short_t HLTDecision; // HLT trigger global decision [HighLevelTriggerResult::getGlobalDecision()]
135
136 ClassDef(TRootEvent, 1)
137};
138
139//---------------------------------------------------------------------------
140
141class TRootParticle: public TSortableObject {
142
143public:
144
145 TRootParticle() {};
146 float E; // particle energy in GeV
147 float Px; // particle momentum vector (x component) in GeV
148 float Py; // particle momentum vector (y component) in GeV
149 float Pz; // particle momentum vector (z component) in GeV
150
151 float Eta; // particle pseudorapidity
152 float Phi; // particle azimuthal angle in rad
153
154 float EtaCalo; // particle pseudorapidity when entering the calo,
155 float PhiCalo; // particle azimuthal angle in rad when entering the calo
156
157 void Set(const TLorentzVector& momentum);
158 void Set(const float px, const float py, const float pz, const float e);
159 void SetEtaPhi(const float eta, const float phi) {Eta=eta; Phi=phi;};
160 void SetEtaPhiCalo(const float eta, const float phi) {EtaCalo=eta; PhiCalo=phi;};
161 void SetEtaPhiEET(const float eta, const float phi, const float e, const float et);
162 static TCompare *fgCompare; //!
163 const TCompare *GetCompare() const { return fgCompare; }
164 //void SetEem_Ehad(const float sE_em, const float sE_had) {} ; // sets E_em and E_had, computes E and ET
165 float PT; // particle transverse momentum in GeV
166 //const float getEtaGen() const {return _EtaGen;}
167 //const float getPhiGen() const {return _PhiGen;}
168
169
170//protected:
171 //float EGen, _EtaGen, _PhiGen; // from the generator: energy, eta, phi
172
173 ClassDef(TRootParticle, 1)
174};
175
176
177//---------------------------------------------------------------------------
178
179class TRootGenParticle: public TRootParticle {
180
181public:
182 TRootGenParticle() {_initialised=false;}
183 int PID; // particle HEP ID number [RawHepEventParticle::pid()]
184 int Status; // particle status [RawHepEventParticle::status()]
185 int M1; // particle 1st mother [RawHepEventParticle::mother1() - 1]
186 int M2; // particle 2nd mother [RawHepEventParticle::mother2() - 1]
187 int D1; // particle 1st daughter [RawHepEventParticle::daughter1() - 1]
188 int D2; // particle 2nd daughter [RawHepEventParticle::daughter2() - 1]
189
190 float T; // particle vertex position (t component) [RawHepEventParticle::t()]
191 float X; // particle vertex position (x component) [RawHepEventParticle::x()]
192 float Y; // particle vertex position (y component) [RawHepEventParticle::y()]
193 float Z; // particle vertex position (z component) [RawHepEventParticle::z()]
194 float M;
195 void setFractions();
196 const float getCharge() const {return Charge;};
197 const float getFem() {if(!_initialised) setFractions(); return _Fem;}
198 const float getFhad() {if(!_initialised) setFractions(); return _Fhad;}
199
200 float Charge; // electrical charge
201
202 static TCompare *fgCompare; //!
203 protected:
204 float _Fem, _Fhad; // fractions of energy deposit
205 bool _initialised;
206 ClassDef(TRootGenParticle, 1)
207};
208
209
210//------------------------------------------------------------------------------
211
212class TRootElectron: public TRootParticle
213{
214public:
215 TRootElectron() {};
216 int Charge; // particle Charge [RawHepEventParticle::pid()]
217 static TCompare *fgCompare; //!
218
219 bool IsolFlag;
220
221 ClassDef(TRootElectron, 1)
222};
223
224//------------------------------------------------------------------------------
225
226class TRootPhoton: public TRootParticle
227{
228public:
229 TRootPhoton() {};
230 static TCompare *fgCompare; //!
231
232 ClassDef(TRootPhoton, 1)
233};
234
235
236//------------------------------------------------------------------------------
237
238class TRootMuon: public TRootParticle
239{
240public:
241 TRootMuon() {};
242 int Charge; // particle Charge [RawHepEventParticle::pid()]
243 bool IsolFlag;
244 static TCompare *fgCompare; //!
245
246 ClassDef(TRootMuon, 1)
247};
248
249//---------------------------------------------------------------------------
250
251class D_Track : public TSortableObject {
252//class D_Track : public TRootParticle {
253 public:
254 D_Track(); // needed for storage in ExRootAnalysis
255 D_Track(const D_Track& track);
256 D_Track(const float inEta, const float inPhi, const float outEta, const float outPhi, const float pt);
257 D_Track& operator=(const D_Track& track);
258 void Set(const float inEta, const float inPhi, const float outEta, const float outPhi, const float pt);
259 const TLorentzVector GetFourVector() const;
260 const float getEta() const {return Eta;}
261 const float getPhi() const {return Phi;}
262 const float getEtaOuter() const {return EtaOuter;}
263 const float getPhiOuter() const {return PhiOuter;}
264 const float getE() const {return E;}
265 const float getPx() const {return Px;}
266 const float getPy() const {return Py;}
267 const float getPz() const {return Pz;}
268 const float getPT() const {return PT;}
269
270 static TCompare *fgCompare; //!
271 const TCompare *GetCompare() const { return fgCompare; }
272 protected:
273 float Eta, Phi; // (eta,phi) at the beginning of the track
274 float EtaOuter, PhiOuter; // (eta,phi) at the end of the track
275 float PT, E, Px, Py, Pz; // transverse momentum
276 ClassDef(D_Track, 1)
277};
278
279
280class TRootTracks: public TRootParticle {
281public:
282 TRootTracks() {} // : Etaout(0), Phiout(0) {};
283 static TCompare *fgCompare; //!
284 TRootTracks(const D_Track& track);
285 float E; // particle energy in GeV
286 float Px; // particle momentum vector (x component) in GeV
287 float Py; // particle momentum vector (y component) in GeV
288 float Pz; // particle momentum vector (z component) in GeV
289
290 float Eta; // particle pseudorapidity
291 float Phi; // particle azimuthal angle in rad
292
293 float EtaCalo; // particle pseudorapidity when entering the calo,
294 float PhiCalo; // particle azimuthal angle in rad when entering the calo
295// float X, Y, Z; // coordinates of the beginning of the track
296// float Xout, Yout, Zout; // coordinates of the end of the track
297 //float Etaout, Phiout; // coordinates of the end of the track
298// void SetPosition(const float x, const float y, const float z) {X=x; Y=y; Z=z;}
299// void SetPositionOut(const float x, const float y, const float z) {Xout=x; Yout=y; Zout=z;}
300 ClassDef(TRootTracks, 1)
301};
302
303//---------------------------------------------------------------------------
304
305/*class TRootCalo: public TRootParticle
306public:
307 TRootCalo() {};
308 static TCompare *fgCompare; //!
309
310 ClassDef(TRootCalo, 1)
311};
312*/
313
314//class TRootCalo: public TSortableObject {
315class TRootCalo: public TRootParticle {
316 public:
317 TRootCalo() ;
318 TRootCalo(const TRootCalo& cal);
319 TRootCalo& operator=(const TRootCalo& cal);
320 void set(const D_CaloTower& cal);
321 static TCompare *fgCompare; //!
322 // const TCompare *GetCompare() const { return fgCompare; }
323 const float getET() const {return ET;}
324
325 protected:
326 //float Eta, Phi; // segmented eta, phi
327 float E_em, E_had; // electromagnetic and hadronic components of the tower energy
328 //float E;
329 float ET; // total energy and transverse energy
330 ClassDef(TRootCalo, 1)
331};
332
333//---------------------------------------------------------------------------
334class TRootZdcHits: public TRootParticle
335{
336public:
337 TRootZdcHits() {};
338 float T; // time of flight [s]
339 int side; // -1 or +1
340 static TCompare *fgCompare; //!
341
342 ClassDef(TRootZdcHits, 1)
343};
344
345//---------------------------------------------------------------------------
346
347class TRootJet: public TRootParticle
348{
349public:
350 TRootJet() {};
351 bool Btag;
352
353 static TCompare *fgCompare; //!
354
355 ClassDef(TRootJet, 1)
356};
357
358//---------------------------------------------------------------------------
359
360class TRootTauJet: public TRootParticle
361{
362public:
363 TRootTauJet() {};
364 static TCompare *fgCompare; //!
365
366 ClassDef(TRootTauJet, 1)
367};
368
369class TRootTrigger: public TSortableObject
370{
371public:
372 TRootTrigger() {};
373
374 int Accepted;
375
376 static TCompare *fgCompare; //!
377 const TCompare *GetCompare() const { return fgCompare; }
378
379 ClassDef(TRootTrigger, 1)
380};
381//---------------------------------------------------------------------------
382
383class TRootETmis: public TSortableObject
384{
385public:
386 TRootETmis() {};
387 float ET; // jet energy [RecJet::getEnergy()]
388 float Phi; // jet azimuthal angle [RecJet::getPhi()]
389 float Px;
390 float Py;
391
392 static TCompare *fgCompare; //!
393 const TCompare *GetCompare() const { return fgCompare; }
394
395 ClassDef(TRootETmis, 1)
396};
397
398//---------------------------------------------------------------------------
399
400class TRootRomanPotHits: public TSortableObject
401{
402public:
403 TRootRomanPotHits() {};
404 float T; // time of flight to the detector [s]
405 float S; // distance to the IP [m]
406 float E; // reconstructed energy [GeV]
407 float q2; // reconstructed squared momentum transfer [GeV^2]
408
409 float X; // horizontal distance to the beam [um]
410 float Y; // vertical distance to the beam [um]
411
412 float Tx; // angle of the momentum in the horizontal (x,z) plane [urad]
413 float Ty; // angle of the momentum in the verical (y,z) plane [urad]
414
415 int side; // -1 or 1
416
417 static TCompare *fgCompare; //!
418 const TCompare *GetCompare() const { return fgCompare; }
419
420 ClassDef(TRootRomanPotHits, 1)
421};
422
423#endif // BLOCKCLASSES_H
424
Note: See TracBrowser for help on using the repository browser.