]>
Commit | Line | Data |
---|---|---|
8c1c76e9 | 1 | /**************************************************************************\r |
2 | * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *\r | |
3 | * *\r | |
4 | * Author: The ALICE Off-line Project. *\r | |
5 | * Contributors are mentioned in the code where appropriate. *\r | |
6 | * *\r | |
7 | * Permission to use, copy, modify and distribute this software and its *\r | |
8 | * documentation strictly for non-commercial purposes is hereby granted *\r | |
9 | * without fee, provided that the above copyright notice appears in all *\r | |
10 | * copies and that both the copyright notice and this permission notice *\r | |
11 | * appear in the supporting documentation. The authors make no claims *\r | |
12 | * about the suitability of this software for any purpose. It is *\r | |
13 | * provided "as is" without express or implied warranty. *\r | |
14 | **************************************************************************/\r | |
15 | //\r | |
16 | // Flow task\r | |
17 | // \r | |
18 | // Authors:\r | |
19 | // Raphaelle Bailhache <R.Bailhache@gsi.de>\r | |
20 | //\r | |
21 | #include "TROOT.h"\r | |
22 | #include "TH1D.h"\r | |
23 | #include "TH2D.h"\r | |
24 | #include "TChain.h"\r | |
25 | #include "TVector2.h"\r | |
26 | #include "THnSparse.h"\r | |
27 | #include "TMath.h"\r | |
28 | #include "TRandom3.h"\r | |
e17c1f86 | 29 | #include "TProfile.h"\r |
30 | #include "TProfile2D.h"\r | |
0e30407a | 31 | #include "TLorentzVector.h"\r |
32 | #include "TParticle.h"\r | |
6733d981 | 33 | #include "TF1.h"\r |
8c1c76e9 | 34 | \r |
4102d1cc | 35 | #include "AliVEventHandler.h"\r |
8c1c76e9 | 36 | #include "AliAnalysisTaskSE.h"\r |
4102d1cc | 37 | #include "AliAnalysisManager.h"\r |
8c1c76e9 | 38 | \r |
11ff28c5 | 39 | #include "AliVEvent.h"\r |
8c1c76e9 | 40 | #include "AliESDInputHandler.h"\r |
41 | #include "AliMCEvent.h"\r | |
42 | #include "AliESD.h"\r | |
43 | #include "AliESDEvent.h"\r | |
5cd679b7 | 44 | #include "AliPID.h"\r |
8c1c76e9 | 45 | #include "AliPIDResponse.h"\r |
46 | #include "AliESDVZERO.h"\r | |
47 | #include "AliESDUtils.h"\r | |
48 | #include "AliMCParticle.h"\r | |
0e30407a | 49 | #include "AliAODMCParticle.h"\r |
50 | #include "AliAODEvent.h"\r | |
51 | #include "AliAODVertex.h"\r | |
52 | #include "AliAODTrack.h"\r | |
11ff28c5 | 53 | #include "AliVTrack.h"\r |
0e30407a | 54 | #include "AliESDtrack.h"\r |
55 | #include "AliESDtrackCuts.h"\r | |
4102d1cc | 56 | #include "AliAODTrack.h"\r |
0e30407a | 57 | #include "AliStack.h"\r |
58 | #include "AliMCEvent.h"\r | |
8c1c76e9 | 59 | \r |
60 | #include "AliFlowCandidateTrack.h"\r | |
61 | #include "AliFlowEvent.h"\r | |
62 | #include "AliFlowTrackCuts.h"\r | |
63 | #include "AliFlowVector.h"\r | |
64 | #include "AliFlowCommonConstants.h"\r | |
0e30407a | 65 | #include "AliKFParticle.h"\r |
7b4c9210 | 66 | #include "AliKFVertex.h"\r |
8c1c76e9 | 67 | \r |
8c1c76e9 | 68 | #include "AliHFEcuts.h"\r |
69 | #include "AliHFEpid.h"\r | |
70 | #include "AliHFEpidQAmanager.h"\r | |
71 | #include "AliHFEtools.h"\r | |
a8ef1999 | 72 | #include "AliHFEVZEROEventPlane.h"\r |
8c1c76e9 | 73 | \r |
74 | #include "AliCentrality.h"\r | |
75 | #include "AliEventplane.h"\r | |
76 | #include "AliAnalysisTaskHFEFlow.h"\r | |
77 | \r | |
78 | \r | |
79 | //____________________________________________________________________\r | |
80 | AliAnalysisTaskHFEFlow::AliAnalysisTaskHFEFlow() :\r | |
81 | AliAnalysisTaskSE(),\r | |
a8ef1999 | 82 | fListHist(0x0), \r |
11ff28c5 | 83 | fAODAnalysis(kFALSE),\r |
4102d1cc | 84 | fUseFlagAOD(kFALSE),\r |
85 | fApplyCut(kTRUE),\r | |
86 | fFlags(1<<4),\r | |
e17c1f86 | 87 | fVZEROEventPlane(kFALSE),\r |
88 | fVZEROEventPlaneA(kFALSE),\r | |
89 | fVZEROEventPlaneC(kFALSE),\r | |
8c1c76e9 | 90 | fSubEtaGapTPC(kFALSE),\r |
91 | fEtaGap(0.0),\r | |
e17c1f86 | 92 | fNbBinsCentralityQCumulant(4),\r |
11ff28c5 | 93 | fNbBinsPtQCumulant(12),\r |
94 | fMinPtQCumulant(0.2),\r | |
8c1c76e9 | 95 | fMaxPtQCumulant(6.0),\r |
96 | fAfterBurnerOn(kFALSE),\r | |
97 | fNonFlowNumberOfTrackClones(0),\r | |
98 | fV1(0.),\r | |
99 | fV2(0.),\r | |
100 | fV3(0.),\r | |
101 | fV4(0.),\r | |
102 | fV5(0.),\r | |
103 | fMaxNumberOfIterations(100),\r | |
104 | fPrecisionPhi(0.001),\r | |
105 | fUseMCReactionPlane(kFALSE),\r | |
106 | fMCPID(kFALSE),\r | |
a8ef1999 | 107 | fNoPID(kFALSE),\r |
7b4c9210 | 108 | fChi2OverNDFCut(3.0),\r |
0e30407a | 109 | fMaxdca(3.0),\r |
110 | fMaxopeningtheta(0.02),\r | |
111 | fMaxopeningphi(0.1),\r | |
112 | fMaxopening3D(0.1),\r | |
113 | fMaxInvmass(0.1),\r | |
7b4c9210 | 114 | fSetMassConstraint(kFALSE),\r |
e17c1f86 | 115 | fDebugLevel(0),\r |
7b5936fc | 116 | fMonitorEventPlane(kFALSE),\r |
117 | fMonitorContamination(kFALSE),\r | |
118 | fMonitorPhotonic(kFALSE),\r | |
119 | fMonitorWithoutPID(kFALSE),\r | |
120 | fMonitorTrackCuts(kFALSE),\r | |
121 | fMonitorQCumulant(kFALSE),\r | |
8c1c76e9 | 122 | fcutsRP(0),\r |
123 | fcutsPOI(0),\r | |
124 | fHFECuts(0),\r | |
125 | fPID(0),\r | |
5cd679b7 | 126 | fPIDTOFOnly(0),\r |
8c1c76e9 | 127 | fPIDqa(0),\r |
0e30407a | 128 | fflowEvent(NULL),\r |
129 | fHFEBackgroundCuts(0),\r | |
130 | fPIDBackground(0),\r | |
131 | fPIDBackgroundqa(0),\r | |
132 | fAlgorithmMA(kTRUE),\r | |
133 | fArraytrack(NULL),\r | |
134 | fCounterPoolBackground(0),\r | |
a8ef1999 | 135 | fHFEVZEROEventPlane(0x0),\r |
16bbbe1c | 136 | fMultEv(0),\r |
8c1c76e9 | 137 | fEventPlane(0x0),\r |
138 | fEventPlaneaftersubtraction(0x0),\r | |
6733d981 | 139 | fFractionContamination(0x0),\r |
6b2521a4 | 140 | fContaminationv2(0x0),\r |
e17c1f86 | 141 | fCosSin2phiep(0x0),\r |
8c1c76e9 | 142 | fCos2phie(0x0),\r |
143 | fSin2phie(0x0),\r | |
144 | fCos2phiep(0x0),\r | |
145 | fSin2phiep(0x0),\r | |
146 | fSin2phiephiep(0x0),\r | |
e17c1f86 | 147 | fCosResabc(0x0),\r |
a8ef1999 | 148 | fSinResabc(0x0),\r |
e17c1f86 | 149 | fProfileCosResab(0x0),\r |
150 | fProfileCosResac(0x0),\r | |
151 | fProfileCosResbc(0x0),\r | |
8c1c76e9 | 152 | fCosRes(0x0),\r |
a8ef1999 | 153 | fSinRes(0x0),\r |
e17c1f86 | 154 | fProfileCosRes(0x0),\r |
0e30407a | 155 | fTrackingCuts(0x0),\r |
156 | fDeltaPhiMapsBeforePID(0x0),\r | |
157 | fCosPhiMapsBeforePID(0x0),\r | |
8c1c76e9 | 158 | fDeltaPhiMaps(0x0),\r |
5cd679b7 | 159 | fDeltaPhiMapsContamination(0x0),\r |
e17c1f86 | 160 | fCosPhiMaps(0x0),\r |
0e30407a | 161 | fProfileCosPhiMaps(0x0),\r |
6733d981 | 162 | //fDeltaPhiMapsTaggedPhotonic(0x0),\r |
163 | //fCosPhiMapsTaggedPhotonic(0x0),\r | |
164 | //fDeltaPhiMapsTaggedNonPhotonic(0x0),\r | |
165 | //fCosPhiMapsTaggedNonPhotonic(0x0),\r | |
166 | //fDeltaPhiMapsTaggedPhotonicLS(0x0),\r | |
167 | //fCosPhiMapsTaggedPhotonicLS(0x0),\r | |
0e30407a | 168 | fMCSourceDeltaPhiMaps(0x0),\r |
169 | fOppSignDeltaPhiMaps(0x0),\r | |
170 | fSameSignDeltaPhiMaps(0x0),\r | |
171 | fOppSignAngle(0x0),\r | |
172 | fSameSignAngle(0x0)\r | |
8c1c76e9 | 173 | {\r |
174 | // Constructor\r | |
175 | \r | |
e17c1f86 | 176 | for(Int_t k = 0; k < 10; k++) {\r |
177 | fBinCentralityLess[k] = 0.0;\r | |
178 | }\r | |
6733d981 | 179 | for(Int_t k = 0; k < 11; k++) {\r |
180 | fContamination[k] = NULL;\r | |
6b2521a4 | 181 | fv2contamination[k] = NULL;\r |
6733d981 | 182 | }\r |
183 | \r | |
8c1c76e9 | 184 | }\r |
185 | //______________________________________________________________________________\r | |
186 | AliAnalysisTaskHFEFlow:: AliAnalysisTaskHFEFlow(const char *name) :\r | |
187 | AliAnalysisTaskSE(name),\r | |
11ff28c5 | 188 | fListHist(0x0),\r |
4102d1cc | 189 | fAODAnalysis(kFALSE),\r |
190 | fUseFlagAOD(kFALSE),\r | |
191 | fApplyCut(kTRUE),\r | |
192 | fFlags(1<<4), \r | |
e17c1f86 | 193 | fVZEROEventPlane(kFALSE),\r |
194 | fVZEROEventPlaneA(kFALSE),\r | |
195 | fVZEROEventPlaneC(kFALSE),\r | |
8c1c76e9 | 196 | fSubEtaGapTPC(kFALSE),\r |
197 | fEtaGap(0.0),\r | |
e17c1f86 | 198 | fNbBinsCentralityQCumulant(4),\r |
8c1c76e9 | 199 | fNbBinsPtQCumulant(15),\r |
200 | fMinPtQCumulant(0.0),\r | |
201 | fMaxPtQCumulant(6.0),\r | |
202 | fAfterBurnerOn(kFALSE),\r | |
203 | fNonFlowNumberOfTrackClones(0),\r | |
204 | fV1(0.),\r | |
205 | fV2(0.),\r | |
206 | fV3(0.),\r | |
207 | fV4(0.),\r | |
208 | fV5(0.),\r | |
209 | fMaxNumberOfIterations(100),\r | |
210 | fPrecisionPhi(0.001),\r | |
211 | fUseMCReactionPlane(kFALSE),\r | |
212 | fMCPID(kFALSE),\r | |
a8ef1999 | 213 | fNoPID(kFALSE),\r |
7b4c9210 | 214 | fChi2OverNDFCut(3.0),\r |
0e30407a | 215 | fMaxdca(3.0),\r |
216 | fMaxopeningtheta(0.02),\r | |
217 | fMaxopeningphi(0.1),\r | |
218 | fMaxopening3D(0.1),\r | |
219 | fMaxInvmass(0.1),\r | |
7b4c9210 | 220 | fSetMassConstraint(kFALSE),\r |
e17c1f86 | 221 | fDebugLevel(0),\r |
7b5936fc | 222 | fMonitorEventPlane(kFALSE),\r |
223 | fMonitorContamination(kFALSE),\r | |
224 | fMonitorPhotonic(kFALSE),\r | |
225 | fMonitorWithoutPID(kFALSE),\r | |
226 | fMonitorTrackCuts(kFALSE),\r | |
227 | fMonitorQCumulant(kFALSE),\r | |
8c1c76e9 | 228 | fcutsRP(0),\r |
229 | fcutsPOI(0),\r | |
230 | fHFECuts(0),\r | |
231 | fPID(0),\r | |
5cd679b7 | 232 | fPIDTOFOnly(0),\r |
8c1c76e9 | 233 | fPIDqa(0),\r |
0e30407a | 234 | fflowEvent(NULL),\r |
235 | fHFEBackgroundCuts(0),\r | |
236 | fPIDBackground(0),\r | |
237 | fPIDBackgroundqa(0),\r | |
238 | fAlgorithmMA(kTRUE), \r | |
239 | fArraytrack(NULL),\r | |
240 | fCounterPoolBackground(0),\r | |
a8ef1999 | 241 | fHFEVZEROEventPlane(0x0),\r |
16bbbe1c | 242 | fMultEv(0),\r |
8c1c76e9 | 243 | fEventPlane(0x0),\r |
244 | fEventPlaneaftersubtraction(0x0),\r | |
6733d981 | 245 | fFractionContamination(0x0),\r |
6b2521a4 | 246 | fContaminationv2(0x0),\r |
e17c1f86 | 247 | fCosSin2phiep(0x0),\r |
8c1c76e9 | 248 | fCos2phie(0x0),\r |
249 | fSin2phie(0x0),\r | |
250 | fCos2phiep(0x0),\r | |
251 | fSin2phiep(0x0),\r | |
252 | fSin2phiephiep(0x0),\r | |
e17c1f86 | 253 | fCosResabc(0x0),\r |
a8ef1999 | 254 | fSinResabc(0x0),\r |
e17c1f86 | 255 | fProfileCosResab(0x0),\r |
256 | fProfileCosResac(0x0),\r | |
257 | fProfileCosResbc(0x0),\r | |
8c1c76e9 | 258 | fCosRes(0x0),\r |
a8ef1999 | 259 | fSinRes(0x0),\r |
e17c1f86 | 260 | fProfileCosRes(0x0),\r |
0e30407a | 261 | fTrackingCuts(0x0),\r |
262 | fDeltaPhiMapsBeforePID(0x0),\r | |
263 | fCosPhiMapsBeforePID(0x0),\r | |
8c1c76e9 | 264 | fDeltaPhiMaps(0x0),\r |
5cd679b7 | 265 | fDeltaPhiMapsContamination(0x0),\r |
e17c1f86 | 266 | fCosPhiMaps(0x0),\r |
0e30407a | 267 | fProfileCosPhiMaps(0x0),\r |
6733d981 | 268 | //fDeltaPhiMapsTaggedPhotonic(0x0),\r |
269 | //fCosPhiMapsTaggedPhotonic(0x0),\r | |
270 | //fDeltaPhiMapsTaggedNonPhotonic(0x0),\r | |
271 | //fCosPhiMapsTaggedNonPhotonic(0x0),\r | |
272 | //fDeltaPhiMapsTaggedPhotonicLS(0x0),\r | |
273 | //fCosPhiMapsTaggedPhotonicLS(0x0),\r | |
0e30407a | 274 | fMCSourceDeltaPhiMaps(0x0),\r |
275 | fOppSignDeltaPhiMaps(0x0),\r | |
276 | fSameSignDeltaPhiMaps(0x0),\r | |
277 | fOppSignAngle(0x0),\r | |
278 | fSameSignAngle(0x0)\r | |
8c1c76e9 | 279 | {\r |
280 | //\r | |
281 | // named ctor\r | |
282 | //\r | |
e17c1f86 | 283 | \r |
284 | for(Int_t k = 0; k < 10; k++) {\r | |
285 | fBinCentralityLess[k] = 0.0;\r | |
286 | }\r | |
287 | fBinCentralityLess[0] = 0.0;\r | |
288 | fBinCentralityLess[1] = 20.0;\r | |
289 | fBinCentralityLess[2] = 40.0;\r | |
290 | fBinCentralityLess[3] = 60.0;\r | |
291 | fBinCentralityLess[4] = 80.0;\r | |
6733d981 | 292 | \r |
293 | for(Int_t k = 0; k < 11; k++) {\r | |
294 | fContamination[k] = NULL;\r | |
6b2521a4 | 295 | fv2contamination[k] = NULL;\r |
6733d981 | 296 | }\r |
e17c1f86 | 297 | \r |
8c1c76e9 | 298 | fPID = new AliHFEpid("hfePid");\r |
299 | fPIDqa = new AliHFEpidQAmanager;\r | |
300 | \r | |
0e30407a | 301 | fPIDBackground = new AliHFEpid("hfePidBackground");\r |
302 | fPIDBackgroundqa = new AliHFEpidQAmanager;\r | |
303 | \r | |
5cd679b7 | 304 | fPIDTOFOnly = new AliHFEpid("hfePidTOFOnly");\r |
305 | \r | |
8c1c76e9 | 306 | DefineInput(0,TChain::Class());\r |
307 | DefineOutput(1, TList::Class());\r | |
7f695a7b | 308 | //for(Int_t bincless = 0; bincless < fNbBinsCentralityQCumulant; bincless++) {\r |
309 | // DefineOutput(bincless+2,AliFlowEventSimple::Class()); \r | |
310 | //}\r | |
8c1c76e9 | 311 | \r |
a8ef1999 | 312 | }\r |
313 | //____________________________________________________________\r | |
314 | AliAnalysisTaskHFEFlow::AliAnalysisTaskHFEFlow(const AliAnalysisTaskHFEFlow &ref):\r | |
315 | AliAnalysisTaskSE(ref),\r | |
7c4ec6e7 | 316 | fListHist(NULL),\r |
11ff28c5 | 317 | fAODAnalysis(ref.fAODAnalysis), \r |
4102d1cc | 318 | fUseFlagAOD(ref.fUseFlagAOD),\r |
319 | fApplyCut(ref.fApplyCut),\r | |
320 | fFlags(ref.fFlags),\r | |
a8ef1999 | 321 | fVZEROEventPlane(ref.fVZEROEventPlane),\r |
322 | fVZEROEventPlaneA(ref.fVZEROEventPlaneA),\r | |
323 | fVZEROEventPlaneC(ref.fVZEROEventPlaneC),\r | |
324 | fSubEtaGapTPC(ref.fSubEtaGapTPC),\r | |
325 | fEtaGap(ref.fEtaGap),\r | |
326 | fNbBinsCentralityQCumulant(ref.fNbBinsCentralityQCumulant),\r | |
327 | fNbBinsPtQCumulant(ref.fNbBinsPtQCumulant),\r | |
328 | fMinPtQCumulant(ref.fMinPtQCumulant),\r | |
329 | fMaxPtQCumulant(ref.fMaxPtQCumulant),\r | |
330 | fAfterBurnerOn(ref.fAfterBurnerOn),\r | |
331 | fNonFlowNumberOfTrackClones(ref.fNonFlowNumberOfTrackClones),\r | |
332 | fV1(ref.fV1),\r | |
333 | fV2(ref.fV2),\r | |
334 | fV3(ref.fV3),\r | |
335 | fV4(ref.fV4),\r | |
336 | fV5(ref.fV5),\r | |
337 | fMaxNumberOfIterations(ref.fMaxNumberOfIterations),\r | |
338 | fPrecisionPhi(ref.fPrecisionPhi),\r | |
339 | fUseMCReactionPlane(ref.fUseMCReactionPlane),\r | |
340 | fMCPID(ref.fMCPID),\r | |
341 | fNoPID(ref.fNoPID),\r | |
0e30407a | 342 | fChi2OverNDFCut(ref.fChi2OverNDFCut),\r |
343 | fMaxdca(ref.fMaxdca),\r | |
344 | fMaxopeningtheta(ref.fMaxopeningtheta),\r | |
345 | fMaxopeningphi(ref.fMaxopeningphi),\r | |
346 | fMaxopening3D(ref.fMaxopening3D),\r | |
347 | fMaxInvmass(ref.fMaxInvmass),\r | |
7b4c9210 | 348 | fSetMassConstraint(ref.fSetMassConstraint),\r |
a8ef1999 | 349 | fDebugLevel(ref.fDebugLevel),\r |
7b5936fc | 350 | fMonitorEventPlane(ref.fMonitorEventPlane),\r |
351 | fMonitorContamination(ref.fMonitorContamination),\r | |
352 | fMonitorPhotonic(ref.fMonitorPhotonic),\r | |
353 | fMonitorWithoutPID(ref.fMonitorWithoutPID),\r | |
354 | fMonitorTrackCuts(ref.fMonitorTrackCuts),\r | |
355 | fMonitorQCumulant(ref.fMonitorQCumulant),\r | |
7c4ec6e7 | 356 | fcutsRP(NULL),\r |
357 | fcutsPOI(NULL),\r | |
358 | fHFECuts(NULL),\r | |
359 | fPID(NULL),\r | |
5cd679b7 | 360 | fPIDTOFOnly(NULL),\r |
7c4ec6e7 | 361 | fPIDqa(NULL),\r |
0e30407a | 362 | fflowEvent(NULL),\r |
7c4ec6e7 | 363 | fHFEBackgroundCuts(NULL),\r |
364 | fPIDBackground(NULL),\r | |
365 | fPIDBackgroundqa(NULL),\r | |
366 | fAlgorithmMA(ref.fAlgorithmMA),\r | |
0e30407a | 367 | fArraytrack(NULL),\r |
7c4ec6e7 | 368 | fCounterPoolBackground(ref.fCounterPoolBackground),\r |
369 | fHFEVZEROEventPlane(NULL),\r | |
16bbbe1c | 370 | fMultEv(NULL),\r |
7c4ec6e7 | 371 | fEventPlane(NULL),\r |
372 | fEventPlaneaftersubtraction(NULL),\r | |
6733d981 | 373 | fFractionContamination(NULL),\r |
6b2521a4 | 374 | fContaminationv2(NULL),\r |
7c4ec6e7 | 375 | fCosSin2phiep(NULL),\r |
376 | fCos2phie(NULL),\r | |
377 | fSin2phie(NULL),\r | |
378 | fCos2phiep(NULL),\r | |
379 | fSin2phiep(NULL),\r | |
380 | fSin2phiephiep(NULL),\r | |
381 | fCosResabc(NULL),\r | |
382 | fSinResabc(NULL),\r | |
383 | fProfileCosResab(NULL),\r | |
384 | fProfileCosResac(NULL),\r | |
385 | fProfileCosResbc(NULL),\r | |
386 | fCosRes(NULL),\r | |
387 | fSinRes(NULL),\r | |
388 | fProfileCosRes(NULL),\r | |
389 | fTrackingCuts(NULL),\r | |
390 | fDeltaPhiMapsBeforePID(NULL),\r | |
391 | fCosPhiMapsBeforePID(NULL),\r | |
392 | fDeltaPhiMaps(NULL),\r | |
5cd679b7 | 393 | fDeltaPhiMapsContamination(NULL),\r |
7c4ec6e7 | 394 | fCosPhiMaps(NULL),\r |
395 | fProfileCosPhiMaps(NULL),\r | |
6733d981 | 396 | //fDeltaPhiMapsTaggedPhotonic(NULL),\r |
397 | //fCosPhiMapsTaggedPhotonic(NULL),\r | |
398 | //fDeltaPhiMapsTaggedNonPhotonic(NULL),\r | |
399 | //fCosPhiMapsTaggedNonPhotonic(NULL),\r | |
400 | //fDeltaPhiMapsTaggedPhotonicLS(NULL),\r | |
401 | //fCosPhiMapsTaggedPhotonicLS(NULL),\r | |
7c4ec6e7 | 402 | fMCSourceDeltaPhiMaps(NULL),\r |
403 | fOppSignDeltaPhiMaps(NULL),\r | |
404 | fSameSignDeltaPhiMaps(NULL),\r | |
405 | fOppSignAngle(NULL),\r | |
406 | fSameSignAngle(NULL)\r | |
a8ef1999 | 407 | {\r |
408 | //\r | |
409 | // Copy Constructor\r | |
410 | //\r | |
411 | ref.Copy(*this);\r | |
412 | }\r | |
413 | \r | |
414 | //____________________________________________________________\r | |
415 | AliAnalysisTaskHFEFlow &AliAnalysisTaskHFEFlow::operator=(const AliAnalysisTaskHFEFlow &ref){\r | |
416 | //\r | |
417 | // Assignment operator\r | |
418 | //\r | |
419 | if(this == &ref) \r | |
420 | ref.Copy(*this);\r | |
421 | return *this;\r | |
422 | }\r | |
423 | \r | |
424 | //____________________________________________________________\r | |
425 | void AliAnalysisTaskHFEFlow::Copy(TObject &o) const {\r | |
426 | // \r | |
427 | // Copy into object o\r | |
428 | //\r | |
429 | AliAnalysisTaskHFEFlow &target = dynamic_cast<AliAnalysisTaskHFEFlow &>(o);\r | |
11ff28c5 | 430 | target.fAODAnalysis = fAODAnalysis;\r |
4102d1cc | 431 | target.fUseFlagAOD = fUseFlagAOD;\r |
432 | target.fApplyCut = fApplyCut;\r | |
433 | target.fFlags = fFlags;\r | |
a8ef1999 | 434 | target.fVZEROEventPlane = fVZEROEventPlane;\r |
435 | target.fVZEROEventPlaneA = fVZEROEventPlaneA;\r | |
436 | target.fVZEROEventPlaneC = fVZEROEventPlaneC;\r | |
437 | target.fSubEtaGapTPC = fSubEtaGapTPC;\r | |
438 | target.fEtaGap = fEtaGap;\r | |
439 | target.fNbBinsCentralityQCumulant = fNbBinsCentralityQCumulant;\r | |
440 | target.fNbBinsPtQCumulant = fNbBinsPtQCumulant;\r | |
441 | target.fMinPtQCumulant = fMinPtQCumulant;\r | |
442 | target.fMaxPtQCumulant = fMaxPtQCumulant;\r | |
443 | target.fAfterBurnerOn = fAfterBurnerOn;\r | |
444 | target.fNonFlowNumberOfTrackClones = fNonFlowNumberOfTrackClones;\r | |
445 | target.fV1 = fV1;\r | |
446 | target.fV2 = fV2;\r | |
447 | target.fV3 = fV3;\r | |
448 | target.fV4 = fV4;\r | |
449 | target.fV5 = fV5;\r | |
450 | target.fMaxNumberOfIterations = fMaxNumberOfIterations;\r | |
451 | target.fPrecisionPhi = fPrecisionPhi;\r | |
452 | target.fUseMCReactionPlane = fUseMCReactionPlane;\r | |
453 | target.fMCPID = fMCPID;\r | |
454 | target.fNoPID = fNoPID;\r | |
0e30407a | 455 | target.fChi2OverNDFCut = fChi2OverNDFCut;\r |
456 | target.fMaxdca = fMaxdca;\r | |
457 | target.fMaxopeningtheta = fMaxopeningtheta;\r | |
458 | target.fMaxopeningphi = fMaxopeningphi;\r | |
459 | target.fMaxopening3D = fMaxopening3D;\r | |
460 | target.fMaxInvmass = fMaxInvmass;\r | |
7b4c9210 | 461 | target.fSetMassConstraint = fSetMassConstraint;\r |
0e30407a | 462 | target.fAlgorithmMA = fAlgorithmMA;\r |
463 | target.fCounterPoolBackground = fCounterPoolBackground;\r | |
a8ef1999 | 464 | target.fDebugLevel = fDebugLevel;\r |
7b5936fc | 465 | target.fMonitorEventPlane = fMonitorEventPlane;\r |
466 | target.fMonitorContamination = fMonitorContamination;\r | |
467 | target.fMonitorPhotonic = fMonitorPhotonic;\r | |
468 | target.fMonitorWithoutPID = fMonitorWithoutPID;\r | |
469 | target.fMonitorTrackCuts = fMonitorTrackCuts;\r | |
470 | target.fMonitorQCumulant = fMonitorQCumulant;\r | |
a8ef1999 | 471 | target.fcutsRP = fcutsRP;\r |
472 | target.fcutsPOI = fcutsPOI;\r | |
473 | target.fHFECuts = fHFECuts;\r | |
474 | target.fPID = fPID;\r | |
475 | target.fPIDqa = fPIDqa;\r | |
476 | target.fHFEVZEROEventPlane = fHFEVZEROEventPlane;\r | |
6733d981 | 477 | for(Int_t k = 0; k < 11; k++) {\r |
478 | target.fContamination[k] = fContamination[k];\r | |
6b2521a4 | 479 | target.fv2contamination[k] = fv2contamination[k];\r |
6733d981 | 480 | }\r |
a8ef1999 | 481 | \r |
482 | }\r | |
483 | //____________________________________________________________\r | |
484 | AliAnalysisTaskHFEFlow::~AliAnalysisTaskHFEFlow(){\r | |
485 | //\r | |
486 | // Destructor\r | |
487 | //\r | |
0e30407a | 488 | if(fArraytrack) delete fArraytrack;\r |
a8ef1999 | 489 | if(fListHist) delete fListHist;\r |
490 | if(fcutsRP) delete fcutsRP;\r | |
491 | if(fcutsPOI) delete fcutsPOI;\r | |
492 | if(fHFECuts) delete fHFECuts;\r | |
493 | if(fPID) delete fPID;\r | |
5cd679b7 | 494 | if(fPIDTOFOnly) delete fPIDTOFOnly;\r |
f20c8eba | 495 | //if(fPIDqa) delete fPIDqa;\r |
a8ef1999 | 496 | if(fflowEvent) delete fflowEvent;\r |
0e30407a | 497 | if(fHFEBackgroundCuts) delete fHFEBackgroundCuts;\r |
498 | if(fPIDBackground) delete fPIDBackground;\r | |
f20c8eba | 499 | //if(fPIDBackgroundqa) delete fPIDBackgroundqa;\r |
0e30407a | 500 | //if(fHFEVZEROEventPlane) delete fHFEVZEROEventPlane;\r |
501 | \r | |
a8ef1999 | 502 | \r |
8c1c76e9 | 503 | }\r |
504 | //________________________________________________________________________\r | |
505 | void AliAnalysisTaskHFEFlow::UserCreateOutputObjects()\r | |
506 | {\r | |
507 | \r | |
508 | //********************\r | |
509 | // Create histograms\r | |
510 | //********************\r | |
511 | \r | |
512 | //**************\r | |
513 | // Cuts\r | |
514 | //**************\r | |
515 | \r | |
516 | //---------Data selection----------\r | |
517 | //kMC, kGlobal, kTPCstandalone, kSPDtracklet, kPMD\r | |
518 | //AliFlowTrackCuts::trackParameterType rptype = AliFlowTrackCuts::kGlobal;\r | |
519 | //AliFlowTrackCuts::trackParameterType poitype = AliFlowTrackCuts::kGlobal;\r | |
520 | \r | |
521 | //---------Parameter mixing--------\r | |
522 | //kPure - no mixing, kTrackWithMCkine, kTrackWithMCPID, kTrackWithMCpt\r | |
523 | //AliFlowTrackCuts::trackParameterMix rpmix = AliFlowTrackCuts::kPure;\r | |
524 | //AliFlowTrackCuts::trackParameterMix poimix = AliFlowTrackCuts::kPure;\r | |
90aa28e9 | 525 | \r |
7f695a7b | 526 | AliDebug(2,"test");\r |
527 | \r | |
528 | AliDebug(2,"AliAnalysisTaskHFEFlow: User create output objects");\r | |
4102d1cc | 529 | \r |
530 | // AOD or ESD\r | |
531 | AliVEventHandler *inputHandler = dynamic_cast<AliVEventHandler *>(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler());\r | |
532 | if(!TString(inputHandler->IsA()->GetName()).CompareTo("AliAODInputHandler")){\r | |
533 | SetAODAnalysis(kTRUE);\r | |
7f695a7b | 534 | AliDebug(2,"Put AOD analysis on");\r |
4102d1cc | 535 | } else {\r |
536 | SetAODAnalysis(kFALSE);\r | |
537 | }\r | |
538 | \r | |
7f695a7b | 539 | AliDebug(2,"AliAnalysisTaskHFEFlow: AOD ESD");\r |
8c1c76e9 | 540 | \r |
541 | // RP TRACK CUTS:\r | |
542 | fcutsRP = AliFlowTrackCuts::GetStandardTPCStandaloneTrackCuts2010();\r | |
543 | fcutsRP->SetName("StandartTPC");\r | |
544 | fcutsRP->SetEtaRange(-0.9,0.9);\r | |
545 | fcutsRP->SetQA(kTRUE);\r | |
11ff28c5 | 546 | //TList *qaCutsRP = fcutsRP->GetQA();\r |
547 | //qaCutsRP->SetName("QA_StandartTPC_RP");\r | |
8c1c76e9 | 548 | \r |
7f695a7b | 549 | AliDebug(2,"AliAnalysisTaskHFEFlow: cutsRP");\r |
90aa28e9 | 550 | \r |
8c1c76e9 | 551 | //POI TRACK CUTS:\r |
552 | fcutsPOI = new AliFlowTrackCuts("dummy");\r | |
553 | fcutsPOI->SetParamType(AliFlowTrackCuts::kGlobal);\r | |
554 | fcutsPOI->SetPtRange(+1,-1); // select nothing QUICK\r | |
555 | fcutsPOI->SetEtaRange(+1,-1); // select nothing VZERO\r | |
556 | \r | |
7f695a7b | 557 | if( fflowEvent ){ \r |
558 | fflowEvent->~AliFlowEvent();\r | |
559 | new(fflowEvent) AliFlowEvent(fcutsRP,fcutsPOI);\r | |
560 | }\r | |
561 | else fflowEvent = new AliFlowEvent(fcutsRP,fcutsPOI);\r | |
562 | \r | |
563 | AliDebug(2,"AliAnalysisTaskHFEFlow: cutsPOI");\r | |
90aa28e9 | 564 | \r |
8c1c76e9 | 565 | // Flow\r |
566 | AliFlowCommonConstants* cc = AliFlowCommonConstants::GetMaster();\r | |
567 | cc->SetNbinsMult(10000);\r | |
568 | cc->SetMultMin(0);\r | |
569 | cc->SetMultMax(10000.);\r | |
570 | cc->SetNbinsPt(fNbBinsPtQCumulant);\r | |
571 | cc->SetPtMin(fMinPtQCumulant);\r | |
572 | cc->SetPtMax(fMaxPtQCumulant);\r | |
573 | cc->SetNbinsPhi(180);\r | |
574 | cc->SetPhiMin(0.0);\r | |
575 | cc->SetPhiMax(TMath::TwoPi());\r | |
576 | cc->SetNbinsEta(200);\r | |
577 | cc->SetEtaMin(-0.9);\r | |
578 | cc->SetEtaMax(+0.9);\r | |
579 | cc->SetNbinsQ(500);\r | |
580 | cc->SetQMin(0.0);\r | |
581 | cc->SetQMax(3.0);\r | |
582 | \r | |
7f695a7b | 583 | AliDebug(2,"AliAnalysisTaskHFEFlow: common constants");\r |
90aa28e9 | 584 | \r |
8c1c76e9 | 585 | \r |
586 | // HFE cuts\r | |
587 | \r | |
588 | if(!fHFECuts){\r | |
589 | fHFECuts = new AliHFEcuts;\r | |
590 | fHFECuts->CreateStandardCuts();\r | |
591 | }\r | |
592 | fHFECuts->Initialize();\r | |
11ff28c5 | 593 | if(fAODAnalysis) fHFECuts->SetAOD(); \r |
594 | \r | |
7f695a7b | 595 | AliDebug(2,"AliAnalysisTaskHFEFlow: HFE cuts");\r |
90aa28e9 | 596 | \r |
597 | \r | |
8c1c76e9 | 598 | // PID HFE\r |
599 | //fPID->SetHasMCData(HasMCData());\r | |
7f695a7b | 600 | if(!fPID) {\r |
601 | fPID =new AliHFEpid("hfePid");\r | |
602 | AliDebug(2,"AliAnalysisTaskHFEFlow: pid init 0");\r | |
603 | }\r | |
604 | AliDebug(2,"AliAnalysisTaskHFEFlow: pid init 1");\r | |
8c1c76e9 | 605 | if(!fPID->GetNumberOfPIDdetectors()) fPID->AddDetector("TPC", 0);\r |
7f695a7b | 606 | AliDebug(2,Form("AliAnalysisTaskHFEFlow: GetNumber of PID detectors %d",fPID->GetNumberOfPIDdetectors()));\r |
8c1c76e9 | 607 | fPID->InitializePID();\r |
7f695a7b | 608 | AliDebug(2,"Init ");\r |
8c1c76e9 | 609 | fPIDqa->Initialize(fPID);\r |
7f695a7b | 610 | AliDebug(2,"Init qa");\r |
8c1c76e9 | 611 | fPID->SortDetectors();\r |
7f695a7b | 612 | AliDebug(2,"Sort detectors");\r |
0e30407a | 613 | \r |
7f695a7b | 614 | AliDebug(2,"AliAnalysisTaskHFEFlow: pid and pidqa");\r |
90aa28e9 | 615 | \r |
5cd679b7 | 616 | if(!fPIDTOFOnly->GetNumberOfPIDdetectors()) fPIDTOFOnly->AddDetector("TPC", 0);\r |
617 | fPIDTOFOnly->InitializePID();\r | |
618 | fPIDTOFOnly->SortDetectors();\r | |
619 | \r | |
7f695a7b | 620 | AliDebug(2,"AliAnalysisTaskHFEFlow: pidtof");\r |
90aa28e9 | 621 | \r |
0e30407a | 622 | // HFE Background cuts\r |
623 | \r | |
624 | if(!fHFEBackgroundCuts){\r | |
625 | fHFEBackgroundCuts = new AliESDtrackCuts();\r | |
626 | fHFEBackgroundCuts->SetName("nackgroundcuts");\r | |
627 | //Configure Default Track Cuts\r | |
628 | fHFEBackgroundCuts->SetAcceptKinkDaughters(kFALSE);\r | |
629 | fHFEBackgroundCuts->SetRequireTPCRefit(kTRUE);\r | |
630 | fHFEBackgroundCuts->SetEtaRange(-0.9,0.9);\r | |
631 | fHFEBackgroundCuts->SetRequireSigmaToVertex(kTRUE);\r | |
632 | fHFEBackgroundCuts->SetMaxChi2PerClusterTPC(4.0);\r | |
633 | fHFEBackgroundCuts->SetMinNClustersTPC(50);\r | |
634 | fHFEBackgroundCuts->SetPtRange(0.3,1e10);\r | |
635 | }\r | |
8c1c76e9 | 636 | \r |
7f695a7b | 637 | AliDebug(2,"AliAnalysisTaskHFEFlow: hfe background");\r |
90aa28e9 | 638 | \r |
0e30407a | 639 | // PID background HFE\r |
640 | if(!fPIDBackground->GetNumberOfPIDdetectors()) fPIDBackground->AddDetector("TPC", 0);\r | |
641 | fPIDBackground->InitializePID();\r | |
642 | fPIDBackgroundqa->Initialize(fPIDBackground);\r | |
643 | fPIDBackground->SortDetectors();\r | |
90aa28e9 | 644 | \r |
7f695a7b | 645 | AliDebug(2,"AliAnalysisTaskHFEFlow: pid background");\r |
0e30407a | 646 | \r |
647 | \r | |
648 | \r | |
8c1c76e9 | 649 | //**************************\r |
650 | // Bins for the THnSparse\r | |
651 | //**************************\r | |
652 | \r | |
5cd679b7 | 653 | /*\r |
11ff28c5 | 654 | Int_t nBinsPt = 44;\r |
655 | Double_t minPt = 0.1;\r | |
656 | Double_t maxPt = 20.0;\r | |
8c1c76e9 | 657 | Double_t binLimLogPt[nBinsPt+1];\r |
658 | Double_t binLimPt[nBinsPt+1];\r | |
659 | for(Int_t i=0; i<=nBinsPt; i++) binLimLogPt[i]=(Double_t)TMath::Log10(minPt) + (TMath::Log10(maxPt)-TMath::Log10(minPt))/nBinsPt*(Double_t)i ;\r | |
660 | for(Int_t i=0; i<=nBinsPt; i++) binLimPt[i]=(Double_t)TMath::Power(10,binLimLogPt[i]);\r | |
5cd679b7 | 661 | */\r |
662 | \r | |
227a9fc4 | 663 | Int_t nBinsPt = 20;\r |
664 | Double_t binLimPt[21] = {0., 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1., 1.1, 1.2,\r | |
665 | 1.3, 1.4, 1.5, 2., 2.5, 3., 4., 6.};\r | |
5cd679b7 | 666 | \r |
8c1c76e9 | 667 | \r |
11ff28c5 | 668 | Int_t nBinsPtPlus = fNbBinsPtQCumulant;\r |
669 | Double_t minPtPlus = fMinPtQCumulant;\r | |
670 | Double_t maxPtPlus = fMaxPtQCumulant;\r | |
e17c1f86 | 671 | Double_t binLimPtPlus[nBinsPtPlus+1];\r |
672 | for(Int_t i=0; i<=nBinsPtPlus; i++) binLimPtPlus[i]=(Double_t)minPtPlus + (maxPtPlus-minPtPlus)/nBinsPtPlus*(Double_t)i ;\r | |
673 | \r | |
8c1c76e9 | 674 | Int_t nBinsEta = 8;\r |
675 | Double_t minEta = -0.8;\r | |
676 | Double_t maxEta = 0.8;\r | |
677 | Double_t binLimEta[nBinsEta+1];\r | |
678 | for(Int_t i=0; i<=nBinsEta; i++) binLimEta[i]=(Double_t)minEta + (maxEta-minEta)/nBinsEta*(Double_t)i ;\r | |
11ff28c5 | 679 | \r |
4317a065 | 680 | Int_t nBinsStep = 7;\r |
0e30407a | 681 | Double_t minStep = 0.;\r |
4317a065 | 682 | Double_t maxStep = 7.;\r |
0e30407a | 683 | Double_t binLimStep[nBinsStep+1];\r |
684 | for(Int_t i=0; i<=nBinsStep; i++) binLimStep[i]=(Double_t)minStep + (maxStep-minStep)/nBinsStep*(Double_t)i ;\r | |
685 | \r | |
11ff28c5 | 686 | Int_t nBinsEtaLess = 2;\r |
687 | Double_t binLimEtaLess[nBinsEtaLess+1];\r | |
688 | for(Int_t i=0; i<=nBinsEtaLess; i++) binLimEtaLess[i]=(Double_t)minEta + (maxEta-minEta)/nBinsEtaLess*(Double_t)i ;\r | |
8c1c76e9 | 689 | \r |
690 | Int_t nBinsCos = 50;\r | |
691 | Double_t minCos = -1.0;\r | |
692 | Double_t maxCos = 1.0;\r | |
693 | Double_t binLimCos[nBinsCos+1];\r | |
694 | for(Int_t i=0; i<=nBinsCos; i++) binLimCos[i]=(Double_t)minCos + (maxCos-minCos)/nBinsCos*(Double_t)i ;\r | |
695 | \r | |
8c1c76e9 | 696 | Int_t nBinsC = 11;\r |
697 | Double_t minC = 0.0;\r | |
698 | Double_t maxC = 11.0;\r | |
699 | Double_t binLimC[nBinsC+1];\r | |
700 | for(Int_t i=0; i<=nBinsC; i++) binLimC[i]=(Double_t)minC + (maxC-minC)/nBinsC*(Double_t)i ;\r | |
e17c1f86 | 701 | \r |
702 | Int_t nBinsCMore = 20;\r | |
703 | Double_t minCMore = 0.0;\r | |
704 | Double_t maxCMore = 20.0;\r | |
705 | Double_t binLimCMore[nBinsCMore+1];\r | |
706 | for(Int_t i=0; i<=nBinsCMore; i++) binLimCMore[i]=(Double_t)minCMore + (maxCMore-minCMore)/nBinsCMore*(Double_t)i ;\r | |
707 | \r | |
7b5936fc | 708 | Int_t nBinsPhi = 8;\r |
8c1c76e9 | 709 | Double_t minPhi = 0.0;\r |
710 | Double_t maxPhi = TMath::Pi();\r | |
711 | Double_t binLimPhi[nBinsPhi+1];\r | |
712 | for(Int_t i=0; i<=nBinsPhi; i++) {\r | |
713 | binLimPhi[i]=(Double_t)minPhi + (maxPhi-minPhi)/nBinsPhi*(Double_t)i ;\r | |
7f695a7b | 714 | AliDebug(2,Form("bin phi is %f for %d",binLimPhi[i],i));\r |
8c1c76e9 | 715 | }\r |
11ff28c5 | 716 | \r |
5cd679b7 | 717 | Int_t nBinsPhiLess = 2.0;\r |
718 | Double_t minPhiLess = 0.0;\r | |
719 | Double_t maxPhiLess = 2.0;\r | |
720 | Double_t binLimPhiLess[nBinsPhiLess+1];\r | |
721 | for(Int_t i=0; i<=nBinsPhiLess; i++) {\r | |
722 | binLimPhiLess[i]=(Double_t)minPhiLess + (maxPhiLess-minPhiLess)/nBinsPhiLess*(Double_t)i ;\r | |
723 | }\r | |
724 | \r | |
725 | Int_t nBinsTPCdEdx = 140;\r | |
726 | Double_t minTPCdEdx = -12.0;\r | |
727 | Double_t maxTPCdEdx = 12.0;\r | |
728 | Double_t binLimTPCdEdx[nBinsTPCdEdx+1];\r | |
729 | for(Int_t i=0; i<=nBinsTPCdEdx; i++) {\r | |
730 | binLimTPCdEdx[i]=(Double_t)minTPCdEdx + (maxTPCdEdx-minTPCdEdx)/nBinsTPCdEdx*(Double_t)i ;\r | |
731 | }\r | |
732 | \r | |
0e30407a | 733 | Int_t nBinsAngle = 40;\r |
734 | Double_t minAngle = 0.0;\r | |
735 | Double_t maxAngle = 1.0;\r | |
736 | Double_t binLimAngle[nBinsAngle+1];\r | |
737 | for(Int_t i=0; i<=nBinsAngle; i++) {\r | |
738 | binLimAngle[i]=(Double_t)minAngle + (maxAngle-minAngle)/nBinsAngle*(Double_t)i ;\r | |
7f695a7b | 739 | AliDebug(2,Form("bin phi is %f for %d",binLimPhi[i],i));\r |
0e30407a | 740 | }\r |
741 | \r | |
11ff28c5 | 742 | Int_t nBinsCharge = 2;\r |
743 | Double_t minCharge = -1.0;\r | |
744 | Double_t maxCharge = 1.0;\r | |
745 | Double_t binLimCharge[nBinsCharge+1];\r | |
746 | for(Int_t i=0; i<=nBinsCharge; i++) binLimCharge[i]=(Double_t)minCharge + (maxCharge-minCharge)/nBinsCharge*(Double_t)i ;\r | |
0e30407a | 747 | \r |
7b4c9210 | 748 | Int_t nBinsSource = 10;\r |
0e30407a | 749 | Double_t minSource = 0.;\r |
7b4c9210 | 750 | Double_t maxSource = 10.;\r |
0e30407a | 751 | Double_t binLimSource[nBinsSource+1];\r |
752 | for(Int_t i=0; i<=nBinsSource; i++) binLimSource[i]=(Double_t)minSource + (maxSource-minSource)/nBinsSource*(Double_t)i ;\r | |
753 | \r | |
754 | Int_t nBinsInvMass = 50;\r | |
755 | Double_t minInvMass = 0.;\r | |
756 | Double_t maxInvMass = 0.3;\r | |
757 | Double_t binLimInvMass[nBinsInvMass+1];\r | |
758 | for(Int_t i=0; i<=nBinsInvMass; i++) binLimInvMass[i]=(Double_t)minInvMass + (maxInvMass-minInvMass)/nBinsInvMass*(Double_t)i ;\r | |
90aa28e9 | 759 | \r |
7f695a7b | 760 | AliDebug(2,"AliAnalysisTaskHFEFlow: variables");\r |
8c1c76e9 | 761 | \r |
8c1c76e9 | 762 | //******************\r |
763 | // Histograms\r | |
764 | //******************\r | |
765 | \r | |
766 | fListHist = new TList();\r | |
0e30407a | 767 | fListHist->SetOwner();\r |
8c1c76e9 | 768 | \r |
7f695a7b | 769 | AliDebug(2,"AliAnalysisTaskHFEFlow: list");\r |
90aa28e9 | 770 | \r |
7b5936fc | 771 | // Minimum histos\r |
772 | \r | |
8c1c76e9 | 773 | // Histos\r |
16bbbe1c | 774 | fMultEv = new TH1D("fMultEv", "", 5000, 0, 10000.);\r |
8c1c76e9 | 775 | \r |
7f695a7b | 776 | AliDebug(2,"AliAnalysisTaskHFEFlow: histev");\r |
90aa28e9 | 777 | \r |
8c1c76e9 | 778 | // Event plane as function of phiep, centrality\r |
6733d981 | 779 | const Int_t nDima=4;\r |
780 | Int_t nBina[nDima] = {nBinsPhi,nBinsPhi,nBinsPhi,nBinsC};\r | |
8c1c76e9 | 781 | fEventPlane = new THnSparseF("EventPlane","EventPlane",nDima,nBina);\r |
782 | fEventPlane->SetBinEdges(0,binLimPhi);\r | |
e17c1f86 | 783 | fEventPlane->SetBinEdges(1,binLimPhi);\r |
784 | fEventPlane->SetBinEdges(2,binLimPhi);\r | |
6733d981 | 785 | fEventPlane->SetBinEdges(3,binLimC);\r |
e17c1f86 | 786 | fEventPlane->Sumw2();\r |
e17c1f86 | 787 | \r |
7f695a7b | 788 | AliDebug(2,"AliAnalysisTaskHFEFlow: eventplane");\r |
90aa28e9 | 789 | \r |
6733d981 | 790 | // Fraction of contamination, centrality\r |
791 | const Int_t nDimcont=2;\r | |
792 | Int_t nBincont[nDimcont] = {nBinsPt,nBinsC};\r | |
793 | fFractionContamination = new THnSparseF("Contamination","Contamination",nDimcont,nBincont);\r | |
794 | fFractionContamination->SetBinEdges(0,binLimPt);\r | |
795 | fFractionContamination->SetBinEdges(1,binLimC);\r | |
796 | fFractionContamination->Sumw2();\r | |
6b2521a4 | 797 | // \r |
798 | fContaminationv2 = new TProfile2D("Contaminationv2","",nBinsC,binLimC,nBinsPt,binLimPt);\r | |
799 | fContaminationv2->Sumw2();\r | |
6733d981 | 800 | \r |
801 | AliDebug(2,"AliAnalysisTaskHFEFlow: fraction of contamination");\r | |
802 | \r | |
e17c1f86 | 803 | // Resolution cosres_abc centrality\r |
804 | const Int_t nDimfbis=4;\r | |
805 | Int_t nBinfbis[nDimfbis] = {nBinsCos,nBinsCos,nBinsCos,nBinsCMore};\r | |
806 | fCosResabc = new THnSparseF("CosRes_abc","CosRes_abc",nDimfbis,nBinfbis);\r | |
807 | fCosResabc->SetBinEdges(0,binLimCos);\r | |
808 | fCosResabc->SetBinEdges(1,binLimCos);\r | |
809 | fCosResabc->SetBinEdges(2,binLimCos);\r | |
810 | fCosResabc->SetBinEdges(3,binLimCMore);\r | |
811 | fCosResabc->Sumw2();\r | |
812 | \r | |
7f695a7b | 813 | AliDebug(2,"AliAnalysisTaskHFEFlow: cosresabc");\r |
90aa28e9 | 814 | \r |
8c1c76e9 | 815 | // Resolution cosres centrality\r |
816 | const Int_t nDimf=2;\r | |
e17c1f86 | 817 | Int_t nBinf[nDimf] = {nBinsCos, nBinsCMore};\r |
8c1c76e9 | 818 | fCosRes = new THnSparseF("CosRes","CosRes",nDimf,nBinf);\r |
819 | fCosRes->SetBinEdges(0,binLimCos);\r | |
e17c1f86 | 820 | fCosRes->SetBinEdges(1,binLimCMore);\r |
821 | fCosRes->Sumw2();\r | |
822 | \r | |
7f695a7b | 823 | AliDebug(2,"AliAnalysisTaskHFEFlow: cosres");\r |
90aa28e9 | 824 | \r |
8c1c76e9 | 825 | // Maps delta phi\r |
11ff28c5 | 826 | const Int_t nDimg=5;\r |
827 | Int_t nBing[nDimg] = {nBinsPhi,nBinsC,nBinsPt, nBinsCharge,nBinsEtaLess};\r | |
8c1c76e9 | 828 | fDeltaPhiMaps = new THnSparseF("DeltaPhiMaps","DeltaPhiMaps",nDimg,nBing);\r |
829 | fDeltaPhiMaps->SetBinEdges(0,binLimPhi);\r | |
830 | fDeltaPhiMaps->SetBinEdges(1,binLimC);\r | |
831 | fDeltaPhiMaps->SetBinEdges(2,binLimPt);\r | |
11ff28c5 | 832 | fDeltaPhiMaps->SetBinEdges(3,binLimCharge);\r |
833 | fDeltaPhiMaps->SetBinEdges(4,binLimEtaLess);\r | |
e17c1f86 | 834 | fDeltaPhiMaps->Sumw2(); \r |
835 | \r | |
7f695a7b | 836 | AliDebug(2,"AliAnalysisTaskHFEFlow: deltaphimaps");\r |
90aa28e9 | 837 | \r |
8c1c76e9 | 838 | // Maps cos phi\r |
11ff28c5 | 839 | const Int_t nDimh=5;\r |
840 | Int_t nBinh[nDimh] = {nBinsCos,nBinsC,nBinsPt,nBinsCharge,nBinsEtaLess};\r | |
8c1c76e9 | 841 | fCosPhiMaps = new THnSparseF("CosPhiMaps","CosPhiMaps",nDimh,nBinh);\r |
842 | fCosPhiMaps->SetBinEdges(0,binLimCos);\r | |
843 | fCosPhiMaps->SetBinEdges(1,binLimC);\r | |
844 | fCosPhiMaps->SetBinEdges(2,binLimPt);\r | |
11ff28c5 | 845 | fCosPhiMaps->SetBinEdges(3,binLimCharge);\r |
846 | fCosPhiMaps->SetBinEdges(4,binLimEtaLess);\r | |
e17c1f86 | 847 | fCosPhiMaps->Sumw2();\r |
848 | \r | |
7f695a7b | 849 | AliDebug(2,"AliAnalysisTaskHFEFlow: cosphimaps");\r |
90aa28e9 | 850 | \r |
7b5936fc | 851 | //\r |
852 | // fMonitorEventPlane\r | |
853 | //\r | |
854 | //\r | |
0e30407a | 855 | \r |
7b5936fc | 856 | if(fMonitorEventPlane) { \r |
857 | // Event Plane after subtraction as function of phiep, centrality, pt, eta\r | |
858 | const Int_t nDimb=2;\r | |
859 | Int_t nBinb[nDimb] = {nBinsPhi, nBinsC};\r | |
860 | fEventPlaneaftersubtraction = new THnSparseF("EventPlane_aftersubtraction","EventPlane_aftersubtraction",nDimb,nBinb);\r | |
861 | fEventPlaneaftersubtraction->SetBinEdges(0,binLimPhi);\r | |
862 | fEventPlaneaftersubtraction->SetBinEdges(1,binLimC);\r | |
863 | fEventPlaneaftersubtraction->Sumw2();\r | |
90aa28e9 | 864 | \r |
7f695a7b | 865 | AliDebug(2,"AliAnalysisTaskHFEFlow: eventplane after sub");\r |
7b5936fc | 866 | \r |
867 | // Monitoring of the event Plane cos(2phi) sin(2phi) centrality\r | |
868 | const Int_t nDimi=3;\r | |
869 | Int_t nBini[nDimi] = {nBinsCos, nBinsCos, nBinsCMore};\r | |
870 | fCosSin2phiep = new THnSparseF("CosSin2phiep","CosSin2phiep",nDimi,nBini);\r | |
871 | fCosSin2phiep->SetBinEdges(0,binLimCos);\r | |
872 | fCosSin2phiep->SetBinEdges(1,binLimCos);\r | |
873 | fCosSin2phiep->SetBinEdges(2,binLimCMore);\r | |
874 | fCosSin2phiep->Sumw2();\r | |
90aa28e9 | 875 | \r |
7f695a7b | 876 | AliDebug(2,"AliAnalysisTaskHFEFlow: cossin2phiep");\r |
7b5936fc | 877 | \r |
878 | // Monitoring Event plane after subtraction of the track\r | |
879 | const Int_t nDime=4;\r | |
880 | Int_t nBine[nDime] = {nBinsCos, nBinsC, nBinsPt, nBinsEta};\r | |
881 | fCos2phie = new THnSparseF("cos2phie","cos2phie",nDime,nBine);\r | |
882 | fCos2phie->SetBinEdges(2,binLimPt);\r | |
883 | fCos2phie->SetBinEdges(3,binLimEta);\r | |
884 | fCos2phie->SetBinEdges(0,binLimCos);\r | |
885 | fCos2phie->SetBinEdges(1,binLimC);\r | |
886 | fCos2phie->Sumw2();\r | |
7f695a7b | 887 | AliDebug(2,"AliAnalysisTaskHFEFlow: cos2phie");\r |
7b5936fc | 888 | fSin2phie = new THnSparseF("sin2phie","sin2phie",nDime,nBine);\r |
889 | fSin2phie->SetBinEdges(2,binLimPt);\r | |
890 | fSin2phie->SetBinEdges(3,binLimEta);\r | |
891 | fSin2phie->SetBinEdges(0,binLimCos);\r | |
892 | fSin2phie->SetBinEdges(1,binLimC);\r | |
893 | fSin2phie->Sumw2();\r | |
7f695a7b | 894 | AliDebug(2,"AliAnalysisTaskHFEFlow: sin2phie");\r |
7b5936fc | 895 | fCos2phiep = new THnSparseF("cos2phiep","cos2phiep",nDime,nBine);\r |
896 | fCos2phiep->SetBinEdges(2,binLimPt);\r | |
897 | fCos2phiep->SetBinEdges(3,binLimEta);\r | |
898 | fCos2phiep->SetBinEdges(0,binLimCos);\r | |
899 | fCos2phiep->SetBinEdges(1,binLimC);\r | |
900 | fCos2phiep->Sumw2();\r | |
7f695a7b | 901 | AliDebug(2,"AliAnalysisTaskHFEFlow: cos2phiep");\r |
7b5936fc | 902 | fSin2phiep = new THnSparseF("sin2phiep","sin2phiep",nDime,nBine);\r |
903 | fSin2phiep->SetBinEdges(2,binLimPt);\r | |
904 | fSin2phiep->SetBinEdges(3,binLimEta);\r | |
905 | fSin2phiep->SetBinEdges(0,binLimCos);\r | |
906 | fSin2phiep->SetBinEdges(1,binLimC);\r | |
907 | fSin2phiep->Sumw2();\r | |
7f695a7b | 908 | AliDebug(2,"AliAnalysisTaskHFEFlow: sin2phiep");\r |
7b5936fc | 909 | fSin2phiephiep = new THnSparseF("sin2phie_phiep","sin2phie_phiep",nDime,nBine);\r |
910 | fSin2phiephiep->SetBinEdges(2,binLimPt);\r | |
911 | fSin2phiephiep->SetBinEdges(3,binLimEta);\r | |
912 | fSin2phiephiep->SetBinEdges(0,binLimCos);\r | |
913 | fSin2phiephiep->SetBinEdges(1,binLimC);\r | |
914 | fSin2phiephiep->Sumw2(); \r | |
7f695a7b | 915 | AliDebug(2,"AliAnalysisTaskHFEFlow: sin2phiephiep");\r |
7b5936fc | 916 | \r |
917 | const Int_t nDimfbiss=4;\r | |
918 | Int_t nBinfbiss[nDimfbiss] = {nBinsCos,nBinsCos,nBinsCos,nBinsC};\r | |
919 | fSinResabc = new THnSparseF("SinRes_abc","SinRes_abc",nDimfbiss,nBinfbiss);\r | |
920 | fSinResabc->SetBinEdges(0,binLimCos);\r | |
921 | fSinResabc->SetBinEdges(1,binLimCos);\r | |
922 | fSinResabc->SetBinEdges(2,binLimCos);\r | |
923 | fSinResabc->SetBinEdges(3,binLimC);\r | |
924 | fSinResabc->Sumw2();\r | |
7f695a7b | 925 | AliDebug(2,"AliAnalysisTaskHFEFlow: sinresabc");\r |
7b5936fc | 926 | \r |
927 | // Profile cosres centrality with 3 subevents\r | |
928 | fProfileCosResab = new TProfile("ProfileCosRes_a_b","ProfileCosRes_a_b",nBinsCMore,binLimCMore);\r | |
929 | fProfileCosResab->Sumw2();\r | |
930 | fProfileCosResac = new TProfile("ProfileCosRes_a_c","ProfileCosRes_a_c",nBinsCMore,binLimCMore);\r | |
931 | fProfileCosResac->Sumw2();\r | |
932 | fProfileCosResbc = new TProfile("ProfileCosRes_b_c","ProfileCosRes_b_c",nBinsCMore,binLimCMore);\r | |
933 | fProfileCosResbc->Sumw2();\r | |
7f695a7b | 934 | AliDebug(2,"AliAnalysisTaskHFEFlow: profilecosresbc");\r |
7b5936fc | 935 | \r |
936 | //\r | |
937 | const Int_t nDimff=2;\r | |
938 | Int_t nBinff[nDimff] = {nBinsCos, nBinsC};\r | |
939 | fSinRes = new THnSparseF("SinRes","SinRes",nDimff,nBinff);\r | |
940 | fSinRes->SetBinEdges(0,binLimCos);\r | |
941 | fSinRes->SetBinEdges(1,binLimC);\r | |
942 | fSinRes->Sumw2();\r | |
7f695a7b | 943 | AliDebug(2,"AliAnalysisTaskHFEFlow: sinres");\r |
7b5936fc | 944 | \r |
945 | // Profile cosres centrality\r | |
946 | fProfileCosRes = new TProfile("ProfileCosRes","ProfileCosRes",nBinsCMore,binLimCMore);\r | |
947 | fProfileCosRes->Sumw2();\r | |
7f695a7b | 948 | AliDebug(2,"AliAnalysisTaskHFEFlow: profilecosres");\r |
7b5936fc | 949 | \r |
950 | // Profile Maps cos phi\r | |
951 | fProfileCosPhiMaps = new TProfile2D("ProfileCosPhiMaps","ProfileCosPhiMaps",nBinsC,binLimC,nBinsPt,binLimPt);\r | |
952 | fProfileCosPhiMaps->Sumw2();\r | |
7f695a7b | 953 | AliDebug(2,"AliAnalysisTaskHFEFlow: profilecosphimaps");\r |
7b5936fc | 954 | \r |
955 | }\r | |
956 | //\r | |
957 | // fMonitorTrackCuts\r | |
958 | //\r | |
959 | \r | |
960 | if(fMonitorTrackCuts) {\r | |
961 | // Debugging tracking steps\r | |
962 | const Int_t nDimTrStep=2;\r | |
963 | Int_t nBinTrStep[nDimTrStep] = {nBinsPt,nBinsStep};\r | |
964 | fTrackingCuts = new THnSparseF("TrackingCuts","TrackingCuts",nDimTrStep,nBinTrStep);\r | |
965 | fTrackingCuts->SetBinEdges(0,binLimPt);\r | |
966 | fTrackingCuts->SetBinEdges(1,binLimStep);\r | |
967 | fTrackingCuts->Sumw2();\r | |
7f695a7b | 968 | AliDebug(2,"AliAnalysisTaskHFEFlow: trackingcuts");\r |
7b5936fc | 969 | }\r |
970 | \r | |
971 | //\r | |
972 | // fMonitorContamination\r | |
973 | //\r | |
974 | \r | |
975 | if(fMonitorContamination) { \r | |
976 | // Maps delta phi contamination\r | |
977 | const Int_t nDimgcont=4;\r | |
978 | Int_t nBingcont[nDimgcont] = {nBinsPhiLess,nBinsC,nBinsPt, nBinsTPCdEdx};\r | |
979 | fDeltaPhiMapsContamination = new THnSparseF("DeltaPhiMapsContamination","DeltaPhiMapsContamination",nDimgcont,nBingcont);\r | |
980 | fDeltaPhiMapsContamination->SetBinEdges(0,binLimPhiLess);\r | |
981 | fDeltaPhiMapsContamination->SetBinEdges(1,binLimC);\r | |
982 | fDeltaPhiMapsContamination->SetBinEdges(2,binLimPt);\r | |
983 | fDeltaPhiMapsContamination->SetBinEdges(3,binLimTPCdEdx);\r | |
984 | fDeltaPhiMapsContamination->Sumw2(); \r | |
7f695a7b | 985 | AliDebug(2,"AliAnalysisTaskHFEFlow: deltaphimapscontamination");\r |
6b2521a4 | 986 | \r |
7b5936fc | 987 | }\r |
988 | //\r | |
989 | // fMonitorWithoutPID\r | |
990 | //\r | |
991 | \r | |
992 | if(fMonitorWithoutPID) {\r | |
993 | //\r | |
994 | const Int_t nDimgb=3;\r | |
995 | Int_t nBingb[nDimgb] = {nBinsPhi,nBinsC,nBinsPt};\r | |
996 | \r | |
997 | fDeltaPhiMapsBeforePID = new THnSparseF("DeltaPhiMapsBeforePID","DeltaPhiMapsBeforePID",nDimgb,nBingb);\r | |
998 | fDeltaPhiMapsBeforePID->SetBinEdges(0,binLimPhi);\r | |
999 | fDeltaPhiMapsBeforePID->SetBinEdges(1,binLimC);\r | |
1000 | fDeltaPhiMapsBeforePID->SetBinEdges(2,binLimPt);\r | |
1001 | fDeltaPhiMapsBeforePID->Sumw2(); \r | |
7f695a7b | 1002 | AliDebug(2,"AliAnalysisTaskHFEFlow: deltaphimapsbeforepid");\r |
7b5936fc | 1003 | \r |
1004 | const Int_t nDimhb=3;\r | |
1005 | Int_t nBinhb[nDimhb] = {nBinsCos,nBinsC,nBinsPt};\r | |
1006 | \r | |
1007 | fCosPhiMapsBeforePID = new THnSparseF("CosPhiMapsBeforePID","CosPhiMapsBeforePID",nDimhb,nBinhb);\r | |
1008 | fCosPhiMapsBeforePID->SetBinEdges(0,binLimCos);\r | |
1009 | fCosPhiMapsBeforePID->SetBinEdges(1,binLimC);\r | |
1010 | fCosPhiMapsBeforePID->SetBinEdges(2,binLimPt);\r | |
1011 | fCosPhiMapsBeforePID->Sumw2();\r | |
7f695a7b | 1012 | AliDebug(2,"AliAnalysisTaskHFEFlow: cosphimapsbeforepid");\r |
7b5936fc | 1013 | }\r |
1014 | //\r | |
1015 | // fMonitorPhotonic\r | |
1016 | //\r | |
1017 | \r | |
1018 | if(fMonitorPhotonic) {\r | |
6733d981 | 1019 | /*\r |
7b5936fc | 1020 | const Int_t nDimgbp=3;\r |
1021 | Int_t nBingbp[nDimgbp] = {nBinsPhi,nBinsC,nBinsPt};\r | |
1022 | \r | |
1023 | fDeltaPhiMapsTaggedPhotonic = new THnSparseF("DeltaPhiMapsTaggedPhotonic","DeltaPhiMapsTaggedPhotonic",nDimgbp,nBingbp);\r | |
1024 | fDeltaPhiMapsTaggedPhotonic->SetBinEdges(0,binLimPhi);\r | |
1025 | fDeltaPhiMapsTaggedPhotonic->SetBinEdges(1,binLimC);\r | |
1026 | fDeltaPhiMapsTaggedPhotonic->SetBinEdges(2,binLimPt);\r | |
1027 | fDeltaPhiMapsTaggedPhotonic->Sumw2(); \r | |
7f695a7b | 1028 | AliDebug(2,"AliAnalysisTaskHFEFlow: deltaphimapstaggedphotonic");\r |
7b5936fc | 1029 | \r |
1030 | fDeltaPhiMapsTaggedNonPhotonic = new THnSparseF("DeltaPhiMapsTaggedNonPhotonic","DeltaPhiMapsTaggedNonPhotonic",nDimgbp,nBingbp);\r | |
1031 | fDeltaPhiMapsTaggedNonPhotonic->SetBinEdges(0,binLimPhi);\r | |
1032 | fDeltaPhiMapsTaggedNonPhotonic->SetBinEdges(1,binLimC);\r | |
1033 | fDeltaPhiMapsTaggedNonPhotonic->SetBinEdges(2,binLimPt);\r | |
1034 | fDeltaPhiMapsTaggedNonPhotonic->Sumw2(); \r | |
7f695a7b | 1035 | AliDebug(2,"AliAnalysisTaskHFEFlow: deltaphimapstaggednonphotonic");\r |
7b5936fc | 1036 | \r |
1037 | fDeltaPhiMapsTaggedPhotonicLS = new THnSparseF("DeltaPhiMapsTaggedPhotonicLS","DeltaPhiMapsTaggedPhotonicLS",nDimgbp,nBingbp);\r | |
1038 | fDeltaPhiMapsTaggedPhotonicLS->SetBinEdges(0,binLimPhi);\r | |
1039 | fDeltaPhiMapsTaggedPhotonicLS->SetBinEdges(1,binLimC);\r | |
1040 | fDeltaPhiMapsTaggedPhotonicLS->SetBinEdges(2,binLimPt);\r | |
1041 | fDeltaPhiMapsTaggedPhotonicLS->Sumw2(); \r | |
7f695a7b | 1042 | AliDebug(2,"AliAnalysisTaskHFEFlow: deltaphimapstaggedphotonicls"); \r |
90aa28e9 | 1043 | \r |
7b5936fc | 1044 | const Int_t nDimhbp=3;\r |
1045 | Int_t nBinhbp[nDimhbp] = {nBinsCos,nBinsC,nBinsPt};\r | |
1046 | \r | |
1047 | fCosPhiMapsTaggedPhotonic = new THnSparseF("CosPhiMapsTaggedPhotonic","CosPhiMapsTaggedPhotonic",nDimhbp,nBinhbp);\r | |
1048 | fCosPhiMapsTaggedPhotonic->SetBinEdges(0,binLimCos);\r | |
1049 | fCosPhiMapsTaggedPhotonic->SetBinEdges(1,binLimC);\r | |
1050 | fCosPhiMapsTaggedPhotonic->SetBinEdges(2,binLimPt);\r | |
1051 | fCosPhiMapsTaggedPhotonic->Sumw2();\r | |
7f695a7b | 1052 | AliDebug(2,"AliAnalysisTaskHFEFlow: cosphimapstaggedphotonic");\r |
7b5936fc | 1053 | \r |
1054 | fCosPhiMapsTaggedNonPhotonic = new THnSparseF("CosPhiMapsTaggedNonPhotonic","CosPhiMapsTaggedNonPhotonic",nDimhbp,nBinhbp);\r | |
1055 | fCosPhiMapsTaggedNonPhotonic->SetBinEdges(0,binLimCos);\r | |
1056 | fCosPhiMapsTaggedNonPhotonic->SetBinEdges(1,binLimC);\r | |
1057 | fCosPhiMapsTaggedNonPhotonic->SetBinEdges(2,binLimPt);\r | |
1058 | fCosPhiMapsTaggedNonPhotonic->Sumw2();\r | |
7f695a7b | 1059 | AliDebug(2,"AliAnalysisTaskHFEFlow: cosphimapstaggednonphotonic");\r |
7b5936fc | 1060 | \r |
1061 | fCosPhiMapsTaggedPhotonicLS = new THnSparseF("CosPhiMapsTaggedPhotonicLS","CosPhiMapsTaggedPhotonicLS",nDimhbp,nBinhbp);\r | |
1062 | fCosPhiMapsTaggedPhotonicLS->SetBinEdges(0,binLimCos);\r | |
1063 | fCosPhiMapsTaggedPhotonicLS->SetBinEdges(1,binLimC);\r | |
1064 | fCosPhiMapsTaggedPhotonicLS->SetBinEdges(2,binLimPt);\r | |
1065 | fCosPhiMapsTaggedPhotonicLS->Sumw2();\r | |
7f695a7b | 1066 | AliDebug(2,"AliAnalysisTaskHFEFlow: cosphimapstaggedphotonicls");\r |
6733d981 | 1067 | */\r |
7b5936fc | 1068 | const Int_t nDimMCSource=3;\r |
1069 | Int_t nBinMCSource[nDimMCSource] = {nBinsC,nBinsPt,nBinsSource};\r | |
1070 | fMCSourceDeltaPhiMaps = new THnSparseF("MCSourceDeltaPhiMaps","MCSourceDeltaPhiMaps",nDimMCSource,nBinMCSource);\r | |
1071 | fMCSourceDeltaPhiMaps->SetBinEdges(0,binLimC);\r | |
1072 | fMCSourceDeltaPhiMaps->SetBinEdges(1,binLimPt);\r | |
1073 | fMCSourceDeltaPhiMaps->SetBinEdges(2,binLimSource);\r | |
1074 | fMCSourceDeltaPhiMaps->Sumw2();\r | |
7f695a7b | 1075 | AliDebug(2,"AliAnalysisTaskHFEFlow: mcsourcedeltaphimaps");\r |
7b5936fc | 1076 | \r |
1077 | // Maps invmass opposite\r | |
1078 | const Int_t nDimOppSign=5;\r | |
1079 | Int_t nBinOppSign[nDimOppSign] = {nBinsPhi,nBinsC,nBinsPt,nBinsInvMass,nBinsSource};\r | |
1080 | fOppSignDeltaPhiMaps = new THnSparseF("OppSignDeltaPhiMaps","OppSignDeltaPhiMaps",nDimOppSign,nBinOppSign);\r | |
1081 | fOppSignDeltaPhiMaps->SetBinEdges(0,binLimPhi);\r | |
1082 | fOppSignDeltaPhiMaps->SetBinEdges(1,binLimC);\r | |
1083 | fOppSignDeltaPhiMaps->SetBinEdges(2,binLimPt);\r | |
1084 | fOppSignDeltaPhiMaps->SetBinEdges(3,binLimInvMass);\r | |
1085 | fOppSignDeltaPhiMaps->SetBinEdges(4,binLimSource);\r | |
1086 | fOppSignDeltaPhiMaps->Sumw2();\r | |
7f695a7b | 1087 | AliDebug(2,"AliAnalysisTaskHFEFlow: oppsigndeltaphimaps");\r |
7b5936fc | 1088 | \r |
1089 | // Maps invmass same sign\r | |
1090 | const Int_t nDimSameSign=5;\r | |
1091 | Int_t nBinSameSign[nDimSameSign] = {nBinsPhi,nBinsC,nBinsPt,nBinsInvMass,nBinsSource};\r | |
1092 | fSameSignDeltaPhiMaps = new THnSparseF("SameSignDeltaPhiMaps","SameSignDeltaPhiMaps",nDimSameSign,nBinSameSign);\r | |
1093 | fSameSignDeltaPhiMaps->SetBinEdges(0,binLimPhi);\r | |
1094 | fSameSignDeltaPhiMaps->SetBinEdges(1,binLimC);\r | |
1095 | fSameSignDeltaPhiMaps->SetBinEdges(2,binLimPt);\r | |
1096 | fSameSignDeltaPhiMaps->SetBinEdges(3,binLimInvMass);\r | |
1097 | fSameSignDeltaPhiMaps->SetBinEdges(4,binLimSource);\r | |
1098 | fSameSignDeltaPhiMaps->Sumw2();\r | |
7f695a7b | 1099 | AliDebug(2,"AliAnalysisTaskHFEFlow: samesigndeltaphimaps");\r |
7b5936fc | 1100 | \r |
1101 | // Maps angle same sign\r | |
1102 | const Int_t nDimAngleSameSign=3;\r | |
1103 | Int_t nBinAngleSameSign[nDimAngleSameSign] = {nBinsAngle,nBinsC,nBinsSource};\r | |
1104 | fSameSignAngle = new THnSparseF("SameSignAngleMaps","SameSignAngleMaps",nDimAngleSameSign,nBinAngleSameSign);\r | |
1105 | fSameSignAngle->SetBinEdges(0,binLimAngle);\r | |
1106 | fSameSignAngle->SetBinEdges(1,binLimC);\r | |
1107 | fSameSignAngle->SetBinEdges(2,binLimSource);\r | |
1108 | fSameSignAngle->Sumw2();\r | |
7f695a7b | 1109 | AliDebug(2,"AliAnalysisTaskHFEFlow: samesignangle");\r |
7b5936fc | 1110 | \r |
1111 | // Maps angle opp sign\r | |
1112 | const Int_t nDimAngleOppSign=3;\r | |
1113 | Int_t nBinAngleOppSign[nDimAngleOppSign] = {nBinsAngle,nBinsC,nBinsSource};\r | |
1114 | fOppSignAngle = new THnSparseF("OppSignAngleMaps","OppSignAngleMaps",nDimAngleOppSign,nBinAngleOppSign);\r | |
1115 | fOppSignAngle->SetBinEdges(0,binLimAngle);\r | |
1116 | fOppSignAngle->SetBinEdges(1,binLimC);\r | |
1117 | fOppSignAngle->SetBinEdges(2,binLimSource);\r | |
1118 | fOppSignAngle->Sumw2();\r | |
7f695a7b | 1119 | AliDebug(2,"AliAnalysisTaskHFEFlow: oppsignangle");\r |
90aa28e9 | 1120 | \r |
7b5936fc | 1121 | }\r |
e17c1f86 | 1122 | \r |
8c1c76e9 | 1123 | //**************************\r |
1124 | // Add to the list\r | |
1125 | //******************************\r | |
1126 | \r | |
16bbbe1c | 1127 | fListHist->Add(fMultEv);\r |
8c1c76e9 | 1128 | fListHist->Add(fEventPlane);\r |
6733d981 | 1129 | fListHist->Add(fFractionContamination);\r |
8c1c76e9 | 1130 | fListHist->Add(fCosRes);\r |
e17c1f86 | 1131 | fListHist->Add(fCosResabc);\r |
8c1c76e9 | 1132 | fListHist->Add(fCosPhiMaps);\r |
7b5936fc | 1133 | fListHist->Add(fDeltaPhiMaps);\r |
1134 | fListHist->Add(fPIDqa->MakeList("HFEpidQA"));\r | |
6b2521a4 | 1135 | fListHist->Add(fContaminationv2);\r |
7f695a7b | 1136 | AliDebug(2,"AliAnalysisTaskHFEFlow: add default");\r |
7b5936fc | 1137 | \r |
1138 | if(fMonitorEventPlane) {\r | |
1139 | fListHist->Add(fProfileCosRes);\r | |
1140 | fListHist->Add(fProfileCosResab);\r | |
1141 | fListHist->Add(fProfileCosResac);\r | |
1142 | fListHist->Add(fProfileCosResbc);\r | |
1143 | fListHist->Add(fCosSin2phiep);\r | |
1144 | fListHist->Add(fCos2phie);\r | |
1145 | fListHist->Add(fSin2phie);\r | |
1146 | fListHist->Add(fCos2phiep);\r | |
1147 | fListHist->Add(fSin2phiep);\r | |
1148 | fListHist->Add(fSin2phiephiep);\r | |
1149 | fListHist->Add(fSinRes);\r | |
1150 | fListHist->Add(fSinResabc);\r | |
1151 | fListHist->Add(fProfileCosPhiMaps);\r | |
1152 | }\r | |
7f695a7b | 1153 | AliDebug(2,"AliAnalysisTaskHFEFlow: add monitor");\r |
7b5936fc | 1154 | \r |
1155 | if(fMonitorTrackCuts) fListHist->Add(fTrackingCuts);\r | |
1156 | \r | |
7f695a7b | 1157 | AliDebug(2,"AliAnalysisTaskHFEFlow: add monitortrackcuts");\r |
90aa28e9 | 1158 | \r |
6b2521a4 | 1159 | if(fMonitorContamination) {\r |
1160 | fListHist->Add(fDeltaPhiMapsContamination);\r | |
1161 | }\r | |
7b5936fc | 1162 | \r |
7f695a7b | 1163 | AliDebug(2,"AliAnalysisTaskHFEFlow: add deltaphimapscontamination");\r |
90aa28e9 | 1164 | \r |
7b5936fc | 1165 | if(fMonitorWithoutPID) {\r |
1166 | fListHist->Add(fDeltaPhiMapsBeforePID);\r | |
1167 | fListHist->Add(fCosPhiMapsBeforePID);\r | |
1168 | }\r | |
1169 | \r | |
7f695a7b | 1170 | AliDebug(2,"AliAnalysisTaskHFEFlow: add without pid");\r |
90aa28e9 | 1171 | \r |
7b5936fc | 1172 | if(fMonitorPhotonic) {\r |
1173 | fListHist->Add(fPIDBackgroundqa->MakeList("HFEpidBackgroundQA"));\r | |
6733d981 | 1174 | //fListHist->Add(fDeltaPhiMapsTaggedPhotonic);\r |
1175 | //fListHist->Add(fCosPhiMapsTaggedPhotonic);\r | |
1176 | //fListHist->Add(fDeltaPhiMapsTaggedNonPhotonic);\r | |
1177 | //fListHist->Add(fCosPhiMapsTaggedNonPhotonic);\r | |
1178 | //fListHist->Add(fDeltaPhiMapsTaggedPhotonicLS);\r | |
1179 | //fListHist->Add(fCosPhiMapsTaggedPhotonicLS);\r | |
0e30407a | 1180 | fListHist->Add(fMCSourceDeltaPhiMaps);\r |
1181 | fListHist->Add(fOppSignDeltaPhiMaps);\r | |
1182 | fListHist->Add(fSameSignDeltaPhiMaps);\r | |
1183 | fListHist->Add(fSameSignAngle);\r | |
1184 | fListHist->Add(fOppSignAngle);\r | |
7b5936fc | 1185 | }\r |
0e30407a | 1186 | \r |
7f695a7b | 1187 | AliDebug(2,"AliAnalysisTaskHFEFlow: add photonic");\r |
90aa28e9 | 1188 | \r |
7b5936fc | 1189 | if(fHFEVZEROEventPlane && fMonitorEventPlane) fListHist->Add(fHFEVZEROEventPlane->GetOutputList());\r |
8c1c76e9 | 1190 | \r |
7f695a7b | 1191 | AliDebug(2,"AliAnalysisTaskHFEFlow: add event plane");\r |
8c1c76e9 | 1192 | \r |
1193 | PostData(1, fListHist);\r | |
7f695a7b | 1194 | //for(Int_t bincless = 0; bincless < fNbBinsCentralityQCumulant; bincless++) {\r |
1195 | // PostData(bincless+2,fflowEvent); \r | |
1196 | //}\r | |
8c1c76e9 | 1197 | \r |
7f695a7b | 1198 | AliDebug(2,"AliAnalysisTaskHFEFlow: post");\r |
90aa28e9 | 1199 | \r |
8c1c76e9 | 1200 | \r |
1201 | }\r | |
1202 | \r | |
1203 | //________________________________________________________________________\r | |
1204 | void AliAnalysisTaskHFEFlow::UserExec(Option_t */*option*/)\r | |
1205 | {\r | |
1206 | //\r | |
1207 | // Loop over event\r | |
1208 | //\r | |
1209 | \r | |
1210 | Double_t massElectron = 0.000511;\r | |
1211 | Double_t mcReactionPlane = 0.0;\r | |
e17c1f86 | 1212 | Bool_t eventplanedefined = kTRUE;\r |
8c1c76e9 | 1213 | \r |
1214 | Float_t cntr = 0.0;\r | |
1215 | Double_t binct = 11.5;\r | |
e17c1f86 | 1216 | Double_t binctMore = 20.5;\r |
1217 | Double_t binctLess = -0.5;\r | |
8c1c76e9 | 1218 | Float_t binctt = -1.0;\r |
1219 | \r | |
e17c1f86 | 1220 | Double_t valuecossinephiep[3];\r |
6733d981 | 1221 | Double_t valuensparsea[4];\r |
e17c1f86 | 1222 | Double_t valuensparseabis[5];\r |
8c1c76e9 | 1223 | Double_t valuensparsee[4];\r |
1224 | Double_t valuensparsef[2];\r | |
a8ef1999 | 1225 | Double_t valuensparsefsin[2];\r |
e17c1f86 | 1226 | Double_t valuensparsefbis[4];\r |
a8ef1999 | 1227 | Double_t valuensparsefbissin[4];\r |
11ff28c5 | 1228 | Double_t valuensparseg[5];\r |
1229 | Double_t valuensparseh[5];\r | |
e17c1f86 | 1230 | Double_t valuensparsehprofile[3];\r |
0e30407a | 1231 | Double_t valuensparseMCSourceDeltaPhiMaps[3];\r |
1232 | Double_t valuetrackingcuts[2];\r | |
5cd679b7 | 1233 | Double_t valuedeltaphicontamination[4];\r |
6733d981 | 1234 | Double_t valuefractioncont[2];\r |
0e30407a | 1235 | \r |
8c1c76e9 | 1236 | AliMCEvent *mcEvent = MCEvent();\r |
1237 | AliMCParticle *mctrack = NULL;\r | |
0e30407a | 1238 | \r |
8c1c76e9 | 1239 | /////////////////\r |
1240 | // centrality\r | |
1241 | /////////////////\r | |
1242 | \r | |
11ff28c5 | 1243 | //AliESDEvent *esd = dynamic_cast<AliESDEvent*>(InputEvent());\r |
1244 | //if(!esd) return;\r | |
1245 | AliCentrality *centrality = fInputEvent->GetCentrality();\r | |
7f695a7b | 1246 | //AliDebug(2,"Got the centrality");\r |
8c1c76e9 | 1247 | if(!centrality) return;\r |
1248 | cntr = centrality->GetCentralityPercentile("V0M");\r | |
1249 | if((0.0< cntr) && (cntr<5.0)) binct = 0.5;\r | |
1250 | if((5.0< cntr) && (cntr<10.0)) binct = 1.5;\r | |
1251 | if((10.0< cntr) && (cntr<20.0)) binct = 2.5;\r | |
1252 | if((20.0< cntr) && (cntr<30.0)) binct = 3.5;\r | |
1253 | if((30.0< cntr) && (cntr<40.0)) binct = 4.5;\r | |
1254 | if((40.0< cntr) && (cntr<50.0)) binct = 5.5;\r | |
1255 | if((50.0< cntr) && (cntr<60.0)) binct = 6.5;\r | |
1256 | if((60.0< cntr) && (cntr<70.0)) binct = 7.5;\r | |
1257 | if((70.0< cntr) && (cntr<80.0)) binct = 8.5;\r | |
1258 | if((80.0< cntr) && (cntr<90.0)) binct = 9.5;\r | |
1259 | if((90.0< cntr) && (cntr<100.0)) binct = 10.5;\r | |
1260 | \r | |
1261 | if((0.< cntr) && (cntr < 20.)) binctt = 0.5;\r | |
1262 | if((20.< cntr) && (cntr < 40.)) binctt = 1.5;\r | |
1263 | if((40.< cntr) && (cntr < 80.)) binctt = 2.5;\r | |
1264 | \r | |
e17c1f86 | 1265 | if((0.0< cntr) && (cntr<5.0)) binctMore = 0.5;\r |
1266 | if((5.0< cntr) && (cntr<10.0)) binctMore = 1.5;\r | |
1267 | if((10.0< cntr) && (cntr<15.0)) binctMore = 2.5;\r | |
1268 | if((15.0< cntr) && (cntr<20.0)) binctMore = 3.5;\r | |
1269 | if((20.0< cntr) && (cntr<25.0)) binctMore = 4.5;\r | |
1270 | if((25.0< cntr) && (cntr<30.0)) binctMore = 5.5;\r | |
1271 | if((30.0< cntr) && (cntr<35.0)) binctMore = 6.5;\r | |
1272 | if((35.0< cntr) && (cntr<40.0)) binctMore = 7.5;\r | |
1273 | if((40.0< cntr) && (cntr<45.0)) binctMore = 8.5;\r | |
1274 | if((45.0< cntr) && (cntr<50.0)) binctMore = 9.5;\r | |
1275 | if((50.0< cntr) && (cntr<55.0)) binctMore = 10.5;\r | |
1276 | if((55.0< cntr) && (cntr<60.0)) binctMore = 11.5;\r | |
1277 | if((60.0< cntr) && (cntr<65.0)) binctMore = 12.5;\r | |
1278 | if((65.0< cntr) && (cntr<70.0)) binctMore = 13.5;\r | |
1279 | if((70.0< cntr) && (cntr<75.0)) binctMore = 14.5;\r | |
1280 | if((75.0< cntr) && (cntr<80.0)) binctMore = 15.5;\r | |
1281 | if((80.0< cntr) && (cntr<85.0)) binctMore = 16.5;\r | |
1282 | if((85.0< cntr) && (cntr<90.0)) binctMore = 17.5;\r | |
1283 | if((90.0< cntr) && (cntr<95.0)) binctMore = 18.5;\r | |
1284 | if((95.0< cntr) && (cntr<100.0)) binctMore = 19.5;\r | |
1285 | \r | |
1286 | binctLess = cntr;\r | |
a8ef1999 | 1287 | \r |
e17c1f86 | 1288 | \r |
8c1c76e9 | 1289 | if(binct > 11.0) return;\r |
1290 | \r | |
1291 | // centrality\r | |
6733d981 | 1292 | valuensparsea[3] = binct; \r |
e17c1f86 | 1293 | valuensparseabis[1] = binct; \r |
8c1c76e9 | 1294 | valuensparsee[1] = binct; \r |
e17c1f86 | 1295 | valuensparsef[1] = binctMore; \r |
a8ef1999 | 1296 | valuensparsefsin[1] = binct; \r |
e17c1f86 | 1297 | valuensparsefbis[3] = binctMore; \r |
a8ef1999 | 1298 | valuensparsefbissin[3] = binct; \r |
8c1c76e9 | 1299 | valuensparseg[1] = binct;\r |
1300 | valuensparseh[1] = binct; \r | |
6733d981 | 1301 | valuefractioncont[1] = binct;\r |
11ff28c5 | 1302 | valuensparsehprofile[1] = binct; \r |
e17c1f86 | 1303 | valuecossinephiep[2] = binctMore;\r |
0e30407a | 1304 | valuensparseMCSourceDeltaPhiMaps[0] = binct;\r |
5cd679b7 | 1305 | valuedeltaphicontamination[1] = binct;\r |
0e30407a | 1306 | \r |
8c1c76e9 | 1307 | //////////////////////\r |
1308 | // run number\r | |
1309 | //////////////////////\r | |
1310 | \r | |
11ff28c5 | 1311 | Int_t runnumber = fInputEvent->GetRunNumber();\r |
7f695a7b | 1312 | AliDebug(2,Form("Run number %d",runnumber));\r |
8c1c76e9 | 1313 | \r |
1314 | if(!fPID->IsInitialized()){\r | |
1315 | // Initialize PID with the given run number\r | |
1316 | fPID->InitializePID(runnumber);\r | |
1317 | }\r | |
5cd679b7 | 1318 | if(!fPIDTOFOnly->IsInitialized()){\r |
1319 | // Initialize PID with the given run number\r | |
1320 | fPIDTOFOnly->InitializePID(runnumber);\r | |
1321 | }\r | |
8c1c76e9 | 1322 | \r |
5cd679b7 | 1323 | //\r |
0e30407a | 1324 | if(!fPIDBackground->IsInitialized()){\r |
1325 | // Initialize PID with the given run number\r | |
1326 | fPIDBackground->InitializePID(runnumber);\r | |
1327 | }\r | |
1328 | \r | |
6400afdd | 1329 | fHFECuts->SetRecEvent(fInputEvent);\r |
1330 | if(mcEvent) fHFECuts->SetMCEvent(mcEvent);\r | |
1331 | \r | |
8c1c76e9 | 1332 | \r |
1333 | //////////\r | |
1334 | // PID\r | |
1335 | //////////\r | |
1336 | \r | |
1337 | AliPIDResponse *pidResponse = fInputHandler->GetPIDResponse();\r | |
1338 | if(!pidResponse){\r | |
7f695a7b | 1339 | AliDebug(2,"No PID response set");\r |
8c1c76e9 | 1340 | return;\r |
1341 | }\r | |
1342 | fPID->SetPIDResponse(pidResponse);\r | |
5cd679b7 | 1343 | fPIDTOFOnly->SetPIDResponse(pidResponse);\r |
0e30407a | 1344 | fPIDBackground->SetPIDResponse(pidResponse);\r |
8c1c76e9 | 1345 | \r |
16bbbe1c | 1346 | //fMultEv->Fill(binctt,0.0);\r |
8c1c76e9 | 1347 | \r |
1348 | \r | |
1349 | //////////////////\r | |
1350 | // Event cut\r | |
1351 | //////////////////\r | |
11ff28c5 | 1352 | if(!fHFECuts->CheckEventCuts("fEvRecCuts", fInputEvent)) {\r |
7f695a7b | 1353 | AliDebug(2,"Do not pass the event cut");\r |
8c1c76e9 | 1354 | PostData(1, fListHist);\r |
1355 | return;\r | |
1356 | }\r | |
1357 | \r | |
16bbbe1c | 1358 | //fMultEv->Fill(binctt,1.0);\r |
8c1c76e9 | 1359 | \r |
1360 | //////////////////////////////////// \r | |
e17c1f86 | 1361 | // First method event plane\r |
8c1c76e9 | 1362 | ////////////////////////////////////\r |
1363 | \r | |
11ff28c5 | 1364 | AliEventplane* vEPa = fInputEvent->GetEventplane();\r |
e17c1f86 | 1365 | Float_t eventPlanea = 0.0;\r |
1366 | Float_t eventPlaneTPC = 0.0;\r | |
1367 | Float_t eventPlaneV0A = 0.0;\r | |
1368 | Float_t eventPlaneV0C = 0.0;\r | |
1369 | Float_t eventPlaneV0 = 0.0;\r | |
1370 | TVector2 *standardQ = 0x0;\r | |
1371 | TVector2 *qsub1a = 0x0;\r | |
1372 | TVector2 *qsub2a = 0x0;\r | |
1373 | \r | |
1374 | // V0\r | |
a8ef1999 | 1375 | \r |
11ff28c5 | 1376 | if(fHFEVZEROEventPlane && (!fAODAnalysis)){\r |
1377 | \r | |
1378 | //AliESDEvent *esd = dynamic_cast<AliESDEvent*>(InputEvent());\r | |
1379 | //if(!esd) return;\r | |
a8ef1999 | 1380 | \r |
11ff28c5 | 1381 | fHFEVZEROEventPlane->ProcessEvent(fInputEvent);\r |
a8ef1999 | 1382 | \r |
1383 | if(TMath::Abs(fHFEVZEROEventPlane->GetEventPlaneV0A()+100) < 0.0000001) eventPlaneV0A = -100.0;\r | |
1384 | else {\r | |
1385 | eventPlaneV0A = TVector2::Phi_0_2pi(fHFEVZEROEventPlane->GetEventPlaneV0A());\r | |
1386 | if(eventPlaneV0A > TMath::Pi()) eventPlaneV0A = eventPlaneV0A - TMath::Pi();\r | |
1387 | }\r | |
1388 | \r | |
1389 | if(TMath::Abs(fHFEVZEROEventPlane->GetEventPlaneV0C()+100) < 0.0000001) eventPlaneV0C = -100.0;\r | |
1390 | else {\r | |
1391 | eventPlaneV0C = TVector2::Phi_0_2pi(fHFEVZEROEventPlane->GetEventPlaneV0C());\r | |
1392 | if(eventPlaneV0C > TMath::Pi()) eventPlaneV0C = eventPlaneV0C - TMath::Pi();\r | |
1393 | }\r | |
1394 | \r | |
1395 | if(TMath::Abs(fHFEVZEROEventPlane->GetEventPlaneV0()+100) < 0.0000001) eventPlaneV0 = -100.0;\r | |
1396 | else {\r | |
1397 | eventPlaneV0 = TVector2::Phi_0_2pi(fHFEVZEROEventPlane->GetEventPlaneV0());\r | |
1398 | if(eventPlaneV0 > TMath::Pi()) eventPlaneV0 = eventPlaneV0 - TMath::Pi();\r | |
1399 | }\r | |
1400 | \r | |
1401 | }\r | |
1402 | else {\r | |
1403 | \r | |
11ff28c5 | 1404 | eventPlaneV0 = TVector2::Phi_0_2pi(vEPa->GetEventplane("V0", fInputEvent,2));\r |
7f695a7b | 1405 | AliDebug(2,Form("eventPlaneV0 %f",eventPlaneV0));\r |
a8ef1999 | 1406 | if(eventPlaneV0 > TMath::Pi()) eventPlaneV0 = eventPlaneV0 - TMath::Pi();\r |
7f695a7b | 1407 | AliDebug(2,Form("eventPlaneV0 %f",eventPlaneV0));\r |
11ff28c5 | 1408 | eventPlaneV0A = TVector2::Phi_0_2pi(vEPa->GetEventplane("V0A", fInputEvent,2));\r |
a8ef1999 | 1409 | if(eventPlaneV0A > TMath::Pi()) eventPlaneV0A = eventPlaneV0A - TMath::Pi();\r |
11ff28c5 | 1410 | eventPlaneV0C = TVector2::Phi_0_2pi(vEPa->GetEventplane("V0C", fInputEvent,2));\r |
a8ef1999 | 1411 | if(eventPlaneV0C > TMath::Pi()) eventPlaneV0C = eventPlaneV0C - TMath::Pi();\r |
e17c1f86 | 1412 | \r |
a8ef1999 | 1413 | }\r |
1414 | \r | |
e17c1f86 | 1415 | // TPC\r |
1416 | \r | |
11ff28c5 | 1417 | standardQ = vEPa->GetQVector(); \r |
8c1c76e9 | 1418 | Double_t qx = -1.0;\r |
1419 | Double_t qy = -1.0;\r | |
1420 | if(standardQ) {\r | |
1421 | qx = standardQ->X();\r | |
1422 | qy = standardQ->Y();\r | |
1423 | } \r | |
1424 | TVector2 qVectorfortrack;\r | |
1425 | qVectorfortrack.Set(qx,qy);\r | |
e17c1f86 | 1426 | eventPlaneTPC = TVector2::Phi_0_2pi(qVectorfortrack.Phi())/2.; \r |
1427 | \r | |
1428 | // Choose the one used for v2\r | |
1429 | \r | |
1430 | if(fVZEROEventPlane) eventPlanea = eventPlaneV0;\r | |
1431 | if(fVZEROEventPlaneA) eventPlanea = eventPlaneV0A;\r | |
1432 | if(fVZEROEventPlaneC) eventPlanea = eventPlaneV0C;\r | |
1433 | if(!fVZEROEventPlane) eventPlanea = eventPlaneTPC;\r | |
1434 | \r | |
1435 | valuecossinephiep[0] = TMath::Cos(2*eventPlanea);\r | |
1436 | valuecossinephiep[1] = TMath::Sin(2*eventPlanea);\r | |
1437 | \r | |
8c1c76e9 | 1438 | Float_t eventPlanesub1a = -100.0;\r |
1439 | Float_t eventPlanesub2a = -100.0;\r | |
e17c1f86 | 1440 | Double_t diffsub1sub2a = -100.0;\r |
a8ef1999 | 1441 | Double_t diffsub1sub2asin = -100.0;\r |
e17c1f86 | 1442 | Double_t diffsubasubb = -100.0;\r |
1443 | Double_t diffsubasubc = -100.0;\r | |
1444 | Double_t diffsubbsubc = -100.0;\r | |
a8ef1999 | 1445 | Double_t diffsubasubbsin = -100.0;\r |
1446 | Double_t diffsubasubcsin = -100.0;\r | |
1447 | Double_t diffsubbsubcsin = -100.0;\r | |
e17c1f86 | 1448 | \r |
6733d981 | 1449 | // two sub event TPC\r |
11ff28c5 | 1450 | qsub1a = vEPa->GetQsub1();\r |
1451 | qsub2a = vEPa->GetQsub2();\r | |
8c1c76e9 | 1452 | if(qsub1a) eventPlanesub1a = TVector2::Phi_0_2pi(qsub1a->Phi())/2.;\r |
1453 | if(qsub2a) eventPlanesub2a = TVector2::Phi_0_2pi(qsub2a->Phi())/2.;\r | |
a8ef1999 | 1454 | if(qsub1a && qsub2a) {\r |
1455 | diffsub1sub2a = TMath::Cos(2.*TVector2::Phi_0_2pi(qsub1a->Phi()/2.- qsub2a->Phi()/2.));\r | |
1456 | diffsub1sub2asin = TMath::Sin(2.*TVector2::Phi_0_2pi(qsub1a->Phi()/2.- qsub2a->Phi()/2.));\r | |
1457 | }\r | |
6733d981 | 1458 | \r |
1459 | // three sub events in case of VZEROA and VZEROC\r | |
1460 | diffsubasubb = TMath::Cos(2.*(eventPlaneV0A - eventPlaneV0C));\r | |
1461 | diffsubasubc = TMath::Cos(2.*(eventPlaneV0A - eventPlaneTPC));\r | |
1462 | diffsubbsubc = TMath::Cos(2.*(eventPlaneV0C - eventPlaneTPC));\r | |
1463 | \r | |
1464 | diffsubasubbsin = TMath::Sin(2.*(eventPlaneV0A - eventPlaneV0C));\r | |
1465 | diffsubasubcsin = TMath::Sin(2.*(eventPlaneV0A - eventPlaneTPC));\r | |
1466 | diffsubbsubcsin = TMath::Sin(2.*(eventPlaneV0C - eventPlaneTPC));\r | |
1467 | // three sub events in case of VZERO all\r | |
1468 | if(fVZEROEventPlane && (!fVZEROEventPlaneA) && (!fVZEROEventPlaneC)) {\r | |
1469 | diffsubasubb = TMath::Cos(2.*(eventPlaneV0 - eventPlanesub1a));\r | |
1470 | diffsubasubc = TMath::Cos(2.*(eventPlaneV0 - eventPlanesub2a));\r | |
1471 | diffsubbsubc = TMath::Cos(2.*(eventPlanesub1a - eventPlanesub2a));\r | |
1472 | \r | |
1473 | diffsubasubbsin = TMath::Sin(2.*(eventPlaneV0 - eventPlanesub1a));\r | |
1474 | diffsubasubcsin = TMath::Sin(2.*(eventPlaneV0 - eventPlanesub2a));\r | |
1475 | diffsubbsubcsin = TMath::Sin(2.*(eventPlanesub1a - eventPlanesub2a));\r | |
1476 | }\r | |
e17c1f86 | 1477 | \r |
8c1c76e9 | 1478 | \r |
e17c1f86 | 1479 | /////////////////////////////////////////////////////////\r |
1480 | // Cut for event with event plane reconstructed by all\r | |
1481 | ////////////////////////////////////////////////////////\r | |
8c1c76e9 | 1482 | \r |
e17c1f86 | 1483 | //if(!fVZEROEventPlane) {\r |
1484 | // if(!standardQ) {\r | |
1485 | // eventplanedefined = kFALSE;\r | |
1486 | //PostData(1, fListHist);\r | |
1487 | //return;\r | |
1488 | //}\r | |
1489 | //}\r | |
1490 | \r | |
4102d1cc | 1491 | if((!standardQ) || (!qsub1a) || (!qsub2a)) {\r |
7f695a7b | 1492 | AliDebug(2,"No event plane");\r |
4102d1cc | 1493 | return;\r |
1494 | }\r | |
8c1c76e9 | 1495 | \r |
7b5936fc | 1496 | //////////////////////////////////////\r |
1497 | // AliFlowEvent and MC event plane\r | |
1498 | /////////////////////////////////////\r | |
8c1c76e9 | 1499 | \r |
11ff28c5 | 1500 | Int_t nbtracks = fInputEvent->GetNumberOfTracks();\r |
7f695a7b | 1501 | AliDebug(2,Form("Number of tracks %d",nbtracks));\r |
8c1c76e9 | 1502 | \r |
7b5936fc | 1503 | if(fMonitorQCumulant) {\r |
1504 | \r | |
1505 | fcutsRP->SetEvent( InputEvent(), MCEvent());\r | |
1506 | fcutsPOI->SetEvent( InputEvent(), MCEvent());\r | |
1507 | if( fflowEvent ){ \r | |
1508 | fflowEvent->~AliFlowEvent();\r | |
1509 | new(fflowEvent) AliFlowEvent(fcutsRP,fcutsPOI);\r | |
1510 | }else fflowEvent = new AliFlowEvent(fcutsRP,fcutsPOI);\r | |
1511 | if(mcEvent && mcEvent->GenEventHeader()) {\r | |
1512 | fflowEvent->SetMCReactionPlaneAngle(mcEvent);\r | |
1513 | //if reaction plane not set from elsewhere randomize it before adding flow\r | |
1514 | //if (!fflowEvent->IsSetMCReactionPlaneAngle()) fflowEvent->SetMCReactionPlaneAngle(gRandom->Uniform(0.0,TMath::TwoPi()));\r | |
1515 | mcReactionPlane = TVector2::Phi_0_2pi(fflowEvent->GetMCReactionPlaneAngle());\r | |
1516 | if(mcReactionPlane > TMath::Pi()) mcReactionPlane = mcReactionPlane - TMath::Pi();\r | |
7f695a7b | 1517 | AliDebug(2,Form("MC reaction plane %f",mcReactionPlane));\r |
7b5936fc | 1518 | }\r |
1519 | fflowEvent->SetReferenceMultiplicity( nbtracks );\r | |
1520 | fflowEvent->DefineDeadZone(0,0,0,0);\r | |
1521 | //fflowEvent.TagSubeventsInEta(-0.8,-0.1,0.1,0.8);\r | |
1522 | \r | |
1523 | ////////////////\r | |
1524 | // MC\r | |
1525 | ///////////////\r | |
1526 | if(fUseMCReactionPlane) {\r | |
1527 | eventPlanea = mcReactionPlane;\r | |
1528 | diffsub1sub2a = 0.0;\r | |
1529 | }\r | |
8c1c76e9 | 1530 | }\r |
1531 | \r | |
1532 | \r | |
1533 | //////////////////////\r | |
1534 | // Fill Histos\r | |
1535 | //////////////////////\r | |
1536 | \r | |
e17c1f86 | 1537 | if(eventplanedefined) {\r |
1538 | \r | |
16bbbe1c | 1539 | //fMultEv->Fill(binctt,2.0);\r |
e17c1f86 | 1540 | \r |
1541 | // Fill\r | |
1542 | valuensparsea[0] = eventPlaneV0A;\r | |
1543 | valuensparsea[1] = eventPlaneV0C;\r | |
1544 | valuensparsea[2] = eventPlaneTPC;\r | |
6733d981 | 1545 | if(fVZEROEventPlane && (!fVZEROEventPlaneA) && (!fVZEROEventPlaneC)) {\r |
1546 | // case VZERO all\r | |
1547 | valuensparsea[0] = eventPlaneV0;\r | |
1548 | valuensparsea[1] = eventPlanesub1a;\r | |
1549 | valuensparsea[2] = eventPlanesub2a;\r | |
1550 | } \r | |
e17c1f86 | 1551 | fEventPlane->Fill(&valuensparsea[0]);\r |
1552 | \r | |
1553 | // Fill\r | |
7b5936fc | 1554 | if(fMonitorEventPlane) fCosSin2phiep->Fill(&valuecossinephiep[0]);\r |
e17c1f86 | 1555 | \r |
1556 | if(!fVZEROEventPlane) {\r | |
1557 | valuensparsef[0] = diffsub1sub2a;\r | |
1558 | fCosRes->Fill(&valuensparsef[0]);\r | |
a8ef1999 | 1559 | valuensparsefsin[0] = diffsub1sub2asin;\r |
7b5936fc | 1560 | if(fMonitorEventPlane) fSinRes->Fill(&valuensparsefsin[0]);\r |
1561 | if(fMonitorEventPlane) {\r | |
e17c1f86 | 1562 | fProfileCosRes->Fill(valuensparsef[1],valuensparsef[0]);\r |
1563 | }\r | |
1564 | }\r | |
1565 | else {\r | |
1566 | valuensparsefbis[0] = diffsubasubb;\r | |
1567 | valuensparsefbis[1] = diffsubbsubc;\r | |
1568 | valuensparsefbis[2] = diffsubasubc;\r | |
1569 | fCosResabc->Fill(&valuensparsefbis[0]);\r | |
a8ef1999 | 1570 | valuensparsefbissin[0] = diffsubasubbsin;\r |
1571 | valuensparsefbissin[1] = diffsubbsubcsin;\r | |
1572 | valuensparsefbissin[2] = diffsubasubcsin;\r | |
7b5936fc | 1573 | if(fMonitorEventPlane) fSinResabc->Fill(&valuensparsefbissin[0]);\r |
1574 | if(fMonitorEventPlane) {\r | |
e17c1f86 | 1575 | fProfileCosResab->Fill(valuensparsefbis[3],valuensparsefbis[0]);\r |
1576 | fProfileCosResac->Fill(valuensparsefbis[3],valuensparsefbis[1]);\r | |
1577 | fProfileCosResbc->Fill(valuensparsefbis[3],valuensparsefbis[2]);\r | |
1578 | }\r | |
1579 | }\r | |
1580 | \r | |
1581 | }\r | |
8c1c76e9 | 1582 | \r |
0e30407a | 1583 | ////////////////////////////////////////\r |
1584 | // Loop to determine pool background\r | |
1585 | /////////////////////////////////////////\r | |
7b5936fc | 1586 | if(fMonitorPhotonic) {\r |
1587 | \r | |
1588 | if( fArraytrack ){ \r | |
1589 | fArraytrack->~TArrayI();\r | |
1590 | new(fArraytrack) TArrayI(nbtracks);\r | |
1591 | }\r | |
1592 | else { \r | |
1593 | fArraytrack = new TArrayI(nbtracks);\r | |
1594 | }\r | |
1595 | fCounterPoolBackground = 0;\r | |
0e30407a | 1596 | \r |
7b5936fc | 1597 | for(Int_t k = 0; k < nbtracks; k++){\r |
1598 | \r | |
1599 | AliVTrack *track = (AliVTrack *) fInputEvent->GetTrack(k);\r | |
1600 | if(!track) continue;\r | |
1601 | \r | |
1602 | // Track cuts\r | |
1603 | Bool_t survivedbackground = kTRUE;\r | |
1604 | if(fAODAnalysis) {\r | |
1605 | AliAODTrack *aodtrack = dynamic_cast<AliAODTrack *>(track);\r | |
1606 | if(aodtrack) {\r | |
1607 | AliESDtrack esdTrack(aodtrack);\r | |
1608 | // set the TPC cluster info\r | |
1609 | esdTrack.SetTPCClusterMap(aodtrack->GetTPCClusterMap());\r | |
1610 | esdTrack.SetTPCSharedMap(aodtrack->GetTPCSharedMap());\r | |
1611 | esdTrack.SetTPCPointsF(aodtrack->GetTPCNclsF());\r | |
1612 | // needed to calculate the impact parameters\r | |
1613 | AliAODEvent *aodeventu = dynamic_cast<AliAODEvent *>(fInputEvent);\r | |
1614 | if(aodeventu) {\r | |
1615 | AliAODVertex *vAOD = aodeventu->GetPrimaryVertex();\r | |
1616 | Double_t bfield = aodeventu->GetMagneticField();\r | |
1617 | Double_t pos[3],cov[6];\r | |
1618 | vAOD->GetXYZ(pos);\r | |
1619 | vAOD->GetCovarianceMatrix(cov);\r | |
1620 | const AliESDVertex vESD(pos,cov,100.,100);\r | |
1621 | esdTrack.RelateToVertex(&vESD,bfield,3.);\r | |
1622 | } \r | |
1623 | if(!fHFEBackgroundCuts->IsSelected(&esdTrack)) {\r | |
1624 | survivedbackground = kFALSE;\r | |
1625 | }\r | |
0e30407a | 1626 | }\r |
1627 | }\r | |
7b5936fc | 1628 | else {\r |
1629 | AliESDtrack *esdtrack = dynamic_cast<AliESDtrack *>(track);\r | |
1630 | if(esdtrack) {\r | |
1631 | if(!fHFEBackgroundCuts->IsSelected(esdtrack)) survivedbackground = kFALSE;\r | |
1632 | }\r | |
0e30407a | 1633 | }\r |
7b5936fc | 1634 | // PID\r |
1635 | if(survivedbackground) {\r | |
1636 | // PID track cuts\r | |
1637 | AliHFEpidObject hfetrack2;\r | |
1638 | if(!fAODAnalysis) hfetrack2.SetAnalysisType(AliHFEpidObject::kESDanalysis);\r | |
1639 | else hfetrack2.SetAnalysisType(AliHFEpidObject::kAODanalysis);\r | |
1640 | hfetrack2.SetRecTrack(track);\r | |
1641 | hfetrack2.SetCentrality((Int_t)binct);\r | |
7f695a7b | 1642 | AliDebug(2,Form("centrality %f and %d",binct,hfetrack2.GetCentrality()));\r |
7b5936fc | 1643 | hfetrack2.SetPbPb();\r |
1644 | if(fPIDBackground->IsSelected(&hfetrack2,0x0,"recTrackCont",fPIDBackgroundqa)) {\r | |
1645 | fArraytrack->AddAt(k,fCounterPoolBackground);\r | |
1646 | fCounterPoolBackground++;\r | |
7f695a7b | 1647 | AliDebug(2,Form("fCounterPoolBackground %d, track %d",fCounterPoolBackground,k));\r |
7b5936fc | 1648 | }\r |
0e30407a | 1649 | }\r |
1650 | }\r | |
1651 | }\r | |
8c1c76e9 | 1652 | \r |
7b5936fc | 1653 | \r |
1654 | ///////////////////////////////////\r | |
1655 | // Loop for kink mother AOD\r | |
1656 | //////////////////////////////////\r | |
0e30407a | 1657 | // Look at kink mother in case of AOD\r |
1658 | Int_t numberofvertices = 1;\r | |
1659 | AliAODEvent *aodevent = NULL;\r | |
1660 | Int_t numberofmotherkink = 0; \r | |
1661 | if(fAODAnalysis) {\r | |
1662 | aodevent = dynamic_cast<AliAODEvent *>(fInputEvent);\r | |
1663 | if(aodevent) {\r | |
1664 | numberofvertices = aodevent->GetNumberOfVertices();\r | |
1665 | }\r | |
1666 | }\r | |
1667 | Double_t listofmotherkink[numberofvertices];\r | |
1668 | if(fAODAnalysis && aodevent) {\r | |
1669 | for(Int_t ivertex=0; ivertex < numberofvertices; ivertex++) {\r | |
1670 | AliAODVertex *aodvertex = aodevent->GetVertex(ivertex);\r | |
1671 | if(!aodvertex) continue;\r | |
1672 | if(aodvertex->GetType()==AliAODVertex::kKink) {\r | |
1673 | AliAODTrack *mother = (AliAODTrack *) aodvertex->GetParent();\r | |
1674 | if(!mother) continue;\r | |
1675 | Int_t idmother = mother->GetID();\r | |
1676 | listofmotherkink[numberofmotherkink] = idmother;\r | |
7f695a7b | 1677 | AliDebug(2,Form("ID %d",idmother));\r |
0e30407a | 1678 | numberofmotherkink++;\r |
1679 | }\r | |
1680 | }\r | |
1681 | }\r | |
1682 | \r | |
1683 | //////////////////////////\r | |
1684 | // Loop over track\r | |
1685 | //////////////////////////\r | |
16bbbe1c | 1686 | Double_t nboftrackTPCcut = 0.0;\r |
0e30407a | 1687 | \r |
1688 | for(Int_t k = 0; k < nbtracks; k++){\r | |
1689 | \r | |
1690 | AliVTrack *track = (AliVTrack *) fInputEvent->GetTrack(k);\r | |
1691 | if(!track) continue;\r | |
1692 | \r | |
4102d1cc | 1693 | if(fAODAnalysis) {\r |
1694 | AliAODTrack *aodtrack = dynamic_cast<AliAODTrack *>(track);\r | |
1695 | if(!aodtrack){\r | |
1696 | AliError("AOD track is not there");\r | |
0e30407a | 1697 | continue;\r |
4102d1cc | 1698 | } \r |
7f695a7b | 1699 | AliDebug(2,"Find AOD track on");\r |
4102d1cc | 1700 | if(fUseFlagAOD){\r |
1701 | if(aodtrack->GetFlags() != fFlags) continue; // Only process AOD tracks where the HFE is set\r | |
8c1c76e9 | 1702 | }\r |
8c1c76e9 | 1703 | }\r |
1704 | \r | |
4102d1cc | 1705 | if(fApplyCut) {\r |
4102d1cc | 1706 | \r |
0e30407a | 1707 | valuetrackingcuts[0] = track->Pt(); \r |
1708 | valuetrackingcuts[1] = 0;\r | |
1709 | \r | |
1710 | // RecKine: ITSTPC cuts \r | |
1711 | if(!fHFECuts->CheckParticleCuts(AliHFEcuts::kStepRecKineITSTPC + AliHFEcuts::kNcutStepsMCTrack, (TObject *)track)) continue;\r | |
7b5936fc | 1712 | if(fMonitorTrackCuts) fTrackingCuts->Fill(&valuetrackingcuts[0]);\r |
16bbbe1c | 1713 | nboftrackTPCcut++;\r |
0e30407a | 1714 | \r |
1715 | // Reject kink mother\r | |
1716 | if(fAODAnalysis) {\r | |
1717 | Bool_t kinkmotherpass = kTRUE;\r | |
1718 | for(Int_t kinkmother = 0; kinkmother < numberofmotherkink; kinkmother++) {\r | |
1719 | if(track->GetID() == listofmotherkink[kinkmother]) {\r | |
1720 | kinkmotherpass = kFALSE;\r | |
1721 | continue;\r | |
1722 | }\r | |
a8ef1999 | 1723 | }\r |
0e30407a | 1724 | if(!kinkmotherpass) continue;\r |
a8ef1999 | 1725 | }\r |
1726 | else {\r | |
0e30407a | 1727 | AliESDtrack *esdtrack = dynamic_cast<AliESDtrack *>(track);\r |
1728 | if(esdtrack){ \r | |
1729 | if(esdtrack->GetKinkIndex(0) != 0) continue; \r | |
1730 | } // Quick and dirty fix to reject both kink mothers and daughters\r | |
8c1c76e9 | 1731 | }\r |
7b5936fc | 1732 | \r |
4317a065 | 1733 | valuetrackingcuts[1] = 1; \r |
7b5936fc | 1734 | if(fMonitorTrackCuts) fTrackingCuts->Fill(&valuetrackingcuts[0]); \r |
0e30407a | 1735 | // RecPrim\r |
1736 | if(!fHFECuts->CheckParticleCuts(AliHFEcuts::kStepRecPrim + AliHFEcuts::kNcutStepsMCTrack, (TObject *)track)) continue;\r | |
4317a065 | 1737 | valuetrackingcuts[1] = 2; \r |
7b5936fc | 1738 | if(fMonitorTrackCuts) fTrackingCuts->Fill(&valuetrackingcuts[0]); \r |
1739 | \r | |
0e30407a | 1740 | // HFEcuts: ITS layers cuts\r |
7b5936fc | 1741 | if(!fHFECuts->CheckParticleCuts(AliHFEcuts::kStepHFEcutsITS + AliHFEcuts::kNcutStepsMCTrack, (TObject *)track)) continue;\r |
4317a065 | 1742 | valuetrackingcuts[1] = 3; \r |
7b5936fc | 1743 | if(fMonitorTrackCuts) fTrackingCuts->Fill(&valuetrackingcuts[0]); \r |
0e30407a | 1744 | \r |
1745 | // HFE cuts: TOF PID and mismatch flag\r | |
1746 | if(!fHFECuts->CheckParticleCuts(AliHFEcuts::kStepHFEcutsTOF + AliHFEcuts::kNcutStepsMCTrack, (TObject *)track)) continue;\r | |
4317a065 | 1747 | valuetrackingcuts[1] = 4; \r |
7b5936fc | 1748 | if(fMonitorTrackCuts) fTrackingCuts->Fill(&valuetrackingcuts[0]); \r |
0e30407a | 1749 | \r |
1750 | // HFE cuts: TPC PID cleanup\r | |
1751 | if(!fHFECuts->CheckParticleCuts(AliHFEcuts::kStepHFEcutsTPC + AliHFEcuts::kNcutStepsMCTrack, (TObject *)track)) continue;\r | |
4317a065 | 1752 | valuetrackingcuts[1] = 5; \r |
7b5936fc | 1753 | if(fMonitorTrackCuts) fTrackingCuts->Fill(&valuetrackingcuts[0]); \r |
0e30407a | 1754 | \r |
1755 | // HFEcuts: Nb of tracklets TRD0\r | |
1756 | if(!fHFECuts->CheckParticleCuts(AliHFEcuts::kStepHFEcutsTRD + AliHFEcuts::kNcutStepsMCTrack, (TObject *)track)) continue;\r | |
4317a065 | 1757 | valuetrackingcuts[1] = 6; \r |
7b5936fc | 1758 | if(fMonitorTrackCuts) fTrackingCuts->Fill(&valuetrackingcuts[0]); \r |
0e30407a | 1759 | \r |
8c1c76e9 | 1760 | }\r |
1761 | \r | |
7f695a7b | 1762 | AliDebug(2,"Survived");\r |
8c1c76e9 | 1763 | \r |
8c1c76e9 | 1764 | /////////////////////////////////////////////////////////\r |
0e30407a | 1765 | // Subtract candidate from TPC event plane\r |
8c1c76e9 | 1766 | ////////////////////////////////////////////////////////\r |
e17c1f86 | 1767 | Float_t eventplanesubtracted = 0.0; \r |
1768 | \r | |
1769 | //if(eventplanedefined && (!fVZEROEventPlane)) {\r | |
1770 | if(!fVZEROEventPlane) {\r | |
1771 | // Subtract the tracks from the event plane\r | |
11ff28c5 | 1772 | Double_t qX = standardQ->X() - vEPa->GetQContributionX(track); //Modify the components: subtract the track you want to look at with your analysis\r |
1773 | Double_t qY = standardQ->Y() - vEPa->GetQContributionY(track); //Modify the components: subtract the track you want to look at with your analysis\r | |
e17c1f86 | 1774 | TVector2 newQVectorfortrack;\r |
1775 | newQVectorfortrack.Set(qX,qY);\r | |
1776 | eventplanesubtracted = TVector2::Phi_0_2pi(newQVectorfortrack.Phi())/2; \r | |
1777 | }\r | |
1778 | else eventplanesubtracted = eventPlanea;\r | |
8c1c76e9 | 1779 | \r |
0e30407a | 1780 | ///////////////////////////////////////////\r |
1781 | // Event plane\r | |
1782 | //////////////////////////////////////////\r | |
e17c1f86 | 1783 | Bool_t fillEventPlane = kTRUE;\r |
1784 | if(!fVZEROEventPlane){\r | |
1785 | //if((!qsub1a) || (!qsub2a) || (!eventplanedefined)) fillEventPlane = kFALSE;\r | |
1786 | if((!qsub1a) || (!qsub2a)) fillEventPlane = kFALSE;\r | |
1787 | if(fSubEtaGapTPC) {\r | |
1788 | if(track->Eta() < (- fEtaGap/2.)) eventplanesubtracted = eventPlanesub1a;\r | |
1789 | else if(track->Eta() > (fEtaGap/2.)) eventplanesubtracted = eventPlanesub2a;\r | |
1790 | else fillEventPlane = kFALSE;\r | |
1791 | }\r | |
8c1c76e9 | 1792 | }\r |
e17c1f86 | 1793 | \r |
8c1c76e9 | 1794 | ///////////////\r |
1795 | // MC\r | |
1796 | //////////////\r | |
1797 | if(fUseMCReactionPlane) {\r | |
1798 | eventplanesubtracted = mcReactionPlane;\r | |
e17c1f86 | 1799 | fillEventPlane = kTRUE;\r |
8c1c76e9 | 1800 | }\r |
1801 | \r | |
1802 | //////////////////////////////////////////////////////////////////////////////\r | |
1803 | ///////////////////////////AFTERBURNER\r | |
1804 | Double_t phitrack = track->Phi(); \r | |
1805 | if (fAfterBurnerOn)\r | |
1806 | {\r | |
1807 | phitrack = GetPhiAfterAddV2(track->Phi(),mcReactionPlane);\r | |
1808 | }\r | |
1809 | //////////////////////////////////////////////////////////////////////////////\r | |
1810 | \r | |
1811 | \r | |
1812 | ///////////////////////\r | |
1813 | // Calculate deltaphi\r | |
1814 | ///////////////////////\r | |
1815 | \r | |
1816 | // Suppose phi track is between 0.0 and phi\r | |
1817 | Double_t deltaphi = TVector2::Phi_0_2pi(phitrack - eventplanesubtracted);\r | |
1818 | if(deltaphi > TMath::Pi()) deltaphi = deltaphi - TMath::Pi();\r | |
0e30407a | 1819 | \r |
5cd679b7 | 1820 | ////////////////////////////////\r |
1821 | // Determine the deltaphi bin\r | |
1822 | ///////////////////////////////\r | |
1823 | \r | |
1824 | // in-plane\r | |
1825 | if(((deltaphi<(TMath::Pi()/4.)) && (deltaphi>0.0)) || ((deltaphi>(3*TMath::Pi()/4.)) && (deltaphi<TMath::Pi()))) valuedeltaphicontamination[0] = 0.5;\r | |
1826 | // out-of-plane\r | |
1827 | if((deltaphi>(TMath::Pi()/4.)) && (deltaphi<(3*TMath::Pi()/4.))) valuedeltaphicontamination[0] = 1.5;\r | |
1828 | \r | |
0e30407a | 1829 | ////////////////////////////////////////\r |
1830 | // Define variables\r | |
1831 | ///////////////////////////////////////\r | |
1832 | \r | |
5cd679b7 | 1833 | \r |
1834 | valuedeltaphicontamination[2] = track->Pt();\r | |
0e30407a | 1835 | valuensparsee[2] = track->Pt();\r |
1836 | valuensparsee[3] = track->Eta(); \r | |
1837 | valuensparseg[2] = track->Pt();\r | |
1838 | valuensparseh[2] = track->Pt();\r | |
6733d981 | 1839 | valuefractioncont[0] = track->Pt();\r |
0e30407a | 1840 | valuensparsehprofile[2] = track->Pt();\r |
1841 | valuensparseMCSourceDeltaPhiMaps[1] = track->Pt();\r | |
1842 | if(track->Charge() > 0.0) {\r | |
1843 | valuensparseg[3] = 0.2;\r | |
1844 | valuensparseh[3] = 0.2;\r | |
1845 | }\r | |
1846 | else {\r | |
1847 | valuensparseg[3] = -0.2;\r | |
1848 | valuensparseh[3] = -0.2;\r | |
1849 | }\r | |
1850 | valuensparseh[4] = track->Eta();\r | |
1851 | valuensparseg[4] = track->Eta();\r | |
1852 | \r | |
7f695a7b | 1853 | AliDebug(2,Form("charge %d",(Int_t)track->Charge()));\r |
0e30407a | 1854 | \r |
1855 | ////////////////////////\r | |
1856 | // Fill before PID\r | |
1857 | ///////////////////////\r | |
1858 | \r | |
7b5936fc | 1859 | if(fMonitorWithoutPID) { \r |
0e30407a | 1860 | \r |
1861 | valuensparseg[0] = deltaphi;\r | |
1862 | if(fillEventPlane) fDeltaPhiMapsBeforePID->Fill(&valuensparseg[0]);\r | |
1863 | \r | |
1864 | //\r | |
1865 | valuensparseh[0] = TMath::Cos(2*TVector2::Phi_mpi_pi(phitrack-eventplanesubtracted));\r | |
1866 | if(fillEventPlane) {\r | |
1867 | fCosPhiMapsBeforePID->Fill(&valuensparseh[0]);\r | |
1868 | }\r | |
1869 | }\r | |
1870 | \r | |
1871 | ////////////////////////\r | |
1872 | // Apply PID\r | |
1873 | ////////////////////////\r | |
1874 | if(!fNoPID) {\r | |
1875 | // Apply PID for Data\r | |
1876 | if(!fMCPID) {\r | |
5cd679b7 | 1877 | // pid object\r |
0e30407a | 1878 | AliHFEpidObject hfetrack;\r |
1879 | if(!fAODAnalysis) hfetrack.SetAnalysisType(AliHFEpidObject::kESDanalysis);\r | |
1880 | else hfetrack.SetAnalysisType(AliHFEpidObject::kAODanalysis);\r | |
1881 | hfetrack.SetRecTrack(track);\r | |
1882 | hfetrack.SetCentrality((Int_t)binct);\r | |
7f695a7b | 1883 | AliDebug(2,Form("centrality %f and %d",binct,hfetrack.GetCentrality()));\r |
0e30407a | 1884 | hfetrack.SetPbPb();\r |
5cd679b7 | 1885 | \r |
1886 | // Only TOF PID\r | |
7b5936fc | 1887 | if(fMonitorContamination) {\r |
1888 | if(fPIDTOFOnly->IsSelected(&hfetrack,0x0,"recTrackCont",0x0)) {\r | |
1889 | Float_t nsigma = pidResponse->NumberOfSigmasTPC(track, AliPID::kElectron);\r | |
1890 | valuedeltaphicontamination[3] = nsigma;\r | |
1891 | fDeltaPhiMapsContamination->Fill(&valuedeltaphicontamination[0]);\r | |
1892 | }\r | |
5cd679b7 | 1893 | }\r |
1894 | \r | |
1895 | // Complete PID TOF+TPC\r | |
0e30407a | 1896 | if(!fPID->IsSelected(&hfetrack,0x0,"recTrackCont",fPIDqa)) {\r |
1897 | continue;\r | |
1898 | }\r | |
1899 | }\r | |
1900 | else {\r | |
1901 | if(!mcEvent) continue;\r | |
1902 | if(!(mctrack = dynamic_cast<AliMCParticle *>(mcEvent->GetTrack(TMath::Abs(track->GetLabel()))))) continue;\r | |
7f695a7b | 1903 | AliDebug(2,Form("PdgCode %d",TMath::Abs(mctrack->Particle()->GetPdgCode())));\r |
0e30407a | 1904 | if(TMath::Abs(mctrack->Particle()->GetPdgCode())!=11) continue;\r |
1905 | }\r | |
1906 | }\r | |
1907 | \r | |
1908 | \r | |
1909 | /////////////////////////////////////////////////////////////////////////////\r | |
1910 | // Add candidate to AliFlowEvent for POI and subtract from RP if needed\r | |
1911 | ////////////////////////////////////////////////////////////////////////////\r | |
7b5936fc | 1912 | if(fMonitorQCumulant) {\r |
1913 | Int_t idtrack = static_cast<AliVTrack*>(track)->GetID();\r | |
1914 | Bool_t found = kFALSE;\r | |
1915 | Int_t numberoffound = 0;\r | |
7f695a7b | 1916 | AliDebug(2,Form("A: Number of tracks %d",fflowEvent->NumberOfTracks()));\r |
7b5936fc | 1917 | for(Int_t iRPs=0; iRPs< fflowEvent->NumberOfTracks(); iRPs++) {\r |
1918 | AliFlowTrack *iRP = (AliFlowTrack*) (fflowEvent->GetTrack(iRPs));\r | |
1919 | //if(!iRP->InRPSelection()) continue;\r | |
1920 | if( TMath::Abs(idtrack) == TMath::Abs(iRP->GetID()) ) {\r | |
1921 | iRP->SetForPOISelection(kTRUE);\r | |
1922 | found = kTRUE;\r | |
1923 | numberoffound ++;\r | |
1924 | }\r | |
0e30407a | 1925 | }\r |
7f695a7b | 1926 | AliDebug(2,Form("Found %d mal",numberoffound));\r |
7b5936fc | 1927 | if(!found) {\r |
1928 | AliFlowCandidateTrack *sTrack = (AliFlowCandidateTrack*) MakeTrack(massElectron,track->Pt(),track->Phi(), track->Eta());\r | |
1929 | sTrack->SetID(idtrack);\r | |
1930 | fflowEvent->AddTrack(sTrack);\r | |
7f695a7b | 1931 | AliDebug(2,"Add the track");\r |
7b5936fc | 1932 | }\r |
7f695a7b | 1933 | AliDebug(2,Form("B: Number of tracks %d",fflowEvent->NumberOfTracks()));\r |
0e30407a | 1934 | }\r |
0e30407a | 1935 | \r |
1936 | \r | |
8c1c76e9 | 1937 | /////////////////////\r |
1938 | // Fill THnSparseF\r | |
1939 | /////////////////////\r | |
1940 | \r | |
1941 | //\r | |
e17c1f86 | 1942 | valuensparseabis[0] = eventplanesubtracted;\r |
7b5936fc | 1943 | if((fillEventPlane) && (fMonitorEventPlane)) fEventPlaneaftersubtraction->Fill(&valuensparseabis[0]);\r |
8c1c76e9 | 1944 | \r |
e17c1f86 | 1945 | \r |
7b5936fc | 1946 | if(fMonitorEventPlane) \r |
e17c1f86 | 1947 | {\r |
1948 | //\r | |
1949 | valuensparsee[0] = TMath::Cos(2*phitrack);\r | |
1950 | fCos2phie->Fill(&valuensparsee[0]);\r | |
1951 | valuensparsee[0] = TMath::Sin(2*phitrack);\r | |
1952 | fSin2phie->Fill(&valuensparsee[0]);\r | |
1953 | //\r | |
1954 | valuensparsee[0] = TMath::Cos(2*eventplanesubtracted);\r | |
1955 | if(fillEventPlane) fCos2phiep->Fill(&valuensparsee[0]);\r | |
1956 | valuensparsee[0] = TMath::Sin(2*eventplanesubtracted);\r | |
1957 | if(fillEventPlane) fSin2phiep->Fill(&valuensparsee[0]);\r | |
1958 | valuensparsee[0] = TMath::Sin(2*TVector2::Phi_mpi_pi(phitrack-eventplanesubtracted));\r | |
1959 | if(fillEventPlane) fSin2phiephiep->Fill(&valuensparsee[0]);\r | |
1960 | //\r | |
1961 | }\r | |
1962 | \r | |
8c1c76e9 | 1963 | // \r |
1964 | valuensparseg[0] = deltaphi;\r | |
e17c1f86 | 1965 | if(fillEventPlane) fDeltaPhiMaps->Fill(&valuensparseg[0]);\r |
8c1c76e9 | 1966 | \r |
1967 | //\r | |
1968 | valuensparseh[0] = TMath::Cos(2*TVector2::Phi_mpi_pi(phitrack-eventplanesubtracted));\r | |
e17c1f86 | 1969 | if(fillEventPlane) {\r |
1970 | fCosPhiMaps->Fill(&valuensparseh[0]);\r | |
6733d981 | 1971 | if((valuefractioncont[1] >=0) && (valuefractioncont[1] < 11)){\r |
1972 | if(fContamination[((Int_t)valuefractioncont[1])]){\r | |
1973 | Double_t weight = fContamination[((Int_t)valuefractioncont[1])]->Eval(track->P());\r | |
1974 | if(weight<0.0) weight=0.0;\r | |
1975 | if(weight>1.0) weight=1.0;\r | |
1976 | fFractionContamination->Fill(&valuefractioncont[0],weight);\r | |
6b2521a4 | 1977 | if(fv2contamination[((Int_t)valuefractioncont[1])]){\r |
1978 | Double_t v2 = fv2contamination[((Int_t)valuefractioncont[1])]->Eval(track->Pt());\r | |
1979 | fContaminationv2->Fill(valuefractioncont[1],valuefractioncont[0],v2,weight);\r | |
1980 | }\r | |
6733d981 | 1981 | } \r |
1982 | }\r | |
7b5936fc | 1983 | if(fMonitorEventPlane) {\r |
e17c1f86 | 1984 | fProfileCosPhiMaps->Fill(valuensparsehprofile[1],valuensparsehprofile[2],valuensparseh[0]);\r |
1985 | }\r | |
1986 | }\r | |
1987 | \r | |
7b5936fc | 1988 | if(fMonitorPhotonic) {\r |
0e30407a | 1989 | // background\r |
1990 | Int_t source = 0;\r | |
1991 | Int_t indexmother = -1;\r | |
1992 | source = FindMother(TMath::Abs(track->GetLabel()),mcEvent, indexmother);\r | |
1993 | valuensparseMCSourceDeltaPhiMaps[2] = source;\r | |
1994 | if(mcEvent) fMCSourceDeltaPhiMaps->Fill(&valuensparseMCSourceDeltaPhiMaps[0]);\r | |
6733d981 | 1995 | LookAtNonHFE(k,track,fInputEvent,mcEvent,binct,deltaphi,source,indexmother);\r |
1996 | //Int_t taggedvalue = LookAtNonHFE(k,track,fInputEvent,mcEvent,binct,deltaphi,source,indexmother);\r | |
1997 | /*\r | |
0e30407a | 1998 | if(fillEventPlane) {\r |
1999 | // No opposite charge partner found in the invariant mass choosen\r | |
2000 | if((taggedvalue!=2) && (taggedvalue!=6)) {\r | |
2001 | fDeltaPhiMapsTaggedNonPhotonic->Fill(&valuensparseg[0]);\r | |
2002 | fCosPhiMapsTaggedNonPhotonic->Fill(&valuensparseh[0]);\r | |
2003 | }\r | |
2004 | // One opposite charge partner found in the invariant mass choosen\r | |
2005 | if((taggedvalue==2) || (taggedvalue==6)) {\r | |
2006 | fDeltaPhiMapsTaggedPhotonic->Fill(&valuensparseg[0]);\r | |
2007 | fCosPhiMapsTaggedPhotonic->Fill(&valuensparseh[0]);\r | |
2008 | }\r | |
2009 | // One same charge partner found in the invariant mass choosen\r | |
2010 | if((taggedvalue==4) || (taggedvalue==6)) {\r | |
2011 | fDeltaPhiMapsTaggedPhotonicLS->Fill(&valuensparseg[0]);\r | |
2012 | fCosPhiMapsTaggedPhotonicLS->Fill(&valuensparseh[0]);\r | |
2013 | }\r | |
2014 | }\r | |
6733d981 | 2015 | */\r |
0e30407a | 2016 | }\r |
8c1c76e9 | 2017 | \r |
2018 | }\r | |
2019 | \r | |
2020 | //////////////////////////////////////////////////////////////////////////////\r | |
2021 | ///////////////////////////AFTERBURNER\r | |
7b5936fc | 2022 | if (fAfterBurnerOn & fMonitorQCumulant)\r |
8c1c76e9 | 2023 | {\r |
2024 | fflowEvent->AddFlow(fV1,fV2,fV3,fV4,fV5); //add flow\r | |
2025 | fflowEvent->CloneTracks(fNonFlowNumberOfTrackClones); //add nonflow by cloning tracks\r | |
2026 | }\r | |
2027 | //////////////////////////////////////////////////////////////////////////////\r | |
2028 | \r | |
2029 | \r | |
2030 | \r | |
7f695a7b | 2031 | //for(Int_t bincless = 0; bincless < fNbBinsCentralityQCumulant; bincless++) {\r |
2032 | // if((fBinCentralityLess[bincless]< cntr) && (cntr < fBinCentralityLess[bincless+1])) PostData(bincless+2,fflowEvent);\r | |
2033 | //}\r | |
0e30407a | 2034 | \r |
7b5936fc | 2035 | if(fMonitorPhotonic) {\r |
2036 | if(fArraytrack) {\r | |
2037 | delete fArraytrack;\r | |
2038 | fArraytrack = NULL;\r | |
2039 | }\r | |
0e30407a | 2040 | }\r |
16bbbe1c | 2041 | \r |
2042 | if((cntr>20) && (cntr<40)) fMultEv->Fill(nboftrackTPCcut);\r | |
8c1c76e9 | 2043 | \r |
8c1c76e9 | 2044 | PostData(1, fListHist);\r |
2045 | \r | |
8c1c76e9 | 2046 | \r |
2047 | }\r | |
2048 | //______________________________________________________________________________\r | |
2049 | AliFlowCandidateTrack *AliAnalysisTaskHFEFlow::MakeTrack( Double_t mass, \r | |
2050 | Double_t pt, Double_t phi, Double_t eta) {\r | |
2051 | //\r | |
2052 | // Make Track (Not needed actually)\r | |
2053 | //\r | |
2054 | \r | |
2055 | AliFlowCandidateTrack *sTrack = new AliFlowCandidateTrack();\r | |
2056 | sTrack->SetMass(mass);\r | |
2057 | sTrack->SetPt(pt);\r | |
2058 | sTrack->SetPhi(phi);\r | |
2059 | sTrack->SetEta(eta);\r | |
2060 | sTrack->SetForPOISelection(kTRUE);\r | |
2061 | sTrack->SetForRPSelection(kFALSE);\r | |
2062 | return sTrack;\r | |
2063 | }\r | |
2064 | //_________________________________________________________________________________ \r | |
2065 | Double_t AliAnalysisTaskHFEFlow::GetPhiAfterAddV2(Double_t phi,Double_t reactionPlaneAngle) const\r | |
2066 | {\r | |
2067 | //\r | |
2068 | // Adds v2, uses Newton-Raphson iteration\r | |
2069 | //\r | |
2070 | Double_t phiend=phi;\r | |
2071 | Double_t phi0=phi;\r | |
2072 | Double_t f=0.;\r | |
2073 | Double_t fp=0.;\r | |
2074 | Double_t phiprev=0.;\r | |
2075 | \r | |
2076 | for (Int_t i=0; i<fMaxNumberOfIterations; i++)\r | |
2077 | {\r | |
2078 | phiprev=phiend; //store last value for comparison\r | |
2079 | f = phiend-phi0+fV2*TMath::Sin(2.*(phiend-reactionPlaneAngle));\r | |
2080 | fp = 1.0+2.0*fV2*TMath::Cos(2.*(phiend-reactionPlaneAngle)); //first derivative\r | |
2081 | phiend -= f/fp;\r | |
2082 | if (TMath::AreEqualAbs(phiprev,phiend,fPrecisionPhi)) break;\r | |
2083 | }\r | |
2084 | return phiend;\r | |
2085 | }\r | |
0e30407a | 2086 | //_____________________________________________________________________________________________\r |
2087 | Int_t AliAnalysisTaskHFEFlow::LookAtNonHFE(Int_t iTrack1, AliVTrack *track1, AliVEvent *vEvent, AliMCEvent *mcEvent,Int_t binct,Double_t deltaphi,Int_t source,Int_t indexmother)\r | |
2088 | { \r | |
2089 | //\r | |
2090 | // Look At Non HFE\r | |
2091 | //\r | |
2092 | \r | |
2093 | // return -1 if nothing\r | |
2094 | // return 2 if opposite charge within the mass range found\r | |
2095 | // return 4 if like charge within the mass range found\r | |
2096 | // return 6 if opposite charge and like charge within the mass range found\r | |
2097 | //\r | |
2098 | \r | |
2099 | Int_t taggedphotonic = -1;\r | |
2100 | \r | |
2101 | Bool_t oppositetaggedphotonic = kFALSE;\r | |
2102 | Bool_t sametaggedphotonic = kFALSE;\r | |
2103 | \r | |
7f695a7b | 2104 | AliDebug(2,Form("fCounterPoolBackground %d in LookAtNonHFE!!!",fCounterPoolBackground));\r |
0e30407a | 2105 | if(!fArraytrack) return taggedphotonic;\r |
7f695a7b | 2106 | AliDebug(2,Form("process track %d",iTrack1));\r |
0e30407a | 2107 | \r |
2108 | TVector3 v3D1;\r | |
2109 | TVector3 v3D2;\r | |
2110 | \r | |
2111 | Double_t valuensparseDeltaPhiMaps[5];\r | |
2112 | Double_t valueangle[3];\r | |
2113 | \r | |
2114 | valuensparseDeltaPhiMaps[1] = binct;\r | |
2115 | valuensparseDeltaPhiMaps[2] = track1->Pt();\r | |
2116 | valuensparseDeltaPhiMaps[0] = deltaphi;\r | |
2117 | valuensparseDeltaPhiMaps[4] = source;\r | |
2118 | \r | |
2119 | valueangle[2] = source;\r | |
2120 | valueangle[1] = binct;\r | |
2121 | \r | |
5cd679b7 | 2122 | // Pdg code\r |
2123 | Int_t pdg1 = CheckPdg(TMath::Abs(track1->GetLabel()),mcEvent);\r | |
2124 | Int_t numberfound = 0;\r | |
2125 | \r | |
0e30407a | 2126 | //Magnetic Field\r |
2127 | Double_t bfield = vEvent->GetMagneticField();\r | |
7b4c9210 | 2128 | \r |
2129 | // Get Primary vertex\r | |
2130 | const AliVVertex *pVtx = vEvent->GetPrimaryVertex();\r | |
0e30407a | 2131 | \r |
2132 | for(Int_t idex = 0; idex < fCounterPoolBackground; idex++) \r | |
2133 | {\r | |
2134 | \r | |
2135 | Int_t iTrack2 = fArraytrack->At(idex);\r | |
7f695a7b | 2136 | AliDebug(2,Form("track %d",iTrack2));\r |
0e30407a | 2137 | AliVTrack* track2 = (AliVTrack *) vEvent->GetTrack(iTrack2);\r |
2138 | if (!track2) \r | |
2139 | {\r | |
7f695a7b | 2140 | printf("ERROR: Could not receive track %d", iTrack2);\r |
0e30407a | 2141 | continue;\r |
2142 | }\r | |
2143 | if(iTrack2==iTrack1) continue;\r | |
7f695a7b | 2144 | AliDebug(2,"Different");\r |
0e30407a | 2145 | \r |
5cd679b7 | 2146 | // Reset the MC info\r |
2147 | valueangle[2] = source;\r | |
2148 | valuensparseDeltaPhiMaps[4] = source;\r | |
2149 | \r | |
0e30407a | 2150 | // track cuts and PID already done\r |
2151 | \r | |
2152 | // if MC look\r | |
5cd679b7 | 2153 | Int_t pdg2 = -100;\r |
0e30407a | 2154 | if(mcEvent) {\r |
2155 | Int_t source2 = 0;\r | |
2156 | Int_t indexmother2 = -1;\r | |
2157 | source2 = FindMother(TMath::Abs(track2->GetLabel()),mcEvent, indexmother2);\r | |
5cd679b7 | 2158 | pdg2 = CheckPdg(TMath::Abs(track2->GetLabel()),mcEvent);\r |
7b4c9210 | 2159 | if(source2 >=0 ) {\r |
5cd679b7 | 2160 | if((indexmother2 == indexmother) && (source == source2) && ((pdg1*pdg2)<0.0)) {\r |
7b4c9210 | 2161 | if(source == kElectronfromconversion) {\r |
2162 | valueangle[2] = kElectronfromconversionboth;\r | |
2163 | valuensparseDeltaPhiMaps[4] = kElectronfromconversionboth;\r | |
5cd679b7 | 2164 | numberfound++;\r |
7b4c9210 | 2165 | }\r |
2166 | if(source == kElectronfrompi0) {\r | |
2167 | valueangle[2] = kElectronfrompi0both;\r | |
2168 | valuensparseDeltaPhiMaps[4] = kElectronfrompi0both;\r | |
2169 | }\r | |
2170 | if(source == kElectronfrometa) {\r | |
2171 | valueangle[2] = kElectronfrometaboth;\r | |
2172 | valuensparseDeltaPhiMaps[4] = kElectronfrometaboth;\r | |
2173 | }\r | |
0e30407a | 2174 | }\r |
2175 | }\r | |
2176 | }\r | |
2177 | \r | |
2178 | if(fAlgorithmMA && (!fAODAnalysis))\r | |
2179 | {\r | |
2180 | // tracks\r | |
2181 | AliESDtrack *esdtrack2 = dynamic_cast<AliESDtrack *>(track2); \r | |
2182 | AliESDtrack *esdtrack1 = dynamic_cast<AliESDtrack *>(track1); \r | |
2183 | if((!esdtrack2) || (!esdtrack1)) continue;\r | |
2184 | \r | |
2185 | //Variables\r | |
2186 | Double_t p1[3];\r | |
2187 | Double_t p2[3];\r | |
2188 | Double_t xt1; //radial position track 1 at the DCA point\r | |
2189 | Double_t xt2; //radial position track 2 at the DCA point\r | |
2190 | //DCA track1-track2\r | |
2191 | Double_t dca12 = esdtrack2->GetDCA(esdtrack1,bfield,xt2,xt1);\r | |
2192 | \r | |
2193 | // Cut dca\r | |
2194 | if(dca12 > fMaxdca) continue;\r | |
2195 | \r | |
2196 | //Momento of the track extrapolated to DCA track-track \r | |
2197 | //Track1\r | |
2198 | Bool_t hasdcaT1 = esdtrack1->GetPxPyPzAt(xt1,bfield,p1);\r | |
2199 | //Track2\r | |
2200 | Bool_t hasdcaT2 = esdtrack2->GetPxPyPzAt(xt2,bfield,p2);\r | |
2201 | \r | |
2202 | if(!hasdcaT1 || !hasdcaT2) AliWarning("It could be a problem in the extrapolation");\r | |
2203 | \r | |
2204 | //track1-track2 Invariant Mass\r | |
2205 | Double_t eMass = 0.000510998910; //Electron mass in GeV\r | |
2206 | Double_t pP1 = sqrt(p1[0]*p1[0]+p1[1]*p1[1]+p1[2]*p1[2]); //Track 1 momentum\r | |
2207 | Double_t pP2 = sqrt(p2[0]*p2[0]+p2[1]*p2[1]+p2[2]*p2[2]); //Track 2 momentum\r | |
2208 | Double_t eE1 = TMath::Sqrt(pP1*pP1+eMass*eMass);\r | |
2209 | Double_t eE2 = TMath::Sqrt(pP2*pP2+eMass*eMass);\r | |
2210 | \r | |
2211 | //TLorentzVector v1(p1[0],p1[1],p1[2],sqrt(eMass*eMass+pP1*pP1));\r | |
2212 | //TLorentzVector v2(p2[0],p2[1],p2[2],sqrt(eMass*eMass+pP2*pP2));\r | |
2213 | //Double_t imass = (v1+v2).M(); //Invariant Mass\r | |
2214 | //Double_t angle3D = v1.Angle(v2.Vect()); //Opening Angle (Total Angle)\r | |
2215 | \r | |
2216 | // daughter\r | |
2217 | v3D1.SetXYZ(p1[0],p1[1],p1[2]);\r | |
2218 | v3D2.SetXYZ(p2[0],p2[1],p2[2]);\r | |
2219 | Double_t openingangle = TVector2::Phi_0_2pi(v3D2.Angle(v3D1));\r | |
2220 | \r | |
2221 | // mother\r | |
2222 | TVector3 motherrec = v3D1 + v3D2;\r | |
2223 | Double_t invmass = TMath::Sqrt((eE1+eE2)*(eE1+eE2)-(motherrec.Px()*motherrec.Px()+motherrec.Py()*motherrec.Py()+motherrec.Pz()*motherrec.Pz()));\r | |
2224 | \r | |
2225 | // xy\r | |
2226 | //TVector3 vectordiff = v3D1 - v3D2;\r | |
2227 | //Double_t diffphi = TVector2::Phi_0_2pi(vectordiff.Phi());\r | |
2228 | //Double_t massxy = TMath::Sqrt((eE1+eE2)*(eE1+eE2)-(pP1*pP1+pP2*pP2+2*pP1*pP2*TMath::Cos(diffphi)));\r | |
2229 | \r | |
2230 | // rz\r | |
2231 | //Double_t difftheta = TVector2::Phi_0_2pi(vectordiff.Eta());\r | |
2232 | //Double_t massrz = TMath::Sqrt((eE1+eE2)*(eE1+eE2)-(pP1*pP1+pP2*pP2+2*pP1*pP2*TMath::Cos(difftheta)));\r | |
2233 | \r | |
2234 | \r | |
2235 | Float_t fCharge1 = track1->Charge();\r | |
2236 | Float_t fCharge2 = track2->Charge();\r | |
2237 | \r | |
2238 | // Fill Histo\r | |
2239 | //valueangle[0] = diffphi;\r | |
2240 | //valueangle[1] = difftheta;\r | |
2241 | valueangle[0] = openingangle;\r | |
2242 | if((fCharge1*fCharge2)>0.0) fSameSignAngle->Fill(&valueangle[0]);\r | |
2243 | else fOppSignAngle->Fill(&valueangle[0]);\r | |
2244 | \r | |
2245 | // Cut\r | |
2246 | if(openingangle > fMaxopening3D) continue;\r | |
2247 | //if(difftheta > fMaxopeningtheta) continue;\r | |
2248 | //if(diffphi > fMaxopeningphi) continue;\r | |
2249 | \r | |
2250 | // Invmass\r | |
2251 | valuensparseDeltaPhiMaps[3] = invmass;\r | |
2252 | if((fCharge1*fCharge2)>0.0) fSameSignDeltaPhiMaps->Fill(&valuensparseDeltaPhiMaps[0]);\r | |
2253 | else fOppSignDeltaPhiMaps->Fill(&valuensparseDeltaPhiMaps[0]);\r | |
2254 | \r | |
2255 | // Cut\r | |
2256 | if(invmass < fMaxInvmass) {\r | |
2257 | if((fCharge1*fCharge2)<0.0) oppositetaggedphotonic=kTRUE;\r | |
2258 | if((fCharge1*fCharge2)>0.0) sametaggedphotonic=kTRUE;\r | |
2259 | }\r | |
2260 | \r | |
2261 | \r | |
2262 | }\r | |
2263 | else \r | |
2264 | {\r | |
2265 | Int_t fPDGtrack1 = 11; \r | |
2266 | Int_t fPDGtrack2 = 11;\r | |
2267 | \r | |
2268 | Float_t fCharge1 = track1->Charge();\r | |
2269 | Float_t fCharge2 = track2->Charge();\r | |
2270 | \r | |
2271 | if(fCharge1>0) fPDGtrack1 = -11;\r | |
2272 | if(fCharge2>0) fPDGtrack2 = -11;\r | |
2273 | \r | |
7b4c9210 | 2274 | AliKFParticle ktrack1(*track1, fPDGtrack1);\r |
2275 | AliKFParticle ktrack2(*track2, fPDGtrack2);\r | |
2276 | AliKFParticle recoGamma(ktrack1, ktrack2);\r | |
0e30407a | 2277 | \r |
2278 | //Reconstruction Cuts\r | |
7b4c9210 | 2279 | if(recoGamma.GetNDF()<1) continue;\r |
2280 | Double_t chi2OverNDF = recoGamma.GetChi2()/recoGamma.GetNDF();\r | |
0e30407a | 2281 | if(TMath::Sqrt(TMath::Abs(chi2OverNDF))>fChi2OverNDFCut) continue;\r |
5cd679b7 | 2282 | \r |
2283 | // DCA\r | |
2284 | //Double_t dca12 = ktrack1.GetDistanceFromParticle(ktrack2);\r | |
2285 | //if(dca12 > fMaxdca) continue; \r | |
2286 | \r | |
7b4c9210 | 2287 | // if set mass constraint\r |
2288 | if(fSetMassConstraint && pVtx) {\r | |
2289 | AliKFVertex primV(*pVtx);\r | |
2290 | primV += recoGamma;\r | |
5cd679b7 | 2291 | primV -= ktrack1;\r |
2292 | primV -= ktrack2;\r | |
7b4c9210 | 2293 | recoGamma.SetProductionVertex(primV);\r |
2294 | recoGamma.SetMassConstraint(0,0.0001);\r | |
2295 | } \r | |
2296 | \r | |
0e30407a | 2297 | //Invariant Mass\r |
2298 | Double_t imass; \r | |
2299 | Double_t width;\r | |
7b4c9210 | 2300 | recoGamma.GetMass(imass,width);\r |
0e30407a | 2301 | \r |
2302 | //Opening Angle (Total Angle)\r | |
7b4c9210 | 2303 | Double_t angle = ktrack1.GetAngle(ktrack2);\r |
0e30407a | 2304 | valueangle[0] = angle;\r |
2305 | if((fCharge1*fCharge2)>0.0) fSameSignAngle->Fill(&valueangle[0]);\r | |
7b4c9210 | 2306 | else fOppSignAngle->Fill(&valueangle[0]);\r |
2307 | \r | |
2308 | // Cut\r | |
2309 | if(angle > fMaxopening3D) continue; \r | |
0e30407a | 2310 | \r |
2311 | // Invmass\r | |
2312 | valuensparseDeltaPhiMaps[3] = imass;\r | |
2313 | if((fCharge1*fCharge2)>0.0) fSameSignDeltaPhiMaps->Fill(&valuensparseDeltaPhiMaps[0]);\r | |
5cd679b7 | 2314 | else {\r |
2315 | fOppSignDeltaPhiMaps->Fill(&valuensparseDeltaPhiMaps[0]);\r | |
2316 | /*\r | |
2317 | if(valueangle[2] == kElectronfromconversionboth) {\r | |
7f695a7b | 2318 | printf("Reconstructed charge1 %f, charge 2 %f and invmass %f",fCharge1,fCharge2,imass);\r |
2319 | printf("MC charge1 %d, charge 2 %d",pdg1,pdg2);\r | |
2320 | printf("DCA %f",dca12);\r | |
2321 | printf("Number of found %d",numberfound);\r | |
5cd679b7 | 2322 | }\r |
2323 | */\r | |
2324 | }\r | |
0e30407a | 2325 | \r |
2326 | // Cut\r | |
2327 | if(imass < fMaxInvmass) {\r | |
2328 | if((fCharge1*fCharge2)<0.0) oppositetaggedphotonic=kTRUE;\r | |
2329 | if((fCharge1*fCharge2)>0.0) sametaggedphotonic=kTRUE;\r | |
2330 | }\r | |
0e30407a | 2331 | }\r |
2332 | }\r | |
7b4c9210 | 2333 | \r |
0e30407a | 2334 | if(oppositetaggedphotonic && sametaggedphotonic){\r |
2335 | taggedphotonic = 6;\r | |
2336 | }\r | |
2337 | \r | |
2338 | if(!oppositetaggedphotonic && sametaggedphotonic){\r | |
2339 | taggedphotonic = 4;\r | |
2340 | }\r | |
2341 | \r | |
2342 | if(oppositetaggedphotonic && !sametaggedphotonic){\r | |
2343 | taggedphotonic = 2;\r | |
2344 | }\r | |
2345 | \r | |
2346 | \r | |
2347 | return taggedphotonic;\r | |
2348 | }\r | |
0e30407a | 2349 | //_________________________________________________________________________\r |
2350 | Int_t AliAnalysisTaskHFEFlow::FindMother(Int_t tr, AliMCEvent *mcEvent, Int_t &indexmother){\r | |
2351 | //\r | |
2352 | // Find the mother if MC\r | |
2353 | //\r | |
2354 | \r | |
2355 | if(!mcEvent) return 0;\r | |
7b4c9210 | 2356 | \r |
2357 | Int_t pdg = CheckPdg(tr,mcEvent);\r | |
2358 | if(TMath::Abs(pdg)!= 11) {\r | |
2359 | indexmother = -1;\r | |
2360 | return kNoElectron;\r | |
2361 | }\r | |
0e30407a | 2362 | \r |
2363 | indexmother = IsMotherGamma(tr,mcEvent);\r | |
2364 | if(indexmother > 0) return kElectronfromconversion;\r | |
2365 | indexmother = IsMotherPi0(tr,mcEvent);\r | |
2366 | if(indexmother > 0) return kElectronfrompi0;\r | |
2367 | indexmother = IsMotherC(tr,mcEvent);\r | |
2368 | if(indexmother > 0) return kElectronfromC;\r | |
2369 | indexmother = IsMotherB(tr,mcEvent);\r | |
2370 | if(indexmother > 0) return kElectronfromB;\r | |
2371 | indexmother = IsMotherEta(tr,mcEvent);\r | |
2372 | if(indexmother > 0) return kElectronfrometa;\r | |
2373 | \r | |
2374 | return kElectronfromother;\r | |
2375 | \r | |
2376 | \r | |
7b4c9210 | 2377 | }\r |
2378 | //____________________________________________________________________________________________________________\r | |
2379 | Int_t AliAnalysisTaskHFEFlow::CheckPdg(Int_t tr, AliMCEvent* mcEvent) {\r | |
2380 | \r | |
2381 | //\r | |
2382 | // Return the pdg of the particle\r | |
2383 | //\r | |
2384 | \r | |
7b4c9210 | 2385 | \r |
5cd679b7 | 2386 | Int_t pdgcode = -1;\r |
7b4c9210 | 2387 | if(tr < 0) return pdgcode;\r |
5cd679b7 | 2388 | \r |
2389 | if(!mcEvent) return pdgcode;\r | |
2390 | \r | |
7b4c9210 | 2391 | AliVParticle *mctrack = mcEvent->GetTrack(tr);\r |
2392 | \r | |
2393 | \r | |
2394 | if(mctrack->IsA() == AliMCParticle::Class()) {\r | |
2395 | AliMCParticle *mctrackesd = NULL;\r | |
2396 | if(!(mctrackesd = dynamic_cast<AliMCParticle *>(mcEvent->GetTrack(TMath::Abs(tr))))) return pdgcode;\r | |
2397 | pdgcode = mctrackesd->PdgCode();\r | |
2398 | }\r | |
2399 | \r | |
2400 | if(mctrack->IsA() == AliAODMCParticle::Class()) {\r | |
2401 | AliAODMCParticle *mctrackaod = NULL;\r | |
2402 | if(!(mctrackaod = dynamic_cast<AliAODMCParticle *>(mcEvent->GetTrack(TMath::Abs(tr))))) return pdgcode;\r | |
2403 | pdgcode = mctrackaod->GetPdgCode();\r | |
2404 | }\r | |
2405 | \r | |
2406 | return pdgcode;\r | |
2407 | \r | |
2408 | \r | |
0e30407a | 2409 | }\r |
2410 | //____________________________________________________________________________________________________________\r | |
2411 | Int_t AliAnalysisTaskHFEFlow::IsMotherGamma(Int_t tr, AliMCEvent* mcEvent) {\r | |
2412 | \r | |
2413 | //\r | |
2414 | // Return the lab of gamma mother or -1 if not gamma\r | |
2415 | //\r | |
2416 | \r | |
2417 | if(tr < 0) return -1;\r | |
2418 | AliVParticle *mctrack = mcEvent->GetTrack(tr);\r | |
2419 | \r | |
2420 | if(mctrack->IsA() == AliMCParticle::Class()) {\r | |
2421 | AliMCParticle *mctrackesd = NULL;\r | |
2422 | if(!(mctrackesd = dynamic_cast<AliMCParticle *>(mcEvent->GetTrack(TMath::Abs(tr))))) return -1;\r | |
2423 | TParticle *particle = 0x0;\r | |
2424 | particle = mctrackesd->Particle();\r | |
2425 | // Take mother\r | |
2426 | if(!particle) return -1;\r | |
2427 | Int_t imother = particle->GetFirstMother(); \r | |
2428 | if(imother < 0) return -1; \r | |
2429 | AliMCParticle *mothertrack = NULL;\r | |
2430 | if(!(mothertrack = dynamic_cast<AliMCParticle *>(mcEvent->GetTrack(TMath::Abs(imother))))) return -1;\r | |
2431 | TParticle * mother = mothertrack->Particle();\r | |
2432 | if(!mother) return -1;\r | |
2433 | // Check gamma \r | |
2434 | Int_t pdg = mother->GetPdgCode();\r | |
2435 | if(TMath::Abs(pdg) == 22) return imother;\r | |
2436 | if(TMath::Abs(pdg) == 11) {\r | |
2437 | return IsMotherGamma(imother,mcEvent);\r | |
2438 | }\r | |
2439 | return -1;\r | |
2440 | }\r | |
2441 | \r | |
2442 | if(mctrack->IsA() == AliAODMCParticle::Class()) {\r | |
2443 | AliAODMCParticle *mctrackaod = NULL;\r | |
2444 | if(!(mctrackaod = dynamic_cast<AliAODMCParticle *>(mcEvent->GetTrack(TMath::Abs(tr))))) return -1;\r | |
2445 | // Take mother\r | |
2446 | Int_t imother = mctrackaod->GetMother();\r | |
2447 | if(imother < 0) return -1; \r | |
2448 | AliAODMCParticle *mothertrack = NULL;\r | |
2449 | if(!(mothertrack = dynamic_cast<AliAODMCParticle *>(mcEvent->GetTrack(TMath::Abs(imother))))) return -1;\r | |
2450 | // Check gamma \r | |
2451 | Int_t pdg = mothertrack->GetPdgCode();\r | |
2452 | if(TMath::Abs(pdg) == 22) return imother;\r | |
2453 | if(TMath::Abs(pdg) == 11) {\r | |
2454 | return IsMotherGamma(imother,mcEvent);\r | |
2455 | }\r | |
2456 | return -1;\r | |
2457 | \r | |
2458 | }\r | |
2459 | \r | |
2460 | return -1;\r | |
2461 | \r | |
2462 | \r | |
2463 | }\r | |
2464 | //\r | |
2465 | //____________________________________________________________________________________________________________\r | |
2466 | Int_t AliAnalysisTaskHFEFlow::IsMotherPi0(Int_t tr, AliMCEvent* mcEvent) {\r | |
2467 | \r | |
2468 | //\r | |
2469 | // Return the lab of pi0 mother or -1 if not pi0\r | |
2470 | //\r | |
2471 | \r | |
2472 | if(tr < 0) return -1;\r | |
2473 | AliVParticle *mctrack = mcEvent->GetTrack(tr);\r | |
2474 | \r | |
2475 | if(mctrack->IsA() == AliMCParticle::Class()) {\r | |
2476 | AliMCParticle *mctrackesd = NULL;\r | |
2477 | if(!(mctrackesd = dynamic_cast<AliMCParticle *>(mcEvent->GetTrack(TMath::Abs(tr))))) return -1;\r | |
2478 | TParticle *particle = 0x0;\r | |
2479 | particle = mctrackesd->Particle();\r | |
2480 | // Take mother\r | |
2481 | if(!particle) return -1;\r | |
2482 | Int_t imother = particle->GetFirstMother(); \r | |
2483 | if(imother < 0) return -1; \r | |
2484 | AliMCParticle *mothertrack = NULL;\r | |
2485 | if(!(mothertrack = dynamic_cast<AliMCParticle *>(mcEvent->GetTrack(TMath::Abs(imother))))) return -1;\r | |
2486 | TParticle * mother = mothertrack->Particle();\r | |
2487 | if(!mother) return -1;\r | |
2488 | // Check gamma \r | |
2489 | Int_t pdg = mother->GetPdgCode();\r | |
2490 | if(TMath::Abs(pdg) == 111) return imother;\r | |
2491 | if(TMath::Abs(pdg) == 11) {\r | |
2492 | return IsMotherPi0(imother,mcEvent);\r | |
2493 | }\r | |
2494 | return -1;\r | |
2495 | }\r | |
2496 | \r | |
2497 | if(mctrack->IsA() == AliAODMCParticle::Class()) {\r | |
2498 | AliAODMCParticle *mctrackaod = NULL;\r | |
2499 | if(!(mctrackaod = dynamic_cast<AliAODMCParticle *>(mcEvent->GetTrack(TMath::Abs(tr))))) return -1;\r | |
2500 | // Take mother\r | |
2501 | Int_t imother = mctrackaod->GetMother();\r | |
2502 | if(imother < 0) return -1; \r | |
2503 | AliAODMCParticle *mothertrack = NULL;\r | |
2504 | if(!(mothertrack = dynamic_cast<AliAODMCParticle *>(mcEvent->GetTrack(TMath::Abs(imother))))) return -1;\r | |
2505 | // Check gamma \r | |
2506 | Int_t pdg = mothertrack->GetPdgCode();\r | |
2507 | if(TMath::Abs(pdg) == 111) return imother;\r | |
2508 | if(TMath::Abs(pdg) == 11) {\r | |
2509 | return IsMotherPi0(imother,mcEvent);\r | |
2510 | }\r | |
2511 | return -1;\r | |
2512 | }\r | |
2513 | \r | |
2514 | return -1;\r | |
2515 | \r | |
2516 | }\r | |
2517 | //____________________________________________________________________________________________________________\r | |
2518 | Int_t AliAnalysisTaskHFEFlow::IsMotherC(Int_t tr, AliMCEvent* mcEvent) {\r | |
2519 | \r | |
2520 | //\r | |
2521 | // Return the lab of signal mother or -1 if not signal\r | |
2522 | //\r | |
2523 | \r | |
2524 | if(tr < 0) return -1;\r | |
2525 | AliVParticle *mctrack = mcEvent->GetTrack(tr);\r | |
2526 | \r | |
2527 | if(mctrack->IsA() == AliMCParticle::Class()) {\r | |
2528 | AliMCParticle *mctrackesd = NULL;\r | |
2529 | if(!(mctrackesd = dynamic_cast<AliMCParticle *>(mcEvent->GetTrack(TMath::Abs(tr))))) return -1;\r | |
2530 | TParticle *particle = 0x0;\r | |
2531 | particle = mctrackesd->Particle();\r | |
2532 | // Take mother\r | |
2533 | if(!particle) return -1;\r | |
2534 | Int_t imother = particle->GetFirstMother(); \r | |
2535 | if(imother < 0) return -1; \r | |
2536 | AliMCParticle *mothertrack = NULL;\r | |
2537 | if(!(mothertrack = dynamic_cast<AliMCParticle *>(mcEvent->GetTrack(TMath::Abs(imother))))) return -1;\r | |
2538 | TParticle * mother = mothertrack->Particle();\r | |
2539 | if(!mother) return -1;\r | |
2540 | // Check gamma \r | |
2541 | Int_t pdg = mother->GetPdgCode();\r | |
2542 | if((TMath::Abs(pdg)==411) || (TMath::Abs(pdg)==421) || (TMath::Abs(pdg)==431) || (TMath::Abs(pdg)==4122) || (TMath::Abs(pdg)==4132) || (TMath::Abs(pdg)==4232) || (TMath::Abs(pdg)==43320)) return imother;\r | |
2543 | if(TMath::Abs(pdg) == 11) {\r | |
2544 | return IsMotherC(imother,mcEvent);\r | |
2545 | }\r | |
2546 | return -1;\r | |
2547 | }\r | |
2548 | \r | |
2549 | if(mctrack->IsA() == AliAODMCParticle::Class()) {\r | |
2550 | AliAODMCParticle *mctrackaod = NULL;\r | |
2551 | if(!(mctrackaod = dynamic_cast<AliAODMCParticle *>(mcEvent->GetTrack(TMath::Abs(tr))))) return -1;\r | |
2552 | // Take mother\r | |
2553 | Int_t imother = mctrackaod->GetMother();\r | |
2554 | if(imother < 0) return -1; \r | |
2555 | AliAODMCParticle *mothertrack = NULL;\r | |
2556 | if(!(mothertrack = dynamic_cast<AliAODMCParticle *>(mcEvent->GetTrack(TMath::Abs(imother))))) return -1;\r | |
2557 | // Check gamma \r | |
2558 | Int_t pdg = mothertrack->GetPdgCode();\r | |
2559 | if((TMath::Abs(pdg)==411) || (TMath::Abs(pdg)==421) || (TMath::Abs(pdg)==431) || (TMath::Abs(pdg)==4122) || (TMath::Abs(pdg)==4132) || (TMath::Abs(pdg)==4232) || (TMath::Abs(pdg)==43320)) return imother;\r | |
2560 | if(TMath::Abs(pdg) == 11) {\r | |
2561 | return IsMotherC(imother,mcEvent);\r | |
2562 | }\r | |
2563 | return -1;\r | |
2564 | }\r | |
2565 | \r | |
2566 | return -1;\r | |
2567 | \r | |
2568 | }\r | |
2569 | //____________________________________________________________________________________________________________\r | |
2570 | Int_t AliAnalysisTaskHFEFlow::IsMotherB(Int_t tr, AliMCEvent* mcEvent) {\r | |
2571 | \r | |
2572 | //\r | |
2573 | // Return the lab of signal mother or -1 if not signal\r | |
2574 | //\r | |
2575 | \r | |
2576 | if(tr < 0) return -1;\r | |
2577 | AliVParticle *mctrack = mcEvent->GetTrack(tr);\r | |
2578 | \r | |
2579 | if(mctrack->IsA() == AliMCParticle::Class()) {\r | |
2580 | AliMCParticle *mctrackesd = NULL;\r | |
2581 | if(!(mctrackesd = dynamic_cast<AliMCParticle *>(mcEvent->GetTrack(TMath::Abs(tr))))) return -1;\r | |
2582 | TParticle *particle = 0x0;\r | |
2583 | particle = mctrackesd->Particle();\r | |
2584 | // Take mother\r | |
2585 | if(!particle) return -1;\r | |
2586 | Int_t imother = particle->GetFirstMother(); \r | |
2587 | if(imother < 0) return -1; \r | |
2588 | AliMCParticle *mothertrack = NULL;\r | |
2589 | if(!(mothertrack = dynamic_cast<AliMCParticle *>(mcEvent->GetTrack(TMath::Abs(imother))))) return -1;\r | |
2590 | TParticle * mother = mothertrack->Particle();\r | |
2591 | if(!mother) return -1;\r | |
2592 | // Check gamma \r | |
2593 | Int_t pdg = mother->GetPdgCode();\r | |
2594 | if((TMath::Abs(pdg)==511) || (TMath::Abs(pdg)==521) || (TMath::Abs(pdg)==531) || (TMath::Abs(pdg)==5122) || (TMath::Abs(pdg)==5132) || (TMath::Abs(pdg)==5232) || (TMath::Abs(pdg)==53320)) return imother; \r | |
2595 | if(TMath::Abs(pdg) == 11) {\r | |
2596 | return IsMotherB(imother,mcEvent);\r | |
2597 | }\r | |
2598 | return -1;\r | |
2599 | }\r | |
2600 | \r | |
2601 | if(mctrack->IsA() == AliAODMCParticle::Class()) {\r | |
2602 | AliAODMCParticle *mctrackaod = NULL;\r | |
2603 | if(!(mctrackaod = dynamic_cast<AliAODMCParticle *>(mcEvent->GetTrack(TMath::Abs(tr))))) return -1;\r | |
2604 | // Take mother\r | |
2605 | Int_t imother = mctrackaod->GetMother();\r | |
2606 | if(imother < 0) return -1; \r | |
2607 | AliAODMCParticle *mothertrack = NULL;\r | |
2608 | if(!(mothertrack = dynamic_cast<AliAODMCParticle *>(mcEvent->GetTrack(TMath::Abs(imother))))) return -1;\r | |
2609 | // Check gamma \r | |
2610 | Int_t pdg = mothertrack->GetPdgCode();\r | |
2611 | if((TMath::Abs(pdg)==511) || (TMath::Abs(pdg)==521) || (TMath::Abs(pdg)==531) || (TMath::Abs(pdg)==5122) || (TMath::Abs(pdg)==5132) || (TMath::Abs(pdg)==5232) || (TMath::Abs(pdg)==53320)) return imother;\r | |
2612 | if(TMath::Abs(pdg) == 11) {\r | |
2613 | return IsMotherB(imother,mcEvent);\r | |
2614 | }\r | |
2615 | return -1;\r | |
2616 | }\r | |
2617 | \r | |
2618 | return -1;\r | |
2619 | \r | |
2620 | }\r | |
2621 | //____________________________________________________________________________________________________________\r | |
2622 | Int_t AliAnalysisTaskHFEFlow::IsMotherEta(Int_t tr, AliMCEvent* mcEvent) {\r | |
2623 | \r | |
2624 | //\r | |
2625 | // Return the lab of pi0 mother or -1 if not pi0\r | |
2626 | //\r | |
2627 | \r | |
2628 | if(tr < 0) return -1;\r | |
2629 | AliVParticle *mctrack = mcEvent->GetTrack(tr);\r | |
2630 | \r | |
2631 | if(mctrack->IsA() == AliMCParticle::Class()) {\r | |
2632 | AliMCParticle *mctrackesd = NULL;\r | |
2633 | if(!(mctrackesd = dynamic_cast<AliMCParticle *>(mcEvent->GetTrack(TMath::Abs(tr))))) return -1;\r | |
2634 | TParticle *particle = 0x0;\r | |
2635 | particle = mctrackesd->Particle();\r | |
2636 | // Take mother\r | |
2637 | if(!particle) return -1;\r | |
2638 | Int_t imother = particle->GetFirstMother(); \r | |
2639 | if(imother < 0) return -1; \r | |
2640 | AliMCParticle *mothertrack = NULL;\r | |
2641 | if(!(mothertrack = dynamic_cast<AliMCParticle *>(mcEvent->GetTrack(TMath::Abs(imother))))) return -1;\r | |
2642 | TParticle * mother = mothertrack->Particle();\r | |
2643 | if(!mother) return -1;\r | |
2644 | // Check gamma \r | |
2645 | Int_t pdg = mother->GetPdgCode();\r | |
2646 | if(TMath::Abs(pdg) == 221) return imother;\r | |
2647 | if(TMath::Abs(pdg) == 11) {\r | |
2648 | return IsMotherEta(imother,mcEvent);\r | |
2649 | }\r | |
2650 | return -1;\r | |
2651 | }\r | |
2652 | \r | |
2653 | if(mctrack->IsA() == AliAODMCParticle::Class()) {\r | |
2654 | AliAODMCParticle *mctrackaod = NULL;\r | |
2655 | if(!(mctrackaod = dynamic_cast<AliAODMCParticle *>(mcEvent->GetTrack(TMath::Abs(tr))))) return -1;\r | |
2656 | // Take mother\r | |
2657 | Int_t imother = mctrackaod->GetMother();\r | |
2658 | if(imother < 0) return -1; \r | |
2659 | AliAODMCParticle *mothertrack = NULL;\r | |
2660 | if(!(mothertrack = dynamic_cast<AliAODMCParticle *>(mcEvent->GetTrack(TMath::Abs(imother))))) return -1;\r | |
2661 | // Check gamma \r | |
2662 | Int_t pdg = mothertrack->GetPdgCode();\r | |
2663 | if(TMath::Abs(pdg) == 221) return imother;\r | |
2664 | if(TMath::Abs(pdg) == 11) {\r | |
2665 | return IsMotherEta(imother,mcEvent);\r | |
2666 | }\r | |
2667 | return -1;\r | |
2668 | }\r | |
2669 | \r | |
2670 | return -1;\r | |
2671 | \r | |
2672 | }\r |