AliPhysics  b555aef (b555aef)
AliAnalysisTaskCRCZDC.cxx
Go to the documentation of this file.
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 thce 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 * analysis task for CRC with ZDC *
18 * *
19 * author: Jacopo Margutti *
20 * (margutti@nikhef.nl) *
21 **********************************/
22 
23 #include "Riostream.h" //needed as include
24 #include "TChain.h"
25 #include "TList.h"
26 #include "TTree.h"
27 #include "TRandom3.h"
28 #include "TTimeStamp.h"
29 #include "TStopwatch.h"
30 #include "TProfile.h"
31 #include <TList.h>
32 #include <TH1F.h>
33 #include <TH2F.h>
34 #include <TH3D.h>
35 #include <TFile.h>
36 #include <TString.h>
37 #include <TCanvas.h>
38 #include <TParticle.h>
39 #include "TProfile2D.h"
40 #include "TProfile3D.h"
41 
42 #include "AliAnalysisManager.h"
43 #include "AliInputEventHandler.h"
44 #include "AliVEvent.h"
45 #include "AliESD.h"
46 #include "AliESDEvent.h"
47 #include "AliESDHeader.h"
48 #include "AliESDInputHandler.h"
49 #include "AliESDZDC.h"
50 #include "AliMultiplicity.h"
51 #include "AliAnalysisUtils.h"
52 #include "AliAODHandler.h"
53 #include "AliAODTrack.h"
54 #include "AliAODEvent.h"
55 #include "AliAODHeader.h"
56 #include "AliAODVertex.h"
57 #include "AliAODVZERO.h"
58 #include "AliAODZDC.h"
59 #include "AliAODMCHeader.h"
60 #include "AliMCEventHandler.h"
61 #include "AliMCEvent.h"
62 #include "AliHeader.h"
63 #include "AliVParticle.h"
64 #include "AliStack.h"
65 #include "AliAODMCParticle.h"
66 #include "AliAnalysisTaskSE.h"
67 #include "AliGenEventHeader.h"
68 #include "AliPhysicsSelectionTask.h"
69 #include "AliPhysicsSelection.h"
70 #include "AliBackgroundSelection.h"
71 #include "AliTriggerAnalysis.h"
72 #include "AliCentrality.h"
73 #include "AliAnalysisTaskCRCZDC.h"
74 #include "AliMultSelection.h"
75 #include "AliLumiTools.h"
76 
77 // ALICE Correction Framework
78 #include "AliCFManager.h"
79 
80 // Interface to Event generators to get Reaction Plane Angle
81 #include "AliGenCocktailEventHeader.h"
82 #include "AliGenPythiaEventHeader.h"
83 #include "AliGenHijingEventHeader.h"
84 #include "AliGenGeVSimEventHeader.h"
85 #include "AliGenEposEventHeader.h"
86 
87 // Interface to Load short life particles
88 #include "TObjArray.h"
89 #include "AliFlowCandidateTrack.h"
90 
91 // Interface to make the Flow Event Simple used in the flow analysis methods
92 #include "AliFlowEvent.h"
93 #include "AliFlowTrackCuts.h"
94 #include "AliFlowEventCuts.h"
95 #include "AliFlowCommonConstants.h"
96 
97 //NanoAODs
98 #include "AliNanoAODTrack.h"
99 #include "AliNanoAODHeader.h"
100 
101 ClassImp(AliAnalysisTaskCRCZDC)
102 
103 //________________________________________________________________________
106 fAnalysisType(kAUTOMATIC),
107 fRPType(""),
108 fCFManager1(NULL),
109 fCFManager2(NULL),
110 fCutsEvent(NULL),
111 fCutsRP(NULL),
112 fCutsPOI(NULL),
113 fCutContainer(new TList()),
114 fQAList(NULL),
115 fMinMult(0),
116 fMaxMult(10000000),
117 fAnalysisUtil(NULL),
118 fMinA(-1.0),
119 fMaxA(-0.01),
120 fMinB(0.01),
121 fMaxB(1.0),
122 fGenHeader(NULL),
123 fPythiaGenHeader(NULL),
124 fHijingGenHeader(NULL),
125 fFlowTrack(NULL),
126 fQAon(kFALSE),
127 fLoadCandidates(kFALSE),
128 fNbinsMult(10000),
129 fNbinsPt(100),
130 fNbinsPhi(100),
131 fNbinsEta(200),
132 fNbinsQ(500),
133 fNbinsMass(1),
134 fMultMin(0.),
135 fMultMax(10000.),
136 fPtMin(0.),
137 fPtMax(10.),
138 fPhiMin(0.),
139 fPhiMax(TMath::TwoPi()),
140 fEtaMin(-5.),
141 fEtaMax(5.),
142 fQMin(0.),
143 fQMax(3.),
144 fMassMin(-1.),
145 fMassMax(0.),
146 fHistWeightvsPhiMin(0.),
147 fHistWeightvsPhiMax(3.),
148 fExcludedEtaMin(0.),
149 fExcludedEtaMax(0.),
150 fExcludedPhiMin(0.),
151 fExcludedPhiMax(0.),
152 fAfterburnerOn(kFALSE),
153 fNonFlowNumberOfTrackClones(0),
154 fV1(0.),
155 fV2(0.),
156 fV3(0.),
157 fV4(0.),
158 fV5(0.),
159 fDifferentialV2(0),
160 fFlowEvent(NULL),
161 fShuffleTracks(kFALSE),
162 fMyTRandom3(NULL),
163 fAnalysisInput(kAOD),
164 fIsMCInput(kFALSE),
165 fUseMCCen(kTRUE),
166 fRejectPileUp(kTRUE),
167 fRejectPileUpTight(kFALSE),
168 fResetNegativeZDC(kFALSE),
169 fCentrLowLim(0.),
170 fCentrUpLim(100.),
171 fCentrEstimator(kV0M),
172 fOutput(0x0),
173 fhZNCvsZNA(0x0),
174 fhZDCCvsZDCCA(0x0),
175 fhZNCvsZPC(0x0),
176 fhZNAvsZPA(0x0),
177 fhZNvsZP(0x0),
178 fhZNvsVZERO(0x0),
179 fhZDCvsVZERO(0x0),
180 fhAsymm(0x0),
181 fhZNAvsAsymm(0x0),
182 fhZNCvsAsymm(0x0),
183 fhZNCvscentrality(0x0),
184 fhZNAvscentrality(0x0),
185 fhZPCvscentrality(0x0),
186 fhZPAvscentrality(0x0),
187 fCRCnRun(0),
188 fZDCGainAlpha(0.395),
189 fDataSet(kAny),
190 fStack(0x0),
191 fCutTPC(kFALSE),
192 fCenDis(0x0),
193 fVZEROMult(0x0),
194 fMultSelection(0x0),
195 fPileUpCount(0x0),
196 fPileUpMultSelCount(0x0),
197 fMultTOFLowCut(0x0),
198 fMultTOFHighCut(0x0),
199 fUseTowerEq(kFALSE),
200 fTowerEqList(NULL),
201 fUseBadTowerCalib(kFALSE),
202 fBadTowerCalibList(NULL),
203 fVZEROGainEqList(NULL),
204 fVZEROQVecRecList(NULL),
205 fUseZDCSpectraCorr(kFALSE),
206 fCorrectPhiTracklets(kFALSE),
207 fZDCSpectraCorrList(NULL),
208 fSpectraMCList(NULL),
209 fTrackQAList(NULL),
210 fBadTowerStuffList(NULL),
211 fVZEROStuffList(NULL),
212 fVZEROGainEqHist(NULL),
213 fMinRingVZC(1),
214 fMaxRingVZC(4),
215 fMinRingVZA(5),
216 fMaxRingVZA(8),
217 fCachedRunNum(0),
218 fhZNSpectra(0x0),
219 fhZNSpectraCor(0x0),
220 fhZNSpectraPow(0x0),
221 fhZNBCCorr(0x0),
222 fQATrackTPCNcls(NULL),
223 fQATrackITSNcls(NULL),
224 fQATrackTPCchi2(NULL),
225 fQATrackITSchi2(NULL),
226 fQATrackTPCScls(NULL),
227 fQATrackITSScls(NULL)
228 {
229  for(int i=0; i<5; i++){
230  fhZNCPM[i] = 0x0;
231  fhZNAPM[i] = 0x0;
232  }
233  for(int i=0; i<4; i++){
234  fhZNCPMQiPMC[i] = 0x0;
235  fhZNAPMQiPMC[i] = 0x0;
236  }
237  for(Int_t r=0; r<fCRCMaxnRun; r++) {
238  fRunList[r] = 0;
239  }
240  for(Int_t c=0; c<2; c++) {
241  for(Int_t i=0; i<5; i++) {
242  fTowerGainEq[c][i] = NULL;
243  }
244  }
245  for(Int_t c=0; c<100; c++) {
246  fBadTowerCalibHist[c] = NULL;
247  }
248  for (Int_t k=0; k<fkVZEROnHar; k++) {
249  // fVZEROQVectorRecQx[k] = NULL;
250  // fVZEROQVectorRecQy[k] = NULL;
251  fVZEROQVectorRecQxStored[k] = NULL;
252  fVZEROQVectorRecQyStored[k] = NULL;
253  for (Int_t t=0; t<fkVZEROnQAplots; t++) {
254  fVZEROQVectorRecFinal[k][t] = NULL;
255  }
256  }
257  for(Int_t i=0; i<8; i++) {
258  SpecCorMu1[i] = NULL;
259  SpecCorMu2[i] = NULL;
260  SpecCorSi[i] = NULL;
261  SpecCorAv[i] = NULL;
262  }
263  this->InitializeRunArrays();
264  fMyTRandom3 = new TRandom3(1);
265  gRandom->SetSeed(fMyTRandom3->Integer(65539));
266  for(Int_t j=0; j<2; j++) {
267  for(Int_t c=0; c<10; c++) {
268  fPtSpecGen[j][c] = NULL;
269  fPtSpecFB32[j][c] = NULL;
270  fPtSpecFB96[j][c] = NULL;
271  fPtSpecFB128[j][c] = NULL;
272  fPtSpecFB768[j][c] = NULL;
273  }
274  }
275  for (Int_t c=0; c<2; c++) {
276  fhZNCenDis[c] = NULL;
277  }
278  for(Int_t fb=0; fb<fKNFBs; fb++){
279  for (Int_t i=0; i<4; i++) {
280  fTrackQADCAxy[fb][i] = NULL;
281  fTrackQADCAz[fb][i] = NULL;
282  fTrackQApT[fb][i] = NULL;
283  fTrackQADphi[fb][i] = NULL;
284  fEbEQRe[fb][i] = NULL;
285  fEbEQIm[fb][i] = NULL;
286  fEbEQMu[fb][i] = NULL;
287  }
288  }
289 }
290 
291 //________________________________________________________________________
292 AliAnalysisTaskCRCZDC::AliAnalysisTaskCRCZDC(const char *name, TString RPtype, Bool_t on, UInt_t iseed, Bool_t bCandidates):
293 AliAnalysisTaskSE(name),
294 fAnalysisType(kAUTOMATIC),
295 fRPType(RPtype),
296 fCFManager1(NULL),
297 fCFManager2(NULL),
298 fCutsEvent(NULL),
299 fCutsRP(NULL),
300 fCutsPOI(NULL),
301 fCutContainer(new TList()),
302 fQAList(NULL),
303 fMinMult(0),
304 fMaxMult(10000000),
305 fAnalysisUtil(NULL),
306 fMinA(-1.0),
307 fMaxA(-0.01),
308 fMinB(0.01),
309 fMaxB(1.0),
310 fQAon(on),
311 fLoadCandidates(bCandidates),
312 fNbinsMult(10000),
313 fNbinsPt(100),
314 fNbinsPhi(100),
315 fNbinsEta(200),
316 fNbinsQ(500),
317 fNbinsMass(1),
318 fMultMin(0.),
319 fMultMax(10000.),
320 fPtMin(0.),
321 fPtMax(10.),
322 fPhiMin(0.),
323 fPhiMax(TMath::TwoPi()),
324 fEtaMin(-5.),
325 fEtaMax(5.),
326 fQMin(0.),
327 fQMax(3.),
328 fMassMin(-1.),
329 fMassMax(0.),
330 fHistWeightvsPhiMin(0.),
331 fHistWeightvsPhiMax(3.),
332 fExcludedEtaMin(0.),
333 fExcludedEtaMax(0.),
334 fExcludedPhiMin(0.),
335 fExcludedPhiMax(0.),
336 fAfterburnerOn(kFALSE),
337 fNonFlowNumberOfTrackClones(0),
338 fV1(0.),
339 fV2(0.),
340 fV3(0.),
341 fV4(0.),
342 fV5(0.),
343 fDifferentialV2(0),
344 fFlowEvent(NULL),
345 fShuffleTracks(kFALSE),
346 fMyTRandom3(NULL),
347 fAnalysisInput(kAOD),
348 fIsMCInput(kFALSE),
349 fUseMCCen(kTRUE),
350 fRejectPileUp(kTRUE),
351 fRejectPileUpTight(kFALSE),
352 fResetNegativeZDC(kFALSE),
353 fCentrLowLim(0.),
354 fCentrUpLim(100.),
355 fCentrEstimator(kV0M),
356 fOutput(0x0),
357 fhZNCvsZNA(0x0),
358 fhZDCCvsZDCCA(0x0),
359 fhZNCvsZPC(0x0),
360 fhZNAvsZPA(0x0),
361 fhZNvsZP(0x0),
362 fhZNvsVZERO(0x0),
363 fhZDCvsVZERO(0x0),
364 fhAsymm(0x0),
365 fhZNAvsAsymm(0x0),
366 fhZNCvsAsymm(0x0),
367 fhZNCvscentrality(0x0),
368 fhZNAvscentrality(0x0),
369 fhZPCvscentrality(0x0),
370 fhZPAvscentrality(0x0),
371 fDataSet(kAny),
372 fCRCnRun(0),
373 fZDCGainAlpha(0.395),
374 fGenHeader(NULL),
375 fPythiaGenHeader(NULL),
376 fHijingGenHeader(NULL),
377 fFlowTrack(NULL),
378 fStack(0x0),
379 fCutTPC(kFALSE),
380 fCenDis(0x0),
381 fVZEROMult(0x0),
382 fMultSelection(0x0),
383 fPileUpCount(0x0),
384 fPileUpMultSelCount(0x0),
385 fMultTOFLowCut(0x0),
386 fMultTOFHighCut(0x0),
387 fUseTowerEq(kFALSE),
388 fTowerEqList(NULL),
389 fUseBadTowerCalib(kFALSE),
390 fBadTowerCalibList(NULL),
391 fVZEROGainEqList(NULL),
392 fVZEROQVecRecList(NULL),
393 fUseZDCSpectraCorr(kFALSE),
394 fCorrectPhiTracklets(kFALSE),
395 fZDCSpectraCorrList(NULL),
396 fSpectraMCList(NULL),
397 fTrackQAList(NULL),
398 fBadTowerStuffList(NULL),
399 fVZEROStuffList(NULL),
400 fVZEROGainEqHist(NULL),
401 fMinRingVZC(1),
402 fMaxRingVZC(4),
403 fMinRingVZA(5),
404 fMaxRingVZA(8),
405 fCachedRunNum(0),
406 fhZNSpectra(0x0),
407 fhZNSpectraCor(0x0),
408 fhZNSpectraPow(0x0),
409 fhZNBCCorr(0x0),
410 fQATrackTPCNcls(NULL),
411 fQATrackITSNcls(NULL),
412 fQATrackTPCchi2(NULL),
413 fQATrackITSchi2(NULL),
414 fQATrackTPCScls(NULL),
415 fQATrackITSScls(NULL)
416 {
417  for(int i=0; i<5; i++){
418  fhZNCPM[i] = 0x0;
419  fhZNAPM[i] = 0x0;
420  }
421  for(int i=0; i<4; i++){
422  fhZNCPMQiPMC[i] = 0x0;
423  fhZNAPMQiPMC[i] = 0x0;
424  }
425  for(Int_t r=0; r<fCRCMaxnRun; r++) {
426  fRunList[r] = 0;
427  }
428  for(Int_t c=0; c<2; c++) {
429  for(Int_t i=0; i<5; i++) {
430  fTowerGainEq[c][i] = NULL;
431  }
432  }
433  for(Int_t c=0; c<100; c++) {
434  fBadTowerCalibHist[c] = NULL;
435  }
436  for (Int_t k=0; k<fkVZEROnHar; k++) {
437  // fVZEROQVectorRecQx[k] = NULL;
438  // fVZEROQVectorRecQy[k] = NULL;
439  fVZEROQVectorRecQxStored[k] = NULL;
440  fVZEROQVectorRecQyStored[k] = NULL;
441  for (Int_t t=0; t<fkVZEROnQAplots; t++) {
442  fVZEROQVectorRecFinal[k][t] = NULL;
443  }
444  }
445  for(Int_t i=0; i<8; i++) {
446  SpecCorMu1[i] = NULL;
447  SpecCorMu2[i] = NULL;
448  SpecCorSi[i] = NULL;
449  SpecCorAv[i] = NULL;
450  }
451  this->InitializeRunArrays();
452  fMyTRandom3 = new TRandom3(iseed);
453  gRandom->SetSeed(fMyTRandom3->Integer(65539));
454 
455  DefineInput(0, TChain::Class());
456  // Define output slots here
457  // Define here the flow event output
458  DefineOutput(1, AliFlowEventSimple::Class());
459  DefineOutput(2, TList::Class());
460 
461  for(Int_t j=0; j<2; j++) {
462  for(Int_t c=0; c<10; c++) {
463  fPtSpecGen[j][c] = NULL;
464  fPtSpecFB32[j][c] = NULL;
465  fPtSpecFB96[j][c] = NULL;
466  fPtSpecFB128[j][c] = NULL;
467  fPtSpecFB768[j][c] = NULL;
468  }
469  }
470  for (Int_t c=0; c<2; c++) {
471  fhZNCenDis[c] = NULL;
472  }
473  for(Int_t fb=0; fb<fKNFBs; fb++){
474  for (Int_t i=0; i<4; i++) {
475  fTrackQADCAxy[fb][i] = NULL;
476  fTrackQADCAz[fb][i] = NULL;
477  fTrackQApT[fb][i] = NULL;
478  fTrackQADphi[fb][i] = NULL;
479  fEbEQRe[fb][i] = NULL;
480  fEbEQIm[fb][i] = NULL;
481  fEbEQMu[fb][i] = NULL;
482  }
483  }
484 }
485 
486 //________________________________________________________________________
488 {
489  // Destructor
490  if(fOutput && !AliAnalysisManager::GetAnalysisManager()->IsProofMode()){
491  delete fOutput; fOutput=0;
492  }
493  delete fMyTRandom3;
494  delete fFlowEvent;
495  delete fFlowTrack;
496  delete fCutsEvent;
497  if (fTowerEqList) delete fTowerEqList;
502  if (fAnalysisUtil) delete fAnalysisUtil;
503  if (fQAList) delete fQAList;
504  if (fCutContainer) fCutContainer->Delete(); delete fCutContainer;
505 }
506 
507 //________________________________________________________________________
509 {
510  for(Int_t r=0;r<fCRCMaxnRun;r++) {
511  fCRCQVecListRun[r] = NULL;
512  for(Int_t k=0;k<fCRCnTow;k++) {
513  fZNCTower[r][k] = NULL;
514  fZNATower[r][k] = NULL;
515  }
516  // fhZNSpectraRbR[r] = NULL;
517  }
518  // for(Int_t i=0;i<fnCen;i++) {
519  // fPtPhiEtaRbRFB128[r][i] = NULL;
520  // fPtPhiEtaRbRFB768[r][i] = NULL;
521  // }
522  // }
523 }
524 
525 //________________________________________________________________________
527 {
528  // Create the output containers
529 
530  //set the common constants
533  cc->SetNbinsPt(fNbinsPt);
534  cc->SetNbinsPhi(fNbinsPhi);
535  cc->SetNbinsEta(fNbinsEta);
536  cc->SetNbinsQ(fNbinsQ);
538  cc->SetMultMin(fMultMin);
539  cc->SetMultMax(fMultMax);
540  cc->SetPtMin(fPtMin);
541  cc->SetPtMax(fPtMax);
542  cc->SetPhiMin(fPhiMin);
543  cc->SetPhiMax(fPhiMax);
544  cc->SetEtaMin(fEtaMin);
545  cc->SetEtaMax(fEtaMax);
546  cc->SetQMin(fQMin);
547  cc->SetQMax(fQMax);
548  cc->SetMassMin(fMassMin);
549  cc->SetMassMax(fMassMax);
552 
553  fFlowEvent = new AliFlowEvent(20000);
554  fFlowTrack = new AliFlowTrack();
555 
556  //printf(" AliAnalysisTaskCRCZDC::UserCreateOutputObjects()\n\n");
557  fOutput = new TList();
558  fOutput->SetOwner(kTRUE);
559  //fOutput->SetName("output");
560 
561  if (fQAon) {
562  fQAList = new TList();
563  fQAList->SetOwner(kTRUE);
564  fQAList->SetName("AliFlowEventCuts QA");
565  if (fCutsEvent->GetQA()) fQAList->Add(fCutsEvent->GetQA()); //0
566  if (fCutsRP->GetQA()) fQAList->Add(fCutsRP->GetQA()); //1
567  if (fCutsPOI->GetQA())fQAList->Add(fCutsPOI->GetQA()); //2
568  fOutput->Add(fQAList);
569  }
570 
571  fVZEROStuffList = new TList();
572  fVZEROStuffList->SetOwner(kTRUE);
573  fVZEROStuffList->SetName("VZERO stuff");
574  fOutput->Add(fVZEROStuffList);
575 
576  fBadTowerStuffList = new TList();
577  fBadTowerStuffList->SetOwner(kTRUE);
578  fBadTowerStuffList->SetName("BadTowerCalib");
580 
581  fCenDis = new TH1F("fCenDis", "fCenDis", 100, 0., 100.);
582  fOutput->Add(fCenDis);
583  fPileUpCount = new TH1F("fPileUpCount", "fPileUpCount", 9, 0., 9.);
584  fPileUpCount->GetXaxis()->SetBinLabel(1,"plpMV");
585  fPileUpCount->GetXaxis()->SetBinLabel(2,"fromSPD");
586  fPileUpCount->GetXaxis()->SetBinLabel(3,"RefMultiplicityComb08");
587  fPileUpCount->GetXaxis()->SetBinLabel(4,"IncompleteDAQ");
588  fPileUpCount->GetXaxis()->SetBinLabel(5,"abs(V0M-CL1)>7.5");
589  fPileUpCount->GetXaxis()->SetBinLabel(6,"missingVtx");
590  fPileUpCount->GetXaxis()->SetBinLabel(7,"inconsistentVtx");
591  fPileUpCount->GetXaxis()->SetBinLabel(8,"multESDTPCDif");
592  fPileUpCount->GetXaxis()->SetBinLabel(9,"extraPileUpMultSel");
593  fOutput->Add(fPileUpCount);
594  fPileUpMultSelCount = new TH1F("fPileUpMultSelCount", "fPileUpMultSelCount", 8, 0., 8.);
595  fPileUpMultSelCount->GetXaxis()->SetBinLabel(1,"IsNotPileup");
596  fPileUpMultSelCount->GetXaxis()->SetBinLabel(2,"IsNotPileupMV");
597  fPileUpMultSelCount->GetXaxis()->SetBinLabel(3,"IsNotPileupInMultBins");
598  fPileUpMultSelCount->GetXaxis()->SetBinLabel(4,"InconsistentVertices");
599  fPileUpMultSelCount->GetXaxis()->SetBinLabel(5,"TrackletVsCluster");
600  fPileUpMultSelCount->GetXaxis()->SetBinLabel(6,"AsymmetricInVZERO");
601  fPileUpMultSelCount->GetXaxis()->SetBinLabel(7,"IncompleteDAQ");
602  fPileUpMultSelCount->GetXaxis()->SetBinLabel(8,"GoodVertex2016");
604 
605  fMultTOFLowCut = new TF1("fMultTOFLowCut", "[0]+[1]*x+[2]*x*x+[3]*x*x*x - 4.*([4]+[5]*x+[6]*x*x+[7]*x*x*x+[8]*x*x*x*x+[9]*x*x*x*x*x)", 0, 10000);
606  fMultTOFLowCut->SetParameters(-1.0178, 0.333132, 9.10282e-05, -1.61861e-08, 1.47848, 0.0385923, -5.06153e-05, 4.37641e-08, -1.69082e-11, 2.35085e-15);
607  fOutput->Add(fMultTOFLowCut);
608  fMultTOFHighCut = new TF1("fMultTOFHighCut", "[0]+[1]*x+[2]*x*x+[3]*x*x*x + 4.*([4]+[5]*x+[6]*x*x+[7]*x*x*x+[8]*x*x*x*x+[9]*x*x*x*x*x)", 0, 10000);
609  fMultTOFHighCut->SetParameters(-1.0178, 0.333132, 9.10282e-05, -1.61861e-08, 1.47848, 0.0385923, -5.06153e-05, 4.37641e-08, -1.69082e-11, 2.35085e-15);
610  fOutput->Add(fMultTOFHighCut);
611 
612  for(Int_t c=0; c<2; c++) {
613  for(Int_t i=0; i<5; i++) {
614  fTowerGainEq[c][i] = new TH1D();
615  fOutput->Add(fTowerGainEq[c][i]);
616  }
617  }
618 
619  for (Int_t c=0; c<2; c++) {
620  fhZNCenDis[c] = new TH3D(Form("fhZNCenDis[%d]",c), Form("fhZNCenDis[%d]",c), 100, 0., 100., 100, -2., 2. , 100., -2., 2.);
621  fOutput->Add(fhZNCenDis[c]);
622  }
623 
624  if(fBadTowerCalibList) {
625  for(Int_t c=0; c<100; c++) {
626  fBadTowerCalibHist[c] = (TH2D*)fBadTowerCalibList->FindObject(Form("TH2Resp[%d]",c));
628  }
629  }
630  if(fZDCSpectraCorrList) {
631  for(Int_t i=0; i<8; i++) {
632  SpecCorMu1[i] = (TH1D*)fZDCSpectraCorrList->FindObject(Form("SpecCorMu1[%d]",i));
633  fOutput->Add(SpecCorMu1[i]);
634  SpecCorMu2[i] = (TH1D*)fZDCSpectraCorrList->FindObject(Form("SpecCorMu2[%d]",i));
635  fOutput->Add(SpecCorMu2[i]);
636  SpecCorAv[i] = (TH1D*)fZDCSpectraCorrList->FindObject(Form("SpecCorAv[%d]",i));
637  fOutput->Add(SpecCorAv[i]);
638  SpecCorSi[i] = (TH1D*)fZDCSpectraCorrList->FindObject(Form("SpecCorSi[%d]",i));
639  fOutput->Add(SpecCorSi[i]);
640  }
641  }
642 
643  fhZNSpectra = new TH3D("fhZNSpectra","fhZNSpectra",100,0.,100.,8,0.,8.,1000,0.,1.E5);
644  fOutput->Add(fhZNSpectra);
645  fhZNSpectraCor = new TH3D("fhZNSpectraCor","fhZNSpectraCor",100,0.,100.,8,0.,8.,1000,0.,1.E5);
646  fOutput->Add(fhZNSpectraCor);
647  fhZNSpectraPow = new TH3D("fhZNSpectraPow","fhZNSpectraPow",100,0.,100.,8,0.,8.,1000,0.,TMath::Power(1.E5,fZDCGainAlpha));
648  fOutput->Add(fhZNSpectraPow);
649  fhZNBCCorr = new TH3D("fhZNBCCorr","fhZNBCCorr",100,0.,100.,500,0.,1.E5,500,0.,1.E5);
650  fOutput->Add(fhZNBCCorr);
651 
652  fQATrackTPCNcls = new TH3D("fQATrackTPCNcls","fQATrackTPCNcls",50,0.,TMath::TwoPi(),16,-0.8,0.8,50,50.,150.);
653  fOutput->Add(fQATrackTPCNcls);
654  fQATrackITSNcls = new TH3D("fQATrackITSNcls","fQATrackITSNcls",50,0.,TMath::TwoPi(),16,-0.8,0.8,6,0.,6.);
655  fOutput->Add(fQATrackITSNcls);
656  fQATrackTPCchi2 = new TH3D("fQATrackTPCchi2","fQATrackTPCchi2",50,0.,TMath::TwoPi(),16,-0.8,0.8,50,0.,5.);
657  fOutput->Add(fQATrackTPCchi2);
658  fQATrackITSchi2 = new TH3D("fQATrackITSchi2","fQATrackITSchi2",50,0.,TMath::TwoPi(),16,-0.8,0.8,50,0.,50.);
659  fOutput->Add(fQATrackITSchi2);
660  fQATrackTPCScls = new TH3D("fQATrackTPCScls","fQATrackTPCScls",50,0.,TMath::TwoPi(),16,-0.8,0.8,50,0.,1.);
661  fOutput->Add(fQATrackTPCScls);
662  fQATrackITSScls = new TH3D("fQATrackITSScls","fQATrackITSScls",50,0.,TMath::TwoPi(),16,-0.8,0.8,50,0.,1.);
663  fOutput->Add(fQATrackITSScls);
664 
665  if(fAnalysisType == kMCAOD) {
666 
667  fSpectraMCList = new TList();
668  fSpectraMCList->SetOwner(kTRUE);
669  fSpectraMCList->SetName("Spectra");
670  fOutput->Add(fSpectraMCList);
671 
672  Double_t xmin[] = {0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1.,1.2,1.4,1.6,1.8,2.,2.33,2.66,3.,3.5,4.,5.,6.,9.,20.};
673  for(Int_t j=0; j<2; j++) {
674  for(Int_t c=0; c<10; c++) {
675  fPtSpecGen[j][c] = new TH1F(Form("fPtSpecGen[%d][%d]",j,c), Form("fPtSpecGen[%d][%d]",j,c), 23, xmin);
676  fSpectraMCList->Add(fPtSpecGen[j][c]);
677  fPtSpecFB32[j][c] = new TH1F(Form("fPtSpecFB32[%d][%d]",j,c), Form("fPtSpecFB32[%d][%d]",j,c), 23, xmin);
678  fSpectraMCList->Add(fPtSpecFB32[j][c]);
679  fPtSpecFB96[j][c] = new TH1F(Form("fPtSpecFB96[%d][%d]",j,c), Form("fPtSpecFB96[%d][%d]",j,c), 23, xmin);
680  fSpectraMCList->Add(fPtSpecFB96[j][c]);
681  fPtSpecFB128[j][c] = new TH1F(Form("fPtSpecFB128[%d][%d]",j,c), Form("fPtSpecFB128[%d][%d]",j,c), 23, xmin);
682  fSpectraMCList->Add(fPtSpecFB128[j][c]);
683  fPtSpecFB768[j][c] = new TH1F(Form("fPtSpecFB768[%d][%d]",j,c), Form("fPtSpecFB768[%d][%d]",j,c), 23, xmin);
684  fSpectraMCList->Add(fPtSpecFB768[j][c]);
685  }
686  }
687  }
688 
689  fAnalysisUtil = new AliAnalysisUtils();
690  fAnalysisUtil->SetUseMVPlpSelection(kTRUE);
691  fAnalysisUtil->SetUseOutOfBunchPileUp(kTRUE);
692 
693  for(int i=0; i<5; i++){
694  char hname[20];
695  sprintf(hname,"hZNCPM%d",i);
696  fhZNCPM[i] = new TH1F(hname, hname, 200, -50., 140000);
697  fOutput->Add(fhZNCPM[i]);
698  //
699  sprintf(hname,"hZNAPM%d",i);
700  fhZNAPM[i] = new TH1F(hname, hname, 200, -50., 140000);
701  fOutput->Add(fhZNAPM[i]);
702  //
703  if(i<4){
704  //
705  char hnamenc[20];
706  sprintf(hnamenc, "hZNCPMQ%dPMC",i+1);
707  fhZNCPMQiPMC[i] = new TH1F(hnamenc, hnamenc, 100, 0., 1.);
708  fOutput->Add(fhZNCPMQiPMC[i]);
709  //
710  char hnamena[20];
711  sprintf(hnamena, "hZNAPMQ%dPMC",i+1);
712  fhZNAPMQiPMC[i] = new TH1F(hnamena, hnamena, 100, 0., 1.);
713  fOutput->Add(fhZNAPMQiPMC[i]);
714  }
715  }
716 
717  fhZNCvsZNA = new TH2F("hZNCvsZNA","hZNCvsZNA",200,-50.,2.E5,200,-50.,2.E5);
718  fOutput->Add(fhZNCvsZNA);
719  fhZDCCvsZDCCA = new TH2F("hZDCCvsZDCCA","hZDCCvsZDCCA",200,0.,2.8E5,200,0.,2.8E5);
720  fOutput->Add(fhZDCCvsZDCCA);
721  fhZNCvsZPC = new TH2F("hZNCvsZPC","hZNCvsZPC",200,-50.,0.8E5,200,-50.,2.E5);
722  fOutput->Add(fhZNCvsZPC);
723  fhZNAvsZPA = new TH2F("hZNAvsZPA","hZNAvsZPA",200,-50.,0.8E5,200,-50.,2.E5);
724  fOutput->Add(fhZNAvsZPA);
725  fhZNvsZP = new TH2F("hZNvsZP","hZNvsZP",200,-50.,1.6E5,200,-50.,4.E5);
726  fOutput->Add(fhZNvsZP);
727  fhZNvsVZERO = new TH2F("hZNvsVZERO","hZNvsVZERO",250,0.,35000.,200,0.,4.E5);
728  fOutput->Add(fhZNvsVZERO);
729  fhZDCvsVZERO = new TH2F("hZDCvsVZERO","hZDCvsVZERO",250,0.,35000.,250,0.,5.6E5);
730  fOutput->Add(fhZDCvsVZERO);
731 
732  fhAsymm = new TH1F("hAsymm" , "Asimmetry ",200,-1.,1.);
733  fOutput->Add(fhAsymm);
734  fhZNAvsAsymm = new TH2F("hZNAvsAsymm","ZNA vs. asymm.",200,-1.,1.,200,-50.,2.E5);
735  fOutput->Add(fhZNAvsAsymm);
736  fhZNCvsAsymm = new TH2F("hZNCvsAsymm","ZNC vs. asymm.",200,-1.,1.,200,-50.,2.E5);
737  fOutput->Add(fhZNCvsAsymm);
738 
739  fhZNCvscentrality = new TH2F("hZNCvscentrality","hZNCvscentrality",100,0.,100.,200,-50.,2.E5);
741  fhZNAvscentrality = new TH2F("hZNAvscentrality","hZNAvscentrality",100,0.,100.,200,-50.,2.E5);
743  fhZPCvscentrality = new TH2F("hZPCvscentrality","hZPCvscentrality",100,0.,100.,200,-50.,0.8E5);
745  fhZPAvscentrality = new TH2F("hZPAvscentrality","hZPAvscentrality",100,0.,100.,200,-50.,0.8E5);
747 
748  //********************************************************************
749 
750  Int_t dRun10h[] = {139510, 139507, 139505, 139503, 139465, 139438, 139437, 139360, 139329, 139328, 139314, 139310, 139309, 139173, 139107, 139105, 139038, 139037, 139036, 139029, 139028, 138872, 138871, 138870, 138837, 138732, 138730, 138666, 138662, 138653, 138652, 138638, 138624, 138621, 138583, 138582, 138579, 138578, 138534, 138469, 138442, 138439, 138438, 138396, 138364, 138275, 138225, 138201, 138197, 138192, 138190, 137848, 137844, 137752, 137751, 137724, 137722, 137718, 137704, 137693, 137692, 137691, 137686, 137685, 137639, 137638, 137608, 137595, 137549, 137546, 137544, 137541, 137539, 137531, 137530, 137443, 137441, 137440, 137439, 137434, 137432, 137431, 137430, 137366, 137243, 137236, 137235, 137232, 137231, 137230, 137162, 137161};
751 
752  Int_t dRun11h[] = {167902, 167903, 167915, 167920, 167985, 167987, 167988, 168066, 168068, 168069, 168076, 168104, 168105, 168107, 168108, 168115, 168212, 168310, 168311, 168322, 168325, 168341, 168342, 168361, 168362, 168458, 168460, 168461, 168464, 168467, 168511, 168512, 168514, 168777, 168826, 168984, 168988, 168992, 169035, 169040, 169044, 169045, 169091, 169094, 169099, 169138, 169143, 169144, 169145, 169148, 169156, 169160, 169167, 169238, 169411, 169415, 169417, 169418, 169419, 169420, 169475, 169498, 169504, 169506, 169512, 169515, 169550, 169553, 169554, 169555, 169557, 169586, 169587, 169588, 169590, 169591, 169835, 169837, 169838, 169846, 169855, 169858, 169859, 169923, 169956, 169965, 170027, 170036,170040, 170081, 170083, 170084, 170085, 170088, 170089, 170091, 170155, 170159, 170163, 170193, 170203, 170204, 170207, 170228, 170230, 170268, 170269, 170270, 170306, 170308, 170309, 170311, 170312, 170313, 170315, 170387, 170388, 170572, 170593};
753 
754  Int_t dRun15o[] = {244917, 244918, 244975, 244980, 244982, 244983, 245064, 245066, 245068, 246390, 246391, 246392, 246994, 246991, 246989, 246984, 246982, 246980, 246948, 246945, 246928, 246851, 246847, 246846, 246845, 246844, 246810, 246809, 246808, 246807, 246805, 246804, 246766, 246765, 246763, 246760, 246759, 246758, 246757, 246751, 246750, 246495, 246493, 246488, 246487, 246434, 246431, 246428, 246424, 246276, 246275, 246272, 246271, 246225, 246222, 246217, 246185, 246182, 246181, 246180, 246178, 246153, 246152, 246151, 246115, 246113, 246089, 246087, 246053, 246052, 246049, 246048, 246042, 246037, 246036, 246012, 246003, 246001, 245954, 245952, 245949, 245923, 245833, 245831, 245829, 245705, 245702, 245700, 245692, 245683};
755 
756  Int_t dRun15ov6[] = {244918, 244975, 244980, 244982, 244983, 245064, 245066, 245068, 246390, 246391, 246392, 246994, 246991, 246989, 246984, 246982, 246980, 246948, 246945, 246928, 246851, 246847, 246846, 246845, 246844, 246810, 246809, 246808, 246807, 246805, 246804, 246766, 246765, 246763, 246760, 246759, 246758, 246757, 246751, 246750, 246495, 246493, 246488, 246487, 246434, 246431, 246428, 246424, 246276, 246275, 246272, 246271, 246225, 246222, 246217, 246185, 246182, 246181, 246180, 246178, 246153, 246152, 246151, 246148, 246115, 246113, 246089, 246087, 246053, 246052, 246049, 246048, 246042, 246037, 246036, 246012, 246003, 246001, 245963, 245954, 245952, 245949, 245923, 245833, 245831, 245829, 245705, 245702, 245700, 245692, 245683};
757 
758  Int_t dRun15opidfix[] = {245145, 245146, 245151, 245152, 245231, 245232, 245259, 245343, 245345, 245346, 245347, 245349, 245353, 245396, 245397, 245401, 245407, 245409, 245441, 245446, 245450, 245454, 245496, 245497, 245501, 245504, 245505, 245507, 245535, 245540, 245542, 245543, 245544, 245545, 245554};
759 
760  if(fDataSet==k2010) {fCRCnRun=92;}
761  if(fDataSet==k2011) {fCRCnRun=119;}
762  if(fDataSet==k2015) {fCRCnRun=90;}
763  if(fDataSet==k2015v6) {fCRCnRun=91;}
764  if(fDataSet==k2015pidfix) {fCRCnRun=35;}
765  if(fDataSet==kAny) {fCRCnRun=1;}
766 
767  Int_t d=0;
768  for(Int_t r=0; r<fCRCnRun; r++) {
769  if(fDataSet==k2010) fRunList[d] = dRun10h[r];
770  if(fDataSet==k2011) fRunList[d] = dRun11h[r];
771  if(fDataSet==k2015) fRunList[d] = dRun15o[r];
772  if(fDataSet==k2015v6) fRunList[d] = dRun15ov6[r];
773  if(fDataSet==k2015pidfix) fRunList[d] = dRun15opidfix[r];
774  if(fDataSet==kAny) fRunList[d] = 1;
775  d++;
776  }
777 
778  fVZEROMult = new TProfile2D("fVZEROMult","fVZEROMult",fCRCnRun,0.,1.*fCRCnRun,64,0.,64.);
779  for (Int_t i=0; i<fCRCnRun; i++) {
780  fVZEROMult->GetXaxis()->SetBinLabel(i+1,Form("%d",fRunList[i]));
781  }
783 
784  if(fVZEROGainEqList) {
785  fVZEROGainEqHist = (TH2D*)fVZEROGainEqList->FindObject("VZEROEqGain");
787  }
788  if(fVZEROQVecRecList) {
789  for (Int_t k=0; k<fkVZEROnHar; k++) {
790  fVZEROQVectorRecQxStored[k] = (TProfile3D*)fVZEROQVecRecList->FindObject(Form("fVZEROQVectorRecQx[%d]",k));
791  fVZEROQVectorRecQxStored[k]->SetTitle(Form("fVZEROQVectorRecQxStored[%d]",k));
792  fVZEROQVectorRecQxStored[k]->SetName(Form("fVZEROQVectorRecQxStored[%d]",k));
794  fVZEROQVectorRecQyStored[k] = (TProfile3D*)fVZEROQVecRecList->FindObject(Form("fVZEROQVectorRecQy[%d]",k));
795  fVZEROQVectorRecQyStored[k]->SetTitle(Form("fVZEROQVectorRecQyStored[%d]",k));
796  fVZEROQVectorRecQyStored[k]->SetName(Form("fVZEROQVectorRecQyStored[%d]",k));
798  for (Int_t t=0; t<fkVZEROnQAplots; t++) {
799  fVZEROQVectorRecFinal[k][t] = new TProfile2D(Form("fVZEROQVectorRecFinal[%d][%d]",k,t),Form("fVZEROQVectorRecFinal[%d][%d]",k,t),fCRCnRun,0.,1.*fCRCnRun,100,0.,100.,"s");
800  fVZEROQVectorRecFinal[k][t]->Sumw2();
802  }
803  }
804  }
805 
806  // for (Int_t k=0; k<fkVZEROnHar; k++) {
807  // fVZEROQVectorRecQx[k] = new TProfile3D(Form("fVZEROQVectorRecQx[%d]",k),Form("fVZEROQVectorRecQx[%d]",k),fCRCnRun,0.,1.*fCRCnRun,100,0.,100.,8,0.,8.,"s");
808  // fVZEROQVectorRecQx[k]->Sumw2();
809  // fVZEROStuffList->Add(fVZEROQVectorRecQx[k]);
810  // fVZEROQVectorRecQy[k] = new TProfile3D(Form("fVZEROQVectorRecQy[%d]",k),Form("fVZEROQVectorRecQy[%d]",k),fCRCnRun,0.,1.*fCRCnRun,100,0.,100.,8,0.,8.,"s");
811  // fVZEROQVectorRecQy[k]->Sumw2();
812  // fVZEROStuffList->Add(fVZEROQVectorRecQy[k]);
813  // }
814 
815  // track QA
816 
817  if(fAnalysisType == kTrackQA) {
818 
819  fTrackQAList = new TList();
820  fTrackQAList->SetOwner(kTRUE);
821  fTrackQAList->SetName("TrackQA");
822  fOutput->Add(fTrackQAList);
823 
824  Int_t nBinsEta=10;
825  Double_t dBinsEta[]={-0.8,-0.64,-0.48,-0.32,-0.16,0.,0.16,0.32,0.48,0.64,0.8};
826  Int_t nBinsPt = 26;
827  Double_t dBinsPt[] = {0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1.,1.2,1.4,1.6,1.8,2.,2.33,2.66,3.,3.5,4.,5.,6.,8.,10.,14.,20.,30.,50.};
828 
829  for(Int_t fb=0; fb<fKNFBs; fb++){
830  for (Int_t i=0; i<4; i++) {
831  // DCA
832  fTrackQADCAxy[fb][i] = new TH3D(Form("fTrackQADCAxy[%d][%d]",fb,i),";#eta;p_{T} [GeV/c];DCAxy [cm]",10,-0.8,0.8,10,0.,5.,480,-2.4,2.4);
833  fTrackQAList->Add(fTrackQADCAxy[fb][i]);
834  fTrackQADCAz[fb][i] = new TH3D(Form("fTrackQADCAz[%d][%d]",fb,i),";#eta;p_{T} [GeV/c];DCAz [cm]",10,-0.8,0.8,10,0.,5.,640,-3.2,3.2);
835  fTrackQAList->Add(fTrackQADCAz[fb][i]);
836  // pT
837  fTrackQApT[fb][i] = new TH2D(Form("fTrackQApT[%d][%d]",fb,i),";#eta;p_{T} [GeV/c]",nBinsEta,dBinsEta,nBinsPt,dBinsPt);
838  fTrackQAList->Add(fTrackQApT[fb][i]);
839  // Dphi
840  fTrackQADphi[fb][i] = new TProfile2D(Form("fTrackQADphi[%d][%d]",fb,i),";#eta;p_{T} [GeV/c];cos(#Delta#phi)",nBinsEta,dBinsEta,nBinsPt,dBinsPt);
841  fTrackQAList->Add(fTrackQADphi[fb][i]);
842  // EbE
843  fEbEQRe[fb][i] = new TH2D(Form("fEbEQRe[%d][%d]",fb,i),";#eta;p_{T} [GeV/c];QRe(EbE)",nBinsEta,dBinsEta,nBinsPt,dBinsPt);
844  fTrackQAList->Add(fEbEQRe[fb][i]);
845  fEbEQIm[fb][i] = new TH2D(Form("fEbEQIm[%d][%d]",fb,i),";#eta;p_{T} [GeV/c];QRe(EbE)",nBinsEta,dBinsEta,nBinsPt,dBinsPt);
846  fTrackQAList->Add(fEbEQIm[fb][i]);
847  fEbEQMu[fb][i] = new TH2D(Form("fEbEQMu[%d][%d]",fb,i),";#eta;p_{T} [GeV/c];QRe(EbE)",nBinsEta,dBinsEta,nBinsPt,dBinsPt);
848  fTrackQAList->Add(fEbEQMu[fb][i]);
849  }
850  }
851 
852  }
853 
854  // run-by-run stuff
855 
856  if(!fUseTowerEq) {
857  Double_t ptmin[] = {0.2,0.4,0.6,0.8,1.,1.2,1.4,1.8,2.2,3.,4.,6.,8.,12.,20.};
858  Double_t phimin[] = {0.,TMath::Pi()/8.,2*TMath::Pi()/8.,3*TMath::Pi()/8.,4*TMath::Pi()/8.,5*TMath::Pi()/8.,6*TMath::Pi()/8.,7*TMath::Pi()/8.,8*TMath::Pi()/8.,9*TMath::Pi()/8.,10*TMath::Pi()/8.,11*TMath::Pi()/8.,12*TMath::Pi()/8.,13*TMath::Pi()/8.,14*TMath::Pi()/8.,15*TMath::Pi()/8.,16*TMath::Pi()/8.};
859  Double_t etamin[] = {-0.8,-0.7,-0.6,-0.5,-0.4,-0.3,-0.2,-0.1,0.,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8};
860 
861  for(Int_t r=0;r<fCRCnRun;r++) {
862  fCRCQVecListRun[r] = new TList();
863  fCRCQVecListRun[r]->SetName(Form("Run %d",fRunList[r]));
864  fCRCQVecListRun[r]->SetOwner(kTRUE);
865  fOutput->Add(fCRCQVecListRun[r]);
866 
867  for(Int_t k=0;k<fCRCnTow;k++) {
868  fZNCTower[r][k] = new TProfile(Form("fZNCTower[%d][%d]",fRunList[r],k),Form("fZNCTower[%d][%d]",fRunList[r],k),100,0.,100.,"s");
869  fZNCTower[r][k]->Sumw2();
870  fCRCQVecListRun[r]->Add(fZNCTower[r][k]);
871  fZNATower[r][k] = new TProfile(Form("fZNATower[%d][%d]",fRunList[r],k),Form("fZNATower[%d][%d]",fRunList[r],k),100,0.,100.,"s");
872  fZNATower[r][k]->Sumw2();
873  fCRCQVecListRun[r]->Add(fZNATower[r][k]);
874  }
875 
876  // fhZNSpectraRbR[r] = new TH3D(Form("fhZNSpectraRbR[%d]",fRunList[r]),Form("fhZNSpectraRbR[%d]",fRunList[r]),50,0.,100.,8,0.,8.,100,0.,1.E5);
877  // fCRCQVecListRun[r]->Add(fhZNSpectraRbR[r]);
878 
879  // for(Int_t i=0;i<fnCen;i++) {
880  // fPtPhiEtaRbRFB128[r][i] = new TH3F(Form("fPtPhiEtaRbRFB128[%d][%d]",r,i),Form("fPtPhiEtaRbRFB128[%d][%d]",r,i),14, ptmin, 16, phimin, 16, etamin);
881  // fCRCQVecListRun[r]->Add(fPtPhiEtaRbRFB128[r][i]);
882  // fPtPhiEtaRbRFB768[r][i] = new TH3F(Form("fPtPhiEtaRbRFB768[%d][%d]",r,i),Form("fPtPhiEtaRbRFB768[%d][%d]",r,i),14, ptmin, 16, phimin, 16, etamin);
883  // fCRCQVecListRun[r]->Add(fPtPhiEtaRbRFB768[r][i]);
884  // }
885  }
886  }
887 
888  PostData(2, fOutput);
889 }
890 
891 //________________________________________________________________________
893 {
894  // Execute analysis for current event:
895  AliMCEvent* McEvent = MCEvent();
896  AliAODEvent *aod = dynamic_cast<AliAODEvent*>(InputEvent());
897  AliESDEvent *esd = dynamic_cast<AliESDEvent*>(InputEvent());
898  // AliMultiplicity* myTracklets = NULL;
899  // AliESDPmdTrack* pmdtracks = NULL;
900  // int availableINslot=1;
901 
902  if (!(fCutsRP&&fCutsPOI&&fCutsEvent)) {
903  AliError("cuts not set");
904  return;
905  }
906 
907  Int_t numTracks = aod->GetNumberOfTracks();
908  if (numTracks==0) return;
909 
910  TObject *head = aod->GetHeader();
911  Int_t RunBin=-1, bin=0, RunNum=-1;
912 
913  if(!head->InheritsFrom("AliNanoAODStorage")){ //no nanoAOD
914  RunNum = aod->GetRunNumber();
915  for(Int_t c=0;c<fCRCnRun;c++) {
916  if(fRunList[c]==RunNum) RunBin=bin;
917  else bin++;
918  }
919  if(RunBin==-1) return;
920  if(fDataSet==kAny) RunBin=0;
921  }
922 
923  //DEFAULT - automatically takes care of everything
925 
926  // get centrality
927  Double_t centrV0M=300, centrCL1=300, centrCL0=300, centrTRK=300;
928  if(!head->InheritsFrom("AliNanoAODStorage")){
930  centrV0M = ((AliVAODHeader*)aod->GetHeader())->GetCentralityP()->GetCentralityPercentile("V0M");
931  centrCL1 = ((AliVAODHeader*)aod->GetHeader())->GetCentralityP()->GetCentralityPercentile("CL1");
932  centrCL0 = ((AliVAODHeader*)aod->GetHeader())->GetCentralityP()->GetCentralityPercentile("CL0");
933  centrTRK = ((AliVAODHeader*)aod->GetHeader())->GetCentralityP()->GetCentralityPercentile("TRK");
934  } else {
935  fMultSelection = (AliMultSelection*) InputEvent()->FindListObject("MultSelection");
936  if(!fMultSelection) {
937  //If you get this warning (and lPercentiles 300) please check that the AliMultSelectionTask actually ran (before your task)
938  AliWarning("AliMultSelection object not found!");
939  } else {
940  centrV0M = fMultSelection->GetMultiplicityPercentile("V0M");
941  centrCL1 = fMultSelection->GetMultiplicityPercentile("CL1");
942  centrCL0 = fMultSelection->GetMultiplicityPercentile("CL0");
943  centrTRK = fMultSelection->GetMultiplicityPercentile("TRK");
944  }
945  }
946  }else{
947 
948  AliNanoAODHeader *nanoAodHeader = (AliNanoAODHeader*) head;
949  RunNum = nanoAodHeader->GetRunNumber();
950  for(Int_t c=0;c<fCRCnRun;c++) {
951  if(fRunList[c]==RunNum) RunBin=bin;
952  else bin++;
953  }
954 
955  if(RunBin==-1) return;
956  if(fDataSet==kAny) RunBin=0;
957 
958  centrV0M = nanoAodHeader->GetCentr("V0M");
959  centrTRK = nanoAodHeader->GetCentr("TRK");
960  centrCL1 = nanoAodHeader->GetCentr("CL1");
961  centrCL0 = nanoAodHeader->GetCentr("CL0");
962 
963  }
964  //check event cuts
965  if (InputEvent()) {
966  if(!fCutsEvent->IsSelected(InputEvent(),MCEvent())) return;
967  if(fRejectPileUp) {
968  Bool_t IsPileUp = SelectPileup(aod);
969  if(IsPileUp) return;
970  }
971  }
972 
973  //first attach all possible information to the cuts
974  fCutsRP->SetEvent( InputEvent(), MCEvent() ); //attach event
975  fCutsPOI->SetEvent( InputEvent(), MCEvent() );
976 
977  //then make the event
979 
980  if(fAnalysisType == kTracklets) {
981  // fill with tracklets
982  AliAODTracklets* anInputTracklets = (AliAODTracklets*)aod->GetTracklets();
983  Int_t multSPD = anInputTracklets->GetNumberOfTracklets();
984  Double_t BField = aod->GetMagneticField();
985  //loop over tracklets
986  for (Int_t itracklet=0; itracklet<multSPD; ++itracklet) {
987  Float_t thetaTr= anInputTracklets->GetTheta(itracklet);
988  Float_t phiTr= anInputTracklets->GetPhi(itracklet);
989  // calculate eta
990  Float_t etaTr = -TMath::Log(TMath::Tan(thetaTr/2.));
991  //make new AliFLowTrackSimple
992  AliFlowTrack* pTrack = new AliFlowTrack();
993  pTrack->SetPt(0.5);
994  pTrack->SetEta(etaTr);
995  // set charge: "according to Ruben, with positive magnetic field, the positive tracks rotate clockwise. Since the angle stored in AOD is the difference between the hit on the first and second layers of SPD, in positive mag field, positive delta_phi -> positive track charge."
996  Double_t DeltaPhi = anInputTracklets->GetDeltaPhi(itracklet);
997  if(BField>0. && DeltaPhi>0.) pTrack->SetCharge(1);
998  if(BField>0. && DeltaPhi<0.) pTrack->SetCharge(-1);
999  if(BField<0. && DeltaPhi>0.) pTrack->SetCharge(-1);
1000  if(BField<0. && DeltaPhi<0.) pTrack->SetCharge(1);
1001  // correction of phi
1002  if(fCorrectPhiTracklets) {
1003  phiTr += 39./34.*DeltaPhi;
1004  if (phiTr < 0.) phiTr += 2.*TMath::Pi();
1005  if (phiTr > 2.*TMath::Pi()) phiTr -= 2.*TMath::Pi();
1006  }
1007  pTrack->SetPhi(phiTr);
1008  //marking the particles as POI type 2:
1010  pTrack->SetPOItype(2,kTRUE);
1012  //Add the track to the flowevent
1013  fFlowEvent->AddTrack(pTrack);
1014  }
1015  }
1016 
1018 
1019  if(fCentrEstimator==kV0M) fFlowEvent->SetCentrality(centrV0M);
1020  if(fCentrEstimator==kCL0) fFlowEvent->SetCentrality(centrCL0);
1021  if(fCentrEstimator==kCL1) fFlowEvent->SetCentrality(centrCL1);
1022  if(fCentrEstimator==kTRK) fFlowEvent->SetCentrality(centrTRK);
1023  fFlowEvent->SetCentralityCL1(centrCL1);
1024  fFlowEvent->SetCentralityTRK(centrTRK);
1025  // fFlowEvent->SetNITSCL1(((AliVAODHeader*)aod->GetHeader())->GetNumberOfITSClusters(1));
1026 
1027  Double_t SumV0=0.;
1028  UInt_t period, orbit24;
1029 
1030  if(!head->InheritsFrom("AliNanoAODStorage")){
1031  for(Int_t i=0; i<64; i++) {
1032  if(std::isfinite(aod->GetVZEROEqMultiplicity(i))) SumV0 += aod->GetVZEROEqMultiplicity(i);
1033  }
1034  period = aod->GetPeriodNumber();
1035  orbit24 = aod->GetOrbitNumber(); // wrapped down to 24 bits
1036  }else{
1037  AliNanoAODHeader *nanoAodHeader = (AliNanoAODHeader*) head;
1038  SumV0 = nanoAodHeader->GetVar(nanoAodHeader->GetVarIndex("cstV0"));
1039  period = nanoAodHeader->GetVar(nanoAodHeader->GetVarIndex("cstPeriod"));
1040  orbit24 = nanoAodHeader->GetVar(nanoAodHeader->GetVarIndex("cstOrbit")); // wrapped down to 24 bits
1041  }
1042  fFlowEvent->SetNITSCL1(SumV0);
1043 
1044  // set absolute orbit number
1045 
1046  if (period > 255) { // 8 bits
1047  period = 255;
1048  orbit24 = (1<<24) - 1;
1049  }
1050  if (orbit24 >= (1<<24)) { // 24 bits
1051  period = 255;
1052  orbit24 = (1<<24) - 1;
1053  }
1054  UInt_t orbit = period * (1<<24) + orbit24;
1055  fFlowEvent->SetAbsOrbit(orbit);
1056 
1057  Double_t vtxpos[3]={0.,0.,0.};
1058  vtxpos[0] = ((AliAODVertex*)aod->GetPrimaryVertex())->GetX();
1059  vtxpos[1] = ((AliAODVertex*)aod->GetPrimaryVertex())->GetY();
1060  vtxpos[2] = ((AliAODVertex*)aod->GetPrimaryVertex())->GetZ();
1061  fFlowEvent->SetVertexPosition(vtxpos);
1062 
1063  if (McEvent && McEvent->GenEventHeader()) fFlowEvent->SetMCReactionPlaneAngle(McEvent);
1064 
1065  // run-by-run QA
1066  // for(Int_t jTracks = 0; jTracks<aod->GetNumberOfTracks(); jTracks++){
1067  // AliAODTrack* track = (AliAODTrack*)aod->GetTrack(jTracks);
1068  // if(!track) continue;
1069  // // general kinematic & quality cuts
1070  // if (track->Pt() < .2 || track->Pt() > 20. || TMath::Abs(track->Eta()) > .8 || track->GetTPCNcls() < 70) continue;
1071  // if (track->TestFilterBit(128)) fPtPhiEtaRbRFB128[RunBin][CenBin]->Fill(track->Pt(),track->Phi(),track->Eta());
1072  // if (track->TestFilterBit(768)) fPtPhiEtaRbRFB768[RunBin][CenBin]->Fill(track->Pt(),track->Phi(),track->Eta());
1073  // }
1074  fCenDis->Fill(centrV0M);
1075 
1076  }
1077 
1078  if (fAnalysisType == kTrackQA) {
1079 
1080  // empty flow event
1081  fFlowEvent->ClearFast();
1082 
1083  // get centrality
1084  Double_t centrV0M=300;
1086  centrV0M = ((AliVAODHeader*)aod->GetHeader())->GetCentralityP()->GetCentralityPercentile("V0M");
1087  } else {
1088  fMultSelection = (AliMultSelection*) InputEvent()->FindListObject("MultSelection");
1089  if(!fMultSelection) {
1090  //If you get this warning (and lPercentiles 300) please check that the AliMultSelectionTask actually ran (before your task)
1091  AliWarning("AliMultSelection object not found!");
1092  } else {
1093  centrV0M = fMultSelection->GetMultiplicityPercentile("V0M");
1094  }
1095  }
1096  if(centrV0M<10. || centrV0M>40.) return;
1097 
1098  //check event cuts
1099  if (InputEvent()) {
1100  if(!fCutsEvent->IsSelected(InputEvent(),MCEvent())) return;
1101  if(fRejectPileUp) {
1102  Bool_t IsPileUp = SelectPileup(aod);
1103  if(IsPileUp) return;
1104  }
1105  }
1106 
1107  Double_t BField = aod->GetMagneticField();
1108 
1109  for(Int_t jTracks = 0; jTracks<aod->GetNumberOfTracks(); jTracks++){
1110 
1111  AliAODTrack* track = (AliAODTrack*)aod->GetTrack(jTracks);
1112  if(!track) continue;
1113 
1114  Double_t dPt = track->Pt();
1115  Double_t dEta = track->Eta();
1116  Double_t dPhi = track->Phi();
1117  Double_t dCharge = track->Charge();
1118  Int_t cw = 0;
1119  if(BField>0. && dCharge>0.) cw=0;
1120  if(BField>0. && dCharge<0.) cw=1;
1121  if(BField<0. && dCharge>0.) cw=2;
1122  if(BField<0. && dCharge<0.) cw=3;
1123 
1124  // general kinematic cuts
1125  if (dPt < .2 || dPt > 50. || TMath::Abs(dEta) > 0.8) continue;
1126 
1127  // cut on DCA
1128  Double_t DCAxy = track->DCA();
1129  Double_t DCAz = track->ZAtDCA();
1130  if (std::abs((Int_t)DCAxy)==999 || std::abs((Int_t)DCAz)==999) {
1131  // re-evaluate the dca as it seems to not be natively present
1132  // allowed only for tracks inside the beam pipe
1133  Double_t pos[3] = {-99., -99., -99.};
1134  track->GetPosition(pos);
1135  if(pos[0]*pos[0]+pos[1]*pos[1] <= 3.*3.) {
1136  AliAODTrack copy(*track); // stack copy
1137  Double_t b[2] = {-99., -99.};
1138  Double_t bCov[3] = {-99., -99., -99.};
1139  if(copy.PropagateToDCA(aod->GetPrimaryVertex(), aod->GetMagneticField(), 100., b, bCov)) {
1140  DCAxy = b[0];
1141  DCAz = b[1];
1142  }
1143  }
1144  }
1145  if(fabs(DCAxy)>2.4 || fabs(DCAz)>3.2) continue;
1146 
1147  // various cuts on TPC clusters
1148  if (track->GetTPCNcls() < 70) continue;
1149  Double_t chi2_per_tpc = track->Chi2perNDF();
1150  if (chi2_per_tpc < 0.1 || chi2_per_tpc > 4.) continue;
1151  Double_t fraction_shared_tpccls = 1.*track->GetTPCnclsS()/track->GetTPCncls();
1152  if (fraction_shared_tpccls > 0.4) continue;
1153 
1154  Int_t FBarray[4] = {32,96,128,768};
1155 
1156  // test filter bits
1157  for(Int_t fb=0; fb<fKNFBs; fb++){
1158  if (track->TestFilterBit(FBarray[fb])) {
1159  fTrackQADCAxy[fb][cw]->Fill(dEta,dPt,DCAxy);
1160  fTrackQADCAz[fb][cw]->Fill(dEta,dPt,DCAz);
1161  fTrackQApT[fb][cw]->Fill(dEta,dPt);
1162  fEbEQRe[fb][cw]->Fill(dEta,dPt,TMath::Cos(dPhi));
1163  fEbEQIm[fb][cw]->Fill(dEta,dPt,TMath::Sin(dPhi));
1164  fEbEQMu[fb][cw]->Fill(dEta,dPt);
1165  }
1166  }
1167  }
1168 
1169  // compute cos(#Delta#phi)
1170  for(Int_t bx=1; bx<=fEbEQRe[0][0]->GetXaxis()->GetNbins(); bx++) {
1171  for(Int_t by=1; by<=fEbEQRe[0][0]->GetYaxis()->GetNbins(); by++) {
1172 
1173  Double_t dEta = fEbEQRe[0][0]->GetXaxis()->GetBinCenter(bx);
1174  Double_t dPt = fEbEQRe[0][0]->GetYaxis()->GetBinCenter(by);
1175 
1176  for(Int_t fb=0; fb<fKNFBs; fb++){
1177  for(Int_t c=0; c<4; c++){
1178 
1179  Double_t QRe = fEbEQRe[fb][c]->GetBinContent(bx,by);
1180  Double_t QIm = fEbEQIm[fb][c]->GetBinContent(bx,by);
1181  Double_t M = 1.*fEbEQMu[fb][c]->GetBinContent(bx,by);
1182 
1183  if(M>1.) {
1184  Double_t c1 = (QRe*QRe+QIm*QIm-M)/(M*(M-1.));
1185  fTrackQADphi[fb][c]->Fill(dEta,dPt,c1);
1186  }
1187  }
1188  }
1189 
1190  }
1191  }
1192 
1193  // reset EbE histograms
1194  for(Int_t fb=0; fb<fKNFBs; fb++){
1195  for(Int_t c=0; c<4; c++){
1196  fEbEQRe[fb][c]->Reset();
1197  fEbEQIm[fb][c]->Reset();
1198  fEbEQMu[fb][c]->Reset();
1199  }
1200  }
1201 
1202  }
1203 
1204  if (fAnalysisType == kMCAOD) {
1205 
1206  //check event cuts
1207  if (InputEvent()) {
1208  if(!fCutsEvent->IsSelected(InputEvent(),MCEvent())) return;
1209  if(fRejectPileUp && fAnalysisUtil->IsPileUpEvent(InputEvent())) return;
1210  }
1211 
1212  fFlowEvent->ClearFast();
1213 
1214  if(!McEvent) {
1215  AliError("ERROR: Could not retrieve MCEvent");
1216  return;
1217  }
1218  fStack = (TClonesArray*)aod->FindListObject(AliAODMCParticle::StdBranchName());
1219  if(!fStack){
1220  AliError("ERROR: Could not retrieve MCStack");
1221  return;
1222  }
1223 
1224  // get centrality (from AliMultSelection or AliCentrality)
1225  Double_t centr = 300;
1227  fMultSelection = (AliMultSelection*)aod->FindListObject("MultSelection");
1228  if(!fMultSelection) {
1229  //If you get this warning (and lPercentiles 300) please check that the AliMultSelectionTask actually ran (before your task)
1230  AliWarning("AliMultSelection object not found!");
1231  } else {
1232  centr = fMultSelection->GetMultiplicityPercentile("V0M");
1233  }
1234  } else {
1235  centr = (((AliVAODHeader*)aod->GetHeader())->GetCentralityP())->GetCentralityPercentile("V0M");
1236  }
1237  // centrality bin
1238  if (centr<fCentrLowLim || centr>=fCentrUpLim ) return;
1239  Int_t CenBin = -1;
1240  CenBin = GetCenBin(centr);
1241  if(CenBin==-1) return;
1242  fCenDis->Fill(centr);
1243 
1244  AliMCEvent* McEventFake = NULL;
1245  //first attach all possible information to the cuts
1246  fCutsRP->SetEvent( InputEvent(), McEventFake ); //attach event
1247  fCutsPOI->SetEvent( InputEvent(), McEventFake );
1248 
1249  //then make the event
1251 
1252  fFlowEvent->SetCentrality(centr);
1253  fFlowEvent->SetCentralityCL1(centr);
1254  fFlowEvent->SetCentralityTRK(centr);
1256 
1257  Double_t SumV0=0.;
1258  for(Int_t i=0; i<64; i++) {
1259  if(std::isfinite(aod->GetVZEROEqMultiplicity(i))) SumV0 += aod->GetVZEROEqMultiplicity(i);
1260  }
1261  fFlowEvent->SetNITSCL1(SumV0);
1262 
1263  Double_t vtxpos[3]={0.,0.,0.};
1264  vtxpos[0] = ((AliAODVertex*)aod->GetPrimaryVertex())->GetX();
1265  vtxpos[1] = ((AliAODVertex*)aod->GetPrimaryVertex())->GetY();
1266  vtxpos[2] = ((AliAODVertex*)aod->GetPrimaryVertex())->GetZ();
1267  fFlowEvent->SetVertexPosition(vtxpos);
1268 
1269  // reconstructed
1270  for(Int_t jTracks = 0; jTracks<aod->GetNumberOfTracks(); jTracks++){
1271 
1272  AliAODTrack* track = (AliAODTrack*)aod->GetTrack(jTracks);
1273  if(!track) continue;
1274 
1275  // to select primaries
1276  Int_t lp = TMath::Abs(track->GetLabel());
1277 
1278  // general kinematic cuts
1279  if (track->Pt() < .2 || track->Pt() > 20. || TMath::Abs(track->Eta()) > 0.8) continue;
1280 
1281  // cut on DCA
1282  Double_t DCAxy = track->DCA();
1283  Double_t DCAz = track->ZAtDCA();
1284  if(fabs(DCAxy)>2.4 || fabs(DCAz)>3.2) continue;
1285 
1286  // various cuts on TPC clusters
1287  if (track->GetTPCNcls() < 70) continue;
1288  Double_t chi2_per_tpc = track->Chi2perNDF();
1289  if (chi2_per_tpc < 0.1 || chi2_per_tpc > 4.) continue;
1290  Double_t fraction_shared_tpccls = 1.*track->GetTPCnclsS()/track->GetTPCncls();
1291  if (fraction_shared_tpccls > 0.4) continue;
1292 
1293  // test filter bits
1294  if (((AliAODMCParticle*)fStack->At(lp))->IsPhysicalPrimary()) {
1295  if (track->TestFilterBit(32)) fPtSpecFB32[0][CenBin]->Fill(track->Pt());
1296  if (track->TestFilterBit(96)) fPtSpecFB96[0][CenBin]->Fill(track->Pt());
1297  if (track->TestFilterBit(128)) fPtSpecFB128[0][CenBin]->Fill(track->Pt());
1298  if (track->TestFilterBit(768)) fPtSpecFB768[0][CenBin]->Fill(track->Pt());
1299  } else {
1300  if (track->TestFilterBit(32)) fPtSpecFB32[1][CenBin]->Fill(track->Pt());
1301  if (track->TestFilterBit(96)) fPtSpecFB96[1][CenBin]->Fill(track->Pt());
1302  if (track->TestFilterBit(128)) fPtSpecFB128[1][CenBin]->Fill(track->Pt());
1303  if (track->TestFilterBit(768)) fPtSpecFB768[1][CenBin]->Fill(track->Pt());
1304  }
1305 
1306  }
1307 
1308  // generated (physical primaries)
1309  for(Int_t jTracks = 0; jTracks<fStack->GetEntriesFast(); jTracks++) {
1310  AliAODMCParticle *MCpart = (AliAODMCParticle*)fStack->At(jTracks);
1311  if (!MCpart) {
1312  printf("ERROR: Could not receive MC track %d\n", jTracks);
1313  continue;
1314  }
1315 
1316  // kinematic cuts
1317  if ( MCpart->Pt() < .2 || MCpart->Pt() > 20. || TMath::Abs(MCpart->Eta()) > .8 ) continue;
1318  // select charged primaries
1319  if ( MCpart->Charge() == 0. || !MCpart->IsPhysicalPrimary()) continue;
1320 
1321  fPtSpecGen[0][CenBin]->Fill(MCpart->Pt());
1322  }
1323 
1324  // fGenHeader = McEvent->GenEventHeader();
1325  // if(fGenHeader) fPythiaGenHeader = dynamic_cast<AliGenPythiaEventHeader*>(fGenHeader);
1326  // printf("#reconstructed : %d (rejected from cuts %d), #MC primaries : %d (rejected from cuts %d) \n",AODPOIs,AODbads,MCPrims,MCSecos);
1327  fFlowEvent->SetReferenceMultiplicity(aod->GetNumberOfTracks());
1328  fFlowEvent->SetCentrality(centr);
1329  // if (McEvent && McEvent->GenEventHeader()) fFlowEvent->SetMCReactionPlaneAngle(McEvent);
1330  fFlowEvent->SetRun(RunNum);
1331  // printf("Run : %d, RefMult : %d, Cent : %f \n",fFlowEvent->GetRun(),fFlowEvent->GetReferenceMultiplicity(),fFlowEvent->GetCentrality());
1332  }
1333 
1334  if(fAnalysisType == kMCESD) {
1335 
1336  fFlowEvent->ClearFast();
1337 
1338  if(!esd) {
1339  AliError("ERROR: Could not retrieve ESDEvent");
1340  return;
1341  }
1342  if(!McEvent) {
1343  AliError("ERROR: Could not retrieve MCEvent");
1344  return;
1345  }
1346  AliStack* fStack = fMCEvent->Stack();
1347  if(!fStack) {
1348  AliError("ERROR: Could not retrieve MCStack");
1349  return;
1350  }
1351 
1352  AliESDVertex *vertex = (AliESDVertex*) esd->GetPrimaryVertex();
1353  if (!vertex) return;
1354  if (TMath::Abs(vertex->GetZ()) > 10. ) return;
1355  if (vertex->GetNContributors() < 1 ) return;
1356  AliCentrality *centrality = esd->GetCentrality();
1357  if (!centrality) return;
1358  Double_t centr = centrality->GetCentralityPercentile("V0M");
1359  if (centr<fCentrLowLim || centr>=fCentrUpLim ) return;
1360  Int_t CenBin = -1;
1361  if (centr>0. && centr<5.) CenBin=0;
1362  if (centr>5. && centr<10.) CenBin=1;
1363  if (centr>10. && centr<20.) CenBin=2;
1364  if (centr>20. && centr<30.) CenBin=3;
1365  if (centr>30. && centr<40.) CenBin=4;
1366  if (centr>40. && centr<50.) CenBin=5;
1367  if (centr>50. && centr<60.) CenBin=6;
1368  if (centr>60. && centr<70.) CenBin=7;
1369  if (centr>70. && centr<80.) CenBin=8;
1370  if (centr>80. && centr<90.) CenBin=9;
1371  if(CenBin==-1) return;
1372 
1373  //Generated
1374  Int_t MCPrims = 0;
1375  for ( Int_t i=0 ; i<fStack->GetNtrack() ; i++ ) {
1376 
1377  //Primaries Selection
1378  TParticle *particle = (TParticle*)fStack->Particle(i);
1379  if (!particle) continue;
1380  if (!fStack->IsPhysicalPrimary(i)) continue;
1381  if ( particle->GetPDG()->Charge() == 0.) continue;
1382 
1383  //Kinematic Cuts
1384  if ( particle->Pt()<0.2 || particle->Pt()>10. ) continue;
1385  if ( TMath::Abs(particle->Eta())>0.8 ) continue;
1386 
1387  fFlowTrack->SetPhi(particle->Phi());
1388  fFlowTrack->SetEta(particle->Eta());
1389  fFlowTrack->SetPt(particle->Pt());
1391  fFlowTrack->SetForRPSelection(kTRUE);
1393  fFlowTrack->SetForPOISelection(kFALSE);
1395  MCPrims++;
1396 
1397  fPtSpecGen[0][CenBin]->Fill(particle->Pt());
1398 
1399  }
1400 
1401  //Reconstructed
1402  Int_t ESDPrims = 0;
1403  for (Int_t i=0 ; i<esd->GetNumberOfTracks() ; i++) {
1404 
1405  //Get reconstructed track
1406  AliVTrack *vtrack = static_cast<AliVTrack*>(esd->GetTrack(i));
1407  AliESDtrack *track = dynamic_cast<AliESDtrack*>(vtrack);
1408  if (!track) continue;
1409 
1410  //Primaries selection
1411  Int_t lp = TMath::Abs(track->GetLabel());
1412  if (!fStack->IsPhysicalPrimary(lp)) continue;
1413  TParticle *particle = (TParticle*)fStack->Particle(lp);
1414  if (!particle) continue;
1415  if (particle->GetPDG()->Charge() == 0.) continue;
1416 
1417  // if(!fCutsPOI->PassesESDcuts(track)) continue;
1418 
1419  Bool_t pass = kTRUE;
1420 
1421  if(fCutTPC) {
1422  // printf("******* cutting TPC ******** \n");
1423  UShort_t ntpccls = track->GetTPCNcls();
1424  Double_t tpcchi2 = track->GetTPCchi2();
1425  if (tpcchi2<0.2 || tpcchi2 >=4.) {
1426  // printf("TPCchi2 : %e %e ",tpcchi2,track->GetTPCchi2Iter1());
1427  pass=kFALSE;
1428  }
1429  if (ntpccls < 70) {
1430  // printf("#TPCcluster : %u %u %u %u ",ntpccls,track->GetTPCNclsF(),track->GetTPCNclsFIter1(),track->GetTPCNclsIter1());
1431  pass=kFALSE;
1432  }
1433  }
1434 
1435  Float_t dcaxy=0.0;
1436  Float_t dcaz=0.0;
1437  track->GetImpactParameters(dcaxy,dcaz);
1438  if (dcaxy > 0.3 || dcaz > 0.3) {
1439  // printf("DCA : %e %e ",dcaxy,dcaz);
1440  pass=kFALSE;
1441  }
1442  if(!pass) continue;
1443 
1444  //Kinematic Cuts
1445  if ( track->Pt()<0.2 || track->Pt()>10. ) continue;
1446  if ( TMath::Abs(track->Eta())>0.8 ) continue;
1447 
1448  fFlowTrack->SetPhi(track->Phi());
1449  fFlowTrack->SetEta(track->Eta());
1450  fFlowTrack->SetPt(track->Pt());
1452  fFlowTrack->SetForRPSelection(kFALSE);
1456  ESDPrims++;
1457 
1458  }
1459 
1460  // printf("#reconstructed : %d , #MC primaries : %d \n",ESDPrims,MCPrims);
1461  fFlowEvent->SetReferenceMultiplicity(esd->GetNumberOfTracks());
1462  fFlowEvent->SetCentrality(centr);
1463  if (McEvent && McEvent->GenEventHeader()) fFlowEvent->SetMCReactionPlaneAngle(McEvent);
1464  fFlowEvent->SetRun(esd->GetRunNumber());
1465  // printf("Run : %d, RefMult : %d, Cent : %f \n",fFlowEvent->GetRun(),fFlowEvent->GetReferenceMultiplicity(),fFlowEvent->GetCentrality());
1466 
1467  } // end of if(fAnalysisType == kMCESD)
1468 
1469  if(fAnalysisType == kMCkine) {
1470 
1471  fFlowEvent->ClearFast();
1472 
1473  AliInputEventHandler* McHandler = dynamic_cast<AliInputEventHandler*> (AliAnalysisManager::GetAnalysisManager()->GetMCtruthEventHandler());
1474  if(!McHandler) {
1475  AliError("ERROR: Could not retrieve MCtruthEventHandler");
1476  return;
1477  }
1478  McEvent = McHandler->MCEvent();
1479  if(!McEvent) {
1480  AliError("ERROR: Could not retrieve MC event");
1481  return;
1482  }
1483 
1484  Int_t nTracks = McEvent->GetNumberOfTracks();
1485  // Int_t nPrimTr = McEvent->GetNumberOfPrimaries();
1486 
1487  //loop over tracks
1488  for (Int_t itrkN=0; itrkN<nTracks; itrkN++) {
1489  //get input particle
1490  AliMCParticle* pParticle = dynamic_cast<AliMCParticle*>(McEvent->GetTrack(itrkN));
1491  if (!pParticle) continue;
1492 
1493  //check if track passes the cuts
1494  if (McEvent->IsPhysicalPrimary(itrkN) && pParticle->Charge()!=0) {
1495  fFlowTrack->Set(pParticle);
1497  fFlowTrack->SetForRPSelection(kTRUE);
1502  }
1503  }// for all tracks
1504 
1505  // if monte carlo event get reaction plane from monte carlo (depends on generator)
1506  if (McEvent && McEvent->GenEventHeader()) fFlowEvent->SetMCReactionPlaneAngle(McEvent);
1507  // set reference multiplicity
1508  fFlowEvent->SetReferenceMultiplicity(McEvent->GetNumberOfTracks());
1509  // tag subevents
1511  // set centrality from impact parameter
1512  Double_t ImpPar=0., CenPer=0.;
1513  fGenHeader = McEvent->GenEventHeader();
1514  if(fGenHeader){
1515  fPythiaGenHeader = dynamic_cast<AliGenPythiaEventHeader*>(fGenHeader);
1516  if(fPythiaGenHeader) ImpPar = fPythiaGenHeader->GetImpactParameter();
1517  fHijingGenHeader = dynamic_cast<AliGenHijingEventHeader*>(fGenHeader);
1518  if(fHijingGenHeader) ImpPar = fHijingGenHeader->ImpactParameter();
1519  if(ImpPar) CenPer = 0.3859796743103508*pow(ImpPar,2.);
1520  if(CenPer>0. && CenPer<100.) fFlowEvent->SetCentrality(CenPer);
1521  else return;
1522  fFlowEvent->SetRun(1);
1523  }
1524 
1525  } // end of if(fAnalysisType == kMCkine)
1526 
1527  if (!fFlowEvent) return; //shuts up coverity
1528 
1529  //check final event cuts
1530  Int_t mult = fFlowEvent->NumberOfTracks();
1531  // AliInfo(Form("FlowEvent has %i tracks",mult));
1532  if (mult<fMinMult || mult>fMaxMult) {
1533  AliWarning("FlowEvent cut on multiplicity"); return;
1534  }
1535 
1536  //define dead zone
1538 
1541  if (fAfterburnerOn)
1542  {
1543  //if reaction plane not set from elsewhere randomize it before adding flow
1545  fFlowEvent->SetMCReactionPlaneAngle(gRandom->Uniform(0.0,TMath::TwoPi()));
1546 
1547  if(fDifferentialV2)
1549  else
1550  fFlowEvent->AddFlow(fV1,fV2,fV3,fV4,fV5); //add flow
1551  fFlowEvent->CloneTracks(fNonFlowNumberOfTrackClones); //add nonflow by cloning tracks
1552  }
1554 
1555  //tag subEvents
1557 
1558  //do we want to serve shullfed tracks to everybody?
1560 
1561  // associate the mother particles to their daughters in the flow event (if any)
1563 
1564  //fListHistos->Print();
1565  //fOutputFile->WriteObject(fFlowEvent,"myFlowEventSimple");
1566 
1567  //********************************************************************************************************************************
1568 
1570 
1571  // PHYSICS SELECTION
1572  AliAnalysisManager *am = AliAnalysisManager::GetAnalysisManager();
1573  AliInputEventHandler *hdr = (AliInputEventHandler*)am->GetInputEventHandler();
1574 
1575  if(hdr->IsEventSelected()==0 && !head->InheritsFrom("AliNanoAODStorage")) return;
1576  //if(hdr->IsEventSelected() && AliVEvent::kAny) {
1577 
1578  Double_t centrperc = fFlowEvent->GetCentrality();
1579  Int_t cenb = (Int_t)centrperc;
1580 
1581  Int_t nTracklets ;
1582  if(!head->InheritsFrom("AliNanoAODStorage")){
1583  AliAODTracklets *trackl = aod->GetTracklets();
1584  nTracklets = trackl->GetNumberOfTracklets();
1585  }else{
1586  AliNanoAODHeader *nanoAodHeader = (AliNanoAODHeader*) head;
1587  nTracklets = nanoAodHeader->GetVar(nanoAodHeader->GetVarIndex("cstNTrackelets"));
1588  }
1589 
1590 
1591  // get VZERO data
1592  AliAODVZERO *vzeroAOD = aod->GetVZEROData();
1593  Double_t multV0A = vzeroAOD->GetMTotV0A();
1594  Double_t multV0C = vzeroAOD->GetMTotV0C();
1595 
1596  // set VZERO Q-vectors
1597  if(fDataSet==k2015 || fDataSet==k2015v6) {
1598  Int_t CachednRing = 1;
1599  Double_t QxTot[fkVZEROnHar] = {0.}, QyTot[fkVZEROnHar] = {0.};
1600  Double_t denom = 0.;
1601  Double_t V0TotQC[fkVZEROnHar][2] = {{0.}}, V0TotQA[fkVZEROnHar][2] = {{0.}};
1602  Double_t MultC[fkVZEROnHar] = {0.}, MultA[fkVZEROnHar] = {0.};
1603 
1604  for(Int_t i=0; i<64; i++) {
1605 
1606  // correct multiplicity per channel
1607  Double_t mult = vzeroAOD->GetMultiplicity(i);
1608  if(fVZEROGainEqHist) {
1609  Double_t EqFactor = fVZEROGainEqHist->GetBinContent(RunBin+1,i+1);
1610  if(EqFactor>0.) mult *= EqFactor;
1611  }
1612  fVZEROMult->Fill(RunBin+0.5,i+0.5,mult);
1613 
1614  // build Q-vector per ring
1615  Int_t nRing = (Int_t)i/8 + 1;
1616  Double_t ChPhi = TMath::PiOver4()*(0.5+i%8);
1617 
1618  if(i == 63) {
1619  for (Int_t k=0; k<fkVZEROnHar; k++) {
1620  QxTot[k] += mult*TMath::Cos((k+1.)*ChPhi);
1621  QyTot[k] += mult*TMath::Sin((k+1.)*ChPhi);
1622  }
1623  denom += mult;
1624  nRing++;
1625  }
1626 
1627  if(nRing!=CachednRing) {
1628  for (Int_t k=0; k<fkVZEROnHar; k++) {
1629  Double_t QxRec = QxTot[k]/denom;
1630  Double_t QyRec = QyTot[k]/denom;
1631  // store values for re-centering
1632  // fVZEROQVectorRecQx[k]->Fill(RunBin+0.5,centrperc,CachednRing-0.5,QxRec);
1633  // fVZEROQVectorRecQy[k]->Fill(RunBin+0.5,centrperc,CachednRing-0.5,QyRec);
1634  // do re-centering
1635  if(fVZEROQVectorRecQxStored[k]) {
1636  if(!std::isnan(fVZEROQVectorRecQxStored[k]->GetBinContent(fVZEROQVectorRecQxStored[k]->FindBin(RunBin+0.5,centrperc,CachednRing-0.5)))) QxRec -= fVZEROQVectorRecQxStored[k]->GetBinContent(fVZEROQVectorRecQxStored[k]->FindBin(RunBin+0.5,centrperc,CachednRing-0.5));
1637  if(!std::isnan(fVZEROQVectorRecQyStored[k]->GetBinContent(fVZEROQVectorRecQyStored[k]->FindBin(RunBin+0.5,centrperc,CachednRing-0.5)))) QyRec -= fVZEROQVectorRecQyStored[k]->GetBinContent(fVZEROQVectorRecQyStored[k]->FindBin(RunBin+0.5,centrperc,CachednRing-0.5));
1638  }
1639  // sum of Q-vectors over all rings (total V0 Q-vector)
1640  if (CachednRing >= fMinRingVZC && CachednRing <= fMaxRingVZC) {
1641  V0TotQC[k][0] += QxRec*denom;
1642  V0TotQC[k][1] += QyRec*denom;
1643  MultC[k] += denom;
1644  }
1645  if (CachednRing >= fMinRingVZA && CachednRing <= fMaxRingVZA) {
1646  V0TotQA[k][0] += QxRec*denom;
1647  V0TotQA[k][1] += QyRec*denom;
1648  MultA[k] += denom;
1649  }
1650  QxTot[k] = 0.;
1651  QyTot[k] = 0.;
1652  }
1653  denom = 0.;
1654  CachednRing = nRing;
1655  }
1656  for (Int_t k=0; k<fkVZEROnHar; k++) {
1657  QxTot[k] += mult*TMath::Cos((k+1.)*ChPhi);
1658  QyTot[k] += mult*TMath::Sin((k+1.)*ChPhi);
1659  }
1660  denom += mult;
1661  }
1662 
1663  for (Int_t k=0; k<fkVZEROnHar; k++) {
1664  if(MultC[k]>0. && MultA[k]>0.) {
1665  Double_t QCx = V0TotQC[k][0]/MultC[k], QCy = V0TotQC[k][1]/MultC[k], QAx = V0TotQA[k][0]/MultA[k], QAy = V0TotQA[k][1]/MultA[k];
1666  if(!std::isnan(QCx) && !std::isnan(QCy) && !std::isnan(QAx) && !std::isnan(QAy)) {
1667  fFlowEvent->SetV02Qsub(QCx,QCy,MultC[k],QAx,QAy,MultA[k],k+1);
1668  fVZEROQVectorRecFinal[k][0]->Fill(RunBin+0.5,centrperc,QCx);
1669  fVZEROQVectorRecFinal[k][1]->Fill(RunBin+0.5,centrperc,QCy);
1670  fVZEROQVectorRecFinal[k][2]->Fill(RunBin+0.5,centrperc,QAx);
1671  fVZEROQVectorRecFinal[k][3]->Fill(RunBin+0.5,centrperc,QAy);
1672  fVZEROQVectorRecFinal[k][4]->Fill(RunBin+0.5,centrperc,QCx*QAx);
1673  fVZEROQVectorRecFinal[k][5]->Fill(RunBin+0.5,centrperc,QCy*QAy);
1674  fVZEROQVectorRecFinal[k][6]->Fill(RunBin+0.5,centrperc,QCx*QAy);
1675  fVZEROQVectorRecFinal[k][7]->Fill(RunBin+0.5,centrperc,QCy*QAx);
1676  } else {
1677  fFlowEvent->SetV02Qsub(0.,0.,0.,0.,0.,0.,k+1);
1678  }
1679  } else {
1680  fFlowEvent->SetV02Qsub(0.,0.,0.,0.,0.,0.,k+1);
1681  }
1682  }
1683  }
1684 
1685  // AliAODForwardMult* aodForward = static_cast<AliAODForwardMult*>(aodEvent->FindListObject("Forward"));
1686  // const TH2D& d2Ndetadphi = aodForward->GetHistogram();
1687  // Int_t nEta = d2Ndetadphi.GetXaxis()->GetNbins();
1688  // Int_t nPhi = d2Ndetadphi.GetYaxis()->GetNbins();
1689  // Double_t ret = 0.;
1690  // // Loop over eta
1691  // for (Int_t iEta = 1; iEta <= nEta; iEta++) {
1692  // Int_t valid = d2Ndetadphi.GetBinContent(iEta, 0);
1693  // if (!valid) continue; // No data expected for this eta
1694  // // Loop over phi
1695  // for (Int_t iPhi = 1; i <= nPhi; i++) {
1696  // ret = d2Ndetadphi.GetBinContent(iEta, iPhi);
1697  // printf("eta %e phi %e : %e \n",d2Ndetadphi.GetXaxis()->GetBinCenter(iEta),d2Ndetadphi.GetYaxis()->GetBinCenter(iPhi),ret);
1698  // }
1699  // }
1700 
1701  AliAODZDC *aodZDC = aod->GetZDCData();
1702 
1703  const Double_t * towZNCraw = aodZDC->GetZNCTowerEnergy();
1704  const Double_t * towZNAraw = aodZDC->GetZNATowerEnergy();
1705 
1706  // Get centroid from ZDCs *******************************************************
1707 
1708  Double_t Enucl = (RunNum < 209122 ? 1380. : 2511.);
1709  Double_t xyZNC[2]={0.,0.}, xyZNA[2]={0.,0.};
1710  Double_t towZNC[5]={0.}, towZNA[5]={0.};
1711 
1712  Double_t ZNCcalib=1., ZNAcalib=1.;
1713  if(fUseTowerEq) {
1714  if(RunNum!=fCachedRunNum) {
1715  for(Int_t i=0; i<5; i++) {
1716  fTowerGainEq[0][i] = (TH1D*)(fTowerEqList->FindObject(Form("fZNCTower[%d][%d]",RunNum,i)));
1717  fTowerGainEq[1][i] = (TH1D*)(fTowerEqList->FindObject(Form("fZNATower[%d][%d]",RunNum,i)));
1718  }
1719  }
1720  for(Int_t i=0; i<5; i++) {
1721  if(fTowerGainEq[0][i]) towZNC[i] = towZNCraw[i]*fTowerGainEq[0][i]->GetBinContent(fTowerGainEq[0][i]->FindBin(centrperc));
1722  if(fTowerGainEq[1][i]) towZNA[i] = towZNAraw[i]*fTowerGainEq[1][i]->GetBinContent(fTowerGainEq[1][i]->FindBin(centrperc));
1723  if(fResetNegativeZDC) {
1724  if(towZNC[i]<0.) towZNC[i] = 0.;
1725  if(towZNA[i]<0.) towZNA[i] = 0.;
1726  }
1727  }
1728  } else {
1729  for(Int_t i=0; i<5; i++) {
1730  towZNC[i] = towZNCraw[i];
1731  towZNA[i] = towZNAraw[i];
1732  if(fResetNegativeZDC) {
1733  if(towZNC[i]<0.) towZNC[i] = 0.;
1734  if(towZNA[i]<0.) towZNA[i] = 0.;
1735  }
1736  fZNCTower[RunBin][i]->Fill(centrperc,towZNC[i]);
1737  fZNATower[RunBin][i]->Fill(centrperc,towZNA[i]);
1738  }
1739  }
1740 
1741  if(RunNum>=245829) towZNA[2] = 0.;
1742  Double_t zncEnergy=0., znaEnergy=0.;
1743  for(Int_t i=0; i<5; i++){
1744  zncEnergy += towZNC[i];
1745  znaEnergy += towZNA[i];
1746  }
1747  if(RunNum>=245829) znaEnergy *= 8./7.;
1748  fFlowEvent->SetZNCQ0(towZNC[0]);
1749  fFlowEvent->SetZNAQ0(towZNA[0]);
1750 
1751  Double_t energyZNC =0;
1752  Double_t energyZNA =0;
1753  Double_t energyZPC =0;
1754  Double_t energyZPA =0;
1755  if(!head->InheritsFrom("AliNanoAODStorage")){
1756  energyZNC = ((AliVAODHeader*)aod->GetHeader())->GetZDCN1Energy();
1757  energyZNA = ((AliVAODHeader*)aod->GetHeader())->GetZDCN2Energy();
1758  energyZPC = ((AliVAODHeader*)aod->GetHeader())->GetZDCP1Energy();
1759  energyZPA = ((AliVAODHeader*)aod->GetHeader())->GetZDCP2Energy();
1760  }else{
1761  AliNanoAODHeader *nanoAodHeader = (AliNanoAODHeader*) head;
1762  energyZNC = nanoAodHeader->GetVar(nanoAodHeader->GetVarIndex("cstEnergyZNC"));
1763  energyZNA = nanoAodHeader->GetVar(nanoAodHeader->GetVarIndex("cstEnergyZNA"));
1764  energyZPC = nanoAodHeader->GetVar(nanoAodHeader->GetVarIndex("cstEnergyZPC"));
1765  energyZPA = nanoAodHeader->GetVar(nanoAodHeader->GetVarIndex("cstEnergyZPA"));
1766  }
1767 
1768  fFlowEvent->SetZNCEnergy(energyZNC);
1769  fFlowEvent->SetZNAEnergy(energyZNA);
1770 
1771  fFlowEvent->SetZPCEnergy(energyZPC);
1772  fFlowEvent->SetZPAEnergy(energyZPA);
1773 
1774  const Double_t x[4] = {-1.75, 1.75, -1.75, 1.75};
1775  const Double_t y[4] = {-1.75, -1.75, 1.75, 1.75};
1776  Double_t numXZNC=0., numYZNC=0., denZNC=0., cZNC, wZNC, EZNC, SumEZNC=0.;
1777  Double_t numXZNA=0., numYZNA=0., denZNA=0., cZNA, wZNA, EZNA, SumEZNA=0., BadChOr;
1778  Bool_t fAllChONZNC=kTRUE, fAllChONZNA=kTRUE;
1779 
1780  if (fUseMCCen) {
1781  for(Int_t i=0; i<4; i++){
1782 
1783  // get energy
1784  EZNC = towZNC[i+1];
1785  fhZNSpectra->Fill(centrperc,i+0.5,EZNC);
1786  // fhZNSpectraRbR[RunBin]->Fill(centrperc,i+0.5,EZNC);
1787  if(fUseZDCSpectraCorr && EZNC>0.) {
1788  Double_t mu1 = SpecCorMu1[i]->Interpolate(centrperc);
1789  Double_t mu2 = SpecCorMu2[i]->Interpolate(centrperc);
1790  Double_t av = SpecCorAv[i]->Interpolate(centrperc);
1791  Double_t cor1 = SpecCorSi[i]->Interpolate(centrperc);
1792  EZNC = exp( (log(EZNC) - mu1 + mu2*cor1)/cor1 ) + av;
1793  fhZNSpectraCor->Fill(centrperc,i+0.5,EZNC);
1794  }
1795  if(fUseZDCSpectraCorr && EZNC<=0.) fAllChONZNC=kFALSE;
1796 
1797  SumEZNC += EZNC;
1798 
1799  // build centroid
1800  wZNC = TMath::Power(EZNC, fZDCGainAlpha);
1801  numXZNC += x[i]*wZNC;
1802  numYZNC += y[i]*wZNC;
1803  denZNC += wZNC;
1804  fhZNSpectraPow->Fill(centrperc,i+0.5,wZNC);
1805 
1806  // get energy
1807  if(fDataSet==k2015 || fDataSet==k2015v6) {
1808  if(i==1) {
1809  EZNA = towZNA[0]-towZNA[1]-towZNA[3]-towZNA[4];
1810  if(fUseBadTowerCalib && fBadTowerCalibHist[cenb]) {
1811  EZNA = GetBadTowerResp(EZNA, fBadTowerCalibHist[cenb]);
1812  }
1813  } else {
1814  EZNA = towZNA[i+1];
1815  }
1816  } else {
1817  EZNA = towZNA[i+1];
1818  }
1819  fhZNSpectra->Fill(centrperc,i+4.5,EZNA);
1820  // fhZNSpectraRbR[RunBin]->Fill(centrperc,i+4.5,EZNA);
1821  if(fUseZDCSpectraCorr && EZNA>0.) {
1822  Double_t mu1 = SpecCorMu1[i+4]->Interpolate(centrperc);
1823  Double_t mu2 = SpecCorMu2[i+4]->Interpolate(centrperc);
1824  Double_t av = SpecCorAv[i+4]->Interpolate(centrperc);
1825  Double_t cor1 = SpecCorSi[i+4]->Interpolate(centrperc);
1826  EZNA = exp( (log(EZNA) - mu1 + mu2*cor1)/cor1 ) + av;
1827  fhZNSpectraCor->Fill(centrperc,i+4.5,EZNA);
1828  }
1829  if(fUseZDCSpectraCorr && EZNA<=0.) fAllChONZNA=kFALSE;
1830  SumEZNA += EZNA;
1831 
1832  // build centroid
1833  wZNA = TMath::Power(EZNA, fZDCGainAlpha);
1834  numXZNA += x[i]*wZNA;
1835  numYZNA += y[i]*wZNA;
1836  denZNA += wZNA;
1837  fhZNSpectraPow->Fill(centrperc,i+4.5,wZNA);
1838  }
1839  // store distribution for unfolding
1840  if(RunNum<245829) {
1841  Double_t recoE = towZNA[0]-towZNA[1]-towZNA[3]-towZNA[4];
1842  Double_t trueE = towZNA[2];
1843  fhZNBCCorr->Fill(centrperc,trueE,recoE);
1844  }
1845  if(denZNC>0.){
1846  Double_t nSpecnC = SumEZNC/Enucl;
1847  cZNC = 1.89358-0.71262/(nSpecnC+0.71789);
1848  xyZNC[0] = cZNC*numXZNC/denZNC;
1849  xyZNC[1] = cZNC*numYZNC/denZNC;
1850  denZNC *= cZNC;
1851  }
1852  else{
1853  xyZNC[0] = xyZNC[1] = 0.;
1854  }
1855  if(denZNA>0.){
1856  Double_t nSpecnA = SumEZNA/Enucl;
1857  cZNA = 1.89358-0.71262/(nSpecnA+0.71789);
1858  xyZNA[0] = cZNA*numXZNA/denZNA;
1859  xyZNA[1] = cZNA*numYZNA/denZNA;
1860  denZNA *= cZNA;
1861  }
1862  else{
1863  xyZNA[0] = xyZNA[1] = 0.;
1864  }
1865  } else {
1866  for(Int_t i=0; i<4; i++) {
1867  if(towZNC[i+1]>0.) {
1868  wZNC = TMath::Power(towZNC[i+1], fZDCGainAlpha);
1869  numXZNC += x[i]*wZNC;
1870  numYZNC += y[i]*wZNC;
1871  denZNC += wZNC;
1872  }
1873  if(towZNA[i+1]>0.) {
1874  wZNA = TMath::Power(towZNA[i+1], fZDCGainAlpha);
1875  numXZNA += x[i]*wZNA;
1876  numYZNA += y[i]*wZNA;
1877  denZNA += wZNA;
1878  }
1879  }
1880  if(denZNC!=0) {
1881  xyZNC[0] = numXZNC/denZNC;
1882  xyZNC[1] = numYZNC/denZNC;
1883  }
1884  else{
1885  xyZNC[0] = xyZNC[1] = 999.;
1886  zncEnergy = 0.;
1887  }
1888  if(denZNA!=0) {
1889  xyZNA[0] = numXZNA/denZNA;
1890  xyZNA[1] = numYZNA/denZNA;
1891  }
1892  else{
1893  xyZNA[0] = xyZNA[1] = 999.;
1894  znaEnergy = 0.;
1895  }
1896  }
1897 
1898  if(!fAllChONZNC) denZNC=-1.;
1899  if(!fAllChONZNA) denZNA=-1.;
1900 
1901  if(denZNC>0. && pow(xyZNC[0]*xyZNC[0]+xyZNC[1]*xyZNC[1],0.5)>1.E-6) fhZNCenDis[0]->Fill(centrperc,xyZNC[0],xyZNC[1]);
1902  if(denZNA>0. && pow(xyZNA[0]*xyZNA[0]+xyZNA[1]*xyZNA[1],0.5)>1.E-6) fhZNCenDis[1]->Fill(centrperc,-xyZNA[0], xyZNA[1]);
1903 
1904  fFlowEvent->SetZDC2Qsub(xyZNC,denZNC,xyZNA,denZNA);
1905 
1906  // ******************************************************************************
1907 
1908  for(int i=0; i<5; i++){
1909  fhZNCPM[i]->Fill(towZNC[i]);
1910  if((i<4) && (towZNC[0]>0.)) fhZNCPMQiPMC[i]->Fill(towZNC[i+1]/towZNC[0]);
1911  }
1912  for(int i=0; i<5; i++){
1913  fhZNAPM[i]->Fill(towZNA[i]);
1914  if(((i<4) && towZNA[0]>0.)) fhZNAPMQiPMC[i]->Fill(towZNA[i+1]/towZNA[0]);
1915  }
1916 
1917  fhZNCvsZNA->Fill(energyZNA, energyZNC);
1918  fhZDCCvsZDCCA->Fill(energyZNA+energyZPA, energyZNC+energyZPC);
1919  fhZNCvsZPC->Fill(energyZPC, energyZNC);
1920  fhZNAvsZPA->Fill(energyZPA, energyZNA);
1921  fhZNvsZP->Fill(energyZPA+energyZPC, energyZNA+energyZNC);
1922  fhZNvsVZERO->Fill(multV0A+multV0C, energyZNC+energyZNA);
1923  fhZDCvsVZERO->Fill(multV0A+multV0C, energyZNA+energyZPA+energyZNC+energyZPC);
1924 
1925  Double_t asymmetry = -999.;
1926  if((energyZNC+energyZNA)>0.) asymmetry = (energyZNC-energyZNA)/(energyZNC+energyZNA);
1927  fhAsymm->Fill(asymmetry);
1928  fhZNAvsAsymm->Fill(asymmetry, energyZNA);
1929  fhZNCvsAsymm->Fill(asymmetry, energyZNC);
1930 
1931  fhZNCvscentrality->Fill(centrperc, energyZNC);
1932  fhZNAvscentrality->Fill(centrperc, energyZNA);
1933  fhZPCvscentrality->Fill(centrperc, energyZPC);
1934  fhZPAvscentrality->Fill(centrperc, energyZPA);
1935 
1936  // } // PHYSICS SELECTION
1937 
1938  }
1939 
1940  // p) cache run number
1942 
1943  // printf("debug: NoRPs %e, NoPOIs %e, RunNum %d, Cen %e \n",fFlowEvent->GetNumberOfRPs(),fFlowEvent->GetNumberOfPOIs(),fCachedRunNum,fFlowEvent->GetCentrality());
1944 
1945  PostData(1, fFlowEvent);
1946 
1947  PostData(2, fOutput);
1948 }
1949 //________________________________________________________________________
1950 
1952 {
1953  Bool_t BisPileup=kFALSE;
1954 
1955  TObject *head =aod->GetHeader();
1956  if (head->InheritsFrom("AliNanoAODStorage")){
1957 
1958  AliNanoAODHeader * nanohead = (AliNanoAODHeader*)head;
1959  Int_t pileupIndex = nanohead->GetVarIndex("cstPileUp");
1960  if (nanohead->GetVar(pileupIndex)==0) BisPileup=kFALSE;
1961  if (nanohead->GetVar(pileupIndex)==1) BisPileup=kTRUE;
1962 
1963  } else {
1964 
1965  Double_t centrV0M=300., centrCL1=300.;
1966 
1968 
1969  // pileup for LHC10h and LHC11h
1970 
1971  centrV0M = ((AliVAODHeader*)aod->GetHeader())->GetCentralityP()->GetCentralityPercentile("V0M");
1972  centrCL1 = ((AliVAODHeader*)aod->GetHeader())->GetCentralityP()->GetCentralityPercentile("CL1");
1973 
1974  // check anyway pileup
1975  if (plpMV(aod)) {
1976  fPileUpCount->Fill(0.5);
1977  BisPileup=kTRUE;
1978  }
1979 
1980  Short_t isPileup = aod->IsPileupFromSPD(3);
1981  if (isPileup != 0) {
1982  fPileUpCount->Fill(1.5);
1983  BisPileup=kTRUE;
1984  }
1985 
1986  if (((AliAODHeader*)aod->GetHeader())->GetRefMultiplicityComb08() < 0) {
1987  fPileUpCount->Fill(2.5);
1988  BisPileup=kTRUE;
1989  }
1990 
1991  if (aod->IsIncompleteDAQ()) {
1992  fPileUpCount->Fill(3.5);
1993  BisPileup=kTRUE;
1994  }
1995 
1996  // check vertex consistency
1997  const AliAODVertex* vtTrc = aod->GetPrimaryVertex();
1998  const AliAODVertex* vtSPD = aod->GetPrimaryVertexSPD();
1999 
2000  if (vtTrc->GetNContributors() < 2 || vtSPD->GetNContributors()<1) {
2001  fPileUpCount->Fill(5.5);
2002  BisPileup=kTRUE;
2003  }
2004 
2005  double covTrc[6], covSPD[6];
2006  vtTrc->GetCovarianceMatrix(covTrc);
2007  vtSPD->GetCovarianceMatrix(covSPD);
2008 
2009  double dz = vtTrc->GetZ() - vtSPD->GetZ();
2010 
2011  double errTot = TMath::Sqrt(covTrc[5]+covSPD[5]);
2012  double errTrc = TMath::Sqrt(covTrc[5]);
2013  double nsigTot = dz/errTot;
2014  double nsigTrc = dz/errTrc;
2015 
2016  if (TMath::Abs(dz)>0.2 || TMath::Abs(nsigTot)>10 || TMath::Abs(nsigTrc)>20) {
2017  fPileUpCount->Fill(6.5);
2018  BisPileup=kTRUE;
2019  }
2020 
2021  if (fAnalysisUtil->IsPileUpEvent(InputEvent())) {
2022  fPileUpCount->Fill(7.5);
2023  BisPileup=kTRUE;
2024  }
2025 
2026  }
2027  else {
2028 
2029  // pileup for LHC15o, using AliMultSelection
2030 
2031  if(fMultSelection) {
2032  centrV0M = fMultSelection->GetMultiplicityPercentile("V0M");
2033  centrCL1 = fMultSelection->GetMultiplicityPercentile("CL1");
2034  } else {
2035  BisPileup=kTRUE;
2036  }
2037 
2038  // pileup from AliMultSelection
2039  if(!fMultSelection->GetThisEventIsNotPileup()) fPileUpMultSelCount->Fill(0.5);
2040  if(!fMultSelection->GetThisEventIsNotPileupMV()) fPileUpMultSelCount->Fill(1.5);
2041  if(!fMultSelection->GetThisEventIsNotPileupInMultBins()) fPileUpMultSelCount->Fill(2.5);
2042  if(!fMultSelection->GetThisEventHasNoInconsistentVertices()) fPileUpMultSelCount->Fill(3.5);
2043  if(!fMultSelection->GetThisEventPassesTrackletVsCluster()) fPileUpMultSelCount->Fill(4.5);
2044  if(!fMultSelection->GetThisEventIsNotAsymmetricInVZERO()) fPileUpMultSelCount->Fill(5.5);
2045  if(!fMultSelection->GetThisEventIsNotIncompleteDAQ()) fPileUpMultSelCount->Fill(6.5);
2046  if(!fMultSelection->GetThisEventHasGoodVertex2016()) fPileUpMultSelCount->Fill(7.5);
2047 
2048  // pile-up a la Dobrin for LHC15o
2049  if (plpMV(aod)) {
2050  fPileUpCount->Fill(0.5);
2051  BisPileup=kTRUE;
2052  }
2053 
2054  Short_t isPileup = aod->IsPileupFromSPD(3);
2055  if (isPileup != 0) {
2056  fPileUpCount->Fill(1.5);
2057  BisPileup=kTRUE;
2058  }
2059 
2060  if (((AliAODHeader*)aod->GetHeader())->GetRefMultiplicityComb08() < 0) {
2061  fPileUpCount->Fill(2.5);
2062  BisPileup=kTRUE;
2063  }
2064 
2065  if (aod->IsIncompleteDAQ()) {
2066  fPileUpCount->Fill(3.5);
2067  BisPileup=kTRUE;
2068  }
2069 
2070  if(fabs(centrV0M-centrCL1)>7.5) {
2071  fPileUpCount->Fill(4.5);
2072  BisPileup=kTRUE;
2073  }
2074 
2075  // check vertex consistency
2076  const AliAODVertex* vtTrc = aod->GetPrimaryVertex();
2077  const AliAODVertex* vtSPD = aod->GetPrimaryVertexSPD();
2078 
2079  if (vtTrc->GetNContributors() < 2 || vtSPD->GetNContributors()<1) {
2080  fPileUpCount->Fill(5.5);
2081  BisPileup=kTRUE;
2082  }
2083 
2084  double covTrc[6], covSPD[6];
2085  vtTrc->GetCovarianceMatrix(covTrc);
2086  vtSPD->GetCovarianceMatrix(covSPD);
2087 
2088  double dz = vtTrc->GetZ() - vtSPD->GetZ();
2089 
2090  double errTot = TMath::Sqrt(covTrc[5]+covSPD[5]);
2091  double errTrc = TMath::Sqrt(covTrc[5]);
2092  double nsigTot = dz/errTot;
2093  double nsigTrc = dz/errTrc;
2094 
2095  if (TMath::Abs(dz)>0.2 || TMath::Abs(nsigTot)>10 || TMath::Abs(nsigTrc)>20) {
2096  fPileUpCount->Fill(6.5);
2097  BisPileup=kTRUE;
2098  }
2099 
2100  // cuts on tracks
2101  const Int_t nTracks = aod->GetNumberOfTracks();
2102  Int_t multEsd = ((AliAODHeader*)aod->GetHeader())->GetNumberOfESDTracks();
2103 
2104  Int_t multTrk = 0;
2105  Int_t multTrkBefC = 0;
2106  Int_t multTrkTOFBefC = 0;
2107  Int_t multTPC = 0;
2108 
2109  for (Int_t it = 0; it < nTracks; it++) {
2110 
2111  AliAODTrack* aodTrk = (AliAODTrack*)aod->GetTrack(it);
2112  if (!aodTrk){
2113  delete aodTrk;
2114  continue;
2115  }
2116 
2117  // if (aodTrk->TestFilterBit(32)){
2118  // multTrkBefC++;
2119  //
2120  // if ( TMath::Abs(aodTrk->GetTOFsignalDz()) <= 10. && aodTrk->GetTOFsignal() >= 12000. && aodTrk->GetTOFsignal() <= 25000.)
2121  // multTrkTOFBefC++;
2122  //
2123  // if ((TMath::Abs(aodTrk->Eta()) < 0.8) && (aodTrk->GetTPCNcls() >= 70) && (aodTrk->Pt() >= 0.2) && (aodTrk->Pt() < 20.))
2124  // multTrk++;
2125  // }
2126 
2127  if (aodTrk->TestFilterBit(128))
2128  multTPC++;
2129 
2130  if (centrV0M<10. && aodTrk->TestFilterBit(768) && aodTrk->Pt()>0.2) {
2131 
2132  // cut on # TPC clusters
2133  Int_t ntpccls = aodTrk->GetTPCNcls();
2134  fQATrackTPCNcls->Fill(aodTrk->Phi(),aodTrk->Eta(),ntpccls);
2135 
2136  // cut on # ITS clusters
2137  Int_t nitscls = aodTrk->GetITSNcls();
2138  fQATrackITSNcls->Fill(aodTrk->Phi(),aodTrk->Eta(),nitscls);
2139 
2140  // cut on chi2 / # TPC clusters
2141  Double_t chi2tpc = 0.;
2142  if(ntpccls>0) {
2143  chi2tpc = aodTrk->Chi2perNDF();
2144  }
2145  fQATrackTPCchi2->Fill(aodTrk->Phi(),aodTrk->Eta(),chi2tpc);
2146 
2147  // cut on chi2 / # ITS clusters
2148  Double_t chi2its = 0.;
2149  if(nitscls>0) {
2150  chi2its = aodTrk->GetITSchi2()/aodTrk->GetITSNcls();
2151  }
2152  fQATrackITSchi2->Fill(aodTrk->Phi(),aodTrk->Eta(),chi2its);
2153 
2154  // cut on fraction shared TPC clusters
2155  Double_t fshtpccls = 0.;
2156  if(ntpccls>0) {
2157  Int_t ntpcclsS = aodTrk->GetTPCnclsS();
2158  fshtpccls = 1.*ntpcclsS/ntpccls;
2159  }
2160  fQATrackTPCScls->Fill(aodTrk->Phi(),aodTrk->Eta(),fshtpccls);
2161 
2162  // cut on fraction shared ITS clusters
2163  Double_t fshitscls = 0.;
2164  Int_t nshcl = 0;
2165  if(nitscls>0) {
2166  for (Int_t i=0; i<6; i++) {
2167  if(aodTrk->HasSharedPointOnITSLayer(i)) nshcl++;
2168  }
2169  fshitscls = 1.*nshcl/nitscls;
2170  }
2171  fQATrackITSScls->Fill(aodTrk->Phi(),aodTrk->Eta(),fshitscls);
2172 
2173  }
2174 
2175  } // end of for (Int_t it = 0; it < nTracks; it++)
2176 
2177  Double_t multTPCn = multTPC;
2178  Double_t multEsdn = multEsd;
2179  Double_t multESDTPCDif = multEsdn - multTPCn*3.38;
2180 
2181  if (multESDTPCDif > (fRejectPileUpTight?700.:15000.)) {
2182  fPileUpCount->Fill(7.5);
2183  BisPileup=kTRUE;
2184  }
2185 
2186  if(fRejectPileUpTight) {
2187  if(BisPileup==kFALSE) {
2188  if(!fMultSelection->GetThisEventIsNotPileup()) BisPileup=kTRUE;
2189  if(!fMultSelection->GetThisEventIsNotPileupMV()) BisPileup=kTRUE;
2190  if(!fMultSelection->GetThisEventIsNotPileupInMultBins()) BisPileup=kTRUE;
2191  if(!fMultSelection->GetThisEventHasNoInconsistentVertices()) BisPileup=kTRUE;
2192  if(!fMultSelection->GetThisEventPassesTrackletVsCluster()) BisPileup=kTRUE;
2193  if(!fMultSelection->GetThisEventIsNotIncompleteDAQ()) BisPileup=kTRUE;
2194  if(!fMultSelection->GetThisEventHasGoodVertex2016()) BisPileup=kTRUE;
2195  if(BisPileup) fPileUpCount->Fill(8.5);
2196  }
2197  }
2198  }
2199  }
2200 
2201 
2202  return BisPileup;
2203 }
2204 
2205 //________________________________________________________________________
2206 
2208 {
2209  Double_t EtC = BadTowerCalibHist->ProjectionY("",BadTowerCalibHist->GetXaxis()->FindBin(Et),BadTowerCalibHist->GetXaxis()->FindBin(Et))->GetRandom();
2210  return EtC;
2211 }
2212 
2213 //________________________________________________________________________
2214 
2216 {
2217  Int_t CenBin=-1;
2218  if (Centrality>0. && Centrality<5.) CenBin=0;
2219  if (Centrality>5. && Centrality<10.) CenBin=1;
2220  if (Centrality>10. && Centrality<20.) CenBin=2;
2221  if (Centrality>20. && Centrality<30.) CenBin=3;
2222  if (Centrality>30. && Centrality<40.) CenBin=4;
2223  if (Centrality>40. && Centrality<50.) CenBin=5;
2224  if (Centrality>50. && Centrality<60.) CenBin=6;
2225  if (Centrality>60. && Centrality<70.) CenBin=7;
2226  if (Centrality>70. && Centrality<80.) CenBin=8;
2227  if (Centrality>80. && Centrality<90.) CenBin=9;
2228  if (CenBin>=fnCen) CenBin=-1;
2229  if (fnCen==1) CenBin=0;
2230  return CenBin;
2231 } // end of AliFlowAnalysisCRC::GetCRCCenBin(Double_t Centrality)
2232 //_____________________________________________________________________________
2233 
2234 Double_t AliAnalysisTaskCRCZDC::GetWDist(const AliVVertex* v0, const AliVVertex* v1)
2235 {
2236  // calculate sqrt of weighted distance to other vertex
2237  if (!v0 || !v1) {
2238  printf("One of vertices is not valid\n");
2239  return 0;
2240  }
2241  static TMatrixDSym vVb(3);
2242  double dist = -1;
2243  double dx = v0->GetX()-v1->GetX();
2244  double dy = v0->GetY()-v1->GetY();
2245  double dz = v0->GetZ()-v1->GetZ();
2246  double cov0[6],cov1[6];
2247  v0->GetCovarianceMatrix(cov0);
2248  v1->GetCovarianceMatrix(cov1);
2249  vVb(0,0) = cov0[0]+cov1[0];
2250  vVb(1,1) = cov0[2]+cov1[2];
2251  vVb(2,2) = cov0[5]+cov1[5];
2252  vVb(1,0) = vVb(0,1) = cov0[1]+cov1[1];
2253  vVb(0,2) = vVb(1,2) = vVb(2,0) = vVb(2,1) = 0.;
2254  vVb.InvertFast();
2255  if (!vVb.IsValid()) {printf("Singular Matrix\n"); return dist;}
2256  dist = vVb(0,0)*dx*dx + vVb(1,1)*dy*dy + vVb(2,2)*dz*dz
2257  + 2*vVb(0,1)*dx*dy + 2*vVb(0,2)*dx*dz + 2*vVb(1,2)*dy*dz;
2258  return dist>0 ? TMath::Sqrt(dist) : -1;
2259 }
2260 //________________________________________________________________________
2261 
2263 {
2264  // check for multi-vertexer pile-up
2265 
2266  const int kMinPlpContrib = 5;
2267  const double kMaxPlpChi2 = 5.0;
2268  const double kMinWDist = 15;
2269 
2270  const AliVVertex* vtPrm = 0;
2271  const AliVVertex* vtPlp = 0;
2272  int nPlp = 0;
2273 
2274  if ( !(nPlp=aod->GetNumberOfPileupVerticesTracks()) ) return kFALSE;
2275  vtPrm = aod->GetPrimaryVertex();
2276  if (vtPrm == aod->GetPrimaryVertexSPD()) return kTRUE; // there are pile-up vertices but no primary
2277 
2278  //int bcPrim = vtPrm->GetBC();
2279 
2280  for (int ipl=0;ipl<nPlp;ipl++) {
2281  vtPlp = (const AliVVertex*)aod->GetPileupVertexTracks(ipl);
2282  //
2283  if (vtPlp->GetNContributors() < kMinPlpContrib) continue;
2284  if (vtPlp->GetChi2perNDF() > kMaxPlpChi2) continue;
2285  // int bcPlp = vtPlp->GetBC();
2286  // if (bcPlp!=AliVTrack::kTOFBCNA && TMath::Abs(bcPlp-bcPrim)>2) return kTRUE; // pile-up from other BC
2287  //
2288  double wDst = GetWDist(vtPrm,vtPlp);
2289  if (wDst<kMinWDist) continue;
2290  //
2291  return kTRUE; // pile-up: well separated vertices
2292  }
2293 
2294  return kFALSE;
2295 }
2296 
2297 //________________________________________________________________________
2299  fCutContainer->AddAt(cutsRP,0); fCutsRP=cutsRP; cutsRP->SetPOItype(0);
2300 }
2301 
2302 //________________________________________________________________________
2304  fCutContainer->AddAt(cutsPOI,1); fCutsPOI=cutsPOI; cutsPOI->SetPOItype(1);
2305 }
2306 
2307 //________________________________________________________________________
2309 {
2310  // Terminate analysis
2311  //
2312  /* if(fDebug > 1) printf(" **** AliAnalysisTaskCRCZDC::Terminate() \n");
2313 
2314  //fOutput = dynamic_cast<TList*> (GetOutputData(1));
2315  //if(!fOutput) printf("ERROR: fOutput not available\n");
2316  */
2317 }
void SetCharge(Int_t charge)
TH2F * fhZDCCvsZDCCA
ZNC vs ZNA;.
static const Int_t fkVZEROnQAplots
TH2F * fhZNvsVZERO
ZNC+ZNA vs ZPC+ZPA;.
TH1F * fPtSpecFB128[2][10]
PtSpecRec FB96.
void SetPOItype(Int_t poiType, Bool_t b=kTRUE)
void FindDaughters(Bool_t keepDaughtersInRPselection=kFALSE)
TH3D * fhZNSpectraCor
ZNA vs. centrality.
const Color_t cc[]
Definition: DrawKs.C:1
virtual void SetV02Qsub(Double_t QVCx, Double_t QVCy, Double_t MC, Double_t QVAx, Double_t QVAy, Double_t MA, Int_t har)
double Double_t
Definition: External.C:58
void SetEta(Double_t eta)
TH1F * fPileUpCount
centrality distribution
Int_t fRunList[fCRCMaxnRun]
Definition: External.C:236
static const Int_t fCRCnTow
TH1F * fhZNCPMQiPMC[4]
ZNA PM high res.
void SetZNCQ0(Double_t const en)
TH2F * fhZNCvsZPC
ZDCC vs ZDCCA.
static const Int_t fkVZEROnHar
Int_t GetNumberOfRPs() const
virtual void SetZDC2Qsub(Double_t *QVC, Double_t MC, Double_t *QVA, Double_t MA)
void AddFlow(Double_t v1, Double_t v2, Double_t v3, Double_t v4, Double_t v5)
Int_t GetReferenceMultiplicity(AliVEvent *event, AliMCEvent *mcEvent)
centrality
void Set(const AliVParticle *p)
void SetZPAEnergy(Double_t const en)
TH2F * fhZNCvsAsymm
ZNA vs asymmetry.
void SetMCReactionPlaneAngle(const AliMCEvent *mcEvent)
TH3D * fhZNCenDis[2]
ZDC vs VZERO;.
void SetCutsPOI(AliFlowTrackCuts *cutsPOI)
void SetZNAQ0(Double_t const en)
TH1F * fPtSpecFB768[2][10]
PtSpecRec FB128.
TH1F * fPtSpecGen[2][10]
list with pt spectra
virtual void UserExec(Option_t *option)
void SetHistWeightvsPhiMax(Double_t d)
TCanvas * c
Definition: TestFitELoss.C:172
TH2F * fhZNCvscentrality
ZNC vs asymmetry.
void SetZNAEnergy(Double_t const en)
void AddTrack(AliFlowTrackSimple *track)
void SetReferenceMultiplicity(Int_t m)
virtual Int_t GetCenBin(Double_t Centrality)
void SetCutsRP(AliFlowTrackCuts *cutsRP)
TRandom * gRandom
TH3D * fTrackQADCAxy[fKNFBs][4]
TH2F * fhZNCvsZNA
PMQi/PMC for ZNA.
TH1F * fhAsymm
ZN centroid vs centrality.
void SetCentralityCL1(Double_t c)
virtual void SetVertexPosition(Double_t *pos)
void IncrementNumberOfPOIs(Int_t poiType=1)
TList * GetQA() const
TH3D * fhZNBCCorr
ZNA vs. centrality.
void SetForRPSelection(Bool_t b=kTRUE)
const Double_t etamin
void Fill(AliFlowTrackCuts *rpCuts, AliFlowTrackCuts *poiCuts)
TH2F * fhZNAvsZPA
ZNC vs ZPC;.
int Int_t
Definition: External.C:63
TH1F * fhZNAPM[5]
ZNC PM high res.
TProfile3D * fVZEROQVectorRecQxStored[fkVZEROnHar]
TF1 * fMultTOFLowCut
centrality distribution
unsigned int UInt_t
Definition: External.C:33
void SetShuffleTracks(Bool_t b)
float Float_t
Definition: External.C:68
AliMultSelection * fMultSelection
void SetNITSCL1(Double_t c)
Definition: External.C:252
Definition: External.C:228
virtual void UserCreateOutputObjects()
Definition: External.C:212
static AliFlowCommonConstants * GetMaster()
TH3D * fhZNSpectra
ZNA vs. centrality.
AliFlowEventCuts * fCutsEvent
const Double_t ptmin
void SetAbsOrbit(UInt_t const en)
TH1F * fPileUpMultSelCount
centrality distribution
Double_t GetCentrality() const
Bool_t fUseTowerEq
MultSelection (RUN2 centrality estimator)
Bool_t plpMV(const AliAODEvent *aod)
void SetCentrality(Double_t c)
AliFlowTrackCuts * fCutsPOI
void SetRun(Int_t const run)
void SetSource(trackSource s)
Definition: AliFlowTrack.h:37
TH2F * fhZPAvscentrality
ZNC vs. centrality.
void SetPhi(Double_t phi)
TProfile3D * fVZEROQVectorRecQyStored[fkVZEROnHar]
short Short_t
Definition: External.C:23
void DefineDeadZone(Double_t etaMin, Double_t etaMax, Double_t phiMin, Double_t phiMax)
AliGenEventHeader * fGenHeader
void SetPt(Double_t pt)
TProfile2D * fTrackQADphi[fKNFBs][4]
TProfile * fZNCTower[fCRCMaxnRun][fCRCnTow]
Q Vectors list per run.
TList * fCRCQVecListRun[fCRCMaxnRun]
Run list.
void SetZNCEnergy(Double_t const en)
virtual void Terminate(Option_t *option)
TProfile * fZNATower[fCRCMaxnRun][fCRCnTow]
ZNC tower spectra.
void SetEvent(AliVEvent *event, AliMCEvent *mcEvent=NULL)
TH2F * fhZPCvscentrality
ZNA vs. centrality.
Bool_t IsSetMCReactionPlaneAngle() const
TClonesArray * fStack
ZNA tower spectra.
TList * GetQA() const
TH2D * fTrackQApT[fKNFBs][4]
TProfile2D * fVZEROQVectorRecFinal[fkVZEROnHar][fkVZEROnQAplots]
static const Int_t fCRCMaxnRun
Double_t GetBadTowerResp(Double_t Et, TH2D *BadTowerCalibHist)
TH3D * fQATrackTPCNcls
ZNA vs. centrality.
void SetForPOISelection(Bool_t b=kTRUE)
void SetHistWeightvsPhiMin(Double_t d)
TH1F * fhZNAPMQiPMC[4]
PMQi/PMC for ZNC.
void AddV2(Double_t v2)
TH3D * fTrackQADCAz[fKNFBs][4]
TH2F * fhZDCvsVZERO
ZN vs VZERO;.
void TagSubeventsInEta(Double_t etaMinA, Double_t etaMaxA, Double_t etaMinB, Double_t etaMaxB)
void SetZPCEnergy(Double_t const en)
unsigned short UShort_t
Definition: External.C:28
TH1F * fPtSpecFB96[2][10]
PtSpecRec FB32.
TH3D * fhZNSpectraPow
ZNA vs. centrality.
const char Option_t
Definition: External.C:48
TH2F * fhZNAvsAsymm
ZN asymmetry.
TH2F * fhZNAvscentrality
ZNC vs. centrality.
bool Bool_t
Definition: External.C:53
virtual Bool_t IsSelected(TObject *obj, TObject *objmc)
TH1F * fPtSpecFB32[2][10]
PtSpecGen.
TH1F * fhZNCPM[5]
list send on output slot 0
void SetCentralityTRK(Double_t c)
Double_t GetWDist(const AliVVertex *v0, const AliVVertex *v1)
Bool_t SelectPileup(AliAODEvent *aod)
Bool_t fCutTPC
PtSpecRec FB768.
AliFlowTrackCuts * fCutsRP
void InsertTrack(AliFlowTrack *)
virtual void ClearFast()
Bool_t fUseBadTowerCalib
list for storing calib files
AliAnalysisUtils * fAnalysisUtil
Event selection.
TH2F * fhZNvsZP
ZNA vs ZPA;.
AliGenHijingEventHeader * fHijingGenHeader
const Double_t phimin
AliGenPythiaEventHeader * fPythiaGenHeader
Int_t NumberOfTracks() const