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