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