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