AliPhysics  b81c3d2 (b81c3d2)
 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 
98 
99 //________________________________________________________________________
102 fAnalysisType("AUTOMATIC"),
103 fRPType(""),
104 fCFManager1(NULL),
105 fCFManager2(NULL),
106 fCutsEvent(NULL),
107 fCutsRP(NULL),
108 fCutsPOI(NULL),
109 fCutContainer(new TList()),
110 fQAList(NULL),
111 fMinMult(0),
112 fMaxMult(10000000),
113 fMinA(-1.0),
114 fMaxA(-0.01),
115 fMinB(0.01),
116 fMaxB(1.0),
117 fGenHeader(NULL),
118 fPythiaGenHeader(NULL),
119 fHijingGenHeader(NULL),
120 fFlowTrack(NULL),
121 fAnalysisUtil(NULL),
122 fQAon(kFALSE),
123 fLoadCandidates(kFALSE),
124 fNbinsMult(10000),
125 fNbinsPt(100),
126 fNbinsPhi(100),
127 fNbinsEta(200),
128 fNbinsQ(500),
129 fNbinsMass(1),
130 fMultMin(0.),
131 fMultMax(10000.),
132 fPtMin(0.),
133 fPtMax(10.),
134 fPhiMin(0.),
135 fPhiMax(TMath::TwoPi()),
136 fEtaMin(-5.),
137 fEtaMax(5.),
138 fQMin(0.),
139 fQMax(3.),
140 fMassMin(-1.),
141 fMassMax(0.),
142 fHistWeightvsPhiMin(0.),
143 fHistWeightvsPhiMax(3.),
144 fExcludedEtaMin(0.),
145 fExcludedEtaMax(0.),
146 fExcludedPhiMin(0.),
147 fExcludedPhiMax(0.),
148 fAfterburnerOn(kFALSE),
149 fNonFlowNumberOfTrackClones(0),
150 fV1(0.),
151 fV2(0.),
152 fV3(0.),
153 fV4(0.),
154 fV5(0.),
155 fDifferentialV2(0),
156 fFlowEvent(NULL),
157 fShuffleTracks(kFALSE),
158 fMyTRandom3(NULL),
159 fAnalysisInput(kAOD),
160 fIsMCInput(kFALSE),
161 fUseMCCen(kTRUE),
162 fRejectPileUp(kTRUE),
163 fRejectPileUpTight(kFALSE),
164 fCentrLowLim(0.),
165 fCentrUpLim(100.),
166 fCentrEstimator(kV0M),
167 fOutput(0x0),
168 fhZNCvsZNA(0x0),
169 fhZDCCvsZDCCA(0x0),
170 fhZNCvsZPC(0x0),
171 fhZNAvsZPA(0x0),
172 fhZNvsZP(0x0),
173 fhZNvsVZERO(0x0),
174 fhZDCvsVZERO(0x0),
175 fhZDCvsTracklets(0x0),
176 fhZDCvsNclu1(0x0),
177 fhDebunch(0x0),
178 fhAsymm(0x0),
179 fhZNAvsAsymm(0x0),
180 fhZNCvsAsymm(0x0),
181 fhZNCvscentrality(0x0),
182 fhZNAvscentrality(0x0),
183 fCRCnRun(0),
184 fZDCGainAlpha(0.395),
185 fDataSet(kAny),
186 fStack(0x0),
187 fCutTPC(kFALSE),
188 fCenDis(0x0),
189 fVZEROMult(0x0),
190 fMultSelection(0x0),
191 fPileUpCount(0x0),
192 fPileUpMultSelCount(0x0),
193 fMultTOFLowCut(0x0),
194 fMultTOFHighCut(0x0),
195 fUseTowerEq(kFALSE),
196 fTowerEqList(NULL),
197 fUseBadTowerCalib(kFALSE),
198 fBadTowerCalibList(NULL),
199 fVZEROGainEqList(NULL),
200 fVZEROQVecRecList(NULL),
201 fUseZDCSpectraCorr(kFALSE),
202 fZDCSpectraCorrList(NULL),
203 fSpectraMCList(NULL),
204 fBadTowerStuffList(NULL),
205 fVZEROStuffList(NULL),
206 fCachedRunNum(0),
207 fhZNSpectra(0x0),
208 fhZNSpectraCor(0x0),
209 fhZNSpectraPow(0x0),
210 fhZNBCCorr(0x0)
211 {
212  for(int i=0; i<5; i++){
213  fhZNCPM[i] = 0x0;
214  fhZNAPM[i] = 0x0;
215  }
216  for(int i=0; i<4; i++){
217  fhZNCPMQiPMC[i] = 0x0;
218  fhZNAPMQiPMC[i] = 0x0;
219  }
220  for(Int_t r=0; r<fCRCMaxnRun; r++) {
221  fRunList[r] = 0;
222  }
223  for(Int_t c=0; c<2; c++) {
224  for(Int_t i=0; i<5; i++) {
225  fTowerGainEq[c][i] = NULL;
226  }
227  }
228  for(Int_t c=0; c<100; c++) {
229  fBadTowerCalibHist[c] = NULL;
230  }
231  fVZEROGainEqHist = NULL;
232  for (Int_t k=0; k<fkVZEROnHar; k++) {
233 // fVZEROQVectorRecQx[k] = NULL;
234 // fVZEROQVectorRecQy[k] = NULL;
235  fVZEROQVectorRecQxStored[k] = NULL;
236  fVZEROQVectorRecQyStored[k] = NULL;
237  for (Int_t t=0; t<fkVZEROnQAplots; t++) {
238  fVZEROQVectorRecFinal[k][t] = NULL;
239  }
240  }
241  for(Int_t i=0; i<8; i++) {
242  SpecCorMu1[i] = NULL;
243  SpecCorMu2[i] = NULL;
244  SpecCorSi[i] = NULL;
245  SpecCorAv[i] = NULL;
246  }
247  this->InitializeRunArrays();
248  fMyTRandom3 = new TRandom3(1);
249  gRandom->SetSeed(fMyTRandom3->Integer(65539));
250  for(Int_t j=0; j<2; j++) {
251  for(Int_t c=0; c<10; c++) {
252  fPtSpecGen[j][c] = NULL;
253  fPtSpecFB32[j][c] = NULL;
254  fPtSpecFB96[j][c] = NULL;
255  fPtSpecFB128[j][c] = NULL;
256  fPtSpecFB768[j][c] = NULL;
257  }
258  }
259  for (Int_t c=0; c<2; c++) {
260  fhZNCenDis[c] = NULL;
261  }
262 }
263 
264 //________________________________________________________________________
265 AliAnalysisTaskCRCZDC::AliAnalysisTaskCRCZDC(const char *name, TString RPtype, Bool_t on, UInt_t iseed, Bool_t bCandidates):
266 AliAnalysisTaskSE(name),
267 fAnalysisType("AUTOMATIC"),
268 fRPType(RPtype),
269 fCFManager1(NULL),
270 fCFManager2(NULL),
271 fCutsEvent(NULL),
272 fCutsRP(NULL),
273 fCutsPOI(NULL),
274 fCutContainer(new TList()),
275 fQAList(NULL),
276 fMinMult(0),
277 fMaxMult(10000000),
278 fMinA(-1.0),
279 fMaxA(-0.01),
280 fMinB(0.01),
281 fMaxB(1.0),
282 fQAon(on),
283 fLoadCandidates(bCandidates),
284 fNbinsMult(10000),
285 fNbinsPt(100),
286 fNbinsPhi(100),
287 fNbinsEta(200),
288 fNbinsQ(500),
289 fNbinsMass(1),
290 fMultMin(0.),
291 fMultMax(10000.),
292 fPtMin(0.),
293 fPtMax(10.),
294 fPhiMin(0.),
295 fPhiMax(TMath::TwoPi()),
296 fEtaMin(-5.),
297 fEtaMax(5.),
298 fQMin(0.),
299 fQMax(3.),
300 fMassMin(-1.),
301 fMassMax(0.),
302 fHistWeightvsPhiMin(0.),
303 fHistWeightvsPhiMax(3.),
304 fExcludedEtaMin(0.),
305 fExcludedEtaMax(0.),
306 fExcludedPhiMin(0.),
307 fExcludedPhiMax(0.),
308 fAfterburnerOn(kFALSE),
309 fNonFlowNumberOfTrackClones(0),
310 fV1(0.),
311 fV2(0.),
312 fV3(0.),
313 fV4(0.),
314 fV5(0.),
315 fDifferentialV2(0),
316 fFlowEvent(NULL),
317 fShuffleTracks(kFALSE),
318 fMyTRandom3(NULL),
319 fAnalysisInput(kAOD),
320 fIsMCInput(kFALSE),
321 fUseMCCen(kTRUE),
322 fRejectPileUp(kTRUE),
323 fRejectPileUpTight(kFALSE),
324 fCentrLowLim(0.),
325 fCentrUpLim(100.),
326 fCentrEstimator(kV0M),
327 fOutput(0x0),
328 fhZNCvsZNA(0x0),
329 fhZDCCvsZDCCA(0x0),
330 fhZNCvsZPC(0x0),
331 fhZNAvsZPA(0x0),
332 fhZNvsZP(0x0),
333 fhZNvsVZERO(0x0),
334 fhZDCvsVZERO(0x0),
335 fhZDCvsTracklets(0x0),
336 fhZDCvsNclu1(0x0),
337 fhDebunch(0x0),
338 fhAsymm(0x0),
339 fhZNAvsAsymm(0x0),
340 fhZNCvsAsymm(0x0),
341 fhZNCvscentrality(0x0),
342 fhZNAvscentrality(0x0),
343 fDataSet(kAny),
344 fCRCnRun(0),
345 fZDCGainAlpha(0.395),
346 fGenHeader(NULL),
347 fPythiaGenHeader(NULL),
348 fHijingGenHeader(NULL),
349 fFlowTrack(NULL),
350 fAnalysisUtil(NULL),
351 fStack(0x0),
352 fCutTPC(kFALSE),
353 fCenDis(0x0),
354 fVZEROMult(0x0),
355 fMultSelection(0x0),
356 fPileUpCount(0x0),
357 fPileUpMultSelCount(0x0),
358 fMultTOFLowCut(0x0),
359 fMultTOFHighCut(0x0),
360 fUseTowerEq(kFALSE),
361 fTowerEqList(NULL),
362 fUseBadTowerCalib(kFALSE),
363 fBadTowerCalibList(NULL),
364 fVZEROGainEqList(NULL),
365 fVZEROQVecRecList(NULL),
366 fUseZDCSpectraCorr(kFALSE),
367 fZDCSpectraCorrList(NULL),
368 fSpectraMCList(NULL),
369 fBadTowerStuffList(NULL),
370 fVZEROStuffList(NULL),
371 fCachedRunNum(0),
372 fhZNSpectra(0x0),
373 fhZNSpectraCor(0x0),
374 fhZNSpectraPow(0x0),
375 fhZNBCCorr(0x0)
376 {
377 
378  for(int i=0; i<5; i++){
379  fhZNCPM[i] = 0x0;
380  fhZNAPM[i] = 0x0;
381  }
382  for(int i=0; i<4; i++){
383  fhZNCPMQiPMC[i] = 0x0;
384  fhZNAPMQiPMC[i] = 0x0;
385  }
386  for(Int_t r=0; r<fCRCMaxnRun; r++) {
387  fRunList[r] = 0;
388  }
389  for(Int_t c=0; c<2; c++) {
390  for(Int_t i=0; i<5; i++) {
391  fTowerGainEq[c][i] = NULL;
392  }
393  }
394  for(Int_t c=0; c<100; c++) {
395  fBadTowerCalibHist[c] = NULL;
396  }
397  fVZEROGainEqHist = NULL;
398  for (Int_t k=0; k<fkVZEROnHar; k++) {
399  // fVZEROQVectorRecQx[k] = NULL;
400  // fVZEROQVectorRecQy[k] = NULL;
401  fVZEROQVectorRecQxStored[k] = NULL;
402  fVZEROQVectorRecQyStored[k] = NULL;
403  for (Int_t t=0; t<fkVZEROnQAplots; t++) {
404  fVZEROQVectorRecFinal[k][t] = NULL;
405  }
406  }
407  for(Int_t i=0; i<8; i++) {
408  SpecCorMu1[i] = NULL;
409  SpecCorMu2[i] = NULL;
410  SpecCorSi[i] = NULL;
411  SpecCorAv[i] = NULL;
412  }
413  this->InitializeRunArrays();
414  fMyTRandom3 = new TRandom3(iseed);
415  gRandom->SetSeed(fMyTRandom3->Integer(65539));
416 
417  DefineInput(0, TChain::Class());
418  // Define output slots here
419  // Define here the flow event output
420  DefineOutput(1, AliFlowEventSimple::Class());
421  DefineOutput(2, TList::Class());
422 
423  for(Int_t j=0; j<2; j++) {
424  for(Int_t c=0; c<10; c++) {
425  fPtSpecGen[j][c] = NULL;
426  fPtSpecFB32[j][c] = NULL;
427  fPtSpecFB96[j][c] = NULL;
428  fPtSpecFB128[j][c] = NULL;
429  fPtSpecFB768[j][c] = NULL;
430  }
431  }
432  for (Int_t c=0; c<2; c++) {
433  fhZNCenDis[c] = NULL;
434  }
435 }
436 
437 //________________________________________________________________________
439 {
440  // Destructor
441  if(fOutput && !AliAnalysisManager::GetAnalysisManager()->IsProofMode()){
442  delete fOutput; fOutput=0;
443  }
444  delete fMyTRandom3;
445  delete fFlowEvent;
446  delete fFlowTrack;
447  delete fCutsEvent;
448  if (fTowerEqList) delete fTowerEqList;
453  if (fAnalysisUtil) delete fAnalysisUtil;
454  if (fQAList) delete fQAList;
455  if (fCutContainer) fCutContainer->Delete(); delete fCutContainer;
456 }
457 
458 //________________________________________________________________________
460 {
461  for(Int_t r=0;r<fCRCMaxnRun;r++) {
462  fCRCQVecListRun[r] = NULL;
463  for(Int_t k=0;k<fCRCnTow;k++) {
464  fZNCTower[r][k] = NULL;
465  fZNATower[r][k] = NULL;
466  }
467 // fhZNSpectraRbR[r] = NULL;
468  }
469  // for(Int_t i=0;i<fnCen;i++) {
470  // fPtPhiEtaRbRFB128[r][i] = NULL;
471  // fPtPhiEtaRbRFB768[r][i] = NULL;
472  // }
473  // }
474 }
475 
476 //________________________________________________________________________
478 {
479  // Create the output containers
480 
481  if (!(fAnalysisType == "AOD" || fAnalysisType == "MCkine" || fAnalysisType == "MCAOD" || fAnalysisType == "AUTOMATIC" || fAnalysisType == "MCESD"))
482  {
483  AliError("WRONG ANALYSIS TYPE! only MCESD, MCkine, MCAOD, AOD and AUTOMATIC are allowed.");
484  exit(1);
485  }
486 
487  //set the common constants
490  cc->SetNbinsPt(fNbinsPt);
491  cc->SetNbinsPhi(fNbinsPhi);
492  cc->SetNbinsEta(fNbinsEta);
493  cc->SetNbinsQ(fNbinsQ);
495  cc->SetMultMin(fMultMin);
496  cc->SetMultMax(fMultMax);
497  cc->SetPtMin(fPtMin);
498  cc->SetPtMax(fPtMax);
499  cc->SetPhiMin(fPhiMin);
500  cc->SetPhiMax(fPhiMax);
501  cc->SetEtaMin(fEtaMin);
502  cc->SetEtaMax(fEtaMax);
503  cc->SetQMin(fQMin);
504  cc->SetQMax(fQMax);
505  cc->SetMassMin(fMassMin);
506  cc->SetMassMax(fMassMax);
509 
510  fFlowEvent = new AliFlowEvent(20000);
511  fFlowTrack = new AliFlowTrack();
512 
513  //printf(" AliAnalysisTaskCRCZDC::UserCreateOutputObjects()\n\n");
514  fOutput = new TList();
515  fOutput->SetOwner(kTRUE);
516  //fOutput->SetName("output");
517 
518  if (fQAon) {
519  fQAList = new TList();
520  fQAList->SetOwner(kTRUE);
521  fQAList->SetName("AliFlowEventCuts QA");
522  if (fCutsEvent->GetQA()) fQAList->Add(fCutsEvent->GetQA()); //0
523  if (fCutsRP->GetQA()) fQAList->Add(fCutsRP->GetQA()); //1
524  if (fCutsPOI->GetQA())fQAList->Add(fCutsPOI->GetQA()); //2
525  fOutput->Add(fQAList);
526  }
527 
528  fVZEROStuffList = new TList();
529  fVZEROStuffList->SetOwner(kTRUE);
530  fVZEROStuffList->SetName("VZERO stuff");
531  fOutput->Add(fVZEROStuffList);
532 
533  fBadTowerStuffList = new TList();
534  fBadTowerStuffList->SetOwner(kTRUE);
535  fBadTowerStuffList->SetName("BadTowerCalib");
537 
538  fCenDis = new TH1F("fCenDis", "fCenDis", 100, 0., 100.);
539  fOutput->Add(fCenDis);
540  fPileUpCount = new TH1F("fPileUpCount", "fPileUpCount", 9, 0., 9.);
541  fPileUpCount->GetXaxis()->SetBinLabel(1,"plpMV");
542  fPileUpCount->GetXaxis()->SetBinLabel(2,"fromSPD");
543  fPileUpCount->GetXaxis()->SetBinLabel(3,"RefMultiplicityComb08");
544  fPileUpCount->GetXaxis()->SetBinLabel(4,"IncompleteDAQ");
545  fPileUpCount->GetXaxis()->SetBinLabel(5,"abs(V0M-CL1)>7.5");
546  fPileUpCount->GetXaxis()->SetBinLabel(6,"missingVtx");
547  fPileUpCount->GetXaxis()->SetBinLabel(7,"inconsistentVtx");
548  fPileUpCount->GetXaxis()->SetBinLabel(8,"multESDTPCDif");
549  fPileUpCount->GetXaxis()->SetBinLabel(9,"extraPileUpMultSel");
550  fOutput->Add(fPileUpCount);
551  fPileUpMultSelCount = new TH1F("fPileUpMultSelCount", "fPileUpMultSelCount", 8, 0., 8.);
552  fPileUpMultSelCount->GetXaxis()->SetBinLabel(1,"IsNotPileup");
553  fPileUpMultSelCount->GetXaxis()->SetBinLabel(2,"IsNotPileupMV");
554  fPileUpMultSelCount->GetXaxis()->SetBinLabel(3,"IsNotPileupInMultBins");
555  fPileUpMultSelCount->GetXaxis()->SetBinLabel(4,"InconsistentVertices");
556  fPileUpMultSelCount->GetXaxis()->SetBinLabel(5,"TrackletVsCluster");
557  fPileUpMultSelCount->GetXaxis()->SetBinLabel(6,"AsymmetricInVZERO");
558  fPileUpMultSelCount->GetXaxis()->SetBinLabel(7,"IncompleteDAQ");
559  fPileUpMultSelCount->GetXaxis()->SetBinLabel(8,"GoodVertex2016");
561 
562  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);
563  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);
564  fOutput->Add(fMultTOFLowCut);
565  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);
566  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);
567  fOutput->Add(fMultTOFHighCut);
568 
569  for(Int_t c=0; c<2; c++) {
570  for(Int_t i=0; i<5; i++) {
571  fTowerGainEq[c][i] = new TH1D();
572  fOutput->Add(fTowerGainEq[c][i]);
573  }
574  }
575 
576  for (Int_t c=0; c<2; c++) {
577  fhZNCenDis[c] = new TH3D(Form("fhZNCenDis[%d]",c), Form("fhZNCenDis[%d]",c), 100, 0., 100., 100, -2., 2. , 100., -2., 2.);
578  fOutput->Add(fhZNCenDis[c]);
579  }
580 
581  if(fBadTowerCalibList) {
582  for(Int_t c=0; c<100; c++) {
583  fBadTowerCalibHist[c] = (TH2D*)fBadTowerCalibList->FindObject(Form("TH2Resp[%d]",c));
585  }
586  }
587  if(fZDCSpectraCorrList) {
588  for(Int_t i=0; i<8; i++) {
589  SpecCorMu1[i] = (TH1D*)fZDCSpectraCorrList->FindObject(Form("SpecCorMu1[%d]",i));
590  fOutput->Add(SpecCorMu1[i]);
591  SpecCorMu2[i] = (TH1D*)fZDCSpectraCorrList->FindObject(Form("SpecCorMu2[%d]",i));
592  fOutput->Add(SpecCorMu2[i]);
593  SpecCorAv[i] = (TH1D*)fZDCSpectraCorrList->FindObject(Form("SpecCorAv[%d]",i));
594  fOutput->Add(SpecCorAv[i]);
595  SpecCorSi[i] = (TH1D*)fZDCSpectraCorrList->FindObject(Form("SpecCorSi[%d]",i));
596  fOutput->Add(SpecCorSi[i]);
597  }
598  }
599 
600  fhZNSpectra = new TH3D("fhZNSpectra","fhZNSpectra",100,0.,100.,8,0.,8.,1000,0.,1.E5);
601  fOutput->Add(fhZNSpectra);
602  fhZNSpectraCor = new TH3D("fhZNSpectraCor","fhZNSpectraCor",100,0.,100.,8,0.,8.,1000,0.,1.E5);
603  fOutput->Add(fhZNSpectraCor);
604  fhZNSpectraPow = new TH3D("fhZNSpectraPow","fhZNSpectraPow",100,0.,100.,8,0.,8.,1000,0.,TMath::Power(1.E5,fZDCGainAlpha));
605  fOutput->Add(fhZNSpectraPow);
606  fhZNBCCorr = new TH3D("fhZNBCCorr","fhZNBCCorr",100,0.,100.,500,0.,1.E5,500,0.,1.E5);
607  fOutput->Add(fhZNBCCorr);
608 
609  if(fAnalysisType == "MCAOD") {
610 
611  fSpectraMCList = new TList();
612  fSpectraMCList->SetOwner(kTRUE);
613  fSpectraMCList->SetName("Spectra");
614  fOutput->Add(fSpectraMCList);
615 
616  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.};
617  for(Int_t j=0; j<2; j++) {
618  for(Int_t c=0; c<10; c++) {
619  fPtSpecGen[j][c] = new TH1F(Form("fPtSpecGen[%d][%d]",j,c), Form("fPtSpecGen[%d][%d]",j,c), 23, xmin);
620  fSpectraMCList->Add(fPtSpecGen[j][c]);
621  fPtSpecFB32[j][c] = new TH1F(Form("fPtSpecFB32[%d][%d]",j,c), Form("fPtSpecFB32[%d][%d]",j,c), 23, xmin);
622  fSpectraMCList->Add(fPtSpecFB32[j][c]);
623  fPtSpecFB96[j][c] = new TH1F(Form("fPtSpecFB96[%d][%d]",j,c), Form("fPtSpecFB96[%d][%d]",j,c), 23, xmin);
624  fSpectraMCList->Add(fPtSpecFB96[j][c]);
625  fPtSpecFB128[j][c] = new TH1F(Form("fPtSpecFB128[%d][%d]",j,c), Form("fPtSpecFB128[%d][%d]",j,c), 23, xmin);
626  fSpectraMCList->Add(fPtSpecFB128[j][c]);
627  fPtSpecFB768[j][c] = new TH1F(Form("fPtSpecFB768[%d][%d]",j,c), Form("fPtSpecFB768[%d][%d]",j,c), 23, xmin);
628  fSpectraMCList->Add(fPtSpecFB768[j][c]);
629  }
630  }
631  }
632 
633  fAnalysisUtil = new AliAnalysisUtils();
634  fAnalysisUtil->SetUseMVPlpSelection(kTRUE);
635  fAnalysisUtil->SetUseOutOfBunchPileUp(kTRUE);
636 
637  for(int i=0; i<5; i++){
638  char hname[20];
639  sprintf(hname,"hZNCPM%d",i);
640  fhZNCPM[i] = new TH1F(hname, hname, 200, -50., 140000);
641  fOutput->Add(fhZNCPM[i]);
642  //
643  sprintf(hname,"hZNAPM%d",i);
644  fhZNAPM[i] = new TH1F(hname, hname, 200, -50., 140000);
645  fOutput->Add(fhZNAPM[i]);
646  //
647  if(i<4){
648  //
649  char hnamenc[20];
650  sprintf(hnamenc, "hZNCPMQ%dPMC",i+1);
651  fhZNCPMQiPMC[i] = new TH1F(hnamenc, hnamenc, 100, 0., 1.);
652  fOutput->Add(fhZNCPMQiPMC[i]);
653  //
654  char hnamena[20];
655  sprintf(hnamena, "hZNAPMQ%dPMC",i+1);
656  fhZNAPMQiPMC[i] = new TH1F(hnamena, hnamena, 100, 0., 1.);
657  fOutput->Add(fhZNAPMQiPMC[i]);
658  }
659  }
660 
661  fhZNCvsZNA = new TH2F("hZNCvsZNA","hZNCvsZNA",200,-50.,140000,200,-50.,140000);
662  fOutput->Add(fhZNCvsZNA);
663  fhZDCCvsZDCCA = new TH2F("hZDCCvsZDCCA","hZDCCvsZDCCA",200,0.,180000.,200,0.,200000.);
664  fOutput->Add(fhZDCCvsZDCCA);
665  fhZNCvsZPC = new TH2F("hZNCvsZPC","hZNCvsZPC",200,-50.,50000,200,-50.,140000);
666  fOutput->Add(fhZNCvsZPC);
667  fhZNAvsZPA = new TH2F("hZNAvsZPA","hZNAvsZPA",200,-50.,50000,200,-50.,140000);
668  fOutput->Add(fhZNAvsZPA);
669  fhZNvsZP = new TH2F("hZNvsZP","hZNvsZP",200,-50.,80000,200,-50.,200000);
670  fOutput->Add(fhZNvsZP);
671  fhZNvsVZERO = new TH2F("hZNvsVZERO","hZNvsVZERO",250,0.,25000.,200,0.,200000.);
672  fOutput->Add(fhZNvsVZERO);
673  fhZDCvsVZERO = new TH2F("hZDCvsVZERO","hZDCvsVZERO",250,0.,25000.,250,0.,250000.);
674  fOutput->Add(fhZDCvsVZERO);
675  fhZDCvsTracklets = new TH2F("hZDCvsTracklets","hZDCvsTracklets",200,0.,4000.,250,0.,250000.);
677  fhZDCvsNclu1 = new TH2F("hZDCvsNclu1", "hZDCvsNclu1", 200, 0.,8000.,200,0.,250000.);
678  fOutput->Add(fhZDCvsNclu1);
679  fhDebunch = new TH2F("hDebunch","hDebunch",240,-100.,-40.,240,-30.,30.);
680  fOutput->Add(fhDebunch);
681 
682  fhAsymm = new TH1F("hAsymm" , "Asimmetry ",200,-1.,1.);
683  fOutput->Add(fhAsymm);
684  fhZNAvsAsymm = new TH2F("hZNAvsAsymm","ZNA vs. asymm.",200,-1.,1.,200,0.,80.);
685  fOutput->Add(fhZNAvsAsymm);
686  fhZNCvsAsymm = new TH2F("hZNCvsAsymm","ZNC vs. asymm.",200,-1.,1.,200,0.,80.);
687  fOutput->Add(fhZNCvsAsymm);
688 
689  fhZNCvscentrality = new TH2F("hZNCvscentrality","ZNC vs. centrality",100,0.,100.,100,0.,100.);
691  fhZNAvscentrality = new TH2F("hZNAvscentrality","ZNA vs. centrality",100,0.,100.,100,0.,100.);
693 
694  //********************************************************************
695 
696  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};
697 
698  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};
699 
700  // 12 low IR: 244917, 244918, 244975, 244980, 244982, 244983, 245064, 245066, 245068, 246390, 246391, 246392
701  // 80 high IR ("CentralBarrelTracking" good runs): 246994, 246991, 246989, 246984, 246982, 246980, 246948, 246945, 246928, 246871, 246870, 246867, 246865, 246864, 246859, 246858, 246851, 246847, 246846, 246845, 246844, 246810, 246809, 246808, 246807, 246805, 246804, 246766, 246765, 246763, 246760, 246759, 246758, 246757, 246751, 246750, 246676, 246675, 246540, 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
702 
703  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};
704 
705  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};
706 
707  if(fDataSet==k2010) {fCRCnRun=92;}
708  if(fDataSet==k2011) {fCRCnRun=119;}
709  if(fDataSet==k2015) {fCRCnRun=90;}
710  if(fDataSet==k2015v6) {fCRCnRun=91;}
711  if(fDataSet==kAny) {fCRCnRun=1;}
712 
713  Int_t d=0;
714  for(Int_t r=0; r<fCRCnRun; r++) {
715  if(fDataSet==k2010) fRunList[d] = dRun10h[r];
716  if(fDataSet==k2011) fRunList[d] = dRun11h[r];
717  if(fDataSet==k2015) fRunList[d] = dRun15o[r];
718  if(fDataSet==k2015v6) fRunList[d] = dRun15ov6[r];
719  if(fDataSet==kAny) fRunList[d] = 1;
720  d++;
721  }
722 
723  fVZEROMult = new TProfile2D("fVZEROMult","fVZEROMult",fCRCnRun,0.,1.*fCRCnRun,64,0.,64.);
724  for (Int_t i=0; i<fCRCnRun; i++) {
725  fVZEROMult->GetXaxis()->SetBinLabel(i+1,Form("%d",fRunList[i]));
726  }
728 
729  if(fVZEROGainEqList) {
730  fVZEROGainEqHist = (TH2D*)fVZEROGainEqList->FindObject("VZEROEqGain");
732  }
733  if(fVZEROQVecRecList) {
734  for (Int_t k=0; k<fkVZEROnHar; k++) {
735  fVZEROQVectorRecQxStored[k] = (TProfile3D*)fVZEROQVecRecList->FindObject(Form("fVZEROQVectorRecQx[%d]",k));
736  fVZEROQVectorRecQxStored[k]->SetTitle(Form("fVZEROQVectorRecQxStored[%d]",k));
737  fVZEROQVectorRecQxStored[k]->SetName(Form("fVZEROQVectorRecQxStored[%d]",k));
739  fVZEROQVectorRecQyStored[k] = (TProfile3D*)fVZEROQVecRecList->FindObject(Form("fVZEROQVectorRecQy[%d]",k));
740  fVZEROQVectorRecQyStored[k]->SetTitle(Form("fVZEROQVectorRecQyStored[%d]",k));
741  fVZEROQVectorRecQyStored[k]->SetName(Form("fVZEROQVectorRecQyStored[%d]",k));
743  for (Int_t t=0; t<fkVZEROnQAplots; t++) {
744  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");
745  fVZEROQVectorRecFinal[k][t]->Sumw2();
747  }
748  }
749  }
750 
751 // for (Int_t k=0; k<fkVZEROnHar; k++) {
752 // fVZEROQVectorRecQx[k] = new TProfile3D(Form("fVZEROQVectorRecQx[%d]",k),Form("fVZEROQVectorRecQx[%d]",k),fCRCnRun,0.,1.*fCRCnRun,100,0.,100.,8,0.,8.,"s");
753 // fVZEROQVectorRecQx[k]->Sumw2();
754 // fVZEROStuffList->Add(fVZEROQVectorRecQx[k]);
755 // fVZEROQVectorRecQy[k] = new TProfile3D(Form("fVZEROQVectorRecQy[%d]",k),Form("fVZEROQVectorRecQy[%d]",k),fCRCnRun,0.,1.*fCRCnRun,100,0.,100.,8,0.,8.,"s");
756 // fVZEROQVectorRecQy[k]->Sumw2();
757 // fVZEROStuffList->Add(fVZEROQVectorRecQy[k]);
758 // }
759 
760  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.};
761  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.};
762  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};
763 
764  for(Int_t r=0;r<fCRCnRun;r++) {
765  fCRCQVecListRun[r] = new TList();
766  fCRCQVecListRun[r]->SetName(Form("Run %d",fRunList[r]));
767  fCRCQVecListRun[r]->SetOwner(kTRUE);
768  fOutput->Add(fCRCQVecListRun[r]);
769 
770  if(!fUseTowerEq) {
771  for(Int_t k=0;k<fCRCnTow;k++) {
772  fZNCTower[r][k] = new TProfile(Form("fZNCTower[%d][%d]",fRunList[r],k),Form("fZNCTower[%d][%d]",fRunList[r],k),100,0.,100.,"s");
773  fZNCTower[r][k]->Sumw2();
774  fCRCQVecListRun[r]->Add(fZNCTower[r][k]);
775  fZNATower[r][k] = new TProfile(Form("fZNATower[%d][%d]",fRunList[r],k),Form("fZNATower[%d][%d]",fRunList[r],k),100,0.,100.,"s");
776  fZNATower[r][k]->Sumw2();
777  fCRCQVecListRun[r]->Add(fZNATower[r][k]);
778  }
779  }
780 
781 // fhZNSpectraRbR[r] = new TH3D(Form("fhZNSpectraRbR[%d]",fRunList[r]),Form("fhZNSpectraRbR[%d]",fRunList[r]),50,0.,100.,8,0.,8.,100,0.,1.E5);
782 // fCRCQVecListRun[r]->Add(fhZNSpectraRbR[r]);
783 
784  // for(Int_t i=0;i<fnCen;i++) {
785  // fPtPhiEtaRbRFB128[r][i] = new TH3F(Form("fPtPhiEtaRbRFB128[%d][%d]",r,i),Form("fPtPhiEtaRbRFB128[%d][%d]",r,i),14, ptmin, 16, phimin, 16, etamin);
786  // fCRCQVecListRun[r]->Add(fPtPhiEtaRbRFB128[r][i]);
787  // fPtPhiEtaRbRFB768[r][i] = new TH3F(Form("fPtPhiEtaRbRFB768[%d][%d]",r,i),Form("fPtPhiEtaRbRFB768[%d][%d]",r,i),14, ptmin, 16, phimin, 16, etamin);
788  // fCRCQVecListRun[r]->Add(fPtPhiEtaRbRFB768[r][i]);
789  // }
790  }
791 
792  PostData(2, fOutput);
793 }
794 
795 //________________________________________________________________________
797 {
798  // Execute analysis for current event:
799  AliMCEvent* McEvent = MCEvent();
800  AliAODEvent *aod = dynamic_cast<AliAODEvent*>(InputEvent());
801  AliESDEvent *esd = dynamic_cast<AliESDEvent*>(InputEvent());
802  // AliMultiplicity* myTracklets = NULL;
803  // AliESDPmdTrack* pmdtracks = NULL;
804  // int availableINslot=1;
805 
806  if (!(fCutsRP&&fCutsPOI&&fCutsEvent)) {
807  AliError("cuts not set");
808  return;
809  }
810 
811  Int_t RunBin=-1, bin=0;
812  Int_t RunNum = aod->GetRunNumber();
813  for(Int_t c=0;c<fCRCnRun;c++) {
814  if(fRunList[c]==RunNum) RunBin=bin;
815  else bin++;
816  }
817  if(RunBin==-1) return;
818  if(fDataSet==kAny) RunBin=0;
819 
820  //DEFAULT - automatically takes care of everything
821  if (fAnalysisType == "AUTOMATIC") {
822 
823  // get centrality
824  Double_t centrV0M=300, centrCL1=300, centrCL0=300, centrTRK=300;
825  if(fDataSet!=k2015 && fDataSet!=k2015v6) {
826  centrV0M = ((AliVAODHeader*)aod->GetHeader())->GetCentralityP()->GetCentralityPercentile("V0M");
827  centrCL1 = ((AliVAODHeader*)aod->GetHeader())->GetCentralityP()->GetCentralityPercentile("CL1");
828  centrCL0 = ((AliVAODHeader*)aod->GetHeader())->GetCentralityP()->GetCentralityPercentile("CL0");
829  centrTRK = ((AliVAODHeader*)aod->GetHeader())->GetCentralityP()->GetCentralityPercentile("TRK");
830  } else {
831  fMultSelection = (AliMultSelection*) InputEvent()->FindListObject("MultSelection");
832  if(!fMultSelection) {
833  //If you get this warning (and lPercentiles 300) please check that the AliMultSelectionTask actually ran (before your task)
834  AliWarning("AliMultSelection object not found!");
835  } else {
836  centrV0M = fMultSelection->GetMultiplicityPercentile("V0M");
837  centrCL1 = fMultSelection->GetMultiplicityPercentile("CL1");
838  centrCL0 = fMultSelection->GetMultiplicityPercentile("CL0");
839  centrTRK = fMultSelection->GetMultiplicityPercentile("TRK");
840  }
841  }
842 
843  //check event cuts
844  if (InputEvent()) {
845  if(!fCutsEvent->IsSelected(InputEvent(),MCEvent())) return;
846  if(fRejectPileUp) {
847  if(fDataSet!=k2015 && fDataSet!=k2015v6) {
848 
849  Bool_t BisPileup=kFALSE;
850 
851  // check anyway pileup
852  if (plpMV(aod)) {
853  fPileUpCount->Fill(0.5);
854  BisPileup=kTRUE;
855  }
856 
857  Short_t isPileup = aod->IsPileupFromSPD(3);
858  if (isPileup != 0) {
859  fPileUpCount->Fill(1.5);
860  BisPileup=kTRUE;
861  }
862 
863  if (((AliAODHeader*)aod->GetHeader())->GetRefMultiplicityComb08() < 0) {
864  fPileUpCount->Fill(2.5);
865  BisPileup=kTRUE;
866  }
867 
868  if (aod->IsIncompleteDAQ()) {
869  fPileUpCount->Fill(3.5);
870  BisPileup=kTRUE;
871  }
872 
873  // check vertex consistency
874  const AliAODVertex* vtTrc = aod->GetPrimaryVertex();
875  const AliAODVertex* vtSPD = aod->GetPrimaryVertexSPD();
876 
877  if (vtTrc->GetNContributors() < 2 || vtSPD->GetNContributors()<1) {
878  fPileUpCount->Fill(5.5);
879  BisPileup=kTRUE;
880  }
881 
882  double covTrc[6], covSPD[6];
883  vtTrc->GetCovarianceMatrix(covTrc);
884  vtSPD->GetCovarianceMatrix(covSPD);
885 
886  double dz = vtTrc->GetZ() - vtSPD->GetZ();
887 
888  double errTot = TMath::Sqrt(covTrc[5]+covSPD[5]);
889  double errTrc = TMath::Sqrt(covTrc[5]);
890  double nsigTot = dz/errTot;
891  double nsigTrc = dz/errTrc;
892 
893  if (TMath::Abs(dz)>0.2 || TMath::Abs(nsigTot)>10 || TMath::Abs(nsigTrc)>20) {
894  fPileUpCount->Fill(6.5);
895  BisPileup=kTRUE;
896  }
897 
898  if (fAnalysisUtil->IsPileUpEvent(InputEvent())) {
899  fPileUpCount->Fill(7.5);
900  BisPileup=kTRUE;
901  }
902 
903 // if(BisPileup) return;
904  } else {
905  // pileup from AliMultSelection
906  if(!fMultSelection->GetThisEventIsNotPileup()) fPileUpMultSelCount->Fill(0.5);
907  if(!fMultSelection->GetThisEventIsNotPileupMV()) fPileUpMultSelCount->Fill(1.5);
908  if(!fMultSelection->GetThisEventIsNotPileupInMultBins()) fPileUpMultSelCount->Fill(2.5);
909  if(!fMultSelection->GetThisEventHasNoInconsistentVertices()) fPileUpMultSelCount->Fill(3.5);
910  if(!fMultSelection->GetThisEventPassesTrackletVsCluster()) fPileUpMultSelCount->Fill(4.5);
911  if(!fMultSelection->GetThisEventIsNotAsymmetricInVZERO()) fPileUpMultSelCount->Fill(5.5);
912  if(!fMultSelection->GetThisEventIsNotIncompleteDAQ()) fPileUpMultSelCount->Fill(6.5);
913  if(!fMultSelection->GetThisEventHasGoodVertex2016()) fPileUpMultSelCount->Fill(7.5);
914 
915  Bool_t BisPileup=kFALSE;
916 
917  // pile-up a la Dobrin for LHC15o
918  if (plpMV(aod)) {
919  fPileUpCount->Fill(0.5);
920  BisPileup=kTRUE;
921  }
922 
923  Short_t isPileup = aod->IsPileupFromSPD(3);
924  if (isPileup != 0) {
925  fPileUpCount->Fill(1.5);
926  BisPileup=kTRUE;
927  }
928 
929  if (((AliAODHeader*)aod->GetHeader())->GetRefMultiplicityComb08() < 0) {
930  fPileUpCount->Fill(2.5);
931  BisPileup=kTRUE;
932  }
933 
934  if (aod->IsIncompleteDAQ()) {
935  fPileUpCount->Fill(3.5);
936  BisPileup=kTRUE;
937  }
938 
939  if(fabs(centrV0M-centrCL1)>7.5) {
940  fPileUpCount->Fill(4.5);
941  BisPileup=kTRUE;
942  }
943 
944  // check vertex consistency
945  const AliAODVertex* vtTrc = aod->GetPrimaryVertex();
946  const AliAODVertex* vtSPD = aod->GetPrimaryVertexSPD();
947 
948  if (vtTrc->GetNContributors() < 2 || vtSPD->GetNContributors()<1) {
949  fPileUpCount->Fill(5.5);
950  BisPileup=kTRUE;
951  }
952 
953  double covTrc[6], covSPD[6];
954  vtTrc->GetCovarianceMatrix(covTrc);
955  vtSPD->GetCovarianceMatrix(covSPD);
956 
957  double dz = vtTrc->GetZ() - vtSPD->GetZ();
958 
959  double errTot = TMath::Sqrt(covTrc[5]+covSPD[5]);
960  double errTrc = TMath::Sqrt(covTrc[5]);
961  double nsigTot = dz/errTot;
962  double nsigTrc = dz/errTrc;
963 
964  if (TMath::Abs(dz)>0.2 || TMath::Abs(nsigTot)>10 || TMath::Abs(nsigTrc)>20) {
965  fPileUpCount->Fill(6.5);
966  BisPileup=kTRUE;
967  }
968 
969  // cuts on tracks
970  const Int_t nTracks = aod->GetNumberOfTracks();
971  Int_t multEsd = ((AliAODHeader*)aod->GetHeader())->GetNumberOfESDTracks();
972 
973  Int_t multTrk = 0;
974  Int_t multTrkBefC = 0;
975  Int_t multTrkTOFBefC = 0;
976  Int_t multTPC = 0;
977 
978  for (Int_t it = 0; it < nTracks; it++) {
979 
980  AliAODTrack* aodTrk = (AliAODTrack*)aod->GetTrack(it);
981  if (!aodTrk){
982  delete aodTrk;
983  continue;
984  }
985 
986 // if (aodTrk->TestFilterBit(32)){
987 // multTrkBefC++;
988 //
989 // if ( TMath::Abs(aodTrk->GetTOFsignalDz()) <= 10. && aodTrk->GetTOFsignal() >= 12000. && aodTrk->GetTOFsignal() <= 25000.)
990 // multTrkTOFBefC++;
991 //
992 // if ((TMath::Abs(aodTrk->Eta()) < 0.8) && (aodTrk->GetTPCNcls() >= 70) && (aodTrk->Pt() >= 0.2) && (aodTrk->Pt() < 20.))
993 // multTrk++;
994 // }
995 
996  if (aodTrk->TestFilterBit(128))
997  multTPC++;
998 
999  } // end of for (Int_t it = 0; it < nTracks; it++)
1000 
1001  Double_t multTPCn = multTPC;
1002  Double_t multEsdn = multEsd;
1003  Double_t multESDTPCDif = multEsdn - multTPCn*3.38;
1004 
1005  if (multESDTPCDif > (fRejectPileUpTight?700.:15000.)) {
1006  fPileUpCount->Fill(7.5);
1007  BisPileup=kTRUE;
1008  }
1009 
1010  if(fRejectPileUpTight) {
1011  if(BisPileup==kFALSE) {
1012  if(!fMultSelection->GetThisEventIsNotPileup()) BisPileup=kTRUE;
1013  if(!fMultSelection->GetThisEventIsNotPileupMV()) BisPileup=kTRUE;
1014  if(!fMultSelection->GetThisEventIsNotPileupInMultBins()) BisPileup=kTRUE;
1015  if(!fMultSelection->GetThisEventHasNoInconsistentVertices()) BisPileup=kTRUE;
1016  if(!fMultSelection->GetThisEventPassesTrackletVsCluster()) BisPileup=kTRUE;
1017  if(!fMultSelection->GetThisEventIsNotIncompleteDAQ()) BisPileup=kTRUE;
1018  if(!fMultSelection->GetThisEventHasGoodVertex2016()) BisPileup=kTRUE;
1019  if(BisPileup) fPileUpCount->Fill(8.5);
1020  }
1021  }
1022 
1023  if(BisPileup) return;
1024  }
1025  }
1026  }
1027 
1028  //first attach all possible information to the cuts
1029  fCutsRP->SetEvent( InputEvent(), MCEvent() ); //attach event
1030  fCutsPOI->SetEvent( InputEvent(), MCEvent() );
1031 
1032  //then make the event
1034 
1036 
1037  if(fCentrEstimator==kV0M) fFlowEvent->SetCentrality(centrV0M);
1038  if(fCentrEstimator==kCL0) fFlowEvent->SetCentrality(centrCL0);
1039  if(fCentrEstimator==kCL1) fFlowEvent->SetCentrality(centrCL1);
1040  if(fCentrEstimator==kTRK) fFlowEvent->SetCentrality(centrTRK);
1041  fFlowEvent->SetCentralityCL1(centrCL1);
1042  fFlowEvent->SetCentralityTRK(centrTRK);
1043  // fFlowEvent->SetNITSCL1(((AliVAODHeader*)aod->GetHeader())->GetNumberOfITSClusters(1));
1044  Double_t SumV0=0.;
1045  for(Int_t i=0; i<64; i++) {
1046  if(std::isfinite(aod->GetVZEROEqMultiplicity(i))) SumV0 += aod->GetVZEROEqMultiplicity(i);
1047  }
1048  fFlowEvent->SetNITSCL1(SumV0);
1049 
1050  Double_t vtxpos[3]={0.,0.,0.};
1051  vtxpos[0] = ((AliAODVertex*)aod->GetPrimaryVertex())->GetX();
1052  vtxpos[1] = ((AliAODVertex*)aod->GetPrimaryVertex())->GetY();
1053  vtxpos[2] = ((AliAODVertex*)aod->GetPrimaryVertex())->GetZ();
1054  fFlowEvent->SetVertexPosition(vtxpos);
1055 
1056  if (McEvent && McEvent->GenEventHeader()) fFlowEvent->SetMCReactionPlaneAngle(McEvent);
1057 
1058  // run-by-run QA
1059  // for(Int_t jTracks = 0; jTracks<aod->GetNumberOfTracks(); jTracks++){
1060  // AliAODTrack* track = (AliAODTrack*)aod->GetTrack(jTracks);
1061  // if(!track) continue;
1062  // // general kinematic & quality cuts
1063  // if (track->Pt() < .2 || track->Pt() > 20. || TMath::Abs(track->Eta()) > .8 || track->GetTPCNcls() < 70) continue;
1064  // if (track->TestFilterBit(128)) fPtPhiEtaRbRFB128[RunBin][CenBin]->Fill(track->Pt(),track->Phi(),track->Eta());
1065  // if (track->TestFilterBit(768)) fPtPhiEtaRbRFB768[RunBin][CenBin]->Fill(track->Pt(),track->Phi(),track->Eta());
1066  // }
1067  fCenDis->Fill(centrV0M);
1068 
1069  }
1070 
1071  if (fAnalysisType == "MCAOD") {
1072 
1073  //check event cuts
1074  if (InputEvent()) {
1075  if(!fCutsEvent->IsSelected(InputEvent(),MCEvent())) return;
1076  if(fRejectPileUp && fAnalysisUtil->IsPileUpEvent(InputEvent())) return;
1077  }
1078 
1079  fFlowEvent->ClearFast();
1080 
1081  if(!McEvent) {
1082  AliError("ERROR: Could not retrieve MCEvent");
1083  return;
1084  }
1085  fStack = (TClonesArray*)aod->FindListObject(AliAODMCParticle::StdBranchName());
1086  if(!fStack){
1087  AliError("ERROR: Could not retrieve MCStack");
1088  return;
1089  }
1090 
1091  // get centrality (from AliMultSelection or AliCentrality)
1092  Double_t centr = 300;
1093  if(fDataSet==k2015 || fDataSet==k2015v6) {
1094  fMultSelection = (AliMultSelection*)aod->FindListObject("MultSelection");
1095  if(!fMultSelection) {
1096  //If you get this warning (and lPercentiles 300) please check that the AliMultSelectionTask actually ran (before your task)
1097  AliWarning("AliMultSelection object not found!");
1098  } else {
1099  centr = fMultSelection->GetMultiplicityPercentile("V0M");
1100  }
1101  } else {
1102  centr = (((AliVAODHeader*)aod->GetHeader())->GetCentralityP())->GetCentralityPercentile("V0M");
1103  }
1104  // centrality bin
1105  if (centr<fCentrLowLim || centr>=fCentrUpLim ) return;
1106  Int_t CenBin = -1;
1107  CenBin = GetCenBin(centr);
1108  if(CenBin==-1) return;
1109 
1110  // reconstructed
1111  for(Int_t jTracks = 0; jTracks<aod->GetNumberOfTracks(); jTracks++){
1112 
1113  AliAODTrack* track = (AliAODTrack*)aod->GetTrack(jTracks);
1114  if(!track) continue;
1115 
1116  // to select primaries
1117  Int_t lp = TMath::Abs(track->GetLabel());
1118 
1119  // general kinematic & quality cuts
1120  if (track->Pt() < .2 || track->Pt() > 20. || TMath::Abs(track->Eta()) > .8 || track->GetTPCNcls() < 70) continue;
1121 
1122  // Double_t DCAxy = track->DCA();
1123  // Double_t DCAz = track->ZAtDCA();
1124  // if (std::abs((Int_t)DCAxy)==999 || std::abs((Int_t)DCAz)==999) {
1125  // // re-evaluate the dca as it seems to not be natively present
1126  // // allowed only for tracks inside the beam pipe
1127  // Double_t pos[3] = {-99., -99., -99.};
1128  // track->GetPosition(pos);
1129  // if(pos[0]*pos[0]+pos[1]*pos[1] <= 3.*3.) {
1130  // AliAODTrack copy(*track); // stack copy
1131  // Double_t b[2] = {-99., -99.};
1132  // Double_t bCov[3] = {-99., -99., -99.};
1133  // if(copy.PropagateToDCA(aod->GetPrimaryVertex(), aod->GetMagneticField(), 100., b, bCov)) {
1134  // DCAxy = b[0];
1135  // DCAz = b[1];
1136  // }
1137  // }
1138  // }
1139 
1140  // test filter bits
1141  if (((AliAODMCParticle*)fStack->At(lp))->IsPhysicalPrimary()) {
1142  if (track->TestFilterBit(32)) fPtSpecFB32[0][CenBin]->Fill(track->Pt());
1143  if (track->TestFilterBit(96)) fPtSpecFB96[0][CenBin]->Fill(track->Pt());
1144  if (track->TestFilterBit(128)) fPtSpecFB128[0][CenBin]->Fill(track->Pt());
1145  if (track->TestFilterBit(768)) fPtSpecFB768[0][CenBin]->Fill(track->Pt());
1146  } else {
1147  if (track->TestFilterBit(32)) fPtSpecFB32[1][CenBin]->Fill(track->Pt());
1148  if (track->TestFilterBit(96)) fPtSpecFB96[1][CenBin]->Fill(track->Pt());
1149  if (track->TestFilterBit(128)) fPtSpecFB128[1][CenBin]->Fill(track->Pt());
1150  if (track->TestFilterBit(768)) fPtSpecFB768[1][CenBin]->Fill(track->Pt());
1151  }
1152 
1153  fCenDis->Fill(centr);
1154  }
1155 
1156  // generated (physical primaries)
1157 
1158  for(Int_t jTracks = 0; jTracks<fStack->GetEntriesFast(); jTracks++) {
1159  AliAODMCParticle *MCpart = (AliAODMCParticle*)fStack->At(jTracks);
1160  if (!MCpart) {
1161  printf("ERROR: Could not receive MC track %d\n", jTracks);
1162  continue;
1163  }
1164  // kinematic cuts
1165  if ( MCpart->Pt() < .2 || MCpart->Pt() > 20. || TMath::Abs(MCpart->Eta()) > .8 ) continue;
1166  // select charged primaries
1167  if ( MCpart->Charge() == 0. || !MCpart->IsPhysicalPrimary()) continue;
1168 
1169  fPtSpecGen[0][CenBin]->Fill(MCpart->Pt());
1170  }
1171 
1172  // fGenHeader = McEvent->GenEventHeader();
1173  // if(fGenHeader) fPythiaGenHeader = dynamic_cast<AliGenPythiaEventHeader*>(fGenHeader);
1174  // printf("#reconstructed : %d (rejected from cuts %d), #MC primaries : %d (rejected from cuts %d) \n",AODPOIs,AODbads,MCPrims,MCSecos);
1175  fFlowEvent->SetReferenceMultiplicity(aod->GetNumberOfTracks());
1176  fFlowEvent->SetCentrality(centr);
1177  // if (McEvent && McEvent->GenEventHeader()) fFlowEvent->SetMCReactionPlaneAngle(McEvent);
1178  fFlowEvent->SetRun(RunNum);
1179  // printf("Run : %d, RefMult : %d, Cent : %f \n",fFlowEvent->GetRun(),fFlowEvent->GetReferenceMultiplicity(),fFlowEvent->GetCentrality());
1180  }
1181 
1182  if(fAnalysisType == "MCESD") {
1183 
1184  fFlowEvent->ClearFast();
1185 
1186  if(!esd) {
1187  AliError("ERROR: Could not retrieve ESDEvent");
1188  return;
1189  }
1190  if(!McEvent) {
1191  AliError("ERROR: Could not retrieve MCEvent");
1192  return;
1193  }
1194  AliStack* fStack = fMCEvent->Stack();
1195  if(!fStack) {
1196  AliError("ERROR: Could not retrieve MCStack");
1197  return;
1198  }
1199 
1200  AliESDVertex *vertex = (AliESDVertex*) esd->GetPrimaryVertex();
1201  if (!vertex) return;
1202  if (TMath::Abs(vertex->GetZ()) > 10. ) return;
1203  if (vertex->GetNContributors() < 1 ) return;
1204  AliCentrality *centrality = esd->GetCentrality();
1205  if (!centrality) return;
1206  Double_t centr = centrality->GetCentralityPercentile("V0M");
1207  if (centr<fCentrLowLim || centr>=fCentrUpLim ) return;
1208  Int_t CenBin = -1;
1209  if (centr>0. && centr<5.) CenBin=0;
1210  if (centr>5. && centr<10.) CenBin=1;
1211  if (centr>10. && centr<20.) CenBin=2;
1212  if (centr>20. && centr<30.) CenBin=3;
1213  if (centr>30. && centr<40.) CenBin=4;
1214  if (centr>40. && centr<50.) CenBin=5;
1215  if (centr>50. && centr<60.) CenBin=6;
1216  if (centr>60. && centr<70.) CenBin=7;
1217  if (centr>70. && centr<80.) CenBin=8;
1218  if (centr>80. && centr<90.) CenBin=9;
1219  if(CenBin==-1) return;
1220 
1221  //Generated
1222  Int_t MCPrims = 0;
1223  for ( Int_t i=0 ; i<fStack->GetNtrack() ; i++ ) {
1224 
1225  //Primaries Selection
1226  TParticle *particle = (TParticle*)fStack->Particle(i);
1227  if (!particle) continue;
1228  if (!fStack->IsPhysicalPrimary(i)) continue;
1229  if ( particle->GetPDG()->Charge() == 0.) continue;
1230 
1231  //Kinematic Cuts
1232  if ( particle->Pt()<0.2 || particle->Pt()>10. ) continue;
1233  if ( TMath::Abs(particle->Eta())>0.8 ) continue;
1234 
1235  fFlowTrack->SetPhi(particle->Phi());
1236  fFlowTrack->SetEta(particle->Eta());
1237  fFlowTrack->SetPt(particle->Pt());
1239  fFlowTrack->SetForRPSelection(kTRUE);
1241  fFlowTrack->SetForPOISelection(kFALSE);
1243  MCPrims++;
1244 
1245  fPtSpecGen[0][CenBin]->Fill(particle->Pt());
1246 
1247  }
1248 
1249  //Reconstructed
1250  Int_t ESDPrims = 0;
1251  for (Int_t i=0 ; i<esd->GetNumberOfTracks() ; i++) {
1252 
1253  //Get reconstructed track
1254  AliVTrack *vtrack = static_cast<AliVTrack*>(esd->GetTrack(i));
1255  AliESDtrack *track = dynamic_cast<AliESDtrack*>(vtrack);
1256  if (!track) continue;
1257 
1258  //Primaries selection
1259  Int_t lp = TMath::Abs(track->GetLabel());
1260  if (!fStack->IsPhysicalPrimary(lp)) continue;
1261  TParticle *particle = (TParticle*)fStack->Particle(lp);
1262  if (!particle) continue;
1263  if (particle->GetPDG()->Charge() == 0.) continue;
1264 
1265  // if(!fCutsPOI->PassesESDcuts(track)) continue;
1266 
1267  Bool_t pass = kTRUE;
1268 
1269  if(fCutTPC) {
1270  // printf("******* cutting TPC ******** \n");
1271  UShort_t ntpccls = track->GetTPCNcls();
1272  Double_t tpcchi2 = track->GetTPCchi2();
1273  if (tpcchi2<0.2 || tpcchi2 >=4.) {
1274  // printf("TPCchi2 : %e %e ",tpcchi2,track->GetTPCchi2Iter1());
1275  pass=kFALSE;
1276  }
1277  if (ntpccls < 70) {
1278  // printf("#TPCcluster : %u %u %u %u ",ntpccls,track->GetTPCNclsF(),track->GetTPCNclsFIter1(),track->GetTPCNclsIter1());
1279  pass=kFALSE;
1280  }
1281  }
1282 
1283  Float_t dcaxy=0.0;
1284  Float_t dcaz=0.0;
1285  track->GetImpactParameters(dcaxy,dcaz);
1286  if (dcaxy > 0.3 || dcaz > 0.3) {
1287  // printf("DCA : %e %e ",dcaxy,dcaz);
1288  pass=kFALSE;
1289  }
1290  if(!pass) continue;
1291 
1292  //Kinematic Cuts
1293  if ( track->Pt()<0.2 || track->Pt()>10. ) continue;
1294  if ( TMath::Abs(track->Eta())>0.8 ) continue;
1295 
1296  fFlowTrack->SetPhi(track->Phi());
1297  fFlowTrack->SetEta(track->Eta());
1298  fFlowTrack->SetPt(track->Pt());
1300  fFlowTrack->SetForRPSelection(kFALSE);
1304  ESDPrims++;
1305 
1306  }
1307 
1308  // printf("#reconstructed : %d , #MC primaries : %d \n",ESDPrims,MCPrims);
1309  fFlowEvent->SetReferenceMultiplicity(esd->GetNumberOfTracks());
1310  fFlowEvent->SetCentrality(centr);
1311  if (McEvent && McEvent->GenEventHeader()) fFlowEvent->SetMCReactionPlaneAngle(McEvent);
1312  fFlowEvent->SetRun(esd->GetRunNumber());
1313  // printf("Run : %d, RefMult : %d, Cent : %f \n",fFlowEvent->GetRun(),fFlowEvent->GetReferenceMultiplicity(),fFlowEvent->GetCentrality());
1314 
1315  } // end of if(fAnalysisType == "MCESD")
1316 
1317  if(fAnalysisType == "MCkine") {
1318 
1319  fFlowEvent->ClearFast();
1320 
1321  AliInputEventHandler* McHandler = dynamic_cast<AliInputEventHandler*> (AliAnalysisManager::GetAnalysisManager()->GetMCtruthEventHandler());
1322  if(!McHandler) {
1323  AliError("ERROR: Could not retrieve MCtruthEventHandler");
1324  return;
1325  }
1326  McEvent = McHandler->MCEvent();
1327  if(!McEvent) {
1328  AliError("ERROR: Could not retrieve MC event");
1329  return;
1330  }
1331 
1332  Int_t nTracks = McEvent->GetNumberOfTracks();
1333  // Int_t nPrimTr = McEvent->GetNumberOfPrimaries();
1334 
1335  //loop over tracks
1336  for (Int_t itrkN=0; itrkN<nTracks; itrkN++) {
1337  //get input particle
1338  AliMCParticle* pParticle = dynamic_cast<AliMCParticle*>(McEvent->GetTrack(itrkN));
1339  if (!pParticle) continue;
1340 
1341  //check if track passes the cuts
1342  if (McEvent->IsPhysicalPrimary(itrkN) && pParticle->Charge()!=0) {
1343  fFlowTrack->Set(pParticle);
1345  fFlowTrack->SetForRPSelection(kTRUE);
1350  }
1351  }// for all tracks
1352 
1353  // if monte carlo event get reaction plane from monte carlo (depends on generator)
1354  if (McEvent && McEvent->GenEventHeader()) fFlowEvent->SetMCReactionPlaneAngle(McEvent);
1355  // set reference multiplicity
1356  fFlowEvent->SetReferenceMultiplicity(McEvent->GetNumberOfTracks());
1357  // tag subevents
1359  // set centrality from impact parameter
1360  Double_t ImpPar=0., CenPer=0.;
1361  fGenHeader = McEvent->GenEventHeader();
1362  if(fGenHeader){
1363  fPythiaGenHeader = dynamic_cast<AliGenPythiaEventHeader*>(fGenHeader);
1364  if(fPythiaGenHeader) ImpPar = fPythiaGenHeader->GetImpactParameter();
1365  fHijingGenHeader = dynamic_cast<AliGenHijingEventHeader*>(fGenHeader);
1366  if(fHijingGenHeader) ImpPar = fHijingGenHeader->ImpactParameter();
1367  if(ImpPar) CenPer = 0.3859796743103508*pow(ImpPar,2.);
1368  if(CenPer>0. && CenPer<100.) fFlowEvent->SetCentrality(CenPer);
1369  else return;
1370  fFlowEvent->SetRun(1);
1371  }
1372 
1373  } // end of if(fAnalysisType == "MCkine")
1374 
1375  if (!fFlowEvent) return; //shuts up coverity
1376 
1377  //check final event cuts
1378  Int_t mult = fFlowEvent->NumberOfTracks();
1379  // AliInfo(Form("FlowEvent has %i tracks",mult));
1380  if (mult<fMinMult || mult>fMaxMult) {
1381  AliWarning("FlowEvent cut on multiplicity"); return;
1382  }
1383 
1384  //define dead zone
1386 
1389  if (fAfterburnerOn)
1390  {
1391  //if reaction plane not set from elsewhere randomize it before adding flow
1393  fFlowEvent->SetMCReactionPlaneAngle(gRandom->Uniform(0.0,TMath::TwoPi()));
1394 
1395  if(fDifferentialV2)
1397  else
1398  fFlowEvent->AddFlow(fV1,fV2,fV3,fV4,fV5); //add flow
1399  fFlowEvent->CloneTracks(fNonFlowNumberOfTrackClones); //add nonflow by cloning tracks
1400  }
1402 
1403  //tag subEvents
1405 
1406  //do we want to serve shullfed tracks to everybody?
1408 
1409  // associate the mother particles to their daughters in the flow event (if any)
1411 
1412  //fListHistos->Print();
1413  //fOutputFile->WriteObject(fFlowEvent,"myFlowEventSimple");
1414 
1415  //********************************************************************************************************************************
1416 
1417  if(fAnalysisType == "AOD" || fAnalysisType == "AUTOMATIC") {
1418 
1419  // PHYSICS SELECTION
1420  AliAnalysisManager *am = AliAnalysisManager::GetAnalysisManager();
1421  AliInputEventHandler *hdr = (AliInputEventHandler*)am->GetInputEventHandler();
1422 
1423  if(hdr->IsEventSelected() && AliVEvent::kAny) {
1424 
1425  Double_t centrperc = fFlowEvent->GetCentrality();
1426  Int_t cenb = (Int_t)centrperc;
1427 
1428  AliAODTracklets *trackl = aod->GetTracklets();
1429  Int_t nTracklets = trackl->GetNumberOfTracklets();
1430 
1431  // VZERO
1432 
1433  // get VZERO data
1434  AliAODVZERO *vzeroAOD = aod->GetVZEROData();
1435  Double_t multV0A = vzeroAOD->GetMTotV0A();
1436  Double_t multV0C = vzeroAOD->GetMTotV0C();
1437  Int_t CachednRing = 1;
1438  Double_t QxTot[fkVZEROnHar] = {0.}, QyTot[fkVZEROnHar] = {0.};
1439  Double_t denom = 0.;
1440  Double_t V0TotQC[fkVZEROnHar][2] = {{0.}}, V0TotQA[fkVZEROnHar][2] = {{0.}};
1441  Double_t MultC=0., MultA=0.;
1442 
1443  for(Int_t i=0; i<64; i++) {
1444 
1445  // correct multiplicity per channel
1446  Double_t mult = vzeroAOD->GetMultiplicity(i);
1447  if(fVZEROGainEqHist) {
1448  Double_t EqFactor = fVZEROGainEqHist->GetBinContent(RunBin+1,i+1);
1449  if(EqFactor>0.) mult *= EqFactor;
1450  }
1451  fVZEROMult->Fill(RunBin+0.5,i+0.5,mult);
1452 
1453  // build Q-vector per ring
1454  Int_t nRing = (Int_t)i/8 + 1;
1455  Double_t ChPhi = TMath::PiOver4()*(0.5+i%8);
1456 
1457  if(i == 63) {
1458  for (Int_t k=0; k<fkVZEROnHar; k++) {
1459  QxTot[k] += mult*TMath::Cos((k+1.)*ChPhi);
1460  QyTot[k] += mult*TMath::Sin((k+1.)*ChPhi);
1461  }
1462  denom += mult;
1463  nRing++;
1464  }
1465 
1466  if(nRing!=CachednRing) {
1467  for (Int_t k=0; k<fkVZEROnHar; k++) {
1468  Double_t QxRec = QxTot[k]/denom;
1469  Double_t QyRec = QyTot[k]/denom;
1470  // store values for re-centering
1471 // fVZEROQVectorRecQx[k]->Fill(RunBin+0.5,centrperc,CachednRing-0.5,QxRec);
1472 // fVZEROQVectorRecQy[k]->Fill(RunBin+0.5,centrperc,CachednRing-0.5,QyRec);
1473  // do re-centering
1474  if(fVZEROQVectorRecQxStored[k]) {
1475  QxRec -= fVZEROQVectorRecQxStored[k]->GetBinContent(fVZEROQVectorRecQxStored[k]->FindBin(RunBin+0.5,centrperc,CachednRing-0.5));
1476  QyRec -= fVZEROQVectorRecQyStored[k]->GetBinContent(fVZEROQVectorRecQyStored[k]->FindBin(RunBin+0.5,centrperc,CachednRing-0.5));
1477  }
1478  // sum of Q-vectors over all rings (total V0 Q-vector)
1479  if (CachednRing <= 4) {
1480  V0TotQC[k][0] += QxRec*denom;
1481  V0TotQC[k][1] += QyRec*denom;
1482  MultC += denom;
1483  } else {
1484  V0TotQA[k][0] += QxRec*denom;
1485  V0TotQA[k][1] += QyRec*denom;
1486  MultA += denom;
1487  }
1488  QxTot[k] = 0.;
1489  QyTot[k] = 0.;
1490  }
1491  denom = 0.;
1492  CachednRing = nRing;
1493  }
1494  for (Int_t k=0; k<fkVZEROnHar; k++) {
1495  QxTot[k] += mult*TMath::Cos((k+1.)*ChPhi);
1496  QyTot[k] += mult*TMath::Sin((k+1.)*ChPhi);
1497  }
1498  denom += mult;
1499  }
1500 
1501  for (Int_t k=0; k<fkVZEROnHar; k++) {
1502  Double_t QCx = V0TotQC[k][0]/MultC, QCy = V0TotQC[k][1]/MultC, QAx = V0TotQA[k][0]/MultA, QAy = V0TotQA[k][1]/MultA;
1503  fFlowEvent->SetV02Qsub(QCx,QCy,MultC,QAx,QAy,MultA,k+1);
1504  fVZEROQVectorRecFinal[k][0]->Fill(RunBin+0.5,centrperc,QCx);
1505  fVZEROQVectorRecFinal[k][1]->Fill(RunBin+0.5,centrperc,QCy);
1506  fVZEROQVectorRecFinal[k][2]->Fill(RunBin+0.5,centrperc,QAx);
1507  fVZEROQVectorRecFinal[k][3]->Fill(RunBin+0.5,centrperc,QAy);
1508  fVZEROQVectorRecFinal[k][4]->Fill(RunBin+0.5,centrperc,QCx*QAx);
1509  fVZEROQVectorRecFinal[k][5]->Fill(RunBin+0.5,centrperc,QCy*QAy);
1510  fVZEROQVectorRecFinal[k][6]->Fill(RunBin+0.5,centrperc,QCx*QAy);
1511  fVZEROQVectorRecFinal[k][7]->Fill(RunBin+0.5,centrperc,QCy*QAx);
1512  }
1513 
1514 
1515 
1516 // AliAODForwardMult* aodForward = static_cast<AliAODForwardMult*>(aodEvent->FindListObject("Forward"));
1517 // const TH2D& d2Ndetadphi = aodForward->GetHistogram();
1518 // Int_t nEta = d2Ndetadphi.GetXaxis()->GetNbins();
1519 // Int_t nPhi = d2Ndetadphi.GetYaxis()->GetNbins();
1520 // Double_t ret = 0.;
1521 // // Loop over eta
1522 // for (Int_t iEta = 1; iEta <= nEta; iEta++) {
1523 // Int_t valid = d2Ndetadphi.GetBinContent(iEta, 0);
1524 // if (!valid) continue; // No data expected for this eta
1525 // // Loop over phi
1526 // for (Int_t iPhi = 1; i <= nPhi; i++) {
1527 // ret = d2Ndetadphi.GetBinContent(iEta, iPhi);
1528 // printf("eta %e phi %e : %e \n",d2Ndetadphi.GetXaxis()->GetBinCenter(iEta),d2Ndetadphi.GetYaxis()->GetBinCenter(iPhi),ret);
1529 // }
1530 // }
1531 
1532  AliAODZDC *aodZDC = aod->GetZDCData();
1533 
1534  Double_t energyZNC = (Double_t) (aodZDC->GetZNCEnergy());
1535  Double_t energyZPC = (Double_t) (aodZDC->GetZPCEnergy());
1536  Double_t energyZNA = (Double_t) (aodZDC->GetZNAEnergy());
1537  Double_t energyZPA = (Double_t) (aodZDC->GetZPAEnergy());
1538  Double_t energyZEM1 = (Double_t) (aodZDC->GetZEM1Energy());
1539  Double_t energyZEM2 = (Double_t) (aodZDC->GetZEM2Energy());
1540 
1541  const Double_t * towZNCraw = aodZDC->GetZNCTowerEnergy();
1542  const Double_t * towZNAraw = aodZDC->GetZNATowerEnergy();
1543 
1544  // Get centroid from ZDCs *******************************************************
1545 
1546  Double_t Enucl = (RunNum < 209122 ? 1380. : 2511.);
1547  Double_t xyZNC[2]={0.,0.}, xyZNA[2]={0.,0.};
1548  Double_t towZNC[5]={0.}, towZNA[5]={0.};
1549 
1550  Double_t ZNCcalib=1., ZNAcalib=1.;
1551  if(fUseTowerEq) {
1552  if(RunNum!=fCachedRunNum) {
1553  for(Int_t i=0; i<5; i++) {
1554  fTowerGainEq[0][i] = (TH1D*)(fTowerEqList->FindObject(Form("fZNCTower[%d][%d]",RunNum,i)));
1555  fTowerGainEq[1][i] = (TH1D*)(fTowerEqList->FindObject(Form("fZNATower[%d][%d]",RunNum,i)));
1556  }
1557  }
1558  for(Int_t i=0; i<5; i++) {
1559  if(fTowerGainEq[0][i]) towZNC[i] = towZNCraw[i]*fTowerGainEq[0][i]->GetBinContent(fTowerGainEq[0][i]->FindBin(centrperc));
1560  if(fTowerGainEq[1][i]) towZNA[i] = towZNAraw[i]*fTowerGainEq[1][i]->GetBinContent(fTowerGainEq[1][i]->FindBin(centrperc));
1561  }
1562  } else {
1563  for(Int_t i=0; i<5; i++) {
1564  towZNC[i] = towZNCraw[i];
1565  towZNA[i] = towZNAraw[i];
1566  fZNCTower[RunBin][i]->Fill(centrperc,towZNC[i]);
1567  fZNATower[RunBin][i]->Fill(centrperc,towZNA[i]);
1568  }
1569  }
1570 
1571  if(RunNum>=245829) towZNA[2] = 0.;
1572  Double_t zncEnergy=0., znaEnergy=0.;
1573  for(Int_t i=0; i<5; i++){
1574  zncEnergy += towZNC[i];
1575  znaEnergy += towZNA[i];
1576  }
1577  if(RunNum>=245829) znaEnergy *= 8./7.;
1578  fFlowEvent->SetZNCEnergy(towZNC[0]);
1579  fFlowEvent->SetZNAEnergy(towZNA[0]);
1580 
1581  const Double_t x[4] = {-1.75, 1.75, -1.75, 1.75};
1582  const Double_t y[4] = {-1.75, -1.75, 1.75, 1.75};
1583  Double_t numXZNC=0., numYZNC=0., denZNC=0., cZNC, wZNC, EZNC, SumEZNC=0.;
1584  Double_t numXZNA=0., numYZNA=0., denZNA=0., cZNA, wZNA, EZNA, SumEZNA=0., BadChOr;
1585  Bool_t fAllChONZNC=kTRUE, fAllChONZNA=kTRUE;
1586 
1587  if (fUseMCCen) {
1588  for(Int_t i=0; i<4; i++){
1589 
1590  // get energy
1591  EZNC = towZNC[i+1];
1592  fhZNSpectra->Fill(centrperc,i+0.5,EZNC);
1593 // fhZNSpectraRbR[RunBin]->Fill(centrperc,i+0.5,EZNC);
1594  if(fUseZDCSpectraCorr && EZNC>0.) {
1595  Double_t mu1 = SpecCorMu1[i]->Interpolate(centrperc);
1596  Double_t mu2 = SpecCorMu2[i]->Interpolate(centrperc);
1597  Double_t av = SpecCorAv[i]->Interpolate(centrperc);
1598  Double_t cor1 = SpecCorSi[i]->Interpolate(centrperc);
1599  EZNC = exp( (log(EZNC) - mu1 + mu2*cor1)/cor1 ) + av;
1600  fhZNSpectraCor->Fill(centrperc,i+0.5,EZNC);
1601  }
1602  if(fUseZDCSpectraCorr && EZNC<=0.) fAllChONZNC=kFALSE;
1603  SumEZNC += EZNC;
1604 
1605  // build centroid
1606  wZNC = TMath::Power(EZNC, fZDCGainAlpha);
1607  numXZNC += x[i]*wZNC;
1608  numYZNC += y[i]*wZNC;
1609  denZNC += wZNC;
1610  fhZNSpectraPow->Fill(centrperc,i+0.5,wZNC);
1611 
1612  // get energy
1613  if(i==1) {
1614  EZNA = towZNA[0]-towZNA[1]-towZNA[3]-towZNA[4];
1615  if(fUseBadTowerCalib && fBadTowerCalibHist[cenb]) {
1616  EZNA = GetBadTowerResp(EZNA, fBadTowerCalibHist[cenb]);
1617  }
1618  } else {
1619  EZNA = towZNA[i+1];
1620  }
1621  fhZNSpectra->Fill(centrperc,i+4.5,EZNA);
1622 // fhZNSpectraRbR[RunBin]->Fill(centrperc,i+4.5,EZNA);
1623  if(fUseZDCSpectraCorr && EZNA>0.) {
1624  Double_t mu1 = SpecCorMu1[i+4]->Interpolate(centrperc);
1625  Double_t mu2 = SpecCorMu2[i+4]->Interpolate(centrperc);
1626  Double_t av = SpecCorAv[i+4]->Interpolate(centrperc);
1627  Double_t cor1 = SpecCorSi[i+4]->Interpolate(centrperc);
1628  EZNA = exp( (log(EZNA) - mu1 + mu2*cor1)/cor1 ) + av;
1629  fhZNSpectraCor->Fill(centrperc,i+4.5,EZNA);
1630  }
1631  if(fUseZDCSpectraCorr && EZNA<=0.) fAllChONZNA=kFALSE;
1632  SumEZNA += EZNA;
1633 
1634  // build centroid
1635  wZNA = TMath::Power(EZNA, fZDCGainAlpha);
1636  numXZNA += x[i]*wZNA;
1637  numYZNA += y[i]*wZNA;
1638  denZNA += wZNA;
1639  fhZNSpectraPow->Fill(centrperc,i+4.5,wZNA);
1640  }
1641  // store distribution for unfolding
1642  if(RunNum<245829) {
1643  Double_t recoE = towZNA[0]-towZNA[1]-towZNA[3]-towZNA[4];
1644  Double_t trueE = towZNA[2];
1645  fhZNBCCorr->Fill(centrperc,trueE,recoE);
1646  }
1647  if(denZNC>0.){
1648  Double_t nSpecnC = SumEZNC/Enucl;
1649  cZNC = 1.89358-0.71262/(nSpecnC+0.71789);
1650  xyZNC[0] = cZNC*numXZNC/denZNC;
1651  xyZNC[1] = cZNC*numYZNC/denZNC;
1652  denZNC *= cZNC;
1653  }
1654  else{
1655  xyZNC[0] = xyZNC[1] = 0.;
1656  }
1657  if(denZNA>0.){
1658  Double_t nSpecnA = SumEZNA/Enucl;
1659  cZNA = 1.89358-0.71262/(nSpecnA+0.71789);
1660  xyZNA[0] = cZNA*numXZNA/denZNA;
1661  xyZNA[1] = cZNA*numYZNA/denZNA;
1662  denZNA *= cZNA;
1663  }
1664  else{
1665  xyZNA[0] = xyZNA[1] = 0.;
1666  }
1667  } else {
1668  for(Int_t i=0; i<4; i++) {
1669  if(towZNC[i+1]>0.) {
1670  wZNC = TMath::Power(towZNC[i+1], fZDCGainAlpha);
1671  numXZNC += x[i]*wZNC;
1672  numYZNC += y[i]*wZNC;
1673  denZNC += wZNC;
1674  }
1675  if(towZNA[i+1]>0.) {
1676  wZNA = TMath::Power(towZNA[i+1], fZDCGainAlpha);
1677  numXZNA += x[i]*wZNA;
1678  numYZNA += y[i]*wZNA;
1679  denZNA += wZNA;
1680  }
1681  }
1682  if(denZNC!=0) {
1683  xyZNC[0] = numXZNC/denZNC;
1684  xyZNC[1] = numYZNC/denZNC;
1685  }
1686  else{
1687  xyZNC[0] = xyZNC[1] = 999.;
1688  zncEnergy = 0.;
1689  }
1690  if(denZNA!=0) {
1691  xyZNA[0] = numXZNA/denZNA;
1692  xyZNA[1] = numYZNA/denZNA;
1693  }
1694  else{
1695  xyZNA[0] = xyZNA[1] = 999.;
1696  znaEnergy = 0.;
1697  }
1698  }
1699 
1700  if(!fAllChONZNC) denZNC=-1.;
1701  if(!fAllChONZNA) denZNA=-1.;
1702 
1703  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]);
1704  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]);
1705 
1706  fFlowEvent->SetZDC2Qsub(xyZNC,denZNC,xyZNA,denZNA);
1707 
1708  // ******************************************************************************
1709 
1710  Double_t tdcSum = aodZDC->GetZDCTimeSum();
1711  Double_t tdcDiff = aodZDC->GetZDCTimeDiff();
1712  fhDebunch->Fill(tdcDiff, tdcSum);
1713 
1714  for(int i=0; i<5; i++){
1715  fhZNCPM[i]->Fill(towZNC[i]);
1716  if((i<4) && (towZNC[0]>0.)) fhZNCPMQiPMC[i]->Fill(towZNC[i+1]/towZNC[0]);
1717  }
1718  for(int i=0; i<5; i++){
1719  fhZNAPM[i]->Fill(towZNA[i]);
1720  if(((i<4) && towZNA[0]>0.)) fhZNAPMQiPMC[i]->Fill(towZNA[i+1]/towZNA[0]);
1721  }
1722 
1723  fhZNCvsZNA->Fill(energyZNA, energyZNC);
1724  fhZDCCvsZDCCA->Fill(energyZNA+energyZPA, energyZNC+energyZPC);
1725  fhZNCvsZPC->Fill(energyZPC, energyZNC);
1726  fhZNAvsZPA->Fill(energyZPA, energyZNA);
1727  fhZNvsZP->Fill(energyZPA+energyZPC, energyZNA+energyZNC);
1728  fhZNvsVZERO->Fill(multV0A+multV0C, energyZNC+energyZNA);
1729  fhZDCvsVZERO->Fill(multV0A+multV0C, energyZNA+energyZPA+energyZNC+energyZPC);
1730  fhZDCvsTracklets->Fill((Double_t) (nTracklets), energyZNA+energyZPA+energyZNC+energyZPC);
1731 
1732  Double_t asymmetry = -999.;
1733  if((energyZNC+energyZNA)>0.) asymmetry = (energyZNC-energyZNA)/(energyZNC+energyZNA);
1734  fhAsymm->Fill(asymmetry);
1735  fhZNAvsAsymm->Fill(asymmetry, energyZNA/1000.);
1736  fhZNCvsAsymm->Fill(asymmetry, energyZNC/1000.);
1737 
1738  fhZNCvscentrality->Fill(centrperc, energyZNC/1000.);
1739  fhZNAvscentrality->Fill(centrperc, energyZNA/1000.);
1740 
1741  } // PHYSICS SELECTION
1742 
1743  }
1744 
1745  // p) cache run number
1747 
1748  // printf("debug: NoRPs %e, NoPOIs %e, RunNum %d, Cen %e \n",fFlowEvent->GetNumberOfRPs(),fFlowEvent->GetNumberOfPOIs(),fCachedRunNum,fFlowEvent->GetCentrality());
1749 
1750  PostData(1, fFlowEvent);
1751 
1752  PostData(2, fOutput);
1753 }
1754 //________________________________________________________________________
1755 
1757 {
1758  Double_t EtC = BadTowerCalibHist->ProjectionY("",BadTowerCalibHist->GetXaxis()->FindBin(Et),BadTowerCalibHist->GetXaxis()->FindBin(Et))->GetRandom();
1759  return EtC;
1760 }
1761 
1762 //________________________________________________________________________
1763 
1765 {
1766  Int_t CenBin=-1;
1767  if (Centrality>0. && Centrality<5.) CenBin=0;
1768  if (Centrality>5. && Centrality<10.) CenBin=1;
1769  if (Centrality>10. && Centrality<20.) CenBin=2;
1770  if (Centrality>20. && Centrality<30.) CenBin=3;
1771  if (Centrality>30. && Centrality<40.) CenBin=4;
1772  if (Centrality>40. && Centrality<50.) CenBin=5;
1773  if (Centrality>50. && Centrality<60.) CenBin=6;
1774  if (Centrality>60. && Centrality<70.) CenBin=7;
1775  if (Centrality>70. && Centrality<80.) CenBin=8;
1776  if (Centrality>80. && Centrality<90.) CenBin=9;
1777  if (CenBin>=fnCen) CenBin=-1;
1778  if (fnCen==1) CenBin=0;
1779  return CenBin;
1780 } // end of AliFlowAnalysisCRC::GetCRCCenBin(Double_t Centrality)
1781 //_____________________________________________________________________________
1782 
1783 Double_t AliAnalysisTaskCRCZDC::GetWDist(const AliVVertex* v0, const AliVVertex* v1)
1784 {
1785  // calculate sqrt of weighted distance to other vertex
1786  if (!v0 || !v1) {
1787  printf("One of vertices is not valid\n");
1788  return 0;
1789  }
1790  static TMatrixDSym vVb(3);
1791  double dist = -1;
1792  double dx = v0->GetX()-v1->GetX();
1793  double dy = v0->GetY()-v1->GetY();
1794  double dz = v0->GetZ()-v1->GetZ();
1795  double cov0[6],cov1[6];
1796  v0->GetCovarianceMatrix(cov0);
1797  v1->GetCovarianceMatrix(cov1);
1798  vVb(0,0) = cov0[0]+cov1[0];
1799  vVb(1,1) = cov0[2]+cov1[2];
1800  vVb(2,2) = cov0[5]+cov1[5];
1801  vVb(1,0) = vVb(0,1) = cov0[1]+cov1[1];
1802  vVb(0,2) = vVb(1,2) = vVb(2,0) = vVb(2,1) = 0.;
1803  vVb.InvertFast();
1804  if (!vVb.IsValid()) {printf("Singular Matrix\n"); return dist;}
1805  dist = vVb(0,0)*dx*dx + vVb(1,1)*dy*dy + vVb(2,2)*dz*dz
1806  + 2*vVb(0,1)*dx*dy + 2*vVb(0,2)*dx*dz + 2*vVb(1,2)*dy*dz;
1807  return dist>0 ? TMath::Sqrt(dist) : -1;
1808 }
1809 //________________________________________________________________________
1810 
1812 {
1813  // check for multi-vertexer pile-up
1814 
1815  const int kMinPlpContrib = 5;
1816  const double kMaxPlpChi2 = 5.0;
1817  const double kMinWDist = 15;
1818 
1819  const AliVVertex* vtPrm = 0;
1820  const AliVVertex* vtPlp = 0;
1821  int nPlp = 0;
1822 
1823  if ( !(nPlp=aod->GetNumberOfPileupVerticesTracks()) ) return kFALSE;
1824  vtPrm = aod->GetPrimaryVertex();
1825  if (vtPrm == aod->GetPrimaryVertexSPD()) return kTRUE; // there are pile-up vertices but no primary
1826 
1827  //int bcPrim = vtPrm->GetBC();
1828 
1829  for (int ipl=0;ipl<nPlp;ipl++) {
1830  vtPlp = (const AliVVertex*)aod->GetPileupVertexTracks(ipl);
1831  //
1832  if (vtPlp->GetNContributors() < kMinPlpContrib) continue;
1833  if (vtPlp->GetChi2perNDF() > kMaxPlpChi2) continue;
1834  // int bcPlp = vtPlp->GetBC();
1835  // if (bcPlp!=AliVTrack::kTOFBCNA && TMath::Abs(bcPlp-bcPrim)>2) return kTRUE; // pile-up from other BC
1836  //
1837  double wDst = GetWDist(vtPrm,vtPlp);
1838  if (wDst<kMinWDist) continue;
1839  //
1840  return kTRUE; // pile-up: well separated vertices
1841  }
1842 
1843  return kFALSE;
1844 }
1845 
1846 //________________________________________________________________________
1848  fCutContainer->AddAt(cutsRP,0); fCutsRP=cutsRP; cutsRP->SetPOItype(0);
1849 }
1850 
1851 //________________________________________________________________________
1853  fCutContainer->AddAt(cutsPOI,1); fCutsPOI=cutsPOI; cutsPOI->SetPOItype(1);
1854 }
1855 
1856 //________________________________________________________________________
1858 {
1859  // Terminate analysis
1860  //
1861  /* if(fDebug > 1) printf(" **** AliAnalysisTaskCRCZDC::Terminate() \n");
1862 
1863  //fOutput = dynamic_cast<TList*> (GetOutputData(1));
1864  //if(!fOutput) printf("ERROR: fOutput not available\n");
1865  */
1866 }
TH2F * fhZDCCvsZDCCA
ZNC vs ZNA;.
static const Int_t fkVZEROnQAplots
TH2F * fhZNvsVZERO
ZNC+ZNA vs ZPC+ZPA;.
TH1F * fPtSpecFB128[2][10]
PtSpecRec FB96.
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
TH2F * fhZDCvsTracklets
ZDC vs VZERO;.
static const Int_t fCRCnTow
TH1F * fhZNCPMQiPMC[4]
ZNA PM high res.
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)
TH2F * fhZNCvsAsymm
ZNA vs asymmetry.
void SetMCReactionPlaneAngle(const AliMCEvent *mcEvent)
TH3D * fhZNCenDis[2]
Debunch;.
void SetCutsPOI(AliFlowTrackCuts *cutsPOI)
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 SetReferenceMultiplicity(Int_t m)
virtual Int_t GetCenBin(Double_t Centrality)
void SetCutsRP(AliFlowTrackCuts *cutsRP)
TRandom * gRandom
TH2F * fhZNCvsZNA
PMQi/PMC for ZNA.
TH2F * fhDebunch
ZDC vs N_cluster layer 1;.
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.
TH2F * fhZDCvsNclu1
ZDC vs N_tracklets;.
AliFlowEventCuts * fCutsEvent
const Double_t ptmin
TH1F * fPileUpMultSelCount
centrality distribution
Double_t GetCentrality() const
Bool_t fUseTowerEq
MultSelection (RUN2 centrality estimator)
ClassImp(AliAnalysisTaskCRCZDC) AliAnalysisTaskCRCZDC
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
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)
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)
Bool_t IsSetMCReactionPlaneAngle() const
TClonesArray * fStack
ZNA tower spectra.
TList * GetQA() const
TProfile2D * fVZEROQVectorRecFinal[fkVZEROnHar][fkVZEROnQAplots]
static const Int_t fCRCMaxnRun
ZNA vs. centrality.
Double_t GetBadTowerResp(Double_t Et, TH2D *BadTowerCalibHist)
void SetForPOISelection(Bool_t b=kTRUE)
void SetHistWeightvsPhiMin(Double_t d)
TH1F * fhZNAPMQiPMC[4]
PMQi/PMC for ZNC.
void AddV2(Double_t v2)
TH2F * fhZDCvsVZERO
ZN vs VZERO;.
void TagSubeventsInEta(Double_t etaMinA, Double_t etaMaxA, Double_t etaMinB, Double_t etaMaxB)
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 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