AliPhysics  4549ede (4549ede)
AliAnalysisTaskCMEV0PID.cxx
Go to the documentation of this file.
1 /**************************************************************************
2  * Copyright(c) 1998-1999, 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 
16 /* $Id: AliAnalysisTaskCMEV0PID.cxx Rihan Haque 14/02/2018 $ */
17 
18 //-- general include---
19 #include "TChain.h"
20 #include "TTree.h"
21 #include "TGrid.h"
22 #include "TROOT.h"
23 #include "TObjArray.h"
24 #include "TMatrixDSym.h"
25 
26 #include "TMath.h"
27 #include "stdio.h"
28 #include "Riostream.h"
29 
30 //---- manager and handler---
31 #include "AliAnalysisManager.h"
32 #include "AliInputEventHandler.h"
33 
34 //---V0 and ZDC info---
35 #include "AliAODZDC.h"
36 #include "AliAODVZERO.h"
37 #include "AliAODVertex.h"
38 
39 //---AOD,ESD event--
40 #include "AliESDEvent.h"
41 #include "AliAODHeader.h"
42 #include "AliAODEvent.h"
43 #include "AliAODTrack.h"
44 
45 //----for PID-----
46 #include "AliPIDResponse.h"
47 #include "AliPIDCombined.h"
48 
49 //----- Vevent and tracks
50 #include "AliVEventHandler.h"
51 #include "AliVEvent.h"
52 #include "AliVTrack.h"
53 #include "AliVParticle.h"
54 #include "AliCentrality.h"
55 
56 //----- must include-------
57 #include "AliMultSelection.h"
58 #include "AliAnalysisUtils.h"
59 #include "AliPhysicsSelection.h"
60 #include "AliFlowEventSimple.h"
61 #include "AliAnalysisTaskSE.h"
63 
64 //using namespace std;
65 
66 using std::cout;
67 using std::endl;
68 using std::vector;
69 
70 
72 
73 
75  fVevent(NULL),
76  fESD(NULL),
77  fAOD(NULL),
78  fPIDResponse(NULL),
79  fMultSelection(NULL),
80  fAnalysisUtil(NULL),
81  fListHist(NULL),
82  mfileFBHijing(NULL),
83  fListFBHijing(NULL),
84  fListNUACorr(NULL),
85  fListV0MCorr(NULL),
86  fHistTaskConfigParameters(NULL),
87  fHistPileUpCount(NULL),
88  fHistMultSelPUCount(NULL),
89  fHistEtaPtBefore(NULL),
90  fHistEtaPtAfter(NULL),
91  fHistTPCvsGlobalMultBefore(NULL),
92  fHistTPCvsGlobalMultAfter(NULL),
93  fHistTPCdEdxvsPBefore(NULL),
94  fHistTPCdEdxvsPAfter(NULL),
95  fHistTOFBetavsPBefore(NULL),
96  fHistTOFBetavsPAfter(NULL),
97  fHistTOFMassvsPtBefore(NULL),
98  fHistTOFMatchCount(NULL),
99  fHistTPCVsESDTrkBefore(NULL),
100  fHistTPCVsESDTrkAfter(NULL),
101  fHistTPConlyVsCL1Before(NULL),
102  fHistTPConlyVsV0MBefore(NULL),
103  fHistTPConlyVsCL1After(NULL),
104  fHistTPConlyVsV0MAfter(NULL),
105  fHistGlobalVsV0MBefore(NULL),
106  fHistGlobalVsV0MAfter(NULL),
107  fHistRawVsCorrMultFB(NULL),
108  hCentvsTPCmultCuts(NULL),
109  fHV0AEventPlaneVsCent(NULL),
110  fHV0CEventPlaneVsCent(NULL),
111  fHTPCAEventPlaneVsCent(NULL),
112  fHTPCCEventPlaneVsCent(NULL),
113  fHTPCEventPlaneVsCent(NULL),
114  fV0MultChVsRun(NULL),
115  fCentDistBefore(NULL),
116  fCentDistAfter(NULL),
117  fHCorrectV0M(NULL),
118  fHAvgerageQnV0A(NULL),
119  fHAvgerageQnV0C(NULL),
120  fHCentWeightForRun(NULL),
121  fQAEtaPhiAfterNUA(NULL),
122  fQAEtaPhiAfterNUAPion(NULL),
123  fQAEtaPhiAfterNUAKaon(NULL),
124  fQAEtaPhiAfterNUAProton(NULL),
125  fV0AQ2xVsCentRun(NULL),
126  fV0AQ2yVsCentRun(NULL),
127  fV0CQ2xVsCentRun(NULL),
128  fV0CQ2yVsCentRun(NULL),
129  fV0AQ3xVsCentRun(NULL),
130  fV0AQ3yVsCentRun(NULL),
131  fV0CQ3xVsCentRun(NULL),
132  fV0CQ3yVsCentRun(NULL),
133  fTPCAQ2xVsCentRun(NULL),
134  fTPCAQ2yVsCentRun(NULL),
135  fTPCCQ2xVsCentRun(NULL),
136  fTPCCQ2yVsCentRun(NULL),
137  fTPCAQ3xVsCentRun(NULL),
138  fTPCAQ3yVsCentRun(NULL),
139  fTPCCQ3xVsCentRun(NULL),
140  fTPCCQ3yVsCentRun(NULL),
141  fTPCAQ4xVsCentRun(NULL),
142  fTPCAQ4yVsCentRun(NULL),
143  fTPCCQ4xVsCentRun(NULL),
144  fTPCCQ4yVsCentRun(NULL),
145  fTPCFQ2xVsCentRun(NULL),
146  fTPCFQ2yVsCentRun(NULL),
147  fZPASignalPerChVsCent(NULL),
148  fZPCSignalPerChVsCent(NULL),
149  fZNASignalPerChVsCent(NULL),
150  fZNCSignalPerChVsCent(NULL),
151  fCentDistVsVz(NULL),
152  fFilterBit(1),
153  gN(1),
154  gM(1),
155  gPsiN(2),
156  fOldRunNum(111),
157  fEventCount(0),
158  fTPCclustMin(70),
159  fNSigmaCut(2),
160  fMinPtCut(0.2),
161  fMaxPtCut(5.0),
162  fMinEtaCut(-0.8),
163  fMaxEtaCut(0.8),
164  fTrkChi2Min(0.1),
165  fDCAxyMax(2.4),
166  fDCAzMax(3.2),
167  fdEdxMin(10.),
168  fCentralityPercentMin(0),
169  fCentralityPercentMax(90),
170  fPileUpSlopeParm(3.43),
171  fPileUpConstParm(43),
172  fMinVzCut(-10.0),
173  fMaxVzCut(10.0),
174  bApplyMCcorr(kFALSE),
175  bV0MGainCorr(kFALSE),
176  bSkipPileUpCut(kFALSE),
177  bFillNUAHistPID(kFALSE),
178  bUseKinkTracks(kFALSE),
179  sPathOfMCFile("/alien"),
180  sNucleiTP("PbPb"),
181  sCentrEstimator("V0M"),
182  fHistEventCount(NULL)
183 {
184  for(int i=0;i<3;i++){
185  fHistPtwithTPCNsigma[i]=NULL;
186  fHistPtwithTOFmasscut[i]=NULL;
187  fHistPtwithTOFSignal[i]=NULL;
188  fHistTOFnSigmavsPtAfter[i]=NULL;
189  fHistTPCnSigmavsPtAfter[i]=NULL;
190  fHistTPCTOFnSigmavsPtAfter[i]=NULL;
191  fHistTPCdEdxvsPtPIDAfter[i]=NULL;
192  }
193  for(int i=0;i<5;i++){
194  fHCorrectNUApos[i] = NULL;
195  fHCorrectNUAneg[i] = NULL;
196  }
197  for(int i=0;i<5;i++){ // for PID
198  fHCorrectNUAposPion[i] = NULL;
199  fHCorrectNUAnegPion[i] = NULL;
200  fHCorrectNUAposKaon[i] = NULL;
201  fHCorrectNUAnegKaon[i] = NULL;
202  fHCorrectNUAposProton[i] = NULL;
203  fHCorrectNUAnegProton[i] = NULL;
204  }
205  //3p vs centrality
206  for(int i=0;i<2;i++){
207  for(int j=0;j<4;j++){
208  fHist_Corr3p_EP_Norm_PN[i][j] = NULL;
209  fHist_Corr3p_EP_Norm_PP[i][j] = NULL;
210  fHist_Corr3p_EP_Norm_NN[i][j] = NULL;
211  }
212  for(int j=0;j<4;j++) {
213  fHist_Reso2n_EP_Norm_Det[i][j] = NULL;
214  }
215  //PID:
216  for(int j=0;j<4;j++){
217  fHist_Corr3p_Pion_EP_Norm_PN[i][j] = NULL;
218  fHist_Corr3p_Pion_EP_Norm_PP[i][j] = NULL;
219  fHist_Corr3p_Pion_EP_Norm_NN[i][j] = NULL;
220  fHist_Corr3p_Kaon_EP_Norm_PN[i][j] = NULL;
221  fHist_Corr3p_Kaon_EP_Norm_PP[i][j] = NULL;
222  fHist_Corr3p_Kaon_EP_Norm_NN[i][j] = NULL;
223  fHist_Corr3p_Proton_EP_Norm_PN[i][j] = NULL;
224  fHist_Corr3p_Proton_EP_Norm_PP[i][j] = NULL;
225  fHist_Corr3p_Proton_EP_Norm_NN[i][j] = NULL;
226  }
227  }
228  //3p vs RefMult
229  for(int i=0;i<2;i++){
230  for(int j=0;j<4;j++){
231  fHist_Corr3p_EP_Refm_PN[i][j] = NULL;
232  fHist_Corr3p_EP_Refm_PP[i][j] = NULL;
233  fHist_Corr3p_EP_Refm_NN[i][j] = NULL;
234  }
235  for(int j=0;j<4;j++) {
236  fHist_Reso2n_EP_Refm_Det[i][j] = NULL;
237  }
238  //PID:
239  for(int j=0;j<4;j++){
240  fHist_Corr3p_Pion_EP_Refm_PN[i][j] = NULL;
241  fHist_Corr3p_Pion_EP_Refm_PP[i][j] = NULL;
242  fHist_Corr3p_Pion_EP_Refm_NN[i][j] = NULL;
243  fHist_Corr3p_Kaon_EP_Refm_PN[i][j] = NULL;
244  fHist_Corr3p_Kaon_EP_Refm_PP[i][j] = NULL;
245  fHist_Corr3p_Kaon_EP_Refm_NN[i][j] = NULL;
246  fHist_Corr3p_Proton_EP_Refm_PN[i][j] = NULL;
247  fHist_Corr3p_Proton_EP_Refm_PP[i][j] = NULL;
248  fHist_Corr3p_Proton_EP_Refm_NN[i][j] = NULL;
249  }
250  }
251 
252 
253  //2p vs Centrality:
254 
255  //2p vs Refm:
256 
257 
258 
259 
260 
261 
262 
263 
264 
265  //Differential 3p Charge:
266  for(int i=0;i<2;i++){
267  for(int j=0;j<6;j++){
268  fHist_Corr3p_pTSum_EP_V0A_PN[i][j] = NULL;
269  fHist_Corr3p_pTSum_EP_V0A_PP[i][j] = NULL;
270  fHist_Corr3p_pTSum_EP_V0A_NN[i][j] = NULL;
271  fHist_Corr3p_pTSum_EP_V0C_PN[i][j] = NULL;
272  fHist_Corr3p_pTSum_EP_V0C_PP[i][j] = NULL;
273  fHist_Corr3p_pTSum_EP_V0C_NN[i][j] = NULL;
274 
275  fHist_Corr3p_pTDiff_EP_V0A_PN[i][j] = NULL;
276  fHist_Corr3p_pTDiff_EP_V0A_PP[i][j] = NULL;
277  fHist_Corr3p_pTDiff_EP_V0A_NN[i][j] = NULL;
278  fHist_Corr3p_pTDiff_EP_V0C_PN[i][j] = NULL;
279  fHist_Corr3p_pTDiff_EP_V0C_PP[i][j] = NULL;
280  fHist_Corr3p_pTDiff_EP_V0C_NN[i][j] = NULL;
281 
282  fHist_Corr3p_EtaDiff_EP_V0A_PN[i][j] = NULL;
283  fHist_Corr3p_EtaDiff_EP_V0A_PP[i][j] = NULL;
284  fHist_Corr3p_EtaDiff_EP_V0A_NN[i][j] = NULL;
285  fHist_Corr3p_EtaDiff_EP_V0C_PN[i][j] = NULL;
286  fHist_Corr3p_EtaDiff_EP_V0C_PP[i][j] = NULL;
287  fHist_Corr3p_EtaDiff_EP_V0C_NN[i][j] = NULL;
288  }
289  }
290  //Differential 3p PID:
291  for(int i=0;i<2;i++){
292  for(int j=0;j<6;j++){
293  //Pion
294  fHist_Corr3p_Pion_pTSum_EP_V0A_PN[i][j] = NULL;
295  fHist_Corr3p_Pion_pTSum_EP_V0A_PP[i][j] = NULL;
296  fHist_Corr3p_Pion_pTSum_EP_V0A_NN[i][j] = NULL;
297  fHist_Corr3p_Pion_pTSum_EP_V0C_PN[i][j] = NULL;
298  fHist_Corr3p_Pion_pTSum_EP_V0C_PP[i][j] = NULL;
299  fHist_Corr3p_Pion_pTSum_EP_V0C_NN[i][j] = NULL;
300 
301  fHist_Corr3p_Pion_pTDiff_EP_V0A_PN[i][j] = NULL;
302  fHist_Corr3p_Pion_pTDiff_EP_V0A_PP[i][j] = NULL;
303  fHist_Corr3p_Pion_pTDiff_EP_V0A_NN[i][j] = NULL;
304  fHist_Corr3p_Pion_pTDiff_EP_V0C_PN[i][j] = NULL;
305  fHist_Corr3p_Pion_pTDiff_EP_V0C_PP[i][j] = NULL;
306  fHist_Corr3p_Pion_pTDiff_EP_V0C_NN[i][j] = NULL;
307 
308  fHist_Corr3p_Pion_EtaDiff_EP_V0A_PN[i][j] = NULL;
309  fHist_Corr3p_Pion_EtaDiff_EP_V0A_PP[i][j] = NULL;
310  fHist_Corr3p_Pion_EtaDiff_EP_V0A_NN[i][j] = NULL;
311  fHist_Corr3p_Pion_EtaDiff_EP_V0C_PN[i][j] = NULL;
312  fHist_Corr3p_Pion_EtaDiff_EP_V0C_PP[i][j] = NULL;
313  fHist_Corr3p_Pion_EtaDiff_EP_V0C_NN[i][j] = NULL;
314  //Kaon
315  fHist_Corr3p_Kaon_pTSum_EP_V0A_PN[i][j] = NULL;
316  fHist_Corr3p_Kaon_pTSum_EP_V0A_PP[i][j] = NULL;
317  fHist_Corr3p_Kaon_pTSum_EP_V0A_NN[i][j] = NULL;
318  fHist_Corr3p_Kaon_pTSum_EP_V0C_PN[i][j] = NULL;
319  fHist_Corr3p_Kaon_pTSum_EP_V0C_PP[i][j] = NULL;
320  fHist_Corr3p_Kaon_pTSum_EP_V0C_NN[i][j] = NULL;
321 
322  fHist_Corr3p_Kaon_pTDiff_EP_V0A_PN[i][j] = NULL;
323  fHist_Corr3p_Kaon_pTDiff_EP_V0A_PP[i][j] = NULL;
324  fHist_Corr3p_Kaon_pTDiff_EP_V0A_NN[i][j] = NULL;
325  fHist_Corr3p_Kaon_pTDiff_EP_V0C_PN[i][j] = NULL;
326  fHist_Corr3p_Kaon_pTDiff_EP_V0C_PP[i][j] = NULL;
327  fHist_Corr3p_Kaon_pTDiff_EP_V0C_NN[i][j] = NULL;
328 
329  fHist_Corr3p_Kaon_EtaDiff_EP_V0A_PN[i][j] = NULL;
330  fHist_Corr3p_Kaon_EtaDiff_EP_V0A_PP[i][j] = NULL;
331  fHist_Corr3p_Kaon_EtaDiff_EP_V0A_NN[i][j] = NULL;
332  fHist_Corr3p_Kaon_EtaDiff_EP_V0C_PN[i][j] = NULL;
333  fHist_Corr3p_Kaon_EtaDiff_EP_V0C_PP[i][j] = NULL;
334  fHist_Corr3p_Kaon_EtaDiff_EP_V0C_NN[i][j] = NULL;
335  //Proton
336  fHist_Corr3p_Proton_pTSum_EP_V0A_PN[i][j] = NULL;
337  fHist_Corr3p_Proton_pTSum_EP_V0A_PP[i][j] = NULL;
338  fHist_Corr3p_Proton_pTSum_EP_V0A_NN[i][j] = NULL;
339  fHist_Corr3p_Proton_pTSum_EP_V0C_PN[i][j] = NULL;
340  fHist_Corr3p_Proton_pTSum_EP_V0C_PP[i][j] = NULL;
341  fHist_Corr3p_Proton_pTSum_EP_V0C_NN[i][j] = NULL;
342 
343  fHist_Corr3p_Proton_pTDiff_EP_V0A_PN[i][j] = NULL;
344  fHist_Corr3p_Proton_pTDiff_EP_V0A_PP[i][j] = NULL;
345  fHist_Corr3p_Proton_pTDiff_EP_V0A_NN[i][j] = NULL;
346  fHist_Corr3p_Proton_pTDiff_EP_V0C_PN[i][j] = NULL;
347  fHist_Corr3p_Proton_pTDiff_EP_V0C_PP[i][j] = NULL;
348  fHist_Corr3p_Proton_pTDiff_EP_V0C_NN[i][j] = NULL;
349 
350  fHist_Corr3p_Proton_EtaDiff_EP_V0A_PN[i][j] = NULL;
351  fHist_Corr3p_Proton_EtaDiff_EP_V0A_PP[i][j] = NULL;
352  fHist_Corr3p_Proton_EtaDiff_EP_V0A_NN[i][j] = NULL;
353  fHist_Corr3p_Proton_EtaDiff_EP_V0C_PN[i][j] = NULL;
354  fHist_Corr3p_Proton_EtaDiff_EP_V0C_PP[i][j] = NULL;
355  fHist_Corr3p_Proton_EtaDiff_EP_V0C_NN[i][j] = NULL;
356  }
357  }
358 
359  //Differential 2p Charge:
360 
361  for(int i=0;i<4;i++){
362  for(int j=0;j<5;j++){
363  fHist3DEtaPhiVz_Pos_Run[i][j]=NULL;
364  fHist3DEtaPhiVz_Neg_Run[i][j]=NULL;
365  }
366  }
367  for(int i=0;i<10;i++){
368  fFB_Efficiency_Cent[i] = NULL;
369  fFB_Efficiency_Pion_Cent[i] = NULL;
370  fFB_Efficiency_Kaon_Cent[i] = NULL;
371  //fFB_Efficiency_Proton_Cent[i] = NULL;
372  fFB_Efficiency_Proton_Pos_Cent[i] = NULL;
373  fFB_Efficiency_Proton_Neg_Cent[i] = NULL;
374  }
375 
376 
377  DefineInput(0,TChain::Class());
378  DefineOutput(1,TList::Class());
379 }
380 //______________________________empty constructor_______________________
383  fVevent(NULL),
384  fESD(NULL),
385  fAOD(NULL),
386  fPIDResponse(NULL),
387  fMultSelection(NULL),
388  fAnalysisUtil(NULL),
389  fListHist(NULL),
390  mfileFBHijing(NULL),
391  fListFBHijing(NULL),
392  fListNUACorr(NULL),
393  fListV0MCorr(NULL),
394  fHistTaskConfigParameters(NULL),
395  fHistPileUpCount(NULL),
396  fHistMultSelPUCount(NULL),
397  fHistEtaPtBefore(NULL),
398  fHistEtaPtAfter(NULL),
399  fHistTPCvsGlobalMultBefore(NULL),
400  fHistTPCvsGlobalMultAfter(NULL),
401  fHistTPCdEdxvsPBefore(NULL),
402  fHistTPCdEdxvsPAfter(NULL),
403  fHistTOFBetavsPBefore(NULL),
404  fHistTOFBetavsPAfter(NULL),
405  fHistTOFMassvsPtBefore(NULL),
406  fHistTOFMatchCount(NULL),
407  fHistTPCVsESDTrkBefore(NULL),
408  fHistTPCVsESDTrkAfter(NULL),
409  fHistTPConlyVsCL1Before(NULL),
410  fHistTPConlyVsV0MBefore(NULL),
411  fHistTPConlyVsCL1After(NULL),
412  fHistTPConlyVsV0MAfter(NULL),
413  fHistGlobalVsV0MBefore(NULL),
414  fHistGlobalVsV0MAfter(NULL),
415  fHistRawVsCorrMultFB(NULL),
416  hCentvsTPCmultCuts(NULL),
417  fHV0AEventPlaneVsCent(NULL),
418  fHV0CEventPlaneVsCent(NULL),
419  fHTPCAEventPlaneVsCent(NULL),
420  fHTPCCEventPlaneVsCent(NULL),
421  fHTPCEventPlaneVsCent(NULL),
422  fV0MultChVsRun(NULL),
423  fCentDistBefore(NULL),
424  fCentDistAfter(NULL),
425  fHCorrectV0M(NULL),
426  fHAvgerageQnV0A(NULL),
427  fHAvgerageQnV0C(NULL),
428  fHCentWeightForRun(NULL),
429  fQAEtaPhiAfterNUA(NULL),
430  fQAEtaPhiAfterNUAPion(NULL),
431  fQAEtaPhiAfterNUAKaon(NULL),
432  fQAEtaPhiAfterNUAProton(NULL),
433  fV0AQ2xVsCentRun(NULL),
434  fV0AQ2yVsCentRun(NULL),
435  fV0CQ2xVsCentRun(NULL),
436  fV0CQ2yVsCentRun(NULL),
437  fV0AQ3xVsCentRun(NULL),
438  fV0AQ3yVsCentRun(NULL),
439  fV0CQ3xVsCentRun(NULL),
440  fV0CQ3yVsCentRun(NULL),
441  fTPCAQ2xVsCentRun(NULL),
442  fTPCAQ2yVsCentRun(NULL),
443  fTPCCQ2xVsCentRun(NULL),
444  fTPCCQ2yVsCentRun(NULL),
445  fTPCAQ3xVsCentRun(NULL),
446  fTPCAQ3yVsCentRun(NULL),
447  fTPCCQ3xVsCentRun(NULL),
448  fTPCCQ3yVsCentRun(NULL),
449  fTPCAQ4xVsCentRun(NULL),
450  fTPCAQ4yVsCentRun(NULL),
451  fTPCCQ4xVsCentRun(NULL),
452  fTPCCQ4yVsCentRun(NULL),
453  fTPCFQ2xVsCentRun(NULL),
454  fTPCFQ2yVsCentRun(NULL),
455  fZPASignalPerChVsCent(NULL),
456  fZPCSignalPerChVsCent(NULL),
457  fZNASignalPerChVsCent(NULL),
458  fZNCSignalPerChVsCent(NULL),
459  fCentDistVsVz(NULL),
460  fFilterBit(1),
461  gN(1),
462  gM(1),
463  gPsiN(2),
464  fOldRunNum(111),
465  fEventCount(0),
466  fTPCclustMin(70),
467  fNSigmaCut(2),
468  fMinPtCut(0.2),
469  fMaxPtCut(5.0),
470  fMinEtaCut(-0.8),
471  fMaxEtaCut(0.8),
472  fTrkChi2Min(0.1),
473  fDCAxyMax(2.4),
474  fDCAzMax(3.2),
475  fdEdxMin(10.),
476  fCentralityPercentMin(0),
477  fCentralityPercentMax(90),
478  fPileUpSlopeParm(3.43),
479  fPileUpConstParm(43),
480  fMinVzCut(-10.0),
481  fMaxVzCut(10.0),
482  bApplyMCcorr(kFALSE),
483  bV0MGainCorr(kFALSE),
484  bSkipPileUpCut(kFALSE),
485  bFillNUAHistPID(kFALSE),
486  bUseKinkTracks(kFALSE),
487  sPathOfMCFile("/alien"),
488  sNucleiTP("PbPb"),
489  sCentrEstimator("V0M"),
490  fHistEventCount(NULL)
491 {
492  for(int i=0;i<3;i++){
493  fHistPtwithTPCNsigma[i]=NULL;
494  fHistPtwithTOFmasscut[i]=NULL;
495  fHistPtwithTOFSignal[i]=NULL;
496  fHistTOFnSigmavsPtAfter[i]=NULL;
497  fHistTPCnSigmavsPtAfter[i]=NULL;
499  fHistTPCdEdxvsPtPIDAfter[i]=NULL;
500  }
501  for(int i=0;i<5;i++){
502  fHCorrectNUApos[i] = NULL;
503  fHCorrectNUAneg[i] = NULL;
504  }
505  for(int i=0;i<5;i++){ // for PID NUA
506  fHCorrectNUAposPion[i] = NULL;
507  fHCorrectNUAnegPion[i] = NULL;
508  fHCorrectNUAposKaon[i] = NULL;
509  fHCorrectNUAnegKaon[i] = NULL;
510  fHCorrectNUAposProton[i] = NULL;
511  fHCorrectNUAnegProton[i] = NULL;
512  }
513  //3p vs Centrality
514  for(int i=0;i<2;i++){
515  for(int j=0;j<4;j++){
516  fHist_Corr3p_EP_Norm_PN[i][j] = NULL;
517  fHist_Corr3p_EP_Norm_PP[i][j] = NULL;
518  fHist_Corr3p_EP_Norm_NN[i][j] = NULL;
519  }
520  for(int j=0;j<4;j++) {
521  fHist_Reso2n_EP_Norm_Det[i][j] = NULL;
522  }
523  //PID:
524  for(int j=0;j<4;j++){
525  fHist_Corr3p_Pion_EP_Norm_PN[i][j] = NULL;
526  fHist_Corr3p_Pion_EP_Norm_PP[i][j] = NULL;
527  fHist_Corr3p_Pion_EP_Norm_NN[i][j] = NULL;
528  fHist_Corr3p_Kaon_EP_Norm_PN[i][j] = NULL;
529  fHist_Corr3p_Kaon_EP_Norm_PP[i][j] = NULL;
530  fHist_Corr3p_Kaon_EP_Norm_NN[i][j] = NULL;
531  fHist_Corr3p_Proton_EP_Norm_PN[i][j] = NULL;
532  fHist_Corr3p_Proton_EP_Norm_PP[i][j] = NULL;
533  fHist_Corr3p_Proton_EP_Norm_NN[i][j] = NULL;
534  }
535  }
536  //3p vs RefMult
537  for(int i=0;i<2;i++){
538  for(int j=0;j<4;j++){
539  fHist_Corr3p_EP_Refm_PN[i][j] = NULL;
540  fHist_Corr3p_EP_Refm_PP[i][j] = NULL;
541  fHist_Corr3p_EP_Refm_NN[i][j] = NULL;
542  }
543  for(int j=0;j<4;j++) {
544  fHist_Reso2n_EP_Refm_Det[i][j] = NULL;
545  }
546  //PID:
547  for(int j=0;j<4;j++){
548  fHist_Corr3p_Pion_EP_Refm_PN[i][j] = NULL;
549  fHist_Corr3p_Pion_EP_Refm_PP[i][j] = NULL;
550  fHist_Corr3p_Pion_EP_Refm_NN[i][j] = NULL;
551  fHist_Corr3p_Kaon_EP_Refm_PN[i][j] = NULL;
552  fHist_Corr3p_Kaon_EP_Refm_PP[i][j] = NULL;
553  fHist_Corr3p_Kaon_EP_Refm_NN[i][j] = NULL;
554  fHist_Corr3p_Proton_EP_Refm_PN[i][j] = NULL;
555  fHist_Corr3p_Proton_EP_Refm_PP[i][j] = NULL;
556  fHist_Corr3p_Proton_EP_Refm_NN[i][j] = NULL;
557  }
558  }
559 
560 
561 
562  //2p vs Centrality:
563 
564  //2p vs Refm:
565 
566 
567 
568 
569 
570 
571 
572 
573 
574 
575 
576 
577 
578 
579  //Differential Charge:
580  for(int i=0;i<2;i++){
581  for(int j=0;j<6;j++){
582  fHist_Corr3p_pTSum_EP_V0A_PN[i][j] = NULL;
583  fHist_Corr3p_pTSum_EP_V0A_PP[i][j] = NULL;
584  fHist_Corr3p_pTSum_EP_V0A_NN[i][j] = NULL;
585  fHist_Corr3p_pTSum_EP_V0C_PN[i][j] = NULL;
586  fHist_Corr3p_pTSum_EP_V0C_PP[i][j] = NULL;
587  fHist_Corr3p_pTSum_EP_V0C_NN[i][j] = NULL;
588 
589  fHist_Corr3p_pTDiff_EP_V0A_PN[i][j] = NULL;
590  fHist_Corr3p_pTDiff_EP_V0A_PP[i][j] = NULL;
591  fHist_Corr3p_pTDiff_EP_V0A_NN[i][j] = NULL;
592  fHist_Corr3p_pTDiff_EP_V0C_PN[i][j] = NULL;
593  fHist_Corr3p_pTDiff_EP_V0C_PP[i][j] = NULL;
594  fHist_Corr3p_pTDiff_EP_V0C_NN[i][j] = NULL;
595 
596  fHist_Corr3p_EtaDiff_EP_V0A_PN[i][j] = NULL;
597  fHist_Corr3p_EtaDiff_EP_V0A_PP[i][j] = NULL;
598  fHist_Corr3p_EtaDiff_EP_V0A_NN[i][j] = NULL;
599  fHist_Corr3p_EtaDiff_EP_V0C_PN[i][j] = NULL;
600  fHist_Corr3p_EtaDiff_EP_V0C_PP[i][j] = NULL;
601  fHist_Corr3p_EtaDiff_EP_V0C_NN[i][j] = NULL;
602  }
603  }
604  //Differential PID:
605  for(int i=0;i<2;i++){
606  for(int j=0;j<6;j++){
607  //Pion
614 
621 
628  //Kaon
635 
642 
649  //Proton
656 
663 
670  }
671  }
672 
673  //Differential 2p Charge:
674 
675  for(int i=0;i<4;i++){
676  for(int j=0;j<5;j++){
677  fHist3DEtaPhiVz_Pos_Run[i][j]=NULL;
678  fHist3DEtaPhiVz_Neg_Run[i][j]=NULL;
679  }
680  }
681  for(int i=0;i<10;i++){
682  fFB_Efficiency_Cent[i] = NULL;
683  fFB_Efficiency_Pion_Cent[i] = NULL;
684  fFB_Efficiency_Kaon_Cent[i] = NULL;
685  //fFB_Efficiency_Proton_Cent[i] = NULL;
688  }
689 }
690 
691 //___________________________ destructor ___________________________
693 {
694  //Destructor
695  //if(fPIDResponse) delete fPIDResponse;
696  //if(fMultSelection) delete fMultSelection;
697 
698  /*
699  if(fHCorrectV0M) delete fHCorrectV0M;
700  if(fHAvgerageQnV0A) delete fHAvgerageQnV0A;
701  if(fHAvgerageQnV0C) delete fHAvgerageQnV0C;
702 
703  if(mfileFBHijing->IsOpen()){
704  mfileFBHijing->Close();
705  if(fListFBHijing) delete fListFBHijing;
706  }
707  for(int i=0;i<10;i++){
708  if(fFB_Efficiency_Cent[i])
709  delete fFB_Efficiency_Cent[i];
710  }
711  for(int i=0;i<5;i++){
712  if(fHCorrectNUApos[i]) delete fHCorrectNUApos[i];
713  if(fHCorrectNUAneg[i]) delete fHCorrectNUAneg[i];
714  }
715  for(int i=0;i<5;i++){ // for PID
716  if(fHCorrectNUAposPion[i]) delete fHCorrectNUAposPion[i];
717  if(fHCorrectNUAnegPion[i]) delete fHCorrectNUAnegPion[i];
718  if(fHCorrectNUAposKaon[i]) delete fHCorrectNUAposKaon[i];
719  if(fHCorrectNUAnegKaon[i]) delete fHCorrectNUAnegKaon[i];
720  if(fHCorrectNUAposProton[i]) delete fHCorrectNUAposProton[i];
721  if(fHCorrectNUAnegProton[i]) delete fHCorrectNUAnegProton[i];
722  }
723 */
724 
725  //Delete the clones
726  if(fListFBHijing) delete fListFBHijing;
727  if(fListNUACorr) delete fListNUACorr;
728  if(fListV0MCorr) delete fListV0MCorr;
729 
730  if(fListHist) delete fListHist;
731  if(fAnalysisUtil) delete fAnalysisUtil; // its 'new' !!
732 
733 }//---------------- sanity ------------------------
734 
735 
736 
738 {
739 
740  //std::cout<<"\n..UserCreateOutputObject called.. with isCorr = "<<isCorr<<"\n ....check if succeeded...\n"<<endl;
741 
742  //input hander
743  AliAnalysisManager *mgr=AliAnalysisManager::GetAnalysisManager();
744  AliInputEventHandler *inputHandler=dynamic_cast<AliInputEventHandler*>(mgr->GetInputEventHandler());
745  if (!inputHandler) { printf("\n ...Input handler missing!!!...\n"); return; }
746 
747  //PileUp Multi-Vertex
748  fAnalysisUtil = new AliAnalysisUtils();
749  fAnalysisUtil->SetUseMVPlpSelection(kTRUE);
750  fAnalysisUtil->SetUseOutOfBunchPileUp(kTRUE);
751 
752  //pid response object
753  //fPIDResponse=inputHandler->GetPIDResponse();
754 
755  fListHist = new TList();
756  fListHist->SetOwner(kTRUE);
757 
758 
760 
761  if(!gGrid){
762  TGrid::Connect("alien://");
763  }
764 
766 
767 
768 
769  hCentvsTPCmultCuts = new TH2F("hCentvsTPCmultCuts","TPCmult Low,high",100,0,100,5,0,5);
770  hCentvsTPCmultCuts->GetYaxis()->SetBinLabel(1,"mean");
771  hCentvsTPCmultCuts->GetYaxis()->SetBinLabel(2,"sigma");
773 
775 
776  fHistTOFMatchCount = new TH2F("fHistTOFMatchCount","TofMatchFlag vs mismatch Prob",10,0,10,200,-5,5);
778 
779  fHistEtaPtBefore = new TH2F("fHistEtaPtBefore","Eta vs pT",100,-1.25,1.25,100,0,10);
781 
782  fHistEtaPtAfter = new TH2F("fHistEtaPtAfter","Eta vs pT",100,-1.25,1.25,100,0,10);
784 
785 
786  Int_t gMaxTPCFB1mult = 0;
787  Int_t gMaxGlobalmult = 0;
788  Int_t gMaxTPCcorrmult = 0;
789  Int_t gMaxESDtracks = 0;
790  Int_t nBinRefMult = 200;
791  Int_t nRefMultMax = 4000;
792 
793 
794 
795  if(sNucleiTP=="pp"||sNucleiTP=="PP"){
796  gMaxGlobalmult = 200;
797  gMaxTPCFB1mult = 200;
798  gMaxTPCcorrmult = 500;
799  gMaxESDtracks = 1000;
800  nBinRefMult = 100; //change binning for pp
801  nRefMultMax = 500;
802  //fSkipOutlierCut = 1;
803  }
804  else if(sNucleiTP=="pPb"||sNucleiTP=="Pbp"||sNucleiTP=="PbP"||sNucleiTP=="PPb"){
805  gMaxGlobalmult = 400;
806  gMaxTPCFB1mult = 400;
807  gMaxTPCcorrmult = 500;
808  gMaxESDtracks = 2000;
809  nBinRefMult = 100; //change binning for pPb
810  nRefMultMax = 1000;
811  //fSkipOutlierCut = 1;
812  }
813  else{
814  gMaxGlobalmult = 4000;
815  gMaxTPCFB1mult = 4000;
816  gMaxTPCcorrmult = 5000;
817  gMaxESDtracks = 20000;
818  //fSkipOutlierCut = 0;
819  }
820 
821 
822 
823  //if(bSkipPileUpCut) { fSkipOutlierCut = 1;}
824 
825 
826  fHistTPCVsESDTrkBefore = new TH2F("fHistTPCVsESDTrkBefore","Before; TPC1; ESD trk",500,0,gMaxTPCcorrmult,200,0,gMaxESDtracks);
828  fHistTPCVsESDTrkAfter = new TH2F("fHistTPCVsESDTrkAfter"," After; TPC1; ESD trk",500,0,gMaxTPCcorrmult,200,0,gMaxESDtracks);
830 
831  fHistTPCvsGlobalMultBefore = new TH2F("fHistTPCvsGlobalMultBefore","Before; Global; TPC(fb1) ",200,0,gMaxGlobalmult,200,0,gMaxTPCFB1mult);
833  fHistTPCvsGlobalMultAfter = new TH2F("fHistTPCvsGlobalMultAfter"," After; Global; TPC(fb1) ",200,0,gMaxGlobalmult,200,0,gMaxTPCFB1mult);
835 
836  fHistGlobalVsV0MBefore = new TH2F("fHistGlobalVsV0MBefore","Before;Cent(V0M);Global",100,0,100,500,0,gMaxGlobalmult);
838  fHistGlobalVsV0MAfter = new TH2F("fHistGlobalVsV0MAfter"," After; Cent(V0M);Global",100,0,100,500,0,gMaxGlobalmult);
840 
841  fHistTPConlyVsCL1Before = new TH2F("fHistTPConlyVsCL1Before","Before;Cent(CL1); TPC(FB1)",100,0,100,250,0,gMaxTPCcorrmult);
843  fHistTPConlyVsCL1After = new TH2F("fHistTPConlyVsCL1After","After; Cent(CL1); TPC(FB1) ",100,0,100,250,0,gMaxTPCcorrmult);
845 
846  fHistTPConlyVsV0MBefore = new TH2F("fHistTPConlyVsV0MBefore","Before;Cent(V0M); TPC(FB1)",100,0,100,250,0,gMaxTPCcorrmult);
848  fHistTPConlyVsV0MAfter = new TH2F("fHistTPConlyVsV0MAfter","After; Cent(V0M); TPC(FB1) ",100,0,100,250,0,gMaxTPCcorrmult);
850 
851  fHistRawVsCorrMultFB = new TH2F("fHistRawVsCorrMultFB",Form("FB%d;Mult_{raw};Mult_{corr}",fFilterBit),gMaxTPCFB1mult,0,gMaxTPCFB1mult,gMaxTPCcorrmult,0,gMaxTPCcorrmult);
853 
854 
855 
856 
857 
858 
859  // Turn off PID QA histograms
860  //---------------- PID QA Histograms ---------------------
861  /*
862  fHistTPCdEdxvsPBefore = new TH2F("fHistTPCdEdxvsPBefore","Before; p (GeV/c); dEdx (arb)",200,-5,5,200,0,250);
863  fListHist->Add(fHistTPCdEdxvsPBefore);
864  fHistTPCdEdxvsPAfter = new TH2F("fHistTPCdEdxvsPAfter"," After; p (GeV/c); dEdx (arb)",200,-5,5, 200,0,250);
865  fListHist->Add(fHistTPCdEdxvsPAfter);
866 
867  fHistTOFBetavsPBefore = new TH2F("fHistTOFBetavsPBefore","Before; p (GeV/c); beta ",200,-5,5,100,0.0,1.2);
868  fListHist->Add(fHistTOFBetavsPBefore);
869  fHistTOFBetavsPAfter = new TH2F("fHistTOFBetavsPAfter"," After; p (GeV/c); beta ",200,-5,5,100,0.0,1.2);
870  fListHist->Add(fHistTOFBetavsPAfter);
871 
872  fHistTOFMassvsPtBefore = new TH2F("fHistTOFMassvsPtBefore","Before; p_{T}(GeV/c); m^{2}(GeV^{2}/c^{4})",200,-5,5,500,-0.5,4.5);
873  fListHist->Add(fHistTOFMassvsPtBefore);
874 
875  //const char *gSpecies[4] = {"Pion","Kaon","proton","Charge"};
876 
877  for(int i=0;i<3;i++){
878  fHistPtwithTPCNsigma[i] = new TH1F(Form("fHistPtwithTPCNsigma_%d",i), Form("%d;p_{T}(GeV/c))",i),200,-5,5); //i
879  fListHist->Add(fHistPtwithTPCNsigma[i]);
880  fHistPtwithTOFmasscut[i] = new TH1F(Form("fHistPtwithTOFmasscut_%d",i),Form("%d;p_{T}(GeV/c))",i),200,-5,5);
881  fListHist->Add(fHistPtwithTOFmasscut[i]);
882  fHistPtwithTOFSignal[i] = new TH1F(Form("fHistPtwithTOFSignal_%d", i),Form("%d;p_{T}(GeV/c))",i),200,-5,5);
883  fListHist->Add(fHistPtwithTOFSignal[i]);
884 
885  fHistTOFnSigmavsPtAfter[i] = new TH2F(Form("fHistTOFnSigmavsPtAfter_%d",i),Form("%d;p_{T}(GeV/c);n#sigma_{TOF}",i),200,-5,5,400,-10.0,10.0);
886  fListHist->Add(fHistTOFnSigmavsPtAfter[i]);
887 
888  fHistTPCnSigmavsPtAfter[i] = new TH2F(Form("fHistTPCnSigmavsPtAfter_%d",i),Form("%d;p_{T}(GeV/c);n#sigma_{TPC}",i),200,-5,5,400,-10.0,10.0);
889  fListHist->Add(fHistTPCnSigmavsPtAfter[i]);
890 
891  fHistTPCTOFnSigmavsPtAfter[i] = new TH3F(Form("fHistTPCTOFnSigmavsPtAfter_%d",i),Form("%d; p_{T}(GeV/c); n#sigma_{TPC}; n#sigma_{TOF}",i),100,0,5,400,-10,10,400,-10,10);
892  fListHist->Add(fHistTPCTOFnSigmavsPtAfter[i]);
893 
894  fHistTPCdEdxvsPtPIDAfter[i] = new TH2F(Form("fHistTPCdEdxvsPtAfter_%d",i),"AfterCut; p_{T} (GeV/c); dEdx (arb)",400,0,10,200,0,250);
895  fListHist->Add(fHistTPCdEdxvsPtPIDAfter[i]);
896  }// PID histograms done
897  */
898 
899 
900 
901 
902  fCentDistBefore = new TH1F("fCentDistBefore","no Cut; Cent (%); Events ",100,0,100);
904 
905  fCentDistAfter = new TH1F("fCentDistAfter","with Cut; Cent (%); Events ",100,0,100);
907 
908 
909 
910 
911 
912 
913 
914 
915 
916 
917 
918 
919 
920  Double_t centRange[11] = {0,5,10,20,30,40,50,60,70,80,90};
921  //const char *gDetForEP[4] = {"V0A","V0C","TPC-A","TPC-C"};
922  // 10,centRange
923  //------------------- 3p correlator vs Centrality (EP method) ------------------
924  for(int i=0;i<2;i++){
925  //Charged:
926  for(int j=0;j<4;j++){
927  //Detector: 0 = V0A, 1 = V0C, 3 = TPCA, 4 = TPCC
928  fHist_Corr3p_EP_Norm_PN[i][j] = new TProfile(Form("fHist_Corr3p_EP_Norm_PosNeg_Mag%d_Det%d",i,j+1),Form("US, #Psi_{2} %d",j),10,centRange,"");
929  fHist_Corr3p_EP_Norm_PN[i][j]->Sumw2();
931  fHist_Corr3p_EP_Norm_PP[i][j] = new TProfile(Form("fHist_Corr3p_EP_Norm_PosPos_Mag%d_Det%d",i,j+1),Form("P-P, #Psi_{2} %d",j),10,centRange,"");
932  fHist_Corr3p_EP_Norm_PP[i][j]->Sumw2();
934  fHist_Corr3p_EP_Norm_NN[i][j] = new TProfile(Form("fHist_Corr3p_EP_Norm_NegNeg_Mag%d_Det%d",i,j+1),Form("N-N, #Psi_{2}, %d",j),10,centRange,"");
935  fHist_Corr3p_EP_Norm_NN[i][j]->Sumw2();
937  }
938  //EP Resolution:
939  for(int j=0;j<4;j++){
940  //Det: 0 = v0c-v0a, 1 = v0a-TPC, 2 = v0c-TPC, 3 =TPC-A TPC-C
941  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,"");
942  fHist_Reso2n_EP_Norm_Det[i][j]->Sumw2();
944  }
945  /*
946  //----------- PID -------------------
947  for(int j=0;j<4;j++){ //Detector: 0 = V0A, 1 = V0C, 3 = TPCA, 4 = TPCC
948  //----------> Pion:
949  fHist_Corr3p_Pion_EP_Norm_PN[i][j] = new TProfile(Form("fHist_Corr3p_Pion_EP_Norm_PosNeg_Mag%d_Det%d",i,j+1),Form("US, #Psi_{2} %d",j),10,centRange,"");
950  fHist_Corr3p_Pion_EP_Norm_PN[i][j]->Sumw2();
951  fListHist->Add(fHist_Corr3p_Pion_EP_Norm_PN[i][j]);
952  fHist_Corr3p_Pion_EP_Norm_PP[i][j] = new TProfile(Form("fHist_Corr3p_Pion_EP_Norm_PosPos_Mag%d_Det%d",i,j+1),Form("P-P, #Psi_{2} %d",j),10,centRange,"");
953  fHist_Corr3p_Pion_EP_Norm_PP[i][j]->Sumw2();
954  fListHist->Add(fHist_Corr3p_Pion_EP_Norm_PP[i][j]);
955  fHist_Corr3p_Pion_EP_Norm_NN[i][j] = new TProfile(Form("fHist_Corr3p_Pion_EP_Norm_NegNeg_Mag%d_Det%d",i,j+1),Form("N-N, #Psi_{2}, %d",j),10,centRange,"");
956  fHist_Corr3p_Pion_EP_Norm_NN[i][j]->Sumw2();
957  fListHist->Add(fHist_Corr3p_Pion_EP_Norm_NN[i][j]);
958  //----------> Kaon:
959  fHist_Corr3p_Kaon_EP_Norm_PN[i][j] = new TProfile(Form("fHist_Corr3p_Kaon_EP_Norm_PosNeg_Mag%d_Det%d",i,j+1),Form("US, #Psi_{2} %d",j),10,centRange,"");
960  fHist_Corr3p_Kaon_EP_Norm_PN[i][j]->Sumw2();
961  fListHist->Add(fHist_Corr3p_Kaon_EP_Norm_PN[i][j]);
962  fHist_Corr3p_Kaon_EP_Norm_PP[i][j] = new TProfile(Form("fHist_Corr3p_Kaon_EP_Norm_PosPos_Mag%d_Det%d",i,j+1),Form("P-P, #Psi_{2} %d",j),10,centRange,"");
963  fHist_Corr3p_Kaon_EP_Norm_PP[i][j]->Sumw2();
964  fListHist->Add(fHist_Corr3p_Kaon_EP_Norm_PP[i][j]);
965  fHist_Corr3p_Kaon_EP_Norm_NN[i][j] = new TProfile(Form("fHist_Corr3p_Kaon_EP_Norm_NegNeg_Mag%d_Det%d",i,j+1),Form("N-N, #Psi_{2}, %d",j),10,centRange,"");
966  fHist_Corr3p_Kaon_EP_Norm_NN[i][j]->Sumw2();
967  fListHist->Add(fHist_Corr3p_Kaon_EP_Norm_NN[i][j]);
968  //----------> Proton:
969  fHist_Corr3p_Proton_EP_Norm_PN[i][j] = new TProfile(Form("fHist_Corr3p_Proton_EP_Norm_PosNeg_Mag%d_Det%d",i,j+1),Form("US, #Psi_{2} %d",j),10,centRange,"");
970  fHist_Corr3p_Proton_EP_Norm_PN[i][j]->Sumw2();
971  fListHist->Add(fHist_Corr3p_Proton_EP_Norm_PN[i][j]);
972  fHist_Corr3p_Proton_EP_Norm_PP[i][j] = new TProfile(Form("fHist_Corr3p_Proton_EP_Norm_PosPos_Mag%d_Det%d",i,j+1),Form("P-P, #Psi_{2} %d",j),10,centRange,"");
973  fHist_Corr3p_Proton_EP_Norm_PP[i][j]->Sumw2();
974  fListHist->Add(fHist_Corr3p_Proton_EP_Norm_PP[i][j]);
975  fHist_Corr3p_Proton_EP_Norm_NN[i][j] = new TProfile(Form("fHist_Corr3p_Proton_EP_Norm_NegNeg_Mag%d_Det%d",i,j+1),Form("N-N, #Psi_{2}, %d",j),10,centRange,"");
976  fHist_Corr3p_Proton_EP_Norm_NN[i][j]->Sumw2();
977  fListHist->Add(fHist_Corr3p_Proton_EP_Norm_NN[i][j]);
978  }//Det loop
979  */
980 
981  }//magfield loop
982 
983 
984 
985 
986 
987 
988  /*
989  //------------------- 3p correlator vs RefMult (EP method) ------------------
990  for(int i=0;i<2;i++){
991  //Charged:
992  for(int j=0;j<4;j++){
993  //Detector: 0 = V0A, 1 = V0C, 3 = TPCA, 4 = TPCC
994  fHist_Corr3p_EP_Refm_PN[i][j] = new TProfile(Form("fHist_Corr3p_EP_Refm_PosNeg_Mag%d_Det%d",i,j+1),Form("US, #Psi_{2} %d",j),nBinRefMult,0,nRefMultMax,"");
995  //fHist_Corr3p_EP_Refm_PN[i][j]->Sumw2();
996  fListHist->Add(fHist_Corr3p_EP_Refm_PN[i][j]);
997  fHist_Corr3p_EP_Refm_PP[i][j] = new TProfile(Form("fHist_Corr3p_EP_Refm_PosPos_Mag%d_Det%d",i,j+1),Form("P-P, #Psi_{2} %d",j),nBinRefMult,0,nRefMultMax,"");
998  //fHist_Corr3p_EP_Refm_PP[i][j]->Sumw2();
999  fListHist->Add(fHist_Corr3p_EP_Refm_PP[i][j]);
1000  fHist_Corr3p_EP_Refm_NN[i][j] = new TProfile(Form("fHist_Corr3p_EP_Refm_NegNeg_Mag%d_Det%d",i,j+1),Form("N-N, #Psi_{2}, %d",j),nBinRefMult,0,nRefMultMax,"");
1001  //fHist_Corr3p_EP_Refm_NN[i][j]->Sumw2();
1002  fListHist->Add(fHist_Corr3p_EP_Refm_NN[i][j]);
1003  }
1004  //EP Resolution:
1005  for(int j=0;j<4;j++){
1006  //Det: 0 = v0c-v0a, 1 = v0a-TPC, 2 = v0c-TPC, 3 =TPC-A TPC-C
1007  fHist_Reso2n_EP_Refm_Det[i][j] = new TProfile(Form("fHist_Reso2n_EP_Refm_Mag%d_DetComb%d",i,j+1),"Event plane Resolution",nBinRefMult,0,nRefMultMax,"");
1008  //fHist_Reso2n_EP_Refm_Det[i][j]->Sumw2();
1009  fListHist->Add(fHist_Reso2n_EP_Refm_Det[i][j]);
1010  }
1011  //----------- PID -------------------
1012  for(int j=0;j<4;j++){ //Detector: 0 = V0A, 1 = V0C, 3 = TPCA, 4 = TPCC
1013  //----------> Pion:
1014  fHist_Corr3p_Pion_EP_Refm_PN[i][j] = new TProfile(Form("fHist_Corr3p_Pion_EP_Refm_PosNeg_Mag%d_Det%d",i,j+1),Form("US, #Psi_{2} %d",j),nBinRefMult,0,nRefMultMax,"");
1015  //fHist_Corr3p_Pion_EP_Refm_PN[i][j]->Sumw2();
1016  fListHist->Add(fHist_Corr3p_Pion_EP_Refm_PN[i][j]);
1017  fHist_Corr3p_Pion_EP_Refm_PP[i][j] = new TProfile(Form("fHist_Corr3p_Pion_EP_Refm_PosPos_Mag%d_Det%d",i,j+1),Form("P-P, #Psi_{2} %d",j),nBinRefMult,0,nRefMultMax,"");
1018  //fHist_Corr3p_Pion_EP_Refm_PP[i][j]->Sumw2();
1019  fListHist->Add(fHist_Corr3p_Pion_EP_Refm_PP[i][j]);
1020  fHist_Corr3p_Pion_EP_Refm_NN[i][j] = new TProfile(Form("fHist_Corr3p_Pion_EP_Refm_NegNeg_Mag%d_Det%d",i,j+1),Form("N-N, #Psi_{2}, %d",j),nBinRefMult,0,nRefMultMax,"");
1021  //fHist_Corr3p_Pion_EP_Refm_NN[i][j]->Sumw2();
1022  fListHist->Add(fHist_Corr3p_Pion_EP_Refm_NN[i][j]);
1023  //----------> Kaon:
1024  fHist_Corr3p_Kaon_EP_Refm_PN[i][j] = new TProfile(Form("fHist_Corr3p_Kaon_EP_Refm_PosNeg_Mag%d_Det%d",i,j+1),Form("US,#Psi_{2},%d",j),nBinRefMult,0,nRefMultMax,"");
1025  //fHist_Corr3p_Kaon_EP_Refm_PN[i][j]->Sumw2();
1026  fListHist->Add(fHist_Corr3p_Kaon_EP_Refm_PN[i][j]);
1027  fHist_Corr3p_Kaon_EP_Refm_PP[i][j] = new TProfile(Form("fHist_Corr3p_Kaon_EP_Refm_PosPos_Mag%d_Det%d",i,j+1),Form("P-P,#Psi_{2},%d",j),nBinRefMult,0,nRefMultMax,"");
1028  //fHist_Corr3p_Kaon_EP_Refm_PP[i][j]->Sumw2();
1029  fListHist->Add(fHist_Corr3p_Kaon_EP_Refm_PP[i][j]);
1030  fHist_Corr3p_Kaon_EP_Refm_NN[i][j] = new TProfile(Form("fHist_Corr3p_Kaon_EP_Refm_NegNeg_Mag%d_Det%d",i,j+1),Form("N-N,#Psi_{2},%d",j),nBinRefMult,0,nRefMultMax,"");
1031  //fHist_Corr3p_Kaon_EP_Refm_NN[i][j]->Sumw2();
1032  fListHist->Add(fHist_Corr3p_Kaon_EP_Refm_NN[i][j]);
1033  //----------> Proton:
1034  fHist_Corr3p_Proton_EP_Refm_PN[i][j] = new TProfile(Form("fHist_Corr3p_Proton_EP_Refm_PosNeg_Mag%d_Det%d",i,j+1),Form("US,#Psi_{2},%d",j),nBinRefMult,0,nRefMultMax,"");
1035  //fHist_Corr3p_Proton_EP_Refm_PN[i][j]->Sumw2();
1036  fListHist->Add(fHist_Corr3p_Proton_EP_Refm_PN[i][j]);
1037  fHist_Corr3p_Proton_EP_Refm_PP[i][j] = new TProfile(Form("fHist_Corr3p_Proton_EP_Refm_PosPos_Mag%d_Det%d",i,j+1),Form("P-P,#Psi_{2},%d",j),nBinRefMult,0,nRefMultMax,"");
1038  //fHist_Corr3p_Proton_EP_Refm_PP[i][j]->Sumw2();
1039  fListHist->Add(fHist_Corr3p_Proton_EP_Refm_PP[i][j]);
1040  fHist_Corr3p_Proton_EP_Refm_NN[i][j] = new TProfile(Form("fHist_Corr3p_Proton_EP_Refm_NegNeg_Mag%d_Det%d",i,j+1),Form("N-N,#Psi_{2},%d",j),nBinRefMult,0,nRefMultMax,"");
1041  //fHist_Corr3p_Proton_EP_Refm_NN[i][j]->Sumw2();
1042  fListHist->Add(fHist_Corr3p_Proton_EP_Refm_NN[i][j]);
1043  }//Det loop
1044  }//magfield loop
1045  */
1046 
1047 
1048 
1049 
1050 
1051 
1052 
1053 
1054 
1055 
1056  //--------- Differential PID ------------
1057 
1058  Char_t name[100];
1059  Char_t title[100];
1060 
1061  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};
1062 //Double_t pTRange[11] = {0.0,0.2,0.4,0.6,0.8,1.0,1.2,1.4,1.6,1.8,2.0};
1063 
1064  //Charge:
1065  for(Int_t i=0;i<2;i++){
1066  for(Int_t j=0;j<6;j++){
1067  sprintf(name,"fHist_Corr3p_pTSum_EP_V0A_PN_Mag%d_Cent%d",i,j);
1068  sprintf(title,"PN 3p vs (pT1+pT2)/2, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
1069  fHist_Corr3p_pTSum_EP_V0A_PN[i][j] = new TProfile(name,title,20,pTRange,"");
1070  fHist_Corr3p_pTSum_EP_V0A_PN[i][j]->Sumw2();
1072 
1073  sprintf(name,"fHist_Corr3p_pTSum_EP_V0A_PP_Mag%d_Cent%d",i,j);
1074  sprintf(title,"PP 3p vs (pT1+pT2)/2, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
1075  fHist_Corr3p_pTSum_EP_V0A_PP[i][j] = new TProfile(name,title,20,pTRange,"");
1076  fHist_Corr3p_pTSum_EP_V0A_PP[i][j]->Sumw2();
1078 
1079  sprintf(name,"fHist_Corr3p_pTSum_EP_V0A_NN_Mag%d_Cent%d",i,j);
1080  sprintf(title,"NN 3p vs (pT1+pT2)/2, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
1081  fHist_Corr3p_pTSum_EP_V0A_NN[i][j] = new TProfile(name,title,20,pTRange,"");
1082  fHist_Corr3p_pTSum_EP_V0A_NN[i][j]->Sumw2();
1084  //-----v0c----
1085  sprintf(name,"fHist_Corr3p_pTSum_EP_V0C_PN_Mag%d_Cent%d",i,j);
1086  sprintf(title,"PN 3p vs (pT1+pT2)/2, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
1087  fHist_Corr3p_pTSum_EP_V0C_PN[i][j] = new TProfile(name,title,20,pTRange,"");
1088  fHist_Corr3p_pTSum_EP_V0C_PN[i][j]->Sumw2();
1090 
1091  sprintf(name,"fHist_Corr3p_pTSum_EP_V0C_PP_Mag%d_Cent%d",i,j);
1092  sprintf(title,"PP 3p vs (pT1+pT2)/2, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
1093  fHist_Corr3p_pTSum_EP_V0C_PP[i][j] = new TProfile(name,title,20,pTRange,"");
1094  fHist_Corr3p_pTSum_EP_V0C_PP[i][j]->Sumw2();
1096 
1097  sprintf(name,"fHist_Corr3p_pTSum_EP_V0C_NN_Mag%d_Cent%d",i,j);
1098  sprintf(title,"NN 3p vs (pT1+pT2)/2, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
1099  fHist_Corr3p_pTSum_EP_V0C_NN[i][j] = new TProfile(name,title,20,pTRange,"");
1100  fHist_Corr3p_pTSum_EP_V0C_NN[i][j]->Sumw2();
1102  }
1103  }
1104 
1105  for(Int_t i=0;i<2;i++){
1106  for(Int_t j=0;j<6;j++){
1107  sprintf(name,"fHist_Corr3p_pTDiff_EP_V0A_PN_Mag%d_Cent%d",i,j);
1108  sprintf(title,"PN 3p vs |pT1-pT2|, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
1109  fHist_Corr3p_pTDiff_EP_V0A_PN[i][j] = new TProfile(name,title,20,pTRange,"");
1110  fHist_Corr3p_pTDiff_EP_V0A_PN[i][j]->Sumw2();
1112 
1113  sprintf(name,"fHist_Corr3p_pTDiff_EP_V0A_PP_Mag%d_Cent%d",i,j);
1114  sprintf(title,"PP 3p vs |pT1-pT2|, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
1115  fHist_Corr3p_pTDiff_EP_V0A_PP[i][j] = new TProfile(name,title,20,pTRange,"");
1116  fHist_Corr3p_pTDiff_EP_V0A_PP[i][j]->Sumw2();
1118 
1119  sprintf(name,"fHist_Corr3p_pTDiff_EP_V0A_NN_Mag%d_Cent%d",i,j);
1120  sprintf(title,"NN 3p vs |pT1-pT2|, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
1121  fHist_Corr3p_pTDiff_EP_V0A_NN[i][j] = new TProfile(name,title,20,pTRange,"");
1122  fHist_Corr3p_pTDiff_EP_V0A_NN[i][j]->Sumw2();
1124  //-----v0c----
1125  sprintf(name,"fHist_Corr3p_pTDiff_EP_V0C_PN_Mag%d_Cent%d",i,j);
1126  sprintf(title,"PN 3p vs |pT1-pT2|, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
1127  fHist_Corr3p_pTDiff_EP_V0C_PN[i][j] = new TProfile(name,title,20,pTRange,"");
1128  fHist_Corr3p_pTDiff_EP_V0C_PN[i][j]->Sumw2();
1130 
1131  sprintf(name,"fHist_Corr3p_pTDiff_EP_V0C_PP_Mag%d_Cent%d",i,j);
1132  sprintf(title,"PP 3p vs |pT1-pT2|, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
1133  fHist_Corr3p_pTDiff_EP_V0C_PP[i][j] = new TProfile(name,title,20,pTRange,"");
1134  fHist_Corr3p_pTDiff_EP_V0C_PP[i][j]->Sumw2();
1136 
1137  sprintf(name,"fHist_Corr3p_pTDiff_EP_V0C_NN_Mag%d_Cent%d",i,j);
1138  sprintf(title,"NN 3p vs |pT1-pT2|, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
1139  fHist_Corr3p_pTDiff_EP_V0C_NN[i][j] = new TProfile(name,title,20,pTRange,"");
1140  fHist_Corr3p_pTDiff_EP_V0C_NN[i][j]->Sumw2();
1142  }
1143  }
1144 
1145  //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
1146  //Now Eta binning: 16,0,1.6 for test
1147 
1148  for(Int_t i=0;i<2;i++){
1149  for(Int_t j=0;j<6;j++){
1150  sprintf(name,"fHist_Corr3p_EtaDiff_EP_V0A_PN_Mag%d_Cent%d",i,j);
1151  sprintf(title,"PN 3p vs |Eta1-Eta2|, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
1152  fHist_Corr3p_EtaDiff_EP_V0A_PN[i][j] = new TProfile(name,title,8,0,1.6,"");
1153  fHist_Corr3p_EtaDiff_EP_V0A_PN[i][j]->Sumw2();
1155 
1156  sprintf(name,"fHist_Corr3p_EtaDiff_EP_V0A_PP_Mag%d_Cent%d",i,j);
1157  sprintf(title,"PP 3p vs |Eta1-Eta2|, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
1158  fHist_Corr3p_EtaDiff_EP_V0A_PP[i][j] = new TProfile(name,title,8,0,1.6,"");
1159  fHist_Corr3p_EtaDiff_EP_V0A_PP[i][j]->Sumw2();
1161 
1162  sprintf(name,"fHist_Corr3p_EtaDiff_EP_V0A_NN_Mag%d_Cent%d",i,j);
1163  sprintf(title,"NN 3p vs |Eta1-Eta2|, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
1164  fHist_Corr3p_EtaDiff_EP_V0A_NN[i][j] = new TProfile(name,title,8,0,1.6,"");
1165  fHist_Corr3p_EtaDiff_EP_V0A_NN[i][j]->Sumw2();
1167  //-----v0c----
1168  sprintf(name,"fHist_Corr3p_EtaDiff_EP_V0C_PN_Mag%d_Cent%d",i,j);
1169  sprintf(title,"PN 3p vs |Eta1-Eta2|, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
1170  fHist_Corr3p_EtaDiff_EP_V0C_PN[i][j] = new TProfile(name,title,8,0,1.6,"");
1171  fHist_Corr3p_EtaDiff_EP_V0C_PN[i][j]->Sumw2();
1173 
1174  sprintf(name,"fHist_Corr3p_EtaDiff_EP_V0C_PP_Mag%d_Cent%d",i,j);
1175  sprintf(title,"PP 3p vs |Eta1-Eta2|, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
1176  fHist_Corr3p_EtaDiff_EP_V0C_PP[i][j] = new TProfile(name,title,8,0,1.6,"");
1177  fHist_Corr3p_EtaDiff_EP_V0C_PP[i][j]->Sumw2();
1179 
1180  sprintf(name,"fHist_Corr3p_EtaDiff_EP_V0C_NN_Mag%d_Cent%d",i,j);
1181  sprintf(title,"NN 3p vs |Eta1-Eta2|, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
1182  fHist_Corr3p_EtaDiff_EP_V0C_NN[i][j] = new TProfile(name,title,8,0,1.6,"");
1183  fHist_Corr3p_EtaDiff_EP_V0C_NN[i][j]->Sumw2();
1185  }
1186  }
1187 
1188  // Pion
1189  /*
1190  for(Int_t i=0;i<2;i++){
1191  for(Int_t j=0;j<6;j++){
1192  sprintf(name,"fHist_Corr3p_Pion_pTSum_EP_V0A_PN_Mag%d_Cent%d",i,j);
1193  sprintf(title,"PN 3p vs (pT1+pT2)/2, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
1194  fHist_Corr3p_Pion_pTSum_EP_V0A_PN[i][j] = new TProfile(name,title,20,pTRange,"");
1195  fHist_Corr3p_Pion_pTSum_EP_V0A_PN[i][j]->Sumw2();
1196  fListHist->Add(fHist_Corr3p_Pion_pTSum_EP_V0A_PN[i][j]);
1197 
1198  sprintf(name,"fHist_Corr3p_Pion_pTSum_EP_V0A_PP_Mag%d_Cent%d",i,j);
1199  sprintf(title,"PP 3p vs (pT1+pT2)/2, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
1200  fHist_Corr3p_Pion_pTSum_EP_V0A_PP[i][j] = new TProfile(name,title,20,pTRange,"");
1201  fHist_Corr3p_Pion_pTSum_EP_V0A_PP[i][j]->Sumw2();
1202  fListHist->Add(fHist_Corr3p_Pion_pTSum_EP_V0A_PP[i][j]);
1203 
1204  sprintf(name,"fHist_Corr3p_Pion_pTSum_EP_V0A_NN_Mag%d_Cent%d",i,j);
1205  sprintf(title,"NN 3p vs (pT1+pT2)/2, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
1206  fHist_Corr3p_Pion_pTSum_EP_V0A_NN[i][j] = new TProfile(name,title,20,pTRange,"");
1207  fHist_Corr3p_Pion_pTSum_EP_V0A_NN[i][j]->Sumw2();
1208  fListHist->Add(fHist_Corr3p_Pion_pTSum_EP_V0A_NN[i][j]);
1209  //-----v0c----
1210  sprintf(name,"fHist_Corr3p_Pion_pTSum_EP_V0C_PN_Mag%d_Cent%d",i,j);
1211  sprintf(title,"PN 3p vs (pT1+pT2)/2, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
1212  fHist_Corr3p_Pion_pTSum_EP_V0C_PN[i][j] = new TProfile(name,title,20,pTRange,"");
1213  fHist_Corr3p_Pion_pTSum_EP_V0C_PN[i][j]->Sumw2();
1214  fListHist->Add(fHist_Corr3p_Pion_pTSum_EP_V0C_PN[i][j]);
1215 
1216  sprintf(name,"fHist_Corr3p_Pion_pTSum_EP_V0C_PP_Mag%d_Cent%d",i,j);
1217  sprintf(title,"PP 3p vs (pT1+pT2)/2, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
1218  fHist_Corr3p_Pion_pTSum_EP_V0C_PP[i][j] = new TProfile(name,title,20,pTRange,"");
1219  fHist_Corr3p_Pion_pTSum_EP_V0C_PP[i][j]->Sumw2();
1220  fListHist->Add(fHist_Corr3p_Pion_pTSum_EP_V0C_PP[i][j]);
1221 
1222  sprintf(name,"fHist_Corr3p_Pion_pTSum_EP_V0C_NN_Mag%d_Cent%d",i,j);
1223  sprintf(title,"NN 3p vs (pT1+pT2)/2, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
1224  fHist_Corr3p_Pion_pTSum_EP_V0C_NN[i][j] = new TProfile(name,title,20,pTRange,"");
1225  fHist_Corr3p_Pion_pTSum_EP_V0C_NN[i][j]->Sumw2();
1226  fListHist->Add(fHist_Corr3p_Pion_pTSum_EP_V0C_NN[i][j]);
1227  }
1228  }
1229 
1230  for(Int_t i=0;i<2;i++){
1231  for(Int_t j=0;j<6;j++){
1232  sprintf(name,"fHist_Corr3p_Pion_pTDiff_EP_V0A_PN_Mag%d_Cent%d",i,j);
1233  sprintf(title,"PN 3p vs |pT1-pT2|, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
1234  fHist_Corr3p_Pion_pTDiff_EP_V0A_PN[i][j] = new TProfile(name,title,20,pTRange,"");
1235  fHist_Corr3p_Pion_pTDiff_EP_V0A_PN[i][j]->Sumw2();
1236  fListHist->Add(fHist_Corr3p_Pion_pTDiff_EP_V0A_PN[i][j]);
1237 
1238  sprintf(name,"fHist_Corr3p_Pion_pTDiff_EP_V0A_PP_Mag%d_Cent%d",i,j);
1239  sprintf(title,"PP 3p vs |pT1-pT2|, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
1240  fHist_Corr3p_Pion_pTDiff_EP_V0A_PP[i][j] = new TProfile(name,title,20,pTRange,"");
1241  fHist_Corr3p_Pion_pTDiff_EP_V0A_PP[i][j]->Sumw2();
1242  fListHist->Add(fHist_Corr3p_Pion_pTDiff_EP_V0A_PP[i][j]);
1243 
1244  sprintf(name,"fHist_Corr3p_Pion_pTDiff_EP_V0A_NN_Mag%d_Cent%d",i,j);
1245  sprintf(title,"NN 3p vs |pT1-pT2|, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
1246  fHist_Corr3p_Pion_pTDiff_EP_V0A_NN[i][j] = new TProfile(name,title,20,pTRange,"");
1247  fHist_Corr3p_Pion_pTDiff_EP_V0A_NN[i][j]->Sumw2();
1248  fListHist->Add(fHist_Corr3p_Pion_pTDiff_EP_V0A_NN[i][j]);
1249  //-----v0c----
1250  sprintf(name,"fHist_Corr3p_Pion_pTDiff_EP_V0C_PN_Mag%d_Cent%d",i,j);
1251  sprintf(title,"PN 3p vs |pT1-pT2|, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
1252  fHist_Corr3p_Pion_pTDiff_EP_V0C_PN[i][j] = new TProfile(name,title,20,pTRange,"");
1253  fHist_Corr3p_Pion_pTDiff_EP_V0C_PN[i][j]->Sumw2();
1254  fListHist->Add(fHist_Corr3p_Pion_pTDiff_EP_V0C_PN[i][j]);
1255 
1256  sprintf(name,"fHist_Corr3p_Pion_pTDiff_EP_V0C_PP_Mag%d_Cent%d",i,j);
1257  sprintf(title,"PP 3p vs |pT1-pT2|, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
1258  fHist_Corr3p_Pion_pTDiff_EP_V0C_PP[i][j] = new TProfile(name,title,20,pTRange,"");
1259  fHist_Corr3p_Pion_pTDiff_EP_V0C_PP[i][j]->Sumw2();
1260  fListHist->Add(fHist_Corr3p_Pion_pTDiff_EP_V0C_PP[i][j]);
1261 
1262  sprintf(name,"fHist_Corr3p_Pion_pTDiff_EP_V0C_NN_Mag%d_Cent%d",i,j);
1263  sprintf(title,"NN 3p vs |pT1-pT2|, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
1264  fHist_Corr3p_Pion_pTDiff_EP_V0C_NN[i][j] = new TProfile(name,title,20,pTRange,"");
1265  fHist_Corr3p_Pion_pTDiff_EP_V0C_NN[i][j]->Sumw2();
1266  fListHist->Add(fHist_Corr3p_Pion_pTDiff_EP_V0C_NN[i][j]);
1267  }
1268  }
1269 
1270  //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
1271 
1272  for(Int_t i=0;i<2;i++){
1273  for(Int_t j=0;j<6;j++){
1274  sprintf(name,"fHist_Corr3p_Pion_EtaDiff_EP_V0A_PN_Mag%d_Cent%d",i,j);
1275  sprintf(title,"PN 3p vs |Eta1-Eta2|, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
1276  fHist_Corr3p_Pion_EtaDiff_EP_V0A_PN[i][j] = new TProfile(name,title,16,0,1.6,"");
1277  fHist_Corr3p_Pion_EtaDiff_EP_V0A_PN[i][j]->Sumw2();
1278  fListHist->Add(fHist_Corr3p_Pion_EtaDiff_EP_V0A_PN[i][j]);
1279 
1280  sprintf(name,"fHist_Corr3p_Pion_EtaDiff_EP_V0A_PP_Mag%d_Cent%d",i,j);
1281  sprintf(title,"PP 3p vs |Eta1-Eta2|, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
1282  fHist_Corr3p_Pion_EtaDiff_EP_V0A_PP[i][j] = new TProfile(name,title,16,0,1.6,"");
1283  fHist_Corr3p_Pion_EtaDiff_EP_V0A_PP[i][j]->Sumw2();
1284  fListHist->Add(fHist_Corr3p_Pion_EtaDiff_EP_V0A_PP[i][j]);
1285 
1286  sprintf(name,"fHist_Corr3p_Pion_EtaDiff_EP_V0A_NN_Mag%d_Cent%d",i,j);
1287  sprintf(title,"NN 3p vs |Eta1-Eta2|, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
1288  fHist_Corr3p_Pion_EtaDiff_EP_V0A_NN[i][j] = new TProfile(name,title,16,0,1.6,"");
1289  fHist_Corr3p_Pion_EtaDiff_EP_V0A_NN[i][j]->Sumw2();
1290  fListHist->Add(fHist_Corr3p_Pion_EtaDiff_EP_V0A_NN[i][j]);
1291  //-----v0c----
1292  sprintf(name,"fHist_Corr3p_Pion_EtaDiff_EP_V0C_PN_Mag%d_Cent%d",i,j);
1293  sprintf(title,"PN 3p vs |Eta1-Eta2|, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
1294  fHist_Corr3p_Pion_EtaDiff_EP_V0C_PN[i][j] = new TProfile(name,title,16,0,1.6,"");
1295  fHist_Corr3p_Pion_EtaDiff_EP_V0C_PN[i][j]->Sumw2();
1296  fListHist->Add(fHist_Corr3p_Pion_EtaDiff_EP_V0C_PN[i][j]);
1297 
1298  sprintf(name,"fHist_Corr3p_Pion_EtaDiff_EP_V0C_PP_Mag%d_Cent%d",i,j);
1299  sprintf(title,"PP 3p vs |Eta1-Eta2|, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
1300  fHist_Corr3p_Pion_EtaDiff_EP_V0C_PP[i][j] = new TProfile(name,title,16,0,1.6,"");
1301  fHist_Corr3p_Pion_EtaDiff_EP_V0C_PP[i][j]->Sumw2();
1302  fListHist->Add(fHist_Corr3p_Pion_EtaDiff_EP_V0C_PP[i][j]);
1303 
1304  sprintf(name,"fHist_Corr3p_Pion_EtaDiff_EP_V0C_NN_Mag%d_Cent%d",i,j);
1305  sprintf(title,"NN 3p vs |Eta1-Eta2|, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
1306  fHist_Corr3p_Pion_EtaDiff_EP_V0C_NN[i][j] = new TProfile(name,title,16,0,1.6,"");
1307  fHist_Corr3p_Pion_EtaDiff_EP_V0C_NN[i][j]->Sumw2();
1308  fListHist->Add(fHist_Corr3p_Pion_EtaDiff_EP_V0C_NN[i][j]);
1309  }
1310  }
1311 
1312  //Kaon
1313  for(Int_t i=0;i<2;i++){
1314  for(Int_t j=0;j<6;j++){
1315  sprintf(name,"fHist_Corr3p_Kaon_pTSum_EP_V0A_PN_Mag%d_Cent%d",i,j);
1316  sprintf(title,"PN 3p vs (pT1+pT2)/2, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
1317  fHist_Corr3p_Kaon_pTSum_EP_V0A_PN[i][j] = new TProfile(name,title,20,pTRange,"");
1318  fHist_Corr3p_Kaon_pTSum_EP_V0A_PN[i][j]->Sumw2();
1319  fListHist->Add(fHist_Corr3p_Kaon_pTSum_EP_V0A_PN[i][j]);
1320 
1321  sprintf(name,"fHist_Corr3p_Kaon_pTSum_EP_V0A_PP_Mag%d_Cent%d",i,j);
1322  sprintf(title,"PP 3p vs (pT1+pT2)/2, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
1323  fHist_Corr3p_Kaon_pTSum_EP_V0A_PP[i][j] = new TProfile(name,title,20,pTRange,"");
1324  fHist_Corr3p_Kaon_pTSum_EP_V0A_PP[i][j]->Sumw2();
1325  fListHist->Add(fHist_Corr3p_Kaon_pTSum_EP_V0A_PP[i][j]);
1326 
1327  sprintf(name,"fHist_Corr3p_Kaon_pTSum_EP_V0A_NN_Mag%d_Cent%d",i,j);
1328  sprintf(title,"NN 3p vs (pT1+pT2)/2, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
1329  fHist_Corr3p_Kaon_pTSum_EP_V0A_NN[i][j] = new TProfile(name,title,20,pTRange,"");
1330  fHist_Corr3p_Kaon_pTSum_EP_V0A_NN[i][j]->Sumw2();
1331  fListHist->Add(fHist_Corr3p_Kaon_pTSum_EP_V0A_NN[i][j]);
1332  //-----v0c----
1333  sprintf(name,"fHist_Corr3p_Kaon_pTSum_EP_V0C_PN_Mag%d_Cent%d",i,j);
1334  sprintf(title,"PN 3p vs (pT1+pT2)/2, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
1335  fHist_Corr3p_Kaon_pTSum_EP_V0C_PN[i][j] = new TProfile(name,title,20,pTRange,"");
1336  fHist_Corr3p_Kaon_pTSum_EP_V0C_PN[i][j]->Sumw2();
1337  fListHist->Add(fHist_Corr3p_Kaon_pTSum_EP_V0C_PN[i][j]);
1338 
1339  sprintf(name,"fHist_Corr3p_Kaon_pTSum_EP_V0C_PP_Mag%d_Cent%d",i,j);
1340  sprintf(title,"PP 3p vs (pT1+pT2)/2, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
1341  fHist_Corr3p_Kaon_pTSum_EP_V0C_PP[i][j] = new TProfile(name,title,20,pTRange,"");
1342  fHist_Corr3p_Kaon_pTSum_EP_V0C_PP[i][j]->Sumw2();
1343  fListHist->Add(fHist_Corr3p_Kaon_pTSum_EP_V0C_PP[i][j]);
1344 
1345  sprintf(name,"fHist_Corr3p_Kaon_pTSum_EP_V0C_NN_Mag%d_Cent%d",i,j);
1346  sprintf(title,"NN 3p vs (pT1+pT2)/2, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
1347  fHist_Corr3p_Kaon_pTSum_EP_V0C_NN[i][j] = new TProfile(name,title,20,pTRange,"");
1348  fHist_Corr3p_Kaon_pTSum_EP_V0C_NN[i][j]->Sumw2();
1349  fListHist->Add(fHist_Corr3p_Kaon_pTSum_EP_V0C_NN[i][j]);
1350  }
1351  }
1352 
1353  for(Int_t i=0;i<2;i++){
1354  for(Int_t j=0;j<6;j++){
1355  sprintf(name,"fHist_Corr3p_Kaon_pTDiff_EP_V0A_PN_Mag%d_Cent%d",i,j);
1356  sprintf(title,"PN 3p vs |pT1-pT2|, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
1357  fHist_Corr3p_Kaon_pTDiff_EP_V0A_PN[i][j] = new TProfile(name,title,20,pTRange,"");
1358  fHist_Corr3p_Kaon_pTDiff_EP_V0A_PN[i][j]->Sumw2();
1359  fListHist->Add(fHist_Corr3p_Kaon_pTDiff_EP_V0A_PN[i][j]);
1360 
1361  sprintf(name,"fHist_Corr3p_Kaon_pTDiff_EP_V0A_PP_Mag%d_Cent%d",i,j);
1362  sprintf(title,"PP 3p vs |pT1-pT2|, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
1363  fHist_Corr3p_Kaon_pTDiff_EP_V0A_PP[i][j] = new TProfile(name,title,20,pTRange,"");
1364  fHist_Corr3p_Kaon_pTDiff_EP_V0A_PP[i][j]->Sumw2();
1365  fListHist->Add(fHist_Corr3p_Kaon_pTDiff_EP_V0A_PP[i][j]);
1366 
1367  sprintf(name,"fHist_Corr3p_Kaon_pTDiff_EP_V0A_NN_Mag%d_Cent%d",i,j);
1368  sprintf(title,"NN 3p vs |pT1-pT2|, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
1369  fHist_Corr3p_Kaon_pTDiff_EP_V0A_NN[i][j] = new TProfile(name,title,20,pTRange,"");
1370  fHist_Corr3p_Kaon_pTDiff_EP_V0A_NN[i][j]->Sumw2();
1371  fListHist->Add(fHist_Corr3p_Kaon_pTDiff_EP_V0A_NN[i][j]);
1372  //-----v0c----
1373  sprintf(name,"fHist_Corr3p_Kaon_pTDiff_EP_V0C_PN_Mag%d_Cent%d",i,j);
1374  sprintf(title,"PN 3p vs |pT1-pT2|, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
1375  fHist_Corr3p_Kaon_pTDiff_EP_V0C_PN[i][j] = new TProfile(name,title,20,pTRange,"");
1376  fHist_Corr3p_Kaon_pTDiff_EP_V0C_PN[i][j]->Sumw2();
1377  fListHist->Add(fHist_Corr3p_Kaon_pTDiff_EP_V0C_PN[i][j]);
1378 
1379  sprintf(name,"fHist_Corr3p_Kaon_pTDiff_EP_V0C_PP_Mag%d_Cent%d",i,j);
1380  sprintf(title,"PP 3p vs |pT1-pT2|, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
1381  fHist_Corr3p_Kaon_pTDiff_EP_V0C_PP[i][j] = new TProfile(name,title,20,pTRange,"");
1382  fHist_Corr3p_Kaon_pTDiff_EP_V0C_PP[i][j]->Sumw2();
1383  fListHist->Add(fHist_Corr3p_Kaon_pTDiff_EP_V0C_PP[i][j]);
1384 
1385  sprintf(name,"fHist_Corr3p_Kaon_pTDiff_EP_V0C_NN_Mag%d_Cent%d",i,j);
1386  sprintf(title,"NN 3p vs |pT1-pT2|, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
1387  fHist_Corr3p_Kaon_pTDiff_EP_V0C_NN[i][j] = new TProfile(name,title,20,pTRange,"");
1388  fHist_Corr3p_Kaon_pTDiff_EP_V0C_NN[i][j]->Sumw2();
1389  fListHist->Add(fHist_Corr3p_Kaon_pTDiff_EP_V0C_NN[i][j]);
1390  }
1391  }
1392 
1393  //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
1394 
1395  for(Int_t i=0;i<2;i++){
1396  for(Int_t j=0;j<6;j++){
1397  sprintf(name,"fHist_Corr3p_Kaon_EtaDiff_EP_V0A_PN_Mag%d_Cent%d",i,j);
1398  sprintf(title,"PN 3p vs |Eta1-Eta2|, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
1399  fHist_Corr3p_Kaon_EtaDiff_EP_V0A_PN[i][j] = new TProfile(name,title,16,0,1.6,"");
1400  fHist_Corr3p_Kaon_EtaDiff_EP_V0A_PN[i][j]->Sumw2();
1401  fListHist->Add(fHist_Corr3p_Kaon_EtaDiff_EP_V0A_PN[i][j]);
1402 
1403  sprintf(name,"fHist_Corr3p_Kaon_EtaDiff_EP_V0A_PP_Mag%d_Cent%d",i,j);
1404  sprintf(title,"PP 3p vs |Eta1-Eta2|, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
1405  fHist_Corr3p_Kaon_EtaDiff_EP_V0A_PP[i][j] = new TProfile(name,title,16,0,1.6,"");
1406  fHist_Corr3p_Kaon_EtaDiff_EP_V0A_PP[i][j]->Sumw2();
1407  fListHist->Add(fHist_Corr3p_Kaon_EtaDiff_EP_V0A_PP[i][j]);
1408 
1409  sprintf(name,"fHist_Corr3p_Kaon_EtaDiff_EP_V0A_NN_Mag%d_Cent%d",i,j);
1410  sprintf(title,"NN 3p vs |Eta1-Eta2|, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
1411  fHist_Corr3p_Kaon_EtaDiff_EP_V0A_NN[i][j] = new TProfile(name,title,16,0,1.6,"");
1412  fHist_Corr3p_Kaon_EtaDiff_EP_V0A_NN[i][j]->Sumw2();
1413  fListHist->Add(fHist_Corr3p_Kaon_EtaDiff_EP_V0A_NN[i][j]);
1414  //-----v0c----
1415  sprintf(name,"fHist_Corr3p_Kaon_EtaDiff_EP_V0C_PN_Mag%d_Cent%d",i,j);
1416  sprintf(title,"PN 3p vs |Eta1-Eta2|, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
1417  fHist_Corr3p_Kaon_EtaDiff_EP_V0C_PN[i][j] = new TProfile(name,title,16,0,1.6,"");
1418  fHist_Corr3p_Kaon_EtaDiff_EP_V0C_PN[i][j]->Sumw2();
1419  fListHist->Add(fHist_Corr3p_Kaon_EtaDiff_EP_V0C_PN[i][j]);
1420 
1421  sprintf(name,"fHist_Corr3p_Kaon_EtaDiff_EP_V0C_PP_Mag%d_Cent%d",i,j);
1422  sprintf(title,"PP 3p vs |Eta1-Eta2|, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
1423  fHist_Corr3p_Kaon_EtaDiff_EP_V0C_PP[i][j] = new TProfile(name,title,16,0,1.6,"");
1424  fHist_Corr3p_Kaon_EtaDiff_EP_V0C_PP[i][j]->Sumw2();
1425  fListHist->Add(fHist_Corr3p_Kaon_EtaDiff_EP_V0C_PP[i][j]);
1426 
1427  sprintf(name,"fHist_Corr3p_Kaon_EtaDiff_EP_V0C_NN_Mag%d_Cent%d",i,j);
1428  sprintf(title,"NN 3p vs |Eta1-Eta2|, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
1429  fHist_Corr3p_Kaon_EtaDiff_EP_V0C_NN[i][j] = new TProfile(name,title,16,0,1.6,"");
1430  fHist_Corr3p_Kaon_EtaDiff_EP_V0C_NN[i][j]->Sumw2();
1431  fListHist->Add(fHist_Corr3p_Kaon_EtaDiff_EP_V0C_NN[i][j]);
1432  }
1433  }
1434 
1435  //Proton
1436  for(Int_t i=0;i<2;i++){
1437  for(Int_t j=0;j<6;j++){
1438  sprintf(name,"fHist_Corr3p_Proton_pTSum_EP_V0A_PN_Mag%d_Cent%d",i,j);
1439  sprintf(title,"PN 3p vs (pT1+pT2)/2, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
1440  fHist_Corr3p_Proton_pTSum_EP_V0A_PN[i][j] = new TProfile(name,title,20,pTRange,"");
1441  fHist_Corr3p_Proton_pTSum_EP_V0A_PN[i][j]->Sumw2();
1442  fListHist->Add(fHist_Corr3p_Proton_pTSum_EP_V0A_PN[i][j]);
1443 
1444  sprintf(name,"fHist_Corr3p_Proton_pTSum_EP_V0A_PP_Mag%d_Cent%d",i,j);
1445  sprintf(title,"PP 3p vs (pT1+pT2)/2, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
1446  fHist_Corr3p_Proton_pTSum_EP_V0A_PP[i][j] = new TProfile(name,title,20,pTRange,"");
1447  fHist_Corr3p_Proton_pTSum_EP_V0A_PP[i][j]->Sumw2();
1448  fListHist->Add(fHist_Corr3p_Proton_pTSum_EP_V0A_PP[i][j]);
1449 
1450  sprintf(name,"fHist_Corr3p_Proton_pTSum_EP_V0A_NN_Mag%d_Cent%d",i,j);
1451  sprintf(title,"NN 3p vs (pT1+pT2)/2, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
1452  fHist_Corr3p_Proton_pTSum_EP_V0A_NN[i][j] = new TProfile(name,title,20,pTRange,"");
1453  fHist_Corr3p_Proton_pTSum_EP_V0A_NN[i][j]->Sumw2();
1454  fListHist->Add(fHist_Corr3p_Proton_pTSum_EP_V0A_NN[i][j]);
1455  //-----v0c----
1456  sprintf(name,"fHist_Corr3p_Proton_pTSum_EP_V0C_PN_Mag%d_Cent%d",i,j);
1457  sprintf(title,"PN 3p vs (pT1+pT2)/2, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
1458  fHist_Corr3p_Proton_pTSum_EP_V0C_PN[i][j] = new TProfile(name,title,20,pTRange,"");
1459  fHist_Corr3p_Proton_pTSum_EP_V0C_PN[i][j]->Sumw2();
1460  fListHist->Add(fHist_Corr3p_Proton_pTSum_EP_V0C_PN[i][j]);
1461 
1462  sprintf(name,"fHist_Corr3p_Proton_pTSum_EP_V0C_PP_Mag%d_Cent%d",i,j);
1463  sprintf(title,"PP 3p vs (pT1+pT2)/2, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
1464  fHist_Corr3p_Proton_pTSum_EP_V0C_PP[i][j] = new TProfile(name,title,20,pTRange,"");
1465  fHist_Corr3p_Proton_pTSum_EP_V0C_PP[i][j]->Sumw2();
1466  fListHist->Add(fHist_Corr3p_Proton_pTSum_EP_V0C_PP[i][j]);
1467 
1468  sprintf(name,"fHist_Corr3p_Proton_pTSum_EP_V0C_NN_Mag%d_Cent%d",i,j);
1469  sprintf(title,"NN 3p vs (pT1+pT2)/2, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
1470  fHist_Corr3p_Proton_pTSum_EP_V0C_NN[i][j] = new TProfile(name,title,20,pTRange,"");
1471  fHist_Corr3p_Proton_pTSum_EP_V0C_NN[i][j]->Sumw2();
1472  fListHist->Add(fHist_Corr3p_Proton_pTSum_EP_V0C_NN[i][j]);
1473  }
1474  }
1475 
1476  for(Int_t i=0;i<2;i++){
1477  for(Int_t j=0;j<6;j++){
1478  sprintf(name,"fHist_Corr3p_Proton_pTDiff_EP_V0A_PN_Mag%d_Cent%d",i,j);
1479  sprintf(title,"PN 3p vs |pT1-pT2|, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
1480  fHist_Corr3p_Proton_pTDiff_EP_V0A_PN[i][j] = new TProfile(name,title,20,pTRange,"");
1481  fHist_Corr3p_Proton_pTDiff_EP_V0A_PN[i][j]->Sumw2();
1482  fListHist->Add(fHist_Corr3p_Proton_pTDiff_EP_V0A_PN[i][j]);
1483 
1484  sprintf(name,"fHist_Corr3p_Proton_pTDiff_EP_V0A_PP_Mag%d_Cent%d",i,j);
1485  sprintf(title,"PP 3p vs |pT1-pT2|, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
1486  fHist_Corr3p_Proton_pTDiff_EP_V0A_PP[i][j] = new TProfile(name,title,20,pTRange,"");
1487  fHist_Corr3p_Proton_pTDiff_EP_V0A_PP[i][j]->Sumw2();
1488  fListHist->Add(fHist_Corr3p_Proton_pTDiff_EP_V0A_PP[i][j]);
1489 
1490  sprintf(name,"fHist_Corr3p_Proton_pTDiff_EP_V0A_NN_Mag%d_Cent%d",i,j);
1491  sprintf(title,"NN 3p vs |pT1-pT2|, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
1492  fHist_Corr3p_Proton_pTDiff_EP_V0A_NN[i][j] = new TProfile(name,title,20,pTRange,"");
1493  fHist_Corr3p_Proton_pTDiff_EP_V0A_NN[i][j]->Sumw2();
1494  fListHist->Add(fHist_Corr3p_Proton_pTDiff_EP_V0A_NN[i][j]);
1495  //-----v0c----
1496  sprintf(name,"fHist_Corr3p_Proton_pTDiff_EP_V0C_PN_Mag%d_Cent%d",i,j);
1497  sprintf(title,"PN 3p vs |pT1-pT2|, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
1498  fHist_Corr3p_Proton_pTDiff_EP_V0C_PN[i][j] = new TProfile(name,title,20,pTRange,"");
1499  fHist_Corr3p_Proton_pTDiff_EP_V0C_PN[i][j]->Sumw2();
1500  fListHist->Add(fHist_Corr3p_Proton_pTDiff_EP_V0C_PN[i][j]);
1501 
1502  sprintf(name,"fHist_Corr3p_Proton_pTDiff_EP_V0C_PP_Mag%d_Cent%d",i,j);
1503  sprintf(title,"PP 3p vs |pT1-pT2|, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
1504  fHist_Corr3p_Proton_pTDiff_EP_V0C_PP[i][j] = new TProfile(name,title,20,pTRange,"");
1505  fHist_Corr3p_Proton_pTDiff_EP_V0C_PP[i][j]->Sumw2();
1506  fListHist->Add(fHist_Corr3p_Proton_pTDiff_EP_V0C_PP[i][j]);
1507 
1508  sprintf(name,"fHist_Corr3p_Proton_pTDiff_EP_V0C_NN_Mag%d_Cent%d",i,j);
1509  sprintf(title,"NN 3p vs |pT1-pT2|, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
1510  fHist_Corr3p_Proton_pTDiff_EP_V0C_NN[i][j] = new TProfile(name,title,20,pTRange,"");
1511  fHist_Corr3p_Proton_pTDiff_EP_V0C_NN[i][j]->Sumw2();
1512  fListHist->Add(fHist_Corr3p_Proton_pTDiff_EP_V0C_NN[i][j]);
1513  }
1514  }
1515 
1516  //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
1517 
1518  for(Int_t i=0;i<2;i++){
1519  for(Int_t j=0;j<6;j++){
1520  sprintf(name,"fHist_Corr3p_Proton_EtaDiff_EP_V0A_PN_Mag%d_Cent%d",i,j);
1521  sprintf(title,"PN 3p vs |Eta1-Eta2|, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
1522  fHist_Corr3p_Proton_EtaDiff_EP_V0A_PN[i][j] = new TProfile(name,title,16,0,1.6,"");
1523  fHist_Corr3p_Proton_EtaDiff_EP_V0A_PN[i][j]->Sumw2();
1524  fListHist->Add(fHist_Corr3p_Proton_EtaDiff_EP_V0A_PN[i][j]);
1525 
1526  sprintf(name,"fHist_Corr3p_Proton_EtaDiff_EP_V0A_PP_Mag%d_Cent%d",i,j);
1527  sprintf(title,"PP 3p vs |Eta1-Eta2|, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
1528  fHist_Corr3p_Proton_EtaDiff_EP_V0A_PP[i][j] = new TProfile(name,title,16,0,1.6,"");
1529  fHist_Corr3p_Proton_EtaDiff_EP_V0A_PP[i][j]->Sumw2();
1530  fListHist->Add(fHist_Corr3p_Proton_EtaDiff_EP_V0A_PP[i][j]);
1531 
1532  sprintf(name,"fHist_Corr3p_Proton_EtaDiff_EP_V0A_NN_Mag%d_Cent%d",i,j);
1533  sprintf(title,"NN 3p vs |Eta1-Eta2|, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
1534  fHist_Corr3p_Proton_EtaDiff_EP_V0A_NN[i][j] = new TProfile(name,title,16,0,1.6,"");
1535  fHist_Corr3p_Proton_EtaDiff_EP_V0A_NN[i][j]->Sumw2();
1536  fListHist->Add(fHist_Corr3p_Proton_EtaDiff_EP_V0A_NN[i][j]);
1537  //-----v0c----
1538  sprintf(name,"fHist_Corr3p_Proton_EtaDiff_EP_V0C_PN_Mag%d_Cent%d",i,j);
1539  sprintf(title,"PN 3p vs |Eta1-Eta2|, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
1540  fHist_Corr3p_Proton_EtaDiff_EP_V0C_PN[i][j] = new TProfile(name,title,16,0,1.6,"");
1541  fHist_Corr3p_Proton_EtaDiff_EP_V0C_PN[i][j]->Sumw2();
1542  fListHist->Add(fHist_Corr3p_Proton_EtaDiff_EP_V0C_PN[i][j]);
1543 
1544  sprintf(name,"fHist_Corr3p_Proton_EtaDiff_EP_V0C_PP_Mag%d_Cent%d",i,j);
1545  sprintf(title,"PP 3p vs |Eta1-Eta2|, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
1546  fHist_Corr3p_Proton_EtaDiff_EP_V0C_PP[i][j] = new TProfile(name,title,16,0,1.6,"");
1547  fHist_Corr3p_Proton_EtaDiff_EP_V0C_PP[i][j]->Sumw2();
1548  fListHist->Add(fHist_Corr3p_Proton_EtaDiff_EP_V0C_PP[i][j]);
1549 
1550  sprintf(name,"fHist_Corr3p_Proton_EtaDiff_EP_V0C_NN_Mag%d_Cent%d",i,j);
1551  sprintf(title,"NN 3p vs |Eta1-Eta2|, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
1552  fHist_Corr3p_Proton_EtaDiff_EP_V0C_NN[i][j] = new TProfile(name,title,16,0,1.6,"");
1553  fHist_Corr3p_Proton_EtaDiff_EP_V0C_NN[i][j]->Sumw2();
1554  fListHist->Add(fHist_Corr3p_Proton_EtaDiff_EP_V0C_NN[i][j]);
1555  }
1556  }
1557  */
1558  //------------------ Differential 3p PID done -----------------------
1559 
1560 
1561 
1562 
1563 
1564 
1565 
1566 
1567 
1568  //---- to store NUA and calib histograms -----
1569  TList *fListNUACalib = new TList();
1570  fListNUACalib->SetName("fListNUACalib");
1571  fListNUACalib->SetOwner(kTRUE);
1572 
1573 
1574  Double_t truncPi = 3.1416;
1575 
1576  //-------------- Event plane distributions --------------
1577  fHV0AEventPlaneVsCent = new TH2F("fHV0AEventPlaneVsCent",Form("Psi %d from V0A", gPsiN), 10,centRange,50,-0.0,truncPi);
1578  fListNUACalib->Add(fHV0AEventPlaneVsCent);
1579 
1580  fHV0CEventPlaneVsCent = new TH2F("fHV0CEventPlaneVsCent",Form("Psi %d from V0C", gPsiN), 10,centRange,50,-0.0,truncPi);
1581  fListNUACalib->Add(fHV0CEventPlaneVsCent);
1582 
1583  fHTPCAEventPlaneVsCent = new TH2F("fHTPCAEventPlaneVsCent",Form("Psi %d from pos eta",gPsiN),10,centRange,50,-0.0,truncPi);
1584  fListNUACalib->Add(fHTPCAEventPlaneVsCent);
1585 
1586  fHTPCCEventPlaneVsCent = new TH2F("fHTPCCEventPlaneVsCent",Form("Psi %d from neg eta",gPsiN),10,centRange,50,-0.0,truncPi);
1587  fListNUACalib->Add(fHTPCCEventPlaneVsCent);
1588 
1589  fHTPCEventPlaneVsCent = new TH2F("fHTPCEventPlaneVsCent",Form("Psi %d from Full TPC",gPsiN),10,centRange,50,-0.0,truncPi);
1590  fListNUACalib->Add(fHTPCEventPlaneVsCent);
1591 
1592 
1593 
1594  //-------------------- QA: how does the eta-phi looks after NUA correction ----------------
1595  fQAEtaPhiAfterNUA = new TH2F("fQAEtaPhiAfterNUA","eta vs phi with NUA corr",50,0,6.283185,16,-0.8,0.8);
1596  fListNUACalib->Add(fQAEtaPhiAfterNUA);
1597 
1598  fQAEtaPhiAfterNUAPion = new TH2F("fQAEtaPhiAfterNUAPion","Pion eta vs phi with NUA corr",50,0,6.283185,16,-0.8,0.8);
1599  fListNUACalib->Add(fQAEtaPhiAfterNUAPion);
1600 
1601  fQAEtaPhiAfterNUAKaon = new TH2F("fQAEtaPhiAfterNUAKaon","Kaon eta vs phi with NUA corr",50,0,6.283185,16,-0.8,0.8);
1602  fListNUACalib->Add(fQAEtaPhiAfterNUAKaon);
1603 
1604  fQAEtaPhiAfterNUAProton = new TH2F("fQAEtaPhiAfterNUAProton","Proton eta vs phi with NUA corr",50,0,6.283185,16,-0.8,0.8);
1605  fListNUACalib->Add(fQAEtaPhiAfterNUAProton);
1606 
1607 
1608 
1609  //----------------- ZPA,ZNA Calibration hist: ---------------------
1610  fZPASignalPerChVsCent = new TH3F("fZPASignalPerChVsCent","En-ZPA, Cent, Vz, ch",100,0,100,20,-10,10,5,0,5);
1611  fZPCSignalPerChVsCent = new TH3F("fZPCSignalPerChVsCent","En-ZPC, Cent, Vz, ch",100,0,100,20,-10,10,5,0,5);
1612  fZNASignalPerChVsCent = new TH3F("fZNASignalPerChVsCent","En-ZNA, Cent, Vz, ch",100,0,100,20,-10,10,5,0,5);
1613  fZNCSignalPerChVsCent = new TH3F("fZNCSignalPerChVsCent","En-ZNC, Cent, Vz, ch",100,0,100,20,-10,10,5,0,5);
1614 
1615  fListNUACalib->Add(fZPASignalPerChVsCent);
1616  fListNUACalib->Add(fZPCSignalPerChVsCent);
1617  fListNUACalib->Add(fZNASignalPerChVsCent);
1618  fListNUACalib->Add(fZNCSignalPerChVsCent);
1619 
1620  fCentDistVsVz = new TH3F("fCentDistVsVz","Estimator (V0,CL1), Vz, cent.",2,0,2,40,-10,10,90,0,90);
1621 
1622  fListNUACalib->Add(fCentDistVsVz);
1623 
1624 
1625 
1626 
1627  //----------------- V0 Calibration hist: ---------------------
1628  fV0MultChVsRun = new TH2F("fV0MultChVsRun","1-32 V0C, 33-64 V0A",64,0,64,90,0,90);
1629  fListNUACalib->Add(fV0MultChVsRun);
1630 
1631  //const char *sCorrect[2]={"wo Corr","w Corr"};
1632  Int_t isCorr = 0;
1633 
1634  if(fListV0MCorr){
1635  isCorr = 1;
1636  }
1637 
1638 
1639  fV0AQ2xVsCentRun = new TProfile("fV0ACos2nVsCentRun",Form("<Cos2> vs cent (%d)",isCorr),90,0,90,""); //sCorrect[isCorr]
1640  fListNUACalib->Add(fV0AQ2xVsCentRun);
1641  fV0AQ2yVsCentRun = new TProfile("fV0ASin2nVsCentRun",Form("<Sin2> vs cent (%d)",isCorr),90,0,90,"");
1642  fListNUACalib->Add(fV0AQ2yVsCentRun);
1643  fV0CQ2xVsCentRun = new TProfile("fV0CCos2nVsCentRun",Form("<Cos2> vs cent (%d)",isCorr),90,0,90,"");
1644  fListNUACalib->Add(fV0CQ2xVsCentRun);
1645  fV0CQ2yVsCentRun = new TProfile("fV0CSin2nVsCentRun",Form("<Sin2> vs cent (%d)",isCorr),90,0,90,"");
1646  fListNUACalib->Add(fV0CQ2yVsCentRun);
1647 
1648  fV0AQ3xVsCentRun = new TProfile("fV0ACos3nVsCentRun",Form("<Cos3> vs cent (%d)",isCorr),90,0,90,"");
1649  fListNUACalib->Add(fV0AQ3xVsCentRun);
1650  fV0AQ3yVsCentRun = new TProfile("fV0ASin3nVsCentRun",Form("<Sin3> vs cent (%d)",isCorr),90,0,90,"");
1651  fListNUACalib->Add(fV0AQ3yVsCentRun);
1652  fV0CQ3xVsCentRun = new TProfile("fV0CCos3nVsCentRun",Form("<Cos3> vs cent (%d)",isCorr),90,0,90,"");
1653  fListNUACalib->Add(fV0CQ3xVsCentRun);
1654  fV0CQ3yVsCentRun = new TProfile("fV0CSin3nVsCentRun",Form("<Sin3> vs cent (%d)",isCorr),90,0,90,"");
1655  fListNUACalib->Add(fV0CQ3yVsCentRun);
1656 
1657  isCorr = 1;
1658  if(fListNUACorr){
1659  cout<<"\n =========> NUA file found for NUA correction <========== \n";
1660  isCorr = 0;
1661  }
1662  //------------------- TPC Qvector Recentering Histograms --------------
1663  fTPCAQ2xVsCentRun = new TProfile("fTPCACos2nVsCentRun",Form("<Cos2> vs cent (%d)",isCorr),90,0,90,"");
1664  fListNUACalib->Add(fTPCAQ2xVsCentRun);
1665  fTPCAQ2yVsCentRun = new TProfile("fTPCASin2nVsCentRun",Form("<Sin2> vs cent (%d)",isCorr),90,0,90,"");
1666  fListNUACalib->Add(fTPCAQ2yVsCentRun);
1667  fTPCCQ2xVsCentRun = new TProfile("fTPCCCos2nVsCentRun",Form("<Cos2> vs cent (%d)",isCorr),90,0,90,"");
1668  fListNUACalib->Add(fTPCCQ2xVsCentRun);
1669  fTPCCQ2yVsCentRun = new TProfile("fTPCCSin2nVsCentRun",Form("<Sin2> vs cent (%d)",isCorr),90,0,90,"");
1670  fListNUACalib->Add(fTPCCQ2yVsCentRun);
1671 
1672  fTPCAQ3xVsCentRun = new TProfile("fTPCACos3nVsCentRun",Form("<Cos3> vs cent (%d)",isCorr),90,0,90,"");
1673  fListNUACalib->Add(fTPCAQ3xVsCentRun);
1674  fTPCAQ3yVsCentRun = new TProfile("fTPCASin3nVsCentRun",Form("<Sin3> vs cent (%d)",isCorr),90,0,90,"");
1675  fListNUACalib->Add(fTPCAQ3yVsCentRun);
1676  fTPCCQ3xVsCentRun = new TProfile("fTPCCCos3nVsCentRun",Form("<Cos3> vs cent (%d)",isCorr),90,0,90,"");
1677  fListNUACalib->Add(fTPCCQ3xVsCentRun);
1678  fTPCCQ3yVsCentRun = new TProfile("fTPCCSin3nVsCentRun",Form("<Sin3> vs cent (%d)",isCorr),90,0,90,"");
1679  fListNUACalib->Add(fTPCCQ3yVsCentRun);
1680 
1681  fTPCAQ4xVsCentRun = new TProfile("fTPCACos4nVsCentRun",Form("<Cos4> vs cent (%d)",isCorr),90,0,90,"");
1682  fListNUACalib->Add(fTPCAQ4xVsCentRun);
1683  fTPCAQ4yVsCentRun = new TProfile("fTPCASin4nVsCentRun",Form("<Sin4> vs cent (%d)",isCorr),90,0,90,"");
1684  fListNUACalib->Add(fTPCAQ4yVsCentRun);
1685  fTPCCQ4xVsCentRun = new TProfile("fTPCCCos4nVsCentRun",Form("<Cos4> vs cent (%d)",isCorr),90,0,90,"");
1686  fListNUACalib->Add(fTPCCQ4xVsCentRun);
1687  fTPCCQ4yVsCentRun = new TProfile("fTPCCSin4nVsCentRun",Form("<Sin4> vs cent (%d)",isCorr),90,0,90,"");
1688  fListNUACalib->Add(fTPCCQ4yVsCentRun);
1689 
1690 
1691  fTPCFQ2xVsCentRun = new TProfile("fTPCFQ2xVsCentRun",Form("<Cos2> vs cent (%d)",isCorr),90,0,90,"");
1692  fListNUACalib->Add(fTPCFQ2xVsCentRun);
1693  fTPCFQ2yVsCentRun = new TProfile("fTPCFQ2yVsCentRun",Form("<Sin2> vs cent (%d)",isCorr),90,0,90,"");
1694  fListNUACalib->Add(fTPCFQ2yVsCentRun);
1695 
1696  //-------------------------------------------------------------------------------
1697 
1698 
1699 
1700 
1701  //-------------------------- Define NUA Hist for PID -----------------------------
1702  Int_t gCentForNUA[6] = {0,5,10,20,40,90};
1703  //Char_t name[100];
1704  //Char_t title[100];
1705 
1706  for(int i=0;i<4;i++){
1707  for(int j=0;j<5;j++){
1708  sprintf(name,"fHistEtaPhiVz_%d_Pos_Cent%d_Run%d",i,j,1); //gSpecies[i]
1709  sprintf(title,"eta,phi,Vz %dPos, Cent%d-%d, FB %d",i,gCentForNUA[j],gCentForNUA[j+1],fFilterBit);
1710  fHist3DEtaPhiVz_Pos_Run[i][j] = new TH3F(name,title,10,-10,10,50,0,6.283185,16,-0.8,0.8);
1711  fListNUACalib->Add(fHist3DEtaPhiVz_Pos_Run[i][j]);
1712 
1713  sprintf(name,"fHistEtaPhiVz_%d_Neg_Cent%d_Run%d",i,j,1); //gSpecies[i]
1714  sprintf(title,"eta,phi,Vz %dNeg, Cent%d-%d, FB %d",i,gCentForNUA[j],gCentForNUA[j+1],fFilterBit);
1715  fHist3DEtaPhiVz_Neg_Run[i][j] = new TH3F(name,title,10,-10,10,50,0,6.283185,16,-0.8,0.8);
1716  fListNUACalib->Add(fHist3DEtaPhiVz_Neg_Run[i][j]);
1717  }
1718  }
1719  //---------------------------------------------------------------------------------
1720 
1721 
1722  fListHist->Add(fListNUACalib);
1723 
1724  PostData(1,fListHist);
1725  cout<<"\n.........UserCreateOutputObject called.........\n fFilterBit = "<<fFilterBit<<" CentMax = "<<fCentralityPercentMax;
1726  cout<<" PU C = "<<fPileUpConstParm<<" gN = "<<gN<<" gM = "<<gM<<" PsiN = "<<gPsiN<<"\n\n"<<endl;
1727  //cout<<" *********** checking my commit...!! ***************** \n\n ";
1728 }
1729 
1730 
1731 
1732 
1733 
1734 
1735 
1736 
1737 
1738 
1739 
1740 
1741 
1742 
1743 
1744 
1745 
1746 //______________________________________________________________________
1748  //debug only
1749  //cout<<"\n Info:UserExec() called ..!!!\n";
1750  //watch.Start(kTRUE);
1751  //if(fEventCount==501) return;
1752 
1753 
1754  Float_t stepCount = 0.5;
1755 
1756  fHistEventCount->Fill(stepCount); //1
1757  stepCount++;
1758 
1759  fAOD = dynamic_cast<AliAODEvent*>(InputEvent());
1760  fESD = dynamic_cast<AliESDEvent*>(InputEvent());
1761 
1762  if(!(fESD || fAOD)){ printf("ERROR: fESD & fAOD not available\n"); return; }
1763 
1764  fVevent = dynamic_cast<AliVEvent*>(InputEvent());
1765 
1766  if (!fVevent) { printf("ERROR: fVevent not available\n"); return; }
1767 
1768  fHistEventCount->Fill(stepCount); //2
1769  stepCount++;
1770 
1771 
1772 
1773 
1774 
1775 
1776  //--------- Check if I have PID response object --------
1777  /*
1778  if(!fPIDResponse){
1779  AliAnalysisManager *mgr=AliAnalysisManager::GetAnalysisManager();
1780  AliInputEventHandler *inputHandler=dynamic_cast<AliInputEventHandler*>(mgr->GetInputEventHandler());
1781  if(inputHandler) fPIDResponse=inputHandler->GetPIDResponse();
1782  if(!fPIDResponse){
1783  printf("\n\n...... PIDResponse object not found..... \n\n");
1784  return;
1785  }
1786  }
1787  */
1788 
1789 
1790 
1791 
1792  //-------------- Vtx cuts ---------------
1793  const AliVVertex *pVtx = fVevent->GetPrimaryVertex();
1794 
1795  Double_t pVtxZ = -999;
1796  pVtxZ = pVtx->GetZ();
1797 
1798 //if(TMath::Abs(pVtxZ)>10.) return;
1799  //User defined cut:
1800  if(pVtxZ<fMinVzCut || pVtxZ>fMaxVzCut ) return;
1801 
1802 
1803  fHistEventCount->Fill(stepCount); //3
1804  stepCount++;
1805 
1806 
1807 
1808  Float_t centrality = -99.0;
1809  Float_t centrV0M = -99.0;
1810  Float_t centrCL1 = -99.0;
1811 
1812 
1813 
1814  //---------- Centrality Estimators -------------
1815  AliCentrality* Alicentr = ((AliVAODHeader*)fAOD->GetHeader())->GetCentralityP(); // For Run1, 2010 data
1816 
1817  fMultSelection = (AliMultSelection*) InputEvent()->FindListObject("MultSelection"); // Must never comment this
1818  if(!fMultSelection) { printf("\n\n **WARNING** \n::UserExec() AliMultSelection object not found.\n\n"); exit(1); }
1819 
1820 
1821  if(sNucleiTP=="PbPb2010" || sNucleiTP=="2010") {
1822  if(Alicentr){
1823 
1824  centrV0M = Alicentr->GetCentralityPercentile("V0M");
1825  centrCL1 = Alicentr->GetCentralityPercentile("CL1");
1826 
1827  if(sCentrEstimator=="V0M" || sCentrEstimator=="V0"){
1828  centrality = centrV0M;
1829  }
1830  else if(sCentrEstimator=="CL1"){
1831  centrality = centrCL1;
1832  }
1833  else if(sCentrEstimator=="V0C"){
1834  centrality = Alicentr->GetCentralityPercentile("V0C");
1835  }
1836  else if(sCentrEstimator=="V0A"){
1837  centrality = Alicentr->GetCentralityPercentile("V0A");
1838  }
1839  else if(sCentrEstimator=="TRK"){
1840  centrality = Alicentr->GetCentralityPercentile("TRK");
1841  }
1842  }
1843  }
1844  else{ // fall back to MultSelection if other than 2010 data
1845 
1846  centrV0M = fMultSelection->GetMultiplicityPercentile("V0M");
1847  centrCL1 = fMultSelection->GetMultiplicityPercentile("CL1");
1848 
1849  if(sCentrEstimator=="V0M" || sCentrEstimator=="V0"){
1850  centrality = centrV0M;
1851  }
1852  else if(sCentrEstimator=="CL1"){
1853  centrality = centrCL1;
1854  }
1855  else if(sCentrEstimator=="V0C"){
1856  centrality = fMultSelection->GetMultiplicityPercentile("V0C");
1857  }
1858  else if(sCentrEstimator=="V0A"){
1859  centrality = fMultSelection->GetMultiplicityPercentile("V0A");
1860  }
1861  else if(sCentrEstimator=="TRK"){
1862  centrality = fMultSelection->GetMultiplicityPercentile("TRK");
1863  }
1864  }
1865 
1866  /*
1867  //--------- Centrality Estimators -------------
1868  centrV0M = fMultSelection->GetMultiplicityPercentile("V0M");
1869  centrCL1 = fMultSelection->GetMultiplicityPercentile("CL1");
1870 
1871  if(sCentrEstimator=="V0M" || sCentrEstimator=="V0"){
1872  centrality = centrV0M;
1873  }
1874  else if(sCentrEstimator=="CL1"){
1875  centrality = centrCL1;
1876  }
1877  else if(sCentrEstimator=="V0C"){
1878  centrality = fMultSelection->GetMultiplicityPercentile("V0C");
1879  }
1880  else if(sCentrEstimator=="V0A"){
1881  centrality = fMultSelection->GetMultiplicityPercentile("V0A");
1882  }
1883  else if(sCentrEstimator=="TRK"){
1884  centrality = fMultSelection->GetMultiplicityPercentile("TRK");
1885  } */
1886 
1887 
1888 
1889 
1891  return;
1892  }
1893 
1894  fHistEventCount->Fill(stepCount); //4
1895  stepCount++;
1896 
1897  fCentDistBefore->Fill(centrality);
1898 
1899 
1900 
1901 
1902 
1903 
1904  Int_t ntracks=fAOD->GetNumberOfTracks();
1905  if(ntracks<2) return; // Check this cut....!!!
1906 
1907  fHistEventCount->Fill(stepCount); //5
1908  stepCount++;
1909 
1910 
1911 
1912 
1913 
1914 
1915  Int_t cent10bin = -1;
1916  Int_t cIndex = -1;
1917  //cent10bin = GetCentralityScaled0to10(centrality); //Centrality in 0-10 scale
1918 
1919  if(centrality<5.0) {
1920  cent10bin = 0;
1921  }
1922  else if(centrality>=5.0 && centrality<10){
1923  cent10bin = 1;
1924  }
1925  else if(centrality>=10.0) {
1926  cent10bin = abs(centrality/10.0)+1;
1927  }
1928 
1929  cIndex = cent10bin;
1930 
1931 //Centrality array index for NUA correcion
1932  Int_t cForNUA = 0;
1933 
1934  if(centrality<5.0) {
1935  cForNUA = 0;
1936  }
1937  else if(centrality>=5.0 && centrality<10){
1938  cForNUA = 1; // 1=5-10,
1939  }
1940  else if(centrality>=10.0 && centrality<20) {
1941  cForNUA = 2; // 2 = 10-20,
1942  }
1943  else if(centrality>=20 && centrality<40){
1944  cForNUA = 3; // 3=20-40
1945  }
1946  else if(centrality>=40){
1947  cForNUA = 4; // 4=40-90
1948  }
1949 
1950 
1951 
1952 
1953 
1954 
1955  //---------- Magnetic field --------
1956  Double_t fMagField = fAOD->GetMagneticField();
1957 
1958  const Int_t QAindex = (fMagField > 0) ? 1 : 0;
1959  //---------------------------------
1960 
1961 
1962 
1963 
1964 
1965 
1966  //Load NUA and V0M correction map run by run:
1967  Int_t runNumber = fAOD->GetRunNumber();
1968 
1969  if(runNumber!=fOldRunNum) {
1970 
1971  GetNUACorrectionHist(runNumber);
1972 
1973  if(bV0MGainCorr) {
1974  GetV0MCorrectionHist(runNumber);
1975  }
1976 
1977  fOldRunNum = runNumber;
1978  }
1979  //------------------------------------------
1980 
1981 
1982 
1983 
1984 
1985 
1986 
1987  //----- Event Plane variables:-------
1988  Double_t PsiNV0A = 0;
1989  Double_t PsiNV0C = 0;
1990 
1991  Double_t PsiNTPCA = 0; // eta <0
1992  Double_t PsiNTPCC = 0; // eta >0
1993  Double_t PsiNTPCF = 0; // Full TPC
1994 
1995  Double_t sumTPCQn2x[3] = {0,0,0}; //[0]= eta<0; [1]= eta>0; [2]= -0.8 < eta < 0.8
1996  Double_t sumTPCQn2y[3] = {0,0,0};
1997  //Double_t sumTPCQn3x[3] = {0,0,0}; //[0]= eta<0; [1]= eta>0; [2]= -0.8 < eta < 0.8
1998  //Double_t sumTPCQn3y[3] = {0,0,0};
1999  //Double_t sumTPCQn4x[3] = {0,0,0}; //[0]= eta<0; [1]= eta>0; [2]= -0.8 < eta < 0.8
2000  //Double_t sumTPCQn4y[3] = {0,0,0};
2001  //------------------------------------
2002 
2003 
2004 
2005 
2006 
2007 
2008 
2009  //Variables for MC tracking correction
2010  Int_t ptBinMC = 1;
2011  Int_t iBinNUA = 1;
2012  Double_t ptWgtMC = 1.0;
2013  Double_t WgtNUA = 1.0;
2014  Double_t ptTrk = 0.1;
2015  Double_t dEdx = 0.0;
2016  Double_t Chi2Trk = 0.0;
2017 
2018 
2019  //-------------- Track loop for outlier and PileUp cut -------------------
2020 
2021  //---------------- a dobrin --------------
2022 
2023  Bool_t bIsPileup=kFALSE;
2024 
2025  Int_t isPileup = fAOD->IsPileupFromSPD(3);
2026 
2027  if(isPileup != 0) {
2028  fHistPileUpCount->Fill(0.5);
2029  bIsPileup=kTRUE;
2030  }
2031  else if(PileUpMultiVertex(fAOD)) {
2032  fHistPileUpCount->Fill(1.5);
2033  bIsPileup=kTRUE;
2034  }
2035  else if(((AliAODHeader*)fAOD->GetHeader())->GetRefMultiplicityComb08() < 0) {
2036  fHistPileUpCount->Fill(2.5);
2037  bIsPileup=kTRUE;
2038  }
2039  else if(fAOD->IsIncompleteDAQ()) {
2040  fHistPileUpCount->Fill(3.5);
2041  bIsPileup=kTRUE;
2042  }
2043  else if(fabs(centrV0M-centrCL1)> 5.0) {//default: 7.5
2044 //else if(fabs(centrV0M-centrCL1)> 7.5) {//default: 7.5
2045  fHistPileUpCount->Fill(4.5);
2046  bIsPileup=kTRUE;
2047  }
2048 
2049  // check vertex consistency
2050  const AliAODVertex* vtTrc = fAOD->GetPrimaryVertex();
2051  const AliAODVertex* vtSPD = fAOD->GetPrimaryVertexSPD();
2052 
2053  if(vtTrc->GetNContributors() < 2 || vtSPD->GetNContributors()<1) {
2054  fHistPileUpCount->Fill(5.5);
2055  bIsPileup=kTRUE;
2056  }
2057 
2058  double covTrc[6], covSPD[6];
2059  vtTrc->GetCovarianceMatrix(covTrc);
2060  vtSPD->GetCovarianceMatrix(covSPD);
2061 
2062  double dz = vtTrc->GetZ() - vtSPD->GetZ();
2063 
2064  double errTot = TMath::Sqrt(covTrc[5]+covSPD[5]);
2065  double errTrc = TMath::Sqrt(covTrc[5]);
2066  double nsigTot = dz/errTot;
2067  double nsigTrc = dz/errTrc;
2068 
2069  if(TMath::Abs(dz)>0.2 || TMath::Abs(nsigTot)>10 || TMath::Abs(nsigTrc)>20) {
2070  fHistPileUpCount->Fill(6.5);
2071  bIsPileup=kTRUE;
2072  }
2073 
2074 
2075  /*
2076  Float_t nSigPionTPC[40000] = {0.,};
2077  Float_t nSigKaonTPC[40000] = {0.,};
2078  Float_t nSigProtonTPC[40000] = {0.,};
2079  Float_t nSigPionTOF[40000] = {0.,};
2080  Float_t nSigKaonTOF[40000] = {0.,};
2081  Float_t nSigProtonTOF[40000] = {0.,};
2082  */
2083 
2084  if(ntracks > 40000) return; //Dont break segment for higher tracks:
2085 
2086 
2087  /*
2088  std::vector<float> nSigPionTPC;
2089  std::vector<float> nSigKaonTPC;
2090  std::vector<float> nSigProtonTPC;
2091  std::vector<float> nSigPionTOF;
2092  std::vector<float> nSigKaonTOF;
2093  std::vector<float> nSigProtonTOF;
2094 
2095  nSigPionTPC.reserve(10000);
2096  nSigKaonTPC.reserve(10000);
2097  nSigProtonTPC.reserve(10000);
2098  nSigPionTOF.reserve(10000);
2099  nSigKaonTOF.reserve(10000);
2100  nSigProtonTOF.reserve(10000); */
2101 
2102 
2103 
2104 
2105  Float_t multTPC = 0; // tpc mult estimate
2106  //Float_t RefMultRaw = 0; // tpc mult estimate
2107  //Float_t RefMultCorr = 0; // tpc mult estimate
2108  Float_t RefMultRawFB = 0;
2109  Float_t RefMultCorrFB= 0;
2110 
2111  Float_t multTPCAll = 0; // tpc mult estimate
2112  Float_t multGlobal = 0; // global multiplicity
2113 
2114  Int_t multEtaNeg, multEtaPos, multEtaFull;
2115  Double_t SumWEtaNeg, SumWEtaPos, SumWEtaFull;
2116 
2117  Int_t ChTrk;
2118  Int_t nClustTPC;
2119 
2120  Double_t etaTrk, phiTrk; // Never define eta as float, always double.!!
2121 
2122  //Double_t fMaxPtEP = 5.0;
2123  //Double_t fMinPtEP = 0.2;
2124  Double_t fMaxEtaEP = 0.8;
2125  Double_t fMinEtaEP = -0.8;
2126 
2127  multEtaNeg = 0;
2128  multEtaPos = 0;
2129  multEtaFull= 0;
2130  SumWEtaNeg = 0;
2131  SumWEtaPos = 0;
2132  SumWEtaFull= 0;
2133 
2134 
2135 
2136  for(Int_t iTrack = 0; iTrack < ntracks; iTrack++) { //-------------------------
2137 
2138  AliAODTrack* AODtrack =dynamic_cast<AliAODTrack*>(fVevent->GetTrack(iTrack));
2139  if(!AODtrack) continue;
2140 
2141 
2142  //------ Store PID info in array to use later:---------
2143  //Vector method: // taking same time as arrays
2144  /*
2145  nSigPionTPC.push_back(fPIDResponse->NumberOfSigmasTPC(AODtrack, AliPID::kPion));
2146  nSigKaonTPC.push_back(fPIDResponse->NumberOfSigmasTPC( AODtrack, AliPID::kKaon));
2147  nSigProtonTPC.push_back(fPIDResponse->NumberOfSigmasTPC(AODtrack, AliPID::kProton));
2148  nSigPionTOF.push_back(fPIDResponse->NumberOfSigmasTOF(AODtrack, AliPID::kPion));
2149  nSigKaonTOF.push_back(fPIDResponse->NumberOfSigmasTOF( AODtrack, AliPID::kKaon));
2150  nSigProtonTOF.push_back(fPIDResponse->NumberOfSigmasTOF(AODtrack, AliPID::kProton)); */
2151 
2152  //I used these Arrays for PID, now commented as not enough statistics: 28/09/18
2153  /*
2154  nSigPionTPC[iTrack] = fPIDResponse->NumberOfSigmasTPC(AODtrack, AliPID::kPion);
2155  nSigKaonTPC[iTrack] = fPIDResponse->NumberOfSigmasTPC(AODtrack, AliPID::kKaon);
2156  nSigProtonTPC[iTrack] = fPIDResponse->NumberOfSigmasTPC(AODtrack, AliPID::kProton);
2157  nSigPionTOF[iTrack] = fPIDResponse->NumberOfSigmasTOF(AODtrack, AliPID::kPion);
2158  nSigKaonTOF[iTrack] = fPIDResponse->NumberOfSigmasTOF(AODtrack, AliPID::kKaon);
2159  nSigProtonTOF[iTrack] = fPIDResponse->NumberOfSigmasTOF(AODtrack, AliPID::kProton);
2160  */
2161  //-----------------------------------------------------
2162 
2163 
2164  ptTrk = AODtrack->Pt();
2165  etaTrk = AODtrack->Eta();
2166  Chi2Trk = AODtrack->Chi2perNDF();
2167  nClustTPC = AODtrack->GetTPCNcls();
2168  //dEdx = AODtrack->GetDetPid()->GetTPCsignal(); // This one breaks the code if called before checking FilterBit.
2169 
2170 
2171  //Track cuts for POIs: Same to be used for EP calc.
2172  //if((dPt2 > fMaxPtCut) || (dPt2 < fMinPtCut) || (dEta2 > fMaxEtaCut) || (dEta2 < fMinEtaCut) || (dEdx2 < fdEdxMin) || (track2->GetTPCNcls() < fTPCclustMin) || (Chi2Trk2 < fTrkChi2Min) || (Chi2Trk2 > 4.0) || (track2->DCA() > fDCAxyMax)|| (track2->ZAtDCA() > fDCAzMax) || !(TMath::Abs(gCharge2)))
2173 
2174  //cuts for EP calculation:
2175  if(AODtrack->TestFilterBit(fFilterBit)){
2176 
2177  phiTrk = AODtrack->Phi();
2178  dEdx = AODtrack->GetDetPid()->GetTPCsignal();
2179  ChTrk = AODtrack->Charge();
2180 
2181  if(gPsiN > 0 && (ptTrk <= fMaxPtCut) && (ptTrk >= fMinPtCut) && (etaTrk <= fMaxEtaEP) && (etaTrk >= fMinEtaEP) && (dEdx >= fdEdxMin) && (nClustTPC >= fTPCclustMin) && (AODtrack->DCA() <= fDCAxyMax) && (AODtrack->ZAtDCA() <= fDCAzMax) && (Chi2Trk >= fTrkChi2Min) && (Chi2Trk <= 4.0) && TMath::Abs(ChTrk))
2182  {
2183 
2184  ptWgtMC = 1.0;
2185 
2186  if(fFB_Efficiency_Cent[cent10bin]){
2187  ptBinMC = fFB_Efficiency_Cent[cent10bin]->FindBin(ptTrk); //Charge independent MC correction atm.
2188  ptWgtMC = 1.0/fFB_Efficiency_Cent[cent10bin]->GetBinContent(ptBinMC);
2189  }
2190 
2191  RefMultRawFB++;
2192  RefMultCorrFB += ptWgtMC;
2193 
2194 
2195  //------> Get NUA weights for EP <----------
2196  WgtNUA = 1.0;
2197 
2198  if(ChTrk>0){
2199  if(fHCorrectNUApos[cForNUA]){
2200  iBinNUA = fHCorrectNUApos[cForNUA]->FindBin(pVtxZ,phiTrk,etaTrk);
2201  WgtNUA = fHCorrectNUApos[cForNUA]->GetBinContent(iBinNUA);
2202  }
2203  //else{ WgtNUA = 1.0; }
2204  }
2205  else{
2206  if(fHCorrectNUAneg[cForNUA]){
2207  iBinNUA = fHCorrectNUAneg[cForNUA]->FindBin(pVtxZ,phiTrk,etaTrk);
2208  WgtNUA = fHCorrectNUAneg[cForNUA]->GetBinContent(iBinNUA);
2209  }
2210  //else{ WgtNUA = 1.0; }
2211  }
2212 
2213  if(etaTrk < -0.05){
2214  sumTPCQn2x[0] += WgtNUA*TMath::Cos(gPsiN*phiTrk);
2215  sumTPCQn2y[0] += WgtNUA*TMath::Sin(gPsiN*phiTrk);
2216  //sumTPCQn3x[0] += WgtNUA*TMath::Cos(3*phiTrk);
2217  //sumTPCQn3y[0] += WgtNUA*TMath::Sin(3*phiTrk);
2218  //sumTPCQn4x[0] += WgtNUA*TMath::Cos(4*phiTrk);
2219  //sumTPCQn4y[0] += WgtNUA*TMath::Sin(4*phiTrk);
2220  multEtaNeg++;
2221  SumWEtaNeg += WgtNUA;
2222  }
2223  else if(etaTrk > 0.05){
2224  sumTPCQn2x[1] += WgtNUA*TMath::Cos(gPsiN*phiTrk);
2225  sumTPCQn2y[1] += WgtNUA*TMath::Sin(gPsiN*phiTrk);
2226  //sumTPCQn3x[1] += WgtNUA*TMath::Cos(3*phiTrk);
2227  //sumTPCQn3y[1] += WgtNUA*TMath::Sin(3*phiTrk);
2228  //sumTPCQn4x[1] += WgtNUA*TMath::Cos(4*phiTrk);
2229  //sumTPCQn4y[1] += WgtNUA*TMath::Sin(4*phiTrk);
2230  multEtaPos++;
2231  SumWEtaPos += WgtNUA;
2232  }
2233  sumTPCQn2x[2] += WgtNUA*TMath::Cos(gPsiN*phiTrk);
2234  sumTPCQn2y[2] += WgtNUA*TMath::Sin(gPsiN*phiTrk);
2235  //sumTPCQn3x[2] += WgtNUA*TMath::Cos(3*phiTrk);
2236  //sumTPCQn3y[2] += WgtNUA*TMath::Sin(3*phiTrk);
2237  //sumTPCQn4x[2] += WgtNUA*TMath::Cos(4*phiTrk);
2238  //sumTPCQn4y[2] += WgtNUA*TMath::Sin(4*phiTrk);
2239  multEtaFull++;
2240  SumWEtaFull += WgtNUA;
2241  }// track cuts
2242  } // AOD fiter bit
2243 
2244 
2245  if(AODtrack->TestFilterBit(128)) multTPCAll++; // A. Dobrin TPC vs ESD PileUp Cut.
2246 
2247  if(!(AODtrack->TestFilterBit(1))) continue; // cuts for Outlier as in FlowEvent Task
2248 
2249  dEdx = AODtrack->GetDetPid()->GetTPCsignal();
2250 
2251  if((ptTrk < 0.2) || (ptTrk > 5.0) || (TMath::Abs(etaTrk) > 0.8) || (nClustTPC < 70) || (dEdx < 10.0) || (Chi2Trk < 0.1)) continue;
2252 
2253  if(AODtrack->GetDetPid() && Chi2Trk > 0.2) multTPC++;
2254 
2255  if(!AODtrack->TestFilterBit(16) || AODtrack->Chi2perNDF() < 0.1) continue;
2256  Double_t b[2] = {-99., -99.};
2257  Double_t bCov[3] = {-99., -99., -99.};
2258  AliAODTrack copy(*AODtrack);
2259  if(copy.PropagateToDCA(fVevent->GetPrimaryVertex(), fVevent->GetMagneticField(), 100., b, bCov) && TMath::Abs(b[0]) < 0.3 && TMath::Abs(b[1]) < 0.3) multGlobal++;
2260 
2261  }//--- track loop outlier/PileUp ----
2262 
2263 
2264 
2265 
2266 
2267 
2268  Int_t multEsd = ((AliAODHeader*)fAOD->GetHeader())->GetNumberOfESDTracks();
2269  Float_t multESDTPCDiff = (Float_t) multEsd - fPileUpSlopeParm*multTPCAll;
2270 
2271  //cout<<" Info:UserExec() called ... I am after PU cut... event = "<<fEventCount<<" \n";
2272 
2273  if(multESDTPCDiff > fPileUpConstParm) {
2274  fHistPileUpCount->Fill(7.5);
2275  bIsPileup=kTRUE;
2276  }
2277  else if(bIsPileup==kFALSE) {
2278 
2279  if(!fMultSelection->GetThisEventIsNotPileup()){
2280  fHistMultSelPUCount->Fill(0.5);
2281  bIsPileup=kTRUE;
2282  }
2283  if(!fMultSelection->GetThisEventIsNotPileupMV()){
2284  fHistMultSelPUCount->Fill(1.5);
2285  bIsPileup=kTRUE;
2286  }
2287  if(!fMultSelection->GetThisEventIsNotPileupInMultBins()){
2288  fHistMultSelPUCount->Fill(2.5);
2289  bIsPileup=kTRUE;
2290  }
2291  if(!fMultSelection->GetThisEventHasNoInconsistentVertices()){
2292  fHistMultSelPUCount->Fill(2.5);
2293  bIsPileup=kTRUE;
2294  }
2295  if(!fMultSelection->GetThisEventPassesTrackletVsCluster()){
2296  fHistMultSelPUCount->Fill(2.5);
2297  bIsPileup=kTRUE;
2298  }
2299  if(!fMultSelection->GetThisEventIsNotIncompleteDAQ()){
2300  fHistMultSelPUCount->Fill(2.5);
2301  bIsPileup=kTRUE;
2302  }
2303  if(!fMultSelection->GetThisEventHasGoodVertex2016()){
2304  fHistMultSelPUCount->Fill(2.5);
2305  bIsPileup=kTRUE;
2306  }
2307  if(bIsPileup) fHistPileUpCount->Fill(9.5);
2308  }
2309  //-----------------------------------------------------------------
2310 
2311 
2312 
2313 
2314 
2315 
2316 
2317 
2318 
2319  fHistTPCVsESDTrkBefore->Fill(multTPCAll,multEsd); //A. Dobrin
2320  fHistTPCvsGlobalMultBefore->Fill(multGlobal,multTPC);
2321 
2322 
2323  Bool_t bIsOutLier=kFALSE;
2324 
2325  if(multTPC < (-20.0+1.15*multGlobal) || multTPC > (200.+1.45*multGlobal)) { bIsOutLier = kTRUE;}
2326 
2327  fHistEventCount->Fill(stepCount); //6
2328  stepCount++;
2329 
2330 
2331  fHistTPConlyVsCL1Before->Fill(centrCL1,multTPCAll);
2332  fHistTPConlyVsV0MBefore->Fill(centrV0M,multTPCAll);
2333  fHistGlobalVsV0MBefore->Fill(centrV0M, multGlobal);
2334 
2335 
2336  //if bSkipPileUpCut is kTRUE then don't apply PileUp removal.
2337  if(!bSkipPileUpCut && bIsOutLier) return; //outlier TPC vs Global
2338 
2339  fHistTPCvsGlobalMultAfter->Fill(multGlobal,multTPC);
2340 
2341  fHistEventCount->Fill(stepCount); //7
2342  stepCount++;
2343 
2344 
2345  if(!bSkipPileUpCut && bIsPileup) return; //PileUp A. Dobrin
2346 
2347  fHistTPCVsESDTrkAfter->Fill(multTPCAll,multEsd);
2348 
2349  fHistEventCount->Fill(stepCount); //8
2350  stepCount++;
2351 
2352  //cout<<"After PU cut multTPC = "<<multTPC<<" multGlobal = "<<multGlobal<<endl;
2353 
2354 
2355 
2356 
2357 
2358  /*
2359  Int_t icentBin = centrality;
2360  icentBin++;
2361 
2362  Float_t TPCmultLowLimit = hCentvsTPCmultCuts->GetBinContent(icentBin,1);
2363  Float_t TPCmultHighLimit = hCentvsTPCmultCuts->GetBinContent(icentBin,1);
2364 
2365  TPCmultLowLimit -= 5.0 * hCentvsTPCmultCuts->GetBinContent(icentBin,2); //mean - 5sigma
2366  TPCmultHighLimit += 5.0 * hCentvsTPCmultCuts->GetBinContent(icentBin,2); //mean + 5sigma
2367  //std::cout<<" Cent = "<<centrality<<"\t icent = "<<icentBin<<" low = "<<TPCmultLowLimit<<"\t high = "<<TPCmultHighLimit<<std::endl;
2368 
2369  //centrality outlier
2370  if(!bSkipPileUpCut){ if(multTPC<TPCmultLowLimit || multTPC>TPCmultHighLimit) return; }
2371  */
2372 
2373 
2374 
2375 
2376 
2377  fHistEventCount->Fill(stepCount); //9
2378  stepCount++;
2379 
2380 
2381 
2382  fHistTPConlyVsCL1After->Fill(centrCL1,multTPCAll);
2383  fHistTPConlyVsV0MAfter->Fill(centrV0M,multTPCAll);
2384  fHistGlobalVsV0MAfter->Fill(centrV0M, multGlobal);
2385 
2386 
2387  // MC corrected Refmult:
2388  fHistRawVsCorrMultFB->Fill(RefMultRawFB,RefMultCorrFB); // FB set by AddTask..
2389 
2390 
2391  Float_t EvtCent = centrality;
2392 
2393 
2394 
2395 
2396  if(gPsiN > 0){
2397  if(multEtaNeg<2 || multEtaPos<2) return; //Minimum 2 tracks in each eta
2398  }
2399 
2400  fHistEventCount->Fill(stepCount); //10
2401  stepCount++;
2402 
2403  //--------------------------------------------------------
2404 
2405 
2406 
2407 
2408 
2409 
2410 
2411 
2412 
2413 
2414 
2415 
2416 
2417 
2418 
2419 
2420 
2421 
2422  //--------------- cent CL1 <= 90 cut ------------------
2423  Int_t icentV0Qn = centrCL1; // cent CL1 used for V0 calibration.
2424  icentV0Qn += 1;
2425 
2426  fCentDistVsVz->Fill(0.5,pVtxZ,centrV0M);
2427  fCentDistVsVz->Fill(1.5,pVtxZ,centrCL1);
2428 
2429 
2430  if(icentV0Qn>90) return;
2431 
2432  fHistEventCount->Fill(stepCount); //11
2433  stepCount++;
2434 
2435 
2436 
2437 
2438  //=============== Get the ZDC data ====================
2439  const Int_t fNumberOfZDCChannels = 5;
2440 
2441  AliAODZDC *aodZDC = fAOD->GetZDCData();
2442  if(!aodZDC) {
2443  cout<<"\n ********* Error: could not find ZDC data ************ \n "<<endl;
2444  }
2445 
2446  const Double_t *gZNATowerRawAOD = aodZDC->GetZNATowerEnergy();
2447  const Double_t *gZNCTowerRawAOD = aodZDC->GetZNCTowerEnergy();
2448  const Double_t *gZPATowerRawAOD = aodZDC->GetZPATowerEnergy();
2449  const Double_t *gZPCTowerRawAOD = aodZDC->GetZPCTowerEnergy();
2450 
2451  Double_t gZNATowerRaw[5] = {0.,0.,0.,0.,0.};
2452  Double_t gZNCTowerRaw[5] = {0.,0.,0.,0.,0.};
2453  Double_t gZPATowerRaw[5] = {0.,0.,0.,0.,0.};
2454  Double_t gZPCTowerRaw[5] = {0.,0.,0.,0.,0.};
2455 
2456  for(Int_t iChannel = 0; iChannel < fNumberOfZDCChannels; iChannel++) {
2457  gZNATowerRaw[iChannel] = gZNATowerRawAOD[iChannel];
2458  gZNCTowerRaw[iChannel] = gZNCTowerRawAOD[iChannel];
2459  gZPATowerRaw[iChannel] = gZPATowerRawAOD[iChannel];
2460  gZPCTowerRaw[iChannel] = gZPCTowerRawAOD[iChannel];
2461 
2462  fZPASignalPerChVsCent->Fill(centrCL1,pVtxZ,iChannel,gZPATowerRaw[iChannel]);
2463  fZPCSignalPerChVsCent->Fill(centrCL1,pVtxZ,iChannel,gZPCTowerRaw[iChannel]);
2464  fZNASignalPerChVsCent->Fill(centrCL1,pVtxZ,iChannel,gZNATowerRaw[iChannel]);
2465  fZNCSignalPerChVsCent->Fill(centrCL1,pVtxZ,iChannel,gZNCTowerRaw[iChannel]);
2466 
2467  }// ZDC channel loop
2468 
2469 
2470 
2471 
2472 
2473  //-------- V0M info ---------------
2474  const AliAODVZERO *fAODV0 = fAOD->GetVZEROData();
2475 
2476  //do v0m recentering
2477  Double_t QxanCor = 0, QyanCor = 0;
2478  Double_t QxcnCor = 0, QycnCor = 0;
2479 
2480  Double_t Qxan3 = 0., Qyan3 = 0.;
2481  Double_t Qxcn3 = 0., Qycn3 = 0.;
2482  Double_t Qxan2 = 0., Qyan2 = 0.;
2483  Double_t Qxcn2 = 0., Qycn2 = 0.;
2484 
2485  Double_t phiV0;
2486  Float_t fMultv0 = 0;
2487  Float_t sumMa = 0;
2488  Float_t sumMc = 0;
2489 
2490 
2491  if(gPsiN>0) { // Calculate EP only for gPsiN > 0
2492 
2493  for(int iV0 = 0; iV0 < 64; iV0++) { //0-31 is V0C, 32-63 VOA
2494 
2495  fMultv0 = fAODV0->GetMultiplicity(iV0);
2496 
2497  if(fHCorrectV0M){
2498  fMultv0 = fMultv0 * fHCorrectV0M->GetBinContent(iV0+1); // Gain Correction
2499  //cout<<"info: run = "<<runNumber<<" cent = "<<centrCL1<<"\t channel = "<<iV0<<" gain = "<<fHCorrectV0M->GetBinContent(iV0+1)<<endl;
2500  }
2501 
2502  fV0MultChVsRun->Fill(iV0+0.5,centrCL1,fMultv0);
2503  //fV0MultChVsRun->Fill(iV0+0.5,runindex,fMultv0);
2504 
2505  phiV0 = TMath::PiOver4()*(0.5 + iV0 % 8);
2506 
2507  if(iV0 < 32){
2508  Qxcn2 += TMath::Cos(2*phiV0) * fMultv0;
2509  Qycn2 += TMath::Sin(2*phiV0) * fMultv0;
2510  Qxcn3 += TMath::Cos(3*phiV0) * fMultv0;
2511  Qycn3 += TMath::Sin(3*phiV0) * fMultv0;
2512  sumMc += fMultv0;
2513  }
2514  else if(iV0 >= 32){
2515  Qxan2 += TMath::Cos(2*phiV0) * fMultv0;
2516  Qyan2 += TMath::Sin(2*phiV0) * fMultv0;
2517  Qxan3 += TMath::Cos(3*phiV0) * fMultv0;
2518  Qyan3 += TMath::Sin(3*phiV0) * fMultv0;
2519  sumMa += fMultv0;
2520  }
2521  }//----- channel loop ----------
2522 
2523 
2524  if(gPsiN==3){
2525  QxanCor = Qxan3/sumMa; //3rd order event plane
2526  QyanCor = Qyan3/sumMa;
2527  QxcnCor = Qxcn3/sumMc;
2528  QycnCor = Qycn3/sumMc;
2529 
2530  if(fHAvgerageQnV0C && fHAvgerageQnV0A && icentV0Qn < 91){
2531  QxanCor -= fHAvgerageQnV0A->GetBinContent(icentV0Qn,3); //x = Cos
2532  QxcnCor -= fHAvgerageQnV0C->GetBinContent(icentV0Qn,3); //x = Cos
2533  QyanCor -= fHAvgerageQnV0A->GetBinContent(icentV0Qn,4); //y = Sin
2534  QycnCor -= fHAvgerageQnV0C->GetBinContent(icentV0Qn,4); //y = Sin
2535 
2536  fV0AQ3xVsCentRun->Fill(centrCL1,QxanCor);
2537  fV0AQ3yVsCentRun->Fill(centrCL1,QyanCor);
2538  fV0CQ3xVsCentRun->Fill(centrCL1,QxcnCor);
2539  fV0CQ3yVsCentRun->Fill(centrCL1,QycnCor);
2540  }
2541  //printf("\n .... I am using my own V0 gain correction for Psi3...\n");
2542  }
2543  else{
2544  QxanCor = Qxan2/sumMa; //2nd order Event plane
2545  QyanCor = Qyan2/sumMa;
2546  QxcnCor = Qxcn2/sumMc;
2547  QycnCor = Qycn2/sumMc;
2548 
2549  if(fHAvgerageQnV0C && fHAvgerageQnV0A && icentV0Qn < 91){
2550  QxanCor -= fHAvgerageQnV0A->GetBinContent(icentV0Qn,1); //x = Cos
2551  QxcnCor -= fHAvgerageQnV0C->GetBinContent(icentV0Qn,1); //x = Cos
2552  QyanCor -= fHAvgerageQnV0A->GetBinContent(icentV0Qn,2); //y = Sin
2553  QycnCor -= fHAvgerageQnV0C->GetBinContent(icentV0Qn,2); //y = Sin
2554 
2555  fV0AQ2xVsCentRun->Fill(centrCL1,QxanCor);
2556  fV0AQ2yVsCentRun->Fill(centrCL1,QyanCor);
2557  fV0CQ2xVsCentRun->Fill(centrCL1,QxcnCor);
2558  fV0CQ2yVsCentRun->Fill(centrCL1,QycnCor);
2559  }
2560  //printf("\n .... I am using my own V0 gain correction for Psi2...\n");
2561  }
2562 
2563  //------ For V0-Qn Recenter and Event plane: Uncorrectd ----------
2565  fV0CQ2xVsCentRun->Fill(centrCL1,Qxcn2/sumMc);
2566  fV0CQ2yVsCentRun->Fill(centrCL1,Qycn2/sumMc);
2567  fV0AQ2xVsCentRun->Fill(centrCL1,Qxan2/sumMa);
2568  fV0AQ2yVsCentRun->Fill(centrCL1,Qyan2/sumMa);
2569 
2570  fV0CQ3xVsCentRun->Fill(centrCL1,Qxcn3/sumMc);
2571  fV0CQ3yVsCentRun->Fill(centrCL1,Qycn3/sumMc);
2572  fV0AQ3xVsCentRun->Fill(centrCL1,Qxan3/sumMa);
2573  fV0AQ3yVsCentRun->Fill(centrCL1,Qyan3/sumMa);
2574  }
2575 
2576  if(gPsiN>2){
2577  PsiNV0C = 1.0/gPsiN*( TMath::ATan2(QycnCor,QxcnCor) + TMath::Pi() );
2578  PsiNV0A = 1.0/gPsiN*( TMath::ATan2(QyanCor,QxanCor) + TMath::Pi() );
2579  }
2580  else{
2581  PsiNV0C = 1.0/gPsiN*TMath::ATan2(QycnCor,QxcnCor) ;
2582  if(PsiNV0C<0.) PsiNV0C += 2*TMath::Pi()/gPsiN;
2583 
2584  PsiNV0A = 1.0/gPsiN*TMath::ATan2(QyanCor,QxanCor) ;
2585  if(PsiNV0A<0.) PsiNV0A += 2*TMath::Pi()/gPsiN;
2586  }
2587 
2588 
2589  fHV0CEventPlaneVsCent->Fill(EvtCent,PsiNV0C);
2590  fHV0AEventPlaneVsCent->Fill(EvtCent,PsiNV0A);
2591 
2592  } //--------------------- if(gPsiN>0) --------------------------
2593 
2594 
2595 
2596 
2597 
2598 
2599 
2600  fEventCount++;
2601 
2602 
2603 
2604 
2605 
2606 
2607 
2608 
2609 
2610  //---- Copies of TPC-Q vectors to remove track -by- track auto-correlation -----
2611 
2612  Double_t sumQxTPCneg;
2613  Double_t sumQyTPCneg;
2614  Double_t sumQxTPCpos;
2615  Double_t sumQyTPCpos;
2616  Double_t sumQxTPCneg2;
2617  Double_t sumQyTPCneg2;
2618  Double_t sumQxTPCpos2;
2619  Double_t sumQyTPCpos2;
2620  Double_t SumWgtNeg, SumWgtPos;
2621  Double_t SumWgtNeg2, SumWgtPos2;
2622 
2623 
2624 
2625  //--------- Track variable for PID/Charge studies ----------------
2626  Double_t PDGmassPion = 0.13957;
2627  Double_t PDGmassKaon = 0.49368;
2628  Double_t PDGmassProton = 0.93827;
2629 
2630  PDGmassProton *= PDGmassProton;
2631  PDGmassPion *= PDGmassPion;
2632  PDGmassKaon *= PDGmassKaon;
2633 
2634  Double_t dEdx1, dEdx2, dPhi1, dPhi2, dPt1, dPt2;
2635  Double_t dEta1, dEta2, ptw1, ptw2, deltaPhi;
2636  Double_t mom, w1NUA, w2NUA, WgtEP;
2637 
2638  /*
2639  Double_t nSigTOFpion, nSigTPCpion;
2640  Double_t nSigTOFkaon, nSigTPCkaon;
2641  Double_t nSigTOFproton,nSigTPCproton;
2642  Double_t nSigTOFpion2, nSigTPCpion2;
2643  Double_t nSigTOFkaon2, nSigTPCkaon2;
2644  Double_t nSigTOFproton2,nSigTPCproton2;
2645  */
2646 
2647  //Tof variables
2648  //Double_t length, tofTime, probMis, mass, beta;
2649  //Double_t c = TMath::C()*1.E-9; //bright light m/ns
2650  //Int_t TOFmatch=0;
2651 
2652 
2653 
2654  Int_t ptBin,gCharge1,gCharge2;
2655 
2656  //Double_t dcaXY, dcaZ ;
2657 
2658 
2659  //----------- Set the desired Harmonic ------------
2660  Int_t n = gN;
2661  Int_t m = gM;
2662  Int_t p =n+m;
2663  //------------------------------------------------
2664 
2665 
2666  Int_t skipPairHBT = 0;
2667 
2668 
2669 
2670 
2671 
2672  Double_t Chi2Trk1=0, Chi2Trk2=0;
2673 
2674  //Double_t ptwPion1,ptwKaon1,ptwProton1;
2675  //Double_t ptwPion2,ptwKaon2,ptwProton2;
2676  //Double_t wNUAPion1,wNUAKaon1,wNUAProton1;
2677  //Double_t wNUAPion2,wNUAKaon2,wNUAProton2;
2678 
2679  //Double_t WgtEPPion = 1.0;
2680  //Double_t WgtEPKaon = 1.0;
2681  //Double_t WgtEPProton = 1.0;
2682 
2683 
2684  Bool_t isPion1 = kFALSE;
2685  Bool_t isKaon1 = kFALSE;
2686  Bool_t isProton1 = kFALSE;
2687  Bool_t isPion2 = kFALSE;
2688  Bool_t isKaon2 = kFALSE;
2689  Bool_t isProton2 = kFALSE;
2690 
2691  Int_t multPOI1st = 0;
2692  Int_t multPOI2nd = 0;
2693 
2694 
2695  //const Int_t maxTrack = 40000;
2696 
2697 
2698 
2699 
2700  //Calling fPIDResponse in nested loop is CPU expensive.
2701  //Store nSigma values in a array:
2702 
2703 
2704  /*
2705  for(int itrack = 0; itrack < ntracks; itrack++) {
2706 
2707  AliAODTrack *trackForPID=dynamic_cast<AliAODTrack*>(fVevent->GetTrack(itrack));
2708  if(!trackForPID) continue;
2709 
2710  // Array method:
2711  if(trackForPID){
2712  nSigPionTPC[itrack] = fPIDResponse->NumberOfSigmasTPC(trackForPID, AliPID::kPion);
2713  nSigKaonTPC[itrack] = fPIDResponse->NumberOfSigmasTPC(trackForPID, AliPID::kKaon);
2714  nSigProtonTPC[itrack] = fPIDResponse->NumberOfSigmasTPC(trackForPID, AliPID::kProton);
2715  nSigPionTOF[itrack] = fPIDResponse->NumberOfSigmasTOF(trackForPID, AliPID::kPion);
2716  nSigKaonTOF[itrack] = fPIDResponse->NumberOfSigmasTOF(trackForPID, AliPID::kKaon);
2717  nSigProtonTOF[itrack] = fPIDResponse->NumberOfSigmasTOF(trackForPID, AliPID::kProton);
2718  }
2719  else{
2720  nSigPionTPC[itrack] = -99;
2721  nSigKaonTPC[itrack] = -99;
2722  nSigProtonTPC[itrack] = -99;
2723  nSigPionTOF[itrack] = -99;
2724  nSigKaonTOF[itrack] = -99;
2725  nSigProtonTOF[itrack] = -99;
2726  }
2727 
2728  //if(itrack%10==0)
2729  //cout<< "nSig pi = " <<nSigPionTPC[itrack] << "nSig K = " << nSigKaonTPC[itrack] << "nSig p = " << nSigProtonTOF[itrack] << endl;
2730 
2731  // Vector method:
2732  //if(trackForPID){
2733  //nSigPionTPC.push_back(fPIDResponse->NumberOfSigmasTPC(trackForPID, AliPID::kPion));
2734  //nSigKaonTPC.push_back(fPIDResponse->NumberOfSigmasTPC(trackForPID, AliPID::kKaon));
2735  //nSigProtonTPC.push_back(fPIDResponse->NumberOfSigmasTPC(trackForPID, AliPID::kProton));
2736 
2737  //nSigPionTOF.push_back(fPIDResponse->NumberOfSigmasTOF(trackForPID, AliPID::kPion));
2738  //nSigKaonTOF.push_back(fPIDResponse->NumberOfSigmasTOF(trackForPID, AliPID::kKaon));
2739  //nSigProtonTOF.push_back(fPIDResponse->NumberOfSigmasTOF(trackForPID, AliPID::kProton));
2740  //}
2741  //else{
2742  //nSigPionTPC.push_back(-100.);
2743  //nSigKaonTPC.push_back(-100.);
2744  //nSigProtonTPC.push_back(-100.);
2745 
2746  //nSigPionTOF.push_back(-100.);
2747  //nSigKaonTOF.push_back(-100.);
2748  //nSigProtonTOF.push_back(-100.);
2749  //}
2750  }*/
2751 
2752 
2753 
2754 
2755 
2756 
2757  //Correct with Centrality Wgts : in second pass
2758  Int_t iCentBinWgt = (Int_t) centrality;
2759  iCentBinWgt += 1;
2760 
2761  Double_t fWgtCent = 1.0;
2762 
2763  /*
2764  if(fHCentWeightForRun){
2765  fWgtCent = fHCentWeightForRun->GetBinContent(iCentBinWgt);
2766  }*/
2767 
2768  //Fill Centrality for run-by-run: in first pass over data
2769  fCentDistAfter->Fill(centrality);
2770 
2771  //cout<<" Info:UserExec() called ... I am before track loop event = "<<fEventCount<<" \n";
2772 
2773 
2774 
2775  for(Int_t itrack = 0; itrack < ntracks; itrack++) {
2776 
2777  AliAODTrack *track=dynamic_cast<AliAODTrack*>(fVevent->GetTrack(itrack));
2778  if(!track) continue;
2779 
2780  if(!track->TestFilterBit(fFilterBit)) continue;
2781 
2782 
2783 
2784  mom = track->P();
2785  dPt1 = track->Pt();
2786  dPhi1 = track->Phi();
2787  dEta1 = track->Eta();
2788  gCharge1 = track->Charge();
2789  dEdx1 = track->GetDetPid()->GetTPCsignal();
2790  Chi2Trk1 = track->Chi2perNDF();
2791 
2792  //dcaXY = track->DCA();
2793  //dcaZ = track->ZAtDCA();
2794 
2795  /* Turn off QAs
2796  //-------------- Check TOF status ------------------
2797  AliPIDResponse::EDetPidStatus status;
2798  status = fPIDResponse->CheckPIDStatus(AliPIDResponse::kTOF,track);
2799  TOFmatch = 0;
2800  if(status==AliPIDResponse::kDetPidOk){
2801  TOFmatch++;
2802  }
2803  probMis = fPIDResponse->GetTOFMismatchProbability(track);
2804  fHistTOFMatchCount->Fill(TOFmatch,probMis);
2805 
2806  mass = -9.9;
2807  beta = -0.9;
2808 
2809  if(TOFmatch>0 && probMis < 0.01) {
2810  //This conditions are called when detector status is checked above :
2811  //if((track->IsOn(AliAODTrack::kTOFin)) && (track->IsOn(AliAODTrack::kTIME)) && (track->IsOn(AliAODTrack::kTOFout))) {
2812  //if((track->IsOn(AliAODTrack::kITSin)) && (track->IsOn(AliAODTrack::kTOFpid))) { //Naghmeh used it
2813  tofTime = track->GetTOFsignal(); // in pico seconds
2814  length = track->GetIntegratedLength();
2815  tofTime = tofTime*1.E-3; // ns
2816  if (tofTime <= 0) tofTime = 9999;
2817  length = length*0.01; // in meters
2818  tofTime = tofTime*c;
2819  beta = length/tofTime;
2820  mass = mom*mom*(1./(beta*beta) - 1);
2821  }//------------ TOF signal -------------------------
2822 
2823 
2824  //QA histograms before applying track cuts:
2825  fHistEtaPtBefore->Fill(dEta1,dPt1);
2826  fHistTPCdEdxvsPBefore->Fill(mom*gCharge1,dEdx1);
2827  fHistTOFBetavsPBefore->Fill(mom*gCharge1,beta);
2828  fHistTOFMassvsPtBefore->Fill(dPt1*gCharge1,mass); */
2829 
2830 
2831 
2832 
2833  //-------- Apply Default track cuts for analysis: ---------
2834  if((dPt1 > fMaxPtCut) || (dPt1 < fMinPtCut) || (dEta1 > fMaxEtaCut) || (dEta1 < fMinEtaCut) || (dEdx1 < fdEdxMin) || (track->GetTPCNcls() < fTPCclustMin) || (Chi2Trk1 < fTrkChi2Min) || (Chi2Trk1 > 4.0) || (track->DCA() > fDCAxyMax) || (track->ZAtDCA() > fDCAzMax) || !(TMath::Abs(gCharge1)))
2835  continue;
2836 
2837  multPOI1st++;
2838 
2839 
2840 
2841  //--------------------- PID signals 1st track-------------------------
2842  //Vector/Array both works same way:
2843  /*
2844  nSigTPCpion = nSigPionTPC[itrack];
2845  nSigTPCkaon = nSigKaonTPC[itrack];
2846  nSigTPCproton = nSigProtonTPC[itrack];
2847  nSigTOFpion = nSigPionTOF[itrack];
2848  nSigTOFkaon = nSigKaonTOF[itrack];
2849  nSigTOFproton = nSigProtonTOF[itrack];
2850  */
2851 
2852 
2853  //if(itrack%100==0)
2854  //cout<<"Trk "<<itrack<<" pt1 = "<<dPt1<<"\tnSigPion = "<<nSigTPCpion<<"\tnSigKaon = "<<nSigTPCkaon <<"\tnSigprot = "<<nSigTPCproton<<endl;
2855 
2856 
2857  isPion1 = kFALSE;
2858  isKaon1 = kFALSE;
2859  isProton1 = kFALSE;
2860 
2861  /*
2862  //------> Pion
2863  if(dPt1<=0.6 && TMath::Abs(nSigTPCpion)<=3.0){
2864  isPion1 = kTRUE;
2865  }
2866  else if(dPt1>0.6 && dPt1<=2.0 && TMath::Abs(nSigTPCpion)<=3.0 && TMath::Abs(nSigTOFpion)<=2.0 ){
2867  isPion1 = kTRUE;
2868  }
2869  //------> Kaon
2870  if(dPt1<=0.45 && TMath::Abs(nSigTPCkaon)<=3.0){
2871  isKaon1 = kTRUE;
2872  }
2873  else if(dPt1>0.45 && dPt1<=2.0 && TMath::Abs(nSigTPCkaon)<=3.0 && TMath::Abs(nSigTOFkaon)<=2.0){
2874  isKaon1 = kTRUE;
2875  }
2876  //------> Proton
2877  if(dPt1<=0.8 && TMath::Abs(nSigTPCproton)<=3.0){
2878  isProton1 = kTRUE;
2879  if(dPt1<0.4) isProton1 = kFALSE; //Proton below 0.4 GeV is garbage
2880  }
2881  else if(dPt1>0.8 && dPt1<=2.0 && TMath::Abs(nSigTPCproton)<=3.0 && TMath::Abs(nSigTOFproton)<=3.0){ //0.8 to 3.5 was used earlier.
2882  isProton1 = kTRUE;
2883  } */
2884 
2885 
2886 
2887 
2888 
2889 
2890 
2891 
2892 
2893  //================= MC wgt and NUA wgt for PID =================
2894  /*
2895  ptwPion1 = 1.0;
2896  ptwKaon1 = 1.0;
2897  ptwProton1 = 1.0;
2898  wNUAPion1 = 1.0;
2899  wNUAKaon1 = 1.0;
2900  wNUAProton1 = 1.0;
2901 
2902  //------ get MC weight and NUA for Pion track1 --------------
2903  if(isPion1){
2904  if(fFB_Efficiency_Pion_Cent[cent10bin]){ // <-------------------- !!!! WARNING: use Pion Efficiency file when available.
2905  ptBin = fFB_Efficiency_Pion_Cent[cent10bin]->FindBin(dPt1);
2906  ptwPion1 = 1.0/fFB_Efficiency_Pion_Cent[cent10bin]->GetBinContent(ptBin);
2907  }
2908  //else{ ptwPion1 = 1.0; }
2909 
2910  if(gCharge1>0){
2911  if(fHCorrectNUAposPion[cForNUA]){
2912  iBinNUA = fHCorrectNUAposPion[cForNUA]->FindBin(pVtxZ,dPhi1,dEta1);
2913  wNUAPion1 = fHCorrectNUAposPion[cForNUA]->GetBinContent(iBinNUA);
2914  }
2915  //else{ wNUAPion1 = 1.0; }
2916  }
2917  else{
2918  if(fHCorrectNUAnegPion[cForNUA]){
2919  iBinNUA = fHCorrectNUAnegPion[cForNUA]->FindBin(pVtxZ,dPhi1,dEta1);
2920  wNUAPion1 = fHCorrectNUAnegPion[cForNUA]->GetBinContent(iBinNUA);
2921  }
2922  //else{ wNUAPion1 = 1.0; }
2923  }
2924  }
2925 
2926  //------ get MC weight and NUA for Kaon track1 --------------
2927  if(isKaon1){
2928  if(fFB_Efficiency_Kaon_Cent[cent10bin]){ // <-------------------- !!!! WARNING: use Kaon Efficiency file when available.
2929  ptBin = fFB_Efficiency_Kaon_Cent[cent10bin]->FindBin(dPt1);
2930  ptwKaon1 = 1.0/fFB_Efficiency_Kaon_Cent[cent10bin]->GetBinContent(ptBin);
2931  }
2932  //else{ ptwKaon1 = 1.0; }
2933 
2934  if(gCharge1>0){
2935  if(fHCorrectNUAposKaon[cForNUA]){
2936  iBinNUA = fHCorrectNUAposKaon[cForNUA]->FindBin(pVtxZ,dPhi1,dEta1);
2937  wNUAKaon1 = fHCorrectNUAposKaon[cForNUA]->GetBinContent(iBinNUA);
2938  }
2939  //else{ wNUAKaon1 = 1.0; }
2940  }
2941  else{
2942  if(fHCorrectNUAnegKaon[cForNUA]){
2943  iBinNUA = fHCorrectNUAnegKaon[cForNUA]->FindBin(pVtxZ,dPhi1,dEta1);
2944  wNUAKaon1 = fHCorrectNUAnegKaon[cForNUA]->GetBinContent(iBinNUA);
2945  }
2946  //else{ wNUAKaon1 = 1.0; }
2947  }
2948  }
2949 
2950  //------ get MC weight and NUA for Proton track1 --------------
2951  if(isProton1){
2952  if(gCharge1>0){
2953  if(fFB_Efficiency_Proton_Pos_Cent[cent10bin]){ // <-------------------- !!!! WARNING: use Proton Efficiency file when available.
2954  ptBin = fFB_Efficiency_Proton_Pos_Cent[cent10bin]->FindBin(dPt1);
2955  ptwProton1 = 1.0/fFB_Efficiency_Proton_Pos_Cent[cent10bin]->GetBinContent(ptBin);
2956  }
2957  if(fHCorrectNUAposProton[cForNUA]){
2958  iBinNUA = fHCorrectNUAposProton[cForNUA]->FindBin(pVtxZ,dPhi1,dEta1);
2959  wNUAProton1 = fHCorrectNUAposProton[cForNUA]->GetBinContent(iBinNUA);
2960  }
2961  }
2962  else{
2963  if(fFB_Efficiency_Proton_Neg_Cent[cent10bin]){ // <-------------------- !!!! WARNING: use Proton Efficiency file when available.
2964  ptBin = fFB_Efficiency_Proton_Neg_Cent[cent10bin]->FindBin(dPt1);
2965  ptwProton1 = 1.0/fFB_Efficiency_Proton_Neg_Cent[cent10bin]->GetBinContent(ptBin);
2966  }
2967  if(fHCorrectNUAnegProton[cForNUA]){
2968  iBinNUA = fHCorrectNUAnegProton[cForNUA]->FindBin(pVtxZ,dPhi1,dEta1);
2969  wNUAProton1 = fHCorrectNUAnegProton[cForNUA]->GetBinContent(iBinNUA);
2970  }
2971  }
2972  //else{ ptwProton1 = 1.0; }
2973  }
2974  */
2975  //=========================== X ===============================
2976 
2977 
2978 
2979  //------ get MC weight and NUA for Charged track 1--------------
2980  ptw1 = 1.0;
2981  w1NUA = 1.0;
2982 
2983  if(fFB_Efficiency_Cent[cent10bin]){
2984  ptBin = fFB_Efficiency_Cent[cent10bin]->FindBin(dPt1);
2985  ptw1 = 1.0/fFB_Efficiency_Cent[cent10bin]->GetBinContent(ptBin);
2986  }
2987  //else{ ptw1 = 1.0; }
2988 
2989  if(gCharge1>0){
2990  if(fHCorrectNUApos[cForNUA]){
2991  iBinNUA = fHCorrectNUApos[cForNUA]->FindBin(pVtxZ,dPhi1,dEta1);
2992  w1NUA = fHCorrectNUApos[cForNUA]->GetBinContent(iBinNUA);
2993  }
2994  //else{ w1NUA = 1.0; }
2995  }
2996  else{
2997  if(fHCorrectNUAneg[cForNUA]){
2998  iBinNUA = fHCorrectNUAneg[cForNUA]->FindBin(pVtxZ,dPhi1,dEta1);
2999  w1NUA = fHCorrectNUAneg[cForNUA]->GetBinContent(iBinNUA);
3000  }
3001  //else{ w1NUA = 1.0; }
3002  }
3003 
3004  if(w1NUA==0) w1NUA = 1.0;
3005 
3006 
3007 
3008  //============= charged hadron analysis: ============
3009  sumQxTPCneg = sumTPCQn2x[0]; // first copy to remove 1st track fron Q vector (AutoCorrelation)
3010  sumQyTPCneg = sumTPCQn2y[0];
3011  sumQxTPCpos = sumTPCQn2x[1];
3012  sumQyTPCpos = sumTPCQn2y[1];
3013  SumWgtNeg = SumWEtaNeg;
3014  SumWgtPos = SumWEtaPos;
3015 
3016  //-------- Remove phi1 from EP calculation ----------
3017 
3018  if(dEta1 < -0.05){
3019  sumQxTPCneg -= w1NUA*TMath::Cos(gPsiN*dPhi1);
3020  sumQyTPCneg -= w1NUA*TMath::Sin(gPsiN*dPhi1); // [0] = eta <-0.05
3021  SumWgtNeg -= w1NUA;
3022  }
3023  else if(dEta1 > 0.05){
3024  sumQxTPCpos -= w1NUA*TMath::Cos(gPsiN*dPhi1);
3025  sumQyTPCpos -= w1NUA*TMath::Sin(gPsiN*dPhi1); // [1] = eta > 0.05
3026  SumWgtPos -= w1NUA;
3027  }
3028  //-----------------------------------------------------
3029 
3030 
3031 
3032 
3033 
3034 
3035 
3036 
3037 
3038 
3039 
3040 
3041  multPOI2nd = 0;
3042 
3043  //---2nd track loop (nested)---
3044  for(Int_t jtrack = 0; jtrack < ntracks; jtrack++) {
3045 
3046  if(jtrack==itrack) continue;
3047 
3048  if(n==0) continue;
3049 
3050  AliAODTrack *track2=dynamic_cast<AliAODTrack*>(fVevent->GetTrack(jtrack));
3051  if(!track2) continue;
3052 
3053  if(!(track2->TestFilterBit(fFilterBit))) continue;
3054 
3055  dPt2 = track2->Pt();
3056  dPhi2 = track2->Phi();
3057  dEta2 = track2->Eta();
3058  gCharge2= track2->Charge();
3059  dEdx2 = track2->GetDetPid()->GetTPCsignal();
3060  Chi2Trk2 = track2->Chi2perNDF();
3061 
3062  if((dPt2 > fMaxPtCut) || (dPt2 < fMinPtCut) || (dEta2 > fMaxEtaCut) || (dEta2 < fMinEtaCut) || (dEdx2 < fdEdxMin) || (track2->GetTPCNcls() < fTPCclustMin) || (Chi2Trk2 < fTrkChi2Min) || (Chi2Trk2 > 4.0) || (track2->DCA() > fDCAxyMax) || (track2->ZAtDCA() > fDCAzMax) || !(TMath::Abs(gCharge2)))
3063  continue;
3064 
3065  multPOI2nd++;
3066 
3067 
3068 
3069  /*
3070  if(track2->GetDetPid()->GetTPCsignal() < 10.0) continue;
3071  if(track2->GetTPCNcls() < 70) continue;
3072  if(track2->Chi2perNDF() < 0.2) continue;
3073  if(dPt2 < fMinPtCut || dPt2 > fMaxPtCut) continue;
3074  if(dEta2< fMinEtaCut || dEta2 > fMaxEtaCut) continue;
3075  if(!TMath::Abs(gCharge2)) continue;
3076  //if(!(track2->TestFilterBit(fFilterBit))) continue; */
3077  //-----------------------------------------------------
3078 
3079  //calling fPIDResponse is too costly for CPU
3080 
3081 
3082  isPion2 = kFALSE;
3083  isKaon2 = kFALSE;
3084  isProton2 = kFALSE;
3085 
3086  //--------------------- PID signals 2nd track-------------------------
3087  //Vector/Array both works same way:
3088  /*
3089  nSigTPCpion2 = nSigPionTPC[jtrack];
3090  nSigTPCkaon2 = nSigKaonTPC[jtrack];
3091  nSigTPCproton2 = nSigProtonTPC[jtrack];
3092  nSigTOFpion2 = nSigPionTOF[jtrack];
3093  nSigTOFkaon2 = nSigKaonTOF[jtrack];
3094  nSigTOFproton2 = nSigProtonTOF[jtrack];
3095 
3096  //------> Pion
3097  if(dPt2<=0.6 && TMath::Abs(nSigTPCpion2)<=3.0){
3098  isPion2 = kTRUE;
3099  }
3100  else if(dPt2>0.6 && dPt2<=2.0 && TMath::Abs(nSigTPCpion2)<=3.0 && TMath::Abs(nSigTOFpion2)<=2.0 ){
3101  isPion2 = kTRUE;
3102  }
3103  //------> Kaon
3104  if(dPt2<=0.45 && TMath::Abs(nSigTPCkaon2)<=3.0){
3105  isKaon2 = kTRUE;
3106  }
3107  else if(dPt2>0.45 && dPt2<=2.0 && TMath::Abs(nSigTPCkaon2)<=3.0 && TMath::Abs(nSigTOFkaon2)<=2.0){
3108  isKaon2 = kTRUE;
3109  }
3110  //------> Proton
3111  if(dPt2<=0.8 && TMath::Abs(nSigTPCproton2)<=3.0){
3112  isProton2 = kTRUE;
3113  if(dPt2<0.4) isProton2 = kFALSE; //Proton below 0.4 GeV is garbage
3114  }
3115  else if(dPt2>0.8 && dPt2<=2.0 && TMath::Abs(nSigTPCproton2)<=3.0 && TMath::Abs(nSigTOFproton2)<=3.0){ //0.8 to 3.5 was used earlier.
3116  isProton2 = kTRUE;
3117  }
3118  */
3119 
3120  //----------------------------------------------------------------
3121 
3122 
3123 
3124 
3125 
3126  //================= MC wgt and NUA wgt for PID =================
3127  /*
3128  WgtEPPion = 1.0;
3129  WgtEPKaon = 1.0;
3130  WgtEPProton = 1.0;
3131 
3132  ptwPion2 = 1.0;
3133  ptwKaon2 = 1.0;
3134  ptwProton2 = 1.0;
3135  wNUAPion2 = 1.0;
3136  wNUAKaon2 = 1.0;
3137  wNUAProton2 = 1.0;
3138 
3139  //------ get MC weight and NUA for Pion track2 --------------
3140  if(isPion2){
3141  if(fFB_Efficiency_Pion_Cent[cent10bin]){
3142  ptBin = fFB_Efficiency_Pion_Cent[cent10bin]->FindBin(dPt2);
3143  ptwPion2 = 1.0/fFB_Efficiency_Pion_Cent[cent10bin]->GetBinContent(ptBin);
3144  }
3145  //else{ ptwPion2 = 1.0; }
3146 
3147  if(gCharge2>0){
3148  if(fHCorrectNUAposPion[cForNUA]){
3149  iBinNUA = fHCorrectNUAposPion[cForNUA]->FindBin(pVtxZ,dPhi2,dEta2);
3150  wNUAPion2 = fHCorrectNUAposPion[cForNUA]->GetBinContent(iBinNUA);
3151  }
3152  //else{ wNUAPion2 = 1.0; }
3153  }
3154  else{
3155  if(fHCorrectNUAnegPion[cForNUA]){
3156  iBinNUA = fHCorrectNUAnegPion[cForNUA]->FindBin(pVtxZ,dPhi2,dEta2);
3157  wNUAPion2 = fHCorrectNUAnegPion[cForNUA]->GetBinContent(iBinNUA);
3158  }
3159  //else{ wNUAPion2 = 1.0; }
3160  }
3161 
3162  WgtEPPion = ptwPion1*ptwPion2*wNUAPion1*wNUAPion2;
3163  }
3164 
3165  //------ get MC weight and NUA for Kaon track2 --------------
3166  if(isKaon2){
3167  if(fFB_Efficiency_Kaon_Cent[cent10bin]){
3168  ptBin = fFB_Efficiency_Kaon_Cent[cent10bin]->FindBin(dPt2);
3169  ptwKaon2 = 1.0/fFB_Efficiency_Kaon_Cent[cent10bin]->GetBinContent(ptBin);
3170  }
3171  //else{ ptwKaon2 = 1.0; }
3172 
3173  if(gCharge2>0){
3174  if(fHCorrectNUAposKaon[cForNUA]){
3175  iBinNUA = fHCorrectNUAposKaon[cForNUA]->FindBin(pVtxZ,dPhi2,dEta2);
3176  wNUAKaon2 = fHCorrectNUAposKaon[cForNUA]->GetBinContent(iBinNUA);
3177  }
3178  //else{ wNUAKaon2 = 1.0; }
3179  }
3180  else{
3181  if(fHCorrectNUAnegKaon[cForNUA]){
3182  iBinNUA = fHCorrectNUAnegKaon[cForNUA]->FindBin(pVtxZ,dPhi2,dEta2);
3183  wNUAKaon2 = fHCorrectNUAnegKaon[cForNUA]->GetBinContent(iBinNUA);
3184  }
3185  //else{ wNUAKaon2 = 1.0; }
3186  }
3187 
3188  WgtEPKaon = ptwKaon1*ptwKaon2*wNUAKaon1*wNUAKaon2;
3189  }
3190 
3191  //------ get MC weight and NUA for Proton track2 --------------
3192  if(isProton2){
3193  if(gCharge2>0){
3194  if(fFB_Efficiency_Proton_Pos_Cent[cent10bin]){
3195  ptBin = fFB_Efficiency_Proton_Pos_Cent[cent10bin]->FindBin(dPt2);
3196  ptwProton2 = 1.0/fFB_Efficiency_Proton_Pos_Cent[cent10bin]->GetBinContent(ptBin);
3197  }
3198  if(fHCorrectNUAposProton[cForNUA]){
3199  iBinNUA = fHCorrectNUAposProton[cForNUA]->FindBin(pVtxZ,dPhi2,dEta2);
3200  wNUAProton2 = fHCorrectNUAposProton[cForNUA]->GetBinContent(iBinNUA);
3201  }
3202  }
3203  else{
3204  if(fFB_Efficiency_Proton_Neg_Cent[cent10bin]){
3205  ptBin = fFB_Efficiency_Proton_Neg_Cent[cent10bin]->FindBin(dPt2);
3206  ptwProton2 = 1.0/fFB_Efficiency_Proton_Neg_Cent[cent10bin]->GetBinContent(ptBin);
3207  }
3208  if(fHCorrectNUAnegProton[cForNUA]){
3209  iBinNUA = fHCorrectNUAnegProton[cForNUA]->FindBin(pVtxZ,dPhi2,dEta2);
3210  wNUAProton2 = fHCorrectNUAnegProton[cForNUA]->GetBinContent(iBinNUA);
3211  }
3212  }
3213  //else{ ptwProton2 = 1.0; }
3214  WgtEPProton = ptwProton1*ptwProton2*wNUAProton1*wNUAProton2;
3215  }
3216  */
3217  //========================== X ================================
3218 
3219 
3220 
3221 
3222 
3223  //------ get MC weight and NUA (Charged) for track 2--------------
3224  WgtEP = 1.0;
3225  ptw2 = 1.0;
3226  w2NUA = 1.0;
3227 
3228  if(fFB_Efficiency_Cent[cent10bin]){
3229  ptBin = fFB_Efficiency_Cent[cent10bin]->FindBin(dPt2);
3230  ptw2 = 1.0/fFB_Efficiency_Cent[cent10bin]->GetBinContent(ptBin);
3231  }
3232  //else{ ptw2 = 1.0; }
3233 
3234  if(gCharge2>0){
3235  if(fHCorrectNUApos[cForNUA]){
3236  iBinNUA = fHCorrectNUApos[cForNUA]->FindBin(pVtxZ,dPhi2,dEta2);
3237  w2NUA = fHCorrectNUApos[cForNUA]->GetBinContent(iBinNUA);
3238  }
3239  //else{ w2NUA = 1.0; }
3240  }
3241  else{
3242  if(fHCorrectNUAneg[cForNUA]){
3243  iBinNUA = fHCorrectNUAneg[cForNUA]->FindBin(pVtxZ,dPhi2,dEta2);
3244  w2NUA = fHCorrectNUAneg[cForNUA]->GetBinContent(iBinNUA);
3245  }
3246  //else{ w2NUA = 1.0; }
3247  }
3248 
3249  if(w2NUA==0) w2NUA = 1.0;
3250 
3251 
3252 
3253 
3254 
3255 
3256 
3257 
3258 
3259 
3260 
3261 
3262  //---------- Remove track2 from EP calculation ---------
3263  sumQxTPCneg2 = sumQxTPCneg; //second copy to remove 2nd track from EP
3264  sumQyTPCneg2 = sumQyTPCneg;
3265  sumQxTPCpos2 = sumQxTPCpos;
3266  sumQyTPCpos2 = sumQyTPCpos;
3267  SumWgtNeg2 = SumWgtNeg;
3268  SumWgtPos2 = SumWgtPos;
3269  //------------------------------------------------------
3270 
3271 
3272 
3273  if(dEta2 < -0.05){
3274  sumQxTPCneg2 -= w2NUA*TMath::Cos(gPsiN*dPhi2);
3275  sumQyTPCneg2 -= w2NUA*TMath::Sin(gPsiN*dPhi2); // [0] = eta <-0.05
3276  SumWgtNeg2 -= w2NUA;
3277  }
3278  else if(dEta2 > 0.05){
3279  sumQxTPCpos2 -= w2NUA*TMath::Cos(gPsiN*dPhi2);
3280  sumQyTPCpos2 -= w2NUA*TMath::Sin(gPsiN*dPhi2); // [1] = eta > 0.05
3281  SumWgtPos2 -= w2NUA;
3282  }
3283 
3284  if(SumWgtNeg2>0 && SumWgtPos2>0){
3285  sumQyTPCneg2 = sumQyTPCneg2/SumWgtNeg2;
3286  sumQxTPCneg2 = sumQxTPCneg2/SumWgtNeg2;
3287 
3288  sumQyTPCpos2 = sumQyTPCpos2/SumWgtPos2;
3289  sumQxTPCpos2 = sumQxTPCpos2/SumWgtPos2;
3290  }
3291 
3292  // track by track EP:
3293  if(gPsiN>0){
3294  PsiNTPCC = (1.0/gPsiN)*( TMath::ATan2(sumQyTPCneg2,sumQxTPCneg2) ) ; // negetive eta
3295  if(PsiNTPCC<0.) PsiNTPCC += 2*TMath::Pi()/gPsiN;
3296 
3297  PsiNTPCA = (1.0/gPsiN)*( TMath::ATan2(sumQyTPCpos2,sumQxTPCpos2) ) ; // positive eta
3298  if(PsiNTPCA<0.) PsiNTPCA += 2*TMath::Pi()/gPsiN;
3299  }
3300 
3301  //fHTPCAEventPlaneVsCent->Fill(EvtCent,PsiNTPCA);
3302  //fHTPCCEventPlaneVsCent->Fill(EvtCent,PsiNTPCC);
3303  //-----------------------------------------------------------
3304 
3305 
3306 
3307 
3308  // combined weight for EP:
3309  WgtEP = ptw1*ptw2*w1NUA*w2NUA;
3310 
3311 
3312 
3313  deltaPhi = dPhi1 - dPhi2; //for 2p correlator
3314 
3316 
3317  if(gCharge1!=gCharge2) {
3318  fHist_Corr3p_EP_Norm_PN[QAindex][0]->Fill(EvtCent, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0A), WgtEP*fWgtCent);
3319  fHist_Corr3p_EP_Norm_PN[QAindex][1]->Fill(EvtCent, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0C), WgtEP*fWgtCent);
3320  fHist_Corr3p_EP_Norm_PN[QAindex][2]->Fill(EvtCent, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNTPCA),WgtEP*fWgtCent);
3321  fHist_Corr3p_EP_Norm_PN[QAindex][3]->Fill(EvtCent, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNTPCC),WgtEP*fWgtCent);
3322  /*
3323  fHist_Corr3p_EP_Refm_PN[QAindex][0]->Fill(RefMultCorrFB, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0A), WgtEP*fWgtCent);
3324  fHist_Corr3p_EP_Refm_PN[QAindex][1]->Fill(RefMultCorrFB, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0C), WgtEP*fWgtCent);
3325  fHist_Corr3p_EP_Refm_PN[QAindex][2]->Fill(RefMultCorrFB, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNTPCA),WgtEP*fWgtCent);
3326  fHist_Corr3p_EP_Refm_PN[QAindex][3]->Fill(RefMultCorrFB, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNTPCC),WgtEP*fWgtCent);
3327  */
3328  //Differential
3329  if(cIndex<6){
3330  fHist_Corr3p_pTSum_EP_V0A_PN[QAindex][cIndex]->Fill((dPt1+dPt2)*0.5, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0A),WgtEP*fWgtCent);
3331  fHist_Corr3p_pTSum_EP_V0C_PN[QAindex][cIndex]->Fill((dPt1+dPt2)*0.5, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0C),WgtEP*fWgtCent);
3332  fHist_Corr3p_pTDiff_EP_V0A_PN[QAindex][cIndex]->Fill(TMath::Abs(dPt1-dPt2), TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0A),WgtEP*fWgtCent);
3333  fHist_Corr3p_pTDiff_EP_V0C_PN[QAindex][cIndex]->Fill(TMath::Abs(dPt1-dPt2), TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0C),WgtEP*fWgtCent);
3334  fHist_Corr3p_EtaDiff_EP_V0A_PN[QAindex][cIndex]->Fill(TMath::Abs(dEta1-dEta2), TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0A),WgtEP*fWgtCent);
3335  fHist_Corr3p_EtaDiff_EP_V0C_PN[QAindex][cIndex]->Fill(TMath::Abs(dEta1-dEta2), TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0C),WgtEP*fWgtCent);
3336  }
3337  //-------------> PID CME ---------------
3338  //Pion:
3339  if(isPion1 && isPion2){
3340  /*
3341  fHist_Corr3p_Pion_EP_Norm_PN[QAindex][0]->Fill(EvtCent, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0A), WgtEPPion*fWgtCent);
3342  fHist_Corr3p_Pion_EP_Norm_PN[QAindex][1]->Fill(EvtCent, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0C), WgtEPPion*fWgtCent);
3343  fHist_Corr3p_Pion_EP_Norm_PN[QAindex][2]->Fill(EvtCent, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNTPCA),WgtEPPion*fWgtCent);
3344  fHist_Corr3p_Pion_EP_Norm_PN[QAindex][3]->Fill(EvtCent, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNTPCC),WgtEPPion*fWgtCent);
3345 
3346  //Differential:
3347  if(cIndex<6){
3348  fHist_Corr3p_Pion_pTSum_EP_V0A_PN[QAindex][cIndex]->Fill((dPt1+dPt2)*0.5, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0A),WgtEPPion*fWgtCent);
3349  fHist_Corr3p_Pion_pTSum_EP_V0C_PN[QAindex][cIndex]->Fill((dPt1+dPt2)*0.5, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0C),WgtEPPion*fWgtCent);
3350  fHist_Corr3p_Pion_pTDiff_EP_V0A_PN[QAindex][cIndex]->Fill(TMath::Abs(dPt1-dPt2), TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0A),WgtEPPion*fWgtCent);
3351  fHist_Corr3p_Pion_pTDiff_EP_V0C_PN[QAindex][cIndex]->Fill(TMath::Abs(dPt1-dPt2), TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0C),WgtEPPion*fWgtCent);
3352  fHist_Corr3p_Pion_EtaDiff_EP_V0A_PN[QAindex][cIndex]->Fill(TMath::Abs(dEta1-dEta2), TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0A),WgtEPPion*fWgtCent);
3353  fHist_Corr3p_Pion_EtaDiff_EP_V0C_PN[QAindex][cIndex]->Fill(TMath::Abs(dEta1-dEta2), TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0C),WgtEPPion*fWgtCent);
3354  }
3355  */
3356  }
3357  //Kaon:
3358  if(isKaon1 && isKaon2){
3359  /*
3360  fHist_Corr3p_Kaon_EP_Norm_PN[QAindex][0]->Fill(EvtCent, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0A), WgtEPKaon*fWgtCent);
3361  fHist_Corr3p_Kaon_EP_Norm_PN[QAindex][1]->Fill(EvtCent, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0C), WgtEPKaon*fWgtCent);
3362  fHist_Corr3p_Kaon_EP_Norm_PN[QAindex][2]->Fill(EvtCent, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNTPCA),WgtEPKaon*fWgtCent);
3363  fHist_Corr3p_Kaon_EP_Norm_PN[QAindex][3]->Fill(EvtCent, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNTPCC),WgtEPKaon*fWgtCent);
3364 
3365  //Differential:
3366  if(cIndex<6){
3367  fHist_Corr3p_Kaon_pTSum_EP_V0A_PN[QAindex][cIndex]->Fill((dPt1+dPt2)*0.5, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0A),WgtEPKaon*fWgtCent);
3368  fHist_Corr3p_Kaon_pTSum_EP_V0C_PN[QAindex][cIndex]->Fill((dPt1+dPt2)*0.5, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0C),WgtEPKaon*fWgtCent);
3369  fHist_Corr3p_Kaon_pTDiff_EP_V0A_PN[QAindex][cIndex]->Fill(TMath::Abs(dPt1-dPt2), TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0A),WgtEPKaon*fWgtCent);
3370  fHist_Corr3p_Kaon_pTDiff_EP_V0C_PN[QAindex][cIndex]->Fill(TMath::Abs(dPt1-dPt2), TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0C),WgtEPKaon*fWgtCent);
3371  fHist_Corr3p_Kaon_EtaDiff_EP_V0A_PN[QAindex][cIndex]->Fill(TMath::Abs(dEta1-dEta2), TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0A),WgtEPKaon*fWgtCent);
3372  fHist_Corr3p_Kaon_EtaDiff_EP_V0C_PN[QAindex][cIndex]->Fill(TMath::Abs(dEta1-dEta2), TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0C),WgtEPKaon*fWgtCent);
3373  }
3374  */
3375  }
3376  //Proton:
3377  if(isProton1 && isProton2){
3378  //cout<<"#pair pt1 = "<<dPt1<<"\tpt2 = "<<dPt2<<"\tnSigp1 = "<<nSigTPCproton<<"\tnSigp2 = "<<nSigTPCproton2<<endl;
3379  /*
3380  fHist_Corr3p_Proton_EP_Norm_PN[QAindex][0]->Fill(EvtCent, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0A), WgtEPProton*fWgtCent);
3381  fHist_Corr3p_Proton_EP_Norm_PN[QAindex][1]->Fill(EvtCent, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0C), WgtEPProton*fWgtCent);
3382  fHist_Corr3p_Proton_EP_Norm_PN[QAindex][2]->Fill(EvtCent, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNTPCA),WgtEPProton*fWgtCent);
3383  fHist_Corr3p_Proton_EP_Norm_PN[QAindex][3]->Fill(EvtCent, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNTPCC),WgtEPProton*fWgtCent);
3384 
3385  //Differential:
3386  if(cIndex<6){
3387  fHist_Corr3p_Proton_pTSum_EP_V0A_PN[QAindex][cIndex]->Fill((dPt1+dPt2)*0.5, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0A),WgtEPProton*fWgtCent);
3388  fHist_Corr3p_Proton_pTSum_EP_V0C_PN[QAindex][cIndex]->Fill((dPt1+dPt2)*0.5, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0C),WgtEPProton*fWgtCent);
3389  fHist_Corr3p_Proton_pTDiff_EP_V0A_PN[QAindex][cIndex]->Fill(TMath::Abs(dPt1-dPt2), TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0A),WgtEPProton*fWgtCent);
3390  fHist_Corr3p_Proton_pTDiff_EP_V0C_PN[QAindex][cIndex]->Fill(TMath::Abs(dPt1-dPt2), TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0C),WgtEPProton*fWgtCent);
3391  fHist_Corr3p_Proton_EtaDiff_EP_V0A_PN[QAindex][cIndex]->Fill(TMath::Abs(dEta1-dEta2), TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0A),WgtEPProton*fWgtCent);
3392  fHist_Corr3p_Proton_EtaDiff_EP_V0C_PN[QAindex][cIndex]->Fill(TMath::Abs(dEta1-dEta2), TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0C),WgtEPProton*fWgtCent);
3393  }
3394  */
3395  }
3396  //------------------------------------
3397  }
3398 
3399 
3400 
3402 
3403 
3404 
3405  else if(gCharge1>0 && gCharge2>0 && skipPairHBT==0) {
3406  fHist_Corr3p_EP_Norm_PP[QAindex][0]->Fill(EvtCent, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0A), WgtEP*fWgtCent);
3407  fHist_Corr3p_EP_Norm_PP[QAindex][1]->Fill(EvtCent, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0C), WgtEP*fWgtCent);
3408  fHist_Corr3p_EP_Norm_PP[QAindex][2]->Fill(EvtCent, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNTPCA),WgtEP*fWgtCent);
3409  fHist_Corr3p_EP_Norm_PP[QAindex][3]->Fill(EvtCent, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNTPCC),WgtEP*fWgtCent);
3410  /*
3411  fHist_Corr3p_EP_Refm_PP[QAindex][0]->Fill(RefMultCorrFB, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0A), WgtEP*fWgtCent);
3412  fHist_Corr3p_EP_Refm_PP[QAindex][1]->Fill(RefMultCorrFB, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0C), WgtEP*fWgtCent);
3413  fHist_Corr3p_EP_Refm_PP[QAindex][2]->Fill(RefMultCorrFB, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNTPCA),WgtEP*fWgtCent);
3414  fHist_Corr3p_EP_Refm_PP[QAindex][3]->Fill(RefMultCorrFB, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNTPCC),WgtEP*fWgtCent);
3415  */
3416 
3417  //Differential:
3418  if(cIndex<6){
3419  fHist_Corr3p_pTSum_EP_V0A_PP[QAindex][cIndex]->Fill((dPt1+dPt2)*0.5, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0A),WgtEP*fWgtCent);
3420  fHist_Corr3p_pTSum_EP_V0C_PP[QAindex][cIndex]->Fill((dPt1+dPt2)*0.5, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0C),WgtEP*fWgtCent);
3421  fHist_Corr3p_pTDiff_EP_V0A_PP[QAindex][cIndex]->Fill(TMath::Abs(dPt1-dPt2), TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0A),WgtEP*fWgtCent);
3422  fHist_Corr3p_pTDiff_EP_V0C_PP[QAindex][cIndex]->Fill(TMath::Abs(dPt1-dPt2), TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0C),WgtEP*fWgtCent);
3423  fHist_Corr3p_EtaDiff_EP_V0A_PP[QAindex][cIndex]->Fill(TMath::Abs(dEta1-dEta2), TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0A),WgtEP*fWgtCent);
3424  fHist_Corr3p_EtaDiff_EP_V0C_PP[QAindex][cIndex]->Fill(TMath::Abs(dEta1-dEta2), TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0C),WgtEP*fWgtCent);
3425  }
3426  //-------------> PID CME ---------------
3427  //Pion:
3428  if(isPion1 && isPion2){
3429  /*
3430  fHist_Corr3p_Pion_EP_Norm_PP[QAindex][0]->Fill(EvtCent, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0A), WgtEPPion*fWgtCent);
3431  fHist_Corr3p_Pion_EP_Norm_PP[QAindex][1]->Fill(EvtCent, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0C), WgtEPPion*fWgtCent);
3432  fHist_Corr3p_Pion_EP_Norm_PP[QAindex][2]->Fill(EvtCent, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNTPCA),WgtEPPion*fWgtCent);
3433  fHist_Corr3p_Pion_EP_Norm_PP[QAindex][3]->Fill(EvtCent, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNTPCC),WgtEPPion*fWgtCent);
3434 
3435  //Differential:
3436  if(cIndex<6){
3437  fHist_Corr3p_Pion_pTSum_EP_V0A_PP[QAindex][cIndex]->Fill((dPt1+dPt2)*0.5, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0A),WgtEPPion*fWgtCent);
3438  fHist_Corr3p_Pion_pTSum_EP_V0C_PP[QAindex][cIndex]->Fill((dPt1+dPt2)*0.5, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0C),WgtEPPion*fWgtCent);
3439  fHist_Corr3p_Pion_pTDiff_EP_V0A_PP[QAindex][cIndex]->Fill(TMath::Abs(dPt1-dPt2), TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0A),WgtEPPion*fWgtCent);
3440  fHist_Corr3p_Pion_pTDiff_EP_V0C_PP[QAindex][cIndex]->Fill(TMath::Abs(dPt1-dPt2), TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0C),WgtEPPion*fWgtCent);
3441  fHist_Corr3p_Pion_EtaDiff_EP_V0A_PP[QAindex][cIndex]->Fill(TMath::Abs(dEta1-dEta2), TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0A),WgtEPPion*fWgtCent);
3442  fHist_Corr3p_Pion_EtaDiff_EP_V0C_PP[QAindex][cIndex]->Fill(TMath::Abs(dEta1-dEta2), TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0C),WgtEPPion*fWgtCent);
3443  }
3444  */
3445  }
3446  //Kaon:
3447  if(isKaon1 && isKaon2){
3448  /*
3449  fHist_Corr3p_Kaon_EP_Norm_PP[QAindex][0]->Fill(EvtCent, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0A), WgtEPKaon*fWgtCent);
3450  fHist_Corr3p_Kaon_EP_Norm_PP[QAindex][1]->Fill(EvtCent, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0C), WgtEPKaon*fWgtCent);
3451  fHist_Corr3p_Kaon_EP_Norm_PP[QAindex][2]->Fill(EvtCent, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNTPCA),WgtEPKaon*fWgtCent);
3452  fHist_Corr3p_Kaon_EP_Norm_PP[QAindex][3]->Fill(EvtCent, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNTPCC),WgtEPKaon*fWgtCent);
3453 
3454  //Differential:
3455  if(cIndex<6){
3456  fHist_Corr3p_Kaon_pTSum_EP_V0A_PP[QAindex][cIndex]->Fill((dPt1+dPt2)*0.5, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0A),WgtEPKaon*fWgtCent);
3457  fHist_Corr3p_Kaon_pTSum_EP_V0C_PP[QAindex][cIndex]->Fill((dPt1+dPt2)*0.5, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0C),WgtEPKaon*fWgtCent);
3458  fHist_Corr3p_Kaon_pTDiff_EP_V0A_PP[QAindex][cIndex]->Fill(TMath::Abs(dPt1-dPt2), TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0A),WgtEPKaon*fWgtCent);
3459  fHist_Corr3p_Kaon_pTDiff_EP_V0C_PP[QAindex][cIndex]->Fill(TMath::Abs(dPt1-dPt2), TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0C),WgtEPKaon*fWgtCent);
3460  fHist_Corr3p_Kaon_EtaDiff_EP_V0A_PP[QAindex][cIndex]->Fill(TMath::Abs(dEta1-dEta2), TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0A),WgtEPKaon*fWgtCent);
3461  fHist_Corr3p_Kaon_EtaDiff_EP_V0C_PP[QAindex][cIndex]->Fill(TMath::Abs(dEta1-dEta2), TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0C),WgtEPKaon*fWgtCent);
3462  }
3463  */
3464  }
3465  //Proton:
3466  if(isProton1 && isProton2){
3467  /*
3468  fHist_Corr3p_Proton_EP_Norm_PP[QAindex][0]->Fill(EvtCent, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0A), WgtEPProton*fWgtCent);
3469  fHist_Corr3p_Proton_EP_Norm_PP[QAindex][1]->Fill(EvtCent, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0C), WgtEPProton*fWgtCent);
3470  fHist_Corr3p_Proton_EP_Norm_PP[QAindex][2]->Fill(EvtCent, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNTPCA),WgtEPProton*fWgtCent);
3471  fHist_Corr3p_Proton_EP_Norm_PP[QAindex][3]->Fill(EvtCent, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNTPCC),WgtEPProton*fWgtCent);
3472 
3473  //Differential:
3474  if(cIndex<6){
3475  fHist_Corr3p_Proton_pTSum_EP_V0A_PP[QAindex][cIndex]->Fill((dPt1+dPt2)*0.5, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0A),WgtEPProton*fWgtCent);
3476  fHist_Corr3p_Proton_pTSum_EP_V0C_PP[QAindex][cIndex]->Fill((dPt1+dPt2)*0.5, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0C),WgtEPProton*fWgtCent);
3477  fHist_Corr3p_Proton_pTDiff_EP_V0A_PP[QAindex][cIndex]->Fill(TMath::Abs(dPt1-dPt2), TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0A),WgtEPProton*fWgtCent);
3478  fHist_Corr3p_Proton_pTDiff_EP_V0C_PP[QAindex][cIndex]->Fill(TMath::Abs(dPt1-dPt2), TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0C),WgtEPProton*fWgtCent);
3479  fHist_Corr3p_Proton_EtaDiff_EP_V0A_PP[QAindex][cIndex]->Fill(TMath::Abs(dEta1-dEta2), TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0A),WgtEPProton*fWgtCent);
3480  fHist_Corr3p_Proton_EtaDiff_EP_V0C_PP[QAindex][cIndex]->Fill(TMath::Abs(dEta1-dEta2), TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0C),WgtEPProton*fWgtCent);
3481  }
3482  */
3483  }
3484  //------------------------------------
3485  }
3486 
3487 
3488 
3489 
3490 
3492 
3493 
3494  else if(gCharge1<0 && gCharge2<0 && skipPairHBT==0){
3495  fHist_Corr3p_EP_Norm_NN[QAindex][0]->Fill(EvtCent, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0A), WgtEP*fWgtCent);
3496  fHist_Corr3p_EP_Norm_NN[QAindex][1]->Fill(EvtCent, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0C), WgtEP*fWgtCent);
3497  fHist_Corr3p_EP_Norm_NN[QAindex][2]->Fill(EvtCent, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNTPCA),WgtEP*fWgtCent);
3498  fHist_Corr3p_EP_Norm_NN[QAindex][3]->Fill(EvtCent, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNTPCC),WgtEP*fWgtCent);
3499  /*
3500  fHist_Corr3p_EP_Refm_NN[QAindex][0]->Fill(RefMultCorrFB, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0A), WgtEP*fWgtCent);
3501  fHist_Corr3p_EP_Refm_NN[QAindex][1]->Fill(RefMultCorrFB, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0C), WgtEP*fWgtCent);
3502  fHist_Corr3p_EP_Refm_NN[QAindex][2]->Fill(RefMultCorrFB, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNTPCA),WgtEP*fWgtCent);
3503  fHist_Corr3p_EP_Refm_NN[QAindex][3]->Fill(RefMultCorrFB, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNTPCC),WgtEP*fWgtCent);
3504  */
3505 
3506  if(cIndex<6){
3507  fHist_Corr3p_pTSum_EP_V0A_NN[QAindex][cIndex]->Fill((dPt1+dPt2)*0.5, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0A),WgtEP*fWgtCent);
3508  fHist_Corr3p_pTSum_EP_V0C_NN[QAindex][cIndex]->Fill((dPt1+dPt2)*0.5, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0C),WgtEP*fWgtCent);
3509  fHist_Corr3p_pTDiff_EP_V0A_NN[QAindex][cIndex]->Fill(TMath::Abs(dPt1-dPt2), TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0A),WgtEP*fWgtCent);
3510  fHist_Corr3p_pTDiff_EP_V0C_NN[QAindex][cIndex]->Fill(TMath::Abs(dPt1-dPt2), TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0C),WgtEP*fWgtCent);
3511  fHist_Corr3p_EtaDiff_EP_V0A_NN[QAindex][cIndex]->Fill(TMath::Abs(dEta1-dEta2), TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0A),WgtEP*fWgtCent);
3512  fHist_Corr3p_EtaDiff_EP_V0C_NN[QAindex][cIndex]->Fill(TMath::Abs(dEta1-dEta2), TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0C),WgtEP*fWgtCent);
3513  }
3514  //-------------> PID CME ---------------
3515  //Pion:
3516  if(isPion1 && isPion2){
3517  /*
3518  fHist_Corr3p_Pion_EP_Norm_NN[QAindex][0]->Fill(EvtCent, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0A), WgtEPPion*fWgtCent);
3519  fHist_Corr3p_Pion_EP_Norm_NN[QAindex][1]->Fill(EvtCent, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0C), WgtEPPion*fWgtCent);
3520  fHist_Corr3p_Pion_EP_Norm_NN[QAindex][2]->Fill(EvtCent, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNTPCA),WgtEPPion*fWgtCent);
3521  fHist_Corr3p_Pion_EP_Norm_NN[QAindex][3]->Fill(EvtCent, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNTPCC),WgtEPPion*fWgtCent);
3522 
3523  //Differential:
3524  if(cIndex<6){
3525  fHist_Corr3p_Pion_pTSum_EP_V0A_NN[QAindex][cIndex]->Fill((dPt1+dPt2)*0.5, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0A),WgtEPPion*fWgtCent);
3526  fHist_Corr3p_Pion_pTSum_EP_V0C_NN[QAindex][cIndex]->Fill((dPt1+dPt2)*0.5, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0C),WgtEPPion*fWgtCent);
3527  fHist_Corr3p_Pion_pTDiff_EP_V0A_NN[QAindex][cIndex]->Fill(TMath::Abs(dPt1-dPt2), TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0A),WgtEPPion*fWgtCent);
3528  fHist_Corr3p_Pion_pTDiff_EP_V0C_NN[QAindex][cIndex]->Fill(TMath::Abs(dPt1-dPt2), TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0C),WgtEPPion*fWgtCent);
3529  fHist_Corr3p_Pion_EtaDiff_EP_V0A_NN[QAindex][cIndex]->Fill(TMath::Abs(dEta1-dEta2), TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0A),WgtEPPion*fWgtCent);
3530  fHist_Corr3p_Pion_EtaDiff_EP_V0C_NN[QAindex][cIndex]->Fill(TMath::Abs(dEta1-dEta2), TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0C),WgtEPPion*fWgtCent);
3531  }
3532  */
3533  }
3534  //Kaon:
3535  if(isKaon1 && isKaon2){
3536  /*
3537  fHist_Corr3p_Kaon_EP_Norm_NN[QAindex][0]->Fill(EvtCent, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0A), WgtEPKaon*fWgtCent);
3538  fHist_Corr3p_Kaon_EP_Norm_NN[QAindex][1]->Fill(EvtCent, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0C), WgtEPKaon*fWgtCent);
3539  fHist_Corr3p_Kaon_EP_Norm_NN[QAindex][2]->Fill(EvtCent, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNTPCA),WgtEPKaon*fWgtCent);
3540  fHist_Corr3p_Kaon_EP_Norm_NN[QAindex][3]->Fill(EvtCent, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNTPCC),WgtEPKaon*fWgtCent);
3541 
3542  //Differential:
3543  if(cIndex<6){
3544  fHist_Corr3p_Kaon_pTSum_EP_V0A_NN[QAindex][cIndex]->Fill((dPt1+dPt2)*0.5, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0A),WgtEPKaon*fWgtCent);
3545  fHist_Corr3p_Kaon_pTSum_EP_V0C_NN[QAindex][cIndex]->Fill((dPt1+dPt2)*0.5, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0C),WgtEPKaon*fWgtCent);
3546  fHist_Corr3p_Kaon_pTDiff_EP_V0A_NN[QAindex][cIndex]->Fill(TMath::Abs(dPt1-dPt2), TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0A),WgtEPKaon*fWgtCent);
3547  fHist_Corr3p_Kaon_pTDiff_EP_V0C_NN[QAindex][cIndex]->Fill(TMath::Abs(dPt1-dPt2), TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0C),WgtEPKaon*fWgtCent);
3548  fHist_Corr3p_Kaon_EtaDiff_EP_V0A_NN[QAindex][cIndex]->Fill(TMath::Abs(dEta1-dEta2), TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0A),WgtEPKaon*fWgtCent);
3549  fHist_Corr3p_Kaon_EtaDiff_EP_V0C_NN[QAindex][cIndex]->Fill(TMath::Abs(dEta1-dEta2), TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0C),WgtEPKaon*fWgtCent);
3550  }
3551  */
3552  }
3553  //Proton:
3554  if(isProton1 && isProton2){
3555  /*
3556  fHist_Corr3p_Proton_EP_Norm_NN[QAindex][0]->Fill(EvtCent, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0A), WgtEPProton*fWgtCent);
3557  fHist_Corr3p_Proton_EP_Norm_NN[QAindex][1]->Fill(EvtCent, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0C), WgtEPProton*fWgtCent);
3558  fHist_Corr3p_Proton_EP_Norm_NN[QAindex][2]->Fill(EvtCent, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNTPCA),WgtEPProton*fWgtCent);
3559  fHist_Corr3p_Proton_EP_Norm_NN[QAindex][3]->Fill(EvtCent, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNTPCC),WgtEPProton*fWgtCent);
3560 
3561  //Differential:
3562  if(cIndex<6){
3563  fHist_Corr3p_Proton_pTSum_EP_V0A_NN[QAindex][cIndex]->Fill((dPt1+dPt2)*0.5, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0A),WgtEPProton*fWgtCent);
3564  fHist_Corr3p_Proton_pTSum_EP_V0C_NN[QAindex][cIndex]->Fill((dPt1+dPt2)*0.5, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0C),WgtEPProton*fWgtCent);
3565  fHist_Corr3p_Proton_pTDiff_EP_V0A_NN[QAindex][cIndex]->Fill(TMath::Abs(dPt1-dPt2), TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0A),WgtEPProton*fWgtCent);
3566  fHist_Corr3p_Proton_pTDiff_EP_V0C_NN[QAindex][cIndex]->Fill(TMath::Abs(dPt1-dPt2), TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0C),WgtEPProton*fWgtCent);
3567  fHist_Corr3p_Proton_EtaDiff_EP_V0A_NN[QAindex][cIndex]->Fill(TMath::Abs(dEta1-dEta2), TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0A),WgtEPProton*fWgtCent);
3568  fHist_Corr3p_Proton_EtaDiff_EP_V0C_NN[QAindex][cIndex]->Fill(TMath::Abs(dEta1-dEta2), TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0C),WgtEPProton*fWgtCent);
3569  }
3570  */
3571  }
3572  //------------------------------------
3573  }
3574 
3575  //cout<<", passes 3 WgtEP = "<<WgtEP<<endl;
3576  }//-------- nested track loop ends ------------------
3577 
3578 
3579 
3580 
3581 
3582 
3583 
3584 
3585 
3586 
3587  //------------- Fill QA histograms ------------
3588  if(TMath::Abs(pVtxZ) < 8.0 && gCharge1 > 0){
3589 
3590  fQAEtaPhiAfterNUA->Fill(dPhi1,dEta1,w1NUA);
3591  /*
3592  if(isPion1){
3593  fQAEtaPhiAfterNUAPion->Fill(dPhi1,dEta1,wNUAPion1);
3594  }
3595  if(isKaon1){
3596  fQAEtaPhiAfterNUAKaon->Fill(dPhi1,dEta1,wNUAKaon1);
3597  }
3598  if(isProton1){
3599  fQAEtaPhiAfterNUAProton->Fill(dPhi1,dEta1,wNUAProton1);
3600  } */
3601  }
3602 
3603 
3604 
3605 
3606 
3607 
3608 
3609 
3610  //-------------- Fill NUA for PID tracks ----------------
3611  if(bFillNUAHistPID) {
3612 
3613  // Pion
3614  if(isPion1){
3615  if(gCharge1>0){
3616  fHist3DEtaPhiVz_Pos_Run[0][cForNUA]->Fill(pVtxZ,dPhi1,dEta1);
3617  }
3618  else if(gCharge1<0){
3619  fHist3DEtaPhiVz_Neg_Run[0][cForNUA]->Fill(pVtxZ,dPhi1,dEta1);
3620  }
3621  }
3622 
3623  // Kaon
3624  if(isKaon1){
3625  if(gCharge1>0){
3626  fHist3DEtaPhiVz_Pos_Run[1][cForNUA]->Fill(pVtxZ,dPhi1,dEta1);
3627  }
3628  else if(gCharge1<0){
3629  fHist3DEtaPhiVz_Neg_Run[1][cForNUA]->Fill(pVtxZ,dPhi1,dEta1);
3630  }
3631  }
3632 
3633  // proton
3634  if(isProton1){
3635  if(gCharge1>0){
3636  fHist3DEtaPhiVz_Pos_Run[2][cForNUA]->Fill(pVtxZ,dPhi1,dEta1);
3637  }
3638  else if(gCharge1<0){
3639  fHist3DEtaPhiVz_Neg_Run[2][cForNUA]->Fill(pVtxZ,dPhi1,dEta1);
3640  }
3641  }
3642 
3643  // Charged
3644  if(gCharge1>0){
3645  fHist3DEtaPhiVz_Pos_Run[3][cForNUA]->Fill(pVtxZ,dPhi1,dEta1);
3646  }
3647  else if(gCharge1<0){
3648  fHist3DEtaPhiVz_Neg_Run[3][cForNUA]->Fill(pVtxZ,dPhi1,dEta1);
3649  }
3650 
3651  }// Fill NUA for PID or not?
3652 
3653 
3654 
3655 
3656 
3657  //============ PID business starts here =============
3658 
3659  /*
3660  fHistEtaPtAfter->Fill(dEta1,dPt1);
3661 
3662  fHistTPCdEdxvsPAfter->Fill(mom*gCharge1,dEdx1);
3663 
3664  if(TOFmatch>0 && probMis < 0.01){
3665  fHistTOFBetavsPAfter->Fill(mom*gCharge1,beta);
3666  }
3667 
3668  //nSigTOFpion=fPIDResponse->NumberOfSigmasTOF(track, AliPID::kPion);
3669  //nSigTOFkaon=fPIDResponse->NumberOfSigmasTOF(track, AliPID::kKaon);
3670  //nSigTOFproton=fPIDResponse->NumberOfSigmasTOF(track, AliPID::kProton);
3671 
3672  fHistTOFMatchCount->Fill(TOFmatch+2,nSigTOFpion);
3673  fHistTOFMatchCount->Fill(TOFmatch+4,nSigTOFkaon);
3674  fHistTOFMatchCount->Fill(TOFmatch+6,nSigTOFproton);
3675 
3676  if(!TOFmatch || probMis > 0.01){ // I dont want mismatched track in my signal distribution
3677  nSigTOFpion = -99;
3678  nSigTOFkaon = -99;
3679  nSigTOFproton = -99;
3680  }
3681 
3682  //nSigTPCpion = fPIDResponse->NumberOfSigmasTPC(track, AliPID::kPion);
3683  //nSigTPCkaon = fPIDResponse->NumberOfSigmasTPC(track, AliPID::kKaon);
3684  //nSigTPCproton = fPIDResponse->NumberOfSigmasTPC(track, AliPID::kProton);
3685 
3686 
3687  // Fill only 3D nSigma TOF and TPC:
3688  //0=pi, 1=K, 2=Proton
3689  fHistTPCTOFnSigmavsPtAfter[0]->Fill(dPt1,nSigTPCpion,nSigTOFpion);
3690  fHistTPCTOFnSigmavsPtAfter[1]->Fill(dPt1,nSigTPCkaon,nSigTOFkaon);
3691  fHistTPCTOFnSigmavsPtAfter[2]->Fill(dPt1,nSigTPCproton,nSigTOFproton);
3692 
3693 
3694  // Fill nSigTOF for fixed nSigmaTPC Cut
3695  if(TMath::Abs(nSigTPCpion)<=fNSigmaCut){
3696  fHistTOFnSigmavsPtAfter[0]->Fill(dPt1*gCharge1,nSigTOFpion);
3697  fHistPtwithTPCNsigma[0]->Fill(dPt1*gCharge1);
3698  fHistTPCdEdxvsPtPIDAfter[0]->Fill(dPt1,dEdx1);
3699  if(TOFmatch>0 && probMis < 0.01 && beta>0.2){
3700  fHistPtwithTOFSignal[0]->Fill(dPt1*gCharge1);
3701  }
3702  }
3703  if(TMath::Abs(nSigTPCkaon)<=fNSigmaCut){
3704  fHistPtwithTPCNsigma[1]->Fill(dPt1*gCharge1);
3705  fHistTOFnSigmavsPtAfter[1]->Fill(dPt1*gCharge1,nSigTOFkaon);
3706  fHistTPCdEdxvsPtPIDAfter[1]->Fill(dPt1,dEdx1);
3707  if(TOFmatch>0 && probMis < 0.01 && beta>0.2){
3708  fHistPtwithTOFSignal[1]->Fill(dPt1*gCharge1);
3709  }
3710  }
3711  if(TMath::Abs(nSigTPCproton)<=fNSigmaCut){
3712  fHistPtwithTPCNsigma[2]->Fill(dPt1*gCharge1);
3713  fHistTOFnSigmavsPtAfter[2]->Fill(dPt1*gCharge1,nSigTOFproton);
3714  fHistTPCdEdxvsPtPIDAfter[2]->Fill(dPt1,dEdx1);
3715  if(TOFmatch>0 && probMis < 0.01 && beta>0.2){
3716  fHistPtwithTOFSignal[2]->Fill(dPt1*gCharge1);
3717  }
3718  }
3719 
3720 
3721  // Fill dEdx Histograms
3722  if(TMath::Abs(nSigTPCpion)<=fNSigmaCut){
3723  fHistPtwithTPCNsigma[0]->Fill(dPt1*gCharge1);
3724  fHistTPCdEdxvsPtPIDAfter[0]->Fill(dPt1,dEdx1);
3725  }
3726  if(TMath::Abs(nSigTPCkaon)<=fNSigmaCut){
3727  fHistPtwithTPCNsigma[1]->Fill(dPt1*gCharge1);
3728  fHistTPCdEdxvsPtPIDAfter[1]->Fill(dPt1,dEdx1);
3729  }
3730  if(TMath::Abs(nSigTPCproton)<=fNSigmaCut){
3731  fHistPtwithTPCNsigma[2]->Fill(dPt1*gCharge1);
3732  fHistTPCdEdxvsPtPIDAfter[2]->Fill(dPt1,dEdx1);
3733  }
3734 
3735 
3736 
3737  //========> nSigmaTOF distribution for circular cut <===============
3738  //if(TMath::Sqrt(nSigTPCpion*nSigTPCpion+nSigTOFpion*nSigTOFpion)<=fNSigmaCut){
3739  //fHistTOFnSigmavsPtAfter[0]->Fill(dPt1*gCharge1,nSigTOFpion);
3740  //if(TOFmatch>0 && probMis < 0.01 && beta>0.2){
3741  //fHistPtwithTOFSignal[0]->Fill(dPt1*gCharge1);
3742  //}
3743  //}
3744  //if(TMath::Sqrt(nSigTPCkaon*nSigTPCkaon+nSigTOFkaon*nSigTOFkaon)<=fNSigmaCut){
3745  //fHistTOFnSigmavsPtAfter[1]->Fill(dPt1*gCharge1,nSigTOFkaon);
3746  //if(TOFmatch>0 && probMis < 0.01 && beta>0.2){
3747  //fHistPtwithTOFSignal[1]->Fill(dPt1*gCharge1);
3748  //}
3749  //}
3750  //if(TMath::Sqrt(nSigTPCproton*nSigTPCproton+nSigTOFproton*nSigTOFproton)<=fNSigmaCut){
3751  //fHistTOFnSigmavsPtAfter[2]->Fill(dPt1*gCharge1,nSigTOFproton);
3752  //if(TOFmatch>0 && probMis < 0.01 && beta>0.2){
3753  //fHistPtwithTOFSignal[2]->Fill(dPt1*gCharge1);
3754  //}
3755  //}
3756 
3757 
3758  //------------------------------------------------------------
3759 
3760  // TOF matching is not needed from data as done by Davide using MC.
3761 
3762  if(!TOFmatch || probMis > 0.01 || beta>0.2) continue;
3763 
3764  // nSigmaTPC distribution for Fixed nSigmaTOF cut
3765  if(TMath::Abs(nSigTOFpion)<=fNSigmaCut){
3766  fHistTPCnSigmavsPtAfter[0]->Fill(dPt1*gCharge1,nSigTPCpion);
3767  fHistPtwithTOFmasscut[0]->Fill(dPt1*gCharge1);
3768  }
3769  if(TMath::Abs(nSigTOFkaon)<=fNSigmaCut){
3770  fHistTPCnSigmavsPtAfter[1]->Fill(dPt1*gCharge1,nSigTPCkaon);
3771  fHistPtwithTOFmasscut[1]->Fill(dPt1*gCharge1);
3772  }
3773  if(TMath::Abs(nSigTOFproton)<=fNSigmaCut){
3774  fHistTPCnSigmavsPtAfter[2]->Fill(dPt1*gCharge1,nSigTPCproton);
3775  fHistPtwithTOFmasscut[2]->Fill(dPt1*gCharge1);
3776  } */
3777 
3778 
3779 
3780  }
3781 //===================== track loop ends ============================
3782 
3783 
3784 
3785 
3786 
3787 
3788 
3789  //---------- TPC Event Planes -------
3790  //Sub events //
3791  sumTPCQn2x[0] = sumTPCQn2x[0]/SumWEtaNeg;
3792  sumTPCQn2y[0] = sumTPCQn2y[0]/SumWEtaNeg;
3793  sumTPCQn2x[1] = sumTPCQn2x[1]/SumWEtaPos;
3794  sumTPCQn2y[1] = sumTPCQn2y[1]/SumWEtaPos;
3795 
3796  sumTPCQn2x[2] = sumTPCQn2x[2]/SumWEtaFull;
3797  sumTPCQn2y[2] = sumTPCQn2y[2]/SumWEtaFull;
3798 
3799  /*
3800  sumTPCQn3x[0] = sumTPCQn3x[0]/SumWEtaNeg;
3801  sumTPCQn3y[0] = sumTPCQn3y[0]/SumWEtaNeg;
3802  sumTPCQn4x[0] = sumTPCQn4x[0]/SumWEtaNeg;
3803  sumTPCQn4y[0] = sumTPCQn4y[0]/SumWEtaNeg;
3804 
3805  sumTPCQn3x[1] = sumTPCQn3x[1]/SumWEtaPos;
3806  sumTPCQn3y[1] = sumTPCQn3y[1]/SumWEtaPos;
3807  sumTPCQn4x[1] = sumTPCQn4x[1]/SumWEtaPos;
3808  sumTPCQn4y[1] = sumTPCQn4y[1]/SumWEtaPos;
3809 
3810  sumTPCQn3x[2] = sumTPCQn3x[2]/SumWEtaFull;
3811  sumTPCQn3y[2] = sumTPCQn3y[2]/SumWEtaFull;
3812  sumTPCQn4x[2] = sumTPCQn4x[2]/SumWEtaFull;
3813  sumTPCQn4y[2] = sumTPCQn4y[2]/SumWEtaFull;
3814  */
3815 
3816  if(gPsiN==3){
3817  //Enable periodicity PsiN directly:
3818  PsiNTPCC = (1.0/gPsiN)*( TMath::ATan2(sumTPCQn2y[0],sumTPCQn2x[0]) + TMath::Pi() ) ; // negetive eta
3819  PsiNTPCA = (1.0/gPsiN)*( TMath::ATan2(sumTPCQn2y[1],sumTPCQn2x[1]) + TMath::Pi() ) ; // positive eta
3820  PsiNTPCF = (1.0/gPsiN)*( TMath::ATan2(sumTPCQn2y[2],sumTPCQn2x[2]) + TMath::Pi() ) ; // FUll TPC eta
3821  }
3822  else{
3823  PsiNTPCC = (1.0/gPsiN)*( TMath::ATan2(sumTPCQn2y[0],sumTPCQn2x[0]) ) ; // negetive eta
3824  if(PsiNTPCC<0.) PsiNTPCC += 2*TMath::Pi()/gPsiN;
3825  PsiNTPCA = (1.0/gPsiN)*( TMath::ATan2(sumTPCQn2y[1],sumTPCQn2x[1]) ) ; // positive eta
3826  if(PsiNTPCA<0.) PsiNTPCA += 2*TMath::Pi()/gPsiN;
3827  PsiNTPCF = (1.0/gPsiN)*( TMath::ATan2(sumTPCQn2y[2],sumTPCQn2x[2]) ) ; // FUll TPC eta
3828  if(PsiNTPCF<0.) PsiNTPCF += 2*TMath::Pi()/gPsiN;
3829  }
3830 
3831  fHTPCAEventPlaneVsCent->Fill(EvtCent,PsiNTPCA);
3832  fHTPCCEventPlaneVsCent->Fill(EvtCent,PsiNTPCC);
3833  fHTPCEventPlaneVsCent->Fill(EvtCent, PsiNTPCF);
3834 
3835 
3836 
3837 
3838 
3839  //-------------- vs Centrality -----------------
3840  //V0A-V0C
3841  fHist_Reso2n_EP_Norm_Det[QAindex][0]->Fill(EvtCent, TMath::Cos(gPsiN*(PsiNV0A-PsiNV0C)), fWgtCent);
3842  //V0A-TPC
3843  fHist_Reso2n_EP_Norm_Det[QAindex][1]->Fill(EvtCent, TMath::Cos(gPsiN*(PsiNV0A-PsiNTPCF)), fWgtCent);
3844  //V0C-TPC
3845  fHist_Reso2n_EP_Norm_Det[QAindex][2]->Fill(EvtCent, TMath::Cos(gPsiN*(PsiNV0C-PsiNTPCF)), fWgtCent);
3846  //TPCa -TPCc
3847  fHist_Reso2n_EP_Norm_Det[QAindex][3]->Fill(EvtCent, TMath::Cos(gPsiN*(PsiNTPCA-PsiNTPCC)), fWgtCent);
3848 
3849  //-------------- vs Refmult -----------------
3850  /*
3851  //V0A-V0C
3852  fHist_Reso2n_EP_Refm_Det[QAindex][0]->Fill(RefMultCorrFB, TMath::Cos(gPsiN*(PsiNV0A-PsiNV0C)), fWgtCent);
3853  //V0A-TPC
3854  fHist_Reso2n_EP_Refm_Det[QAindex][1]->Fill(RefMultCorrFB, TMath::Cos(gPsiN*(PsiNV0A-PsiNTPCF)), fWgtCent);
3855  //V0C-TPC
3856  fHist_Reso2n_EP_Refm_Det[QAindex][2]->Fill(RefMultCorrFB, TMath::Cos(gPsiN*(PsiNV0C-PsiNTPCF)), fWgtCent);
3857  //TPCa -TPCc
3858  fHist_Reso2n_EP_Refm_Det[QAindex][3]->Fill(RefMultCorrFB, TMath::Cos(gPsiN*(PsiNTPCA-PsiNTPCC)), fWgtCent);
3859  */
3860 
3861 
3862 
3863 
3864 
3865  //--------- Store TPC-Qn for Recenter ---------
3866  fTPCAQ2xVsCentRun->Fill(EvtCent,sumTPCQn2x[0]);
3867  fTPCAQ2yVsCentRun->Fill(EvtCent,sumTPCQn2y[0]);
3868  fTPCCQ2xVsCentRun->Fill(EvtCent,sumTPCQn2x[1]);
3869  fTPCCQ2yVsCentRun->Fill(EvtCent,sumTPCQn2y[1]);
3870 
3871  fTPCFQ2xVsCentRun->Fill(EvtCent,sumTPCQn2x[2]);
3872  fTPCFQ2yVsCentRun->Fill(EvtCent,sumTPCQn2y[2]);
3873  /*
3874  fTPCAQ3xVsCentRun->Fill(EvtCent,sumTPCQn3x[0]);
3875  fTPCAQ3yVsCentRun->Fill(EvtCent,sumTPCQn3y[0]);
3876  fTPCCQ3xVsCentRun->Fill(EvtCent,sumTPCQn3x[1]);
3877  fTPCCQ3yVsCentRun->Fill(EvtCent,sumTPCQn3y[1]);
3878 
3879  fTPCAQ4xVsCentRun->Fill(EvtCent,sumTPCQn4x[0]);
3880  fTPCAQ4yVsCentRun->Fill(EvtCent,sumTPCQn4y[0]);
3881  fTPCCQ4xVsCentRun->Fill(EvtCent,sumTPCQn4x[1]);
3882  fTPCCQ4yVsCentRun->Fill(EvtCent,sumTPCQn4y[1]);
3883  */
3884 
3885 
3886 
3887 
3888 
3889 
3890 
3891 
3892 
3893 
3894 
3895  PostData(1,fListHist);
3896 
3897  fHistEventCount->Fill(14.5); //15th bin is last one
3898  stepCount++;
3899 
3900 
3901 
3902 
3903 
3904 
3905  //if(multPOI2nd!=(multPOI1st-1))
3906  //cout<<"mismatched "<< "\tPOIs1st = "<<multPOI1st<<"\tPOIs2nd = "<<multPOI2nd <<" for Event = "<<fEventCount<<endl;
3907 
3908  //if(multPOI1st!=multEtaFull)
3909  //cout<<"\n Mismatched track "<< "\t multEtaFull = "<<multEtaFull<<"\tPOIs1st = "<<multPOI1st<<" for Event = "<<fEventCount<<endl;
3910 
3911  //if(fEventCount%10==0)
3912  //cout<<"Ev = "<<fEventCount<<"\tMult = "<<multEtaFull<<"\tPOIs1st = "<<multPOI1st<<"\t POI2nd = "<< multPOI2nd <<endl;
3913 
3914  //if(multEtaFull>500)
3915  //cout<<"Ev = "<<fEventCount<<" ntracks = "<<ntracks<<"\tMult = "<<multEtaFull<<"\t RealTime = "<<watch.RealTime()<<"\t CPUTime = "<< watch.CpuTime() <<endl;
3916  //cout<<"Ev = "<<fEventCount<<" cent = "<<EvtCent<<"\tWEtaNeg = "<<SumWEtaNeg<<"\tnegMult = "<<multEtaNeg<<"\tWEtaPos = "<<SumWEtaPos<<"\tposMult = "<<multEtaPos<<endl;
3917  //watch.Stop();
3918 
3919 }//================ UserExec ==============
3920 
3921 
3922 
3923 
3924 
3925 
3926 
3927 
3928 
3929 
3930 
3931 
3932 
3933 
3934 
3935 
3936 
3937 
3938 
3939 
3940 
3941 
3943 
3944 
3945 
3946 
3947 double AliAnalysisTaskCMEV0PID::GetWDist(const AliVVertex* v0, const AliVVertex* v1)
3948 {
3949  // calculate sqrt of weighted distance to other vertex
3950  if (!v0 || !v1) {
3951  AliDebug(2,"\n\n ::GetWDist => One of vertices is not valid\n\n");
3952  return 0;
3953  }
3954  static TMatrixDSym vVb(3);
3955  double dist = -1;
3956  double dx = v0->GetX()-v1->GetX();
3957  double dy = v0->GetY()-v1->GetY();
3958  double dz = v0->GetZ()-v1->GetZ();
3959  double cov0[6],cov1[6];
3960  v0->GetCovarianceMatrix(cov0);
3961  v1->GetCovarianceMatrix(cov1);
3962  vVb(0,0) = cov0[0]+cov1[0];
3963  vVb(1,1) = cov0[2]+cov1[2];
3964  vVb(2,2) = cov0[5]+cov1[5];
3965  vVb(1,0) = vVb(0,1) = cov0[1]+cov1[1];
3966  vVb(0,2) = vVb(1,2) = vVb(2,0) = vVb(2,1) = 0.;
3967  vVb.InvertFast();
3968  if (!vVb.IsValid()) {
3969  AliDebug(2,"Singular Matrix\n");
3970  return dist;
3971  }
3972  dist = vVb(0,0)*dx*dx + vVb(1,1)*dy*dy + vVb(2,2)*dz*dz
3973  + 2*vVb(0,1)*dx*dy + 2*vVb(0,2)*dx*dz + 2*vVb(1,2)*dy*dz;
3974  return dist>0 ? TMath::Sqrt(dist) : -1;
3975 }
3976 
3977 
3979  { // check for multi-vertexer pile-up
3980  const int kMinPlpContrib = 5;
3981  const double kMaxPlpChi2 = 5.0;
3982  const double kMinWDist = 15;
3983 
3984  const AliVVertex* vtPrm = 0;
3985  const AliVVertex* vtPlp = 0;
3986 
3987  int nPlp = 0;
3988 
3989  if(!(nPlp=faod->GetNumberOfPileupVerticesTracks()))
3990  return kFALSE;
3991 
3992  vtPrm = faod->GetPrimaryVertex();
3993  if(vtPrm == faod->GetPrimaryVertexSPD())
3994  return kTRUE; // there are pile-up vertices but no primary
3995 
3996  //int bcPrim = vtPrm->GetBC();
3997 
3998  for(int ipl=0;ipl<nPlp;ipl++) {
3999  vtPlp = (const AliVVertex*)faod->GetPileupVertexTracks(ipl);
4000  if (vtPlp->GetNContributors() < kMinPlpContrib) continue;
4001  if (vtPlp->GetChi2perNDF() > kMaxPlpChi2) continue;
4002  //int bcPlp = vtPlp->GetBC();
4003  //if (bcPlp!=AliVTrack::kTOFBCNA && TMath::Abs(bcPlp-bcPrim)>2)
4004  // return kTRUE; // pile-up from other BC
4005 
4006  double wDst = GetWDist(vtPrm,vtPlp);
4007  if (wDst<kMinWDist) continue;
4008 
4009  return kTRUE; // pile-up: well separated vertices
4010  }
4011  return kFALSE;
4012 }
4013 
4014 
4015 
4017  /*if(bApplyMCcorr){
4018  if(!gGrid){
4019  TGrid::Connect("alien://");
4020  }
4021  if(!mfileFBHijing){
4022  mfileFBHijing = TFile::Open(sMCfilePath,"READ");
4023  fListFBHijing = dynamic_cast<TList*>(mfileFBHijing->FindObjectAny("fMcEffiHij")); */
4024 
4025  if(fListFBHijing) {
4026  cout<<"\n =========> Info: Using MC efficiency correction Map <=========== "<<endl;
4027  for(int i=0;i<10;i++) {
4028  fFB_Efficiency_Cent[i] = (TH1D *) fListFBHijing->FindObject(Form("eff_unbiased_%d",i));
4029  }
4030  //PID :
4031  for(int i=0;i<10;i++) {
4032  fFB_Efficiency_Pion_Cent[i] = (TH1D *) fListFBHijing->FindObject(Form("eff_unbiased_Pion_%d",i));
4033  fFB_Efficiency_Kaon_Cent[i] = (TH1D *) fListFBHijing->FindObject(Form("eff_unbiased_Kaon_%d",i));
4034  //fFB_Efficiency_Proton_Cent[i] = (TH1D *) fListFBHijing->FindObject(Form("eff_unbiased_Proton_%d",i));
4035  fFB_Efficiency_Proton_Pos_Cent[i] = (TH1D *) fListFBHijing->FindObject(Form("eff_unbiased_ProtonPos_%d",i));
4036  fFB_Efficiency_Proton_Neg_Cent[i] = (TH1D *) fListFBHijing->FindObject(Form("eff_unbiased_ProtonNeg_%d",i));
4037  }
4038 
4039  //------- Fill the flags: --------------
4041  fHistTaskConfigParameters->SetBinContent(19,1);
4042  }
4044  fHistTaskConfigParameters->SetBinContent(20,1);
4045  }
4047  fHistTaskConfigParameters->SetBinContent(21,1);
4048  }
4050  fHistTaskConfigParameters->SetBinContent(22,1);
4051  }
4052  }
4053  else if(!fListFBHijing){
4054  std::cout<<"\n\n !!!!**** Warning: FB Efficiency File/List not found Use Weight = 1.0 *****\n\n"<<std::endl;
4055  //exit(1);
4056  }
4057 }
4058 
4059 
4060 
4061 
4063 
4064  Int_t cIndex = 0;
4065 
4066  if(fCent<5.0) {
4067  cIndex = 0;
4068  }
4069  else if(fCent>=5.0 && fCent<10){
4070  cIndex = 1;
4071  }
4072  else if(fCent>=10.0) {
4073  cIndex = abs(fCent/10.0)+1;
4074  }
4075  return cIndex;
4076 }
4077 
4079  //std::cout<<" centrality outlier function called "<<std::endl;
4080  Float_t fMeanTPC[100] = {2902.95,2758.33,2642.78,2536.67,2435.37,2340.06,2248.44,2163.71,2080.49,2001.54,1925.86,1852.64,1781.97,1715.56,1650.53,1587.23,1527.51,1468.19,1412.73,1357.86,1305.35,1254.33,1205.57,1157.28,1111.53,1066.42,1023.15,981.594,940.795,901.766,863.651,826.183,790.53,756.358,722.654,690.513,659.443,628.807,599.748,571.664,544.446,518.042,492.369,468.072,444.694,422.487,400.104,379.129,359.147,339.62,320.817,302.788,285.791,269.015,253.688,238.671,224.039,209.932,196.915,184.647,172.76,161.381,150.395,140.288,131.033,121.58,113.112,104.938,97.3078,90.2178,83.5974,77.2645,70.7126,65.4424,60.1404,55.5644,50.8314,46.3761,43.024,38.625,35.3435,32.2304,29.4192,26.821,24.3303,21.9332,19.4215,16.7163,14.9414,13.1092,0.};
4081 
4082  Float_t fSigmaTPC[100] = {122.209,107.901,103.452,100.498,97.7403,94.7845,93.2543,90.0548,88.1106,85.7382,84.0812,82.2978,80.3817,78.6002,77.3448,75.5086,73.6842,71.9733,70.3447,69.1999,67.878,66.3511,65.0406,63.4866,62.4409,60.7899,59.1328,58.426,56.8618,55.8871,54.1031,53.4959,52.0482,51.0441,49.6218,48.7646,47.5166,46.5247,45.0727,44.4311,43.4531,42.0404,41.0238,40.1384,39.2588,38.2461,36.5951,36.0552,35.3727,33.7883,32.7167,32.4486,31.3709,30.3444,29.505,28.5139,27.4471,26.5359,25.9506,25.127,24.3797,23.2985,22.279,21.4698,20.781,20.8193,19.9509,18.8036,17.9145,16.961,16.7375,15.852,14.9324,14.7663,13.5969,13.4533,12.3067,12.7835,11.7283,10.6758,10.6676,10.6492,9.04614,8.89065,8.66093,8.50997,7.98812,6.91087,7.12045,7.29593,0.};
4083 
4084  for(int i=0;i<90;i++) {
4085  hCentvsTPCmultCuts->SetBinContent(i+1,1,fMeanTPC[i]);
4086  hCentvsTPCmultCuts->SetBinContent(i+1,2,fSigmaTPC[i]);
4087  }
4088 }
4089 
4090 
4091 
4092 
4093 
4094 
4096 
4097  fHistTaskConfigParameters = new TH1F("fHistTaskConfigParameters","Task parameters",25,0,25);
4098  fHistTaskConfigParameters->GetXaxis()->SetBinLabel(1,"FilterBit");
4099  fHistTaskConfigParameters->SetBinContent(1,fFilterBit);
4100  fHistTaskConfigParameters->GetXaxis()->SetBinLabel(2,"n#sigmaTPC");
4101  fHistTaskConfigParameters->SetBinContent(2,fNSigmaCut);
4102  fHistTaskConfigParameters->GetXaxis()->SetBinLabel(3,"MinPt");
4103  fHistTaskConfigParameters->SetBinContent(3,fMinPtCut);
4104  fHistTaskConfigParameters->GetXaxis()->SetBinLabel(4,"MaxPt");
4105  fHistTaskConfigParameters->SetBinContent(4,fMaxPtCut);
4106  fHistTaskConfigParameters->GetXaxis()->SetBinLabel(5,"MinEta");
4107  fHistTaskConfigParameters->SetBinContent(5,fMinEtaCut);
4108  fHistTaskConfigParameters->GetXaxis()->SetBinLabel(6,"MaxEta");
4109  fHistTaskConfigParameters->SetBinContent(6,fMaxEtaCut);
4110 
4111  fHistTaskConfigParameters->GetXaxis()->SetBinLabel(11,"CentralityMin");
4113  fHistTaskConfigParameters->GetXaxis()->SetBinLabel(12,"CentralityMax");
4115 
4116  fHistTaskConfigParameters->GetXaxis()->SetBinLabel(13,"VertexMin(cm)");
4117  fHistTaskConfigParameters->GetXaxis()->SetBinLabel(14,"VertexMax(cm)");
4118 
4119 
4120  fHistTaskConfigParameters->GetXaxis()->SetBinLabel(15,"NUA Charge");
4121  fHistTaskConfigParameters->GetXaxis()->SetBinLabel(16,"NUA Pion");
4122  fHistTaskConfigParameters->GetXaxis()->SetBinLabel(17,"NUA Kaon");
4123  fHistTaskConfigParameters->GetXaxis()->SetBinLabel(18,"NUA Proton");
4124 
4125  fHistTaskConfigParameters->GetXaxis()->SetBinLabel(19,"MC Charge");
4126  fHistTaskConfigParameters->GetXaxis()->SetBinLabel(20,"MC Pion");
4127  fHistTaskConfigParameters->GetXaxis()->SetBinLabel(21,"MC Kaon");
4128  fHistTaskConfigParameters->GetXaxis()->SetBinLabel(22,"MC Proton");
4129 
4130  fHistTaskConfigParameters->GetXaxis()->SetBinLabel(23,"V0 Gain Eq.");
4131  fHistTaskConfigParameters->GetXaxis()->SetBinLabel(24,"V0 Qn Recenter");
4132 
4133 
4135 
4136 
4137 
4138  fHistPileUpCount = new TH1F("fHistPileUpCount", "fHistPileUpCount", 15, 0., 15.);
4139  fHistPileUpCount->GetXaxis()->SetBinLabel(1,"plpMV");
4140  fHistPileUpCount->GetXaxis()->SetBinLabel(2,"fromSPD");
4141  fHistPileUpCount->GetXaxis()->SetBinLabel(3,"RefMultComb08");
4142  fHistPileUpCount->GetXaxis()->SetBinLabel(4,"IncompleteDAQ");
4143  fHistPileUpCount->GetXaxis()->SetBinLabel(5,"abs(V0M-CL1)>5.0");
4144  fHistPileUpCount->GetXaxis()->SetBinLabel(6,"missingVtx");
4145  fHistPileUpCount->GetXaxis()->SetBinLabel(7,"inconsistentVtx");
4146  Int_t puConst = fPileUpConstParm;
4147  fHistPileUpCount->GetXaxis()->SetBinLabel(8,Form("multESDTPCDif>%d",puConst));
4148  fHistPileUpCount->GetXaxis()->SetBinLabel(9,Form("multGlobTPCDif>%d",puConst));
4149  fHistPileUpCount->GetXaxis()->SetBinLabel(10,"PileUpMultSelTask");
4151 
4152 
4153  fHistMultSelPUCount = new TH1F("fHistMultSelPileUpCount", "no of PU Event from MultSelTask", 10, 0., 10);
4154  fHistMultSelPUCount->GetXaxis()->SetBinLabel(1,"PileUp");
4155  fHistMultSelPUCount->GetXaxis()->SetBinLabel(2,"PileUpMV");
4156  fHistMultSelPUCount->GetXaxis()->SetBinLabel(3,"PileUpMultBins");
4157  fHistMultSelPUCount->GetXaxis()->SetBinLabel(4,"InconsistentVtx");
4158  fHistMultSelPUCount->GetXaxis()->SetBinLabel(5,"TrackletVsCluster");
4159  fHistMultSelPUCount->GetXaxis()->SetBinLabel(6,"IncompleteDAQ");
4160  fHistMultSelPUCount->GetXaxis()->SetBinLabel(7,"NotGoodVertex2016");
4162 
4163 
4164  fHistEventCount = new TH1F("fHistEventCount","Event counts",15,0,15);
4165  fHistEventCount->GetXaxis()->SetBinLabel(1,"Called UserExec()");
4166  fHistEventCount->GetXaxis()->SetBinLabel(2,"Called Exec()");
4167  fHistEventCount->GetXaxis()->SetBinLabel(3,"AOD Exist");
4168  fHistEventCount->GetXaxis()->SetBinLabel(4,"Vz < 10");
4169  fHistEventCount->GetXaxis()->SetBinLabel(5,Form("%2.0f<Cent<%2.0f",fCentralityPercentMin,fCentralityPercentMax));
4170  fHistEventCount->GetXaxis()->SetBinLabel(6,"noAODtrack > 2 ");
4171  fHistEventCount->GetXaxis()->SetBinLabel(7,"TPC vs Global");
4172  fHistEventCount->GetXaxis()->SetBinLabel(8,"TPC128 vs ESD");
4173  fHistEventCount->GetXaxis()->SetBinLabel(9,"Cent vs TPC");
4174  fHistEventCount->GetXaxis()->SetBinLabel(10,"mult eta+/- > 2");
4175  fHistEventCount->GetXaxis()->SetBinLabel(11,"centCL1 < 90");
4176  fHistEventCount->GetXaxis()->SetBinLabel(15,"Survived Events");
4177  fListHist->Add(fHistEventCount);
4178 
4179  //fHistEventCount->Fill(1);
4180 
4181 }
4182 
4183 
4184 
4185 
4186 
4188 {
4189  /*
4190  TList *fListAppliedV0Corr = new TList();
4191  fListAppliedV0Corr->SetName("fListAppliedV0Corr");
4192  fListAppliedV0Corr->SetOwner(kTRUE);
4193  fListHist->Add(fListAppliedV0Corr);*/ // to be Tested later.
4194 
4195  if(fListV0MCorr){
4196  fHCorrectV0M = (TH1D *) fListV0MCorr->FindObject(Form("fHistV0Gain_Run%d",run));
4197  fHAvgerageQnV0A = (TH2D *) fListV0MCorr->FindObject(Form("fHistAvgQnV0A_Run%d",run));
4198  fHAvgerageQnV0C = (TH2D *) fListV0MCorr->FindObject(Form("fHistAvgQnV0C_Run%d",run));
4199 
4200  //Now the wgts for centrality is added inside VOM gain file.
4201  fHCentWeightForRun = (TH1D *) fListV0MCorr->FindObject(Form("fHistCentWeight_Run%d",run));
4202 
4203  if(fHCentWeightForRun){
4204  cout<<"\n =========== Info:: Using Centrality wgts for run = "<<run<<"============"<<endl;
4205  }
4206  else{
4207  cout<<"\n =========== Info:: No Centrality wgt. correction.!! for run = "<<run<<"============"<<endl;
4208  }
4209 
4210  if(fHCorrectV0M){
4211  cout<<"\n =========== Info:: Setting up V0 gain correction for run = "<<run<<"============"<<endl;
4212  fHistTaskConfigParameters->SetBinContent(23,1);
4213  }
4214  else{
4215  cout<<"\n =========== Info:: No V0 gain correction..!!! for run = "<<run<<"============"<<endl;
4216  }
4218  cout<<"\n =========== Info:: Setting up V0 <Qn> recentering for run = "<<run<<"============"<<endl;
4219  fHistTaskConfigParameters->SetBinContent(24,1);
4220  }
4221  else{
4222  cout<<"\n =========== Info:: No V0 <Qn> recentering..!!! for run = "<<run<<"============"<<endl;
4223  }
4224  }
4225  else{
4226  cout<<"\n ======== !!!! Error:: List For V0-Gain and Qn not found for run "<<run<<"============"<<endl;
4227  }
4228 
4229 }
4230 
4231 
4232 
4233 
4234 
4235 
4236 
4238 {
4239 
4240  if(fListNUACorr){
4241  for(int i=0;i<5;i++){
4242  fHCorrectNUApos[i] = (TH3D *) fListNUACorr->FindObject(Form("fHist_NUA_VzPhiEta_Pos_Cent%d_Run%d",i,run));
4243  fHCorrectNUAneg[i] = (TH3D *) fListNUACorr->FindObject(Form("fHist_NUA_VzPhiEta_Neg_Cent%d_Run%d",i,run));
4244  }
4245  if(fHCorrectNUApos[3] && fHCorrectNUAneg[3]){
4246  cout<<"\n=========== Info:: Setting up NUA corrections for run "<<run<<"============"<<endl;
4247  fHistTaskConfigParameters->SetBinContent(15,1);
4248  }
4249  }
4250  else {
4251  printf("\n ******** Warning: No NUA Correction for Charge Particle in run %d, Use Wgt = 1.0 ********* \n",run);
4252  //Do not allocate memory:
4253  /*
4254  for(int i=0;i<5;i++){
4255  fHCorrectNUApos[i] = new TH3D(Form("fHCorrectNUApos_cent%d",i),"",1,-10,10,1,0,6.284,1,-0.9,0.9);
4256  fHCorrectNUAneg[i] = new TH3D(Form("fHCorrectNUAneg_cent%d",i),"",1,-10,10,1,0,6.284,1,-0.9,0.9);
4257  fHCorrectNUApos[i]->SetBinContent(1,1,1,1.0);
4258  fHCorrectNUAneg[i]->SetBinContent(1,1,1,1.0);
4259  //exit(1);
4260  }*/
4261  }
4262 
4263  //=================== PID: ==========================
4264  if(fListNUACorr){
4265  for(int i=0;i<5;i++){
4266  fHCorrectNUAposPion[i] = (TH3D *) fListNUACorr->FindObject(Form("fHist_NUA_VzPhiEta_Pion_Pos_Cent%d_Run%d",i,run)); //
4267  fHCorrectNUAnegPion[i] = (TH3D *) fListNUACorr->FindObject(Form("fHist_NUA_VzPhiEta_Pion_Neg_Cent%d_Run%d",i,run));
4268  if(fHCorrectNUAposPion[3] && fHCorrectNUAnegPion[3]) fHistTaskConfigParameters->SetBinContent(16,1);
4269 
4270  fHCorrectNUAposKaon[i] = (TH3D *) fListNUACorr->FindObject(Form("fHist_NUA_VzPhiEta_Kaon_Pos_Cent%d_Run%d",i,run)); //
4271  fHCorrectNUAnegKaon[i] = (TH3D *) fListNUACorr->FindObject(Form("fHist_NUA_VzPhiEta_Kaon_Neg_Cent%d_Run%d",i,run));
4272  if(fHCorrectNUAposKaon[3] && fHCorrectNUAnegKaon[3]) fHistTaskConfigParameters->SetBinContent(17,1);
4273 
4274  fHCorrectNUAposProton[i] = (TH3D *) fListNUACorr->FindObject(Form("fHist_NUA_VzPhiEta_Proton_Pos_Cent%d_Run%d",i,run));
4275  fHCorrectNUAnegProton[i] = (TH3D *) fListNUACorr->FindObject(Form("fHist_NUA_VzPhiEta_Proton_Neg_Cent%d_Run%d",i,run));
4276  if(fHCorrectNUAposProton[3] && fHCorrectNUAnegProton[3]) fHistTaskConfigParameters->SetBinContent(18,1);
4277  }
4279  cout<<"\n=========== Info:: Setting up --> PID NUA corrections for run = "<<run<<"============"<<endl;
4280  }
4281  else{
4282  cout<<"\n=========== WARNING :: PID NUA corrections NOT found for run = "<<run<<"============"<<endl;
4283  }
4284  }
4285  else {
4286  printf("\n ******** Error/Warning: No NUA Correction found for PID for run %d, Use PID Wgt = 1.0 ********* \n",run);
4287  /*
4288  for(int i=0;i<5;i++){
4289  fHCorrectNUAposPion[i] = new TH3D(Form("fHCorrectNUAPionpos_cent%d",i),"",1,-10,10,1,0,6.284,1,-0.9,0.9);
4290  fHCorrectNUAposPion[i] = new TH3D(Form("fHCorrectNUAPionneg_cent%d",i),"",1,-10,10,1,0,6.284,1,-0.9,0.9);
4291  fHCorrectNUAposPion[i]->SetBinContent(1,1,1,1.0);
4292  fHCorrectNUAposPion[i]->SetBinContent(1,1,1,1.0);
4293 
4294  fHCorrectNUAposKaon[i] = new TH3D(Form("fHCorrectNUAKaonpos_cent%d",i),"",1,-10,10,1,0,6.284,1,-0.9,0.9);
4295  fHCorrectNUAposKaon[i] = new TH3D(Form("fHCorrectNUAKaonneg_cent%d",i),"",1,-10,10,1,0,6.284,1,-0.9,0.9);
4296  fHCorrectNUAposKaon[i]->SetBinContent(1,1,1,1.0);
4297  fHCorrectNUAposKaon[i]->SetBinContent(1,1,1,1.0);
4298 
4299  fHCorrectNUAposProton[i] = new TH3D(Form("fHCorrectNUAProtonpos_cent%d",i),"",1,-10,10,1,0,6.284,1,-0.9,0.9);
4300  fHCorrectNUAposProton[i] = new TH3D(Form("fHCorrectNUAProtonneg_cent%d",i),"",1,-10,10,1,0,6.284,1,-0.9,0.9);
4301  fHCorrectNUAposProton[i]->SetBinContent(1,1,1,1.0);
4302  fHCorrectNUAposProton[i]->SetBinContent(1,1,1,1.0);
4303  //exit(1);
4304  }*/
4305  }
4306 
4307 }
4308 
TProfile * fHist_Corr3p_pTSum_EP_V0C_PP[2][6]
TProfile * fHist_Corr3p_Pion_pTDiff_EP_V0A_NN[2][6]
TProfile * fHist_Corr3p_EP_Refm_NN[2][4]
TProfile * fHist_Corr3p_Pion_pTDiff_EP_V0C_PP[2][6]
TProfile * fHist_Corr3p_Proton_EtaDiff_EP_V0A_PP[2][6]
TProfile * fHist_Corr3p_Proton_EP_Refm_PN[2][4]
TProfile * fHist_Corr3p_Kaon_pTSum_EP_V0A_PP[2][6]
TProfile * fHist_Corr3p_Kaon_EP_Refm_NN[2][4]
TProfile * fHist_Corr3p_Pion_pTSum_EP_V0C_PP[2][6]
Int_t GetCentralityScaled0to10(Double_t fCent)
double Double_t
Definition: External.C:58
TProfile * fHist_Corr3p_Kaon_pTDiff_EP_V0C_PN[2][6]
Definition: External.C:260
TProfile * fHist_Corr3p_Kaon_EtaDiff_EP_V0A_PN[2][6]
TH2D * fHAvgerageQnV0A
To read Gain Correction file.
TProfile * fHist_Corr3p_pTDiff_EP_V0C_PP[2][6]
TProfile * fHist_Corr3p_Kaon_pTSum_EP_V0C_NN[2][6]
Definition: External.C:236
const char * title
Definition: MakeQAPdf.C:27
TProfile * fHist_Corr3p_Kaon_EP_Norm_PP[2][4]
TProfile * fHist_Corr3p_pTSum_EP_V0A_PN[2][6]
TProfile * fHist_Corr3p_pTSum_EP_V0C_NN[2][6]
TProfile * fHist_Corr3p_Pion_EtaDiff_EP_V0A_PN[2][6]
TProfile * fHist_Corr3p_Proton_EP_Norm_NN[2][4]
TProfile * fHist_Corr3p_Kaon_EtaDiff_EP_V0A_PP[2][6]
AliMultSelection * fMultSelection
PID response Handler.
centrality
TProfile * fHist_Corr3p_Kaon_EP_Norm_PN[2][4]
char Char_t
Definition: External.C:18
TProfile * fHist_Corr3p_EtaDiff_EP_V0A_PN[2][6]
TH1F * fHistPtwithTPCNsigma[3]
last in the list
TProfile * fHist_Reso2n_EP_Norm_Det[2][4]
TProfile * fHist_Corr3p_Pion_EtaDiff_EP_V0C_PP[2][6]
TH1D * fFB_Efficiency_Pion_Cent[10]
for charge
TProfile * fHist_Corr3p_Pion_pTDiff_EP_V0A_PP[2][6]
TProfile * fHist_Corr3p_Pion_pTSum_EP_V0C_PN[2][6]
TProfile * fHist_Corr3p_Proton_pTSum_EP_V0C_PN[2][6]
TProfile * fHist_Corr3p_Proton_pTSum_EP_V0A_NN[2][6]
TProfile * fHist_Corr3p_Kaon_pTDiff_EP_V0C_NN[2][6]
TH2F * fHistEtaPtAfter
Eta-Pt acceptance.
TProfile * fHist_Corr3p_EP_Norm_NN[2][4]
TProfile * fHist_Corr3p_pTDiff_EP_V0C_PN[2][6]
TProfile * fHist_Corr3p_Proton_pTDiff_EP_V0C_NN[2][6]
TProfile * fHist_Corr3p_EtaDiff_EP_V0C_PP[2][6]
TH3D * fHCorrectNUAnegProton[5]
5 centrality bin, read NUA from file
TProfile * fHist_Corr3p_Proton_pTSum_EP_V0C_NN[2][6]
TProfile * fHist_Corr3p_Proton_pTDiff_EP_V0C_PP[2][6]
TProfile * fHist_Corr3p_Pion_pTDiff_EP_V0A_PN[2][6]
TH3D * fHCorrectNUAposPion[5]
5 centrality bin, read NUA from file
TProfile * fHist_Corr3p_Proton_EtaDiff_EP_V0C_PP[2][6]
TH1F * fCentDistAfter
without PileUp cut
TProfile * fHist_Corr3p_Pion_EP_Norm_PP[2][4]
TH3D * fHCorrectNUAnegPion[5]
5 centrality bin, read NUA from file
TProfile * fHist_Corr3p_Proton_EtaDiff_EP_V0A_NN[2][6]
TProfile * fHist_Corr3p_Kaon_pTSum_EP_V0A_PN[2][6]
TProfile * fHist_Corr3p_Pion_pTSum_EP_V0C_NN[2][6]
TProfile * fHist_Corr3p_EtaDiff_EP_V0A_NN[2][6]
TProfile * fHist_Corr3p_pTSum_EP_V0C_PN[2][6]
TH1D * fHCentWeightForRun
V0C Average <Qn>, n=2,3.
TProfile * fHist_Corr3p_EtaDiff_EP_V0A_PP[2][6]
int Int_t
Definition: External.C:63
TProfile * fHist_Corr3p_Kaon_pTSum_EP_V0C_PP[2][6]
float Float_t
Definition: External.C:68
TProfile * fHist_Corr3p_Kaon_EtaDiff_EP_V0C_NN[2][6]
TProfile * fHist_Corr3p_Kaon_pTDiff_EP_V0A_PP[2][6]
TProfile * fHist_Corr3p_Pion_pTDiff_EP_V0C_NN[2][6]
Definition: External.C:252
TH3F * fHist3DEtaPhiVz_Neg_Run[4][5]
4 particle 5 centrality bin
TProfile * fHist_Corr3p_Proton_EP_Norm_PP[2][4]
Definition: External.C:228
TProfile * fHist_Corr3p_Pion_EtaDiff_EP_V0A_NN[2][6]
Definition: External.C:212
TProfile * fHist_Corr3p_Proton_pTSum_EP_V0A_PP[2][6]
TProfile * fHist_Corr3p_Proton_pTDiff_EP_V0A_NN[2][6]
TProfile * fHist_Corr3p_Kaon_EP_Refm_PN[2][4]
TProfile * fHist_Corr3p_Kaon_EtaDiff_EP_V0C_PP[2][6]
TProfile * fHist_Corr3p_Pion_pTSum_EP_V0A_PN[2][6]
TProfile * fHist_Corr3p_Pion_pTSum_EP_V0A_PP[2][6]
TProfile * fHist_Corr3p_Kaon_pTDiff_EP_V0C_PP[2][6]
TH1D * fHCorrectV0M
with PileUp cut
TProfile * fHist_Corr3p_Proton_pTSum_EP_V0A_PN[2][6]
TProfile * fHist_Corr3p_Kaon_pTDiff_EP_V0A_NN[2][6]
TProfile * fHist_Corr3p_Pion_EtaDiff_EP_V0C_NN[2][6]
TH2F * fHistTPCvsGlobalMultBefore
Eta-Pt acceptance.
TH3D * fHCorrectNUAposKaon[5]
5 centrality bin, read NUA from file
TProfile * fHist_Corr3p_Pion_EP_Norm_PN[2][4]
TProfile * fHist_Corr3p_Kaon_EP_Norm_NN[2][4]
TProfile * fHist_Corr3p_Pion_EP_Norm_NN[2][4]
TProfile * fHist_Corr3p_Pion_EP_Refm_PN[2][4]
TProfile * fHist_Corr3p_Proton_pTDiff_EP_V0A_PN[2][6]
TProfile * fHist_Corr3p_pTDiff_EP_V0A_PP[2][6]
TProfile * fHist_Corr3p_Proton_EP_Norm_PN[2][4]
TH1F * fCentDistBefore
To fill VOM multiplicity.
TList * fListHist
Event selection.
virtual void UserExec(Option_t *)
TH1F * fHistPileUpCount
Task input parameters FB / cut values etc.
Bool_t PileUpMultiVertex(const AliAODEvent *faod)
TH3D * fHCorrectNUAnegKaon[5]
5 centrality bin, read NUA from file
TH3D * fHCorrectNUAneg[5]
5 centrality bin, read NUA from file
TProfile * fHist_Corr3p_Kaon_EP_Refm_PP[2][4]
double GetWDist(const AliVVertex *v0, const AliVVertex *v1)
TH1D * fFB_Efficiency_Cent[10]
4 particle 5 centrality bin
TProfile * fHist_Corr3p_EP_Norm_PN[2][4]
5 centrality bin, read NUA from file
TProfile * fHist_Corr3p_EtaDiff_EP_V0C_PN[2][6]
TProfile * fHist_Corr3p_pTSum_EP_V0A_NN[2][6]
TProfile * fHist_Corr3p_Proton_EtaDiff_EP_V0C_NN[2][6]
TProfile * fHist_Corr3p_pTDiff_EP_V0C_NN[2][6]
TProfile * fHist_Corr3p_Kaon_EtaDiff_EP_V0A_NN[2][6]
TProfile * fHist_Corr3p_Pion_EP_Refm_PP[2][4]
TProfile * fHist_Corr3p_Pion_pTSum_EP_V0A_NN[2][6]
TH2F * fQAEtaPhiAfterNUA
Event weights for non-flat centrality.
const char Option_t
Definition: External.C:48
TProfile * fHist_Corr3p_Kaon_pTDiff_EP_V0A_PN[2][6]
TProfile * fHist_Corr3p_Proton_EtaDiff_EP_V0A_PN[2][6]
TH3D * fHCorrectNUAposProton[5]
5 centrality bin, read NUA from file
TProfile * fHist_Corr3p_EP_Refm_PN[2][4]
bool Bool_t
Definition: External.C:53
TProfile * fHist_Corr3p_Proton_pTDiff_EP_V0C_PN[2][6]
TProfile * fHist_Corr3p_Pion_pTDiff_EP_V0C_PN[2][6]
TProfile * fHist_Corr3p_pTDiff_EP_V0A_PN[2][6]
TProfile * fHist_Corr3p_pTDiff_EP_V0A_NN[2][6]
TProfile * fHist_Corr3p_Pion_EP_Refm_NN[2][4]
TH2F * fV0MultChVsRun
Full Event plane.
TProfile * fHist_Corr3p_Proton_pTSum_EP_V0C_PP[2][6]
TProfile * fHist_Corr3p_Kaon_EtaDiff_EP_V0C_PN[2][6]
TProfile * fHist_Corr3p_Kaon_pTSum_EP_V0C_PN[2][6]
TProfile * fHist_Corr3p_Proton_EP_Refm_PP[2][4]
TProfile * fHist_Corr3p_EP_Refm_PP[2][4]
TProfile * fHist_Reso2n_EP_Refm_Det[2][4]
TProfile * fHist_Corr3p_Kaon_pTSum_EP_V0A_NN[2][6]
TProfile * fHist_Corr3p_Pion_EtaDiff_EP_V0C_PN[2][6]
TProfile * fHist_Corr3p_Pion_EtaDiff_EP_V0A_PP[2][6]
TProfile * fHist_Corr3p_pTSum_EP_V0A_PP[2][6]
TProfile * fHist_Corr3p_Proton_EP_Refm_NN[2][4]
TProfile * fHist_Corr3p_Proton_EtaDiff_EP_V0C_PN[2][6]
TProfile * fHist_Corr3p_Proton_pTDiff_EP_V0A_PP[2][6]
TProfile * fHist_Corr3p_EtaDiff_EP_V0C_NN[2][6]
TH2D * fHAvgerageQnV0C
V0A Average <Qn>, n=2,3.
TProfile * fHist_Corr3p_EP_Norm_PP[2][4]