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