Fork me on GitHub

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

Last change on this file since 267 was 267, checked in by severine ovyn, 15 years ago

remove double

File size: 13.7 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-13 19:38:03 $
16 * $Revision: 1.13 $
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
314class TRootCalo: public TSortableObject
315{
316//class TRootCalo: public TRootParticle {
317 public:
318 float Eta;
319 float Phi;
320 float E;
321 TRootCalo() ;
322 TRootCalo(const TRootCalo& cal);
323 TRootCalo& operator=(const TRootCalo& cal);
324 void set(const D_CaloTower& cal);
325 static TCompare *fgCompare; //!
326 const TCompare *GetCompare() const { return fgCompare; }
327 const float getET() const {return ET;}
328
329 protected:
330 //float Eta, Phi; // segmented eta, phi
331 float E_em, E_had; // electromagnetic and hadronic components of the tower energy
332 //float E;
333 float ET; // total energy and transverse energy
334 ClassDef(TRootCalo, 1)
335};
336
337//---------------------------------------------------------------------------
338class TRootZdcHits: public TRootParticle
339{
340public:
341 TRootZdcHits() {};
342 float T; // time of flight [s]
343 int side; // -1 or +1
344 static TCompare *fgCompare; //!
345
346 ClassDef(TRootZdcHits, 1)
347};
348
349//---------------------------------------------------------------------------
350
351class TRootTauJet: public TSortableObject
352{
353public:
354 TRootTauJet() {};
355
356 float E; // particle energy in GeV
357 float Px; // particle momentum vector (x component) in GeV
358 float Py; // particle momentum vector (y component) in GeV
359 float Pz; // particle momentum vector (z component) in GeV
360
361 float Eta; // particle pseudorapidity
362 float Phi; // particle azimuthal angle in rad
363
364 void Set(const TLorentzVector& momentum);// { return TRootParticle::Set(momentum); }
365
366 static TCompare *fgCompare; //!
367 const TCompare *GetCompare() const { return fgCompare; }
368
369 float PT; // particle transverse momentum in GeV
370
371 ClassDef(TRootTauJet, 1)
372};
373
374//---------------------------------------------------------------------------
375
376class TRootJet: public TRootTauJet
377{
378public:
379 TRootJet() {};
380
381 static TCompare *fgCompare; //!
382
383 bool Btag;
384
385 ClassDef(TRootJet, 1)
386};
387
388//------------------------------------------------------------------------------
389
390class TRootTrigger: public TSortableObject
391{
392public:
393 TRootTrigger() {};
394
395 int Accepted;
396
397 static TCompare *fgCompare; //!
398 const TCompare *GetCompare() const { return fgCompare; }
399
400 ClassDef(TRootTrigger, 1)
401};
402//---------------------------------------------------------------------------
403
404class TRootETmis: public TSortableObject
405{
406public:
407 TRootETmis() {};
408 float ET; // jet energy [RecJet::getEnergy()]
409 float Phi; // jet azimuthal angle [RecJet::getPhi()]
410 float Px;
411 float Py;
412
413 static TCompare *fgCompare; //!
414 const TCompare *GetCompare() const { return fgCompare; }
415
416 ClassDef(TRootETmis, 1)
417};
418
419//---------------------------------------------------------------------------
420
421class TRootRomanPotHits: public TSortableObject
422{
423public:
424 TRootRomanPotHits() {};
425 float T; // time of flight to the detector [s]
426 float S; // distance to the IP [m]
427 float E; // reconstructed energy [GeV]
428 float q2; // reconstructed squared momentum transfer [GeV^2]
429
430 float X; // horizontal distance to the beam [um]
431 float Y; // vertical distance to the beam [um]
432
433 float Tx; // angle of the momentum in the horizontal (x,z) plane [urad]
434 float Ty; // angle of the momentum in the verical (y,z) plane [urad]
435
436 int side; // -1 or 1
437
438 static TCompare *fgCompare; //!
439 const TCompare *GetCompare() const { return fgCompare; }
440
441 ClassDef(TRootRomanPotHits, 1)
442};
443
444#endif // BLOCKCLASSES_H
445
Note: See TracBrowser for help on using the repository browser.