Updates
[u/mrichter/AliRoot.git] / ANALYSIS / AliCentralitySelectionTask.cxx
CommitLineData
01974bd1 1/**************************************************************************
2 * Copyright(c) 1998-2008, 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//*****************************************************
17// Class AliCentralitySelectionTask
18// Class to analyze determine centrality
19// author: Alberica Toia
20//*****************************************************
21
22#include "AliCentralitySelectionTask.h"
23
24#include <TTree.h>
25#include <TList.h>
26#include <TH1F.h>
27#include <TH2F.h>
28#include <TF1.h>
29#include <TProfile.h>
30#include <TFile.h>
31#include <TObjString.h>
32#include <TString.h>
33#include <TCanvas.h>
34#include <TROOT.h>
35#include <TDirectory.h>
36#include <TSystem.h>
37#include <iostream>
38
39#include "AliAnalysisManager.h"
40#include "AliHeader.h"
41#include "AliVEvent.h"
42#include "AliESD.h"
43#include "AliESDEvent.h"
44#include "AliESDHeader.h"
45#include "AliESDInputHandler.h"
46#include "AliESDZDC.h"
47#include "AliESDFMD.h"
48#include "AliESDTZERO.h"
49#include "AliESDVZERO.h"
50#include "AliESDtrackCuts.h"
51#include "AliESDVertex.h"
52#include "AliCentrality.h"
53#include "AliOADBCentrality.h"
54#include "AliOADBContainer.h"
55#include "AliMultiplicity.h"
56#include "AliAODHandler.h"
57#include "AliAODHeader.h"
58#include "AliAODEvent.h"
59#include "AliAODVertex.h"
60#include "AliAODVZERO.h"
61#include "AliAODTracklets.h"
62#include "AliAODMCHeader.h"
63#include "AliMCEventHandler.h"
64#include "AliMCEvent.h"
65#include "AliAODMCParticle.h"
66#include "AliMCParticle.h"
67#include "AliStack.h"
68#include "AliAnalysisTaskSE.h"
69#include "AliGenEventHeader.h"
70#include "AliGenHijingEventHeader.h"
8432b617 71#include "AliGenDPMjetEventHeader.h"
72#include "AliGenCocktailEventHeader.h"
01974bd1 73#include "AliPhysicsSelectionTask.h"
74#include "AliPhysicsSelection.h"
75#include "AliBackgroundSelection.h"
76#include "AliESDUtils.h"
77
78ClassImp(AliCentralitySelectionTask)
79
80
81//________________________________________________________________________
82AliCentralitySelectionTask::AliCentralitySelectionTask():
83AliAnalysisTaskSE(),
84 fAnalysisInput("ESD"),
85 fIsMCInput(kFALSE),
86 fCurrentRun(-1),
87 fUseScaling(0),
88 fUseCleaning(0),
89 fFillHistos(0),
90 fV0MScaleFactor(0),
91 fSPDScaleFactor(0),
92 fTPCScaleFactor(0),
93 fV0MScaleFactorMC(0),
94 fV0MSPDOutlierPar0(0),
95 fV0MSPDOutlierPar1(0),
96 fV0MTPCOutlierPar0(0),
97 fV0MTPCOutlierPar1(0),
98 fV0MSPDSigmaOutlierPar0(0),
99 fV0MSPDSigmaOutlierPar1(0),
100 fV0MSPDSigmaOutlierPar2(0),
101 fV0MTPCSigmaOutlierPar0(0),
102 fV0MTPCSigmaOutlierPar1(0),
103 fV0MTPCSigmaOutlierPar2(0),
104 fV0MZDCOutlierPar0(0),
105 fV0MZDCOutlierPar1(0),
106 fV0MZDCEcalOutlierPar0(0),
107 fV0MZDCEcalOutlierPar1(0),
108 fTrackCuts(0),
2d27827d 109 fEsdTrackCuts(0),
110 fEsdTrackCutsExtra1(0),
111 fEsdTrackCutsExtra2(0),
01974bd1 112 fZVCut(10),
113 fOutliersCut(5),
114 fQuality(999),
115 fIsSelected(0),
116 fMSL(0),
117 fMSH(0),
118 fMUL(0),
119 fMLL(0),
120 fEJE(0),
121 fEGA(0),
122 fPHS(0),
123 fMB(0),
124 fCVHN(0),
125 fCVLN(0),
126 fCVHNbit(0),
127 fCVLNbit(0),
128 fCCENT(0),
129 fCSEMI(0),
130 fCCENTbit(0),
131 fCSEMIbit(0),
132 fCentV0M(0),
133 fCentV0A(0),
9113c527 134 fCentV0A0(0),
2d12adde 135 fCentV0A123(0),
01974bd1 136 fCentV0C(0),
f9a774f9 137 fCentV0MEq(0),
138 fCentV0AEq(0),
139 fCentV0CEq(0),
01974bd1 140 fCentFMD(0),
141 fCentTRK(0),
142 fCentTKL(0),
143 fCentCL0(0),
144 fCentCL1(0),
145 fCentCND(0),
99029fba 146 fCentZNA(0),
f9a774f9 147 fCentZNC(0),
3a19f64f 148 fCentZPA(0),
149 fCentZPC(0),
39a3e400 150 fCentNPA(0),
01974bd1 151 fCentV0MvsFMD(0),
152 fCentTKLvsV0M(0),
153 fCentZEMvsZDC(0),
39a3e400 154 fCentV0Mtrue(0),
155 fCentV0Atrue(0),
156 fCentV0Ctrue(0),
f9a774f9 157 fCentV0MEqtrue(0),
158 fCentV0AEqtrue(0),
159 fCentV0CEqtrue(0),
39a3e400 160 fCentFMDtrue(0),
161 fCentTRKtrue(0),
162 fCentTKLtrue(0),
163 fCentCL0true(0),
164 fCentCL1true(0),
165 fCentCNDtrue(0),
166 fCentZNAtrue(0),
f9a774f9 167 fCentZNCtrue(0),
3a19f64f 168 fCentZPAtrue(0),
169 fCentZPCtrue(0),
01974bd1 170 fHtempV0M(0),
171 fHtempV0A(0),
9113c527 172 fHtempV0A0(0),
2d12adde 173 fHtempV0A123(0),
01974bd1 174 fHtempV0C(0),
f9a774f9 175 fHtempV0MEq(0),
176 fHtempV0AEq(0),
177 fHtempV0CEq(0),
01974bd1 178 fHtempFMD(0),
179 fHtempTRK(0),
180 fHtempTKL(0),
181 fHtempCL0(0),
182 fHtempCL1(0),
183 fHtempCND(0),
99029fba 184 fHtempZNA(0),
f9a774f9 185 fHtempZNC(0),
3a19f64f 186 fHtempZPA(0),
187 fHtempZPC(0),
01974bd1 188 fHtempV0MvsFMD(0),
189 fHtempTKLvsV0M(0),
190 fHtempZEMvsZDC(0),
39a3e400 191 fHtempNPA(0),
192 fHtempV0Mtrue(0),
193 fHtempV0Atrue(0),
194 fHtempV0Ctrue(0),
f9a774f9 195 fHtempV0MEqtrue(0),
196 fHtempV0AEqtrue(0),
197 fHtempV0CEqtrue(0),
39a3e400 198 fHtempFMDtrue(0),
199 fHtempTRKtrue(0),
200 fHtempTKLtrue(0),
201 fHtempCL0true(0),
202 fHtempCL1true(0),
203 fHtempCNDtrue(0),
204 fHtempZNAtrue(0),
f9a774f9 205 fHtempZNCtrue(0),
3a19f64f 206 fHtempZPAtrue(0),
207 fHtempZPCtrue(0),
01974bd1 208 fOutputList(0),
39a3e400 209 fHOutCentV0M(0),
210 fHOutCentV0A(0),
9113c527 211 fHOutCentV0A0(0),
2d12adde 212 fHOutCentV0A123(0),
39a3e400 213 fHOutCentV0C(0),
f9a774f9 214 fHOutCentV0MEq(0),
215 fHOutCentV0AEq(0),
216 fHOutCentV0CEq(0),
01974bd1 217 fHOutCentV0MCVHN(0),
218 fHOutCentV0MCVLN(0),
219 fHOutCentV0MCVHNinMB(0),
220 fHOutCentV0MCVLNinMB(0),
221 fHOutCentV0MCCENT(0),
222 fHOutCentV0MCSEMI(0),
223 fHOutCentV0MCCENTinMB(0),
224 fHOutCentV0MCSEMIinMB(0),
225 fHOutCentV0MMSL(0),
226 fHOutCentV0MMSH(0),
227 fHOutCentV0MMUL(0),
228 fHOutCentV0MMLL(0),
229 fHOutCentV0MEJE(0),
230 fHOutCentV0MEGA(0),
231 fHOutCentV0MPHS(0),
232 fHOutCentV0MMSLinMB(0),
233 fHOutCentV0MMSHinMB(0),
234 fHOutCentV0MMULinMB(0),
235 fHOutCentV0MMLLinMB(0),
236 fHOutCentV0MEJEinMB(0),
237 fHOutCentV0MEGAinMB(0),
238 fHOutCentV0MPHSinMB(0),
39a3e400 239 fHOutCentFMD(0),
240 fHOutCentTRK(0),
241 fHOutCentTKL(0),
242 fHOutCentCL0(0),
243 fHOutCentCL1(0),
244 fHOutCentCND(0),
245 fHOutCentNPA(0),
246 fHOutCentZNA(0),
f9a774f9 247 fHOutCentZNC(0),
3a19f64f 248 fHOutCentZPA(0),
249 fHOutCentZPC(0),
01974bd1 250 fHOutCentV0MvsFMD(0),
251 fHOutCentTKLvsV0M(0),
252 fHOutCentZEMvsZDC(0),
253 fHOutCentV0MvsCentCL1(0),
254 fHOutCentV0MvsCentTRK(0),
255 fHOutCentTRKvsCentCL1(0),
256 fHOutCentV0MvsCentZDC(0),
257 fHOutCentV0AvsCentV0C(0),
258 fHOutCentV0AvsCentTRK(0),
259 fHOutCentV0AvsCentCND(0),
260 fHOutCentV0AvsCentCL1(0),
261 fHOutCentV0CvsCentTRK(0),
262 fHOutCentV0CvsCentCND(0),
263 fHOutCentV0CvsCentCL1(0),
8432b617 264 fHOutCentNPAvsCentV0A(0),
265 fHOutCentNPAvsCentV0C(0),
266 fHOutCentNPAvsCentTRK(0),
267 fHOutCentNPAvsCentCND(0),
268 fHOutCentNPAvsCentCL1(0),
99029fba 269 fHOutCentZNAvsCentV0A(0),
270 fHOutCentZNAvsCentV0C(0),
271 fHOutCentZNAvsCentTRK(0),
272 fHOutCentZNAvsCentCND(0),
273 fHOutCentZNAvsCentCL1(0),
bfbc1975 274 fHOutCentZNAvsCentZPA(0),
01974bd1 275 fHOutMultV0AC(0),
276 fHOutMultV0M(0),
277 fHOutMultV0A(0),
9113c527 278 fHOutMultV0A0(0),
2d12adde 279 fHOutMultV0A123(0),
01974bd1 280 fHOutMultV0C(0),
f9a774f9 281 fHOutMultV0MEq(0),
282 fHOutMultV0AEq(0),
283 fHOutMultV0CEq(0),
e1d58f75 284 fHOutMultV0Mnc(0),
285 fHOutMultV0Anc(0),
286 fHOutMultV0Cnc(0),
01974bd1 287 fHOutMultV0O(0),
288 fHOutMultV0Cells(0),
289 fHOutMultFMD(0),
290 fHOutMultTRK(0),
291 fHOutMultTKL(0),
292 fHOutMultCL0(0),
293 fHOutMultCL1(0),
294 fHOutMultCND(0),
8432b617 295 fHOutMultNPA(0),
99029fba 296 fHOutMultZNA(0),
f9a774f9 297 fHOutMultZNC(0),
3a19f64f 298 fHOutMultZPA(0),
299 fHOutMultZPC(0),
01974bd1 300 fHOutMultV0MvsZDN(0),
301 fHOutMultZEMvsZDN(0),
302 fHOutMultV0MvsZDC(0),
303 fHOutMultZEMvsZDC(0),
304 fHOutMultZEMvsZDCw(0),
305 fHOutMultV0MvsCL1(0),
306 fHOutMultV0MvsTRK(0),
307 fHOutMultTRKvsCL1(0),
308 fHOutMultV0MvsV0O(0),
309 fHOutMultV0OvsCL1(0),
310 fHOutMultV0OvsTRK(0),
311 fHOutMultCL1vsTKL(0),
bfbc1975 312 fHOutMultZNAvsZPA(0),
01974bd1 313 fHOutCentV0Mqual1(0),
314 fHOutCentTRKqual1(0),
315 fHOutCentCL1qual1(0),
316 fHOutMultV0MvsCL1qual1(0),
317 fHOutMultV0MvsTRKqual1(0),
318 fHOutMultTRKvsCL1qual1(0),
319 fHOutCentV0Mqual2(0),
320 fHOutCentTRKqual2(0),
321 fHOutCentCL1qual2(0),
322 fHOutMultV0MvsCL1qual2(0),
323 fHOutMultV0MvsTRKqual2(0),
324 fHOutMultTRKvsCL1qual2(0),
325 fHOutQuality(0),
326 fHOutVertex(0),
327 fHOutVertexT0(0)
328{
329 // Default constructor
330 AliInfo("Centrality Selection enabled.");
331
332 fUseScaling=kTRUE;
333 fUseCleaning=kTRUE;
334 fFillHistos=kFALSE;
335 fBranchNames="ESD:AliESDRun.,AliESDHeader.,AliESDZDC.,AliESDFMD.,AliESDVZERO.,AliESDTZERO."
336 ",SPDVertex.,TPCVertex.,PrimaryVertex.,AliMultiplicity.,Tracks ";
337}
338
339//________________________________________________________________________
340AliCentralitySelectionTask::AliCentralitySelectionTask(const char *name):
341 AliAnalysisTaskSE(name),
342 fAnalysisInput("ESD"),
343 fIsMCInput(kFALSE),
344 fCurrentRun(-1),
345 fUseScaling(0),
346 fUseCleaning(0),
347 fFillHistos(0),
348 fV0MScaleFactor(0),
349 fSPDScaleFactor(0),
350 fTPCScaleFactor(0),
351 fV0MScaleFactorMC(0),
352 fV0MSPDOutlierPar0(0),
353 fV0MSPDOutlierPar1(0),
354 fV0MTPCOutlierPar0(0),
355 fV0MTPCOutlierPar1(0),
356 fV0MSPDSigmaOutlierPar0(0),
357 fV0MSPDSigmaOutlierPar1(0),
358 fV0MSPDSigmaOutlierPar2(0),
359 fV0MTPCSigmaOutlierPar0(0),
360 fV0MTPCSigmaOutlierPar1(0),
361 fV0MTPCSigmaOutlierPar2(0),
362 fV0MZDCOutlierPar0(0),
363 fV0MZDCOutlierPar1(0),
364 fV0MZDCEcalOutlierPar0(0),
365 fV0MZDCEcalOutlierPar1(0),
366 fTrackCuts(0),
2d27827d 367 fEsdTrackCuts(0),
368 fEsdTrackCutsExtra1(0),
369 fEsdTrackCutsExtra2(0),
01974bd1 370 fZVCut(10),
371 fOutliersCut(5),
372 fQuality(999),
373 fIsSelected(0),
374 fMSL(0),
375 fMSH(0),
376 fMUL(0),
377 fMLL(0),
378 fEJE(0),
379 fEGA(0),
380 fPHS(0),
381 fMB(0),
382 fCVHN(0),
383 fCVLN(0),
384 fCVHNbit(0),
385 fCVLNbit(0),
386 fCCENT(0),
387 fCSEMI(0),
388 fCCENTbit(0),
389 fCSEMIbit(0),
390 fCentV0M(0),
391 fCentV0A(0),
9113c527 392 fCentV0A0(0),
2d12adde 393 fCentV0A123(0),
01974bd1 394 fCentV0C(0),
f9a774f9 395 fCentV0MEq(0),
396 fCentV0AEq(0),
397 fCentV0CEq(0),
01974bd1 398 fCentFMD(0),
399 fCentTRK(0),
400 fCentTKL(0),
401 fCentCL0(0),
402 fCentCL1(0),
403 fCentCND(0),
99029fba 404 fCentZNA(0),
f9a774f9 405 fCentZNC(0),
3a19f64f 406 fCentZPA(0),
407 fCentZPC(0),
39a3e400 408 fCentNPA(0),
01974bd1 409 fCentV0MvsFMD(0),
410 fCentTKLvsV0M(0),
411 fCentZEMvsZDC(0),
39a3e400 412 fCentV0Mtrue(0),
413 fCentV0Atrue(0),
414 fCentV0Ctrue(0),
f9a774f9 415 fCentV0MEqtrue(0),
416 fCentV0AEqtrue(0),
417 fCentV0CEqtrue(0),
39a3e400 418 fCentFMDtrue(0),
419 fCentTRKtrue(0),
420 fCentTKLtrue(0),
421 fCentCL0true(0),
422 fCentCL1true(0),
423 fCentCNDtrue(0),
424 fCentZNAtrue(0),
f9a774f9 425 fCentZNCtrue(0),
3a19f64f 426 fCentZPAtrue(0),
427 fCentZPCtrue(0),
01974bd1 428 fHtempV0M(0),
429 fHtempV0A(0),
9113c527 430 fHtempV0A0(0),
2d12adde 431 fHtempV0A123(0),
01974bd1 432 fHtempV0C(0),
f9a774f9 433 fHtempV0MEq(0),
434 fHtempV0AEq(0),
435 fHtempV0CEq(0),
01974bd1 436 fHtempFMD(0),
437 fHtempTRK(0),
438 fHtempTKL(0),
439 fHtempCL0(0),
440 fHtempCL1(0),
441 fHtempCND(0),
99029fba 442 fHtempZNA(0),
f9a774f9 443 fHtempZNC(0),
3a19f64f 444 fHtempZPA(0),
445 fHtempZPC(0),
01974bd1 446 fHtempV0MvsFMD(0),
447 fHtempTKLvsV0M(0),
448 fHtempZEMvsZDC(0),
39a3e400 449 fHtempNPA(0),
450 fHtempV0Mtrue(0),
451 fHtempV0Atrue(0),
452 fHtempV0Ctrue(0),
f9a774f9 453 fHtempV0MEqtrue(0),
454 fHtempV0AEqtrue(0),
455 fHtempV0CEqtrue(0),
39a3e400 456 fHtempFMDtrue(0),
457 fHtempTRKtrue(0),
458 fHtempTKLtrue(0),
459 fHtempCL0true(0),
460 fHtempCL1true(0),
461 fHtempCNDtrue(0),
462 fHtempZNAtrue(0),
f9a774f9 463 fHtempZNCtrue(0),
3a19f64f 464 fHtempZPAtrue(0),
465 fHtempZPCtrue(0),
01974bd1 466 fOutputList(0),
39a3e400 467 fHOutCentV0M(0),
468 fHOutCentV0A(0),
9113c527 469 fHOutCentV0A0(0),
2d12adde 470 fHOutCentV0A123(0),
39a3e400 471 fHOutCentV0C(0),
f9a774f9 472 fHOutCentV0MEq(0),
473 fHOutCentV0AEq(0),
474 fHOutCentV0CEq(0),
01974bd1 475 fHOutCentV0MCVHN(0),
476 fHOutCentV0MCVLN(0),
477 fHOutCentV0MCVHNinMB(0),
478 fHOutCentV0MCVLNinMB(0),
479 fHOutCentV0MCCENT(0),
480 fHOutCentV0MCSEMI(0),
481 fHOutCentV0MCCENTinMB(0),
482 fHOutCentV0MCSEMIinMB(0),
483 fHOutCentV0MMSL(0),
484 fHOutCentV0MMSH(0),
485 fHOutCentV0MMUL(0),
486 fHOutCentV0MMLL(0),
487 fHOutCentV0MEJE(0),
488 fHOutCentV0MEGA(0),
489 fHOutCentV0MPHS(0),
490 fHOutCentV0MMSLinMB(0),
491 fHOutCentV0MMSHinMB(0),
492 fHOutCentV0MMULinMB(0),
493 fHOutCentV0MMLLinMB(0),
494 fHOutCentV0MEJEinMB(0),
495 fHOutCentV0MEGAinMB(0),
496 fHOutCentV0MPHSinMB(0),
39a3e400 497 fHOutCentFMD(0),
498 fHOutCentTRK(0),
499 fHOutCentTKL(0),
500 fHOutCentCL0(0),
501 fHOutCentCL1(0),
502 fHOutCentCND(0),
503 fHOutCentNPA(0),
504 fHOutCentZNA(0),
f9a774f9 505 fHOutCentZNC(0),
3a19f64f 506 fHOutCentZPA(0),
507 fHOutCentZPC(0),
01974bd1 508 fHOutCentV0MvsFMD(0),
509 fHOutCentTKLvsV0M(0),
510 fHOutCentZEMvsZDC(0),
511 fHOutCentV0MvsCentCL1(0),
512 fHOutCentV0MvsCentTRK(0),
513 fHOutCentTRKvsCentCL1(0),
514 fHOutCentV0MvsCentZDC(0),
515 fHOutCentV0AvsCentV0C(0),
516 fHOutCentV0AvsCentTRK(0),
517 fHOutCentV0AvsCentCND(0),
518 fHOutCentV0AvsCentCL1(0),
519 fHOutCentV0CvsCentTRK(0),
520 fHOutCentV0CvsCentCND(0),
521 fHOutCentV0CvsCentCL1(0),
8432b617 522 fHOutCentNPAvsCentV0A(0),
523 fHOutCentNPAvsCentV0C(0),
524 fHOutCentNPAvsCentTRK(0),
525 fHOutCentNPAvsCentCND(0),
526 fHOutCentNPAvsCentCL1(0),
99029fba 527 fHOutCentZNAvsCentV0A(0),
528 fHOutCentZNAvsCentV0C(0),
529 fHOutCentZNAvsCentTRK(0),
530 fHOutCentZNAvsCentCND(0),
531 fHOutCentZNAvsCentCL1(0),
bfbc1975 532 fHOutCentZNAvsCentZPA(0),
01974bd1 533 fHOutMultV0AC(0),
534 fHOutMultV0M(0),
535 fHOutMultV0A(0),
9113c527 536 fHOutMultV0A0(0),
2d12adde 537 fHOutMultV0A123(0),
01974bd1 538 fHOutMultV0C(0),
f9a774f9 539 fHOutMultV0MEq(0),
540 fHOutMultV0AEq(0),
541 fHOutMultV0CEq(0),
e1d58f75 542 fHOutMultV0Mnc(0),
543 fHOutMultV0Anc(0),
544 fHOutMultV0Cnc(0),
01974bd1 545 fHOutMultV0O(0),
546 fHOutMultV0Cells(0),
547 fHOutMultFMD(0),
548 fHOutMultTRK(0),
549 fHOutMultTKL(0),
550 fHOutMultCL0(0),
551 fHOutMultCL1(0),
552 fHOutMultCND(0),
8432b617 553 fHOutMultNPA(0),
99029fba 554 fHOutMultZNA(0),
f9a774f9 555 fHOutMultZNC(0),
3a19f64f 556 fHOutMultZPA(0),
557 fHOutMultZPC(0),
01974bd1 558 fHOutMultV0MvsZDN(0),
559 fHOutMultZEMvsZDN(0),
560 fHOutMultV0MvsZDC(0),
561 fHOutMultZEMvsZDC(0),
562 fHOutMultZEMvsZDCw(0),
563 fHOutMultV0MvsCL1(0),
564 fHOutMultV0MvsTRK(0),
565 fHOutMultTRKvsCL1(0),
566 fHOutMultV0MvsV0O(0),
567 fHOutMultV0OvsCL1(0),
568 fHOutMultV0OvsTRK(0),
569 fHOutMultCL1vsTKL(0),
bfbc1975 570 fHOutMultZNAvsZPA(0),
01974bd1 571 fHOutCentV0Mqual1(0),
572 fHOutCentTRKqual1(0),
573 fHOutCentCL1qual1(0),
574 fHOutMultV0MvsCL1qual1(0),
575 fHOutMultV0MvsTRKqual1(0),
576 fHOutMultTRKvsCL1qual1(0),
577 fHOutCentV0Mqual2(0),
578 fHOutCentTRKqual2(0),
579 fHOutCentCL1qual2(0),
580 fHOutMultV0MvsCL1qual2(0),
581 fHOutMultV0MvsTRKqual2(0),
582 fHOutMultTRKvsCL1qual2(0),
583 fHOutQuality(0),
584 fHOutVertex(0),
585 fHOutVertexT0(0)
586{
587 // Default constructor
588 AliInfo("Centrality Selection enabled.");
589 //DefineOutput(1, TList::Class());
590 fUseScaling=kTRUE;
591 fUseCleaning=kTRUE;
592 fFillHistos=kFALSE;
593 fBranchNames="ESD:AliESDRun.,AliESDHeader.,AliESDZDC.,AliESDFMD.,AliESDVZERO.,AliESDTZERO."
594 ",SPDVertex.,TPCVertex.,PrimaryVertex.,AliMultiplicity.,Tracks ";
595}
596
597//________________________________________________________________________
598AliCentralitySelectionTask& AliCentralitySelectionTask::operator=(const AliCentralitySelectionTask& c)
599{
600 // Assignment operator
601 if (this!=&c) {
602 AliAnalysisTaskSE::operator=(c);
603 }
604 return *this;
605}
606
607//________________________________________________________________________
608AliCentralitySelectionTask::AliCentralitySelectionTask(const AliCentralitySelectionTask& ana):
609 AliAnalysisTaskSE(ana),
610 fAnalysisInput(ana.fAnalysisInput),
611 fIsMCInput(ana.fIsMCInput),
612 fCurrentRun(ana.fCurrentRun),
613 fUseScaling(ana.fUseScaling),
614 fUseCleaning(ana.fUseCleaning),
615 fFillHistos(ana.fFillHistos),
616 fV0MScaleFactor(ana.fV0MScaleFactor),
617 fSPDScaleFactor(ana.fSPDScaleFactor),
618 fTPCScaleFactor(ana.fTPCScaleFactor),
619 fV0MScaleFactorMC(ana.fV0MScaleFactorMC),
620 fV0MSPDOutlierPar0(ana.fV0MSPDOutlierPar0),
621 fV0MSPDOutlierPar1(ana.fV0MSPDOutlierPar1),
622 fV0MTPCOutlierPar0(ana.fV0MTPCOutlierPar0),
623 fV0MTPCOutlierPar1(ana.fV0MTPCOutlierPar1),
624 fV0MSPDSigmaOutlierPar0(ana.fV0MSPDSigmaOutlierPar0),
625 fV0MSPDSigmaOutlierPar1(ana.fV0MSPDSigmaOutlierPar1),
626 fV0MSPDSigmaOutlierPar2(ana.fV0MSPDSigmaOutlierPar2),
627 fV0MTPCSigmaOutlierPar0(ana.fV0MTPCSigmaOutlierPar0),
628 fV0MTPCSigmaOutlierPar1(ana.fV0MTPCSigmaOutlierPar1),
629 fV0MTPCSigmaOutlierPar2(ana.fV0MTPCSigmaOutlierPar2),
630 fV0MZDCOutlierPar0(ana.fV0MZDCOutlierPar0),
631 fV0MZDCOutlierPar1(ana.fV0MZDCOutlierPar1),
632 fV0MZDCEcalOutlierPar0(ana.fV0MZDCEcalOutlierPar0),
633 fV0MZDCEcalOutlierPar1(ana.fV0MZDCEcalOutlierPar1),
634 fTrackCuts(ana.fTrackCuts),
2d27827d 635 fEsdTrackCuts(ana.fEsdTrackCuts),
636 fEsdTrackCutsExtra1(ana.fEsdTrackCutsExtra1),
637 fEsdTrackCutsExtra2(ana.fEsdTrackCutsExtra2),
01974bd1 638 fZVCut(ana.fZVCut),
639 fOutliersCut(ana.fOutliersCut),
640 fQuality(ana.fQuality),
641 fIsSelected(ana.fIsSelected),
642 fMSL(ana.fMSL),
643 fMSH(ana.fMSH),
644 fMUL(ana.fMUL),
645 fMLL(ana.fMLL),
646 fEJE(ana.fEJE),
647 fEGA(ana.fEGA),
648 fPHS(ana.fPHS),
649 fMB(ana.fMB),
650 fCVHN(ana.fCVHN),
651 fCVLN(ana.fCVLN),
652 fCVHNbit(ana.fCVHNbit),
653 fCVLNbit(ana.fCVLNbit),
654 fCCENT(ana.fCCENT),
655 fCSEMI(ana.fCSEMI),
656 fCCENTbit(ana.fCCENTbit),
657 fCSEMIbit(ana.fCSEMIbit),
658 fCentV0M(ana.fCentV0M),
659 fCentV0A(ana.fCentV0A),
9113c527 660 fCentV0A0(ana.fCentV0A0),
2d12adde 661 fCentV0A123(ana.fCentV0A123),
01974bd1 662 fCentV0C(ana.fCentV0C),
f9a774f9 663 fCentV0MEq(ana.fCentV0MEq),
664 fCentV0AEq(ana.fCentV0AEq),
665 fCentV0CEq(ana.fCentV0CEq),
01974bd1 666 fCentFMD(ana.fCentFMD),
667 fCentTRK(ana.fCentTRK),
668 fCentTKL(ana.fCentTKL),
669 fCentCL0(ana.fCentCL0),
670 fCentCL1(ana.fCentCL1),
671 fCentCND(ana.fCentCND),
99029fba 672 fCentZNA(ana.fCentZNA),
f9a774f9 673 fCentZNC(ana.fCentZNC),
3a19f64f 674 fCentZPA(ana.fCentZPA),
675 fCentZPC(ana.fCentZPC),
39a3e400 676 fCentNPA(ana.fCentNPA),
01974bd1 677 fCentV0MvsFMD(ana.fCentV0MvsFMD),
678 fCentTKLvsV0M(ana.fCentTKLvsV0M),
679 fCentZEMvsZDC(ana.fCentZEMvsZDC),
39a3e400 680 fCentV0Mtrue(ana.fCentV0Mtrue),
681 fCentV0Atrue(ana.fCentV0Atrue),
682 fCentV0Ctrue(ana.fCentV0Ctrue),
f9a774f9 683 fCentV0MEqtrue(ana.fCentV0MEqtrue),
684 fCentV0AEqtrue(ana.fCentV0AEqtrue),
685 fCentV0CEqtrue(ana.fCentV0CEqtrue),
39a3e400 686 fCentFMDtrue(ana.fCentFMDtrue),
687 fCentTRKtrue(ana.fCentTRKtrue),
688 fCentTKLtrue(ana.fCentTKLtrue),
689 fCentCL0true(ana.fCentCL0true),
690 fCentCL1true(ana.fCentCL1true),
691 fCentCNDtrue(ana.fCentCNDtrue),
692 fCentZNAtrue(ana.fCentZNAtrue),
f9a774f9 693 fCentZNCtrue(ana.fCentZNCtrue),
3a19f64f 694 fCentZPAtrue(ana.fCentZPAtrue),
695 fCentZPCtrue(ana.fCentZPCtrue),
01974bd1 696 fHtempV0M(ana.fHtempV0M),
697 fHtempV0A(ana.fHtempV0A),
9113c527 698 fHtempV0A0(ana.fHtempV0A0),
2d12adde 699 fHtempV0A123(ana.fHtempV0A123),
01974bd1 700 fHtempV0C(ana.fHtempV0C),
f9a774f9 701 fHtempV0MEq(ana.fHtempV0MEq),
702 fHtempV0AEq(ana.fHtempV0AEq),
703 fHtempV0CEq(ana.fHtempV0CEq),
01974bd1 704 fHtempFMD(ana.fHtempFMD),
705 fHtempTRK(ana.fHtempTRK),
706 fHtempTKL(ana.fHtempTKL),
707 fHtempCL0(ana.fHtempCL0),
708 fHtempCL1(ana.fHtempCL1),
709 fHtempCND(ana.fHtempCND),
99029fba 710 fHtempZNA(ana.fHtempZNA),
f9a774f9 711 fHtempZNC(ana.fHtempZNC),
3a19f64f 712 fHtempZPA(ana.fHtempZPA),
713 fHtempZPC(ana.fHtempZPC),
01974bd1 714 fHtempV0MvsFMD(ana.fHtempV0MvsFMD),
715 fHtempTKLvsV0M(ana.fHtempTKLvsV0M),
716 fHtempZEMvsZDC(ana.fHtempZEMvsZDC),
39a3e400 717 fHtempNPA(ana.fHtempNPA),
718 fHtempV0Mtrue(ana.fHtempV0Mtrue),
719 fHtempV0Atrue(ana.fHtempV0Atrue),
720 fHtempV0Ctrue(ana.fHtempV0Ctrue),
f9a774f9 721 fHtempV0MEqtrue(ana.fHtempV0MEqtrue),
722 fHtempV0AEqtrue(ana.fHtempV0AEqtrue),
723 fHtempV0CEqtrue(ana.fHtempV0CEqtrue),
39a3e400 724 fHtempFMDtrue(ana.fHtempFMDtrue),
725 fHtempTRKtrue(ana.fHtempTRKtrue),
726 fHtempTKLtrue(ana.fHtempTKLtrue),
727 fHtempCL0true(ana.fHtempCL0true),
728 fHtempCL1true(ana.fHtempCL1true),
729 fHtempCNDtrue(ana.fHtempCNDtrue),
730 fHtempZNAtrue(ana.fHtempZNAtrue),
f9a774f9 731 fHtempZNCtrue(ana.fHtempZNCtrue),
3a19f64f 732 fHtempZPAtrue(ana.fHtempZPAtrue),
733 fHtempZPCtrue(ana.fHtempZPCtrue),
01974bd1 734 fOutputList(ana.fOutputList),
39a3e400 735 fHOutCentV0M(ana.fHOutCentV0M),
736 fHOutCentV0A(ana.fHOutCentV0A),
9113c527 737 fHOutCentV0A0(ana.fHOutCentV0A0),
2d12adde 738 fHOutCentV0A123(ana.fHOutCentV0A123),
39a3e400 739 fHOutCentV0C(ana.fHOutCentV0C),
f9a774f9 740 fHOutCentV0MEq(ana.fHOutCentV0MEq),
741 fHOutCentV0AEq(ana.fHOutCentV0AEq),
742 fHOutCentV0CEq(ana.fHOutCentV0CEq),
01974bd1 743 fHOutCentV0MCVHN(ana.fHOutCentV0MCVHN),
744 fHOutCentV0MCVLN(ana.fHOutCentV0MCVLN),
745 fHOutCentV0MCVHNinMB(ana.fHOutCentV0MCVHNinMB),
746 fHOutCentV0MCVLNinMB(ana.fHOutCentV0MCVLNinMB),
747 fHOutCentV0MCCENT(ana.fHOutCentV0MCCENT),
748 fHOutCentV0MCSEMI(ana.fHOutCentV0MCSEMI),
749 fHOutCentV0MCCENTinMB(ana.fHOutCentV0MCCENTinMB),
750 fHOutCentV0MCSEMIinMB(ana.fHOutCentV0MCSEMIinMB),
751 fHOutCentV0MMSL(ana.fHOutCentV0MMSL),
752 fHOutCentV0MMSH(ana.fHOutCentV0MMSH),
753 fHOutCentV0MMUL(ana.fHOutCentV0MMUL),
754 fHOutCentV0MMLL(ana.fHOutCentV0MMLL),
755 fHOutCentV0MEJE(ana.fHOutCentV0MEJE),
756 fHOutCentV0MEGA(ana.fHOutCentV0MEGA),
757 fHOutCentV0MPHS(ana.fHOutCentV0MPHS),
758 fHOutCentV0MMSLinMB(ana.fHOutCentV0MMSLinMB),
759 fHOutCentV0MMSHinMB(ana.fHOutCentV0MMSHinMB),
760 fHOutCentV0MMULinMB(ana.fHOutCentV0MMULinMB),
761 fHOutCentV0MMLLinMB(ana.fHOutCentV0MMLLinMB),
762 fHOutCentV0MEJEinMB(ana.fHOutCentV0MEJEinMB),
763 fHOutCentV0MEGAinMB(ana.fHOutCentV0MEGAinMB),
764 fHOutCentV0MPHSinMB(ana.fHOutCentV0MPHSinMB),
39a3e400 765 fHOutCentFMD(ana.fHOutCentFMD),
766 fHOutCentTRK(ana.fHOutCentTRK),
767 fHOutCentTKL(ana.fHOutCentTKL),
768 fHOutCentCL0(ana.fHOutCentCL0),
769 fHOutCentCL1(ana.fHOutCentCL1),
770 fHOutCentCND(ana.fHOutCentCND),
771 fHOutCentNPA(ana.fHOutCentNPA),
772 fHOutCentZNA(ana.fHOutCentZNA),
f9a774f9 773 fHOutCentZNC(ana.fHOutCentZNC),
3a19f64f 774 fHOutCentZPA(ana.fHOutCentZPA),
775 fHOutCentZPC(ana.fHOutCentZPC),
01974bd1 776 fHOutCentV0MvsFMD(ana.fHOutCentV0MvsFMD),
777 fHOutCentTKLvsV0M(ana.fHOutCentTKLvsV0M),
778 fHOutCentZEMvsZDC(ana.fHOutCentZEMvsZDC),
779 fHOutCentV0MvsCentCL1(ana.fHOutCentV0MvsCentCL1),
780 fHOutCentV0MvsCentTRK(ana.fHOutCentV0MvsCentTRK),
781 fHOutCentTRKvsCentCL1(ana.fHOutCentTRKvsCentCL1),
782 fHOutCentV0MvsCentZDC(ana.fHOutCentV0MvsCentZDC),
783 fHOutCentV0AvsCentV0C(ana.fHOutCentV0AvsCentV0C),
784 fHOutCentV0AvsCentTRK(ana.fHOutCentV0AvsCentTRK),
785 fHOutCentV0AvsCentCND(ana.fHOutCentV0AvsCentCND),
786 fHOutCentV0AvsCentCL1(ana.fHOutCentV0AvsCentCL1),
787 fHOutCentV0CvsCentTRK(ana.fHOutCentV0CvsCentTRK),
788 fHOutCentV0CvsCentCND(ana.fHOutCentV0CvsCentCND),
789 fHOutCentV0CvsCentCL1(ana.fHOutCentV0CvsCentCL1),
8432b617 790 fHOutCentNPAvsCentV0A(ana.fHOutCentNPAvsCentV0A),
791 fHOutCentNPAvsCentV0C(ana.fHOutCentNPAvsCentV0C),
792 fHOutCentNPAvsCentTRK(ana.fHOutCentNPAvsCentTRK),
793 fHOutCentNPAvsCentCND(ana.fHOutCentNPAvsCentCND),
794 fHOutCentNPAvsCentCL1(ana.fHOutCentNPAvsCentCL1),
99029fba 795 fHOutCentZNAvsCentV0A(ana.fHOutCentZNAvsCentV0A),
796 fHOutCentZNAvsCentV0C(ana.fHOutCentZNAvsCentV0C),
797 fHOutCentZNAvsCentTRK(ana.fHOutCentZNAvsCentTRK),
798 fHOutCentZNAvsCentCND(ana.fHOutCentZNAvsCentCND),
799 fHOutCentZNAvsCentCL1(ana.fHOutCentZNAvsCentCL1),
bfbc1975 800 fHOutCentZNAvsCentZPA(ana.fHOutCentZNAvsCentZPA),
01974bd1 801 fHOutMultV0AC(ana.fHOutMultV0AC),
802 fHOutMultV0M(ana.fHOutMultV0M),
803 fHOutMultV0A(ana.fHOutMultV0A),
9113c527 804 fHOutMultV0A0(ana.fHOutMultV0A0),
2d12adde 805 fHOutMultV0A123(ana.fHOutMultV0A123),
01974bd1 806 fHOutMultV0C(ana.fHOutMultV0C),
f9a774f9 807 fHOutMultV0MEq(ana.fHOutMultV0MEq),
808 fHOutMultV0AEq(ana.fHOutMultV0AEq),
809 fHOutMultV0CEq(ana.fHOutMultV0CEq),
e1d58f75 810 fHOutMultV0Mnc(ana.fHOutMultV0Mnc),
811 fHOutMultV0Anc(ana.fHOutMultV0Anc),
812 fHOutMultV0Cnc(ana.fHOutMultV0Cnc),
01974bd1 813 fHOutMultV0O(ana.fHOutMultV0O),
814 fHOutMultV0Cells(ana.fHOutMultV0Cells),
815 fHOutMultFMD(ana.fHOutMultFMD),
816 fHOutMultTRK(ana.fHOutMultTRK),
817 fHOutMultTKL(ana.fHOutMultTKL),
818 fHOutMultCL0(ana.fHOutMultCL0),
819 fHOutMultCL1(ana.fHOutMultCL1),
820 fHOutMultCND(ana.fHOutMultCND),
8432b617 821 fHOutMultNPA(ana.fHOutMultNPA),
99029fba 822 fHOutMultZNA(ana.fHOutMultZNA),
f9a774f9 823 fHOutMultZNC(ana.fHOutMultZNC),
3a19f64f 824 fHOutMultZPA(ana.fHOutMultZPA),
825 fHOutMultZPC(ana.fHOutMultZPC),
01974bd1 826 fHOutMultV0MvsZDN(ana.fHOutMultV0MvsZDN),
827 fHOutMultZEMvsZDN(ana.fHOutMultZEMvsZDN),
828 fHOutMultV0MvsZDC(ana.fHOutMultV0MvsZDC),
829 fHOutMultZEMvsZDC(ana.fHOutMultZEMvsZDC),
830 fHOutMultZEMvsZDCw(ana.fHOutMultZEMvsZDCw),
831 fHOutMultV0MvsCL1(ana.fHOutMultV0MvsCL1),
832 fHOutMultV0MvsTRK(ana.fHOutMultV0MvsTRK),
833 fHOutMultTRKvsCL1(ana.fHOutMultTRKvsCL1),
834 fHOutMultV0MvsV0O(ana.fHOutMultV0MvsV0O),
835 fHOutMultV0OvsCL1(ana.fHOutMultV0OvsCL1),
836 fHOutMultV0OvsTRK(ana.fHOutMultV0OvsTRK),
837 fHOutMultCL1vsTKL(ana.fHOutMultCL1vsTKL),
bfbc1975 838 fHOutMultZNAvsZPA(ana.fHOutMultZNAvsZPA),
01974bd1 839 fHOutCentV0Mqual1(ana.fHOutCentV0Mqual1),
840 fHOutCentTRKqual1(ana.fHOutCentTRKqual1),
841 fHOutCentCL1qual1(ana.fHOutCentCL1qual1),
842 fHOutMultV0MvsCL1qual1(ana.fHOutMultV0MvsCL1qual1),
843 fHOutMultV0MvsTRKqual1(ana.fHOutMultV0MvsTRKqual1),
844 fHOutMultTRKvsCL1qual1(ana.fHOutMultTRKvsCL1qual1),
845 fHOutCentV0Mqual2(ana.fHOutCentV0Mqual2),
846 fHOutCentTRKqual2(ana.fHOutCentTRKqual2),
847 fHOutCentCL1qual2(ana.fHOutCentCL1qual2),
848 fHOutMultV0MvsCL1qual2(ana.fHOutMultV0MvsCL1qual2),
849 fHOutMultV0MvsTRKqual2(ana.fHOutMultV0MvsTRKqual2),
850 fHOutMultTRKvsCL1qual2(ana.fHOutMultTRKvsCL1qual2),
851 fHOutQuality(ana.fHOutQuality),
852 fHOutVertex(ana.fHOutVertex),
853 fHOutVertexT0(ana.fHOutVertexT0)
854{
855 // Copy Constructor
856
857}
858
859//________________________________________________________________________
860AliCentralitySelectionTask::~AliCentralitySelectionTask()
861{
862 // Destructor
863 if (fOutputList && !AliAnalysisManager::GetAnalysisManager()->IsProofMode()) delete fOutputList;
864 if (fTrackCuts) delete fTrackCuts;
2d27827d 865 if (fEsdTrackCuts) delete fEsdTrackCuts;
866 if (fEsdTrackCutsExtra1) delete fEsdTrackCutsExtra1;
867 if (fEsdTrackCutsExtra2) delete fEsdTrackCutsExtra2;
01974bd1 868}
869
870//________________________________________________________________________
871void AliCentralitySelectionTask::UserCreateOutputObjects()
872{
873 // Create the output containers
874 if(fDebug>1) printf("AnalysisCentralitySelectionTask::UserCreateOutputObjects() \n");
875 AliLog::SetClassDebugLevel("AliCentralitySelectionTask", AliLog::kInfo);
876
877 if (fFillHistos) {
878 fOutputList = new TList();
879 fOutputList->SetOwner();
880 fHOutCentV0M = new TH1F("fHOutCentV0M","fHOutCentV0M; Centrality V0",505,0,101);
881 fHOutCentV0A = new TH1F("fHOutCentV0A","fHOutCentV0A; Centrality V0A",505,0,101);
9113c527 882 fHOutCentV0A0 = new TH1F("fHOutCentV0A0","fHOutCentV0A0; Centrality V0A-0",505,0,101);
2d12adde 883 fHOutCentV0A123 = new TH1F("fHOutCentV0A123","fHOutCentV0A123; Centrality V0A-123",505,0,101);
01974bd1 884 fHOutCentV0C = new TH1F("fHOutCentV0C","fHOutCentV0C; Centrality V0C",505,0,101);
1a9bd911 885 fHOutCentV0MEq = new TH1F("fHOutCentV0MEq","fHOutCentV0MEq; Centrality V0 equalized",505,0,101);
886 fHOutCentV0AEq = new TH1F("fHOutCentV0AEq","fHOutCentV0AEq; Centrality V0A equalized",505,0,101);
887 fHOutCentV0CEq = new TH1F("fHOutCentV0CEq","fHOutCentV0CEq; Centrality V0C equalized",505,0,101);
01974bd1 888 fHOutCentV0MCVHN= new TH1F("fHOutCentV0M_CVHN","fHOutCentV0M_CVHN; Centrality V0",505,0,101);
889 fHOutCentV0MCVLN= new TH1F("fHOutCentV0M_CVLN","fHOutCentV0M_CVLN; Centrality V0",505,0,101);
890 fHOutCentV0MCVHNinMB= new TH1F("fHOutCentV0M_CVHNinMB","fHOutCentV0M_CVHN; Centrality V0",505,0,101);
891 fHOutCentV0MCVLNinMB= new TH1F("fHOutCentV0M_CVLNinMB","fHOutCentV0M_CVLN; Centrality V0",505,0,101);
892 fHOutCentV0MCCENT= new TH1F("fHOutCentV0M_CCENT","fHOutCentV0M_CCENT; Centrality V0",505,0,101);
893 fHOutCentV0MCSEMI= new TH1F("fHOutCentV0M_CSEMI","fHOutCentV0M_CSEMI; Centrality V0",505,0,101);
894 fHOutCentV0MCCENTinMB= new TH1F("fHOutCentV0M_CCENTinMB","fHOutCentV0M_CCENT; Centrality V0",505,0,101);
895 fHOutCentV0MCSEMIinMB= new TH1F("fHOutCentV0M_CSEMIinMB","fHOutCentV0M_CSEMI; Centrality V0",505,0,101);
896 fHOutCentV0MMSL= new TH1F("fHOutCentV0M_MSL","fHOutCentV0M_MSL; Centrality V0",505,0,101);
897 fHOutCentV0MMSH= new TH1F("fHOutCentV0M_MSH","fHOutCentV0M_MSH; Centrality V0",505,0,101);
898 fHOutCentV0MMUL= new TH1F("fHOutCentV0M_MUL","fHOutCentV0M_MUL; Centrality V0",505,0,101);
899 fHOutCentV0MMLL= new TH1F("fHOutCentV0M_MLL","fHOutCentV0M_MLL; Centrality V0",505,0,101);
900 fHOutCentV0MEJE= new TH1F("fHOutCentV0M_EJE","fHOutCentV0M_EJE; Centrality V0",505,0,101);
901 fHOutCentV0MEGA= new TH1F("fHOutCentV0M_EGA","fHOutCentV0M_EGA; Centrality V0",505,0,101);
902 fHOutCentV0MPHS= new TH1F("fHOutCentV0M_PHS","fHOutCentV0M_PHS; Centrality V0",505,0,101);
903 fHOutCentV0MMSLinMB= new TH1F("fHOutCentV0M_MSLinMB","fHOutCentV0M_MSLinMB; Centrality V0",505,0,101);
904 fHOutCentV0MMSHinMB= new TH1F("fHOutCentV0M_MSHinMB","fHOutCentV0M_MSHinMB; Centrality V0",505,0,101);
905 fHOutCentV0MMULinMB= new TH1F("fHOutCentV0M_MULinMB","fHOutCentV0M_MULinMB; Centrality V0",505,0,101);
906 fHOutCentV0MMLLinMB= new TH1F("fHOutCentV0M_MLLinMB","fHOutCentV0M_MLLinMB; Centrality V0",505,0,101);
907 fHOutCentV0MEJEinMB= new TH1F("fHOutCentV0M_EJEinMB","fHOutCentV0M_EJEinMB; Centrality V0",505,0,101);
908 fHOutCentV0MEGAinMB= new TH1F("fHOutCentV0M_EGAinMB","fHOutCentV0M_EGAinMB; Centrality V0",505,0,101);
909 fHOutCentV0MPHSinMB= new TH1F("fHOutCentV0M_PHSinMB","fHOutCentV0M_PHSinMB; Centrality V0",505,0,101);
910 fHOutCentFMD = new TH1F("fHOutCentFMD","fHOutCentFMD; Centrality FMD",505,0,101);
911 fHOutCentTRK = new TH1F("fHOutCentTRK","fHOutCentTRK; Centrality TPC",505,0,101);
912 fHOutCentTKL = new TH1F("fHOutCentTKL","fHOutCentTKL; Centrality tracklets",505,0,101);
913 fHOutCentCL0 = new TH1F("fHOutCentCL0","fHOutCentCL0; Centrality SPD inner",505,0,101);
914 fHOutCentCL1 = new TH1F("fHOutCentCL1","fHOutCentCL1; Centrality SPD outer",505,0,101);
915 fHOutCentCND = new TH1F("fHOutCentCND","fHOutCentCND; Centrality candle",505,0,101);
99029fba 916 fHOutCentNPA = new TH1F("fHOutCentNPA","fHOutCentNPA; Centrality Npart",505,0,101);
917 fHOutCentZNA = new TH1F("fHOutCentZNA","fHOutCentZNA; Centrality ZNA",505,0,101);
1a9bd911 918 fHOutCentZNC = new TH1F("fHOutCentZNC","fHOutCentZNC; Centrality ZNC",505,0,101);
3a19f64f 919 fHOutCentZPA = new TH1F("fHOutCentZPA","fHOutCentZPA; Centrality ZPA",505,0,101);
920 fHOutCentZPC = new TH1F("fHOutCentZPC","fHOutCentZPC; Centrality ZPC",505,0,101);
01974bd1 921 fHOutCentV0MvsFMD= new TH1F("fHOutCentV0MvsFMD","fHOutCentV0MvsFMD; Centrality V0 vs FMD",505,0,101);
922 fHOutCentTKLvsV0M= new TH1F("fHOutCentTKLvsV0M","fHOutCentTKLvsV0M; Centrality tracklets vs V0",505,0,101);
923 fHOutCentZEMvsZDC= new TH1F("fHOutCentZEMvsZDC","fHOutCentZEMvsZDC; Centrality ZEM vs ZDC",505,0,101);
924 fHOutCentV0MvsCentCL1= new TH2F("fHOutCentV0MvsCentCL1","fHOutCentV0MvsCentCL1; Cent V0; Cent SPD",505,0,101,505,0,101);
925 fHOutCentV0MvsCentTRK= new TH2F("fHOutCentV0MvsCentTRK","fHOutCentV0MvsCentTRK; Cent V0; Cent TPC",505,0,101,505,0,101);
926 fHOutCentTRKvsCentCL1= new TH2F("fHOutCentTRKvsCentCL1","fHOutCentTRKvsCentCL1; Cent TPC; Cent SPD",505,0,101,505,0,101);
927 fHOutCentV0MvsCentZDC= new TH2F("fHOutCentV0MvsCentZDC","fHOutCentV0MvsCentZDC; Cent V0; Cent ZDC",505,0,101,505,0,101);
928 fHOutCentV0AvsCentV0C= new TH2F("fHOutCentV0AvsCentV0C","fHOutCentV0AvsCentV0C; Cent V0A; Cent V0C;", 505,0,101,505,0,101);
929 fHOutCentV0AvsCentTRK= new TH2F("fHOutCentV0AvsCentTRK","fHOutCentV0AvsCentTRK; Cent V0A; Cent TRK;", 505,0,101,505,0,101);
930 fHOutCentV0AvsCentCND= new TH2F("fHOutCentV0AvsCentCND","fHOutCentV0AvsCentCND; Cent V0A; Cent CND;", 505,0,101,505,0,101);
931 fHOutCentV0AvsCentCL1= new TH2F("fHOutCentV0AvsCentCL1","fHOutCentV0AvsCentCL1; Cent V0A; Cent CL1;", 505,0,101,505,0,101);
932 fHOutCentV0CvsCentTRK= new TH2F("fHOutCentV0CvsCentTRK","fHOutCentV0CvsCentTRK; Cent V0C; Cent TRK;", 505,0,101,505,0,101);
933 fHOutCentV0CvsCentCND= new TH2F("fHOutCentV0CvsCentCND","fHOutCentV0CvsCentCND; Cent V0C; Cent CND;", 505,0,101,505,0,101);
934 fHOutCentV0CvsCentCL1= new TH2F("fHOutCentV0CvsCentCL1","fHOutCentV0CvsCentCL1; Cent V0C; Cent CL1;", 505,0,101,505,0,101);
8432b617 935 fHOutCentNPAvsCentV0A= new TH2F("fHOutCentNPAvsCentV0A","fHOutCentNPAvsCentV0A; Cent NPA; Cent V0A;", 505,0,101,505,0,101);
936 fHOutCentNPAvsCentV0C= new TH2F("fHOutCentNPAvsCentV0C","fHOutCentNPAvsCentV0C; Cent NPA; Cent V0C;", 505,0,101,505,0,101);
937 fHOutCentNPAvsCentTRK= new TH2F("fHOutCentNPAvsCentTRK","fHOutCentNPAvsCentTRK; Cent NPA; Cent TRK;", 505,0,101,505,0,101);
938 fHOutCentNPAvsCentCND= new TH2F("fHOutCentNPAvsCentCND","fHOutCentNPAvsCentCND; Cent NPA; Cent CND;", 505,0,101,505,0,101);
939 fHOutCentNPAvsCentCL1= new TH2F("fHOutCentNPAvsCentCL1","fHOutCentNPAvsCentCL1; Cent NPA; Cent CL1;", 505,0,101,505,0,101);
99029fba 940 fHOutCentZNAvsCentV0A= new TH2F("fHOutCentZNAvsCentV0A","fHOutCentZNAvsCentV0A; Cent ZNA; Cent V0A;", 505,0,101,505,0,101);
941 fHOutCentZNAvsCentV0C= new TH2F("fHOutCentZNAvsCentV0C","fHOutCentZNAvsCentV0C; Cent ZNA; Cent V0C;", 505,0,101,505,0,101);
942 fHOutCentZNAvsCentTRK= new TH2F("fHOutCentZNAvsCentTRK","fHOutCentZNAvsCentTRK; Cent ZNA; Cent TRK;", 505,0,101,505,0,101);
943 fHOutCentZNAvsCentCND= new TH2F("fHOutCentZNAvsCentCND","fHOutCentZNAvsCentCND; Cent ZNA; Cent CND;", 505,0,101,505,0,101);
944 fHOutCentZNAvsCentCL1= new TH2F("fHOutCentZNAvsCentCL1","fHOutCentZNAvsCentCL1; Cent ZNA; Cent CL1;", 505,0,101,505,0,101);
bfbc1975 945 fHOutCentZNAvsCentZPA= new TH2F("fHOutCentZNAvsCentZPA","fHOutCentZNAvsCentZPA; Cent ZNA; Cent ZPA;", 505,0,101,505,0,101);
01974bd1 946
947 fHOutMultV0AC = new TH2F("fHOutMultV0AC","fHOutMultV0AC; Multiplicity V0A; Multiplicity V0C",1000,0,1000,1000,0,1000);
948 fHOutMultV0M = new TH1F("fHOutMultV0M","fHOutMultV0M; Multiplicity V0",25000,0,25000);
949 fHOutMultV0A = new TH1F("fHOutMultV0A","fHOutMultV0A; Multiplicity V0",25000,0,25000);
9113c527 950 fHOutMultV0A0 = new TH1F("fHOutMultV0A0","fHOutMultV0A0; Multiplicity V0A-0",25000,0,25000);
2d12adde 951 fHOutMultV0A123 = new TH1F("fHOutMultV0A123","fHOutMultV0A123; Multiplicity V0A-123",25000,0,25000);
01974bd1 952 fHOutMultV0C = new TH1F("fHOutMultV0C","fHOutMultV0C; Multiplicity V0",25000,0,25000);
7c928baf 953 fHOutMultV0MEq = new TH1F("fHOutMultV0MEq","fHOutMultV0MEq; Multiplicity V0",25000,0,25000);
954 fHOutMultV0AEq = new TH1F("fHOutMultV0AEq","fHOutMultV0AEq; Multiplicity V0",25000,0,25000);
955 fHOutMultV0CEq = new TH1F("fHOutMultV0CEq","fHOutMultV0CEq; Multiplicity V0",25000,0,25000);
e1d58f75 956 fHOutMultV0Mnc= new TH1F("fHOutMultV0Mnc","fHOutMultV0Mnc; Multiplicity V0",25000,0,25000);
957 fHOutMultV0Anc= new TH1F("fHOutMultV0Anc","fHOutMultV0Anc; Multiplicity V0",25000,0,25000);
958 fHOutMultV0Cnc= new TH1F("fHOutMultV0Cnc","fHOutMultV0Cnc; Multiplicity V0",25000,0,25000);
01974bd1 959 fHOutMultV0O = new TH1F("fHOutMultV0O","fHOutMultV0O; Multiplicity V0",40000,0,40000);
960 fHOutMultV0Cells = new TH2F("fHOutMultV0Cells","fHOutMultV0Cells",33,-0.5,32.5,33,-0.5,32.5);
961 fHOutMultFMD = new TH1F("fHOutMultFMD","fHOutMultFMD; Multiplicity FMD",24000,0,24000);
962 fHOutMultTRK = new TH1F("fHOutMultTRK","fHOutMultTRK; Multiplicity TPC",4000,0,4000);
963 fHOutMultTKL = new TH1F("fHOutMultTKL","fHOutMultTKL; Multiplicity tracklets",5000,0,5000);
964 fHOutMultCL0 = new TH1F("fHOutMultCL0","fHOutMultCL0; Multiplicity SPD inner",7000,0,7000);
965 fHOutMultCL1 = new TH1F("fHOutMultCL1","fHOutMultCL1; Multiplicity SPD outer",7000,0,7000);
966 fHOutMultCND = new TH1F("fHOutMultCND","fHOutMultCND; Multiplicity candle",4000,0,4000);
8432b617 967 fHOutMultNPA = new TH1F("fHOutMultNPA","fHOutMultNPA; Nparticipants",450,0,450);
3a19f64f 968 fHOutMultZNA = new TH1F("fHOutMultZNA","fHOutMultZNA; ZNA Energy",2000,0,2000);
969 fHOutMultZNC = new TH1F("fHOutMultZNC","fHOutMultZNC; ZNC Energy",2000,0,2000);
970 fHOutMultZPA = new TH1F("fHOutMultZPA","fHOutMultZPA; ZPA Energy",2000,0,2000);
971 fHOutMultZPC = new TH1F("fHOutMultZPC","fHOutMultZPC; ZPC Energy",2000,0,2000);
01974bd1 972
3a19f64f 973 fHOutMultV0MvsZDN = new TH2F("fHOutMultV0MvsZDN","fHOutMultV0MvsZDN; Multiplicity V0; Energy ZDC-N",500,0,1200,500,0,2000);
01974bd1 974 fHOutMultZEMvsZDN = new TH2F("fHOutMultZEMvsZDN","fHOutMultZEMvsZDN; Energy ZEM; Energy ZDC-N",500,0,2500,500,0,180000);
975 fHOutMultV0MvsZDC = new TH2F("fHOutMultV0MvsZDC","fHOutMultV0MvsZDC; Multiplicity V0; Energy ZDC",500,0,30000,500,0,200000);
976 fHOutMultZEMvsZDC = new TH2F("fHOutMultZEMvsZDC","fHOutMultZEMvsZDC; Energy ZEM; Energy ZDC",500,0,2500,500,0,200000);
977 fHOutMultZEMvsZDCw = new TH2F("fHOutMultZEMvsZDCw","fHOutMultZEMvsZDCw; Energy ZEM; Energy ZDC (weigthed with V0 percentile)",500,0,2500,500,0,200000);
978 fHOutMultV0MvsCL1 = new TH2F("fHOutMultV0MvsCL1","fHOutMultV0MvsCL1; Multiplicity V0; Multiplicity SPD outer",2500,0,30000,700,0,7000);
979 fHOutMultV0MvsTRK = new TH2F("fHOutMultV0MvsTRK","fHOutMultV0MvsTRK; Multiplicity V0; Multiplicity TPC",2500,0,30000,400,0,4000);
980 fHOutMultTRKvsCL1 = new TH2F("fHOutMultTRKvsCL1","fHOutMultTRKvsCL1; Multiplicity TPC; Multiplicity SPD outer",400,0,4000,700,0,7000);
981 fHOutMultV0MvsV0O = new TH2F("fHOutMultV0MvsV0O","fHOutMultV0MvsV0O; Multiplicity V0; Multiplicity V0 Online",500,0,30000,500,0,40000);
982 fHOutMultV0OvsCL1 = new TH2F("fHOutMultV0OvsCL1","fHOutMultV0OvsCL1; Multiplicity V0; Multiplicity SPD outer",500,0,40000,700,0,7000);
983 fHOutMultV0OvsTRK = new TH2F("fHOutMultV0OvsTRK","fHOutMultV0OvsTRK; Multiplicity V0; Multiplicity TPC",500,0,40000,400,0,4000);
984 fHOutMultV0MvsV0O = new TH2F("fHOutMultV0MvsV0O","fHOutMultV0MvsV0O; Multiplicity V0; Multiplicity V0 Online",500,0,30000,500,0,30000);
985 fHOutMultV0OvsCL1 = new TH2F("fHOutMultV0OvsCL1","fHOutMultV0OvsCL1; Multiplicity V0; Multiplicity SPD outer",2500,0,30000,700,0,7000);
986 fHOutMultV0OvsTRK = new TH2F("fHOutMultV0OvsTRK","fHOutMultV0OvsTRK; Multiplicity V0; Multiplicity TPC",2500,0,30000,400,0,4000);
987 fHOutMultCL1vsTKL = new TH2F ("fHOutMultCL1vsTKL","fHOutMultCL1vsTKL; Multiplicity SPD outer; Multiplicity tracklets",700,0,7000,700,0,7000);
bfbc1975 988 fHOutMultZNAvsZPA = new TH2F ("fHOutMultZNAvsZPA","fHOutMultZNAvsZPA; Energy ZNA; Energy ZPA",500,0,2000,500,0,2000);
01974bd1 989
990 fHOutCentV0Mqual1 = new TH1F("fHOutCentV0M_qual1","fHOutCentV0M_qual1; Centrality V0",505,0,101);
991 fHOutCentTRKqual1 = new TH1F("fHOutCentTRK_qual1","fHOutCentTRK_qual1; Centrality TPC",505,0,101);
992 fHOutCentCL1qual1 = new TH1F("fHOutCentCL1_qual1","fHOutCentCL1_qual1; Centrality SPD outer",505,0,101);
993 fHOutMultV0MvsCL1qual1 = new TH2F("fHOutMultV0MvsCL1_qual1","fHOutMultV0MvsCL1_qual1; Multiplicity V0; Multiplicity SPD outer",2500,0,25000,700,0,7000);
994 fHOutMultV0MvsTRKqual1 = new TH2F("fHOutMultV0MvsTRK_qual1","fHOutMultV0MvsTRK_qual1; Multiplicity V0; Multiplicity TPC",2500,0,25000,400,0,4000);
995 fHOutMultTRKvsCL1qual1 = new TH2F("fHOutMultTRKvsCL1_qual1","fHOutMultTRKvsCL1_qual1; Multiplicity TPC; Multiplicity SPD outer",400,0,4000,700,0,7000);
996
997 fHOutCentV0Mqual2 = new TH1F("fHOutCentV0M_qual2","fHOutCentV0M_qual2; Centrality V0",505,0,101);
998 fHOutCentTRKqual2 = new TH1F("fHOutCentTRK_qual2","fHOutCentTRK_qual2; Centrality TPC",505,0,101);
999 fHOutCentCL1qual2 = new TH1F("fHOutCentCL1_qual2","fHOutCentCL1_qual2; Centrality SPD outer",505,0,101);
1000 fHOutMultV0MvsCL1qual2 = new TH2F("fHOutMultV0MvsCL1_qual2","fHOutMultV0MvsCL1_qual2; Multiplicity V0; Multiplicity SPD outer",2500,0,25000,700,0,7000);
1001 fHOutMultV0MvsTRKqual2 = new TH2F("fHOutMultV0MvsTRK_qual2","fHOutMultV0MvsTRK_qual2; Multiplicity V0; Multiplicity TPC",2500,0,25000,400,0,4000);
1002 fHOutMultTRKvsCL1qual2 = new TH2F("fHOutMultTRKvsCL1_qual2","fHOutMultTRKvsCL1_qual2; Multiplicity TPC; Multiplicity SPD outer",400,0,4000,700,0,7000);
1003
1004 fHOutQuality = new TH1F("fHOutQuality", "fHOutQuality", 100,-0.5,99.5);
1005 fHOutVertex = new TH1F("fHOutVertex", "fHOutVertex", 100,-20,20);
1006 fHOutVertexT0 = new TH1F("fHOutVertexT0", "fHOutVertexT0", 100,-20,20);
1007
377e5a61 1008 fOutputList->Add(fHOutCentV0M);
1009 fOutputList->Add(fHOutCentV0A);
9113c527 1010 fOutputList->Add(fHOutCentV0A0);
2d12adde 1011 fOutputList->Add(fHOutCentV0A123);
377e5a61 1012 fOutputList->Add(fHOutCentV0C);
1a9bd911 1013 fOutputList->Add(fHOutCentV0MEq);
1014 fOutputList->Add(fHOutCentV0AEq);
1015 fOutputList->Add(fHOutCentV0CEq);
377e5a61 1016 fOutputList->Add(fHOutCentV0MCVHN);
1017 fOutputList->Add(fHOutCentV0MCVLN);
1018 fOutputList->Add(fHOutCentV0MCVHNinMB);
1019 fOutputList->Add(fHOutCentV0MCVLNinMB);
1020 fOutputList->Add(fHOutCentV0MCCENT);
1021 fOutputList->Add(fHOutCentV0MCSEMI);
1022 fOutputList->Add(fHOutCentV0MCCENTinMB);
1023 fOutputList->Add(fHOutCentV0MCSEMIinMB);
1024 fOutputList->Add(fHOutCentV0MMSL);
1025 fOutputList->Add(fHOutCentV0MMSH);
1026 fOutputList->Add(fHOutCentV0MMUL);
1027 fOutputList->Add(fHOutCentV0MMLL);
1028 fOutputList->Add(fHOutCentV0MEJE);
1029 fOutputList->Add(fHOutCentV0MEGA);
1030 fOutputList->Add(fHOutCentV0MPHS);
1031 fOutputList->Add(fHOutCentV0MMSLinMB);
1032 fOutputList->Add(fHOutCentV0MMSHinMB);
1033 fOutputList->Add(fHOutCentV0MMULinMB);
1034 fOutputList->Add(fHOutCentV0MMLLinMB);
1035 fOutputList->Add(fHOutCentV0MEJEinMB);
1036 fOutputList->Add(fHOutCentV0MEGAinMB);
1037 fOutputList->Add(fHOutCentV0MPHSinMB);
1038 fOutputList->Add(fHOutCentFMD);
1039 fOutputList->Add(fHOutCentTRK);
1040 fOutputList->Add(fHOutCentTKL);
1041 fOutputList->Add(fHOutCentCL0);
1042 fOutputList->Add(fHOutCentCL1);
1043 fOutputList->Add(fHOutCentCND);
1044 fOutputList->Add(fHOutCentNPA);
1045 fOutputList->Add(fHOutCentZNA);
1a9bd911 1046 fOutputList->Add(fHOutCentZNC);
3a19f64f 1047 fOutputList->Add(fHOutCentZPA);
1048 fOutputList->Add(fHOutCentZPC);
377e5a61 1049 fOutputList->Add(fHOutCentV0MvsFMD);
1050 fOutputList->Add(fHOutCentTKLvsV0M);
1051 fOutputList->Add(fHOutCentZEMvsZDC);
1052 fOutputList->Add(fHOutCentV0MvsCentCL1);
1053 fOutputList->Add(fHOutCentV0MvsCentTRK);
1054 fOutputList->Add(fHOutCentTRKvsCentCL1);
1055 fOutputList->Add(fHOutCentV0MvsCentZDC);
1056 fOutputList->Add(fHOutCentV0AvsCentV0C);
1057 fOutputList->Add(fHOutCentV0AvsCentTRK);
1058 fOutputList->Add(fHOutCentV0AvsCentCND);
1059 fOutputList->Add(fHOutCentV0AvsCentCL1);
1060 fOutputList->Add(fHOutCentV0CvsCentTRK);
1061 fOutputList->Add(fHOutCentV0CvsCentCND);
1062 fOutputList->Add(fHOutCentV0CvsCentCL1);
1063 fOutputList->Add(fHOutCentNPAvsCentV0A);
1064 fOutputList->Add(fHOutCentNPAvsCentV0C);
1065 fOutputList->Add(fHOutCentNPAvsCentTRK);
1066 fOutputList->Add(fHOutCentNPAvsCentCND);
1067 fOutputList->Add(fHOutCentNPAvsCentCL1);
1068 fOutputList->Add(fHOutCentZNAvsCentV0A);
1069 fOutputList->Add(fHOutCentZNAvsCentV0C);
1070 fOutputList->Add(fHOutCentZNAvsCentTRK);
1071 fOutputList->Add(fHOutCentZNAvsCentCND);
1072 fOutputList->Add(fHOutCentZNAvsCentCL1);
bfbc1975 1073 fOutputList->Add(fHOutCentZNAvsCentZPA);
377e5a61 1074
1075 fOutputList->Add(fHOutMultV0AC);
1076 fOutputList->Add(fHOutMultV0M);
1077 fOutputList->Add(fHOutMultV0A);
9113c527 1078 fOutputList->Add(fHOutMultV0A0);
2d12adde 1079 fOutputList->Add(fHOutMultV0A123);
377e5a61 1080 fOutputList->Add(fHOutMultV0C);
7c928baf 1081 fOutputList->Add(fHOutMultV0MEq);
1082 fOutputList->Add(fHOutMultV0AEq);
1083 fOutputList->Add(fHOutMultV0CEq);
377e5a61 1084 fOutputList->Add(fHOutMultV0Mnc);
1085 fOutputList->Add(fHOutMultV0Anc);
1086 fOutputList->Add(fHOutMultV0Cnc);
1087 fOutputList->Add(fHOutMultV0O);
1088 fOutputList->Add(fHOutMultV0Cells) ;
1089 fOutputList->Add(fHOutMultFMD);
1090 fOutputList->Add(fHOutMultTRK);
1091 fOutputList->Add(fHOutMultTKL);
1092 fOutputList->Add(fHOutMultCL0);
1093 fOutputList->Add(fHOutMultCL1);
1094 fOutputList->Add(fHOutMultCND);
1095 fOutputList->Add(fHOutMultNPA);
1096 fOutputList->Add(fHOutMultZNA);
7c928baf 1097 fOutputList->Add(fHOutMultZNC);
3a19f64f 1098 fOutputList->Add(fHOutMultZPA);
1099 fOutputList->Add(fHOutMultZPC);
377e5a61 1100 fOutputList->Add(fHOutMultV0MvsZDN);
1101 fOutputList->Add(fHOutMultZEMvsZDN);
1102 fOutputList->Add(fHOutMultV0MvsZDC);
1103 fOutputList->Add(fHOutMultZEMvsZDC);
1104 fOutputList->Add(fHOutMultZEMvsZDCw);
1105 fOutputList->Add(fHOutMultV0MvsCL1);
1106 fOutputList->Add(fHOutMultV0MvsTRK);
1107 fOutputList->Add(fHOutMultTRKvsCL1);
1108 fOutputList->Add(fHOutMultV0MvsV0O);
1109 fOutputList->Add(fHOutMultV0OvsCL1);
1110 fOutputList->Add(fHOutMultV0OvsTRK);
1111 fOutputList->Add(fHOutMultCL1vsTKL);
bfbc1975 1112 fOutputList->Add(fHOutMultZNAvsZPA);
377e5a61 1113 fOutputList->Add(fHOutCentV0Mqual1);
1114 fOutputList->Add(fHOutCentTRKqual1);
1115 fOutputList->Add(fHOutCentCL1qual1);
1116 fOutputList->Add(fHOutMultV0MvsCL1qual1);
1117 fOutputList->Add(fHOutMultV0MvsTRKqual1);
1118 fOutputList->Add(fHOutMultTRKvsCL1qual1);
1119 fOutputList->Add(fHOutCentV0Mqual2);
1120 fOutputList->Add(fHOutCentTRKqual2);
1121 fOutputList->Add(fHOutCentCL1qual2);
1122 fOutputList->Add(fHOutMultV0MvsCL1qual2);
1123 fOutputList->Add(fHOutMultV0MvsTRKqual2);
1124 fOutputList->Add(fHOutMultTRKvsCL1qual2);
1125 fOutputList->Add(fHOutQuality);
1126 fOutputList->Add(fHOutVertex);
1127 fOutputList->Add(fHOutVertexT0);
01974bd1 1128
1129 PostData(1, fOutputList);
1130 }
1131
1132 fTrackCuts = AliESDtrackCuts::GetStandardTPCOnlyTrackCuts();
2d27827d 1133 fEsdTrackCuts = AliESDtrackCuts::GetStandardITSTPCTrackCuts2011();
1134 fEsdTrackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD,AliESDtrackCuts::kOff);
1135 // Add SPD requirement
1136 fEsdTrackCutsExtra1 = new AliESDtrackCuts("SPD", "Require 1 cluster in SPD");
1137 fEsdTrackCutsExtra1->SetClusterRequirementITS(AliESDtrackCuts::kSPD,AliESDtrackCuts::kAny);
1138 // Add SDD requirement
1139 fEsdTrackCutsExtra2 = new AliESDtrackCuts("SDD", "Require 1 cluster in first layer SDD");
1140 fEsdTrackCutsExtra2->SetClusterRequirementITS(AliESDtrackCuts::kSDD,AliESDtrackCuts::kFirst);
01974bd1 1141}
1142
1143//________________________________________________________________________
1144void AliCentralitySelectionTask::UserExec(Option_t */*option*/)
1145{
1146 // Execute analysis for current event:
1147 if(fDebug>1) printf(" **** AliCentralitySelectionTask::UserExec() \n");
1148
c932ac15 1149 Int_t runType = 0; // 0:PbPb, 1:pPb or Pbp
1150
01974bd1 1151 Float_t zncEnergy = 0.; // ZNC Energy
1152 Float_t zpcEnergy = 0.; // ZPC Energy
1153 Float_t znaEnergy = 0.; // ZNA Energy
1154 Float_t zpaEnergy = 0.; // ZPA Energy
1155 Float_t zem1Energy = 0.; // ZEM1 Energy
1156 Float_t zem2Energy = 0.; // ZEM2 Energy
1157 Bool_t zdcEnergyCal = kFALSE; // if zdc is calibrated (in pass2)
99029fba 1158 Double_t znaTower = 0.; // common PMT of ZNA
3a19f64f 1159 Double_t zncTower = 0.; // common PMT of ZNC
1160 Double_t zpaTower = 0.; // common PMT of ZPA
1161 Double_t zpcTower = 0.; // common PMT of ZPC
99029fba 1162 Bool_t znaFired = kFALSE;
f9a774f9 1163 Bool_t zncFired = kFALSE;
3a19f64f 1164 Bool_t zpaFired = kFALSE;
1165 Bool_t zpcFired = kFALSE;
01974bd1 1166
1167 Int_t nTracks = 0; // no. tracks
1168 Int_t nTracklets = 0; // no. tracklets
1169 Int_t nClusters[6] = {0}; // no. clusters on 6 ITS layers
377e5a61 1170 Int_t nChips[2] = {0,0}; // no. chips on 2 SPD layers
01974bd1 1171 Float_t spdCorr =0; // corrected spd2 multiplicity
1172 Int_t multCND = 0; // no. tracks (candle condition)
1173
9113c527 1174 Float_t multV0A0 = 0; // multiplicity from V0 reco side A (ring 0)
2d12adde 1175 Float_t multV0A123 = 0; // multiplicity from V0 reco side A (ring 1-2-3)
01974bd1 1176 Float_t multV0A = 0; // multiplicity from V0 reco side A
1177 Float_t multV0C = 0; // multiplicity from V0 reco side C
f9a774f9 1178 Float_t multV0AEq = 0; // multiplicity from V0 reco side A
1179 Float_t multV0CEq = 0; // multiplicity from V0 reco side C
e1d58f75 1180 Float_t multV0ACorr = 0; // multiplicity from V0 reco side A
1181 Float_t multV0CCorr = 0; // multiplicity from V0 reco side C
01974bd1 1182 Short_t multV0AOnline = 0; // multiplicity from V0 reco side A
1183 Short_t multV0COnline = 0; // multiplicity from V0 reco side C
8432b617 1184 Float_t v0Corr = 0; // corrected V0 multiplicity (used for MC)
01974bd1 1185 Int_t nV0A = 0;
1186 Int_t nV0C = 0;
1187
1188 Float_t multFMDA = 0; // multiplicity from FMD on detector A
1189 Float_t multFMDC = 0; // multiplicity from FMD on detector C
1190
1191 Float_t zvtx =0; // z-vertex SPD
1192 Int_t zvtxNcont =0; // contributors to z-vertex SPD
1193
1194 Float_t zvtxT0 =0; // z-vertex T0
1195
8432b617 1196 Int_t Npart =0; // N. of participants (true MC)
01974bd1 1197
1198 AliCentrality *esdCent = 0;
1199
377e5a61 1200 AliVEvent *event = InputEvent();
1201 AliESDEvent *esd = dynamic_cast<AliESDEvent*>(event);
1202 AliAODEvent *aod = dynamic_cast<AliAODEvent*>(event);
01974bd1 1203 if(fAnalysisInput.CompareTo("ESD")==0){
01974bd1 1204 if (!esd) {
1205 AliError("No ESD Event");
1206 return;
1207 }
377e5a61 1208 } else if(fAnalysisInput.CompareTo("AOD")==0){
1209 if (!aod) {
1210 AliError("No AOD Event");
01974bd1 1211 return;
1212 }
377e5a61 1213 }
1214 LoadBranches();
1215
1216 if (SetupRun(event)<0) {
1217 AliError("Centrality File not available for this run");
1218 return;
1219 }
1220
1221 if (esd) {
c932ac15 1222 if (strcmp(esd->GetESDRun()->GetBeamType(), "A-A") == 0) runType=0;
9113c527 1223 else runType=1;
377e5a61 1224 } else {
1225 Int_t runNumber = event->GetRunNumber();
1226 if ((runNumber >= 136851 && runNumber <= 139517) || // LHC10h
1227 (runNumber >= 166529 && runNumber <= 170593)) // LHC11h
1228 runType=0;
1229 }
c932ac15 1230
377e5a61 1231 esdCent = event->GetCentrality();
01974bd1 1232
377e5a61 1233 // ***** Vertex Info
1234 if (esd) {
e1d58f75 1235 const AliESDVertex* vtxESD = esd->GetPrimaryVertexSPD();
1236 zvtx = vtxESD->GetZ();
1237 zvtxNcont = vtxESD->GetNContributors();
377e5a61 1238 } else {
1239 const AliAODVertex* spdVtx = aod->GetPrimaryVertexSPD();
1240 zvtx = spdVtx->GetZ();
1241 zvtxNcont = spdVtx->GetNContributors();
1242 }
e1d58f75 1243
01974bd1 1244 // ***** V0 info
377e5a61 1245 AliVVZERO* esdV0 = event->GetVZEROData();
1246 if (!esdV0) {
1247 AliError("AliVVZERO not available");
1248 return;
1249 }
e1d58f75 1250
377e5a61 1251 multV0A=esdV0->GetMTotV0A();
1252 multV0C=esdV0->GetMTotV0C();
e1d58f75 1253
2d12adde 1254 // excluding innermost V0A ring
9113c527 1255 for (int i=32; i<40; i++)
1256 multV0A0 += esdV0->GetMultiplicity(i);
2d12adde
AM
1257 for (int i=40; i<64; i++)
1258 multV0A123 += esdV0->GetMultiplicity(i);
1259
377e5a61 1260 multV0ACorr = AliESDUtils::GetCorrV0A(multV0A,zvtx);
1261 multV0CCorr = AliESDUtils::GetCorrV0C(multV0C,zvtx);
01974bd1 1262
3a19f64f 1263 v0Corr = multV0A+multV0C; // Todo: C.L. not clear why here we do not use the sum of the corrected values?
01974bd1 1264
377e5a61 1265 multV0AOnline=esdV0->GetTriggerChargeA();
1266 multV0COnline=esdV0->GetTriggerChargeC();
1267
1268 // Count V0 flags
1269 for(Int_t i = 0; i < 32; ++i) {
1270 if (esdV0->GetBBFlag(i)) nV0C++;
1271 if (esdV0->GetBBFlag(i+32)) nV0A++;
1272 }
01974bd1 1273
f9a774f9 1274 // Equalized signals
1275 multV0AEq=0.;
1276 multV0CEq=0.;
1277 for(Int_t iCh = 4; iCh < 7; ++iCh) {
1278 Double_t mult = esd->GetVZEROEqMultiplicity(iCh);
1279 multV0AEq += mult;
1280 }
1281 for(Int_t iCh = 0; iCh < 3; ++iCh) {
1282 Double_t mult = esd->GetVZEROEqMultiplicity(iCh);
1283 multV0CEq += mult;
1284 }
3a19f64f 1285
377e5a61 1286 Bool_t kT0BB = kFALSE;
1287 if (esd) {
01974bd1 1288 // ***** T0 info
1289 const AliESDTZERO* esdT0 = esd->GetESDTZERO();
1290 if (!esdT0)
1291 {
1292 AliError("AliESDTZERO not available");
1293 return;
1294 }
1295 Int_t trig=esdT0->GetT0Trig();
01974bd1 1296 if(trig&1) kT0BB=kTRUE;
1297 zvtxT0=esdT0->GetT0zVertex();
377e5a61 1298 } else {
1299 const AliAODTZERO* esdT0 = aod->GetTZEROData();
1300 if (!esdT0)
1301 {
1302 AliError("AliAODTZERO not available");
1303 return;
1304 }
3a19f64f 1305 Int_t trig=1;//esdT0->GetT0Trig(); //* Todo: C.L. This info is not in AOD? */
377e5a61 1306 if(trig&1) kT0BB=kTRUE;
1307 zvtxT0=esdT0->GetT0zVertex();
1308 }
01974bd1 1309
377e5a61 1310 // ***** Trigger info
1311 fIsSelected = ((esdV0->GetV0ADecision()==1) && (esdV0->GetV0CDecision()==1));
1312 TString trigStr;
1313 if (esd)
1314 trigStr = esd->GetFiredTriggerClasses();
1315 else
1316 trigStr = aod->GetFiredTriggerClasses();
01974bd1 1317
377e5a61 1318 fMB=kFALSE;
1319 fCVHN=kFALSE; fCVLN=kFALSE; fCCENT=kFALSE; fCSEMI=kFALSE;
1320 fMSL=kFALSE; fMSH=kFALSE; fMUL=kFALSE; fMLL=kFALSE;
1321 fEJE=kFALSE; fEGA=kFALSE; fPHS=kFALSE;
1322
1323 if ( (trigStr.Contains("-B-")) && (trigStr.Contains("CPBI")) && (fIsSelected))
1324 fMB=kTRUE;
1325 if ( (trigStr.Contains("-B-")) && (trigStr.Contains("CVHN")) && (fIsSelected))
1326 fCVHN=kTRUE;
1327 if ( (trigStr.Contains("-B-")) && (trigStr.Contains("CVLN")) && (fIsSelected))
1328 fCVLN=kTRUE;
1329 if ( (trigStr.Contains("-B-")) && (trigStr.Contains("CCENT")) && (fIsSelected))
1330 fCCENT=kTRUE;
1331 if ( (trigStr.Contains("-B-")) && (trigStr.Contains("CSEMI")) && (fIsSelected))
1332 fCSEMI=kTRUE;
01974bd1 1333
377e5a61 1334 if ( (trigStr.Contains("-B-")) && (trigStr.Contains("CPBI1MSL")) && (fIsSelected))
1335 fMSL=kTRUE;
1336 if ( (trigStr.Contains("-B-")) && (trigStr.Contains("CPBI1MSH")) && (fIsSelected))
1337 fMSH=kTRUE;
1338 if ( (trigStr.Contains("-B-")) && (trigStr.Contains("CPBI1MUL")) && (fIsSelected))
1339 fMUL=kTRUE;
1340 if ( (trigStr.Contains("-B-")) && (trigStr.Contains("CPBI1MLL")) && (fIsSelected))
1341 fMLL=kTRUE;
1342 if ( (trigStr.Contains("-B-")) && (trigStr.Contains("CPBI1EJE")) && (fIsSelected))
1343 fEJE=kTRUE;
1344 if ( (trigStr.Contains("-B-")) && (trigStr.Contains("CPBI1EGA")) && (fIsSelected))
1345 fEGA=kTRUE;
1346 if ( (trigStr.Contains("-B-")) && (trigStr.Contains("CPBI1PHS")) && (fIsSelected))
1347 fPHS=kTRUE;
1348
1349 fCVHNbit=kFALSE; fCVLNbit=kFALSE; fCCENTbit=kFALSE; fCSEMIbit=kFALSE;
1350 if (esdV0->GetTriggerBits() & (1<<8))
1351 fCVHNbit=kTRUE;
1352 if (esdV0->GetTriggerBits() & (1<<6))
1353 fCVLNbit=kTRUE;
01974bd1 1354
377e5a61 1355 if (kT0BB && fCVHNbit)
1356 fCCENTbit=kTRUE;
1357 if (kT0BB && fCVLNbit)
1358 fCSEMIbit=kTRUE;
01974bd1 1359
377e5a61 1360 if (esd) {
01974bd1 1361 // ***** CB info (tracklets, clusters, chips)
1362 //nTracks = event->GetNumberOfTracks();
1363 nTracks = fTrackCuts ? (Short_t)fTrackCuts->GetReferenceMultiplicity(esd,kTRUE):-1;
377e5a61 1364 } else {
1365 AliAODHeader *h = aod->GetHeader();
1366 nTracks = h!=0 ? (Short_t)h->GetTPConlyRefMultiplicity():-1;
1367 }
2d27827d 1368
377e5a61 1369 if (esd) {
01974bd1 1370 Short_t nTrTPCcandle = 0;
1371 for (Int_t iTracks = 0; iTracks < esd->GetNumberOfTracks(); iTracks++) {
2d27827d 1372
01974bd1 1373 AliESDtrack* track = esd->GetTrack(iTracks);
1374 if (!track) continue;
2d27827d 1375
1376 if (! fEsdTrackCuts->IsSelected(track) )continue;
1377
1378 if (fEsdTrackCutsExtra1 && fEsdTrackCutsExtra2 &&
1379 !fEsdTrackCutsExtra1->IsSelected(track) &&
1380 !fEsdTrackCutsExtra2->IsSelected(track)) continue;
1381
1382 if (track->Pt() > 0.4 && TMath::Abs(track->Eta()) < 0.9) nTrTPCcandle++;
01974bd1 1383 }
1384 multCND = nTrTPCcandle;
377e5a61 1385 } else {
1386 Short_t nTrTPCcandle = 0;
1387 for (Int_t iTracks = 0; iTracks < aod->GetNumberOfTracks(); iTracks++) {
1388
1389 AliAODTrack* track = aod->GetTrack(iTracks);
1390
1391 if (!track) continue;
1392 if (!track->TestFilterBit(1<<5) &&
1393 !track->TestFilterBit(1<<6)) continue;
1394
1395 if (track->Pt() > 0.4 && TMath::Abs(track->Eta()) < 0.9) nTrTPCcandle++;
1396 }
1397 multCND = nTrTPCcandle;
1398 }
01974bd1 1399
377e5a61 1400 if (esd) {
01974bd1 1401 const AliMultiplicity *mult = esd->GetMultiplicity();
1402 nTracklets = mult->GetNumberOfTracklets();
1403
1404 for(Int_t ilay=0; ilay<6; ilay++){
1405 nClusters[ilay] = mult->GetNumberOfITSClusters(ilay);
1406 }
1407
1408 for(Int_t ilay=0; ilay<2; ilay++){
1409 nChips[ilay] = mult->GetNumberOfFiredChips(ilay);
1410 }
377e5a61 1411 } else {
1412 AliAODTracklets *mult = aod->GetTracklets();
1413 nTracklets = mult->GetNumberOfTracklets();
1414 AliAODHeader *h = aod->GetHeader();
1415 for(Int_t ilay=0; ilay<6; ilay++){
1416 nClusters[ilay] = h->GetNumberOfITSClusters(ilay);
1417 }
1418 }
1419 spdCorr = AliESDUtils::GetCorrSPD2(nClusters[1],zvtx);
1420
1421 if (esd) {
01974bd1 1422 // ***** FMD info
1423 AliESDFMD *fmd = esd->GetFMDData();
1424 Float_t totalMultA = 0;
1425 Float_t totalMultC = 0;
1426 const Float_t fFMDLowCut = 0.4;
1427
1428 for(UShort_t det=1;det<=3;det++) {
1429 Int_t nRings = (det==1 ? 1 : 2);
1430 for (UShort_t ir = 0; ir < nRings; ir++) {
1431 Char_t ring = (ir == 0 ? 'I' : 'O');
1432 UShort_t nsec = (ir == 0 ? 20 : 40);
1433 UShort_t nstr = (ir == 0 ? 512 : 256);
1434 for(UShort_t sec =0; sec < nsec; sec++) {
1435 for(UShort_t strip = 0; strip < nstr; strip++) {
1436
1437 Float_t fmdMult = fmd->Multiplicity(det,ring,sec,strip);
1438 if(fmdMult == 0 || fmdMult == AliESDFMD::kInvalidMult) continue;
1439
1440 Float_t nParticles=0;
1441
1442 if(fmdMult > fFMDLowCut) {
1443 nParticles = 1.;
1444 }
1445
1446 if (det<3) totalMultA = totalMultA + nParticles;
1447 else totalMultC = totalMultC + nParticles;
1448
1449 }
1450 }
1451 }
1452 }
1453 multFMDA = totalMultA;
1454 multFMDC = totalMultC;
377e5a61 1455 }
1456
1457 if (esd) {
01974bd1 1458 // ***** ZDC info
1459 AliESDZDC *esdZDC = esd->GetESDZDC();
1460 zdcEnergyCal = esdZDC->AliESDZDC::TestBit(AliESDZDC::kEnergyCalibratedSignal);
1461 if (zdcEnergyCal) {
1462 zncEnergy = (Float_t) (esdZDC->GetZDCN1Energy());
1463 zpcEnergy = (Float_t) (esdZDC->GetZDCP1Energy());
1464 znaEnergy = (Float_t) (esdZDC->GetZDCN2Energy());
1465 zpaEnergy = (Float_t) (esdZDC->GetZDCP2Energy());
1466 } else {
1467 zncEnergy = (Float_t) (esdZDC->GetZDCN1Energy())/8.;
1468 zpcEnergy = (Float_t) (esdZDC->GetZDCP1Energy())/8.;
1469 znaEnergy = (Float_t) (esdZDC->GetZDCN2Energy())/8.;
1470 zpaEnergy = (Float_t) (esdZDC->GetZDCP2Energy())/8.;
1471 }
1472 zem1Energy = (Float_t) (esdZDC->GetZDCEMEnergy(0))/8.;
1473 zem2Energy = (Float_t) (esdZDC->GetZDCEMEnergy(1))/8.;
99029fba 1474
f9a774f9 1475 for (Int_t j = 0; j < 4; ++j)
1476 if (esdZDC->GetZDCTDCData(12,j) != 0)
99029fba 1477 znaFired = kTRUE;
f9a774f9 1478
1479 for (Int_t j = 0; j < 4; ++j)
1480 if (esdZDC->GetZDCTDCData(10,j) != 0)
1481 zncFired = kTRUE;
1482
3a19f64f 1483 for (Int_t j = 0; j < 4; ++j)
1484 if (esdZDC->GetZDCTDCData(13,j) != 0)
1485 zpaFired = kTRUE;
1486
1487 for (Int_t j = 0; j < 4; ++j)
1488 if (esdZDC->GetZDCTDCData(11,j) != 0)
1489 zpcFired = kTRUE;
1490
bfbc1975 1491 const Double_t *ZNAtower = esdZDC->GetZN2TowerEnergy();
1492 const Double_t *ZNCtower = esdZDC->GetZN1TowerEnergy();
1493 const Double_t *ZPAtower = esdZDC->GetZP2TowerEnergy();
1494 const Double_t *ZPCtower = esdZDC->GetZP1TowerEnergy();
1495 if (znaFired) znaTower = ZNAtower[0];
1496 if (zncFired) zncTower = ZNCtower[0];
1497 if (zpaFired) zpaTower = ZPAtower[0];
1498 if (zpcFired) zpcTower = ZPCtower[0];
1499
377e5a61 1500 } else {
1501 AliAODHeader *h = aod->GetHeader();
3a19f64f 1502 zncEnergy = (Float_t) (h->GetZDCN1Energy());
1503 zpcEnergy = (Float_t) (h->GetZDCP1Energy());
1504 znaEnergy = (Float_t) (h->GetZDCN2Energy());
1505 zpaEnergy = (Float_t) (h->GetZDCP2Energy());
377e5a61 1506 zem1Energy = (Float_t) (h->GetZDCEMEnergy(0))/8.; //Todo: C.L. Should we devide here by 8? It is done in the ESD case!
1507 zem2Energy = (Float_t) (h->GetZDCEMEnergy(1))/8.;
1508
1509 AliAODZDC *aodZDC = aod->GetZDCData();
1510 const Double_t *ZNAtower = aodZDC->GetZNATowerEnergy();
3a19f64f 1511 const Double_t *ZNCtower = aodZDC->GetZNCTowerEnergy();
1512 const Double_t *ZPAtower = aodZDC->GetZPATowerEnergy();
1513 const Double_t *ZPCtower = aodZDC->GetZPCTowerEnergy();
377e5a61 1514 znaTower = ZNAtower[0];
666dc076 1515 zncTower = ZNCtower[0];
3a19f64f 1516 zpaTower = ZPAtower[0];
1517 zpcTower = ZPCtower[0];
377e5a61 1518
1519 znaFired = kFALSE; // trick because info is not stored in AOD
666dc076 1520 zncFired = kFALSE; // trick because info is not stored in AOD
3a19f64f 1521 zpaFired = kFALSE; // trick because info is not stored in AOD
1522 zpcFired = kFALSE; // trick because info is not stored in AOD
1523 if (esdCent->GetCentralityPercentile("ZNA") != 101) znaFired = kTRUE;
1524 if (esdCent->GetCentralityPercentile("ZNC") != 101) zncFired = kTRUE;
1525 if (esdCent->GetCentralityPercentile("ZPA") != 101) zpaFired = kTRUE;
1526 if (esdCent->GetCentralityPercentile("ZPC") != 101) zpcFired = kTRUE;
377e5a61 1527 }
1528
1529 if (esd) {
99029fba 1530 // ***** MC info
1531 AliAnalysisManager* anMan = AliAnalysisManager::GetAnalysisManager();
1532 AliMCEventHandler* eventHandler = (AliMCEventHandler*)anMan->GetMCtruthEventHandler();
3a19f64f 1533 AliStack* stack=0;
99029fba 1534 AliMCEvent* mcEvent=0;
3a19f64f 1535 if (fIsMCInput && eventHandler && (mcEvent=eventHandler->MCEvent()) && (stack=mcEvent->Stack())) {
99029fba 1536 AliGenHijingEventHeader* hHijing=0;
9b389d09 1537 AliGenDPMjetEventHeader* dpmHeader=0;
1538
99029fba 1539 AliGenEventHeader* mcGenH = mcEvent->GenEventHeader();
74b0bf85 1540 if (mcGenH->InheritsFrom(AliGenHijingEventHeader::Class()))
1541 hHijing = (AliGenHijingEventHeader*)mcGenH;
99029fba 1542 else if (mcGenH->InheritsFrom(AliGenCocktailEventHeader::Class())) {
1543 TList* headers = ((AliGenCocktailEventHeader*)mcGenH)->GetHeaders();
3a19f64f 1544 //headers->Print();
99029fba 1545 hHijing = dynamic_cast<AliGenHijingEventHeader*>(headers->FindObject("Hijing"));
74b0bf85 1546 if (!hHijing) hHijing = dynamic_cast<AliGenHijingEventHeader*>(headers->FindObject("Hijing pPb_0"));
3ef9b178 1547 if (!hHijing) hHijing = dynamic_cast<AliGenHijingEventHeader*>(headers->FindObject("Hijing_0"));
99029fba 1548 }
9b389d09 1549 else if (mcGenH->InheritsFrom(AliGenDPMjetEventHeader::Class())) {
1550 dpmHeader = (AliGenDPMjetEventHeader*)mcGenH;
99029fba 1551 }
74b0bf85 1552 if(hHijing) Npart = hHijing->ProjectileParticipants()+hHijing->TargetParticipants();
1553 if(dpmHeader) Npart = dpmHeader->ProjectileParticipants()+ dpmHeader->TargetParticipants();
8432b617 1554 }
01974bd1 1555 }
1556
1557 // ***** Scaling for MC
1558 if (fIsMCInput) {
1559 fUseScaling=kFALSE;
1560 v0Corr = Short_t((multV0A+multV0C) * fV0MScaleFactorMC);
bfd47aba 1561 multV0A = multV0A * fV0MScaleFactorMC;
1562 multV0C = multV0C * fV0MScaleFactorMC;
01974bd1 1563 }
1564 // ***** Scaling for Data
1565 if (fUseScaling) {
1566 v0Corr = Short_t(v0Corr / fV0MScaleFactor);
1567 spdCorr = spdCorr / fSPDScaleFactor;
1568 nTracks = Int_t(nTracks / fTPCScaleFactor);
1569 }
1570
1571 // ***** Centrality Selection
1572 if(fHtempV0M) fCentV0M = fHtempV0M->GetBinContent(fHtempV0M->FindBin((v0Corr)));
e1d58f75 1573 if(fHtempV0A) fCentV0A = fHtempV0A->GetBinContent(fHtempV0A->FindBin((multV0ACorr)));
9113c527 1574 if(fHtempV0A0) fCentV0A0 = fHtempV0A0->GetBinContent(fHtempV0A0->FindBin((multV0A0)));
2d12adde 1575 if(fHtempV0A123) fCentV0A123 = fHtempV0A123->GetBinContent(fHtempV0A123->FindBin((multV0A123)));
e1d58f75 1576 if(fHtempV0C) fCentV0C = fHtempV0C->GetBinContent(fHtempV0C->FindBin((multV0CCorr)));
f9a774f9 1577 if(fHtempV0MEq) fCentV0MEq = fHtempV0MEq->GetBinContent(fHtempV0MEq->FindBin((multV0AEq+multV0CEq)));
1578 if(fHtempV0AEq) fCentV0AEq = fHtempV0AEq->GetBinContent(fHtempV0AEq->FindBin((multV0AEq)));
1579 if(fHtempV0CEq) fCentV0CEq = fHtempV0CEq->GetBinContent(fHtempV0CEq->FindBin((multV0CEq)));
01974bd1 1580 if(fHtempFMD) fCentFMD = fHtempFMD->GetBinContent(fHtempFMD->FindBin((multFMDA+multFMDC)));
1581 if(fHtempTRK) fCentTRK = fHtempTRK->GetBinContent(fHtempTRK->FindBin(nTracks));
1582 if(fHtempTKL) fCentTKL = fHtempTKL->GetBinContent(fHtempTKL->FindBin(nTracklets));
1583 if(fHtempCL0) fCentCL0 = fHtempCL0->GetBinContent(fHtempCL0->FindBin(nClusters[0]));
1584 if(fHtempCL1) fCentCL1 = fHtempCL1->GetBinContent(fHtempCL1->FindBin(spdCorr));
1585 if(fHtempCND) fCentCND = fHtempCND->GetBinContent(fHtempCND->FindBin(multCND));
99029fba 1586 if(fHtempZNA) {
1587 if(znaFired) fCentZNA = fHtempZNA->GetBinContent(fHtempZNA->FindBin(znaTower));
1588 else fCentZNA = 101;
1589 }
f9a774f9 1590 if(fHtempZNC) {
1591 if(zncFired) fCentZNC = fHtempZNC->GetBinContent(fHtempZNC->FindBin(zncTower));
1592 else fCentZNC = 101;
1593 }
3a19f64f 1594 if(fHtempZPA) {
1595 if(znaFired) fCentZPA = fHtempZPA->GetBinContent(fHtempZPA->FindBin(zpaTower));
1596 else fCentZPA = 101;
1597 }
1598 if(fHtempZPC) {
1599 if(zpcFired) fCentZPC = fHtempZPC->GetBinContent(fHtempZPC->FindBin(zpcTower));
1600 else fCentZPC = 101;
1601 }
1602
1603
01974bd1 1604 if(fHtempV0MvsFMD) fCentV0MvsFMD = fHtempV0MvsFMD->GetBinContent(fHtempV0MvsFMD->FindBin((multV0A+multV0C)));
1605 if(fHtempTKLvsV0M) fCentTKLvsV0M = fHtempTKLvsV0M->GetBinContent(fHtempTKLvsV0M->FindBin(nTracklets));
1606 if(fHtempZEMvsZDC) fCentZEMvsZDC = fHtempZEMvsZDC->GetBinContent(fHtempZEMvsZDC->FindBin(zem1Energy+zem2Energy,zncEnergy+znaEnergy+zpcEnergy+zpaEnergy));
1607
39a3e400 1608 if(fHtempNPA) fCentNPA = fHtempNPA->GetBinContent(fHtempNPA->FindBin(Npart));
1609 if(fHtempV0Mtrue) fCentV0Mtrue = fHtempV0Mtrue->GetBinContent(fHtempV0Mtrue->FindBin((multV0ACorr+multV0CCorr)));
1610 if(fHtempV0Atrue) fCentV0Atrue = fHtempV0Atrue->GetBinContent(fHtempV0Atrue->FindBin((multV0ACorr)));
1611 if(fHtempV0Ctrue) fCentV0Ctrue = fHtempV0Ctrue->GetBinContent(fHtempV0Ctrue->FindBin((multV0CCorr)));
f9a774f9 1612 if(fHtempV0MEqtrue) fCentV0MEqtrue = fHtempV0MEqtrue->GetBinContent(fHtempV0MEqtrue->FindBin((multV0AEq+multV0CEq)));
1613 if(fHtempV0AEqtrue) fCentV0AEqtrue = fHtempV0AEqtrue->GetBinContent(fHtempV0AEqtrue->FindBin((multV0AEq)));
1614 if(fHtempV0CEqtrue) fCentV0CEqtrue = fHtempV0CEqtrue->GetBinContent(fHtempV0CEqtrue->FindBin((multV0CEq)));
39a3e400 1615 if(fHtempFMDtrue) fCentFMDtrue = fHtempFMDtrue->GetBinContent(fHtempFMDtrue->FindBin((multFMDA+multFMDC)));
1616 if(fHtempTRKtrue) fCentTRKtrue = fHtempTRKtrue->GetBinContent(fHtempTRKtrue->FindBin(nTracks));
1617 if(fHtempTKLtrue) fCentTKLtrue = fHtempTKLtrue->GetBinContent(fHtempTKLtrue->FindBin(nTracklets));
1618 if(fHtempCL0true) fCentCL0true = fHtempCL0true->GetBinContent(fHtempCL0true->FindBin(nClusters[0]));
1619 if(fHtempCL1true) fCentCL1true = fHtempCL1true->GetBinContent(fHtempCL1true->FindBin(spdCorr));
1620 if(fHtempCNDtrue) fCentCNDtrue = fHtempCNDtrue->GetBinContent(fHtempCNDtrue->FindBin(multCND));
1621 if(fHtempZNAtrue) fCentZNAtrue = fHtempZNAtrue->GetBinContent(fHtempZNAtrue->FindBin(znaTower));
f9a774f9 1622 if(fHtempZNCtrue) fCentZNCtrue = fHtempZNCtrue->GetBinContent(fHtempZNCtrue->FindBin(zncTower));
39a3e400 1623
1624
01974bd1 1625 // ***** Cleaning
1626 if (fUseCleaning) {
1627 fQuality=0;
1628
1629 // ***** vertex
1630 if (TMath::Abs(zvtx)>fZVCut || zvtxNcont<1) fQuality += 1;
1631
1632 // ***** outliers, skip in case of MC input
1633 if (!fIsMCInput) {
1634 // **** V0 vs SPD
1635 if (IsOutlierV0MSPD(spdCorr, v0Corr, int(fCentV0M))) fQuality += 2;
1636 // ***** V0 vs TPC
1637 if (IsOutlierV0MTPC(nTracks, v0Corr, int(fCentV0M))) fQuality += 4;
1638 // ***** V0 vs ZDC
1639 if (IsOutlierV0MZDC((zncEnergy+znaEnergy+zpcEnergy+zpaEnergy), v0Corr) &&
1640 (zdcEnergyCal==kFALSE) ) fQuality += 8;
1641 if (IsOutlierV0MZDCECal((zncEnergy+znaEnergy+zpcEnergy+zpaEnergy), v0Corr) &&
1642 (zdcEnergyCal==kTRUE) ) fQuality += 8;
1643 }
1644 } else {
1645 fQuality = 0;
1646 }
1647
1648
1649 if (esdCent) {
377e5a61 1650 if (aod&&(fDebug>1)) {
1651 Double_t v0m = esdCent->GetCentralityPercentile("V0M");
1652 Double_t cl1 = esdCent->GetCentralityPercentile("CL1");
1653 Double_t trk = esdCent->GetCentralityPercentile("TRK");
1654 Double_t cnd = esdCent->GetCentralityPercentile("CND");
1655 Double_t zna = esdCent->GetCentralityPercentile("ZNA");
3a19f64f 1656 printf("AOD: v0m %.2f %.2f (%.2f) cl1 %.2f %.2f (%.2f) trk %.2f %.2f (%.2f) cnd %.2f %.2f (%.2f) zna %.2f %.2f (%.2f)\n",
377e5a61 1657 v0m, fCentV0M, fCentV0M!=0?v0m/fCentV0M:1, cl1, fCentCL1, fCentCL1!=0?cl1/fCentCL1:1, trk, fCentTRK,
3a19f64f 1658 fCentTRK!=0?trk/fCentTRK:1, cnd, fCentCND, fCentCND!=0?cnd/fCentCND:1, zna, fCentZNA, fCentZNA!=0?zna/fCentZNA:1);
377e5a61 1659 }
01974bd1 1660 esdCent->SetQuality(fQuality);
1661 esdCent->SetCentralityV0M(fCentV0M);
1662 esdCent->SetCentralityV0A(fCentV0A);
9113c527 1663 esdCent->SetCentralityV0A123(fCentV0A0);
2d12adde 1664 esdCent->SetCentralityV0A123(fCentV0A123);
01974bd1 1665 esdCent->SetCentralityV0C(fCentV0C);
f9a774f9 1666 esdCent->SetCentralityV0MEq(fCentV0MEq);
1667 esdCent->SetCentralityV0AEq(fCentV0AEq);
1668 esdCent->SetCentralityV0CEq(fCentV0CEq);
01974bd1 1669 esdCent->SetCentralityFMD(fCentFMD);
1670 esdCent->SetCentralityTRK(fCentTRK);
1671 esdCent->SetCentralityTKL(fCentTKL);
1672 esdCent->SetCentralityCL0(fCentCL0);
1673 esdCent->SetCentralityCL1(fCentCL1);
1674 esdCent->SetCentralityCND(fCentCND);
8432b617 1675 esdCent->SetCentralityNPA(fCentNPA);
99029fba 1676 esdCent->SetCentralityZNA(fCentZNA);
f9a774f9 1677 esdCent->SetCentralityZNC(fCentZNC);
3a19f64f 1678 esdCent->SetCentralityZPA(fCentZPA);
1679 esdCent->SetCentralityZPC(fCentZPC);
01974bd1 1680 esdCent->SetCentralityV0MvsFMD(fCentV0MvsFMD);
1681 esdCent->SetCentralityTKLvsV0M(fCentTKLvsV0M);
1682 esdCent->SetCentralityZEMvsZDC(fCentZEMvsZDC);
1683 }
1684
1685 // filling QA histograms
1686 if (fFillHistos) {
39a3e400 1687
1688 if (fIsMCInput) { // fill histo with true centrality for simulations
1689 fCentV0M = fCentV0Mtrue;
1690 fCentV0A = fCentV0Atrue;
1691 fCentV0C = fCentV0Ctrue;
f9a774f9 1692 fCentV0MEq = fCentV0MEqtrue;
1693 fCentV0AEq = fCentV0AEqtrue;
1694 fCentV0CEq = fCentV0CEqtrue;
39a3e400 1695 fCentFMD = fCentFMDtrue;
1696 fCentTRK = fCentTRKtrue;
1697 fCentTKL = fCentTKLtrue;
1698 fCentCL0 = fCentCL0true;
1699 fCentCL1 = fCentCL1true;
1700 fCentCND = fCentCNDtrue;
1701 fCentZNA = fCentZNAtrue;
f9a774f9 1702 fCentZNC = fCentZNCtrue;
3a19f64f 1703 fCentZPA = fCentZPAtrue;
1704 fCentZPC = fCentZPCtrue;
39a3e400 1705 }
1706
1707
01974bd1 1708 if ((fMB) && (abs(zvtx)<10)) fHOutMultCL1vsTKL->Fill(spdCorr,nTracklets);
1709
1710 if (fCVHN) fHOutCentV0MCVHN->Fill(fCentV0M);
1711 if (fCVLN) fHOutCentV0MCVLN->Fill(fCentV0M);
1712 if (fCCENT) fHOutCentV0MCCENT->Fill(fCentV0M);
1713 if (fCSEMI) fHOutCentV0MCSEMI->Fill(fCentV0M);
1714 if (fMSL) fHOutCentV0MMSL->Fill(fCentV0M);
1715 if (fMSH) fHOutCentV0MMSH->Fill(fCentV0M);
1716 if (fMUL) fHOutCentV0MMUL->Fill(fCentV0M);
1717 if (fMLL) fHOutCentV0MMLL->Fill(fCentV0M);
1718 if (fEJE) fHOutCentV0MEJE->Fill(fCentV0M);
1719 if (fEGA) fHOutCentV0MEGA->Fill(fCentV0M);
1720 if (fPHS) fHOutCentV0MPHS->Fill(fCentV0M);
1721
c932ac15 1722 if (((((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected() & AliVEvent::kMB) && (runType==0)) ||
9113c527 1723 ((((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected() & AliVEvent::kINT7) && (runType==1))) { // fill the QA histograms only for MB events!
1724
01974bd1 1725 fHOutQuality->Fill(fQuality);
1726 fHOutVertex->Fill(zvtx);
1727 fHOutVertexT0->Fill(zvtxT0);
1728
1729 if (fQuality==0) {
1730 fHOutCentV0M->Fill(fCentV0M);
1731 fHOutCentV0A->Fill(fCentV0A);
9113c527 1732 fHOutCentV0A0->Fill(fCentV0A0);
2d12adde 1733 fHOutCentV0A123->Fill(fCentV0A123);
01974bd1 1734 fHOutCentV0C->Fill(fCentV0C);
f9a774f9 1735 fHOutCentV0MEq->Fill(fCentV0MEq);
1736 fHOutCentV0AEq->Fill(fCentV0AEq);
1737 fHOutCentV0CEq->Fill(fCentV0CEq);
01974bd1 1738
1739 if (fCVHNbit) fHOutCentV0MCVHNinMB->Fill(fCentV0M);
1740 if (fCVLNbit) fHOutCentV0MCVLNinMB->Fill(fCentV0M);
1741 if (fCCENTbit) fHOutCentV0MCCENTinMB->Fill(fCentV0M);
1742 if (fCSEMIbit) fHOutCentV0MCSEMIinMB->Fill(fCentV0M);
1743 if (fMSL) fHOutCentV0MMSLinMB->Fill(fCentV0M);
1744 if (fMSH) fHOutCentV0MMSHinMB->Fill(fCentV0M);
1745 if (fMUL) fHOutCentV0MMULinMB->Fill(fCentV0M);
1746 if (fMLL) fHOutCentV0MMLLinMB->Fill(fCentV0M);
1747 if (fEJE) fHOutCentV0MEJEinMB->Fill(fCentV0M);
1748 if (fEGA) fHOutCentV0MEGAinMB->Fill(fCentV0M);
1749 if (fPHS) fHOutCentV0MPHSinMB->Fill(fCentV0M);
1750
1751 fHOutCentFMD->Fill(fCentFMD);
1752 fHOutCentTRK->Fill(fCentTRK);
1753 fHOutCentTKL->Fill(fCentTKL);
1754 fHOutCentCL0->Fill(fCentCL0);
1755 fHOutCentCL1->Fill(fCentCL1);
1756 fHOutCentCND->Fill(fCentCND);
8432b617 1757 fHOutCentNPA->Fill(fCentNPA);
99029fba 1758 fHOutCentZNA->Fill(fCentZNA);
f9a774f9 1759 fHOutCentZNC->Fill(fCentZNC);
3a19f64f 1760 fHOutCentZPA->Fill(fCentZPA);
1761 fHOutCentZPC->Fill(fCentZPC);
01974bd1 1762 fHOutCentV0MvsFMD->Fill(fCentV0MvsFMD);
1763 fHOutCentTKLvsV0M->Fill(fCentTKLvsV0M);
1764 fHOutCentZEMvsZDC->Fill(fCentZEMvsZDC);
1765 fHOutCentV0MvsCentCL1->Fill(fCentV0M,fCentCL1);
1766 fHOutCentV0MvsCentTRK->Fill(fCentV0M,fCentTRK);
1767 fHOutCentTRKvsCentCL1->Fill(fCentTRK,fCentCL1);
1768 fHOutCentV0MvsCentZDC->Fill(fCentV0M,fCentZEMvsZDC);
1769 fHOutCentV0AvsCentV0C->Fill(fCentV0A,fCentV0C);
1770 fHOutCentV0AvsCentTRK->Fill(fCentV0A,fCentTRK);
1771 fHOutCentV0AvsCentCND->Fill(fCentV0A,fCentCND);
1772 fHOutCentV0AvsCentCL1->Fill(fCentV0A,fCentCL1);
1773 fHOutCentV0CvsCentTRK->Fill(fCentV0C,fCentTRK);
1774 fHOutCentV0CvsCentCND->Fill(fCentV0C,fCentCND);
1775 fHOutCentV0CvsCentCL1->Fill(fCentV0C,fCentCL1);
8432b617 1776 fHOutCentNPAvsCentV0A->Fill(fCentNPA,fCentV0A);
1777 fHOutCentNPAvsCentV0C->Fill(fCentNPA,fCentV0C);
1778 fHOutCentNPAvsCentTRK->Fill(fCentNPA,fCentTRK);
1779 fHOutCentNPAvsCentCND->Fill(fCentNPA,fCentCND);
1780 fHOutCentNPAvsCentCL1->Fill(fCentNPA,fCentCL1);
99029fba 1781 fHOutCentZNAvsCentV0A->Fill(fCentZNA,fCentV0A);
1782 fHOutCentZNAvsCentV0C->Fill(fCentZNA,fCentV0C);
1783 fHOutCentZNAvsCentTRK->Fill(fCentZNA,fCentTRK);
1784 fHOutCentZNAvsCentCND->Fill(fCentZNA,fCentCND);
1785 fHOutCentZNAvsCentCL1->Fill(fCentZNA,fCentCL1);
bfbc1975 1786 fHOutCentZNAvsCentZPA->Fill(fCentZNA,fCentZPA);
01974bd1 1787
1788 fHOutMultV0AC->Fill(multV0A,multV0C);
e1d58f75 1789 fHOutMultV0M->Fill(multV0ACorr+multV0CCorr);
1790 fHOutMultV0A->Fill(multV0ACorr);
9113c527 1791 fHOutMultV0A0->Fill(multV0A0);
2d12adde 1792 fHOutMultV0A123->Fill(multV0A123);
e1d58f75 1793 fHOutMultV0C->Fill(multV0CCorr);
f9a774f9 1794 fHOutMultV0MEq->Fill(multV0AEq+multV0CEq);
1795 fHOutMultV0AEq->Fill(multV0AEq);
1796 fHOutMultV0CEq->Fill(multV0CEq);
e1d58f75 1797 fHOutMultV0Mnc->Fill(multV0A+multV0C);
1798 fHOutMultV0Anc->Fill(multV0A);
1799 fHOutMultV0Cnc->Fill(multV0C);
01974bd1 1800 fHOutMultV0O->Fill(multV0AOnline+multV0COnline);
1801 fHOutMultV0Cells->Fill(nV0A,nV0C);
1802 fHOutMultFMD->Fill(multFMDA+multFMDC);
1803 fHOutMultTRK->Fill(nTracks);
1804 fHOutMultTKL->Fill(nTracklets);
1805 fHOutMultCL0->Fill(nClusters[0]);
1806 fHOutMultCL1->Fill(spdCorr);
1807 fHOutMultCND->Fill(multCND);
8432b617 1808 fHOutMultNPA->Fill(Npart);
f9a774f9 1809 if(znaFired)fHOutMultZNA->Fill(znaTower);
1810 if(zncFired)fHOutMultZNC->Fill(zncTower);
3a19f64f 1811 if(zpaFired)fHOutMultZPA->Fill(zpaTower);
1812 if(zpcFired)fHOutMultZPC->Fill(zpcTower);
bfbc1975 1813 fHOutMultZNAvsZPA->Fill(znaTower,zpaTower);
01974bd1 1814
3a19f64f 1815 //fHOutMultV0MvsZDN->Fill(v0Corr,(zncEnergy+znaEnergy));
1816 fHOutMultV0MvsZDN->Fill(v0Corr,znaTower);
01974bd1 1817 fHOutMultZEMvsZDN->Fill((zem1Energy+zem2Energy),(zncEnergy+znaEnergy));
1818 fHOutMultV0MvsZDC->Fill(v0Corr,(zncEnergy+znaEnergy+zpcEnergy+zpaEnergy));
1819 fHOutMultZEMvsZDC->Fill((zem1Energy+zem2Energy),(zncEnergy+znaEnergy+zpcEnergy+zpaEnergy));
1820 fHOutMultZEMvsZDCw->Fill((zem1Energy+zem2Energy),(zncEnergy+znaEnergy+zpcEnergy+zpaEnergy),fCentV0M);
1821 fHOutMultV0MvsCL1->Fill(v0Corr,spdCorr);
1822 fHOutMultV0MvsTRK->Fill(v0Corr,nTracks);
1823 fHOutMultTRKvsCL1->Fill(nTracks,spdCorr);
1824 fHOutMultV0MvsV0O->Fill(v0Corr,(multV0AOnline+multV0COnline));
1825 fHOutMultV0OvsCL1->Fill((multV0AOnline+multV0COnline),spdCorr);
1826 fHOutMultV0OvsTRK->Fill((multV0AOnline+multV0COnline),nTracks);
1827 } else if (fQuality%2 == 0) {
1828 fHOutCentV0Mqual1->Fill(fCentV0M);
1829 fHOutCentTRKqual1->Fill(fCentTRK);
1830 fHOutCentCL1qual1->Fill(fCentCL1);
1831 fHOutMultV0MvsCL1qual1->Fill(v0Corr,spdCorr);
1832 fHOutMultV0MvsTRKqual1->Fill(v0Corr,nTracks);
1833 fHOutMultTRKvsCL1qual1->Fill(nTracks,spdCorr);
1834 } else {
1835 fHOutCentV0Mqual2->Fill(fCentV0M);
1836 fHOutCentTRKqual2->Fill(fCentTRK);
1837 fHOutCentCL1qual2->Fill(fCentCL1);
1838 fHOutMultV0MvsCL1qual2->Fill(v0Corr,spdCorr);
1839 fHOutMultV0MvsTRKqual2->Fill(v0Corr,nTracks);
1840 fHOutMultTRKvsCL1qual2->Fill(nTracks,spdCorr);
1841 }
1842 }
1843 PostData(1, fOutputList);
1844 }
1845}
1846//________________________________________________________________________
1847void AliCentralitySelectionTask::Terminate(Option_t */*option*/)
1848{
1849 // Terminate analysis
1850}
1851//________________________________________________________________________
377e5a61 1852Int_t AliCentralitySelectionTask::SetupRun(const AliVEvent* const esd)
01974bd1 1853{
1854 // Setup files for run
1855
1856 if (!esd)
1857 return -1;
1858
1859 // check if something to be done
1860 if (fCurrentRun == esd->GetRunNumber())
1861 return 0;
1862 else
1863 fCurrentRun = esd->GetRunNumber();
1864
1865 TString fileName =(Form("%s/COMMON/CENTRALITY/data/centrality.root", AliAnalysisManager::GetOADBPath()));
1866 AliInfo(Form("Setup Centrality Selection for run %d with file %s\n",fCurrentRun,fileName.Data()));
1867
1868 AliOADBContainer *con = new AliOADBContainer("OADB");
1869 con->InitFromFile(fileName,"Centrality");
1870
1871 AliOADBCentrality* centOADB = 0;
1872 centOADB = (AliOADBCentrality*)(con->GetObject(fCurrentRun));
1873 if (!centOADB) {
1874 AliWarning(Form("Centrality OADB does not exist for run %d, using Default \n",fCurrentRun ));
1875 centOADB = (AliOADBCentrality*)(con->GetDefaultObject("oadbDefault"));
1876 }
1877
39a3e400 1878 Bool_t isHijing=kFALSE;
1879 Bool_t isDpmjet=kFALSE;
1880 AliAnalysisManager* anMan = AliAnalysisManager::GetAnalysisManager();
1881 AliMCEventHandler* eventHandler = (AliMCEventHandler*)anMan->GetMCtruthEventHandler();
1882 AliMCEvent* mcEvent=0;
1883 if (fIsMCInput && eventHandler && (mcEvent=eventHandler->MCEvent()) ) {
1884 AliGenEventHeader* mcGenH = mcEvent->GenEventHeader();
1885 if (mcGenH->InheritsFrom(AliGenHijingEventHeader::Class())) isHijing=kTRUE;
1886 else if (mcGenH->InheritsFrom(AliGenCocktailEventHeader::Class())) isHijing=kTRUE;
1887 else if (mcGenH->InheritsFrom(AliGenDPMjetEventHeader::Class())) isDpmjet=kTRUE;
1888 }
1889
1890
01974bd1 1891 // modes
1892 fUseScaling = centOADB->UseScaling();
1893 fUseCleaning = centOADB->UseCleaning();
1894
1895 // cuts
1896 fZVCut = centOADB->ZVCut();
1897 fOutliersCut = centOADB->OutliersCut();
1898
1899 // centrality histos
1900 fHtempV0M = centOADB->V0hist();
1901 fHtempV0A = centOADB->V0Ahist();
9113c527 1902 fHtempV0A0 = centOADB->V0A0hist();
2d12adde 1903 fHtempV0A123 = centOADB->V0A123hist();
01974bd1 1904 fHtempV0C = centOADB->V0Chist();
f9a774f9 1905 fHtempV0MEq = centOADB->V0Eqhist();
1906 fHtempV0AEq = centOADB->V0AEqhist();
1907 fHtempV0CEq = centOADB->V0CEqhist();
01974bd1 1908 fHtempTRK = centOADB->TPChist();
1909 fHtempCL1 = centOADB->SPDhist();
1910 fHtempCND = centOADB->CNDhist();
39a3e400 1911 fHtempFMD = centOADB->FMDhist();
99029fba 1912 fHtempZNA = centOADB->ZNAhist();
f9a774f9 1913 fHtempZNC = centOADB->ZNChist();
3a19f64f 1914 fHtempZPA = centOADB->ZPAhist();
1915 fHtempZPC = centOADB->ZPChist();
01974bd1 1916 fHtempZEMvsZDC = centOADB->ZEMvsZDChist();
39a3e400 1917
f9a774f9 1918 if (isHijing) {
1919 fHtempNPA = centOADB->NPAhist();
1920 fHtempV0Mtrue = centOADB->V0histtrue();
1921 fHtempV0Atrue = centOADB->V0Ahisttrue();
1922 fHtempV0Ctrue = centOADB->V0Chisttrue();
1923 fHtempV0MEqtrue = centOADB->V0Eqhisttrue();
1924 fHtempV0AEqtrue = centOADB->V0AEqhisttrue();
1925 fHtempV0CEqtrue = centOADB->V0CEqhisttrue();
1926 fHtempTRKtrue = centOADB->TPChisttrue();
1927 fHtempCL1true = centOADB->SPDhisttrue();
1928 fHtempCNDtrue = centOADB->CNDhisttrue();
1929 fHtempFMDtrue = centOADB->FMDhisttrue();
1930 fHtempZNAtrue = centOADB->ZNAhisttrue();
1931 fHtempZNCtrue = centOADB->ZNChisttrue();
3a19f64f 1932 fHtempZPAtrue = centOADB->ZPAhisttrue();
1933 fHtempZPCtrue = centOADB->ZPChisttrue();
f9a774f9 1934 } else if (isDpmjet) {
1935 fHtempNPA = centOADB->NPAhistDPM();
1936 fHtempV0Mtrue = centOADB->V0histtrueDPM();
1937 fHtempV0Atrue = centOADB->V0AhisttrueDPM();
1938 fHtempV0Ctrue = centOADB->V0ChisttrueDPM();
1939 fHtempV0MEqtrue = centOADB->V0EqhisttrueDPM();
1940 fHtempV0AEqtrue = centOADB->V0AEqhisttrueDPM();
1941 fHtempV0CEqtrue = centOADB->V0CEqhisttrueDPM();
1942 fHtempTRKtrue = centOADB->TPChisttrueDPM();
1943 fHtempCL1true = centOADB->SPDhisttrueDPM();
1944 fHtempCNDtrue = centOADB->CNDhisttrueDPM();
1945 fHtempFMDtrue = centOADB->FMDhisttrueDPM();
1946 fHtempZNAtrue = centOADB->ZNAhisttrueDPM();
1947 fHtempZNCtrue = centOADB->ZNChisttrueDPM();
3a19f64f 1948 fHtempZPAtrue = centOADB->ZPAhisttrueDPM();
1949 fHtempZPCtrue = centOADB->ZPChisttrueDPM();
f9a774f9 1950 }
1951
1952
1953 TString path = gSystem->ExpandPathName(fileName.Data());
01974bd1 1954 if (!fHtempV0M) AliWarning(Form("Calibration for V0M does not exist in %s", path.Data()));
1955 if (!fHtempV0A) AliWarning(Form("Calibration for V0A does not exist in %s", path.Data()));
1956 if (!fHtempV0C) AliWarning(Form("Calibration for V0C does not exist in %s", path.Data()));
f9a774f9 1957 if (!fHtempV0MEq) AliWarning(Form("Calibration for V0MEq does not exist in %s", path.Data()));
1958 if (!fHtempV0AEq) AliWarning(Form("Calibration for V0AEq does not exist in %s", path.Data()));
1959 if (!fHtempV0CEq) AliWarning(Form("Calibration for V0CEq does not exist in %s", path.Data()));
01974bd1 1960 if (!fHtempTRK) AliWarning(Form("Calibration for TRK does not exist in %s", path.Data()));
1961 if (!fHtempCL1) AliWarning(Form("Calibration for CL1 does not exist in %s", path.Data()));
1962 if (!fHtempCND) AliWarning(Form("Calibration for CND does not exist in %s", path.Data()));
99029fba 1963 if (!fHtempZNA) AliWarning(Form("Calibration for ZNA does not exist in %s", path.Data()));
f9a774f9 1964 if (!fHtempZNC) AliWarning(Form("Calibration for ZNC does not exist in %s", path.Data()));
3a19f64f 1965 if (!fHtempZPA) AliWarning(Form("Calibration for ZPA does not exist in %s", path.Data()));
1966 if (!fHtempZPC) AliWarning(Form("Calibration for ZPC does not exist in %s", path.Data()));
39a3e400 1967 if (!fHtempFMD) AliWarning(Form("Calibration for FMD does not exist in %s", path.Data()));
01974bd1 1968 if (!fHtempZEMvsZDC) AliWarning(Form("Calibration for ZEMvsZDC does not exist in %s", path.Data()));
39a3e400 1969 if (!fHtempNPA) AliWarning(Form("Calibration for NPA does not exist in %s", path.Data()));
1970
1971 if (!fHtempV0Mtrue) AliWarning(Form("Calibration for V0Mtrue does not exist in %s", path.Data()));
1972 if (!fHtempV0Atrue) AliWarning(Form("Calibration for V0Atrue does not exist in %s", path.Data()));
1973 if (!fHtempV0Ctrue) AliWarning(Form("Calibration for V0Ctrue does not exist in %s", path.Data()));
f9a774f9 1974 if (!fHtempV0MEqtrue) AliWarning(Form("Calibration for V0MEqtrue does not exist in %s", path.Data()));
1975 if (!fHtempV0AEqtrue) AliWarning(Form("Calibration for V0AEqtrue does not exist in %s", path.Data()));
1976 if (!fHtempV0CEqtrue) AliWarning(Form("Calibration for V0CEqtrue does not exist in %s", path.Data()));
39a3e400 1977 if (!fHtempTRKtrue) AliWarning(Form("Calibration for TRKtrue does not exist in %s", path.Data()));
1978 if (!fHtempCL1true) AliWarning(Form("Calibration for CL1true does not exist in %s", path.Data()));
1979 if (!fHtempCNDtrue) AliWarning(Form("Calibration for CNDtrue does not exist in %s", path.Data()));
1980 if (!fHtempZNAtrue) AliWarning(Form("Calibration for ZNAtrue does not exist in %s", path.Data()));
f9a774f9 1981 if (!fHtempZNCtrue) AliWarning(Form("Calibration for ZNCtrue does not exist in %s", path.Data()));
3a19f64f 1982 if (!fHtempZPAtrue) AliWarning(Form("Calibration for ZPAtrue does not exist in %s", path.Data()));
1983 if (!fHtempZPCtrue) AliWarning(Form("Calibration for ZPCtrue does not exist in %s", path.Data()));
39a3e400 1984 if (!fHtempFMDtrue) AliWarning(Form("Calibration for FMDtrue does not exist in %s", path.Data()));
01974bd1 1985
f9a774f9 1986
01974bd1 1987 // scale factors
1988 fV0MScaleFactor = centOADB->V0MScaleFactor();
1989 fSPDScaleFactor = centOADB->SPDScaleFactor();
1990 fTPCScaleFactor = centOADB->TPCScaleFactor();
1991 fV0MScaleFactorMC = centOADB->V0MScaleFactorMC();
1992
1993 // outliers parameters
1994 fV0MSPDOutlierPar0 = centOADB->V0MSPDOutlierPar0();
1995 fV0MSPDOutlierPar1 = centOADB->V0MSPDOutlierPar1();
1996 fV0MTPCOutlierPar0 = centOADB->V0MTPCOutlierPar0();
1997 fV0MTPCOutlierPar1 = centOADB->V0MTPCOutlierPar1();
1998
1999 fV0MSPDSigmaOutlierPar0 = centOADB->V0MSPDSigmaOutlierPar0();
2000 fV0MSPDSigmaOutlierPar1 = centOADB->V0MSPDSigmaOutlierPar1();
2001 fV0MSPDSigmaOutlierPar2 = centOADB->V0MSPDSigmaOutlierPar2();
2002 fV0MTPCSigmaOutlierPar0 = centOADB->V0MTPCSigmaOutlierPar0();
2003 fV0MTPCSigmaOutlierPar1 = centOADB->V0MTPCSigmaOutlierPar1();
2004 fV0MTPCSigmaOutlierPar2 = centOADB->V0MTPCSigmaOutlierPar2();
2005
2006 fV0MZDCOutlierPar0 = centOADB->V0MZDCOutlierPar0();
2007 fV0MZDCOutlierPar1 = centOADB->V0MZDCOutlierPar1();
2008 fV0MZDCEcalOutlierPar0 = centOADB->V0MZDCEcalOutlierPar0();
2009 fV0MZDCEcalOutlierPar1 = centOADB->V0MZDCEcalOutlierPar1();
2010
01974bd1 2011 return 0;
2012}
2013
2014
2015
2016//________________________________________________________________________
2017Bool_t AliCentralitySelectionTask::IsOutlierV0MSPD(Float_t spd, Float_t v0, Int_t cent) const
2018{
2019 // Clean outliers
2020 Float_t val = fV0MSPDOutlierPar0 + fV0MSPDOutlierPar1 * v0;
2021 Float_t spdSigma = fV0MSPDSigmaOutlierPar0 + fV0MSPDSigmaOutlierPar1*cent + fV0MSPDSigmaOutlierPar2*cent*cent;
2022 if ( TMath::Abs(spd-val) > fOutliersCut*spdSigma )
2023 return kTRUE;
2024 else
2025 return kFALSE;
2026}
2027
2028//________________________________________________________________________
2029Bool_t AliCentralitySelectionTask::IsOutlierV0MTPC(Int_t tracks, Float_t v0, Int_t cent) const
2030{
2031 // Clean outliers
2032 Float_t val = fV0MTPCOutlierPar0 + fV0MTPCOutlierPar1 * v0;
2033 Float_t tpcSigma = fV0MTPCSigmaOutlierPar0 + fV0MTPCSigmaOutlierPar1*cent + fV0MTPCSigmaOutlierPar2*cent*cent;
2034 if ( TMath::Abs(tracks-val) > fOutliersCut*tpcSigma )
2035 return kTRUE;
2036 else
2037 return kFALSE;
2038}
2039
2040//________________________________________________________________________
2041Bool_t AliCentralitySelectionTask::IsOutlierV0MZDC(Float_t zdc, Float_t v0) const
2042{
2043 // Clean outliers
2044 Float_t val = fV0MZDCOutlierPar0 + fV0MZDCOutlierPar1 * v0;
2045 if (zdc > val)
2046 return kTRUE;
2047 else
2048 return kFALSE;
2049}
2050
2051//________________________________________________________________________
2052Bool_t AliCentralitySelectionTask::IsOutlierV0MZDCECal(Float_t zdc, Float_t v0) const
2053{
2054 // Clean outliers
2055 Float_t val = fV0MZDCEcalOutlierPar0 + fV0MZDCEcalOutlierPar1 * v0;
2056 if (zdc > val)
2057 return kTRUE;
2058 else
2059 return kFALSE;
2060}