StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
TPi0Event.cxx
1 
2 // Implementation file for Pi0Event and components
3 
4 #include "TPi0Event.h"
5 //#include "Stiostream.h"
6 
7 ClassImp(TPi0Event)
8 ClassImp(TPi0Candidate)
9 ClassImp(TMCPi0)
10 ClassImp(TMCEta)
11 ClassImp(THit)
12 
13 
14 TClonesArray* TPi0Event::aPi0Candidates = 0;
15 TClonesArray* TPi0Event::aMCPi0s = 0;
16 TClonesArray* TPi0Event::aMCEtas = 0;
17 TClonesArray* TPi0Event::aHits = 0;
18 
19 // TPi0Event class
20 
22  if (!aPi0Candidates) aPi0Candidates = new TClonesArray("TPi0Candidate", 50);
23  m_Pi0Candidates = aPi0Candidates;
24  if (!aMCPi0s) aMCPi0s = new TClonesArray("TMCPi0", 50);
25  m_MCPi0s = aMCPi0s;
26  if (!aMCEtas) aMCEtas = new TClonesArray("TMCEta", 50);
27  m_MCEtas = aMCEtas;
28  if (!aHits) aHits = new TClonesArray("THit", 50);
29  m_Hits = aHits;
30  m_EventNo = 0;
31  m_RunNo = 0;
32  m_FillNo = 0;
33  m_VertexZ = 0;
34  m_IsMB = 0;
35  m_IsHTTPF = 0;
36  m_IsHTTPL2 = 0;
37  m_IsHTTPL2_Test = 0;
38  m_IsHT2 = 0;
39  m_IsJP1 = 0;
40  m_HiTowerAdc6Bit = 0;
41  m_BEMCPoints = 0;
42  m_PrescaleMB = 0;
43  m_PrescaleHTTPF = 0;
44  m_PrescaleHTTPL2 = 0;
45  m_PrescaleHTTPL2_Test = 0;
46  m_PrescaleHT2 = 0;
47  m_PrescaleJP1 = 0;
48  m_BBCTrig = 0;
49  m_MCVertexZ = 0;
50  m_Accept = 0;
51  m_NPi0Candidates = 0;
52  m_NMCPi0s = 0;
53  m_NMCEtas = 0;
54  m_NHits = 0;
55  m_HighestPi0MCPt = 0;
56  m_BunchX48 = 0;
57  m_BunchX7 = 0;
58  m_SpinBit4 = 0;
59  m_MaskedXing = 0;
60  m_ValidSpin = 0;
61  m_PolLong = 0;
62  m_DbSpinBit = 0;
63  m_relLum[0] = 0;
64  m_relLum[1] = 0;
65  m_relLum[2] = 0;
66  m_lumErr[0] = 0;
67  m_lumErr[1] = 0;
68  m_lumErr[2] = 0;
69  m_BBCVertexZ = 0;
70  m_OnlyBBCVtx = 0;
71  m_PythiaPartPt = 0;
72  m_PythiaX1 = 0;
73  m_PythiaX2 = 0;
74  m_BBCTimeBin = 0;
75  m_isBackground = 0;
76 }
77 
78 TPi0Event::~TPi0Event() {
79  Clear();
80 }
81 
82 void TPi0Event::Clear(const Option_t*) {
83  //cout << "Clearing TPi0Event..." << endl;
84  m_EventNo = 0;
85  m_RunNo = 0;
86  m_FillNo = 0;
87  m_VertexZ = 0;
88  m_IsMB = 0;
89  m_IsHTTPF = 0;
90  m_IsHTTPL2 = 0;
91  m_IsHTTPL2_Test = 0;
92  m_IsHT2 = 0;
93  m_IsJP1 = 0;
94  m_HiTowerAdc6Bit = 0;
95  m_BEMCPoints = 0;
96  m_PrescaleMB = 0;
97  m_PrescaleHTTPF = 0;
98  m_PrescaleHTTPL2 = 0;
99  m_PrescaleHTTPL2_Test = 0;
100  m_PrescaleHT2 = 0;
101  m_PrescaleJP1 = 0;
102  m_BBCTrig = 0;
103  m_MCVertexZ = 0;
104  m_Accept = 0;
105  m_NPi0Candidates = 0;
106  m_NMCPi0s = 0;
107  m_NMCEtas = 0;
108  m_NHits = 0;
109  m_HighestPi0MCPt = 0;
110  m_BunchX48 = 0;
111  m_BunchX7 = 0;
112  m_SpinBit4 = 0;
113  m_MaskedXing = 0;
114  m_ValidSpin = 0;
115  m_PolLong = 0;
116  m_DbSpinBit = 0;
117  m_relLum[0] = 0;
118  m_relLum[1] = 0;
119  m_relLum[2] = 0;
120  m_lumErr[0] = 0;
121  m_lumErr[1] = 0;
122  m_lumErr[2] = 0;
123  m_BBCVertexZ = 0;
124  m_OnlyBBCVtx = 0;
125  m_PythiaPartPt = 0;
126  m_PythiaX1 = 0;
127  m_PythiaX2 = 0;
128  m_BBCTimeBin = 0;
129  m_isBackground = 0;
130  m_BackgroundTowers.clear();
131  m_Pi0Candidates->Clear();
132  m_MCPi0s->Clear();
133  m_MCEtas->Clear();
134  m_Hits->Clear();
135  //cout << "Clear done!" << endl;
136 }
137 void TPi0Event::Reset(Option_t * /*option*/)
138 {
139  // Static function to reset all static objects for this event
140 
141  delete aPi0Candidates; aPi0Candidates = 0;
142  delete aMCPi0s; aMCPi0s = 0;
143  delete aMCEtas; aMCEtas = 0;
144  delete aHits; aHits = 0;
145 }
146 
147 
148 TPi0Candidate* TPi0Event::AddPi0Candidate(TPi0Candidate& cand) {
149  //cout << "Adding Pi0 candidate after " << m_NPi0Candidates << endl;
150  TClonesArray &aCand = *m_Pi0Candidates;
151  TPi0Candidate *piCand = new(aCand[m_NPi0Candidates++]) TPi0Candidate(cand);
152  //cout << "Added Candidate " << m_NPi0Candidates << endl;
153  return piCand;
154 }
155 
156 TMCPi0* TPi0Event::AddMCPi0(TMCPi0& cand) {
157  //cout << "Adding Pi0 candidate after " << m_NPi0Candidates << endl;
158  TClonesArray &aCand = *m_MCPi0s;
159  TMCPi0 *piCand = new(aCand[m_NMCPi0s++]) TMCPi0(cand);
160  //cout << "Added Candidate " << m_NPi0Candidates << endl;
161  return piCand;
162 }
163 TMCEta* TPi0Event::AddMCEta(TMCEta& cand) {
164  //cout << "Adding Pi0 candidate after " << m_NPi0Candidates << endl;
165  TClonesArray &aCand = *m_MCEtas;
166  TMCEta *piCand = new(aCand[m_NMCEtas++]) TMCEta(cand);
167  //cout << "Added Candidate " << m_NPi0Candidates << endl;
168  return piCand;
169 }
170 
171 THit* TPi0Event::AddHit(THit& cand) {
172  //cout << "Adding Pi0 candidate after " << m_NPi0Candidates << endl;
173  TClonesArray &aCand = *m_Hits;
174  THit *piCand = new(aCand[m_NHits++]) THit(cand);
175  //cout << "Added Candidate " << m_NPi0Candidates << endl;
176  return piCand;
177 }
178 
179 
180 TPi0Candidate::TPi0Candidate() : TObject(){
181  m_Pt = m_Mass = 0;
182 }
183 
184 TPi0Candidate::TPi0Candidate(const TPi0Candidate& orig) : TObject(orig) {
185  // copy a Pi0Candidate
186  m_Pt = orig.m_Pt;
187  m_Mass = orig.m_Mass;
188  m_Eta = orig.m_Eta;
189  m_Phi = orig.m_Phi;
190  m_Asymmetry = orig.m_Asymmetry;
191  m_CosAngle = orig.m_CosAngle;
192  m_Distance = orig.m_Distance;
193  m_TowerId1 = orig.m_TowerId1;
194  m_TowerId2 = orig.m_TowerId2;
195  m_ChargedAssociation1 = orig.m_ChargedAssociation1;
196  m_ChargedAssociation2 = orig.m_ChargedAssociation2;
197  m_SMDFlagg1 = orig.m_SMDFlagg1;
198  m_SMDFlagg2 = orig.m_SMDFlagg2;
199  m_Energy1 = orig.m_Energy1;
200  m_Energy2 = orig.m_Energy2;
201  m_TowerEnergy1 = orig.m_TowerEnergy1;
202  m_TowerEnergy2 = orig.m_TowerEnergy2;
203  m_SMDe1 = orig.m_SMDe1;
204  m_SMDp1 = orig.m_SMDp1;
205  m_SMDe2 = orig.m_SMDe2;
206  m_SMDp2 = orig.m_SMDp2;
207  m_Phi1 = orig.m_Phi1;
208  m_Eta1 = orig.m_Eta1;
209  m_Phi2 = orig.m_Phi2;
210  m_Eta2 = orig.m_Eta2;
211  m_SizeSMDe1 = orig.m_SizeSMDe1;
212  m_SizeSMDp1 = orig.m_SizeSMDp1;
213  m_SizeTower1 = orig.m_SizeTower1;
214  m_SizeSMDe2 = orig.m_SizeSMDe2;
215  m_SizeSMDp2 = orig.m_SizeSMDp2;
216  m_SizeTower2 = orig.m_SizeTower2;
217 
218 }
219 
220 void TPi0Candidate::SetAll(Float_t data[25]) {
221  m_Pt = data[0];
222  m_Mass = data[1];
223  m_Eta = data[2];
224  m_Phi = data[3];
225  m_Asymmetry = data[4];
226  m_CosAngle = data[5];
227  m_Distance = data[6];
228  m_TowerId1 = data[7];
229  m_TowerId2 = data[8];
230  m_ChargedAssociation1 = (Int_t) data[9];
231  m_ChargedAssociation2 = (Int_t) data[10];
232  m_SMDFlagg1 = (Int_t)data[11];
233  m_SMDFlagg2 = (Int_t)data[12];
234  m_Energy1 = data[13];
235  m_Energy2 = data[14];
236  m_TowerEnergy1 = data[15];
237  m_TowerEnergy2 = data[16];
238  m_SMDe1 = data[17];
239  m_SMDp1 = data[18];
240  m_SMDe2 = data[19];
241  m_SMDp2 = data[20];
242  m_Eta1 = data[21];
243  m_Phi1 = data[22];
244  m_Eta2 = data[23];
245  m_Phi2 = data[24];
246  m_SizeSMDe1 = data[25];
247  m_SizeSMDp1 = data[26];
248  m_SizeTower1 = data[27];
249  m_SizeSMDe2 = data[28];
250  m_SizeSMDp2 = data[29];
251  m_SizeTower2 = data[30];
252 
253 }
254 
255 THit::THit() : TObject() {
256  m_X = 0;
257  m_Y = 0;
258  m_Z = 0;
259  m_Id = 0;
260  m_Energy = 0;
261  m_Pt = 0;
262  m_NTracks = 0;
263  m_SMDFlag = 0;
264  m_EnergySMDe = 0;
265  m_EnergySMDp = 0;
266  m_EnergyTower = 0;
267  m_SizeSMDe = 0;
268  m_SizeSMDp = 0;
269  m_SizeTower = 0;
270  m_Phi = 0;
271  m_Eta = 0;
272 }
273 
274 THit::THit(const THit& orig) : TObject(orig) {
275  m_X = orig.m_X;
276  m_Y = orig.m_Y;
277  m_Z = orig.m_Z;
278  m_Id = orig.m_Id;
279  m_Energy = orig.m_Energy;
280  m_Pt = orig.m_Pt;
281  m_NTracks = orig.m_NTracks;
282  m_SMDFlag = orig.m_SMDFlag;
283  m_EnergySMDe = orig.m_EnergySMDe;
284  m_EnergySMDp = orig.m_EnergySMDp;
285  m_EnergyTower = orig.m_EnergyTower;
286  m_SizeSMDe = orig.m_SizeSMDe;
287  m_SizeSMDp = orig.m_SizeSMDp;
288  m_SizeTower = orig.m_SizeTower;
289  m_Phi = orig.m_Phi;
290  m_Eta = orig.m_Eta;
291 }
292 
293 void THit::SetAll(Float_t data[16]) {
294  m_X = data[0];
295  m_Y = data[1];
296  m_Z = data[2];
297  m_Id = (Int_t) data[3];
298  m_Energy = data[4];
299  m_Pt = data[5];
300  m_NTracks = (Int_t) data[6];
301  m_SMDFlag = (Int_t) data[7];
302  m_EnergySMDe = data[8];
303  m_EnergySMDp = data[9];
304  m_EnergyTower = data[10];
305  m_SizeSMDe = data[11];
306  m_SizeSMDp = data[12];
307  m_SizeTower = data[13];
308  m_Phi = data[14];
309  m_Eta = data[15];
310 }
311 
312 TMCPi0::TMCPi0() : TObject() {
313  m_Pt = 0;
314  m_Eta = 0;
315  m_Phi = 0;
316  m_Energy1 = 0;
317  m_Energy2 = 0;
318  m_TowerId1 = 0;
319  m_TowerId2 = 0;
320 }
321 
322 TMCPi0::TMCPi0(const TMCPi0& orig) : TObject(orig) {
323  m_Pt = orig.m_Pt;
324  m_Eta = orig.m_Eta;
325  m_Phi = orig.m_Phi;
326  m_Energy1 = orig.m_Energy1;
327  m_Energy2 = orig.m_Energy2;
328  m_TowerId1 = orig.m_TowerId1;
329  m_TowerId2 = orig.m_TowerId2;
330  m_Phi1 = orig.m_Phi1;
331  m_Eta1 = orig.m_Eta1;
332  m_Phi2 = orig.m_Phi2;
333  m_Eta2 = orig.m_Eta2;
334 }
335 
336 void TMCPi0::SetAll(Float_t data[11]) {
337  m_Pt = data[0];
338  m_Eta = data[1];
339  m_Phi = data[2];
340  m_Energy1 = data[3];
341  m_Energy2 = data[4];
342  m_TowerId1 = data[5];
343  m_TowerId2 = data[6];
344  m_Eta1 = data[7];
345  m_Phi1 = data[8];
346  m_Eta2 = data[9];
347  m_Phi2 = data[10];
348 }
349 
350 TMCEta::TMCEta() : TObject() {
351  m_Pt = 0;
352  m_Eta = 0;
353  m_Phi = 0;
354  m_DecayMode = 0;
355  m_Energy1 = 0;
356  m_Energy2 = 0;
357  m_TowerId1 = 0;
358  m_TowerId2 = 0;
359  m_Pi01Pt = 0;
360  m_Pi01Eta = 0;
361  m_Pi01Phi = 0;
362  m_Pi02Pt = 0;
363  m_Pi02Eta = 0;
364  m_Pi02Phi = 0;
365  m_Pi03Pt = 0;
366  m_Pi03Eta = 0;
367  m_Pi03Phi = 0;
368 
369 }
370 
371 TMCEta::TMCEta(const TMCEta& orig) : TObject(orig) {
372  m_Pt = orig.m_Pt;
373  m_Eta = orig.m_Eta;
374  m_Phi = orig.m_Phi;
375  m_DecayMode = orig.m_DecayMode;
376  m_Energy1 = orig.m_Energy1;
377  m_Energy2 = orig.m_Energy2;
378  m_TowerId1 = orig.m_TowerId1;
379  m_TowerId2 = orig.m_TowerId2;
380  m_Phi1 = orig.m_Phi1;
381  m_Eta1 = orig.m_Eta1;
382  m_Phi2 = orig.m_Phi2;
383  m_Eta2 = orig.m_Eta2;
384  m_Pi01Pt = orig.m_Pi01Pt;
385  m_Pi01Eta = orig.m_Pi01Eta;
386  m_Pi01Phi = orig.m_Pi01Phi;
387  m_Pi02Pt = orig.m_Pi02Pt;
388  m_Pi02Eta = orig.m_Pi02Eta;
389  m_Pi02Phi = orig.m_Pi02Phi;
390  m_Pi03Pt = orig.m_Pi03Pt;
391  m_Pi03Eta = orig.m_Pi03Eta;
392  m_Pi03Phi = orig.m_Pi03Phi;
393 
394 }
395 
396 void TMCEta::SetAll(Float_t data[21]) {
397  m_Pt = data[0];
398  m_Eta = data[1];
399  m_Phi = data[2];
400  m_DecayMode = ((Int_t) data[3]);
401  m_Energy1 = data[4];
402  m_Energy2 = data[5];
403  m_TowerId1 = data[6];
404  m_TowerId2 = data[7];
405  m_Eta1 = data[8];
406  m_Phi1 = data[9];
407  m_Eta2 = data[10];
408  m_Phi2 = data[11];
409  m_Pi01Pt = data[12];
410  m_Pi01Eta = data[13];
411  m_Pi01Phi = data[14];
412  m_Pi02Pt = data[15];
413  m_Pi02Eta = data[16];
414  m_Pi02Phi = data[17];
415  m_Pi03Pt = data[18];
416  m_Pi03Eta = data[19];
417  m_Pi03Phi = data[20];
418 
419 }