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