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