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