- Three classes by MinJung Kweon AliHFEpriVtx, AliHFEsecVtx and AliHFEmcQA for primar...
[u/mrichter/AliRoot.git] / STEER / AliESDVZERO.cxx
CommitLineData
dd735cf0 1#include "AliESDVZERO.h"
28fdf12c 2#include "AliLog.h"
dd735cf0 3
4ClassImp(AliESDVZERO)
5
d0502ab2 6//__________________________________________________________________________
a055ee24 7AliESDVZERO::AliESDVZERO()
8 :TObject(),
9 fBBtriggerV0A(0),
10 fBGtriggerV0A(0),
11 fBBtriggerV0C(0),
12 fBGtriggerV0C(0)
dd735cf0 13{
14 // Default constructor
a055ee24 15 for(Int_t j=0; j<64; j++){
16 fMultiplicity[j] = 0;
d0502ab2 17 fAdc[j] = 0;
18 fTime[j] = 0;
19 fWidth[j] = 0;
20 fBBFlag[j]= kFALSE;
21 fBGFlag[j]= kFALSE;
cd888a89 22 }
dd735cf0 23}
24
d0502ab2 25//__________________________________________________________________________
cd888a89 26AliESDVZERO::AliESDVZERO(const AliESDVZERO &o)
27 :TObject(o),
a055ee24 28 fBBtriggerV0A(o.fBBtriggerV0A),
29 fBGtriggerV0A(o.fBGtriggerV0A),
30 fBBtriggerV0C(o.fBBtriggerV0C),
31 fBGtriggerV0C(o.fBGtriggerV0C)
dd735cf0 32{
33 // Default constructor
28fdf12c 34 for(Int_t j=0; j<64; j++) {
a055ee24 35 fMultiplicity[j] = o.fMultiplicity[j];
d0502ab2 36 fAdc[j] = o.fAdc[j];
37 fTime[j] = o.fTime[j];
38 fWidth[j] = o.fWidth[j];
39 fBBFlag[j] = o.fBBFlag[j];
40 fBGFlag[j] = o.fBGFlag[j];
28fdf12c 41 }
dd735cf0 42}
43
d0502ab2 44//__________________________________________________________________________
a055ee24 45AliESDVZERO::AliESDVZERO(UInt_t BBtriggerV0A, UInt_t BGtriggerV0A,
46 UInt_t BBtriggerV0C, UInt_t BGtriggerV0C,
d0502ab2 47 Short_t *Multiplicity, Short_t *Adc,
48 Short_t *Time, Short_t *Width, Bool_t *BBFlag, Bool_t *BGFlag)
cd888a89 49 :TObject(),
a055ee24 50 fBBtriggerV0A(BBtriggerV0A),
51 fBGtriggerV0A(BGtriggerV0A),
52 fBBtriggerV0C(BBtriggerV0C),
53 fBGtriggerV0C(BGtriggerV0C)
54
dd735cf0 55{
56 // Constructor
28fdf12c 57 for(Int_t j=0; j<64; j++) {
a055ee24 58 fMultiplicity[j] = Multiplicity[j];
d0502ab2 59 fAdc[j] = Adc[j];
60 fTime[j] = Time[j];
61 fWidth[j] = Width[j];
62 fBBFlag[j] = BBFlag[j];
63 fBGFlag[j] = BGFlag[j];
28fdf12c 64 }
dd735cf0 65}
66
d0502ab2 67//__________________________________________________________________________
dd735cf0 68AliESDVZERO& AliESDVZERO::operator=(const AliESDVZERO& o)
69{
cd888a89 70
a055ee24 71 if(this==&o) return *this;
cd888a89 72 TObject::operator=(o);
dd735cf0 73 // Assignment operator
a055ee24 74 fBBtriggerV0A=o.fBBtriggerV0A;
75 fBGtriggerV0A=o.fBGtriggerV0A;
76 fBBtriggerV0C=o.fBBtriggerV0C;
77 fBGtriggerV0C=o.fBGtriggerV0C;
28fdf12c 78 for(Int_t j=0; j<64; j++) {
a055ee24 79 fMultiplicity[j] = o.fMultiplicity[j];
d0502ab2 80 fAdc[j] = o.fAdc[j];
81 fTime[j] = o.fTime[j];
82 fWidth[j] = o.fWidth[j];
83 fBBFlag[j] = o.fBBFlag[j];
84 fBGFlag[j] = o.fBGFlag[j];
28fdf12c 85 }
a055ee24 86 return *this;
87}
cd888a89 88
d0502ab2 89//__________________________________________________________________________
a055ee24 90Short_t AliESDVZERO::GetNbPMV0A()
91{
92 Short_t n=0;
93 for(Int_t i=32;i<64;i++)
94 if (fMultiplicity[i]>0) n++;
95 return n;
96}
dd735cf0 97
d0502ab2 98//__________________________________________________________________________
a055ee24 99Short_t AliESDVZERO::GetNbPMV0C()
100{
101 Short_t n=0;
102 for(Int_t i=0;i<32;i++)
103 if (fMultiplicity[i]>0) n++;
104 return n;
105}
dd735cf0 106
d0502ab2 107//__________________________________________________________________________
a055ee24 108Int_t AliESDVZERO::GetMTotV0A()
109{
110 Int_t n=0;
111 for(Int_t i=32;i<64;i++)
112 n+= (Int_t) fMultiplicity[i];
113 return n;
114}
115
d0502ab2 116//__________________________________________________________________________
a055ee24 117Int_t AliESDVZERO::GetMTotV0C()
118{
119 Int_t n=0;
120 for(Int_t i=0;i<32;i++)
121 n+= (Int_t) fMultiplicity[i];
122 return n;
123}
124
d0502ab2 125//__________________________________________________________________________
a055ee24 126Int_t* AliESDVZERO::GetMRingV0A()
127{
28fdf12c 128// cout << "AliESDVZERO::GetMRingV0C() not supported any more" << endl;
129// cout << "use Int_t AliESDVZERO::GetMRingV0C(Int_t ring)" << endl;
130 AliInfo("AliESDVZERO::GetMRingV0C() not supported any more");
131 AliInfo("use Int_t AliESDVZERO::GetMRingV0C(Int_t ring)");
a055ee24 132 return 0x0;
133}
134
d0502ab2 135//__________________________________________________________________________
a055ee24 136Int_t* AliESDVZERO::GetMRingV0C()
137{
28fdf12c 138// cout << "AliESDVZERO::GetMRingV0C() not supported any more" << endl;
139// cout << "use Int_t AliESDVZERO::GetMRingV0C(Int_t ring)" << endl;
140 AliInfo("AliESDVZERO::GetMRingV0C() not supported any more");
141 AliInfo("use Int_t AliESDVZERO::GetMRingV0C(Int_t ring)");
a055ee24 142 return 0x0;
dd735cf0 143}
144
d0502ab2 145//__________________________________________________________________________
a055ee24 146Int_t AliESDVZERO::GetMRingV0A(Int_t ring)
147{
148 if (OutOfRange(ring, "AliESDVZERO:::GetMRingV0A",4)) return -1;
149 Int_t n=0;
732a24fe 150
a055ee24 151 if (ring == 0) for(Int_t i=32;i<40;i++) n += (Int_t) fMultiplicity[i];
152 if (ring == 1) for(Int_t i=40;i<48;i++) n += (Int_t) fMultiplicity[i];
153 if (ring == 2) for(Int_t i=48;i<56;i++) n += (Int_t) fMultiplicity[i];
154 if (ring == 3) for(Int_t i=56;i<64;i++) n += (Int_t) fMultiplicity[i];
155 return n ;
156}
732a24fe 157
d0502ab2 158//__________________________________________________________________________
a055ee24 159Int_t AliESDVZERO::GetMRingV0C(Int_t ring)
160{
161 if (OutOfRange(ring, "AliESDVZERO:::GetMRingV0C",4)) return -1;
162 Int_t n=0;
732a24fe 163
d0502ab2 164 if (ring == 0) for(Int_t i=0;i<8;i++) n += (Int_t) fMultiplicity[i];
165 if (ring == 1) for(Int_t i=8;i<16;i++) n += (Int_t) fMultiplicity[i];
a055ee24 166 if (ring == 2) for(Int_t i=16;i<24;i++) n += (Int_t) fMultiplicity[i];
167 if (ring == 3) for(Int_t i=24;i<32;i++) n += (Int_t) fMultiplicity[i];
168 return n ;
732a24fe 169}
170
d0502ab2 171//__________________________________________________________________________
a055ee24 172Int_t AliESDVZERO::GetMultiplicity(Int_t i)
173
174{
175 if (OutOfRange(i, "AliESDVZERO::GetMultiplicity:",64)) return -1;
176 return fMultiplicity[i];
177}
178
d0502ab2 179//__________________________________________________________________________
28fdf12c 180Int_t AliESDVZERO::GetMultiplicityV0A(Int_t i)
181
182{
183 if (OutOfRange(i, "AliESDVZERO::GetMultiplicityV0A:",32)) return -1;
184 return fMultiplicity[32+i];
185}
186
d0502ab2 187//__________________________________________________________________________
28fdf12c 188Int_t AliESDVZERO::GetMultiplicityV0C(Int_t i)
189
190{
191 if (OutOfRange(i, "AliESDVZERO::GetMultiplicityV0C:",32)) return -1;
192 return fMultiplicity[i];
193}
194
d0502ab2 195//__________________________________________________________________________
28fdf12c 196Int_t AliESDVZERO::GetAdc(Int_t i)
197
198{
199 if (OutOfRange(i, "AliESDVZERO::GetAdc:",64)) return -1;
200 return fAdc[i];
201}
202
d0502ab2 203//__________________________________________________________________________
204Int_t AliESDVZERO::GetAdcV0A(Int_t i)
28fdf12c 205
206{
d0502ab2 207 if (OutOfRange(i, "AliESDVZERO::GetAdcV0A:",32)) return -1;
208 return fAdc[32+i];
28fdf12c 209}
210
d0502ab2 211//__________________________________________________________________________
212Int_t AliESDVZERO::GetAdcV0C(Int_t i)
28fdf12c 213
214{
d0502ab2 215 if (OutOfRange(i, "AliESDVZERO::GetAdcV0C:",32)) return -1;
216 return fAdc[i];
28fdf12c 217}
218
d0502ab2 219//__________________________________________________________________________
28fdf12c 220Int_t AliESDVZERO::GetTime(Int_t i)
221
222{
223 if (OutOfRange(i, "AliESDVZERO::GetTime:",64)) return -1;
224 return fTime[i];
225}
226
d0502ab2 227//__________________________________________________________________________
228Int_t AliESDVZERO::GetTimeV0A(Int_t i)
229
230{
231 if (OutOfRange(i, "AliESDVZERO::GetTimeV0A:",32)) return -1;
232 return fTime[32+i];
233}
234
235//__________________________________________________________________________
28fdf12c 236Int_t AliESDVZERO::GetTimeV0C(Int_t i)
237
238{
239 if (OutOfRange(i, "AliESDVZERO::GetTimeV0C:",32)) return -1;
240 return fTime[i];
241}
242
d0502ab2 243//__________________________________________________________________________
244Int_t AliESDVZERO::GetWidth(Int_t i)
28fdf12c 245
246{
d0502ab2 247 if (OutOfRange(i, "AliESDVZERO::GetWidth:",64)) return -1;
248 return fWidth[i];
249}
250
251//__________________________________________________________________________
252Int_t AliESDVZERO::GetWidthV0A(Int_t i)
253
254{
255 if (OutOfRange(i, "AliESDVZERO::GetWidthV0A:",32)) return -1;
256 return fWidth[32+i];
257}
258
259//__________________________________________________________________________
260Int_t AliESDVZERO::GetWidthV0C(Int_t i)
261
262{
263 if (OutOfRange(i, "AliESDVZERO::GetWidthV0C:",32)) return -1;
264 return fWidth[i];
28fdf12c 265}
266
d0502ab2 267//__________________________________________________________________________
a055ee24 268Bool_t AliESDVZERO::BBTriggerV0A(Int_t i)
269{
270 if (OutOfRange(i, "AliESDVZERO:::BBTriggerV0A",32)) return kFALSE;
271 UInt_t test = 1;
272 return ( fBBtriggerV0A & (test << i) ? kTRUE : kFALSE );
273}
274
d0502ab2 275//__________________________________________________________________________
a055ee24 276Bool_t AliESDVZERO::BGTriggerV0A(Int_t i)
277{
278 if (OutOfRange(i, "AliESDVZERO:::BGTriggerV0A",32)) return kFALSE;
279 UInt_t test = 1;
280 return ( fBGtriggerV0A & (test << i) ? kTRUE : kFALSE );
281}
282
d0502ab2 283//__________________________________________________________________________
a055ee24 284Bool_t AliESDVZERO::BBTriggerV0C(Int_t i)
285{
286 if (OutOfRange(i, "AliESDVZERO:::BBTriggerV0C",32)) return kFALSE;
287 UInt_t test = 1;
288 return ( fBBtriggerV0C & (test << i) ? kTRUE : kFALSE );
289}
290
d0502ab2 291//__________________________________________________________________________
a055ee24 292Bool_t AliESDVZERO::BGTriggerV0C(Int_t i)
293{
294 if (OutOfRange(i, "AliESDVZERO:::BGTriggerV0C",32)) return kFALSE;
295 UInt_t test = 1;
296 return ( fBGtriggerV0C & (test << i) ? kTRUE : kFALSE );
297}
298
d0502ab2 299//__________________________________________________________________________
300Bool_t AliESDVZERO::GetBBFlag(Int_t i)
301
302{
303 if (OutOfRange(i, "AliESDVZERO::GetBBFlag:",64)) return kFALSE;
304 return fBBFlag[i];
305}
306
307//__________________________________________________________________________
308Bool_t AliESDVZERO::GetBGFlag(Int_t i)
309
310{
311 if (OutOfRange(i, "AliESDVZERO::GetBGFlag:",64)) return kFALSE;
312 return fBGFlag[i];
313}
314
315//__________________________________________________________________________
7cec0871 316Bool_t AliESDVZERO::OutOfRange(Int_t i, const char* /*s*/, Int_t upper) const
a055ee24 317{
318 // checks if i is a valid index. s = name of calling method
319 if (i > upper || i < 0) {
28fdf12c 320// cout << s << " Index " << i << " out of range" << endl;
321 AliInfo(Form("Index %d out of range",i));
322 return kTRUE;
a055ee24 323 }
324 return kFALSE;
325}
732a24fe 326