AliPhysics  58f3d52 (58f3d52)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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  // reconstructed
1245  for(Int_t jTracks = 0; jTracks<aod->GetNumberOfTracks(); jTracks++){
1246 
1247  AliAODTrack* track = (AliAODTrack*)aod->GetTrack(jTracks);
1248  if(!track) continue;
1249 
1250  // to select primaries
1251  Int_t lp = TMath::Abs(track->GetLabel());
1252 
1253  // general kinematic cuts
1254  if (track->Pt() < .2 || track->Pt() > 20. || TMath::Abs(track->Eta()) > 0.8) continue;
1255 
1256  // cut on DCA
1257  Double_t DCAxy = track->DCA();
1258  Double_t DCAz = track->ZAtDCA();
1259  if(fabs(DCAxy)>2.4 || fabs(DCAz)>3.2) continue;
1260 
1261  // various cuts on TPC clusters
1262  if (track->GetTPCNcls() < 70) continue;
1263  Double_t chi2_per_tpc = track->Chi2perNDF();
1264  if (chi2_per_tpc < 0.1 || chi2_per_tpc > 4.) continue;
1265  Double_t fraction_shared_tpccls = 1.*track->GetTPCnclsS()/track->GetTPCncls();
1266  if (fraction_shared_tpccls > 0.4) continue;
1267 
1268  // test filter bits
1269  if (((AliAODMCParticle*)fStack->At(lp))->IsPhysicalPrimary()) {
1270  if (track->TestFilterBit(32)) fPtSpecFB32[0][CenBin]->Fill(track->Pt());
1271  if (track->TestFilterBit(96)) fPtSpecFB96[0][CenBin]->Fill(track->Pt());
1272  if (track->TestFilterBit(128)) fPtSpecFB128[0][CenBin]->Fill(track->Pt());
1273  if (track->TestFilterBit(768)) fPtSpecFB768[0][CenBin]->Fill(track->Pt());
1274  } else {
1275  if (track->TestFilterBit(32)) fPtSpecFB32[1][CenBin]->Fill(track->Pt());
1276  if (track->TestFilterBit(96)) fPtSpecFB96[1][CenBin]->Fill(track->Pt());
1277  if (track->TestFilterBit(128)) fPtSpecFB128[1][CenBin]->Fill(track->Pt());
1278  if (track->TestFilterBit(768)) fPtSpecFB768[1][CenBin]->Fill(track->Pt());
1279  }
1280 
1281  }
1282 
1283  // generated (physical primaries)
1284 
1285  for(Int_t jTracks = 0; jTracks<fStack->GetEntriesFast(); jTracks++) {
1286  AliAODMCParticle *MCpart = (AliAODMCParticle*)fStack->At(jTracks);
1287  if (!MCpart) {
1288  printf("ERROR: Could not receive MC track %d\n", jTracks);
1289  continue;
1290  }
1291 
1292  // kinematic cuts
1293  if ( MCpart->Pt() < .2 || MCpart->Pt() > 20. || TMath::Abs(MCpart->Eta()) > .8 ) continue;
1294  // select charged primaries
1295  if ( MCpart->Charge() == 0. || !MCpart->IsPhysicalPrimary()) continue;
1296 
1297  fPtSpecGen[0][CenBin]->Fill(MCpart->Pt());
1298  }
1299 
1300  // fGenHeader = McEvent->GenEventHeader();
1301  // if(fGenHeader) fPythiaGenHeader = dynamic_cast<AliGenPythiaEventHeader*>(fGenHeader);
1302  // printf("#reconstructed : %d (rejected from cuts %d), #MC primaries : %d (rejected from cuts %d) \n",AODPOIs,AODbads,MCPrims,MCSecos);
1303  fFlowEvent->SetReferenceMultiplicity(aod->GetNumberOfTracks());
1304  fFlowEvent->SetCentrality(centr);
1305  // if (McEvent && McEvent->GenEventHeader()) fFlowEvent->SetMCReactionPlaneAngle(McEvent);
1306  fFlowEvent->SetRun(RunNum);
1307  // printf("Run : %d, RefMult : %d, Cent : %f \n",fFlowEvent->GetRun(),fFlowEvent->GetReferenceMultiplicity(),fFlowEvent->GetCentrality());
1308  }
1309 
1310  if(fAnalysisType == kMCESD) {
1311 
1312  fFlowEvent->ClearFast();
1313 
1314  if(!esd) {
1315  AliError("ERROR: Could not retrieve ESDEvent");
1316  return;
1317  }
1318  if(!McEvent) {
1319  AliError("ERROR: Could not retrieve MCEvent");
1320  return;
1321  }
1322  AliStack* fStack = fMCEvent->Stack();
1323  if(!fStack) {
1324  AliError("ERROR: Could not retrieve MCStack");
1325  return;
1326  }
1327 
1328  AliESDVertex *vertex = (AliESDVertex*) esd->GetPrimaryVertex();
1329  if (!vertex) return;
1330  if (TMath::Abs(vertex->GetZ()) > 10. ) return;
1331  if (vertex->GetNContributors() < 1 ) return;
1332  AliCentrality *centrality = esd->GetCentrality();
1333  if (!centrality) return;
1334  Double_t centr = centrality->GetCentralityPercentile("V0M");
1335  if (centr<fCentrLowLim || centr>=fCentrUpLim ) return;
1336  Int_t CenBin = -1;
1337  if (centr>0. && centr<5.) CenBin=0;
1338  if (centr>5. && centr<10.) CenBin=1;
1339  if (centr>10. && centr<20.) CenBin=2;
1340  if (centr>20. && centr<30.) CenBin=3;
1341  if (centr>30. && centr<40.) CenBin=4;
1342  if (centr>40. && centr<50.) CenBin=5;
1343  if (centr>50. && centr<60.) CenBin=6;
1344  if (centr>60. && centr<70.) CenBin=7;
1345  if (centr>70. && centr<80.) CenBin=8;
1346  if (centr>80. && centr<90.) CenBin=9;
1347  if(CenBin==-1) return;
1348 
1349  //Generated
1350  Int_t MCPrims = 0;
1351  for ( Int_t i=0 ; i<fStack->GetNtrack() ; i++ ) {
1352 
1353  //Primaries Selection
1354  TParticle *particle = (TParticle*)fStack->Particle(i);
1355  if (!particle) continue;
1356  if (!fStack->IsPhysicalPrimary(i)) continue;
1357  if ( particle->GetPDG()->Charge() == 0.) continue;
1358 
1359  //Kinematic Cuts
1360  if ( particle->Pt()<0.2 || particle->Pt()>10. ) continue;
1361  if ( TMath::Abs(particle->Eta())>0.8 ) continue;
1362 
1363  fFlowTrack->SetPhi(particle->Phi());
1364  fFlowTrack->SetEta(particle->Eta());
1365  fFlowTrack->SetPt(particle->Pt());
1367  fFlowTrack->SetForRPSelection(kTRUE);
1369  fFlowTrack->SetForPOISelection(kFALSE);
1371  MCPrims++;
1372 
1373  fPtSpecGen[0][CenBin]->Fill(particle->Pt());
1374 
1375  }
1376 
1377  //Reconstructed
1378  Int_t ESDPrims = 0;
1379  for (Int_t i=0 ; i<esd->GetNumberOfTracks() ; i++) {
1380 
1381  //Get reconstructed track
1382  AliVTrack *vtrack = static_cast<AliVTrack*>(esd->GetTrack(i));
1383  AliESDtrack *track = dynamic_cast<AliESDtrack*>(vtrack);
1384  if (!track) continue;
1385 
1386  //Primaries selection
1387  Int_t lp = TMath::Abs(track->GetLabel());
1388  if (!fStack->IsPhysicalPrimary(lp)) continue;
1389  TParticle *particle = (TParticle*)fStack->Particle(lp);
1390  if (!particle) continue;
1391  if (particle->GetPDG()->Charge() == 0.) continue;
1392 
1393  // if(!fCutsPOI->PassesESDcuts(track)) continue;
1394 
1395  Bool_t pass = kTRUE;
1396 
1397  if(fCutTPC) {
1398  // printf("******* cutting TPC ******** \n");
1399  UShort_t ntpccls = track->GetTPCNcls();
1400  Double_t tpcchi2 = track->GetTPCchi2();
1401  if (tpcchi2<0.2 || tpcchi2 >=4.) {
1402  // printf("TPCchi2 : %e %e ",tpcchi2,track->GetTPCchi2Iter1());
1403  pass=kFALSE;
1404  }
1405  if (ntpccls < 70) {
1406  // printf("#TPCcluster : %u %u %u %u ",ntpccls,track->GetTPCNclsF(),track->GetTPCNclsFIter1(),track->GetTPCNclsIter1());
1407  pass=kFALSE;
1408  }
1409  }
1410 
1411  Float_t dcaxy=0.0;
1412  Float_t dcaz=0.0;
1413  track->GetImpactParameters(dcaxy,dcaz);
1414  if (dcaxy > 0.3 || dcaz > 0.3) {
1415  // printf("DCA : %e %e ",dcaxy,dcaz);
1416  pass=kFALSE;
1417  }
1418  if(!pass) continue;
1419 
1420  //Kinematic Cuts
1421  if ( track->Pt()<0.2 || track->Pt()>10. ) continue;
1422  if ( TMath::Abs(track->Eta())>0.8 ) continue;
1423 
1424  fFlowTrack->SetPhi(track->Phi());
1425  fFlowTrack->SetEta(track->Eta());
1426  fFlowTrack->SetPt(track->Pt());
1428  fFlowTrack->SetForRPSelection(kFALSE);
1432  ESDPrims++;
1433 
1434  }
1435 
1436  // printf("#reconstructed : %d , #MC primaries : %d \n",ESDPrims,MCPrims);
1437  fFlowEvent->SetReferenceMultiplicity(esd->GetNumberOfTracks());
1438  fFlowEvent->SetCentrality(centr);
1439  if (McEvent && McEvent->GenEventHeader()) fFlowEvent->SetMCReactionPlaneAngle(McEvent);
1440  fFlowEvent->SetRun(esd->GetRunNumber());
1441  // printf("Run : %d, RefMult : %d, Cent : %f \n",fFlowEvent->GetRun(),fFlowEvent->GetReferenceMultiplicity(),fFlowEvent->GetCentrality());
1442 
1443  } // end of if(fAnalysisType == kMCESD)
1444 
1445  if(fAnalysisType == kMCkine) {
1446 
1447  fFlowEvent->ClearFast();
1448 
1449  AliInputEventHandler* McHandler = dynamic_cast<AliInputEventHandler*> (AliAnalysisManager::GetAnalysisManager()->GetMCtruthEventHandler());
1450  if(!McHandler) {
1451  AliError("ERROR: Could not retrieve MCtruthEventHandler");
1452  return;
1453  }
1454  McEvent = McHandler->MCEvent();
1455  if(!McEvent) {
1456  AliError("ERROR: Could not retrieve MC event");
1457  return;
1458  }
1459 
1460  Int_t nTracks = McEvent->GetNumberOfTracks();
1461  // Int_t nPrimTr = McEvent->GetNumberOfPrimaries();
1462 
1463  //loop over tracks
1464  for (Int_t itrkN=0; itrkN<nTracks; itrkN++) {
1465  //get input particle
1466  AliMCParticle* pParticle = dynamic_cast<AliMCParticle*>(McEvent->GetTrack(itrkN));
1467  if (!pParticle) continue;
1468 
1469  //check if track passes the cuts
1470  if (McEvent->IsPhysicalPrimary(itrkN) && pParticle->Charge()!=0) {
1471  fFlowTrack->Set(pParticle);
1473  fFlowTrack->SetForRPSelection(kTRUE);
1478  }
1479  }// for all tracks
1480 
1481  // if monte carlo event get reaction plane from monte carlo (depends on generator)
1482  if (McEvent && McEvent->GenEventHeader()) fFlowEvent->SetMCReactionPlaneAngle(McEvent);
1483  // set reference multiplicity
1484  fFlowEvent->SetReferenceMultiplicity(McEvent->GetNumberOfTracks());
1485  // tag subevents
1487  // set centrality from impact parameter
1488  Double_t ImpPar=0., CenPer=0.;
1489  fGenHeader = McEvent->GenEventHeader();
1490  if(fGenHeader){
1491  fPythiaGenHeader = dynamic_cast<AliGenPythiaEventHeader*>(fGenHeader);
1492  if(fPythiaGenHeader) ImpPar = fPythiaGenHeader->GetImpactParameter();
1493  fHijingGenHeader = dynamic_cast<AliGenHijingEventHeader*>(fGenHeader);
1494  if(fHijingGenHeader) ImpPar = fHijingGenHeader->ImpactParameter();
1495  if(ImpPar) CenPer = 0.3859796743103508*pow(ImpPar,2.);
1496  if(CenPer>0. && CenPer<100.) fFlowEvent->SetCentrality(CenPer);
1497  else return;
1498  fFlowEvent->SetRun(1);
1499  }
1500 
1501  } // end of if(fAnalysisType == kMCkine)
1502 
1503  if (!fFlowEvent) return; //shuts up coverity
1504 
1505  //check final event cuts
1506  Int_t mult = fFlowEvent->NumberOfTracks();
1507  // AliInfo(Form("FlowEvent has %i tracks",mult));
1508  if (mult<fMinMult || mult>fMaxMult) {
1509  AliWarning("FlowEvent cut on multiplicity"); return;
1510  }
1511 
1512  //define dead zone
1514 
1517  if (fAfterburnerOn)
1518  {
1519  //if reaction plane not set from elsewhere randomize it before adding flow
1521  fFlowEvent->SetMCReactionPlaneAngle(gRandom->Uniform(0.0,TMath::TwoPi()));
1522 
1523  if(fDifferentialV2)
1525  else
1526  fFlowEvent->AddFlow(fV1,fV2,fV3,fV4,fV5); //add flow
1527  fFlowEvent->CloneTracks(fNonFlowNumberOfTrackClones); //add nonflow by cloning tracks
1528  }
1530 
1531  //tag subEvents
1533 
1534  //do we want to serve shullfed tracks to everybody?
1536 
1537  // associate the mother particles to their daughters in the flow event (if any)
1539 
1540  //fListHistos->Print();
1541  //fOutputFile->WriteObject(fFlowEvent,"myFlowEventSimple");
1542 
1543  //********************************************************************************************************************************
1544 
1546 
1547  // PHYSICS SELECTION
1548  AliAnalysisManager *am = AliAnalysisManager::GetAnalysisManager();
1549  AliInputEventHandler *hdr = (AliInputEventHandler*)am->GetInputEventHandler();
1550 
1551  if(hdr->IsEventSelected()==0 && !head->InheritsFrom("AliNanoAODStorage")) return;
1552  //if(hdr->IsEventSelected() && AliVEvent::kAny) {
1553 
1554  Double_t centrperc = fFlowEvent->GetCentrality();
1555  Int_t cenb = (Int_t)centrperc;
1556 
1557  Int_t nTracklets ;
1558  if(!head->InheritsFrom("AliNanoAODStorage")){
1559  AliAODTracklets *trackl = aod->GetTracklets();
1560  nTracklets = trackl->GetNumberOfTracklets();
1561  }else{
1562  AliNanoAODHeader *nanoAodHeader = (AliNanoAODHeader*) head;
1563  nTracklets = nanoAodHeader->GetVar(nanoAodHeader->GetVarIndex("cstNTrackelets"));
1564  }
1565 
1566 
1567  // get VZERO data
1568  AliAODVZERO *vzeroAOD = aod->GetVZEROData();
1569  Double_t multV0A = vzeroAOD->GetMTotV0A();
1570  Double_t multV0C = vzeroAOD->GetMTotV0C();
1571 
1572  // set VZERO Q-vectors
1573  if(fDataSet==k2015 || fDataSet==k2015v6) {
1574  Int_t CachednRing = 1;
1575  Double_t QxTot[fkVZEROnHar] = {0.}, QyTot[fkVZEROnHar] = {0.};
1576  Double_t denom = 0.;
1577  Double_t V0TotQC[fkVZEROnHar][2] = {{0.}}, V0TotQA[fkVZEROnHar][2] = {{0.}};
1578  Double_t MultC[fkVZEROnHar] = {0.}, MultA[fkVZEROnHar] = {0.};
1579 
1580  for(Int_t i=0; i<64; i++) {
1581 
1582  // correct multiplicity per channel
1583  Double_t mult = vzeroAOD->GetMultiplicity(i);
1584  if(fVZEROGainEqHist) {
1585  Double_t EqFactor = fVZEROGainEqHist->GetBinContent(RunBin+1,i+1);
1586  if(EqFactor>0.) mult *= EqFactor;
1587  }
1588  fVZEROMult->Fill(RunBin+0.5,i+0.5,mult);
1589 
1590  // build Q-vector per ring
1591  Int_t nRing = (Int_t)i/8 + 1;
1592  Double_t ChPhi = TMath::PiOver4()*(0.5+i%8);
1593 
1594  if(i == 63) {
1595  for (Int_t k=0; k<fkVZEROnHar; k++) {
1596  QxTot[k] += mult*TMath::Cos((k+1.)*ChPhi);
1597  QyTot[k] += mult*TMath::Sin((k+1.)*ChPhi);
1598  }
1599  denom += mult;
1600  nRing++;
1601  }
1602 
1603  if(nRing!=CachednRing) {
1604  for (Int_t k=0; k<fkVZEROnHar; k++) {
1605  Double_t QxRec = QxTot[k]/denom;
1606  Double_t QyRec = QyTot[k]/denom;
1607  // store values for re-centering
1608  // fVZEROQVectorRecQx[k]->Fill(RunBin+0.5,centrperc,CachednRing-0.5,QxRec);
1609  // fVZEROQVectorRecQy[k]->Fill(RunBin+0.5,centrperc,CachednRing-0.5,QyRec);
1610  // do re-centering
1611  if(fVZEROQVectorRecQxStored[k]) {
1612  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));
1613  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));
1614  }
1615  // sum of Q-vectors over all rings (total V0 Q-vector)
1616  if (CachednRing >= fMinRingVZC && CachednRing <= fMaxRingVZC) {
1617  V0TotQC[k][0] += QxRec*denom;
1618  V0TotQC[k][1] += QyRec*denom;
1619  MultC[k] += denom;
1620  }
1621  if (CachednRing >= fMinRingVZA && CachednRing <= fMaxRingVZA) {
1622  V0TotQA[k][0] += QxRec*denom;
1623  V0TotQA[k][1] += QyRec*denom;
1624  MultA[k] += denom;
1625  }
1626  QxTot[k] = 0.;
1627  QyTot[k] = 0.;
1628  }
1629  denom = 0.;
1630  CachednRing = nRing;
1631  }
1632  for (Int_t k=0; k<fkVZEROnHar; k++) {
1633  QxTot[k] += mult*TMath::Cos((k+1.)*ChPhi);
1634  QyTot[k] += mult*TMath::Sin((k+1.)*ChPhi);
1635  }
1636  denom += mult;
1637  }
1638 
1639  for (Int_t k=0; k<fkVZEROnHar; k++) {
1640  if(MultC[k]>0. && MultA[k]>0.) {
1641  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];
1642  if(!std::isnan(QCx) && !std::isnan(QCy) && !std::isnan(QAx) && !std::isnan(QAy)) {
1643  fFlowEvent->SetV02Qsub(QCx,QCy,MultC[k],QAx,QAy,MultA[k],k+1);
1644  fVZEROQVectorRecFinal[k][0]->Fill(RunBin+0.5,centrperc,QCx);
1645  fVZEROQVectorRecFinal[k][1]->Fill(RunBin+0.5,centrperc,QCy);
1646  fVZEROQVectorRecFinal[k][2]->Fill(RunBin+0.5,centrperc,QAx);
1647  fVZEROQVectorRecFinal[k][3]->Fill(RunBin+0.5,centrperc,QAy);
1648  fVZEROQVectorRecFinal[k][4]->Fill(RunBin+0.5,centrperc,QCx*QAx);
1649  fVZEROQVectorRecFinal[k][5]->Fill(RunBin+0.5,centrperc,QCy*QAy);
1650  fVZEROQVectorRecFinal[k][6]->Fill(RunBin+0.5,centrperc,QCx*QAy);
1651  fVZEROQVectorRecFinal[k][7]->Fill(RunBin+0.5,centrperc,QCy*QAx);
1652  } else {
1653  fFlowEvent->SetV02Qsub(0.,0.,0.,0.,0.,0.,k+1);
1654  }
1655  } else {
1656  fFlowEvent->SetV02Qsub(0.,0.,0.,0.,0.,0.,k+1);
1657  }
1658  }
1659  }
1660 
1661 // AliAODForwardMult* aodForward = static_cast<AliAODForwardMult*>(aodEvent->FindListObject("Forward"));
1662 // const TH2D& d2Ndetadphi = aodForward->GetHistogram();
1663 // Int_t nEta = d2Ndetadphi.GetXaxis()->GetNbins();
1664 // Int_t nPhi = d2Ndetadphi.GetYaxis()->GetNbins();
1665 // Double_t ret = 0.;
1666 // // Loop over eta
1667 // for (Int_t iEta = 1; iEta <= nEta; iEta++) {
1668 // Int_t valid = d2Ndetadphi.GetBinContent(iEta, 0);
1669 // if (!valid) continue; // No data expected for this eta
1670 // // Loop over phi
1671 // for (Int_t iPhi = 1; i <= nPhi; i++) {
1672 // ret = d2Ndetadphi.GetBinContent(iEta, iPhi);
1673 // printf("eta %e phi %e : %e \n",d2Ndetadphi.GetXaxis()->GetBinCenter(iEta),d2Ndetadphi.GetYaxis()->GetBinCenter(iPhi),ret);
1674 // }
1675 // }
1676 
1677  AliAODZDC *aodZDC = aod->GetZDCData();
1678 
1679  const Double_t * towZNCraw = aodZDC->GetZNCTowerEnergy();
1680  const Double_t * towZNAraw = aodZDC->GetZNATowerEnergy();
1681 
1682  // Get centroid from ZDCs *******************************************************
1683 
1684  Double_t Enucl = (RunNum < 209122 ? 1380. : 2511.);
1685  Double_t xyZNC[2]={0.,0.}, xyZNA[2]={0.,0.};
1686  Double_t towZNC[5]={0.}, towZNA[5]={0.};
1687 
1688  Double_t ZNCcalib=1., ZNAcalib=1.;
1689  if(fUseTowerEq) {
1690  if(RunNum!=fCachedRunNum) {
1691  for(Int_t i=0; i<5; i++) {
1692  fTowerGainEq[0][i] = (TH1D*)(fTowerEqList->FindObject(Form("fZNCTower[%d][%d]",RunNum,i)));
1693  fTowerGainEq[1][i] = (TH1D*)(fTowerEqList->FindObject(Form("fZNATower[%d][%d]",RunNum,i)));
1694  }
1695  }
1696  for(Int_t i=0; i<5; i++) {
1697  if(fTowerGainEq[0][i]) towZNC[i] = towZNCraw[i]*fTowerGainEq[0][i]->GetBinContent(fTowerGainEq[0][i]->FindBin(centrperc));
1698  if(fTowerGainEq[1][i]) towZNA[i] = towZNAraw[i]*fTowerGainEq[1][i]->GetBinContent(fTowerGainEq[1][i]->FindBin(centrperc));
1699  if(fResetNegativeZDC) {
1700  if(towZNC[i]<0.) towZNC[i] = 0.;
1701  if(towZNA[i]<0.) towZNA[i] = 0.;
1702  }
1703  }
1704  } else {
1705  for(Int_t i=0; i<5; i++) {
1706  towZNC[i] = towZNCraw[i];
1707  towZNA[i] = towZNAraw[i];
1708  if(fResetNegativeZDC) {
1709  if(towZNC[i]<0.) towZNC[i] = 0.;
1710  if(towZNA[i]<0.) towZNA[i] = 0.;
1711  }
1712  fZNCTower[RunBin][i]->Fill(centrperc,towZNC[i]);
1713  fZNATower[RunBin][i]->Fill(centrperc,towZNA[i]);
1714  }
1715  }
1716 
1717  if(RunNum>=245829) towZNA[2] = 0.;
1718  Double_t zncEnergy=0., znaEnergy=0.;
1719  for(Int_t i=0; i<5; i++){
1720  zncEnergy += towZNC[i];
1721  znaEnergy += towZNA[i];
1722  }
1723  if(RunNum>=245829) znaEnergy *= 8./7.;
1724  fFlowEvent->SetZNCQ0(towZNC[0]);
1725  fFlowEvent->SetZNAQ0(towZNA[0]);
1726 
1727  Double_t energyZNC =0;
1728  Double_t energyZNA =0;
1729  Double_t energyZPC =0;
1730  Double_t energyZPA =0;
1731  if(!head->InheritsFrom("AliNanoAODStorage")){
1732  energyZNC = ((AliVAODHeader*)aod->GetHeader())->GetZDCN1Energy();
1733  energyZNA = ((AliVAODHeader*)aod->GetHeader())->GetZDCN2Energy();
1734  energyZPC = ((AliVAODHeader*)aod->GetHeader())->GetZDCP1Energy();
1735  energyZPA = ((AliVAODHeader*)aod->GetHeader())->GetZDCP2Energy();
1736  }else{
1737  AliNanoAODHeader *nanoAodHeader = (AliNanoAODHeader*) head;
1738  energyZNC = nanoAodHeader->GetVar(nanoAodHeader->GetVarIndex("cstEnergyZNC"));
1739  energyZNA = nanoAodHeader->GetVar(nanoAodHeader->GetVarIndex("cstEnergyZNA"));
1740  energyZPC = nanoAodHeader->GetVar(nanoAodHeader->GetVarIndex("cstEnergyZPC"));
1741  energyZPA = nanoAodHeader->GetVar(nanoAodHeader->GetVarIndex("cstEnergyZPA"));
1742  }
1743 
1744  fFlowEvent->SetZNCEnergy(energyZNC);
1745  fFlowEvent->SetZNAEnergy(energyZNA);
1746 
1747  fFlowEvent->SetZPCEnergy(energyZPC);
1748  fFlowEvent->SetZPAEnergy(energyZPA);
1749 
1750  const Double_t x[4] = {-1.75, 1.75, -1.75, 1.75};
1751  const Double_t y[4] = {-1.75, -1.75, 1.75, 1.75};
1752  Double_t numXZNC=0., numYZNC=0., denZNC=0., cZNC, wZNC, EZNC, SumEZNC=0.;
1753  Double_t numXZNA=0., numYZNA=0., denZNA=0., cZNA, wZNA, EZNA, SumEZNA=0., BadChOr;
1754  Bool_t fAllChONZNC=kTRUE, fAllChONZNA=kTRUE;
1755 
1756  if (fUseMCCen) {
1757  for(Int_t i=0; i<4; i++){
1758 
1759  // get energy
1760  EZNC = towZNC[i+1];
1761  fhZNSpectra->Fill(centrperc,i+0.5,EZNC);
1762 // fhZNSpectraRbR[RunBin]->Fill(centrperc,i+0.5,EZNC);
1763  if(fUseZDCSpectraCorr && EZNC>0.) {
1764  Double_t mu1 = SpecCorMu1[i]->Interpolate(centrperc);
1765  Double_t mu2 = SpecCorMu2[i]->Interpolate(centrperc);
1766  Double_t av = SpecCorAv[i]->Interpolate(centrperc);
1767  Double_t cor1 = SpecCorSi[i]->Interpolate(centrperc);
1768  EZNC = exp( (log(EZNC) - mu1 + mu2*cor1)/cor1 ) + av;
1769  fhZNSpectraCor->Fill(centrperc,i+0.5,EZNC);
1770  }
1771  if(fUseZDCSpectraCorr && EZNC<=0.) fAllChONZNC=kFALSE;
1772 
1773  SumEZNC += EZNC;
1774 
1775  // build centroid
1776  wZNC = TMath::Power(EZNC, fZDCGainAlpha);
1777  numXZNC += x[i]*wZNC;
1778  numYZNC += y[i]*wZNC;
1779  denZNC += wZNC;
1780  fhZNSpectraPow->Fill(centrperc,i+0.5,wZNC);
1781 
1782  // get energy
1783  if(fDataSet==k2015 || fDataSet==k2015v6) {
1784  if(i==1) {
1785  EZNA = towZNA[0]-towZNA[1]-towZNA[3]-towZNA[4];
1786  if(fUseBadTowerCalib && fBadTowerCalibHist[cenb]) {
1787  EZNA = GetBadTowerResp(EZNA, fBadTowerCalibHist[cenb]);
1788  }
1789  } else {
1790  EZNA = towZNA[i+1];
1791  }
1792  } else {
1793  EZNA = towZNA[i+1];
1794  }
1795  fhZNSpectra->Fill(centrperc,i+4.5,EZNA);
1796 // fhZNSpectraRbR[RunBin]->Fill(centrperc,i+4.5,EZNA);
1797  if(fUseZDCSpectraCorr && EZNA>0.) {
1798  Double_t mu1 = SpecCorMu1[i+4]->Interpolate(centrperc);
1799  Double_t mu2 = SpecCorMu2[i+4]->Interpolate(centrperc);
1800  Double_t av = SpecCorAv[i+4]->Interpolate(centrperc);
1801  Double_t cor1 = SpecCorSi[i+4]->Interpolate(centrperc);
1802  EZNA = exp( (log(EZNA) - mu1 + mu2*cor1)/cor1 ) + av;
1803  fhZNSpectraCor->Fill(centrperc,i+4.5,EZNA);
1804  }
1805  if(fUseZDCSpectraCorr && EZNA<=0.) fAllChONZNA=kFALSE;
1806  SumEZNA += EZNA;
1807 
1808  // build centroid
1809  wZNA = TMath::Power(EZNA, fZDCGainAlpha);
1810  numXZNA += x[i]*wZNA;
1811  numYZNA += y[i]*wZNA;
1812  denZNA += wZNA;
1813  fhZNSpectraPow->Fill(centrperc,i+4.5,wZNA);
1814  }
1815  // store distribution for unfolding
1816  if(RunNum<245829) {
1817  Double_t recoE = towZNA[0]-towZNA[1]-towZNA[3]-towZNA[4];
1818  Double_t trueE = towZNA[2];
1819  fhZNBCCorr->Fill(centrperc,trueE,recoE);
1820  }
1821  if(denZNC>0.){
1822  Double_t nSpecnC = SumEZNC/Enucl;
1823  cZNC = 1.89358-0.71262/(nSpecnC+0.71789);
1824  xyZNC[0] = cZNC*numXZNC/denZNC;
1825  xyZNC[1] = cZNC*numYZNC/denZNC;
1826  denZNC *= cZNC;
1827  }
1828  else{
1829  xyZNC[0] = xyZNC[1] = 0.;
1830  }
1831  if(denZNA>0.){
1832  Double_t nSpecnA = SumEZNA/Enucl;
1833  cZNA = 1.89358-0.71262/(nSpecnA+0.71789);
1834  xyZNA[0] = cZNA*numXZNA/denZNA;
1835  xyZNA[1] = cZNA*numYZNA/denZNA;
1836  denZNA *= cZNA;
1837  }
1838  else{
1839  xyZNA[0] = xyZNA[1] = 0.;
1840  }
1841  } else {
1842  for(Int_t i=0; i<4; i++) {
1843  if(towZNC[i+1]>0.) {
1844  wZNC = TMath::Power(towZNC[i+1], fZDCGainAlpha);
1845  numXZNC += x[i]*wZNC;
1846  numYZNC += y[i]*wZNC;
1847  denZNC += wZNC;
1848  }
1849  if(towZNA[i+1]>0.) {
1850  wZNA = TMath::Power(towZNA[i+1], fZDCGainAlpha);
1851  numXZNA += x[i]*wZNA;
1852  numYZNA += y[i]*wZNA;
1853  denZNA += wZNA;
1854  }
1855  }
1856  if(denZNC!=0) {
1857  xyZNC[0] = numXZNC/denZNC;
1858  xyZNC[1] = numYZNC/denZNC;
1859  }
1860  else{
1861  xyZNC[0] = xyZNC[1] = 999.;
1862  zncEnergy = 0.;
1863  }
1864  if(denZNA!=0) {
1865  xyZNA[0] = numXZNA/denZNA;
1866  xyZNA[1] = numYZNA/denZNA;
1867  }
1868  else{
1869  xyZNA[0] = xyZNA[1] = 999.;
1870  znaEnergy = 0.;
1871  }
1872  }
1873 
1874  if(!fAllChONZNC) denZNC=-1.;
1875  if(!fAllChONZNA) denZNA=-1.;
1876 
1877  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]);
1878  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]);
1879 
1880  fFlowEvent->SetZDC2Qsub(xyZNC,denZNC,xyZNA,denZNA);
1881 
1882  // ******************************************************************************
1883 
1884  for(int i=0; i<5; i++){
1885  fhZNCPM[i]->Fill(towZNC[i]);
1886  if((i<4) && (towZNC[0]>0.)) fhZNCPMQiPMC[i]->Fill(towZNC[i+1]/towZNC[0]);
1887  }
1888  for(int i=0; i<5; i++){
1889  fhZNAPM[i]->Fill(towZNA[i]);
1890  if(((i<4) && towZNA[0]>0.)) fhZNAPMQiPMC[i]->Fill(towZNA[i+1]/towZNA[0]);
1891  }
1892 
1893  fhZNCvsZNA->Fill(energyZNA, energyZNC);
1894  fhZDCCvsZDCCA->Fill(energyZNA+energyZPA, energyZNC+energyZPC);
1895  fhZNCvsZPC->Fill(energyZPC, energyZNC);
1896  fhZNAvsZPA->Fill(energyZPA, energyZNA);
1897  fhZNvsZP->Fill(energyZPA+energyZPC, energyZNA+energyZNC);
1898  fhZNvsVZERO->Fill(multV0A+multV0C, energyZNC+energyZNA);
1899  fhZDCvsVZERO->Fill(multV0A+multV0C, energyZNA+energyZPA+energyZNC+energyZPC);
1900 
1901  Double_t asymmetry = -999.;
1902  if((energyZNC+energyZNA)>0.) asymmetry = (energyZNC-energyZNA)/(energyZNC+energyZNA);
1903  fhAsymm->Fill(asymmetry);
1904  fhZNAvsAsymm->Fill(asymmetry, energyZNA);
1905  fhZNCvsAsymm->Fill(asymmetry, energyZNC);
1906 
1907  fhZNCvscentrality->Fill(centrperc, energyZNC);
1908  fhZNAvscentrality->Fill(centrperc, energyZNA);
1909  fhZPCvscentrality->Fill(centrperc, energyZPC);
1910  fhZPAvscentrality->Fill(centrperc, energyZPA);
1911 
1912  // } // PHYSICS SELECTION
1913 
1914  }
1915 
1916  // p) cache run number
1918 
1919  // printf("debug: NoRPs %e, NoPOIs %e, RunNum %d, Cen %e \n",fFlowEvent->GetNumberOfRPs(),fFlowEvent->GetNumberOfPOIs(),fCachedRunNum,fFlowEvent->GetCentrality());
1920 
1921  PostData(1, fFlowEvent);
1922 
1923  PostData(2, fOutput);
1924 }
1925 //________________________________________________________________________
1926 
1928 {
1929  Bool_t BisPileup=kFALSE;
1930 
1931  TObject *head =aod->GetHeader();
1932  if (head->InheritsFrom("AliNanoAODStorage")){
1933 
1934  AliNanoAODHeader * nanohead = (AliNanoAODHeader*)head;
1935  Int_t pileupIndex = nanohead->GetVarIndex("cstPileUp");
1936  if (nanohead->GetVar(pileupIndex)==0) BisPileup=kFALSE;
1937  if (nanohead->GetVar(pileupIndex)==1) BisPileup=kTRUE;
1938 
1939  } else {
1940 
1941  Double_t centrV0M=300., centrCL1=300.;
1942 
1944 
1945  // pileup for LHC10h and LHC11h
1946 
1947  centrV0M = ((AliVAODHeader*)aod->GetHeader())->GetCentralityP()->GetCentralityPercentile("V0M");
1948  centrCL1 = ((AliVAODHeader*)aod->GetHeader())->GetCentralityP()->GetCentralityPercentile("CL1");
1949 
1950  // check anyway pileup
1951  if (plpMV(aod)) {
1952  fPileUpCount->Fill(0.5);
1953  BisPileup=kTRUE;
1954  }
1955 
1956  Short_t isPileup = aod->IsPileupFromSPD(3);
1957  if (isPileup != 0) {
1958  fPileUpCount->Fill(1.5);
1959  BisPileup=kTRUE;
1960  }
1961 
1962  if (((AliAODHeader*)aod->GetHeader())->GetRefMultiplicityComb08() < 0) {
1963  fPileUpCount->Fill(2.5);
1964  BisPileup=kTRUE;
1965  }
1966 
1967  if (aod->IsIncompleteDAQ()) {
1968  fPileUpCount->Fill(3.5);
1969  BisPileup=kTRUE;
1970  }
1971 
1972  // check vertex consistency
1973  const AliAODVertex* vtTrc = aod->GetPrimaryVertex();
1974  const AliAODVertex* vtSPD = aod->GetPrimaryVertexSPD();
1975 
1976  if (vtTrc->GetNContributors() < 2 || vtSPD->GetNContributors()<1) {
1977  fPileUpCount->Fill(5.5);
1978  BisPileup=kTRUE;
1979  }
1980 
1981  double covTrc[6], covSPD[6];
1982  vtTrc->GetCovarianceMatrix(covTrc);
1983  vtSPD->GetCovarianceMatrix(covSPD);
1984 
1985  double dz = vtTrc->GetZ() - vtSPD->GetZ();
1986 
1987  double errTot = TMath::Sqrt(covTrc[5]+covSPD[5]);
1988  double errTrc = TMath::Sqrt(covTrc[5]);
1989  double nsigTot = dz/errTot;
1990  double nsigTrc = dz/errTrc;
1991 
1992  if (TMath::Abs(dz)>0.2 || TMath::Abs(nsigTot)>10 || TMath::Abs(nsigTrc)>20) {
1993  fPileUpCount->Fill(6.5);
1994  BisPileup=kTRUE;
1995  }
1996 
1997  if (fAnalysisUtil->IsPileUpEvent(InputEvent())) {
1998  fPileUpCount->Fill(7.5);
1999  BisPileup=kTRUE;
2000  }
2001 
2002  }
2003  else {
2004 
2005  // pileup for LHC15o, using AliMultSelection
2006 
2007  if(fMultSelection) {
2008  centrV0M = fMultSelection->GetMultiplicityPercentile("V0M");
2009  centrCL1 = fMultSelection->GetMultiplicityPercentile("CL1");
2010  } else {
2011  BisPileup=kTRUE;
2012  }
2013 
2014  // pileup from AliMultSelection
2015  if(!fMultSelection->GetThisEventIsNotPileup()) fPileUpMultSelCount->Fill(0.5);
2016  if(!fMultSelection->GetThisEventIsNotPileupMV()) fPileUpMultSelCount->Fill(1.5);
2017  if(!fMultSelection->GetThisEventIsNotPileupInMultBins()) fPileUpMultSelCount->Fill(2.5);
2018  if(!fMultSelection->GetThisEventHasNoInconsistentVertices()) fPileUpMultSelCount->Fill(3.5);
2019  if(!fMultSelection->GetThisEventPassesTrackletVsCluster()) fPileUpMultSelCount->Fill(4.5);
2020  if(!fMultSelection->GetThisEventIsNotAsymmetricInVZERO()) fPileUpMultSelCount->Fill(5.5);
2021  if(!fMultSelection->GetThisEventIsNotIncompleteDAQ()) fPileUpMultSelCount->Fill(6.5);
2022  if(!fMultSelection->GetThisEventHasGoodVertex2016()) fPileUpMultSelCount->Fill(7.5);
2023 
2024  // pile-up a la Dobrin for LHC15o
2025  if (plpMV(aod)) {
2026  fPileUpCount->Fill(0.5);
2027  BisPileup=kTRUE;
2028  }
2029 
2030  Short_t isPileup = aod->IsPileupFromSPD(3);
2031  if (isPileup != 0) {
2032  fPileUpCount->Fill(1.5);
2033  BisPileup=kTRUE;
2034  }
2035 
2036  if (((AliAODHeader*)aod->GetHeader())->GetRefMultiplicityComb08() < 0) {
2037  fPileUpCount->Fill(2.5);
2038  BisPileup=kTRUE;
2039  }
2040 
2041  if (aod->IsIncompleteDAQ()) {
2042  fPileUpCount->Fill(3.5);
2043  BisPileup=kTRUE;
2044  }
2045 
2046  if(fabs(centrV0M-centrCL1)>7.5) {
2047  fPileUpCount->Fill(4.5);
2048  BisPileup=kTRUE;
2049  }
2050 
2051  // check vertex consistency
2052  const AliAODVertex* vtTrc = aod->GetPrimaryVertex();
2053  const AliAODVertex* vtSPD = aod->GetPrimaryVertexSPD();
2054 
2055  if (vtTrc->GetNContributors() < 2 || vtSPD->GetNContributors()<1) {
2056  fPileUpCount->Fill(5.5);
2057  BisPileup=kTRUE;
2058  }
2059 
2060  double covTrc[6], covSPD[6];
2061  vtTrc->GetCovarianceMatrix(covTrc);
2062  vtSPD->GetCovarianceMatrix(covSPD);
2063 
2064  double dz = vtTrc->GetZ() - vtSPD->GetZ();
2065 
2066  double errTot = TMath::Sqrt(covTrc[5]+covSPD[5]);
2067  double errTrc = TMath::Sqrt(covTrc[5]);
2068  double nsigTot = dz/errTot;
2069  double nsigTrc = dz/errTrc;
2070 
2071  if (TMath::Abs(dz)>0.2 || TMath::Abs(nsigTot)>10 || TMath::Abs(nsigTrc)>20) {
2072  fPileUpCount->Fill(6.5);
2073  BisPileup=kTRUE;
2074  }
2075 
2076  // cuts on tracks
2077  const Int_t nTracks = aod->GetNumberOfTracks();
2078  Int_t multEsd = ((AliAODHeader*)aod->GetHeader())->GetNumberOfESDTracks();
2079 
2080  Int_t multTrk = 0;
2081  Int_t multTrkBefC = 0;
2082  Int_t multTrkTOFBefC = 0;
2083  Int_t multTPC = 0;
2084 
2085  for (Int_t it = 0; it < nTracks; it++) {
2086 
2087  AliAODTrack* aodTrk = (AliAODTrack*)aod->GetTrack(it);
2088  if (!aodTrk){
2089  delete aodTrk;
2090  continue;
2091  }
2092 
2093 // if (aodTrk->TestFilterBit(32)){
2094 // multTrkBefC++;
2095 //
2096 // if ( TMath::Abs(aodTrk->GetTOFsignalDz()) <= 10. && aodTrk->GetTOFsignal() >= 12000. && aodTrk->GetTOFsignal() <= 25000.)
2097 // multTrkTOFBefC++;
2098 //
2099 // if ((TMath::Abs(aodTrk->Eta()) < 0.8) && (aodTrk->GetTPCNcls() >= 70) && (aodTrk->Pt() >= 0.2) && (aodTrk->Pt() < 20.))
2100 // multTrk++;
2101 // }
2102 
2103  if (aodTrk->TestFilterBit(128))
2104  multTPC++;
2105 
2106  if (centrV0M<10. && aodTrk->TestFilterBit(768) && aodTrk->Pt()>0.2) {
2107 
2108  // cut on # TPC clusters
2109  Int_t ntpccls = aodTrk->GetTPCNcls();
2110  fQATrackTPCNcls->Fill(aodTrk->Phi(),aodTrk->Eta(),ntpccls);
2111 
2112  // cut on # ITS clusters
2113  Int_t nitscls = aodTrk->GetITSNcls();
2114  fQATrackITSNcls->Fill(aodTrk->Phi(),aodTrk->Eta(),nitscls);
2115 
2116  // cut on chi2 / # TPC clusters
2117  Double_t chi2tpc = 0.;
2118  if(ntpccls>0) {
2119  chi2tpc = aodTrk->Chi2perNDF();
2120  }
2121  fQATrackTPCchi2->Fill(aodTrk->Phi(),aodTrk->Eta(),chi2tpc);
2122 
2123  // cut on chi2 / # ITS clusters
2124  Double_t chi2its = 0.;
2125  if(nitscls>0) {
2126  chi2its = aodTrk->GetITSchi2()/aodTrk->GetITSNcls();
2127  }
2128  fQATrackITSchi2->Fill(aodTrk->Phi(),aodTrk->Eta(),chi2its);
2129 
2130  // cut on fraction shared TPC clusters
2131  Double_t fshtpccls = 0.;
2132  if(ntpccls>0) {
2133  Int_t ntpcclsS = aodTrk->GetTPCnclsS();
2134  fshtpccls = 1.*ntpcclsS/ntpccls;
2135  }
2136  fQATrackTPCScls->Fill(aodTrk->Phi(),aodTrk->Eta(),fshtpccls);
2137 
2138  // cut on fraction shared ITS clusters
2139  Double_t fshitscls = 0.;
2140  Int_t nshcl = 0;
2141  if(nitscls>0) {
2142  for (Int_t i=0; i<6; i++) {
2143  if(aodTrk->HasSharedPointOnITSLayer(i)) nshcl++;
2144  }
2145  fshitscls = 1.*nshcl/nitscls;
2146  }
2147  fQATrackITSScls->Fill(aodTrk->Phi(),aodTrk->Eta(),fshitscls);
2148 
2149  }
2150 
2151  } // end of for (Int_t it = 0; it < nTracks; it++)
2152 
2153  Double_t multTPCn = multTPC;
2154  Double_t multEsdn = multEsd;
2155  Double_t multESDTPCDif = multEsdn - multTPCn*3.38;
2156 
2157  if (multESDTPCDif > (fRejectPileUpTight?700.:15000.)) {
2158  fPileUpCount->Fill(7.5);
2159  BisPileup=kTRUE;
2160  }
2161 
2162  if(fRejectPileUpTight) {
2163  if(BisPileup==kFALSE) {
2164  if(!fMultSelection->GetThisEventIsNotPileup()) BisPileup=kTRUE;
2165  if(!fMultSelection->GetThisEventIsNotPileupMV()) BisPileup=kTRUE;
2166  if(!fMultSelection->GetThisEventIsNotPileupInMultBins()) BisPileup=kTRUE;
2167  if(!fMultSelection->GetThisEventHasNoInconsistentVertices()) BisPileup=kTRUE;
2168  if(!fMultSelection->GetThisEventPassesTrackletVsCluster()) BisPileup=kTRUE;
2169  if(!fMultSelection->GetThisEventIsNotIncompleteDAQ()) BisPileup=kTRUE;
2170  if(!fMultSelection->GetThisEventHasGoodVertex2016()) BisPileup=kTRUE;
2171  if(BisPileup) fPileUpCount->Fill(8.5);
2172  }
2173  }
2174  }
2175  }
2176 
2177 
2178  return BisPileup;
2179 }
2180 
2181 //________________________________________________________________________
2182 
2184 {
2185  Double_t EtC = BadTowerCalibHist->ProjectionY("",BadTowerCalibHist->GetXaxis()->FindBin(Et),BadTowerCalibHist->GetXaxis()->FindBin(Et))->GetRandom();
2186  return EtC;
2187 }
2188 
2189 //________________________________________________________________________
2190 
2192 {
2193  Int_t CenBin=-1;
2194  if (Centrality>0. && Centrality<5.) CenBin=0;
2195  if (Centrality>5. && Centrality<10.) CenBin=1;
2196  if (Centrality>10. && Centrality<20.) CenBin=2;
2197  if (Centrality>20. && Centrality<30.) CenBin=3;
2198  if (Centrality>30. && Centrality<40.) CenBin=4;
2199  if (Centrality>40. && Centrality<50.) CenBin=5;
2200  if (Centrality>50. && Centrality<60.) CenBin=6;
2201  if (Centrality>60. && Centrality<70.) CenBin=7;
2202  if (Centrality>70. && Centrality<80.) CenBin=8;
2203  if (Centrality>80. && Centrality<90.) CenBin=9;
2204  if (CenBin>=fnCen) CenBin=-1;
2205  if (fnCen==1) CenBin=0;
2206  return CenBin;
2207 } // end of AliFlowAnalysisCRC::GetCRCCenBin(Double_t Centrality)
2208 //_____________________________________________________________________________
2209 
2210 Double_t AliAnalysisTaskCRCZDC::GetWDist(const AliVVertex* v0, const AliVVertex* v1)
2211 {
2212  // calculate sqrt of weighted distance to other vertex
2213  if (!v0 || !v1) {
2214  printf("One of vertices is not valid\n");
2215  return 0;
2216  }
2217  static TMatrixDSym vVb(3);
2218  double dist = -1;
2219  double dx = v0->GetX()-v1->GetX();
2220  double dy = v0->GetY()-v1->GetY();
2221  double dz = v0->GetZ()-v1->GetZ();
2222  double cov0[6],cov1[6];
2223  v0->GetCovarianceMatrix(cov0);
2224  v1->GetCovarianceMatrix(cov1);
2225  vVb(0,0) = cov0[0]+cov1[0];
2226  vVb(1,1) = cov0[2]+cov1[2];
2227  vVb(2,2) = cov0[5]+cov1[5];
2228  vVb(1,0) = vVb(0,1) = cov0[1]+cov1[1];
2229  vVb(0,2) = vVb(1,2) = vVb(2,0) = vVb(2,1) = 0.;
2230  vVb.InvertFast();
2231  if (!vVb.IsValid()) {printf("Singular Matrix\n"); return dist;}
2232  dist = vVb(0,0)*dx*dx + vVb(1,1)*dy*dy + vVb(2,2)*dz*dz
2233  + 2*vVb(0,1)*dx*dy + 2*vVb(0,2)*dx*dz + 2*vVb(1,2)*dy*dz;
2234  return dist>0 ? TMath::Sqrt(dist) : -1;
2235 }
2236 //________________________________________________________________________
2237 
2239 {
2240  // check for multi-vertexer pile-up
2241 
2242  const int kMinPlpContrib = 5;
2243  const double kMaxPlpChi2 = 5.0;
2244  const double kMinWDist = 15;
2245 
2246  const AliVVertex* vtPrm = 0;
2247  const AliVVertex* vtPlp = 0;
2248  int nPlp = 0;
2249 
2250  if ( !(nPlp=aod->GetNumberOfPileupVerticesTracks()) ) return kFALSE;
2251  vtPrm = aod->GetPrimaryVertex();
2252  if (vtPrm == aod->GetPrimaryVertexSPD()) return kTRUE; // there are pile-up vertices but no primary
2253 
2254  //int bcPrim = vtPrm->GetBC();
2255 
2256  for (int ipl=0;ipl<nPlp;ipl++) {
2257  vtPlp = (const AliVVertex*)aod->GetPileupVertexTracks(ipl);
2258  //
2259  if (vtPlp->GetNContributors() < kMinPlpContrib) continue;
2260  if (vtPlp->GetChi2perNDF() > kMaxPlpChi2) continue;
2261  // int bcPlp = vtPlp->GetBC();
2262  // if (bcPlp!=AliVTrack::kTOFBCNA && TMath::Abs(bcPlp-bcPrim)>2) return kTRUE; // pile-up from other BC
2263  //
2264  double wDst = GetWDist(vtPrm,vtPlp);
2265  if (wDst<kMinWDist) continue;
2266  //
2267  return kTRUE; // pile-up: well separated vertices
2268  }
2269 
2270  return kFALSE;
2271 }
2272 
2273 //________________________________________________________________________
2275  fCutContainer->AddAt(cutsRP,0); fCutsRP=cutsRP; cutsRP->SetPOItype(0);
2276 }
2277 
2278 //________________________________________________________________________
2280  fCutContainer->AddAt(cutsPOI,1); fCutsPOI=cutsPOI; cutsPOI->SetPOItype(1);
2281 }
2282 
2283 //________________________________________________________________________
2285 {
2286  // Terminate analysis
2287  //
2288  /* if(fDebug > 1) printf(" **** AliAnalysisTaskCRCZDC::Terminate() \n");
2289 
2290  //fOutput = dynamic_cast<TList*> (GetOutputData(1));
2291  //if(!fOutput) printf("ERROR: fOutput not available\n");
2292  */
2293 }
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
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