AliPhysics  aaf9c62 (aaf9c62)
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 
46 using std::endl;
47 using std::cout;
48 
49 ClassImp(AliAnalysisTaskCMEV0)
50 
52  fEvent(NULL),
53  fMultSelection(NULL),
54  fAnalysisUtil(NULL),
55  fListHistos(NULL),
56  fListCalibs(NULL),
57  fListNUAHist(NULL),
58  fListFBHijing(NULL),
59  fListNUACorr(NULL),
60  fListZDNCorr(NULL),
61  fListV0MCorr(NULL),
62  fRejectPileUp(kTRUE),
63  fRejectPileUpTight(kTRUE),
64  bFillAvgTPCQn(kFALSE),
65  bFillEtaPhiNUA(kFALSE),
66  bApplyNUACorr(kFALSE),
67  bApplyZDCCorr(kFALSE),
68  bApplyNUAforEP(kFALSE),
69  bFillZDCinfo(kFALSE),
70  bSkipNestedTrk(kFALSE),
71  bRemNegTrkRndm(kFALSE),
72  bApplyV0MCorr(kFALSE),
73  sDataSet("2015"),
74  sAnalysisSet("DoGainEq"),
75  sCentEstimator("V0"),
76  sFileNUA("NewR"),
77  sMCdimension("1D"),
78  fRunFlag(0),
79  fOldRunNum(0),
80  fievent(0),
81  EvtCent(0.0),
82  fHarmonicN(1),
83  fHarmonicM(1),
84  fHarmonicPsi(2),
85  fPileUpSlopeParm(3.43),
86  fPileUpConstParm(43),
87  gFilterBit(96),
88  fHBTCutValue(0.0),
89  fRefMultCorr(0),
90  fRefMultRaw(0),
91  fHist_Event_count(NULL),
92  fPileUpMultSelCount(NULL),
93  fPileUpCount(NULL),
94  fTaskConfigParm(NULL),
95  fMultV0(NULL),
96  fQxnmV0A(NULL),
97  fQynmV0A(NULL),
98  fQxnsV0A(NULL),
99  fQynsV0A(NULL),
100  fQxnmV0C(NULL),
101  fQynmV0C(NULL),
102  fQxnsV0C(NULL),
103  fQynsV0C(NULL),
104  fHV0AEventPlaneVsCent(NULL),
105  fHV0CEventPlaneVsCent(NULL),
106  fHTPCEventPlaneVsCent(NULL),
107  fHEnergyZNCvsCent(NULL),
108  fHEnergyZNAvsCent(NULL),
109  fHEnergyZPCvsCent(NULL),
110  fHEnergyZPAvsCent(NULL),
111  fHEnergyZNCvsCentRun(NULL),
112  fHEnergyZNAvsCentRun(NULL),
113  fHEnergyZPCvsCentRun(NULL),
114  fHEnergyZPAvsCentRun(NULL),
115  fHEnergyZPCvsZPA(NULL),
116  fHEnergyZNCvsZNA(NULL),
117  hUnderOverBinNUApos(NULL),
118  hUnderOverBinNUAneg(NULL),
119  fHCentBinTrkRecenter(NULL),
120  fHCorrectZDNP(NULL),
121  fV0AQ2xVsCentRun(NULL),
122  fV0AQ2yVsCentRun(NULL),
123  fV0CQ2xVsCentRun(NULL),
124  fV0CQ2yVsCentRun(NULL),
125  fV0AQ3xVsCentRun(NULL),
126  fV0AQ3yVsCentRun(NULL),
127  fV0CQ3xVsCentRun(NULL),
128  fV0CQ3yVsCentRun(NULL),
129  fTPCQ2xVsCentRun(NULL),
130  fTPCQ2yVsCentRun(NULL),
131  fTPCQ3xVsCentRun(NULL),
132  fTPCQ3yVsCentRun(NULL),
133  mListNUAPos(NULL),
134  mListNUANeg(NULL),
135  fileNUApos(NULL),
136  fileNUAneg(NULL),
137  fAvgMultCentRun(NULL),
138  fAvgWgtMultCentRun(NULL),
139  fAvgPOIposCentRun(NULL),
140  fAvgPOInegCentRun(NULL),
141  fAvgPOIPPCentRun(NULL),
142  fAvgPOINNCentRun(NULL),
143  fAvgPOIOSCentRun(NULL),
144  fV0MultChVsRun(NULL),
145  fEventStatvsRun(NULL),
146  fEtaBinFinderForQA(NULL),
147  fVzBinFinderForNUA(NULL),
148  fHistVtxZvsRun(NULL),
149  fHistVtxXvsRun(NULL),
150  fHistVtxYvsRun(NULL),
151  fRejectRatioVsCR(NULL),
152  fCentDistvsRun(NULL),
153  fHCorrectV0M(NULL),
154  fHAvgerageQnV0A(NULL),
155  fHAvgerageQnV0C(NULL),
156  fCentV0MvsVzRun(NULL),
157  fCent3pvsVzRun(NULL),
158  fRefMultCorrvsRaw(NULL),
159  fTPCvsGlobalTrk(NULL),
160  fTPCuncutvsGlobal(NULL),
161  fGlobalTracks(NULL),
162  fTPCvsITSfb96(NULL),
163  fTPCvsITSfb32(NULL),
164  fTPCFEvsITSfb96(NULL),
165  fCentCL1vsVzRun(NULL),
166  fdPhiFemtoCut(NULL),
167  fVzDistribuion(NULL)
168 {
169  for(int i=0;i<5;i++){
170  fHCorrectNUApos[i] = NULL;
171  fHCorrectNUAneg[i] = NULL;
172  }
173  for(int i=0;i<90;i++){
174  runNums[i] = 0;
175  for(int j=0;j<5;j++){
176  fHist3DEtaPhiVz_Pos_Run[j][i] = NULL;
177  fHist3DEtaPhiVz_Neg_Run[j][i] = NULL;
178  }
179  }
180  for(int i=0;i<10;i++){
181  fFB_Efficiency_Cent[i] = NULL;
182  fFB_Efficiency_Pos[i] = NULL;
183  fFB_Efficiency_Neg[i] = NULL;
184  }
185  for(int i=0;i<2;i++){
186  for(int j=0;j<3;j++){
187  fHist_Corr3p_SP_Norm_PN[i][j] = NULL;
188  fHist_Corr3p_SP_Norm_PP[i][j] = NULL;
189  fHist_Corr3p_SP_Norm_NN[i][j] = NULL;
190  fHist_Reso2n_SP_Norm_Det[i][j] = NULL;
191  }
192  }
193  for(int i=0;i<2;i++){
194  for(int j=0;j<3;j++){
195  fHist_Corr3p_EP_Norm_PN[i][j] = NULL;
196  fHist_Corr3p_EP_Norm_PP[i][j] = NULL;
197  fHist_Corr3p_EP_Norm_NN[i][j] = NULL;
198  fHist_Reso2n_EP_Norm_Det[i][j] = NULL;
199  }
200  for(int j=0;j<3;j++){
201  fHist_Corr3p_EP_Refm_PN[i][j] = NULL;
202  fHist_Corr3p_EP_Refm_PP[i][j] = NULL;
203  fHist_Corr3p_EP_Refm_NN[i][j] = NULL;
204  fHist_Reso2n_EP_Refm_Det[i][j] = NULL;
205  }
206  }
207  for(int i=0;i<2;i++){
208  fHist_Corr3p_vsRun_EP_PN[i] = NULL;
209  fHist_Corr3p_vsRun_EP_PP[i] = NULL;
210  fHist_Corr3p_vsRun_EP_NN[i] = NULL;
211  }
212  for(int i=0;i<3;i++){
213  fHist_Corr3p_ZDN_SP_PN[i] = NULL;
214  fHist_Corr3p_ZDN_SP_PP[i] = NULL;
215  fHist_Corr3p_ZDN_SP_NN[i] = NULL;
216  fHist_Reso2n_ZDN_SP_Det[i] = NULL;
217  }
218  for(int i=0;i<2;i++){
219  for(int j=0;j<6;j++){
220  fHist_Corr3p_pTSum_EP_V0A_PN[i][j] = NULL;
221  fHist_Corr3p_pTSum_EP_V0A_PP[i][j] = NULL;
222  fHist_Corr3p_pTSum_EP_V0A_NN[i][j] = NULL;
223  fHist_Corr3p_pTSum_EP_V0C_PN[i][j] = NULL;
224  fHist_Corr3p_pTSum_EP_V0C_PP[i][j] = NULL;
225  fHist_Corr3p_pTSum_EP_V0C_NN[i][j] = NULL;
226 
227  fHist_Corr3p_pTDiff_EP_V0A_PN[i][j] = NULL;
228  fHist_Corr3p_pTDiff_EP_V0A_PP[i][j] = NULL;
229  fHist_Corr3p_pTDiff_EP_V0A_NN[i][j] = NULL;
230  fHist_Corr3p_pTDiff_EP_V0C_PN[i][j] = NULL;
231  fHist_Corr3p_pTDiff_EP_V0C_PP[i][j] = NULL;
232  fHist_Corr3p_pTDiff_EP_V0C_NN[i][j] = NULL;
233 
234  fHist_Corr3p_EtaDiff_EP_V0A_PN[i][j] = NULL;
235  fHist_Corr3p_EtaDiff_EP_V0A_PP[i][j] = NULL;
236  fHist_Corr3p_EtaDiff_EP_V0A_NN[i][j] = NULL;
237  fHist_Corr3p_EtaDiff_EP_V0C_PN[i][j] = NULL;
238  fHist_Corr3p_EtaDiff_EP_V0C_PP[i][j] = NULL;
239  fHist_Corr3p_EtaDiff_EP_V0C_NN[i][j] = NULL;
240  }
241  }
242  for(int i=0;i<10;i++){
243  fHistChPosvsEtaPtRun[i] = NULL;
244  fHistChNegvsEtaPtRun[i] = NULL;
245  }
246  for(int i=0;i<2;i++){
247  fHist_Corr3p_QAEta_SP_V0A_PN[i] = NULL;
248  fHist_Corr3p_QAEta_SP_V0A_PP[i] = NULL;
249  fHist_Corr3p_QAEta_SP_V0A_NN[i] = NULL;
250  }
251  for(int i=0;i<2;i++){
252  fHist_Corr3p_QAEta_SP_V0C_PN[i] = NULL;
253  fHist_Corr3p_QAEta_SP_V0C_PP[i] = NULL;
254  fHist_Corr3p_QAEta_SP_V0C_NN[i] = NULL;
255  }
256  for(int i=0;i<4;i++){
257  fHCos1nPosChEtaVz[i] = NULL;
258  fHCos2nPosChEtaVz[i] = NULL;
259  fHCos3nPosChEtaVz[i] = NULL;
260  fHCos4nPosChEtaVz[i] = NULL;
261  fHSin1nPosChEtaVz[i] = NULL;
262  fHSin2nPosChEtaVz[i] = NULL;
263  fHSin3nPosChEtaVz[i] = NULL;
264  fHSin4nPosChEtaVz[i] = NULL;
265 
266  fHCos1nNegChEtaVz[i] = NULL;
267  fHCos2nNegChEtaVz[i] = NULL;
268  fHCos3nNegChEtaVz[i] = NULL;
269  fHCos4nNegChEtaVz[i] = NULL;
270  fHSin1nNegChEtaVz[i] = NULL;
271  fHSin2nNegChEtaVz[i] = NULL;
272  fHSin3nNegChEtaVz[i] = NULL;
273  fHSin4nNegChEtaVz[i] = NULL;
274 
275  fHCos2nDWPosChEtaVz[i] = NULL;
276  fHSin2nDWPosChEtaVz[i] = NULL;
277  fHCos2nDWNegChEtaVz[i] = NULL;
278  fHSin2nDWNegChEtaVz[i] = NULL;
279  }
280  for(int i=0;i<2;i++){
281  fHist_NonIso_SP_PP_Mag0[i] = NULL;
282  fHist_NonIso_SP_NN_Mag0[i] = NULL;
283  fHist_NonIso_SP_PP_Mag1[i] = NULL;
284  fHist_NonIso_SP_NN_Mag1[i] = NULL;
285  }
286  for(int i=0;i<2;i++){
287  fHist_Corr2p_EP_Norm_PN[i] = NULL;
288  fHist_Corr2p_EP_Norm_PP[i] = NULL;
289  fHist_Corr2p_EP_Norm_NN[i] = NULL;
290  }
291  for(int i=0;i<2;i++){
292  fHist_Corr2p_EP_Refm_PN[i] = NULL;
293  fHist_Corr2p_EP_Refm_PP[i] = NULL;
294  fHist_Corr2p_EP_Refm_NN[i] = NULL;
295  }
296 
297  DefineInput(1, AliFlowEventSimple::Class()); // Input slot #1: AliFlowEventSimple
298 
299  DefineOutput(1,TList::Class());
300  DefineOutput(2,TList::Class());
301  DefineOutput(3,TList::Class());
302 
303 }//-------- real ---------
304 
306  fEvent(NULL),
307  fMultSelection(NULL),
308  fAnalysisUtil(NULL),
309  fListHistos(NULL),
310  fListCalibs(NULL),
311  fListNUAHist(NULL),
312  fListFBHijing(NULL),
313  fListNUACorr(NULL),
314  fListZDNCorr(NULL),
315  fListV0MCorr(NULL),
316  fRejectPileUp(kTRUE),
317  fRejectPileUpTight(kTRUE),
318  bFillAvgTPCQn(kFALSE),
319  bFillEtaPhiNUA(kFALSE),
320  bApplyNUACorr(kFALSE),
321  bApplyZDCCorr(kFALSE),
322  bApplyNUAforEP(kFALSE),
323  bFillZDCinfo(kFALSE),
324  bSkipNestedTrk(kFALSE),
325  bRemNegTrkRndm(kFALSE),
326  bApplyV0MCorr(kFALSE),
327  sDataSet("2015"),
328  sAnalysisSet("DoGainEq"),
329  sCentEstimator("V0"),
330  sFileNUA("NewR"),
331  sMCdimension("1D"),
332  fRunFlag(0),
333  fOldRunNum(0),
334  fievent(0),
335  EvtCent(0.0),
336  fHarmonicN(1),
337  fHarmonicM(1),
338  fHarmonicPsi(2),
339  fPileUpSlopeParm(3.43),
340  fPileUpConstParm(43),
341  gFilterBit(96),
342  fHBTCutValue(0.0),
343  fRefMultCorr(0),
344  fRefMultRaw(0),
345  fHist_Event_count(NULL),
346  fPileUpMultSelCount(NULL),
347  fPileUpCount(NULL),
348  fTaskConfigParm(NULL),
349  fMultV0(NULL),
350  fQxnmV0A(NULL),
351  fQynmV0A(NULL),
352  fQxnsV0A(NULL),
353  fQynsV0A(NULL),
354  fQxnmV0C(NULL),
355  fQynmV0C(NULL),
356  fQxnsV0C(NULL),
357  fQynsV0C(NULL),
358  fHV0AEventPlaneVsCent(NULL),
359  fHV0CEventPlaneVsCent(NULL),
360  fHTPCEventPlaneVsCent(NULL),
361  fHEnergyZNCvsCent(NULL),
362  fHEnergyZNAvsCent(NULL),
363  fHEnergyZPCvsCent(NULL),
364  fHEnergyZPAvsCent(NULL),
365  fHEnergyZNCvsCentRun(NULL),
366  fHEnergyZNAvsCentRun(NULL),
367  fHEnergyZPCvsCentRun(NULL),
368  fHEnergyZPAvsCentRun(NULL),
369  fHEnergyZPCvsZPA(NULL),
370  fHEnergyZNCvsZNA(NULL),
371  hUnderOverBinNUApos(NULL),
372  hUnderOverBinNUAneg(NULL),
373  fHCentBinTrkRecenter(NULL),
374  fHCorrectZDNP(NULL),
375  fV0AQ2xVsCentRun(NULL),
376  fV0AQ2yVsCentRun(NULL),
377  fV0CQ2xVsCentRun(NULL),
378  fV0CQ2yVsCentRun(NULL),
379  fV0AQ3xVsCentRun(NULL),
380  fV0AQ3yVsCentRun(NULL),
381  fV0CQ3xVsCentRun(NULL),
382  fV0CQ3yVsCentRun(NULL),
383  fTPCQ2xVsCentRun(NULL),
384  fTPCQ2yVsCentRun(NULL),
385  fTPCQ3xVsCentRun(NULL),
386  fTPCQ3yVsCentRun(NULL),
387  mListNUAPos(NULL),
388  mListNUANeg(NULL),
389  fileNUApos(NULL),
390  fileNUAneg(NULL),
391  fAvgMultCentRun(NULL),
392  fAvgWgtMultCentRun(NULL),
393  fAvgPOIposCentRun(NULL),
394  fAvgPOInegCentRun(NULL),
395  fAvgPOIPPCentRun(NULL),
396  fAvgPOINNCentRun(NULL),
397  fAvgPOIOSCentRun(NULL),
398  fV0MultChVsRun(NULL),
399  fEventStatvsRun(NULL),
400  fEtaBinFinderForQA(NULL),
401  fVzBinFinderForNUA(NULL),
402  fHistVtxZvsRun(NULL),
403  fHistVtxXvsRun(NULL),
404  fHistVtxYvsRun(NULL),
405  fRejectRatioVsCR(NULL),
406  fCentDistvsRun(NULL),
407  fHCorrectV0M(NULL),
408  fHAvgerageQnV0A(NULL),
409  fHAvgerageQnV0C(NULL),
410  fCentV0MvsVzRun(NULL),
411  fCent3pvsVzRun(NULL),
412  fRefMultCorrvsRaw(NULL),
413  fTPCvsGlobalTrk(NULL),
414  fTPCuncutvsGlobal(NULL),
415  fGlobalTracks(NULL),
416  fTPCvsITSfb96(NULL),
417  fTPCvsITSfb32(NULL),
418  fTPCFEvsITSfb96(NULL),
419  fCentCL1vsVzRun(NULL),
420  fdPhiFemtoCut(NULL),
421  fVzDistribuion(NULL)
422 {
423  for(int i=0;i<5;i++){
424  fHCorrectNUApos[i] = NULL;
425  fHCorrectNUAneg[i] = NULL;
426  }
427  for(int i=0;i<90;i++){
428  runNums[i] = 0;
429  for(int j=0;j<5;j++){
430  fHist3DEtaPhiVz_Pos_Run[j][i] = NULL;
431  fHist3DEtaPhiVz_Neg_Run[j][i] = NULL;
432  }
433  }
434  for(int i=0;i<10;i++){
435  fFB_Efficiency_Cent[i] = NULL;
436  fFB_Efficiency_Pos[i] = NULL;
437  fFB_Efficiency_Neg[i] = NULL;
438  }
439  for(int i=0;i<2;i++){
440  for(int j=0;j<3;j++){
441  fHist_Corr3p_SP_Norm_PN[i][j] = NULL;
442  fHist_Corr3p_SP_Norm_PP[i][j] = NULL;
443  fHist_Corr3p_SP_Norm_NN[i][j] = NULL;
444  fHist_Reso2n_SP_Norm_Det[i][j] = NULL;
445  }
446  }
447  for(int i=0;i<2;i++){
448  for(int j=0;j<3;j++){
449  fHist_Corr3p_EP_Norm_PN[i][j] = NULL;
450  fHist_Corr3p_EP_Norm_PP[i][j] = NULL;
451  fHist_Corr3p_EP_Norm_NN[i][j] = NULL;
452  fHist_Reso2n_EP_Norm_Det[i][j] = NULL;
453  }
454  for(int j=0;j<3;j++){
455  fHist_Corr3p_EP_Refm_PN[i][j] = NULL;
456  fHist_Corr3p_EP_Refm_PP[i][j] = NULL;
457  fHist_Corr3p_EP_Refm_NN[i][j] = NULL;
458  fHist_Reso2n_EP_Refm_Det[i][j] = NULL;
459  }
460  }
461  for(int i=0;i<2;i++){
462  fHist_Corr3p_vsRun_EP_PN[i] = NULL;
463  fHist_Corr3p_vsRun_EP_PP[i] = NULL;
464  fHist_Corr3p_vsRun_EP_NN[i] = NULL;
465  }
466  for(int i=0;i<3;i++){
467  fHist_Corr3p_ZDN_SP_PN[i] = NULL;
468  fHist_Corr3p_ZDN_SP_PP[i] = NULL;
469  fHist_Corr3p_ZDN_SP_NN[i] = NULL;
470  fHist_Reso2n_ZDN_SP_Det[i] = NULL;
471  }
472  for(int i=0;i<2;i++){
473  for(int j=0;j<6;j++){
474  fHist_Corr3p_pTSum_EP_V0A_PN[i][j] = NULL;
475  fHist_Corr3p_pTSum_EP_V0A_PP[i][j] = NULL;
476  fHist_Corr3p_pTSum_EP_V0A_NN[i][j] = NULL;
477  fHist_Corr3p_pTSum_EP_V0C_PN[i][j] = NULL;
478  fHist_Corr3p_pTSum_EP_V0C_PP[i][j] = NULL;
479  fHist_Corr3p_pTSum_EP_V0C_NN[i][j] = NULL;
480 
481  fHist_Corr3p_pTDiff_EP_V0A_PN[i][j] = NULL;
482  fHist_Corr3p_pTDiff_EP_V0A_PP[i][j] = NULL;
483  fHist_Corr3p_pTDiff_EP_V0A_NN[i][j] = NULL;
484  fHist_Corr3p_pTDiff_EP_V0C_PN[i][j] = NULL;
485  fHist_Corr3p_pTDiff_EP_V0C_PP[i][j] = NULL;
486  fHist_Corr3p_pTDiff_EP_V0C_NN[i][j] = NULL;
487 
488  fHist_Corr3p_EtaDiff_EP_V0A_PN[i][j] = NULL;
489  fHist_Corr3p_EtaDiff_EP_V0A_PP[i][j] = NULL;
490  fHist_Corr3p_EtaDiff_EP_V0A_NN[i][j] = NULL;
491  fHist_Corr3p_EtaDiff_EP_V0C_PN[i][j] = NULL;
492  fHist_Corr3p_EtaDiff_EP_V0C_PP[i][j] = NULL;
493  fHist_Corr3p_EtaDiff_EP_V0C_NN[i][j] = NULL;
494  }
495  }
496  for(int i=0;i<10;i++){
497  fHistChPosvsEtaPtRun[i] = NULL;
498  fHistChNegvsEtaPtRun[i] = NULL;
499  }
500  for(int i=0;i<2;i++){
504  }
505  for(int i=0;i<2;i++){
509  }
510  for(int i=0;i<4;i++){
511  fHCos1nPosChEtaVz[i] = NULL;
512  fHCos2nPosChEtaVz[i] = NULL;
513  fHCos3nPosChEtaVz[i] = NULL;
514  fHCos4nPosChEtaVz[i] = NULL;
515  fHSin1nPosChEtaVz[i] = NULL;
516  fHSin2nPosChEtaVz[i] = NULL;
517  fHSin3nPosChEtaVz[i] = NULL;
518  fHSin4nPosChEtaVz[i] = NULL;
519 
520  fHCos1nNegChEtaVz[i] = NULL;
521  fHCos2nNegChEtaVz[i] = NULL;
522  fHCos3nNegChEtaVz[i] = NULL;
523  fHCos4nNegChEtaVz[i] = NULL;
524  fHSin1nNegChEtaVz[i] = NULL;
525  fHSin2nNegChEtaVz[i] = NULL;
526  fHSin3nNegChEtaVz[i] = NULL;
527  fHSin4nNegChEtaVz[i] = NULL;
528 
529  fHCos2nDWPosChEtaVz[i] = NULL;
530  fHSin2nDWPosChEtaVz[i] = NULL;
531  fHCos2nDWNegChEtaVz[i] = NULL;
532  fHSin2nDWNegChEtaVz[i] = NULL;
533  }
534  for(int i=0;i<2;i++){
535  fHist_NonIso_SP_PP_Mag0[i] = NULL;
536  fHist_NonIso_SP_NN_Mag0[i] = NULL;
537  fHist_NonIso_SP_PP_Mag1[i] = NULL;
538  fHist_NonIso_SP_NN_Mag1[i] = NULL;
539  }
540  for(int i=0;i<2;i++){
541  fHist_Corr2p_EP_Norm_PN[i] = NULL;
542  fHist_Corr2p_EP_Norm_PP[i] = NULL;
543  fHist_Corr2p_EP_Norm_NN[i] = NULL;
544  }
545  for(int i=0;i<2;i++){
546  fHist_Corr2p_EP_Refm_PN[i] = NULL;
547  fHist_Corr2p_EP_Refm_PP[i] = NULL;
548  fHist_Corr2p_EP_Refm_NN[i] = NULL;
549  }
550 
551 }//-----------
552 
553 
554 
555 
557 {
558 
560 
561  fAnalysisUtil = new AliAnalysisUtils();
562  fAnalysisUtil->SetUseMVPlpSelection(kTRUE);
563  fAnalysisUtil->SetUseOutOfBunchPileUp(kTRUE);
564 
565 
566  if(fListFBHijing) {
567  if(sMCdimension=="1D"){
568  for(int i=0;i<10;i++) {
569  fFB_Efficiency_Cent[i] = (TH1D *) fListFBHijing->FindObject(Form("eff_unbiased_%d",i));
570  }
571  }
572  else if(sMCdimension=="3D"){
573  Int_t centFB[11] = {0,5,10,20,30,40,50,60,70,80,90};
574  for(int i=0;i<10;i++) {
575  fFB_Efficiency_Pos[i] = (TH3F *) fListFBHijing->FindObject(Form("fHistCorrectionPlus%d-%d",centFB[i],centFB[i+1]));
576  fFB_Efficiency_Neg[i] = (TH3F *) fListFBHijing->FindObject(Form("fHistCorrectionMinus%d-%d",centFB[i],centFB[i+1]));
577  }
578  }
579  else{
580  printf("\n\n!!***** Warning *****!!\n Enter correct Dimention !!\n\n"); exit(1);
581  }
582  }
583  else{ // if MC efficiency not found then use weight = 1.
584  printf("\n\n!!***** Warning *****!!\n FilterBit efficiency not found, use = 1.0 !!\n\n");
585  for(int i=0;i<10;i++){
586  fFB_Efficiency_Cent[i] = new TH1D(Form("eff_unbiased_%d",i),"",1,0,50.);
587  fFB_Efficiency_Cent[i]->SetBinContent(1,1.0);
588  fFB_Efficiency_Pos[i] = new TH3F(Form("eff_unbiased_Pos_%d",i),"",1,-0.9,0.9,1,0,50,1,0,7);
589  fFB_Efficiency_Pos[i]->SetBinContent(1,1,1,1.0);
590  fFB_Efficiency_Neg[i] = new TH3F(Form("eff_unbiased_Neg_%d",i),"",1,-0.9,0.9,1,0,50,1,0,7);
591  fFB_Efficiency_Neg[i]->SetBinContent(1,1,1,1.0);
592  }
593  }
594 
595 
596 
597  fListHistos = new TList();
598  fListHistos->SetOwner(kTRUE);
599 
600  fListCalibs = new TList();
601  fListCalibs->SetOwner(kTRUE);
602 
603  fListNUAHist = new TList();
604  fListNUAHist->SetOwner(kTRUE);
605 
606  this->DefineHistograms();
607 
608  if(fListFBHijing){
609  fTaskConfigParm->SetBinContent(11,1.0);
610  }
611  if(bApplyNUACorr){
612  fTaskConfigParm->SetBinContent(12,1.0);
613  }
614  if(bApplyV0MCorr){
615  fTaskConfigParm->SetBinContent(13,1.0);
616  }
617  if(bApplyZDCCorr){
618  fTaskConfigParm->SetBinContent(14,1.0);
619  }
620 
621  fTaskConfigParm->SetBinContent(15,fHarmonicN);
622  fTaskConfigParm->SetBinContent(16,fHarmonicM);
623  fTaskConfigParm->SetBinContent(17,fHarmonicPsi);
624 
625  PostData(1,fListHistos);
626  PostData(2,fListCalibs);
627  PostData(3,fListNUAHist);
628 
629  printf("\n ======================== Info::UserCreateOutPutObject Called ======================== \n");
630  std::cout<<" sDataSet = "<<sDataSet.Data()<<" FB = "<<gFilterBit<<" PileUp C = "<<fPileUpConstParm<<" HBT cut = "<<fHBTCutValue<<"\n"<<std::endl;
631 
632 
633 }
634 
636 {
637  delete fListHistos;
638  //delete fListCalibs;
639  //delete fListNUAHist;
640 
641  if(fAnalysisUtil) delete fAnalysisUtil; // it is '= new' !!!
642 
644  delete fHCentBinTrkRecenter;
645 
646  if(fHCorrectZDNP) delete fHCorrectZDNP;
647  if(fHCorrectV0M) delete fHCorrectV0M;
648  if(fHAvgerageQnV0A) delete fHAvgerageQnV0A;
649  if(fHAvgerageQnV0C) delete fHAvgerageQnV0C;
650 
651 
652  for(int i=0;i<5;i++){
653  if(fHCorrectNUApos[i]) delete fHCorrectNUApos[i];
654  if(fHCorrectNUAneg[i]) delete fHCorrectNUAneg[i];
655  }
656  for(int i=0;i<10;i++){
657  if(fFB_Efficiency_Cent[i]) delete fFB_Efficiency_Cent[i];
658  if(fFB_Efficiency_Pos[i]) delete fFB_Efficiency_Pos[i];
659  if(fFB_Efficiency_Neg[i]) delete fFB_Efficiency_Neg[i];
660  }
661 }
662 
663 
664 
665 
666 
667 
668 
670 {
671 //printf("\n ======================== Debug::UserExec Called ======================== \n");
672 
673  Float_t stepCount = 0.5;
674  fHist_Event_count->Fill(stepCount); //1
675  stepCount++;
676 
677  AliAODEvent *aod = dynamic_cast<AliAODEvent*>(InputEvent());
678  fEvent = dynamic_cast<AliFlowEventSimple*>(GetInputData(1));
679 
680  if(!aod || !fEvent){
681  printf("\n ... ::UserExec = no AOD or Flow Event, \n.... EXIT ..... \n");
682  return;
683  }
684 
685  fHist_Event_count->Fill(stepCount); //2
686  stepCount++;
687 
688 
689  //---------pileup rejection: --------
690 
691  Bool_t kPileupEvent = kFALSE;
692 
693  kPileupEvent = CheckEventIsPileUp(aod);
694 
695  if(kPileupEvent) return;
696 
697 
698 
699  fHist_Event_count->Fill(stepCount); //3
700  stepCount++;
701 
702 
703 
704  Double_t centrV0M = -1;
705  Double_t centrCL1 = -1;
706  Double_t centrCL0 = -1;
707  Double_t centrTRK = -1;
708 
709  EvtCent = -1;
710 
711  if(sDataSet=="2010"||sDataSet=="2011"){
712  centrV0M = ((AliVAODHeader*)aod->GetHeader())->GetCentralityP()->GetCentralityPercentile("V0M");
713  centrCL1 = ((AliVAODHeader*)aod->GetHeader())->GetCentralityP()->GetCentralityPercentile("CL1");
714  centrCL0 = ((AliVAODHeader*)aod->GetHeader())->GetCentralityP()->GetCentralityPercentile("CL0");
715  centrTRK = ((AliVAODHeader*)aod->GetHeader())->GetCentralityP()->GetCentralityPercentile("TRK");
716  }
717  else{
718  fMultSelection = (AliMultSelection*) InputEvent()->FindListObject("MultSelection");
719  if(!fMultSelection) {
720  printf("\n\n **WARNING** ::UserExec() AliMultSelection object not found.\n\n");
721  exit(1);
722  }
723  centrV0M = fMultSelection->GetMultiplicityPercentile("V0M");
724  centrCL1 = fMultSelection->GetMultiplicityPercentile("CL1");
725  centrCL0 = fMultSelection->GetMultiplicityPercentile("CL0");
726  centrTRK = fMultSelection->GetMultiplicityPercentile("TRK");
727  }
728 
729 
730 
731  if(sCentEstimator=="V0" || sCentEstimator=="V0M"){
732  EvtCent = centrV0M;
733  }
734  else{
735  EvtCent = centrCL1;
736  }
737 
738 
739  Int_t iCentSPD = centrCL1;
740 
741  if(iCentSPD > 90) return;
742 
743  fHist_Event_count->Fill(stepCount); //4
744  stepCount++;
745 
746 
747 
748 
749  Int_t cIndex = 0;
750  Int_t cForNUA = 0;
751  Int_t cInputNUA = 0;
752 
753  if(EvtCent<5.0) {
754  cIndex = 0;
755  cForNUA = 0; //0=0-5,
756  cInputNUA = 0;
757  }
758  else if(EvtCent>=5.0 && EvtCent<10){
759  cIndex = 1;
760  cForNUA = 1; // 1=5-10,
761  cInputNUA = 1;
762  }
763  else if(EvtCent>=10.0) {
764  cIndex = abs(EvtCent/10.0) + 1;
765  cForNUA = cIndex; //2 = 10-20,
766 
767  if(EvtCent>=10 && EvtCent<40.0)
768  cInputNUA = 2;
769 
770  if(EvtCent>=20 && EvtCent<40.0){
771  cForNUA = 3; // 3=20-40
772  }
773  if(EvtCent>=40.0){
774  cForNUA = 4; // 4=40-90
775  cInputNUA = 3;
776  }
777  }
778 
779 
780 
781  //------- load v0 calib file of Alex --------
782  Int_t runindex = -111;
783  Int_t runNumber = aod->GetRunNumber();
784  Float_t psiN = fHarmonicPsi;
785  runindex = GetCurrentRunIndex(runNumber);
786 
787  if(runNumber!=fOldRunNum){
788 
789 
790  if(sDataSet=="2015" || sDataSet=="2015HI"){
791  OpenInfoCalbration(runNumber, psiN);
792  }
793  if(bApplyV0MCorr) {
794  GetV0MCorrectionHist(runNumber);
795  }
796  if(bApplyNUACorr){
797  GetNUACorrectionHist(runNumber,sFileNUA);
798  }
800  GetZDCCorrectionHist(runNumber);
801  }
802 
803  fOldRunNum = runNumber;
804  }
805 
806 
807 
808 
809  Double_t fMagField = aod->GetMagneticField();
810 
811  Int_t QAindex = -1;
812 
813  //Femto:
814  Int_t bSign = (fMagField > 0) ? 1 : -1;
815 
816  //Double_t fHBTCutValue = 0.02;
817 
818 
819  if(fMagField<0)
820  QAindex = 0;
821  else if(fMagField>0)
822  QAindex = 1;
823 
824 //-------- V0 info ---------------
825  const AliAODVZERO *fAODV0 = aod->GetVZEROData();
826 
827 
828  Double_t QyanCor = 0., QycnCor = 0.;
829  Double_t QxanCor = 0., QxcnCor = 0.;
830  Double_t Qxan2 = 0., Qyan2 = 0.;
831  Double_t Qxcn2 = 0., Qycn2 = 0.;
832  Double_t sumMa = 0., sumMc = 0.;
833  Double_t fMultv0 = 0.;
834  Double_t phiV0 = 0.;
835 
836 
837  if(sDataSet=="2015" || sDataSet=="2015HI") {
838  GetV0QvectAndMult(fAODV0, psiN, Qxan2, Qyan2, sumMa, Qxcn2, Qycn2, sumMc);
839 
840  QyanCor = (Qyan2 - fQynmV0A->GetBinContent(iCentSPD+1))/fQynsV0A->GetBinContent(iCentSPD+1);
841  QycnCor = (Qycn2 - fQynmV0C->GetBinContent(iCentSPD+1))/fQynsV0C->GetBinContent(iCentSPD+1);
842 
843  QxanCor = Qxan2;
844  QxcnCor = Qxcn2;
845 
846  if(psiN != 4.){
847  QxanCor = (Qxan2 - fQxnmV0A->GetBinContent(iCentSPD+1))/fQxnsV0A->GetBinContent(iCentSPD+1);
848  QxcnCor = (Qxcn2 - fQxnmV0C->GetBinContent(iCentSPD+1))/fQxnsV0C->GetBinContent(iCentSPD+1);
849  }
850  }
851  //else{
852 
853  Double_t Qxan3 = 0., Qyan3 = 0.;
854  Double_t Qxcn3 = 0., Qycn3 = 0.;
855  Qxan2 = 0., Qyan2 = 0.;
856  Qxcn2 = 0., Qycn2 = 0.;
857 
858  for(int iV0 = 0; iV0 < 64; iV0++) { //0-31 is V0C, 32-63 VOA
859 
860  fMultv0 = fAODV0->GetMultiplicity(iV0);
861 
862  if(fHCorrectV0M){
863  fMultv0 = fMultv0 * fHCorrectV0M->GetBinContent(iV0+1); // Gain Correction
864  }
865 
866  fV0MultChVsRun->Fill(iV0+0.5,runindex,fMultv0);
867 
868  phiV0 = TMath::PiOver4()*(0.5 + iV0 % 8);
869 
870  if(iV0 < 32){
871  Qxcn2 += TMath::Cos(2*phiV0) * fMultv0;
872  Qycn2 += TMath::Sin(2*phiV0) * fMultv0;
873  Qxcn3 += TMath::Cos(3*phiV0) * fMultv0;
874  Qycn3 += TMath::Sin(3*phiV0) * fMultv0;
875  sumMc += fMultv0;
876  }
877  else if(iV0 >= 32){
878  Qxan2 += TMath::Cos(2*phiV0) * fMultv0;
879  Qyan2 += TMath::Sin(2*phiV0) * fMultv0;
880  Qxan3 += TMath::Cos(3*phiV0) * fMultv0;
881  Qyan3 += TMath::Sin(3*phiV0) * fMultv0;
882  sumMa += fMultv0;
883  }
884  }//channel loop
885 
886  //For V0-Qn Recenter
887  fV0CQ2xVsCentRun->Fill(centrCL1,runindex,Qxcn2);
888  fV0CQ2yVsCentRun->Fill(centrCL1,runindex,Qycn2);
889  fV0AQ2xVsCentRun->Fill(centrCL1,runindex,Qxan2);
890  fV0AQ2yVsCentRun->Fill(centrCL1,runindex,Qyan2);
891 
892  fV0CQ3xVsCentRun->Fill(centrCL1,runindex,Qxcn3);
893  fV0CQ3yVsCentRun->Fill(centrCL1,runindex,Qycn3);
894  fV0AQ3xVsCentRun->Fill(centrCL1,runindex,Qxan3);
895  fV0AQ3yVsCentRun->Fill(centrCL1,runindex,Qyan3);
896 
897  Int_t icentV0Qn = centrCL1;
898  icentV0Qn += 1;
899 
900  if(sDataSet=="2015pPb" || sDataSet=="pPb" || sDataSet=="2015LI") {
901  if(psiN==3.0){
902  QxanCor = Qxan3; //3rd
903  QxcnCor = Qxcn3;
904  QyanCor = Qyan3;
905  QycnCor = Qycn3;
906 
907  if(fHAvgerageQnV0C && fHAvgerageQnV0A && icentV0Qn < 91){
908  QxanCor -= fHAvgerageQnV0A->GetBinContent(icentV0Qn,3); //x = Cos
909  QxcnCor -= fHAvgerageQnV0C->GetBinContent(icentV0Qn,3); //x = Cos
910  QyanCor -= fHAvgerageQnV0A->GetBinContent(icentV0Qn,4); //y = Sin
911  QycnCor -= fHAvgerageQnV0C->GetBinContent(icentV0Qn,4); //y = Sin
912  }
913  //printf("\n .... I am using my own V0 gain correction for Psi3...\n");
914  }
915  else{
916  QxanCor = Qxan2; //2nd or higher
917  QxcnCor = Qxcn2;
918  QyanCor = Qyan2;
919  QycnCor = Qycn2;
920  if(fHAvgerageQnV0C && fHAvgerageQnV0A && icentV0Qn < 91){
921  QxanCor -= fHAvgerageQnV0A->GetBinContent(icentV0Qn,1); //x = Cos
922  QxcnCor -= fHAvgerageQnV0C->GetBinContent(icentV0Qn,1); //x = Cos
923  QyanCor -= fHAvgerageQnV0A->GetBinContent(icentV0Qn,2); //y = Sin
924  QycnCor -= fHAvgerageQnV0C->GetBinContent(icentV0Qn,2); //y = Sin
925  }
926  //printf("\n .... I am using my own V0 gain correction for Psi2...\n");
927  }
928  }
929 
930  //} else (other than 2015o_pass1 HI data)
931 
932 
933 
934  //Fill V0M Mult for all System: filled above
935  /*for(int iV0 = 0; iV0 < 64; iV0++) { //0-31 is V0C, 32-63 VOA
936  fMultv0 = fAODV0->GetMultiplicity(iV0);
937  fV0MultChVsRun->Fill(iV0+0.5,runindex,fMultv0);
938  }*/
939 
940 
941 
942 
943 
944  if(sumMa <= 0 || sumMc <= 0) return;
945  fHist_Event_count->Fill(stepCount); //5
946  stepCount++;
947 
948 
949  AliAODVertex *pVertex = aod->GetPrimaryVertex();
950  Double_t VtxZ = pVertex->GetZ();
951  Double_t VtxX = pVertex->GetX();
952  Double_t VtxY = pVertex->GetY();
953 
954  fVzDistribuion->Fill(VtxZ);
955 
956  if(sDataSet=="2015pPb" || sDataSet=="pPb"){
957 
958  if(VtxZ < 1.e-4 && VtxX < 1.e-4 && VtxY < 1.e-4)
959  return;
960 
961  fHistVtxZvsRun->Fill(runindex,VtxZ);
962  fHistVtxXvsRun->Fill(runindex,VtxX);
963  fHistVtxYvsRun->Fill(runindex,VtxY);
964  }
965 
966 
967  //------------- Load ZDC info: -----------
968  Double_t energyZNC=0.,energyZNA=0.,energyZPC=0.,energyZPA=0.;
969 
970  energyZNC = ((AliVAODHeader*)aod->GetHeader())->GetZDCN1Energy();
971  energyZNA = ((AliVAODHeader*)aod->GetHeader())->GetZDCN2Energy();
972  energyZPC = ((AliVAODHeader*)aod->GetHeader())->GetZDCP1Energy();
973  energyZPA = ((AliVAODHeader*)aod->GetHeader())->GetZDCP2Energy();
974 
975 
976  //Apply Gain Correction:
977  if(fHCorrectZDNP){
978  energyZNC = energyZNC * fHCorrectZDNP->GetBinContent((abs(EvtCent)+1),1);
979  energyZNA = energyZNA * fHCorrectZDNP->GetBinContent((abs(EvtCent)+1),2);
980  energyZPC = energyZPC * fHCorrectZDNP->GetBinContent((abs(EvtCent)+1),3);
981  energyZPA = energyZPA * fHCorrectZDNP->GetBinContent((abs(EvtCent)+1),4);
982  }
983 
984  //fill ZDC info: Uses
985  if(bFillZDCinfo){
986 
987  fHEnergyZNCvsCentRun->Fill(EvtCent,runindex,energyZNC);
988  fHEnergyZNAvsCentRun->Fill(EvtCent,runindex,energyZNA);
989  fHEnergyZPCvsCentRun->Fill(EvtCent,runindex,energyZPC);
990  fHEnergyZPAvsCentRun->Fill(EvtCent,runindex,energyZPA);
991 
992  //if(EvtCent>30. && EvtCent<40.){
993  //fHEnergyZPCvsZPA->Fill(energyZPC,energyZPA);
994  //fHEnergyZNCvsZNA->Fill(energyZNC,energyZNA);
995  //}
996  }
997 
998 
999 
1000 
1001 
1002  Int_t BadRuns[10] = {246871,246870,246867,246865,246864,246859,246858,246676,246675,246540};
1003  Int_t iBadrun = 10;
1004  Int_t isBadRun = 0;
1005 
1006  for(int ib=0;ib<iBadrun;ib++){
1007  if(runNumber==BadRuns[ib]){
1008  isBadRun = 1;
1009  break;
1010  }
1011  }
1012 
1013 
1014 
1015  //Store Qvector for tracks:
1016  Double_t QxPos[2] = {0.,}; //[0]=n*phi,[1]=2*n*phi
1017  Double_t QyPos[2] = {0.,};
1018  Double_t QxNeg[2] = {0.,};
1019  Double_t QyNeg[2] = {0.,};
1020 
1021  //Store Qvector for Auto-correlations
1022  Double_t QxAutoPos[2] = {0.,};
1023  Double_t QyAutoPos[2] = {0.,};
1024  Double_t QxAutoNeg[2] = {0.,};
1025  Double_t QyAutoNeg[2] = {0.,};
1026 
1027 
1028  //temp: for QA only
1029  Double_t QxPosQAEta[80] = {0.,};
1030  Double_t QyPosQAEta[80] = {0.,};
1031  Double_t QxNegQAEta[80] = {0.,};
1032  Double_t QyNegQAEta[80] = {0.,};
1033  Double_t QxAutoPosQAEta[80] = {0.,};
1034  Double_t QyAutoPosQAEta[80] = {0.,};
1035  Double_t QxAutoNegQAEta[80] = {0.,};
1036  Double_t QyAutoNegQAEta[80] = {0.,};
1037  Double_t MPOIposQAEta[80] = {0.,};
1038  Double_t MPOInegQAEta[80] = {0.,};
1039  Int_t iEtaQA = -1;
1040 
1041  Double_t AvgCos1n=0.,AvgSin1n=0.;
1042  //Double_t AvgCos2n=0.,AvgSin2n=0.;
1043  Double_t AvgDWCos2n=0.,AvgDWSin2n=0.;
1044 
1045 
1046  //Multiplicity of POIs:
1047  Double_t MPOIpos = 0;
1048  Double_t MPOIneg = 0;
1049  Double_t McorrPos = 0.;
1050  Double_t McorrNeg = 0.;
1051 
1052  //TPC Event plane Qvectors:
1053  Double_t QxTPC[3] = {0.,};
1054  Double_t QyTPC[3] = {0.,};
1055 
1056  Int_t ptBin;
1057  Int_t nRefMult = 0;
1058  Int_t n = fHarmonicN;
1059  Int_t m = fHarmonicM;
1060  Int_t p = (fHarmonicN+fHarmonicM); // cos(nphi1 + mphi2 - p*Psi_{2,3}) //not 4
1061 
1062  Double_t nRefMultWgt = 0.;
1063  Int_t skipPairHBT = 0;
1064 
1065 
1066 
1067 
1068  //Int_t iCentRec = 0; //centrality bin for track recenter
1069  //iCentRec = fHCentBinTrkRecenter->FindBin(EvtCent);
1070 
1071  //Int_t nBinVz=1,nBinPhi=1,nBinEta=1;
1072 
1073  //CME using Event plane:
1074  Double_t pi = TMath::Pi();
1075  Double_t Psi2V0C = 1./psiN*TMath::ATan2(QycnCor,QxcnCor);
1076  if(Psi2V0C<0.) Psi2V0C += 2*pi/psiN;
1077 
1078  Double_t Psi2V0A = 1./psiN*TMath::ATan2(QyanCor,QxanCor);
1079  if(Psi2V0A<0.) Psi2V0A += 2*pi/psiN;
1080 
1081 
1082  /*
1083  fV0AQ2xVsCentRun->Fill(centrCL1,runindex,QycnCor); // For V0-Q Recenter QA.
1084  fV0AQ2yVsCentRun->Fill(centrCL1,runindex,QyanCor);
1085  fV0CQ2xVsCentRun->Fill(centrCL1,runindex,QxcnCor);
1086  fV0CQ2yVsCentRun->Fill(centrCL1,runindex,QycnCor);*/
1087 
1088 
1089 
1090  Int_t iBinNUA = 1;
1091  Int_t iVzNUA = -1;
1092  iVzNUA = fVzBinFinderForNUA->FindBin(VtxZ) - 1;
1093 
1094 
1095 
1096  Int_t iTracks = fEvent->NumberOfTracks();
1097 
1098  Int_t icReject = 0;
1099 
1100 
1101  AliFlowTrackSimple* pTrack1 = NULL;
1102  AliFlowTrackSimple* pTrack2 = NULL;
1103 
1104  Double_t dPhi1,dPt1,dEta1,dChrg1;
1105  Double_t dPhi2,dPt2,dEta2,dChrg2;
1106  Double_t WgtEP = 1.0;
1107 
1108  Double_t ptw1 = 1.0, w1NUA = 1.0;
1109  Double_t ptw2 = 1.0;
1110  Double_t w2NUA = 1.0;
1111 
1112  //Femto:
1113  Double_t deltaPhi=0.,deltaEta=0.;
1114 
1115 
1116 
1117  for(int i=0; i<iTracks; i++) {
1118  pTrack1 = fEvent->GetTrack(i);
1119  if(!pTrack1) continue;
1120  dPhi1 = pTrack1->Phi(); //0-2pi range
1121  dPt1 = pTrack1-> Pt();
1122  dEta1 = pTrack1->Eta();
1123  dChrg1 = pTrack1->Charge();
1124 
1125  if(!pTrack1->InPOISelection())
1126  continue;
1127 
1128  //remove randomly -Ve tracks:
1129  //if(bRemNegTrkRndm && dChrg1<0 && fRand.Rndm()<0.15){
1130  //icReject++;
1131  //continue;
1132  //}
1133 
1134 
1135  if(bFillEtaPhiNUA){
1136  if(dChrg1>0){
1137  fHist3DEtaPhiVz_Pos_Run[cForNUA][runindex]->Fill(VtxZ,dPhi1,dEta1);
1138  }
1139  else if(dChrg1<0){
1140  fHist3DEtaPhiVz_Neg_Run[cForNUA][runindex]->Fill(VtxZ,dPhi1,dEta1);
1141  }
1142  }
1143  /*
1144  if(bFillEtaPhiNUA){
1145  if(dChrg1>0){
1146  fHist3DEtaPhiVz_Pos_Run[iVzNUA][runindex]->Fill(dPt1,dPhi1,dEta1);
1147  }
1148  else if(dChrg1<0){
1149  fHist3DEtaPhiVz_Neg_Run[iVzNUA][runindex]->Fill(dPt1,dPhi1,dEta1);
1150  }
1151  }*/
1152 
1153  if(bApplyNUACorr){
1154  //get NUA weights:
1155  if(sFileNUA=="New2018"){
1156  if(dChrg1>0){
1157  iBinNUA = fHCorrectNUApos[cForNUA]->FindBin(VtxZ,dPhi1,dEta1);
1158  w1NUA = fHCorrectNUApos[cForNUA]->GetBinContent(iBinNUA);
1159  }
1160  else if(dChrg1<0){
1161  iBinNUA = fHCorrectNUAneg[cForNUA]->FindBin(VtxZ,dPhi1,dEta1);
1162  w1NUA = fHCorrectNUAneg[cForNUA]->GetBinContent(iBinNUA);
1163  }
1164  }
1165  else if(sFileNUA=="OldJ"||sFileNUA=="NewR"){
1166  if(dChrg1>0){
1167  iBinNUA = fHCorrectNUApos[cInputNUA]->FindBin(VtxZ,dPhi1,dEta1);
1168  w1NUA = fHCorrectNUApos[cInputNUA]->GetBinContent(iBinNUA);
1169  }
1170  else if(dChrg1<0){
1171  iBinNUA = fHCorrectNUAneg[cInputNUA]->FindBin(VtxZ,dPhi1,dEta1);
1172  w1NUA = fHCorrectNUAneg[cInputNUA]->GetBinContent(iBinNUA);
1173  }
1174  if(sFileNUA=="OldJ") w1NUA = 1./w1NUA;
1175  }
1176  else if(sFileNUA=="NewPt"||sFileNUA=="NewpT"){
1177  if(dChrg1>0){
1178  iBinNUA = fHCorrectNUApos[iVzNUA]->FindBin(dPt1,dPhi1,dEta1);
1179  w1NUA = fHCorrectNUApos[iVzNUA]->GetBinContent(iBinNUA);
1180  }
1181  else if(dChrg1<0){
1182  iBinNUA = fHCorrectNUAneg[iVzNUA]->FindBin(dPt1,dPhi1,dEta1);
1183  w1NUA = fHCorrectNUAneg[iVzNUA]->GetBinContent(iBinNUA);
1184  }
1185  }
1186  if(w1NUA > 1e3 ) w1NUA = 1.0;
1187  }
1188 
1189 
1190 
1191  if(dChrg1>0){
1192  fHistChPosvsEtaPtRun[cIndex]->Fill(dPt1,dEta1,runindex,w1NUA);
1193  }
1194  else if(dChrg1<0){
1195  fHistChNegvsEtaPtRun[cIndex]->Fill(dPt1,dEta1,runindex,w1NUA);
1196  }
1197 
1198 
1199 
1200  if(sMCdimension=="1D"){
1201  ptBin = fFB_Efficiency_Cent[cIndex]->FindBin(dPt1);
1202  ptw1 = 1.0/fFB_Efficiency_Cent[cIndex]->GetBinContent(ptBin);
1203  }
1204  else if(sMCdimension=="3D"){
1205  if(dChrg1>0){
1206  ptBin = fFB_Efficiency_Pos[cIndex]->FindBin(dEta1,dPt1,dPhi1); //left here
1207  ptw1 = fFB_Efficiency_Pos[cIndex]->GetBinContent(ptBin);
1208  }
1209  else if(dChrg1<0){
1210  ptBin = fFB_Efficiency_Neg[cIndex]->FindBin(dEta1,dPt1,dPhi1); //left here
1211  ptw1 = fFB_Efficiency_Neg[cIndex]->GetBinContent(ptBin);
1212  }
1213  }
1214 
1215  if (ptw1>1e3) ptw1 = 1.0;
1216 
1217 
1218  //if(bFillAvgTPCQn) { //fill TPC Q-vect:
1219  if(VtxZ>0 && dEta1>=0){
1220  if(dChrg1>0){
1221  //fHCos1nPosChEtaVz[0]->Fill(EvtCent,runindex,ptw1*TMath::Cos(dPhi1));
1222  //fHSin1nPosChEtaVz[0]->Fill(EvtCent,runindex,ptw1*TMath::Sin(dPhi1));
1223  fHCos2nPosChEtaVz[0]->Fill(EvtCent,runindex,ptw1*TMath::Cos(2.*dPhi1));
1224  fHSin2nPosChEtaVz[0]->Fill(EvtCent,runindex,ptw1*TMath::Sin(2.*dPhi1));
1225  fHCos3nPosChEtaVz[0]->Fill(EvtCent,runindex,ptw1*TMath::Cos(3.*dPhi1));
1226  fHSin3nPosChEtaVz[0]->Fill(EvtCent,runindex,ptw1*TMath::Sin(3.*dPhi1));
1227  //fHCos4nPosChEtaVz[0]->Fill(EvtCent,runindex,ptw1*TMath::Cos(4.*dPhi1));
1228  //fHSin4nPosChEtaVz[0]->Fill(EvtCent,runindex,ptw1*TMath::Sin(4.*dPhi1));
1229  //fHCos2nDWPosChEtaVz[0]->Fill(EvtCent,runindex,ptw1*ptw1*TMath::Cos(2.*dPhi1));
1230  //fHSin2nDWPosChEtaVz[0]->Fill(EvtCent,runindex,ptw1*ptw1*TMath::Sin(2.*dPhi1));
1231  }
1232  else if(dChrg1<0){
1233  //fHCos1nNegChEtaVz[0]->Fill(EvtCent,runindex,ptw1*TMath::Cos(dPhi1));
1234  //fHSin1nNegChEtaVz[0]->Fill(EvtCent,runindex,ptw1*TMath::Sin(dPhi1));
1235  fHCos2nNegChEtaVz[0]->Fill(EvtCent,runindex,ptw1*TMath::Cos(2.*dPhi1));
1236  fHSin2nNegChEtaVz[0]->Fill(EvtCent,runindex,ptw1*TMath::Sin(2.*dPhi1));
1237  fHCos3nNegChEtaVz[0]->Fill(EvtCent,runindex,ptw1*TMath::Cos(3.*dPhi1));
1238  fHSin3nNegChEtaVz[0]->Fill(EvtCent,runindex,ptw1*TMath::Sin(3.*dPhi1));
1239  //fHCos4nNegChEtaVz[0]->Fill(EvtCent,runindex,ptw1*TMath::Cos(4.*dPhi1));
1240  //fHSin4nNegChEtaVz[0]->Fill(EvtCent,runindex,ptw1*TMath::Sin(4.*dPhi1));
1241  //fHCos2nDWNegChEtaVz[0]->Fill(EvtCent,runindex,ptw1*ptw1*TMath::Cos(2.*dPhi1));
1242  //fHSin2nDWNegChEtaVz[0]->Fill(EvtCent,runindex,ptw1*ptw1*TMath::Sin(2.*dPhi1));
1243  }
1244  }
1245  else if(VtxZ>0 && dEta1<0){
1246  if(dChrg1>0){
1247  //fHCos1nPosChEtaVz[1]->Fill(EvtCent,runindex,ptw1*TMath::Cos(dPhi1));
1248  //fHSin1nPosChEtaVz[1]->Fill(EvtCent,runindex,ptw1*TMath::Sin(dPhi1));
1249  fHCos2nPosChEtaVz[1]->Fill(EvtCent,runindex,ptw1*TMath::Cos(2.*dPhi1));
1250  fHSin2nPosChEtaVz[1]->Fill(EvtCent,runindex,ptw1*TMath::Sin(2.*dPhi1));
1251  fHCos3nPosChEtaVz[1]->Fill(EvtCent,runindex,ptw1*TMath::Cos(3.*dPhi1));
1252  fHSin3nPosChEtaVz[1]->Fill(EvtCent,runindex,ptw1*TMath::Sin(3.*dPhi1));
1253  //fHCos4nPosChEtaVz[1]->Fill(EvtCent,runindex,ptw1*TMath::Cos(4.*dPhi1));
1254  //fHSin4nPosChEtaVz[1]->Fill(EvtCent,runindex,ptw1*TMath::Sin(4.*dPhi1));
1255  //fHCos2nDWPosChEtaVz[1]->Fill(EvtCent,runindex,ptw1*ptw1*TMath::Cos(2.*dPhi1));
1256  //fHSin2nDWPosChEtaVz[1]->Fill(EvtCent,runindex,ptw1*ptw1*TMath::Sin(2.*dPhi1));
1257  }
1258  else if(dChrg1<0){
1259  // fHCos1nNegChEtaVz[1]->Fill(EvtCent,runindex,ptw1*TMath::Cos(dPhi1));
1260  // fHSin1nNegChEtaVz[1]->Fill(EvtCent,runindex,ptw1*TMath::Sin(dPhi1));
1261  fHCos2nNegChEtaVz[1]->Fill(EvtCent,runindex,ptw1*TMath::Cos(2.*dPhi1));
1262  fHSin2nNegChEtaVz[1]->Fill(EvtCent,runindex,ptw1*TMath::Sin(2.*dPhi1));
1263  fHCos3nNegChEtaVz[1]->Fill(EvtCent,runindex,ptw1*TMath::Cos(3.*dPhi1));
1264  fHSin3nNegChEtaVz[1]->Fill(EvtCent,runindex,ptw1*TMath::Sin(3.*dPhi1));
1265  // fHCos4nNegChEtaVz[1]->Fill(EvtCent,runindex,ptw1*TMath::Cos(4.*dPhi1));
1266  // fHSin4nNegChEtaVz[1]->Fill(EvtCent,runindex,ptw1*TMath::Sin(4.*dPhi1));
1267  // fHCos2nDWNegChEtaVz[1]->Fill(EvtCent,runindex,ptw1*ptw1*TMath::Cos(2.*dPhi1));
1268  // fHSin2nDWNegChEtaVz[1]->Fill(EvtCent,runindex,ptw1*ptw1*TMath::Sin(2.*dPhi1));
1269  }
1270  }
1271  else if(VtxZ<0 && dEta1>=0){
1272  if(dChrg1>0){
1273  // fHCos1nPosChEtaVz[2]->Fill(EvtCent,runindex,ptw1*TMath::Cos(dPhi1));
1274  // fHSin1nPosChEtaVz[2]->Fill(EvtCent,runindex,ptw1*TMath::Sin(dPhi1));
1275  fHCos2nPosChEtaVz[2]->Fill(EvtCent,runindex,ptw1*TMath::Cos(2.*dPhi1));
1276  fHSin2nPosChEtaVz[2]->Fill(EvtCent,runindex,ptw1*TMath::Sin(2.*dPhi1));
1277  fHCos3nPosChEtaVz[2]->Fill(EvtCent,runindex,ptw1*TMath::Cos(3.*dPhi1));
1278  fHSin3nPosChEtaVz[2]->Fill(EvtCent,runindex,ptw1*TMath::Sin(3.*dPhi1));
1279  // fHCos4nPosChEtaVz[2]->Fill(EvtCent,runindex,ptw1*TMath::Cos(4.*dPhi1));
1280  // fHSin4nPosChEtaVz[2]->Fill(EvtCent,runindex,ptw1*TMath::Sin(4.*dPhi1));
1281  // fHCos2nDWPosChEtaVz[2]->Fill(EvtCent,runindex,ptw1*ptw1*TMath::Cos(2.*dPhi1));
1282  // fHSin2nDWPosChEtaVz[2]->Fill(EvtCent,runindex,ptw1*ptw1*TMath::Sin(2.*dPhi1));
1283  }
1284  else if(dChrg1<0){
1285  // fHCos1nNegChEtaVz[2]->Fill(EvtCent,runindex,ptw1*TMath::Cos(dPhi1));
1286  // fHSin1nNegChEtaVz[2]->Fill(EvtCent,runindex,ptw1*TMath::Sin(dPhi1));
1287  fHCos2nNegChEtaVz[2]->Fill(EvtCent,runindex,ptw1*TMath::Cos(2.*dPhi1));
1288  fHSin2nNegChEtaVz[2]->Fill(EvtCent,runindex,ptw1*TMath::Sin(2.*dPhi1));
1289  fHCos3nNegChEtaVz[2]->Fill(EvtCent,runindex,ptw1*TMath::Cos(3.*dPhi1));
1290  fHSin3nNegChEtaVz[2]->Fill(EvtCent,runindex,ptw1*TMath::Sin(3.*dPhi1));
1291  // fHCos4nNegChEtaVz[2]->Fill(EvtCent,runindex,ptw1*TMath::Cos(4.*dPhi1));
1292  // fHSin4nNegChEtaVz[2]->Fill(EvtCent,runindex,ptw1*TMath::Sin(4.*dPhi1));
1293  // fHCos2nDWNegChEtaVz[2]->Fill(EvtCent,runindex,ptw1*ptw1*TMath::Cos(2.*dPhi1));
1294  // fHSin2nDWNegChEtaVz[2]->Fill(EvtCent,runindex,ptw1*ptw1*TMath::Sin(2.*dPhi1));
1295  }
1296 
1297  }
1298  else if(VtxZ<0 && dEta1<0){
1299  if(dChrg1>0){
1300  // fHCos1nPosChEtaVz[3]->Fill(EvtCent,runindex,ptw1*TMath::Cos(dPhi1));
1301  // fHSin1nPosChEtaVz[3]->Fill(EvtCent,runindex,ptw1*TMath::Sin(dPhi1));
1302  fHCos2nPosChEtaVz[3]->Fill(EvtCent,runindex,ptw1*TMath::Cos(2.*dPhi1));
1303  fHSin2nPosChEtaVz[3]->Fill(EvtCent,runindex,ptw1*TMath::Sin(2.*dPhi1));
1304  fHCos3nPosChEtaVz[3]->Fill(EvtCent,runindex,ptw1*TMath::Cos(3.*dPhi1));
1305  fHSin3nPosChEtaVz[3]->Fill(EvtCent,runindex,ptw1*TMath::Sin(3.*dPhi1));
1306  // fHCos4nPosChEtaVz[3]->Fill(EvtCent,runindex,ptw1*TMath::Cos(4.*dPhi1));
1307  // fHSin4nPosChEtaVz[3]->Fill(EvtCent,runindex,ptw1*TMath::Sin(4.*dPhi1));
1308  // fHCos2nDWPosChEtaVz[3]->Fill(EvtCent,runindex,ptw1*ptw1*TMath::Cos(2.*dPhi1));
1309  // fHSin2nDWPosChEtaVz[3]->Fill(EvtCent,runindex,ptw1*ptw1*TMath::Sin(2.*dPhi1));
1310  }
1311  else if(dChrg1<0){
1312  // fHCos1nNegChEtaVz[3]->Fill(EvtCent,runindex,ptw1*TMath::Cos(dPhi1));
1313  // fHSin1nNegChEtaVz[3]->Fill(EvtCent,runindex,ptw1*TMath::Sin(dPhi1));
1314  fHCos2nNegChEtaVz[3]->Fill(EvtCent,runindex,ptw1*TMath::Cos(2.*dPhi1));
1315  fHSin2nNegChEtaVz[3]->Fill(EvtCent,runindex,ptw1*TMath::Sin(2.*dPhi1));
1316  fHCos3nNegChEtaVz[3]->Fill(EvtCent,runindex,ptw1*TMath::Cos(3.*dPhi1));
1317  fHSin3nNegChEtaVz[3]->Fill(EvtCent,runindex,ptw1*TMath::Sin(3.*dPhi1));
1318  // fHCos4nNegChEtaVz[3]->Fill(EvtCent,runindex,ptw1*TMath::Cos(4.*dPhi1));
1319  // fHSin4nNegChEtaVz[3]->Fill(EvtCent,runindex,ptw1*TMath::Sin(4.*dPhi1));
1320  // fHCos2nDWNegChEtaVz[3]->Fill(EvtCent,runindex,ptw1*ptw1*TMath::Cos(2.*dPhi1));
1321  // fHSin2nDWNegChEtaVz[3]->Fill(EvtCent,runindex,ptw1*ptw1*TMath::Sin(2.*dPhi1));
1322  }
1323  }
1324  //} //if(fillFlag==kTRUE)
1325 
1326 
1327 
1328 
1329 
1330 
1331  iEtaQA = fEtaBinFinderForQA->FindBin(dEta1) - 1;
1332 
1333  if(dChrg1>0){
1334  QxPos[0] += (ptw1*w1NUA*TMath::Cos(n*dPhi1) - AvgCos1n);
1335  QyPos[0] += (ptw1*w1NUA*TMath::Sin(n*dPhi1) - AvgSin1n);
1336  QxAutoPos[0] += (ptw1*ptw1*w1NUA*w1NUA*TMath::Cos(2.*n*dPhi1) - AvgDWCos2n);
1337  QyAutoPos[0] += (ptw1*ptw1*w1NUA*w1NUA*TMath::Sin(2.*n*dPhi1) - AvgDWSin2n);
1338  MPOIpos += w1NUA*ptw1;
1339  McorrPos += w1NUA*ptw1*w1NUA*ptw1;
1340  //QA: eta dependence
1341  if(EvtCent>=10 && EvtCent<20){
1342  QxPosQAEta[iEtaQA] += (ptw1*w1NUA*TMath::Cos(n*dPhi1) - AvgCos1n);
1343  QyPosQAEta[iEtaQA] += (ptw1*w1NUA*TMath::Sin(n*dPhi1) - AvgSin1n);
1344  QxAutoPosQAEta[iEtaQA] += (ptw1*ptw1*w1NUA*w1NUA*TMath::Cos(2.*n*dPhi1) - AvgDWCos2n);
1345  QyAutoPosQAEta[iEtaQA] += (ptw1*ptw1*w1NUA*w1NUA*TMath::Sin(2.*n*dPhi1) - AvgDWSin2n);
1346  MPOIposQAEta[iEtaQA] += ptw1*w1NUA;
1347  }
1348  }
1349  else if(dChrg1<0){
1350  QxNeg[0] += (ptw1*w1NUA*TMath::Cos(n*dPhi1) - AvgCos1n);
1351  QyNeg[0] += (ptw1*w1NUA*TMath::Sin(n*dPhi1) - AvgSin1n);
1352  QxAutoNeg[0] += (ptw1*ptw1*w1NUA*w1NUA*TMath::Cos(2.*n*dPhi1) - AvgDWCos2n);
1353  QyAutoNeg[0] += (ptw1*ptw1*w1NUA*w1NUA*TMath::Sin(2.*n*dPhi1) - AvgDWSin2n);
1354  MPOIneg += w1NUA*ptw1;
1355  McorrNeg += w1NUA*ptw1*w1NUA*ptw1;
1356  //QA: eta dependence
1357  if(EvtCent>=10 && EvtCent<20){
1358  QxNegQAEta[iEtaQA] += (ptw1*w1NUA*TMath::Cos(n*dPhi1) - AvgCos1n);
1359  QyNegQAEta[iEtaQA] += (ptw1*w1NUA*TMath::Sin(n*dPhi1) - AvgSin1n);
1360  QxAutoNegQAEta[iEtaQA] += (ptw1*ptw1*w1NUA*w1NUA*TMath::Cos(2.*n*dPhi1) - AvgDWCos2n);
1361  QyAutoNegQAEta[iEtaQA] += (ptw1*ptw1*w1NUA*w1NUA*TMath::Sin(2.*n*dPhi1) - AvgDWSin2n);
1362  MPOInegQAEta[iEtaQA] += ptw1*w1NUA;
1363  }
1364  }
1365 
1366  //QxTPC[0] += ptw1*w1NUA*TMath::Cos(n*dPhi1);
1367  //QyTPC[0] += ptw1*w1NUA*TMath::Sin(n*dPhi1);
1368  QxTPC[1] += ptw1*w1NUA*TMath::Cos(2*dPhi1);
1369  QyTPC[1] += ptw1*w1NUA*TMath::Sin(2*dPhi1);
1370 
1371  QxTPC[2] += ptw1*w1NUA*TMath::Cos(3*dPhi1);
1372  QyTPC[2] += ptw1*w1NUA*TMath::Sin(3*dPhi1);
1373 
1374  nRefMult++;
1375  nRefMultWgt += ptw1*w1NUA;
1376 
1377 
1378  //if(i%10==0)
1379  //cout<<" track "<<i<<" eta = "<<dEta1<<"\tdPhi1 = "<<dPhi1<<"\tptw1 = "<<ptw1<<"\tw1NUA = "<<w1NUA<<"\tAvgCos1n = "<<AvgCos1n<<endl;
1380 
1381  if(bSkipNestedTrk) continue;
1382 
1383  //2nd track loop:
1384  for(int j=0; j<iTracks; j++) {
1385 
1386  if(j==i) continue; //Auto-correlation removed.
1387 
1388  pTrack2 = fEvent->GetTrack(j);
1389  if(!pTrack2) continue;
1390  dPhi2 = pTrack2->Phi(); //0-2pi range
1391  dPt2 = pTrack2-> Pt();
1392  dEta2 = pTrack2->Eta();
1393  dChrg2 = pTrack2->Charge();
1394 
1395  if(!pTrack2->InPOISelection())
1396  continue;
1397 
1398  //remove randomly -Ve tracks:
1399  //if(bRemNegTrkRndm && dChrg1<0 && fRand.Rndm()<0.15){
1400  //continue;
1401  //}
1402 
1403 
1404  if(sMCdimension=="1D"){
1405  ptBin = fFB_Efficiency_Cent[cIndex]->FindBin(dPt2);
1406  ptw2 = 1.0/fFB_Efficiency_Cent[cIndex]->GetBinContent(ptBin);
1407  }
1408  else if(sMCdimension=="3D"){
1409  if(dChrg2>0){
1410  ptBin = fFB_Efficiency_Pos[cIndex]->FindBin(dEta2,dPt2,dPhi2); //left here
1411  ptw2 = fFB_Efficiency_Pos[cIndex]->GetBinContent(ptBin);
1412  }
1413  else if(dChrg2<0){
1414  ptBin = fFB_Efficiency_Neg[cIndex]->FindBin(dEta2,dPt2,dPhi2); //left here
1415  ptw2 = fFB_Efficiency_Neg[cIndex]->GetBinContent(ptBin);
1416  }
1417  }
1418 
1419  if (ptw2>1e3) ptw1 = 1.0;
1420 
1421 
1422  if(bApplyNUACorr) {
1423  //get NUA weights:
1424  if(sFileNUA=="New2018"){
1425  if(dChrg2>0){
1426  iBinNUA = fHCorrectNUApos[cForNUA]->FindBin(VtxZ,dPhi1,dEta1);
1427  w1NUA = fHCorrectNUApos[cForNUA]->GetBinContent(iBinNUA);
1428  }
1429  else if(dChrg2<0){
1430  iBinNUA = fHCorrectNUAneg[cForNUA]->FindBin(VtxZ,dPhi1,dEta1);
1431  w1NUA = fHCorrectNUAneg[cForNUA]->GetBinContent(iBinNUA);
1432  }
1433  }
1434  else if(sFileNUA=="OldJ"||sFileNUA=="NewR"){
1435  if(dChrg2>0){
1436  iBinNUA = fHCorrectNUApos[cInputNUA]->FindBin(VtxZ,dPhi2,dEta2);
1437  w2NUA = fHCorrectNUApos[cInputNUA]->GetBinContent(iBinNUA);
1438  }
1439  else if(dChrg2<0){
1440  iBinNUA = fHCorrectNUAneg[cInputNUA]->FindBin(VtxZ,dPhi2,dEta2);
1441  w2NUA = fHCorrectNUAneg[cInputNUA]->GetBinContent(iBinNUA);
1442  }
1443  if(sFileNUA=="OldJ") w2NUA = 1./w2NUA;
1444  }
1445  else if(sFileNUA=="NewPt"||sFileNUA=="NewpT"){
1446  if(dChrg2>0){
1447  iBinNUA = fHCorrectNUApos[iVzNUA]->FindBin(dPt2,dPhi2,dEta2);
1448  w2NUA = fHCorrectNUApos[iVzNUA]->GetBinContent(iBinNUA);
1449  }
1450  else if(dChrg2<0){
1451  iBinNUA = fHCorrectNUAneg[iVzNUA]->FindBin(dPt2,dPhi2,dEta2);
1452  w2NUA = fHCorrectNUAneg[iVzNUA]->GetBinContent(iBinNUA);
1453  }
1454  }
1455  if(w2NUA > 1e3 ) w2NUA = 1.0;
1456  }
1457  if(bApplyNUAforEP){
1458  WgtEP = ptw1*ptw2*w1NUA*w2NUA;
1459  }
1460  else{
1461  WgtEP = 1.0;
1462  }
1463 
1464 
1465  //------------- test ------ before femto cuts:
1466  if(dChrg1!=dChrg2){
1467  fHist_Corr3p_SP_Norm_PN[QAindex][0]->Fill(EvtCent, TMath::Cos(n*dPhi1 + m*dPhi2 - p*Psi2V0A),WgtEP);
1468  fHist_Corr3p_SP_Norm_PN[QAindex][1]->Fill(EvtCent, TMath::Cos(n*dPhi1 + m*dPhi2 - p*Psi2V0C),WgtEP);
1469  }
1470  else if(dChrg1>0 && dChrg2>0){
1471  fHist_Corr3p_SP_Norm_PP[QAindex][0]->Fill(EvtCent, TMath::Cos(n*dPhi1 + m*dPhi2 - p*Psi2V0A),WgtEP);
1472  fHist_Corr3p_SP_Norm_PP[QAindex][1]->Fill(EvtCent, TMath::Cos(n*dPhi1 + m*dPhi2 - p*Psi2V0C),WgtEP);
1473  }
1474  else if(dChrg1<0 && dChrg2<0){
1475  fHist_Corr3p_SP_Norm_NN[QAindex][0]->Fill(EvtCent, TMath::Cos(n*dPhi1 + m*dPhi2 - p*Psi2V0A),WgtEP);
1476  fHist_Corr3p_SP_Norm_NN[QAindex][1]->Fill(EvtCent, TMath::Cos(n*dPhi1 + m*dPhi2 - p*Psi2V0C),WgtEP);
1477  }
1478 
1479  if(dChrg1==dChrg2) {
1480  fdPhiFemtoCut->Fill(2.5,1e-8);
1481  }
1482  else{
1483  fdPhiFemtoCut->Fill(0.5,1e-8);
1484  }
1485 
1486 
1487  //---------- Femto Cuts ----------
1488  deltaEta = dEta1 - dEta2;
1489  deltaPhi = dPhi1 - dPhi2;
1490  skipPairHBT = 0;
1491 
1492  if(TMath::Abs(deltaEta) < fHBTCutValue * 2.5 * 3) //fHBTCutValue = 0.02 [default for dphicorrelations]
1493  {
1494  Float_t phi1rad = dPhi1; // phi in rad
1495  Float_t phi2rad = dPhi2;
1496 
1497  // check first boundaries to see if is worth to loop and find the minimum
1498  Float_t dphistar1 = GetDPhiStar(phi1rad, dPt1, dChrg1, phi2rad, dPt2, dChrg2, 0.8, bSign);
1499  Float_t dphistar2 = GetDPhiStar(phi1rad, dPt1, dChrg1, phi2rad, dPt2, dChrg2, 2.5, bSign);
1500 
1501  const Float_t kLimit = fHBTCutValue * 3;
1502 
1503  Float_t dphistarminabs = 1e5;
1504  Float_t dphistarmin = 1e5;
1505 
1506  if(TMath::Abs(dphistar1) < kLimit || TMath::Abs(dphistar2) < kLimit || dphistar1 * dphistar2 < 0 ) {
1507 
1508  for(Double_t rad=0.8; rad<2.51; rad+=0.01) {
1509  Float_t dphistar = GetDPhiStar(phi1rad, dPt1, dChrg1, phi2rad, dPt2, dChrg2, rad, bSign);
1510  Float_t dphistarabs = TMath::Abs(dphistar);
1511 
1512  if(dphistarabs < dphistarminabs) {
1513  dphistarmin = dphistar;
1514  dphistarminabs = dphistarabs;
1515  }
1516  }
1517  //Float_t dPtDiff = fabs(dPt1-dPt2);
1518  if(dphistarminabs < fHBTCutValue && TMath::Abs(deltaEta) < fHBTCutValue) {
1519  //cout<<"dEta "<<deltaEta<<" dphi "<<deltaPhi<<" ch1 = "<<dChrg1<<" ch2 = "<<dChrg2<<" fHBTCutValue = "<<fHBTCutValue<<endl;
1520  if(dChrg1==dChrg2) {
1521  fdPhiFemtoCut->Fill(3.5,1e-8);
1522  }
1523  else{
1524  fdPhiFemtoCut->Fill(1.5,1e-8);
1525  }
1526  skipPairHBT = 1;
1527  //continue;
1528  }
1529  }
1530  }
1531 
1532  //---------------- Femto Cuts done --------------------
1533 
1534 
1535 
1536 
1537 
1538 
1539 
1540 
1541 
1542 
1543 
1544 
1545  if(dChrg1!=dChrg2) {
1546  //if(skipPairHBT > 0)
1547  //cout<<"All dEta "<<deltaEta<<" dphi "<<deltaPhi<<" ch1 = "<<dChrg1<<" ch2 = "<<dChrg2<<" skipPairHBT = "<<skipPairHBT<<endl;
1548 
1549  fdPhiFemtoCut->Fill(1.5,1e-8);
1550 
1551  fHist_Corr3p_EP_Norm_PN[QAindex][0]->Fill(EvtCent, TMath::Cos(n*dPhi1 + m*dPhi2 - p*Psi2V0A),WgtEP);
1552  fHist_Corr3p_EP_Norm_PN[QAindex][1]->Fill(EvtCent, TMath::Cos(n*dPhi1 + m*dPhi2 - p*Psi2V0C),WgtEP);
1553  //vs Refmult:
1554  fHist_Corr3p_EP_Refm_PN[QAindex][0]->Fill(fRefMultCorr, TMath::Cos(n*dPhi1 + m*dPhi2 - p*Psi2V0A),WgtEP);
1555  fHist_Corr3p_EP_Refm_PN[QAindex][1]->Fill(fRefMultCorr, TMath::Cos(n*dPhi1 + m*dPhi2 - p*Psi2V0C),WgtEP);
1556 
1557  if(EvtCent>=10. && EvtCent<20){
1558  fCent3pvsVzRun->Fill(VtxZ,runindex,TMath::Cos(n*dPhi1 + m*dPhi2 - p*Psi2V0A));
1559  }
1560 
1561  //fHist_Corr3p_vsRun_EP_PN[0]->Fill(EvtCent, runindex, TMath::Cos(n*dPhi1 + m*dPhi2 - p*Psi2V0A),WgtEP);
1562  //fHist_Corr3p_vsRun_EP_PN[1]->Fill(EvtCent, runindex, TMath::Cos(n*dPhi1 + m*dPhi2 - p*Psi2V0C),WgtEP);
1563 
1564  fHist_Corr2p_EP_Norm_PN[QAindex]->Fill(EvtCent,0.5,TMath::Cos((dPhi1 - dPhi2)),WgtEP);
1565  fHist_Corr2p_EP_Norm_PN[QAindex]->Fill(EvtCent,1.5,TMath::Cos(2.*(dPhi1 - dPhi2)),WgtEP);
1566  fHist_Corr2p_EP_Norm_PN[QAindex]->Fill(EvtCent,2.5,TMath::Cos(3.*(dPhi1 - dPhi2)),WgtEP);
1567  fHist_Corr2p_EP_Norm_PN[QAindex]->Fill(EvtCent,3.5,TMath::Cos(4.*(dPhi1 - dPhi2)),WgtEP);
1568 
1569  //2p Vs Refmult:
1570  fHist_Corr2p_EP_Refm_PN[QAindex]->Fill(fRefMultCorr,0.5,TMath::Cos((dPhi1 - dPhi2)),WgtEP);
1571  fHist_Corr2p_EP_Refm_PN[QAindex]->Fill(fRefMultCorr,1.5,TMath::Cos(2.*(dPhi1 - dPhi2)),WgtEP);
1572  fHist_Corr2p_EP_Refm_PN[QAindex]->Fill(fRefMultCorr,2.5,TMath::Cos(3.*(dPhi1 - dPhi2)),WgtEP);
1573  fHist_Corr2p_EP_Refm_PN[QAindex]->Fill(fRefMultCorr,3.5,TMath::Cos(4.*(dPhi1 - dPhi2)),WgtEP);
1574 
1575 
1576 
1577 
1578  if(cIndex<6){
1579  fHist_Corr3p_pTSum_EP_V0A_PN[QAindex][cIndex]->Fill((dPt1+dPt2)*0.5, TMath::Cos(n*dPhi1 + m*dPhi2 - p*Psi2V0A),WgtEP);
1580  fHist_Corr3p_pTSum_EP_V0C_PN[QAindex][cIndex]->Fill((dPt1+dPt2)*0.5, TMath::Cos(n*dPhi1 + m*dPhi2 - p*Psi2V0C),WgtEP);
1581  fHist_Corr3p_pTDiff_EP_V0A_PN[QAindex][cIndex]->Fill(TMath::Abs(dPt1-dPt2), TMath::Cos(n*dPhi1 + m*dPhi2 - p*Psi2V0A),WgtEP);
1582  fHist_Corr3p_pTDiff_EP_V0C_PN[QAindex][cIndex]->Fill(TMath::Abs(dPt1-dPt2), TMath::Cos(n*dPhi1 + m*dPhi2 - p*Psi2V0C),WgtEP);
1583  fHist_Corr3p_EtaDiff_EP_V0A_PN[QAindex][cIndex]->Fill(TMath::Abs(dEta1-dEta2), TMath::Cos(n*dPhi1 + m*dPhi2 - p*Psi2V0A),WgtEP);
1584  fHist_Corr3p_EtaDiff_EP_V0C_PN[QAindex][cIndex]->Fill(TMath::Abs(dEta1-dEta2), TMath::Cos(n*dPhi1 + m*dPhi2 - p*Psi2V0C),WgtEP);
1585  }
1586  }
1587  else if(dChrg1>0 && dChrg2>0 && skipPairHBT==0) {
1588 
1589  //if(deltaEta < fHBTCutValue)
1590  //cout<<"++ dEta "<<deltaEta<<" dphi "<<deltaPhi<<" ch1 = "<<dChrg1<<" ch2 = "<<dChrg2<<" skipPairHBT = "<<skipPairHBT<<endl;
1591 
1592  fdPhiFemtoCut->Fill(3.5,1e-8);
1593 
1594  fHist_Corr3p_EP_Norm_PP[QAindex][0]->Fill(EvtCent, TMath::Cos(n*dPhi1 + m*dPhi2 - p*Psi2V0A),WgtEP);
1595  fHist_Corr3p_EP_Norm_PP[QAindex][1]->Fill(EvtCent, TMath::Cos(n*dPhi1 + m*dPhi2 - p*Psi2V0C),WgtEP);
1596  //vs Refmult:
1597  fHist_Corr3p_EP_Refm_PP[QAindex][0]->Fill(fRefMultCorr, TMath::Cos(n*dPhi1 + m*dPhi2 - p*Psi2V0A),WgtEP);
1598  fHist_Corr3p_EP_Refm_PP[QAindex][1]->Fill(fRefMultCorr, TMath::Cos(n*dPhi1 + m*dPhi2 - p*Psi2V0C),WgtEP);
1599 
1600  //fHist_Corr3p_vsRun_EP_PP[0]->Fill(EvtCent, runindex, TMath::Cos(n*dPhi1 + m*dPhi2 - p*Psi2V0A),WgtEP);
1601  //fHist_Corr3p_vsRun_EP_PP[1]->Fill(EvtCent, runindex, TMath::Cos(n*dPhi1 + m*dPhi2 - p*Psi2V0C),WgtEP);
1602 
1603  fHist_Corr2p_EP_Norm_PP[QAindex]->Fill(EvtCent,0.5,TMath::Cos((dPhi1 - dPhi2)),WgtEP);
1604  fHist_Corr2p_EP_Norm_PP[QAindex]->Fill(EvtCent,1.5,TMath::Cos(2.*(dPhi1 - dPhi2)),WgtEP);
1605  fHist_Corr2p_EP_Norm_PP[QAindex]->Fill(EvtCent,2.5,TMath::Cos(3.*(dPhi1 - dPhi2)),WgtEP);
1606  fHist_Corr2p_EP_Norm_PP[QAindex]->Fill(EvtCent,3.5,TMath::Cos(4.*(dPhi1 - dPhi2)),WgtEP);
1607 
1608  //2p Vs Refmult:
1609  fHist_Corr2p_EP_Refm_PP[QAindex]->Fill(fRefMultCorr,0.5,TMath::Cos((dPhi1 - dPhi2)),WgtEP);
1610  fHist_Corr2p_EP_Refm_PP[QAindex]->Fill(fRefMultCorr,1.5,TMath::Cos(2.*(dPhi1 - dPhi2)),WgtEP);
1611  fHist_Corr2p_EP_Refm_PP[QAindex]->Fill(fRefMultCorr,2.5,TMath::Cos(3.*(dPhi1 - dPhi2)),WgtEP);
1612  fHist_Corr2p_EP_Refm_PP[QAindex]->Fill(fRefMultCorr,3.5,TMath::Cos(4.*(dPhi1 - dPhi2)),WgtEP);
1613 
1614 
1615 
1616  if(cIndex<6){
1617  fHist_Corr3p_pTSum_EP_V0A_PP[QAindex][cIndex]->Fill((dPt1+dPt2)*0.5, TMath::Cos(n*dPhi1 + m*dPhi2 - p*Psi2V0A),WgtEP);
1618  fHist_Corr3p_pTSum_EP_V0C_PP[QAindex][cIndex]->Fill((dPt1+dPt2)*0.5, TMath::Cos(n*dPhi1 + m*dPhi2 - p*Psi2V0C),WgtEP);
1619  fHist_Corr3p_pTDiff_EP_V0A_PP[QAindex][cIndex]->Fill(TMath::Abs(dPt1-dPt2), TMath::Cos(n*dPhi1 + m*dPhi2 - p*Psi2V0A),WgtEP);
1620  fHist_Corr3p_pTDiff_EP_V0C_PP[QAindex][cIndex]->Fill(TMath::Abs(dPt1-dPt2), TMath::Cos(n*dPhi1 + m*dPhi2 - p*Psi2V0C),WgtEP);
1621  fHist_Corr3p_EtaDiff_EP_V0A_PP[QAindex][cIndex]->Fill(TMath::Abs(dEta1-dEta2), TMath::Cos(n*dPhi1 + m*dPhi2 - p*Psi2V0A),WgtEP);
1622  fHist_Corr3p_EtaDiff_EP_V0C_PP[QAindex][cIndex]->Fill(TMath::Abs(dEta1-dEta2), TMath::Cos(n*dPhi1 + m*dPhi2 - p*Psi2V0C),WgtEP);
1623  }
1624  }
1625  else if(dChrg1<0 && dChrg2<0 && skipPairHBT==0){
1626 
1627  fdPhiFemtoCut->Fill(3.5,1e-8);
1628 
1629  fHist_Corr3p_EP_Norm_NN[QAindex][0]->Fill(EvtCent, TMath::Cos(n*dPhi1 + m*dPhi2 - p*Psi2V0A),WgtEP);
1630  fHist_Corr3p_EP_Norm_NN[QAindex][1]->Fill(EvtCent, TMath::Cos(n*dPhi1 + m*dPhi2 - p*Psi2V0C),WgtEP);
1631  //vs Refmult:
1632  fHist_Corr3p_EP_Refm_NN[QAindex][0]->Fill(fRefMultCorr, TMath::Cos(n*dPhi1 + m*dPhi2 - p*Psi2V0A),WgtEP);
1633  fHist_Corr3p_EP_Refm_NN[QAindex][1]->Fill(fRefMultCorr, TMath::Cos(n*dPhi1 + m*dPhi2 - p*Psi2V0C),WgtEP);
1634 
1635  //fHist_Corr3p_vsRun_EP_NN[0]->Fill(EvtCent, runindex, TMath::Cos(n*dPhi1 + m*dPhi2 - p*Psi2V0A),WgtEP);
1636  //fHist_Corr3p_vsRun_EP_NN[1]->Fill(EvtCent, runindex, TMath::Cos(n*dPhi1 + m*dPhi2 - p*Psi2V0C),WgtEP);
1637 
1638  fHist_Corr2p_EP_Norm_NN[QAindex]->Fill(EvtCent,0.5,TMath::Cos((dPhi1 - dPhi2)),WgtEP);
1639  fHist_Corr2p_EP_Norm_NN[QAindex]->Fill(EvtCent,1.5,TMath::Cos(2.*(dPhi1 - dPhi2)),WgtEP);
1640  fHist_Corr2p_EP_Norm_NN[QAindex]->Fill(EvtCent,2.5,TMath::Cos(3.*(dPhi1 - dPhi2)),WgtEP);
1641  fHist_Corr2p_EP_Norm_NN[QAindex]->Fill(EvtCent,3.5,TMath::Cos(4.*(dPhi1 - dPhi2)),WgtEP);
1642  //2p Vs Refmult:
1643  fHist_Corr2p_EP_Refm_NN[QAindex]->Fill(fRefMultCorr,0.5,TMath::Cos((dPhi1 - dPhi2)),WgtEP);
1644  fHist_Corr2p_EP_Refm_NN[QAindex]->Fill(fRefMultCorr,1.5,TMath::Cos(2.*(dPhi1 - dPhi2)),WgtEP);
1645  fHist_Corr2p_EP_Refm_NN[QAindex]->Fill(fRefMultCorr,2.5,TMath::Cos(3.*(dPhi1 - dPhi2)),WgtEP);
1646  fHist_Corr2p_EP_Refm_NN[QAindex]->Fill(fRefMultCorr,3.5,TMath::Cos(4.*(dPhi1 - dPhi2)),WgtEP);
1647 
1648 
1649  if(cIndex<6){
1650  fHist_Corr3p_pTSum_EP_V0A_NN[QAindex][cIndex]->Fill((dPt1+dPt2)*0.5, TMath::Cos(n*dPhi1 + m*dPhi2 - p*Psi2V0A),WgtEP);
1651  fHist_Corr3p_pTSum_EP_V0C_NN[QAindex][cIndex]->Fill((dPt1+dPt2)*0.5, TMath::Cos(n*dPhi1 + m*dPhi2 - p*Psi2V0C),WgtEP);
1652  fHist_Corr3p_pTDiff_EP_V0A_NN[QAindex][cIndex]->Fill(TMath::Abs(dPt1-dPt2), TMath::Cos(n*dPhi1 + m*dPhi2 - p*Psi2V0A),WgtEP);
1653  fHist_Corr3p_pTDiff_EP_V0C_NN[QAindex][cIndex]->Fill(TMath::Abs(dPt1-dPt2), TMath::Cos(n*dPhi1 + m*dPhi2 - p*Psi2V0C),WgtEP);
1654  fHist_Corr3p_EtaDiff_EP_V0A_NN[QAindex][cIndex]->Fill(TMath::Abs(dEta1-dEta2), TMath::Cos(n*dPhi1 + m*dPhi2 - p*Psi2V0A),WgtEP);
1655  fHist_Corr3p_EtaDiff_EP_V0C_NN[QAindex][cIndex]->Fill(TMath::Abs(dEta1-dEta2), TMath::Cos(n*dPhi1 + m*dPhi2 - p*Psi2V0C),WgtEP);
1656  }
1657  }
1658  }//nested loop ends
1659  }//------ track loop ends ------
1660 
1661  fEventStatvsRun->Fill(runindex);
1662 
1663  fCentDistvsRun->Fill(EvtCent,runindex);
1664 
1665 
1667 
1668 
1669 
1670  if(EvtCent<=20){
1671  fCentV0MvsVzRun->Fill(VtxZ,runindex,EvtCent);
1672  fCentCL1vsVzRun->Fill(VtxZ,runindex,(centrCL1-EvtCent));
1673  }
1674 
1675 
1676  Double_t QTPCRe = QxTPC[1];
1677  Double_t QTPCIm = QyTPC[1];
1678 
1679  Double_t QTPCRe3 = QxTPC[2];
1680  Double_t QTPCIm3 = QyTPC[2];
1681 
1682 
1683  Double_t Psi2TPC = 0;
1684 
1685  if(psiN<=2){
1686  Psi2TPC = 1./2*(TMath::ATan2(QTPCIm,QTPCRe));
1687  if(Psi2TPC < 0.) Psi2TPC += TMath::Pi();
1688 
1689  fTPCQ2xVsCentRun->Fill(EvtCent,runindex,TMath::Cos(Psi2TPC));
1690  fTPCQ2yVsCentRun->Fill(EvtCent,runindex,TMath::Sin(Psi2TPC));
1691  }
1692  else if(psiN>=3){
1693  Psi2TPC = 1./psiN*(TMath::ATan2(QTPCIm3,QTPCRe3));
1694  if(Psi2TPC < 0.) Psi2TPC += 2./psiN*TMath::Pi();
1695 
1696  fTPCQ3xVsCentRun->Fill(EvtCent,runindex,TMath::Cos(Psi2TPC));
1697  fTPCQ3yVsCentRun->Fill(EvtCent,runindex,TMath::Sin(Psi2TPC));
1698  }
1699 
1700 
1701 
1702 
1703  PostData(3,fListNUAHist); // Store NUA for all Runs including bad one.
1704 
1705 
1706  if(QTPCRe==0 && QTPCIm==0) return; // is this is one to one with bad run list?
1707  fHist_Event_count->Fill(stepCount); //6
1708  stepCount++;
1709 
1710 
1711  if(isBadRun) return;
1712  fHist_Event_count->Fill(stepCount); //7
1713  stepCount++;
1714 
1715 
1716 
1717  Float_t fNegTracks = iTracks*0.5;
1718  Float_t ratioReject = (Float_t) icReject/fNegTracks;
1719 
1720  fRejectRatioVsCR->Fill(EvtCent,runindex,ratioReject);
1721 
1722 
1723 
1724 
1725 
1726 
1727 
1728 //V0A-V0C EP resolution:
1729  fHist_Reso2n_EP_Norm_Det[QAindex][0]->Fill(EvtCent, TMath::Cos(psiN*(Psi2V0A-Psi2V0C)));
1730 //V0A-TPC EP resolution:
1731  fHist_Reso2n_EP_Norm_Det[QAindex][1]->Fill(EvtCent, TMath::Cos(psiN*(Psi2V0A-Psi2TPC)));
1732 //V0C-TPC EP resolution:
1733  fHist_Reso2n_EP_Norm_Det[QAindex][2]->Fill(EvtCent, TMath::Cos(psiN*(Psi2V0C-Psi2TPC)));
1734 
1735 //V0A-V0C EP resolution:
1736  fHist_Reso2n_EP_Refm_Det[QAindex][0]->Fill(fRefMultCorr, TMath::Cos(psiN*(Psi2V0A-Psi2V0C)));
1737 //V0A-TPC EP resolution:
1738  fHist_Reso2n_EP_Refm_Det[QAindex][1]->Fill(fRefMultCorr, TMath::Cos(psiN*(Psi2V0A-Psi2TPC)));
1739 //V0C-TPC EP resolution:
1740  fHist_Reso2n_EP_Refm_Det[QAindex][2]->Fill(fRefMultCorr, TMath::Cos(psiN*(Psi2V0C-Psi2TPC)));
1741 
1742 
1743  fHV0AEventPlaneVsCent->Fill(EvtCent,Psi2V0A);
1744  fHV0CEventPlaneVsCent->Fill(EvtCent,Psi2V0C);
1745  fHTPCEventPlaneVsCent->Fill(EvtCent,Psi2TPC);
1746 
1747 
1748 
1749 
1750 
1751 
1752  //------- SP Method -------------
1753 
1754 
1755  Double_t uPRe=0.,uNRe=0.,uPIm=0.,uNIm=0.,uN2Re=0.,uN2Im=0.,uP2Re=0.,uP2Im=0.;
1756  Double_t uPM=0.,uNM=0.;
1757  //Double_t VCIm=0., VPRe=0.,VPIm=0.;
1758 
1759 
1760  uPM = MPOIpos; uNM = MPOIneg;
1761 
1762  uPRe = QxPos[0]; uNRe = QxNeg[0];
1763  uPIm = QyPos[0]; uNIm = QyNeg[0];
1764 
1765  uP2Re = QxAutoPos[0]; uP2Im = QyAutoPos[0];
1766  uN2Re = QxAutoNeg[0]; uN2Im = QyAutoNeg[0];
1767 
1768  Double_t TwoQpQnV = 0.,TwoQpQpV=0.,TwoQnQnV=0.;
1769 
1770  if(uPM > 1 && uNM > 1) {
1771  //CME w.r.t V0A EP:
1772  TwoQpQnV = ((uPRe*uNRe-uPIm*uNIm)*QxanCor + (uPRe*uNIm+uPIm*uNRe)*QyanCor) / (uPM*uNM) ;
1773  TwoQpQpV = ((uPRe*uPRe-uPIm*uPIm-uP2Re)*QxanCor + (2.*uPRe*uPIm-uP2Im)*QyanCor) / (uPM*(uPM-1)) ;
1774  TwoQnQnV = ((uNRe*uNRe-uNIm*uNIm-uN2Re)*QxanCor + (2.*uNRe*uNIm-uN2Im)*QyanCor) / (uNM*(uNM-1)) ;
1775  //Fill profiles:
1776  /*
1777  fHist_Corr3p_SP_Norm_PN[QAindex][0]->Fill(EvtCent, TwoQpQnV, uPM*uNM);
1778  fHist_Corr3p_SP_Norm_PP[QAindex][0]->Fill(EvtCent, TwoQpQpV, (uPM*(uPM-1)));
1779  fHist_Corr3p_SP_Norm_NN[QAindex][0]->Fill(EvtCent, TwoQnQnV, (uNM*(uNM-1)));
1780  */
1781  //-------- Fill NonIsotropic terms ------
1782 
1783  Double_t QnNonIsoRe = 0.,QnNonIsoIm=0.;
1784 
1785  if(QAindex==0){ //B < 0
1786  //charge pos:
1787  fHist_NonIso_SP_PP_Mag0[0]->Fill(EvtCent, 0.5,uPRe/uPM,uPM); //<Cos(nPhi)> ChPos
1788  fHist_NonIso_SP_PP_Mag0[0]->Fill(EvtCent, 1.5,uPIm/uPM,uPM); //<Sin(nPhi)> ChPos
1789 
1790  QnNonIsoRe = (uPRe*QxanCor + uPIm*QyanCor)/uPM;
1791  QnNonIsoIm = (uPIm*QxanCor - uPRe*QyanCor)/uPM;
1792  fHist_NonIso_SP_PP_Mag0[0]->Fill(EvtCent, 2.5,QnNonIsoRe,uPM); //<Cos(nPhi-mPsi)> ChPos
1793  fHist_NonIso_SP_PP_Mag0[0]->Fill(EvtCent, 3.5,QnNonIsoIm,uPM); //<Sin(nPhi-mPsi)> ChPos
1794 
1795  QnNonIsoRe = (uPRe*uPRe-uPIm*uPIm-uP2Re)/(uPM*(uPM-1));
1796  QnNonIsoIm = (2.*uPRe*uPIm-uP2Im)/(uPM*(uPM-1));
1797  fHist_NonIso_SP_PP_Mag0[0]->Fill(EvtCent, 4.5,QnNonIsoRe,(uPM*(uPM-1))); //<Cos(nPhi1+nPhi2)> ChPos
1798  fHist_NonIso_SP_PP_Mag0[0]->Fill(EvtCent, 5.5,QnNonIsoIm,(uPM*(uPM-1))); //<Sin(nPhi1+nPhi2)> ChPos
1799 
1800  QnNonIsoRe = (uPRe*uNRe-uPIm*uNIm)/(uPM*uNM);
1801  QnNonIsoIm = (uPRe*uNIm+uPIm*uNRe)/(uPM*uNM);
1802  fHist_NonIso_SP_PP_Mag0[0]->Fill(EvtCent, 6.5,QnNonIsoRe,(uPM*uNM)); //<Cos(nPhi1+nPhi2)> phi1,phi2 opposite charge
1803  fHist_NonIso_SP_PP_Mag0[0]->Fill(EvtCent, 7.5,QnNonIsoIm,(uPM*uNM)); //<Sin(nPhi1+nPhi2)> phi1,phi2 opposite charge
1804 
1805  fHist_NonIso_SP_PP_Mag0[0]->Fill(EvtCent, 8.5,QxanCor,uPM); //<Cos(mPsiEP)>
1806  fHist_NonIso_SP_PP_Mag0[0]->Fill(EvtCent, 9.5,QyanCor,uPM); //<Sin(mPsiEP)>
1807 
1808  //charge neg:
1809  fHist_NonIso_SP_NN_Mag0[0]->Fill(EvtCent, 0.5,uNRe/uNM,uNM); //<Cos(nPhi)> ChNeg
1810  fHist_NonIso_SP_NN_Mag0[0]->Fill(EvtCent, 1.5,uNIm/uNM,uNM); //<Sin(nPhi)> ChNeg
1811 
1812  QnNonIsoRe = (uNRe*QxanCor + uNIm*QyanCor)/uNM;
1813  QnNonIsoIm = (uNIm*QxanCor - uNRe*QyanCor)/uNM;
1814  fHist_NonIso_SP_NN_Mag0[0]->Fill(EvtCent, 2.5,QnNonIsoRe,uNM); //<Cos(nPhi-mPsi)> ChNeg
1815  fHist_NonIso_SP_NN_Mag0[0]->Fill(EvtCent, 3.5,QnNonIsoIm,uNM); //<Cos(nPhi-mPsi)> ChNeg
1816 
1817  QnNonIsoRe = (uNRe*uNRe-uNIm*uNIm-uN2Re)/(uNM*(uNM-1));
1818  QnNonIsoIm = (2.*uNRe*uNIm-uN2Im)/(uNM*(uNM-1));
1819  fHist_NonIso_SP_NN_Mag0[0]->Fill(EvtCent, 4.5,QnNonIsoRe,(uNM*(uNM-1))); //<Cos(nPhi1+nPhi2)> ChNeg
1820  fHist_NonIso_SP_NN_Mag0[0]->Fill(EvtCent, 5.5,QnNonIsoIm,(uNM*(uNM-1))); //<Sin(nPhi1+nPhi2)> ChNeg
1821 
1822  QnNonIsoRe = (uPRe*uNRe-uPIm*uNIm)/(uPM*uNM);
1823  QnNonIsoIm = (uPRe*uNIm+uPIm*uNRe)/(uPM*uNM);
1824  fHist_NonIso_SP_NN_Mag0[0]->Fill(EvtCent, 6.5,QnNonIsoRe,(uPM*uNM)); //<Cos(nPhi1+nPhi2)> phi1,phi2 opposite charge
1825  fHist_NonIso_SP_NN_Mag0[0]->Fill(EvtCent, 7.5,QnNonIsoIm,(uPM*uNM)); //<Sin(nPhi1+nPhi2)> phi1,phi2 opposite charge
1826 
1827  fHist_NonIso_SP_NN_Mag0[0]->Fill(EvtCent, 8.5,QxanCor,uNM); //<Cos(mPsiEP)>
1828  fHist_NonIso_SP_NN_Mag0[0]->Fill(EvtCent, 9.5,QyanCor,uNM); //<Sin(mPsiEP)>
1829  }
1830  else if(QAindex==1){ //B > 0
1831  //charge pos:
1832  fHist_NonIso_SP_PP_Mag1[0]->Fill(EvtCent, 0.5,uPRe/uPM,uPM); //<Cos(nPhi)> ChPos
1833  fHist_NonIso_SP_PP_Mag1[0]->Fill(EvtCent, 1.5,uPIm/uPM,uPM); //<Sin(nPhi)> ChPos
1834 
1835  QnNonIsoRe = (uPRe*QxanCor + uPIm*QyanCor)/uPM;
1836  QnNonIsoIm = (uPIm*QxanCor - uPRe*QyanCor)/uPM;
1837  fHist_NonIso_SP_PP_Mag1[0]->Fill(EvtCent, 2.5,QnNonIsoRe,uPM); //<Cos(nPhi-mPsi)> ChPos
1838  fHist_NonIso_SP_PP_Mag1[0]->Fill(EvtCent, 3.5,QnNonIsoIm,uPM); //<Sin(nPhi-mPsi)> ChPos
1839 
1840  QnNonIsoRe = (uPRe*uPRe-uPIm*uPIm-uP2Re)/(uPM*(uPM-1));
1841  QnNonIsoIm = (2.*uPRe*uPIm-uP2Im)/(uPM*(uPM-1));
1842  fHist_NonIso_SP_PP_Mag1[0]->Fill(EvtCent, 4.5,QnNonIsoRe,(uPM*(uPM-1))); //<Cos(nPhi1+nPhi2)> ChPos
1843  fHist_NonIso_SP_PP_Mag1[0]->Fill(EvtCent, 5.5,QnNonIsoIm,(uPM*(uPM-1))); //<Sin(nPhi1+nPhi2)> ChPos
1844 
1845  QnNonIsoRe = (uPRe*uNRe-uPIm*uNIm)/(uPM*uNM);
1846  QnNonIsoIm = (uPRe*uNIm+uPIm*uNRe)/(uPM*uNM);
1847  fHist_NonIso_SP_PP_Mag1[0]->Fill(EvtCent, 6.5,QnNonIsoRe,(uPM*uNM)); //<Cos(nPhi1+nPhi2)> phi1,phi2 opposite charge
1848  fHist_NonIso_SP_PP_Mag1[0]->Fill(EvtCent, 7.5,QnNonIsoIm,(uPM*uNM)); //<Sin(nPhi1+nPhi2)> phi1,phi2 opposite charge
1849 
1850  fHist_NonIso_SP_PP_Mag1[0]->Fill(EvtCent, 8.5,QxanCor,uPM); //<Cos(mPsiEP)>
1851  fHist_NonIso_SP_PP_Mag1[0]->Fill(EvtCent, 9.5,QyanCor,uPM); //<Sin(mPsiEP)>
1852 
1853  //charge neg:
1854  fHist_NonIso_SP_NN_Mag1[0]->Fill(EvtCent, 0.5,uNRe/uNM,uNM); //<Cos(nPhi)> ChNeg
1855  fHist_NonIso_SP_NN_Mag1[0]->Fill(EvtCent, 1.5,uNIm/uNM,uNM); //<Sin(nPhi)> ChNeg
1856 
1857  QnNonIsoRe = (uNRe*QxanCor + uNIm*QyanCor)/uNM;
1858  QnNonIsoIm = (uNIm*QxanCor - uNRe*QyanCor)/uNM;
1859  fHist_NonIso_SP_NN_Mag1[0]->Fill(EvtCent, 2.5,QnNonIsoRe,uNM); //<Cos(nPhi-mPsi)> ChNeg
1860  fHist_NonIso_SP_NN_Mag1[0]->Fill(EvtCent, 3.5,QnNonIsoIm,uNM); //<Cos(nPhi-mPsi)> ChNeg
1861 
1862  QnNonIsoRe = (uNRe*uNRe-uNIm*uNIm-uN2Re)/(uNM*(uNM-1));
1863  QnNonIsoIm = (2.*uNRe*uNIm-uN2Im)/(uNM*(uNM-1));
1864  fHist_NonIso_SP_NN_Mag1[0]->Fill(EvtCent, 4.5,QnNonIsoRe,(uNM*(uNM-1))); //<Cos(nPhi1+nPhi2)> ChNeg
1865  fHist_NonIso_SP_NN_Mag1[0]->Fill(EvtCent, 5.5,QnNonIsoIm,(uNM*(uNM-1))); //<Sin(nPhi1+nPhi2)> ChNeg
1866 
1867  QnNonIsoRe = (uPRe*uNRe-uPIm*uNIm)/(uPM*uNM);
1868  QnNonIsoIm = (uPRe*uNIm+uPIm*uNRe)/(uPM*uNM);
1869  fHist_NonIso_SP_NN_Mag1[0]->Fill(EvtCent, 6.5,QnNonIsoRe,(uPM*uNM)); //<Cos(nPhi1+nPhi2)> phi1,phi2 opposite charge
1870  fHist_NonIso_SP_NN_Mag1[0]->Fill(EvtCent, 7.5,QnNonIsoIm,(uPM*uNM)); //<Sin(nPhi1+nPhi2)> phi1,phi2 opposite charge
1871 
1872  fHist_NonIso_SP_NN_Mag1[0]->Fill(EvtCent, 8.5,QxanCor,uNM); //<Cos(mPsiEP)>
1873  fHist_NonIso_SP_NN_Mag1[0]->Fill(EvtCent, 9.5,QyanCor,uNM); //<Sin(mPsiEP)>
1874  }
1875 
1876 
1877  //-------- CME - ZDN correlators:---------
1878  fHist_Corr3p_ZDN_SP_PN[0]->Fill(EvtCent, 0., TwoQpQnV, uPM*uNM);
1879  fHist_Corr3p_ZDN_SP_PN[0]->Fill(EvtCent, 1., energyZPA, 1.);
1880  fHist_Corr3p_ZDN_SP_PN[0]->Fill(EvtCent, 2., energyZPC, 1.);
1881  fHist_Corr3p_ZDN_SP_PN[0]->Fill(EvtCent, 3., (energyZPA+energyZPC), 1.);
1882  fHist_Corr3p_ZDN_SP_PN[0]->Fill(EvtCent, 4., energyZNA, 1.);
1883  fHist_Corr3p_ZDN_SP_PN[0]->Fill(EvtCent, 5., energyZNC, 1.);
1884  fHist_Corr3p_ZDN_SP_PN[0]->Fill(EvtCent, 6., (energyZNA+energyZNC), 1.);
1885  fHist_Corr3p_ZDN_SP_PN[0]->Fill(EvtCent, 7., TwoQpQnV*energyZPA, uPM*uNM);
1886  fHist_Corr3p_ZDN_SP_PN[0]->Fill(EvtCent, 8., TwoQpQnV*energyZPC, uPM*uNM);
1887  fHist_Corr3p_ZDN_SP_PN[0]->Fill(EvtCent, 9., TwoQpQnV*(energyZPC+energyZPA), uPM*uNM);
1888  fHist_Corr3p_ZDN_SP_PN[0]->Fill(EvtCent, 10., TwoQpQnV*energyZNA, uPM*uNM);
1889  fHist_Corr3p_ZDN_SP_PN[0]->Fill(EvtCent, 11., TwoQpQnV*energyZNC, uPM*uNM);
1890  fHist_Corr3p_ZDN_SP_PN[0]->Fill(EvtCent, 12., TwoQpQnV*(energyZNC+energyZNA), uPM*uNM);
1891 
1892  fHist_Corr3p_ZDN_SP_PP[0]->Fill(EvtCent, 0., TwoQpQpV, (uPM*(uPM-1)));
1893  //fHist_Corr3p_ZDN_SP_PP[0]->Fill(EvtCent, 1., energyZPA, 1.);
1894  //fHist_Corr3p_ZDN_SP_PP[0]->Fill(EvtCent, 2., energyZPC, 1.);
1895  //fHist_Corr3p_ZDN_SP_PP[0]->Fill(EvtCent, 3., (energyZPA+energyZPC), 1.);
1896  //fHist_Corr3p_ZDN_SP_PP[0]->Fill(EvtCent, 4., energyZNA, 1.);
1897  //fHist_Corr3p_ZDN_SP_PP[0]->Fill(EvtCent, 5., energyZNC, 1.);
1898  //fHist_Corr3p_ZDN_SP_PP[0]->Fill(EvtCent, 6., (energyZNA+energyZNC), 1.);
1899  fHist_Corr3p_ZDN_SP_PP[0]->Fill(EvtCent, 7., TwoQpQpV*energyZPA, (uPM*(uPM-1)));
1900  fHist_Corr3p_ZDN_SP_PP[0]->Fill(EvtCent, 8., TwoQpQpV*energyZPC, (uPM*(uPM-1)));
1901  fHist_Corr3p_ZDN_SP_PP[0]->Fill(EvtCent, 9., TwoQpQpV*(energyZPC+energyZPA), (uPM*(uPM-1)));
1902  fHist_Corr3p_ZDN_SP_PP[0]->Fill(EvtCent, 10., TwoQpQpV*energyZNA, (uPM*(uPM-1)));
1903  fHist_Corr3p_ZDN_SP_PP[0]->Fill(EvtCent, 11., TwoQpQpV*energyZNC, (uPM*(uPM-1)));
1904  fHist_Corr3p_ZDN_SP_PP[0]->Fill(EvtCent, 12., TwoQpQpV*(energyZNC+energyZNA), (uPM*(uPM-1)));
1905 
1906  fHist_Corr3p_ZDN_SP_NN[0]->Fill(EvtCent, 0., TwoQnQnV, (uNM*(uNM-1)));
1907  //fHist_Corr3p_ZDN_SP_NN[0]->Fill(EvtCent, 1., energyZPA, 1.);
1908  //fHist_Corr3p_ZDN_SP_NN[0]->Fill(EvtCent, 2., energyZPC, 1.);
1909  //fHist_Corr3p_ZDN_SP_NN[0]->Fill(EvtCent, 3., (energyZPA+energyZPC), 1.);
1910  //fHist_Corr3p_ZDN_SP_NN[0]->Fill(EvtCent, 4., energyZNA, 1.);
1911  //fHist_Corr3p_ZDN_SP_NN[0]->Fill(EvtCent, 5., energyZNC, 1.);
1912  //fHist_Corr3p_ZDN_SP_NN[0]->Fill(EvtCent, 6., (energyZNA+energyZNC), 1.);
1913  fHist_Corr3p_ZDN_SP_NN[0]->Fill(EvtCent, 7., TwoQnQnV*energyZPA, (uNM*(uNM-1)));
1914  fHist_Corr3p_ZDN_SP_NN[0]->Fill(EvtCent, 8., TwoQnQnV*energyZPC, (uNM*(uNM-1)));
1915  fHist_Corr3p_ZDN_SP_NN[0]->Fill(EvtCent, 9., TwoQnQnV*(energyZPC+energyZPA), (uNM*(uNM-1)));
1916  fHist_Corr3p_ZDN_SP_NN[0]->Fill(EvtCent, 10., TwoQnQnV*energyZNA, (uNM*(uNM-1)));
1917  fHist_Corr3p_ZDN_SP_NN[0]->Fill(EvtCent, 11., TwoQnQnV*energyZNC, (uNM*(uNM-1)));
1918  fHist_Corr3p_ZDN_SP_NN[0]->Fill(EvtCent, 12., TwoQnQnV*(energyZNC+energyZNA), (uNM*(uNM-1)));
1919  //-----------------------------------------
1920 
1921 
1922 
1923 
1924  //CME w.r.t V0C EP:
1925  TwoQpQnV = 0.; TwoQpQpV = 0.; TwoQnQnV = 0.;
1926  TwoQpQnV = ((uPRe*uNRe-uPIm*uNIm)*QxcnCor + (uPRe*uNIm+uPIm*uNRe)*QycnCor) / (uPM*uNM) ;
1927  TwoQpQpV = ((uPRe*uPRe-uPIm*uPIm-uP2Re)*QxcnCor + (2.*uPRe*uPIm-uP2Im)*QycnCor) / (uPM*(uPM-1)) ;
1928  TwoQnQnV = ((uNRe*uNRe-uNIm*uNIm-uN2Re)*QxcnCor + (2.*uNRe*uNIm-uN2Im)*QycnCor) / (uNM*(uNM-1)) ;
1929 
1930  //Fill profiles:
1931  /*
1932  fHist_Corr3p_SP_Norm_PN[QAindex][1]->Fill(EvtCent, TwoQpQnV, uPM*uNM);
1933  fHist_Corr3p_SP_Norm_PP[QAindex][1]->Fill(EvtCent, TwoQpQpV, (uPM*(uPM-1)));
1934  fHist_Corr3p_SP_Norm_NN[QAindex][1]->Fill(EvtCent, TwoQnQnV, (uNM*(uNM-1)));
1935  */
1936 
1937  if(QAindex==0){ //B < 0
1938  //charge pos:
1939  fHist_NonIso_SP_PP_Mag0[1]->Fill(EvtCent, 0.5,uPRe/uPM,uPM); //<Cos(nPhi)> ChPos
1940  fHist_NonIso_SP_PP_Mag0[1]->Fill(EvtCent, 1.5,uPIm/uPM,uPM); //<Sin(nPhi)> ChPos
1941 
1942  QnNonIsoRe = (uPRe*QxcnCor + uPIm*QycnCor)/uPM;
1943  QnNonIsoIm = (uPIm*QxcnCor - uPRe*QycnCor)/uPM;
1944  fHist_NonIso_SP_PP_Mag0[1]->Fill(EvtCent, 2.5,QnNonIsoRe,uPM); //<Cos(nPhi-mPsi)> ChPos
1945  fHist_NonIso_SP_PP_Mag0[1]->Fill(EvtCent, 3.5,QnNonIsoIm,uPM); //<Sin(nPhi-mPsi)> ChPos
1946 
1947  QnNonIsoRe = (uPRe*uPRe-uPIm*uPIm-uP2Re)/(uPM*(uPM-1));
1948  QnNonIsoIm = (2.*uPRe*uPIm-uP2Im)/(uPM*(uPM-1));
1949  fHist_NonIso_SP_PP_Mag0[1]->Fill(EvtCent, 4.5,QnNonIsoRe,(uPM*(uPM-1))); //<Cos(nPhi1+nPhi2)> ChPos
1950  fHist_NonIso_SP_PP_Mag0[1]->Fill(EvtCent, 5.5,QnNonIsoIm,(uPM*(uPM-1))); //<Sin(nPhi1+nPhi2)> ChPos
1951 
1952  QnNonIsoRe = (uPRe*uNRe-uPIm*uNIm)/(uPM*uNM);
1953  QnNonIsoIm = (uPRe*uNIm+uPIm*uNRe)/(uPM*uNM);
1954  fHist_NonIso_SP_PP_Mag0[1]->Fill(EvtCent, 6.5,QnNonIsoRe,(uPM*uNM)); //<Cos(nPhi1+nPhi2)> phi1,phi2 opposite charge
1955  fHist_NonIso_SP_PP_Mag0[1]->Fill(EvtCent, 7.5,QnNonIsoIm,(uPM*uNM)); //<Sin(nPhi1+nPhi2)> phi1,phi2 opposite charge
1956 
1957  fHist_NonIso_SP_PP_Mag0[1]->Fill(EvtCent, 8.5,QxcnCor,uPM); //<Cos(mPsiEP)>
1958  fHist_NonIso_SP_PP_Mag0[1]->Fill(EvtCent, 9.5,QycnCor,uPM); //<Sin(mPsiEP)>
1959 
1960  //charge neg:
1961  fHist_NonIso_SP_NN_Mag0[1]->Fill(EvtCent, 0.5,uNRe/uNM,uNM); //<Cos(nPhi)> ChNeg
1962  fHist_NonIso_SP_NN_Mag0[1]->Fill(EvtCent, 1.5,uNIm/uNM,uNM); //<Sin(nPhi)> ChNeg
1963 
1964  QnNonIsoRe = (uNRe*QxcnCor + uNIm*QycnCor)/uNM;
1965  QnNonIsoIm = (uNIm*QxcnCor - uNRe*QycnCor)/uNM;
1966  fHist_NonIso_SP_NN_Mag0[1]->Fill(EvtCent, 2.5,QnNonIsoRe,uNM); //<Cos(nPhi-mPsi)> ChNeg
1967  fHist_NonIso_SP_NN_Mag0[1]->Fill(EvtCent, 3.5,QnNonIsoIm,uNM); //<Cos(nPhi-mPsi)> ChNeg
1968 
1969  QnNonIsoRe = (uNRe*uNRe-uNIm*uNIm-uN2Re)/(uNM*(uNM-1));
1970  QnNonIsoIm = (2.*uNRe*uNIm-uN2Im)/(uNM*(uNM-1));
1971  fHist_NonIso_SP_NN_Mag0[1]->Fill(EvtCent, 4.5,QnNonIsoRe,(uNM*(uNM-1))); //<Cos(nPhi1+nPhi2)> ChNeg
1972  fHist_NonIso_SP_NN_Mag0[1]->Fill(EvtCent, 5.5,QnNonIsoIm,(uNM*(uNM-1))); //<Sin(nPhi1+nPhi2)> ChNeg
1973 
1974  QnNonIsoRe = (uPRe*uNRe-uPIm*uNIm)/(uPM*uNM);
1975  QnNonIsoIm = (uPRe*uNIm+uPIm*uNRe)/(uPM*uNM);
1976  fHist_NonIso_SP_NN_Mag0[1]->Fill(EvtCent, 6.5,QnNonIsoRe,(uPM*uNM)); //<Cos(nPhi1+nPhi2)> phi1,phi2 opposite charge
1977  fHist_NonIso_SP_NN_Mag0[1]->Fill(EvtCent, 7.5,QnNonIsoIm,(uPM*uNM)); //<Sin(nPhi1+nPhi2)> phi1,phi2 opposite charge
1978 
1979  fHist_NonIso_SP_NN_Mag0[1]->Fill(EvtCent, 8.5,QxcnCor,uNM); //<Cos(mPsiEP)>
1980  fHist_NonIso_SP_NN_Mag0[1]->Fill(EvtCent, 9.5,QycnCor,uNM); //<Sin(mPsiEP)>
1981  }
1982  else if(QAindex==1) { //B > 0
1983  //charge pos:
1984  fHist_NonIso_SP_PP_Mag1[1]->Fill(EvtCent, 0.5,uPRe/uPM,uPM); //<Cos(nPhi)> ChPos
1985  fHist_NonIso_SP_PP_Mag1[1]->Fill(EvtCent, 1.5,uPIm/uPM,uPM); //<Sin(nPhi)> ChPos
1986 
1987  QnNonIsoRe = (uPRe*QxcnCor + uPIm*QycnCor)/uPM;
1988  QnNonIsoIm = (uPIm*QxcnCor - uPRe*QycnCor)/uPM;
1989  fHist_NonIso_SP_PP_Mag1[1]->Fill(EvtCent, 2.5,QnNonIsoRe,uPM); //<Cos(nPhi-mPsi)> ChPos
1990  fHist_NonIso_SP_PP_Mag1[1]->Fill(EvtCent, 3.5,QnNonIsoIm,uPM); //<Sin(nPhi-mPsi)> ChPos
1991 
1992  QnNonIsoRe = (uPRe*uPRe-uPIm*uPIm-uP2Re)/(uPM*(uPM-1));
1993  QnNonIsoIm = (2.*uPRe*uPIm-uP2Im)/(uPM*(uPM-1));
1994  fHist_NonIso_SP_PP_Mag1[1]->Fill(EvtCent, 4.5,QnNonIsoRe,(uPM*(uPM-1))); //<Cos(nPhi1+nPhi2)> ChPos
1995  fHist_NonIso_SP_PP_Mag1[1]->Fill(EvtCent, 5.5,QnNonIsoIm,(uPM*(uPM-1))); //<Sin(nPhi1+nPhi2)> ChPos
1996 
1997  QnNonIsoRe = (uPRe*uNRe-uPIm*uNIm)/(uPM*uNM);
1998  QnNonIsoIm = (uPRe*uNIm+uPIm*uNRe)/(uPM*uNM);
1999  fHist_NonIso_SP_PP_Mag1[1]->Fill(EvtCent, 6.5,QnNonIsoRe,(uPM*uNM)); //<Cos(nPhi1+nPhi2)> phi1,phi2 opposite charge
2000  fHist_NonIso_SP_PP_Mag1[1]->Fill(EvtCent, 7.5,QnNonIsoIm,(uPM*uNM)); //<Sin(nPhi1+nPhi2)> phi1,phi2 opposite charge
2001 
2002  fHist_NonIso_SP_PP_Mag1[1]->Fill(EvtCent, 8.5,QxcnCor,uPM); //<Cos(mPsiEP)>
2003  fHist_NonIso_SP_PP_Mag1[1]->Fill(EvtCent, 9.5,QycnCor,uPM); //<Sin(mPsiEP)>
2004 
2005  //charge neg:
2006  fHist_NonIso_SP_NN_Mag1[1]->Fill(EvtCent, 0.5,uNRe/uNM,uNM); //<Cos(nPhi)> ChNeg
2007  fHist_NonIso_SP_NN_Mag1[1]->Fill(EvtCent, 1.5,uNIm/uNM,uNM); //<Sin(nPhi)> ChNeg
2008 
2009  QnNonIsoRe = (uNRe*QxcnCor + uNIm*QycnCor)/uNM;
2010  QnNonIsoIm = (uNIm*QxcnCor - uNRe*QycnCor)/uNM;
2011  fHist_NonIso_SP_NN_Mag1[1]->Fill(EvtCent, 2.5,QnNonIsoRe,uNM); //<Cos(nPhi-mPsi)> ChNeg
2012  fHist_NonIso_SP_NN_Mag1[1]->Fill(EvtCent, 3.5,QnNonIsoIm,uNM); //<Cos(nPhi-mPsi)> ChNeg
2013 
2014  QnNonIsoRe = (uNRe*uNRe-uNIm*uNIm-uN2Re)/(uNM*(uNM-1));
2015  QnNonIsoIm = (2.*uNRe*uNIm-uN2Im)/(uNM*(uNM-1));
2016  fHist_NonIso_SP_NN_Mag1[1]->Fill(EvtCent, 4.5,QnNonIsoRe,(uNM*(uNM-1))); //<Cos(nPhi1+nPhi2)> ChNeg
2017  fHist_NonIso_SP_NN_Mag1[1]->Fill(EvtCent, 5.5,QnNonIsoIm,(uNM*(uNM-1))); //<Sin(nPhi1+nPhi2)> ChNeg
2018 
2019  QnNonIsoRe = (uPRe*uNRe-uPIm*uNIm)/(uPM*uNM);
2020  QnNonIsoIm = (uPRe*uNIm+uPIm*uNRe)/(uPM*uNM);
2021  fHist_NonIso_SP_NN_Mag1[1]->Fill(EvtCent, 6.5,QnNonIsoRe,(uPM*uNM)); //<Cos(nPhi1+nPhi2)> phi1,phi2 opposite charge
2022  fHist_NonIso_SP_NN_Mag1[1]->Fill(EvtCent, 7.5,QnNonIsoIm,(uPM*uNM)); //<Sin(nPhi1+nPhi2)> phi1,phi2 opposite charge
2023 
2024  fHist_NonIso_SP_NN_Mag1[1]->Fill(EvtCent, 8.5,QxcnCor,uNM); //<Cos(mPsiEP)>
2025  fHist_NonIso_SP_NN_Mag1[1]->Fill(EvtCent, 9.5,QycnCor,uNM); //<Sin(mPsiEP)>
2026  }
2027 
2028 
2029  //-------- CME - ZDN correlators:---------
2030  fHist_Corr3p_ZDN_SP_PN[1]->Fill(EvtCent, 0., TwoQpQnV, uPM*uNM);
2031  fHist_Corr3p_ZDN_SP_PN[1]->Fill(EvtCent, 1., energyZPA, 1.);
2032  fHist_Corr3p_ZDN_SP_PN[1]->Fill(EvtCent, 2., energyZPC, 1.);
2033  fHist_Corr3p_ZDN_SP_PN[1]->Fill(EvtCent, 3., (energyZPA+energyZPC), 1.);
2034  fHist_Corr3p_ZDN_SP_PN[1]->Fill(EvtCent, 4., energyZNA, 1.);
2035  fHist_Corr3p_ZDN_SP_PN[1]->Fill(EvtCent, 5., energyZNC, 1.);
2036  fHist_Corr3p_ZDN_SP_PN[1]->Fill(EvtCent, 6., (energyZNA+energyZNC), 1.);
2037  fHist_Corr3p_ZDN_SP_PN[1]->Fill(EvtCent, 7., TwoQpQnV*energyZPA, uPM*uNM);
2038  fHist_Corr3p_ZDN_SP_PN[1]->Fill(EvtCent, 8., TwoQpQnV*energyZPC, uPM*uNM);
2039  fHist_Corr3p_ZDN_SP_PN[1]->Fill(EvtCent, 9., TwoQpQnV*(energyZPC+energyZPA), uPM*uNM);
2040  fHist_Corr3p_ZDN_SP_PN[1]->Fill(EvtCent, 10., TwoQpQnV*energyZNA, uPM*uNM);
2041  fHist_Corr3p_ZDN_SP_PN[1]->Fill(EvtCent, 11., TwoQpQnV*energyZNC, uPM*uNM);
2042  fHist_Corr3p_ZDN_SP_PN[1]->Fill(EvtCent, 12., TwoQpQnV*(energyZNC+energyZNA), uPM*uNM);
2043 
2044  fHist_Corr3p_ZDN_SP_PP[1]->Fill(EvtCent, 0., TwoQpQpV, (uPM*(uPM-1)));
2045  //fHist_Corr3p_ZDN_SP_PP[1]->Fill(EvtCent, 1., energyZPA, 1.);
2046  //fHist_Corr3p_ZDN_SP_PP[1]->Fill(EvtCent, 2., energyZPC, 1.);
2047  //fHist_Corr3p_ZDN_SP_PP[1]->Fill(EvtCent, 3., (energyZPA+energyZPC), 1.);
2048  //fHist_Corr3p_ZDN_SP_PP[1]->Fill(EvtCent, 4., energyZNA, 1.);
2049  //fHist_Corr3p_ZDN_SP_PP[1]->Fill(EvtCent, 5., energyZNC, 1.);
2050  //fHist_Corr3p_ZDN_SP_PP[1]->Fill(EvtCent, 6., (energyZNA+energyZNC), 1.);
2051  fHist_Corr3p_ZDN_SP_PP[1]->Fill(EvtCent, 7., TwoQpQpV*energyZPA, (uPM*(uPM-1)));
2052  fHist_Corr3p_ZDN_SP_PP[1]->Fill(EvtCent, 8., TwoQpQpV*energyZPC, (uPM*(uPM-1)));
2053  fHist_Corr3p_ZDN_SP_PP[1]->Fill(EvtCent, 9., TwoQpQpV*(energyZPC+energyZPA), (uPM*(uPM-1)));
2054  fHist_Corr3p_ZDN_SP_PP[1]->Fill(EvtCent, 10., TwoQpQpV*energyZNA, (uPM*(uPM-1)));
2055  fHist_Corr3p_ZDN_SP_PP[1]->Fill(EvtCent, 11., TwoQpQpV*energyZNC, (uPM*(uPM-1)));
2056  fHist_Corr3p_ZDN_SP_PP[1]->Fill(EvtCent, 12., TwoQpQpV*(energyZNC+energyZNA), (uPM*(uPM-1)));
2057 
2058  fHist_Corr3p_ZDN_SP_NN[1]->Fill(EvtCent, 0., TwoQnQnV, (uNM*(uNM-1)));
2059  //fHist_Corr3p_ZDN_SP_NN[1]->Fill(EvtCent, 1., energyZPA, 1.);
2060  //fHist_Corr3p_ZDN_SP_NN[1]->Fill(EvtCent, 2., energyZPC, 1.);
2061  //fHist_Corr3p_ZDN_SP_NN[1]->Fill(EvtCent, 3., (energyZPA+energyZPC), 1.);
2062  //fHist_Corr3p_ZDN_SP_NN[1]->Fill(EvtCent, 4., energyZNA, 1.);
2063  //fHist_Corr3p_ZDN_SP_NN[1]->Fill(EvtCent, 5., energyZNC, 1.);
2064  //fHist_Corr3p_ZDN_SP_NN[1]->Fill(EvtCent, 6., (energyZNA+energyZNC), 1.);
2065  fHist_Corr3p_ZDN_SP_NN[1]->Fill(EvtCent, 7., TwoQnQnV*energyZPA, (uNM*(uNM-1)));
2066  fHist_Corr3p_ZDN_SP_NN[1]->Fill(EvtCent, 8., TwoQnQnV*energyZPC, (uNM*(uNM-1)));
2067  fHist_Corr3p_ZDN_SP_NN[1]->Fill(EvtCent, 9., TwoQnQnV*(energyZPC+energyZPA), (uNM*(uNM-1)));
2068  fHist_Corr3p_ZDN_SP_NN[1]->Fill(EvtCent, 10., TwoQnQnV*energyZNA, (uNM*(uNM-1)));
2069  fHist_Corr3p_ZDN_SP_NN[1]->Fill(EvtCent, 11., TwoQnQnV*energyZNC, (uNM*(uNM-1)));
2070  fHist_Corr3p_ZDN_SP_NN[1]->Fill(EvtCent, 12., TwoQnQnV*(energyZNC+energyZNA), (uNM*(uNM-1)));
2071  //-----------------------------------------
2072 
2073 
2074  //Fill Mult, POIs vs cent:
2075 
2076  fAvgMultCentRun->Fill(EvtCent,runindex,nRefMult);
2077  fAvgWgtMultCentRun->Fill(EvtCent,runindex,nRefMultWgt);
2078  fAvgPOIposCentRun->Fill(EvtCent,runindex,uPM);
2079  fAvgPOInegCentRun->Fill(EvtCent,runindex,uNM);
2080  fAvgPOIPPCentRun->Fill(EvtCent,runindex,(uPM*(uPM-1)));
2081  fAvgPOINNCentRun->Fill(EvtCent,runindex,(uNM*(uNM-1)));
2082  fAvgPOIOSCentRun->Fill(EvtCent,runindex,uPM*uNM);
2083 
2084 
2085  //------------ eta depedence -----------------
2086  Double_t fEtaCent = -100.;
2087  Int_t nBinsX = fEtaBinFinderForQA->GetNbinsX();
2088 
2089  for(int ie=0; ie<nBinsX; ie++){
2090 
2091  uPM = MPOIposQAEta[ie];
2092  uNM = MPOInegQAEta[ie];
2093 
2094  if(uPM>1 && uNM>1){
2095 
2096  uPRe = QxPosQAEta[ie];
2097  uNRe = QxNegQAEta[ie];
2098  uPIm = QyPosQAEta[ie];
2099  uNIm = QyNegQAEta[ie];
2100 
2101  uP2Re = QxAutoPosQAEta[ie];
2102  uP2Im = QyAutoPosQAEta[ie];
2103  uN2Re = QxAutoNegQAEta[ie];
2104  uN2Im = QyAutoNegQAEta[ie];
2105 
2106 
2107  fEtaCent = fEtaBinFinderForQA->GetBinCenter(ie+1);
2108 
2109  //w.r.t V0A:
2110  TwoQpQnV = 0.; TwoQpQpV = 0.; TwoQnQnV = 0.;
2111  TwoQpQnV = ((uPRe*uNRe-uPIm*uNIm)*QxanCor + (uPRe*uNIm+uPIm*uNRe)*QyanCor) / (uPM*uNM) ;
2112  TwoQpQpV = ((uPRe*uPRe-uPIm*uPIm-uP2Re)*QxanCor + (2.*uPRe*uPIm-uP2Im)*QyanCor) / (uPM*(uPM-1.)) ;
2113  TwoQnQnV = ((uNRe*uNRe-uNIm*uNIm-uN2Re)*QxanCor + (2.*uNRe*uNIm-uN2Im)*QyanCor) / (uNM*(uNM-1.)) ;
2114 
2115  fHist_Corr3p_QAEta_SP_V0A_PN[QAindex]->Fill(fEtaCent,TwoQpQnV,uPM*uNM);
2116  fHist_Corr3p_QAEta_SP_V0A_PP[QAindex]->Fill(fEtaCent,TwoQpQpV,uPM*(uPM-1.));
2117  fHist_Corr3p_QAEta_SP_V0A_NN[QAindex]->Fill(fEtaCent,TwoQnQnV,uNM*(uNM-1.));
2118 
2119  //w.r.t V0C:
2120  TwoQpQnV = 0.; TwoQpQpV = 0.; TwoQnQnV = 0.;
2121  TwoQpQnV = ((uPRe*uNRe-uPIm*uNIm)*QxcnCor + (uPRe*uNIm+uPIm*uNRe)*QycnCor) / (uPM*uNM) ;
2122  TwoQpQpV = ((uPRe*uPRe-uPIm*uPIm-uP2Re)*QxcnCor + (2.*uPRe*uPIm-uP2Im)*QycnCor) / (uPM*(uPM-1.)) ;
2123  TwoQnQnV = ((uNRe*uNRe-uNIm*uNIm-uN2Re)*QxcnCor + (2.*uNRe*uNIm-uN2Im)*QycnCor) / (uNM*(uNM-1.)) ;
2124 
2125  fHist_Corr3p_QAEta_SP_V0C_PN[QAindex]->Fill(fEtaCent,TwoQpQnV,uPM*uNM);
2126  fHist_Corr3p_QAEta_SP_V0C_PP[QAindex]->Fill(fEtaCent,TwoQpQpV,uPM*(uPM-1.));
2127  fHist_Corr3p_QAEta_SP_V0C_NN[QAindex]->Fill(fEtaCent,TwoQnQnV,uNM*(uNM-1.));
2128  }
2129  }
2130  //---------------------------------------
2131 
2132 
2133 
2134 
2135  if(MPOIpos>1 && MPOIneg>1){
2136  //V0A-V0C SP resolution:
2137  fHist_Reso2n_SP_Norm_Det[QAindex][0]->Fill(EvtCent, (QxcnCor*QxanCor+QycnCor*QyanCor));
2138  //V0A-TPC SP resolution:
2139  fHist_Reso2n_SP_Norm_Det[QAindex][1]->Fill(EvtCent, (QTPCRe*QxanCor+QTPCIm*QyanCor));
2140  //V0C-TPC SP resolution:
2141  fHist_Reso2n_SP_Norm_Det[QAindex][2]->Fill(EvtCent, (QTPCRe*QxcnCor+QTPCIm*QycnCor));
2142 
2143 
2144  //V0A-V0C:
2145  fHist_Reso2n_ZDN_SP_Det[0]->Fill(EvtCent, 0., (QxcnCor*QxanCor+QycnCor*QyanCor));
2146  fHist_Reso2n_ZDN_SP_Det[0]->Fill(EvtCent, 1., (QxcnCor*QxanCor+QycnCor*QyanCor)*energyZPA);
2147  fHist_Reso2n_ZDN_SP_Det[0]->Fill(EvtCent, 2., (QxcnCor*QxanCor+QycnCor*QyanCor)*energyZPC);
2148  fHist_Reso2n_ZDN_SP_Det[0]->Fill(EvtCent, 3., (QxcnCor*QxanCor+QycnCor*QyanCor)*(energyZPA+energyZPC));
2149  fHist_Reso2n_ZDN_SP_Det[0]->Fill(EvtCent, 4., (QxcnCor*QxanCor+QycnCor*QyanCor)*energyZNA);
2150  fHist_Reso2n_ZDN_SP_Det[0]->Fill(EvtCent, 5., (QxcnCor*QxanCor+QycnCor*QyanCor)*energyZNC);
2151  fHist_Reso2n_ZDN_SP_Det[0]->Fill(EvtCent, 6., (QxcnCor*QxanCor+QycnCor*QyanCor)*(energyZNA+energyZNC));
2152 
2153  //V0A-TPC
2154  fHist_Reso2n_ZDN_SP_Det[1]->Fill(EvtCent, 0., (QTPCRe*QxanCor+QTPCIm*QyanCor));
2155  fHist_Reso2n_ZDN_SP_Det[1]->Fill(EvtCent, 1., (QTPCRe*QxanCor+QTPCIm*QyanCor)*energyZPA);
2156  fHist_Reso2n_ZDN_SP_Det[1]->Fill(EvtCent, 2., (QTPCRe*QxanCor+QTPCIm*QyanCor)*energyZPC);
2157  fHist_Reso2n_ZDN_SP_Det[1]->Fill(EvtCent, 3., (QTPCRe*QxanCor+QTPCIm*QyanCor)*(energyZPA+energyZPC));
2158  fHist_Reso2n_ZDN_SP_Det[1]->Fill(EvtCent, 4., (QTPCRe*QxanCor+QTPCIm*QyanCor)*energyZNA);
2159  fHist_Reso2n_ZDN_SP_Det[1]->Fill(EvtCent, 5., (QTPCRe*QxanCor+QTPCIm*QyanCor)*energyZNC);
2160  fHist_Reso2n_ZDN_SP_Det[1]->Fill(EvtCent, 6., (QTPCRe*QxanCor+QTPCIm*QyanCor)*(energyZNA+energyZNC));
2161 
2162  //V0C-TPC
2163  fHist_Reso2n_ZDN_SP_Det[2]->Fill(EvtCent, 0., (QTPCRe*QxcnCor+QTPCIm*QycnCor));
2164  fHist_Reso2n_ZDN_SP_Det[2]->Fill(EvtCent, 1., (QTPCRe*QxcnCor+QTPCIm*QycnCor)*energyZPA);
2165  fHist_Reso2n_ZDN_SP_Det[2]->Fill(EvtCent, 2., (QTPCRe*QxcnCor+QTPCIm*QycnCor)*energyZPC);
2166  fHist_Reso2n_ZDN_SP_Det[2]->Fill(EvtCent, 3., (QTPCRe*QxcnCor+QTPCIm*QycnCor)*(energyZPA+energyZPC));
2167  fHist_Reso2n_ZDN_SP_Det[2]->Fill(EvtCent, 1., (QTPCRe*QxcnCor+QTPCIm*QycnCor)*energyZNA);
2168  fHist_Reso2n_ZDN_SP_Det[2]->Fill(EvtCent, 2., (QTPCRe*QxcnCor+QTPCIm*QycnCor)*energyZNC);
2169  fHist_Reso2n_ZDN_SP_Det[2]->Fill(EvtCent, 3., (QTPCRe*QxcnCor+QTPCIm*QycnCor)*(energyZNA+energyZNC));
2170  }
2171 
2172  }//---- SP method -------
2173 
2174 
2175  PostData(1,fListHistos);
2176  PostData(2,fListCalibs);
2177 
2178  fHist_Event_count->Fill(9.5);
2179 
2180  //if(fievent%100==0) {
2181  //cout<<"irun = "<<runindex<<" n "<<n<<" m = "<<m<<" p = "<<p<<" cent= "<<EvtCent<<"\tiCentSPD = "<<iCentSPD<<"\tQRe= "<<QTPCRe<<"\tQIm= "<<QTPCIm<<"\tpsiN = "<<psiN<<endl;
2182  //cout<<" cent= "<<EvtCent<<"\teZNC= "<<energyZNC<<"\teZPC = "<<energyZPC<<"\teZNA= "<<energyZNA<<"\teZPA = "<<energyZPA<<endl;
2183  //}
2184 
2185  fievent++;
2186 
2187 }
2188 //======================= UserExec done =========================
2189 
2190 
2191 
2193 {
2194  AliDebug(2,"\n ... AliAnalysisTaskCMEV0::Terminate() is being called ... \n");
2195 }
2196 
2197 
2198 
2199 
2200 
2201 
2202 
2203 
2204 
2205 
2206 
2207 
2208 
2209 void AliAnalysisTaskCMEV0::GetV0QvectAndMult(const AliAODVZERO *aodV0,Float_t fHarmonic, Double_t& Qxan,Double_t& Qyan,Double_t& sumMa,Double_t& Qxcn,Double_t& Qycn,Double_t& sumMc)
2210 {
2211  for(Int_t iV0 = 0; iV0 < 64; iV0++) {
2212  /*if(fRemChV0A){
2213  if(iV0 == 46)
2214  continue;
2215  }*/
2216  Double_t phiV0 = TMath::PiOver4()*(0.5 + iV0 % 8);
2217  Float_t multv0 = aodV0->GetMultiplicity(iV0);
2218 
2219  if(iV0 < 32) {
2220  Double_t multCorC = -10;
2221 
2222  if(iV0 < 8)
2223  multCorC = multv0/fMultV0->GetBinContent(iV0+1)*fMultV0->GetBinContent(1);
2224  else if(iV0 >= 8 && iV0 < 16)
2225  multCorC = multv0/fMultV0->GetBinContent(iV0+1)*fMultV0->GetBinContent(9);
2226  else if(iV0 >= 16 && iV0 < 24)
2227  multCorC = multv0/fMultV0->GetBinContent(iV0+1)*fMultV0->GetBinContent(17);
2228  else if(iV0 >= 24 && iV0 < 32)
2229  multCorC = multv0/fMultV0->GetBinContent(iV0+1)*fMultV0->GetBinContent(25);
2230 
2231  if(multCorC < 0){
2232  cout<<"Problem with multiplicity in V0C"<<endl;
2233  continue;
2234  }
2235  Qxcn += TMath::Cos(fHarmonic*phiV0) * multCorC;
2236  Qycn += TMath::Sin(fHarmonic*phiV0) * multCorC;
2237 
2238  sumMc = sumMc + multCorC;
2239  }
2240  else{
2241  Double_t multCorA = -10;
2242 
2243  if(iV0 >= 32 && iV0 < 40)
2244  multCorA = multv0/fMultV0->GetBinContent(iV0+1)*fMultV0->GetBinContent(33);
2245  else if(iV0 >= 40 && iV0 < 48)
2246  multCorA = multv0/fMultV0->GetBinContent(iV0+1)*fMultV0->GetBinContent(41);
2247  else if(iV0 >= 48 && iV0 < 56)
2248  multCorA = multv0/fMultV0->GetBinContent(iV0+1)*fMultV0->GetBinContent(49);
2249  else if(iV0 >= 56 && iV0 < 64)
2250  multCorA = multv0/fMultV0->GetBinContent(iV0+1)*fMultV0->GetBinContent(57);
2251 
2252  if(multCorA < 0){
2253  cout<<"Problem with multiplicity in V0A"<<endl;
2254  continue;
2255  }
2256  Qxan += TMath::Cos(fHarmonic*phiV0) * multCorA;
2257  Qyan += TMath::Sin(fHarmonic*phiV0) * multCorA;
2258 
2259  sumMa = sumMa + multCorA;
2260  }
2261  }
2262 }//-------- Get V0 QVect and Multiplicity -----
2263 
2265 {
2266  if(fListZDNCorr){
2267  fHCorrectZDNP = (TH2D *) fListZDNCorr->FindObject(Form("fHist_ZDC_All_Wgt_VsCent_Run%d",run));
2268  }
2269  else{
2270  fHCorrectZDNP = new TH2D("fHCorrectZDNP","",100,0,100,4,0,4) ;
2271  for(int i=1;i<=100;i++){
2272  for(int j=1;j<=4;j++){
2273  fHCorrectZDNP->SetBinContent(i,j,1.0);
2274  }
2275  }
2276  //printf("\n\n ********** ZDC Wgt Histograms NotFound ***************\n\n");
2277  //exit(1);
2278  }
2279 }
2280 
2282 {
2283 
2284  //old method
2285  /*
2286  Int_t centBin = -1;
2287  if(cent<5.0){ centBin = 0;}
2288  else if(cent>=5.0 && cent<10.0){centBin = 1;}
2289  else if(cent>=10.0 && cent<40.0){centBin = 2;}
2290  else if(cent>=40.0) {centBin = 3;}
2291  if(fListNUACorr){
2292  fHCorrectNUApos = (TH3D *) fListNUACorr->FindObject(Form("fHist_NUA_VzPhiEta_Pos_Cent%d_Run%d",centBin,run));
2293  fHCorrectNUAneg = (TH3D *) fListNUACorr->FindObject(Form("fHist_NUA_VzPhiEta_Neg_Cent%d_Run%d",centBin,run));
2294  } */
2295 
2296  if(sfileNUA=="New2018" && fListNUACorr){
2297  for(int i=0;i<5;i++){
2298  fHCorrectNUApos[i] = (TH3D *) fListNUACorr->FindObject(Form("fHist_NUA_VzPhiEta_Pos_Cent%d_Run%d",i,run));
2299  fHCorrectNUAneg[i] = (TH3D *) fListNUACorr->FindObject(Form("fHist_NUA_VzPhiEta_Neg_Cent%d_Run%d",i,run));
2300  }
2301  //cout<<"\n sfileNUA = "<<sfileNUA<<" opening Rihan's NUA file.\n "<<endl;
2302  }
2303  else if(sfileNUA=="NewR" && fListNUACorr){
2304  for(int i=0;i<4;i++){
2305  fHCorrectNUApos[i] = (TH3D *) fListNUACorr->FindObject(Form("fHist_NUA_VzPhiEta_Pos_Cent%d_Run%d",i,run));
2306  fHCorrectNUAneg[i] = (TH3D *) fListNUACorr->FindObject(Form("fHist_NUA_VzPhiEta_Neg_Cent%d_Run%d",i,run));
2307  }
2308  //cout<<"\n sfileNUA = "<<sfileNUA<<" opening Rihan's NUA file.\n "<<endl;
2309  }
2310  else if(sfileNUA=="NewPt"|| sfileNUA=="NewpT"){
2311  if(fListNUACorr){
2312  for(int i=0;i<4;i++){
2313  fHCorrectNUApos[i] = (TH3D *) fListNUACorr->FindObject(Form("fHist_NUA_pTPhiEta_Pos_Vz%d_Run%d",i,run));
2314  fHCorrectNUAneg[i] = (TH3D *) fListNUACorr->FindObject(Form("fHist_NUA_pTPhiEta_Neg_Vz%d_Run%d",i,run));
2315  }
2316  }
2317  }
2318  else if(sfileNUA=="OldJ") {//from Jacopo's NUA file:
2319  if(!gGrid){
2320  TGrid::Connect("alien://");
2321  }
2322  if(!fileNUApos){
2323  fileNUApos = TFile::Open("alien:///alice/cern.ch/user/m/mhaque/calib_files/15oHI_FB768_PosCh_CenPhiEtaWeights_VtxRbR.root");
2324  mListNUAPos = dynamic_cast<TList*> (fileNUApos->FindObjectAny("CenPhiEta Weights"));
2325  }
2326  if(!fileNUAneg){
2327  fileNUAneg = TFile::Open("alien:///alice/cern.ch/user/m/mhaque/calib_files/15oHI_FB768_NegCh_CenPhiEtaWeights_VtxRbR.root");
2328  mListNUANeg = dynamic_cast<TList*> (fileNUAneg->FindObjectAny("CenPhiEta Weights"));
2329  }
2330  if(mListNUAPos){
2331  for(int i=0;i<4;i++){
2332  fHCorrectNUApos[i] = (TH3D *) mListNUAPos->FindObject(Form("CRCQVecPhiHistVtx[%d][%d]",i,run));
2333  }
2334  }
2335  if(mListNUANeg){
2336  for(int i=0;i<4;i++){
2337  fHCorrectNUAneg[i] = (TH3D *) mListNUANeg->FindObject(Form("CRCQVecPhiHistVtx[%d][%d]",i,run));
2338  }
2339  }
2340  }
2341 
2342 
2343  if(!fHCorrectNUApos[0] || !fHCorrectNUAneg[0]){
2344  printf("\n\n ******** could not open NUA Histograms for run %d, Use Wgt = 1.0 *********\n\n",run);
2345  if(sfileNUA=="New2018"){
2346  for(int i=0;i<5;i++){
2347  fHCorrectNUApos[i] = new TH3D(Form("fHCorrectNUApos_cent%d",i),"",1,-10,10,1,0,6.284,1,-0.9,0.9);
2348  fHCorrectNUAneg[i] = new TH3D(Form("fHCorrectNUAneg_cent%d",i),"",1,-10,10,1,0,6.284,1,-0.9,0.9);
2349  fHCorrectNUApos[i]->SetBinContent(1,1,1,1.0);
2350  fHCorrectNUAneg[i]->SetBinContent(1,1,1,1.0);
2351  //exit(1);
2352  }
2353  }
2354  else if(sfileNUA=="OldJ"|| sfileNUA=="NewR"){
2355  for(int i=0;i<4;i++){
2356  fHCorrectNUApos[i] = new TH3D(Form("fHCorrectNUApos_cent%d",i),"",1,-10,10,1,0,6.284,1,-0.9,0.9);
2357  fHCorrectNUAneg[i] = new TH3D(Form("fHCorrectNUAneg_cent%d",i),"",1,-10,10,1,0,6.284,1,-0.9,0.9);
2358  fHCorrectNUApos[i]->SetBinContent(1,1,1,1.0);
2359  fHCorrectNUAneg[i]->SetBinContent(1,1,1,1.0);
2360  //exit(1);
2361  }
2362  }
2363  else if(sfileNUA=="NewPt"|| sfileNUA=="NewpT"){
2364  for(int i=0;i<4;i++){
2365  fHCorrectNUApos[i] = new TH3D(Form("fHCorrectNUApos_cent%d",i),"",1,0,10,1,0,6.284,1,-0.9,0.9);
2366  fHCorrectNUAneg[i] = new TH3D(Form("fHCorrectNUAneg_cent%d",i),"",1,0,10,1,0,6.284,1,-0.9,0.9);
2367  fHCorrectNUApos[i]->SetBinContent(1,1,1,1.0);
2368  fHCorrectNUAneg[i]->SetBinContent(1,1,1,1.0);
2369  //exit(1);
2370  }
2371  }
2372  }
2373 }
2374 
2375 
2376 
2378 {
2379  if(!gGrid){
2380  TGrid::Connect("alien://");
2381  }
2382 
2383  TFile* foadb = 0;
2384  //if(!fRemChV0A)
2385  foadb = TFile::Open("alien:///alice/cern.ch/user/a/adobrin/calibV0HIR.root");
2386  //else
2387  //foadb = TFile::Open("alien:///alice/cern.ch/user/a/adobrin/calibV0HIRNoCh46V0A.root");
2388 
2389  if(!foadb){
2390  printf("OADB V0 calibration file cannot be opened\n");
2391  return;
2392  }
2393 
2394  AliOADBContainer* cont = (AliOADBContainer*) foadb->Get("hMultV0BefCorPfpx");
2395  if(!cont){
2396  printf("OADB object hMultV0BefCorr is not available in the file\n");
2397  return;
2398  }
2399  if(!(cont->GetObject(run))){
2400  printf("OADB object hMultV0BefCorPfpx is not available for run %i\n", run);
2401  return;
2402  }
2403  fMultV0 = ((TH1D*) cont->GetObject(run));
2404 
2405  AliOADBContainer* contQxnam = 0;
2406  if (fHarmonic == 2.)
2407  contQxnam = (AliOADBContainer*) foadb->Get("fqxa2m");
2408  else
2409  contQxnam = (AliOADBContainer*) foadb->Get("fqxa3m");
2410 
2411  if(!contQxnam){
2412  printf("OADB object fqxanm is not available in the file\n");
2413  return;
2414  }
2415  if(!(contQxnam->GetObject(run))){
2416  printf("OADB object fqxanm is not available for run %i\n", run);
2417  return;
2418  }
2419  fQxnmV0A = ((TH1D*) contQxnam->GetObject(run));
2420 
2421  AliOADBContainer* contQynam = 0;
2422  if (fHarmonic == 2.)
2423  contQynam = (AliOADBContainer*) foadb->Get("fqya2m");
2424  else if (fHarmonic == 3.)
2425  contQynam = (AliOADBContainer*) foadb->Get("fqya3m");
2426  else if (fHarmonic == 4.)
2427  contQynam = (AliOADBContainer*) foadb->Get("fqya4m");
2428 
2429  if(!contQynam){
2430  printf("OADB object fqyanm is not available in the file\n");
2431  return;
2432  }
2433  if(!(contQynam->GetObject(run))){
2434  printf("OADB object fqyanm is not available for run %i\n", run);
2435  return;
2436  }
2437  fQynmV0A = ((TH1D*) contQynam->GetObject(run));
2438 
2439  AliOADBContainer* contQxnas = 0;
2440  if (fHarmonic == 2.)
2441  contQxnas = (AliOADBContainer*) foadb->Get("fqxa2s");
2442  else
2443  contQxnas = (AliOADBContainer*) foadb->Get("fqxa3s");
2444 
2445  if(!contQxnas){
2446  printf("OADB object fqxans is not available in the file\n");
2447  return;
2448  }
2449  if(!(contQxnas->GetObject(run))){
2450  printf("OADB object fqxans is not available for run %i\n", run);
2451  return;
2452  }
2453  fQxnsV0A = ((TH1D*) contQxnas->GetObject(run));
2454 
2455  AliOADBContainer* contQynas = 0;
2456  if (fHarmonic == 2.)
2457  contQynas = (AliOADBContainer*) foadb->Get("fqya2s");
2458  else if (fHarmonic == 3.)
2459  contQynas = (AliOADBContainer*) foadb->Get("fqya3s");
2460  else if (fHarmonic == 4.)
2461  contQynas = (AliOADBContainer*) foadb->Get("fqya4s");
2462 
2463  if(!contQynas){
2464  printf("OADB object fqyans is not available in the file\n");
2465  return;
2466  }
2467  if(!(contQynas->GetObject(run))){
2468  printf("OADB object fqyans is not available for run %i\n", run);
2469  return;
2470  }
2471  fQynsV0A = ((TH1D*) contQynas->GetObject(run));
2472 
2473 
2474 
2475  AliOADBContainer* contQxncm = 0;
2476  if (fHarmonic == 2.)
2477  contQxncm = (AliOADBContainer*) foadb->Get("fqxc2m");
2478  else
2479  contQxncm = (AliOADBContainer*) foadb->Get("fqxc3m");
2480 
2481  if(!contQxncm){
2482  printf("OADB object fqxcnm is not available in the file\n");
2483  return;
2484  }
2485  if(!(contQxncm->GetObject(run))){
2486  printf("OADB object fqxcnm is not available for run %i\n", run);
2487  return;
2488  }
2489  fQxnmV0C = ((TH1D*) contQxncm->GetObject(run));
2490 
2491 
2492 
2493  AliOADBContainer* contQyncm = 0;
2494  if (fHarmonic == 2.)
2495  contQyncm = (AliOADBContainer*) foadb->Get("fqyc2m");
2496  else if (fHarmonic == 3.)
2497  contQyncm = (AliOADBContainer*) foadb->Get("fqyc3m");
2498  else if (fHarmonic == 4.)
2499  contQyncm = (AliOADBContainer*) foadb->Get("fqyc4m");
2500 
2501  if(!contQyncm){
2502  printf("OADB object fqyc2m is not available in the file\n");
2503  return;
2504  }
2505  if(!(contQyncm->GetObject(run))){
2506  printf("OADB object fqyc2m is not available for run %i\n", run);
2507  return;
2508  }
2509  fQynmV0C = ((TH1D*) contQyncm->GetObject(run));
2510 
2511 
2512  AliOADBContainer* contQxncs = 0;
2513  if (fHarmonic == 2.)
2514  contQxncs = (AliOADBContainer*) foadb->Get("fqxc2s");
2515  else
2516  contQxncs = (AliOADBContainer*) foadb->Get("fqxc3s");
2517 
2518  if(!contQxncs){
2519  printf("OADB object fqxc2s is not available in the file\n");
2520  return;
2521  }
2522  if(!(contQxncs->GetObject(run))){
2523  printf("OADB object fqxc2s is not available for run %i\n", run);
2524  return;
2525  }
2526  fQxnsV0C = ((TH1D*) contQxncs->GetObject(run));
2527 
2528 
2529  AliOADBContainer* contQyncs = 0;
2530  if (fHarmonic == 2.)
2531  contQyncs = (AliOADBContainer*) foadb->Get("fqyc2s");
2532  else if (fHarmonic == 3.)
2533  contQyncs = (AliOADBContainer*) foadb->Get("fqyc3s");
2534  else if (fHarmonic == 4.)
2535  contQyncs = (AliOADBContainer*) foadb->Get("fqyc4s");
2536 
2537  if(!contQyncs){
2538  printf("OADB object fqycnm is not available in the file\n");
2539  return;
2540  }
2541  if(!(contQyncs->GetObject(run))){
2542  printf("OADB object fqycns is not available for run %i\n", run);
2543  return;
2544  }
2545  fQynsV0C = ((TH1D*) contQyncs->GetObject(run));
2546 }//------- OADB container ------
2547 
2548 
2549 
2550 
2551 double AliAnalysisTaskCMEV0::GetWDist(const AliVVertex* v0, const AliVVertex* v1)
2552 {
2553  // calculate sqrt of weighted distance to other vertex
2554  if (!v0 || !v1) {
2555  AliDebug(2,"\n\n ::GetWDist => One of vertices is not valid\n\n");
2556  return 0;
2557  }
2558  static TMatrixDSym vVb(3);
2559  double dist = -1;
2560  double dx = v0->GetX()-v1->GetX();
2561  double dy = v0->GetY()-v1->GetY();
2562  double dz = v0->GetZ()-v1->GetZ();
2563  double cov0[6],cov1[6];
2564  v0->GetCovarianceMatrix(cov0);
2565  v1->GetCovarianceMatrix(cov1);
2566  vVb(0,0) = cov0[0]+cov1[0];
2567  vVb(1,1) = cov0[2]+cov1[2];
2568  vVb(2,2) = cov0[5]+cov1[5];
2569  vVb(1,0) = vVb(0,1) = cov0[1]+cov1[1];
2570  vVb(0,2) = vVb(1,2) = vVb(2,0) = vVb(2,1) = 0.;
2571  vVb.InvertFast();
2572  if (!vVb.IsValid()) {
2573  AliDebug(2,"Singular Matrix\n");
2574  return dist;
2575  }
2576  dist = vVb(0,0)*dx*dx + vVb(1,1)*dy*dy + vVb(2,2)*dz*dz
2577  + 2*vVb(0,1)*dx*dy + 2*vVb(0,2)*dx*dz + 2*vVb(1,2)*dy*dz;
2578  return dist>0 ? TMath::Sqrt(dist) : -1;
2579 }
2580 
2582  { // check for multi-vertexer pile-up
2583  const int kMinPlpContrib = 5;
2584  const double kMaxPlpChi2 = 5.0;
2585  const double kMinWDist = 15;
2586 
2587  const AliVVertex* vtPrm = 0;
2588  const AliVVertex* vtPlp = 0;
2589 
2590  int nPlp = 0;
2591 
2592  if(!(nPlp=faod->GetNumberOfPileupVerticesTracks()))
2593  return kFALSE;
2594 
2595  vtPrm = faod->GetPrimaryVertex();
2596  if(vtPrm == faod->GetPrimaryVertexSPD())
2597  return kTRUE; // there are pile-up vertices but no primary
2598 
2599  //int bcPrim = vtPrm->GetBC();
2600 
2601  for(int ipl=0;ipl<nPlp;ipl++) {
2602  vtPlp = (const AliVVertex*)faod->GetPileupVertexTracks(ipl);
2603  if (vtPlp->GetNContributors() < kMinPlpContrib) continue;
2604  if (vtPlp->GetChi2perNDF() > kMaxPlpChi2) continue;
2605  //int bcPlp = vtPlp->GetBC();
2606  //if (bcPlp!=AliVTrack::kTOFBCNA && TMath::Abs(bcPlp-bcPrim)>2)
2607  // return kTRUE; // pile-up from other BC
2608 
2609  double wDst = GetWDist(vtPrm,vtPlp);
2610  if (wDst<kMinWDist) continue;
2611 
2612  return kTRUE; // pile-up: well separated vertices
2613  }
2614  return kFALSE;
2615 }
2616 
2617 
2618 
2620 {
2621 /*
2622  if(!gGrid){
2623  TGrid::Connect("alien://");
2624  }
2625 
2626  TFile *fileV0M = TFile::Open(fFileV0MCorr);
2627  if(!fileV0M){
2628  printf("\n\n ********** File for V0M gain eq. not found ***************\n\n");
2629  }
2630 
2631  TList *mListV0M = dynamic_cast<TList*> (fileV0M->FindObjectAny("fV0MChWgts"));
2632 */
2633  if(fListV0MCorr){
2634  fHCorrectV0M = (TH1D *) fListV0MCorr->FindObject(Form("fHistV0Gain_Run%d",run));
2635  fHAvgerageQnV0A = (TH2D *) fListV0MCorr->FindObject(Form("fHistAvgQnV0A_Run%d",run));
2636  fHAvgerageQnV0C = (TH2D *) fListV0MCorr->FindObject(Form("fHistAvgQnV0C_Run%d",run));
2637  }
2638  else{
2639  fHCorrectV0M = new TH1D("fHCorrectV0M","",64,0,64);
2640  for(int i=1;i<=64;i++){
2641  fHCorrectV0M->SetBinContent(i,1.0);
2642  }
2643  fHAvgerageQnV0A = new TH2D("fHAvgerageQnV0A_empty","<Cos2>,<Sin2>,<Cos3>,<Sin3> V0A",90,0,90,8,0,8);
2644  fHAvgerageQnV0C = new TH2D("fHAvgerageQnV0C_empty","<Cos2>,<Sin2>,<Cos3>,<Sin3> V0A",90,0,90,8,0,8);
2645  for(int i=1;i<=90;i++){
2646  for(int j=1;j<=8;j++){
2647  fHAvgerageQnV0A->SetBinContent(i,j,0.0);
2648  fHAvgerageQnV0C->SetBinContent(i,j,0.0);
2649  }
2650  }
2651  }
2652 }
2653 
2654 
2655 
2656 
2658 
2659  Bool_t BisPileup=kFALSE;
2660 
2661  Double_t centrV0M=300;
2662  Double_t centrCL1=300;
2663  Double_t centrCL0=300;
2664  Double_t centrTRK=300;
2665 
2666  if(sDataSet=="2010"||sDataSet=="2011") {
2667  centrV0M = ((AliVAODHeader*)faod->GetHeader())->GetCentralityP()->GetCentralityPercentile("V0M");
2668  centrCL1 = ((AliVAODHeader*)faod->GetHeader())->GetCentralityP()->GetCentralityPercentile("CL1");
2669  centrCL0 = ((AliVAODHeader*)faod->GetHeader())->GetCentralityP()->GetCentralityPercentile("CL0");
2670  centrTRK = ((AliVAODHeader*)faod->GetHeader())->GetCentralityP()->GetCentralityPercentile("TRK");
2671  }
2672  else{
2673  fMultSelection = (AliMultSelection*) InputEvent()->FindListObject("MultSelection");
2674  if(!fMultSelection) {
2675  printf("\n\n **WARNING** ::UserExec() AliMultSelection object not found.\n\n");
2676  exit(1);
2677  }
2678  centrV0M = fMultSelection->GetMultiplicityPercentile("V0M");
2679  centrCL1 = fMultSelection->GetMultiplicityPercentile("CL1");
2680  centrCL0 = fMultSelection->GetMultiplicityPercentile("CL0");
2681  centrTRK = fMultSelection->GetMultiplicityPercentile("TRK");
2682  }// 2015,pPb
2683 
2684 
2685  if(fRejectPileUp && InputEvent()) {
2686 
2687  //if(!fCutsEvent->IsSelected(InputEvent(),MCEvent())) return;
2688 
2689  if(sDataSet!="2015" && sDataSet!="2015LI" && sDataSet!="2015pPb" && sDataSet!="pPb") {
2690  if(PileUpMultiVertex(faod)) {
2691  fPileUpCount->Fill(0.5);
2692  BisPileup=kTRUE;
2693  }
2694  Int_t isPileup = faod->IsPileupFromSPD(3);
2695  if(isPileup != 0) {
2696  fPileUpCount->Fill(1.5);
2697  //BisPileup=kTRUE; //
2698  }
2699  if(((AliAODHeader*)faod->GetHeader())->GetRefMultiplicityComb08() < 0) {
2700  fPileUpCount->Fill(2.5);
2701  BisPileup=kTRUE;
2702  }
2703  if(faod->IsIncompleteDAQ()) {
2704  fPileUpCount->Fill(3.5);
2705  BisPileup=kTRUE;
2706  }
2707 
2708  //check vertex consistency
2709  const AliAODVertex* vtTrc = faod->GetPrimaryVertex();
2710  const AliAODVertex* vtSPD = faod->GetPrimaryVertexSPD();
2711 
2712  if(vtTrc->GetNContributors() < 2 || vtSPD->GetNContributors()<1) {
2713  fPileUpCount->Fill(5.5);
2714  BisPileup=kTRUE;
2715  }
2716 
2717  double covTrc[6], covSPD[6];
2718  vtTrc->GetCovarianceMatrix(covTrc);
2719  vtSPD->GetCovarianceMatrix(covSPD);
2720 
2721  double dz = vtTrc->GetZ() - vtSPD->GetZ();
2722 
2723  double errTot = TMath::Sqrt(covTrc[5]+covSPD[5]);
2724  double errTrc = TMath::Sqrt(covTrc[5]);
2725  double nsigTot = dz/errTot;
2726  double nsigTrc = dz/errTrc;
2727 
2728  if(TMath::Abs(dz)>0.2 || TMath::Abs(nsigTot)>10 || TMath::Abs(nsigTrc)>20) {
2729  fPileUpCount->Fill(6.5);
2730  BisPileup=kTRUE;
2731  }
2732  if(fAnalysisUtil->IsPileUpEvent(InputEvent())) {
2733  fPileUpCount->Fill(7.5);
2734  BisPileup=kTRUE;
2735  }
2736  }
2737 
2738  else { //------------ pileup for 2015HI,LI, 2016,pPb data -----------------
2739 
2740  if(!fMultSelection->GetThisEventIsNotPileup())
2741  fPileUpMultSelCount->Fill(0.5);
2742  if(!fMultSelection->GetThisEventIsNotPileupMV())
2743  fPileUpMultSelCount->Fill(1.5);
2744  if(!fMultSelection->GetThisEventIsNotPileupInMultBins())
2745  fPileUpMultSelCount->Fill(2.5);
2746  if(!fMultSelection->GetThisEventHasNoInconsistentVertices())
2747  fPileUpMultSelCount->Fill(3.5);
2748  if(!fMultSelection->GetThisEventPassesTrackletVsCluster())
2749  fPileUpMultSelCount->Fill(4.5);
2750  if(!fMultSelection->GetThisEventIsNotAsymmetricInVZERO())
2751  fPileUpMultSelCount->Fill(5.5);
2752  if(!fMultSelection->GetThisEventIsNotIncompleteDAQ())
2753  fPileUpMultSelCount->Fill(6.5);
2754  if(!fMultSelection->GetThisEventHasGoodVertex2016())
2755  fPileUpMultSelCount->Fill(7.5);
2756 
2757  BisPileup=kFALSE;
2758 
2759  //-- pile-up a la Dobrin for LHC15o -----
2760  if(PileUpMultiVertex(faod)) {
2761  fPileUpCount->Fill(0.5);
2762  BisPileup=kTRUE;
2763  }
2764  Int_t isPileup = faod->IsPileupFromSPD(3);
2765  if(isPileup != 0) {
2766  fPileUpCount->Fill(1.5);
2767  BisPileup=kTRUE;
2768  }
2769  if(((AliAODHeader*)faod->GetHeader())->GetRefMultiplicityComb08() < 0) {
2770  fPileUpCount->Fill(2.5);
2771  BisPileup=kTRUE;
2772  }
2773  if(faod->IsIncompleteDAQ()) {
2774  fPileUpCount->Fill(3.5);
2775  BisPileup=kTRUE;
2776  }
2777  if(fabs(centrV0M-centrCL1)> 5.0) {//default: 7.5
2778  fPileUpCount->Fill(4.5);
2779  BisPileup=kTRUE;
2780  }
2781 
2782  // check vertex consistency
2783  const AliAODVertex* vtTrc = faod->GetPrimaryVertex();
2784  const AliAODVertex* vtSPD = faod->GetPrimaryVertexSPD();
2785 
2786  if(vtTrc->GetNContributors() < 2 || vtSPD->GetNContributors()<1) {
2787  fPileUpCount->Fill(5.5);
2788  BisPileup=kTRUE;
2789  }
2790 
2791  double covTrc[6], covSPD[6];
2792  vtTrc->GetCovarianceMatrix(covTrc);
2793  vtSPD->GetCovarianceMatrix(covSPD);
2794 
2795  double dz = vtTrc->GetZ() - vtSPD->GetZ();
2796 
2797  double errTot = TMath::Sqrt(covTrc[5]+covSPD[5]);
2798  double errTrc = TMath::Sqrt(covTrc[5]);
2799  double nsigTot = dz/errTot;
2800  double nsigTrc = dz/errTrc;
2801 
2802  if(TMath::Abs(dz)>0.2 || TMath::Abs(nsigTot)>10 || TMath::Abs(nsigTrc)>20) {
2803  fPileUpCount->Fill(6.5);
2804  BisPileup=kTRUE;
2805  }
2806 
2807  //cuts on tracks
2808  //Int_t multTrk = 0;
2809  //Int_t multTrkBefC = 0;
2810  //Int_t multTrkTOFBefC = 0;
2811 
2812 
2813 
2814  Int_t multTPC = 0;
2815  Int_t multITSfb96 = 0;
2816  Int_t multITSfb32 = 0;
2817 
2818  Int_t multTPCFE = 0;
2819  Int_t multGlobal = 0;
2820  Int_t multTPCuncut = 0;
2821  Float_t dEta1,dPt1,dPhi1,ptw1;
2822  Int_t ptBin,dChrg1;
2823 
2824  Int_t multEsd = ((AliAODHeader*)faod->GetHeader())->GetNumberOfESDTracks();
2825 
2826  const Int_t nTracks = faod->GetNumberOfTracks();
2827 
2828 
2829  fRefMultCorr = 0; //Global Variable
2830  fRefMultRaw = 0; //Global Variable
2831  Int_t cIndex = 0;
2832 
2833  EvtCent = centrV0M;
2834 
2835  if(EvtCent<5.0) {
2836  cIndex = 0;
2837  }
2838  else if(EvtCent>=5.0 && EvtCent<10){
2839  cIndex = 1;
2840  }
2841  else if(EvtCent>=10.0) {
2842  cIndex = abs(EvtCent/10.0) + 1;
2843  }
2844 
2845 
2846  for(Int_t iTracks = 0; iTracks < nTracks; iTracks++) {
2847  //AliNanoAODTrack* track = dynamic_cast<AliNanoAODTrack*>(faod->GetTrack(iTracks));
2848  AliAODTrack* track = (AliAODTrack*)faod->GetTrack(iTracks);
2849  if(!track) continue;
2850  //---------- old method -----------
2851  if(track->TestFilterBit(128))
2852  multTPC++;
2853  if(track->TestFilterBit(96))
2854  multITSfb96++;
2855  //----------------------------------
2856  if(track->TestFilterBit(1)) multTPCuncut++;
2857  if(track->TestFilterBit(32)) multITSfb32++;
2858 
2859  dEta1 = track->Eta();
2860  dPt1 = track->Pt();
2861  dPhi1 = track->Phi();
2862  dChrg1 = track->Charge();
2863 
2864  if(dPt1<0.2 || dPt1>5.0 || TMath::Abs(dEta1)>0.8 || track->GetTPCNcls()<70 || track->GetTPCsignal()<10.0)
2865  continue;
2866 
2867  //-------- GetRefMult corrected --------------
2868  if(sMCdimension=="1D"){
2869  ptBin = fFB_Efficiency_Cent[cIndex]->FindBin(dPt1);
2870  ptw1 = 1.0/fFB_Efficiency_Cent[cIndex]->GetBinContent(ptBin);
2871  }
2872  else if(sMCdimension=="3D"){
2873  if(dChrg1>0){
2874  ptBin = fFB_Efficiency_Pos[cIndex]->FindBin(dEta1,dPt1,dPhi1); //left here
2875  ptw1 = fFB_Efficiency_Pos[cIndex]->GetBinContent(ptBin);
2876  }
2877  else if(dChrg1<0){
2878  ptBin = fFB_Efficiency_Neg[cIndex]->FindBin(dEta1,dPt1,dPhi1); //left here
2879  ptw1 = fFB_Efficiency_Neg[cIndex]->GetBinContent(ptBin);
2880  }
2881  }
2882 
2883  if (ptw1>1e3) ptw1 = 1.0;
2884 
2885 
2886  //Get Corrected mulltiplicity:
2887  if(track->TestFilterBit(gFilterBit) && dPt1>=0.2 && TMath::Abs(dEta1) < 0.8) {
2888  fRefMultCorr += ptw1;
2889  fRefMultRaw++;
2890  }
2891 
2892 
2893  if(track->TestFilterBit(1) && track->Chi2perNDF()>0.2) multTPCFE++;
2894  if(!track->TestFilterBit(16) || track->Chi2perNDF()<0.1) continue;
2895 
2896 
2897  Double_t b[2] = {-99., -99.};
2898  Double_t bCov[3] = {-99., -99., -99.};
2899 
2900  AliAODTrack copy(*track);
2901  Double_t magField = faod->GetMagneticField();
2902 
2903  if(magField!=0){
2904  if(track->PropagateToDCA(faod->GetPrimaryVertex(), magField, 100., b, bCov) && TMath::Abs(b[0]) < 0.3 && TMath::Abs(b[1]) < 0.3) multGlobal++;
2905  }
2906  }
2907 
2908 
2909  /*
2910  for(Int_t it = 0; it < nTracks; it++) {
2911  AliAODTrack* aodTrk = (AliAODTrack*)faod->GetTrack(it);
2912  if(!aodTrk) {
2913  delete aodTrk;
2914  continue;
2915  }
2916  //if(aodTrk->TestFilterBit(32)){
2917  // multTrkBefC++;
2918  // if(TMath::Abs(aodTrk->GetTOFsignalDz()) <= 10. && aodTrk->GetTOFsignal() >= 12000. && aodTrk->GetTOFsignal() <= 25000.)
2919  // multTrkTOFBefC++;
2920  // if((TMath::Abs(aodTrk->Eta()) < 0.8) && (aodTrk->GetTPCNcls() >= 70) && (aodTrk->Pt() >= 0.2) && (aodTrk->Pt() < 20.))
2921  // multTrk++;
2922  //}
2923  if(aodTrk->TestFilterBit(128))
2924  multTPC++;
2925  if(aodTrk->TestFilterBit(96))
2926  multITSfb96++;
2927  } // end of for AOD track loop
2928 
2929  */
2930 
2931  Double_t multTPCn = multTPC;
2932  Double_t multEsdn = multEsd;
2933 
2934  Double_t multESDTPCDif = multEsdn - fPileUpSlopeParm*multTPCn;
2935  Double_t multTPCGlobDif = multTPCFE - fPileUpSlopeParm*multGlobal;
2936 
2937 
2938  //cout<<" multTPC = "<<multTPCn<<"\tESD = "<<multEsdn<<"\tMultRaw = "<<fRefMultRaw<<"\tMultCorr="<<fRefMultCorr<<endl;
2939 
2940  fTPCvsITSfb96->Fill(multITSfb96,multTPC); //multITSfb96 = FB 96, multTPC = FB 128
2941  fTPCvsITSfb32->Fill(multITSfb32,multTPC); //multITSfb32 = FB 32
2942  fTPCFEvsITSfb96->Fill(multITSfb96,multTPCFE); //multTPCFE = FB 1
2943 
2944  fGlobalTracks->Fill(multGlobal);
2945  fTPCvsGlobalTrk->Fill(multGlobal,multTPCFE);
2946  fTPCuncutvsGlobal->Fill(multGlobal,multTPCuncut);
2947 
2948 
2949 
2950  /*if(multESDTPCDif > (fRejectPileUpTight?700.:15000.)) {
2951  fPileUpCount->Fill(7.5);
2952  BisPileup=kTRUE;
2953  }*/
2954  /*if(multESDTPCDif > 15000.){ //default: 15000
2955  fPileUpCount->Fill(7.5);
2956  BisPileup=kTRUE;
2957  }*/
2958 
2959  if(fRejectPileUpTight) {
2960  if(multESDTPCDif > fPileUpConstParm) {
2961  fPileUpCount->Fill(7.5);
2962  BisPileup=kTRUE;
2963  }
2964  if(multTPCGlobDif > fPileUpConstParm) {
2965  fPileUpCount->Fill(8.5);
2966  //BisPileup=kTRUE;
2967  }
2968  if(BisPileup==kFALSE) {
2969  if(!fMultSelection->GetThisEventIsNotPileup()) BisPileup=kTRUE;
2970  if(!fMultSelection->GetThisEventIsNotPileupMV()) BisPileup=kTRUE;
2971  if(!fMultSelection->GetThisEventIsNotPileupInMultBins()) BisPileup=kTRUE;
2972  if(!fMultSelection->GetThisEventHasNoInconsistentVertices()) BisPileup=kTRUE;
2973  if(!fMultSelection->GetThisEventPassesTrackletVsCluster()) BisPileup=kTRUE;
2974  if(!fMultSelection->GetThisEventIsNotIncompleteDAQ()) BisPileup=kTRUE;
2975  if(!fMultSelection->GetThisEventHasGoodVertex2016()) BisPileup=kTRUE;
2976  if(BisPileup) fPileUpCount->Fill(9.5);
2977  }
2978  }
2979  }
2980  }
2981 
2982  return BisPileup;
2983 }//-------pile up function ------
2984 
2985 
2986 
2987 Float_t AliAnalysisTaskCMEV0::GetDPhiStar(Float_t phi1, Float_t pt1, Float_t charge1, Float_t phi2, Float_t pt2, Float_t charge2, Float_t radius, Float_t bSign) {
2988 
2989  static const Double_t kPi = TMath::Pi();
2990 
2991  Float_t dphistar = phi1 - phi2 - charge1 * bSign * TMath::ASin(0.075 * radius / pt1) + charge2 * bSign * TMath::ASin(0.075 * radius / pt2);
2992 
2993  if(dphistar < -kPi)
2994  dphistar = -kPi * 2 - dphistar;
2995 
2996  if(dphistar > kPi) // might look funny but is needed
2997  dphistar = kPi * 2 - dphistar;
2998 
2999  return dphistar;
3000 }
3001 
3002 
3003 
3004 
3005 
3006 
3007 
3009 
3010  Int_t irun = -1;
3011 
3012  for(int i=0;i<fRunFlag;i++){
3013  if(run==runNums[i])
3014  {
3015  irun = i;
3016  break;
3017  }
3018  }
3019  if(irun<0) {
3020  printf("\n ... **WARNING** \n::UserExec() runnumber not listed.\n EXIT..\n");
3021  }
3022 
3023  return irun;
3024 }//------ GetCurrentRunIndex --------
3025 
3026 
3028 
3029  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};
3030 
3031  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};
3032 
3033  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};
3034 
3035  Int_t runArray_2015LI[13] = {244917, 244918, 244975, 244980, 244982, 244983, 245061, 245064, 245066, 245068, 246390, 246391, 246392};
3036 
3037 //Int_t runArray_pPb_13cpass2[14] = {195677, 195675, 195673, 195644, 195635, 195633, 195596, 195593, 195592, 195568, 195567, 195566, 195531, 195529};
3038 
3039  Int_t runArray_pPb_16q_pass1[32] = {265309, 265332, 265334, 265335, 265336, 265338, 265339, 265342, 265343, 265344, 265377, 265378, 265381, 265383, 265384, 265385, 265387, 265388, 265419, 265420, 265421, 265422, 265424, 265425, 265426, 265427, 265435, 265499, 265500, 265501, 265521, 265525};
3040 
3041 
3042 
3043 
3044  if(sPeriod=="2010"){
3045  fRunFlag = 89;
3046  for(int i=0;i<fRunFlag;i++)
3047  runNums[i] = runArray_2010[i];
3048  }
3049  else if(sPeriod=="2011"){
3050  fRunFlag = 68; //<-- 2011 check
3051  for(int i=0;i<fRunFlag;i++)
3052  runNums[i] = runArray_2011[i];
3053  }
3054  else if(sPeriod=="2015" || sPeriod=="2015PbPb"){
3055  fRunFlag = 90;
3056  for(int i=0;i<fRunFlag;i++)
3057  runNums[i] = runArray_2015[i];
3058  }
3059  else if(sPeriod=="2015pPb" || sPeriod=="pPb"){
3060  fRunFlag = 32;
3061  for(int i=0;i<fRunFlag;i++)
3062  runNums[i] = runArray_pPb_16q_pass1[i];
3063  }
3064  else if(sPeriod=="2015LI"){
3065  fRunFlag = 13;
3066  for(int i=0;i<fRunFlag;i++)
3067  runNums[i] = runArray_2015LI[i];
3068  }
3069 
3070 
3071  else{
3072  printf("\n\n ***** Run Number not defined for this data set. *******\n\n Please modify code..\n\n");
3073  exit(1);
3074  }
3075 
3076 }//------- InitializeRunArray ---------
3077 
3078 
3079 
3081 
3082  fHist_Event_count = new TH1F("fHist_Event_count"," ",20,0,20);
3083  fHist_Event_count->GetXaxis()->SetBinLabel(1,"Called Exec()");
3084  fHist_Event_count->GetXaxis()->SetBinLabel(2,"AOD Exist");
3085  fHist_Event_count->GetXaxis()->SetBinLabel(3,"PileUp");
3086  fHist_Event_count->GetXaxis()->SetBinLabel(4,"iCentSPD<90");
3087  fHist_Event_count->GetXaxis()->SetBinLabel(5,"V0 Mult>0");
3088  fHist_Event_count->GetXaxis()->SetBinLabel(6,"TPC Q!=0");
3089  fHist_Event_count->GetXaxis()->SetBinLabel(7,"Bad Runs");
3090  fHist_Event_count->GetXaxis()->SetBinLabel(8,"..TBA..");
3091 
3092  fHist_Event_count->GetXaxis()->SetBinLabel(10,"Final Event");
3094 
3095  fPileUpMultSelCount = new TH1F("fPileUpMultSelCount", "fPileUpMultSelCount", 10, 0., 10.);
3096  fPileUpMultSelCount->GetXaxis()->SetBinLabel(1,"IsNotPileup");
3097  fPileUpMultSelCount->GetXaxis()->SetBinLabel(2,"IsNotPileupMV");
3098  fPileUpMultSelCount->GetXaxis()->SetBinLabel(3,"IsNotPileupInMultBins");
3099  fPileUpMultSelCount->GetXaxis()->SetBinLabel(4,"InconsistentVertices");
3100  fPileUpMultSelCount->GetXaxis()->SetBinLabel(5,"TrackletVsCluster");
3101  fPileUpMultSelCount->GetXaxis()->SetBinLabel(6,"AsymmetricInVZERO");
3102  fPileUpMultSelCount->GetXaxis()->SetBinLabel(7,"IncompleteDAQ");
3103  fPileUpMultSelCount->GetXaxis()->SetBinLabel(8,"GoodVertex2016");
3105 
3106  fPileUpCount = new TH1F("fPileUpCount", "fPileUpCount", 12, 0., 12.);
3107  fPileUpCount->GetXaxis()->SetBinLabel(1,"plpMV");
3108  fPileUpCount->GetXaxis()->SetBinLabel(2,"fromSPD");
3109  fPileUpCount->GetXaxis()->SetBinLabel(3,"RefMultiplicityComb08");
3110  fPileUpCount->GetXaxis()->SetBinLabel(4,"IncompleteDAQ");
3111  fPileUpCount->GetXaxis()->SetBinLabel(5,"abs(V0M-CL1)>5.0");
3112  fPileUpCount->GetXaxis()->SetBinLabel(6,"missingVtx");
3113  fPileUpCount->GetXaxis()->SetBinLabel(7,"inconsistentVtx");
3114  Int_t puConst = fPileUpConstParm;
3115  fPileUpCount->GetXaxis()->SetBinLabel(8,Form("multESDTPCDif>%d",puConst));
3116  fPileUpCount->GetXaxis()->SetBinLabel(9,Form("multGlobTPCDif>%d",puConst));
3117  fPileUpCount->GetXaxis()->SetBinLabel(10,"extraPileUpMultSel");
3118  fListHistos->Add(fPileUpCount);
3119 
3120  //To be implemented fully:
3121  fTaskConfigParm = new TH1F("fTaskConfigParm", "Connfig Values", 20, 0., 20.);
3122  fTaskConfigParm->GetXaxis()->SetBinLabel(1,"CentMin");
3123  fTaskConfigParm->GetXaxis()->SetBinLabel(2,"CentMax");
3124  fTaskConfigParm->GetXaxis()->SetBinLabel(3,"VzMin");
3125  fTaskConfigParm->GetXaxis()->SetBinLabel(4,"VzMax");
3126  fTaskConfigParm->GetXaxis()->SetBinLabel(5,"EtaMin");
3127  fTaskConfigParm->GetXaxis()->SetBinLabel(6,"EtaMax");
3128  fTaskConfigParm->GetXaxis()->SetBinLabel(7,"PtMin");
3129  fTaskConfigParm->GetXaxis()->SetBinLabel(8,"PtMax");
3130  fTaskConfigParm->GetXaxis()->SetBinLabel(9,"DCAxy");
3131  fTaskConfigParm->GetXaxis()->SetBinLabel(10,"DCAz");
3132  fTaskConfigParm->GetXaxis()->SetBinLabel(11,"MCcorrected?");
3133  fTaskConfigParm->GetXaxis()->SetBinLabel(12,"NUACorrected?");
3134  fTaskConfigParm->GetXaxis()->SetBinLabel(13,"V0gainCorr?");
3135  fTaskConfigParm->GetXaxis()->SetBinLabel(14,"ZDCgainCorr?");
3136  fTaskConfigParm->GetXaxis()->SetBinLabel(15,"harmonic N");
3137  fTaskConfigParm->GetXaxis()->SetBinLabel(16,"harmonic M");
3138  fTaskConfigParm->GetXaxis()->SetBinLabel(17,"harmonicPsi");
3140 
3141  if(sDataSet=="2015pPb" || sDataSet=="pPb") {
3142  fHistVtxZvsRun = new TH2F("fHistVtxZvsRun", " Vz (cm) ",fRunFlag,0,fRunFlag,200, -10, 10.);
3144  fHistVtxXvsRun = new TH2F("fHistVtxXvsRun", " Vx (cm) ",fRunFlag,0,fRunFlag,100, -1, 1.);
3146  fHistVtxYvsRun = new TH2F("fHistVtxYvsRun", " Vy (cm) ",fRunFlag,0,fRunFlag,100, -1, 1.);
3148  }
3149 
3150 
3151  //----- CME-ZDN correlator SP method---------
3152  for(int i=0;i<3;i++){ //ZDN_SP
3153  //Detector: 0 = V0A, 1 = V0C, 3 = Q-cumulant
3154  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,"");
3155  fHist_Corr3p_ZDN_SP_PN[i]->Sumw2();
3157  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,"");
3158  fHist_Corr3p_ZDN_SP_PP[i]->Sumw2();
3160  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,"");
3161  fHist_Corr3p_ZDN_SP_NN[i]->Sumw2();
3163  }
3164  //SP Resolution:
3165  for(int i=0;i<3;i++){
3166  //Det: 0 = v0c-v0a, 1 = v0a-TPC, 2 = v0c-TPC,
3167  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,"");
3168  fHist_Reso2n_ZDN_SP_Det[i]->Sumw2();
3170  }
3171  //--------------------------------------------
3172 
3173  Double_t centRange[11] = {0,5,10,20,30,40,50,60,70,80,90};
3174 
3175 
3176  fRejectRatioVsCR = new TProfile2D("fRejectRatioVsCentRun","",10,centRange,fRunFlag,0,fRunFlag);
3178 
3179 
3180 
3181  //----- CME SP method histograms ---------
3182  for(int i=0;i<2;i++){
3183  for(int j=0;j<3;j++){
3184  //Detector: 0 = V0A, 1 = V0C, 3 = Q-cumulant
3185  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,"");
3186  fHist_Corr3p_SP_Norm_PN[i][j]->Sumw2();
3188  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,"");
3189  fHist_Corr3p_SP_Norm_PP[i][j]->Sumw2();
3191  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,"");
3192  fHist_Corr3p_SP_Norm_NN[i][j]->Sumw2();
3194  }
3195  //EP Resolution:
3196  for(int j=0;j<3;j++){
3197  //Det: 0 = v0c-v0a, 1 = v0a-TPC, 2 = v0c-TPC,
3198  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,"");
3199  fHist_Reso2n_SP_Norm_Det[i][j]->Sumw2();
3201  }
3202  }
3203 
3204  Int_t gMaxRefMult = 4000;
3205 
3206  if(sDataSet=="2015pPb" || sDataSet=="pPb"){
3207  gMaxRefMult = 800;
3208  }
3209 
3210  //----- CME EP method histograms ---------
3211  for(int i=0;i<2;i++){
3212  for(int j=0;j<3;j++){
3213  //Detector: 0 = V0A, 1 = V0C, 3 = Q-cumulant
3214  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,"");
3215  fHist_Corr3p_EP_Norm_PN[i][j]->Sumw2();
3217  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,"");
3218  fHist_Corr3p_EP_Norm_PP[i][j]->Sumw2();
3220  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,"");
3221  fHist_Corr3p_EP_Norm_NN[i][j]->Sumw2();
3223  }
3224  //EP Resolution:
3225  for(int j=0;j<3;j++){
3226  //Det: 0 = v0c-v0a, 1 = v0a-TPC, 2 = v0c-TPC,
3227  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,"");
3228  fHist_Reso2n_EP_Norm_Det[i][j]->Sumw2();
3230  }
3231 
3232  //Same obsevables in Refmult bins:
3233  for(int j=0;j<3;j++){
3234  //Detector: 0 = V0A, 1 = V0C, 3 = Q-cumulant
3235  fHist_Corr3p_EP_Refm_PN[i][j] = new TProfile(Form("fHist_Corr3p_EP_Refm_PosNeg_Mag%d_Det%d",i,j+1),"opposit charge correlator",800,0,gMaxRefMult,"");
3236  fHist_Corr3p_EP_Refm_PN[i][j]->Sumw2();
3238  fHist_Corr3p_EP_Refm_PP[i][j] = new TProfile(Form("fHist_Corr3p_EP_Refm_PosPos_Mag%d_Det%d",i,j+1),"pos-pos charge correlator",800,0,gMaxRefMult,"");
3239  fHist_Corr3p_EP_Refm_PP[i][j]->Sumw2();
3241  fHist_Corr3p_EP_Refm_NN[i][j] = new TProfile(Form("fHist_Corr3p_EP_Refm_NegNeg_Mag%d_Det%d",i,j+1),"neg-neg charge correlator",800,0,gMaxRefMult,"");
3242  fHist_Corr3p_EP_Refm_NN[i][j]->Sumw2();
3244  }
3245  for(int j=0;j<3;j++){
3246  //Det: 0 = v0c-v0a, 1 = v0a-TPC, 2 = v0c-TPC,
3247  fHist_Reso2n_EP_Refm_Det[i][j] = new TProfile(Form("fHist_Reso2n_EP_Refm_Mag%d_DetComb%d",i,j+1),"Event plane Resolution",800,0,gMaxRefMult,"");
3248  fHist_Reso2n_EP_Refm_Det[i][j]->Sumw2();
3250  }
3251  }
3252 
3253 
3254 
3255 
3256 
3257 
3258 
3259  //two particle correlators:
3260  for(int i=0;i<2;i++){
3261  fHist_Corr2p_EP_Norm_PN[i] = new TProfile2D(Form("fHist_Corr2p_EP_Norm_PN_Mag%d",i),"<cos(n(phiA-phiB))>",10,centRange,4,0,4,"");
3263  fHist_Corr2p_EP_Norm_PP[i] = new TProfile2D(Form("fHist_Corr2p_EP_Norm_PP_Mag%d",i),"<cos(n(phiA-phiB))>",10,centRange,4,0,4,"");
3265  fHist_Corr2p_EP_Norm_NN[i] = new TProfile2D(Form("fHist_Corr2p_EP_Norm_NN_Mag%d",i),"<cos(n(phiA-phiB))>",10,centRange,4,0,4,"");
3267  }
3268  for(int i=0;i<2;i++){
3269  fHist_Corr2p_EP_Refm_PN[i] = new TProfile2D(Form("fHist_Corr2p_EP_Refm_PN_Mag%d",i),"<cos(n(phiA-phiB))>",800,0,gMaxRefMult,4,0,4,"");
3271  fHist_Corr2p_EP_Refm_PP[i] = new TProfile2D(Form("fHist_Corr2p_EP_Refm_PP_Mag%d",i),"<cos(n(phiA-phiB))>",800,0,gMaxRefMult,4,0,4,"");
3273  fHist_Corr2p_EP_Refm_NN[i] = new TProfile2D(Form("fHist_Corr2p_EP_Refm_NN_Mag%d",i),"<cos(n(phiA-phiB))>",800,0,gMaxRefMult,4,0,4,"");
3275  }
3276 
3277 
3278 
3279 
3280 
3281 
3282  fHV0AEventPlaneVsCent = new TH2F("fHV0AEventPlaneVsCent","Psi2 from V0A",10,centRange,50,0,3.1415);
3284  fHV0CEventPlaneVsCent = new TH2F("fHV0CEventPlaneVsCent","Psi2 from V0C",10,centRange,50,0,3.1415);
3286  fHTPCEventPlaneVsCent = new TH2F("fHTPCEventPlaneVsCent","Psi2 from TPC",10,centRange,50,0,3.1415);
3288 
3289 
3290 
3291 
3292  //TH1::SetDefaultSumw2();
3293 
3294  Char_t name[100], title[100];
3295 
3296 
3297 
3298  //Differential in pT:
3299  //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.};
3300 
3301  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};
3302 
3303  for(int i=0;i<2;i++){
3304  for(int j=0;j<6;j++){
3305  sprintf(name,"fHist_Corr3p_pTSum_EP_V0A_PN_Mag%d_Cent%d",i,j);
3306  sprintf(title,"PN 3p vs (pT1+pT2)/2, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
3307  fHist_Corr3p_pTSum_EP_V0A_PN[i][j] = new TProfile(name,title,20,pTRange,"");
3308  fHist_Corr3p_pTSum_EP_V0A_PN[i][j]->Sumw2();
3310 
3311  sprintf(name,"fHist_Corr3p_pTSum_EP_V0A_PP_Mag%d_Cent%d",i,j);
3312  sprintf(title,"PP 3p vs (pT1+pT2)/2, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
3313  fHist_Corr3p_pTSum_EP_V0A_PP[i][j] = new TProfile(name,title,20,pTRange,"");
3314  fHist_Corr3p_pTSum_EP_V0A_PP[i][j]->Sumw2();
3316 
3317  sprintf(name,"fHist_Corr3p_pTSum_EP_V0A_NN_Mag%d_Cent%d",i,j);
3318  sprintf(title,"NN 3p vs (pT1+pT2)/2, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
3319  fHist_Corr3p_pTSum_EP_V0A_NN[i][j] = new TProfile(name,title,20,pTRange,"");
3320  fHist_Corr3p_pTSum_EP_V0A_NN[i][j]->Sumw2();
3322  //-----v0c----
3323  sprintf(name,"fHist_Corr3p_pTSum_EP_V0C_PN_Mag%d_Cent%d",i,j);
3324  sprintf(title,"PN 3p vs (pT1+pT2)/2, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
3325  fHist_Corr3p_pTSum_EP_V0C_PN[i][j] = new TProfile(name,title,20,pTRange,"");
3326  fHist_Corr3p_pTSum_EP_V0C_PN[i][j]->Sumw2();
3328 
3329  sprintf(name,"fHist_Corr3p_pTSum_EP_V0C_PP_Mag%d_Cent%d",i,j);
3330  sprintf(title,"PP 3p vs (pT1+pT2)/2, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
3331  fHist_Corr3p_pTSum_EP_V0C_PP[i][j] = new TProfile(name,title,20,pTRange,"");
3332  fHist_Corr3p_pTSum_EP_V0C_PP[i][j]->Sumw2();
3334 
3335  sprintf(name,"fHist_Corr3p_pTSum_EP_V0C_NN_Mag%d_Cent%d",i,j);
3336  sprintf(title,"NN 3p vs (pT1+pT2)/2, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
3337  fHist_Corr3p_pTSum_EP_V0C_NN[i][j] = new TProfile(name,title,20,pTRange,"");
3338  fHist_Corr3p_pTSum_EP_V0C_NN[i][j]->Sumw2();
3340  }
3341  }
3342 
3343  for(int i=0;i<2;i++){
3344  for(int j=0;j<6;j++){
3345  sprintf(name,"fHist_Corr3p_pTDiff_EP_V0A_PN_Mag%d_Cent%d",i,j);
3346  sprintf(title,"PN 3p vs |pT1-pT2|, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
3347  fHist_Corr3p_pTDiff_EP_V0A_PN[i][j] = new TProfile(name,title,20,pTRange,"");
3348  fHist_Corr3p_pTDiff_EP_V0A_PN[i][j]->Sumw2();
3350 
3351  sprintf(name,"fHist_Corr3p_pTDiff_EP_V0A_PP_Mag%d_Cent%d",i,j);
3352  sprintf(title,"PP 3p vs |pT1-pT2|, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
3353  fHist_Corr3p_pTDiff_EP_V0A_PP[i][j] = new TProfile(name,title,20,pTRange,"");
3354  fHist_Corr3p_pTDiff_EP_V0A_PP[i][j]->Sumw2();
3356 
3357  sprintf(name,"fHist_Corr3p_pTDiff_EP_V0A_NN_Mag%d_Cent%d",i,j);
3358  sprintf(title,"NN 3p vs |pT1-pT2|, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
3359  fHist_Corr3p_pTDiff_EP_V0A_NN[i][j] = new TProfile(name,title,20,pTRange,"");
3360  fHist_Corr3p_pTDiff_EP_V0A_NN[i][j]->Sumw2();
3362  //-----v0c----
3363  sprintf(name,"fHist_Corr3p_pTDiff_EP_V0C_PN_Mag%d_Cent%d",i,j);
3364  sprintf(title,"PN 3p vs |pT1-pT2|, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
3365  fHist_Corr3p_pTDiff_EP_V0C_PN[i][j] = new TProfile(name,title,20,pTRange,"");
3366  fHist_Corr3p_pTDiff_EP_V0C_PN[i][j]->Sumw2();
3368 
3369  sprintf(name,"fHist_Corr3p_pTDiff_EP_V0C_PP_Mag%d_Cent%d",i,j);
3370  sprintf(title,"PP 3p vs |pT1-pT2|, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
3371  fHist_Corr3p_pTDiff_EP_V0C_PP[i][j] = new TProfile(name,title,20,pTRange,"");
3372  fHist_Corr3p_pTDiff_EP_V0C_PP[i][j]->Sumw2();
3374 
3375  sprintf(name,"fHist_Corr3p_pTDiff_EP_V0C_NN_Mag%d_Cent%d",i,j);
3376  sprintf(title,"NN 3p vs |pT1-pT2|, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
3377  fHist_Corr3p_pTDiff_EP_V0C_NN[i][j] = new TProfile(name,title,20,pTRange,"");
3378  fHist_Corr3p_pTDiff_EP_V0C_NN[i][j]->Sumw2();
3380  }
3381  }
3382 
3383  //Double_t EtaRange[9] = {0.0,0.2,0.4,0.6,0.8,1.0,1.2,1.4,1.6}; //Use this after tests done
3384  //Now Eta binning: 160,0,1.6 for test
3385 
3386  for(int i=0;i<2;i++){
3387  for(int j=0;j<6;j++){
3388  sprintf(name,"fHist_Corr3p_EtaDiff_EP_V0A_PN_Mag%d_Cent%d",i,j);
3389  sprintf(title,"PN 3p vs |Eta1-Eta2|, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
3390  fHist_Corr3p_EtaDiff_EP_V0A_PN[i][j] = new TProfile(name,title,160,0,1.6,"");
3391  fHist_Corr3p_EtaDiff_EP_V0A_PN[i][j]->Sumw2();
3393 
3394  sprintf(name,"fHist_Corr3p_EtaDiff_EP_V0A_PP_Mag%d_Cent%d",i,j);
3395  sprintf(title,"PP 3p vs |Eta1-Eta2|, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
3396  fHist_Corr3p_EtaDiff_EP_V0A_PP[i][j] = new TProfile(name,title,160,0,1.6,"");
3397  fHist_Corr3p_EtaDiff_EP_V0A_PP[i][j]->Sumw2();
3399 
3400  sprintf(name,"fHist_Corr3p_EtaDiff_EP_V0A_NN_Mag%d_Cent%d",i,j);
3401  sprintf(title,"NN 3p vs |Eta1-Eta2|, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
3402  fHist_Corr3p_EtaDiff_EP_V0A_NN[i][j] = new TProfile(name,title,160,0,1.6,"");
3403  fHist_Corr3p_EtaDiff_EP_V0A_NN[i][j]->Sumw2();
3405  //-----v0c----
3406  sprintf(name,"fHist_Corr3p_EtaDiff_EP_V0C_PN_Mag%d_Cent%d",i,j);
3407  sprintf(title,"PN 3p vs |Eta1-Eta2|, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
3408  fHist_Corr3p_EtaDiff_EP_V0C_PN[i][j] = new TProfile(name,title,160,0,1.6,"");
3409  fHist_Corr3p_EtaDiff_EP_V0C_PN[i][j]->Sumw2();
3411 
3412  sprintf(name,"fHist_Corr3p_EtaDiff_EP_V0C_PP_Mag%d_Cent%d",i,j);
3413  sprintf(title,"PP 3p vs |Eta1-Eta2|, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
3414  fHist_Corr3p_EtaDiff_EP_V0C_PP[i][j] = new TProfile(name,title,160,0,1.6,"");
3415  fHist_Corr3p_EtaDiff_EP_V0C_PP[i][j]->Sumw2();
3417 
3418  sprintf(name,"fHist_Corr3p_EtaDiff_EP_V0C_NN_Mag%d_Cent%d",i,j);
3419  sprintf(title,"NN 3p vs |Eta1-Eta2|, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
3420  fHist_Corr3p_EtaDiff_EP_V0C_NN[i][j] = new TProfile(name,title,160,0,1.6,"");
3421  fHist_Corr3p_EtaDiff_EP_V0C_NN[i][j]->Sumw2();
3423  }
3424  }
3425 
3426 
3427 
3428 
3429 
3430  //non-Isotropic terms for correction:
3431  for(int i=0;i<2;i++){
3432  fHist_NonIso_SP_PP_Mag0[i] = new TProfile2D(Form("fHist_NonIso_SP_PP_Mag0_Det%d",i),"Non Isotropic terms",10,centRange,10,0,10,"");
3434  fHist_NonIso_SP_NN_Mag0[i] = new TProfile2D(Form("fHist_NonIso_SP_NN_Mag0_Det%d",i),"Non Isotropic terms",10,centRange,10,0,10,"");
3436 
3437  fHist_NonIso_SP_PP_Mag1[i] = new TProfile2D(Form("fHist_NonIso_SP_PP_Mag1_Det%d",i),"Non Isotropic terms",10,centRange,10,0,10,"");
3439  fHist_NonIso_SP_NN_Mag1[i] = new TProfile2D(Form("fHist_NonIso_SP_NN_Mag1_Det%d",i),"Non Isotropic terms",10,centRange,10,0,10,"");
3441  }
3442 
3443 
3444 
3445 
3446 
3447 
3448 
3449 
3450 
3451 
3452  //=========== Calibtation Histograms etc ==================
3453 
3454 
3455 
3457 
3458  fdPhiFemtoCut = new TH1F("fdPhiFemtoCut"," total comb ",5,0,5);
3459  fdPhiFemtoCut->GetXaxis()->SetBinLabel(1,"US Total");
3460  fdPhiFemtoCut->GetXaxis()->SetBinLabel(2,"US Reject");
3461  fdPhiFemtoCut->GetXaxis()->SetBinLabel(3,"LS Total");
3462  fdPhiFemtoCut->GetXaxis()->SetBinLabel(4,"LS Reject");
3463  fListCalibs->Add(fdPhiFemtoCut);
3464 
3465  fVzDistribuion = new TH1F("fVzDistribuion","Vz (cm)",100,-10,10);
3467 
3468  fEventStatvsRun = new TH1F("fEventStatvsRun","Event stat per run",fRunFlag,0,fRunFlag);
3470 
3471  fCentDistvsRun = new TH2F("fCentStatvsRun","Cent Dist. vs run",90,0,90,fRunFlag,0,fRunFlag);
3473 
3474 
3475  fCentV0MvsVzRun = new TProfile2D("fCentV0MvsVzRun","",100,-10,10,fRunFlag,0,fRunFlag);
3477 
3478  fCent3pvsVzRun = new TProfile2D("fCent3pvsVzRun","",100,-10,10,fRunFlag,0,fRunFlag);
3480 
3481  fCentCL1vsVzRun = new TH3F("fCentCL1vsVzRun","",80,-10,10,fRunFlag,0,fRunFlag,20,-10,10);
3483 
3484 
3485  fRefMultCorrvsRaw = new TH2F("fRefMultCorrvsRaw",Form("Raw vs Corr Mult (FB %d)",gFilterBit),gMaxRefMult,0,gMaxRefMult,gMaxRefMult,0,gMaxRefMult);
3487 
3488 
3489 
3490  fTPCvsGlobalTrk = new TH2F("fTPCvsGlobalTrk","ESDTrk vs TPC(FB128)",400,0,gMaxRefMult,400,0,gMaxRefMult);
3492 
3493  fTPCuncutvsGlobal = new TH2F("fTPCuncutvsGlobal","ESDTrk vs ITS(FB96) ",400,0,gMaxRefMult,400,0,gMaxRefMult);
3495 
3496  fTPCvsITSfb96 = new TH2F("fTPCvsITSfb96","FB96 vs TPC(FB128)",400,0,gMaxRefMult,400,0,gMaxRefMult);
3497  fListCalibs->Add(fTPCvsITSfb96);
3498 
3499  fTPCvsITSfb32 = new TH2F("fTPCvsITSfb32","FB32 vs TPC(FB128)",400,0,gMaxRefMult,400,0,gMaxRefMult);
3500  fListCalibs->Add(fTPCvsITSfb32);
3501 
3502  fTPCFEvsITSfb96 = new TH2F("fTPCFEvsITSfb96","FB96 vs TPC(FB1)",400,0,gMaxRefMult,400,0,gMaxRefMult);
3504 
3505  fGlobalTracks = new TH1F("fGlobalTracks","Global Multiplilcity",gMaxRefMult,0,gMaxRefMult);
3506  fListCalibs->Add(fGlobalTracks);
3507 
3508 
3509  //for debug only, remove after stable code
3510  hUnderOverBinNUApos = new TH1F("hUnderOverBinNUApos","",90,0,90);
3512  hUnderOverBinNUAneg = new TH1F("hUnderOverBinNUAneg","",90,0,90);
3514 
3515  Double_t fCentBinQvect[16] = {0.,2.5,5,10,15,20,25,30,35,40,45,50,60,70,80,90};
3516 
3517  fHEnergyZNCvsCent = new TH2F("fHEnergyZNCvsCent","ZNC Energy vs cent",15,fCentBinQvect,4000,0,200000);
3519  fHEnergyZNAvsCent = new TH2F("fHEnergyZNAvsCent","ZNA Energy vs cent",15,fCentBinQvect,4000,0,200000);
3521  fHEnergyZPCvsCent = new TH2F("fHEnergyZPCvsCent","ZPC Energy vs cent",15,fCentBinQvect,2000,0,50000);
3523  fHEnergyZPAvsCent = new TH2F("fHEnergyZPAvsCent","ZPA Energy vs cent",15,fCentBinQvect,2000,0,50000);
3525 
3526  fHEnergyZNCvsCentRun = new TProfile2D("fHEnergyZNCvsCentRun","",90,0,90,fRunFlag,0,fRunFlag);
3528  fHEnergyZNAvsCentRun = new TProfile2D("fHEnergyZNAvsCentRun","",90,0,90,fRunFlag,0,fRunFlag);
3530  fHEnergyZPCvsCentRun = new TProfile2D("fHEnergyZPCvsCentRun","",90,0,90,fRunFlag,0,fRunFlag);
3532  fHEnergyZPAvsCentRun = new TProfile2D("fHEnergyZPAvsCentRun","",90,0,90,fRunFlag,0,fRunFlag);
3534 
3535  fHEnergyZPCvsZPA = new TH2F("fHEnergyZPCvsZPA","ZNC Energy vs cent",500,0,50000,500,0,50000);
3537  fHEnergyZNCvsZNA = new TH2F("fHEnergyZNCvsZNA","ZNC Energy vs cent",500,50000,150000,500,50000,150000);
3539 
3540  fHCentBinTrkRecenter = new TH1F("fHCentBinTrkRecenter","centrality Binning",15,fCentBinQvect);
3541 
3542 
3543 
3544 
3545  Int_t magField[2] = {0,1}; //0 = Neg, 1 = Pos
3546 
3547  for(int i=0;i<2;i++){
3548  fHist_Corr3p_QAEta_SP_V0A_PN[i] = new TProfile(Form("fHist_Corr3p_QAEta_SP_V0A_PN_Mag%d",magField[i]),"PN, Cent 10-20%",80,-0.8,0.8,"");
3549  fHist_Corr3p_QAEta_SP_V0A_PN[i]->Sumw2();
3551  fHist_Corr3p_QAEta_SP_V0A_PP[i] = new TProfile(Form("fHist_Corr3p_QAEta_SP_V0A_PP_Mag%d",magField[i]),"PP, Cent 10-20%",80,-0.8,0.8,"");
3552  fHist_Corr3p_QAEta_SP_V0A_PP[i]->Sumw2();
3554  fHist_Corr3p_QAEta_SP_V0A_NN[i] = new TProfile(Form("fHist_Corr3p_QAEta_SP_V0A_NN_Mag%d",magField[i]),"NN, Cent 10-20%",80,-0.8,0.8,"");
3555  fHist_Corr3p_QAEta_SP_V0A_NN[i]->Sumw2();
3557  }
3558  for(int i=0;i<2;i++){
3559  fHist_Corr3p_QAEta_SP_V0C_PN[i] = new TProfile(Form("fHist_Corr3p_QAEta_SP_V0C_PN_Mag%d",magField[i]),"PN, Cent 10-20%",80,-0.8,0.8,"");
3560  fHist_Corr3p_QAEta_SP_V0C_PN[i]->Sumw2();
3562  fHist_Corr3p_QAEta_SP_V0C_PP[i] = new TProfile(Form("fHist_Corr3p_QAEta_SP_V0C_PP_Mag%d",magField[i]),"PP, Cent 10-20%",80,-0.8,0.8,"");
3563  fHist_Corr3p_QAEta_SP_V0C_PP[i]->Sumw2();
3565  fHist_Corr3p_QAEta_SP_V0C_NN[i] = new TProfile(Form("fHist_Corr3p_QAEta_SP_V0C_NN_Mag%d",magField[i]),"NN, Cent 10-20%",80,-0.8,0.8,"");
3566  fHist_Corr3p_QAEta_SP_V0C_NN[i]->Sumw2();
3568  }
3569 
3570  fEtaBinFinderForQA = new TH1F("fEtaBinFinderForQA","",80,-0.8,0.8);
3572 
3573 
3574 
3575 
3576 
3577 
3578  Int_t suffixEta[4] = {1,0,1,0}; //{"Pos","Neg","Pos","Neg"};
3579  Int_t suffixVz[4] = {1,1,0,0}; //{"Pos","Pos","Neg","Neg"};
3580 
3581  if(bFillAvgTPCQn){
3582  for(int i=0;i<4;i++){
3583  fHCos1nPosChEtaVz[i] = new TProfile2D(Form("fHCos1nPosChEta%dVz%d",suffixEta[i],suffixVz[i]),"<ptw*cos1n>",90,0,90,fRunFlag,0,fRunFlag);
3584  fListCalibs->Add(fHCos1nPosChEtaVz[i]);
3585  fHSin1nPosChEtaVz[i] = new TProfile2D(Form("fHSin1nPosChEta%dVz%d",suffixEta[i],suffixVz[i]),"<ptw*sin1n>",90,0,90,fRunFlag,0,fRunFlag);
3586  fListCalibs->Add(fHSin1nPosChEtaVz[i]);
3587  fHCos1nNegChEtaVz[i] = new TProfile2D(Form("fHCos1nNegChEta%dVz%d",suffixEta[i],suffixVz[i]),"<ptw*cos1n>",90,0,90,fRunFlag,0,fRunFlag);
3588  fListCalibs->Add(fHCos1nNegChEtaVz[i]);
3589  fHSin1nNegChEtaVz[i] = new TProfile2D(Form("fHSin1nNegChEta%dVz%d",suffixEta[i],suffixVz[i]),"<ptw*sin1n>",90,0,90,fRunFlag,0,fRunFlag);
3590  fListCalibs->Add(fHSin1nNegChEtaVz[i]);
3591  /*
3592  fHCos2nPosChEtaVz[i] = new TProfile2D(Form("fHCos2nPosChEta%dVz%d",suffixEta[i],suffixVz[i]),"<ptw*cos2n>",90,0,90,fRunFlag,0,fRunFlag);
3593  fListCalibs->Add(fHCos2nPosChEtaVz[i]);
3594  fHSin2nPosChEtaVz[i] = new TProfile2D(Form("fHSin2nPosChEta%dVz%d",suffixEta[i],suffixVz[i]),"<ptw*sin2n>",90,0,90,fRunFlag,0,fRunFlag);
3595  fListCalibs->Add(fHSin2nPosChEtaVz[i]);
3596  fHCos2nNegChEtaVz[i] = new TProfile2D(Form("fHCos2nNegChEta%dVz%d",suffixEta[i],suffixVz[i]),"<ptw*cos2n>",90,0,90,fRunFlag,0,fRunFlag);
3597  fListCalibs->Add(fHCos2nNegChEtaVz[i]);
3598  fHSin2nNegChEtaVz[i] = new TProfile2D(Form("fHSin2nNegChEta%dVz%d",suffixEta[i],suffixVz[i]),"<ptw*sin2n>",90,0,90,fRunFlag,0,fRunFlag);
3599  fListCalibs->Add(fHSin2nNegChEtaVz[i]);
3600 
3601  fHCos3nPosChEtaVz[i] = new TProfile2D(Form("fHCos3nPosChEta%dVz%d",suffixEta[i],suffixVz[i]),"<ptw*cos3n>",90,0,90,fRunFlag,0,fRunFlag);
3602  fListCalibs->Add(fHCos3nPosChEtaVz[i]);
3603  fHSin3nPosChEtaVz[i] = new TProfile2D(Form("fHSin3nPosChEta%dVz%d",suffixEta[i],suffixVz[i]),"<ptw*sin3n>",90,0,90,fRunFlag,0,fRunFlag);
3604  fListCalibs->Add(fHSin3nPosChEtaVz[i]);
3605  fHCos3nNegChEtaVz[i] = new TProfile2D(Form("fHCos3nNegChEta%dVz%d",suffixEta[i],suffixVz[i]),"<ptw*cos3n>",90,0,90,fRunFlag,0,fRunFlag);
3606  fListCalibs->Add(fHCos3nNegChEtaVz[i]);
3607  fHSin3nNegChEtaVz[i] = new TProfile2D(Form("fHSin3nNegChEta%dVz%d",suffixEta[i],suffixVz[i]),"<ptw*sin3n>",90,0,90,fRunFlag,0,fRunFlag);
3608  fListCalibs->Add(fHSin3nNegChEtaVz[i]);
3609  */
3610  fHCos4nPosChEtaVz[i] = new TProfile2D(Form("fHCos4nPosChEta%dVz%d",suffixEta[i],suffixVz[i]),"<ptw*cos4n>",90,0,90,fRunFlag,0,fRunFlag);
3611  fListCalibs->Add(fHCos4nPosChEtaVz[i]);
3612  fHSin4nPosChEtaVz[i] = new TProfile2D(Form("fHSin4nPosChEta%dVz%d",suffixEta[i],suffixVz[i]),"<ptw*sin4n>",90,0,90,fRunFlag,0,fRunFlag);
3613  fListCalibs->Add(fHSin4nPosChEtaVz[i]);
3614  fHCos4nNegChEtaVz[i] = new TProfile2D(Form("fHCos4nNegChEta%dVz%d",suffixEta[i],suffixVz[i]),"<ptw*cos4n>",90,0,90,fRunFlag,0,fRunFlag);
3615  fListCalibs->Add(fHCos4nNegChEtaVz[i]);
3616  fHSin4nNegChEtaVz[i] = new TProfile2D(Form("fHSin4nNegChEta%dVz%d",suffixEta[i],suffixVz[i]),"<ptw*sin4n>",90,0,90,fRunFlag,0,fRunFlag);
3617  fListCalibs->Add(fHSin4nNegChEtaVz[i]);
3618 
3619  //Double weighted <..>
3620  fHCos2nDWPosChEtaVz[i] = new TProfile2D(Form("fHCos2nDWPosChEta%dVz%d",suffixEta[i],suffixVz[i]),"<ptw*ptw*cos2n>",90,0,90,fRunFlag,0,fRunFlag);
3622  fHSin2nDWPosChEtaVz[i] = new TProfile2D(Form("fHSin2nDWPosChEta%dVz%d",suffixEta[i],suffixVz[i]),"<ptw*ptw*cos2n>",90,0,90,fRunFlag,0,fRunFlag);
3624  fHCos2nDWNegChEtaVz[i] = new TProfile2D(Form("fHCos2nDWNegChEta%dVz%d",suffixEta[i],suffixVz[i]),"<ptw*ptw*cos2n>",90,0,90,fRunFlag,0,fRunFlag);
3626  fHSin2nDWNegChEtaVz[i] = new TProfile2D(Form("fHSin2nDWNegChEta%dVz%d",suffixEta[i],suffixVz[i]),"<ptw*ptw*cos2n>",90,0,90,fRunFlag,0,fRunFlag);
3628  }
3629  }
3630 
3631  //fill <Q2x> and <Q2y> track by track: for Test
3632  for(int i=0;i<4;i++){
3633  fHCos2nPosChEtaVz[i] = new TProfile2D(Form("fHCos2nPosChEta%dVz%d",suffixEta[i],suffixVz[i]),"<ptw*cos2n>",90,0,90,fRunFlag,0,fRunFlag);
3634  fListCalibs->Add(fHCos2nPosChEtaVz[i]);
3635  fHSin2nPosChEtaVz[i] = new TProfile2D(Form("fHSin2nPosChEta%dVz%d",suffixEta[i],suffixVz[i]),"<ptw*sin2n>",90,0,90,fRunFlag,0,fRunFlag);
3636  fListCalibs->Add(fHSin2nPosChEtaVz[i]);
3637  fHCos2nNegChEtaVz[i] = new TProfile2D(Form("fHCos2nNegChEta%dVz%d",suffixEta[i],suffixVz[i]),"<ptw*cos2n>",90,0,90,fRunFlag,0,fRunFlag);
3638  fListCalibs->Add(fHCos2nNegChEtaVz[i]);
3639  fHSin2nNegChEtaVz[i] = new TProfile2D(Form("fHSin2nNegChEta%dVz%d",suffixEta[i],suffixVz[i]),"<ptw*sin2n>",90,0,90,fRunFlag,0,fRunFlag);
3640  fListCalibs->Add(fHSin2nNegChEtaVz[i]);
3641 
3642  fHCos3nPosChEtaVz[i] = new TProfile2D(Form("fHCos3nPosChEta%dVz%d",suffixEta[i],suffixVz[i]),"<ptw*cos3n>",90,0,90,fRunFlag,0,fRunFlag);
3643  fListCalibs->Add(fHCos3nPosChEtaVz[i]);
3644  fHSin3nPosChEtaVz[i] = new TProfile2D(Form("fHSin3nPosChEta%dVz%d",suffixEta[i],suffixVz[i]),"<ptw*sin3n>",90,0,90,fRunFlag,0,fRunFlag);
3645  fListCalibs->Add(fHSin3nPosChEtaVz[i]);
3646  fHCos3nNegChEtaVz[i] = new TProfile2D(Form("fHCos3nNegChEta%dVz%d",suffixEta[i],suffixVz[i]),"<ptw*cos3n>",90,0,90,fRunFlag,0,fRunFlag);
3647  fListCalibs->Add(fHCos3nNegChEtaVz[i]);
3648  fHSin3nNegChEtaVz[i] = new TProfile2D(Form("fHSin3nNegChEta%dVz%d",suffixEta[i],suffixVz[i]),"<ptw*sin3n>",90,0,90,fRunFlag,0,fRunFlag);
3649  fListCalibs->Add(fHSin3nNegChEtaVz[i]);
3650  }
3651 
3652 
3653 
3654  //Average Multiplicity, same-sign, opposite-sign pair vs Centrality 1% :
3655 
3656  fAvgMultCentRun = new TProfile2D("fAvgMultCentRun","<Mult> vs cent,Run",90,0,90,fRunFlag,0,fRunFlag,"");
3658  fAvgWgtMultCentRun = new TProfile2D("fAvgWgtMultCentRun","<wgt*Mult> vs cent,Run",90,0,90,fRunFlag,0,fRunFlag,"");
3660  fAvgPOIposCentRun = new TProfile2D("fAvgPOIposCentRun","<wgt*POIs> ch-pos vs cent,Run",90,0,90,fRunFlag,0,fRunFlag,"");
3662  fAvgPOInegCentRun = new TProfile2D("fAvgPOInegCentRun","<wgt*POIs> ch-neg vs cent,Run",90,0,90,fRunFlag,0,fRunFlag,"");
3664  fAvgPOIPPCentRun = new TProfile2D("fAvgPOIPPCentRun","<wgt*POIs> Pos-Pos vs cent,Run",90,0,90,fRunFlag,0,fRunFlag,"");
3666  fAvgPOINNCentRun = new TProfile2D("fAvgPOINNCentRun","<wgt*POIs> Neg-Neg vs cent,Run",90,0,90,fRunFlag,0,fRunFlag,"");
3668  fAvgPOIOSCentRun = new TProfile2D("fAvgPOIOSCentRun","<wgt*POIs> oppo.-sign vs cent,Run",90,0,90,fRunFlag,0,fRunFlag,"");
3670 
3671 
3672 
3673  //Store CME run by Run: Not used for huge memory usage.
3674  /*
3675  for(int i=0;i<2;i++){//0=V0A,1=V0C
3676  fHist_Corr3p_vsRun_EP_PN[i] = new TProfile2D(Form("fHist_Corr3p_vsRun_EP_PN_Det%d",i+1),"opposit charge correlator",90,0,90,fRunFlag,0,fRunFlag,"");
3677  fListHistos->Add(fHist_Corr3p_vsRun_EP_PN[i]);
3678  fHist_Corr3p_vsRun_EP_PP[i] = new TProfile2D(Form("fHist_Corr3p_vsRun_EP_PP_Det%d",i+1),"PosPos charge correlator",90,0,90,fRunFlag,0,fRunFlag,"");
3679  fListHistos->Add(fHist_Corr3p_vsRun_EP_PP[i]);
3680  fHist_Corr3p_vsRun_EP_NN[i] = new TProfile2D(Form("fHist_Corr3p_vsRun_EP_NN_Det%d",i+1),"NegNeg charge correlator",90,0,90,fRunFlag,0,fRunFlag,"");
3681  fListHistos->Add(fHist_Corr3p_vsRun_EP_NN[i]);
3682  }*/
3683 
3684 
3685 
3686 
3687 
3688 
3689 
3690 
3691  //======== Following are all type of NUA written in List: fListNUAHist ================
3692 
3693 
3694  //---------- V0 histograms ---------
3695  fV0MultChVsRun = new TProfile2D("fV0MultChVsRun","1-32 V0C, 33-64 V0A",64,0,64,fRunFlag,0,fRunFlag,"");
3697 
3698  fV0AQ2xVsCentRun = new TProfile2D("fV0ACos2nVsCentRun","<Cos2> vs cent,Run",90,0,90,fRunFlag,0,fRunFlag,"");
3700  fV0AQ2yVsCentRun = new TProfile2D("fV0ASin2nVsCentRun","<Sin2> vs cent,Run",90,0,90,fRunFlag,0,fRunFlag,"");
3702  fV0CQ2xVsCentRun = new TProfile2D("fV0CCos2nVsCentRun","<Cos2> vs cent,Run",90,0,90,fRunFlag,0,fRunFlag,"");
3704  fV0CQ2yVsCentRun = new TProfile2D("fV0CSin2nVsCentRun","<Sin2> vs cent,Run",90,0,90,fRunFlag,0,fRunFlag,"");
3706 
3707  fV0AQ3xVsCentRun = new TProfile2D("fV0ACos3nVsCentRun","<Cos3> vs cent,Run",90,0,90,fRunFlag,0,fRunFlag,"");
3709  fV0AQ3yVsCentRun = new TProfile2D("fV0ASin3nVsCentRun","<Sin3> vs cent,Run",90,0,90,fRunFlag,0,fRunFlag,"");
3711  fV0CQ3xVsCentRun = new TProfile2D("fV0CCos3nVsCentRun","<Cos3> vs cent,Run",90,0,90,fRunFlag,0,fRunFlag,"");
3713  fV0CQ3yVsCentRun = new TProfile2D("fV0CSin3nVsCentRun","<Sin3> vs cent,Run",90,0,90,fRunFlag,0,fRunFlag,"");
3715  //-----------------------------------
3716 
3717 
3718  fTPCQ2xVsCentRun = new TProfile2D("fTPCCos2nVsCentRun","<Cos2> vs cent,Run",90,0,90,fRunFlag,0,fRunFlag,"");
3720  fTPCQ2yVsCentRun = new TProfile2D("fTPCSin2nVsCentRun","<Sin2> vs cent,Run",90,0,90,fRunFlag,0,fRunFlag,"");
3722 
3723  fTPCQ3xVsCentRun = new TProfile2D("fTPCCos3nVsCentRun","<Cos3> vs cent,Run",90,0,90,fRunFlag,0,fRunFlag,"");
3725  fTPCQ3yVsCentRun = new TProfile2D("fTPCSin3nVsCentRun","<Sin3> vs cent,Run",90,0,90,fRunFlag,0,fRunFlag,"");
3727 
3728 
3729  for(int i=0;i<10;i++){
3730  sprintf(name,"fHistChPosvsEtaPtRun_Cent%d",i);
3731  sprintf(title,"Pos Ch, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
3732  fHistChPosvsEtaPtRun[i] = new TH3F(name,title,25,0.2,5.2,16,-0.8,0.8,fRunFlag,0,fRunFlag);
3734  sprintf(name,"fHistChNegvsEtaPtRun_Cent%d",i);
3735  sprintf(title,"Neg Ch, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
3736  fHistChNegvsEtaPtRun[i] = new TH3F(name,title,25,0.2,5.2,16,-0.8,0.8,fRunFlag,0,fRunFlag);
3738  }
3739 
3740 
3741  Int_t gCentForNUA[6] = {0,5,10,20,40,90};
3742 
3743  if(bFillEtaPhiNUA) {
3744  for(int i=0;i<5;i++){
3745  for(int j=0;j<fRunFlag;j++){
3746  sprintf(name,"fHistEtaPhiVz_Pos_Cent%d_Run%d",i,runNums[j]);
3747  sprintf(title,"eta,phi,Vz Pos Cent%d-%d%%",gCentForNUA[i],gCentForNUA[i+1]);
3748  fHist3DEtaPhiVz_Pos_Run[i][j] = new TH3F(name,title,10,-10,10,50,0,6.283185,16,-0.8,0.8);
3750 
3751  sprintf(name,"fHistEtaPhiVz_Neg_Cent%d_Run%d",i,runNums[j]);
3752  sprintf(title,"eta,phi,Vz Pos Cent%d-%d%%",gCentForNUA[i],gCentForNUA[i+1]);
3753  fHist3DEtaPhiVz_Neg_Run[i][j] = new TH3F(name,title,10,-10,10,50,0,6.283185,16,-0.8,0.8);
3755  }
3756  }
3757  }
3758 
3759  fVzBinFinderForNUA = new TH1F("fVzBinFinderForNUA","",4,-10,10); //only needed for pT dependent NUA.
3761 
3762  /*
3763  // pT Dependent NUA correction:
3764  Double_t pTbinNUA[16] = {0.2,0.4,0.6,0.8,1.0,1.2,1.4,1.6,1.8,2.0,2.4,2.6,3.0,3.5,4.0,5.0};
3765  Double_t etabinNUA[9] = {-0.8,-0.6,-0.4,-0.2,0.0,0.2,0.4,0.6,0.8};
3766  Double_t phibinNUA[51] = {0.,};
3767  Double_t fPhi = 6.2832/50;
3768  for(int i=0;i<51;i++){
3769  phibinNUA[i] = fPhi*i;
3770  }
3771 
3772  if(bFillEtaPhiNUA) {
3773  for(int i=0;i<5;i++){
3774  for(int j=0;j<fRunFlag;j++){
3775  sprintf(name,"fHistEtaPhiPt_Pos_Vz%d_Run%d",i,runNums[j]);
3776  sprintf(title,"eta,phi,Pt Pos Vz%d",i);
3777  fHist3DEtaPhiVz_Pos_Run[i][j] = new TH3F(name,title,15,pTbinNUA,50,phibinNUA,8,etabinNUA);
3778  fListNUAHist->Add(fHist3DEtaPhiVz_Pos_Run[i][j]);
3779 
3780  sprintf(name,"fHistEtaPhiPt_Neg_Vz%d_Run%d",i,runNums[j]);
3781  sprintf(title,"eta,phi,Pt Pos Vz%d",i);
3782  fHist3DEtaPhiVz_Neg_Run[i][j] = new TH3F(name,title,15,pTbinNUA,50,phibinNUA,8,etabinNUA);
3783  fListNUAHist->Add(fHist3DEtaPhiVz_Neg_Run[i][j]);
3784  }
3785  }
3786  } */
3787 
3788 
3789 
3790 }
3791 
3792 
TProfile * fHist_Corr3p_EP_Refm_PN[2][3]
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]
Float_t GetDPhiStar(Float_t phi1, Float_t pt1, Float_t charge1, Float_t phi2, Float_t pt2, Float_t charge2, Float_t radius, Float_t bSign)
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]
TH1D * fQynsV0C
sigma Qx2 V0C
Int_t fOldRunNum
number of total run
Definition: External.C:236
Bool_t PileUpMultiVertex(const AliAODEvent *faod)
TProfile2D * fHist_Corr2p_EP_Refm_PN[2]
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.
TProfile2D * fHist_Corr2p_EP_Norm_NN[2]
AliAnalysisUtils * fAnalysisUtil
MultSelection (RUN2 centrality estimator)
TProfile * fHist_Corr3p_QAEta_SP_V0C_PP[2]
Pos and Neg Mag field.
TProfile2D * fHCos2nNegChEtaVz[4]
TProfile * fHist_Corr3p_pTDiff_EP_V0C_PN[2][6]
TProfile2D * fHSin1nNegChEtaVz[4]
TList * fListFBHijing
collection of NUA Histograms
char Char_t
Definition: External.C:18
TProfile * fHist_Corr3p_QAEta_SP_V0A_PP[2]
Pos and Neg Mag field.
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]
TH3F * fFB_Efficiency_Neg[10]
3d correction Map
TProfile * fHist_Corr3p_pTDiff_EP_V0A_NN[2][6]
TProfile2D * fHist_Corr2p_EP_Refm_PP[2]
Two magnetic fields.
TProfile2D * fHist_Corr3p_ZDN_SP_PN[3]
TProfile2D * fHCos1nPosChEtaVz[4]
TH1F * hUnderOverBinNUAneg
//temporary Debug, remove for stable code
TProfile * fHist_Corr3p_EP_Norm_NN[2][3]
TProfile2D * fHist_Corr3p_vsRun_EP_PN[2]
TProfile2D * fCentV0MvsVzRun
V0C Average <Qn>, n=2,3.
AliMultSelection * fMultSelection
input event
TH1F * fPileUpMultSelCount
event count with different cuts
TProfile * fHist_Corr3p_pTSum_EP_V0A_PN[2][6]
TProfile2D * fHist_NonIso_SP_PP_Mag0[2]
TProfile * fHist_Corr3p_EtaDiff_EP_V0A_PN[2][6]
TProfile2D * fHCos4nNegChEtaVz[4]
TH3F * fHist3DEtaPhiVz_Neg_Run[5][90]
5 centrality bin 90 Bins for Run. NUA
Double_t Phi() const
TProfile * fHist_Corr3p_QAEta_SP_V0A_PN[2]
TProfile2D * fHCos3nPosChEtaVz[4]
void OpenInfoCalbration(Int_t run, Float_t fHarmonic)
TProfile * fHist_Reso2n_EP_Refm_Det[2][3]
TProfile2D * fHist_Reso2n_ZDN_SP_Det[3]
int Int_t
Definition: External.C:63
TH1D * fQynsV0A
sigma Qx2 V0A
TProfile2D * fHCos2nDWPosChEtaVz[4]
TList * fListNUAHist
collection of Calib Histos
TH1D * fMultV0
Cut parameters which were used.
TProfile2D * fHSin2nNegChEtaVz[4]
float Float_t
Definition: External.C:68
TProfile * fHist_Corr3p_SP_Norm_PP[2][3]
Norm = 10 centrality bins along X.
void GetNUACorrectionHist(Int_t run, TString sfileNUA)
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]
TH3F * fHistChNegvsEtaPtRun[10]
10 Centrality Bin
TProfile2D * fHist_NonIso_SP_NN_Mag1[2]
Mag1 = B > 0.
TProfile2D * fHCos2nPosChEtaVz[4]
Int_t fRunFlag
array of runnumbers
TProfile * fHist_Corr3p_QAEta_SP_V0C_NN[2]
TProfile * fHist_Corr3p_EP_Refm_NN[2][3]
AliFlowEventSimple * fEvent
TProfile * fHist_Reso2n_SP_Norm_Det[2][3]
TProfile2D * fHist_Corr2p_EP_Norm_PN[2]
virtual void UserCreateOutputObjects()
TProfile * fHist_Corr3p_pTDiff_EP_V0C_PP[2][6]
TProfile2D * fV0MultChVsRun
opposite sign pairs
void InitializeRunArray(TString sPeriod)
TProfile * fHist_Corr3p_QAEta_SP_V0A_NN[2]
void GetV0MCorrectionHist(Int_t run)
TH1F * fHCentBinTrkRecenter
//temporary Debug, remove for stable code
TProfile2D * fHSin4nNegChEtaVz[4]
TProfile2D * fHist_Corr2p_EP_Refm_NN[2]
TProfile * fHist_Corr3p_pTSum_EP_V0C_NN[2][6]
TProfile2D * fHist_NonIso_SP_PP_Mag1[2]
TProfile * fHist_Corr3p_SP_Norm_PN[2][3]
TProfile2D * fHSin4nPosChEtaVz[4]
TProfile * fHist_Corr3p_EtaDiff_EP_V0C_PP[2][6]
void GetV0QvectAndMult(const AliAODVZERO *aodV0, Float_t fHarmonic, Double_t &Qxan, Double_t &Qyan, Double_t &sumMa, Double_t &Qxcn, Double_t &Qycn, Double_t &sumMc)
TProfile * fHist_Corr3p_EtaDiff_EP_V0A_PP[2][6]
Float_t EvtCent
counter of event for cout
TH2D * fHAvgerageQnV0C
V0A Average <Qn>, n=2,3.
TProfile * fHist_Corr3p_QAEta_SP_V0C_PN[2]
TProfile2D * fHist_Corr3p_vsRun_EP_NN[2]
Int_t fHarmonicN
Event centrality.
TProfile2D * fHist_NonIso_SP_NN_Mag0[2]
Mag0 = B < 0.
TProfile * fHist_Corr3p_EtaDiff_EP_V0C_PN[2][6]
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
TProfile2D * fHist_Corr3p_vsRun_EP_PP[2]
TProfile * fHist_Corr3p_SP_Norm_NN[2][3]
bool Bool_t
Definition: External.C:53
TProfile2D * fHSin1nPosChEtaVz[4]
TH3D * fHCorrectNUAneg[5]
5 centrality bin
TProfile * fHist_Corr3p_EP_Refm_PP[2][3]
virtual void UserExec(Option_t *option)
TH2D * fHAvgerageQnV0A
for V0-Mult Gain Correction per channel.
TProfile * fHist_Corr3p_pTDiff_EP_V0C_NN[2][6]
TH1D * fFB_Efficiency_Cent[10]
5 centrality bin 90 Bins for Run. NUA
double GetWDist(const AliVVertex *v0, const AliVVertex *v1)
TProfile2D * fHSin2nDWNegChEtaVz[4]
TProfile2D * fAvgPOINNCentRun
same sign Pos-Pos pairs
TH3F * fHist3DEtaPhiVz_Pos_Run[5][90]
5 centrality bin
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]
TProfile2D * fHist_Corr2p_EP_Norm_PP[2]
Two magnetic fields.