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