StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
TPi0Event.h
1 #ifndef STAR_Pi0Event
2 #define STAR_Pi0Event
3 
4 // Header file for Pi0 Event class and sub-classes, including Monte Carlo events.
5 
6 #include "TObject.h"
7 #include "TClonesArray.h"
8 #include "TRefArray.h"
9 #include "TRef.h"
10 #include "TH1.h"
11 #include "TMath.h"
12 #include <vector>
13 
14 using namespace std;
15 
16 class TPi0Candidate : public TObject {
17 
18 private:
19  Float_t m_Pt;
20  Float_t m_Mass;
21  Float_t m_Eta;
22  Float_t m_Phi;
23  Float_t m_Asymmetry;
24  Float_t m_CosAngle;
25  Float_t m_Distance;
26  Float_t m_TowerId1;
27  Float_t m_TowerId2;
28  Int_t m_ChargedAssociation1;
29  Int_t m_ChargedAssociation2;
30  Int_t m_SMDFlagg1;
31  Int_t m_SMDFlagg2;
32  Float_t m_Energy1;
33  Float_t m_Energy2;
34  Float_t m_TowerEnergy1;
35  Float_t m_TowerEnergy2;
36  Float_t m_SMDe1;
37  Float_t m_SMDp1;
38  Float_t m_SMDe2;
39  Float_t m_SMDp2;
40  Float_t m_Phi1;
41  Float_t m_Eta1;
42  Float_t m_Phi2;
43  Float_t m_Eta2;
44  Float_t m_SizeSMDe1;
45  Float_t m_SizeSMDp1;
46  Float_t m_SizeTower1;
47  Float_t m_SizeSMDe2;
48  Float_t m_SizeSMDp2;
49  Float_t m_SizeTower2;
50 
51 public:
52  TPi0Candidate();
53  TPi0Candidate(const TPi0Candidate& orig);
54  virtual ~TPi0Candidate() {};
55  void Clear(const Option_t* option ="") {};
56  // Getters:
57  Float_t Pt() const {return m_Pt;}
58  Float_t Mass() const {return m_Mass;}
59  Float_t Eta() const {return m_Eta;}
60  Float_t Phi() const {return m_Phi;}
61  Float_t Asymmetry() const {return m_Asymmetry;}
62  Float_t CosAngle() const {return m_CosAngle;}
63  Float_t Distance() const {return m_Distance;}
64  Float_t TowerId1() const {return m_TowerId1;}
65  Float_t TowerId2() const {return m_TowerId2;}
66  Int_t ChargedAssociation1() const {return m_ChargedAssociation1;}
67  Int_t ChargedAssociation2() const {return m_ChargedAssociation2;}
68  Int_t SMDFlagg1() const {return m_SMDFlagg1;}
69  Int_t SMDFlagg2() const {return m_SMDFlagg2;}
70  Float_t Energy1() const {return m_Energy1;}
71  Float_t Energy2() const {return m_Energy2;}
72  Float_t TowerEnergy1() const {return m_TowerEnergy1;}
73  Float_t TowerEnergy2() const {return m_TowerEnergy2;}
74  Float_t SMDe1() const {return m_SMDe1;}
75  Float_t SMDp1() const {return m_SMDp1;}
76  Float_t SMDe2() const {return m_SMDe2;}
77  Float_t SMDp2() const {return m_SMDp2;}
78  Float_t Phi1() const {return m_Phi1;}
79  Float_t Eta1() const {return m_Eta1;}
80  Float_t Phi2() const {return m_Phi2;}
81  Float_t Eta2() const {return m_Eta2;}
82  Float_t SizeSMDe1() const {return m_SizeSMDe1;}
83  Float_t SizeSMDp1() const {return m_SizeSMDp1;}
84  Float_t SizeTower1() const {return m_SizeTower1;}
85  Float_t SizeSMDe2() const {return m_SizeSMDe2;}
86  Float_t SizeSMDp2() const {return m_SizeSMDp2;}
87  Float_t SizeTower2() const {return m_SizeTower2;}
88  // Setters:
89  void SetAll(Float_t data[31]);
90 
91  ClassDef(TPi0Candidate,1)
92  };
93 
94 class THit : public TObject {
95 private:
96  Float_t m_X;
97  Float_t m_Y;
98  Float_t m_Z;
99  Int_t m_Id;
100  Float_t m_Energy;
101  Float_t m_Pt;
102  Int_t m_NTracks;
103  Int_t m_SMDFlag;
104  Float_t m_EnergySMDe;
105  Float_t m_EnergySMDp;
106  Float_t m_EnergyTower;
107  Float_t m_SizeSMDe;
108  Float_t m_SizeSMDp;
109  Float_t m_SizeTower;
110  Float_t m_Phi;
111  Float_t m_Eta;
112 
113 public:
114  THit();
115  THit(const THit& orig);
116  virtual ~THit() {};
117  void Clear(const Option_t* option =""){};
118  Float_t X() const {return m_X;}
119  Float_t Y() const {return m_Y;}
120  Float_t Z() const {return m_Z;}
121  Int_t Id() const {return m_Id;}
122  Float_t Energy() const {return m_Energy;}
123  Float_t Pt() const {return m_Pt;}
124  Int_t NTracks() const {return m_NTracks;}
125  Int_t SMDFlag() const {return m_SMDFlag;}
126  Float_t EnergySMDe() const {return m_EnergySMDe;}
127  Float_t EnergySMDp() const {return m_EnergySMDp;}
128  Float_t EnergyTower() const {return m_EnergyTower;}
129  Float_t SizeSMDe() const {return m_SizeSMDe;}
130  Float_t SizeSMDp() const {return m_SizeSMDp;}
131  Float_t SizeTower() const {return m_SizeTower;}
132  Float_t Phi() const {return m_Phi;}
133  Float_t Eta() const {return m_Eta;}
134  void SetAll(Float_t data[16]);
135 
136  ClassDef(THit,1)
137  };
138 
139 class TMCPi0 : public TObject {
140  //pt:vertexz:eta:phi:runNo:eventNo:hiTowerAdc6Bit:bbcTrig
141 private:
142  Float_t m_Pt;
143  Float_t m_Eta;
144  Float_t m_Phi;
145  Float_t m_Energy1;
146  Float_t m_Energy2;
147  Float_t m_TowerId1;
148  Float_t m_TowerId2;
149  Float_t m_Phi1;
150  Float_t m_Eta1;
151  Float_t m_Phi2;
152  Float_t m_Eta2;
153 
154 public:
155  TMCPi0();
156  TMCPi0(const TMCPi0& orig);
157  virtual ~TMCPi0() {};
158  void Clear(const Option_t* option ="") {};
159  //Getters
160  Float_t Pt() const {return m_Pt;}
161  Float_t Eta() const {return m_Eta;}
162  Float_t Phi() const {return m_Phi;}
163  Float_t Energy1() const {return m_Energy1;}
164  Float_t Energy2() const {return m_Energy2;}
165  Float_t TowerId1() const {return m_TowerId1;}
166  Float_t TowerId2() const {return m_TowerId2;}
167  Float_t Phi1() const {return m_Phi1;}
168  Float_t Eta1() const {return m_Eta1;}
169  Float_t Phi2() const {return m_Phi2;}
170  Float_t Eta2() const {return m_Eta2;}
171 
172  // Setters
173  void SetAll(Float_t data[11]);
174 
175  ClassDef(TMCPi0,1)
176  };
177 
178 class TMCEta : public TObject {
179 private:
180  Float_t m_Pt;
181  Float_t m_Eta;
182  Float_t m_Phi;
183  Int_t m_DecayMode; // how the eta decayed: 0 : gg; 1: 3 pi0; 2: pi+pi-pi0 (or other 3 particle modes containing one pi0); 3: Others
184  // used for 2 gamma decay modes
185  Float_t m_Energy1;
186  Float_t m_Energy2;
187  Float_t m_TowerId1;
188  Float_t m_TowerId2;
189  Float_t m_Phi1;
190  Float_t m_Eta1;
191  Float_t m_Phi2;
192  Float_t m_Eta2;
193  //used for decay modes containing Pi0s:
194  Float_t m_Pi01Pt;
195  Float_t m_Pi01Eta;
196  Float_t m_Pi01Phi;
197  Float_t m_Pi02Pt;
198  Float_t m_Pi02Eta;
199  Float_t m_Pi02Phi;
200  Float_t m_Pi03Pt;
201  Float_t m_Pi03Eta;
202  Float_t m_Pi03Phi;
203 
204 public:
205  TMCEta();
206  TMCEta(const TMCEta& orig);
207  virtual ~TMCEta() {};
208  void Clear(const Option_t* option ="") {};
209  //Getters
210  Float_t Pt() const {return m_Pt;}
211  Float_t Eta() const {return m_Eta;}
212  Float_t Phi() const {return m_Phi;}
213  Int_t DecayMode() const {return m_DecayMode;}
214  Float_t Energy1() const {return m_Energy1;}
215  Float_t Energy2() const {return m_Energy2;}
216  Float_t TowerId1() const {return m_TowerId1;}
217  Float_t TowerId2() const {return m_TowerId2;}
218  Float_t Phi1() const {return m_Phi1;}
219  Float_t Eta1() const {return m_Eta1;}
220  Float_t Phi2() const {return m_Phi2;}
221  Float_t Eta2() const {return m_Eta2;}
222  Float_t Pi01Pt() const {return m_Pi01Pt;}
223  Float_t Pi01Eta() const {return m_Pi01Eta;}
224  Float_t Pi01Phi() const {return m_Pi01Phi;}
225  Float_t Pi02Pt() const {return m_Pi01Pt;}
226  Float_t Pi02Eta() const {return m_Pi01Eta;}
227  Float_t Pi02Phi() const {return m_Pi01Phi;}
228  Float_t Pi03Pt() const {return m_Pi01Pt;}
229  Float_t Pi03Eta() const {return m_Pi01Eta;}
230  Float_t Pi03Phi() const {return m_Pi01Phi;}
231 
232  // Setters
233  void SetAll(Float_t data[21]);
234 
235  ClassDef(TMCEta,1)
236  };
237 
238 
239 class TPi0Event : public TObject {
240 
241 private:
242  Int_t m_EventNo;
243  Int_t m_RunNo;
244  Int_t m_FillNo;
245  Float_t m_VertexX;
246  Float_t m_VertexY;
247  Float_t m_VertexZ;
248  Int_t m_IsMB;
249  Int_t m_IsHTTPF;
250  Int_t m_IsHTTPL2;
251  Int_t m_IsHTTPL2_Test;
252  Int_t m_IsHT2;
253  Int_t m_IsJP1;
254  Int_t m_HiTowerAdc6Bit;
255  Int_t m_BEMCPoints;
256  Float_t m_ChargedPtSum;
257  Float_t m_NeutralEnergy;
258  Int_t m_PrescaleMB;
259  Int_t m_PrescaleHTTPF;
260  Int_t m_PrescaleHTTPL2;
261  Int_t m_PrescaleHTTPL2_Test;
262  Int_t m_PrescaleHT2;
263  Int_t m_PrescaleJP1;
264  Int_t m_BBCTrig;
265  Float_t m_MCVertexZ;
266  Int_t m_Accept;
267  Int_t m_IsSimu;
268  Int_t m_NPi0Candidates;
269  Int_t m_NMCPi0s;
270  Int_t m_NMCEtas;
271  Int_t m_TriggerTower;
272  Float_t m_HighestPi0MCPt;
273  Int_t m_BunchX48;
274  Int_t m_BunchX7;
275  Int_t m_SpinBit4;
276  Int_t m_MaskedXing;
277  Int_t m_ValidSpin;
278  Int_t m_PolLong;
279  Int_t m_DbSpinBit;
280  Float_t m_relLum[3];
281  Float_t m_lumErr[3];
282  Int_t m_NHits;
283  Float_t m_BBCVertexZ;
284  Int_t m_OnlyBBCVtx;
285  // information from PYTHIA record for simulated events
286  Float_t m_PythiaPartPt;
287  Float_t m_PythiaX1;
288  Float_t m_PythiaX2;
289  Float_t m_BBCTimeBin;
290  Int_t m_isBackground;
291  vector <int> m_BackgroundTowers;
292 
293  //Int_t m_HighestTower; // not used for now
294  //Float_t m_HighestTowerE;
295  TClonesArray *m_Pi0Candidates; //->
296  TClonesArray *m_MCPi0s; //->
297  TClonesArray *m_MCEtas; //->
298  TClonesArray *m_Hits; //->
299  static TClonesArray *aPi0Candidates;
300  static TClonesArray *aMCPi0s;
301  static TClonesArray *aMCEtas;
302  static TClonesArray *aHits;
303 
304 public:
305  TPi0Event();
306  virtual ~TPi0Event();
307  void Clear(const Option_t* option ="");
308  static void Reset(Option_t *option ="");
309  //Getters
310  Int_t EventNo() const {return m_EventNo;}
311  Int_t RunNo() const {return m_RunNo;}
312  Int_t FillNo() const {return m_FillNo;}
313  Float_t VertexX() const {return m_VertexX;}
314  Float_t VertexY() const {return m_VertexY;}
315  Float_t VertexZ() const {return m_VertexZ;}
316  Int_t IsMB() const {return m_IsMB;}
317  Int_t IsHTTPF() const {return m_IsHTTPF;}
318  Int_t IsHTTPL2() const {return m_IsHTTPL2;}
319  Int_t IsHTTPL2_Test() const {return m_IsHTTPL2_Test;}
320  Int_t IsHT2() const {return m_IsHT2;}
321  Int_t IsJP1() const {return m_IsJP1;}
322  Int_t HiTowerAdc6Bit() const {return m_HiTowerAdc6Bit;}
323  Int_t BEMCPoints() const {return m_BEMCPoints;}
324  Float_t ChargedPtSum() const {return m_ChargedPtSum;}
325  Float_t NeutralEnergy() const {return m_NeutralEnergy;}
326  Int_t PrescaleMB() const {return m_PrescaleMB;}
327  Int_t PrescaleHTTPF() const {return m_PrescaleHTTPF;}
328  Int_t PrescaleHTTPL2() const {return m_PrescaleHTTPL2;}
329  Int_t PrescaleHTTPL2_Test() const {return m_PrescaleHTTPL2_Test;}
330  Int_t PrescaleHT2() const {return m_PrescaleHT2;}
331  Int_t PrescaleJP1() const {return m_PrescaleJP1;}
332  Int_t BBCTrig() const {return m_BBCTrig;}
333  Int_t IsSimulation() const {return m_IsSimu;}
334  Float_t MCVertexZ() const {return m_MCVertexZ;}
335  Int_t IsAccepted() const {return m_Accept;}
336  Int_t NPi0Candidates() const {return m_NPi0Candidates;}
337  Int_t NMCPi0s() const {return m_NMCPi0s;}
338  Int_t NMCEtas() const {return m_NMCEtas;}
339  Int_t TriggerTower() const {return m_TriggerTower;}
340  Float_t HighestPi0MCPt() const {return m_HighestPi0MCPt;}
341  Int_t BunchX48() const {return m_BunchX48;}
342  Int_t BunchX7() const {return m_BunchX7;}
343  Int_t SpinBit() const {return m_SpinBit4;}
344  Int_t MaskedXing() const {return m_MaskedXing;}
345  Int_t ValidSpin() const {return m_ValidSpin;}
346  Int_t PolLong() const {return m_PolLong;}
347  Int_t DbSpinBit() const {return m_DbSpinBit;}
348  Float_t RelLumUpUp() const {return m_relLum[0];}
349  Float_t LumErrorUpUp() const {return m_lumErr[0];}
350  Float_t RelLumUpDown() const {return m_relLum[1];}
351  Float_t LumErrorUpDown() const {return m_lumErr[1];}
352  Float_t RelLumDownUp() const {return m_relLum[2];}
353  Float_t LumErrorDownUp() const {return m_lumErr[2];}
354  Int_t NHits() const {return m_NHits;}
355  Float_t BBCVertexZ() const {return m_BBCVertexZ;}
356  Int_t OnlyBBCVertex() const {return m_OnlyBBCVtx;}
357  Float_t PythiaPartPt() const {return m_PythiaPartPt;}
358  Float_t PythiaX1() const {return m_PythiaX1;}
359  Float_t PythiaX2() const {return m_PythiaX2;}
360  Float_t BBCTimeBin() const {return m_BBCTimeBin;}
361  Int_t IsBackground() const {return m_isBackground;}
362  int NumberOfBackgroundTowers() const {return m_BackgroundTowers.size();}
363  int BackgroundTower(int i) const {return m_BackgroundTowers.at(i);}
364  TClonesArray* Pi0Candidates() const {return m_Pi0Candidates;}
365  TPi0Candidate* Pi0Candidate(Int_t i) {return (TPi0Candidate*)m_Pi0Candidates->At(i);}
366  TClonesArray* MCPi0s() const {return m_MCPi0s;}
367  TMCPi0* MCPi0(Int_t i) {return (TMCPi0*)m_MCPi0s->At(i);}
368  TClonesArray* MCEtas() const {return m_MCEtas;}
369  TMCEta* MCEta(Int_t i) {return (TMCEta*)m_MCEtas->At(i);}
370  TClonesArray* Hits() const {return m_Hits;}
371  THit* Hit(Int_t i) {return (THit*)m_Hits->At(i);}
372 
373 
374  //Setters
375  void SetEventNo(Int_t evN) {m_EventNo = evN;}
376  void SetRunNo(Int_t rN) {m_RunNo = rN;}
377  void SetFillNo(Int_t fN) {m_FillNo = fN;}
378  void SetVertex(Float_t vx, Float_t vy, Float_t vz) {m_VertexX = vx; m_VertexY = vy; m_VertexZ = vz;}
379  void SetTriggers(Int_t tr[6]) {m_IsMB = tr[0]; m_IsHTTPF = tr[1]; m_IsHTTPL2 = tr[2]; m_IsHT2 = tr[3]; m_IsJP1 = tr[4]; m_IsHTTPL2_Test = tr[5];}
380  void SetPrescales(Int_t pr[6]) {m_PrescaleMB = pr[0]; m_PrescaleHTTPF = pr[1]; m_PrescaleHTTPL2 = pr[2]; m_PrescaleHT2 = pr[3]; m_PrescaleJP1 = pr[4]; m_PrescaleHTTPL2_Test = pr[5];}
381  void SetHiTowerAdc6Bit(Int_t ht) {m_HiTowerAdc6Bit = ht;}
382  void SetBEMCPoints(Int_t points) {m_BEMCPoints = points;}
383  void SetChargedPtSum(Float_t sum) {m_ChargedPtSum = sum;}
384  void SetNeutralEnergy(Float_t en) {m_NeutralEnergy = en;}
385  void SetBBCTrig(Int_t bt) {m_BBCTrig = bt;}
386  void SetSimulation(Int_t sim) {m_IsSimu = sim;}
387  void SetMCVertexZ(Float_t mz) {m_MCVertexZ = mz;}
388  void Accept(Int_t ac = 1) {m_Accept = ac;}
389  void SetTriggerTower(Int_t tow) {m_TriggerTower = tow;}
390  void SeHighestPi0MCPt(Float_t pt) {m_HighestPi0MCPt = pt;}
391  void SetBunchX48(Int_t b48) {m_BunchX48 = b48;}
392  void SetBunchX7(Int_t b7) {m_BunchX7 = b7;}
393  void SetSpinBit(Int_t sb) {m_SpinBit4 = sb;}
394  void SetMaskedXing(Int_t mask) {m_MaskedXing = mask;}
395  void SetValidSpin(Int_t val) {m_ValidSpin = val;}
396  void SetPolLong(Int_t pol) {m_PolLong = pol;}
397  void SetDbSpinBit(Int_t sb) {m_DbSpinBit = sb;}
398  void SetRelLum(Float_t l[3]) {m_relLum[0] = l[0];m_relLum[1] = l[1];m_relLum[2] = l[2];}
399  void SetLumError(Float_t e[3]) {m_lumErr[0] = e[0];m_lumErr[1] = e[1];m_lumErr[2] = e[2];}
400  void SetBBCVertexZ(Float_t vtxz) {m_BBCVertexZ = vtxz;}
401  void SetOnlyBBCVertex(Int_t flag = 1) {m_OnlyBBCVtx = flag;}
402  void SetPythiaPartPt(Float_t part) {m_PythiaPartPt = part;}
403  void SetPythiaX1(Float_t x) {m_PythiaX1 = x;}
404  void SetPythiaX2(Float_t x) {m_PythiaX2 = x;}
405  void SetBBCTimeBin(Float_t bin) {m_BBCTimeBin = bin;}
406  void SetBackground(int bgd) {m_isBackground = bgd;}
407  void AddBackgroundTower(int tow) {m_BackgroundTowers.push_back(tow);}
408  TPi0Candidate* AddPi0Candidate(TPi0Candidate& cand);
409  TMCPi0* AddMCPi0(TMCPi0& cand);
410  TMCEta* AddMCEta(TMCEta& cand);
411  THit* AddHit(THit& cand);
412 
413  ClassDef(TPi0Event,3)
414  };
415 #endif
416