AliPhysics  8d00e07 (8d00e07)
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  fFilterBit(1),
148  gN(1),
149  gM(1),
150  gPsiN(2),
151  fOldRunNum(111),
152  fEventCount(0),
153  fTPCclustMin(70),
154  fNSigmaCut(2),
155  fMinPtCut(0.2),
156  fMaxPtCut(5.0),
157  fMinEtaCut(-0.8),
158  fMaxEtaCut(0.8),
159  fTrkChi2Min(0.1),
160  fDCAxyMax(2.4),
161  fDCAzMax(3.2),
162  fdEdxMin(10.),
163  fCentralityPercentMin(0),
164  fCentralityPercentMax(90),
165  fPileUpSlopeParm(3.43),
166  fPileUpConstParm(43),
167  fMinVzCut(-10.0),
168  fMaxVzCut(10.0),
169  bApplyMCcorr(kFALSE),
170  bV0MGainCorr(kFALSE),
171  bSkipPileUpCut(kFALSE),
172  bFillNUAHistPID(kFALSE),
173  bUseKinkTracks(kFALSE),
174  sPathOfMCFile("/alien"),
175  sNucleiTP("PbPb"),
176  sCentrEstimator("V0M"),
177  fHistEventCount(NULL)
178 {
179  for(int i=0;i<3;i++){
180  fHistPtwithTPCNsigma[i]=NULL;
181  fHistPtwithTOFmasscut[i]=NULL;
182  fHistPtwithTOFSignal[i]=NULL;
183  fHistTOFnSigmavsPtAfter[i]=NULL;
184  fHistTPCnSigmavsPtAfter[i]=NULL;
185  fHistTPCTOFnSigmavsPtAfter[i]=NULL;
186  fHistTPCdEdxvsPtPIDAfter[i]=NULL;
187  }
188  for(int i=0;i<5;i++){
189  fHCorrectNUApos[i] = NULL;
190  fHCorrectNUAneg[i] = NULL;
191  }
192  for(int i=0;i<5;i++){ // for PID
193  fHCorrectNUAposPion[i] = NULL;
194  fHCorrectNUAnegPion[i] = NULL;
195  fHCorrectNUAposKaon[i] = NULL;
196  fHCorrectNUAnegKaon[i] = NULL;
197  fHCorrectNUAposProton[i] = NULL;
198  fHCorrectNUAnegProton[i] = NULL;
199  }
200  //3p vs centrality
201  for(int i=0;i<2;i++){
202  for(int j=0;j<4;j++){
203  fHist_Corr3p_EP_Norm_PN[i][j] = NULL;
204  fHist_Corr3p_EP_Norm_PP[i][j] = NULL;
205  fHist_Corr3p_EP_Norm_NN[i][j] = NULL;
206  }
207  for(int j=0;j<4;j++) {
208  fHist_Reso2n_EP_Norm_Det[i][j] = NULL;
209  }
210  //PID:
211  for(int j=0;j<4;j++){
212  fHist_Corr3p_Pion_EP_Norm_PN[i][j] = NULL;
213  fHist_Corr3p_Pion_EP_Norm_PP[i][j] = NULL;
214  fHist_Corr3p_Pion_EP_Norm_NN[i][j] = NULL;
215  fHist_Corr3p_Kaon_EP_Norm_PN[i][j] = NULL;
216  fHist_Corr3p_Kaon_EP_Norm_PP[i][j] = NULL;
217  fHist_Corr3p_Kaon_EP_Norm_NN[i][j] = NULL;
218  fHist_Corr3p_Proton_EP_Norm_PN[i][j] = NULL;
219  fHist_Corr3p_Proton_EP_Norm_PP[i][j] = NULL;
220  fHist_Corr3p_Proton_EP_Norm_NN[i][j] = NULL;
221  }
222  }
223  //3p vs RefMult
224  for(int i=0;i<2;i++){
225  for(int j=0;j<4;j++){
226  fHist_Corr3p_EP_Refm_PN[i][j] = NULL;
227  fHist_Corr3p_EP_Refm_PP[i][j] = NULL;
228  fHist_Corr3p_EP_Refm_NN[i][j] = NULL;
229  }
230  for(int j=0;j<4;j++) {
231  fHist_Reso2n_EP_Refm_Det[i][j] = NULL;
232  }
233  //PID:
234  for(int j=0;j<4;j++){
235  fHist_Corr3p_Pion_EP_Refm_PN[i][j] = NULL;
236  fHist_Corr3p_Pion_EP_Refm_PP[i][j] = NULL;
237  fHist_Corr3p_Pion_EP_Refm_NN[i][j] = NULL;
238  fHist_Corr3p_Kaon_EP_Refm_PN[i][j] = NULL;
239  fHist_Corr3p_Kaon_EP_Refm_PP[i][j] = NULL;
240  fHist_Corr3p_Kaon_EP_Refm_NN[i][j] = NULL;
241  fHist_Corr3p_Proton_EP_Refm_PN[i][j] = NULL;
242  fHist_Corr3p_Proton_EP_Refm_PP[i][j] = NULL;
243  fHist_Corr3p_Proton_EP_Refm_NN[i][j] = NULL;
244  }
245  }
246 
247 
248 //2p vs Centrality:
249  for(int i=0;i<2;i++){
250  for(int j=0;j<4;j++){
251  fHist_Corr2p_EP_Norm_PN[i][j] = NULL;
252  fHist_Corr2p_EP_Norm_PP[i][j] = NULL;
253  fHist_Corr2p_EP_Norm_NN[i][j] = NULL;
254  }
255  //PID:
256  for(int j=0;j<4;j++){
257  fHist_Corr2p_Pion_EP_Norm_PN[i][j] = NULL;
258  fHist_Corr2p_Pion_EP_Norm_PP[i][j] = NULL;
259  fHist_Corr2p_Pion_EP_Norm_NN[i][j] = NULL;
260  fHist_Corr2p_Kaon_EP_Norm_PN[i][j] = NULL;
261  fHist_Corr2p_Kaon_EP_Norm_PP[i][j] = NULL;
262  fHist_Corr2p_Kaon_EP_Norm_NN[i][j] = NULL;
263  fHist_Corr2p_Proton_EP_Norm_PN[i][j] = NULL;
264  fHist_Corr2p_Proton_EP_Norm_PP[i][j] = NULL;
265  fHist_Corr2p_Proton_EP_Norm_NN[i][j] = NULL;
266  }
267  }
268 
269 //2p vs Refm:
270  for(int i=0;i<2;i++){
271  for(int j=0;j<4;j++){
272  fHist_Corr2p_EP_Refm_PN[i][j] = NULL;
273  fHist_Corr2p_EP_Refm_PP[i][j] = NULL;
274  fHist_Corr2p_EP_Refm_NN[i][j] = NULL;
275  }
276  //PID:
277  for(int j=0;j<4;j++){
278  fHist_Corr2p_Pion_EP_Refm_PN[i][j] = NULL;
279  fHist_Corr2p_Pion_EP_Refm_PP[i][j] = NULL;
280  fHist_Corr2p_Pion_EP_Refm_NN[i][j] = NULL;
281  fHist_Corr2p_Kaon_EP_Refm_PN[i][j] = NULL;
282  fHist_Corr2p_Kaon_EP_Refm_PP[i][j] = NULL;
283  fHist_Corr2p_Kaon_EP_Refm_NN[i][j] = NULL;
284  fHist_Corr2p_Proton_EP_Refm_PN[i][j] = NULL;
285  fHist_Corr2p_Proton_EP_Refm_PP[i][j] = NULL;
286  fHist_Corr2p_Proton_EP_Refm_NN[i][j] = NULL;
287  }
288  }
289 
290 
291 
292 
293 
294 
295 
296 
297 
298 
299  //Differential 3p Charge:
300  for(int i=0;i<2;i++){
301  for(int j=0;j<6;j++){
302  fHist_Corr3p_pTSum_EP_V0A_PN[i][j] = NULL;
303  fHist_Corr3p_pTSum_EP_V0A_PP[i][j] = NULL;
304  fHist_Corr3p_pTSum_EP_V0A_NN[i][j] = NULL;
305  fHist_Corr3p_pTSum_EP_V0C_PN[i][j] = NULL;
306  fHist_Corr3p_pTSum_EP_V0C_PP[i][j] = NULL;
307  fHist_Corr3p_pTSum_EP_V0C_NN[i][j] = NULL;
308 
309  fHist_Corr3p_pTDiff_EP_V0A_PN[i][j] = NULL;
310  fHist_Corr3p_pTDiff_EP_V0A_PP[i][j] = NULL;
311  fHist_Corr3p_pTDiff_EP_V0A_NN[i][j] = NULL;
312  fHist_Corr3p_pTDiff_EP_V0C_PN[i][j] = NULL;
313  fHist_Corr3p_pTDiff_EP_V0C_PP[i][j] = NULL;
314  fHist_Corr3p_pTDiff_EP_V0C_NN[i][j] = NULL;
315 
316  fHist_Corr3p_EtaDiff_EP_V0A_PN[i][j] = NULL;
317  fHist_Corr3p_EtaDiff_EP_V0A_PP[i][j] = NULL;
318  fHist_Corr3p_EtaDiff_EP_V0A_NN[i][j] = NULL;
319  fHist_Corr3p_EtaDiff_EP_V0C_PN[i][j] = NULL;
320  fHist_Corr3p_EtaDiff_EP_V0C_PP[i][j] = NULL;
321  fHist_Corr3p_EtaDiff_EP_V0C_NN[i][j] = NULL;
322  }
323  }
324  //Differential 3p PID:
325  for(int i=0;i<2;i++){
326  for(int j=0;j<6;j++){
327  //Pion
328  fHist_Corr3p_Pion_pTSum_EP_V0A_PN[i][j] = NULL;
329  fHist_Corr3p_Pion_pTSum_EP_V0A_PP[i][j] = NULL;
330  fHist_Corr3p_Pion_pTSum_EP_V0A_NN[i][j] = NULL;
331  fHist_Corr3p_Pion_pTSum_EP_V0C_PN[i][j] = NULL;
332  fHist_Corr3p_Pion_pTSum_EP_V0C_PP[i][j] = NULL;
333  fHist_Corr3p_Pion_pTSum_EP_V0C_NN[i][j] = NULL;
334 
335  fHist_Corr3p_Pion_pTDiff_EP_V0A_PN[i][j] = NULL;
336  fHist_Corr3p_Pion_pTDiff_EP_V0A_PP[i][j] = NULL;
337  fHist_Corr3p_Pion_pTDiff_EP_V0A_NN[i][j] = NULL;
338  fHist_Corr3p_Pion_pTDiff_EP_V0C_PN[i][j] = NULL;
339  fHist_Corr3p_Pion_pTDiff_EP_V0C_PP[i][j] = NULL;
340  fHist_Corr3p_Pion_pTDiff_EP_V0C_NN[i][j] = NULL;
341 
342  fHist_Corr3p_Pion_EtaDiff_EP_V0A_PN[i][j] = NULL;
343  fHist_Corr3p_Pion_EtaDiff_EP_V0A_PP[i][j] = NULL;
344  fHist_Corr3p_Pion_EtaDiff_EP_V0A_NN[i][j] = NULL;
345  fHist_Corr3p_Pion_EtaDiff_EP_V0C_PN[i][j] = NULL;
346  fHist_Corr3p_Pion_EtaDiff_EP_V0C_PP[i][j] = NULL;
347  fHist_Corr3p_Pion_EtaDiff_EP_V0C_NN[i][j] = NULL;
348  //Kaon
349  fHist_Corr3p_Kaon_pTSum_EP_V0A_PN[i][j] = NULL;
350  fHist_Corr3p_Kaon_pTSum_EP_V0A_PP[i][j] = NULL;
351  fHist_Corr3p_Kaon_pTSum_EP_V0A_NN[i][j] = NULL;
352  fHist_Corr3p_Kaon_pTSum_EP_V0C_PN[i][j] = NULL;
353  fHist_Corr3p_Kaon_pTSum_EP_V0C_PP[i][j] = NULL;
354  fHist_Corr3p_Kaon_pTSum_EP_V0C_NN[i][j] = NULL;
355 
356  fHist_Corr3p_Kaon_pTDiff_EP_V0A_PN[i][j] = NULL;
357  fHist_Corr3p_Kaon_pTDiff_EP_V0A_PP[i][j] = NULL;
358  fHist_Corr3p_Kaon_pTDiff_EP_V0A_NN[i][j] = NULL;
359  fHist_Corr3p_Kaon_pTDiff_EP_V0C_PN[i][j] = NULL;
360  fHist_Corr3p_Kaon_pTDiff_EP_V0C_PP[i][j] = NULL;
361  fHist_Corr3p_Kaon_pTDiff_EP_V0C_NN[i][j] = NULL;
362 
363  fHist_Corr3p_Kaon_EtaDiff_EP_V0A_PN[i][j] = NULL;
364  fHist_Corr3p_Kaon_EtaDiff_EP_V0A_PP[i][j] = NULL;
365  fHist_Corr3p_Kaon_EtaDiff_EP_V0A_NN[i][j] = NULL;
366  fHist_Corr3p_Kaon_EtaDiff_EP_V0C_PN[i][j] = NULL;
367  fHist_Corr3p_Kaon_EtaDiff_EP_V0C_PP[i][j] = NULL;
368  fHist_Corr3p_Kaon_EtaDiff_EP_V0C_NN[i][j] = NULL;
369  //Proton
370  fHist_Corr3p_Proton_pTSum_EP_V0A_PN[i][j] = NULL;
371  fHist_Corr3p_Proton_pTSum_EP_V0A_PP[i][j] = NULL;
372  fHist_Corr3p_Proton_pTSum_EP_V0A_NN[i][j] = NULL;
373  fHist_Corr3p_Proton_pTSum_EP_V0C_PN[i][j] = NULL;
374  fHist_Corr3p_Proton_pTSum_EP_V0C_PP[i][j] = NULL;
375  fHist_Corr3p_Proton_pTSum_EP_V0C_NN[i][j] = NULL;
376 
377  fHist_Corr3p_Proton_pTDiff_EP_V0A_PN[i][j] = NULL;
378  fHist_Corr3p_Proton_pTDiff_EP_V0A_PP[i][j] = NULL;
379  fHist_Corr3p_Proton_pTDiff_EP_V0A_NN[i][j] = NULL;
380  fHist_Corr3p_Proton_pTDiff_EP_V0C_PN[i][j] = NULL;
381  fHist_Corr3p_Proton_pTDiff_EP_V0C_PP[i][j] = NULL;
382  fHist_Corr3p_Proton_pTDiff_EP_V0C_NN[i][j] = NULL;
383 
384  fHist_Corr3p_Proton_EtaDiff_EP_V0A_PN[i][j] = NULL;
385  fHist_Corr3p_Proton_EtaDiff_EP_V0A_PP[i][j] = NULL;
386  fHist_Corr3p_Proton_EtaDiff_EP_V0A_NN[i][j] = NULL;
387  fHist_Corr3p_Proton_EtaDiff_EP_V0C_PN[i][j] = NULL;
388  fHist_Corr3p_Proton_EtaDiff_EP_V0C_PP[i][j] = NULL;
389  fHist_Corr3p_Proton_EtaDiff_EP_V0C_NN[i][j] = NULL;
390  }
391  }
392 
393 
394 
395  //Differential 2p Charge:
396  for(int i=0;i<2;i++){
397  for(int j=0;j<6;j++){
398  fHist_Corr2p_pTSum_EP_Harm1_PN[i][j] = NULL;
399  fHist_Corr2p_pTSum_EP_Harm1_PP[i][j] = NULL;
400  fHist_Corr2p_pTSum_EP_Harm1_NN[i][j] = NULL;
401  fHist_Corr2p_pTSum_EP_Harm2_PN[i][j] = NULL;
402  fHist_Corr2p_pTSum_EP_Harm2_PP[i][j] = NULL;
403  fHist_Corr2p_pTSum_EP_Harm2_NN[i][j] = NULL;
404 
405  fHist_Corr2p_pTDiff_EP_Harm1_PN[i][j] = NULL;
406  fHist_Corr2p_pTDiff_EP_Harm1_PP[i][j] = NULL;
407  fHist_Corr2p_pTDiff_EP_Harm1_NN[i][j] = NULL;
408  fHist_Corr2p_pTDiff_EP_Harm2_PN[i][j] = NULL;
409  fHist_Corr2p_pTDiff_EP_Harm2_PP[i][j] = NULL;
410  fHist_Corr2p_pTDiff_EP_Harm2_NN[i][j] = NULL;
411 
412  fHist_Corr2p_EtaDiff_EP_Harm1_PN[i][j] = NULL;
413  fHist_Corr2p_EtaDiff_EP_Harm1_PP[i][j] = NULL;
414  fHist_Corr2p_EtaDiff_EP_Harm1_NN[i][j] = NULL;
415  fHist_Corr2p_EtaDiff_EP_Harm2_PN[i][j] = NULL;
416  fHist_Corr2p_EtaDiff_EP_Harm2_PP[i][j] = NULL;
417  fHist_Corr2p_EtaDiff_EP_Harm2_NN[i][j] = NULL;
418  }
419  }
420 
421 
422 
423 
424 
425  for(int i=0;i<4;i++){
426  for(int j=0;j<5;j++){
427  fHist3DEtaPhiVz_Pos_Run[i][j]=NULL;
428  fHist3DEtaPhiVz_Neg_Run[i][j]=NULL;
429  }
430  }
431  for(int i=0;i<10;i++){
432  fFB_Efficiency_Cent[i] = NULL;
433  fFB_Efficiency_Pion_Cent[i] = NULL;
434  fFB_Efficiency_Kaon_Cent[i] = NULL;
435  fFB_Efficiency_Proton_Cent[i] = NULL;
436  }
437 
438 
439  DefineInput(0,TChain::Class());
440  DefineOutput(1,TList::Class());
441 }
442 //______________________________empty constructor_______________________
445  fVevent(NULL),
446  fESD(NULL),
447  fAOD(NULL),
448  fPIDResponse(NULL),
449  fMultSelection(NULL),
450  fAnalysisUtil(NULL),
451  fListHist(NULL),
452  mfileFBHijing(NULL),
453  fListFBHijing(NULL),
454  fListNUACorr(NULL),
455  fListV0MCorr(NULL),
456  fHistTaskConfigParameters(NULL),
457  fHistPileUpCount(NULL),
458  fHistMultSelPUCount(NULL),
459  fHistEtaPtBefore(NULL),
460  fHistEtaPtAfter(NULL),
461  fHistTPCvsGlobalMultBefore(NULL),
462  fHistTPCvsGlobalMultAfter(NULL),
463  fHistTPCdEdxvsPBefore(NULL),
464  fHistTPCdEdxvsPAfter(NULL),
465  fHistTOFBetavsPBefore(NULL),
466  fHistTOFBetavsPAfter(NULL),
467  fHistTOFMassvsPtBefore(NULL),
468  fHistTOFMatchCount(NULL),
469  fHistTPCVsESDTrkBefore(NULL),
470  fHistTPCVsESDTrkAfter(NULL),
471  fHistTPConlyVsCL1Before(NULL),
472  fHistTPConlyVsV0MBefore(NULL),
473  fHistTPConlyVsCL1After(NULL),
474  fHistTPConlyVsV0MAfter(NULL),
475  fHistGlobalVsV0MBefore(NULL),
476  fHistGlobalVsV0MAfter(NULL),
477  fHistRawVsCorrMultFB(NULL),
478  hCentvsTPCmultCuts(NULL),
479  fHV0AEventPlaneVsCent(NULL),
480  fHV0CEventPlaneVsCent(NULL),
481  fHTPCAEventPlaneVsCent(NULL),
482  fHTPCCEventPlaneVsCent(NULL),
483  fHTPCEventPlaneVsCent(NULL),
484  fV0MultChVsRun(NULL),
485  fCentDistBefore(NULL),
486  fCentDistAfter(NULL),
487  fHCorrectV0M(NULL),
488  fHAvgerageQnV0A(NULL),
489  fHAvgerageQnV0C(NULL),
490  fHCentWeightForRun(NULL),
491  fQAEtaPhiAfterNUA(NULL),
492  fQAEtaPhiAfterNUAPion(NULL),
493  fQAEtaPhiAfterNUAKaon(NULL),
494  fQAEtaPhiAfterNUAProton(NULL),
495  fV0AQ2xVsCentRun(NULL),
496  fV0AQ2yVsCentRun(NULL),
497  fV0CQ2xVsCentRun(NULL),
498  fV0CQ2yVsCentRun(NULL),
499  fV0AQ3xVsCentRun(NULL),
500  fV0AQ3yVsCentRun(NULL),
501  fV0CQ3xVsCentRun(NULL),
502  fV0CQ3yVsCentRun(NULL),
503  fTPCAQ2xVsCentRun(NULL),
504  fTPCAQ2yVsCentRun(NULL),
505  fTPCCQ2xVsCentRun(NULL),
506  fTPCCQ2yVsCentRun(NULL),
507  fTPCAQ3xVsCentRun(NULL),
508  fTPCAQ3yVsCentRun(NULL),
509  fTPCCQ3xVsCentRun(NULL),
510  fTPCCQ3yVsCentRun(NULL),
511  fTPCAQ4xVsCentRun(NULL),
512  fTPCAQ4yVsCentRun(NULL),
513  fTPCCQ4xVsCentRun(NULL),
514  fTPCCQ4yVsCentRun(NULL),
515  fTPCFQ2xVsCentRun(NULL),
516  fTPCFQ2yVsCentRun(NULL),
517  fFilterBit(1),
518  gN(1),
519  gM(1),
520  gPsiN(2),
521  fOldRunNum(111),
522  fEventCount(0),
523  fTPCclustMin(70),
524  fNSigmaCut(2),
525  fMinPtCut(0.2),
526  fMaxPtCut(5.0),
527  fMinEtaCut(-0.8),
528  fMaxEtaCut(0.8),
529  fTrkChi2Min(0.1),
530  fDCAxyMax(2.4),
531  fDCAzMax(3.2),
532  fdEdxMin(10.),
533  fCentralityPercentMin(0),
534  fCentralityPercentMax(90),
535  fPileUpSlopeParm(3.43),
536  fPileUpConstParm(43),
537  fMinVzCut(-10.0),
538  fMaxVzCut(10.0),
539  bApplyMCcorr(kFALSE),
540  bV0MGainCorr(kFALSE),
541  bSkipPileUpCut(kFALSE),
542  bFillNUAHistPID(kFALSE),
543  bUseKinkTracks(kFALSE),
544  sPathOfMCFile("/alien"),
545  sNucleiTP("PbPb"),
546  sCentrEstimator("V0M"),
547  fHistEventCount(NULL)
548 {
549  for(int i=0;i<3;i++){
550  fHistPtwithTPCNsigma[i]=NULL;
551  fHistPtwithTOFmasscut[i]=NULL;
552  fHistPtwithTOFSignal[i]=NULL;
553  fHistTOFnSigmavsPtAfter[i]=NULL;
554  fHistTPCnSigmavsPtAfter[i]=NULL;
556  fHistTPCdEdxvsPtPIDAfter[i]=NULL;
557  }
558  for(int i=0;i<5;i++){
559  fHCorrectNUApos[i] = NULL;
560  fHCorrectNUAneg[i] = NULL;
561  }
562  for(int i=0;i<5;i++){ // for PID NUA
563  fHCorrectNUAposPion[i] = NULL;
564  fHCorrectNUAnegPion[i] = NULL;
565  fHCorrectNUAposKaon[i] = NULL;
566  fHCorrectNUAnegKaon[i] = NULL;
567  fHCorrectNUAposProton[i] = NULL;
568  fHCorrectNUAnegProton[i] = NULL;
569  }
570  //3p vs Centrality
571  for(int i=0;i<2;i++){
572  for(int j=0;j<4;j++){
573  fHist_Corr3p_EP_Norm_PN[i][j] = NULL;
574  fHist_Corr3p_EP_Norm_PP[i][j] = NULL;
575  fHist_Corr3p_EP_Norm_NN[i][j] = NULL;
576  }
577  for(int j=0;j<4;j++) {
578  fHist_Reso2n_EP_Norm_Det[i][j] = NULL;
579  }
580  //PID:
581  for(int j=0;j<4;j++){
582  fHist_Corr3p_Pion_EP_Norm_PN[i][j] = NULL;
583  fHist_Corr3p_Pion_EP_Norm_PP[i][j] = NULL;
584  fHist_Corr3p_Pion_EP_Norm_NN[i][j] = NULL;
585  fHist_Corr3p_Kaon_EP_Norm_PN[i][j] = NULL;
586  fHist_Corr3p_Kaon_EP_Norm_PP[i][j] = NULL;
587  fHist_Corr3p_Kaon_EP_Norm_NN[i][j] = NULL;
588  fHist_Corr3p_Proton_EP_Norm_PN[i][j] = NULL;
589  fHist_Corr3p_Proton_EP_Norm_PP[i][j] = NULL;
590  fHist_Corr3p_Proton_EP_Norm_NN[i][j] = NULL;
591  }
592  }
593  //3p vs RefMult
594  for(int i=0;i<2;i++){
595  for(int j=0;j<4;j++){
596  fHist_Corr3p_EP_Refm_PN[i][j] = NULL;
597  fHist_Corr3p_EP_Refm_PP[i][j] = NULL;
598  fHist_Corr3p_EP_Refm_NN[i][j] = NULL;
599  }
600  for(int j=0;j<4;j++) {
601  fHist_Reso2n_EP_Refm_Det[i][j] = NULL;
602  }
603  //PID:
604  for(int j=0;j<4;j++){
605  fHist_Corr3p_Pion_EP_Refm_PN[i][j] = NULL;
606  fHist_Corr3p_Pion_EP_Refm_PP[i][j] = NULL;
607  fHist_Corr3p_Pion_EP_Refm_NN[i][j] = NULL;
608  fHist_Corr3p_Kaon_EP_Refm_PN[i][j] = NULL;
609  fHist_Corr3p_Kaon_EP_Refm_PP[i][j] = NULL;
610  fHist_Corr3p_Kaon_EP_Refm_NN[i][j] = NULL;
611  fHist_Corr3p_Proton_EP_Refm_PN[i][j] = NULL;
612  fHist_Corr3p_Proton_EP_Refm_PP[i][j] = NULL;
613  fHist_Corr3p_Proton_EP_Refm_NN[i][j] = NULL;
614  }
615  }
616 
617 
618 
619 //2p vs Centrality:
620  for(int i=0;i<2;i++){
621  for(int j=0;j<4;j++){
622  fHist_Corr2p_EP_Norm_PN[i][j] = NULL;
623  fHist_Corr2p_EP_Norm_PP[i][j] = NULL;
624  fHist_Corr2p_EP_Norm_NN[i][j] = NULL;
625  }
626  //PID:
627  for(int j=0;j<4;j++){
628  fHist_Corr2p_Pion_EP_Norm_PN[i][j] = NULL;
629  fHist_Corr2p_Pion_EP_Norm_PP[i][j] = NULL;
630  fHist_Corr2p_Pion_EP_Norm_NN[i][j] = NULL;
631  fHist_Corr2p_Kaon_EP_Norm_PN[i][j] = NULL;
632  fHist_Corr2p_Kaon_EP_Norm_PP[i][j] = NULL;
633  fHist_Corr2p_Kaon_EP_Norm_NN[i][j] = NULL;
634  fHist_Corr2p_Proton_EP_Norm_PN[i][j] = NULL;
635  fHist_Corr2p_Proton_EP_Norm_PP[i][j] = NULL;
636  fHist_Corr2p_Proton_EP_Norm_NN[i][j] = NULL;
637  }
638  }
639 //2p vs Refm:
640  for(int i=0;i<2;i++){
641  for(int j=0;j<4;j++){
642  fHist_Corr2p_EP_Refm_PN[i][j] = NULL;
643  fHist_Corr2p_EP_Refm_PP[i][j] = NULL;
644  fHist_Corr2p_EP_Refm_NN[i][j] = NULL;
645  }
646  //PID:
647  for(int j=0;j<4;j++){
648  fHist_Corr2p_Pion_EP_Refm_PN[i][j] = NULL;
649  fHist_Corr2p_Pion_EP_Refm_PP[i][j] = NULL;
650  fHist_Corr2p_Pion_EP_Refm_NN[i][j] = NULL;
651  fHist_Corr2p_Kaon_EP_Refm_PN[i][j] = NULL;
652  fHist_Corr2p_Kaon_EP_Refm_PP[i][j] = NULL;
653  fHist_Corr2p_Kaon_EP_Refm_NN[i][j] = NULL;
654  fHist_Corr2p_Proton_EP_Refm_PN[i][j] = NULL;
655  fHist_Corr2p_Proton_EP_Refm_PP[i][j] = NULL;
656  fHist_Corr2p_Proton_EP_Refm_NN[i][j] = NULL;
657  }
658  }
659 
660 
661 
662 
663 
664 
665 
666 
667 
668 
669 
670 
671 
672 
673 
674  //Differential Charge:
675  for(int i=0;i<2;i++){
676  for(int j=0;j<6;j++){
677  fHist_Corr3p_pTSum_EP_V0A_PN[i][j] = NULL;
678  fHist_Corr3p_pTSum_EP_V0A_PP[i][j] = NULL;
679  fHist_Corr3p_pTSum_EP_V0A_NN[i][j] = NULL;
680  fHist_Corr3p_pTSum_EP_V0C_PN[i][j] = NULL;
681  fHist_Corr3p_pTSum_EP_V0C_PP[i][j] = NULL;
682  fHist_Corr3p_pTSum_EP_V0C_NN[i][j] = NULL;
683 
684  fHist_Corr3p_pTDiff_EP_V0A_PN[i][j] = NULL;
685  fHist_Corr3p_pTDiff_EP_V0A_PP[i][j] = NULL;
686  fHist_Corr3p_pTDiff_EP_V0A_NN[i][j] = NULL;
687  fHist_Corr3p_pTDiff_EP_V0C_PN[i][j] = NULL;
688  fHist_Corr3p_pTDiff_EP_V0C_PP[i][j] = NULL;
689  fHist_Corr3p_pTDiff_EP_V0C_NN[i][j] = NULL;
690 
691  fHist_Corr3p_EtaDiff_EP_V0A_PN[i][j] = NULL;
692  fHist_Corr3p_EtaDiff_EP_V0A_PP[i][j] = NULL;
693  fHist_Corr3p_EtaDiff_EP_V0A_NN[i][j] = NULL;
694  fHist_Corr3p_EtaDiff_EP_V0C_PN[i][j] = NULL;
695  fHist_Corr3p_EtaDiff_EP_V0C_PP[i][j] = NULL;
696  fHist_Corr3p_EtaDiff_EP_V0C_NN[i][j] = NULL;
697  }
698  }
699  //Differential PID:
700  for(int i=0;i<2;i++){
701  for(int j=0;j<6;j++){
702  //Pion
709 
716 
723  //Kaon
730 
737 
744  //Proton
751 
758 
765  }
766  }
767 
768 
769 
770  //Differential 2p Charge:
771  for(int i=0;i<2;i++){
772  for(int j=0;j<6;j++){
773  fHist_Corr2p_pTSum_EP_Harm1_PN[i][j] = NULL;
774  fHist_Corr2p_pTSum_EP_Harm1_PP[i][j] = NULL;
775  fHist_Corr2p_pTSum_EP_Harm1_NN[i][j] = NULL;
776  fHist_Corr2p_pTSum_EP_Harm2_PN[i][j] = NULL;
777  fHist_Corr2p_pTSum_EP_Harm2_PP[i][j] = NULL;
778  fHist_Corr2p_pTSum_EP_Harm2_NN[i][j] = NULL;
779 
780  fHist_Corr2p_pTDiff_EP_Harm1_PN[i][j] = NULL;
781  fHist_Corr2p_pTDiff_EP_Harm1_PP[i][j] = NULL;
782  fHist_Corr2p_pTDiff_EP_Harm1_NN[i][j] = NULL;
783  fHist_Corr2p_pTDiff_EP_Harm2_PN[i][j] = NULL;
784  fHist_Corr2p_pTDiff_EP_Harm2_PP[i][j] = NULL;
785  fHist_Corr2p_pTDiff_EP_Harm2_NN[i][j] = NULL;
786 
793  }
794  }
795 
796 
797 
798 
799 
800  for(int i=0;i<4;i++){
801  for(int j=0;j<5;j++){
802  fHist3DEtaPhiVz_Pos_Run[i][j]=NULL;
803  fHist3DEtaPhiVz_Neg_Run[i][j]=NULL;
804  }
805  }
806  for(int i=0;i<10;i++){
807  fFB_Efficiency_Cent[i] = NULL;
808  fFB_Efficiency_Pion_Cent[i] = NULL;
809  fFB_Efficiency_Kaon_Cent[i] = NULL;
810  fFB_Efficiency_Proton_Cent[i] = NULL;
811  }
812 }
813 
814 //___________________________ destructor ___________________________
816 {
817  //Destructor
818  //if(fPIDResponse) delete fPIDResponse;
819  //if(fMultSelection) delete fMultSelection;
820 
821  /*
822  if(fHCorrectV0M) delete fHCorrectV0M;
823  if(fHAvgerageQnV0A) delete fHAvgerageQnV0A;
824  if(fHAvgerageQnV0C) delete fHAvgerageQnV0C;
825 
826  if(mfileFBHijing->IsOpen()){
827  mfileFBHijing->Close();
828  if(fListFBHijing) delete fListFBHijing;
829  }
830  for(int i=0;i<10;i++){
831  if(fFB_Efficiency_Cent[i])
832  delete fFB_Efficiency_Cent[i];
833  }
834  for(int i=0;i<5;i++){
835  if(fHCorrectNUApos[i]) delete fHCorrectNUApos[i];
836  if(fHCorrectNUAneg[i]) delete fHCorrectNUAneg[i];
837  }
838  for(int i=0;i<5;i++){ // for PID
839  if(fHCorrectNUAposPion[i]) delete fHCorrectNUAposPion[i];
840  if(fHCorrectNUAnegPion[i]) delete fHCorrectNUAnegPion[i];
841  if(fHCorrectNUAposKaon[i]) delete fHCorrectNUAposKaon[i];
842  if(fHCorrectNUAnegKaon[i]) delete fHCorrectNUAnegKaon[i];
843  if(fHCorrectNUAposProton[i]) delete fHCorrectNUAposProton[i];
844  if(fHCorrectNUAnegProton[i]) delete fHCorrectNUAnegProton[i];
845  }
846 */
847 
848  //Delete the clones
849  if(fListFBHijing) delete fListFBHijing;
850  if(fListNUACorr) delete fListNUACorr;
851  if(fListV0MCorr) delete fListV0MCorr;
852 
853  if(fListHist) delete fListHist;
854  if(fAnalysisUtil) delete fAnalysisUtil; // its 'new' !!
855 
856 }//---------------- sanity ------------------------
857 
858 
859 
861 {
862 
863  //std::cout<<"\n..UserCreateOutputObject called.. with isCorr = "<<isCorr<<"\n ....check if succeeded...\n"<<endl;
864 
865  //input hander
866  AliAnalysisManager *mgr=AliAnalysisManager::GetAnalysisManager();
867  AliInputEventHandler *inputHandler=dynamic_cast<AliInputEventHandler*>(mgr->GetInputEventHandler());
868  if (!inputHandler) { printf("\n ...Input handler missing!!!...\n"); return; }
869 
870  //PileUp Multi-Vertex
871  fAnalysisUtil = new AliAnalysisUtils();
872  fAnalysisUtil->SetUseMVPlpSelection(kTRUE);
873  fAnalysisUtil->SetUseOutOfBunchPileUp(kTRUE);
874 
875  //pid response object
876  fPIDResponse=inputHandler->GetPIDResponse();
877 
878  fListHist = new TList();
879  fListHist->SetOwner(kTRUE);
880 
881 
883 
884  if(!gGrid){
885  TGrid::Connect("alien://");
886  }
887 
889 
890 
891 
892  hCentvsTPCmultCuts = new TH2F("hCentvsTPCmultCuts","TPCmult Low,high",100,0,100,5,0,5);
893  hCentvsTPCmultCuts->GetYaxis()->SetBinLabel(1,"mean");
894  hCentvsTPCmultCuts->GetYaxis()->SetBinLabel(2,"sigma");
896 
898 
899  fHistTOFMatchCount = new TH2F("fHistTOFMatchCount","TofMatchFlag vs mismatch Prob",10,0,10,200,-5,5);
901 
902  fHistEtaPtBefore = new TH2F("fHistEtaPtBefore","Eta vs pT",100,-1.25,1.25,100,0,10);
904 
905  fHistEtaPtAfter = new TH2F("fHistEtaPtAfter","Eta vs pT",100,-1.25,1.25,100,0,10);
907 
908 
909  Int_t gMaxTPCFB1mult = 0;
910  Int_t gMaxGlobalmult = 0;
911  Int_t gMaxTPCcorrmult = 0;
912  Int_t gMaxESDtracks = 0;
913  Int_t nBinRefMult = 200;
914  Int_t nRefMultMax = 4000;
915 
916 
917 
918  if(sNucleiTP=="pp"||sNucleiTP=="PP"){
919  gMaxGlobalmult = 200;
920  gMaxTPCFB1mult = 200;
921  gMaxTPCcorrmult = 500;
922  gMaxESDtracks = 1000;
923  nBinRefMult = 100; //change binning for pp
924  nRefMultMax = 500;
925  //fSkipOutlierCut = 1;
926  }
927  else if(sNucleiTP=="pPb"||sNucleiTP=="Pbp"||sNucleiTP=="PbP"||sNucleiTP=="PPb"){
928  gMaxGlobalmult = 400;
929  gMaxTPCFB1mult = 400;
930  gMaxTPCcorrmult = 500;
931  gMaxESDtracks = 2000;
932  nBinRefMult = 100; //change binning for pPb
933  nRefMultMax = 1000;
934  //fSkipOutlierCut = 1;
935  }
936  else{
937  gMaxGlobalmult = 4000;
938  gMaxTPCFB1mult = 4000;
939  gMaxTPCcorrmult = 5000;
940  gMaxESDtracks = 20000;
941  //fSkipOutlierCut = 0;
942  }
943 
944 
945 
946  //if(bSkipPileUpCut) { fSkipOutlierCut = 1;}
947 
948 
949  fHistTPCVsESDTrkBefore = new TH2F("fHistTPCVsESDTrkBefore","Before; TPC1; ESD trk",500,0,gMaxTPCcorrmult,200,0,gMaxESDtracks);
951  fHistTPCVsESDTrkAfter = new TH2F("fHistTPCVsESDTrkAfter"," After; TPC1; ESD trk",500,0,gMaxTPCcorrmult,200,0,gMaxESDtracks);
953 
954  fHistTPCvsGlobalMultBefore = new TH2F("fHistTPCvsGlobalMultBefore","Before; Global; TPC(fb1) ",200,0,gMaxGlobalmult,200,0,gMaxTPCFB1mult);
956  fHistTPCvsGlobalMultAfter = new TH2F("fHistTPCvsGlobalMultAfter"," After; Global; TPC(fb1) ",200,0,gMaxGlobalmult,200,0,gMaxTPCFB1mult);
958 
959  fHistGlobalVsV0MBefore = new TH2F("fHistGlobalVsV0MBefore","Before;Cent(V0M);Global",100,0,100,500,0,gMaxGlobalmult);
961  fHistGlobalVsV0MAfter = new TH2F("fHistGlobalVsV0MAfter"," After; Cent(V0M);Global",100,0,100,500,0,gMaxGlobalmult);
963 
964  fHistTPConlyVsCL1Before = new TH2F("fHistTPConlyVsCL1Before","Before;Cent(CL1); TPC(FB1)",100,0,100,250,0,gMaxTPCcorrmult);
966  fHistTPConlyVsCL1After = new TH2F("fHistTPConlyVsCL1After","After; Cent(CL1); TPC(FB1) ",100,0,100,250,0,gMaxTPCcorrmult);
968 
969  fHistTPConlyVsV0MBefore = new TH2F("fHistTPConlyVsV0MBefore","Before;Cent(V0M); TPC(FB1)",100,0,100,250,0,gMaxTPCcorrmult);
971  fHistTPConlyVsV0MAfter = new TH2F("fHistTPConlyVsV0MAfter","After; Cent(V0M); TPC(FB1) ",100,0,100,250,0,gMaxTPCcorrmult);
973 
974  fHistRawVsCorrMultFB = new TH2F("fHistRawVsCorrMultFB",Form("FB%d;Mult_{raw};Mult_{corr}",fFilterBit),gMaxTPCFB1mult,0,gMaxTPCFB1mult,gMaxTPCcorrmult,0,gMaxTPCcorrmult);
976 
977 
978 
979 
980 
981 
982  // Turn off PID QA histograms
983  //---------------- PID QA Histograms ---------------------
984  /*
985  fHistTPCdEdxvsPBefore = new TH2F("fHistTPCdEdxvsPBefore","Before; p (GeV/c); dEdx (arb)",200,-5,5,200,0,250);
986  fListHist->Add(fHistTPCdEdxvsPBefore);
987  fHistTPCdEdxvsPAfter = new TH2F("fHistTPCdEdxvsPAfter"," After; p (GeV/c); dEdx (arb)",200,-5,5, 200,0,250);
988  fListHist->Add(fHistTPCdEdxvsPAfter);
989 
990  fHistTOFBetavsPBefore = new TH2F("fHistTOFBetavsPBefore","Before; p (GeV/c); beta ",200,-5,5,100,0.0,1.2);
991  fListHist->Add(fHistTOFBetavsPBefore);
992  fHistTOFBetavsPAfter = new TH2F("fHistTOFBetavsPAfter"," After; p (GeV/c); beta ",200,-5,5,100,0.0,1.2);
993  fListHist->Add(fHistTOFBetavsPAfter);
994 
995  fHistTOFMassvsPtBefore = new TH2F("fHistTOFMassvsPtBefore","Before; p_{T}(GeV/c); m^{2}(GeV^{2}/c^{4})",200,-5,5,500,-0.5,4.5);
996  fListHist->Add(fHistTOFMassvsPtBefore);
997 
998  //const char *gSpecies[4] = {"Pion","Kaon","proton","Charge"};
999 
1000  for(int i=0;i<3;i++){
1001  fHistPtwithTPCNsigma[i] = new TH1F(Form("fHistPtwithTPCNsigma_%d",i), Form("%d;p_{T}(GeV/c))",i),200,-5,5); //i
1002  fListHist->Add(fHistPtwithTPCNsigma[i]);
1003  fHistPtwithTOFmasscut[i] = new TH1F(Form("fHistPtwithTOFmasscut_%d",i),Form("%d;p_{T}(GeV/c))",i),200,-5,5);
1004  fListHist->Add(fHistPtwithTOFmasscut[i]);
1005  fHistPtwithTOFSignal[i] = new TH1F(Form("fHistPtwithTOFSignal_%d", i),Form("%d;p_{T}(GeV/c))",i),200,-5,5);
1006  fListHist->Add(fHistPtwithTOFSignal[i]);
1007 
1008  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);
1009  fListHist->Add(fHistTOFnSigmavsPtAfter[i]);
1010 
1011  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);
1012  fListHist->Add(fHistTPCnSigmavsPtAfter[i]);
1013 
1014  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);
1015  fListHist->Add(fHistTPCTOFnSigmavsPtAfter[i]);
1016 
1017  fHistTPCdEdxvsPtPIDAfter[i] = new TH2F(Form("fHistTPCdEdxvsPtAfter_%d",i),"AfterCut; p_{T} (GeV/c); dEdx (arb)",400,0,10,200,0,250);
1018  fListHist->Add(fHistTPCdEdxvsPtPIDAfter[i]);
1019  }// PID histograms done
1020  */
1021 
1022 
1023 
1024 
1025  fCentDistBefore = new TH1F("fCentDistBefore","no Cut; Cent (%); Events ",100,0,100);
1026  fListHist->Add(fCentDistBefore);
1027 
1028  fCentDistAfter = new TH1F("fCentDistAfter","with Cut; Cent (%); Events ",100,0,100);
1029  fListHist->Add(fCentDistAfter);
1030 
1031 
1032 
1033 
1034 
1035 
1036 
1037 
1038 
1039 
1040 
1041 
1042 
1043  Double_t centRange[11] = {0,5,10,20,30,40,50,60,70,80,90};
1044  //const char *gDetForEP[4] = {"V0A","V0C","TPC-A","TPC-C"};
1045 
1046  //------------------- 3p correlator vs Centrality (EP method) ------------------
1047  for(int i=0;i<2;i++){
1048  //Charged:
1049  for(int j=0;j<4;j++){
1050  //Detector: 0 = V0A, 1 = V0C, 3 = TPCA, 4 = TPCC
1051  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,"");
1052  //fHist_Corr3p_EP_Norm_PN[i][j]->Sumw2();
1053  fListHist->Add(fHist_Corr3p_EP_Norm_PN[i][j]);
1054  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,"");
1055  //fHist_Corr3p_EP_Norm_PP[i][j]->Sumw2();
1056  fListHist->Add(fHist_Corr3p_EP_Norm_PP[i][j]);
1057  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,"");
1058  //fHist_Corr3p_EP_Norm_NN[i][j]->Sumw2();
1059  fListHist->Add(fHist_Corr3p_EP_Norm_NN[i][j]);
1060  }
1061  //EP Resolution:
1062  for(int j=0;j<4;j++){
1063  //Det: 0 = v0c-v0a, 1 = v0a-TPC, 2 = v0c-TPC, 3 =TPC-A TPC-C
1064  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,"");
1065  //fHist_Reso2n_EP_Norm_Det[i][j]->Sumw2();
1066  fListHist->Add(fHist_Reso2n_EP_Norm_Det[i][j]);
1067  }
1068  //----------- PID -------------------
1069  for(int j=0;j<4;j++){ //Detector: 0 = V0A, 1 = V0C, 3 = TPCA, 4 = TPCC
1070  //----------> Pion:
1071  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,"");
1072  //fHist_Corr3p_Pion_EP_Norm_PN[i][j]->Sumw2();
1074  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,"");
1075  //fHist_Corr3p_Pion_EP_Norm_PP[i][j]->Sumw2();
1077  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,"");
1078  //fHist_Corr3p_Pion_EP_Norm_NN[i][j]->Sumw2();
1080  //----------> Kaon:
1081  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,"");
1082  //fHist_Corr3p_Kaon_EP_Norm_PN[i][j]->Sumw2();
1084  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,"");
1085  //fHist_Corr3p_Kaon_EP_Norm_PP[i][j]->Sumw2();
1087  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,"");
1088  //fHist_Corr3p_Kaon_EP_Norm_NN[i][j]->Sumw2();
1090  //----------> Proton:
1091  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,"");
1092  //fHist_Corr3p_Proton_EP_Norm_PN[i][j]->Sumw2();
1094  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,"");
1095  //fHist_Corr3p_Proton_EP_Norm_PP[i][j]->Sumw2();
1097  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,"");
1098  //fHist_Corr3p_Proton_EP_Norm_NN[i][j]->Sumw2();
1100  }//Det loop
1101  }//magfield loop
1102 
1103 
1104 
1105 
1106 
1107 
1108  /*
1109  //------------------- 3p correlator vs RefMult (EP method) ------------------
1110  for(int i=0;i<2;i++){
1111  //Charged:
1112  for(int j=0;j<4;j++){
1113  //Detector: 0 = V0A, 1 = V0C, 3 = TPCA, 4 = TPCC
1114  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,"");
1115  //fHist_Corr3p_EP_Refm_PN[i][j]->Sumw2();
1116  fListHist->Add(fHist_Corr3p_EP_Refm_PN[i][j]);
1117  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,"");
1118  //fHist_Corr3p_EP_Refm_PP[i][j]->Sumw2();
1119  fListHist->Add(fHist_Corr3p_EP_Refm_PP[i][j]);
1120  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,"");
1121  //fHist_Corr3p_EP_Refm_NN[i][j]->Sumw2();
1122  fListHist->Add(fHist_Corr3p_EP_Refm_NN[i][j]);
1123  }
1124  //EP Resolution:
1125  for(int j=0;j<4;j++){
1126  //Det: 0 = v0c-v0a, 1 = v0a-TPC, 2 = v0c-TPC, 3 =TPC-A TPC-C
1127  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,"");
1128  //fHist_Reso2n_EP_Refm_Det[i][j]->Sumw2();
1129  fListHist->Add(fHist_Reso2n_EP_Refm_Det[i][j]);
1130  }
1131  //----------- PID -------------------
1132  for(int j=0;j<4;j++){ //Detector: 0 = V0A, 1 = V0C, 3 = TPCA, 4 = TPCC
1133  //----------> Pion:
1134  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,"");
1135  //fHist_Corr3p_Pion_EP_Refm_PN[i][j]->Sumw2();
1136  fListHist->Add(fHist_Corr3p_Pion_EP_Refm_PN[i][j]);
1137  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,"");
1138  //fHist_Corr3p_Pion_EP_Refm_PP[i][j]->Sumw2();
1139  fListHist->Add(fHist_Corr3p_Pion_EP_Refm_PP[i][j]);
1140  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,"");
1141  //fHist_Corr3p_Pion_EP_Refm_NN[i][j]->Sumw2();
1142  fListHist->Add(fHist_Corr3p_Pion_EP_Refm_NN[i][j]);
1143  //----------> Kaon:
1144  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,"");
1145  //fHist_Corr3p_Kaon_EP_Refm_PN[i][j]->Sumw2();
1146  fListHist->Add(fHist_Corr3p_Kaon_EP_Refm_PN[i][j]);
1147  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,"");
1148  //fHist_Corr3p_Kaon_EP_Refm_PP[i][j]->Sumw2();
1149  fListHist->Add(fHist_Corr3p_Kaon_EP_Refm_PP[i][j]);
1150  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,"");
1151  //fHist_Corr3p_Kaon_EP_Refm_NN[i][j]->Sumw2();
1152  fListHist->Add(fHist_Corr3p_Kaon_EP_Refm_NN[i][j]);
1153  //----------> Proton:
1154  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,"");
1155  //fHist_Corr3p_Proton_EP_Refm_PN[i][j]->Sumw2();
1156  fListHist->Add(fHist_Corr3p_Proton_EP_Refm_PN[i][j]);
1157  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,"");
1158  //fHist_Corr3p_Proton_EP_Refm_PP[i][j]->Sumw2();
1159  fListHist->Add(fHist_Corr3p_Proton_EP_Refm_PP[i][j]);
1160  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,"");
1161  //fHist_Corr3p_Proton_EP_Refm_NN[i][j]->Sumw2();
1162  fListHist->Add(fHist_Corr3p_Proton_EP_Refm_NN[i][j]);
1163  }//Det loop
1164  }//magfield loop
1165  */
1166 
1167 
1168 
1169 
1170 
1171 
1172 
1173 
1174 
1175 
1176 
1177 
1178 
1179 
1180 
1181  /*
1182  //------------------- 2p correlator vs Centrality (EP method) ------------------
1183  for(int i=0;i<2;i++){
1184  for(int j=0;j<4;j++){
1185  //Detector: 0 = V0A, 1 = V0C, 3 = TPCA, 4 = TPCC
1186  fHist_Corr2p_EP_Norm_PN[i][j] = new TProfile(Form("fHist_Corr2p_EP_Norm_PosNeg_Mag%d_Harm%d",i,j+1),Form("US, n = %d",j),10,centRange,"");
1187  //fHist_Corr2p_EP_Norm_PN[i][j]->Sumw2();
1188  fListHist->Add(fHist_Corr2p_EP_Norm_PN[i][j]);
1189  fHist_Corr2p_EP_Norm_PP[i][j] = new TProfile(Form("fHist_Corr2p_EP_Norm_PosPos_Mag%d_Harm%d",i,j+1),Form("P-P, n = %d",j),10,centRange,"");
1190  //fHist_Corr2p_EP_Norm_PP[i][j]->Sumw2();
1191  fListHist->Add(fHist_Corr2p_EP_Norm_PP[i][j]);
1192  fHist_Corr2p_EP_Norm_NN[i][j] = new TProfile(Form("fHist_Corr2p_EP_Norm_NegNeg_Mag%d_Harm%d",i,j+1),Form("N-N, n = %d",j),10,centRange,"");
1193  //fHist_Corr2p_EP_Norm_NN[i][j]->Sumw2();
1194  fListHist->Add(fHist_Corr2p_EP_Norm_NN[i][j]);
1195  }
1196  //----------- PID -------------------
1197  for(int j=0;j<4;j++){ //Detector: 0 = V0A, 1 = V0C, 3 = TPCA, 4 = TPCC
1198  //----------> Pion:
1199  fHist_Corr2p_Pion_EP_Norm_PN[i][j] = new TProfile(Form("fHist_Corr2p_Pion_EP_Norm_PosNeg_Mag%d_Harm%d",i,j+1),Form("US, n = %d",j),10,centRange,"");
1200  //fHist_Corr2p_Pion_EP_Norm_PN[i][j]->Sumw2();
1201  fListHist->Add(fHist_Corr2p_Pion_EP_Norm_PN[i][j]);
1202  fHist_Corr2p_Pion_EP_Norm_PP[i][j] = new TProfile(Form("fHist_Corr2p_Pion_EP_Norm_PosPos_Mag%d_Harm%d",i,j+1),Form("P-P, n = %d",j),10,centRange,"");
1203  //fHist_Corr2p_Pion_EP_Norm_PP[i][j]->Sumw2();
1204  fListHist->Add(fHist_Corr2p_Pion_EP_Norm_PP[i][j]);
1205  fHist_Corr2p_Pion_EP_Norm_NN[i][j] = new TProfile(Form("fHist_Corr2p_Pion_EP_Norm_NegNeg_Mag%d_Harm%d",i,j+1),Form("N-N, n = %d",j),10,centRange,"");
1206  //fHist_Corr2p_Pion_EP_Norm_NN[i][j]->Sumw2();
1207  fListHist->Add(fHist_Corr2p_Pion_EP_Norm_NN[i][j]);
1208  //----------> Kaon:
1209  fHist_Corr2p_Kaon_EP_Norm_PN[i][j] = new TProfile(Form("fHist_Corr2p_Kaon_EP_Norm_PosNeg_Mag%d_Harm%d",i,j+1),Form("US, n = %d",j),10,centRange,"");
1210  //fHist_Corr2p_Kaon_EP_Norm_PN[i][j]->Sumw2();
1211  fListHist->Add(fHist_Corr2p_Kaon_EP_Norm_PN[i][j]);
1212  fHist_Corr2p_Kaon_EP_Norm_PP[i][j] = new TProfile(Form("fHist_Corr2p_Kaon_EP_Norm_PosPos_Mag%d_Harm%d",i,j+1),Form("P-P, n = %d",j),10,centRange,"");
1213  //fHist_Corr2p_Kaon_EP_Norm_PP[i][j]->Sumw2();
1214  fListHist->Add(fHist_Corr2p_Kaon_EP_Norm_PP[i][j]);
1215  fHist_Corr2p_Kaon_EP_Norm_NN[i][j] = new TProfile(Form("fHist_Corr2p_Kaon_EP_Norm_NegNeg_Mag%d_Harm%d",i,j+1),Form("N-N, n = %d",j),10,centRange,"");
1216  //fHist_Corr2p_Kaon_EP_Norm_NN[i][j]->Sumw2();
1217  fListHist->Add(fHist_Corr2p_Kaon_EP_Norm_NN[i][j]);
1218  //----------> Proton:
1219  fHist_Corr2p_Proton_EP_Norm_PN[i][j] = new TProfile(Form("fHist_Corr2p_Proton_EP_Norm_PosNeg_Mag%d_Harm%d",i,j+1),Form("US, n = %d",j),10,centRange,"");
1220  //fHist_Corr2p_Proton_EP_Norm_PN[i][j]->Sumw2();
1221  fListHist->Add(fHist_Corr2p_Proton_EP_Norm_PN[i][j]);
1222  fHist_Corr2p_Proton_EP_Norm_PP[i][j] = new TProfile(Form("fHist_Corr2p_Proton_EP_Norm_PosPos_Mag%d_Harm%d",i,j+1),Form("P-P, n = %d",j),10,centRange,"");
1223  //fHist_Corr2p_Proton_EP_Norm_PP[i][j]->Sumw2();
1224  fListHist->Add(fHist_Corr2p_Proton_EP_Norm_PP[i][j]);
1225  fHist_Corr2p_Proton_EP_Norm_NN[i][j] = new TProfile(Form("fHist_Corr2p_Proton_EP_Norm_NegNeg_Mag%d_Harm%d",i,j+1),Form("N-N, n = %d",j),10,centRange,"");
1226  //fHist_Corr2p_Proton_EP_Norm_NN[i][j]->Sumw2();
1227  fListHist->Add(fHist_Corr2p_Proton_EP_Norm_NN[i][j]);
1228  }//Det loop
1229  }//magfield loop
1230  */
1231 
1232 
1233 
1234  /*
1235  //------------------- 2p correlator vs Refmult (EP method) ------------------
1236  for(int i=0;i<2;i++){
1237  for(int j=0;j<4;j++){
1238  //Detector: 0 = V0A, 1 = V0C, 3 = TPCA, 4 = TPCC
1239  fHist_Corr2p_EP_Refm_PN[i][j] = new TProfile(Form("fHist_Corr2p_EP_Refm_PosNeg_Mag%d_Harm%d",i,j+1),Form("US, n = %d",j),nBinRefMult,0,nRefMultMax,"");
1240  //fHist_Corr2p_EP_Refm_PN[i][j]->Sumw2();
1241  fListHist->Add(fHist_Corr2p_EP_Refm_PN[i][j]);
1242  fHist_Corr2p_EP_Refm_PP[i][j] = new TProfile(Form("fHist_Corr2p_EP_Refm_PosPos_Mag%d_Harm%d",i,j+1),Form("P-P, n = %d",j),nBinRefMult,0,nRefMultMax,"");
1243  //fHist_Corr2p_EP_Refm_PP[i][j]->Sumw2();
1244  fListHist->Add(fHist_Corr2p_EP_Refm_PP[i][j]);
1245  fHist_Corr2p_EP_Refm_NN[i][j] = new TProfile(Form("fHist_Corr2p_EP_Refm_NegNeg_Mag%d_Harm%d",i,j+1),Form("N-N, n = %d",j),nBinRefMult,0,nRefMultMax,"");
1246  //fHist_Corr2p_EP_Refm_NN[i][j]->Sumw2();
1247  fListHist->Add(fHist_Corr2p_EP_Refm_NN[i][j]);
1248  }
1249  //----------- PID -------------------
1250  for(int j=0;j<4;j++){ //Detector: 0 = V0A, 1 = V0C, 3 = TPCA, 4 = TPCC
1251  //----------> Pion:
1252  fHist_Corr2p_Pion_EP_Refm_PN[i][j] = new TProfile(Form("fHist_Corr2p_Pion_EP_Refm_PosNeg_Mag%d_Harm%d",i,j+1),Form("US, n = %d",j),nBinRefMult,0,nRefMultMax,"");
1253  //fHist_Corr2p_Pion_EP_Refm_PN[i][j]->Sumw2();
1254  fListHist->Add(fHist_Corr2p_Pion_EP_Refm_PN[i][j]);
1255  fHist_Corr2p_Pion_EP_Refm_PP[i][j] = new TProfile(Form("fHist_Corr2p_Pion_EP_Refm_PosPos_Mag%d_Harm%d",i,j+1),Form("P-P, n = %d",j),nBinRefMult,0,nRefMultMax,"");
1256  //fHist_Corr2p_Pion_EP_Refm_PP[i][j]->Sumw2();
1257  fListHist->Add(fHist_Corr2p_Pion_EP_Refm_PP[i][j]);
1258  fHist_Corr2p_Pion_EP_Refm_NN[i][j] = new TProfile(Form("fHist_Corr2p_Pion_EP_Refm_NegNeg_Mag%d_Harm%d",i,j+1),Form("N-N, n = %d",j),nBinRefMult,0,nRefMultMax,"");
1259  //fHist_Corr2p_Pion_EP_Refm_NN[i][j]->Sumw2();
1260  fListHist->Add(fHist_Corr2p_Pion_EP_Refm_NN[i][j]);
1261  //----------> Kaon:
1262  fHist_Corr2p_Kaon_EP_Refm_PN[i][j] = new TProfile(Form("fHist_Corr2p_Kaon_EP_Refm_PosNeg_Mag%d_Harm%d",i,j+1),Form("US, n = %d",j),nBinRefMult,0,nRefMultMax,"");
1263  //fHist_Corr2p_Kaon_EP_Refm_PN[i][j]->Sumw2();
1264  fListHist->Add(fHist_Corr2p_Kaon_EP_Refm_PN[i][j]);
1265  fHist_Corr2p_Kaon_EP_Refm_PP[i][j] = new TProfile(Form("fHist_Corr2p_Kaon_EP_Refm_PosPos_Mag%d_Harm%d",i,j+1),Form("P-P, n = %d",j),nBinRefMult,0,nRefMultMax,"");
1266  //fHist_Corr2p_Kaon_EP_Refm_PP[i][j]->Sumw2();
1267  fListHist->Add(fHist_Corr2p_Kaon_EP_Refm_PP[i][j]);
1268  fHist_Corr2p_Kaon_EP_Refm_NN[i][j] = new TProfile(Form("fHist_Corr2p_Kaon_EP_Refm_NegNeg_Mag%d_Harm%d",i,j+1),Form("N-N, n = %d",j),nBinRefMult,0,nRefMultMax,"");
1269  //fHist_Corr2p_Kaon_EP_Refm_NN[i][j]->Sumw2();
1270  fListHist->Add(fHist_Corr2p_Kaon_EP_Refm_NN[i][j]);
1271  //----------> Proton:
1272  fHist_Corr2p_Proton_EP_Refm_PN[i][j] = new TProfile(Form("fHist_Corr2p_Proton_EP_Refm_PosNeg_Mag%d_Harm%d",i,j+1),Form("US, n = %d",j),nBinRefMult,0,nRefMultMax,"");
1273  //fHist_Corr2p_Proton_EP_Refm_PN[i][j]->Sumw2();
1274  fListHist->Add(fHist_Corr2p_Proton_EP_Refm_PN[i][j]);
1275  fHist_Corr2p_Proton_EP_Refm_PP[i][j] = new TProfile(Form("fHist_Corr2p_Proton_EP_Refm_PosPos_Mag%d_Harm%d",i,j+1),Form("P-P, n = %d",j),nBinRefMult,0,nRefMultMax,"");
1276  //fHist_Corr2p_Proton_EP_Refm_PP[i][j]->Sumw2();
1277  fListHist->Add(fHist_Corr2p_Proton_EP_Refm_PP[i][j]);
1278  fHist_Corr2p_Proton_EP_Refm_NN[i][j] = new TProfile(Form("fHist_Corr2p_Proton_EP_Refm_NegNeg_Mag%d_Harm%d",i,j+1),Form("N-N, n = %d",j),nBinRefMult,0,nRefMultMax,"");
1279  //fHist_Corr2p_Proton_EP_Refm_NN[i][j]->Sumw2();
1280  fListHist->Add(fHist_Corr2p_Proton_EP_Refm_NN[i][j]);
1281  }//Det loop
1282  }//magfield loop
1283 
1284  */
1285 
1286 
1287 
1288 
1289 
1290 
1291 
1292 
1293 
1294 
1295 
1296 
1297 
1298 
1299 
1300 
1301 
1302  //--------- Differential PID ------------
1303 
1304  Char_t name[100];
1305  Char_t title[100];
1306 
1307  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};
1308 //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};
1309 
1310  //Charge:
1311  for(Int_t i=0;i<2;i++){
1312  for(Int_t j=0;j<6;j++){
1313  sprintf(name,"fHist_Corr3p_pTSum_EP_V0A_PN_Mag%d_Cent%d",i,j);
1314  sprintf(title,"PN 3p vs (pT1+pT2)/2, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
1315  fHist_Corr3p_pTSum_EP_V0A_PN[i][j] = new TProfile(name,title,20,pTRange,"");
1316  fHist_Corr3p_pTSum_EP_V0A_PN[i][j]->Sumw2();
1318 
1319  sprintf(name,"fHist_Corr3p_pTSum_EP_V0A_PP_Mag%d_Cent%d",i,j);
1320  sprintf(title,"PP 3p vs (pT1+pT2)/2, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
1321  fHist_Corr3p_pTSum_EP_V0A_PP[i][j] = new TProfile(name,title,20,pTRange,"");
1322  fHist_Corr3p_pTSum_EP_V0A_PP[i][j]->Sumw2();
1324 
1325  sprintf(name,"fHist_Corr3p_pTSum_EP_V0A_NN_Mag%d_Cent%d",i,j);
1326  sprintf(title,"NN 3p vs (pT1+pT2)/2, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
1327  fHist_Corr3p_pTSum_EP_V0A_NN[i][j] = new TProfile(name,title,20,pTRange,"");
1328  fHist_Corr3p_pTSum_EP_V0A_NN[i][j]->Sumw2();
1330  //-----v0c----
1331  sprintf(name,"fHist_Corr3p_pTSum_EP_V0C_PN_Mag%d_Cent%d",i,j);
1332  sprintf(title,"PN 3p vs (pT1+pT2)/2, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
1333  fHist_Corr3p_pTSum_EP_V0C_PN[i][j] = new TProfile(name,title,20,pTRange,"");
1334  fHist_Corr3p_pTSum_EP_V0C_PN[i][j]->Sumw2();
1336 
1337  sprintf(name,"fHist_Corr3p_pTSum_EP_V0C_PP_Mag%d_Cent%d",i,j);
1338  sprintf(title,"PP 3p vs (pT1+pT2)/2, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
1339  fHist_Corr3p_pTSum_EP_V0C_PP[i][j] = new TProfile(name,title,20,pTRange,"");
1340  fHist_Corr3p_pTSum_EP_V0C_PP[i][j]->Sumw2();
1342 
1343  sprintf(name,"fHist_Corr3p_pTSum_EP_V0C_NN_Mag%d_Cent%d",i,j);
1344  sprintf(title,"NN 3p vs (pT1+pT2)/2, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
1345  fHist_Corr3p_pTSum_EP_V0C_NN[i][j] = new TProfile(name,title,20,pTRange,"");
1346  fHist_Corr3p_pTSum_EP_V0C_NN[i][j]->Sumw2();
1348  }
1349  }
1350 
1351  for(Int_t i=0;i<2;i++){
1352  for(Int_t j=0;j<6;j++){
1353  sprintf(name,"fHist_Corr3p_pTDiff_EP_V0A_PN_Mag%d_Cent%d",i,j);
1354  sprintf(title,"PN 3p vs |pT1-pT2|, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
1355  fHist_Corr3p_pTDiff_EP_V0A_PN[i][j] = new TProfile(name,title,20,pTRange,"");
1356  fHist_Corr3p_pTDiff_EP_V0A_PN[i][j]->Sumw2();
1358 
1359  sprintf(name,"fHist_Corr3p_pTDiff_EP_V0A_PP_Mag%d_Cent%d",i,j);
1360  sprintf(title,"PP 3p vs |pT1-pT2|, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
1361  fHist_Corr3p_pTDiff_EP_V0A_PP[i][j] = new TProfile(name,title,20,pTRange,"");
1362  fHist_Corr3p_pTDiff_EP_V0A_PP[i][j]->Sumw2();
1364 
1365  sprintf(name,"fHist_Corr3p_pTDiff_EP_V0A_NN_Mag%d_Cent%d",i,j);
1366  sprintf(title,"NN 3p vs |pT1-pT2|, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
1367  fHist_Corr3p_pTDiff_EP_V0A_NN[i][j] = new TProfile(name,title,20,pTRange,"");
1368  fHist_Corr3p_pTDiff_EP_V0A_NN[i][j]->Sumw2();
1370  //-----v0c----
1371  sprintf(name,"fHist_Corr3p_pTDiff_EP_V0C_PN_Mag%d_Cent%d",i,j);
1372  sprintf(title,"PN 3p vs |pT1-pT2|, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
1373  fHist_Corr3p_pTDiff_EP_V0C_PN[i][j] = new TProfile(name,title,20,pTRange,"");
1374  fHist_Corr3p_pTDiff_EP_V0C_PN[i][j]->Sumw2();
1376 
1377  sprintf(name,"fHist_Corr3p_pTDiff_EP_V0C_PP_Mag%d_Cent%d",i,j);
1378  sprintf(title,"PP 3p vs |pT1-pT2|, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
1379  fHist_Corr3p_pTDiff_EP_V0C_PP[i][j] = new TProfile(name,title,20,pTRange,"");
1380  fHist_Corr3p_pTDiff_EP_V0C_PP[i][j]->Sumw2();
1382 
1383  sprintf(name,"fHist_Corr3p_pTDiff_EP_V0C_NN_Mag%d_Cent%d",i,j);
1384  sprintf(title,"NN 3p vs |pT1-pT2|, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
1385  fHist_Corr3p_pTDiff_EP_V0C_NN[i][j] = new TProfile(name,title,20,pTRange,"");
1386  fHist_Corr3p_pTDiff_EP_V0C_NN[i][j]->Sumw2();
1388  }
1389  }
1390 
1391  //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
1392  //Now Eta binning: 16,0,1.6 for test
1393 
1394  for(Int_t i=0;i<2;i++){
1395  for(Int_t j=0;j<6;j++){
1396  sprintf(name,"fHist_Corr3p_EtaDiff_EP_V0A_PN_Mag%d_Cent%d",i,j);
1397  sprintf(title,"PN 3p vs |Eta1-Eta2|, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
1398  fHist_Corr3p_EtaDiff_EP_V0A_PN[i][j] = new TProfile(name,title,8,0,1.6,"");
1399  fHist_Corr3p_EtaDiff_EP_V0A_PN[i][j]->Sumw2();
1401 
1402  sprintf(name,"fHist_Corr3p_EtaDiff_EP_V0A_PP_Mag%d_Cent%d",i,j);
1403  sprintf(title,"PP 3p vs |Eta1-Eta2|, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
1404  fHist_Corr3p_EtaDiff_EP_V0A_PP[i][j] = new TProfile(name,title,8,0,1.6,"");
1405  fHist_Corr3p_EtaDiff_EP_V0A_PP[i][j]->Sumw2();
1407 
1408  sprintf(name,"fHist_Corr3p_EtaDiff_EP_V0A_NN_Mag%d_Cent%d",i,j);
1409  sprintf(title,"NN 3p vs |Eta1-Eta2|, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
1410  fHist_Corr3p_EtaDiff_EP_V0A_NN[i][j] = new TProfile(name,title,8,0,1.6,"");
1411  fHist_Corr3p_EtaDiff_EP_V0A_NN[i][j]->Sumw2();
1413  //-----v0c----
1414  sprintf(name,"fHist_Corr3p_EtaDiff_EP_V0C_PN_Mag%d_Cent%d",i,j);
1415  sprintf(title,"PN 3p vs |Eta1-Eta2|, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
1416  fHist_Corr3p_EtaDiff_EP_V0C_PN[i][j] = new TProfile(name,title,8,0,1.6,"");
1417  fHist_Corr3p_EtaDiff_EP_V0C_PN[i][j]->Sumw2();
1419 
1420  sprintf(name,"fHist_Corr3p_EtaDiff_EP_V0C_PP_Mag%d_Cent%d",i,j);
1421  sprintf(title,"PP 3p vs |Eta1-Eta2|, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
1422  fHist_Corr3p_EtaDiff_EP_V0C_PP[i][j] = new TProfile(name,title,8,0,1.6,"");
1423  fHist_Corr3p_EtaDiff_EP_V0C_PP[i][j]->Sumw2();
1425 
1426  sprintf(name,"fHist_Corr3p_EtaDiff_EP_V0C_NN_Mag%d_Cent%d",i,j);
1427  sprintf(title,"NN 3p vs |Eta1-Eta2|, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
1428  fHist_Corr3p_EtaDiff_EP_V0C_NN[i][j] = new TProfile(name,title,8,0,1.6,"");
1429  fHist_Corr3p_EtaDiff_EP_V0C_NN[i][j]->Sumw2();
1431  }
1432  }
1433 
1434  // Pion
1435  for(Int_t i=0;i<2;i++){
1436  for(Int_t j=0;j<6;j++){
1437  sprintf(name,"fHist_Corr3p_Pion_pTSum_EP_V0A_PN_Mag%d_Cent%d",i,j);
1438  sprintf(title,"PN 3p vs (pT1+pT2)/2, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
1439  fHist_Corr3p_Pion_pTSum_EP_V0A_PN[i][j] = new TProfile(name,title,20,pTRange,"");
1440  fHist_Corr3p_Pion_pTSum_EP_V0A_PN[i][j]->Sumw2();
1442 
1443  sprintf(name,"fHist_Corr3p_Pion_pTSum_EP_V0A_PP_Mag%d_Cent%d",i,j);
1444  sprintf(title,"PP 3p vs (pT1+pT2)/2, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
1445  fHist_Corr3p_Pion_pTSum_EP_V0A_PP[i][j] = new TProfile(name,title,20,pTRange,"");
1446  fHist_Corr3p_Pion_pTSum_EP_V0A_PP[i][j]->Sumw2();
1448 
1449  sprintf(name,"fHist_Corr3p_Pion_pTSum_EP_V0A_NN_Mag%d_Cent%d",i,j);
1450  sprintf(title,"NN 3p vs (pT1+pT2)/2, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
1451  fHist_Corr3p_Pion_pTSum_EP_V0A_NN[i][j] = new TProfile(name,title,20,pTRange,"");
1452  fHist_Corr3p_Pion_pTSum_EP_V0A_NN[i][j]->Sumw2();
1454  //-----v0c----
1455  sprintf(name,"fHist_Corr3p_Pion_pTSum_EP_V0C_PN_Mag%d_Cent%d",i,j);
1456  sprintf(title,"PN 3p vs (pT1+pT2)/2, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
1457  fHist_Corr3p_Pion_pTSum_EP_V0C_PN[i][j] = new TProfile(name,title,20,pTRange,"");
1458  fHist_Corr3p_Pion_pTSum_EP_V0C_PN[i][j]->Sumw2();
1460 
1461  sprintf(name,"fHist_Corr3p_Pion_pTSum_EP_V0C_PP_Mag%d_Cent%d",i,j);
1462  sprintf(title,"PP 3p vs (pT1+pT2)/2, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
1463  fHist_Corr3p_Pion_pTSum_EP_V0C_PP[i][j] = new TProfile(name,title,20,pTRange,"");
1464  fHist_Corr3p_Pion_pTSum_EP_V0C_PP[i][j]->Sumw2();
1466 
1467  sprintf(name,"fHist_Corr3p_Pion_pTSum_EP_V0C_NN_Mag%d_Cent%d",i,j);
1468  sprintf(title,"NN 3p vs (pT1+pT2)/2, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
1469  fHist_Corr3p_Pion_pTSum_EP_V0C_NN[i][j] = new TProfile(name,title,20,pTRange,"");
1470  fHist_Corr3p_Pion_pTSum_EP_V0C_NN[i][j]->Sumw2();
1472  }
1473  }
1474 
1475  for(Int_t i=0;i<2;i++){
1476  for(Int_t j=0;j<6;j++){
1477  sprintf(name,"fHist_Corr3p_Pion_pTDiff_EP_V0A_PN_Mag%d_Cent%d",i,j);
1478  sprintf(title,"PN 3p vs |pT1-pT2|, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
1479  fHist_Corr3p_Pion_pTDiff_EP_V0A_PN[i][j] = new TProfile(name,title,20,pTRange,"");
1480  fHist_Corr3p_Pion_pTDiff_EP_V0A_PN[i][j]->Sumw2();
1482 
1483  sprintf(name,"fHist_Corr3p_Pion_pTDiff_EP_V0A_PP_Mag%d_Cent%d",i,j);
1484  sprintf(title,"PP 3p vs |pT1-pT2|, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
1485  fHist_Corr3p_Pion_pTDiff_EP_V0A_PP[i][j] = new TProfile(name,title,20,pTRange,"");
1486  fHist_Corr3p_Pion_pTDiff_EP_V0A_PP[i][j]->Sumw2();
1488 
1489  sprintf(name,"fHist_Corr3p_Pion_pTDiff_EP_V0A_NN_Mag%d_Cent%d",i,j);
1490  sprintf(title,"NN 3p vs |pT1-pT2|, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
1491  fHist_Corr3p_Pion_pTDiff_EP_V0A_NN[i][j] = new TProfile(name,title,20,pTRange,"");
1492  fHist_Corr3p_Pion_pTDiff_EP_V0A_NN[i][j]->Sumw2();
1494  //-----v0c----
1495  sprintf(name,"fHist_Corr3p_Pion_pTDiff_EP_V0C_PN_Mag%d_Cent%d",i,j);
1496  sprintf(title,"PN 3p vs |pT1-pT2|, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
1497  fHist_Corr3p_Pion_pTDiff_EP_V0C_PN[i][j] = new TProfile(name,title,20,pTRange,"");
1498  fHist_Corr3p_Pion_pTDiff_EP_V0C_PN[i][j]->Sumw2();
1500 
1501  sprintf(name,"fHist_Corr3p_Pion_pTDiff_EP_V0C_PP_Mag%d_Cent%d",i,j);
1502  sprintf(title,"PP 3p vs |pT1-pT2|, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
1503  fHist_Corr3p_Pion_pTDiff_EP_V0C_PP[i][j] = new TProfile(name,title,20,pTRange,"");
1504  fHist_Corr3p_Pion_pTDiff_EP_V0C_PP[i][j]->Sumw2();
1506 
1507  sprintf(name,"fHist_Corr3p_Pion_pTDiff_EP_V0C_NN_Mag%d_Cent%d",i,j);
1508  sprintf(title,"NN 3p vs |pT1-pT2|, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
1509  fHist_Corr3p_Pion_pTDiff_EP_V0C_NN[i][j] = new TProfile(name,title,20,pTRange,"");
1510  fHist_Corr3p_Pion_pTDiff_EP_V0C_NN[i][j]->Sumw2();
1512  }
1513  }
1514 
1515  //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
1516 
1517  for(Int_t i=0;i<2;i++){
1518  for(Int_t j=0;j<6;j++){
1519  sprintf(name,"fHist_Corr3p_Pion_EtaDiff_EP_V0A_PN_Mag%d_Cent%d",i,j);
1520  sprintf(title,"PN 3p vs |Eta1-Eta2|, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
1521  fHist_Corr3p_Pion_EtaDiff_EP_V0A_PN[i][j] = new TProfile(name,title,16,0,1.6,"");
1522  fHist_Corr3p_Pion_EtaDiff_EP_V0A_PN[i][j]->Sumw2();
1524 
1525  sprintf(name,"fHist_Corr3p_Pion_EtaDiff_EP_V0A_PP_Mag%d_Cent%d",i,j);
1526  sprintf(title,"PP 3p vs |Eta1-Eta2|, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
1527  fHist_Corr3p_Pion_EtaDiff_EP_V0A_PP[i][j] = new TProfile(name,title,16,0,1.6,"");
1528  fHist_Corr3p_Pion_EtaDiff_EP_V0A_PP[i][j]->Sumw2();
1530 
1531  sprintf(name,"fHist_Corr3p_Pion_EtaDiff_EP_V0A_NN_Mag%d_Cent%d",i,j);
1532  sprintf(title,"NN 3p vs |Eta1-Eta2|, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
1533  fHist_Corr3p_Pion_EtaDiff_EP_V0A_NN[i][j] = new TProfile(name,title,16,0,1.6,"");
1534  fHist_Corr3p_Pion_EtaDiff_EP_V0A_NN[i][j]->Sumw2();
1536  //-----v0c----
1537  sprintf(name,"fHist_Corr3p_Pion_EtaDiff_EP_V0C_PN_Mag%d_Cent%d",i,j);
1538  sprintf(title,"PN 3p vs |Eta1-Eta2|, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
1539  fHist_Corr3p_Pion_EtaDiff_EP_V0C_PN[i][j] = new TProfile(name,title,16,0,1.6,"");
1540  fHist_Corr3p_Pion_EtaDiff_EP_V0C_PN[i][j]->Sumw2();
1542 
1543  sprintf(name,"fHist_Corr3p_Pion_EtaDiff_EP_V0C_PP_Mag%d_Cent%d",i,j);
1544  sprintf(title,"PP 3p vs |Eta1-Eta2|, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
1545  fHist_Corr3p_Pion_EtaDiff_EP_V0C_PP[i][j] = new TProfile(name,title,16,0,1.6,"");
1546  fHist_Corr3p_Pion_EtaDiff_EP_V0C_PP[i][j]->Sumw2();
1548 
1549  sprintf(name,"fHist_Corr3p_Pion_EtaDiff_EP_V0C_NN_Mag%d_Cent%d",i,j);
1550  sprintf(title,"NN 3p vs |Eta1-Eta2|, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
1551  fHist_Corr3p_Pion_EtaDiff_EP_V0C_NN[i][j] = new TProfile(name,title,16,0,1.6,"");
1552  fHist_Corr3p_Pion_EtaDiff_EP_V0C_NN[i][j]->Sumw2();
1554  }
1555  }
1556 
1557  //Kaon
1558  for(Int_t i=0;i<2;i++){
1559  for(Int_t j=0;j<6;j++){
1560  sprintf(name,"fHist_Corr3p_Kaon_pTSum_EP_V0A_PN_Mag%d_Cent%d",i,j);
1561  sprintf(title,"PN 3p vs (pT1+pT2)/2, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
1562  fHist_Corr3p_Kaon_pTSum_EP_V0A_PN[i][j] = new TProfile(name,title,20,pTRange,"");
1563  fHist_Corr3p_Kaon_pTSum_EP_V0A_PN[i][j]->Sumw2();
1565 
1566  sprintf(name,"fHist_Corr3p_Kaon_pTSum_EP_V0A_PP_Mag%d_Cent%d",i,j);
1567  sprintf(title,"PP 3p vs (pT1+pT2)/2, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
1568  fHist_Corr3p_Kaon_pTSum_EP_V0A_PP[i][j] = new TProfile(name,title,20,pTRange,"");
1569  fHist_Corr3p_Kaon_pTSum_EP_V0A_PP[i][j]->Sumw2();
1571 
1572  sprintf(name,"fHist_Corr3p_Kaon_pTSum_EP_V0A_NN_Mag%d_Cent%d",i,j);
1573  sprintf(title,"NN 3p vs (pT1+pT2)/2, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
1574  fHist_Corr3p_Kaon_pTSum_EP_V0A_NN[i][j] = new TProfile(name,title,20,pTRange,"");
1575  fHist_Corr3p_Kaon_pTSum_EP_V0A_NN[i][j]->Sumw2();
1577  //-----v0c----
1578  sprintf(name,"fHist_Corr3p_Kaon_pTSum_EP_V0C_PN_Mag%d_Cent%d",i,j);
1579  sprintf(title,"PN 3p vs (pT1+pT2)/2, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
1580  fHist_Corr3p_Kaon_pTSum_EP_V0C_PN[i][j] = new TProfile(name,title,20,pTRange,"");
1581  fHist_Corr3p_Kaon_pTSum_EP_V0C_PN[i][j]->Sumw2();
1583 
1584  sprintf(name,"fHist_Corr3p_Kaon_pTSum_EP_V0C_PP_Mag%d_Cent%d",i,j);
1585  sprintf(title,"PP 3p vs (pT1+pT2)/2, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
1586  fHist_Corr3p_Kaon_pTSum_EP_V0C_PP[i][j] = new TProfile(name,title,20,pTRange,"");
1587  fHist_Corr3p_Kaon_pTSum_EP_V0C_PP[i][j]->Sumw2();
1589 
1590  sprintf(name,"fHist_Corr3p_Kaon_pTSum_EP_V0C_NN_Mag%d_Cent%d",i,j);
1591  sprintf(title,"NN 3p vs (pT1+pT2)/2, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
1592  fHist_Corr3p_Kaon_pTSum_EP_V0C_NN[i][j] = new TProfile(name,title,20,pTRange,"");
1593  fHist_Corr3p_Kaon_pTSum_EP_V0C_NN[i][j]->Sumw2();
1595  }
1596  }
1597 
1598  for(Int_t i=0;i<2;i++){
1599  for(Int_t j=0;j<6;j++){
1600  sprintf(name,"fHist_Corr3p_Kaon_pTDiff_EP_V0A_PN_Mag%d_Cent%d",i,j);
1601  sprintf(title,"PN 3p vs |pT1-pT2|, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
1602  fHist_Corr3p_Kaon_pTDiff_EP_V0A_PN[i][j] = new TProfile(name,title,20,pTRange,"");
1603  fHist_Corr3p_Kaon_pTDiff_EP_V0A_PN[i][j]->Sumw2();
1605 
1606  sprintf(name,"fHist_Corr3p_Kaon_pTDiff_EP_V0A_PP_Mag%d_Cent%d",i,j);
1607  sprintf(title,"PP 3p vs |pT1-pT2|, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
1608  fHist_Corr3p_Kaon_pTDiff_EP_V0A_PP[i][j] = new TProfile(name,title,20,pTRange,"");
1609  fHist_Corr3p_Kaon_pTDiff_EP_V0A_PP[i][j]->Sumw2();
1611 
1612  sprintf(name,"fHist_Corr3p_Kaon_pTDiff_EP_V0A_NN_Mag%d_Cent%d",i,j);
1613  sprintf(title,"NN 3p vs |pT1-pT2|, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
1614  fHist_Corr3p_Kaon_pTDiff_EP_V0A_NN[i][j] = new TProfile(name,title,20,pTRange,"");
1615  fHist_Corr3p_Kaon_pTDiff_EP_V0A_NN[i][j]->Sumw2();
1617  //-----v0c----
1618  sprintf(name,"fHist_Corr3p_Kaon_pTDiff_EP_V0C_PN_Mag%d_Cent%d",i,j);
1619  sprintf(title,"PN 3p vs |pT1-pT2|, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
1620  fHist_Corr3p_Kaon_pTDiff_EP_V0C_PN[i][j] = new TProfile(name,title,20,pTRange,"");
1621  fHist_Corr3p_Kaon_pTDiff_EP_V0C_PN[i][j]->Sumw2();
1623 
1624  sprintf(name,"fHist_Corr3p_Kaon_pTDiff_EP_V0C_PP_Mag%d_Cent%d",i,j);
1625  sprintf(title,"PP 3p vs |pT1-pT2|, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
1626  fHist_Corr3p_Kaon_pTDiff_EP_V0C_PP[i][j] = new TProfile(name,title,20,pTRange,"");
1627  fHist_Corr3p_Kaon_pTDiff_EP_V0C_PP[i][j]->Sumw2();
1629 
1630  sprintf(name,"fHist_Corr3p_Kaon_pTDiff_EP_V0C_NN_Mag%d_Cent%d",i,j);
1631  sprintf(title,"NN 3p vs |pT1-pT2|, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
1632  fHist_Corr3p_Kaon_pTDiff_EP_V0C_NN[i][j] = new TProfile(name,title,20,pTRange,"");
1633  fHist_Corr3p_Kaon_pTDiff_EP_V0C_NN[i][j]->Sumw2();
1635  }
1636  }
1637 
1638  //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
1639 
1640  for(Int_t i=0;i<2;i++){
1641  for(Int_t j=0;j<6;j++){
1642  sprintf(name,"fHist_Corr3p_Kaon_EtaDiff_EP_V0A_PN_Mag%d_Cent%d",i,j);
1643  sprintf(title,"PN 3p vs |Eta1-Eta2|, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
1644  fHist_Corr3p_Kaon_EtaDiff_EP_V0A_PN[i][j] = new TProfile(name,title,16,0,1.6,"");
1645  fHist_Corr3p_Kaon_EtaDiff_EP_V0A_PN[i][j]->Sumw2();
1647 
1648  sprintf(name,"fHist_Corr3p_Kaon_EtaDiff_EP_V0A_PP_Mag%d_Cent%d",i,j);
1649  sprintf(title,"PP 3p vs |Eta1-Eta2|, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
1650  fHist_Corr3p_Kaon_EtaDiff_EP_V0A_PP[i][j] = new TProfile(name,title,16,0,1.6,"");
1651  fHist_Corr3p_Kaon_EtaDiff_EP_V0A_PP[i][j]->Sumw2();
1653 
1654  sprintf(name,"fHist_Corr3p_Kaon_EtaDiff_EP_V0A_NN_Mag%d_Cent%d",i,j);
1655  sprintf(title,"NN 3p vs |Eta1-Eta2|, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
1656  fHist_Corr3p_Kaon_EtaDiff_EP_V0A_NN[i][j] = new TProfile(name,title,16,0,1.6,"");
1657  fHist_Corr3p_Kaon_EtaDiff_EP_V0A_NN[i][j]->Sumw2();
1659  //-----v0c----
1660  sprintf(name,"fHist_Corr3p_Kaon_EtaDiff_EP_V0C_PN_Mag%d_Cent%d",i,j);
1661  sprintf(title,"PN 3p vs |Eta1-Eta2|, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
1662  fHist_Corr3p_Kaon_EtaDiff_EP_V0C_PN[i][j] = new TProfile(name,title,16,0,1.6,"");
1663  fHist_Corr3p_Kaon_EtaDiff_EP_V0C_PN[i][j]->Sumw2();
1665 
1666  sprintf(name,"fHist_Corr3p_Kaon_EtaDiff_EP_V0C_PP_Mag%d_Cent%d",i,j);
1667  sprintf(title,"PP 3p vs |Eta1-Eta2|, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
1668  fHist_Corr3p_Kaon_EtaDiff_EP_V0C_PP[i][j] = new TProfile(name,title,16,0,1.6,"");
1669  fHist_Corr3p_Kaon_EtaDiff_EP_V0C_PP[i][j]->Sumw2();
1671 
1672  sprintf(name,"fHist_Corr3p_Kaon_EtaDiff_EP_V0C_NN_Mag%d_Cent%d",i,j);
1673  sprintf(title,"NN 3p vs |Eta1-Eta2|, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
1674  fHist_Corr3p_Kaon_EtaDiff_EP_V0C_NN[i][j] = new TProfile(name,title,16,0,1.6,"");
1675  fHist_Corr3p_Kaon_EtaDiff_EP_V0C_NN[i][j]->Sumw2();
1677  }
1678  }
1679 
1680  //Proton
1681  for(Int_t i=0;i<2;i++){
1682  for(Int_t j=0;j<6;j++){
1683  sprintf(name,"fHist_Corr3p_Proton_pTSum_EP_V0A_PN_Mag%d_Cent%d",i,j);
1684  sprintf(title,"PN 3p vs (pT1+pT2)/2, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
1685  fHist_Corr3p_Proton_pTSum_EP_V0A_PN[i][j] = new TProfile(name,title,20,pTRange,"");
1686  fHist_Corr3p_Proton_pTSum_EP_V0A_PN[i][j]->Sumw2();
1688 
1689  sprintf(name,"fHist_Corr3p_Proton_pTSum_EP_V0A_PP_Mag%d_Cent%d",i,j);
1690  sprintf(title,"PP 3p vs (pT1+pT2)/2, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
1691  fHist_Corr3p_Proton_pTSum_EP_V0A_PP[i][j] = new TProfile(name,title,20,pTRange,"");
1692  fHist_Corr3p_Proton_pTSum_EP_V0A_PP[i][j]->Sumw2();
1694 
1695  sprintf(name,"fHist_Corr3p_Proton_pTSum_EP_V0A_NN_Mag%d_Cent%d",i,j);
1696  sprintf(title,"NN 3p vs (pT1+pT2)/2, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
1697  fHist_Corr3p_Proton_pTSum_EP_V0A_NN[i][j] = new TProfile(name,title,20,pTRange,"");
1698  fHist_Corr3p_Proton_pTSum_EP_V0A_NN[i][j]->Sumw2();
1700  //-----v0c----
1701  sprintf(name,"fHist_Corr3p_Proton_pTSum_EP_V0C_PN_Mag%d_Cent%d",i,j);
1702  sprintf(title,"PN 3p vs (pT1+pT2)/2, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
1703  fHist_Corr3p_Proton_pTSum_EP_V0C_PN[i][j] = new TProfile(name,title,20,pTRange,"");
1704  fHist_Corr3p_Proton_pTSum_EP_V0C_PN[i][j]->Sumw2();
1706 
1707  sprintf(name,"fHist_Corr3p_Proton_pTSum_EP_V0C_PP_Mag%d_Cent%d",i,j);
1708  sprintf(title,"PP 3p vs (pT1+pT2)/2, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
1709  fHist_Corr3p_Proton_pTSum_EP_V0C_PP[i][j] = new TProfile(name,title,20,pTRange,"");
1710  fHist_Corr3p_Proton_pTSum_EP_V0C_PP[i][j]->Sumw2();
1712 
1713  sprintf(name,"fHist_Corr3p_Proton_pTSum_EP_V0C_NN_Mag%d_Cent%d",i,j);
1714  sprintf(title,"NN 3p vs (pT1+pT2)/2, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
1715  fHist_Corr3p_Proton_pTSum_EP_V0C_NN[i][j] = new TProfile(name,title,20,pTRange,"");
1716  fHist_Corr3p_Proton_pTSum_EP_V0C_NN[i][j]->Sumw2();
1718  }
1719  }
1720 
1721  for(Int_t i=0;i<2;i++){
1722  for(Int_t j=0;j<6;j++){
1723  sprintf(name,"fHist_Corr3p_Proton_pTDiff_EP_V0A_PN_Mag%d_Cent%d",i,j);
1724  sprintf(title,"PN 3p vs |pT1-pT2|, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
1725  fHist_Corr3p_Proton_pTDiff_EP_V0A_PN[i][j] = new TProfile(name,title,20,pTRange,"");
1726  fHist_Corr3p_Proton_pTDiff_EP_V0A_PN[i][j]->Sumw2();
1728 
1729  sprintf(name,"fHist_Corr3p_Proton_pTDiff_EP_V0A_PP_Mag%d_Cent%d",i,j);
1730  sprintf(title,"PP 3p vs |pT1-pT2|, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
1731  fHist_Corr3p_Proton_pTDiff_EP_V0A_PP[i][j] = new TProfile(name,title,20,pTRange,"");
1732  fHist_Corr3p_Proton_pTDiff_EP_V0A_PP[i][j]->Sumw2();
1734 
1735  sprintf(name,"fHist_Corr3p_Proton_pTDiff_EP_V0A_NN_Mag%d_Cent%d",i,j);
1736  sprintf(title,"NN 3p vs |pT1-pT2|, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
1737  fHist_Corr3p_Proton_pTDiff_EP_V0A_NN[i][j] = new TProfile(name,title,20,pTRange,"");
1738  fHist_Corr3p_Proton_pTDiff_EP_V0A_NN[i][j]->Sumw2();
1740  //-----v0c----
1741  sprintf(name,"fHist_Corr3p_Proton_pTDiff_EP_V0C_PN_Mag%d_Cent%d",i,j);
1742  sprintf(title,"PN 3p vs |pT1-pT2|, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
1743  fHist_Corr3p_Proton_pTDiff_EP_V0C_PN[i][j] = new TProfile(name,title,20,pTRange,"");
1744  fHist_Corr3p_Proton_pTDiff_EP_V0C_PN[i][j]->Sumw2();
1746 
1747  sprintf(name,"fHist_Corr3p_Proton_pTDiff_EP_V0C_PP_Mag%d_Cent%d",i,j);
1748  sprintf(title,"PP 3p vs |pT1-pT2|, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
1749  fHist_Corr3p_Proton_pTDiff_EP_V0C_PP[i][j] = new TProfile(name,title,20,pTRange,"");
1750  fHist_Corr3p_Proton_pTDiff_EP_V0C_PP[i][j]->Sumw2();
1752 
1753  sprintf(name,"fHist_Corr3p_Proton_pTDiff_EP_V0C_NN_Mag%d_Cent%d",i,j);
1754  sprintf(title,"NN 3p vs |pT1-pT2|, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
1755  fHist_Corr3p_Proton_pTDiff_EP_V0C_NN[i][j] = new TProfile(name,title,20,pTRange,"");
1756  fHist_Corr3p_Proton_pTDiff_EP_V0C_NN[i][j]->Sumw2();
1758  }
1759  }
1760 
1761  //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
1762 
1763  for(Int_t i=0;i<2;i++){
1764  for(Int_t j=0;j<6;j++){
1765  sprintf(name,"fHist_Corr3p_Proton_EtaDiff_EP_V0A_PN_Mag%d_Cent%d",i,j);
1766  sprintf(title,"PN 3p vs |Eta1-Eta2|, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
1767  fHist_Corr3p_Proton_EtaDiff_EP_V0A_PN[i][j] = new TProfile(name,title,16,0,1.6,"");
1770 
1771  sprintf(name,"fHist_Corr3p_Proton_EtaDiff_EP_V0A_PP_Mag%d_Cent%d",i,j);
1772  sprintf(title,"PP 3p vs |Eta1-Eta2|, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
1773  fHist_Corr3p_Proton_EtaDiff_EP_V0A_PP[i][j] = new TProfile(name,title,16,0,1.6,"");
1776 
1777  sprintf(name,"fHist_Corr3p_Proton_EtaDiff_EP_V0A_NN_Mag%d_Cent%d",i,j);
1778  sprintf(title,"NN 3p vs |Eta1-Eta2|, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
1779  fHist_Corr3p_Proton_EtaDiff_EP_V0A_NN[i][j] = new TProfile(name,title,16,0,1.6,"");
1782  //-----v0c----
1783  sprintf(name,"fHist_Corr3p_Proton_EtaDiff_EP_V0C_PN_Mag%d_Cent%d",i,j);
1784  sprintf(title,"PN 3p vs |Eta1-Eta2|, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
1785  fHist_Corr3p_Proton_EtaDiff_EP_V0C_PN[i][j] = new TProfile(name,title,16,0,1.6,"");
1788 
1789  sprintf(name,"fHist_Corr3p_Proton_EtaDiff_EP_V0C_PP_Mag%d_Cent%d",i,j);
1790  sprintf(title,"PP 3p vs |Eta1-Eta2|, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
1791  fHist_Corr3p_Proton_EtaDiff_EP_V0C_PP[i][j] = new TProfile(name,title,16,0,1.6,"");
1794 
1795  sprintf(name,"fHist_Corr3p_Proton_EtaDiff_EP_V0C_NN_Mag%d_Cent%d",i,j);
1796  sprintf(title,"NN 3p vs |Eta1-Eta2|, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
1797  fHist_Corr3p_Proton_EtaDiff_EP_V0C_NN[i][j] = new TProfile(name,title,16,0,1.6,"");
1800  }
1801  }
1802 
1803  //------------------ Differential 3p PID done -----------------------
1804 
1805 
1806 
1807 
1808 
1809 
1810 
1811 
1812 
1813 
1814 
1815  //------------------ Differential 2-part correlator -----------------------
1816  /*
1817  //Charge:
1818  for(Int_t i=0;i<2;i++){
1819  for(Int_t j=0;j<6;j++){
1820  sprintf(name,"fHist_Corr2p_pTSum_EP_Harm1_PN_Mag%d_Cent%d",i,j);
1821  sprintf(title,"PN 3p vs (pT1+pT2)/2, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
1822  fHist_Corr2p_pTSum_EP_Harm1_PN[i][j] = new TProfile(name,title,20,pTRange,"");
1823  fHist_Corr2p_pTSum_EP_Harm1_PN[i][j]->Sumw2();
1824  fListHist->Add(fHist_Corr2p_pTSum_EP_Harm1_PN[i][j]);
1825 
1826  sprintf(name,"fHist_Corr2p_pTSum_EP_Harm1_PP_Mag%d_Cent%d",i,j);
1827  sprintf(title,"PP 3p vs (pT1+pT2)/2, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
1828  fHist_Corr2p_pTSum_EP_Harm1_PP[i][j] = new TProfile(name,title,20,pTRange,"");
1829  fHist_Corr2p_pTSum_EP_Harm1_PP[i][j]->Sumw2();
1830  fListHist->Add(fHist_Corr2p_pTSum_EP_Harm1_PP[i][j]);
1831 
1832  sprintf(name,"fHist_Corr2p_pTSum_EP_Harm1_NN_Mag%d_Cent%d",i,j);
1833  sprintf(title,"NN 3p vs (pT1+pT2)/2, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
1834  fHist_Corr2p_pTSum_EP_Harm1_NN[i][j] = new TProfile(name,title,20,pTRange,"");
1835  fHist_Corr2p_pTSum_EP_Harm1_NN[i][j]->Sumw2();
1836  fListHist->Add(fHist_Corr2p_pTSum_EP_Harm1_NN[i][j]);
1837  //----- n=2 ----
1838  sprintf(name,"fHist_Corr2p_pTSum_EP_Harm2_PN_Mag%d_Cent%d",i,j);
1839  sprintf(title,"PN 3p vs (pT1+pT2)/2, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
1840  fHist_Corr2p_pTSum_EP_Harm2_PN[i][j] = new TProfile(name,title,20,pTRange,"");
1841  fHist_Corr2p_pTSum_EP_Harm2_PN[i][j]->Sumw2();
1842  fListHist->Add(fHist_Corr2p_pTSum_EP_Harm2_PN[i][j]);
1843 
1844  sprintf(name,"fHist_Corr2p_pTSum_EP_Harm2_PP_Mag%d_Cent%d",i,j);
1845  sprintf(title,"PP 3p vs (pT1+pT2)/2, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
1846  fHist_Corr2p_pTSum_EP_Harm2_PP[i][j] = new TProfile(name,title,20,pTRange,"");
1847  fHist_Corr2p_pTSum_EP_Harm2_PP[i][j]->Sumw2();
1848  fListHist->Add(fHist_Corr2p_pTSum_EP_Harm2_PP[i][j]);
1849 
1850  sprintf(name,"fHist_Corr2p_pTSum_EP_Harm2_NN_Mag%d_Cent%d",i,j);
1851  sprintf(title,"NN 3p vs (pT1+pT2)/2, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
1852  fHist_Corr2p_pTSum_EP_Harm2_NN[i][j] = new TProfile(name,title,20,pTRange,"");
1853  fHist_Corr2p_pTSum_EP_Harm2_NN[i][j]->Sumw2();
1854  fListHist->Add(fHist_Corr2p_pTSum_EP_Harm2_NN[i][j]);
1855  }
1856  }
1857 
1858  for(Int_t i=0;i<2;i++){
1859  for(Int_t j=0;j<6;j++){
1860  sprintf(name,"fHist_Corr2p_pTDiff_EP_Harm1_PN_Mag%d_Cent%d",i,j);
1861  sprintf(title,"PN 3p vs |pT1-pT2|, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
1862  fHist_Corr2p_pTDiff_EP_Harm1_PN[i][j] = new TProfile(name,title,20,pTRange,"");
1863  fHist_Corr2p_pTDiff_EP_Harm1_PN[i][j]->Sumw2();
1864  fListHist->Add(fHist_Corr2p_pTDiff_EP_Harm1_PN[i][j]);
1865 
1866  sprintf(name,"fHist_Corr2p_pTDiff_EP_Harm1_PP_Mag%d_Cent%d",i,j);
1867  sprintf(title,"PP 3p vs |pT1-pT2|, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
1868  fHist_Corr2p_pTDiff_EP_Harm1_PP[i][j] = new TProfile(name,title,20,pTRange,"");
1869  fHist_Corr2p_pTDiff_EP_Harm1_PP[i][j]->Sumw2();
1870  fListHist->Add(fHist_Corr2p_pTDiff_EP_Harm1_PP[i][j]);
1871 
1872  sprintf(name,"fHist_Corr2p_pTDiff_EP_Harm1_NN_Mag%d_Cent%d",i,j);
1873  sprintf(title,"NN 3p vs |pT1-pT2|, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
1874  fHist_Corr2p_pTDiff_EP_Harm1_NN[i][j] = new TProfile(name,title,20,pTRange,"");
1875  fHist_Corr2p_pTDiff_EP_Harm1_NN[i][j]->Sumw2();
1876  fListHist->Add(fHist_Corr2p_pTDiff_EP_Harm1_NN[i][j]);
1877  //-----n=2----
1878  sprintf(name,"fHist_Corr2p_pTDiff_EP_Harm2_PN_Mag%d_Cent%d",i,j);
1879  sprintf(title,"PN 3p vs |pT1-pT2|, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
1880  fHist_Corr2p_pTDiff_EP_Harm2_PN[i][j] = new TProfile(name,title,20,pTRange,"");
1881  fHist_Corr2p_pTDiff_EP_Harm2_PN[i][j]->Sumw2();
1882  fListHist->Add(fHist_Corr2p_pTDiff_EP_Harm2_PN[i][j]);
1883 
1884  sprintf(name,"fHist_Corr2p_pTDiff_EP_Harm2_PP_Mag%d_Cent%d",i,j);
1885  sprintf(title,"PP 3p vs |pT1-pT2|, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
1886  fHist_Corr2p_pTDiff_EP_Harm2_PP[i][j] = new TProfile(name,title,20,pTRange,"");
1887  fHist_Corr2p_pTDiff_EP_Harm2_PP[i][j]->Sumw2();
1888  fListHist->Add(fHist_Corr2p_pTDiff_EP_Harm2_PP[i][j]);
1889 
1890  sprintf(name,"fHist_Corr2p_pTDiff_EP_Harm2_NN_Mag%d_Cent%d",i,j);
1891  sprintf(title,"NN 3p vs |pT1-pT2|, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
1892  fHist_Corr2p_pTDiff_EP_Harm2_NN[i][j] = new TProfile(name,title,20,pTRange,"");
1893  fHist_Corr2p_pTDiff_EP_Harm2_NN[i][j]->Sumw2();
1894  fListHist->Add(fHist_Corr2p_pTDiff_EP_Harm2_NN[i][j]);
1895  }
1896  }
1897 
1898  //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
1899  //Now Eta binning: 16,0,1.6 for test
1900 
1901  for(Int_t i=0;i<2;i++){
1902  for(Int_t j=0;j<6;j++){
1903  sprintf(name,"fHist_Corr2p_EtaDiff_EP_Harm1_PN_Mag%d_Cent%d",i,j);
1904  sprintf(title,"PN 3p vs |Eta1-Eta2|, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
1905  fHist_Corr2p_EtaDiff_EP_Harm1_PN[i][j] = new TProfile(name,title,16,0,1.6,"");
1906  fHist_Corr2p_EtaDiff_EP_Harm1_PN[i][j]->Sumw2();
1907  fListHist->Add(fHist_Corr2p_EtaDiff_EP_Harm1_PN[i][j]);
1908 
1909  sprintf(name,"fHist_Corr2p_EtaDiff_EP_Harm1_PP_Mag%d_Cent%d",i,j);
1910  sprintf(title,"PP 3p vs |Eta1-Eta2|, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
1911  fHist_Corr2p_EtaDiff_EP_Harm1_PP[i][j] = new TProfile(name,title,16,0,1.6,"");
1912  fHist_Corr2p_EtaDiff_EP_Harm1_PP[i][j]->Sumw2();
1913  fListHist->Add(fHist_Corr2p_EtaDiff_EP_Harm1_PP[i][j]);
1914 
1915  sprintf(name,"fHist_Corr2p_EtaDiff_EP_Harm1_NN_Mag%d_Cent%d",i,j);
1916  sprintf(title,"NN 3p vs |Eta1-Eta2|, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
1917  fHist_Corr2p_EtaDiff_EP_Harm1_NN[i][j] = new TProfile(name,title,16,0,1.6,"");
1918  fHist_Corr2p_EtaDiff_EP_Harm1_NN[i][j]->Sumw2();
1919  fListHist->Add(fHist_Corr2p_EtaDiff_EP_Harm1_NN[i][j]);
1920  //-----n=2----
1921  sprintf(name,"fHist_Corr2p_EtaDiff_EP_Harm2_PN_Mag%d_Cent%d",i,j);
1922  sprintf(title,"PN 3p vs |Eta1-Eta2|, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
1923  fHist_Corr2p_EtaDiff_EP_Harm2_PN[i][j] = new TProfile(name,title,16,0,1.6,"");
1924  fHist_Corr2p_EtaDiff_EP_Harm2_PN[i][j]->Sumw2();
1925  fListHist->Add(fHist_Corr2p_EtaDiff_EP_Harm2_PN[i][j]);
1926 
1927  sprintf(name,"fHist_Corr2p_EtaDiff_EP_Harm2_PP_Mag%d_Cent%d",i,j);
1928  sprintf(title,"PP 3p vs |Eta1-Eta2|, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
1929  fHist_Corr2p_EtaDiff_EP_Harm2_PP[i][j] = new TProfile(name,title,16,0,1.6,"");
1930  fHist_Corr2p_EtaDiff_EP_Harm2_PP[i][j]->Sumw2();
1931  fListHist->Add(fHist_Corr2p_EtaDiff_EP_Harm2_PP[i][j]);
1932 
1933  sprintf(name,"fHist_Corr2p_EtaDiff_EP_Harm2_NN_Mag%d_Cent%d",i,j);
1934  sprintf(title,"NN 3p vs |Eta1-Eta2|, Cent %2.0f-%2.0f",centRange[i],centRange[i+1]);
1935  fHist_Corr2p_EtaDiff_EP_Harm2_NN[i][j] = new TProfile(name,title,16,0,1.6,"");
1936  fHist_Corr2p_EtaDiff_EP_Harm2_NN[i][j]->Sumw2();
1937  fListHist->Add(fHist_Corr2p_EtaDiff_EP_Harm2_NN[i][j]);
1938  }
1939  }
1940  //------------ Differential 2p charge done ------------------------
1941 
1942  */
1943 
1944 
1945 
1946 
1947 
1948 
1949 
1950 
1951 
1952 
1953 
1954 
1955 
1956 
1957 
1958 
1959 
1960 
1961 
1962 
1963  //---- to store NUA and calib histograms -----
1964  TList *fListNUACalib = new TList();
1965  fListNUACalib->SetName("fListNUACalib");
1966  fListNUACalib->SetOwner(kTRUE);
1967 
1968 
1969  Double_t truncPi = 3.1416;
1970 
1971  //-------------- Event plane distributions --------------
1972  fHV0AEventPlaneVsCent = new TH2F("fHV0AEventPlaneVsCent",Form("Psi %d from V0A", gPsiN), 10,centRange,50,-0.0,truncPi);
1973  fListNUACalib->Add(fHV0AEventPlaneVsCent);
1974 
1975  fHV0CEventPlaneVsCent = new TH2F("fHV0CEventPlaneVsCent",Form("Psi %d from V0C", gPsiN), 10,centRange,50,-0.0,truncPi);
1976  fListNUACalib->Add(fHV0CEventPlaneVsCent);
1977 
1978  fHTPCAEventPlaneVsCent = new TH2F("fHTPCAEventPlaneVsCent",Form("Psi %d from pos eta",gPsiN),10,centRange,50,-0.0,truncPi);
1979  fListNUACalib->Add(fHTPCAEventPlaneVsCent);
1980 
1981  fHTPCCEventPlaneVsCent = new TH2F("fHTPCCEventPlaneVsCent",Form("Psi %d from neg eta",gPsiN),10,centRange,50,-0.0,truncPi);
1982  fListNUACalib->Add(fHTPCCEventPlaneVsCent);
1983 
1984  fHTPCEventPlaneVsCent = new TH2F("fHTPCEventPlaneVsCent",Form("Psi %d from Full TPC",gPsiN),10,centRange,50,-0.0,truncPi);
1985  fListNUACalib->Add(fHTPCEventPlaneVsCent);
1986 
1987 
1988 
1989  //-------------------- QA: how does the eta-phi looks after NUA correction ----------------
1990  fQAEtaPhiAfterNUA = new TH2F("fQAEtaPhiAfterNUA","eta vs phi with NUA corr",50,0,6.283185,16,-0.8,0.8);
1991  fListNUACalib->Add(fQAEtaPhiAfterNUA);
1992 
1993  fQAEtaPhiAfterNUAPion = new TH2F("fQAEtaPhiAfterNUAPion","Pion eta vs phi with NUA corr",50,0,6.283185,16,-0.8,0.8);
1994  fListNUACalib->Add(fQAEtaPhiAfterNUAPion);
1995 
1996  fQAEtaPhiAfterNUAKaon = new TH2F("fQAEtaPhiAfterNUAKaon","Kaon eta vs phi with NUA corr",50,0,6.283185,16,-0.8,0.8);
1997  fListNUACalib->Add(fQAEtaPhiAfterNUAKaon);
1998 
1999  fQAEtaPhiAfterNUAProton = new TH2F("fQAEtaPhiAfterNUAProton","Proton eta vs phi with NUA corr",50,0,6.283185,16,-0.8,0.8);
2000  fListNUACalib->Add(fQAEtaPhiAfterNUAProton);
2001 
2002 
2003 
2004 
2005 
2006 
2007  //----------------- V0 Calibration hist: ---------------------
2008  fV0MultChVsRun = new TH2F("fV0MultChVsRun","1-32 V0C, 33-64 V0A",64,0,64,20,0,100);
2009  fListNUACalib->Add(fV0MultChVsRun);
2010 
2011  //const char *sCorrect[2]={"wo Corr","w Corr"};
2012  Int_t isCorr = 0;
2013 
2014  if(fListV0MCorr){
2015  isCorr = 1;
2016  }
2017 
2018 
2019  fV0AQ2xVsCentRun = new TProfile("fV0ACos2nVsCentRun",Form("<Cos2> vs cent (%d)",isCorr),90,0,90,""); //sCorrect[isCorr]
2020  fListNUACalib->Add(fV0AQ2xVsCentRun);
2021  fV0AQ2yVsCentRun = new TProfile("fV0ASin2nVsCentRun",Form("<Sin2> vs cent (%d)",isCorr),90,0,90,"");
2022  fListNUACalib->Add(fV0AQ2yVsCentRun);
2023  fV0CQ2xVsCentRun = new TProfile("fV0CCos2nVsCentRun",Form("<Cos2> vs cent (%d)",isCorr),90,0,90,"");
2024  fListNUACalib->Add(fV0CQ2xVsCentRun);
2025  fV0CQ2yVsCentRun = new TProfile("fV0CSin2nVsCentRun",Form("<Sin2> vs cent (%d)",isCorr),90,0,90,"");
2026  fListNUACalib->Add(fV0CQ2yVsCentRun);
2027 
2028  fV0AQ3xVsCentRun = new TProfile("fV0ACos3nVsCentRun",Form("<Cos3> vs cent (%d)",isCorr),90,0,90,"");
2029  fListNUACalib->Add(fV0AQ3xVsCentRun);
2030  fV0AQ3yVsCentRun = new TProfile("fV0ASin3nVsCentRun",Form("<Sin3> vs cent (%d)",isCorr),90,0,90,"");
2031  fListNUACalib->Add(fV0AQ3yVsCentRun);
2032  fV0CQ3xVsCentRun = new TProfile("fV0CCos3nVsCentRun",Form("<Cos3> vs cent (%d)",isCorr),90,0,90,"");
2033  fListNUACalib->Add(fV0CQ3xVsCentRun);
2034  fV0CQ3yVsCentRun = new TProfile("fV0CSin3nVsCentRun",Form("<Sin3> vs cent (%d)",isCorr),90,0,90,"");
2035  fListNUACalib->Add(fV0CQ3yVsCentRun);
2036 
2037  isCorr = 1;
2038  if(fListNUACorr){
2039  cout<<"\n =========> NUA file found for NUA correction <========== \n";
2040  isCorr = 0;
2041  }
2042  //------------------- TPC Qvector Recentering Histograms --------------
2043  fTPCAQ2xVsCentRun = new TProfile("fTPCACos2nVsCentRun",Form("<Cos2> vs cent (%d)",isCorr),90,0,90,"");
2044  fListNUACalib->Add(fTPCAQ2xVsCentRun);
2045  fTPCAQ2yVsCentRun = new TProfile("fTPCASin2nVsCentRun",Form("<Sin2> vs cent (%d)",isCorr),90,0,90,"");
2046  fListNUACalib->Add(fTPCAQ2yVsCentRun);
2047  fTPCCQ2xVsCentRun = new TProfile("fTPCCCos2nVsCentRun",Form("<Cos2> vs cent (%d)",isCorr),90,0,90,"");
2048  fListNUACalib->Add(fTPCCQ2xVsCentRun);
2049  fTPCCQ2yVsCentRun = new TProfile("fTPCCSin2nVsCentRun",Form("<Sin2> vs cent (%d)",isCorr),90,0,90,"");
2050  fListNUACalib->Add(fTPCCQ2yVsCentRun);
2051 
2052  fTPCAQ3xVsCentRun = new TProfile("fTPCACos3nVsCentRun",Form("<Cos3> vs cent (%d)",isCorr),90,0,90,"");
2053  fListNUACalib->Add(fTPCAQ3xVsCentRun);
2054  fTPCAQ3yVsCentRun = new TProfile("fTPCASin3nVsCentRun",Form("<Sin3> vs cent (%d)",isCorr),90,0,90,"");
2055  fListNUACalib->Add(fTPCAQ3yVsCentRun);
2056  fTPCCQ3xVsCentRun = new TProfile("fTPCCCos3nVsCentRun",Form("<Cos3> vs cent (%d)",isCorr),90,0,90,"");
2057  fListNUACalib->Add(fTPCCQ3xVsCentRun);
2058  fTPCCQ3yVsCentRun = new TProfile("fTPCCSin3nVsCentRun",Form("<Sin3> vs cent (%d)",isCorr),90,0,90,"");
2059  fListNUACalib->Add(fTPCCQ3yVsCentRun);
2060 
2061  fTPCAQ4xVsCentRun = new TProfile("fTPCACos4nVsCentRun",Form("<Cos4> vs cent (%d)",isCorr),90,0,90,"");
2062  fListNUACalib->Add(fTPCAQ4xVsCentRun);
2063  fTPCAQ4yVsCentRun = new TProfile("fTPCASin4nVsCentRun",Form("<Sin4> vs cent (%d)",isCorr),90,0,90,"");
2064  fListNUACalib->Add(fTPCAQ4yVsCentRun);
2065  fTPCCQ4xVsCentRun = new TProfile("fTPCCCos4nVsCentRun",Form("<Cos4> vs cent (%d)",isCorr),90,0,90,"");
2066  fListNUACalib->Add(fTPCCQ4xVsCentRun);
2067  fTPCCQ4yVsCentRun = new TProfile("fTPCCSin4nVsCentRun",Form("<Sin4> vs cent (%d)",isCorr),90,0,90,"");
2068  fListNUACalib->Add(fTPCCQ4yVsCentRun);
2069 
2070 
2071  fTPCFQ2xVsCentRun = new TProfile("fTPCFQ2xVsCentRun",Form("<Cos2> vs cent (%d)",isCorr),90,0,90,"");
2072  fListNUACalib->Add(fTPCFQ2xVsCentRun);
2073  fTPCFQ2yVsCentRun = new TProfile("fTPCFQ2yVsCentRun",Form("<Sin2> vs cent (%d)",isCorr),90,0,90,"");
2074  fListNUACalib->Add(fTPCFQ2yVsCentRun);
2075 
2076  //-------------------------------------------------------------------------------
2077 
2078 
2079 
2080 
2081  //-------------------------- Define NUA Hist for PID -----------------------------
2082  Int_t gCentForNUA[6] = {0,5,10,20,40,90};
2083  //Char_t name[100];
2084  //Char_t title[100];
2085 
2086  for(int i=0;i<4;i++){
2087  for(int j=0;j<5;j++){
2088  sprintf(name,"fHistEtaPhiVz_%d_Pos_Cent%d_Run%d",i,j,1); //gSpecies[i]
2089  sprintf(title,"eta,phi,Vz %dPos, Cent%d-%d, FB %d",i,gCentForNUA[j],gCentForNUA[j+1],fFilterBit);
2090  fHist3DEtaPhiVz_Pos_Run[i][j] = new TH3F(name,title,10,-10,10,50,0,6.283185,16,-0.8,0.8);
2091  fListNUACalib->Add(fHist3DEtaPhiVz_Pos_Run[i][j]);
2092 
2093  sprintf(name,"fHistEtaPhiVz_%d_Neg_Cent%d_Run%d",i,j,1); //gSpecies[i]
2094  sprintf(title,"eta,phi,Vz %dNeg, Cent%d-%d, FB %d",i,gCentForNUA[j],gCentForNUA[j+1],fFilterBit);
2095  fHist3DEtaPhiVz_Neg_Run[i][j] = new TH3F(name,title,10,-10,10,50,0,6.283185,16,-0.8,0.8);
2096  fListNUACalib->Add(fHist3DEtaPhiVz_Neg_Run[i][j]);
2097  }
2098  }
2099  //---------------------------------------------------------------------------------
2100 
2101 
2102  fListHist->Add(fListNUACalib);
2103 
2104  PostData(1,fListHist);
2105  cout<<"\n.........UserCreateOutputObject called.........\n fFilterBit = "<<fFilterBit<<" CentMax = "<<fCentralityPercentMax;
2106  cout<<" PU C = "<<fPileUpConstParm<<" gN = "<<gN<<" gM = "<<gM<<" PsiN = "<<gPsiN<<"\n\n"<<endl;
2107 
2108 }
2109 
2110 
2111 
2112 
2113 
2114 
2115 
2116 
2117 
2118 
2119 
2120 
2121 
2122 
2123 
2124 
2125 
2126 //______________________________________________________________________
2128  //debug only
2129  //cout<<"\n Info:UserExec() called ..!!!\n";
2130  //watch.Start(kTRUE);
2131  //if(fEventCount==501) return;
2132 
2133 
2134  Float_t stepCount = 0.5;
2135 
2136  fHistEventCount->Fill(stepCount); //1
2137  stepCount++;
2138 
2139  fAOD = dynamic_cast<AliAODEvent*>(InputEvent());
2140  fESD = dynamic_cast<AliESDEvent*>(InputEvent());
2141 
2142  if(!(fESD || fAOD)){ printf("ERROR: fESD & fAOD not available\n"); return; }
2143 
2144  fVevent = dynamic_cast<AliVEvent*>(InputEvent());
2145 
2146  if (!fVevent) { printf("ERROR: fVevent not available\n"); return; }
2147 
2148  fHistEventCount->Fill(stepCount); //2
2149  stepCount++;
2150 
2151 
2152 
2153 
2154 
2155 
2156  //--------- Check if I have PID response object --------
2157  if(!fPIDResponse){
2158  AliAnalysisManager *mgr=AliAnalysisManager::GetAnalysisManager();
2159  AliInputEventHandler *inputHandler=dynamic_cast<AliInputEventHandler*>(mgr->GetInputEventHandler());
2160  if(inputHandler) fPIDResponse=inputHandler->GetPIDResponse();
2161  if(!fPIDResponse){
2162  printf("\n\n...... PIDResponse object not found..... \n\n");
2163  return;
2164  }
2165  }
2166 
2167 
2168 
2169 
2170 
2171  //-------------- Vtx cuts ---------------
2172  const AliVVertex *pVtx = fVevent->GetPrimaryVertex();
2173 
2174  Double_t pVtxZ = -999;
2175  pVtxZ = pVtx->GetZ();
2176 
2177 //if(TMath::Abs(pVtxZ)>10.) return;
2178  //User defined cut:
2179  if(pVtxZ<fMinVzCut || pVtxZ>fMaxVzCut ) return;
2180 
2181 
2182  fHistEventCount->Fill(stepCount); //3
2183  stepCount++;
2184 
2185 
2186 
2187  Float_t centrality = -99.0;
2188  Float_t centrV0M = -99.0;
2189  Float_t centrCL1 = -99.0;
2190 
2191 
2192 
2193  //---------- Centrality Estimators -------------
2194  AliCentrality* Alicentr = ((AliVAODHeader*)fAOD->GetHeader())->GetCentralityP(); // For Run1, 2010 data
2195 
2196  fMultSelection = (AliMultSelection*) InputEvent()->FindListObject("MultSelection"); // Must never comment this
2197  if(!fMultSelection) { printf("\n\n **WARNING** \n::UserExec() AliMultSelection object not found.\n\n"); exit(1); }
2198 
2199 
2200  if(sNucleiTP=="PbPb2010" || sNucleiTP=="2010") {
2201  if(Alicentr){
2202 
2203  centrV0M = Alicentr->GetCentralityPercentile("V0M");
2204  centrCL1 = Alicentr->GetCentralityPercentile("CL1");
2205 
2206  if(sCentrEstimator=="V0M" || sCentrEstimator=="V0"){
2207  centrality = centrV0M;
2208  }
2209  else if(sCentrEstimator=="CL1"){
2210  centrality = centrCL1;
2211  }
2212  else if(sCentrEstimator=="V0C"){
2213  centrality = Alicentr->GetCentralityPercentile("V0C");
2214  }
2215  else if(sCentrEstimator=="V0A"){
2216  centrality = Alicentr->GetCentralityPercentile("V0A");
2217  }
2218  else if(sCentrEstimator=="TRK"){
2219  centrality = Alicentr->GetCentralityPercentile("TRK");
2220  }
2221  }
2222  }
2223  else{ // fall back to MultSelection if other than 2010 data
2224 
2225  centrV0M = fMultSelection->GetMultiplicityPercentile("V0M");
2226  centrCL1 = fMultSelection->GetMultiplicityPercentile("CL1");
2227 
2228  if(sCentrEstimator=="V0M" || sCentrEstimator=="V0"){
2229  centrality = centrV0M;
2230  }
2231  else if(sCentrEstimator=="CL1"){
2232  centrality = centrCL1;
2233  }
2234  else if(sCentrEstimator=="V0C"){
2235  centrality = fMultSelection->GetMultiplicityPercentile("V0C");
2236  }
2237  else if(sCentrEstimator=="V0A"){
2238  centrality = fMultSelection->GetMultiplicityPercentile("V0A");
2239  }
2240  else if(sCentrEstimator=="TRK"){
2241  centrality = fMultSelection->GetMultiplicityPercentile("TRK");
2242  }
2243  }
2244 
2245  /*
2246  //--------- Centrality Estimators -------------
2247  centrV0M = fMultSelection->GetMultiplicityPercentile("V0M");
2248  centrCL1 = fMultSelection->GetMultiplicityPercentile("CL1");
2249 
2250  if(sCentrEstimator=="V0M" || sCentrEstimator=="V0"){
2251  centrality = centrV0M;
2252  }
2253  else if(sCentrEstimator=="CL1"){
2254  centrality = centrCL1;
2255  }
2256  else if(sCentrEstimator=="V0C"){
2257  centrality = fMultSelection->GetMultiplicityPercentile("V0C");
2258  }
2259  else if(sCentrEstimator=="V0A"){
2260  centrality = fMultSelection->GetMultiplicityPercentile("V0A");
2261  }
2262  else if(sCentrEstimator=="TRK"){
2263  centrality = fMultSelection->GetMultiplicityPercentile("TRK");
2264  } */
2265 
2266 
2267 
2268 
2270  return;
2271  }
2272 
2273  fHistEventCount->Fill(stepCount); //4
2274  stepCount++;
2275 
2276  fCentDistBefore->Fill(centrality);
2277 
2278 
2279 
2280 
2281 
2282 
2283  Int_t ntracks=fAOD->GetNumberOfTracks();
2284  if(ntracks<2) return; // Check this cut....!!!
2285 
2286  fHistEventCount->Fill(stepCount); //5
2287  stepCount++;
2288 
2289 
2290 
2291 
2292 
2293 
2294  Int_t cent10bin = -1;
2295  Int_t cIndex = -1;
2296  //cent10bin = GetCentralityScaled0to10(centrality); //Centrality in 0-10 scale
2297 
2298  if(centrality<5.0) {
2299  cent10bin = 0;
2300  }
2301  else if(centrality>=5.0 && centrality<10){
2302  cent10bin = 1;
2303  }
2304  else if(centrality>=10.0) {
2305  cent10bin = abs(centrality/10.0)+1;
2306  }
2307 
2308  cIndex = cent10bin;
2309 
2310 //Centrality array index for NUA correcion
2311  Int_t cForNUA = 0;
2312 
2313  if(centrality<5.0) {
2314  cForNUA = 0;
2315  }
2316  else if(centrality>=5.0 && centrality<10){
2317  cForNUA = 1; // 1=5-10,
2318  }
2319  else if(centrality>=10.0 && centrality<20) {
2320  cForNUA = 2; // 2 = 10-20,
2321  }
2322  else if(centrality>=20 && centrality<40){
2323  cForNUA = 3; // 3=20-40
2324  }
2325  else if(centrality>=40){
2326  cForNUA = 4; // 4=40-90
2327  }
2328 
2329 
2330 
2331 
2332 
2333 
2334  //---------- Magnetic field --------
2335  Double_t fMagField = fAOD->GetMagneticField();
2336 
2337  const Int_t QAindex = (fMagField > 0) ? 1 : 0;
2338  //---------------------------------
2339 
2340 
2341 
2342 
2343 
2344 
2345  //Load NUA and V0M correction map run by run:
2346  Int_t runNumber = fAOD->GetRunNumber();
2347 
2348  if(runNumber!=fOldRunNum) {
2349 
2350  GetNUACorrectionHist(runNumber);
2351 
2352  if(bV0MGainCorr) {
2353  GetV0MCorrectionHist(runNumber);
2354  }
2355 
2356  fOldRunNum = runNumber;
2357  }
2358  //------------------------------------------
2359 
2360 
2361 
2362 
2363 
2364 
2365 
2366  //----- Event Plane variables:-------
2367  Double_t PsiNV0A = 0;
2368  Double_t PsiNV0C = 0;
2369 
2370  Double_t PsiNTPCA = 0; // eta <0
2371  Double_t PsiNTPCC = 0; // eta >0
2372  Double_t PsiNTPCF = 0; // Full TPC
2373 
2374  Double_t sumTPCQn2x[5] = {0,0,0}; //[0]= eta<0; [1]= eta>0; [2]= -0.8 < eta < 0.8
2375  Double_t sumTPCQn2y[5] = {0,0,0};
2376  Double_t sumTPCQn3x[5] = {0,0,0}; //[0]= eta<0; [1]= eta>0; [2]= -0.8 < eta < 0.8
2377  Double_t sumTPCQn3y[5] = {0,0,0};
2378  Double_t sumTPCQn4x[5] = {0,0,0}; //[0]= eta<0; [1]= eta>0; [2]= -0.8 < eta < 0.8
2379  Double_t sumTPCQn4y[5] = {0,0,0};
2380  //------------------------------------
2381 
2382 
2383 
2384 
2385 
2386 
2387 
2388  //Variables for MC tracking correction
2389  Int_t ptBinMC = 1;
2390  Int_t iBinNUA = 1;
2391  Double_t ptWgtMC = 1.0;
2392  Double_t WgtNUA = 1.0;
2393  Double_t ptTrk = 0.1;
2394  Double_t dEdx = 0.0;
2395  Double_t Chi2Trk = 0.0;
2396 
2397 
2398  //-------------- Track loop for outlier and PileUp cut -------------------
2399 
2400  //---------------- a dobrin --------------
2401 
2402  Bool_t bIsPileup=kFALSE;
2403 
2404  Int_t isPileup = fAOD->IsPileupFromSPD(3);
2405 
2406  if(isPileup != 0) {
2407  fHistPileUpCount->Fill(0.5);
2408  bIsPileup=kTRUE;
2409  }
2410  else if(PileUpMultiVertex(fAOD)) {
2411  fHistPileUpCount->Fill(1.5);
2412  bIsPileup=kTRUE;
2413  }
2414  else if(((AliAODHeader*)fAOD->GetHeader())->GetRefMultiplicityComb08() < 0) {
2415  fHistPileUpCount->Fill(2.5);
2416  bIsPileup=kTRUE;
2417  }
2418  else if(fAOD->IsIncompleteDAQ()) {
2419  fHistPileUpCount->Fill(3.5);
2420  bIsPileup=kTRUE;
2421  }
2422  else if(fabs(centrV0M-centrCL1)> 5.0) {//default: 7.5
2423 //else if(fabs(centrV0M-centrCL1)> 7.5) {//default: 7.5
2424  fHistPileUpCount->Fill(4.5);
2425  bIsPileup=kTRUE;
2426  }
2427 
2428  // check vertex consistency
2429  const AliAODVertex* vtTrc = fAOD->GetPrimaryVertex();
2430  const AliAODVertex* vtSPD = fAOD->GetPrimaryVertexSPD();
2431 
2432  if(vtTrc->GetNContributors() < 2 || vtSPD->GetNContributors()<1) {
2433  fHistPileUpCount->Fill(5.5);
2434  bIsPileup=kTRUE;
2435  }
2436 
2437  double covTrc[6], covSPD[6];
2438  vtTrc->GetCovarianceMatrix(covTrc);
2439  vtSPD->GetCovarianceMatrix(covSPD);
2440 
2441  double dz = vtTrc->GetZ() - vtSPD->GetZ();
2442 
2443  double errTot = TMath::Sqrt(covTrc[5]+covSPD[5]);
2444  double errTrc = TMath::Sqrt(covTrc[5]);
2445  double nsigTot = dz/errTot;
2446  double nsigTrc = dz/errTrc;
2447 
2448  if(TMath::Abs(dz)>0.2 || TMath::Abs(nsigTot)>10 || TMath::Abs(nsigTrc)>20) {
2449  fHistPileUpCount->Fill(6.5);
2450  bIsPileup=kTRUE;
2451  }
2452 
2453 
2454 
2455  Float_t nSigPionTPC[40000] = {0.,};
2456  Float_t nSigKaonTPC[40000] = {0.,};
2457  Float_t nSigProtonTPC[40000] = {0.,};
2458  Float_t nSigPionTOF[40000] = {0.,};
2459  Float_t nSigKaonTOF[40000] = {0.,};
2460  Float_t nSigProtonTOF[40000] = {0.,};
2461 
2462  if(ntracks > 40000) return; //Dont break segment for higher tracks:
2463 
2464 
2465  /*
2466  std::vector<float> nSigPionTPC;
2467  std::vector<float> nSigKaonTPC;
2468  std::vector<float> nSigProtonTPC;
2469  std::vector<float> nSigPionTOF;
2470  std::vector<float> nSigKaonTOF;
2471  std::vector<float> nSigProtonTOF;
2472 
2473  nSigPionTPC.reserve(10000);
2474  nSigKaonTPC.reserve(10000);
2475  nSigProtonTPC.reserve(10000);
2476  nSigPionTOF.reserve(10000);
2477  nSigKaonTOF.reserve(10000);
2478  nSigProtonTOF.reserve(10000); */
2479 
2480 
2481 
2482 
2483  Float_t multTPC = 0; // tpc mult estimate
2484  //Float_t RefMultRaw = 0; // tpc mult estimate
2485  //Float_t RefMultCorr = 0; // tpc mult estimate
2486  Float_t RefMultRawFB = 0;
2487  Float_t RefMultCorrFB= 0;
2488 
2489  Float_t multTPCAll = 0; // tpc mult estimate
2490  Float_t multGlobal = 0; // global multiplicity
2491 
2492  Int_t multEtaNeg, multEtaPos, multEtaFull;
2493  Double_t SumWEtaNeg, SumWEtaPos, SumWEtaFull;
2494 
2495  Int_t ChTrk;
2496  Int_t nClustTPC;
2497 
2498  Double_t etaTrk, phiTrk; // Never define eta as float, always double.!!
2499 
2500  //Double_t fMaxPtEP = 5.0;
2501  //Double_t fMinPtEP = 0.2;
2502  Double_t fMaxEtaEP = 0.8;
2503  Double_t fMinEtaEP = -0.8;
2504 
2505  multEtaNeg = 0;
2506  multEtaPos = 0;
2507  multEtaFull= 0;
2508  SumWEtaNeg = 0;
2509  SumWEtaPos = 0;
2510  SumWEtaFull= 0;
2511 
2512 
2513 
2514  for(Int_t iTrack = 0; iTrack < ntracks; iTrack++) { //-------------------------
2515 
2516  AliAODTrack* AODtrack =dynamic_cast<AliAODTrack*>(fVevent->GetTrack(iTrack));
2517  if(!AODtrack) continue;
2518 
2519 
2520  //------ Store PID info in array to use later:---------
2521  //Vector method: //taking same time as arrays
2522  /*
2523  nSigPionTPC.push_back(fPIDResponse->NumberOfSigmasTPC(AODtrack, AliPID::kPion));
2524  nSigKaonTPC.push_back(fPIDResponse->NumberOfSigmasTPC( AODtrack, AliPID::kKaon));
2525  nSigProtonTPC.push_back(fPIDResponse->NumberOfSigmasTPC(AODtrack, AliPID::kProton));
2526 
2527  nSigPionTOF.push_back(fPIDResponse->NumberOfSigmasTOF(AODtrack, AliPID::kPion));
2528  nSigKaonTOF.push_back(fPIDResponse->NumberOfSigmasTOF( AODtrack, AliPID::kKaon));
2529  nSigProtonTOF.push_back(fPIDResponse->NumberOfSigmasTOF(AODtrack, AliPID::kProton)); */
2530 
2531  nSigPionTPC[iTrack] = fPIDResponse->NumberOfSigmasTPC(AODtrack, AliPID::kPion);
2532  nSigKaonTPC[iTrack] = fPIDResponse->NumberOfSigmasTPC(AODtrack, AliPID::kKaon);
2533  nSigProtonTPC[iTrack] = fPIDResponse->NumberOfSigmasTPC(AODtrack, AliPID::kProton);
2534 
2535  nSigPionTOF[iTrack] = fPIDResponse->NumberOfSigmasTOF(AODtrack, AliPID::kPion);
2536  nSigKaonTOF[iTrack] = fPIDResponse->NumberOfSigmasTOF(AODtrack, AliPID::kKaon);
2537  nSigProtonTOF[iTrack] = fPIDResponse->NumberOfSigmasTOF(AODtrack, AliPID::kProton);
2538 
2539  //-----------------------------------------------------
2540 
2541 
2542  ptTrk = AODtrack->Pt();
2543  etaTrk = AODtrack->Eta();
2544  Chi2Trk = AODtrack->Chi2perNDF();
2545  nClustTPC = AODtrack->GetTPCNcls();
2546  //dEdx = AODtrack->GetDetPid()->GetTPCsignal(); // This one breaks the code if called before checking FilterBit.
2547 
2548 
2549  //Track cuts for POIs: Same to be used for EP calc.
2550  //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)))
2551 
2552  //cuts for EP calculation:
2553  if(AODtrack->TestFilterBit(fFilterBit)){
2554 
2555  phiTrk = AODtrack->Phi();
2556  dEdx = AODtrack->GetDetPid()->GetTPCsignal();
2557  ChTrk = AODtrack->Charge();
2558 
2559  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))
2560  {
2561 
2562  ptWgtMC = 1.0;
2563 
2564  if(fFB_Efficiency_Cent[cent10bin]){
2565  ptBinMC = fFB_Efficiency_Cent[cent10bin]->FindBin(ptTrk); //Charge independent MC correction atm.
2566  ptWgtMC = 1.0/fFB_Efficiency_Cent[cent10bin]->GetBinContent(ptBinMC);
2567  }
2568 
2569  RefMultRawFB++;
2570  RefMultCorrFB += ptWgtMC;
2571 
2572 
2573  //------> Get NUA weights for EP <----------
2574  WgtNUA = 1.0;
2575 
2576  if(ChTrk>0){
2577  if(fHCorrectNUApos[cForNUA]){
2578  iBinNUA = fHCorrectNUApos[cForNUA]->FindBin(pVtxZ,phiTrk,etaTrk);
2579  WgtNUA = fHCorrectNUApos[cForNUA]->GetBinContent(iBinNUA);
2580  }
2581  //else{ WgtNUA = 1.0; }
2582  }
2583  else{
2584  if(fHCorrectNUAneg[cForNUA]){
2585  iBinNUA = fHCorrectNUAneg[cForNUA]->FindBin(pVtxZ,phiTrk,etaTrk);
2586  WgtNUA = fHCorrectNUAneg[cForNUA]->GetBinContent(iBinNUA);
2587  }
2588  //else{ WgtNUA = 1.0; }
2589  }
2590 
2591  if(etaTrk < -0.05){
2592  sumTPCQn2x[0] += WgtNUA*TMath::Cos(gPsiN*phiTrk);
2593  sumTPCQn2y[0] += WgtNUA*TMath::Sin(gPsiN*phiTrk);
2594  sumTPCQn3x[0] += WgtNUA*TMath::Cos(3*phiTrk);
2595  sumTPCQn3y[0] += WgtNUA*TMath::Sin(3*phiTrk);
2596  sumTPCQn4x[0] += WgtNUA*TMath::Cos(4*phiTrk);
2597  sumTPCQn4y[0] += WgtNUA*TMath::Sin(4*phiTrk);
2598  multEtaNeg++;
2599  SumWEtaNeg += WgtNUA;
2600  }
2601  else if(etaTrk > 0.05){
2602  sumTPCQn2x[1] += WgtNUA*TMath::Cos(gPsiN*phiTrk);
2603  sumTPCQn2y[1] += WgtNUA*TMath::Sin(gPsiN*phiTrk);
2604  sumTPCQn3x[1] += WgtNUA*TMath::Cos(3*phiTrk);
2605  sumTPCQn3y[1] += WgtNUA*TMath::Sin(3*phiTrk);
2606  sumTPCQn4x[1] += WgtNUA*TMath::Cos(4*phiTrk);
2607  sumTPCQn4y[1] += WgtNUA*TMath::Sin(4*phiTrk);
2608  multEtaPos++;
2609  SumWEtaPos += WgtNUA;
2610  }
2611  sumTPCQn2x[3] += WgtNUA*TMath::Cos(gPsiN*phiTrk);
2612  sumTPCQn2y[3] += WgtNUA*TMath::Sin(gPsiN*phiTrk);
2613  sumTPCQn3x[3] += WgtNUA*TMath::Cos(3*phiTrk);
2614  sumTPCQn3y[3] += WgtNUA*TMath::Sin(3*phiTrk);
2615  sumTPCQn4x[3] += WgtNUA*TMath::Cos(4*phiTrk);
2616  sumTPCQn4y[3] += WgtNUA*TMath::Sin(4*phiTrk);
2617  multEtaFull++;
2618  SumWEtaFull += WgtNUA;
2619  }// track cuts
2620  } // AOD fiter bit
2621 
2622 
2623  if(AODtrack->TestFilterBit(128)) multTPCAll++; // A. Dobrin TPC vs ESD PileUp Cut.
2624 
2625  if(!(AODtrack->TestFilterBit(1))) continue; // cuts for Outlier as in FlowEvent Task
2626 
2627  dEdx = AODtrack->GetDetPid()->GetTPCsignal();
2628 
2629  if((ptTrk < 0.2) || (ptTrk > 5.0) || (TMath::Abs(etaTrk) > 0.8) || (nClustTPC < 70) || (dEdx < 10.0) || (Chi2Trk < 0.1)) continue;
2630 
2631  if(AODtrack->GetDetPid() && Chi2Trk > 0.2) multTPC++;
2632 
2633  if(!AODtrack->TestFilterBit(16) || AODtrack->Chi2perNDF() < 0.1) continue;
2634  Double_t b[2] = {-99., -99.};
2635  Double_t bCov[3] = {-99., -99., -99.};
2636  AliAODTrack copy(*AODtrack);
2637  if(copy.PropagateToDCA(fVevent->GetPrimaryVertex(), fVevent->GetMagneticField(), 100., b, bCov) && TMath::Abs(b[0]) < 0.3 && TMath::Abs(b[1]) < 0.3) multGlobal++;
2638 
2639  }//--- track loop outlier/PileUp ----
2640 
2641 
2642 
2643 
2644 
2645 
2646  Int_t multEsd = ((AliAODHeader*)fAOD->GetHeader())->GetNumberOfESDTracks();
2647  Float_t multESDTPCDiff = (Float_t) multEsd - fPileUpSlopeParm*multTPCAll;
2648 
2649  //cout<<" Info:UserExec() called ... I am after PU cut... event = "<<fEventCount<<" \n";
2650 
2651  if(multESDTPCDiff > fPileUpConstParm) {
2652  fHistPileUpCount->Fill(7.5);
2653  bIsPileup=kTRUE;
2654  }
2655  else if(bIsPileup==kFALSE) {
2656 
2657  if(!fMultSelection->GetThisEventIsNotPileup()){
2658  fHistMultSelPUCount->Fill(0.5);
2659  bIsPileup=kTRUE;
2660  }
2661  if(!fMultSelection->GetThisEventIsNotPileupMV()){
2662  fHistMultSelPUCount->Fill(1.5);
2663  bIsPileup=kTRUE;
2664  }
2665  if(!fMultSelection->GetThisEventIsNotPileupInMultBins()){
2666  fHistMultSelPUCount->Fill(2.5);
2667  bIsPileup=kTRUE;
2668  }
2669  if(!fMultSelection->GetThisEventHasNoInconsistentVertices()){
2670  fHistMultSelPUCount->Fill(2.5);
2671  bIsPileup=kTRUE;
2672  }
2673  if(!fMultSelection->GetThisEventPassesTrackletVsCluster()){
2674  fHistMultSelPUCount->Fill(2.5);
2675  bIsPileup=kTRUE;
2676  }
2677  if(!fMultSelection->GetThisEventIsNotIncompleteDAQ()){
2678  fHistMultSelPUCount->Fill(2.5);
2679  bIsPileup=kTRUE;
2680  }
2681  if(!fMultSelection->GetThisEventHasGoodVertex2016()){
2682  fHistMultSelPUCount->Fill(2.5);
2683  bIsPileup=kTRUE;
2684  }
2685  if(bIsPileup) fHistPileUpCount->Fill(9.5);
2686  }
2687  //-----------------------------------------------------------------
2688 
2689 
2690 
2691 
2692 
2693 
2694 
2695 
2696 
2697  fHistTPCVsESDTrkBefore->Fill(multTPCAll,multEsd); //A. Dobrin
2698  fHistTPCvsGlobalMultBefore->Fill(multGlobal,multTPC);
2699 
2700 
2701  Bool_t bIsOutLier=kFALSE;
2702 
2703  if(multTPC < (-20.0+1.15*multGlobal) || multTPC > (200.+1.45*multGlobal)) { bIsOutLier = kTRUE;}
2704 
2705  fHistEventCount->Fill(stepCount); //6
2706  stepCount++;
2707 
2708 
2709  fHistTPConlyVsCL1Before->Fill(centrCL1,multTPCAll);
2710  fHistTPConlyVsV0MBefore->Fill(centrV0M,multTPCAll);
2711  fHistGlobalVsV0MBefore->Fill(centrV0M, multGlobal);
2712 
2713 
2714  //if bSkipPileUpCut is kTRUE then don't apply PileUp removal.
2715  if(!bSkipPileUpCut && bIsOutLier) return; //outlier TPC vs Global
2716 
2717  fHistTPCvsGlobalMultAfter->Fill(multGlobal,multTPC);
2718 
2719  fHistEventCount->Fill(stepCount); //7
2720  stepCount++;
2721 
2722 
2723  if(!bSkipPileUpCut && bIsPileup) return; //PileUp A. Dobrin
2724 
2725  fHistTPCVsESDTrkAfter->Fill(multTPCAll,multEsd);
2726 
2727  fHistEventCount->Fill(stepCount); //8
2728  stepCount++;
2729 
2730  //cout<<"After PU cut multTPC = "<<multTPC<<" multGlobal = "<<multGlobal<<endl;
2731 
2732 
2733 
2734 
2735 
2736  /*
2737  Int_t icentBin = centrality;
2738  icentBin++;
2739 
2740  Float_t TPCmultLowLimit = hCentvsTPCmultCuts->GetBinContent(icentBin,1);
2741  Float_t TPCmultHighLimit = hCentvsTPCmultCuts->GetBinContent(icentBin,1);
2742 
2743  TPCmultLowLimit -= 5.0 * hCentvsTPCmultCuts->GetBinContent(icentBin,2); //mean - 5sigma
2744  TPCmultHighLimit += 5.0 * hCentvsTPCmultCuts->GetBinContent(icentBin,2); //mean + 5sigma
2745  //std::cout<<" Cent = "<<centrality<<"\t icent = "<<icentBin<<" low = "<<TPCmultLowLimit<<"\t high = "<<TPCmultHighLimit<<std::endl;
2746 
2747  //centrality outlier
2748  if(!bSkipPileUpCut){ if(multTPC<TPCmultLowLimit || multTPC>TPCmultHighLimit) return; }
2749  */
2750 
2751 
2752 
2753 
2754 
2755  fHistEventCount->Fill(stepCount); //9
2756  stepCount++;
2757 
2758 
2759 
2760  fHistTPConlyVsCL1After->Fill(centrCL1,multTPCAll);
2761  fHistTPConlyVsV0MAfter->Fill(centrV0M,multTPCAll);
2762  fHistGlobalVsV0MAfter->Fill(centrV0M, multGlobal);
2763 
2764 
2765  // MC corrected Refmult:
2766  fHistRawVsCorrMultFB->Fill(RefMultRawFB,RefMultCorrFB); // FB set by AddTask..
2767 
2768 
2769  Float_t EvtCent = centrality;
2770 
2771 
2772 
2773 
2774  if(gPsiN > 0){
2775  if(multEtaNeg<2 || multEtaPos<2) return; //Minimum 2 tracks in each eta
2776  }
2777 
2778  fHistEventCount->Fill(stepCount); //10
2779  stepCount++;
2780 
2781  //--------------------------------------------------------
2782 
2783 
2784 
2785 
2786 
2787 
2788 
2789 
2790 
2791 
2792 
2793 
2794 
2795 
2796 
2797 
2798 
2799 
2800  //--------------- cent CL1 <= 90 cut ------------------
2801  Int_t icentV0Qn = centrCL1; // cent CL1 used for V0 calibration.
2802  icentV0Qn += 1;
2803 
2804  if(icentV0Qn>90) return;
2805 
2806  fHistEventCount->Fill(stepCount); //11
2807  stepCount++;
2808 
2809 
2810 
2811 
2812 
2813  //-------- V0M info ---------------
2814  const AliAODVZERO *fAODV0 = fAOD->GetVZEROData();
2815 
2816  //do v0m recentering
2817  Double_t QxanCor = 0, QyanCor = 0;
2818  Double_t QxcnCor = 0, QycnCor = 0;
2819 
2820  Double_t Qxan3 = 0., Qyan3 = 0.;
2821  Double_t Qxcn3 = 0., Qycn3 = 0.;
2822  Double_t Qxan2 = 0., Qyan2 = 0.;
2823  Double_t Qxcn2 = 0., Qycn2 = 0.;
2824 
2825  Double_t phiV0;
2826  Float_t fMultv0 = 0;
2827  Float_t sumMa = 0;
2828  Float_t sumMc = 0;
2829 
2830 
2831  if(gPsiN>0) { // Calculate EP only for gPsiN > 0
2832 
2833  for(int iV0 = 0; iV0 < 64; iV0++) { //0-31 is V0C, 32-63 VOA
2834 
2835  fMultv0 = fAODV0->GetMultiplicity(iV0);
2836 
2837  if(fHCorrectV0M){
2838  fMultv0 = fMultv0 * fHCorrectV0M->GetBinContent(iV0+1); // Gain Correction
2839  //cout<<"info: run = "<<runNumber<<" cent = "<<centrCL1<<"\t channel = "<<iV0<<" gain = "<<fHCorrectV0M->GetBinContent(iV0+1)<<endl;
2840  }
2841 
2842  fV0MultChVsRun->Fill(iV0+0.5,centrCL1,fMultv0);
2843  //fV0MultChVsRun->Fill(iV0+0.5,runindex,fMultv0);
2844 
2845  phiV0 = TMath::PiOver4()*(0.5 + iV0 % 8);
2846 
2847  if(iV0 < 32){
2848  Qxcn2 += TMath::Cos(2*phiV0) * fMultv0;
2849  Qycn2 += TMath::Sin(2*phiV0) * fMultv0;
2850  Qxcn3 += TMath::Cos(3*phiV0) * fMultv0;
2851  Qycn3 += TMath::Sin(3*phiV0) * fMultv0;
2852  sumMc += fMultv0;
2853  }
2854  else if(iV0 >= 32){
2855  Qxan2 += TMath::Cos(2*phiV0) * fMultv0;
2856  Qyan2 += TMath::Sin(2*phiV0) * fMultv0;
2857  Qxan3 += TMath::Cos(3*phiV0) * fMultv0;
2858  Qyan3 += TMath::Sin(3*phiV0) * fMultv0;
2859  sumMa += fMultv0;
2860  }
2861  }//----- channel loop ----------
2862 
2863 
2864  if(gPsiN==3){
2865  QxanCor = Qxan3/sumMa; //3rd order event plane
2866  QyanCor = Qyan3/sumMa;
2867  QxcnCor = Qxcn3/sumMc;
2868  QycnCor = Qycn3/sumMc;
2869 
2870  if(fHAvgerageQnV0C && fHAvgerageQnV0A && icentV0Qn < 91){
2871  QxanCor -= fHAvgerageQnV0A->GetBinContent(icentV0Qn,3); //x = Cos
2872  QxcnCor -= fHAvgerageQnV0C->GetBinContent(icentV0Qn,3); //x = Cos
2873  QyanCor -= fHAvgerageQnV0A->GetBinContent(icentV0Qn,4); //y = Sin
2874  QycnCor -= fHAvgerageQnV0C->GetBinContent(icentV0Qn,4); //y = Sin
2875 
2876  fV0AQ3xVsCentRun->Fill(centrCL1,QxanCor);
2877  fV0AQ3yVsCentRun->Fill(centrCL1,QyanCor);
2878  fV0CQ3xVsCentRun->Fill(centrCL1,QxcnCor);
2879  fV0CQ3yVsCentRun->Fill(centrCL1,QycnCor);
2880  }
2881  //printf("\n .... I am using my own V0 gain correction for Psi3...\n");
2882  }
2883  else{
2884  QxanCor = Qxan2/sumMa; //2nd order Event plane
2885  QyanCor = Qyan2/sumMa;
2886  QxcnCor = Qxcn2/sumMc;
2887  QycnCor = Qycn2/sumMc;
2888 
2889  if(fHAvgerageQnV0C && fHAvgerageQnV0A && icentV0Qn < 91){
2890  QxanCor -= fHAvgerageQnV0A->GetBinContent(icentV0Qn,1); //x = Cos
2891  QxcnCor -= fHAvgerageQnV0C->GetBinContent(icentV0Qn,1); //x = Cos
2892  QyanCor -= fHAvgerageQnV0A->GetBinContent(icentV0Qn,2); //y = Sin
2893  QycnCor -= fHAvgerageQnV0C->GetBinContent(icentV0Qn,2); //y = Sin
2894 
2895  fV0AQ2xVsCentRun->Fill(centrCL1,QxanCor);
2896  fV0AQ2yVsCentRun->Fill(centrCL1,QyanCor);
2897  fV0CQ2xVsCentRun->Fill(centrCL1,QxcnCor);
2898  fV0CQ2yVsCentRun->Fill(centrCL1,QycnCor);
2899  }
2900  //printf("\n .... I am using my own V0 gain correction for Psi2...\n");
2901  }
2902 
2903  //------ For V0-Qn Recenter and Event plane: Uncorrectd ----------
2905  fV0CQ2xVsCentRun->Fill(centrCL1,Qxcn2/sumMc);
2906  fV0CQ2yVsCentRun->Fill(centrCL1,Qycn2/sumMc);
2907  fV0AQ2xVsCentRun->Fill(centrCL1,Qxan2/sumMa);
2908  fV0AQ2yVsCentRun->Fill(centrCL1,Qyan2/sumMa);
2909 
2910  fV0CQ3xVsCentRun->Fill(centrCL1,Qxcn3/sumMc);
2911  fV0CQ3yVsCentRun->Fill(centrCL1,Qycn3/sumMc);
2912  fV0AQ3xVsCentRun->Fill(centrCL1,Qxan3/sumMa);
2913  fV0AQ3yVsCentRun->Fill(centrCL1,Qyan3/sumMa);
2914  }
2915 
2916  if(gPsiN>2){
2917  PsiNV0C = 1.0/gPsiN*( TMath::ATan2(QycnCor,QxcnCor) + TMath::Pi() );
2918  PsiNV0A = 1.0/gPsiN*( TMath::ATan2(QyanCor,QxanCor) + TMath::Pi() );
2919  }
2920  else{
2921  PsiNV0C = 1.0/gPsiN*TMath::ATan2(QycnCor,QxcnCor) ;
2922  if(PsiNV0C<0.) PsiNV0C += 2*TMath::Pi()/gPsiN;
2923 
2924  PsiNV0A = 1.0/gPsiN*TMath::ATan2(QyanCor,QxanCor) ;
2925  if(PsiNV0A<0.) PsiNV0A += 2*TMath::Pi()/gPsiN;
2926  }
2927 
2928 
2929  fHV0CEventPlaneVsCent->Fill(EvtCent,PsiNV0C);
2930  fHV0AEventPlaneVsCent->Fill(EvtCent,PsiNV0A);
2931 
2932  } //--------------------- if(gPsiN>0) --------------------------
2933 
2934 
2935 
2936 
2937 
2938 
2939 
2940  fEventCount++;
2941 
2942 
2943 
2944 
2945 
2946 
2947 
2948 
2949 
2950  //---- Copies of TPC-Q vectors to remove track -by- track auto-correlation -----
2951 
2952  Double_t sumQxTPCneg;
2953  Double_t sumQyTPCneg;
2954  Double_t sumQxTPCpos;
2955  Double_t sumQyTPCpos;
2956  Double_t sumQxTPCneg2;
2957  Double_t sumQyTPCneg2;
2958  Double_t sumQxTPCpos2;
2959  Double_t sumQyTPCpos2;
2960  Double_t SumWgtNeg, SumWgtPos;
2961  Double_t SumWgtNeg2, SumWgtPos2;
2962 
2963 
2964 
2965  //--------- Track variable for PID/Charge studies ----------------
2966  Double_t PDGmassPion = 0.13957;
2967  Double_t PDGmassKaon = 0.49368;
2968  Double_t PDGmassProton = 0.93827;
2969 
2970  PDGmassProton *= PDGmassProton;
2971  PDGmassPion *= PDGmassPion;
2972  PDGmassKaon *= PDGmassKaon;
2973 
2974  Double_t dEdx1, dEdx2, dPhi1, dPhi2, dPt1, dPt2;
2975  Double_t dEta1, dEta2, ptw1, ptw2, deltaPhi;
2976  Double_t mom, w1NUA, w2NUA, WgtEP;
2977  Double_t nSigTOFpion, nSigTPCpion;
2978  Double_t nSigTOFkaon, nSigTPCkaon;
2979  Double_t nSigTOFproton,nSigTPCproton;
2980  Double_t nSigTOFpion2, nSigTPCpion2;
2981  Double_t nSigTOFkaon2, nSigTPCkaon2;
2982  Double_t nSigTOFproton2,nSigTPCproton2;
2983 
2984  //Tof variables
2985  //Double_t length, tofTime, probMis, mass, beta;
2986  //Double_t c = TMath::C()*1.E-9; //bright light m/ns
2987  //Int_t TOFmatch=0;
2988 
2989 
2990 
2991  Int_t ptBin,gCharge1,gCharge2;
2992 
2993  //Double_t dcaXY, dcaZ ;
2994 
2995 
2996  //----------- Set the desired Harmonic ------------
2997  Int_t n = gN;
2998  Int_t m = gM;
2999  Int_t p =n+m;
3000  //------------------------------------------------
3001 
3002 
3003  Int_t skipPairHBT = 0;
3004 
3005 
3006 
3007 
3008 
3009  Double_t Chi2Trk1,ptwPion1,ptwKaon1,ptwProton1;
3010  Double_t Chi2Trk2,ptwPion2,ptwKaon2,ptwProton2;
3011  Double_t wNUAPion1,wNUAKaon1,wNUAProton1;
3012  Double_t wNUAPion2,wNUAKaon2,wNUAProton2;
3013 
3014  Double_t WgtEPPion = 1.0;
3015  Double_t WgtEPKaon = 1.0;
3016  Double_t WgtEPProton = 1.0;
3017 
3018 
3019  Bool_t isPion1 = kFALSE;
3020  Bool_t isKaon1 = kFALSE;
3021  Bool_t isProton1 = kFALSE;
3022  Bool_t isPion2 = kFALSE;
3023  Bool_t isKaon2 = kFALSE;
3024  Bool_t isProton2 = kFALSE;
3025 
3026  Int_t multPOI1st = 0;
3027  Int_t multPOI2nd = 0;
3028 
3029 
3030  //const Int_t maxTrack = 40000;
3031 
3032 
3033 
3034 
3035  //Calling fPIDResponse in nested loop is CPU expensive.
3036  //Store nSigma values in a array:
3037 
3038 
3039  /*
3040  for(int itrack = 0; itrack < ntracks; itrack++) {
3041 
3042  AliAODTrack *trackForPID=dynamic_cast<AliAODTrack*>(fVevent->GetTrack(itrack));
3043  if(!trackForPID) continue;
3044 
3045  // Array method:
3046  if(trackForPID){
3047  nSigPionTPC[itrack] = fPIDResponse->NumberOfSigmasTPC(trackForPID, AliPID::kPion);
3048  nSigKaonTPC[itrack] = fPIDResponse->NumberOfSigmasTPC(trackForPID, AliPID::kKaon);
3049  nSigProtonTPC[itrack] = fPIDResponse->NumberOfSigmasTPC(trackForPID, AliPID::kProton);
3050  nSigPionTOF[itrack] = fPIDResponse->NumberOfSigmasTOF(trackForPID, AliPID::kPion);
3051  nSigKaonTOF[itrack] = fPIDResponse->NumberOfSigmasTOF(trackForPID, AliPID::kKaon);
3052  nSigProtonTOF[itrack] = fPIDResponse->NumberOfSigmasTOF(trackForPID, AliPID::kProton);
3053  }
3054  else{
3055  nSigPionTPC[itrack] = -99;
3056  nSigKaonTPC[itrack] = -99;
3057  nSigProtonTPC[itrack] = -99;
3058  nSigPionTOF[itrack] = -99;
3059  nSigKaonTOF[itrack] = -99;
3060  nSigProtonTOF[itrack] = -99;
3061  }
3062 
3063  //if(itrack%10==0)
3064  //cout<< "nSig pi = " <<nSigPionTPC[itrack] << "nSig K = " << nSigKaonTPC[itrack] << "nSig p = " << nSigProtonTOF[itrack] << endl;
3065 
3066  // Vector method:
3067  //if(trackForPID){
3068  //nSigPionTPC.push_back(fPIDResponse->NumberOfSigmasTPC(trackForPID, AliPID::kPion));
3069  //nSigKaonTPC.push_back(fPIDResponse->NumberOfSigmasTPC(trackForPID, AliPID::kKaon));
3070  //nSigProtonTPC.push_back(fPIDResponse->NumberOfSigmasTPC(trackForPID, AliPID::kProton));
3071 
3072  //nSigPionTOF.push_back(fPIDResponse->NumberOfSigmasTOF(trackForPID, AliPID::kPion));
3073  //nSigKaonTOF.push_back(fPIDResponse->NumberOfSigmasTOF(trackForPID, AliPID::kKaon));
3074  //nSigProtonTOF.push_back(fPIDResponse->NumberOfSigmasTOF(trackForPID, AliPID::kProton));
3075  //}
3076  //else{
3077  //nSigPionTPC.push_back(-100.);
3078  //nSigKaonTPC.push_back(-100.);
3079  //nSigProtonTPC.push_back(-100.);
3080 
3081  //nSigPionTOF.push_back(-100.);
3082  //nSigKaonTOF.push_back(-100.);
3083  //nSigProtonTOF.push_back(-100.);
3084  //}
3085  }*/
3086 
3087 
3088 
3089 
3090 
3091 
3092  //Correct with Centrality Wgts : in second pass
3093  Int_t iCentBinWgt = (Int_t) centrality;
3094  iCentBinWgt += 1;
3095 
3096  Double_t fWgtCent = 1.0;
3097 
3098  if(fHCentWeightForRun){
3099  fWgtCent = fHCentWeightForRun->GetBinContent(iCentBinWgt);
3100  }
3101 
3102  //Fill Centrality for run-by-run: in first pass over data
3103  fCentDistAfter->Fill(centrality);
3104 
3105  //cout<<" Info:UserExec() called ... I am before track loop event = "<<fEventCount<<" \n";
3106 
3107 
3108 
3109  for(Int_t itrack = 0; itrack < ntracks; itrack++) {
3110 
3111  AliAODTrack *track=dynamic_cast<AliAODTrack*>(fVevent->GetTrack(itrack));
3112  if(!track) continue;
3113 
3114  if(!track->TestFilterBit(fFilterBit)) continue;
3115 
3116 
3117 
3118  mom = track->P();
3119  dPt1 = track->Pt();
3120  dPhi1 = track->Phi();
3121  dEta1 = track->Eta();
3122  gCharge1 = track->Charge();
3123  dEdx1 = track->GetDetPid()->GetTPCsignal();
3124  Chi2Trk1 = track->Chi2perNDF();
3125 
3126  //dcaXY = track->DCA();
3127  //dcaZ = track->ZAtDCA();
3128 
3129  /* Turn off QAs
3130  //-------------- Check TOF status ------------------
3131  AliPIDResponse::EDetPidStatus status;
3132  status = fPIDResponse->CheckPIDStatus(AliPIDResponse::kTOF,track);
3133  TOFmatch = 0;
3134  if(status==AliPIDResponse::kDetPidOk){
3135  TOFmatch++;
3136  }
3137  probMis = fPIDResponse->GetTOFMismatchProbability(track);
3138  fHistTOFMatchCount->Fill(TOFmatch,probMis);
3139 
3140  mass = -9.9;
3141  beta = -0.9;
3142 
3143  if(TOFmatch>0 && probMis < 0.01) {
3144  //This conditions are called when detector status is checked above :
3145  //if((track->IsOn(AliAODTrack::kTOFin)) && (track->IsOn(AliAODTrack::kTIME)) && (track->IsOn(AliAODTrack::kTOFout))) {
3146  //if((track->IsOn(AliAODTrack::kITSin)) && (track->IsOn(AliAODTrack::kTOFpid))) { //Naghmeh used it
3147  tofTime = track->GetTOFsignal(); // in pico seconds
3148  length = track->GetIntegratedLength();
3149  tofTime = tofTime*1.E-3; // ns
3150  if (tofTime <= 0) tofTime = 9999;
3151  length = length*0.01; // in meters
3152  tofTime = tofTime*c;
3153  beta = length/tofTime;
3154  mass = mom*mom*(1./(beta*beta) - 1);
3155  }//------------ TOF signal -------------------------
3156 
3157 
3158  //QA histograms before applying track cuts:
3159  fHistEtaPtBefore->Fill(dEta1,dPt1);
3160  fHistTPCdEdxvsPBefore->Fill(mom*gCharge1,dEdx1);
3161  fHistTOFBetavsPBefore->Fill(mom*gCharge1,beta);
3162  fHistTOFMassvsPtBefore->Fill(dPt1*gCharge1,mass); */
3163 
3164 
3165 
3166 
3167  //-------- Apply Default track cuts for analysis: ---------
3168  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)))
3169  continue;
3170 
3171  multPOI1st++;
3172 
3173 
3174 
3175  //--------------------- PID signals 1st track-------------------------
3176  /*nSigTOFpion = fPIDResponse->NumberOfSigmasTOF(track, AliPID::kPion);
3177  nSigTOFkaon = fPIDResponse->NumberOfSigmasTOF(track, AliPID::kKaon);
3178  nSigTOFproton = fPIDResponse->NumberOfSigmasTOF(track, AliPID::kProton);
3179  nSigTPCpion = fPIDResponse->NumberOfSigmasTPC(track, AliPID::kPion);
3180  nSigTPCkaon = fPIDResponse->NumberOfSigmasTPC(track, AliPID::kKaon);
3181  nSigTPCproton = fPIDResponse->NumberOfSigmasTPC(track, AliPID::kProton);*/
3182 
3183 
3184 
3185  //Vector/Array both works same way:
3186  nSigTPCpion = nSigPionTPC[itrack];
3187  nSigTPCkaon = nSigKaonTPC[itrack];
3188  nSigTPCproton = nSigProtonTPC[itrack];
3189  nSigTOFpion = nSigPionTOF[itrack];
3190  nSigTOFkaon = nSigKaonTOF[itrack];
3191  nSigTOFproton = nSigProtonTOF[itrack];
3192 
3193 
3194 
3195  //if(itrack%100==0)
3196  //cout<<"Trk "<<itrack<<" pt1 = "<<dPt1<<"\tnSigPion = "<<nSigTPCpion<<"\tnSigKaon = "<<nSigTPCkaon <<"\tnSigprot = "<<nSigTPCproton<<endl;
3197 
3198  isPion1 = kFALSE;
3199  isKaon1 = kFALSE;
3200  isProton1 = kFALSE;
3201 
3202  //------> Pion
3203  if(dPt1<0.6 && TMath::Abs(nSigTPCpion)<=2.5){
3204  isPion1 = kTRUE;
3205  }
3206  else if(dPt1>=0.6 && dPt1<=2.0 && TMath::Abs(nSigTPCpion)<=2.5 && TMath::Abs(nSigTOFpion)<=2.0 ){
3207  isPion1 = kTRUE;
3208  }
3209  //------> Kaon
3210  if(dPt1<0.6 && TMath::Abs(nSigTPCkaon)<=2.5){
3211  isKaon1 = kTRUE;
3212  }
3213  else if(dPt1>=0.6 && dPt1<=2.0 && TMath::Abs(nSigTPCkaon)<=2.5 && TMath::Abs(nSigTOFkaon)<=2.0){
3214  isKaon1 = kTRUE;
3215  }
3216  //------> Proton
3217  if(dPt1<0.8 && TMath::Abs(nSigTPCproton)<=2.5){
3218  isProton1 = kTRUE;
3219  }
3220  else if(dPt1>=0.8 && dPt1<=3.5 && TMath::Abs(nSigTPCproton)<=2.5 && TMath::Abs(nSigTOFproton)<=2.5){
3221  isProton1 = kTRUE;
3222  }
3223 
3224  //Proton below 0.4 GeV is garbage
3225  if(dPt1<0.4) isProton1 = kFALSE;
3226 
3227  //-----------------------------------------------------------------
3228 
3229 
3230 
3231 
3232 
3233  //================= MC wgt and NUA wgt for PID =================
3234  ptwPion1 = 1.0;
3235  ptwKaon1 = 1.0;
3236  ptwProton1 = 1.0;
3237  wNUAPion1 = 1.0;
3238  wNUAKaon1 = 1.0;
3239  wNUAProton1 = 1.0;
3240 
3241  //------ get MC weight and NUA for Pion track1 --------------
3242  if(isPion1){
3243  if(fFB_Efficiency_Pion_Cent[cent10bin]){ // <-------------------- !!!! WARNING: use Pion Efficiency file when available.
3244  ptBin = fFB_Efficiency_Pion_Cent[cent10bin]->FindBin(dPt1);
3245  ptwPion1 = 1.0/fFB_Efficiency_Pion_Cent[cent10bin]->GetBinContent(ptBin);
3246  }
3247  //else{ ptwPion1 = 1.0; }
3248 
3249  if(gCharge1>0){
3250  if(fHCorrectNUAposPion[cForNUA]){
3251  iBinNUA = fHCorrectNUAposPion[cForNUA]->FindBin(pVtxZ,dPhi1,dEta1);
3252  wNUAPion1 = fHCorrectNUAposPion[cForNUA]->GetBinContent(iBinNUA);
3253  }
3254  //else{ wNUAPion1 = 1.0; }
3255  }
3256  else{
3257  if(fHCorrectNUAnegPion[cForNUA]){
3258  iBinNUA = fHCorrectNUAnegPion[cForNUA]->FindBin(pVtxZ,dPhi1,dEta1);
3259  wNUAPion1 = fHCorrectNUAnegPion[cForNUA]->GetBinContent(iBinNUA);
3260  }
3261  //else{ wNUAPion1 = 1.0; }
3262  }
3263  }
3264 
3265 
3266  //------ get MC weight and NUA for Kaon track1 --------------
3267  if(isKaon1){
3268  if(fFB_Efficiency_Kaon_Cent[cent10bin]){ // <-------------------- !!!! WARNING: use Kaon Efficiency file when available.
3269  ptBin = fFB_Efficiency_Kaon_Cent[cent10bin]->FindBin(dPt1);
3270  ptwKaon1 = 1.0/fFB_Efficiency_Kaon_Cent[cent10bin]->GetBinContent(ptBin);
3271  }
3272  //else{ ptwKaon1 = 1.0; }
3273 
3274  if(gCharge1>0){
3275  if(fHCorrectNUAposKaon[cForNUA]){
3276  iBinNUA = fHCorrectNUAposKaon[cForNUA]->FindBin(pVtxZ,dPhi1,dEta1);
3277  wNUAKaon1 = fHCorrectNUAposKaon[cForNUA]->GetBinContent(iBinNUA);
3278  }
3279  //else{ wNUAKaon1 = 1.0; }
3280  }
3281  else{
3282  if(fHCorrectNUAnegKaon[cForNUA]){
3283  iBinNUA = fHCorrectNUAnegKaon[cForNUA]->FindBin(pVtxZ,dPhi1,dEta1);
3284  wNUAKaon1 = fHCorrectNUAnegKaon[cForNUA]->GetBinContent(iBinNUA);
3285  }
3286  //else{ wNUAKaon1 = 1.0; }
3287  }
3288  }
3289  //------ get MC weight and NUA for Proton track1 --------------
3290  if(isProton1){
3291  if(fFB_Efficiency_Proton_Cent[cent10bin]){ // <-------------------- !!!! WARNING: use Proton Efficiency file when available.
3292  ptBin = fFB_Efficiency_Proton_Cent[cent10bin]->FindBin(dPt1);
3293  ptwProton1 = 1.0/fFB_Efficiency_Proton_Cent[cent10bin]->GetBinContent(ptBin);
3294  }
3295  //else{ ptwProton1 = 1.0; }
3296 
3297  if(gCharge1>0){
3298  if(fHCorrectNUAposProton[cForNUA]){
3299  iBinNUA = fHCorrectNUAposProton[cForNUA]->FindBin(pVtxZ,dPhi1,dEta1);
3300  wNUAProton1 = fHCorrectNUAposProton[cForNUA]->GetBinContent(iBinNUA);
3301  }
3302  //else{ wNUAProton1 = 1.0; }
3303  }
3304  else{
3305  if(fHCorrectNUAnegProton[cForNUA]){
3306  iBinNUA = fHCorrectNUAnegProton[cForNUA]->FindBin(pVtxZ,dPhi1,dEta1);
3307  wNUAProton1 = fHCorrectNUAnegProton[cForNUA]->GetBinContent(iBinNUA);
3308  }
3309  //else{ wNUAProton1 = 1.0; }
3310  }
3311  }
3312  //=========================== X ===============================
3313 
3314 
3315 
3316  //------ get MC weight and NUA for Charged track 1--------------
3317  ptw1 = 1.0;
3318  w1NUA = 1.0;
3319 
3320  if(fFB_Efficiency_Cent[cent10bin]){
3321  ptBin = fFB_Efficiency_Cent[cent10bin]->FindBin(dPt1);
3322  ptw1 = 1.0/fFB_Efficiency_Cent[cent10bin]->GetBinContent(ptBin);
3323  }
3324  //else{ ptw1 = 1.0; }
3325 
3326  if(gCharge1>0){
3327  if(fHCorrectNUApos[cForNUA]){
3328  iBinNUA = fHCorrectNUApos[cForNUA]->FindBin(pVtxZ,dPhi1,dEta1);
3329  w1NUA = fHCorrectNUApos[cForNUA]->GetBinContent(iBinNUA);
3330  }
3331  //else{ w1NUA = 1.0; }
3332  }
3333  else{
3334  if(fHCorrectNUAneg[cForNUA]){
3335  iBinNUA = fHCorrectNUAneg[cForNUA]->FindBin(pVtxZ,dPhi1,dEta1);
3336  w1NUA = fHCorrectNUAneg[cForNUA]->GetBinContent(iBinNUA);
3337  }
3338  //else{ w1NUA = 1.0; }
3339  }
3340 
3341  if(w1NUA==0) w1NUA = 1.0;
3342 
3343 
3344 
3345  //============= charged hadron analysis: ============
3346  sumQxTPCneg = sumTPCQn2x[0]; // first copy to remove 1st track fron Q vector (AutoCorrelation)
3347  sumQyTPCneg = sumTPCQn2y[0];
3348  sumQxTPCpos = sumTPCQn2x[1];
3349  sumQyTPCpos = sumTPCQn2y[1];
3350  SumWgtNeg = SumWEtaNeg;
3351  SumWgtPos = SumWEtaPos;
3352 
3353  //-------- Remove phi1 from EP calculation ----------
3354 
3355  if(dEta1 < -0.05){
3356  sumQxTPCneg -= w1NUA*TMath::Cos(gPsiN*dPhi1);
3357  sumQyTPCneg -= w1NUA*TMath::Sin(gPsiN*dPhi1); // [0] = eta <-0.05
3358  SumWgtNeg -= w1NUA;
3359  }
3360  else if(dEta1 > 0.05){
3361  sumQxTPCpos -= w1NUA*TMath::Cos(gPsiN*dPhi1);
3362  sumQyTPCpos -= w1NUA*TMath::Sin(gPsiN*dPhi1); // [1] = eta > 0.05
3363  SumWgtPos -= w1NUA;
3364  }
3365  //-----------------------------------------------------
3366 
3367 
3368 
3369 
3370 
3371 
3372 
3373 
3374 
3375 
3376 
3377 
3378  multPOI2nd = 0;
3379 
3380  //---2nd track loop (nested)---
3381  for(Int_t jtrack = 0; jtrack < ntracks; jtrack++) {
3382 
3383  if(jtrack==itrack) continue;
3384 
3385  AliAODTrack *track2=dynamic_cast<AliAODTrack*>(fVevent->GetTrack(jtrack));
3386  if(!track2) continue;
3387 
3388  if(!(track2->TestFilterBit(fFilterBit))) continue;
3389 
3390  dPt2 = track2->Pt();
3391  dPhi2 = track2->Phi();
3392  dEta2 = track2->Eta();
3393  gCharge2= track2->Charge();
3394  dEdx2 = track2->GetDetPid()->GetTPCsignal();
3395  Chi2Trk2 = track2->Chi2perNDF();
3396 
3397  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)))
3398  continue;
3399 
3400  multPOI2nd++;
3401 
3402 
3403 
3404  /*
3405  if(track2->GetDetPid()->GetTPCsignal() < 10.0) continue;
3406  if(track2->GetTPCNcls() < 70) continue;
3407  if(track2->Chi2perNDF() < 0.2) continue;
3408  if(dPt2 < fMinPtCut || dPt2 > fMaxPtCut) continue;
3409  if(dEta2< fMinEtaCut || dEta2 > fMaxEtaCut) continue;
3410  if(!TMath::Abs(gCharge2)) continue;
3411  //if(!(track2->TestFilterBit(fFilterBit))) continue; */
3412  //-----------------------------------------------------
3413 
3414  //calling fPIDResponse is too costly for CPU
3415  //--------------------- PID signals 2nd track-------------------------
3416  /*nSigTOFpion2 = fPIDResponse->NumberOfSigmasTOF(track2, AliPID::kPion);
3417  nSigTOFkaon2 = fPIDResponse->NumberOfSigmasTOF(track2, AliPID::kKaon);
3418  nSigTOFproton2 = fPIDResponse->NumberOfSigmasTOF(track2, AliPID::kProton);
3419  nSigTPCpion2 = fPIDResponse->NumberOfSigmasTPC(track2, AliPID::kPion);
3420  nSigTPCkaon2 = fPIDResponse->NumberOfSigmasTPC(track2, AliPID::kKaon);
3421  nSigTPCproton2 = fPIDResponse->NumberOfSigmasTPC(track2, AliPID::kProton); */
3422 
3423 
3424 
3425  //Vector/Array both works same way:
3426  nSigTPCpion2 = nSigPionTPC[jtrack];
3427  nSigTPCkaon2 = nSigKaonTPC[jtrack];
3428  nSigTPCproton2 = nSigProtonTPC[jtrack];
3429  nSigTOFpion2 = nSigPionTOF[jtrack];
3430  nSigTOFkaon2 = nSigKaonTOF[jtrack];
3431  nSigTOFproton2 = nSigProtonTOF[jtrack];
3432 
3433 
3434 
3435 
3436 
3437  isPion2 = kFALSE;
3438  isKaon2 = kFALSE;
3439  isProton2 = kFALSE;
3440 
3441  //------> Pion 2
3442  if(dPt2<0.6 && TMath::Abs(nSigTPCpion2)<=2.5){
3443  isPion2 = kTRUE;
3444  }
3445  else if(dPt2>=0.6 && dPt2<=2.0 && TMath::Abs(nSigTPCpion2)<=2.5 && TMath::Abs(nSigTOFpion2)<=2.0 ){
3446  isPion2 = kTRUE;
3447  }
3448  //------> Kaon 2
3449  if(dPt2<0.6 && TMath::Abs(nSigTPCkaon2)<=2.5){
3450  isKaon2 = kTRUE;
3451  }
3452  else if(dPt2>=0.6 && dPt2<=2.0 && TMath::Abs(nSigTPCkaon2)<=2.5 && TMath::Abs(nSigTOFkaon2)<=2.0){
3453  isKaon2 = kTRUE;
3454  }
3455  //------> Proton 2
3456  if(dPt2<0.8 && TMath::Abs(nSigTPCproton2)<=2.5){
3457  isProton2 = kTRUE;
3458  }
3459  else if(dPt2>=0.8 && dPt2<=3.5 && TMath::Abs(nSigTPCproton2)<=2.5 && TMath::Abs(nSigTOFproton2)<=2.5){
3460  isProton2 = kTRUE;
3461  }
3462  //Proton below 0.4 GeV is garbage
3463  if(dPt2<0.4) isProton2 = kFALSE;
3464 
3465  //----------------------------------------------------------------
3466 
3467 
3468 
3469 
3470 
3471  //================= MC wgt and NUA wgt for PID =================
3472  WgtEPPion = 1.0;
3473  WgtEPKaon = 1.0;
3474  WgtEPProton = 1.0;
3475 
3476  ptwPion2 = 1.0;
3477  ptwKaon2 = 1.0;
3478  ptwProton2 = 1.0;
3479  wNUAPion2 = 1.0;
3480  wNUAKaon2 = 1.0;
3481  wNUAProton2 = 1.0;
3482 
3483  //------ get MC weight and NUA for Pion track2 --------------
3484  if(isPion2){
3485  if(fFB_Efficiency_Pion_Cent[cent10bin]){ // <-------------------- !!!! WARNING: use Pion Efficiency file when available.
3486  ptBin = fFB_Efficiency_Pion_Cent[cent10bin]->FindBin(dPt2);
3487  ptwPion2 = 1.0/fFB_Efficiency_Pion_Cent[cent10bin]->GetBinContent(ptBin);
3488  }
3489  //else{ ptwPion2 = 1.0; }
3490 
3491  if(gCharge2>0){
3492  if(fHCorrectNUAposPion[cForNUA]){
3493  iBinNUA = fHCorrectNUAposPion[cForNUA]->FindBin(pVtxZ,dPhi2,dEta2);
3494  wNUAPion2 = fHCorrectNUAposPion[cForNUA]->GetBinContent(iBinNUA);
3495  }
3496  //else{ wNUAPion2 = 1.0; }
3497  }
3498  else{
3499  if(fHCorrectNUAnegPion[cForNUA]){
3500  iBinNUA = fHCorrectNUAnegPion[cForNUA]->FindBin(pVtxZ,dPhi2,dEta2);
3501  wNUAPion2 = fHCorrectNUAnegPion[cForNUA]->GetBinContent(iBinNUA);
3502  }
3503  //else{ wNUAPion2 = 1.0; }
3504  }
3505 
3506  WgtEPPion = ptwPion1*ptwPion2*wNUAPion1*wNUAPion2;
3507  }
3508 
3509  //------ get MC weight and NUA for Kaon track2 --------------
3510  if(isKaon2){
3511  if(fFB_Efficiency_Kaon_Cent[cent10bin]){ // <-------------------- !!!! WARNING: use Kaon Efficiency file when available.
3512  ptBin = fFB_Efficiency_Kaon_Cent[cent10bin]->FindBin(dPt2);
3513  ptwKaon2 = 1.0/fFB_Efficiency_Kaon_Cent[cent10bin]->GetBinContent(ptBin);
3514  }
3515  //else{ ptwKaon2 = 1.0; }
3516 
3517  if(gCharge2>0){
3518  if(fHCorrectNUAposKaon[cForNUA]){
3519  iBinNUA = fHCorrectNUAposKaon[cForNUA]->FindBin(pVtxZ,dPhi2,dEta2);
3520  wNUAKaon2 = fHCorrectNUAposKaon[cForNUA]->GetBinContent(iBinNUA);
3521  }
3522  //else{ wNUAKaon2 = 1.0; }
3523  }
3524  else{
3525  if(fHCorrectNUAnegKaon[cForNUA]){
3526  iBinNUA = fHCorrectNUAnegKaon[cForNUA]->FindBin(pVtxZ,dPhi2,dEta2);
3527  wNUAKaon2 = fHCorrectNUAnegKaon[cForNUA]->GetBinContent(iBinNUA);
3528  }
3529  //else{ wNUAKaon2 = 1.0; }
3530  }
3531 
3532  WgtEPKaon = ptwKaon1*ptwKaon2*wNUAKaon1*wNUAKaon2;
3533  }
3534  //------ get MC weight and NUA for Proton track2 --------------
3535  if(isProton2){
3536  if(fFB_Efficiency_Proton_Cent[cent10bin]){ // <-------------------- !!!! WARNING: use Proton Efficiency file when available.
3537  ptBin = fFB_Efficiency_Proton_Cent[cent10bin]->FindBin(dPt2);
3538  ptwProton2 = 1.0/fFB_Efficiency_Proton_Cent[cent10bin]->GetBinContent(ptBin);
3539  }
3540  //else{ ptwProton2 = 1.0; }
3541 
3542  if(gCharge2>0){
3543  if(fHCorrectNUAposProton[cForNUA]){
3544  iBinNUA = fHCorrectNUAposProton[cForNUA]->FindBin(pVtxZ,dPhi2,dEta2);
3545  wNUAProton2 = fHCorrectNUAposProton[cForNUA]->GetBinContent(iBinNUA);
3546  }
3547  //else{ wNUAProton2 = 1.0; }
3548  }
3549  else{
3550  if(fHCorrectNUAnegProton[cForNUA]){
3551  iBinNUA = fHCorrectNUAnegProton[cForNUA]->FindBin(pVtxZ,dPhi2,dEta2);
3552  wNUAProton2 = fHCorrectNUAnegProton[cForNUA]->GetBinContent(iBinNUA);
3553  }
3554  //else{ wNUAProton2 = 1.0; }
3555  }
3556 
3557  WgtEPProton = ptwProton1*ptwProton2*wNUAProton1*wNUAProton2;
3558  }
3559  //========================== X ================================
3560 
3561 
3562 
3563 
3564 
3565  //------ get MC weight and NUA (Charged) for track 2--------------
3566  WgtEP = 1.0;
3567  ptw2 = 1.0;
3568  w2NUA = 1.0;
3569 
3570  if(fFB_Efficiency_Cent[cent10bin]){
3571  ptBin = fFB_Efficiency_Cent[cent10bin]->FindBin(dPt2);
3572  ptw2 = 1.0/fFB_Efficiency_Cent[cent10bin]->GetBinContent(ptBin);
3573  }
3574  //else{ ptw2 = 1.0; }
3575 
3576  if(gCharge2>0){
3577  if(fHCorrectNUApos[cForNUA]){
3578  iBinNUA = fHCorrectNUApos[cForNUA]->FindBin(pVtxZ,dPhi2,dEta2);
3579  w2NUA = fHCorrectNUApos[cForNUA]->GetBinContent(iBinNUA);
3580  }
3581  //else{ w2NUA = 1.0; }
3582  }
3583  else{
3584  if(fHCorrectNUAneg[cForNUA]){
3585  iBinNUA = fHCorrectNUAneg[cForNUA]->FindBin(pVtxZ,dPhi2,dEta2);
3586  w2NUA = fHCorrectNUAneg[cForNUA]->GetBinContent(iBinNUA);
3587  }
3588  //else{ w2NUA = 1.0; }
3589  }
3590 
3591  if(w2NUA==0) w2NUA = 1.0;
3592 
3593 
3594 
3595 
3596 
3597 
3598 
3599 
3600 
3601 
3602 
3603 
3604  //---------- Remove track2 from EP calculation ---------
3605  sumQxTPCneg2 = sumQxTPCneg; //second copy to remove 2nd track from EP
3606  sumQyTPCneg2 = sumQyTPCneg;
3607  sumQxTPCpos2 = sumQxTPCpos;
3608  sumQyTPCpos2 = sumQyTPCpos;
3609  SumWgtNeg2 = SumWgtNeg;
3610  SumWgtPos2 = SumWgtPos;
3611  //------------------------------------------------------
3612 
3613 
3614 
3615  if(dEta2 < -0.05){
3616  sumQxTPCneg2 -= w2NUA*TMath::Cos(gPsiN*dPhi2);
3617  sumQyTPCneg2 -= w2NUA*TMath::Sin(gPsiN*dPhi2); // [0] = eta <-0.05
3618  SumWgtNeg2 -= w2NUA;
3619  }
3620  else if(dEta2 > 0.05){
3621  sumQxTPCpos2 -= w2NUA*TMath::Cos(gPsiN*dPhi2);
3622  sumQyTPCpos2 -= w2NUA*TMath::Sin(gPsiN*dPhi2); // [1] = eta > 0.05
3623  SumWgtPos2 -= w2NUA;
3624  }
3625 
3626  if(SumWgtNeg2>0 && SumWgtPos2>0){
3627  sumQyTPCneg2 = sumQyTPCneg2/SumWgtNeg2;
3628  sumQxTPCneg2 = sumQxTPCneg2/SumWgtNeg2;
3629 
3630  sumQyTPCpos2 = sumQyTPCpos2/SumWgtPos2;
3631  sumQxTPCpos2 = sumQxTPCpos2/SumWgtPos2;
3632  }
3633 
3634  // track by track EP:
3635  /*
3636  if(gPsiN>2){
3637  //Enable periodicity PsiN directly:
3638  PsiNTPCC = (1.0/gPsiN)*( TMath::ATan2(sumQyTPCneg2,sumQxTPCneg2) + TMath::Pi() ) ; // negetive eta
3639  PsiNTPCA = (1.0/gPsiN)*( TMath::ATan2(sumQyTPCpos2,sumQxTPCpos2) + TMath::Pi() ) ; // positive eta
3640  }
3641  else{
3642  PsiNTPCC = (1.0/gPsiN)*( TMath::ATan2(sumQyTPCneg2,sumQxTPCneg2) ) ; // negetive eta
3643  if(PsiNTPCC<0.) PsiNTPCC += 2*TMath::Pi()/gPsiN;
3644 
3645  PsiNTPCA = (1.0/gPsiN)*( TMath::ATan2(sumQyTPCpos2,sumQxTPCpos2) ) ; // positive eta
3646  if(PsiNTPCA<0.) PsiNTPCA += 2*TMath::Pi()/gPsiN;
3647  } */
3648 
3649  if(gPsiN>0){
3650  PsiNTPCC = (1.0/gPsiN)*( TMath::ATan2(sumQyTPCneg2,sumQxTPCneg2) ) ; // negetive eta
3651  if(PsiNTPCC<0.) PsiNTPCC += 2*TMath::Pi()/gPsiN;
3652 
3653  PsiNTPCA = (1.0/gPsiN)*( TMath::ATan2(sumQyTPCpos2,sumQxTPCpos2) ) ; // positive eta
3654  if(PsiNTPCA<0.) PsiNTPCA += 2*TMath::Pi()/gPsiN;
3655  }
3656 
3657  //fHTPCAEventPlaneVsCent->Fill(EvtCent,PsiNTPCA);
3658  //fHTPCCEventPlaneVsCent->Fill(EvtCent,PsiNTPCC);
3659  //-----------------------------------------------------------
3660 
3661 
3662 
3663 
3664  // combined weight for EP:
3665  WgtEP = ptw1*ptw2*w1NUA*w2NUA;
3666 
3667 
3668 
3669  deltaPhi = dPhi1 - dPhi2; //for 2p correlator
3670 
3672 
3673  if(gCharge1!=gCharge2) {
3674  fHist_Corr3p_EP_Norm_PN[QAindex][0]->Fill(EvtCent, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0A), WgtEP*fWgtCent);
3675  fHist_Corr3p_EP_Norm_PN[QAindex][1]->Fill(EvtCent, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0C), WgtEP*fWgtCent);
3676  fHist_Corr3p_EP_Norm_PN[QAindex][2]->Fill(EvtCent, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNTPCA),WgtEP*fWgtCent);
3677  fHist_Corr3p_EP_Norm_PN[QAindex][3]->Fill(EvtCent, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNTPCC),WgtEP*fWgtCent);
3678  /*
3679  fHist_Corr3p_EP_Refm_PN[QAindex][0]->Fill(RefMultCorrFB, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0A), WgtEP*fWgtCent);
3680  fHist_Corr3p_EP_Refm_PN[QAindex][1]->Fill(RefMultCorrFB, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0C), WgtEP*fWgtCent);
3681  fHist_Corr3p_EP_Refm_PN[QAindex][2]->Fill(RefMultCorrFB, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNTPCA),WgtEP*fWgtCent);
3682  fHist_Corr3p_EP_Refm_PN[QAindex][3]->Fill(RefMultCorrFB, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNTPCC),WgtEP*fWgtCent);
3683 
3684  //2p vs Centrality:
3685  fHist_Corr2p_EP_Norm_PN[QAindex][0]->Fill(EvtCent, TMath::Cos(deltaPhi), WgtEP*fWgtCent);
3686  fHist_Corr2p_EP_Norm_PN[QAindex][1]->Fill(EvtCent, TMath::Cos(2*deltaPhi), WgtEP*fWgtCent);
3687  fHist_Corr2p_EP_Norm_PN[QAindex][2]->Fill(EvtCent, TMath::Cos(3*deltaPhi), WgtEP*fWgtCent);
3688  fHist_Corr2p_EP_Norm_PN[QAindex][3]->Fill(EvtCent, TMath::Cos(4*deltaPhi), WgtEP*fWgtCent);
3689 
3690  fHist_Corr2p_EP_Refm_PN[QAindex][0]->Fill(RefMultCorrFB, TMath::Cos(deltaPhi), WgtEP*fWgtCent);
3691  fHist_Corr2p_EP_Refm_PN[QAindex][1]->Fill(RefMultCorrFB, TMath::Cos(2*deltaPhi), WgtEP*fWgtCent);
3692  fHist_Corr2p_EP_Refm_PN[QAindex][2]->Fill(RefMultCorrFB, TMath::Cos(3*deltaPhi), WgtEP*fWgtCent);
3693  fHist_Corr2p_EP_Refm_PN[QAindex][3]->Fill(RefMultCorrFB, TMath::Cos(4*deltaPhi), WgtEP*fWgtCent);
3694  */
3695 
3696  if(cIndex<6){
3697  fHist_Corr3p_pTSum_EP_V0A_PN[QAindex][cIndex]->Fill((dPt1+dPt2)*0.5, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0A),WgtEP*fWgtCent);
3698  fHist_Corr3p_pTSum_EP_V0C_PN[QAindex][cIndex]->Fill((dPt1+dPt2)*0.5, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0C),WgtEP*fWgtCent);
3699  fHist_Corr3p_pTDiff_EP_V0A_PN[QAindex][cIndex]->Fill(TMath::Abs(dPt1-dPt2), TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0A),WgtEP*fWgtCent);
3700  fHist_Corr3p_pTDiff_EP_V0C_PN[QAindex][cIndex]->Fill(TMath::Abs(dPt1-dPt2), TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0C),WgtEP*fWgtCent);
3701  fHist_Corr3p_EtaDiff_EP_V0A_PN[QAindex][cIndex]->Fill(TMath::Abs(dEta1-dEta2), TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0A),WgtEP*fWgtCent);
3702  fHist_Corr3p_EtaDiff_EP_V0C_PN[QAindex][cIndex]->Fill(TMath::Abs(dEta1-dEta2), TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0C),WgtEP*fWgtCent);
3703  /*
3704  fHist_Corr2p_pTSum_EP_Harm1_PN[QAindex][cIndex]->Fill((dPt1+dPt2)*0.5, TMath::Cos( deltaPhi), WgtEP*fWgtCent);
3705  fHist_Corr2p_pTSum_EP_Harm2_PN[QAindex][cIndex]->Fill((dPt1+dPt2)*0.5, TMath::Cos(2*deltaPhi),WgtEP*fWgtCent);
3706  fHist_Corr2p_pTDiff_EP_Harm1_PN[QAindex][cIndex]->Fill((dPt1+dPt2)*0.5, TMath::Cos( deltaPhi), WgtEP*fWgtCent);
3707  fHist_Corr2p_pTDiff_EP_Harm2_PN[QAindex][cIndex]->Fill((dPt1+dPt2)*0.5, TMath::Cos(2*deltaPhi),WgtEP*fWgtCent);
3708  fHist_Corr2p_EtaDiff_EP_Harm1_PN[QAindex][cIndex]->Fill((dPt1+dPt2)*0.5,TMath::Cos( deltaPhi), WgtEP*fWgtCent);
3709  fHist_Corr2p_EtaDiff_EP_Harm2_PN[QAindex][cIndex]->Fill((dPt1+dPt2)*0.5,TMath::Cos(2*deltaPhi),WgtEP*fWgtCent);
3710  */
3711  }
3712  //-------------> PID CME ---------------
3713  //Pion:
3714  if(isPion1 && isPion2){
3715  fHist_Corr3p_Pion_EP_Norm_PN[QAindex][0]->Fill(EvtCent, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0A), WgtEPPion*fWgtCent);
3716  fHist_Corr3p_Pion_EP_Norm_PN[QAindex][1]->Fill(EvtCent, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0C), WgtEPPion*fWgtCent);
3717  fHist_Corr3p_Pion_EP_Norm_PN[QAindex][2]->Fill(EvtCent, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNTPCA),WgtEPPion*fWgtCent);
3718  fHist_Corr3p_Pion_EP_Norm_PN[QAindex][3]->Fill(EvtCent, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNTPCC),WgtEPPion*fWgtCent);
3719  /*
3720  fHist_Corr3p_Pion_EP_Refm_PN[QAindex][0]->Fill(RefMultCorrFB, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0A), WgtEP*fWgtCent);
3721  fHist_Corr3p_Pion_EP_Refm_PN[QAindex][1]->Fill(RefMultCorrFB, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0C), WgtEP*fWgtCent);
3722  fHist_Corr3p_Pion_EP_Refm_PN[QAindex][2]->Fill(RefMultCorrFB, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNTPCA),WgtEP*fWgtCent);
3723  fHist_Corr3p_Pion_EP_Refm_PN[QAindex][3]->Fill(RefMultCorrFB, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNTPCC),WgtEP*fWgtCent);
3724 
3725  fHist_Corr2p_Pion_EP_Norm_PN[QAindex][0]->Fill(EvtCent, TMath::Cos(deltaPhi), WgtEP*fWgtCent);
3726  fHist_Corr2p_Pion_EP_Norm_PN[QAindex][1]->Fill(EvtCent, TMath::Cos(2*deltaPhi), WgtEP*fWgtCent);
3727  fHist_Corr2p_Pion_EP_Norm_PN[QAindex][2]->Fill(EvtCent, TMath::Cos(3*deltaPhi), WgtEP*fWgtCent);
3728  fHist_Corr2p_Pion_EP_Norm_PN[QAindex][3]->Fill(EvtCent, TMath::Cos(4*deltaPhi), WgtEP*fWgtCent);
3729 
3730  fHist_Corr2p_Pion_EP_Refm_PN[QAindex][0]->Fill(RefMultCorrFB, TMath::Cos(deltaPhi), WgtEP*fWgtCent);
3731  fHist_Corr2p_Pion_EP_Refm_PN[QAindex][1]->Fill(RefMultCorrFB, TMath::Cos(2*deltaPhi), WgtEP*fWgtCent);
3732  fHist_Corr2p_Pion_EP_Refm_PN[QAindex][2]->Fill(RefMultCorrFB, TMath::Cos(3*deltaPhi), WgtEP*fWgtCent);
3733  fHist_Corr2p_Pion_EP_Refm_PN[QAindex][3]->Fill(RefMultCorrFB, TMath::Cos(4*deltaPhi), WgtEP*fWgtCent);
3734  */
3735 
3736  //Differential:
3737  if(cIndex<6){
3738  fHist_Corr3p_Pion_pTSum_EP_V0A_PN[QAindex][cIndex]->Fill((dPt1+dPt2)*0.5, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0A),WgtEPPion*fWgtCent);
3739  fHist_Corr3p_Pion_pTSum_EP_V0C_PN[QAindex][cIndex]->Fill((dPt1+dPt2)*0.5, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0C),WgtEPPion*fWgtCent);
3740  fHist_Corr3p_Pion_pTDiff_EP_V0A_PN[QAindex][cIndex]->Fill(TMath::Abs(dPt1-dPt2), TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0A),WgtEPPion*fWgtCent);
3741  fHist_Corr3p_Pion_pTDiff_EP_V0C_PN[QAindex][cIndex]->Fill(TMath::Abs(dPt1-dPt2), TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0C),WgtEPPion*fWgtCent);
3742  fHist_Corr3p_Pion_EtaDiff_EP_V0A_PN[QAindex][cIndex]->Fill(TMath::Abs(dEta1-dEta2), TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0A),WgtEPPion*fWgtCent);
3743  fHist_Corr3p_Pion_EtaDiff_EP_V0C_PN[QAindex][cIndex]->Fill(TMath::Abs(dEta1-dEta2), TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0C),WgtEPPion*fWgtCent);
3744  }
3745  }
3746  //Kaon:
3747  if(isKaon1 && isKaon2){
3748  fHist_Corr3p_Kaon_EP_Norm_PN[QAindex][0]->Fill(EvtCent, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0A), WgtEPKaon*fWgtCent);
3749  fHist_Corr3p_Kaon_EP_Norm_PN[QAindex][1]->Fill(EvtCent, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0C), WgtEPKaon*fWgtCent);
3750  fHist_Corr3p_Kaon_EP_Norm_PN[QAindex][2]->Fill(EvtCent, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNTPCA),WgtEPKaon*fWgtCent);
3751  fHist_Corr3p_Kaon_EP_Norm_PN[QAindex][3]->Fill(EvtCent, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNTPCC),WgtEPKaon*fWgtCent);
3752  /*
3753  fHist_Corr3p_Kaon_EP_Refm_PN[QAindex][0]->Fill(RefMultCorrFB, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0A), WgtEP*fWgtCent);
3754  fHist_Corr3p_Kaon_EP_Refm_PN[QAindex][1]->Fill(RefMultCorrFB, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0C), WgtEP*fWgtCent);
3755  fHist_Corr3p_Kaon_EP_Refm_PN[QAindex][2]->Fill(RefMultCorrFB, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNTPCA),WgtEP*fWgtCent);
3756  fHist_Corr3p_Kaon_EP_Refm_PN[QAindex][3]->Fill(RefMultCorrFB, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNTPCC),WgtEP*fWgtCent);
3757 
3758  //2p:
3759  fHist_Corr2p_Kaon_EP_Norm_PN[QAindex][0]->Fill(EvtCent, TMath::Cos(deltaPhi), WgtEP*fWgtCent);
3760  fHist_Corr2p_Kaon_EP_Norm_PN[QAindex][1]->Fill(EvtCent, TMath::Cos(2*deltaPhi), WgtEP*fWgtCent);
3761  fHist_Corr2p_Kaon_EP_Norm_PN[QAindex][2]->Fill(EvtCent, TMath::Cos(3*deltaPhi), WgtEP*fWgtCent);
3762  fHist_Corr2p_Kaon_EP_Norm_PN[QAindex][3]->Fill(EvtCent, TMath::Cos(4*deltaPhi), WgtEP*fWgtCent);
3763 
3764  //2p vs Refmult:
3765  fHist_Corr2p_Kaon_EP_Refm_PN[QAindex][0]->Fill(RefMultCorrFB, TMath::Cos(deltaPhi), WgtEP*fWgtCent);
3766  fHist_Corr2p_Kaon_EP_Refm_PN[QAindex][1]->Fill(RefMultCorrFB, TMath::Cos(2*deltaPhi), WgtEP*fWgtCent);
3767  fHist_Corr2p_Kaon_EP_Refm_PN[QAindex][2]->Fill(RefMultCorrFB, TMath::Cos(3*deltaPhi), WgtEP*fWgtCent);
3768  fHist_Corr2p_Kaon_EP_Refm_PN[QAindex][3]->Fill(RefMultCorrFB, TMath::Cos(4*deltaPhi), WgtEP*fWgtCent);
3769  */
3770 
3771  //Differential:
3772  if(cIndex<6){
3773  fHist_Corr3p_Kaon_pTSum_EP_V0A_PN[QAindex][cIndex]->Fill((dPt1+dPt2)*0.5, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0A),WgtEPKaon*fWgtCent);
3774  fHist_Corr3p_Kaon_pTSum_EP_V0C_PN[QAindex][cIndex]->Fill((dPt1+dPt2)*0.5, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0C),WgtEPKaon*fWgtCent);
3775  fHist_Corr3p_Kaon_pTDiff_EP_V0A_PN[QAindex][cIndex]->Fill(TMath::Abs(dPt1-dPt2), TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0A),WgtEPKaon*fWgtCent);
3776  fHist_Corr3p_Kaon_pTDiff_EP_V0C_PN[QAindex][cIndex]->Fill(TMath::Abs(dPt1-dPt2), TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0C),WgtEPKaon*fWgtCent);
3777  fHist_Corr3p_Kaon_EtaDiff_EP_V0A_PN[QAindex][cIndex]->Fill(TMath::Abs(dEta1-dEta2), TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0A),WgtEPKaon*fWgtCent);
3778  fHist_Corr3p_Kaon_EtaDiff_EP_V0C_PN[QAindex][cIndex]->Fill(TMath::Abs(dEta1-dEta2), TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0C),WgtEPKaon*fWgtCent);
3779  }
3780  }
3781  //Proton:
3782  if(isProton1 && isProton2){
3783  //cout<<"#pair pt1 = "<<dPt1<<"\tpt2 = "<<dPt2<<"\tnSigp1 = "<<nSigTPCproton<<"\tnSigp2 = "<<nSigTPCproton2<<endl;
3784  fHist_Corr3p_Proton_EP_Norm_PN[QAindex][0]->Fill(EvtCent, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0A), WgtEPProton*fWgtCent);
3785  fHist_Corr3p_Proton_EP_Norm_PN[QAindex][1]->Fill(EvtCent, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0C), WgtEPProton*fWgtCent);
3786  fHist_Corr3p_Proton_EP_Norm_PN[QAindex][2]->Fill(EvtCent, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNTPCA),WgtEPProton*fWgtCent);
3787  fHist_Corr3p_Proton_EP_Norm_PN[QAindex][3]->Fill(EvtCent, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNTPCC),WgtEPProton*fWgtCent);
3788  /*
3789  fHist_Corr3p_Proton_EP_Refm_PN[QAindex][0]->Fill(RefMultCorrFB, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0A), WgtEP*fWgtCent);
3790  fHist_Corr3p_Proton_EP_Refm_PN[QAindex][1]->Fill(RefMultCorrFB, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0C), WgtEP*fWgtCent);
3791  fHist_Corr3p_Proton_EP_Refm_PN[QAindex][2]->Fill(RefMultCorrFB, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNTPCA),WgtEP*fWgtCent);
3792  fHist_Corr3p_Proton_EP_Refm_PN[QAindex][3]->Fill(RefMultCorrFB, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNTPCC),WgtEP*fWgtCent);
3793 
3794  //2p:
3795  fHist_Corr2p_Proton_EP_Norm_PN[QAindex][0]->Fill(EvtCent, TMath::Cos(deltaPhi), WgtEP*fWgtCent);
3796  fHist_Corr2p_Proton_EP_Norm_PN[QAindex][1]->Fill(EvtCent, TMath::Cos(2*deltaPhi), WgtEP*fWgtCent);
3797  fHist_Corr2p_Proton_EP_Norm_PN[QAindex][2]->Fill(EvtCent, TMath::Cos(3*deltaPhi), WgtEP*fWgtCent);
3798  fHist_Corr2p_Proton_EP_Norm_PN[QAindex][3]->Fill(EvtCent, TMath::Cos(4*deltaPhi), WgtEP*fWgtCent);
3799 
3800  fHist_Corr2p_Proton_EP_Refm_PN[QAindex][0]->Fill(RefMultCorrFB, TMath::Cos(deltaPhi), WgtEP*fWgtCent);
3801  fHist_Corr2p_Proton_EP_Refm_PN[QAindex][1]->Fill(RefMultCorrFB, TMath::Cos(2*deltaPhi), WgtEP*fWgtCent);
3802  fHist_Corr2p_Proton_EP_Refm_PN[QAindex][2]->Fill(RefMultCorrFB, TMath::Cos(3*deltaPhi), WgtEP*fWgtCent);
3803  fHist_Corr2p_Proton_EP_Refm_PN[QAindex][3]->Fill(RefMultCorrFB, TMath::Cos(4*deltaPhi), WgtEP*fWgtCent);
3804  */
3805  //Differential:
3806  if(cIndex<6){
3807  fHist_Corr3p_Proton_pTSum_EP_V0A_PN[QAindex][cIndex]->Fill((dPt1+dPt2)*0.5, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0A),WgtEPProton*fWgtCent);
3808  fHist_Corr3p_Proton_pTSum_EP_V0C_PN[QAindex][cIndex]->Fill((dPt1+dPt2)*0.5, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0C),WgtEPProton*fWgtCent);
3809  fHist_Corr3p_Proton_pTDiff_EP_V0A_PN[QAindex][cIndex]->Fill(TMath::Abs(dPt1-dPt2), TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0A),WgtEPProton*fWgtCent);
3810  fHist_Corr3p_Proton_pTDiff_EP_V0C_PN[QAindex][cIndex]->Fill(TMath::Abs(dPt1-dPt2), TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0C),WgtEPProton*fWgtCent);
3811  fHist_Corr3p_Proton_EtaDiff_EP_V0A_PN[QAindex][cIndex]->Fill(TMath::Abs(dEta1-dEta2), TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0A),WgtEPProton*fWgtCent);
3812  fHist_Corr3p_Proton_EtaDiff_EP_V0C_PN[QAindex][cIndex]->Fill(TMath::Abs(dEta1-dEta2), TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0C),WgtEPProton*fWgtCent);
3813  }
3814  }
3815  //------------------------------------
3816  }
3817 
3818 
3819 
3821 
3822 
3823 
3824  else if(gCharge1>0 && gCharge2>0 && skipPairHBT==0) {
3825  fHist_Corr3p_EP_Norm_PP[QAindex][0]->Fill(EvtCent, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0A), WgtEP*fWgtCent);
3826  fHist_Corr3p_EP_Norm_PP[QAindex][1]->Fill(EvtCent, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0C), WgtEP*fWgtCent);
3827  fHist_Corr3p_EP_Norm_PP[QAindex][2]->Fill(EvtCent, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNTPCA),WgtEP*fWgtCent);
3828  fHist_Corr3p_EP_Norm_PP[QAindex][3]->Fill(EvtCent, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNTPCC),WgtEP*fWgtCent);
3829  /*
3830  fHist_Corr3p_EP_Refm_PP[QAindex][0]->Fill(RefMultCorrFB, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0A), WgtEP*fWgtCent);
3831  fHist_Corr3p_EP_Refm_PP[QAindex][1]->Fill(RefMultCorrFB, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0C), WgtEP*fWgtCent);
3832  fHist_Corr3p_EP_Refm_PP[QAindex][2]->Fill(RefMultCorrFB, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNTPCA),WgtEP*fWgtCent);
3833  fHist_Corr3p_EP_Refm_PP[QAindex][3]->Fill(RefMultCorrFB, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNTPCC),WgtEP*fWgtCent);
3834 
3835  //2p vs Cent:
3836  fHist_Corr2p_EP_Norm_PP[QAindex][0]->Fill(EvtCent, TMath::Cos(deltaPhi), WgtEP*fWgtCent);
3837  fHist_Corr2p_EP_Norm_PP[QAindex][1]->Fill(EvtCent, TMath::Cos(2*deltaPhi), WgtEP*fWgtCent);
3838  fHist_Corr2p_EP_Norm_PP[QAindex][2]->Fill(EvtCent, TMath::Cos(3*deltaPhi), WgtEP*fWgtCent);
3839  fHist_Corr2p_EP_Norm_PP[QAindex][3]->Fill(EvtCent, TMath::Cos(4*deltaPhi), WgtEP*fWgtCent);
3840 
3841  fHist_Corr2p_EP_Refm_PP[QAindex][0]->Fill(RefMultCorrFB, TMath::Cos(deltaPhi), WgtEP*fWgtCent);
3842  fHist_Corr2p_EP_Refm_PP[QAindex][1]->Fill(RefMultCorrFB, TMath::Cos(2*deltaPhi), WgtEP*fWgtCent);
3843  fHist_Corr2p_EP_Refm_PP[QAindex][2]->Fill(RefMultCorrFB, TMath::Cos(3*deltaPhi), WgtEP*fWgtCent);
3844  fHist_Corr2p_EP_Refm_PP[QAindex][3]->Fill(RefMultCorrFB, TMath::Cos(4*deltaPhi), WgtEP*fWgtCent);
3845  */
3846 
3847 
3848  if(cIndex<6){
3849  fHist_Corr3p_pTSum_EP_V0A_PP[QAindex][cIndex]->Fill((dPt1+dPt2)*0.5, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0A),WgtEP*fWgtCent);
3850  fHist_Corr3p_pTSum_EP_V0C_PP[QAindex][cIndex]->Fill((dPt1+dPt2)*0.5, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0C),WgtEP*fWgtCent);
3851  fHist_Corr3p_pTDiff_EP_V0A_PP[QAindex][cIndex]->Fill(TMath::Abs(dPt1-dPt2), TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0A),WgtEP*fWgtCent);
3852  fHist_Corr3p_pTDiff_EP_V0C_PP[QAindex][cIndex]->Fill(TMath::Abs(dPt1-dPt2), TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0C),WgtEP*fWgtCent);
3853  fHist_Corr3p_EtaDiff_EP_V0A_PP[QAindex][cIndex]->Fill(TMath::Abs(dEta1-dEta2), TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0A),WgtEP*fWgtCent);
3854  fHist_Corr3p_EtaDiff_EP_V0C_PP[QAindex][cIndex]->Fill(TMath::Abs(dEta1-dEta2), TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0C),WgtEP*fWgtCent);
3855  /*
3856  fHist_Corr2p_pTSum_EP_Harm1_PP[QAindex][cIndex]->Fill((dPt1+dPt2)*0.5, TMath::Cos( deltaPhi), WgtEP*fWgtCent);
3857  fHist_Corr2p_pTSum_EP_Harm2_PP[QAindex][cIndex]->Fill((dPt1+dPt2)*0.5, TMath::Cos(2*deltaPhi),WgtEP*fWgtCent);
3858  fHist_Corr2p_pTDiff_EP_Harm1_PP[QAindex][cIndex]->Fill((dPt1+dPt2)*0.5, TMath::Cos( deltaPhi), WgtEP*fWgtCent);
3859  fHist_Corr2p_pTDiff_EP_Harm2_PP[QAindex][cIndex]->Fill((dPt1+dPt2)*0.5, TMath::Cos(2*deltaPhi),WgtEP*fWgtCent);
3860  fHist_Corr2p_EtaDiff_EP_Harm1_PP[QAindex][cIndex]->Fill((dPt1+dPt2)*0.5,TMath::Cos( deltaPhi), WgtEP*fWgtCent);
3861  fHist_Corr2p_EtaDiff_EP_Harm2_PP[QAindex][cIndex]->Fill((dPt1+dPt2)*0.5,TMath::Cos(2*deltaPhi),WgtEP*fWgtCent);
3862  */
3863  }
3864  //-------------> PID CME ---------------
3865  //Pion:
3866  if(isPion1 && isPion2){
3867  fHist_Corr3p_Pion_EP_Norm_PP[QAindex][0]->Fill(EvtCent, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0A), WgtEPPion*fWgtCent);
3868  fHist_Corr3p_Pion_EP_Norm_PP[QAindex][1]->Fill(EvtCent, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0C), WgtEPPion*fWgtCent);
3869  fHist_Corr3p_Pion_EP_Norm_PP[QAindex][2]->Fill(EvtCent, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNTPCA),WgtEPPion*fWgtCent);
3870  fHist_Corr3p_Pion_EP_Norm_PP[QAindex][3]->Fill(EvtCent, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNTPCC),WgtEPPion*fWgtCent);
3871  /*
3872  fHist_Corr3p_Pion_EP_Refm_PP[QAindex][0]->Fill(RefMultCorrFB, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0A), WgtEP*fWgtCent);
3873  fHist_Corr3p_Pion_EP_Refm_PP[QAindex][1]->Fill(RefMultCorrFB, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0C), WgtEP*fWgtCent);
3874  fHist_Corr3p_Pion_EP_Refm_PP[QAindex][2]->Fill(RefMultCorrFB, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNTPCA),WgtEP*fWgtCent);
3875  fHist_Corr3p_Pion_EP_Refm_PP[QAindex][3]->Fill(RefMultCorrFB, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNTPCC),WgtEP*fWgtCent);
3876 
3877  fHist_Corr2p_Pion_EP_Norm_PP[QAindex][0]->Fill(EvtCent, TMath::Cos(deltaPhi), WgtEP*fWgtCent);
3878  fHist_Corr2p_Pion_EP_Norm_PP[QAindex][1]->Fill(EvtCent, TMath::Cos(2*deltaPhi), WgtEP*fWgtCent);
3879  fHist_Corr2p_Pion_EP_Norm_PP[QAindex][2]->Fill(EvtCent, TMath::Cos(3*deltaPhi), WgtEP*fWgtCent);
3880  fHist_Corr2p_Pion_EP_Norm_PP[QAindex][3]->Fill(EvtCent, TMath::Cos(4*deltaPhi), WgtEP*fWgtCent);
3881 
3882  fHist_Corr2p_Pion_EP_Refm_PP[QAindex][0]->Fill(RefMultCorrFB, TMath::Cos(deltaPhi), WgtEP*fWgtCent);
3883  fHist_Corr2p_Pion_EP_Refm_PP[QAindex][1]->Fill(RefMultCorrFB, TMath::Cos(2*deltaPhi), WgtEP*fWgtCent);
3884  fHist_Corr2p_Pion_EP_Refm_PP[QAindex][2]->Fill(RefMultCorrFB, TMath::Cos(3*deltaPhi), WgtEP*fWgtCent);
3885  fHist_Corr2p_Pion_EP_Refm_PP[QAindex][3]->Fill(RefMultCorrFB, TMath::Cos(4*deltaPhi), WgtEP*fWgtCent);
3886  */
3887  //Differential:
3888  if(cIndex<6){
3889  fHist_Corr3p_Pion_pTSum_EP_V0A_PP[QAindex][cIndex]->Fill((dPt1+dPt2)*0.5, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0A),WgtEPPion*fWgtCent);
3890  fHist_Corr3p_Pion_pTSum_EP_V0C_PP[QAindex][cIndex]->Fill((dPt1+dPt2)*0.5, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0C),WgtEPPion*fWgtCent);
3891  fHist_Corr3p_Pion_pTDiff_EP_V0A_PP[QAindex][cIndex]->Fill(TMath::Abs(dPt1-dPt2), TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0A),WgtEPPion*fWgtCent);
3892  fHist_Corr3p_Pion_pTDiff_EP_V0C_PP[QAindex][cIndex]->Fill(TMath::Abs(dPt1-dPt2), TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0C),WgtEPPion*fWgtCent);
3893  fHist_Corr3p_Pion_EtaDiff_EP_V0A_PP[QAindex][cIndex]->Fill(TMath::Abs(dEta1-dEta2), TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0A),WgtEPPion*fWgtCent);
3894  fHist_Corr3p_Pion_EtaDiff_EP_V0C_PP[QAindex][cIndex]->Fill(TMath::Abs(dEta1-dEta2), TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0C),WgtEPPion*fWgtCent);
3895  }
3896  }
3897  //Kaon:
3898  if(isKaon1 && isKaon2){
3899  fHist_Corr3p_Kaon_EP_Norm_PP[QAindex][0]->Fill(EvtCent, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0A), WgtEPKaon*fWgtCent);
3900  fHist_Corr3p_Kaon_EP_Norm_PP[QAindex][1]->Fill(EvtCent, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0C), WgtEPKaon*fWgtCent);
3901  fHist_Corr3p_Kaon_EP_Norm_PP[QAindex][2]->Fill(EvtCent, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNTPCA),WgtEPKaon*fWgtCent);
3902  fHist_Corr3p_Kaon_EP_Norm_PP[QAindex][3]->Fill(EvtCent, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNTPCC),WgtEPKaon*fWgtCent);
3903  /*
3904  fHist_Corr3p_Kaon_EP_Refm_PP[QAindex][0]->Fill(RefMultCorrFB, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0A), WgtEP*fWgtCent);
3905  fHist_Corr3p_Kaon_EP_Refm_PP[QAindex][1]->Fill(RefMultCorrFB, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0C), WgtEP*fWgtCent);
3906  fHist_Corr3p_Kaon_EP_Refm_PP[QAindex][2]->Fill(RefMultCorrFB, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNTPCA),WgtEP*fWgtCent);
3907  fHist_Corr3p_Kaon_EP_Refm_PP[QAindex][3]->Fill(RefMultCorrFB, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNTPCC),WgtEP*fWgtCent);
3908 
3909  //2p:
3910  fHist_Corr2p_Kaon_EP_Norm_PP[QAindex][0]->Fill(EvtCent, TMath::Cos(deltaPhi), WgtEP*fWgtCent);
3911  fHist_Corr2p_Kaon_EP_Norm_PP[QAindex][1]->Fill(EvtCent, TMath::Cos(2*deltaPhi), WgtEP*fWgtCent);
3912  fHist_Corr2p_Kaon_EP_Norm_PP[QAindex][2]->Fill(EvtCent, TMath::Cos(3*deltaPhi), WgtEP*fWgtCent);
3913  fHist_Corr2p_Kaon_EP_Norm_PP[QAindex][3]->Fill(EvtCent, TMath::Cos(4*deltaPhi), WgtEP*fWgtCent);
3914 
3915  fHist_Corr2p_Kaon_EP_Refm_PP[QAindex][0]->Fill(RefMultCorrFB, TMath::Cos(deltaPhi), WgtEP*fWgtCent);
3916  fHist_Corr2p_Kaon_EP_Refm_PP[QAindex][1]->Fill(RefMultCorrFB, TMath::Cos(2*deltaPhi), WgtEP*fWgtCent);
3917  fHist_Corr2p_Kaon_EP_Refm_PP[QAindex][2]->Fill(RefMultCorrFB, TMath::Cos(3*deltaPhi), WgtEP*fWgtCent);
3918  fHist_Corr2p_Kaon_EP_Refm_PP[QAindex][3]->Fill(RefMultCorrFB, TMath::Cos(4*deltaPhi), WgtEP*fWgtCent);
3919  */
3920 
3921  //Differential:
3922  if(cIndex<6){
3923  fHist_Corr3p_Kaon_pTSum_EP_V0A_PP[QAindex][cIndex]->Fill((dPt1+dPt2)*0.5, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0A),WgtEPKaon*fWgtCent);
3924  fHist_Corr3p_Kaon_pTSum_EP_V0C_PP[QAindex][cIndex]->Fill((dPt1+dPt2)*0.5, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0C),WgtEPKaon*fWgtCent);
3925  fHist_Corr3p_Kaon_pTDiff_EP_V0A_PP[QAindex][cIndex]->Fill(TMath::Abs(dPt1-dPt2), TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0A),WgtEPKaon*fWgtCent);
3926  fHist_Corr3p_Kaon_pTDiff_EP_V0C_PP[QAindex][cIndex]->Fill(TMath::Abs(dPt1-dPt2), TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0C),WgtEPKaon*fWgtCent);
3927  fHist_Corr3p_Kaon_EtaDiff_EP_V0A_PP[QAindex][cIndex]->Fill(TMath::Abs(dEta1-dEta2), TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0A),WgtEPKaon*fWgtCent);
3928  fHist_Corr3p_Kaon_EtaDiff_EP_V0C_PP[QAindex][cIndex]->Fill(TMath::Abs(dEta1-dEta2), TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0C),WgtEPKaon*fWgtCent);
3929  }
3930  }
3931  //Proton:
3932  if(isProton1 && isProton2){
3933  fHist_Corr3p_Proton_EP_Norm_PP[QAindex][0]->Fill(EvtCent, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0A), WgtEPProton*fWgtCent);
3934  fHist_Corr3p_Proton_EP_Norm_PP[QAindex][1]->Fill(EvtCent, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0C), WgtEPProton*fWgtCent);
3935  fHist_Corr3p_Proton_EP_Norm_PP[QAindex][2]->Fill(EvtCent, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNTPCA),WgtEPProton*fWgtCent);
3936  fHist_Corr3p_Proton_EP_Norm_PP[QAindex][3]->Fill(EvtCent, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNTPCC),WgtEPProton*fWgtCent);
3937  /*
3938  fHist_Corr3p_Proton_EP_Refm_PP[QAindex][0]->Fill(RefMultCorrFB, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0A), WgtEP*fWgtCent);
3939  fHist_Corr3p_Proton_EP_Refm_PP[QAindex][1]->Fill(RefMultCorrFB, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0C), WgtEP*fWgtCent);
3940  fHist_Corr3p_Proton_EP_Refm_PP[QAindex][2]->Fill(RefMultCorrFB, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNTPCA),WgtEP*fWgtCent);
3941  fHist_Corr3p_Proton_EP_Refm_PP[QAindex][3]->Fill(RefMultCorrFB, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNTPCC),WgtEP*fWgtCent);
3942 
3943  //2p:
3944  fHist_Corr2p_Proton_EP_Norm_PP[QAindex][0]->Fill(EvtCent, TMath::Cos(deltaPhi), WgtEP*fWgtCent);
3945  fHist_Corr2p_Proton_EP_Norm_PP[QAindex][1]->Fill(EvtCent, TMath::Cos(2*deltaPhi), WgtEP*fWgtCent);
3946  fHist_Corr2p_Proton_EP_Norm_PP[QAindex][2]->Fill(EvtCent, TMath::Cos(3*deltaPhi), WgtEP*fWgtCent);
3947  fHist_Corr2p_Proton_EP_Norm_PP[QAindex][3]->Fill(EvtCent, TMath::Cos(4*deltaPhi), WgtEP*fWgtCent);
3948 
3949  fHist_Corr2p_Proton_EP_Refm_PP[QAindex][0]->Fill(RefMultCorrFB, TMath::Cos(deltaPhi), WgtEP*fWgtCent);
3950  fHist_Corr2p_Proton_EP_Refm_PP[QAindex][1]->Fill(RefMultCorrFB, TMath::Cos(2*deltaPhi), WgtEP*fWgtCent);
3951  fHist_Corr2p_Proton_EP_Refm_PP[QAindex][2]->Fill(RefMultCorrFB, TMath::Cos(3*deltaPhi), WgtEP*fWgtCent);
3952  fHist_Corr2p_Proton_EP_Refm_PP[QAindex][3]->Fill(RefMultCorrFB, TMath::Cos(4*deltaPhi), WgtEP*fWgtCent);
3953  */
3954 
3955  //Differential:
3956  if(cIndex<6){
3957  fHist_Corr3p_Proton_pTSum_EP_V0A_PP[QAindex][cIndex]->Fill((dPt1+dPt2)*0.5, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0A),WgtEPProton*fWgtCent);
3958  fHist_Corr3p_Proton_pTSum_EP_V0C_PP[QAindex][cIndex]->Fill((dPt1+dPt2)*0.5, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0C),WgtEPProton*fWgtCent);
3959  fHist_Corr3p_Proton_pTDiff_EP_V0A_PP[QAindex][cIndex]->Fill(TMath::Abs(dPt1-dPt2), TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0A),WgtEPProton*fWgtCent);
3960  fHist_Corr3p_Proton_pTDiff_EP_V0C_PP[QAindex][cIndex]->Fill(TMath::Abs(dPt1-dPt2), TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0C),WgtEPProton*fWgtCent);
3961  fHist_Corr3p_Proton_EtaDiff_EP_V0A_PP[QAindex][cIndex]->Fill(TMath::Abs(dEta1-dEta2), TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0A),WgtEPProton*fWgtCent);
3962  fHist_Corr3p_Proton_EtaDiff_EP_V0C_PP[QAindex][cIndex]->Fill(TMath::Abs(dEta1-dEta2), TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0C),WgtEPProton*fWgtCent);
3963  }
3964  }
3965  //------------------------------------
3966  }
3967 
3968 
3969 
3970 
3971 
3973 
3974 
3975  else if(gCharge1<0 && gCharge2<0 && skipPairHBT==0){
3976  fHist_Corr3p_EP_Norm_NN[QAindex][0]->Fill(EvtCent, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0A), WgtEP*fWgtCent);
3977  fHist_Corr3p_EP_Norm_NN[QAindex][1]->Fill(EvtCent, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0C), WgtEP*fWgtCent);
3978  fHist_Corr3p_EP_Norm_NN[QAindex][2]->Fill(EvtCent, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNTPCA),WgtEP*fWgtCent);
3979  fHist_Corr3p_EP_Norm_NN[QAindex][3]->Fill(EvtCent, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNTPCC),WgtEP*fWgtCent);
3980  /*
3981  fHist_Corr3p_EP_Refm_NN[QAindex][0]->Fill(RefMultCorrFB, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0A), WgtEP*fWgtCent);
3982  fHist_Corr3p_EP_Refm_NN[QAindex][1]->Fill(RefMultCorrFB, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0C), WgtEP*fWgtCent);
3983  fHist_Corr3p_EP_Refm_NN[QAindex][2]->Fill(RefMultCorrFB, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNTPCA),WgtEP*fWgtCent);
3984  fHist_Corr3p_EP_Refm_NN[QAindex][3]->Fill(RefMultCorrFB, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNTPCC),WgtEP*fWgtCent);
3985 
3986  //2p vs Cent:
3987  fHist_Corr2p_EP_Norm_NN[QAindex][0]->Fill(EvtCent, TMath::Cos(deltaPhi), WgtEP*fWgtCent);
3988  fHist_Corr2p_EP_Norm_NN[QAindex][1]->Fill(EvtCent, TMath::Cos(2*deltaPhi), WgtEP*fWgtCent);
3989  fHist_Corr2p_EP_Norm_NN[QAindex][2]->Fill(EvtCent, TMath::Cos(3*deltaPhi), WgtEP*fWgtCent);
3990  fHist_Corr2p_EP_Norm_NN[QAindex][3]->Fill(EvtCent, TMath::Cos(4*deltaPhi), WgtEP*fWgtCent);
3991 
3992  fHist_Corr2p_EP_Refm_NN[QAindex][0]->Fill(RefMultCorrFB, TMath::Cos(deltaPhi), WgtEP*fWgtCent);
3993  fHist_Corr2p_EP_Refm_NN[QAindex][1]->Fill(RefMultCorrFB, TMath::Cos(2*deltaPhi), WgtEP*fWgtCent);
3994  fHist_Corr2p_EP_Refm_NN[QAindex][2]->Fill(RefMultCorrFB, TMath::Cos(3*deltaPhi), WgtEP*fWgtCent);
3995  fHist_Corr2p_EP_Refm_NN[QAindex][3]->Fill(RefMultCorrFB, TMath::Cos(4*deltaPhi), WgtEP*fWgtCent);
3996  */
3997  if(cIndex<6){
3998  fHist_Corr3p_pTSum_EP_V0A_NN[QAindex][cIndex]->Fill((dPt1+dPt2)*0.5, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0A),WgtEP*fWgtCent);
3999  fHist_Corr3p_pTSum_EP_V0C_NN[QAindex][cIndex]->Fill((dPt1+dPt2)*0.5, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0C),WgtEP*fWgtCent);
4000  fHist_Corr3p_pTDiff_EP_V0A_NN[QAindex][cIndex]->Fill(TMath::Abs(dPt1-dPt2), TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0A),WgtEP*fWgtCent);
4001  fHist_Corr3p_pTDiff_EP_V0C_NN[QAindex][cIndex]->Fill(TMath::Abs(dPt1-dPt2), TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0C),WgtEP*fWgtCent);
4002  fHist_Corr3p_EtaDiff_EP_V0A_NN[QAindex][cIndex]->Fill(TMath::Abs(dEta1-dEta2), TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0A),WgtEP*fWgtCent);
4003  fHist_Corr3p_EtaDiff_EP_V0C_NN[QAindex][cIndex]->Fill(TMath::Abs(dEta1-dEta2), TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0C),WgtEP*fWgtCent);
4004  /*
4005  fHist_Corr2p_pTSum_EP_Harm1_NN[QAindex][cIndex]->Fill((dPt1+dPt2)*0.5, TMath::Cos( deltaPhi), WgtEP*fWgtCent);
4006  fHist_Corr2p_pTSum_EP_Harm2_NN[QAindex][cIndex]->Fill((dPt1+dPt2)*0.5, TMath::Cos(2*deltaPhi),WgtEP*fWgtCent);
4007  fHist_Corr2p_pTDiff_EP_Harm1_NN[QAindex][cIndex]->Fill((dPt1+dPt2)*0.5, TMath::Cos( deltaPhi), WgtEP*fWgtCent);
4008  fHist_Corr2p_pTDiff_EP_Harm2_NN[QAindex][cIndex]->Fill((dPt1+dPt2)*0.5, TMath::Cos(2*deltaPhi),WgtEP*fWgtCent);
4009  fHist_Corr2p_EtaDiff_EP_Harm1_NN[QAindex][cIndex]->Fill((dPt1+dPt2)*0.5,TMath::Cos( deltaPhi), WgtEP*fWgtCent);
4010  fHist_Corr2p_EtaDiff_EP_Harm2_NN[QAindex][cIndex]->Fill((dPt1+dPt2)*0.5,TMath::Cos(2*deltaPhi),WgtEP*fWgtCent);
4011  */
4012  }
4013  //-------------> PID CME ---------------
4014  //Pion:
4015  if(isPion1 && isPion2){
4016  fHist_Corr3p_Pion_EP_Norm_NN[QAindex][0]->Fill(EvtCent, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0A), WgtEPPion*fWgtCent);
4017  fHist_Corr3p_Pion_EP_Norm_NN[QAindex][1]->Fill(EvtCent, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0C), WgtEPPion*fWgtCent);
4018  fHist_Corr3p_Pion_EP_Norm_NN[QAindex][2]->Fill(EvtCent, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNTPCA),WgtEPPion*fWgtCent);
4019  fHist_Corr3p_Pion_EP_Norm_NN[QAindex][3]->Fill(EvtCent, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNTPCC),WgtEPPion*fWgtCent);
4020  /*
4021  fHist_Corr3p_Pion_EP_Refm_NN[QAindex][0]->Fill(RefMultCorrFB, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0A), WgtEP*fWgtCent);
4022  fHist_Corr3p_Pion_EP_Refm_NN[QAindex][1]->Fill(RefMultCorrFB, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0C), WgtEP*fWgtCent);
4023  fHist_Corr3p_Pion_EP_Refm_NN[QAindex][2]->Fill(RefMultCorrFB, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNTPCA),WgtEP*fWgtCent);
4024  fHist_Corr3p_Pion_EP_Refm_NN[QAindex][3]->Fill(RefMultCorrFB, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNTPCC),WgtEP*fWgtCent);
4025 
4026  //2p:
4027  fHist_Corr2p_Pion_EP_Norm_NN[QAindex][0]->Fill(EvtCent, TMath::Cos(deltaPhi), WgtEP*fWgtCent);
4028  fHist_Corr2p_Pion_EP_Norm_NN[QAindex][1]->Fill(EvtCent, TMath::Cos(2*deltaPhi), WgtEP*fWgtCent);
4029  fHist_Corr2p_Pion_EP_Norm_NN[QAindex][2]->Fill(EvtCent, TMath::Cos(3*deltaPhi), WgtEP*fWgtCent);
4030  fHist_Corr2p_Pion_EP_Norm_NN[QAindex][3]->Fill(EvtCent, TMath::Cos(4*deltaPhi), WgtEP*fWgtCent);
4031 
4032  fHist_Corr2p_Pion_EP_Refm_NN[QAindex][0]->Fill(RefMultCorrFB, TMath::Cos(deltaPhi), WgtEP*fWgtCent);
4033  fHist_Corr2p_Pion_EP_Refm_NN[QAindex][1]->Fill(RefMultCorrFB, TMath::Cos(2*deltaPhi), WgtEP*fWgtCent);
4034  fHist_Corr2p_Pion_EP_Refm_NN[QAindex][2]->Fill(RefMultCorrFB, TMath::Cos(3*deltaPhi), WgtEP*fWgtCent);
4035  fHist_Corr2p_Pion_EP_Refm_NN[QAindex][3]->Fill(RefMultCorrFB, TMath::Cos(4*deltaPhi), WgtEP*fWgtCent);
4036  */
4037  //Differential:
4038  if(cIndex<6){
4039  fHist_Corr3p_Pion_pTSum_EP_V0A_NN[QAindex][cIndex]->Fill((dPt1+dPt2)*0.5, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0A),WgtEPPion*fWgtCent);
4040  fHist_Corr3p_Pion_pTSum_EP_V0C_NN[QAindex][cIndex]->Fill((dPt1+dPt2)*0.5, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0C),WgtEPPion*fWgtCent);
4041  fHist_Corr3p_Pion_pTDiff_EP_V0A_NN[QAindex][cIndex]->Fill(TMath::Abs(dPt1-dPt2), TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0A),WgtEPPion*fWgtCent);
4042  fHist_Corr3p_Pion_pTDiff_EP_V0C_NN[QAindex][cIndex]->Fill(TMath::Abs(dPt1-dPt2), TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0C),WgtEPPion*fWgtCent);
4043  fHist_Corr3p_Pion_EtaDiff_EP_V0A_NN[QAindex][cIndex]->Fill(TMath::Abs(dEta1-dEta2), TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0A),WgtEPPion*fWgtCent);
4044  fHist_Corr3p_Pion_EtaDiff_EP_V0C_NN[QAindex][cIndex]->Fill(TMath::Abs(dEta1-dEta2), TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0C),WgtEPPion*fWgtCent);
4045  }
4046  }
4047  //Kaon:
4048  if(isKaon1 && isKaon2){
4049  fHist_Corr3p_Kaon_EP_Norm_NN[QAindex][0]->Fill(EvtCent, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0A), WgtEPKaon*fWgtCent);
4050  fHist_Corr3p_Kaon_EP_Norm_NN[QAindex][1]->Fill(EvtCent, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0C), WgtEPKaon*fWgtCent);
4051  fHist_Corr3p_Kaon_EP_Norm_NN[QAindex][2]->Fill(EvtCent, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNTPCA),WgtEPKaon*fWgtCent);
4052  fHist_Corr3p_Kaon_EP_Norm_NN[QAindex][3]->Fill(EvtCent, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNTPCC),WgtEPKaon*fWgtCent);
4053  /*
4054  fHist_Corr3p_Kaon_EP_Refm_NN[QAindex][0]->Fill(RefMultCorrFB, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0A), WgtEP*fWgtCent);
4055  fHist_Corr3p_Kaon_EP_Refm_NN[QAindex][1]->Fill(RefMultCorrFB, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0C), WgtEP*fWgtCent);
4056  fHist_Corr3p_Kaon_EP_Refm_NN[QAindex][2]->Fill(RefMultCorrFB, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNTPCA),WgtEP*fWgtCent);
4057  fHist_Corr3p_Kaon_EP_Refm_NN[QAindex][3]->Fill(RefMultCorrFB, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNTPCC),WgtEP*fWgtCent);
4058 
4059  //2p:
4060  fHist_Corr2p_Kaon_EP_Norm_NN[QAindex][0]->Fill(EvtCent, TMath::Cos(deltaPhi), WgtEP*fWgtCent);
4061  fHist_Corr2p_Kaon_EP_Norm_NN[QAindex][1]->Fill(EvtCent, TMath::Cos(2*deltaPhi), WgtEP*fWgtCent);
4062  fHist_Corr2p_Kaon_EP_Norm_NN[QAindex][2]->Fill(EvtCent, TMath::Cos(3*deltaPhi), WgtEP*fWgtCent);
4063  fHist_Corr2p_Kaon_EP_Norm_NN[QAindex][3]->Fill(EvtCent, TMath::Cos(4*deltaPhi), WgtEP*fWgtCent);
4064 
4065  fHist_Corr2p_Kaon_EP_Refm_NN[QAindex][0]->Fill(RefMultCorrFB, TMath::Cos(deltaPhi), WgtEP*fWgtCent);
4066  fHist_Corr2p_Kaon_EP_Refm_NN[QAindex][1]->Fill(RefMultCorrFB, TMath::Cos(2*deltaPhi), WgtEP*fWgtCent);
4067  fHist_Corr2p_Kaon_EP_Refm_NN[QAindex][2]->Fill(RefMultCorrFB, TMath::Cos(3*deltaPhi), WgtEP*fWgtCent);
4068  fHist_Corr2p_Kaon_EP_Refm_NN[QAindex][3]->Fill(RefMultCorrFB, TMath::Cos(4*deltaPhi), WgtEP*fWgtCent);
4069  */
4070  //Differential:
4071  if(cIndex<6){
4072  fHist_Corr3p_Kaon_pTSum_EP_V0A_NN[QAindex][cIndex]->Fill((dPt1+dPt2)*0.5, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0A),WgtEPKaon*fWgtCent);
4073  fHist_Corr3p_Kaon_pTSum_EP_V0C_NN[QAindex][cIndex]->Fill((dPt1+dPt2)*0.5, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0C),WgtEPKaon*fWgtCent);
4074  fHist_Corr3p_Kaon_pTDiff_EP_V0A_NN[QAindex][cIndex]->Fill(TMath::Abs(dPt1-dPt2), TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0A),WgtEPKaon*fWgtCent);
4075  fHist_Corr3p_Kaon_pTDiff_EP_V0C_NN[QAindex][cIndex]->Fill(TMath::Abs(dPt1-dPt2), TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0C),WgtEPKaon*fWgtCent);
4076  fHist_Corr3p_Kaon_EtaDiff_EP_V0A_NN[QAindex][cIndex]->Fill(TMath::Abs(dEta1-dEta2), TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0A),WgtEPKaon*fWgtCent);
4077  fHist_Corr3p_Kaon_EtaDiff_EP_V0C_NN[QAindex][cIndex]->Fill(TMath::Abs(dEta1-dEta2), TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0C),WgtEPKaon*fWgtCent);
4078  }
4079  }
4080  //Proton:
4081  if(isProton1 && isProton2){
4082  fHist_Corr3p_Proton_EP_Norm_NN[QAindex][0]->Fill(EvtCent, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0A), WgtEPProton*fWgtCent);
4083  fHist_Corr3p_Proton_EP_Norm_NN[QAindex][1]->Fill(EvtCent, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0C), WgtEPProton*fWgtCent);
4084  fHist_Corr3p_Proton_EP_Norm_NN[QAindex][2]->Fill(EvtCent, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNTPCA),WgtEPProton*fWgtCent);
4085  fHist_Corr3p_Proton_EP_Norm_NN[QAindex][3]->Fill(EvtCent, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNTPCC),WgtEPProton*fWgtCent);
4086  /*
4087  fHist_Corr3p_Proton_EP_Refm_NN[QAindex][0]->Fill(RefMultCorrFB, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0A), WgtEP*fWgtCent);
4088  fHist_Corr3p_Proton_EP_Refm_NN[QAindex][1]->Fill(RefMultCorrFB, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0C), WgtEP*fWgtCent);
4089  fHist_Corr3p_Proton_EP_Refm_NN[QAindex][2]->Fill(RefMultCorrFB, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNTPCA),WgtEP*fWgtCent);
4090  fHist_Corr3p_Proton_EP_Refm_NN[QAindex][3]->Fill(RefMultCorrFB, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNTPCC),WgtEP*fWgtCent);
4091 
4092  //2p vs Cent:
4093  fHist_Corr2p_Proton_EP_Norm_NN[QAindex][0]->Fill(EvtCent, TMath::Cos(deltaPhi), WgtEP*fWgtCent);
4094  fHist_Corr2p_Proton_EP_Norm_NN[QAindex][1]->Fill(EvtCent, TMath::Cos(2*deltaPhi), WgtEP*fWgtCent);
4095  fHist_Corr2p_Proton_EP_Norm_NN[QAindex][2]->Fill(EvtCent, TMath::Cos(3*deltaPhi), WgtEP*fWgtCent);
4096  fHist_Corr2p_Proton_EP_Norm_NN[QAindex][3]->Fill(EvtCent, TMath::Cos(4*deltaPhi), WgtEP*fWgtCent);
4097 
4098  fHist_Corr2p_Proton_EP_Refm_NN[QAindex][0]->Fill(RefMultCorrFB, TMath::Cos(deltaPhi), WgtEP*fWgtCent);
4099  fHist_Corr2p_Proton_EP_Refm_NN[QAindex][1]->Fill(RefMultCorrFB, TMath::Cos(2*deltaPhi), WgtEP*fWgtCent);
4100  fHist_Corr2p_Proton_EP_Refm_NN[QAindex][2]->Fill(RefMultCorrFB, TMath::Cos(3*deltaPhi), WgtEP*fWgtCent);
4101  fHist_Corr2p_Proton_EP_Refm_NN[QAindex][3]->Fill(RefMultCorrFB, TMath::Cos(4*deltaPhi), WgtEP*fWgtCent);
4102  */
4103  //Differential:
4104  if(cIndex<6){
4105  fHist_Corr3p_Proton_pTSum_EP_V0A_NN[QAindex][cIndex]->Fill((dPt1+dPt2)*0.5, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0A),WgtEPProton*fWgtCent);
4106  fHist_Corr3p_Proton_pTSum_EP_V0C_NN[QAindex][cIndex]->Fill((dPt1+dPt2)*0.5, TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0C),WgtEPProton*fWgtCent);
4107  fHist_Corr3p_Proton_pTDiff_EP_V0A_NN[QAindex][cIndex]->Fill(TMath::Abs(dPt1-dPt2), TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0A),WgtEPProton*fWgtCent);
4108  fHist_Corr3p_Proton_pTDiff_EP_V0C_NN[QAindex][cIndex]->Fill(TMath::Abs(dPt1-dPt2), TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0C),WgtEPProton*fWgtCent);
4109  fHist_Corr3p_Proton_EtaDiff_EP_V0A_NN[QAindex][cIndex]->Fill(TMath::Abs(dEta1-dEta2), TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0A),WgtEPProton*fWgtCent);
4110  fHist_Corr3p_Proton_EtaDiff_EP_V0C_NN[QAindex][cIndex]->Fill(TMath::Abs(dEta1-dEta2), TMath::Cos(n*dPhi1 + m*dPhi2 - p*PsiNV0C),WgtEPProton*fWgtCent);
4111  }
4112  }
4113  //------------------------------------
4114  }
4115 
4116  //cout<<", passes 3 WgtEP = "<<WgtEP<<endl;
4117  }//-------- nested track loop ends ------------------
4118 
4119 
4120 
4121 
4122 
4123 
4124 
4125 
4126 
4127 
4128  //------------- Fill QA histograms ------------
4129  if(TMath::Abs(pVtxZ) < 8.0 && gCharge1 > 0){
4130 
4131  fQAEtaPhiAfterNUA->Fill(dPhi1,dEta1,w1NUA);
4132 
4133  if(isPion1){
4134  fQAEtaPhiAfterNUAPion->Fill(dPhi1,dEta1,wNUAPion1);
4135  }
4136  if(isKaon1){
4137  fQAEtaPhiAfterNUAKaon->Fill(dPhi1,dEta1,wNUAKaon1);
4138  }
4139  if(isProton1){
4140  fQAEtaPhiAfterNUAProton->Fill(dPhi1,dEta1,wNUAProton1);
4141  }
4142  }
4143 
4144 
4145 
4146 
4147 
4148 
4149 
4150 
4151  //-------------- Fill NUA for PID tracks ----------------
4152  if(bFillNUAHistPID) {
4153 
4154  //---------------- Temporary: redefine PID NUA cuts:
4155  isPion1 = kFALSE;
4156  isKaon1 = kFALSE;
4157  isProton1 = kFALSE;
4158 
4159  //------> Pion
4160  if(dPt1<0.6 && TMath::Abs(nSigTPCpion)<=2.0){
4161  isPion1 = kTRUE;
4162  }
4163  else if(dPt1>=0.6 && dPt1<=2.0 && TMath::Abs(nSigTPCpion)<=2.5 && TMath::Abs(nSigTOFpion)<=2.0 ){
4164  isPion1 = kTRUE;
4165  }
4166  //------> Kaon
4167  if(dPt1<0.5 && TMath::Abs(nSigTPCkaon)<=2.0){
4168  isKaon1 = kTRUE;
4169  }
4170  else if(dPt1>=0.5 && dPt1<=2.0 && TMath::Abs(nSigTPCkaon)<=2.5 && TMath::Abs(nSigTOFkaon)<=2.0){
4171  isKaon1 = kTRUE;
4172  }
4173  //------> Proton
4174  if(dPt1<0.9 && TMath::Abs(nSigTPCproton)<=2.0){
4175  isProton1 = kTRUE;
4176  }
4177  else if(dPt1>=0.9 && dPt1<=2.0 && TMath::Abs(nSigTPCproton)<=2.5 && TMath::Abs(nSigTOFproton)<=2.5){ //0.8 to 3.5 was used earlier.
4178  isProton1 = kTRUE;
4179  }
4180 
4181  //Proton below 0.4 GeV is garbage
4182  if(dPt1<0.4) isProton1 = kFALSE;
4183 
4184  //-----------------------------------------------------------------
4185 
4186  // Pion
4187  if(isPion1){
4188  if(gCharge1>0){
4189  fHist3DEtaPhiVz_Pos_Run[0][cForNUA]->Fill(pVtxZ,dPhi1,dEta1);
4190  }
4191  else if(gCharge1<0){
4192  fHist3DEtaPhiVz_Neg_Run[0][cForNUA]->Fill(pVtxZ,dPhi1,dEta1);
4193  }
4194  }
4195 
4196  // Kaon
4197  if(isKaon1){
4198  if(gCharge1>0){
4199  fHist3DEtaPhiVz_Pos_Run[1][cForNUA]->Fill(pVtxZ,dPhi1,dEta1);
4200  }
4201  else if(gCharge1<0){
4202  fHist3DEtaPhiVz_Neg_Run[1][cForNUA]->Fill(pVtxZ,dPhi1,dEta1);
4203  }
4204  }
4205 
4206  // proton
4207  if(isProton1){
4208  if(gCharge1>0){
4209  fHist3DEtaPhiVz_Pos_Run[2][cForNUA]->Fill(pVtxZ,dPhi1,dEta1);
4210  }
4211  else if(gCharge1<0){
4212  fHist3DEtaPhiVz_Neg_Run[2][cForNUA]->Fill(pVtxZ,dPhi1,dEta1);
4213  }
4214  }
4215 
4216  // Charged
4217  if(gCharge1>0){
4218  fHist3DEtaPhiVz_Pos_Run[3][cForNUA]->Fill(pVtxZ,dPhi1,dEta1);
4219  }
4220  else if(gCharge1<0){
4221  fHist3DEtaPhiVz_Neg_Run[3][cForNUA]->Fill(pVtxZ,dPhi1,dEta1);
4222  }
4223 
4224  }// Fill NUA for PID or not?
4225 
4226 
4227 
4228 
4229 
4230  //============ PID business starts here =============
4231 
4232  /*
4233  fHistEtaPtAfter->Fill(dEta1,dPt1);
4234 
4235  fHistTPCdEdxvsPAfter->Fill(mom*gCharge1,dEdx1);
4236 
4237  if(TOFmatch>0 && probMis < 0.01){
4238  fHistTOFBetavsPAfter->Fill(mom*gCharge1,beta);
4239  }
4240 
4241  //nSigTOFpion=fPIDResponse->NumberOfSigmasTOF(track, AliPID::kPion);
4242  //nSigTOFkaon=fPIDResponse->NumberOfSigmasTOF(track, AliPID::kKaon);
4243  //nSigTOFproton=fPIDResponse->NumberOfSigmasTOF(track, AliPID::kProton);
4244 
4245  fHistTOFMatchCount->Fill(TOFmatch+2,nSigTOFpion);
4246  fHistTOFMatchCount->Fill(TOFmatch+4,nSigTOFkaon);
4247  fHistTOFMatchCount->Fill(TOFmatch+6,nSigTOFproton);
4248 
4249  if(!TOFmatch || probMis > 0.01){ // I dont want mismatched track in my signal distribution
4250  nSigTOFpion = -99;
4251  nSigTOFkaon = -99;
4252  nSigTOFproton = -99;
4253  }
4254 
4255  //nSigTPCpion = fPIDResponse->NumberOfSigmasTPC(track, AliPID::kPion);
4256  //nSigTPCkaon = fPIDResponse->NumberOfSigmasTPC(track, AliPID::kKaon);
4257  //nSigTPCproton = fPIDResponse->NumberOfSigmasTPC(track, AliPID::kProton);
4258 
4259 
4260  // Fill only 3D nSigma TOF and TPC:
4261  //0=pi, 1=K, 2=Proton
4262  fHistTPCTOFnSigmavsPtAfter[0]->Fill(dPt1,nSigTPCpion,nSigTOFpion);
4263  fHistTPCTOFnSigmavsPtAfter[1]->Fill(dPt1,nSigTPCkaon,nSigTOFkaon);
4264  fHistTPCTOFnSigmavsPtAfter[2]->Fill(dPt1,nSigTPCproton,nSigTOFproton);
4265 
4266 
4267  // Fill nSigTOF for fixed nSigmaTPC Cut
4268  if(TMath::Abs(nSigTPCpion)<=fNSigmaCut){
4269  fHistTOFnSigmavsPtAfter[0]->Fill(dPt1*gCharge1,nSigTOFpion);
4270  fHistPtwithTPCNsigma[0]->Fill(dPt1*gCharge1);
4271  fHistTPCdEdxvsPtPIDAfter[0]->Fill(dPt1,dEdx1);
4272  if(TOFmatch>0 && probMis < 0.01 && beta>0.2){
4273  fHistPtwithTOFSignal[0]->Fill(dPt1*gCharge1);
4274  }
4275  }
4276  if(TMath::Abs(nSigTPCkaon)<=fNSigmaCut){
4277  fHistPtwithTPCNsigma[1]->Fill(dPt1*gCharge1);
4278  fHistTOFnSigmavsPtAfter[1]->Fill(dPt1*gCharge1,nSigTOFkaon);
4279  fHistTPCdEdxvsPtPIDAfter[1]->Fill(dPt1,dEdx1);
4280  if(TOFmatch>0 && probMis < 0.01 && beta>0.2){
4281  fHistPtwithTOFSignal[1]->Fill(dPt1*gCharge1);
4282  }
4283  }
4284  if(TMath::Abs(nSigTPCproton)<=fNSigmaCut){
4285  fHistPtwithTPCNsigma[2]->Fill(dPt1*gCharge1);
4286  fHistTOFnSigmavsPtAfter[2]->Fill(dPt1*gCharge1,nSigTOFproton);
4287  fHistTPCdEdxvsPtPIDAfter[2]->Fill(dPt1,dEdx1);
4288  if(TOFmatch>0 && probMis < 0.01 && beta>0.2){
4289  fHistPtwithTOFSignal[2]->Fill(dPt1*gCharge1);
4290  }
4291  }
4292 
4293 
4294  // Fill dEdx Histograms
4295  if(TMath::Abs(nSigTPCpion)<=fNSigmaCut){
4296  fHistPtwithTPCNsigma[0]->Fill(dPt1*gCharge1);
4297  fHistTPCdEdxvsPtPIDAfter[0]->Fill(dPt1,dEdx1);
4298  }
4299  if(TMath::Abs(nSigTPCkaon)<=fNSigmaCut){
4300  fHistPtwithTPCNsigma[1]->Fill(dPt1*gCharge1);
4301  fHistTPCdEdxvsPtPIDAfter[1]->Fill(dPt1,dEdx1);
4302  }
4303  if(TMath::Abs(nSigTPCproton)<=fNSigmaCut){
4304  fHistPtwithTPCNsigma[2]->Fill(dPt1*gCharge1);
4305  fHistTPCdEdxvsPtPIDAfter[2]->Fill(dPt1,dEdx1);
4306  }
4307 
4308 
4309 
4310  //========> nSigmaTOF distribution for circular cut <===============
4311  //if(TMath::Sqrt(nSigTPCpion*nSigTPCpion+nSigTOFpion*nSigTOFpion)<=fNSigmaCut){
4312  //fHistTOFnSigmavsPtAfter[0]->Fill(dPt1*gCharge1,nSigTOFpion);
4313  //if(TOFmatch>0 && probMis < 0.01 && beta>0.2){
4314  //fHistPtwithTOFSignal[0]->Fill(dPt1*gCharge1);
4315  //}
4316  //}
4317  //if(TMath::Sqrt(nSigTPCkaon*nSigTPCkaon+nSigTOFkaon*nSigTOFkaon)<=fNSigmaCut){
4318  //fHistTOFnSigmavsPtAfter[1]->Fill(dPt1*gCharge1,nSigTOFkaon);
4319  //if(TOFmatch>0 && probMis < 0.01 && beta>0.2){
4320  //fHistPtwithTOFSignal[1]->Fill(dPt1*gCharge1);
4321  //}
4322  //}
4323  //if(TMath::Sqrt(nSigTPCproton*nSigTPCproton+nSigTOFproton*nSigTOFproton)<=fNSigmaCut){
4324  //fHistTOFnSigmavsPtAfter[2]->Fill(dPt1*gCharge1,nSigTOFproton);
4325  //if(TOFmatch>0 && probMis < 0.01 && beta>0.2){
4326  //fHistPtwithTOFSignal[2]->Fill(dPt1*gCharge1);
4327  //}
4328  //}
4329 
4330 
4331  //------------------------------------------------------------
4332 
4333  // TOF matching is not needed from data as done by Davide using MC.
4334 
4335  if(!TOFmatch || probMis > 0.01 || beta>0.2) continue;
4336 
4337  // nSigmaTPC distribution for Fixed nSigmaTOF cut
4338  if(TMath::Abs(nSigTOFpion)<=fNSigmaCut){
4339  fHistTPCnSigmavsPtAfter[0]->Fill(dPt1*gCharge1,nSigTPCpion);
4340  fHistPtwithTOFmasscut[0]->Fill(dPt1*gCharge1);
4341  }
4342  if(TMath::Abs(nSigTOFkaon)<=fNSigmaCut){
4343  fHistTPCnSigmavsPtAfter[1]->Fill(dPt1*gCharge1,nSigTPCkaon);
4344  fHistPtwithTOFmasscut[1]->Fill(dPt1*gCharge1);
4345  }
4346  if(TMath::Abs(nSigTOFproton)<=fNSigmaCut){
4347  fHistTPCnSigmavsPtAfter[2]->Fill(dPt1*gCharge1,nSigTPCproton);
4348  fHistPtwithTOFmasscut[2]->Fill(dPt1*gCharge1);
4349  } */
4350 
4351 
4352 
4353  }
4354 //===================== track loop ends ============================
4355 
4356 
4357 
4358 
4359 
4360 
4361 
4362  //---------- TPC Event Planes -------
4363  //Sub events //
4364  sumTPCQn2x[0] = sumTPCQn2x[0]/SumWEtaNeg;
4365  sumTPCQn2y[0] = sumTPCQn2y[0]/SumWEtaNeg;
4366  sumTPCQn3x[0] = sumTPCQn3x[0]/SumWEtaNeg;
4367  sumTPCQn3y[0] = sumTPCQn3y[0]/SumWEtaNeg;
4368  sumTPCQn4x[0] = sumTPCQn4x[0]/SumWEtaNeg;
4369  sumTPCQn4y[0] = sumTPCQn4y[0]/SumWEtaNeg;
4370 
4371  sumTPCQn2x[1] = sumTPCQn2x[1]/SumWEtaPos;
4372  sumTPCQn2y[1] = sumTPCQn2y[1]/SumWEtaPos;
4373  sumTPCQn3x[1] = sumTPCQn3x[1]/SumWEtaPos;
4374  sumTPCQn3y[1] = sumTPCQn3y[1]/SumWEtaPos;
4375  sumTPCQn4x[1] = sumTPCQn4x[1]/SumWEtaPos;
4376  sumTPCQn4y[1] = sumTPCQn4y[1]/SumWEtaPos;
4377 
4378  sumTPCQn2x[3] = sumTPCQn2x[3]/SumWEtaFull;
4379  sumTPCQn2y[3] = sumTPCQn2y[3]/SumWEtaFull;
4380  sumTPCQn3x[3] = sumTPCQn3x[3]/SumWEtaFull;
4381  sumTPCQn3y[3] = sumTPCQn3y[3]/SumWEtaFull;
4382  sumTPCQn4x[3] = sumTPCQn4x[3]/SumWEtaFull;
4383  sumTPCQn4y[3] = sumTPCQn4y[3]/SumWEtaFull;
4384 
4385 
4386  if(gPsiN>2){
4387  //Enable periodicity PsiN directly:
4388  PsiNTPCC = (1.0/gPsiN)*( TMath::ATan2(sumTPCQn2y[0],sumTPCQn2x[0]) + TMath::Pi() ) ; // negetive eta
4389  PsiNTPCA = (1.0/gPsiN)*( TMath::ATan2(sumTPCQn2y[1],sumTPCQn2x[1]) + TMath::Pi() ) ; // positive eta
4390  PsiNTPCF = (1.0/gPsiN)*( TMath::ATan2(sumTPCQn2y[3],sumTPCQn2x[3]) + TMath::Pi() ) ; // FUll TPC eta
4391  }
4392  else if(gPsiN!=0){
4393  PsiNTPCC = (1.0/gPsiN)*( TMath::ATan2(sumTPCQn2y[0],sumTPCQn2x[0]) ) ; // negetive eta
4394  if(PsiNTPCC<0.) PsiNTPCC += 2*TMath::Pi()/gPsiN;
4395  PsiNTPCA = (1.0/gPsiN)*( TMath::ATan2(sumTPCQn2y[1],sumTPCQn2x[1]) ) ; // positive eta
4396  if(PsiNTPCA<0.) PsiNTPCA += 2*TMath::Pi()/gPsiN;
4397  PsiNTPCF = (1.0/gPsiN)*( TMath::ATan2(sumTPCQn2y[3],sumTPCQn2x[3]) ) ; // FUll TPC eta
4398  if(PsiNTPCF<0.) PsiNTPCF += 2*TMath::Pi()/gPsiN;
4399  }
4400 
4401  fHTPCAEventPlaneVsCent->Fill(EvtCent,PsiNTPCA);
4402  fHTPCCEventPlaneVsCent->Fill(EvtCent,PsiNTPCC);
4403  fHTPCEventPlaneVsCent->Fill(EvtCent, PsiNTPCF);
4404 
4405 
4406 
4407 
4408 
4409  //-------------- vs Centrality -----------------
4410  //V0A-V0C
4411  fHist_Reso2n_EP_Norm_Det[QAindex][0]->Fill(EvtCent, TMath::Cos(gPsiN*(PsiNV0A-PsiNV0C)), fWgtCent);
4412  //V0A-TPC
4413  fHist_Reso2n_EP_Norm_Det[QAindex][1]->Fill(EvtCent, TMath::Cos(gPsiN*(PsiNV0A-PsiNTPCF)), fWgtCent);
4414  //V0C-TPC
4415  fHist_Reso2n_EP_Norm_Det[QAindex][2]->Fill(EvtCent, TMath::Cos(gPsiN*(PsiNV0C-PsiNTPCF)), fWgtCent);
4416  //TPCa -TPCc
4417  fHist_Reso2n_EP_Norm_Det[QAindex][3]->Fill(EvtCent, TMath::Cos(gPsiN*(PsiNTPCA-PsiNTPCC)), fWgtCent);
4418 
4419  //-------------- vs Refmult -----------------
4420  /*
4421  //V0A-V0C
4422  fHist_Reso2n_EP_Refm_Det[QAindex][0]->Fill(RefMultCorrFB, TMath::Cos(gPsiN*(PsiNV0A-PsiNV0C)), fWgtCent);
4423  //V0A-TPC
4424  fHist_Reso2n_EP_Refm_Det[QAindex][1]->Fill(RefMultCorrFB, TMath::Cos(gPsiN*(PsiNV0A-PsiNTPCF)), fWgtCent);
4425  //V0C-TPC
4426  fHist_Reso2n_EP_Refm_Det[QAindex][2]->Fill(RefMultCorrFB, TMath::Cos(gPsiN*(PsiNV0C-PsiNTPCF)), fWgtCent);
4427  //TPCa -TPCc
4428  fHist_Reso2n_EP_Refm_Det[QAindex][3]->Fill(RefMultCorrFB, TMath::Cos(gPsiN*(PsiNTPCA-PsiNTPCC)), fWgtCent);
4429  */
4430 
4431 
4432 
4433 
4434 
4435  //--------- Store TPC-Qn for Recenter ---------
4436  fTPCFQ2xVsCentRun->Fill(EvtCent,sumTPCQn2x[3]);
4437  fTPCFQ2yVsCentRun->Fill(EvtCent,sumTPCQn2y[3]);
4438 
4439  fTPCAQ2xVsCentRun->Fill(EvtCent,sumTPCQn2x[0]);
4440  fTPCAQ2yVsCentRun->Fill(EvtCent,sumTPCQn2y[0]);
4441  fTPCCQ2xVsCentRun->Fill(EvtCent,sumTPCQn2x[1]);
4442  fTPCCQ2yVsCentRun->Fill(EvtCent,sumTPCQn2y[1]);
4443 
4444  fTPCAQ3xVsCentRun->Fill(EvtCent,sumTPCQn3x[0]);
4445  fTPCAQ3yVsCentRun->Fill(EvtCent,sumTPCQn3y[0]);
4446  fTPCCQ3xVsCentRun->Fill(EvtCent,sumTPCQn3x[1]);
4447  fTPCCQ3yVsCentRun->Fill(EvtCent,sumTPCQn3y[1]);
4448 
4449  fTPCAQ4xVsCentRun->Fill(EvtCent,sumTPCQn4x[0]);
4450  fTPCAQ4yVsCentRun->Fill(EvtCent,sumTPCQn4y[0]);
4451  fTPCCQ4xVsCentRun->Fill(EvtCent,sumTPCQn4x[1]);
4452  fTPCCQ4yVsCentRun->Fill(EvtCent,sumTPCQn4y[1]);
4453 
4454 
4455 
4456 
4457 
4458 
4459 
4460 
4461 
4462 
4463 
4464 
4465  PostData(1,fListHist);
4466 
4467  fHistEventCount->Fill(14.5); //15th bin is last one
4468  stepCount++;
4469 
4470 
4471 
4472 
4473 
4474 
4475  //if(multPOI2nd!=(multPOI1st-1))
4476  //cout<<"mismatched "<< "\tPOIs1st = "<<multPOI1st<<"\tPOIs2nd = "<<multPOI2nd <<" for Event = "<<fEventCount<<endl;
4477 
4478  //if(multPOI1st!=multEtaFull)
4479  //cout<<"\n Mismatched track "<< "\t multEtaFull = "<<multEtaFull<<"\tPOIs1st = "<<multPOI1st<<" for Event = "<<fEventCount<<endl;
4480 
4481  //if(fEventCount%10==0)
4482  //cout<<"Ev = "<<fEventCount<<"\tMult = "<<multEtaFull<<"\tPOIs1st = "<<multPOI1st<<"\t POI2nd = "<< multPOI2nd <<endl;
4483 
4484  //if(multEtaFull>500)
4485  //cout<<"Ev = "<<fEventCount<<" ntracks = "<<ntracks<<"\tMult = "<<multEtaFull<<"\t RealTime = "<<watch.RealTime()<<"\t CPUTime = "<< watch.CpuTime() <<endl;
4486  //cout<<"Ev = "<<fEventCount<<" cent = "<<EvtCent<<"\tWEtaNeg = "<<SumWEtaNeg<<"\tnegMult = "<<multEtaNeg<<"\tWEtaPos = "<<SumWEtaPos<<"\tposMult = "<<multEtaPos<<endl;
4487  //watch.Stop();
4488 
4489 }//================ UserExec ==============
4490 
4491 
4492 
4493 
4494 
4495 
4496 
4497 
4498 
4499 
4500 
4501 
4502 
4503 
4504 
4505 
4506 
4507 
4508 
4509 
4510 
4511 
4513 
4514 
4515 
4516 
4517 double AliAnalysisTaskCMEV0PID::GetWDist(const AliVVertex* v0, const AliVVertex* v1)
4518 {
4519  // calculate sqrt of weighted distance to other vertex
4520  if (!v0 || !v1) {
4521  AliDebug(2,"\n\n ::GetWDist => One of vertices is not valid\n\n");
4522  return 0;
4523  }
4524  static TMatrixDSym vVb(3);
4525  double dist = -1;
4526  double dx = v0->GetX()-v1->GetX();
4527  double dy = v0->GetY()-v1->GetY();
4528  double dz = v0->GetZ()-v1->GetZ();
4529  double cov0[6],cov1[6];
4530  v0->GetCovarianceMatrix(cov0);
4531  v1->GetCovarianceMatrix(cov1);
4532  vVb(0,0) = cov0[0]+cov1[0];
4533  vVb(1,1) = cov0[2]+cov1[2];
4534  vVb(2,2) = cov0[5]+cov1[5];
4535  vVb(1,0) = vVb(0,1) = cov0[1]+cov1[1];
4536  vVb(0,2) = vVb(1,2) = vVb(2,0) = vVb(2,1) = 0.;
4537  vVb.InvertFast();
4538  if (!vVb.IsValid()) {
4539  AliDebug(2,"Singular Matrix\n");
4540  return dist;
4541  }
4542  dist = vVb(0,0)*dx*dx + vVb(1,1)*dy*dy + vVb(2,2)*dz*dz
4543  + 2*vVb(0,1)*dx*dy + 2*vVb(0,2)*dx*dz + 2*vVb(1,2)*dy*dz;
4544  return dist>0 ? TMath::Sqrt(dist) : -1;
4545 }
4546 
4547 
4549  { // check for multi-vertexer pile-up
4550  const int kMinPlpContrib = 5;
4551  const double kMaxPlpChi2 = 5.0;
4552  const double kMinWDist = 15;
4553 
4554  const AliVVertex* vtPrm = 0;
4555  const AliVVertex* vtPlp = 0;
4556 
4557  int nPlp = 0;
4558 
4559  if(!(nPlp=faod->GetNumberOfPileupVerticesTracks()))
4560  return kFALSE;
4561 
4562  vtPrm = faod->GetPrimaryVertex();
4563  if(vtPrm == faod->GetPrimaryVertexSPD())
4564  return kTRUE; // there are pile-up vertices but no primary
4565 
4566  //int bcPrim = vtPrm->GetBC();
4567 
4568  for(int ipl=0;ipl<nPlp;ipl++) {
4569  vtPlp = (const AliVVertex*)faod->GetPileupVertexTracks(ipl);
4570  if (vtPlp->GetNContributors() < kMinPlpContrib) continue;
4571  if (vtPlp->GetChi2perNDF() > kMaxPlpChi2) continue;
4572  //int bcPlp = vtPlp->GetBC();
4573  //if (bcPlp!=AliVTrack::kTOFBCNA && TMath::Abs(bcPlp-bcPrim)>2)
4574  // return kTRUE; // pile-up from other BC
4575 
4576  double wDst = GetWDist(vtPrm,vtPlp);
4577  if (wDst<kMinWDist) continue;
4578 
4579  return kTRUE; // pile-up: well separated vertices
4580  }
4581  return kFALSE;
4582 }
4583 
4584 
4585 
4587  /*if(bApplyMCcorr){
4588  if(!gGrid){
4589  TGrid::Connect("alien://");
4590  }
4591  if(!mfileFBHijing){
4592  mfileFBHijing = TFile::Open(sMCfilePath,"READ");
4593  fListFBHijing = dynamic_cast<TList*>(mfileFBHijing->FindObjectAny("fMcEffiHij")); */
4594 
4595  if(fListFBHijing) {
4596  cout<<"\n =========> Info: Using MC efficiency correction Map <=========== "<<endl;
4597  for(int i=0;i<10;i++) {
4598  fFB_Efficiency_Cent[i] = (TH1D *) fListFBHijing->FindObject(Form("eff_unbiased_%d",i));
4599  }
4600  //PID :
4601  for(int i=0;i<10;i++) {
4602  fFB_Efficiency_Pion_Cent[i] = (TH1D *) fListFBHijing->FindObject(Form("eff_unbiased_Pion_%d",i));
4603  fFB_Efficiency_Kaon_Cent[i] = (TH1D *) fListFBHijing->FindObject(Form("eff_unbiased_Kaon_%d",i));
4604  fFB_Efficiency_Proton_Cent[i] = (TH1D *) fListFBHijing->FindObject(Form("eff_unbiased_Proton_%d",i));
4605  }
4606 
4607  //------- Fill the flags: --------------
4609  fHistTaskConfigParameters->SetBinContent(19,1);
4610  }
4612  fHistTaskConfigParameters->SetBinContent(20,1);
4613  }
4615  fHistTaskConfigParameters->SetBinContent(21,1);
4616  }
4618  fHistTaskConfigParameters->SetBinContent(22,1);
4619  }
4620  }
4621  else if(!fListFBHijing){
4622  std::cout<<"\n\n !!!!**** Warning: FB Efficiency File/List not found Use Weight = 1.0 *****\n\n"<<std::endl;
4623  //exit(1);
4624  }
4625 }
4626 
4627 
4628 
4629 
4631 
4632  Int_t cIndex = 0;
4633 
4634  if(fCent<5.0) {
4635  cIndex = 0;
4636  }
4637  else if(fCent>=5.0 && fCent<10){
4638  cIndex = 1;
4639  }
4640  else if(fCent>=10.0) {
4641  cIndex = abs(fCent/10.0)+1;
4642  }
4643  return cIndex;
4644 }
4645 
4647  //std::cout<<" centrality outlier function called "<<std::endl;
4648  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.};
4649 
4650  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.};
4651 
4652  for(int i=0;i<90;i++) {
4653  hCentvsTPCmultCuts->SetBinContent(i+1,1,fMeanTPC[i]);
4654  hCentvsTPCmultCuts->SetBinContent(i+1,2,fSigmaTPC[i]);
4655  }
4656 }
4657 
4658 
4659 
4660 
4661 
4662 
4664 
4665  fHistTaskConfigParameters = new TH1F("fHistTaskConfigParameters","Task parameters",25,0,25);
4666  fHistTaskConfigParameters->GetXaxis()->SetBinLabel(1,"FilterBit");
4667  fHistTaskConfigParameters->SetBinContent(1,fFilterBit);
4668  fHistTaskConfigParameters->GetXaxis()->SetBinLabel(2,"n#sigmaTPC");
4669  fHistTaskConfigParameters->SetBinContent(2,fNSigmaCut);
4670  fHistTaskConfigParameters->GetXaxis()->SetBinLabel(3,"MinPt");
4671  fHistTaskConfigParameters->SetBinContent(3,fMinPtCut);
4672  fHistTaskConfigParameters->GetXaxis()->SetBinLabel(4,"MaxPt");
4673  fHistTaskConfigParameters->SetBinContent(4,fMaxPtCut);
4674  fHistTaskConfigParameters->GetXaxis()->SetBinLabel(5,"MinEta");
4675  fHistTaskConfigParameters->SetBinContent(5,fMinEtaCut);
4676  fHistTaskConfigParameters->GetXaxis()->SetBinLabel(6,"MaxEta");
4677  fHistTaskConfigParameters->SetBinContent(6,fMaxEtaCut);
4678 
4679  fHistTaskConfigParameters->GetXaxis()->SetBinLabel(11,"CentralityMin");
4681  fHistTaskConfigParameters->GetXaxis()->SetBinLabel(12,"CentralityMax");
4683 
4684  fHistTaskConfigParameters->GetXaxis()->SetBinLabel(13,"VertexMin(cm)");
4685  fHistTaskConfigParameters->GetXaxis()->SetBinLabel(14,"VertexMax(cm)");
4686 
4687 
4688  fHistTaskConfigParameters->GetXaxis()->SetBinLabel(15,"NUA Charge");
4689  fHistTaskConfigParameters->GetXaxis()->SetBinLabel(16,"NUA Pion");
4690  fHistTaskConfigParameters->GetXaxis()->SetBinLabel(17,"NUA Kaon");
4691  fHistTaskConfigParameters->GetXaxis()->SetBinLabel(18,"NUA Proton");
4692 
4693  fHistTaskConfigParameters->GetXaxis()->SetBinLabel(19,"MC Charge");
4694  fHistTaskConfigParameters->GetXaxis()->SetBinLabel(20,"MC Pion");
4695  fHistTaskConfigParameters->GetXaxis()->SetBinLabel(21,"MC Kaon");
4696  fHistTaskConfigParameters->GetXaxis()->SetBinLabel(22,"MC Proton");
4697 
4698  fHistTaskConfigParameters->GetXaxis()->SetBinLabel(23,"V0 Gain Eq.");
4699  fHistTaskConfigParameters->GetXaxis()->SetBinLabel(24,"V0 Qn Recenter");
4700 
4701 
4703 
4704 
4705 
4706  fHistPileUpCount = new TH1F("fHistPileUpCount", "fHistPileUpCount", 15, 0., 15.);
4707  fHistPileUpCount->GetXaxis()->SetBinLabel(1,"plpMV");
4708  fHistPileUpCount->GetXaxis()->SetBinLabel(2,"fromSPD");
4709  fHistPileUpCount->GetXaxis()->SetBinLabel(3,"RefMultComb08");
4710  fHistPileUpCount->GetXaxis()->SetBinLabel(4,"IncompleteDAQ");
4711  fHistPileUpCount->GetXaxis()->SetBinLabel(5,"abs(V0M-CL1)>5.0");
4712  fHistPileUpCount->GetXaxis()->SetBinLabel(6,"missingVtx");
4713  fHistPileUpCount->GetXaxis()->SetBinLabel(7,"inconsistentVtx");
4714  Int_t puConst = fPileUpConstParm;
4715  fHistPileUpCount->GetXaxis()->SetBinLabel(8,Form("multESDTPCDif>%d",puConst));
4716  fHistPileUpCount->GetXaxis()->SetBinLabel(9,Form("multGlobTPCDif>%d",puConst));
4717  fHistPileUpCount->GetXaxis()->SetBinLabel(10,"PileUpMultSelTask");
4719 
4720 
4721  fHistMultSelPUCount = new TH1F("fHistMultSelPileUpCount", "no of PU Event from MultSelTask", 10, 0., 10);
4722  fHistMultSelPUCount->GetXaxis()->SetBinLabel(1,"PileUp");
4723  fHistMultSelPUCount->GetXaxis()->SetBinLabel(2,"PileUpMV");
4724  fHistMultSelPUCount->GetXaxis()->SetBinLabel(3,"PileUpMultBins");
4725  fHistMultSelPUCount->GetXaxis()->SetBinLabel(4,"InconsistentVtx");
4726  fHistMultSelPUCount->GetXaxis()->SetBinLabel(5,"TrackletVsCluster");
4727  fHistMultSelPUCount->GetXaxis()->SetBinLabel(6,"IncompleteDAQ");
4728  fHistMultSelPUCount->GetXaxis()->SetBinLabel(7,"NotGoodVertex2016");
4730 
4731 
4732  fHistEventCount = new TH1F("fHistEventCount","Event counts",15,0,15);
4733  fHistEventCount->GetXaxis()->SetBinLabel(1,"Called UserExec()");
4734  fHistEventCount->GetXaxis()->SetBinLabel(2,"Called Exec()");
4735  fHistEventCount->GetXaxis()->SetBinLabel(3,"AOD Exist");
4736  fHistEventCount->GetXaxis()->SetBinLabel(4,"Vz < 10");
4737  fHistEventCount->GetXaxis()->SetBinLabel(5,Form("%2.0f<Cent<%2.0f",fCentralityPercentMin,fCentralityPercentMax));
4738  fHistEventCount->GetXaxis()->SetBinLabel(6,"noAODtrack > 2 ");
4739  fHistEventCount->GetXaxis()->SetBinLabel(7,"TPC vs Global");
4740  fHistEventCount->GetXaxis()->SetBinLabel(8,"TPC128 vs ESD");
4741  fHistEventCount->GetXaxis()->SetBinLabel(9,"Cent vs TPC");
4742  fHistEventCount->GetXaxis()->SetBinLabel(10,"mult eta+/- > 2");
4743  fHistEventCount->GetXaxis()->SetBinLabel(11,"centCL1 < 90");
4744  fHistEventCount->GetXaxis()->SetBinLabel(15,"Survived Events");
4745  fListHist->Add(fHistEventCount);
4746 
4747  //fHistEventCount->Fill(1);
4748 
4749 }
4750 
4751 
4752 
4753 
4754 
4756 {
4757  /*
4758  TList *fListAppliedV0Corr = new TList();
4759  fListAppliedV0Corr->SetName("fListAppliedV0Corr");
4760  fListAppliedV0Corr->SetOwner(kTRUE);
4761  fListHist->Add(fListAppliedV0Corr);*/ // to be Tested later.
4762 
4763  if(fListV0MCorr){
4764  fHCorrectV0M = (TH1D *) fListV0MCorr->FindObject(Form("fHistV0Gain_Run%d",run));
4765  fHAvgerageQnV0A = (TH2D *) fListV0MCorr->FindObject(Form("fHistAvgQnV0A_Run%d",run));
4766  fHAvgerageQnV0C = (TH2D *) fListV0MCorr->FindObject(Form("fHistAvgQnV0C_Run%d",run));
4767 
4768  //Now the wgts for centrality is added inside VOM gain file.
4769  fHCentWeightForRun = (TH1D *) fListV0MCorr->FindObject(Form("fHistCentWeight_Run%d",run));
4770 
4771  if(fHCentWeightForRun){
4772  cout<<"\n =========== Info:: Using Centrality wgts for run = "<<run<<"============"<<endl;
4773  }
4774  else{
4775  cout<<"\n =========== Info:: No Centrality wgt. correction.!! for run = "<<run<<"============"<<endl;
4776  }
4777 
4778  if(fHCorrectV0M){
4779  cout<<"\n =========== Info:: Setting up V0 gain correction for run = "<<run<<"============"<<endl;
4780  fHistTaskConfigParameters->SetBinContent(23,1);
4781  }
4782  else{
4783  cout<<"\n =========== Info:: No V0 gain correction..!!! for run = "<<run<<"============"<<endl;
4784  }
4786  cout<<"\n =========== Info:: Setting up V0 <Qn> recentering for run = "<<run<<"============"<<endl;
4787  fHistTaskConfigParameters->SetBinContent(24,1);
4788  }
4789  else{
4790  cout<<"\n =========== Info:: No V0 <Qn> recentering..!!! for run = "<<run<<"============"<<endl;
4791  }
4792  }
4793  else{
4794  cout<<"\n ======== !!!! Error:: List For V0-Gain and Qn not found for run "<<run<<"============"<<endl;
4795  }
4796 
4797 }
4798 
4799 
4800 
4801 
4802 
4803 
4804 
4806 {
4807 
4808  if(fListNUACorr){
4809  for(int i=0;i<5;i++){
4810  fHCorrectNUApos[i] = (TH3D *) fListNUACorr->FindObject(Form("fHist_NUA_VzPhiEta_Pos_Cent%d_Run%d",i,run));
4811  fHCorrectNUAneg[i] = (TH3D *) fListNUACorr->FindObject(Form("fHist_NUA_VzPhiEta_Neg_Cent%d_Run%d",i,run));
4812  }
4813  if(fHCorrectNUApos[3] && fHCorrectNUAneg[3]){
4814  cout<<"\n=========== Info:: Setting up NUA corrections for run "<<run<<"============"<<endl;
4815  fHistTaskConfigParameters->SetBinContent(15,1);
4816  }
4817  }
4818  else {
4819  printf("\n ******** Warning: No NUA Correction for Charge Particle in run %d, Use Wgt = 1.0 ********* \n",run);
4820  //Do not allocate memory:
4821  /*
4822  for(int i=0;i<5;i++){
4823  fHCorrectNUApos[i] = new TH3D(Form("fHCorrectNUApos_cent%d",i),"",1,-10,10,1,0,6.284,1,-0.9,0.9);
4824  fHCorrectNUAneg[i] = new TH3D(Form("fHCorrectNUAneg_cent%d",i),"",1,-10,10,1,0,6.284,1,-0.9,0.9);
4825  fHCorrectNUApos[i]->SetBinContent(1,1,1,1.0);
4826  fHCorrectNUAneg[i]->SetBinContent(1,1,1,1.0);
4827  //exit(1);
4828  }*/
4829  }
4830 
4831  //=================== PID: ==========================
4832  if(fListNUACorr){
4833  for(int i=0;i<5;i++){
4834  fHCorrectNUAposPion[i] = (TH3D *) fListNUACorr->FindObject(Form("fHist_NUA_VzPhiEta_Pion_Pos_Cent%d_Run%d",i,run)); //
4835  fHCorrectNUAnegPion[i] = (TH3D *) fListNUACorr->FindObject(Form("fHist_NUA_VzPhiEta_Pion_Neg_Cent%d_Run%d",i,run));
4836  if(fHCorrectNUAposPion[3] && fHCorrectNUAnegPion[3]) fHistTaskConfigParameters->SetBinContent(16,1);
4837 
4838  fHCorrectNUAposKaon[i] = (TH3D *) fListNUACorr->FindObject(Form("fHist_NUA_VzPhiEta_Kaon_Pos_Cent%d_Run%d",i,run)); //
4839  fHCorrectNUAnegKaon[i] = (TH3D *) fListNUACorr->FindObject(Form("fHist_NUA_VzPhiEta_Kaon_Neg_Cent%d_Run%d",i,run));
4840  if(fHCorrectNUAposKaon[3] && fHCorrectNUAnegKaon[3]) fHistTaskConfigParameters->SetBinContent(17,1);
4841 
4842  fHCorrectNUAposProton[i] = (TH3D *) fListNUACorr->FindObject(Form("fHist_NUA_VzPhiEta_Proton_Pos_Cent%d_Run%d",i,run));
4843  fHCorrectNUAnegProton[i] = (TH3D *) fListNUACorr->FindObject(Form("fHist_NUA_VzPhiEta_Proton_Neg_Cent%d_Run%d",i,run));
4844  if(fHCorrectNUAposProton[3] && fHCorrectNUAnegProton[3]) fHistTaskConfigParameters->SetBinContent(18,1);
4845  }
4847  cout<<"\n=========== Info:: Setting up --> PID NUA corrections for run = "<<run<<"============"<<endl;
4848  }
4849  else{
4850  cout<<"\n=========== WARNING :: PID NUA corrections NOT found for run = "<<run<<"============"<<endl;
4851  }
4852  }
4853  else {
4854  printf("\n ******** Error/Warning: No NUA Correction found for PID for run %d, Use PID Wgt = 1.0 ********* \n",run);
4855  /*
4856  for(int i=0;i<5;i++){
4857  fHCorrectNUAposPion[i] = new TH3D(Form("fHCorrectNUAPionpos_cent%d",i),"",1,-10,10,1,0,6.284,1,-0.9,0.9);
4858  fHCorrectNUAposPion[i] = new TH3D(Form("fHCorrectNUAPionneg_cent%d",i),"",1,-10,10,1,0,6.284,1,-0.9,0.9);
4859  fHCorrectNUAposPion[i]->SetBinContent(1,1,1,1.0);
4860  fHCorrectNUAposPion[i]->SetBinContent(1,1,1,1.0);
4861 
4862  fHCorrectNUAposKaon[i] = new TH3D(Form("fHCorrectNUAKaonpos_cent%d",i),"",1,-10,10,1,0,6.284,1,-0.9,0.9);
4863  fHCorrectNUAposKaon[i] = new TH3D(Form("fHCorrectNUAKaonneg_cent%d",i),"",1,-10,10,1,0,6.284,1,-0.9,0.9);
4864  fHCorrectNUAposKaon[i]->SetBinContent(1,1,1,1.0);
4865  fHCorrectNUAposKaon[i]->SetBinContent(1,1,1,1.0);
4866 
4867  fHCorrectNUAposProton[i] = new TH3D(Form("fHCorrectNUAProtonpos_cent%d",i),"",1,-10,10,1,0,6.284,1,-0.9,0.9);
4868  fHCorrectNUAposProton[i] = new TH3D(Form("fHCorrectNUAProtonneg_cent%d",i),"",1,-10,10,1,0,6.284,1,-0.9,0.9);
4869  fHCorrectNUAposProton[i]->SetBinContent(1,1,1,1.0);
4870  fHCorrectNUAposProton[i]->SetBinContent(1,1,1,1.0);
4871  //exit(1);
4872  }*/
4873  }
4874 
4875 }
4876 
TProfile * fHist_Corr2p_EP_Refm_PN[2][4]
TProfile * fHist_Corr3p_pTSum_EP_V0C_PP[2][6]
TProfile * fHist_Corr2p_Proton_EP_Refm_PP[2][4]
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_Corr2p_EP_Refm_PP[2][4]
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_Corr2p_EtaDiff_EP_Harm1_NN[2][6]
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_Corr2p_pTSum_EP_Harm2_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_Corr2p_pTSum_EP_Harm1_PP[2][6]
TProfile * fHist_Corr3p_EtaDiff_EP_V0A_PN[2][6]
TH1F * fHistPtwithTPCNsigma[3]
last in the list
TProfile * fHist_Corr2p_EP_Norm_PP[2][4]
TProfile * fHist_Reso2n_EP_Norm_Det[2][4]
TProfile * fHist_Corr2p_pTDiff_EP_Harm2_PN[2][6]
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_Corr2p_pTDiff_EP_Harm1_PN[2][6]
TProfile * fHist_Corr2p_Pion_EP_Norm_PP[2][4]
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]
TProfile * fHist_Corr2p_Kaon_EP_Refm_PN[2][4]
TH3D * fHCorrectNUAnegProton[5]
5 centrality bin, read NUA from file
TProfile * fHist_Corr3p_Proton_pTSum_EP_V0C_NN[2][6]
TProfile * fHist_Corr2p_pTSum_EP_Harm2_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_Corr2p_Pion_EP_Norm_PN[2][4]
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]
AliPIDResponse * fPIDResponse
aod
TProfile * fHist_Corr3p_pTSum_EP_V0C_PN[2][6]
TProfile * fHist_Corr2p_Pion_EP_Refm_NN[2][4]
TH1D * fHCentWeightForRun
V0C Average <Qn>, n=2,3.
TProfile * fHist_Corr3p_EtaDiff_EP_V0A_PP[2][6]
TProfile * fHist_Corr2p_EP_Norm_PN[2][4]
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_Corr2p_pTDiff_EP_Harm1_NN[2][6]
TProfile * fHist_Corr3p_Kaon_EtaDiff_EP_V0C_NN[2][6]
TProfile * fHist_Corr3p_Kaon_pTDiff_EP_V0A_PP[2][6]
TProfile * fHist_Corr2p_Pion_EP_Refm_PN[2][4]
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_Corr2p_pTDiff_EP_Harm2_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_Corr2p_Proton_EP_Refm_PN[2][4]
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]
TProfile * fHist_Corr2p_EtaDiff_EP_Harm1_PP[2][6]
TH1D * fHCorrectV0M
with PileUp cut
TProfile * fHist_Corr2p_EtaDiff_EP_Harm1_PN[2][6]
TProfile * fHist_Corr2p_EtaDiff_EP_Harm2_PN[2][6]
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]
TProfile * fHist_Corr2p_EP_Refm_NN[2][4]
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_Corr2p_pTSum_EP_Harm1_NN[2][6]
TProfile * fHist_Corr3p_Kaon_EP_Norm_NN[2][4]
TProfile * fHist_Corr2p_pTSum_EP_Harm1_PN[2][6]
TProfile * fHist_Corr3p_Pion_EP_Norm_NN[2][4]
TProfile * fHist_Corr2p_Kaon_EP_Refm_NN[2][4]
TProfile * fHist_Corr3p_Pion_EP_Refm_PN[2][4]
TProfile * fHist_Corr2p_EP_Norm_NN[2][4]
TProfile * fHist_Corr3p_Proton_pTDiff_EP_V0A_PN[2][6]
TProfile * fHist_Corr2p_Proton_EP_Norm_NN[2][4]
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 *)
TProfile * fHist_Corr2p_pTDiff_EP_Harm1_PP[2][6]
TH1F * fHistPileUpCount
Task input parameters FB / cut values etc.
TProfile * fHist_Corr2p_Pion_EP_Refm_PP[2][4]
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_Corr2p_Proton_EP_Norm_PN[2][4]
TProfile * fHist_Corr2p_Kaon_EP_Norm_PN[2][4]
TProfile * fHist_Corr3p_EP_Norm_PN[2][4]
5 centrality bin, read NUA from file
TProfile * fHist_Corr2p_EtaDiff_EP_Harm2_PP[2][6]
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_Corr2p_Proton_EP_Refm_NN[2][4]
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]
TProfile * fHist_Corr2p_Kaon_EP_Refm_PP[2][4]
TProfile * fHist_Corr2p_pTSum_EP_Harm2_PP[2][6]
bool Bool_t
Definition: External.C:53
TProfile * fHist_Corr3p_Proton_pTDiff_EP_V0C_PN[2][6]
TProfile * fHist_Corr2p_pTDiff_EP_Harm2_NN[2][6]
TProfile * fHist_Corr3p_Pion_pTDiff_EP_V0C_PN[2][6]
TProfile * fHist_Corr2p_Kaon_EP_Norm_PP[2][4]
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_Corr2p_Proton_EP_Norm_PP[2][4]
TProfile * fHist_Corr2p_Pion_EP_Norm_NN[2][4]
TProfile * fHist_Corr2p_Kaon_EP_Norm_NN[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_Corr2p_EtaDiff_EP_Harm2_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]