Line data Source code
1 : /**************************************************************************
2 : * Copyright(c) 1998-2007, ALICE Experiment at CERN, All rights reserved. *
3 : * *
4 : * Author: The ALICE Off-line Project. *
5 : * Contributors are mentioned in the code where appropriate. *
6 : * *
7 : * Permission to use, copy, modify and distribute this software and its *
8 : * documentation strictly for non-commercial purposes is hereby granted *
9 : * without fee, provided that the above copyright notice appears in all *
10 : * copies and that both the copyright notice and this permission notice *
11 : * appear in the supporting documentation. The authors make no claims *
12 : * about the suitability of this software for any purpose. It is *
13 : * provided "as is" without express or implied warranty. *
14 : **************************************************************************/
15 :
16 : /* $Id$ */
17 :
18 : //-------------------------------------------------------------------------
19 : // AOD event base class
20 : // Author: Markus Oldenburg, CERN
21 : //-------------------------------------------------------------------------
22 :
23 : #include "AliAODHeader.h"
24 : #include "AliCentrality.h"
25 : #include "AliEventplane.h"
26 : #include "AliMagF.h"
27 : #include <TGeoGlobalMagField.h>
28 : #include <TGeoMatrix.h>
29 : #include <TObjString.h>
30 :
31 170 : ClassImp(AliAODHeader)
32 :
33 : //______________________________________________________________________________
34 : AliAODHeader::AliAODHeader() :
35 2 : AliVAODHeader(),
36 2 : fMagneticField(-999.),
37 2 : fMuonMagFieldScale(-999.),
38 2 : fCentrality(-999.),
39 2 : fEventplane(-999.),
40 2 : fEventplaneMag(-999.),
41 2 : fEventplaneQx(-999.),
42 2 : fEventplaneQy(-999.),
43 2 : fZDCN1Energy(-999.),
44 2 : fZDCP1Energy(-999.),
45 2 : fZDCN2Energy(-999.),
46 2 : fZDCP2Energy(-999.),
47 2 : fNQTheta(0),
48 2 : fQTheta(0x0),
49 2 : fTriggerMask(0),
50 2 : fTriggerMaskNext50(0),
51 2 : fFiredTriggers(),
52 2 : fRunNumber(-999),
53 2 : fRefMult(-999),
54 2 : fRefMultPos(-999),
55 2 : fRefMultNeg(-999),
56 2 : fNMuons(0),
57 2 : fNDimuons(0),
58 2 : fNGlobalMuons(0), // AU
59 2 : fNGlobalDimuons(0), // AU
60 2 : fDAQAttributes(0),
61 2 : fEventType(0),
62 2 : fOrbitNumber(0),
63 2 : fPeriodNumber(0),
64 2 : fBunchCrossNumber(0),
65 2 : fRefMultComb05(-999),
66 2 : fRefMultComb08(-999),
67 2 : fRefMultComb10(-999),
68 2 : fTriggerCluster(0),
69 2 : fDiamondZ(0.),
70 2 : fDiamondSig2Z(0.),
71 2 : fOfflineTrigger(0),
72 2 : fESDFileName(""),
73 2 : fEventNumberESDFile(-1),
74 2 : fNumberESDTracks(-1),
75 2 : fL0TriggerInputs(0),
76 2 : fL1TriggerInputs(0),
77 2 : fL2TriggerInputs(0),
78 2 : fTPConlyRefMult(-1),
79 2 : fCentralityP(0),
80 2 : fEventplaneP(0),
81 2 : fIRInt2InteractionsMap(0),
82 2 : fIRInt1InteractionsMap(0)
83 10 : {
84 : // default constructor
85 :
86 2 : SetName("header");
87 12 : for(int j=0; j<2; j++) fZDCEMEnergy[j] = -999.;
88 12 : for(Int_t i=0; i<2; i++) fDiamondXY[i]=0.;
89 2 : fDiamondCovXY[0]=fDiamondCovXY[2]=3.*3.;
90 2 : fDiamondCovXY[1]=0.;
91 24 : for (Int_t m=0; m<kNPHOSMatrix; m++) fPHOSMatrix[m]=NULL;
92 92 : for (Int_t sm=0; sm<kNEMCALMatrix; sm++) fEMCALMatrix[sm]=NULL;
93 28 : for (Int_t i = 0; i < 6; i++) fITSClusters[i] = 0;
94 260 : for (Int_t j=0; j<64; ++j) fVZEROEqFactors[j]=-1;
95 20 : for (Int_t i=0; i<kT0SpreadSize;i++) fT0spread[i]=0;
96 4 : }
97 :
98 : //______________________________________________________________________________
99 : AliAODHeader::AliAODHeader(Int_t nRun,
100 : UShort_t nBunchX,
101 : UInt_t nOrbit,
102 : UInt_t nPeriod,
103 : const Char_t *title) :
104 0 : AliVAODHeader(),
105 0 : fMagneticField(-999.),
106 0 : fMuonMagFieldScale(-999.),
107 0 : fCentrality(-999.),
108 0 : fEventplane(-999.),
109 0 : fEventplaneMag(-999.),
110 0 : fEventplaneQx(-999.),
111 0 : fEventplaneQy(-999.),
112 0 : fZDCN1Energy(-999.),
113 0 : fZDCP1Energy(-999.),
114 0 : fZDCN2Energy(-999.),
115 0 : fZDCP2Energy(-999.),
116 0 : fNQTheta(0),
117 0 : fQTheta(0x0),
118 0 : fTriggerMask(0),
119 0 : fTriggerMaskNext50(0),
120 0 : fFiredTriggers(),
121 0 : fRunNumber(nRun),
122 0 : fRefMult(-999),
123 0 : fRefMultPos(-999),
124 0 : fRefMultNeg(-999),
125 0 : fNMuons(0),
126 0 : fNDimuons(0),
127 0 : fNGlobalMuons(0), // AU
128 0 : fNGlobalDimuons(0), // AU
129 0 : fDAQAttributes(0),
130 0 : fEventType(0),
131 0 : fOrbitNumber(nOrbit),
132 0 : fPeriodNumber(nPeriod),
133 0 : fBunchCrossNumber(nBunchX),
134 0 : fRefMultComb05(-999),
135 0 : fRefMultComb08(-999),
136 0 : fRefMultComb10(-999),
137 0 : fTriggerCluster(0),
138 0 : fDiamondZ(0.),
139 0 : fDiamondSig2Z(0.),
140 0 : fOfflineTrigger(0),
141 0 : fESDFileName(""),
142 0 : fEventNumberESDFile(-1),
143 0 : fNumberESDTracks(-1),
144 0 : fL0TriggerInputs(0),
145 0 : fL1TriggerInputs(0),
146 0 : fL2TriggerInputs(0),
147 0 : fTPConlyRefMult(-1),
148 0 : fCentralityP(0),
149 0 : fEventplaneP(0),
150 0 : fIRInt2InteractionsMap(0),
151 0 : fIRInt1InteractionsMap(0)
152 0 : {
153 : // constructor
154 :
155 0 : SetName("header");
156 0 : SetTitle(title);
157 0 : for(int j=0; j<2; j++) fZDCEMEnergy[j] = -999.;
158 0 : for(Int_t i=0; i<2; i++) fDiamondXY[i]=0.;
159 0 : fDiamondCovXY[0]=fDiamondCovXY[2]=3.*3.;
160 0 : fDiamondCovXY[1]=0.;
161 0 : for (Int_t m=0; m<kNPHOSMatrix; m++) fPHOSMatrix[m]=NULL;
162 0 : for (Int_t sm=0; sm<kNEMCALMatrix; sm++) fEMCALMatrix[sm]=NULL;
163 0 : for (Int_t j=0; j<64; ++j) fVZEROEqFactors[j]=-1;
164 0 : for (Int_t i=0; i<kT0SpreadSize;i++) fT0spread[i]=0;
165 0 : }
166 :
167 : //______________________________________________________________________________
168 : AliAODHeader::AliAODHeader(Int_t nRun,
169 : UShort_t nBunchX,
170 : UInt_t nOrbit,
171 : UInt_t nPeriod,
172 : Int_t refMult,
173 : Int_t refMultPos,
174 : Int_t refMultNeg,
175 : Int_t refMultComb05,
176 : Int_t refMultComb08,
177 : Int_t refMultComb10,
178 : Double_t magField,
179 : Double_t muonMagFieldScale,
180 : Double_t cent,
181 : Double_t eventplane,
182 : Double_t n1Energy,
183 : Double_t p1Energy,
184 : Double_t n2Energy,
185 : Double_t p2Energy,
186 : Double_t *emEnergy,
187 : ULong64_t trigMask,
188 : ULong64_t trigMask50,
189 : UChar_t trigClus,
190 : UInt_t evttype,
191 : const Float_t *vzeroEqFactors,
192 : const Char_t *title,
193 : Int_t nMuons,
194 : Int_t nDimuons,
195 : Int_t nGlobalMuons, // AU
196 : Int_t nGlobalDimuons,
197 : UInt_t daqAttrib) : // AU
198 0 : AliVAODHeader(),
199 0 : fMagneticField(magField),
200 0 : fMuonMagFieldScale(muonMagFieldScale),
201 0 : fCentrality(cent),
202 0 : fEventplane(eventplane),
203 0 : fEventplaneMag(0),
204 0 : fEventplaneQx(0),
205 0 : fEventplaneQy(0),
206 0 : fZDCN1Energy(n1Energy),
207 0 : fZDCP1Energy(p1Energy),
208 0 : fZDCN2Energy(n2Energy),
209 0 : fZDCP2Energy(p2Energy),
210 0 : fNQTheta(0),
211 0 : fQTheta(0x0),
212 0 : fTriggerMask(trigMask),
213 0 : fTriggerMaskNext50(trigMask50),
214 0 : fFiredTriggers(),
215 0 : fRunNumber(nRun),
216 0 : fRefMult(refMult),
217 0 : fRefMultPos(refMultPos),
218 0 : fRefMultNeg(refMultNeg),
219 0 : fNMuons(nMuons),
220 0 : fNDimuons(nDimuons),
221 0 : fNGlobalMuons(nGlobalMuons), // AU
222 0 : fNGlobalDimuons(nGlobalDimuons), // AU
223 0 : fDAQAttributes(daqAttrib),
224 0 : fEventType(evttype),
225 0 : fOrbitNumber(nOrbit),
226 0 : fPeriodNumber(nPeriod),
227 0 : fBunchCrossNumber(nBunchX),
228 0 : fRefMultComb05(refMultComb05),
229 0 : fRefMultComb08(refMultComb08),
230 0 : fRefMultComb10(refMultComb10),
231 0 : fTriggerCluster(trigClus),
232 0 : fDiamondZ(0.),
233 0 : fDiamondSig2Z(0.),
234 0 : fOfflineTrigger(0),
235 0 : fESDFileName(""),
236 0 : fEventNumberESDFile(-1),
237 0 : fNumberESDTracks(-1),
238 0 : fL0TriggerInputs(0),
239 0 : fL1TriggerInputs(0),
240 0 : fL2TriggerInputs(0),
241 0 : fTPConlyRefMult(-1),
242 0 : fCentralityP(0),
243 0 : fEventplaneP(0),
244 0 : fIRInt2InteractionsMap(0),
245 0 : fIRInt1InteractionsMap(0)
246 0 : {
247 : // constructor
248 :
249 0 : SetName("header");
250 0 : SetTitle(title);
251 0 : for(int j=0; j<2; j++) fZDCEMEnergy[j] = emEnergy[j];
252 0 : for(Int_t i=0; i<2; i++) fDiamondXY[i]=0.;
253 0 : fDiamondCovXY[0]=fDiamondCovXY[2]=3.*3.;
254 0 : fDiamondCovXY[1]=0.;
255 0 : for (Int_t m=0; m<kNPHOSMatrix; m++) fPHOSMatrix[m]=NULL;
256 0 : for (Int_t sm=0; sm<kNEMCALMatrix; sm++) fEMCALMatrix[sm]=NULL;
257 0 : for (Int_t i = 0; i < 6; i++) fITSClusters[i] = 0;
258 0 : if (vzeroEqFactors) for (Int_t j=0; j<64; ++j) fVZEROEqFactors[j] = vzeroEqFactors[j];
259 0 : for (Int_t i=0; i<kT0SpreadSize;i++) fT0spread[i]=0;
260 0 : }
261 :
262 : //______________________________________________________________________________
263 : AliAODHeader::~AliAODHeader()
264 0 : {
265 : // destructor
266 0 : delete fCentralityP;
267 0 : delete fEventplaneP;
268 0 : RemoveQTheta();
269 0 : }
270 :
271 : //______________________________________________________________________________
272 : AliAODHeader::AliAODHeader(const AliAODHeader& hdr) :
273 0 : AliVAODHeader(hdr),
274 0 : fMagneticField(hdr.fMagneticField),
275 0 : fMuonMagFieldScale(hdr.fMuonMagFieldScale),
276 0 : fCentrality(hdr.fCentrality),
277 0 : fEventplane(hdr.fEventplane),
278 0 : fEventplaneMag(hdr.fEventplaneMag),
279 0 : fEventplaneQx(hdr.fEventplaneQx),
280 0 : fEventplaneQy(hdr.fEventplaneQy),
281 0 : fZDCN1Energy(hdr.fZDCN1Energy),
282 0 : fZDCP1Energy(hdr.fZDCP1Energy),
283 0 : fZDCN2Energy(hdr.fZDCN2Energy),
284 0 : fZDCP2Energy(hdr.fZDCP2Energy),
285 0 : fNQTheta(0),
286 0 : fQTheta(0x0),
287 0 : fTriggerMask(hdr.fTriggerMask),
288 0 : fTriggerMaskNext50(hdr.fTriggerMaskNext50),
289 0 : fFiredTriggers(hdr.fFiredTriggers),
290 0 : fRunNumber(hdr.fRunNumber),
291 0 : fRefMult(hdr.fRefMult),
292 0 : fRefMultPos(hdr.fRefMultPos),
293 0 : fRefMultNeg(hdr.fRefMultNeg),
294 0 : fNMuons(hdr.fNMuons),
295 0 : fNDimuons(hdr.fNDimuons),
296 0 : fNGlobalMuons(hdr.fNGlobalMuons), // AU
297 0 : fNGlobalDimuons(hdr.fNGlobalDimuons), // AU
298 0 : fEventType(hdr.fEventType),
299 0 : fOrbitNumber(hdr.fOrbitNumber),
300 0 : fPeriodNumber(hdr.fPeriodNumber),
301 0 : fBunchCrossNumber(hdr.fBunchCrossNumber),
302 0 : fRefMultComb05(hdr.fRefMultComb05),
303 0 : fRefMultComb08(hdr.fRefMultComb08),
304 0 : fRefMultComb10(hdr.fRefMultComb10),
305 0 : fTriggerCluster(hdr.fTriggerCluster),
306 0 : fDiamondZ(hdr.fDiamondZ),
307 0 : fDiamondSig2Z(hdr.fDiamondSig2Z),
308 0 : fOfflineTrigger(hdr.fOfflineTrigger),
309 0 : fESDFileName(hdr.fESDFileName),
310 0 : fEventNumberESDFile(hdr.fEventNumberESDFile),
311 0 : fNumberESDTracks(hdr.fNumberESDTracks),
312 0 : fL0TriggerInputs(hdr.fL0TriggerInputs),
313 0 : fL1TriggerInputs(hdr.fL1TriggerInputs),
314 0 : fL2TriggerInputs(hdr.fL2TriggerInputs),
315 0 : fTPConlyRefMult(hdr.fTPConlyRefMult),
316 0 : fCentralityP(new AliCentrality(*hdr.fCentralityP)),
317 0 : fEventplaneP(new AliEventplane(*hdr.fEventplaneP)),
318 0 : fIRInt2InteractionsMap(hdr.fIRInt2InteractionsMap),
319 0 : fIRInt1InteractionsMap(hdr.fIRInt1InteractionsMap)
320 0 : {
321 : // Copy constructor.
322 :
323 0 : SetName(hdr.fName);
324 0 : SetTitle(hdr.fTitle);
325 0 : SetQTheta(hdr.fQTheta, hdr.fNQTheta);
326 0 : SetZDCEMEnergy(hdr.fZDCEMEnergy[0], hdr.fZDCEMEnergy[1]);
327 0 : for(Int_t i=0; i<2; i++) fDiamondXY[i]=hdr.fDiamondXY[i];
328 0 : for(Int_t i=0; i<3; i++) fDiamondCovXY[i]=hdr.fDiamondCovXY[i];
329 :
330 :
331 0 : for(Int_t m=0; m<kNPHOSMatrix; m++){
332 0 : if(hdr.fPHOSMatrix[m])
333 0 : fPHOSMatrix[m]=new TGeoHMatrix(*(hdr.fPHOSMatrix[m])) ;
334 : else
335 0 : fPHOSMatrix[m]=0;
336 : }
337 :
338 0 : for(Int_t sm=0; sm<kNEMCALMatrix; sm++){
339 0 : if(hdr.fEMCALMatrix[sm])
340 0 : fEMCALMatrix[sm]=new TGeoHMatrix(*(hdr.fEMCALMatrix[sm])) ;
341 : else
342 0 : fEMCALMatrix[sm]=0;
343 : }
344 0 : for (Int_t i = 0; i < 6; i++) fITSClusters[i] = hdr.fITSClusters[i];
345 0 : for (Int_t j=0; j<64; ++j) fVZEROEqFactors[j]=hdr.fVZEROEqFactors[j];
346 0 : for (Int_t i=0; i<kT0SpreadSize;i++) fT0spread[i]=hdr.fT0spread[i];
347 :
348 0 : }
349 :
350 : //______________________________________________________________________________
351 : AliAODHeader& AliAODHeader::operator=(const AliAODHeader& hdr)
352 : {
353 : // Assignment operator
354 0 : if(this!=&hdr) {
355 :
356 0 : AliVHeader::operator=(hdr);
357 :
358 0 : fMagneticField = hdr.fMagneticField;
359 0 : fMuonMagFieldScale= hdr.fMuonMagFieldScale;
360 0 : fCentrality = hdr.fCentrality;
361 0 : fEventplane = hdr.fEventplane;
362 0 : fEventplaneMag = hdr.fEventplaneMag;
363 0 : fEventplaneQx = hdr.fEventplaneQx;
364 0 : fEventplaneQy = hdr.fEventplaneQy;
365 0 : fZDCN1Energy = hdr.fZDCN1Energy;
366 0 : fZDCP1Energy = hdr.fZDCP1Energy;
367 0 : fZDCN2Energy = hdr.fZDCN2Energy;
368 0 : fZDCP2Energy = hdr.fZDCP2Energy;
369 0 : fTriggerMask = hdr.fTriggerMask;
370 0 : fTriggerMaskNext50= hdr.fTriggerMaskNext50;
371 0 : fFiredTriggers = hdr.fFiredTriggers;
372 0 : fRunNumber = hdr.fRunNumber;
373 0 : fRefMult = hdr.fRefMult;
374 0 : fRefMultPos = hdr.fRefMultPos;
375 0 : fRefMultNeg = hdr.fRefMultNeg;
376 0 : fEventType = hdr.fEventType;
377 0 : fOrbitNumber = hdr.fOrbitNumber;
378 0 : fPeriodNumber = hdr.fPeriodNumber;
379 0 : fBunchCrossNumber = hdr.fBunchCrossNumber;
380 0 : fRefMultComb05 = hdr.fRefMultComb05;
381 0 : fRefMultComb08 = hdr.fRefMultComb08;
382 0 : fRefMultComb10 = hdr.fRefMultComb10;
383 :
384 0 : fTriggerCluster = hdr.fTriggerCluster;
385 0 : fNMuons = hdr.fNMuons;
386 0 : fNDimuons = hdr.fNDimuons;
387 0 : fNGlobalMuons = hdr.fNGlobalMuons; // AU
388 0 : fNGlobalDimuons = hdr.fNGlobalDimuons; // AU
389 0 : fDAQAttributes = hdr.fDAQAttributes;
390 0 : fDiamondZ = hdr.fDiamondZ;
391 0 : fDiamondSig2Z = hdr.fDiamondSig2Z;
392 0 : fOfflineTrigger = hdr.fOfflineTrigger;
393 0 : fESDFileName = hdr.fESDFileName;
394 0 : fEventNumberESDFile = hdr.fEventNumberESDFile;
395 0 : fNumberESDTracks = hdr.fNumberESDTracks;
396 0 : fL0TriggerInputs = hdr.fL0TriggerInputs;
397 0 : fL1TriggerInputs = hdr.fL1TriggerInputs;
398 0 : fL2TriggerInputs = hdr.fL2TriggerInputs;
399 0 : fTPConlyRefMult = hdr.fTPConlyRefMult;
400 :
401 0 : fIRInt2InteractionsMap = hdr.fIRInt2InteractionsMap;
402 0 : fIRInt1InteractionsMap = hdr.fIRInt1InteractionsMap;
403 :
404 0 : if(hdr.fEventplaneP){
405 0 : if(fEventplaneP)*fEventplaneP = *hdr.fEventplaneP;
406 0 : else fEventplaneP = new AliEventplane(*hdr.fEventplaneP);
407 : }
408 :
409 0 : if(hdr.fCentralityP){
410 0 : if(fCentralityP)*fCentralityP = *hdr.fCentralityP;
411 0 : else fCentralityP = new AliCentrality(*hdr.fCentralityP);
412 : }
413 :
414 0 : SetName(hdr.fName);
415 0 : SetTitle(hdr.fTitle);
416 0 : SetQTheta(hdr.fQTheta, hdr.fNQTheta);
417 0 : SetZDCEMEnergy(hdr.fZDCEMEnergy[0], hdr.fZDCEMEnergy[1]);
418 0 : for(Int_t i=0; i<2; i++) fDiamondXY[i]=hdr.fDiamondXY[i];
419 0 : for(Int_t i=0; i<3; i++) fDiamondCovXY[i]=hdr.fDiamondCovXY[i];
420 :
421 0 : for(Int_t m=0; m<kNPHOSMatrix; m++){
422 0 : if(hdr.fPHOSMatrix[m]){
423 0 : if(fPHOSMatrix[m])delete fPHOSMatrix[m];
424 0 : fPHOSMatrix[m]=new TGeoHMatrix(*(hdr.fPHOSMatrix[m])) ;
425 0 : }
426 : else
427 0 : fPHOSMatrix[m]=0;
428 : }
429 :
430 0 : for(Int_t sm=0; sm<kNEMCALMatrix; sm++){
431 0 : if(hdr.fEMCALMatrix[sm]){
432 0 : if(fEMCALMatrix[sm])delete fEMCALMatrix[sm];
433 0 : fEMCALMatrix[sm]=new TGeoHMatrix(*(hdr.fEMCALMatrix[sm])) ;
434 0 : }
435 : else
436 0 : fEMCALMatrix[sm]=0;
437 : }
438 :
439 0 : }
440 :
441 0 : for (Int_t i = 0; i < 6; i++) fITSClusters[i] = hdr.fITSClusters[i];
442 0 : for (Int_t j=0; j<64; ++j) fVZEROEqFactors[j] = hdr.fVZEROEqFactors[j];
443 0 : for (Int_t i=0; i<kT0SpreadSize;i++) fT0spread[i]=hdr.fT0spread[i];
444 :
445 0 : return *this;
446 0 : }
447 :
448 : //______________________________________________________________________________
449 : void AliAODHeader::SetQTheta(Double_t *QTheta, UInt_t size)
450 : {
451 0 : if (QTheta && size>0) {
452 0 : if (size != (UInt_t)fNQTheta) {
453 0 : RemoveQTheta();
454 0 : fNQTheta = size;
455 0 : fQTheta = new Double_t[fNQTheta];
456 0 : }
457 :
458 0 : for (Int_t i = 0; i < fNQTheta; i++) {
459 0 : fQTheta[i] = QTheta[i];
460 : }
461 0 : } else {
462 0 : RemoveQTheta();
463 : }
464 :
465 0 : return;
466 : }
467 :
468 : //______________________________________________________________________________
469 : Double_t AliAODHeader::GetQTheta(UInt_t i) const
470 : {
471 0 : if (fQTheta && i < (UInt_t)fNQTheta) {
472 0 : return fQTheta[i];
473 : } else {
474 0 : return -999.;
475 : }
476 0 : }
477 :
478 : //______________________________________________________________________________
479 : void AliAODHeader::RemoveQTheta()
480 : {
481 0 : delete[] fQTheta;
482 0 : fQTheta = 0x0;
483 0 : fNQTheta = 0;
484 :
485 0 : return;
486 : }
487 :
488 : void AliAODHeader::Clear(Option_t* /*opt*/)
489 : {
490 : // Clear memory
491 0 : RemoveQTheta();
492 0 : if (fCentralityP){
493 0 : delete fCentralityP;
494 0 : fCentralityP = 0;
495 0 : fCentrality = -999;
496 0 : }
497 0 : if (fEventplaneP){
498 0 : delete fEventplaneP;
499 0 : fEventplaneP = 0;
500 0 : fEventplane = -999;
501 0 : fEventplaneMag = -999.;
502 0 : fEventplaneQx = -999.;
503 0 : fEventplaneQy = -999.;
504 0 : }
505 0 : return;
506 : }
507 :
508 : //______________________________________________________________________________
509 : void AliAODHeader::Print(Option_t* /*option*/) const
510 : {
511 : // prints event information
512 :
513 0 : printf("Run # : %d\n", fRunNumber);
514 0 : printf("Bunch Crossing # : %d\n", fBunchCrossNumber);
515 0 : printf("Orbit Number # : %d\n", fOrbitNumber);
516 0 : printf("Period Number # : %d\n", fPeriodNumber);
517 0 : printf("Trigger mask : %lld\n", fTriggerMask);
518 0 : printf("Trigger mask(next50) : %lld\n", fTriggerMaskNext50);
519 0 : printf("Trigger cluster : %d\n", fTriggerCluster);
520 0 : printf("Event Type : %d\n", fEventType);
521 0 : printf("Magnetic field : %f\n", fMagneticField);
522 0 : printf("Muon mag. field scale : %f\n", fMuonMagFieldScale);
523 :
524 0 : printf("Centrality : %f\n", fCentrality);
525 0 : printf("Event plane Ang : %f\n", fEventplane);
526 0 : printf("Event plane Mag : %f\n", fEventplaneMag);
527 0 : printf("Event plane Qx : %f\n", fEventplaneQx);
528 0 : printf("Event plane Qy : %f\n", fEventplaneQy);
529 0 : printf("ZDC N1 Energy : %f\n", fZDCN1Energy);
530 0 : printf("ZDC P1 Energy : %f\n", fZDCP1Energy);
531 0 : printf("ZDC N2 Energy : %f\n", fZDCN2Energy);
532 0 : printf("ZDC P2 Energy : %f\n", fZDCP2Energy);
533 0 : printf("ZDC EM1 Energy : %f\n", fZDCEMEnergy[0]);
534 0 : printf("ZDC EM2 Energy : %f\n", fZDCEMEnergy[1]);
535 0 : printf("ref. Multiplicity : %d\n", fRefMult);
536 0 : printf("ref. Multiplicity (pos) : %d\n", fRefMultPos);
537 0 : printf("ref. Multiplicity (neg) : %d\n", fRefMultNeg);
538 0 : printf("ref. Mult.Comb |eta|<.5 : %d\n", fRefMultComb05);
539 0 : printf("ref. Mult.Comb |eta|<.8 : %d\n", fRefMultComb08);
540 0 : printf("ref. Mult.Comb |eta|<1. : %d\n", fRefMultComb10);
541 0 : printf("number of muons : %d\n", fNMuons);
542 0 : printf("number of dimuons : %d\n", fNDimuons);
543 0 : printf("offline trigger : %u\n", fOfflineTrigger);
544 :
545 0 : if (fQTheta) {
546 0 : for (UInt_t i = 0; i<(UInt_t)fNQTheta; i++) {
547 0 : printf("QTheta[%d] : %13.3e\n", i, GetQTheta(i));
548 : }
549 0 : }
550 0 : printf("V0 Eq factors: ");
551 0 : for (Int_t j=0; j<64; ++j) printf(" %.3f",fVZEROEqFactors[j]);
552 0 : printf("\n");
553 :
554 0 : return;
555 : }
556 :
557 : //__________________________________________________________________________
558 : Int_t AliAODHeader::FindIRIntInteractionsBXMap(Int_t difference) const
559 : {
560 : //
561 : // The mapping is of 181 bits, from -90 to +90
562 : //
563 : Int_t bin=-1;
564 :
565 0 : if(difference<-90 || difference>90) return bin;
566 0 : else { bin = 90 + difference; }
567 :
568 0 : return bin;
569 0 : }
570 :
571 : //__________________________________________________________________________
572 : Int_t AliAODHeader::GetIRInt2ClosestInteractionMap() const
573 : {
574 : //
575 : // Calculation of the closest interaction
576 : //
577 : Int_t firstNegative=100;
578 0 : for(Int_t item=-1; item>=-90; item--) {
579 0 : Int_t bin = FindIRIntInteractionsBXMap(item);
580 0 : Bool_t isFired = fIRInt2InteractionsMap.TestBitNumber(bin);
581 0 : if(isFired) {
582 : firstNegative = item;
583 0 : break;
584 : }
585 0 : }
586 : Int_t firstPositive=100;
587 0 : for(Int_t item=1; item<=90; item++) {
588 0 : Int_t bin = FindIRIntInteractionsBXMap(item);
589 0 : Bool_t isFired = fIRInt2InteractionsMap.TestBitNumber(bin);
590 0 : if(isFired) {
591 : firstPositive = item;
592 0 : break;
593 : }
594 0 : }
595 :
596 0 : Int_t closest = firstPositive < TMath::Abs(firstNegative) ? firstPositive : TMath::Abs(firstNegative);
597 0 : if(firstPositive==100 && firstNegative==100) closest=0;
598 0 : return closest;
599 : }
600 :
601 : //__________________________________________________________________________
602 : Int_t AliAODHeader::GetIRInt1ClosestInteractionMap(Int_t gap) const
603 : {
604 : //
605 : // Calculation of the closest interaction
606 : // In case of VZERO (Int1) one has to introduce a gap
607 : // in order to avoid false positivies from after-pulses
608 :
609 : Int_t firstNegative=100;
610 0 : for(Int_t item=-1; item>=-90; item--) {
611 0 : Int_t bin = FindIRIntInteractionsBXMap(item);
612 0 : Bool_t isFired = fIRInt1InteractionsMap.TestBitNumber(bin);
613 0 : if(isFired) {
614 : firstNegative = item;
615 0 : break;
616 : }
617 0 : }
618 : Int_t firstPositive=100;
619 0 : for(Int_t item=1+gap; item<=90; item++) {
620 0 : Int_t bin = FindIRIntInteractionsBXMap(item);
621 0 : Bool_t isFired = fIRInt1InteractionsMap.TestBitNumber(bin);
622 0 : if(isFired) {
623 : firstPositive = item;
624 0 : break;
625 : }
626 0 : }
627 :
628 0 : Int_t closest = firstPositive < TMath::Abs(firstNegative) ? firstPositive : TMath::Abs(firstNegative);
629 0 : if(firstPositive==100 && firstNegative==100) closest=0;
630 0 : return closest;
631 : }
632 :
633 : //__________________________________________________________________________
634 : Int_t AliAODHeader::GetIRInt2LastInteractionMap() const
635 : {
636 : //
637 : // Calculation of the last interaction
638 : //
639 : Int_t lastNegative=0;
640 0 : for(Int_t item=-90; item<=-1; item++) {
641 0 : Int_t bin = FindIRIntInteractionsBXMap(item);
642 0 : Bool_t isFired = fIRInt2InteractionsMap.TestBitNumber(bin);
643 0 : if(isFired) {
644 : lastNegative = item;
645 0 : break;
646 : }
647 0 : }
648 : Int_t lastPositive=0;
649 0 : for(Int_t item=90; item>=1; item--) {
650 0 : Int_t bin = FindIRIntInteractionsBXMap(item);
651 0 : Bool_t isFired = fIRInt2InteractionsMap.TestBitNumber(bin);
652 0 : if(isFired) {
653 : lastPositive = item;
654 0 : break;
655 : }
656 0 : }
657 :
658 0 : Int_t last = lastPositive > TMath::Abs(lastNegative) ? lastPositive : TMath::Abs(lastNegative);
659 0 : return last;
660 : }
661 :
662 : //__________________________________________________________________________
663 : Bool_t AliAODHeader::InitMagneticField() const
664 : {
665 : // Create mag field from stored information
666 : //
667 : const double def5kg = 5.00667905807495117e+00;
668 : const double def2kg = 2.04487347602844238e+00;
669 : //
670 0 : AliMagF* fld = (AliMagF*) TGeoGlobalMagField::Instance()->GetField();
671 0 : if (fld) {
672 0 : if (TGeoGlobalMagField::Instance()->IsLocked()) {
673 0 : if (fld->TestBit(AliMagF::kOverrideGRP)) {
674 0 : AliInfo("ExpertMode!!! Information on magnet currents will be ignored !");
675 0 : AliInfo("ExpertMode!!! Running with the externally locked B field !");
676 0 : return kTRUE;
677 : }
678 : }
679 0 : AliInfo("Destroying existing B field instance!");
680 0 : delete TGeoGlobalMagField::Instance();
681 : }
682 : //
683 0 : double fc5 = fMagneticField/def5kg;
684 0 : double fc2 = fMagneticField/def2kg;
685 0 : Bool_t use5 = TMath::Abs(TMath::Abs(fc5)-1.) < TMath::Abs(TMath::Abs(fc2)-1.);
686 : //
687 0 : fld = new AliMagF("mag","mag",use5 ? fc5 : fc2, fMuonMagFieldScale, use5 ? AliMagF::k5kG : AliMagF::k2kG);
688 : //
689 0 : if (fld) {
690 0 : TGeoGlobalMagField::Instance()->SetField( fld );
691 0 : TGeoGlobalMagField::Instance()->Lock();
692 0 : AliInfo("Running with the B field constructed out of the AOD Header !");
693 0 : return kTRUE;
694 : }
695 : else {
696 0 : AliError("Failed to create a B field map !");
697 0 : return kFALSE;
698 : }
699 : //
700 0 : }
|