AliPhysics  a8fcd8c (a8fcd8c)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AliAnalysisTaskCMEV0.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 the supporting documentation. The authors make no claims *
12  * about the suitability of this software for any purpose. It is *
13  * provided "as is" without express or implied warranty. *
14  **************************************************************************/
15 
17 // CME correlator study using VO.
18 // Author: Rihan Haque (mhaque@cern.ch)
20 
21 
22 
23 #include <TGrid.h>
24 #include <TFile.h>
25 #include <TList.h>
26 #include "TMatrixDSym.h"
27 #include "Riostream.h"
28 #include "AliAnalysisManager.h"
29 #include "AliInputEventHandler.h"
30 #include "AliOADBContainer.h"
31 #include "AliMultSelection.h"
32 #include "AliMultiplicity.h"
33 #include "AliAnalysisUtils.h"
34 #include "AliVVertex.h"
35 #include "AliAODTrack.h"
36 #include "AliAODEvent.h"
37 #include "AliAODHeader.h"
38 #include "AliAODVertex.h"
39 #include "AliAODVZERO.h"
40 #include "AliAODZDC.h"
41 #include "AliFlowEvent.h"
42 #include "AliFlowEventSimple.h"
43 #include "AliAnalysisTaskCMEV0.h"
44 
45 using std::endl;
46 using std::cout;
47 
48 ClassImp(AliAnalysisTaskCMEV0)
49 
51  fEvent(NULL),
52  fMultSelection(NULL),
53  fAnalysisUtil(NULL),
54  fListHistos(NULL),
55  fListCalibs(NULL),
56  fListFBHijing(NULL),
57  fListNUACorr(NULL),
58  fListZDNCorr(NULL),
59  fRejectPileUp(kTRUE),
60  fRejectPileUpTight(kTRUE),
61  bFillAvgTPCQn(kFALSE),
62  bFillEtaPhiNUA(kFALSE),
63  bApplyNUACorr(kFALSE),
64  bApplyZDCCorr(kFALSE),
65  bApplyNUAforEP(kFALSE),
66  sDataSet("2015"),
67  sAnalysisSet("DoGainEq"),
68  sCentEstimator("V0"),
69  fRunFlag(0),
70  fOldRunNum(0),
71  fievent(0),
72  EvtCent(0.0),
73  fHarmonic(2.0),
74  fHist_Event_count(NULL),
75  fPileUpMultSelCount(NULL),
76  fPileUpCount(NULL),
77  fMultV0(NULL),
78  fQxnmV0A(NULL),
79  fQynmV0A(NULL),
80  fQxnsV0A(NULL),
81  fQynsV0A(NULL),
82  fQxnmV0C(NULL),
83  fQynmV0C(NULL),
84  fQxnsV0C(NULL),
85  fQynsV0C(NULL),
86  fHV0AEventPlaneVsCent(NULL),
87  fHV0CEventPlaneVsCent(NULL),
88  fHTPCEventPlaneVsCent(NULL),
89  fHCorrectNUApos(NULL),
90  fHCorrectNUAneg(NULL),
91  fHEnergyZNCvsCent(NULL),
92  fHEnergyZNAvsCent(NULL),
93  fHEnergyZPCvsCent(NULL),
94  fHEnergyZPAvsCent(NULL),
95  fHEnergyZNCvsCentRun(NULL),
96  fHEnergyZNAvsCentRun(NULL),
97  fHEnergyZPCvsCentRun(NULL),
98  fHEnergyZPAvsCentRun(NULL),
99  fHEnergyZPCvsZPA(NULL),
100  fHEnergyZNCvsZNA(NULL),
101  hUnderOverBinNUApos(NULL),
102  hUnderOverBinNUAneg(NULL),
103  fHCentBinTrkRecenter(NULL),
104  fHCorrectZDNP(NULL),
105  fV0AQnxVsCentRun(NULL),
106  fV0AQnyVsCentRun(NULL),
107  fV0CQnxVsCentRun(NULL),
108  fV0CQnyVsCentRun(NULL),
109  fTPCQnxVsCentRun(NULL),
110  fTPCQnyVsCentRun(NULL),
111  mListNUAPos(NULL),
112  mListNUANeg(NULL),
113  fileNUApos(NULL),
114  fileNUAneg(NULL),
115  fAvgMultCentRun(NULL),
116  fAvgWgtMultCentRun(NULL),
117  fAvgPOIposCentRun(NULL),
118  fAvgPOInegCentRun(NULL),
119  fAvgPOIPPCentRun(NULL),
120  fAvgPOINNCentRun(NULL),
121  fAvgPOIOSCentRun(NULL),
122  fV0MultChVsRun(NULL),
123  fEventStatvsRun(NULL),
124  fEtaBinFinderForQA(NULL)
125 {
126  for(int i=0;i<90;i++){
127  runNums[i] = 0;
128  for(int j=0;j<4;j++){
129  fHist3DEtaPhiVz_Pos_Run[j][i] = NULL;
130  fHist3DEtaPhiVz_Neg_Run[j][i] = NULL;
131  }
132  }
133  for(int i=0;i<10;i++){
134  fFB_Efficiency_Cent[i] = NULL;
135  }
136  for(int i=0;i<2;i++){
137  for(int j=0;j<3;j++){
138  fHist_Corr3p_SP_Norm_PN[i][j] = NULL;
139  fHist_Corr3p_SP_Norm_PP[i][j] = NULL;
140  fHist_Corr3p_SP_Norm_NN[i][j] = NULL;
141  fHist_Reso2n_SP_Norm_Det[i][j] = NULL;
142  }
143  }
144  for(int i=0;i<2;i++){
145  for(int j=0;j<3;j++){
146  fHist_Corr3p_EP_Norm_PN[i][j] = NULL;
147  fHist_Corr3p_EP_Norm_PP[i][j] = NULL;
148  fHist_Corr3p_EP_Norm_NN[i][j] = NULL;
149  fHist_Reso2n_EP_Norm_Det[i][j] = NULL;
150  }
151  }
152  for(int i=0;i<3;i++){
153  fHist_Corr3p_ZDN_SP_PN[i] = NULL;
154  fHist_Corr3p_ZDN_SP_PP[i] = NULL;
155  fHist_Corr3p_ZDN_SP_NN[i] = NULL;
156  fHist_Reso2n_ZDN_SP_Det[i] = NULL;
157  }
158  for(int i=0;i<2;i++){
159  for(int j=0;j<6;j++){
160  fHist_Corr3p_pTSum_EP_V0A_PN[i][j] = NULL;
161  fHist_Corr3p_pTSum_EP_V0A_PP[i][j] = NULL;
162  fHist_Corr3p_pTSum_EP_V0A_NN[i][j] = NULL;
163  fHist_Corr3p_pTSum_EP_V0C_PN[i][j] = NULL;
164  fHist_Corr3p_pTSum_EP_V0C_PP[i][j] = NULL;
165  fHist_Corr3p_pTSum_EP_V0C_NN[i][j] = NULL;
166 
167  fHist_Corr3p_pTDiff_EP_V0A_PN[i][j] = NULL;
168  fHist_Corr3p_pTDiff_EP_V0A_PP[i][j] = NULL;
169  fHist_Corr3p_pTDiff_EP_V0A_NN[i][j] = NULL;
170  fHist_Corr3p_pTDiff_EP_V0C_PN[i][j] = NULL;
171  fHist_Corr3p_pTDiff_EP_V0C_PP[i][j] = NULL;
172  fHist_Corr3p_pTDiff_EP_V0C_NN[i][j] = NULL;
173 
174  fHist_Corr3p_EtaDiff_EP_V0A_PN[i][j] = NULL;
175  fHist_Corr3p_EtaDiff_EP_V0A_PP[i][j] = NULL;
176  fHist_Corr3p_EtaDiff_EP_V0A_NN[i][j] = NULL;
177  fHist_Corr3p_EtaDiff_EP_V0C_PN[i][j] = NULL;
178  fHist_Corr3p_EtaDiff_EP_V0C_PP[i][j] = NULL;
179  fHist_Corr3p_EtaDiff_EP_V0C_NN[i][j] = NULL;
180  }
181  }
182  for(int i=0;i<10;i++){
183  fHistChPosvsEtaPtRun[i] = NULL;
184  fHistChNegvsEtaPtRun[i] = NULL;
185  }
186  for(int i=0;i<2;i++){
187  fHist_Corr3p_QAEta_EP_V0C_PN[i] = NULL;
188  fHist_Corr3p_QAEta_EP_V0C_PP[i] = NULL;
189  fHist_Corr3p_QAEta_EP_V0C_NN[i] = NULL;
190  }
191  for(int i=0;i<4;i++){
192  fHCos1nPosChEtaVz[i] = NULL;
193  fHCos2nPosChEtaVz[i] = NULL;
194  fHCos3nPosChEtaVz[i] = NULL;
195  fHCos4nPosChEtaVz[i] = NULL;
196  fHSin1nPosChEtaVz[i] = NULL;
197  fHSin2nPosChEtaVz[i] = NULL;
198  fHSin3nPosChEtaVz[i] = NULL;
199  fHSin4nPosChEtaVz[i] = NULL;
200 
201  fHCos1nNegChEtaVz[i] = NULL;
202  fHCos2nNegChEtaVz[i] = NULL;
203  fHCos3nNegChEtaVz[i] = NULL;
204  fHCos4nNegChEtaVz[i] = NULL;
205  fHSin1nNegChEtaVz[i] = NULL;
206  fHSin2nNegChEtaVz[i] = NULL;
207  fHSin3nNegChEtaVz[i] = NULL;
208  fHSin4nNegChEtaVz[i] = NULL;
209 
210  fHCos2nDWPosChEtaVz[i] = NULL;
211  fHSin2nDWPosChEtaVz[i] = NULL;
212  fHCos2nDWNegChEtaVz[i] = NULL;
213  fHSin2nDWNegChEtaVz[i] = NULL;
214  }
215 
216 
217 
218  DefineInput(1, AliFlowEventSimple::Class()); // Input slot #1: AliFlowEventSimple
219 
220  DefineOutput(1,TList::Class());
221  DefineOutput(2,TList::Class());
222 }//-------- real ---------
223 
225  fEvent(NULL),
226  fMultSelection(NULL),
227  fAnalysisUtil(NULL),
228  fListHistos(NULL),
229  fListCalibs(NULL),
230  fListFBHijing(NULL),
231  fListNUACorr(NULL),
232  fListZDNCorr(NULL),
233  fRejectPileUp(kTRUE),
234  fRejectPileUpTight(kTRUE),
235  bFillAvgTPCQn(kFALSE),
236  bFillEtaPhiNUA(kFALSE),
237  bApplyNUACorr(kFALSE),
238  bApplyZDCCorr(kFALSE),
239  bApplyNUAforEP(kFALSE),
240  sDataSet("2015"),
241  sAnalysisSet("DoGainEq"),
242  sCentEstimator("V0"),
243  fRunFlag(0),
244  fOldRunNum(0),
245  fievent(0),
246  EvtCent(0.0),
247  fHarmonic(2.0),
248  fHist_Event_count(NULL),
249  fPileUpMultSelCount(NULL),
250  fPileUpCount(NULL),
251  fMultV0(NULL),
252  fQxnmV0A(NULL),
253  fQynmV0A(NULL),
254  fQxnsV0A(NULL),
255  fQynsV0A(NULL),
256  fQxnmV0C(NULL),
257  fQynmV0C(NULL),
258  fQxnsV0C(NULL),
259  fQynsV0C(NULL),
260  fHV0AEventPlaneVsCent(NULL),
261  fHV0CEventPlaneVsCent(NULL),
262  fHTPCEventPlaneVsCent(NULL),
263  fHCorrectNUApos(NULL),
264  fHCorrectNUAneg(NULL),
265  fHEnergyZNCvsCent(NULL),
266  fHEnergyZNAvsCent(NULL),
267  fHEnergyZPCvsCent(NULL),
268  fHEnergyZPAvsCent(NULL),
269  fHEnergyZNCvsCentRun(NULL),
270  fHEnergyZNAvsCentRun(NULL),
271  fHEnergyZPCvsCentRun(NULL),
272  fHEnergyZPAvsCentRun(NULL),
273  fHEnergyZPCvsZPA(NULL),
274  fHEnergyZNCvsZNA(NULL),
275  hUnderOverBinNUApos(NULL),
276  hUnderOverBinNUAneg(NULL),
277  fHCentBinTrkRecenter(NULL),
278  fHCorrectZDNP(NULL),
279  fV0AQnxVsCentRun(NULL),
280  fV0AQnyVsCentRun(NULL),
281  fV0CQnxVsCentRun(NULL),
282  fV0CQnyVsCentRun(NULL),
283  fTPCQnxVsCentRun(NULL),
284  fTPCQnyVsCentRun(NULL),
285  mListNUAPos(NULL),
286  mListNUANeg(NULL),
287  fileNUApos(NULL),
288  fileNUAneg(NULL),
289  fAvgMultCentRun(NULL),
290  fAvgWgtMultCentRun(NULL),
291  fAvgPOIposCentRun(NULL),
292  fAvgPOInegCentRun(NULL),
293  fAvgPOIPPCentRun(NULL),
294  fAvgPOINNCentRun(NULL),
295  fAvgPOIOSCentRun(NULL),
296  fV0MultChVsRun(NULL),
297  fEventStatvsRun(NULL),
298  fEtaBinFinderForQA(NULL)
299 {
300  for(int i=0;i<90;i++){
301  runNums[i] = 0;
302  for(int j=0;j<4;j++){
303  fHist3DEtaPhiVz_Pos_Run[j][i] = NULL;
304  fHist3DEtaPhiVz_Neg_Run[j][i] = NULL;
305  }
306  }
307  for(int i=0;i<10;i++){
308  fFB_Efficiency_Cent[i] = NULL;
309  }
310  for(int i=0;i<2;i++){
311  for(int j=0;j<3;j++){
312  fHist_Corr3p_SP_Norm_PN[i][j] = NULL;
313  fHist_Corr3p_SP_Norm_PP[i][j] = NULL;
314  fHist_Corr3p_SP_Norm_NN[i][j] = NULL;
315  fHist_Reso2n_SP_Norm_Det[i][j] = NULL;
316  }
317  }
318  for(int i=0;i<2;i++){
319  for(int j=0;j<3;j++){
320  fHist_Corr3p_EP_Norm_PN[i][j] = NULL;
321  fHist_Corr3p_EP_Norm_PP[i][j] = NULL;
322  fHist_Corr3p_EP_Norm_NN[i][j] = NULL;
323  fHist_Reso2n_EP_Norm_Det[i][j] = NULL;
324  }
325  }
326  for(int i=0;i<3;i++){
327  fHist_Corr3p_ZDN_SP_PN[i] = NULL;
328  fHist_Corr3p_ZDN_SP_PP[i] = NULL;
329  fHist_Corr3p_ZDN_SP_NN[i] = NULL;
330  fHist_Reso2n_ZDN_SP_Det[i] = NULL;
331  }
332  for(int i=0;i<2;i++){
333  for(int j=0;j<6;j++){
334  fHist_Corr3p_pTSum_EP_V0A_PN[i][j] = NULL;
335  fHist_Corr3p_pTSum_EP_V0A_PP[i][j] = NULL;
336  fHist_Corr3p_pTSum_EP_V0A_NN[i][j] = NULL;
337  fHist_Corr3p_pTSum_EP_V0C_PN[i][j] = NULL;
338  fHist_Corr3p_pTSum_EP_V0C_PP[i][j] = NULL;
339  fHist_Corr3p_pTSum_EP_V0C_NN[i][j] = NULL;
340 
341  fHist_Corr3p_pTDiff_EP_V0A_PN[i][j] = NULL;
342  fHist_Corr3p_pTDiff_EP_V0A_PP[i][j] = NULL;
343  fHist_Corr3p_pTDiff_EP_V0A_NN[i][j] = NULL;
344  fHist_Corr3p_pTDiff_EP_V0C_PN[i][j] = NULL;
345  fHist_Corr3p_pTDiff_EP_V0C_PP[i][j] = NULL;
346  fHist_Corr3p_pTDiff_EP_V0C_NN[i][j] = NULL;
347 
348  fHist_Corr3p_EtaDiff_EP_V0A_PN[i][j] = NULL;
349  fHist_Corr3p_EtaDiff_EP_V0A_PP[i][j] = NULL;
350  fHist_Corr3p_EtaDiff_EP_V0A_NN[i][j] = NULL;
351  fHist_Corr3p_EtaDiff_EP_V0C_PN[i][j] = NULL;
352  fHist_Corr3p_EtaDiff_EP_V0C_PP[i][j] = NULL;
353  fHist_Corr3p_EtaDiff_EP_V0C_NN[i][j] = NULL;
354  }
355  }
356  for(int i=0;i<10;i++){
357  fHistChPosvsEtaPtRun[i] = NULL;
358  fHistChNegvsEtaPtRun[i] = NULL;
359  }
360  for(int i=0;i<2;i++){
364  }
365  for(int i=0;i<4;i++){
366  fHCos1nPosChEtaVz[i] = NULL;
367  fHCos2nPosChEtaVz[i] = NULL;
368  fHCos3nPosChEtaVz[i] = NULL;
369  fHCos4nPosChEtaVz[i] = NULL;
370  fHSin1nPosChEtaVz[i] = NULL;
371  fHSin2nPosChEtaVz[i] = NULL;
372  fHSin3nPosChEtaVz[i] = NULL;
373  fHSin4nPosChEtaVz[i] = NULL;
374 
375  fHCos1nNegChEtaVz[i] = NULL;
376  fHCos2nNegChEtaVz[i] = NULL;
377  fHCos3nNegChEtaVz[i] = NULL;
378  fHCos4nNegChEtaVz[i] = NULL;
379  fHSin1nNegChEtaVz[i] = NULL;
380  fHSin2nNegChEtaVz[i] = NULL;
381  fHSin3nNegChEtaVz[i] = NULL;
382  fHSin4nNegChEtaVz[i] = NULL;
383 
384  fHCos2nDWPosChEtaVz[i] = NULL;
385  fHSin2nDWPosChEtaVz[i] = NULL;
386  fHCos2nDWNegChEtaVz[i] = NULL;
387  fHSin2nDWNegChEtaVz[i] = NULL;
388  }
389 
390 
391 }//-----------
392 
393 
394 
395 
397 {
399 
400  fAnalysisUtil = new AliAnalysisUtils();
401  fAnalysisUtil->SetUseMVPlpSelection(kTRUE);
402  fAnalysisUtil->SetUseOutOfBunchPileUp(kTRUE);
403 
404 
405  if(fListFBHijing) {
406  for(int i=0;i<10;i++) {
407  fFB_Efficiency_Cent[i] = (TH1D *) fListFBHijing->FindObject(Form("eff_unbiased_%d",i));
408  }
409  }
410  else{ // if MC efficiency not found then use weight = 1.
411  printf("\n\n!!***** Warning *****!!\n FilterBit efficiency not found, use = 1.0 !!\n\n");
412  for(int i=0;i<10;i++){
413  fFB_Efficiency_Cent[i] = new TH1D(Form("eff_unbiased_%d",i),"",1000,0,50.);
414  for(int j=1;j<=fFB_Efficiency_Cent[i]->GetNbinsX();j++){
415  fFB_Efficiency_Cent[i]->SetBinContent(j,1.000);
416  }
417  }
418  }
419 
420 
421 
422  fListHistos = new TList();
423  fListHistos->SetOwner(kTRUE);
424 
425  fListCalibs = new TList();
426  fListCalibs->SetOwner(kTRUE);
427 
428  this->DefineHistograms();
429 
430  PostData(1,fListHistos);
431  PostData(2,fListCalibs);
432 
433 }
434 
436 {
437  delete fListHistos;
438  delete fListCalibs;
439 
440  delete fMultSelection;
441  delete fAnalysisUtil; // it is '= new' !!!
442 
443  delete fHCentBinTrkRecenter;
444 
445 }
446 
447 
448 
449 
450 
451 
452 
454 {
455 
456  Float_t stepCount = 0.5;
457  fHist_Event_count->Fill(stepCount); //1
458  stepCount++;
459 
460  AliAODEvent *aod = dynamic_cast<AliAODEvent*>(InputEvent());
461  fEvent = dynamic_cast<AliFlowEventSimple*>(GetInputData(1));
462 
463  if(!aod || !fEvent){
464  printf("\n ... ::UserExec = no AOD or Flow Event, \n.... EXIT ..... \n");
465  return;
466  }
467 
468  fHist_Event_count->Fill(stepCount); //2
469  stepCount++;
470 
471 
472 
473  //---------pileup rejection: --------
474  Bool_t kPileupEvent = CheckEventIsPileUp(aod);
475 
476  if(kPileupEvent) return;
477 
478  fHist_Event_count->Fill(stepCount); //3
479  stepCount++;
480 
481 
482 
483  Double_t centrV0M = -1;
484  Double_t centrCL1 = -1;
485  Double_t centrCL0 = -1;
486  Double_t centrTRK = -1;
487  EvtCent = -1;
488 
489  if(sDataSet=="2010"||sDataSet=="2011"){
490  centrV0M = ((AliVAODHeader*)aod->GetHeader())->GetCentralityP()->GetCentralityPercentile("V0M");
491  centrCL1 = ((AliVAODHeader*)aod->GetHeader())->GetCentralityP()->GetCentralityPercentile("CL1");
492  centrCL0 = ((AliVAODHeader*)aod->GetHeader())->GetCentralityP()->GetCentralityPercentile("CL0");
493  centrTRK = ((AliVAODHeader*)aod->GetHeader())->GetCentralityP()->GetCentralityPercentile("TRK");
494  }
495  else{
496  fMultSelection = (AliMultSelection*) InputEvent()->FindListObject("MultSelection");
497  if(!fMultSelection) {
498  printf("\n\n **WARNING** ::UserExec() AliMultSelection object not found.\n\n");
499  exit(1);
500  }
501  centrV0M = fMultSelection->GetMultiplicityPercentile("V0M");
502  centrCL1 = fMultSelection->GetMultiplicityPercentile("CL1");
503  centrCL0 = fMultSelection->GetMultiplicityPercentile("CL0");
504  centrTRK = fMultSelection->GetMultiplicityPercentile("TRK");
505  }
506 
507 
508 
509  if(sCentEstimator=="V0" || sCentEstimator=="V0M"){
510  EvtCent = centrV0M;
511  }
512  else{
513  EvtCent = centrCL1;
514  }
515 
516 
517 
518  Int_t iCentSPD = centrCL1;
519 
520  if(iCentSPD >= 90) return;
521 
522  fHist_Event_count->Fill(stepCount); //4
523  stepCount++;
524 
525 
526  Int_t cIndex = 0;
527  Int_t cForNUA = 0;
528 
529  if(EvtCent<5.0) {
530  cIndex = 0;
531  cForNUA = 0; //0=0-5,
532  }
533  else if(EvtCent>=5.0 && EvtCent<10){
534  cIndex = 1;
535  cForNUA = 1; // 1=5-10,
536  }
537  else if(EvtCent>=10.0) {
538  cIndex = abs(EvtCent/10.0) + 1;
539  if(EvtCent<40.0)
540  cForNUA = 2; // 2=10-40,
541  else if(EvtCent>=40.0)
542  cForNUA = 3; // 3=40-90
543  }
544 
545 
546 
547  //------- load v0 calib file of Alex --------
548  Int_t runindex = -111;
549  Int_t runNumber = aod->GetRunNumber();
550  runindex = GetCurrentRunIndex(runNumber);
551 
552  if(runNumber!=fOldRunNum){
553 
554  if(sDataSet=="2015" || sDataSet=="2015PbPb")
555  OpenInfoCalbration(runNumber);
556 
557  if(bApplyNUACorr){
558  GetNUACorrectionHist(runNumber,EvtCent);
559  }
560  if(bApplyZDCCorr){
561  GetZDCCorrectionHist(runNumber);
562  }
563  fOldRunNum = runNumber;
564  }
565 
566 
567  Double_t fMagField = aod->GetMagneticField();
568  Int_t QAindex = -1;
569 
570  if(fMagField<0)
571  QAindex = 0;
572  else if(fMagField>0)
573  QAindex = 1;
574 
575 //-------- V0 info ---------------
576  const AliAODVZERO *fAODV0 = aod->GetVZEROData();
577 
578 
579  Double_t QyanCor = 0., QycnCor = 0.;
580  Double_t QxanCor = 0., QxcnCor = 0.;
581  Double_t Qxan = 0., Qyan = 0.;
582  Double_t Qxcn = 0., Qycn = 0.;
583  Double_t sumMa = 0., sumMc = 0.;
584  Double_t fMultv0 = 0.;
585  Double_t phiV0 = 0.;
586 
587 
588  if(sDataSet=="2015" || sDataSet=="2015PbPb") {
589  GetV0QvectAndMult(fAODV0, Qxan, Qyan, sumMa, Qxcn, Qycn, sumMc);
590 
591  QyanCor = (Qyan - fQynmV0A->GetBinContent(iCentSPD+1))/fQynsV0A->GetBinContent(iCentSPD+1);
592  QycnCor = (Qycn - fQynmV0C->GetBinContent(iCentSPD+1))/fQynsV0C->GetBinContent(iCentSPD+1);
593 
594  QxanCor = Qxan;
595  QxcnCor = Qxcn;
596 
597  if(fHarmonic != 4.){
598  QxanCor = (Qxan - fQxnmV0A->GetBinContent(iCentSPD+1))/fQxnsV0A->GetBinContent(iCentSPD+1);
599  QxcnCor = (Qxcn - fQxnmV0C->GetBinContent(iCentSPD+1))/fQxnsV0C->GetBinContent(iCentSPD+1);
600  }
601  }
602  else{
603 
604  for(int iV0 = 0; iV0 < 64; iV0++) { //0-31 is V0C, 32-63 VOA
605 
606  fMultv0 = fAODV0->GetMultiplicity(iV0);
607  fV0MultChVsRun->Fill(iV0+0.5,runindex,fMultv0);
608 
609  phiV0 = TMath::PiOver4()*(0.5 + iV0 % 8);
610 
611  if(iV0 < 32){
612  Qxcn += TMath::Cos(fHarmonic*phiV0) * fMultv0;
613  Qycn += TMath::Sin(fHarmonic*phiV0) * fMultv0;
614  sumMc += fMultv0;
615  }
616  else if(iV0 >= 32){
617  Qxan += TMath::Cos(fHarmonic*phiV0) * fMultv0;
618  Qyan += TMath::Sin(fHarmonic*phiV0) * fMultv0;
619  sumMa += fMultv0;
620  }
621  }
622  QxanCor = Qxan;
623  QxcnCor = Qxcn;
624  QyanCor = Qyan;
625  QycnCor = Qycn;
626  }
627 
628 
629 
630  if(sumMa < 0 || sumMc < 0) return;
631  fHist_Event_count->Fill(stepCount); //5
632  stepCount++;
633 
634 
635  AliAODVertex *pVertex = aod->GetPrimaryVertex();
636  Double_t VtxZ = pVertex->GetZ();
637 
638 
639 
640  //------------- Load ZDC info: -----------
641  Double_t energyZNC=0.,energyZNA=0.,energyZPC=0.,energyZPA=0.;
642 
643  energyZNC = ((AliVAODHeader*)aod->GetHeader())->GetZDCN1Energy();
644  energyZNA = ((AliVAODHeader*)aod->GetHeader())->GetZDCN2Energy();
645  energyZPC = ((AliVAODHeader*)aod->GetHeader())->GetZDCP1Energy();
646  energyZPA = ((AliVAODHeader*)aod->GetHeader())->GetZDCP2Energy();
647 
648 
649  //Apply Gain Correction:
651  energyZNC = energyZNC * fHCorrectZDNP->GetBinContent((abs(EvtCent)+1),1);
652  energyZNA = energyZNA * fHCorrectZDNP->GetBinContent((abs(EvtCent)+1),2);
653  energyZPC = energyZPC * fHCorrectZDNP->GetBinContent((abs(EvtCent)+1),3);
654  energyZPA = energyZPA * fHCorrectZDNP->GetBinContent((abs(EvtCent)+1),4);
655  }
656 
657  /*
658  fHEnergyZNCvsCent->Fill(EvtCent,energyZNC);
659  fHEnergyZNAvsCent->Fill(EvtCent,energyZNA);
660  fHEnergyZPCvsCent->Fill(EvtCent,energyZPC);
661  fHEnergyZPAvsCent->Fill(EvtCent,energyZPA);
662 
663  fHEnergyZNCvsCentRun->Fill(EvtCent,runindex,energyZNC);
664  fHEnergyZNAvsCentRun->Fill(EvtCent,runindex,energyZNA);
665  fHEnergyZPCvsCentRun->Fill(EvtCent,runindex,energyZPC);
666  fHEnergyZPAvsCentRun->Fill(EvtCent,runindex,energyZPA);
667 
668  if(EvtCent>30. && EvtCent<40.){
669  fHEnergyZPCvsZPA->Fill(energyZPC,energyZPA);
670  fHEnergyZNCvsZNA->Fill(energyZNC,energyZNA);
671  }
672  */
673 
674 
675 
676 
677 
678  Int_t BadRuns[8] = {246871,246870,246867,246865,246864,246676,246675,246540};
679  Int_t iBadrun = 8;
680  Int_t isBadRun = 0;
681 
682  for(int ib=0;ib<iBadrun;ib++){
683  if(runNumber==BadRuns[ib]){
684  isBadRun = 1;
685  break;
686  }
687  }
688 
689 
690 
691 
692 
693  //Store Qvector for tracks:
694  Double_t QxPos[2] = {0.,}; //[0]=n*phi,[1]=2*n*phi
695  Double_t QyPos[2] = {0.,};
696  Double_t QxNeg[2] = {0.,};
697  Double_t QyNeg[2] = {0.,};
698 
699  //Store Qvector for Auto-correlations
700  Double_t QxAutoPos[2] = {0.,};
701  Double_t QyAutoPos[2] = {0.,};
702  Double_t QxAutoNeg[2] = {0.,};
703  Double_t QyAutoNeg[2] = {0.,};
704 
705 
706  //temp: for QA only
707  Double_t QxPosQAEta[16] = {0.,};
708  Double_t QyPosQAEta[16] = {0.,};
709  Double_t QxNegQAEta[16] = {0.,};
710  Double_t QyNegQAEta[16] = {0.,};
711  Double_t QxAutoPosQAEta[16] = {0.,};
712  Double_t QyAutoPosQAEta[16] = {0.,};
713  Double_t QxAutoNegQAEta[16] = {0.,};
714  Double_t QyAutoNegQAEta[16] = {0.,};
715  Double_t MPOIposQAEta[16] = {0.,};
716  Double_t MPOInegQAEta[16] = {0.,};
717  Int_t iEtaQA = -1;
718 
719  Double_t AvgCos1n=0.,AvgSin1n=0.;
720  //Double_t AvgCos2n=0.,AvgSin2n=0.;
721  Double_t AvgDWCos2n=0.,AvgDWSin2n=0.;
722 
723 
724 
725 
726 
727  //Multiplicity of POIs:
728  Double_t MPOIpos = 0;
729  Double_t MPOIneg = 0;
730 
731  //TPC Event plane Qvectors:
732  Double_t QxTPC[2] = {0.,};
733  Double_t QyTPC[2] = {0.,};
734 
735  Int_t ptBin;
736  Int_t nRefMult = 0;
737  Int_t n = fHarmonic/2.0; // Because, cos(nphi1 + nphi2 - 2nPsi)//
738  Double_t nRefMultWgt = 0.;
739 
740  Int_t iCentRec = 0; //centrality bin for track recenter
741  iCentRec = fHCentBinTrkRecenter->FindBin(EvtCent);
742 
743  //Int_t nBinVz=1,nBinPhi=1,nBinEta=1;
744 
745  //CME using Event plane:
746  Double_t pi = TMath::Pi();
747  Double_t Psi2V0C = 0.5*TMath::ATan2(QycnCor,QxcnCor);
748  if(Psi2V0C<0.) Psi2V0C += pi;
749 
750  Double_t Psi2V0A = 0.5*TMath::ATan2(QyanCor,QxanCor);
751  if(Psi2V0A<0.) Psi2V0A += pi;
752 
753  fV0AQnxVsCentRun->Fill(centrCL1,runindex,QycnCor); // For V0-Q Recenter QA.
754  fV0AQnyVsCentRun->Fill(centrCL1,runindex,QyanCor);
755  fV0CQnxVsCentRun->Fill(centrCL1,runindex,QxcnCor);
756  fV0CQnyVsCentRun->Fill(centrCL1,runindex,QycnCor);
757 
758 
759 
760  Int_t iBinNUA = 1;
761 
762  Int_t iTracks = fEvent->NumberOfTracks();
763 
764  AliFlowTrackSimple* pTrack1 = NULL;
765  AliFlowTrackSimple* pTrack2 = NULL;
766 
767  Double_t dPhi1,dPt1,dEta1,dChrg1;
768  Double_t dPhi2,dPt2,dEta2,dChrg2;
769  Double_t WgtEP = 1.0;
770 
771  Double_t ptw1 = 1.0, w1NUA = 1.0;
772  Double_t ptw2 = 1.0;
773  //Double_t w2NUA = 1.0;
774 
775  for(int i=0; i<iTracks; i++) {
776  pTrack1 = fEvent->GetTrack(i);
777  if(!pTrack1) continue;
778  dPhi1 = pTrack1->Phi(); //0-2pi range
779  dPt1 = pTrack1-> Pt();
780  dEta1 = pTrack1->Eta();
781  dChrg1 = pTrack1->Charge();
782 
783  if(!pTrack1->InPOISelection())
784  continue;
785 
786 
787  if(bFillEtaPhiNUA){
788  if(dChrg1>0){
789  fHist3DEtaPhiVz_Pos_Run[cForNUA][runindex]->Fill(VtxZ,dPhi1,dEta1);
790  }
791  else if(dChrg1<0){
792  fHist3DEtaPhiVz_Neg_Run[cForNUA][runindex]->Fill(VtxZ,dPhi1,dEta1);
793  }
794  }
795 
796  if(bApplyNUACorr){
797  //get NUA weights:
798  if(dChrg1>0){
799  iBinNUA = fHCorrectNUApos->FindBin(VtxZ,dPhi1,dEta1);
800  //w1NUA = 1.0/fHCorrectNUApos->GetBinContent(iBinNUA); //Jacopo's
801  w1NUA = fHCorrectNUApos->GetBinContent(iBinNUA); //Rihan's
802  if(w1NUA > 1e5 ) w1NUA = 1e5;
803  }
804  else if(dChrg1<0){
805  iBinNUA = fHCorrectNUAneg->FindBin(VtxZ,dPhi1,dEta1);
806  //w1NUA = 1.0/fHCorrectNUAneg->GetBinContent(iBinNUA); //Jacopo: bincontent = 1/Wgts
807  w1NUA = fHCorrectNUAneg->GetBinContent(iBinNUA); //Rihan: bincontent = Wgts
808  if(w1NUA > 1e5 ) w1NUA = 1e5;
809  }
810  }
811 
812  if(dChrg1>0){
813  fHistChPosvsEtaPtRun[cIndex]->Fill(dPt1,dEta1,runindex,w1NUA);
814  }
815  else if(dChrg1<0){
816  fHistChNegvsEtaPtRun[cIndex]->Fill(dPt1,dEta1,runindex,w1NUA);
817  }
818 
819 
820  ptBin = fFB_Efficiency_Cent[cIndex]->FindBin(dPt1);
821  ptw1 = 1.0/fFB_Efficiency_Cent[cIndex]->GetBinContent(ptBin);
822 
823 
824 
825  if(bFillAvgTPCQn) { //fill TPC Q-vect:
826  if(VtxZ>0 && dEta1>=0){
827  if(dChrg1>0){
828  fHCos1nPosChEtaVz[0]->Fill(EvtCent,runindex,ptw1*TMath::Cos(dPhi1));
829  fHSin1nPosChEtaVz[0]->Fill(EvtCent,runindex,ptw1*TMath::Sin(dPhi1));
830  fHCos2nPosChEtaVz[0]->Fill(EvtCent,runindex,ptw1*TMath::Cos(2.*dPhi1));
831  fHSin2nPosChEtaVz[0]->Fill(EvtCent,runindex,ptw1*TMath::Sin(2.*dPhi1));
832  fHCos3nPosChEtaVz[0]->Fill(EvtCent,runindex,ptw1*TMath::Cos(3.*dPhi1));
833  fHSin3nPosChEtaVz[0]->Fill(EvtCent,runindex,ptw1*TMath::Sin(3.*dPhi1));
834  fHCos4nPosChEtaVz[0]->Fill(EvtCent,runindex,ptw1*TMath::Cos(4.*dPhi1));
835  fHSin4nPosChEtaVz[0]->Fill(EvtCent,runindex,ptw1*TMath::Sin(4.*dPhi1));
836  fHCos2nDWPosChEtaVz[0]->Fill(EvtCent,runindex,ptw1*ptw1*TMath::Cos(2.*dPhi1));
837  fHSin2nDWPosChEtaVz[0]->Fill(EvtCent,runindex,ptw1*ptw1*TMath::Sin(2.*dPhi1));
838  }
839  else if(dChrg1<0){
840  fHCos1nNegChEtaVz[0]->Fill(EvtCent,runindex,ptw1*TMath::Cos(dPhi1));
841  fHSin1nNegChEtaVz[0]->Fill(EvtCent,runindex,ptw1*TMath::Sin(dPhi1));
842  fHCos2nNegChEtaVz[0]->Fill(EvtCent,runindex,ptw1*TMath::Cos(2.*dPhi1));
843  fHSin2nNegChEtaVz[0]->Fill(EvtCent,runindex,ptw1*TMath::Sin(2.*dPhi1));
844  fHCos3nNegChEtaVz[0]->Fill(EvtCent,runindex,ptw1*TMath::Cos(3.*dPhi1));
845  fHSin3nNegChEtaVz[0]->Fill(EvtCent,runindex,ptw1*TMath::Sin(3.*dPhi1));
846  fHCos4nNegChEtaVz[0]->Fill(EvtCent,runindex,ptw1*TMath::Cos(4.*dPhi1));
847  fHSin4nNegChEtaVz[0]->Fill(EvtCent,runindex,ptw1*TMath::Sin(4.*dPhi1));
848  fHCos2nDWNegChEtaVz[0]->Fill(EvtCent,runindex,ptw1*ptw1*TMath::Cos(2.*dPhi1));
849  fHSin2nDWNegChEtaVz[0]->Fill(EvtCent,runindex,ptw1*ptw1*TMath::Sin(2.*dPhi1));
850  }
851  }
852  else if(VtxZ>0 && dEta1<0){
853  if(dChrg1>0){
854  fHCos1nPosChEtaVz[1]->Fill(EvtCent,runindex,ptw1*TMath::Cos(dPhi1));
855  fHSin1nPosChEtaVz[1]->Fill(EvtCent,runindex,ptw1*TMath::Sin(dPhi1));
856  fHCos2nPosChEtaVz[1]->Fill(EvtCent,runindex,ptw1*TMath::Cos(2.*dPhi1));
857  fHSin2nPosChEtaVz[1]->Fill(EvtCent,runindex,ptw1*TMath::Sin(2.*dPhi1));
858  fHCos3nPosChEtaVz[1]->Fill(EvtCent,runindex,ptw1*TMath::Cos(3.*dPhi1));
859  fHSin3nPosChEtaVz[1]->Fill(EvtCent,runindex,ptw1*TMath::Sin(3.*dPhi1));
860  fHCos4nPosChEtaVz[1]->Fill(EvtCent,runindex,ptw1*TMath::Cos(4.*dPhi1));
861  fHSin4nPosChEtaVz[1]->Fill(EvtCent,runindex,ptw1*TMath::Sin(4.*dPhi1));
862  fHCos2nDWPosChEtaVz[1]->Fill(EvtCent,runindex,ptw1*ptw1*TMath::Cos(2.*dPhi1));
863  fHSin2nDWPosChEtaVz[1]->Fill(EvtCent,runindex,ptw1*ptw1*TMath::Sin(2.*dPhi1));
864  }
865  else if(dChrg1<0){
866  fHCos1nNegChEtaVz[1]->Fill(EvtCent,runindex,ptw1*TMath::Cos(dPhi1));
867  fHSin1nNegChEtaVz[1]->Fill(EvtCent,runindex,ptw1*TMath::Sin(dPhi1));
868  fHCos2nNegChEtaVz[1]->Fill(EvtCent,runindex,ptw1*TMath::Cos(2.*dPhi1));
869  fHSin2nNegChEtaVz[1]->Fill(EvtCent,runindex,ptw1*TMath::Sin(2.*dPhi1));
870  fHCos3nNegChEtaVz[1]->Fill(EvtCent,runindex,ptw1*TMath::Cos(3.*dPhi1));
871  fHSin3nNegChEtaVz[1]->Fill(EvtCent,runindex,ptw1*TMath::Sin(3.*dPhi1));
872  fHCos4nNegChEtaVz[1]->Fill(EvtCent,runindex,ptw1*TMath::Cos(4.*dPhi1));
873  fHSin4nNegChEtaVz[1]->Fill(EvtCent,runindex,ptw1*TMath::Sin(4.*dPhi1));
874  fHCos2nDWNegChEtaVz[1]->Fill(EvtCent,runindex,ptw1*ptw1*TMath::Cos(2.*dPhi1));
875  fHSin2nDWNegChEtaVz[1]->Fill(EvtCent,runindex,ptw1*ptw1*TMath::Sin(2.*dPhi1));
876  }
877  }
878  else if(VtxZ<0 && dEta1>=0){
879  if(dChrg1>0){
880  fHCos1nPosChEtaVz[2]->Fill(EvtCent,runindex,ptw1*TMath::Cos(dPhi1));
881  fHSin1nPosChEtaVz[2]->Fill(EvtCent,runindex,ptw1*TMath::Sin(dPhi1));
882  fHCos2nPosChEtaVz[2]->Fill(EvtCent,runindex,ptw1*TMath::Cos(2.*dPhi1));
883  fHSin2nPosChEtaVz[2]->Fill(EvtCent,runindex,ptw1*TMath::Sin(2.*dPhi1));
884  fHCos3nPosChEtaVz[2]->Fill(EvtCent,runindex,ptw1*TMath::Cos(3.*dPhi1));
885  fHSin3nPosChEtaVz[2]->Fill(EvtCent,runindex,ptw1*TMath::Sin(3.*dPhi1));
886  fHCos4nPosChEtaVz[2]->Fill(EvtCent,runindex,ptw1*TMath::Cos(4.*dPhi1));
887  fHSin4nPosChEtaVz[2]->Fill(EvtCent,runindex,ptw1*TMath::Sin(4.*dPhi1));
888  fHCos2nDWPosChEtaVz[2]->Fill(EvtCent,runindex,ptw1*ptw1*TMath::Cos(2.*dPhi1));
889  fHSin2nDWPosChEtaVz[2]->Fill(EvtCent,runindex,ptw1*ptw1*TMath::Sin(2.*dPhi1));
890  }
891  else if(dChrg1<0){
892  fHCos1nNegChEtaVz[2]->Fill(EvtCent,runindex,ptw1*TMath::Cos(dPhi1));
893  fHSin1nNegChEtaVz[2]->Fill(EvtCent,runindex,ptw1*TMath::Sin(dPhi1));
894  fHCos2nNegChEtaVz[2]->Fill(EvtCent,runindex,ptw1*TMath::Cos(2.*dPhi1));
895  fHSin2nNegChEtaVz[2]->Fill(EvtCent,runindex,ptw1*TMath::Sin(2.*dPhi1));
896  fHCos3nNegChEtaVz[2]->Fill(EvtCent,runindex,ptw1*TMath::Cos(3.*dPhi1));
897  fHSin3nNegChEtaVz[2]->Fill(EvtCent,runindex,ptw1*TMath::Sin(3.*dPhi1));
898  fHCos4nNegChEtaVz[2]->Fill(EvtCent,runindex,ptw1*TMath::Cos(4.*dPhi1));
899  fHSin4nNegChEtaVz[2]->Fill(EvtCent,runindex,ptw1*TMath::Sin(4.*dPhi1));
900  fHCos2nDWNegChEtaVz[2]->Fill(EvtCent,runindex,ptw1*ptw1*TMath::Cos(2.*dPhi1));
901  fHSin2nDWNegChEtaVz[2]->Fill(EvtCent,runindex,ptw1*ptw1*TMath::Sin(2.*dPhi1));
902  }
903 
904  }
905  else if(VtxZ<0 && dEta1<0){
906  if(dChrg1>0){
907  fHCos1nPosChEtaVz[3]->Fill(EvtCent,runindex,ptw1*TMath::Cos(dPhi1));
908  fHSin1nPosChEtaVz[3]->Fill(EvtCent,runindex,ptw1*TMath::Sin(dPhi1));
909  fHCos2nPosChEtaVz[3]->Fill(EvtCent,runindex,ptw1*TMath::Cos(2.*dPhi1));
910  fHSin2nPosChEtaVz[3]->Fill(EvtCent,runindex,ptw1*TMath::Sin(2.*dPhi1));
911  fHCos3nPosChEtaVz[3]->Fill(EvtCent,runindex,ptw1*TMath::Cos(3.*dPhi1));
912  fHSin3nPosChEtaVz[3]->Fill(EvtCent,runindex,ptw1*TMath::Sin(3.*dPhi1));
913  fHCos4nPosChEtaVz[3]->Fill(EvtCent,runindex,ptw1*TMath::Cos(4.*dPhi1));
914  fHSin4nPosChEtaVz[3]->Fill(EvtCent,runindex,ptw1*TMath::Sin(4.*dPhi1));
915  fHCos2nDWPosChEtaVz[3]->Fill(EvtCent,runindex,ptw1*ptw1*TMath::Cos(2.*dPhi1));
916  fHSin2nDWPosChEtaVz[3]->Fill(EvtCent,runindex,ptw1*ptw1*TMath::Sin(2.*dPhi1));
917  }
918  else if(dChrg1<0){
919  fHCos1nNegChEtaVz[3]->Fill(EvtCent,runindex,ptw1*TMath::Cos(dPhi1));
920  fHSin1nNegChEtaVz[3]->Fill(EvtCent,runindex,ptw1*TMath::Sin(dPhi1));
921  fHCos2nNegChEtaVz[3]->Fill(EvtCent,runindex,ptw1*TMath::Cos(2.*dPhi1));
922  fHSin2nNegChEtaVz[3]->Fill(EvtCent,runindex,ptw1*TMath::Sin(2.*dPhi1));
923  fHCos3nNegChEtaVz[3]->Fill(EvtCent,runindex,ptw1*TMath::Cos(3.*dPhi1));
924  fHSin3nNegChEtaVz[3]->Fill(EvtCent,runindex,ptw1*TMath::Sin(3.*dPhi1));
925  fHCos4nNegChEtaVz[3]->Fill(EvtCent,runindex,ptw1*TMath::Cos(4.*dPhi1));
926  fHSin4nNegChEtaVz[3]->Fill(EvtCent,runindex,ptw1*TMath::Sin(4.*dPhi1));
927  fHCos2nDWNegChEtaVz[3]->Fill(EvtCent,runindex,ptw1*ptw1*TMath::Cos(2.*dPhi1));
928  fHSin2nDWNegChEtaVz[3]->Fill(EvtCent,runindex,ptw1*ptw1*TMath::Sin(2.*dPhi1));
929  }
930  }
931  }
932 
933  if(isBadRun) continue;
934 
935 
936 
937  iEtaQA = fEtaBinFinderForQA->FindBin(dEta1) - 1;
938 
939  if(dChrg1>0){
940  QxPos[0] += (ptw1*w1NUA*TMath::Cos(n*dPhi1) - AvgCos1n);
941  QyPos[0] += (ptw1*w1NUA*TMath::Sin(n*dPhi1) - AvgSin1n);
942  QxAutoPos[0] += (ptw1*ptw1*w1NUA*w1NUA*TMath::Cos(2.*n*dPhi1) - AvgDWCos2n);
943  QyAutoPos[0] += (ptw1*ptw1*w1NUA*w1NUA*TMath::Sin(2.*n*dPhi1) - AvgDWSin2n);
944  MPOIpos += w1NUA*ptw1;
945  //QA: eta dependence
946  if(EvtCent>=10 && EvtCent<20){
947  QxPosQAEta[iEtaQA] += (ptw1*w1NUA*TMath::Cos(n*dPhi1) - AvgCos1n);
948  QyPosQAEta[iEtaQA] += (ptw1*w1NUA*TMath::Sin(n*dPhi1) - AvgSin1n);
949  QxAutoPosQAEta[iEtaQA] += (ptw1*ptw1*w1NUA*w1NUA*TMath::Cos(2.*n*dPhi1) - AvgDWCos2n);
950  QyAutoPosQAEta[iEtaQA] += (ptw1*ptw1*w1NUA*w1NUA*TMath::Sin(2.*n*dPhi1) - AvgDWSin2n);
951  MPOIposQAEta[iEtaQA] += w1NUA*ptw1;
952  }
953  }
954  else if(dChrg1<0){
955  QxNeg[0] += (ptw1*w1NUA*TMath::Cos(n*dPhi1) - AvgCos1n);
956  QyNeg[0] += (ptw1*w1NUA*TMath::Sin(n*dPhi1) - AvgSin1n);
957  QxAutoNeg[0] += (ptw1*ptw1*w1NUA*w1NUA*TMath::Cos(2.*n*dPhi1) - AvgDWCos2n);
958  QyAutoNeg[0] += (ptw1*ptw1*w1NUA*w1NUA*TMath::Sin(2.*n*dPhi1) - AvgDWSin2n);
959  MPOIneg += w1NUA*ptw1;
960  //QA: eta dependence
961  if(EvtCent>=10 && EvtCent<20){
962  QxNegQAEta[iEtaQA] += (ptw1*TMath::Cos(n*dPhi1) - AvgCos1n);
963  QyNegQAEta[iEtaQA] += (ptw1*TMath::Sin(n*dPhi1) - AvgSin1n);
964  QxAutoNegQAEta[iEtaQA] += (ptw1*ptw1*TMath::Cos(2.*n*dPhi1) - AvgDWCos2n);
965  QyAutoNegQAEta[iEtaQA] += (ptw1*ptw1*TMath::Sin(2.*n*dPhi1) - AvgDWSin2n);
966  MPOInegQAEta[iEtaQA] += w1NUA*ptw1;
967  }
968  }
969 
970  //QxTPC[0] += ptw1*w1NUA*TMath::Cos(n*dPhi1);
971  //QyTPC[0] += ptw1*w1NUA*TMath::Sin(n*dPhi1);
972  QxTPC[1] += ptw1*w1NUA*TMath::Cos(2.*n*dPhi1);
973  QyTPC[1] += ptw1*w1NUA*TMath::Sin(2.*n*dPhi1);
974 
975  nRefMult++;
976  nRefMultWgt += ptw1*w1NUA;
977 
978 
979  //if(i%10==0)
980  //cout<<" track "<<i<<" eta = "<<dEta1<<"\tvz = "<<VtxZ<<"\tptw1 = "<<ptw1<<"\tw1NUA = "<<w1NUA<<"\tAvgCos1n = "<<AvgCos1n<<endl;
981 
982 
983 
984  //2nd track loop:
985  for(int j=0; j<iTracks; j++) {
986 
987  if(j==i) continue; //Auto-correlation removed.
988 
989  pTrack2 = fEvent->GetTrack(j);
990  if(!pTrack2) continue;
991  dPhi2 = pTrack2->Phi(); //0-2pi range
992  dPt2 = pTrack2-> Pt();
993  dEta2 = pTrack2->Eta();
994  dChrg2 = pTrack2->Charge();
995 
996  if(!pTrack2->InPOISelection())
997  continue;
998 
999  /*
1000  ptBin = fFB_Efficiency_Cent[cIndex]->FindBin(dPt2);
1001  ptw2 = 1.0/fFB_Efficiency_Cent[cIndex]->GetBinContent(ptBin);
1002 
1003  if(bApplyNUAforEP){
1004  if(bApplyNUACorr){
1005  if(dChrg2>0){
1006  iBinNUA = fHCorrectNUApos->FindBin(VtxZ,dPhi2,dEta2);
1007  w2NUA = fHCorrectNUApos->GetBinContent(iBinNUA);
1008  if(w2NUA > 1e5 ) w2NUA = 1e5;
1009  }
1010  else if(dChrg2<0){
1011  iBinNUA = fHCorrectNUApos->FindBin(VtxZ,dPhi2,dEta2);
1012  w2NUA = fHCorrectNUApos->GetBinContent(iBinNUA);
1013  if(w2NUA > 1e5 ) w2NUA = 1e5;
1014  }
1015  WgtEP = ptw1*ptw2*w1NUA*w2NUA;
1016  }
1017  else{
1018  WgtEP = ptw1*ptw2;
1019  }
1020  }
1021  else{
1022  WgtEP = 1.0;
1023  }
1024  */
1025 
1026  if(bApplyNUAforEP){
1027  WgtEP = ptw1*ptw2;
1028  }
1029  else{
1030  WgtEP = 1.0;
1031  }
1032 
1033  if(dChrg1!=dChrg2){
1034  fHist_Corr3p_EP_Norm_PN[QAindex][0]->Fill(EvtCent, TMath::Cos(n*dPhi1 + n*dPhi2 - 2.*n*Psi2V0A),WgtEP);
1035  fHist_Corr3p_EP_Norm_PN[QAindex][1]->Fill(EvtCent, TMath::Cos(n*dPhi1 + n*dPhi2 - 2.*n*Psi2V0C),WgtEP);
1036  if(cIndex<6){
1037  fHist_Corr3p_pTSum_EP_V0A_PN[QAindex][cIndex]->Fill((dPt1+dPt2)*0.5, TMath::Cos(n*dPhi1 + n*dPhi2 - 2.*n*Psi2V0A),1.0);
1038  fHist_Corr3p_pTSum_EP_V0C_PN[QAindex][cIndex]->Fill((dPt1+dPt2)*0.5, TMath::Cos(n*dPhi1 + n*dPhi2 - 2.*n*Psi2V0C),1.0);
1039  fHist_Corr3p_pTDiff_EP_V0A_PN[QAindex][cIndex]->Fill(TMath::Abs(dPt1-dPt2), TMath::Cos(n*dPhi1 + n*dPhi2 - 2.*n*Psi2V0A),1.0);
1040  fHist_Corr3p_pTDiff_EP_V0C_PN[QAindex][cIndex]->Fill(TMath::Abs(dPt1-dPt2), TMath::Cos(n*dPhi1 + n*dPhi2 - 2.*n*Psi2V0C),1.0);
1041  fHist_Corr3p_EtaDiff_EP_V0A_PN[QAindex][cIndex]->Fill(TMath::Abs(dEta1-dEta2), TMath::Cos(n*dPhi1 + n*dPhi2 - 2.*n*Psi2V0A),WgtEP);
1042  fHist_Corr3p_EtaDiff_EP_V0C_PN[QAindex][cIndex]->Fill(TMath::Abs(dEta1-dEta2), TMath::Cos(n*dPhi1 + n*dPhi2 - 2.*n*Psi2V0C),WgtEP);
1043  }
1044  }
1045  else if(dChrg1>0 && dChrg2>0){
1046  fHist_Corr3p_EP_Norm_PP[QAindex][0]->Fill(EvtCent, TMath::Cos(n*dPhi1 + n*dPhi2 - 2.*n*Psi2V0A),WgtEP);
1047  fHist_Corr3p_EP_Norm_PP[QAindex][1]->Fill(EvtCent, TMath::Cos(n*dPhi1 + n*dPhi2 - 2.*n*Psi2V0C),WgtEP);
1048  if(cIndex<6){
1049  fHist_Corr3p_pTSum_EP_V0A_PP[QAindex][cIndex]->Fill((dPt1+dPt2)*0.5, TMath::Cos(n*dPhi1 + n*dPhi2 - 2.*n*Psi2V0A),1.0);
1050  fHist_Corr3p_pTSum_EP_V0C_PP[QAindex][cIndex]->Fill((dPt1+dPt2)*0.5, TMath::Cos(n*dPhi1 + n*dPhi2 - 2.*n*Psi2V0C),1.0);
1051  fHist_Corr3p_pTDiff_EP_V0A_PP[QAindex][cIndex]->Fill(TMath::Abs(dPt1-dPt2), TMath::Cos(n*dPhi1 + n*dPhi2 - 2.*n*Psi2V0A),1.0);
1052  fHist_Corr3p_pTDiff_EP_V0C_PP[QAindex][cIndex]->Fill(TMath::Abs(dPt1-dPt2), TMath::Cos(n*dPhi1 + n*dPhi2 - 2.*n*Psi2V0C),1.0);
1053  fHist_Corr3p_EtaDiff_EP_V0A_PP[QAindex][cIndex]->Fill(TMath::Abs(dEta1-dEta2), TMath::Cos(n*dPhi1 + n*dPhi2 - 2.*n*Psi2V0A),WgtEP);
1054  fHist_Corr3p_EtaDiff_EP_V0C_PP[QAindex][cIndex]->Fill(TMath::Abs(dEta1-dEta2), TMath::Cos(n*dPhi1 + n*dPhi2 - 2.*n*Psi2V0C),WgtEP);
1055  }
1056  }
1057  else if(dChrg1<0 && dChrg2<0){
1058  fHist_Corr3p_EP_Norm_NN[QAindex][0]->Fill(EvtCent, TMath::Cos(n*dPhi1 + n*dPhi2 - 2.*n*Psi2V0A),WgtEP);
1059  fHist_Corr3p_EP_Norm_NN[QAindex][1]->Fill(EvtCent, TMath::Cos(n*dPhi1 + n*dPhi2 - 2.*n*Psi2V0C),WgtEP);
1060  if(cIndex<6){
1061  fHist_Corr3p_pTSum_EP_V0A_NN[QAindex][cIndex]->Fill((dPt1+dPt2)*0.5, TMath::Cos(n*dPhi1 + n*dPhi2 - 2.*n*Psi2V0A),1.0);
1062  fHist_Corr3p_pTSum_EP_V0C_NN[QAindex][cIndex]->Fill((dPt1+dPt2)*0.5, TMath::Cos(n*dPhi1 + n*dPhi2 - 2.*n*Psi2V0C),1.0);
1063  fHist_Corr3p_pTDiff_EP_V0A_NN[QAindex][cIndex]->Fill(TMath::Abs(dPt1-dPt2), TMath::Cos(n*dPhi1 + n*dPhi2 - 2.*n*Psi2V0A),1.0);
1064  fHist_Corr3p_pTDiff_EP_V0C_NN[QAindex][cIndex]->Fill(TMath::Abs(dPt1-dPt2), TMath::Cos(n*dPhi1 + n*dPhi2 - 2.*n*Psi2V0C),1.0);
1065  fHist_Corr3p_EtaDiff_EP_V0A_NN[QAindex][cIndex]->Fill(TMath::Abs(dEta1-dEta2), TMath::Cos(n*dPhi1 + n*dPhi2 - 2.*n*Psi2V0A),WgtEP);
1066  fHist_Corr3p_EtaDiff_EP_V0C_NN[QAindex][cIndex]->Fill(TMath::Abs(dEta1-dEta2), TMath::Cos(n*dPhi1 + n*dPhi2 - 2.*n*Psi2V0C),WgtEP);
1067  }
1068  }
1069  }//nested loop ends
1070  }//------ track loop ends ------
1071 
1072 
1073 
1074  fEventStatvsRun->Fill(runindex);
1075 
1076  if(isBadRun) return;
1077  fHist_Event_count->Fill(stepCount); //6
1078  stepCount++;
1079 
1080 
1081 
1082  Double_t QTPCRe = 0.;
1083  Double_t QTPCIm = 0.;
1084 
1085  QTPCRe = QxTPC[1];
1086  QTPCIm = QyTPC[1];
1087 
1088 
1089  Double_t Psi2TPC = 0.5*(TMath::ATan2(QTPCIm,QTPCRe));
1090  if(Psi2TPC < 0.) Psi2TPC += pi;
1091 
1092  fTPCQnxVsCentRun->Fill(centrCL1,runindex,TMath::Cos(Psi2TPC));
1093  fTPCQnyVsCentRun->Fill(centrCL1,runindex,TMath::Sin(Psi2TPC));
1094 
1095 
1096 
1097 //V0A-V0C EP resolution:
1098  fHist_Reso2n_EP_Norm_Det[QAindex][0]->Fill(EvtCent, TMath::Cos(2.*(Psi2V0A-Psi2V0C)));
1099 //V0A-TPC EP resolution:
1100  fHist_Reso2n_EP_Norm_Det[QAindex][1]->Fill(EvtCent, TMath::Cos(2.*(Psi2V0A-Psi2TPC)));
1101 //V0C-TPC EP resolution:
1102  fHist_Reso2n_EP_Norm_Det[QAindex][2]->Fill(EvtCent, TMath::Cos(2.*(Psi2V0C-Psi2TPC)));
1103 
1104  fHV0AEventPlaneVsCent->Fill(EvtCent,Psi2V0A);
1105  fHV0CEventPlaneVsCent->Fill(EvtCent,Psi2V0C);
1106  fHTPCEventPlaneVsCent->Fill(EvtCent,Psi2TPC);
1107 
1108 
1109 
1110 
1111 
1112 
1113  //------- SP Method -------------
1114 
1115 
1116  Double_t uPRe=0.,uNRe=0.,uPIm=0.,uNIm=0.,uN2Re=0.,uN2Im=0.,uP2Re=0.,uP2Im=0.;
1117  Double_t uPM=0.,uNM=0.;
1118  //Double_t VCIm=0., VPRe=0.,VPIm=0.;
1119 
1120 
1121  uPM = MPOIpos; uNM = MPOIneg;
1122 
1123  uPRe = QxPos[0]; uNRe = QxNeg[0];
1124  uPIm = QyPos[0]; uNIm = QyNeg[0];
1125 
1126  uP2Re = QxAutoPos[0]; uP2Im = QyAutoPos[0];
1127  uN2Re = QxAutoNeg[0]; uN2Im = QyAutoNeg[0];
1128 
1129  Double_t TwoQpQnV = 0.,TwoQpQpV=0.,TwoQnQnV=0.;
1130 
1131  if(uPM > 1 && uNM > 1) {
1132  //CME w.r.t V0A EP:
1133  TwoQpQnV = ((uPRe*uNRe-uPIm*uNIm)*QxanCor + (uPRe*uNIm+uPIm*uNRe)*QyanCor) / (uPM*uNM) ;
1134  TwoQpQpV = ((uPRe*uPRe-uPIm*uPIm-uP2Re)*QxanCor + (2.*uPRe*uPIm-uP2Im)*QyanCor) / (uPM*(uPM-1.)) ;
1135  TwoQnQnV = ((uNRe*uNRe-uNIm*uNIm-uN2Re)*QxanCor + (2.*uNRe*uNIm-uN2Im)*QyanCor) / (uNM*(uNM-1.)) ;
1136  //Fill profiles:
1137  fHist_Corr3p_SP_Norm_PN[QAindex][0]->Fill(EvtCent, TwoQpQnV, uPM*uNM);
1138  fHist_Corr3p_SP_Norm_PP[QAindex][0]->Fill(EvtCent, TwoQpQpV, (uPM*(uPM-1.)));
1139  fHist_Corr3p_SP_Norm_NN[QAindex][0]->Fill(EvtCent, TwoQnQnV, (uNM*(uNM-1.)));
1140 
1141  //-------- CME - ZDN correlators:---------
1142  fHist_Corr3p_ZDN_SP_PN[0]->Fill(EvtCent, 0., TwoQpQnV, uPM*uNM);
1143  fHist_Corr3p_ZDN_SP_PN[0]->Fill(EvtCent, 1., energyZPA, 1.);
1144  fHist_Corr3p_ZDN_SP_PN[0]->Fill(EvtCent, 2., energyZPC, 1.);
1145  fHist_Corr3p_ZDN_SP_PN[0]->Fill(EvtCent, 3., (energyZPA+energyZPC), 1.);
1146  fHist_Corr3p_ZDN_SP_PN[0]->Fill(EvtCent, 4., energyZNA, 1.);
1147  fHist_Corr3p_ZDN_SP_PN[0]->Fill(EvtCent, 5., energyZNC, 1.);
1148  fHist_Corr3p_ZDN_SP_PN[0]->Fill(EvtCent, 6., (energyZNA+energyZNC), 1.);
1149  fHist_Corr3p_ZDN_SP_PN[0]->Fill(EvtCent, 7., TwoQpQnV*energyZPA, uPM*uNM);
1150  fHist_Corr3p_ZDN_SP_PN[0]->Fill(EvtCent, 8., TwoQpQnV*energyZPC, uPM*uNM);
1151  fHist_Corr3p_ZDN_SP_PN[0]->Fill(EvtCent, 9., TwoQpQnV*(energyZPC+energyZPA), uPM*uNM);
1152  fHist_Corr3p_ZDN_SP_PN[0]->Fill(EvtCent, 10., TwoQpQnV*energyZNA, uPM*uNM);
1153  fHist_Corr3p_ZDN_SP_PN[0]->Fill(EvtCent, 11., TwoQpQnV*energyZNC, uPM*uNM);
1154  fHist_Corr3p_ZDN_SP_PN[0]->Fill(EvtCent, 12., TwoQpQnV*(energyZNC+energyZNA), uPM*uNM);
1155 
1156  fHist_Corr3p_ZDN_SP_PP[0]->Fill(EvtCent, 0., TwoQpQpV, (uPM*(uPM-1.)));
1157  //fHist_Corr3p_ZDN_SP_PP[0]->Fill(EvtCent, 1., energyZPA, 1.);
1158  //fHist_Corr3p_ZDN_SP_PP[0]->Fill(EvtCent, 2., energyZPC, 1.);
1159  //fHist_Corr3p_ZDN_SP_PP[0]->Fill(EvtCent, 3., (energyZPA+energyZPC), 1.);
1160  //fHist_Corr3p_ZDN_SP_PP[0]->Fill(EvtCent, 4., energyZNA, 1.);
1161  //fHist_Corr3p_ZDN_SP_PP[0]->Fill(EvtCent, 5., energyZNC, 1.);
1162  //fHist_Corr3p_ZDN_SP_PP[0]->Fill(EvtCent, 6., (energyZNA+energyZNC), 1.);
1163  fHist_Corr3p_ZDN_SP_PP[0]->Fill(EvtCent, 7., TwoQpQpV*energyZPA, (uPM*(uPM-1.)));
1164  fHist_Corr3p_ZDN_SP_PP[0]->Fill(EvtCent, 8., TwoQpQpV*energyZPC, (uPM*(uPM-1.)));
1165  fHist_Corr3p_ZDN_SP_PP[0]->Fill(EvtCent, 9., TwoQpQpV*(energyZPC+energyZPA), (uPM*(uPM-1.)));
1166  fHist_Corr3p_ZDN_SP_PP[0]->Fill(EvtCent, 10., TwoQpQpV*energyZNA, (uPM*(uPM-1.)));
1167  fHist_Corr3p_ZDN_SP_PP[0]->Fill(EvtCent, 11., TwoQpQpV*energyZNC, (uPM*(uPM-1.)));
1168  fHist_Corr3p_ZDN_SP_PP[0]->Fill(EvtCent, 12., TwoQpQpV*(energyZNC+energyZNA), (uPM*(uPM-1.)));
1169 
1170  fHist_Corr3p_ZDN_SP_NN[0]->Fill(EvtCent, 0., TwoQnQnV, (uNM*(uNM-1.)));
1171  //fHist_Corr3p_ZDN_SP_NN[0]->Fill(EvtCent, 1., energyZPA, 1.);
1172  //fHist_Corr3p_ZDN_SP_NN[0]->Fill(EvtCent, 2., energyZPC, 1.);
1173  //fHist_Corr3p_ZDN_SP_NN[0]->Fill(EvtCent, 3., (energyZPA+energyZPC), 1.);
1174  //fHist_Corr3p_ZDN_SP_NN[0]->Fill(EvtCent, 4., energyZNA, 1.);
1175  //fHist_Corr3p_ZDN_SP_NN[0]->Fill(EvtCent, 5., energyZNC, 1.);
1176  //fHist_Corr3p_ZDN_SP_NN[0]->Fill(EvtCent, 6., (energyZNA+energyZNC), 1.);
1177  fHist_Corr3p_ZDN_SP_NN[0]->Fill(EvtCent, 7., TwoQnQnV*energyZPA, (uNM*(uNM-1.)));
1178  fHist_Corr3p_ZDN_SP_NN[0]->Fill(EvtCent, 8., TwoQnQnV*energyZPC, (uNM*(uNM-1.)));
1179  fHist_Corr3p_ZDN_SP_NN[0]->Fill(EvtCent, 9., TwoQnQnV*(energyZPC+energyZPA), (uNM*(uNM-1.)));
1180  fHist_Corr3p_ZDN_SP_NN[0]->Fill(EvtCent, 10., TwoQnQnV*energyZNA, (uNM*(uNM-1.)));
1181  fHist_Corr3p_ZDN_SP_NN[0]->Fill(EvtCent, 11., TwoQnQnV*energyZNC, (uNM*(uNM-1.)));
1182  fHist_Corr3p_ZDN_SP_NN[0]->Fill(EvtCent, 12., TwoQnQnV*(energyZNC+energyZNA), (uNM*(uNM-1.)));
1183  //-----------------------------------------
1184 
1185 
1186 
1187 
1188  //CME w.r.t V0C EP:
1189  TwoQpQnV = 0.; TwoQpQpV = 0.; TwoQnQnV = 0.;
1190  TwoQpQnV = ((uPRe*uNRe-uPIm*uNIm)*QxcnCor + (uPRe*uNIm+uPIm*uNRe)*QycnCor) / (uPM*uNM) ;
1191  TwoQpQpV = ((uPRe*uPRe-uPIm*uPIm-uP2Re)*QxcnCor + (2.*uPRe*uPIm-uP2Im)*QycnCor) / (uPM*(uPM-1.)) ;
1192  TwoQnQnV = ((uNRe*uNRe-uNIm*uNIm-uN2Re)*QxcnCor + (2.*uNRe*uNIm-uN2Im)*QycnCor) / (uNM*(uNM-1.)) ;
1193 
1194  //Fill profiles:
1195  fHist_Corr3p_SP_Norm_PN[QAindex][1]->Fill(EvtCent, TwoQpQnV, uPM*uNM);
1196  fHist_Corr3p_SP_Norm_PP[QAindex][1]->Fill(EvtCent, TwoQpQpV, (uPM*(uPM-1.)));
1197  fHist_Corr3p_SP_Norm_NN[QAindex][1]->Fill(EvtCent, TwoQnQnV, (uNM*(uNM-1.)));
1198 
1199  //-------- CME - ZDN correlators:---------
1200  fHist_Corr3p_ZDN_SP_PN[1]->Fill(EvtCent, 0., TwoQpQnV, uPM*uNM);
1201  fHist_Corr3p_ZDN_SP_PN[1]->Fill(EvtCent, 1., energyZPA, 1.);
1202  fHist_Corr3p_ZDN_SP_PN[1]->Fill(EvtCent, 2., energyZPC, 1.);
1203  fHist_Corr3p_ZDN_SP_PN[1]->Fill(EvtCent, 3., (energyZPA+energyZPC), 1.);
1204  fHist_Corr3p_ZDN_SP_PN[1]->Fill(EvtCent, 4., energyZNA, 1.);
1205  fHist_Corr3p_ZDN_SP_PN[1]->Fill(EvtCent, 5., energyZNC, 1.);
1206  fHist_Corr3p_ZDN_SP_PN[1]->Fill(EvtCent, 6., (energyZNA+energyZNC), 1.);
1207  fHist_Corr3p_ZDN_SP_PN[1]->Fill(EvtCent, 7., TwoQpQnV*energyZPA, uPM*uNM);
1208  fHist_Corr3p_ZDN_SP_PN[1]->Fill(EvtCent, 8., TwoQpQnV*energyZPC, uPM*uNM);
1209  fHist_Corr3p_ZDN_SP_PN[1]->Fill(EvtCent, 9., TwoQpQnV*(energyZPC+energyZPA), uPM*uNM);
1210  fHist_Corr3p_ZDN_SP_PN[1]->Fill(EvtCent, 10., TwoQpQnV*energyZNA, uPM*uNM);
1211  fHist_Corr3p_ZDN_SP_PN[1]->Fill(EvtCent, 11., TwoQpQnV*energyZNC, uPM*uNM);
1212  fHist_Corr3p_ZDN_SP_PN[1]->Fill(EvtCent, 12., TwoQpQnV*(energyZNC+energyZNA), uPM*uNM);
1213 
1214  fHist_Corr3p_ZDN_SP_PP[1]->Fill(EvtCent, 0., TwoQpQpV, (uPM*(uPM-1.)));
1215  //fHist_Corr3p_ZDN_SP_PP[1]->Fill(EvtCent, 1., energyZPA, 1.);
1216  //fHist_Corr3p_ZDN_SP_PP[1]->Fill(EvtCent, 2., energyZPC, 1.);
1217  //fHist_Corr3p_ZDN_SP_PP[1]->Fill(EvtCent, 3., (energyZPA+energyZPC), 1.);
1218  //fHist_Corr3p_ZDN_SP_PP[1]->Fill(EvtCent, 4., energyZNA, 1.);
1219  //fHist_Corr3p_ZDN_SP_PP[1]->Fill(EvtCent, 5., energyZNC, 1.);
1220  //fHist_Corr3p_ZDN_SP_PP[1]->Fill(EvtCent, 6., (energyZNA+energyZNC), 1.);
1221  fHist_Corr3p_ZDN_SP_PP[1]->Fill(EvtCent, 7., TwoQpQpV*energyZPA, (uPM*(uPM-1.)));
1222  fHist_Corr3p_ZDN_SP_PP[1]->Fill(EvtCent, 8., TwoQpQpV*energyZPC, (uPM*(uPM-1.)));
1223  fHist_Corr3p_ZDN_SP_PP[1]->Fill(EvtCent, 9., TwoQpQpV*(energyZPC+energyZPA), (uPM*(uPM-1.)));
1224  fHist_Corr3p_ZDN_SP_PP[1]->Fill(EvtCent, 10., TwoQpQpV*energyZNA, (uPM*(uPM-1.)));
1225  fHist_Corr3p_ZDN_SP_PP[1]->Fill(EvtCent, 11., TwoQpQpV*energyZNC, (uPM*(uPM-1.)));
1226  fHist_Corr3p_ZDN_SP_PP[1]->Fill(EvtCent, 12., TwoQpQpV*(energyZNC+energyZNA), (uPM*(uPM-1.)));
1227 
1228  fHist_Corr3p_ZDN_SP_NN[1]->Fill(EvtCent, 0., TwoQnQnV, (uNM*(uNM-1.)));
1229  //fHist_Corr3p_ZDN_SP_NN[1]->Fill(EvtCent, 1., energyZPA, 1.);
1230  //fHist_Corr3p_ZDN_SP_NN[1]->Fill(EvtCent, 2., energyZPC, 1.);
1231  //fHist_Corr3p_ZDN_SP_NN[1]->Fill(EvtCent, 3., (energyZPA+energyZPC), 1.);
1232  //fHist_Corr3p_ZDN_SP_NN[1]->Fill(EvtCent, 4., energyZNA, 1.);
1233  //fHist_Corr3p_ZDN_SP_NN[1]->Fill(EvtCent, 5., energyZNC, 1.);
1234  //fHist_Corr3p_ZDN_SP_NN[1]->Fill(EvtCent, 6., (energyZNA+energyZNC), 1.);
1235  fHist_Corr3p_ZDN_SP_NN[1]->Fill(EvtCent, 7., TwoQnQnV*energyZPA, (uNM*(uNM-1.)));
1236  fHist_Corr3p_ZDN_SP_NN[1]->Fill(EvtCent, 8., TwoQnQnV*energyZPC, (uNM*(uNM-1.)));
1237  fHist_Corr3p_ZDN_SP_NN[1]->Fill(EvtCent, 9., TwoQnQnV*(energyZPC+energyZPA), (uNM*(uNM-1.)));
1238  fHist_Corr3p_ZDN_SP_NN[1]->Fill(EvtCent, 10., TwoQnQnV*energyZNA, (uNM*(uNM-1.)));
1239  fHist_Corr3p_ZDN_SP_NN[1]->Fill(EvtCent, 11., TwoQnQnV*energyZNC, (uNM*(uNM-1.)));
1240  fHist_Corr3p_ZDN_SP_NN[1]->Fill(EvtCent, 12., TwoQnQnV*(energyZNC+energyZNA), (uNM*(uNM-1.)));
1241  //-----------------------------------------
1242 
1243 
1244  //Fill Mult, POIs vs cent:
1245 
1246  fAvgMultCentRun->Fill(EvtCent,runindex,nRefMult);
1247  fAvgWgtMultCentRun->Fill(EvtCent,runindex,nRefMultWgt);
1248  fAvgPOIposCentRun->Fill(EvtCent,runindex,uPM);
1249  fAvgPOInegCentRun->Fill(EvtCent,runindex,uNM);
1250  fAvgPOIPPCentRun->Fill(EvtCent,runindex,uPM*(uPM-1.));
1251  fAvgPOINNCentRun->Fill(EvtCent,runindex,uNM*(uNM-1.));
1252  fAvgPOIOSCentRun->Fill(EvtCent,runindex,uPM*uNM);
1253 
1254 
1255  //------------ eta depedence -----------------
1256  Double_t fEtaCent = -100.;
1257 
1258  for(int ie=0; ie<16; ie++){
1259 
1260  uPM = MPOIposQAEta[ie];
1261  uNM = MPOInegQAEta[ie];
1262 
1263  if(uPM>1 && uNM>1){
1264 
1265  uPRe = QxPosQAEta[ie];
1266  uNRe = QxNegQAEta[ie];
1267  uPIm = QyPosQAEta[ie];
1268  uNIm = QyNegQAEta[ie];
1269 
1270  uP2Re = QxAutoPosQAEta[ie];
1271  uP2Im = QyAutoPosQAEta[ie];
1272  uN2Re = QxAutoNegQAEta[ie];
1273  uN2Im = QyAutoNegQAEta[ie];
1274 
1275  TwoQpQnV = 0.; TwoQpQpV = 0.; TwoQnQnV = 0.;
1276  TwoQpQnV = ((uPRe*uNRe-uPIm*uNIm)*QxcnCor + (uPRe*uNIm+uPIm*uNRe)*QycnCor) / (uPM*uNM) ;
1277  TwoQpQpV = ((uPRe*uPRe-uPIm*uPIm-uP2Re)*QxcnCor + (2.*uPRe*uPIm-uP2Im)*QycnCor) / (uPM*(uPM-1.)) ;
1278  TwoQnQnV = ((uNRe*uNRe-uNIm*uNIm-uN2Re)*QxcnCor + (2.*uNRe*uNIm-uN2Im)*QycnCor) / (uNM*(uNM-1.)) ;
1279 
1280  fEtaCent = fEtaBinFinderForQA->GetBinCenter(ie+1);
1281 
1282  fHist_Corr3p_QAEta_EP_V0C_PN[QAindex]->Fill(fEtaCent,TwoQpQnV,uPM*uNM);
1283  fHist_Corr3p_QAEta_EP_V0C_PP[QAindex]->Fill(fEtaCent,TwoQpQpV,uPM*(uPM-1.));
1284  fHist_Corr3p_QAEta_EP_V0C_NN[QAindex]->Fill(fEtaCent,TwoQnQnV,uNM*(uNM-1.));
1285  }
1286  }
1287  //---------------------------------------
1288 
1289 
1290 
1291 
1292 
1293  //V0A-V0C SP resolution:
1294  fHist_Reso2n_SP_Norm_Det[QAindex][0]->Fill(EvtCent, (QxcnCor*QxanCor+QycnCor*QyanCor));
1295  //V0A-TPC SP resolution:
1296  fHist_Reso2n_SP_Norm_Det[QAindex][1]->Fill(EvtCent, (QTPCRe*QxanCor+QTPCIm*QyanCor));
1297  //V0C-TPC SP resolution:
1298  fHist_Reso2n_SP_Norm_Det[QAindex][2]->Fill(EvtCent, (QTPCRe*QxcnCor+QTPCIm*QycnCor));
1299 
1300  //V0A-V0C:
1301  fHist_Reso2n_ZDN_SP_Det[0]->Fill(EvtCent, 0., (QxcnCor*QxanCor+QycnCor*QyanCor));
1302  fHist_Reso2n_ZDN_SP_Det[0]->Fill(EvtCent, 1., (QxcnCor*QxanCor+QycnCor*QyanCor)*energyZPA);
1303  fHist_Reso2n_ZDN_SP_Det[0]->Fill(EvtCent, 2., (QxcnCor*QxanCor+QycnCor*QyanCor)*energyZPC);
1304  fHist_Reso2n_ZDN_SP_Det[0]->Fill(EvtCent, 3., (QxcnCor*QxanCor+QycnCor*QyanCor)*(energyZPA+energyZPC));
1305  fHist_Reso2n_ZDN_SP_Det[0]->Fill(EvtCent, 4., (QxcnCor*QxanCor+QycnCor*QyanCor)*energyZNA);
1306  fHist_Reso2n_ZDN_SP_Det[0]->Fill(EvtCent, 5., (QxcnCor*QxanCor+QycnCor*QyanCor)*energyZNC);
1307  fHist_Reso2n_ZDN_SP_Det[0]->Fill(EvtCent, 6., (QxcnCor*QxanCor+QycnCor*QyanCor)*(energyZNA+energyZNC));
1308 
1309  //V0A-TPC
1310  fHist_Reso2n_ZDN_SP_Det[1]->Fill(EvtCent, 0., (QTPCRe*QxanCor+QTPCIm*QyanCor));
1311  fHist_Reso2n_ZDN_SP_Det[1]->Fill(EvtCent, 1., (QTPCRe*QxanCor+QTPCIm*QyanCor)*energyZPA);
1312  fHist_Reso2n_ZDN_SP_Det[1]->Fill(EvtCent, 2., (QTPCRe*QxanCor+QTPCIm*QyanCor)*energyZPC);
1313  fHist_Reso2n_ZDN_SP_Det[1]->Fill(EvtCent, 3., (QTPCRe*QxanCor+QTPCIm*QyanCor)*(energyZPA+energyZPC));
1314  fHist_Reso2n_ZDN_SP_Det[1]->Fill(EvtCent, 4., (QTPCRe*QxanCor+QTPCIm*QyanCor)*energyZNA);
1315  fHist_Reso2n_ZDN_SP_Det[1]->Fill(EvtCent, 5., (QTPCRe*QxanCor+QTPCIm*QyanCor)*energyZNC);
1316  fHist_Reso2n_ZDN_SP_Det[1]->Fill(EvtCent, 6., (QTPCRe*QxanCor+QTPCIm*QyanCor)*(energyZNA+energyZNC));
1317 
1318  //V0C-TPC
1319  fHist_Reso2n_ZDN_SP_Det[2]->Fill(EvtCent, 0., (QTPCRe*QxcnCor+QTPCIm*QycnCor));
1320  fHist_Reso2n_ZDN_SP_Det[2]->Fill(EvtCent, 1., (QTPCRe*QxcnCor+QTPCIm*QycnCor)*energyZPA);
1321  fHist_Reso2n_ZDN_SP_Det[2]->Fill(EvtCent, 2., (QTPCRe*QxcnCor+QTPCIm*QycnCor)*energyZPC);
1322  fHist_Reso2n_ZDN_SP_Det[2]->Fill(EvtCent, 3., (QTPCRe*QxcnCor+QTPCIm*QycnCor)*(energyZPA+energyZPC));
1323  fHist_Reso2n_ZDN_SP_Det[2]->Fill(EvtCent, 1., (QTPCRe*QxcnCor+QTPCIm*QycnCor)*energyZNA);
1324  fHist_Reso2n_ZDN_SP_Det[2]->Fill(EvtCent, 2., (QTPCRe*QxcnCor+QTPCIm*QycnCor)*energyZNC);
1325  fHist_Reso2n_ZDN_SP_Det[2]->Fill(EvtCent, 3., (QTPCRe*QxcnCor+QTPCIm*QycnCor)*(energyZNA+energyZNC));
1326 
1327 
1328  }
1329 
1330 
1331  PostData(1,fListHistos);
1332  PostData(2,fListCalibs);
1333 
1334  fHist_Event_count->Fill(9.5);
1335 
1336  //if(fievent%20==0) {
1337  //std::cout<<"irun = "<<runindex<<" n "<<n<<" cent= "<<EvtCent<<"\tsumMa= "<<sumMa<<"\tQxA = "<<QxanCor<<std::endl;
1338  //std::cout<<" cent= "<<EvtCent<<"\teZNC= "<<energyZNC<<"\teZPC = "<<energyZPC<<"\teZNA= "<<energyZNA<<"\teZPA = "<<energyZPA<<std::endl;
1339  //}
1340 
1341  fievent++;
1342 
1343 }
1344 //======================= UserExec done =========================
1345 
1346 
1347 
1349 {
1350  AliDebug(2,"\n ... AliAnalysisTaskCMEV0::Terminate() is being called ... \n");
1351 }
1352 
1353 
1354 
1355 
1356 
1357 
1358 
1359 
1360 
1361 
1362 
1363 
1364 
1365 void AliAnalysisTaskCMEV0::GetV0QvectAndMult(const AliAODVZERO *aodV0, Double_t& Qxan,Double_t& Qyan,Double_t& sumMa,Double_t& Qxcn,Double_t& Qycn,Double_t& sumMc)
1366 {
1367  for(Int_t iV0 = 0; iV0 < 64; iV0++) {
1368  /*if(fRemChV0A){
1369  if(iV0 == 46)
1370  continue;
1371  }*/
1372  Double_t phiV0 = TMath::PiOver4()*(0.5 + iV0 % 8);
1373  Float_t multv0 = aodV0->GetMultiplicity(iV0);
1374 
1375  if(iV0 < 32) {
1376  Double_t multCorC = -10;
1377 
1378  if(iV0 < 8)
1379  multCorC = multv0/fMultV0->GetBinContent(iV0+1)*fMultV0->GetBinContent(1);
1380  else if(iV0 >= 8 && iV0 < 16)
1381  multCorC = multv0/fMultV0->GetBinContent(iV0+1)*fMultV0->GetBinContent(9);
1382  else if(iV0 >= 16 && iV0 < 24)
1383  multCorC = multv0/fMultV0->GetBinContent(iV0+1)*fMultV0->GetBinContent(17);
1384  else if(iV0 >= 24 && iV0 < 32)
1385  multCorC = multv0/fMultV0->GetBinContent(iV0+1)*fMultV0->GetBinContent(25);
1386 
1387  if(multCorC < 0){
1388  cout<<"Problem with multiplicity in V0C"<<endl;
1389  continue;
1390  }
1391  Qxcn += TMath::Cos(fHarmonic*phiV0) * multCorC;
1392  Qycn += TMath::Sin(fHarmonic*phiV0) * multCorC;
1393 
1394  sumMc = sumMc + multCorC;
1395  }
1396  else{
1397  Double_t multCorA = -10;
1398 
1399  if(iV0 >= 32 && iV0 < 40)
1400  multCorA = multv0/fMultV0->GetBinContent(iV0+1)*fMultV0->GetBinContent(33);
1401  else if(iV0 >= 40 && iV0 < 48)
1402  multCorA = multv0/fMultV0->GetBinContent(iV0+1)*fMultV0->GetBinContent(41);
1403  else if(iV0 >= 48 && iV0 < 56)
1404  multCorA = multv0/fMultV0->GetBinContent(iV0+1)*fMultV0->GetBinContent(49);
1405  else if(iV0 >= 56 && iV0 < 64)
1406  multCorA = multv0/fMultV0->GetBinContent(iV0+1)*fMultV0->GetBinContent(57);
1407 
1408  if(multCorA < 0){
1409  cout<<"Problem with multiplicity in V0A"<<endl;
1410  continue;
1411  }
1412  Qxan += TMath::Cos(fHarmonic*phiV0) * multCorA;
1413  Qyan += TMath::Sin(fHarmonic*phiV0) * multCorA;
1414 
1415  sumMa = sumMa + multCorA;
1416  }
1417  }
1418 }//-------- Get V0 QVect and Multiplicity -----
1419 
1421 {
1422  if(fListZDNCorr){
1423  fHCorrectZDNP = (TH2D *) fListZDNCorr->FindObject(Form("fHist_ZDC_All_Wgt_VsCent_Run%d",run));
1424  }
1425  else{
1426  fHCorrectZDNP = NULL;
1427  printf("\n\n ********** ZDC Wgt Histograms NotFound ***************\n\n");
1428  exit(1);
1429  }
1430 }
1431 
1433 {
1434  /*if(fListNUACorr){
1435  fHCorrectNUApos = (TH3F *) fListNUACorr->FindObject(Form("fHist_WgtPos_EtaPhiVz_Run%d",run));
1436  fHCorrectNUAneg = (TH3F *) fListNUACorr->FindObject(Form("fHist_WgtNeg_EtaPhiVz_Run%d",run));
1437  }
1438  else{
1439  printf("\n\n ********** NUA Correction Histograms NotFound ***************\n\n");
1440  exit(1);
1441  }
1442  */
1443 
1444  Int_t centBin = -1;
1445 
1446  if(cent<5.0){ centBin = 0;}
1447  else if(cent>=5.0 && cent<10.0){centBin = 1;}
1448  else if(cent>=10.0 && cent<40.0){centBin = 2;}
1449  else if(cent>=40.0) {centBin = 3;}
1450 
1451 
1452  if(fListNUACorr){
1453  fHCorrectNUApos = (TH3D *) fListNUACorr->FindObject(Form("fHist_NUA_VzPhiEta_Pos_Cent%d_Run%d",centBin,run));
1454  fHCorrectNUAneg = (TH3D *) fListNUACorr->FindObject(Form("fHist_NUA_VzPhiEta_Neg_Cent%d_Run%d",centBin,run));
1455  }
1456 
1457 
1458  /*
1459  if(!gGrid){
1460  TGrid::Connect("alien://");
1461  }
1462  */
1463  //from Rihan's file:
1464  /*
1465  TFile *fNUApn = NULL;
1466 
1467  fNUApn = TFile::Open("alien:///alice/cern.ch/user/m/mhaque/calib_files/Run2015o_NUA_PosNeg_RunbyRun_Oct5.root");
1468  TList *mListPN = dynamic_cast<TList*> (fNUApn->FindObjectAny("fListTrkRecnter"));
1469 
1470  if(mListPN){
1471  fHCorrectNUApos = (TH3F *) mListPN->FindObject(Form("fHist_NUA_VzPhiEta_Pos_Cent%d_Run%d",centBin,run));
1472  fHCorrectNUAneg = (TH3F *) mListPN->FindObject(Form("fHist_NUA_VzPhiEta_Neg_Cent%d_Run%d",centBin,run));
1473  }
1474  else{
1475  printf("\n\n ********** NUA Correction File/mList Not Found EXIT(1) ***************\n\n");
1476  fHCorrectNUApos = NULL;
1477  fHCorrectNUAneg = NULL;
1478  exit(1);
1479  }
1480  */
1481 
1482  /*
1483  //from Jacopo's NUA file:
1484  if(!fileNUApos){
1485  fileNUApos = TFile::Open("alien:///alice/cern.ch/user/m/mhaque/calib_files/15oHI_FB768_PosCh_CenPhiEtaWeights_VtxRbR.root");
1486  mListNUAPos = dynamic_cast<TList*> (fileNUApos->FindObjectAny("CenPhiEta Weights"));
1487  }
1488  if(!fileNUAneg){
1489  fileNUAneg = TFile::Open("alien:///alice/cern.ch/user/m/mhaque/calib_files/15oHI_FB768_NegCh_CenPhiEtaWeights_VtxRbR.root");
1490  mListNUANeg = dynamic_cast<TList*> (fileNUAneg->FindObjectAny("CenPhiEta Weights"));
1491  }
1492 
1493  if(mListNUAPos){
1494  fHCorrectNUApos = (TH3D *) mListNUAPos->FindObject(Form("CRCQVecPhiHistVtx[%d][%d]",centBin,run));
1495  }
1496  if(mListNUANeg){
1497  fHCorrectNUAneg = (TH3D *) mListNUANeg->FindObject(Form("CRCQVecPhiHistVtx[%d][%d]",centBin,run));
1498  } */
1499 
1501  printf("\n\n ******** could not open NUA Histograms for run %d, Use Wgt = 1.0 *********\n\n",run);
1502  fHCorrectNUApos = new TH3D("fHCorrectNUApos","",1,-10,10,1,0,6.284,1,-0.9,0.9);
1503  fHCorrectNUAneg = new TH3D("fHCorrectNUAneg","",1,-10,10,1,0,6.284,1,-0.9,0.9);
1504  fHCorrectNUApos->SetBinContent(1,1,1,1.0);
1505  fHCorrectNUAneg->SetBinContent(1,1,1,1.0);
1506  //exit(1);
1507  }
1508 }
1509 
1510 
1511 
1513 {
1514  if(!gGrid){
1515  TGrid::Connect("alien://");
1516  }
1517 
1518  TFile* foadb = 0;
1519  //if(!fRemChV0A)
1520  foadb = TFile::Open("alien:///alice/cern.ch/user/a/adobrin/calibV0HIR.root");
1521  //else
1522  //foadb = TFile::Open("alien:///alice/cern.ch/user/a/adobrin/calibV0HIRNoCh46V0A.root");
1523 
1524  if(!foadb){
1525  printf("OADB V0 calibration file cannot be opened\n");
1526  return;
1527  }
1528 
1529  AliOADBContainer* cont = (AliOADBContainer*) foadb->Get("hMultV0BefCorPfpx");
1530  if(!cont){
1531  printf("OADB object hMultV0BefCorr is not available in the file\n");
1532  return;
1533  }
1534  if(!(cont->GetObject(run))){
1535  printf("OADB object hMultV0BefCorPfpx is not available for run %i\n", run);
1536  return;
1537  }
1538  fMultV0 = ((TH1D*) cont->GetObject(run));
1539 
1540  AliOADBContainer* contQxnam = 0;
1541  if (fHarmonic == 2.)
1542  contQxnam = (AliOADBContainer*) foadb->Get("fqxa2m");
1543  else
1544  contQxnam = (AliOADBContainer*) foadb->Get("fqxa3m");
1545 
1546  if(!contQxnam){
1547  printf("OADB object fqxanm is not available in the file\n");
1548  return;
1549  }
1550  if(!(contQxnam->GetObject(run))){
1551  printf("OADB object fqxanm is not available for run %i\n", run);
1552  return;
1553  }
1554  fQxnmV0A = ((TH1D*) contQxnam->GetObject(run));
1555 
1556  AliOADBContainer* contQynam = 0;
1557  if (fHarmonic == 2.)
1558  contQynam = (AliOADBContainer*) foadb->Get("fqya2m");
1559  else if (fHarmonic == 3.)
1560  contQynam = (AliOADBContainer*) foadb->Get("fqya3m");
1561  else if (fHarmonic == 4.)
1562  contQynam = (AliOADBContainer*) foadb->Get("fqya4m");
1563 
1564  if(!contQynam){
1565  printf("OADB object fqyanm is not available in the file\n");
1566  return;
1567  }
1568  if(!(contQynam->GetObject(run))){
1569  printf("OADB object fqyanm is not available for run %i\n", run);
1570  return;
1571  }
1572  fQynmV0A = ((TH1D*) contQynam->GetObject(run));
1573 
1574  AliOADBContainer* contQxnas = 0;
1575  if (fHarmonic == 2.)
1576  contQxnas = (AliOADBContainer*) foadb->Get("fqxa2s");
1577  else
1578  contQxnas = (AliOADBContainer*) foadb->Get("fqxa3s");
1579 
1580  if(!contQxnas){
1581  printf("OADB object fqxans is not available in the file\n");
1582  return;
1583  }
1584  if(!(contQxnas->GetObject(run))){
1585  printf("OADB object fqxans is not available for run %i\n", run);
1586  return;
1587  }
1588  fQxnsV0A = ((TH1D*) contQxnas->GetObject(run));
1589 
1590  AliOADBContainer* contQynas = 0;
1591  if (fHarmonic == 2.)
1592  contQynas = (AliOADBContainer*) foadb->Get("fqya2s");
1593  else if (fHarmonic == 3.)
1594  contQynas = (AliOADBContainer*) foadb->Get("fqya3s");
1595  else if (fHarmonic == 4.)
1596  contQynas = (AliOADBContainer*) foadb->Get("fqya4s");
1597 
1598  if(!contQynas){
1599  printf("OADB object fqyans is not available in the file\n");
1600  return;
1601  }
1602  if(!(contQynas->GetObject(run))){
1603  printf("OADB object fqyans is not available for run %i\n", run);
1604  return;
1605  }
1606  fQynsV0A = ((TH1D*) contQynas->GetObject(run));
1607 
1608 
1609 
1610  AliOADBContainer* contQxncm = 0;
1611  if (fHarmonic == 2.)
1612  contQxncm = (AliOADBContainer*) foadb->Get("fqxc2m");
1613  else
1614  contQxncm = (AliOADBContainer*) foadb->Get("fqxc3m");
1615 
1616  if(!contQxncm){
1617  printf("OADB object fqxcnm is not available in the file\n");
1618  return;
1619  }
1620  if(!(contQxncm->GetObject(run))){
1621  printf("OADB object fqxcnm is not available for run %i\n", run);
1622  return;
1623  }
1624  fQxnmV0C = ((TH1D*) contQxncm->GetObject(run));
1625 
1626 
1627 
1628  AliOADBContainer* contQyncm = 0;
1629  if (fHarmonic == 2.)
1630  contQyncm = (AliOADBContainer*) foadb->Get("fqyc2m");
1631  else if (fHarmonic == 3.)
1632  contQyncm = (AliOADBContainer*) foadb->Get("fqyc3m");
1633  else if (fHarmonic == 4.)
1634  contQyncm = (AliOADBContainer*) foadb->Get("fqyc4m");
1635 
1636  if(!contQyncm){
1637  printf("OADB object fqyc2m is not available in the file\n");
1638  return;
1639  }
1640  if(!(contQyncm->GetObject(run))){
1641  printf("OADB object fqyc2m is not available for run %i\n", run);
1642  return;
1643  }
1644  fQynmV0C = ((TH1D*) contQyncm->GetObject(run));
1645 
1646 
1647  AliOADBContainer* contQxncs = 0;
1648  if (fHarmonic == 2.)
1649  contQxncs = (AliOADBContainer*) foadb->Get("fqxc2s");
1650  else
1651  contQxncs = (AliOADBContainer*) foadb->Get("fqxc3s");
1652 
1653  if(!contQxncs){
1654  printf("OADB object fqxc2s is not available in the file\n");
1655  return;
1656  }
1657  if(!(contQxncs->GetObject(run))){
1658  printf("OADB object fqxc2s is not available for run %i\n", run);
1659  return;
1660  }
1661  fQxnsV0C = ((TH1D*) contQxncs->GetObject(run));
1662 
1663 
1664  AliOADBContainer* contQyncs = 0;
1665  if (fHarmonic == 2.)
1666  contQyncs = (AliOADBContainer*) foadb->Get("fqyc2s");
1667  else if (fHarmonic == 3.)
1668  contQyncs = (AliOADBContainer*) foadb->Get("fqyc3s");
1669  else if (fHarmonic == 4.)
1670  contQyncs = (AliOADBContainer*) foadb->Get("fqyc4s");
1671 
1672  if(!contQyncs){
1673  printf("OADB object fqycnm is not available in the file\n");
1674  return;
1675  }
1676  if(!(contQyncs->GetObject(run))){
1677  printf("OADB object fqycns is not available for run %i\n", run);
1678  return;
1679  }
1680  fQynsV0C = ((TH1D*) contQyncs->GetObject(run));
1681 }//------- OADB container ------
1682 
1683 
1684 
1685 
1686 double AliAnalysisTaskCMEV0::GetWDist(const AliVVertex* v0, const AliVVertex* v1)
1687 {
1688  // calculate sqrt of weighted distance to other vertex
1689  if (!v0 || !v1) {
1690  AliDebug(2,"\n\n ::GetWDist => One of vertices is not valid\n\n");
1691  return 0;
1692  }
1693  static TMatrixDSym vVb(3);
1694  double dist = -1;
1695  double dx = v0->GetX()-v1->GetX();
1696  double dy = v0->GetY()-v1->GetY();
1697  double dz = v0->GetZ()-v1->GetZ();
1698  double cov0[6],cov1[6];
1699  v0->GetCovarianceMatrix(cov0);
1700  v1->GetCovarianceMatrix(cov1);
1701  vVb(0,0) = cov0[0]+cov1[0];
1702  vVb(1,1) = cov0[2]+cov1[2];
1703  vVb(2,2) = cov0[5]+cov1[5];
1704  vVb(1,0) = vVb(0,1) = cov0[1]+cov1[1];
1705  vVb(0,2) = vVb(1,2) = vVb(2,0) = vVb(2,1) = 0.;
1706  vVb.InvertFast();
1707  if (!vVb.IsValid()) {
1708  AliDebug(2,"Singular Matrix\n");
1709  return dist;
1710  }
1711  dist = vVb(0,0)*dx*dx + vVb(1,1)*dy*dy + vVb(2,2)*dz*dz
1712  + 2*vVb(0,1)*dx*dy + 2*vVb(0,2)*dx*dz + 2*vVb(1,2)*dy*dz;
1713  return dist>0 ? TMath::Sqrt(dist) : -1;
1714 }
1715 
1717  { // check for multi-vertexer pile-up
1718  const int kMinPlpContrib = 5;
1719  const double kMaxPlpChi2 = 5.0;
1720  const double kMinWDist = 15;
1721 
1722  const AliVVertex* vtPrm = 0;
1723  const AliVVertex* vtPlp = 0;
1724 
1725  int nPlp = 0;
1726 
1727  if(!(nPlp=faod->GetNumberOfPileupVerticesTracks()))
1728  return kFALSE;
1729 
1730  vtPrm = faod->GetPrimaryVertex();
1731  if(vtPrm == faod->GetPrimaryVertexSPD())
1732  return kTRUE; // there are pile-up vertices but no primary
1733 
1734  //int bcPrim = vtPrm->GetBC();
1735 
1736  for(int ipl=0;ipl<nPlp;ipl++) {
1737  vtPlp = (const AliVVertex*)faod->GetPileupVertexTracks(ipl);
1738  if (vtPlp->GetNContributors() < kMinPlpContrib) continue;
1739  if (vtPlp->GetChi2perNDF() > kMaxPlpChi2) continue;
1740  //int bcPlp = vtPlp->GetBC();
1741  //if (bcPlp!=AliVTrack::kTOFBCNA && TMath::Abs(bcPlp-bcPrim)>2)
1742  // return kTRUE; // pile-up from other BC
1743 
1744  double wDst = GetWDist(vtPrm,vtPlp);
1745  if (wDst<kMinWDist) continue;
1746 
1747  return kTRUE; // pile-up: well separated vertices
1748  }
1749  return kFALSE;
1750 }
1751 
1752 
1753 
1754 
1755 
1756 
1758 
1759  Bool_t BisPileup=kFALSE;
1760 
1761  Double_t centrV0M=300;
1762  Double_t centrCL1=300;
1763  Double_t centrCL0=300;
1764  Double_t centrTRK=300;
1765 
1766  if(sDataSet=="2010"||sDataSet=="2011"){
1767  centrV0M = ((AliVAODHeader*)faod->GetHeader())->GetCentralityP()->GetCentralityPercentile("V0M");
1768  centrCL1 = ((AliVAODHeader*)faod->GetHeader())->GetCentralityP()->GetCentralityPercentile("CL1");
1769  centrCL0 = ((AliVAODHeader*)faod->GetHeader())->GetCentralityP()->GetCentralityPercentile("CL0");
1770  centrTRK = ((AliVAODHeader*)faod->GetHeader())->GetCentralityP()->GetCentralityPercentile("TRK");
1771  }
1772  else{
1773  fMultSelection = (AliMultSelection*) InputEvent()->FindListObject("MultSelection");
1774  if(!fMultSelection) {
1775  printf("\n\n **WARNING** ::UserExec() AliMultSelection object not found.\n\n");
1776  exit(1);
1777  }
1778  centrV0M = fMultSelection->GetMultiplicityPercentile("V0M");
1779  centrCL1 = fMultSelection->GetMultiplicityPercentile("CL1");
1780  centrCL0 = fMultSelection->GetMultiplicityPercentile("CL0");
1781  centrTRK = fMultSelection->GetMultiplicityPercentile("TRK");
1782  }// 2015
1783 
1784 
1785  if(fRejectPileUp && InputEvent()) {
1786  //if(!fCutsEvent->IsSelected(InputEvent(),MCEvent())) return;
1787  if(sDataSet!="2015") {
1788  if(PileUpMultiVertex(faod)) {
1789  fPileUpCount->Fill(0.5);
1790  BisPileup=kTRUE;
1791  }
1792  Int_t isPileup = faod->IsPileupFromSPD(3);
1793  if(isPileup != 0) {
1794  fPileUpCount->Fill(1.5);
1795  //BisPileup=kTRUE; //
1796  }
1797  if(((AliAODHeader*)faod->GetHeader())->GetRefMultiplicityComb08() < 0) {
1798  fPileUpCount->Fill(2.5);
1799  BisPileup=kTRUE;
1800  }
1801  if(faod->IsIncompleteDAQ()) {
1802  fPileUpCount->Fill(3.5);
1803  BisPileup=kTRUE;
1804  }
1805 
1806  //check vertex consistency
1807  const AliAODVertex* vtTrc = faod->GetPrimaryVertex();
1808  const AliAODVertex* vtSPD = faod->GetPrimaryVertexSPD();
1809 
1810  if(vtTrc->GetNContributors() < 2 || vtSPD->GetNContributors()<1) {
1811  fPileUpCount->Fill(5.5);
1812  BisPileup=kTRUE;
1813  }
1814 
1815  double covTrc[6], covSPD[6];
1816  vtTrc->GetCovarianceMatrix(covTrc);
1817  vtSPD->GetCovarianceMatrix(covSPD);
1818 
1819  double dz = vtTrc->GetZ() - vtSPD->GetZ();
1820 
1821  double errTot = TMath::Sqrt(covTrc[5]+covSPD[5]);
1822  double errTrc = TMath::Sqrt(covTrc[5]);
1823  double nsigTot = dz/errTot;
1824  double nsigTrc = dz/errTrc;
1825 
1826  if(TMath::Abs(dz)>0.2 || TMath::Abs(nsigTot)>10 || TMath::Abs(nsigTrc)>20) {
1827  fPileUpCount->Fill(6.5);
1828  BisPileup=kTRUE;
1829  }
1830  if(fAnalysisUtil->IsPileUpEvent(InputEvent())) {
1831  fPileUpCount->Fill(7.5);
1832  BisPileup=kTRUE;
1833  }
1834  }
1835 
1836  else{ //------------ pileup for 2015 data -----------------
1837  if(!fMultSelection->GetThisEventIsNotPileup())
1838  fPileUpMultSelCount->Fill(0.5);
1839  if(!fMultSelection->GetThisEventIsNotPileupMV())
1840  fPileUpMultSelCount->Fill(1.5);
1841  if(!fMultSelection->GetThisEventIsNotPileupInMultBins())
1842  fPileUpMultSelCount->Fill(2.5);
1843  if(!fMultSelection->GetThisEventHasNoInconsistentVertices())
1844  fPileUpMultSelCount->Fill(3.5);
1845  if(!fMultSelection->GetThisEventPassesTrackletVsCluster())
1846  fPileUpMultSelCount->Fill(4.5);
1847  if(!fMultSelection->GetThisEventIsNotAsymmetricInVZERO())
1848  fPileUpMultSelCount->Fill(5.5);
1849  if(!fMultSelection->GetThisEventIsNotIncompleteDAQ())
1850  fPileUpMultSelCount->Fill(6.5);
1851  if(!fMultSelection->GetThisEventHasGoodVertex2016())
1852  fPileUpMultSelCount->Fill(7.5);
1853 
1854  BisPileup=kFALSE;
1855 
1856  //-- pile-up a la Dobrin for LHC15o -----
1857  if(PileUpMultiVertex(faod)) {
1858  fPileUpCount->Fill(0.5);
1859  BisPileup=kTRUE;
1860  }
1861  Int_t isPileup = faod->IsPileupFromSPD(3);
1862  if(isPileup != 0) {
1863  fPileUpCount->Fill(1.5);
1864  BisPileup=kTRUE;
1865  }
1866  if(((AliAODHeader*)faod->GetHeader())->GetRefMultiplicityComb08() < 0) {
1867  fPileUpCount->Fill(2.5);
1868  BisPileup=kTRUE;
1869  }
1870  if(faod->IsIncompleteDAQ()) {
1871  fPileUpCount->Fill(3.5);
1872  BisPileup=kTRUE;
1873  }
1874  if(fabs(centrV0M-centrCL1)>7.5) {
1875  fPileUpCount->Fill(4.5);
1876  BisPileup=kTRUE;
1877  }
1878 
1879  // check vertex consistency
1880  const AliAODVertex* vtTrc = faod->GetPrimaryVertex();
1881  const AliAODVertex* vtSPD = faod->GetPrimaryVertexSPD();
1882 
1883  if(vtTrc->GetNContributors() < 2 || vtSPD->GetNContributors()<1) {
1884  fPileUpCount->Fill(5.5);
1885  BisPileup=kTRUE;
1886  }
1887 
1888  double covTrc[6], covSPD[6];
1889  vtTrc->GetCovarianceMatrix(covTrc);
1890  vtSPD->GetCovarianceMatrix(covSPD);
1891 
1892  double dz = vtTrc->GetZ() - vtSPD->GetZ();
1893 
1894  double errTot = TMath::Sqrt(covTrc[5]+covSPD[5]);
1895  double errTrc = TMath::Sqrt(covTrc[5]);
1896  double nsigTot = dz/errTot;
1897  double nsigTrc = dz/errTrc;
1898 
1899  if(TMath::Abs(dz)>0.2 || TMath::Abs(nsigTot)>10 || TMath::Abs(nsigTrc)>20) {
1900  fPileUpCount->Fill(6.5);
1901  BisPileup=kTRUE;
1902  }
1903 
1904  //cuts on tracks
1905  const Int_t nTracks = faod->GetNumberOfTracks();
1906  Int_t multEsd = ((AliAODHeader*)faod->GetHeader())->GetNumberOfESDTracks();
1907 
1908  //Int_t multTrk = 0;
1909  //Int_t multTrkBefC = 0;
1910  //Int_t multTrkTOFBefC = 0;
1911  Int_t multTPC = 0;
1912 
1913  for(Int_t it = 0; it < nTracks; it++) {
1914  AliAODTrack* aodTrk = (AliAODTrack*)faod->GetTrack(it);
1915  if(!aodTrk) {
1916  delete aodTrk;
1917  continue;
1918  }
1919  //if(aodTrk->TestFilterBit(32)){
1920  // multTrkBefC++;
1921  // if(TMath::Abs(aodTrk->GetTOFsignalDz()) <= 10. && aodTrk->GetTOFsignal() >= 12000. && aodTrk->GetTOFsignal() <= 25000.)
1922  // multTrkTOFBefC++;
1923  // if((TMath::Abs(aodTrk->Eta()) < 0.8) && (aodTrk->GetTPCNcls() >= 70) && (aodTrk->Pt() >= 0.2) && (aodTrk->Pt() < 20.))
1924  // multTrk++;
1925  //}
1926  if(aodTrk->TestFilterBit(128))
1927  multTPC++;
1928  } // end of for AOD track loop
1929 
1930  Double_t multTPCn = multTPC;
1931  Double_t multEsdn = multEsd;
1932  Double_t multESDTPCDif = multEsdn - multTPCn*3.38;
1933 
1934  /*if(multESDTPCDif > (fRejectPileUpTight?700.:15000.)) {
1935  fPileUpCount->Fill(7.5);
1936  BisPileup=kTRUE;
1937  }*/
1938  if(multESDTPCDif > 15000.){
1939  fPileUpCount->Fill(7.5);
1940  BisPileup=kTRUE;
1941  }
1942  else if(fRejectPileUpTight) {
1943  if(multESDTPCDif > 700.) {
1944  fPileUpCount->Fill(8.5);
1945  BisPileup=kTRUE;
1946  }
1947  if(BisPileup==kFALSE) {
1948  if(!fMultSelection->GetThisEventIsNotPileup()) BisPileup=kTRUE;
1949  if(!fMultSelection->GetThisEventIsNotPileupMV()) BisPileup=kTRUE;
1950  if(!fMultSelection->GetThisEventIsNotPileupInMultBins()) BisPileup=kTRUE;
1951  if(!fMultSelection->GetThisEventHasNoInconsistentVertices()) BisPileup=kTRUE;
1952  if(!fMultSelection->GetThisEventPassesTrackletVsCluster()) BisPileup=kTRUE;
1953  if(!fMultSelection->GetThisEventIsNotIncompleteDAQ()) BisPileup=kTRUE;
1954  if(!fMultSelection->GetThisEventHasGoodVertex2016()) BisPileup=kTRUE;
1955  if(BisPileup) fPileUpCount->Fill(9.5);
1956  }
1957  }
1958  }
1959  }
1960 
1961  return BisPileup;
1962 }//-------pile up function ------
1963 
1964 
1965 
1966 
1968 
1969  Int_t irun = -1;
1970 
1971  for(int i=0;i<fRunFlag;i++){
1972  if(run==runNums[i])
1973  {
1974  irun = i;
1975  break;
1976  }
1977  }
1978  if(irun<0) {
1979  printf("\n ... **WARNING** \n::UserExec() runnumber not listed.\n EXIT..\n");
1980  }
1981 
1982  return irun;
1983 }//------ GetCurrentRunIndex --------
1984 
1985 
1987 
1988  Int_t runArray_2010[89] = {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, 137243, 137236, 137235, 137232, 137231, 137162, 137161};
1989 
1990  Int_t runArray_2011[68] = {167915, 168115, 168460, 169035, 169238, 169859, 170228, 167920, 168310, 168464, 169091, 169411, 169923, 170230, 167985, 168311, 168467, 169094, 169415, 170027, 170268, 167987, 168322, 168511, 169138, 169417, 170081, 170269, 167988, 168325, 168512, 169144, 169835, 170155, 170270, 168069, 168341, 168514, 169145, 169837, 170159, 170306, 168076, 168342, 168777, 169148, 169838, 170163, 170308, 168105, 168361, 168826, 169156, 169846, 170193, 170309, 168107, 168362, 168988, 169160, 169855, 170203, 168108, 168458, 168992, 169167, 169858, 170204};
1991 
1992  Int_t runArray_2015[90] = {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, 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};
1993 
1994  Int_t runArray_pPb_13cpass2[14] = {195677, 195675, 195673, 195644, 195635, 195633, 195596, 195593, 195592, 195568, 195567, 195566, 195531, 195529};
1995 
1996  if(sPeriod=="2010"){
1997  fRunFlag = 89;
1998  for(int i=0;i<fRunFlag;i++)
1999  runNums[i] = runArray_2010[i];
2000  }
2001  else if(sPeriod=="2011"){
2002  fRunFlag = 68; //<-- 2011 check
2003  for(int i=0;i<fRunFlag;i++)
2004  runNums[i] = runArray_2011[i];
2005  }
2006  else if(sPeriod=="2015" || sPeriod=="2015PbPb"){
2007  fRunFlag = 90;
2008  for(int i=0;i<fRunFlag;i++)
2009  runNums[i] = runArray_2015[i];
2010  }
2011  else if(sPeriod=="2015pPb" || sPeriod=="pPb"){
2012  fRunFlag = 14;
2013  for(int i=0;i<fRunFlag;i++)
2014  runNums[i] = runArray_pPb_13cpass2[i];
2015  }
2016 
2017 
2018  else{
2019  printf("\n\n ***** Run Number not defined for this data set. *******\n\n Please modify code..\n\n");
2020  exit(1);
2021  }
2022 
2023 }//------- InitializeRunArray ---------
2024 
2025 
2026 
2028 
2029  fHist_Event_count = new TH1F("fHist_Event_count"," ",20,0,20);
2030  fHist_Event_count->GetXaxis()->SetBinLabel(1,"Called Exec()");
2031  fHist_Event_count->GetXaxis()->SetBinLabel(2,"AOD Exist");
2032  fHist_Event_count->GetXaxis()->SetBinLabel(3,"PileUp");
2033  fHist_Event_count->GetXaxis()->SetBinLabel(4,"iCentSPD<90");
2034  fHist_Event_count->GetXaxis()->SetBinLabel(5,"V0 Mult>0");
2035  fHist_Event_count->GetXaxis()->SetBinLabel(6,"Bad Runs");
2036  fHist_Event_count->GetXaxis()->SetBinLabel(7,"..TBA..");
2037 
2038  fHist_Event_count->GetXaxis()->SetBinLabel(10,"Final Event");
2040 
2041  fPileUpCount = new TH1F("fPileUpCount", "fPileUpCount", 12, 0., 12.);
2042  fPileUpCount->GetXaxis()->SetBinLabel(1,"plpMV");
2043  fPileUpCount->GetXaxis()->SetBinLabel(2,"fromSPD");
2044  fPileUpCount->GetXaxis()->SetBinLabel(3,"RefMultiplicityComb08");
2045  fPileUpCount->GetXaxis()->SetBinLabel(4,"IncompleteDAQ");
2046  fPileUpCount->GetXaxis()->SetBinLabel(5,"abs(V0M-CL1)>7.5");
2047  fPileUpCount->GetXaxis()->SetBinLabel(6,"missingVtx");
2048  fPileUpCount->GetXaxis()->SetBinLabel(7,"inconsistentVtx");
2049  fPileUpCount->GetXaxis()->SetBinLabel(8,"multESDTPCDif=15000");
2050  fPileUpCount->GetXaxis()->SetBinLabel(9,"multESDTPCDif=700");
2051  fPileUpCount->GetXaxis()->SetBinLabel(10,"extraPileUpMultSel");
2052  fListHistos->Add(fPileUpCount);
2053 
2054  fPileUpMultSelCount = new TH1F("fPileUpMultSelCount", "fPileUpMultSelCount", 10, 0., 10.);
2055  fPileUpMultSelCount->GetXaxis()->SetBinLabel(1,"IsNotPileup");
2056  fPileUpMultSelCount->GetXaxis()->SetBinLabel(2,"IsNotPileupMV");
2057  fPileUpMultSelCount->GetXaxis()->SetBinLabel(3,"IsNotPileupInMultBins");
2058  fPileUpMultSelCount->GetXaxis()->SetBinLabel(4,"InconsistentVertices");
2059  fPileUpMultSelCount->GetXaxis()->SetBinLabel(5,"TrackletVsCluster");
2060  fPileUpMultSelCount->GetXaxis()->SetBinLabel(6,"AsymmetricInVZERO");
2061  fPileUpMultSelCount->GetXaxis()->SetBinLabel(7,"IncompleteDAQ");
2062  fPileUpMultSelCount->GetXaxis()->SetBinLabel(8,"GoodVertex2016");
2064 
2065 
2066 
2067 
2068 
2069  //----- CME-ZDN correlator SP method---------
2070  for(int i=0;i<3;i++){ //ZDN_SP
2071  //Detector: 0 = V0A, 1 = V0C, 3 = Q-cumulant
2072  fHist_Corr3p_ZDN_SP_PN[i] = new TProfile2D(Form("fHist_Corr3p_ZDN_SP_PosNeg_Det%d",i+1),"opposit charge correlator",90,0,90,15,0,15,"");
2073  fHist_Corr3p_ZDN_SP_PN[i]->Sumw2();
2075  fHist_Corr3p_ZDN_SP_PP[i] = new TProfile2D(Form("fHist_Corr3p_ZDN_SP_PosPos_Det%d",i+1),"pos-pos charge correlator",90,0,90,15,0,15,"");
2076  fHist_Corr3p_ZDN_SP_PP[i]->Sumw2();
2078  fHist_Corr3p_ZDN_SP_NN[i] = new TProfile2D(Form("fHist_Corr3p_ZDN_SP_NegNeg_Det%d",i+1),"neg-neg charge correlator",90,0,90,15,0,15,"");
2079  fHist_Corr3p_ZDN_SP_NN[i]->Sumw2();
2081  }
2082  //SP Resolution:
2083  for(int i=0;i<3;i++){
2084  //Det: 0 = v0c-v0a, 1 = v0a-TPC, 2 = v0c-TPC,
2085  fHist_Reso2n_ZDN_SP_Det[i] = new TProfile2D(Form("fHist_Reso2n_ZDN_SP_DetComb%d",i+1),"Event plane Resolution",90,0,90,8,0,8,"");
2086  fHist_Reso2n_ZDN_SP_Det[i]->Sumw2();
2088  }
2089  //--------------------------------------------
2090 
2091  Double_t centRange[11] = {0,5,10,20,30,40,50,60,70,80,90};
2092 
2093  //----- CME SP method histograms ---------
2094  for(int i=0;i<2;i++){
2095  for(int j=0;j<3;j++){
2096  //Detector: 0 = V0A, 1 = V0C, 3 = Q-cumulant
2097  fHist_Corr3p_SP_Norm_PN[i][j] = new TProfile(Form("fHist_Corr3p_SP_Norm_PosNeg_Mag%d_Det%d",i,j+1),"opposit charge correlator",10,centRange,"");
2098  fHist_Corr3p_SP_Norm_PN[i][j]->Sumw2();
2100  fHist_Corr3p_SP_Norm_PP[i][j] = new TProfile(Form("fHist_Corr3p_SP_Norm_PosPos_Mag%d_Det%d",i,j+1),"pos-pos charge correlator",10,centRange,"");
2101  fHist_Corr3p_SP_Norm_PP[i][j]->Sumw2();
2103  fHist_Corr3p_SP_Norm_NN[i][j] = new TProfile(Form("fHist_Corr3p_SP_Norm_NegNeg_Mag%d_Det%d",i,j+1),"neg-neg charge correlator",10,centRange,"");
2104  fHist_Corr3p_SP_Norm_NN[i][j]->Sumw2();
2106  }
2107  //EP Resolution:
2108  for(int j=0;j<3;j++){
2109  //Det: 0 = v0c-v0a, 1 = v0a-TPC, 2 = v0c-TPC,
2110  fHist_Reso2n_SP_Norm_Det[i][j] = new TProfile(Form("fHist_Reso2n_SP_Norm_Mag%d_DetComb%d",i,j+1),"Event plane Resolution",10,centRange,"");
2111  fHist_Reso2n_SP_Norm_Det[i][j]->Sumw2();
2113  }
2114  }
2115 
2116 
2117 
2118  //----- CME EP method histograms ---------
2119  for(int i=0;i<2;i++){
2120  for(int j=0;j<3;j++){
2121  //Detector: 0 = V0A, 1 = V0C, 3 = Q-cumulant
2122  fHist_Corr3p_EP_Norm_PN[i][j] = new TProfile(Form("fHist_Corr3p_EP_Norm_PosNeg_Mag%d_Det%d",i,j+1),"opposit charge correlator",10,centRange,"");
2123  fHist_Corr3p_EP_Norm_PN[i][j]->Sumw2();
2125  fHist_Corr3p_EP_Norm_PP[i][j] = new TProfile(Form("fHist_Corr3p_EP_Norm_PosPos_Mag%d_Det%d",i,j+1),"pos-pos charge correlator",10,centRange,"");
2126  fHist_Corr3p_EP_Norm_PP[i][j]->Sumw2();
2128  fHist_Corr3p_EP_Norm_NN[i][j] = new TProfile(Form("fHist_Corr3p_EP_Norm_NegNeg_Mag%d_Det%d",i,j+1),"neg-neg charge correlator",10,centRange,"");
2129  fHist_Corr3p_EP_Norm_NN[i][j]->Sumw2();
2131  }
2132  //EP Resolution:
2133  for(int j=0;j<3;j++){
2134  //Det: 0 = v0c-v0a, 1 = v0a-TPC, 2 = v0c-TPC,
2135  fHist_Reso2n_EP_Norm_Det[i][j] = new TProfile(Form("fHist_Reso2n_EP_Norm_Mag%d_DetComb%d",i,j+1),"Event plane Resolution",10,centRange,"");
2136  fHist_Reso2n_EP_Norm_Det[i][j]->Sumw2();
2138  }
2139  }
2140 
2141 
2142 
2143 
2144 
2145 
2146  fHV0AEventPlaneVsCent = new TH2F("fHV0AEventPlaneVsCent","Psi2 from V0A",10,centRange,50,0,3.1415);
2148  fHV0CEventPlaneVsCent = new TH2F("fHV0CEventPlaneVsCent","Psi2 from V0C",10,centRange,50,0,3.1415);
2150  fHTPCEventPlaneVsCent = new TH2F("fHTPCEventPlaneVsCent","Psi2 from TPC",10,centRange,50,0,3.1415);
2152 
2153 
2154  TH1::SetDefaultSumw2();
2155 
2156  Char_t name[100], title[100];
2157 
2158 
2159 
2160  //Differential in pT:
2161  //Double_t pTRange[24] = {0,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.};
2162 
2163  Double_t pTRange[21] = {0.0,0.2,0.4,0.6,0.8,1.0,1.2,1.4,1.6,1.8,2.0,2.2,2.4,2.6,2.8,3.0,3.2,3.4,3.6,3.8,4.0};
2164 
2165  for(int i=0;i<2;i++){
2166  for(int j=0;j<6;j++){
2167  sprintf(name,"fHist_Corr3p_pTSum_EP_V0A_PN_Mag%d_Cent%d",i,j);
2168  sprintf(title,"PN 3p vs (pT1+pT2)/2, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
2169  fHist_Corr3p_pTSum_EP_V0A_PN[i][j] = new TProfile(name,title,20,pTRange,"");
2171 
2172  sprintf(name,"fHist_Corr3p_pTSum_EP_V0A_PP_Mag%d_Cent%d",i,j);
2173  sprintf(title,"PP 3p vs (pT1+pT2)/2, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
2174  fHist_Corr3p_pTSum_EP_V0A_PP[i][j] = new TProfile(name,title,20,pTRange,"");
2176 
2177  sprintf(name,"fHist_Corr3p_pTSum_EP_V0A_NN_Mag%d_Cent%d",i,j);
2178  sprintf(title,"NN 3p vs (pT1+pT2)/2, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
2179  fHist_Corr3p_pTSum_EP_V0A_NN[i][j] = new TProfile(name,title,20,pTRange,"");
2181  //-----v0c----
2182  sprintf(name,"fHist_Corr3p_pTSum_EP_V0C_PN_Mag%d_Cent%d",i,j);
2183  sprintf(title,"PN 3p vs (pT1+pT2)/2, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
2184  fHist_Corr3p_pTSum_EP_V0C_PN[i][j] = new TProfile(name,title,20,pTRange,"");
2186 
2187  sprintf(name,"fHist_Corr3p_pTSum_EP_V0C_PP_Mag%d_Cent%d",i,j);
2188  sprintf(title,"PP 3p vs (pT1+pT2)/2, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
2189  fHist_Corr3p_pTSum_EP_V0C_PP[i][j] = new TProfile(name,title,20,pTRange,"");
2191 
2192  sprintf(name,"fHist_Corr3p_pTSum_EP_V0C_NN_Mag%d_Cent%d",i,j);
2193  sprintf(title,"NN 3p vs (pT1+pT2)/2, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
2194  fHist_Corr3p_pTSum_EP_V0C_NN[i][j] = new TProfile(name,title,20,pTRange,"");
2196  }
2197  }
2198 
2199  for(int i=0;i<2;i++){
2200  for(int j=0;j<6;j++){
2201  sprintf(name,"fHist_Corr3p_pTDiff_EP_V0A_PN_Mag%d_Cent%d",i,j);
2202  sprintf(title,"PN 3p vs |pT1-pT2|, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
2203  fHist_Corr3p_pTDiff_EP_V0A_PN[i][j] = new TProfile(name,title,20,pTRange,"");
2205 
2206  sprintf(name,"fHist_Corr3p_pTDiff_EP_V0A_PP_Mag%d_Cent%d",i,j);
2207  sprintf(title,"PP 3p vs |pT1-pT2|, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
2208  fHist_Corr3p_pTDiff_EP_V0A_PP[i][j] = new TProfile(name,title,20,pTRange,"");
2210 
2211  sprintf(name,"fHist_Corr3p_pTDiff_EP_V0A_NN_Mag%d_Cent%d",i,j);
2212  sprintf(title,"NN 3p vs |pT1-pT2|, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
2213  fHist_Corr3p_pTDiff_EP_V0A_NN[i][j] = new TProfile(name,title,20,pTRange,"");
2215  //-----v0c----
2216  sprintf(name,"fHist_Corr3p_pTDiff_EP_V0C_PN_Mag%d_Cent%d",i,j);
2217  sprintf(title,"PN 3p vs |pT1-pT2|, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
2218  fHist_Corr3p_pTDiff_EP_V0C_PN[i][j] = new TProfile(name,title,20,pTRange,"");
2220 
2221  sprintf(name,"fHist_Corr3p_pTDiff_EP_V0C_PP_Mag%d_Cent%d",i,j);
2222  sprintf(title,"PP 3p vs |pT1-pT2|, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
2223  fHist_Corr3p_pTDiff_EP_V0C_PP[i][j] = new TProfile(name,title,20,pTRange,"");
2225 
2226  sprintf(name,"fHist_Corr3p_pTDiff_EP_V0C_NN_Mag%d_Cent%d",i,j);
2227  sprintf(title,"NN 3p vs |pT1-pT2|, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
2228  fHist_Corr3p_pTDiff_EP_V0C_NN[i][j] = new TProfile(name,title,20,pTRange,"");
2230  }
2231  }
2232 
2233  Double_t EtaRange[9] = {0.0,0.2,0.4,0.6,0.8,1.0,1.2,1.4,1.6};
2234 
2235  for(int i=0;i<2;i++){
2236  for(int j=0;j<6;j++){
2237  sprintf(name,"fHist_Corr3p_EtaDiff_EP_V0A_PN_Mag%d_Cent%d",i,j);
2238  sprintf(title,"PN 3p vs |Eta1-Eta2|, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
2239  fHist_Corr3p_EtaDiff_EP_V0A_PN[i][j] = new TProfile(name,title,8,EtaRange,"");
2241 
2242  sprintf(name,"fHist_Corr3p_EtaDiff_EP_V0A_PP_Mag%d_Cent%d",i,j);
2243  sprintf(title,"PP 3p vs |Eta1-Eta2|, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
2244  fHist_Corr3p_EtaDiff_EP_V0A_PP[i][j] = new TProfile(name,title,8,EtaRange,"");
2246 
2247  sprintf(name,"fHist_Corr3p_EtaDiff_EP_V0A_NN_Mag%d_Cent%d",i,j);
2248  sprintf(title,"NN 3p vs |Eta1-Eta2|, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
2249  fHist_Corr3p_EtaDiff_EP_V0A_NN[i][j] = new TProfile(name,title,8,EtaRange,"");
2251  //-----v0c----
2252  sprintf(name,"fHist_Corr3p_EtaDiff_EP_V0C_PN_Mag%d_Cent%d",i,j);
2253  sprintf(title,"PN 3p vs |Eta1-Eta2|, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
2254  fHist_Corr3p_EtaDiff_EP_V0C_PN[i][j] = new TProfile(name,title,8,EtaRange,"");
2256 
2257  sprintf(name,"fHist_Corr3p_EtaDiff_EP_V0C_PP_Mag%d_Cent%d",i,j);
2258  sprintf(title,"PP 3p vs |Eta1-Eta2|, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
2259  fHist_Corr3p_EtaDiff_EP_V0C_PP[i][j] = new TProfile(name,title,8,EtaRange,"");
2261 
2262  sprintf(name,"fHist_Corr3p_EtaDiff_EP_V0C_NN_Mag%d_Cent%d",i,j);
2263  sprintf(title,"NN 3p vs |Eta1-Eta2|, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
2264  fHist_Corr3p_EtaDiff_EP_V0C_NN[i][j] = new TProfile(name,title,8,EtaRange,"");
2266  }
2267  }
2268 
2269 
2270 
2271 
2272 
2273 
2274 
2275 
2276 
2277 
2278  //=========== Calibtation Histograms etc ==================
2280 
2281  fEventStatvsRun = new TH1F("fEventStatvsRun","Event stat per run",fRunFlag,0,fRunFlag);
2283 
2284  //for debug only, remove after stable code
2285  hUnderOverBinNUApos = new TH1F("hUnderOverBinNUApos","",90,0,90);
2287  hUnderOverBinNUAneg = new TH1F("hUnderOverBinNUAneg","",90,0,90);
2289 
2290  Double_t fCentBinQvect[16] = {0.,2.5,5,10,15,20,25,30,35,40,45,50,60,70,80,90};
2291 
2292  fHEnergyZNCvsCent = new TH2F("fHEnergyZNCvsCent","ZNC Energy vs cent",15,fCentBinQvect,4000,0,200000);
2294  fHEnergyZNAvsCent = new TH2F("fHEnergyZNAvsCent","ZNA Energy vs cent",15,fCentBinQvect,4000,0,200000);
2296  fHEnergyZPCvsCent = new TH2F("fHEnergyZPCvsCent","ZPC Energy vs cent",15,fCentBinQvect,2000,0,50000);
2298  fHEnergyZPAvsCent = new TH2F("fHEnergyZPAvsCent","ZPA Energy vs cent",15,fCentBinQvect,2000,0,50000);
2300 
2301  fHEnergyZNCvsCentRun = new TProfile2D("fHEnergyZNCvsCentRun","",90,0,90,90,0,90);
2303  fHEnergyZNAvsCentRun = new TProfile2D("fHEnergyZNAvsCentRun","",90,0,90,90,0,90);
2305  fHEnergyZPCvsCentRun = new TProfile2D("fHEnergyZPCvsCentRun","",90,0,90,90,0,90);
2307  fHEnergyZPAvsCentRun = new TProfile2D("fHEnergyZPAvsCentRun","",90,0,90,90,0,90);
2309 
2310  fHEnergyZPCvsZPA = new TH2F("fHEnergyZPCvsZPA","ZNC Energy vs cent",500,0,50000,500,0,50000);
2312  fHEnergyZNCvsZNA = new TH2F("fHEnergyZNCvsZNA","ZNC Energy vs cent",500,50000,150000,500,50000,150000);
2314 
2315  fHCentBinTrkRecenter = new TH1F("fHCentBinTrkRecenter","centrality Binning",15,fCentBinQvect);
2316 
2317 
2318 
2319 
2320  Int_t magField[2] = {0,1}; //0 = Neg, 1 = Pos
2321 
2322  for(int i=0;i<2;i++){
2323  fHist_Corr3p_QAEta_EP_V0C_PN[i] = new TProfile(Form("fHist_Corr3p_QAEta_SP_V0C_PN_Mag%d",magField[i]),"PN, Cent 10-20%",16,-0.8,0.8,"");
2325  fHist_Corr3p_QAEta_EP_V0C_PP[i] = new TProfile(Form("fHist_Corr3p_QAEta_SP_V0C_PP_Mag%d",magField[i]),"PP, Cent 10-20%",16,-0.8,0.8,"");
2327  fHist_Corr3p_QAEta_EP_V0C_NN[i] = new TProfile(Form("fHist_Corr3p_QAEta_SP_V0C_NN_Mag%d",magField[i]),"NN, Cent 10-20%",16,-0.8,0.8,"");
2329  }
2330  fEtaBinFinderForQA = new TH1D("fEtaBinFinderForQA","",16,-0.8,0.8);
2332 
2333 
2334 
2335 
2336 
2337 
2338  Int_t suffixEta[4] = {1,0,1,0}; //{"Pos","Neg","Pos","Neg"};
2339  Int_t suffixVz[4] = {1,1,0,0}; //{"Pos","Pos","Neg","Neg"};
2340 
2341  if(bFillAvgTPCQn){
2342  for(int i=0;i<4;i++){
2343  fHCos1nPosChEtaVz[i] = new TProfile2D(Form("fHCos1nPosChEta%dVz%d",suffixEta[i],suffixVz[i]),"<ptw*cos1n>",90,0,90,fRunFlag,0,fRunFlag);
2344  fListCalibs->Add(fHCos1nPosChEtaVz[i]);
2345  fHSin1nPosChEtaVz[i] = new TProfile2D(Form("fHSin1nPosChEta%dVz%d",suffixEta[i],suffixVz[i]),"<ptw*sin1n>",90,0,90,fRunFlag,0,fRunFlag);
2346  fListCalibs->Add(fHSin1nPosChEtaVz[i]);
2347  fHCos1nNegChEtaVz[i] = new TProfile2D(Form("fHCos1nNegChEta%dVz%d",suffixEta[i],suffixVz[i]),"<ptw*cos1n>",90,0,90,fRunFlag,0,fRunFlag);
2348  fListCalibs->Add(fHCos1nNegChEtaVz[i]);
2349  fHSin1nNegChEtaVz[i] = new TProfile2D(Form("fHSin1nNegChEta%dVz%d",suffixEta[i],suffixVz[i]),"<ptw*sin1n>",90,0,90,fRunFlag,0,fRunFlag);
2350  fListCalibs->Add(fHSin1nNegChEtaVz[i]);
2351 
2352  fHCos2nPosChEtaVz[i] = new TProfile2D(Form("fHCos2nPosChEta%dVz%d",suffixEta[i],suffixVz[i]),"<ptw*cos2n>",90,0,90,fRunFlag,0,fRunFlag);
2353  fListCalibs->Add(fHCos2nPosChEtaVz[i]);
2354  fHSin2nPosChEtaVz[i] = new TProfile2D(Form("fHSin2nPosChEta%dVz%d",suffixEta[i],suffixVz[i]),"<ptw*sin2n>",90,0,90,fRunFlag,0,fRunFlag);
2355  fListCalibs->Add(fHSin2nPosChEtaVz[i]);
2356  fHCos2nNegChEtaVz[i] = new TProfile2D(Form("fHCos2nNegChEta%dVz%d",suffixEta[i],suffixVz[i]),"<ptw*cos2n>",90,0,90,fRunFlag,0,fRunFlag);
2357  fListCalibs->Add(fHCos2nNegChEtaVz[i]);
2358  fHSin2nNegChEtaVz[i] = new TProfile2D(Form("fHSin2nNegChEta%dVz%d",suffixEta[i],suffixVz[i]),"<ptw*sin2n>",90,0,90,fRunFlag,0,fRunFlag);
2359  fListCalibs->Add(fHSin2nNegChEtaVz[i]);
2360 
2361  fHCos3nPosChEtaVz[i] = new TProfile2D(Form("fHCos3nPosChEta%dVz%d",suffixEta[i],suffixVz[i]),"<ptw*cos3n>",90,0,90,fRunFlag,0,fRunFlag);
2362  fListCalibs->Add(fHCos3nPosChEtaVz[i]);
2363  fHSin3nPosChEtaVz[i] = new TProfile2D(Form("fHSin3nPosChEta%dVz%d",suffixEta[i],suffixVz[i]),"<ptw*sin3n>",90,0,90,fRunFlag,0,fRunFlag);
2364  fListCalibs->Add(fHSin3nPosChEtaVz[i]);
2365  fHCos3nNegChEtaVz[i] = new TProfile2D(Form("fHCos3nNegChEta%dVz%d",suffixEta[i],suffixVz[i]),"<ptw*cos3n>",90,0,90,fRunFlag,0,fRunFlag);
2366  fListCalibs->Add(fHCos3nNegChEtaVz[i]);
2367  fHSin3nNegChEtaVz[i] = new TProfile2D(Form("fHSin3nNegChEta%dVz%d",suffixEta[i],suffixVz[i]),"<ptw*sin3n>",90,0,90,fRunFlag,0,fRunFlag);
2368  fListCalibs->Add(fHSin3nNegChEtaVz[i]);
2369 
2370  fHCos4nPosChEtaVz[i] = new TProfile2D(Form("fHCos4nPosChEta%dVz%d",suffixEta[i],suffixVz[i]),"<ptw*cos4n>",90,0,90,fRunFlag,0,fRunFlag);
2371  fListCalibs->Add(fHCos4nPosChEtaVz[i]);
2372  fHSin4nPosChEtaVz[i] = new TProfile2D(Form("fHSin4nPosChEta%dVz%d",suffixEta[i],suffixVz[i]),"<ptw*sin4n>",90,0,90,fRunFlag,0,fRunFlag);
2373  fListCalibs->Add(fHSin4nPosChEtaVz[i]);
2374  fHCos4nNegChEtaVz[i] = new TProfile2D(Form("fHCos4nNegChEta%dVz%d",suffixEta[i],suffixVz[i]),"<ptw*cos4n>",90,0,90,fRunFlag,0,fRunFlag);
2375  fListCalibs->Add(fHCos4nNegChEtaVz[i]);
2376  fHSin4nNegChEtaVz[i] = new TProfile2D(Form("fHSin4nNegChEta%dVz%d",suffixEta[i],suffixVz[i]),"<ptw*sin4n>",90,0,90,fRunFlag,0,fRunFlag);
2377  fListCalibs->Add(fHSin4nNegChEtaVz[i]);
2378 
2379  //Double weighted <..>
2380  fHCos2nDWPosChEtaVz[i] = new TProfile2D(Form("fHCos2nDWPosChEta%dVz%d",suffixEta[i],suffixVz[i]),"<ptw*ptw*cos2n>",90,0,90,fRunFlag,0,fRunFlag);
2382  fHSin2nDWPosChEtaVz[i] = new TProfile2D(Form("fHSin2nDWPosChEta%dVz%d",suffixEta[i],suffixVz[i]),"<ptw*ptw*cos2n>",90,0,90,fRunFlag,0,fRunFlag);
2384  fHCos2nDWNegChEtaVz[i] = new TProfile2D(Form("fHCos2nDWNegChEta%dVz%d",suffixEta[i],suffixVz[i]),"<ptw*ptw*cos2n>",90,0,90,fRunFlag,0,fRunFlag);
2386  fHSin2nDWNegChEtaVz[i] = new TProfile2D(Form("fHSin2nDWNegChEta%dVz%d",suffixEta[i],suffixVz[i]),"<ptw*ptw*cos2n>",90,0,90,fRunFlag,0,fRunFlag);
2388  }
2389  }
2390 
2391 
2392  fV0MultChVsRun = new TProfile2D("fV0MultChVsRun","1-32 V0C, 33-64 V0A",64,0,64,fRunFlag,0,fRunFlag,"");
2394 
2395 
2396 
2397  fV0AQnxVsCentRun = new TProfile2D("fV0ACos2nVsCentRun","<Cos2> vs cent,Run",90,0,90,fRunFlag,0,fRunFlag,"s");
2399  fV0AQnyVsCentRun = new TProfile2D("fV0ASin2nVsCentRun","<Sin2> vs cent,Run",90,0,90,fRunFlag,0,fRunFlag,"s");
2401 
2402  fV0CQnxVsCentRun = new TProfile2D("fV0CCos2nVsCentRun","<Cos2> vs cent,Run",90,0,90,fRunFlag,0,fRunFlag,"s");
2404  fV0CQnyVsCentRun = new TProfile2D("fV0CSin2nVsCentRun","<Sin2> vs cent,Run",90,0,90,fRunFlag,0,fRunFlag,"s");
2406 
2407  fTPCQnxVsCentRun = new TProfile2D("fTPCCos2nVsCentRun","<Cos2> vs cent,Run",90,0,90,fRunFlag,0,fRunFlag,"s");
2409  fTPCQnyVsCentRun = new TProfile2D("fTPCSin2nVsCentRun","<Sin2> vs cent,Run",90,0,90,fRunFlag,0,fRunFlag,"s");
2411 
2412 
2413  //Average Multiplicity, same-sign, opposite-sign pair vs Centrality 1% :
2414 
2415  fAvgMultCentRun = new TProfile2D("fAvgMultCentRun","<Mult> vs cent,Run",90,0,90,fRunFlag,0,fRunFlag,"s");
2417  fAvgWgtMultCentRun = new TProfile2D("fAvgWgtMultCentRun","<wgt*Mult> vs cent,Run",90,0,90,fRunFlag,0,fRunFlag,"s");
2419  fAvgPOIposCentRun = new TProfile2D("fAvgPOIposCentRun","<wgt*POIs> ch-pos vs cent,Run",90,0,90,fRunFlag,0,fRunFlag,"s");
2421  fAvgPOInegCentRun = new TProfile2D("fAvgPOInegCentRun","<wgt*POIs> ch-neg vs cent,Run",90,0,90,fRunFlag,0,fRunFlag,"s");
2423  fAvgPOIPPCentRun = new TProfile2D("fAvgPOIPPCentRun","<wgt*POIs> Pos-Pos vs cent,Run",90,0,90,fRunFlag,0,fRunFlag,"s");
2425  fAvgPOINNCentRun = new TProfile2D("fAvgPOINNCentRun","<wgt*POIs> Neg-Neg vs cent,Run",90,0,90,fRunFlag,0,fRunFlag,"s");
2427  fAvgPOIOSCentRun = new TProfile2D("fAvgPOIOSCentRun","<wgt*POIs> oppo.-sign vs cent,Run",90,0,90,fRunFlag,0,fRunFlag,"s");
2429 
2430 
2431 
2432 
2433 
2434 
2435  for(int i=0;i<10;i++){
2436  sprintf(name,"fHistChPosvsEtaPtRun_Cent%d",i);
2437  sprintf(title,"Pos Ch, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
2438  fHistChPosvsEtaPtRun[i] = new TH3F(name,title,25,0.2,5.2,16,-0.8,0.8,fRunFlag,0,fRunFlag);
2440  sprintf(name,"fHistChNegvsEtaPtRun_Cent%d",i);
2441  sprintf(title,"Neg Ch, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
2442  fHistChNegvsEtaPtRun[i] = new TH3F(name,title,25,0.2,5.2,16,-0.8,0.8,fRunFlag,0,fRunFlag);
2444  }
2445 
2446 
2447  Int_t gCentForNUA[5] = {0,5,10,40,90};
2448 
2449  if(bFillEtaPhiNUA) {
2450  for(int i=0;i<4;i++){
2451  for(int j=0;j<fRunFlag;j++){
2452  sprintf(name,"fHistEtaPhiVz_Pos_Cent%d_Run%d",i,runNums[j]);
2453  sprintf(title,"eta,phi,Vz Pos Cent%d-%d%%",gCentForNUA[i],gCentForNUA[i+1]);
2454  fHist3DEtaPhiVz_Pos_Run[i][j] = new TH3F(name,title,10,-10,10,50,0,6.2832,16,-0.8,0.8);
2456 
2457  sprintf(name,"fHistEtaPhiVz_Neg_Cent%d_Run%d",i,runNums[j]);
2458  sprintf(title,"eta,phi,Vz Pos Cent%d-%d%%",gCentForNUA[i],gCentForNUA[i+1]);
2459  fHist3DEtaPhiVz_Neg_Run[i][j] = new TH3F(name,title,10,-10,10,50,0,6.2832,16,-0.8,0.8);
2461  }
2462  }
2463  }
2464 
2465 
2466 
2467 }
2468 
2469 
virtual void Terminate(Option_t *)
Bool_t CheckEventIsPileUp(AliAODEvent *faod)
TProfile2D * fHist_Corr3p_ZDN_SP_NN[3]
TProfile * fHist_Corr3p_EtaDiff_EP_V0C_NN[2][6]
TProfile * fHist_Reso2n_EP_Norm_Det[2][3]
TProfile * fHist_Corr3p_EtaDiff_EP_V0A_NN[2][6]
double Double_t
Definition: External.C:58
Definition: External.C:260
TProfile2D * fHist_Corr3p_ZDN_SP_PP[3]
Norm = 10 centrality bins along X.
TProfile2D * fHSin3nPosChEtaVz[4]
Float_t fHarmonic
Event centrality.
TH1D * fQynsV0C
sigma Qx2 V0C
Int_t fOldRunNum
number of total run
Definition: External.C:236
Bool_t PileUpMultiVertex(const AliAODEvent *faod)
const char * title
Definition: MakeQAPdf.C:27
TProfile * fHist_Corr3p_pTSum_EP_V0A_PP[2][6]
TProfile2D * fHCos4nPosChEtaVz[4]
TH1D * fQxnmV0A
profile from V0 multiplicity
AliFlowTrackSimple * GetTrack(Int_t i)
TList * fListHistos
Event selection.
AliAnalysisUtils * fAnalysisUtil
MultSelection (RUN2 centrality estimator)
TProfile2D * fHCos2nNegChEtaVz[4]
TProfile * fHist_Corr3p_pTDiff_EP_V0C_PN[2][6]
TProfile2D * fHSin1nNegChEtaVz[4]
TList * fListFBHijing
collection of Calib Histos
char Char_t
Definition: External.C:18
Int_t GetCurrentRunIndex(Int_t run)
TProfile * fHist_Corr3p_EP_Norm_PP[2][3]
TProfile2D * fHSin3nNegChEtaVz[4]
TProfile2D * fHSin2nPosChEtaVz[4]
TList * fListCalibs
collection of output
TProfile * fHist_Corr3p_EP_Norm_PN[2][3]
TProfile * fHist_Corr3p_pTDiff_EP_V0A_NN[2][6]
TProfile2D * fHist_Corr3p_ZDN_SP_PN[3]
TProfile2D * fHCos1nPosChEtaVz[4]
TH3F * fHist3DEtaPhiVz_Neg_Run[4][90]
4 centrality bin 90 Bins for Run. NUA
TH1F * hUnderOverBinNUAneg
//temporary Debug, remove for stable code
TProfile * fHist_Corr3p_EP_Norm_NN[2][3]
AliMultSelection * fMultSelection
input event
TH1F * fPileUpMultSelCount
event count with different cuts
TProfile * fHist_Corr3p_pTSum_EP_V0A_PN[2][6]
TProfile * fHist_Corr3p_EtaDiff_EP_V0A_PN[2][6]
TProfile2D * fHCos4nNegChEtaVz[4]
Double_t Phi() const
TProfile2D * fHCos3nPosChEtaVz[4]
TProfile2D * fHist_Reso2n_ZDN_SP_Det[3]
int Int_t
Definition: External.C:63
TH1D * fQynsV0A
sigma Qx2 V0A
TProfile2D * fHCos2nDWPosChEtaVz[4]
TProfile2D * fHSin2nNegChEtaVz[4]
float Float_t
Definition: External.C:68
TProfile * fHist_Corr3p_SP_Norm_PP[2][3]
Norm = 10 centrality bins along X.
Definition: External.C:252
TProfile * fHist_Corr3p_pTSum_EP_V0A_NN[2][6]
Definition: External.C:228
Definition: External.C:212
TProfile * fHist_Corr3p_pTDiff_EP_V0A_PN[2][6]
TProfile * fHist_Corr3p_pTSum_EP_V0C_PN[2][6]
TProfile2D * fHSin2nDWPosChEtaVz[4]
TProfile2D * fHCos2nDWNegChEtaVz[4]
TProfile2D * fHCos3nNegChEtaVz[4]
TProfile * fHist_Corr3p_QAEta_EP_V0C_NN[2]
TH3F * fHistChNegvsEtaPtRun[10]
10 Centrality Bin
TProfile2D * fHCos2nPosChEtaVz[4]
Int_t fRunFlag
array of runnumbers
AliFlowEventSimple * fEvent
TProfile * fHist_Reso2n_SP_Norm_Det[2][3]
TH1F * fHist_Event_count
Harmonic.
virtual void UserCreateOutputObjects()
TProfile * fHist_Corr3p_pTDiff_EP_V0C_PP[2][6]
TProfile2D * fV0MultChVsRun
opposite sign pairs
void InitializeRunArray(TString sPeriod)
TH3F * fHist3DEtaPhiVz_Pos_Run[4][90]
TH1F * fHCentBinTrkRecenter
//temporary Debug, remove for stable code
void GetNUACorrectionHist(Int_t run, Float_t cent)
TProfile2D * fHSin4nNegChEtaVz[4]
TProfile * fHist_Corr3p_QAEta_EP_V0C_PN[2]
TProfile * fHist_Corr3p_pTSum_EP_V0C_NN[2][6]
TProfile * fHist_Corr3p_SP_Norm_PN[2][3]
TProfile2D * fHSin4nPosChEtaVz[4]
TProfile * fHist_Corr3p_EtaDiff_EP_V0C_PP[2][6]
TProfile * fHist_Corr3p_EtaDiff_EP_V0A_PP[2][6]
Float_t EvtCent
counter of event for cout
TProfile * fHist_Corr3p_EtaDiff_EP_V0C_PN[2][6]
void GetV0QvectAndMult(const AliAODVZERO *aodV0, Double_t &Qxan, Double_t &Qyan, Double_t &sumMa, Double_t &Qxcn, Double_t &Qycn, Double_t &sumMc)
const char Option_t
Definition: External.C:48
void GetZDCCorrectionHist(Int_t run)
TProfile2D * fAvgPOIOSCentRun
same sign Neg-Neg pairs
Bool_t InPOISelection(Int_t poiType=1) const
TH1D * fQxnmV0C
sigma Qy2 V0A
Double_t Eta() const
const Double_t pi
TProfile * fHist_Corr3p_SP_Norm_NN[2][3]
bool Bool_t
Definition: External.C:53
TProfile2D * fHSin1nPosChEtaVz[4]
virtual void UserExec(Option_t *option)
TProfile * fHist_Corr3p_pTDiff_EP_V0C_NN[2][6]
TH1D * fFB_Efficiency_Cent[10]
4 centrality bin 90 Bins for Run. NUA
TProfile * fHist_Corr3p_QAEta_EP_V0C_PP[2]
Pos and Neg Mag field.
double GetWDist(const AliVVertex *v0, const AliVVertex *v1)
TProfile2D * fHSin2nDWNegChEtaVz[4]
void OpenInfoCalbration(Int_t run)
TProfile2D * fAvgPOINNCentRun
same sign Pos-Pos pairs
TProfile * fHist_Corr3p_pTSum_EP_V0C_PP[2][6]
TProfile2D * fHCos1nNegChEtaVz[4]
Int_t NumberOfTracks() const
TProfile * fHist_Corr3p_pTDiff_EP_V0A_PP[2][6]