]>
Commit | Line | Data |
---|---|---|
2bb2434e | 1 | /************************************************************************** |
2 | * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * | |
3 | * * | |
4803eb1f | 4 | * Author: Pedro Gonz??lez, Pedro Ladr??n de Guevara, Ernesto L??pez Torres, * |
0f8c33c1 | 5 | * Eulogio Serradilla, Ana Marin, Friederike Bock * |
6 | * Version 2 * | |
2bb2434e | 7 | * * |
8 | * Permission to use, copy, modify and distribute this software and its * | |
9 | * documentation strictly for non-commercial purposes is hereby granted * | |
10 | * without fee, provided that the above copyright notice appears in all * | |
11 | * copies and that both the copyright notice and this permission notice * | |
12 | * appear in the supporting documentation. The authors make no claims * | |
13 | * about the suitability of this software for any purpose. It is * | |
14 | * provided "as is" without express or implied warranty. * | |
15 | **************************************************************************/ | |
16 | ||
17 | // Analysis task for pi0->e+e-gamma (Dalitz decay) | |
0f8c33c1 | 18 | // Analysis task for chic->JPsi+gamma |
2bb2434e | 19 | |
20 | #include <vector> | |
21 | ||
22 | #include "TParticle.h" | |
23 | #include "TPDGCode.h" | |
24 | #include "TMCProcess.h" | |
25 | #include "TDatabasePDG.h" | |
26 | #include "TList.h" | |
27 | #include "TChain.h" | |
28 | #include "TDirectory.h" | |
0a2b2b4b | 29 | #include "TTree.h" |
30 | #include "TH1.h" | |
31 | #include "TH1F.h" | |
32 | #include "THnSparse.h" | |
33 | #include "TH2F.h" | |
2bb2434e | 34 | #include "AliStack.h" |
35 | #include "AliAnalysisManager.h" | |
36 | #include "AliESDInputHandler.h" | |
37 | #include "AliESDtrack.h" | |
38 | #include "AliMCEvent.h" | |
39 | #include "AliStack.h" | |
40 | #include "AliMCEventHandler.h" | |
41 | #include "AliPID.h" | |
42 | #include "AliLog.h" | |
43 | #include "AliESDtrackCuts.h" | |
44 | #include "AliESDpidCuts.h" | |
45 | #include "AliMCEvent.h" | |
46 | #include "AliESDv0.h" | |
47 | #include "AliESDEvent.h" | |
48 | #include "AliESDpid.h" | |
49 | #include "AliKFParticle.h" | |
50 | #include "AliMCEventHandler.h" | |
51 | #include "AliKFVertex.h" | |
52 | #include "AliTriggerAnalysis.h" | |
53 | #include "AliCentrality.h" | |
54 | #include "AliMultiplicity.h" | |
55 | #include "AliAnalysisTaskGammaConvDalitzV1.h" | |
0a2b2b4b | 56 | |
2bb2434e | 57 | |
58 | ClassImp( AliAnalysisTaskGammaConvDalitzV1 ) | |
59 | ||
60 | //----------------------------------------------------------------------------------------------- | |
61 | AliAnalysisTaskGammaConvDalitzV1::AliAnalysisTaskGammaConvDalitzV1(): | |
a280ac15 | 62 | fV0Reader(NULL), |
2bb2434e | 63 | fElecSelector(NULL), |
64 | fBGHandler(NULL), | |
65 | fESDEvent(NULL), | |
66 | fMCEvent(NULL), | |
67 | fMCStack(NULL), | |
68 | fCutFolder(NULL), | |
69 | fESDList(NULL), | |
70 | fBackList(NULL), | |
fcc79cf5 | 71 | fMotherList(NULL), |
2bb2434e | 72 | fTrueList(NULL), |
73 | fMCList(NULL), | |
d9d6352b | 74 | fQAFolder(NULL), |
2bb2434e | 75 | fOutputContainer(0), |
76 | fReaderGammas(NULL), | |
77 | fSelectorElectronIndex(0), | |
78 | fSelectorPositronIndex(0), | |
79 | fGoodGammas(NULL), | |
80 | fGoodVirtualGammas(NULL), | |
81 | fGoodElectrons(NULL), | |
82 | fGoodPositrons(NULL), | |
83 | fCutGammaArray(NULL), | |
84 | fCutElectronArray(NULL), | |
85 | fCutMesonArray(NULL), | |
86 | fGammasPool(NULL), | |
87 | fConversionCuts(NULL), | |
88 | hESDConvGammaPt(NULL), | |
2279d237 | 89 | hESDConvGammaEta(NULL), |
90 | hESDConvGammaZR(NULL), | |
2bb2434e | 91 | hESDDalitzElectronPt(NULL), |
92 | hESDDalitzPositronPt(NULL), | |
4803eb1f | 93 | hESDDalitzElectronPhi(NULL), |
94 | hESDDalitzPositronPhi(NULL), | |
95 | hESDDalitzElectronAfterPt(NULL), | |
96 | hESDDalitzPositronAfterPt(NULL), | |
2279d237 | 97 | hESDDalitzElectronAfterEta(NULL), |
98 | hESDDalitzPositronAfterEta(NULL), | |
4803eb1f | 99 | hESDDalitzElectronAfterPhi(NULL), |
100 | hESDDalitzPositronAfterPhi(NULL), | |
d9d6352b | 101 | hESDDalitzElectronAfterNClsITS(NULL), |
102 | hESDDalitzPositronAfterNClsITS(NULL), | |
4803eb1f | 103 | hESDDalitzElectronAfterNFindClsTPC(NULL), |
104 | hESDDalitzPositronAfterNFindClsTPC(NULL), | |
d9d6352b | 105 | hESDDalitzElectronAfterNClsTPC(NULL), |
106 | hESDDalitzPositronAfterNClsTPC(NULL), | |
f47b2bb5 | 107 | hESDDalitzElectronAfterNCrossedRowsTPC(NULL), |
108 | hESDDalitzPositronAfterNCrossedRowsTPC(NULL), | |
4803eb1f | 109 | hESDDalitzPosEleAfterDCAxy(NULL), |
110 | hESDDalitzPosEleAfterDCAz(NULL), | |
d9d6352b | 111 | hESDDalitzElectronAfterTPCdEdxVsP(NULL), |
112 | hESDDalitzPositronAfterTPCdEdxVsP(NULL), | |
113 | hESDDalitzElectronAfterTPCdEdxSignalVsP(NULL), | |
114 | hESDDalitzPositronAfterTPCdEdxSignalVsP(NULL), | |
115 | hESDDalitzElectronAfterTPCdEdxVsEta(NULL), | |
116 | hESDDalitzPositronAfterTPCdEdxVsEta(NULL), | |
117 | hESDDalitzElectronAfterTPCdEdxVsPhi(NULL), | |
118 | hESDDalitzPositronAfterTPCdEdxVsPhi(NULL), | |
4803eb1f | 119 | hESDMotherPhi(NULL), |
2bb2434e | 120 | hESDEposEnegPsiPairDPhi(NULL), |
a280ac15 | 121 | hESDEposEnegInvMassPt(NULL), |
30b9a400 | 122 | hESDEposEnegAfterMassCutInvMassPi0Pt(NULL), |
a1c2f90c | 123 | hESDEposEnegInvMassPi0Pt(NULL), |
0a2b2b4b | 124 | hESDEposEnegLikeSignBackInvMassPt(NULL), |
2bb2434e | 125 | hESDMotherInvMassPt(NULL), |
a280ac15 | 126 | hESDPi0MotherInvMassPt(NULL), |
127 | hESDPi0MotherDiffInvMassPt(NULL), | |
ae947965 | 128 | hESDPi0MotherDiffLimInvMassPt(NULL), |
2bb2434e | 129 | sESDMotherInvMassPtZM(NULL), |
130 | hESDMotherBackInvMassPt(NULL), | |
131 | sESDMotherBackInvMassPtZM(NULL), | |
ccfa8c0d | 132 | hMCAllGammaPt(NULL), |
ae947965 | 133 | hMCConvGammaPt(NULL), |
134 | hMCConvGammaRSPt(NULL), | |
ccfa8c0d | 135 | hMCAllPositronsPt(NULL), |
136 | hMCAllElectronsPt(NULL), | |
2d49ea4c | 137 | hMCConvGammaEta(NULL), |
138 | hMCAllPositronsEta(NULL), | |
139 | hMCAllElectronsEta(NULL), | |
ccfa8c0d | 140 | hMCPi0DalitzGammaPt(NULL), |
141 | hMCPi0DalitzElectronPt(NULL), | |
142 | hMCPi0DalitzPositronPt(NULL), | |
2bb2434e | 143 | hMCPi0Pt(NULL), |
a280ac15 | 144 | hMCPi0GGPt(NULL), |
2bb2434e | 145 | hMCEtaPt(NULL), |
a280ac15 | 146 | hMCEtaGGPt(NULL), |
2bb2434e | 147 | hMCPi0InAccPt(NULL), |
148 | hMCEtaInAccPt(NULL), | |
0f8c33c1 | 149 | hMCChiCPt(NULL), |
150 | hMCChiCInAccPt(NULL), | |
f4d5bd23 | 151 | hMCPi0EposEnegInvMassPt(NULL), |
152 | hMCEtaEposEnegInvMassPt(NULL), | |
ccfa8c0d | 153 | hESDEposEnegTruePi0DalitzInvMassPt(NULL), |
2d49ea4c | 154 | hESDEposEnegTruePrimPi0DalitzInvMass(NULL), |
a072aeaa | 155 | hESDEposEnegTruePi0DalitzPsiPairDPhi(NULL), |
ccfa8c0d | 156 | hESDEposEnegTrueEtaDalitzInvMassPt(NULL), |
2d49ea4c | 157 | hESDEposEnegTruePrimEtaDalitzInvMass(NULL), |
a072aeaa | 158 | hESDEposEnegTrueEtaDalitzPsiPairDPhi(NULL), |
ccfa8c0d | 159 | hESDEposEnegTruePhotonInvMassPt(NULL), |
f4d5bd23 | 160 | hESDEposEnegTrueInvMassPt(NULL), |
a072aeaa | 161 | hESDEposEnegTruePhotonPsiPairDPhi(NULL), |
30b9a400 | 162 | hESDEposEnegTruePhotonPsiPairDPhiPtCut(NULL), |
0f8c33c1 | 163 | hESDEposEnegTrueJPsiInvMassPt(NULL), |
164 | hESDTrueMotherChiCInvMassPt(NULL), | |
ae947965 | 165 | hESDTrueMotherChiCDiffInvMassPt(NULL), |
2bb2434e | 166 | hESDTrueMotherInvMassPt(NULL), |
4803eb1f | 167 | hESDTrueMotherDalitzInvMassPt(NULL), |
2bb2434e | 168 | hESDTrueMotherPi0GGInvMassPt(NULL), |
86eaf9ae | 169 | hESDTruePrimaryMotherPi0GGInvMassPt(NULL), |
170 | hESDTrueSecondaryMotherPi0GGInvMassPt(NULL), | |
2bb2434e | 171 | hESDTruePrimaryMotherInvMassMCPt(NULL), |
86eaf9ae | 172 | hESDTruePrimaryMotherInvMassPt(NULL), |
173 | hESDTruePrimaryMotherW0WeightingInvMassPt(NULL), | |
2bb2434e | 174 | hESDTruePrimaryPi0DalitzESDPtMCPt(NULL), |
175 | hESDTrueSecondaryMotherInvMassPt(NULL), | |
176 | hESDTrueSecondaryMotherFromK0sInvMassPt(NULL), | |
177 | hESDTrueBckGGInvMassPt(NULL), | |
178 | hESDTrueBckContInvMassPt(NULL), | |
179 | hESDTrueMotherGGInvMassPt(NULL), | |
180 | hESDTrueConvGammaPt(NULL), | |
ccfa8c0d | 181 | hESDTruePositronPt(NULL), |
182 | hESDTrueElectronPt(NULL), | |
ae947965 | 183 | hESDTrueSecConvGammaPt(NULL), |
184 | hESDTrueSecPositronPt(NULL), | |
185 | hESDTrueSecElectronPt(NULL), | |
ccfa8c0d | 186 | hESDTruePi0DalitzConvGammaPt(NULL), |
187 | hESDTruePi0DalitzPositronPt(NULL), | |
188 | hESDTruePi0DalitzElectronPt(NULL), | |
ae947965 | 189 | hESDTruePi0DalitzSecConvGammaPt(NULL), |
190 | hESDTruePi0DalitzSecPositronPt(NULL), | |
191 | hESDTruePi0DalitzSecElectronPt(NULL), | |
2bb2434e | 192 | hNEvents(NULL), |
193 | hNGoodESDTracks(NULL), | |
58326f11 | 194 | hNGoodESDTracksVsNGoodGammas(NULL), |
195 | hNGoodESDTracksVsNGoodVGammas(NULL), | |
7b3733f6 | 196 | hNV0Tracks(NULL), |
8a52eed5 | 197 | hEtaShift(NULL), |
2bb2434e | 198 | fRandom(0), |
199 | fUnsmearedPx(NULL), | |
200 | fUnsmearedPy(NULL), | |
201 | fUnsmearedPz(NULL), | |
202 | fUnsmearedE(NULL), | |
30b9a400 | 203 | fUnsmearedVPx(NULL), |
204 | fUnsmearedVPy(NULL), | |
205 | fUnsmearedVPz(NULL), | |
206 | fUnsmearedVE(NULL), | |
2bb2434e | 207 | fnCuts(0), |
208 | fiCut(0), | |
209 | fNumberOfESDTracks(0), | |
58326f11 | 210 | fNumberOfESDTrackskBoth(0), |
a1c2f90c | 211 | fNVirtualGammas(0), |
2bb2434e | 212 | fMoveParticleAccordingToVertex(kFALSE), |
213 | fIsHeavyIon(kFALSE), | |
ae947965 | 214 | fDoMesonAnalysis(kTRUE), |
fcc79cf5 | 215 | fDoChicAnalysis(kFALSE), |
216 | fDoMesonQA(kFALSE), | |
2d49ea4c | 217 | fSetProductionVertextoVGamma(kTRUE), |
ae947965 | 218 | fIsFromMBHeader(kTRUE), |
219 | fIsMC(kFALSE) | |
2bb2434e | 220 | { |
a280ac15 | 221 | |
2bb2434e | 222 | } |
223 | ||
224 | //----------------------------------------------------------------------------------------------- | |
225 | AliAnalysisTaskGammaConvDalitzV1::AliAnalysisTaskGammaConvDalitzV1( const char* name ): | |
226 | AliAnalysisTaskSE(name), | |
227 | fV0Reader(NULL), | |
228 | fElecSelector(NULL), | |
229 | fBGHandler(NULL), | |
230 | fESDEvent(NULL), | |
231 | fMCEvent(NULL), | |
232 | fMCStack(NULL), | |
233 | fCutFolder(NULL), | |
234 | fESDList(NULL), | |
235 | fBackList(NULL), | |
fcc79cf5 | 236 | fMotherList(NULL), |
2bb2434e | 237 | fTrueList(NULL), |
238 | fMCList(NULL), | |
d9d6352b | 239 | fQAFolder(NULL), |
2bb2434e | 240 | fOutputContainer(0), |
241 | fReaderGammas(NULL), | |
242 | fSelectorElectronIndex(0), | |
243 | fSelectorPositronIndex(0), | |
244 | fGoodGammas(NULL), | |
245 | fGoodVirtualGammas(NULL), | |
246 | fGoodElectrons(NULL), | |
247 | fGoodPositrons(NULL), | |
248 | fCutGammaArray(NULL), | |
249 | fCutElectronArray(NULL), | |
250 | fCutMesonArray(NULL), | |
251 | fGammasPool(NULL), | |
252 | fConversionCuts(NULL), | |
253 | hESDConvGammaPt(NULL), | |
2279d237 | 254 | hESDConvGammaEta(NULL), |
255 | hESDConvGammaZR(NULL), | |
2bb2434e | 256 | hESDDalitzElectronPt(NULL), |
257 | hESDDalitzPositronPt(NULL), | |
4803eb1f | 258 | hESDDalitzElectronPhi(NULL), |
259 | hESDDalitzPositronPhi(NULL), | |
260 | hESDDalitzElectronAfterPt(NULL), | |
261 | hESDDalitzPositronAfterPt(NULL), | |
2279d237 | 262 | hESDDalitzElectronAfterEta(NULL), |
263 | hESDDalitzPositronAfterEta(NULL), | |
4803eb1f | 264 | hESDDalitzElectronAfterPhi(NULL), |
265 | hESDDalitzPositronAfterPhi(NULL), | |
d9d6352b | 266 | hESDDalitzElectronAfterNClsITS(NULL), |
267 | hESDDalitzPositronAfterNClsITS(NULL), | |
4803eb1f | 268 | hESDDalitzElectronAfterNFindClsTPC(NULL), |
269 | hESDDalitzPositronAfterNFindClsTPC(NULL), | |
d9d6352b | 270 | hESDDalitzElectronAfterNClsTPC(NULL), |
271 | hESDDalitzPositronAfterNClsTPC(NULL), | |
f47b2bb5 | 272 | hESDDalitzElectronAfterNCrossedRowsTPC(NULL), |
273 | hESDDalitzPositronAfterNCrossedRowsTPC(NULL), | |
4803eb1f | 274 | hESDDalitzPosEleAfterDCAxy(NULL), |
275 | hESDDalitzPosEleAfterDCAz(NULL), | |
d9d6352b | 276 | hESDDalitzElectronAfterTPCdEdxVsP(NULL), |
277 | hESDDalitzPositronAfterTPCdEdxVsP(NULL), | |
278 | hESDDalitzElectronAfterTPCdEdxSignalVsP(NULL), | |
279 | hESDDalitzPositronAfterTPCdEdxSignalVsP(NULL), | |
280 | hESDDalitzElectronAfterTPCdEdxVsEta(NULL), | |
281 | hESDDalitzPositronAfterTPCdEdxVsEta(NULL), | |
282 | hESDDalitzElectronAfterTPCdEdxVsPhi(NULL), | |
283 | hESDDalitzPositronAfterTPCdEdxVsPhi(NULL), | |
4803eb1f | 284 | hESDMotherPhi(NULL), |
2bb2434e | 285 | hESDEposEnegPsiPairDPhi(NULL), |
a280ac15 | 286 | hESDEposEnegInvMassPt(NULL), |
30b9a400 | 287 | hESDEposEnegAfterMassCutInvMassPi0Pt(NULL), |
a1c2f90c | 288 | hESDEposEnegInvMassPi0Pt(NULL), |
0a2b2b4b | 289 | hESDEposEnegLikeSignBackInvMassPt(NULL), |
2bb2434e | 290 | hESDMotherInvMassPt(NULL), |
a280ac15 | 291 | hESDPi0MotherInvMassPt(NULL), |
292 | hESDPi0MotherDiffInvMassPt(NULL), | |
ae947965 | 293 | hESDPi0MotherDiffLimInvMassPt(NULL), |
2bb2434e | 294 | sESDMotherInvMassPtZM(NULL), |
295 | hESDMotherBackInvMassPt(NULL), | |
296 | sESDMotherBackInvMassPtZM(NULL), | |
ccfa8c0d | 297 | hMCAllGammaPt(NULL), |
ae947965 | 298 | hMCConvGammaPt(NULL), |
299 | hMCConvGammaRSPt(NULL), | |
ccfa8c0d | 300 | hMCAllPositronsPt(NULL), |
301 | hMCAllElectronsPt(NULL), | |
2d49ea4c | 302 | hMCConvGammaEta(NULL), |
303 | hMCAllPositronsEta(NULL), | |
304 | hMCAllElectronsEta(NULL), | |
ccfa8c0d | 305 | hMCPi0DalitzGammaPt(NULL), |
306 | hMCPi0DalitzElectronPt(NULL), | |
307 | hMCPi0DalitzPositronPt(NULL), | |
2bb2434e | 308 | hMCPi0Pt(NULL), |
a280ac15 | 309 | hMCPi0GGPt(NULL), |
2bb2434e | 310 | hMCEtaPt(NULL), |
a280ac15 | 311 | hMCEtaGGPt(NULL), |
2bb2434e | 312 | hMCPi0InAccPt(NULL), |
313 | hMCEtaInAccPt(NULL), | |
0f8c33c1 | 314 | hMCChiCPt(NULL), |
315 | hMCChiCInAccPt(NULL), | |
f4d5bd23 | 316 | hMCPi0EposEnegInvMassPt(NULL), |
317 | hMCEtaEposEnegInvMassPt(NULL), | |
ccfa8c0d | 318 | hESDEposEnegTruePi0DalitzInvMassPt(NULL), |
2d49ea4c | 319 | hESDEposEnegTruePrimPi0DalitzInvMass(NULL), |
a072aeaa | 320 | hESDEposEnegTruePi0DalitzPsiPairDPhi(NULL), |
ccfa8c0d | 321 | hESDEposEnegTrueEtaDalitzInvMassPt(NULL), |
2d49ea4c | 322 | hESDEposEnegTruePrimEtaDalitzInvMass(NULL), |
a072aeaa | 323 | hESDEposEnegTrueEtaDalitzPsiPairDPhi(NULL), |
ccfa8c0d | 324 | hESDEposEnegTruePhotonInvMassPt(NULL), |
f4d5bd23 | 325 | hESDEposEnegTrueInvMassPt(NULL), |
a072aeaa | 326 | hESDEposEnegTruePhotonPsiPairDPhi(NULL), |
30b9a400 | 327 | hESDEposEnegTruePhotonPsiPairDPhiPtCut(NULL), |
0f8c33c1 | 328 | hESDEposEnegTrueJPsiInvMassPt(NULL), |
329 | hESDTrueMotherChiCInvMassPt(NULL), | |
ae947965 | 330 | hESDTrueMotherChiCDiffInvMassPt(NULL), |
2bb2434e | 331 | hESDTrueMotherInvMassPt(NULL), |
4803eb1f | 332 | hESDTrueMotherDalitzInvMassPt(NULL), |
2bb2434e | 333 | hESDTrueMotherPi0GGInvMassPt(NULL), |
86eaf9ae | 334 | hESDTruePrimaryMotherPi0GGInvMassPt(NULL), |
335 | hESDTrueSecondaryMotherPi0GGInvMassPt(NULL), | |
2bb2434e | 336 | hESDTruePrimaryMotherInvMassMCPt(NULL), |
86eaf9ae | 337 | hESDTruePrimaryMotherInvMassPt(NULL), |
338 | hESDTruePrimaryMotherW0WeightingInvMassPt(NULL), | |
2bb2434e | 339 | hESDTruePrimaryPi0DalitzESDPtMCPt(NULL), |
340 | hESDTrueSecondaryMotherInvMassPt(NULL), | |
341 | hESDTrueSecondaryMotherFromK0sInvMassPt(NULL), | |
342 | hESDTrueBckGGInvMassPt(NULL), | |
343 | hESDTrueBckContInvMassPt(NULL), | |
344 | hESDTrueMotherGGInvMassPt(NULL), | |
345 | hESDTrueConvGammaPt(NULL), | |
ccfa8c0d | 346 | hESDTruePositronPt(NULL), |
347 | hESDTrueElectronPt(NULL), | |
ae947965 | 348 | hESDTrueSecConvGammaPt(NULL), |
349 | hESDTrueSecPositronPt(NULL), | |
350 | hESDTrueSecElectronPt(NULL), | |
ccfa8c0d | 351 | hESDTruePi0DalitzConvGammaPt(NULL), |
352 | hESDTruePi0DalitzPositronPt(NULL), | |
353 | hESDTruePi0DalitzElectronPt(NULL), | |
ae947965 | 354 | hESDTruePi0DalitzSecConvGammaPt(NULL), |
355 | hESDTruePi0DalitzSecPositronPt(NULL), | |
356 | hESDTruePi0DalitzSecElectronPt(NULL), | |
2bb2434e | 357 | hNEvents(NULL), |
358 | hNGoodESDTracks(NULL), | |
58326f11 | 359 | hNGoodESDTracksVsNGoodGammas(NULL), |
360 | hNGoodESDTracksVsNGoodVGammas(NULL), | |
7b3733f6 | 361 | hNV0Tracks(NULL), |
8a52eed5 | 362 | hEtaShift(NULL), |
2bb2434e | 363 | fRandom(0), |
364 | fUnsmearedPx(NULL), | |
365 | fUnsmearedPy(NULL), | |
366 | fUnsmearedPz(NULL), | |
367 | fUnsmearedE(NULL), | |
30b9a400 | 368 | fUnsmearedVPx(NULL), |
369 | fUnsmearedVPy(NULL), | |
370 | fUnsmearedVPz(NULL), | |
371 | fUnsmearedVE(NULL), | |
2bb2434e | 372 | fnCuts(0), |
373 | fiCut(0), | |
374 | fNumberOfESDTracks(0), | |
58326f11 | 375 | fNumberOfESDTrackskBoth(0), |
a1c2f90c | 376 | fNVirtualGammas(0), |
2bb2434e | 377 | fMoveParticleAccordingToVertex(kFALSE), |
378 | fIsHeavyIon(kFALSE), | |
ae947965 | 379 | fDoMesonAnalysis(kTRUE), |
fcc79cf5 | 380 | fDoChicAnalysis(kFALSE), |
381 | fDoMesonQA(kFALSE), | |
2d49ea4c | 382 | fSetProductionVertextoVGamma(kTRUE), |
ae947965 | 383 | fIsFromMBHeader(kTRUE), |
384 | fIsMC(kFALSE) | |
2bb2434e | 385 | { |
a280ac15 | 386 | DefineOutput(1, TList::Class()); |
2bb2434e | 387 | } |
388 | ||
389 | //----------------------------------------------------------------------------------------------- | |
390 | AliAnalysisTaskGammaConvDalitzV1::~AliAnalysisTaskGammaConvDalitzV1() | |
391 | { | |
a280ac15 | 392 | // |
393 | // virtual destructor | |
394 | // | |
2d49ea4c | 395 | |
a280ac15 | 396 | cout<<"Destructor"<<endl; |
2bb2434e | 397 | |
398 | if(fGoodGammas){ | |
399 | delete fGoodGammas; | |
400 | fGoodGammas = 0x0; | |
401 | } | |
402 | if(fGoodVirtualGammas){ | |
403 | delete fGoodVirtualGammas; | |
404 | fGoodGammas = 0x0; | |
405 | } | |
406 | if(fGoodElectrons){ | |
407 | delete fGoodGammas; | |
408 | fGoodGammas = 0x0; | |
409 | } | |
410 | if(fGoodPositrons){ | |
411 | delete fGoodGammas; | |
412 | fGoodGammas = 0x0; | |
413 | } | |
414 | if(fBGHandler){ | |
415 | delete[] fBGHandler; | |
416 | fBGHandler = 0x0; | |
417 | } | |
a280ac15 | 418 | if( fGammasPool ){ |
419 | delete[] fGammasPool; | |
420 | fGammasPool = 0x0; | |
421 | } | |
2bb2434e | 422 | } |
2bb2434e | 423 | //___________________________________________________________ |
424 | void AliAnalysisTaskGammaConvDalitzV1::InitBack(){ | |
425 | ||
2bb2434e | 426 | const Int_t nDim = 4; |
fcc79cf5 | 427 | Int_t nBins[nDim] = {800,250,7,4}; |
428 | Double_t xMin[nDim] = {0,0, 0,0}; | |
429 | Double_t xMax[nDim] = {0.8,25,7,4}; | |
430 | ||
431 | sESDMotherInvMassPtZM = new THnSparseF*[fnCuts]; | |
2bb2434e | 432 | sESDMotherBackInvMassPtZM = new THnSparseF*[fnCuts]; |
433 | ||
434 | fBGHandler = new AliGammaConversionAODBGHandler*[fnCuts]; | |
fcc79cf5 | 435 | //fBGHandlerRP = new AliConversionAODBGHandlerRP*[fnCuts]; |
2bb2434e | 436 | for(Int_t iCut = 0; iCut<fnCuts;iCut++){ |
fcc79cf5 | 437 | //if (((AliConversionMesonCuts*)fCutMesonArray->At(iCut))->DoBGCalculation()){ |
438 | ||
439 | ||
440 | TString cutstringElectron = ((AliDalitzElectronCuts*)fCutElectronArray->At(iCut))->GetCutNumber(); | |
441 | TString cutstringMeson = ((AliConversionMesonCuts*)fCutMesonArray->At(iCut))->GetCutNumber(); | |
442 | TString cutstringGamma = ((AliConversionCuts*)fCutGammaArray->At(iCut))->GetCutNumber(); | |
443 | ||
444 | ||
445 | ||
446 | Int_t collisionSystem = atoi((TString)(((AliConversionCuts*)fCutGammaArray->At(iCut))->GetCutNumber())(0,1)); | |
447 | Int_t centMin = atoi((TString)(((AliConversionCuts*)fCutGammaArray->At(iCut))->GetCutNumber())(1,1)); | |
448 | Int_t centMax = atoi((TString)(((AliConversionCuts*)fCutGammaArray->At(iCut))->GetCutNumber())(2,1)); | |
449 | ||
450 | if(collisionSystem == 1 || collisionSystem == 2 || | |
451 | collisionSystem == 5 || collisionSystem == 8 || | |
452 | collisionSystem == 9){ | |
453 | centMin = centMin*10; | |
454 | centMax = centMax*10; | |
455 | } | |
456 | else if(collisionSystem == 3 || collisionSystem == 6){ | |
457 | centMin = centMin*5; | |
458 | centMax = centMax*5; | |
459 | } | |
460 | else if(collisionSystem == 4 || collisionSystem == 7){ | |
461 | centMin = ((centMin*5)+45); | |
462 | centMax = ((centMax*5)+45); | |
463 | } | |
2bb2434e | 464 | |
465 | ||
fcc79cf5 | 466 | fBackList[iCut] = new TList(); |
467 | fBackList[iCut]->SetName(Form("%s_%s_%s Back histograms",cutstringGamma.Data(),cutstringElectron.Data(),cutstringMeson.Data())); | |
468 | fBackList[iCut]->SetOwner(kTRUE); | |
469 | fCutFolder[iCut]->Add(fBackList[iCut]); | |
2bb2434e | 470 | |
fcc79cf5 | 471 | sESDMotherBackInvMassPtZM[iCut] = new THnSparseF("Back_Back_InvMass_Pt_z_m","Back_Back_InvMass_Pt_z_m",nDim,nBins,xMin,xMax); |
472 | fBackList[iCut]->Add(sESDMotherBackInvMassPtZM[iCut]); | |
2bb2434e | 473 | |
fcc79cf5 | 474 | fMotherList[iCut] = new TList(); |
475 | fMotherList[iCut]->SetName(Form("%s_%s_%s Mother histograms",cutstringGamma.Data(),cutstringElectron.Data(),cutstringMeson.Data())); | |
476 | fMotherList[iCut]->SetOwner(kTRUE); | |
477 | fCutFolder[iCut]->Add(fMotherList[iCut]); | |
2bb2434e | 478 | |
fcc79cf5 | 479 | sESDMotherInvMassPtZM[iCut] = new THnSparseF("Back_Mother_InvMass_Pt_z_m","Back_Mother_InvMass_Pt_z_m",nDim,nBins,xMin,xMax); |
480 | fMotherList[iCut]->Add(sESDMotherInvMassPtZM[iCut]); | |
2bb2434e | 481 | |
fcc79cf5 | 482 | |
483 | fBGHandler[iCut] = new AliGammaConversionAODBGHandler( | |
484 | collisionSystem,centMin,centMax, | |
485 | ((AliDalitzElectronCuts*)fCutElectronArray->At(iCut))->NumberOfRotationEvents(), | |
486 | ((AliDalitzElectronCuts*)fCutElectronArray->At(iCut))->UseTrackMultiplicity()); | |
487 | ||
488 | if( ( (AliDalitzElectronCuts*)fCutElectronArray->At(iCut))->GetBKGMethod() == 3 ){ | |
a280ac15 | 489 | fGammasPool[iCut] = new TList(); |
fcc79cf5 | 490 | } |
a280ac15 | 491 | |
fcc79cf5 | 492 | //} |
493 | } | |
2bb2434e | 494 | } |
495 | ||
496 | //______________________________________________________________________ | |
497 | void AliAnalysisTaskGammaConvDalitzV1::UserCreateOutputObjects() | |
498 | { | |
a280ac15 | 499 | // |
500 | // Create ouput objects | |
501 | // | |
502 | ||
503 | // Create the output container | |
504 | if(fOutputContainer != NULL){ | |
505 | delete fOutputContainer; | |
506 | fOutputContainer = NULL; | |
507 | } | |
508 | if(fOutputContainer == NULL){ | |
509 | fOutputContainer = new TList(); | |
510 | fOutputContainer->SetOwner(kTRUE); | |
511 | } | |
512 | ||
513 | fGoodGammas = new TList(); | |
514 | //fGoodGammas->SetOwner(kTRUE); | |
515 | ||
516 | ||
517 | fGoodVirtualGammas = new TList(); | |
518 | //fGoodVirtualGammas->SetOwner(kTRUE); | |
519 | ||
520 | ||
521 | ||
a280ac15 | 522 | fGammasPool = new TList*[fnCuts]; |
523 | fCutFolder = new TList*[fnCuts]; | |
524 | fESDList = new TList*[fnCuts]; | |
525 | fBackList = new TList*[fnCuts]; | |
fcc79cf5 | 526 | fMotherList = new TList*[fnCuts]; |
d9d6352b | 527 | //fQAFolder = new TList*[fnCuts]; |
a280ac15 | 528 | hNEvents = new TH1I*[fnCuts]; |
529 | hNGoodESDTracks = new TH1I*[fnCuts]; | |
7b3733f6 | 530 | hNV0Tracks = new TH1I*[fnCuts]; |
8a52eed5 | 531 | hEtaShift = new TProfile*[fnCuts]; |
a280ac15 | 532 | hESDConvGammaPt = new TH1F*[fnCuts]; |
2279d237 | 533 | hESDConvGammaEta = new TH1F*[fnCuts]; |
d9d6352b | 534 | |
a280ac15 | 535 | hESDDalitzElectronPt = new TH1F*[fnCuts]; |
536 | hESDDalitzPositronPt = new TH1F*[fnCuts]; | |
4803eb1f | 537 | hESDDalitzElectronPhi = new TH1F*[fnCuts]; |
538 | hESDDalitzPositronPhi = new TH1F*[fnCuts]; | |
fcc79cf5 | 539 | |
540 | if( fDoMesonQA ) { | |
2279d237 | 541 | |
d9d6352b | 542 | fQAFolder = new TList*[fnCuts]; |
58326f11 | 543 | |
544 | hNGoodESDTracksVsNGoodGammas = new TH2F*[fnCuts]; | |
545 | hNGoodESDTracksVsNGoodVGammas = new TH2F*[fnCuts]; | |
4803eb1f | 546 | hESDDalitzElectronAfterPt = new TH1F*[fnCuts]; |
547 | hESDDalitzPositronAfterPt = new TH1F*[fnCuts]; | |
2279d237 | 548 | hESDDalitzElectronAfterEta = new TH1F*[fnCuts]; |
549 | hESDDalitzPositronAfterEta = new TH1F*[fnCuts]; | |
4803eb1f | 550 | hESDDalitzElectronAfterPhi = new TH1F*[fnCuts]; |
551 | hESDDalitzPositronAfterPhi = new TH1F*[fnCuts]; | |
d9d6352b | 552 | hESDDalitzElectronAfterNClsITS = new TH1F*[fnCuts]; |
553 | hESDDalitzPositronAfterNClsITS = new TH1F*[fnCuts]; | |
4803eb1f | 554 | hESDDalitzElectronAfterNFindClsTPC = new TH2F*[fnCuts]; |
555 | hESDDalitzPositronAfterNFindClsTPC = new TH2F*[fnCuts]; | |
d9d6352b | 556 | hESDDalitzElectronAfterNClsTPC = new TH2F*[fnCuts]; |
557 | hESDDalitzPositronAfterNClsTPC = new TH2F*[fnCuts]; | |
f47b2bb5 | 558 | hESDDalitzElectronAfterNCrossedRowsTPC = new TH2F*[fnCuts]; |
559 | hESDDalitzPositronAfterNCrossedRowsTPC = new TH2F*[fnCuts]; | |
4803eb1f | 560 | hESDDalitzPosEleAfterDCAxy = new TH2F*[fnCuts]; |
561 | hESDDalitzPosEleAfterDCAz = new TH2F*[fnCuts]; | |
d9d6352b | 562 | hESDDalitzElectronAfterTPCdEdxVsP = new TH2F*[fnCuts]; |
563 | hESDDalitzPositronAfterTPCdEdxVsP = new TH2F*[fnCuts]; | |
564 | hESDDalitzElectronAfterTPCdEdxSignalVsP = new TH2F*[fnCuts]; | |
565 | hESDDalitzPositronAfterTPCdEdxSignalVsP = new TH2F*[fnCuts]; | |
566 | hESDDalitzElectronAfterTPCdEdxVsEta = new TH2F*[fnCuts]; | |
567 | hESDDalitzPositronAfterTPCdEdxVsEta = new TH2F*[fnCuts]; | |
568 | hESDDalitzElectronAfterTPCdEdxVsPhi = new TH2F*[fnCuts]; | |
569 | hESDDalitzPositronAfterTPCdEdxVsPhi = new TH2F*[fnCuts]; | |
4803eb1f | 570 | hESDMotherPhi = new TH1F*[fnCuts]; |
a280ac15 | 571 | hESDEposEnegPsiPairDPhi = new TH2F*[fnCuts]; |
258b4572 | 572 | hESDEposEnegInvMassPt = new TH2F*[fnCuts]; |
30b9a400 | 573 | hESDEposEnegAfterMassCutInvMassPi0Pt = new TH2F*[fnCuts]; |
a1c2f90c | 574 | hESDEposEnegInvMassPi0Pt = new TH2F*[fnCuts]; |
258b4572 | 575 | hESDEposEnegLikeSignBackInvMassPt = new TH2F*[fnCuts]; |
d9d6352b | 576 | hESDConvGammaZR = new TH2F*[fnCuts]; |
fcc79cf5 | 577 | |
578 | } | |
579 | ||
580 | ||
581 | ||
a280ac15 | 582 | hESDMotherInvMassPt = new TH2F*[fnCuts]; |
fcc79cf5 | 583 | |
584 | if(fDoChicAnalysis) { | |
a280ac15 | 585 | hESDPi0MotherInvMassPt = new TH2F*[fnCuts]; |
586 | hESDPi0MotherDiffInvMassPt = new TH2F*[fnCuts]; | |
fcc79cf5 | 587 | hESDPi0MotherDiffLimInvMassPt = new TH2F*[fnCuts]; |
588 | } | |
589 | ||
590 | ||
a280ac15 | 591 | hESDMotherBackInvMassPt = new TH2F*[fnCuts]; |
592 | ||
593 | ||
594 | for(Int_t iCut = 0; iCut<fnCuts;iCut++){ | |
595 | ||
596 | ||
597 | TString cutstringElectron =((AliDalitzElectronCuts*)fCutElectronArray->At(iCut))->GetCutNumber(); | |
598 | TString cutstringMeson= ((AliConversionMesonCuts*)fCutMesonArray->At(iCut))->GetCutNumber(); | |
599 | TString cutstringGamma = ((AliConversionCuts*)fCutGammaArray->At(iCut))->GetCutNumber(); | |
600 | ||
601 | fCutFolder[iCut] = new TList(); | |
602 | fCutFolder[iCut]->SetName(Form("Cut Number %s_%s_%s",cutstringGamma.Data(),cutstringElectron.Data(),cutstringMeson.Data())); | |
603 | fCutFolder[iCut]->SetOwner(kTRUE); | |
604 | fOutputContainer->Add(fCutFolder[iCut]); | |
605 | ||
606 | fESDList[iCut] = new TList(); | |
607 | fESDList[iCut]->SetName(Form("%s_%s_%s ESD histograms",cutstringGamma.Data(),cutstringElectron.Data(),cutstringMeson.Data())); | |
608 | fESDList[iCut]->SetOwner(kTRUE); | |
d9d6352b | 609 | |
610 | ||
a280ac15 | 611 | hNEvents[iCut] = new TH1I("NEvents","NEvents",9,-0.5,8.5); |
612 | hNEvents[iCut]->GetXaxis()->SetBinLabel(1,"Accepted"); | |
613 | hNEvents[iCut]->GetXaxis()->SetBinLabel(2,"Centrality"); | |
614 | hNEvents[iCut]->GetXaxis()->SetBinLabel(3,"Missing MC"); | |
615 | hNEvents[iCut]->GetXaxis()->SetBinLabel(4,"Trigger"); | |
616 | hNEvents[iCut]->GetXaxis()->SetBinLabel(5,"Vertex Z"); | |
617 | hNEvents[iCut]->GetXaxis()->SetBinLabel(6,"Cont. Vertex"); | |
618 | hNEvents[iCut]->GetXaxis()->SetBinLabel(7,"Pile-Up"); | |
619 | hNEvents[iCut]->GetXaxis()->SetBinLabel(8,"no SDD"); | |
620 | hNEvents[iCut]->GetXaxis()->SetBinLabel(9,"no V0AND"); | |
621 | fESDList[iCut]->Add(hNEvents[iCut]); | |
622 | ||
623 | ||
624 | ||
a280ac15 | 625 | if(fIsHeavyIon) hNGoodESDTracks[iCut] = new TH1I("GoodESDTracks","GoodESDTracks",3000,0,3000); |
626 | else hNGoodESDTracks[iCut] = new TH1I("GoodESDTracks","GoodESDTracks",200,0,200); | |
627 | fESDList[iCut]->Add(hNGoodESDTracks[iCut]); | |
7b3733f6 | 628 | |
629 | ||
630 | if(fIsHeavyIon == 1) hNV0Tracks[iCut] = new TH1I("V0 Multiplicity","V0 Multiplicity",30000,0,30000); | |
631 | else if(fIsHeavyIon == 2) hNV0Tracks[iCut] = new TH1I("V0 Multiplicity","V0 Multiplicity",2500,0,2500); | |
632 | else hNV0Tracks[iCut] = new TH1I("V0 Multiplicity","V0 Multiplicity",1500,0,1500); | |
633 | fESDList[iCut]->Add(hNV0Tracks[iCut]); | |
634 | ||
a280ac15 | 635 | |
8a52eed5 | 636 | hEtaShift[iCut] = new TProfile("Eta Shift","Eta Shift",1, -0.5,0.5); |
637 | fESDList[iCut]->Add(hEtaShift[iCut]); | |
638 | ||
a280ac15 | 639 | hESDConvGammaPt[iCut] = new TH1F("ESD_ConvGamma_Pt","ESD_ConvGamma_Pt",250,0,25); |
640 | fESDList[iCut]->Add(hESDConvGammaPt[iCut]); | |
2279d237 | 641 | |
642 | hESDConvGammaEta[iCut] = new TH1F("ESD_ConvGamma_Eta","ESD_ConvGamma_Eta",600,-1.5,1.5); | |
643 | fESDList[iCut]->Add(hESDConvGammaEta[iCut]); | |
644 | ||
ae947965 | 645 | hESDDalitzElectronPt[iCut] = new TH1F("ESD_DalitzElectron_Pt","ESD_DalitzElectron_Pt",1000,0,25); |
a280ac15 | 646 | fESDList[iCut]->Add(hESDDalitzElectronPt[iCut]); |
647 | ||
ae947965 | 648 | hESDDalitzPositronPt[iCut] = new TH1F("ESD_DalitzPositron_Pt","ESD_DalitzPositron_Pt",1000,0,25); |
a280ac15 | 649 | fESDList[iCut]->Add(hESDDalitzPositronPt[iCut]); |
4803eb1f | 650 | |
651 | ||
652 | hESDDalitzElectronPhi[iCut] = new TH1F("ESD_DalitzElectron_Phi","ESD_DalitzElectron_Phi",360,0,2*TMath::Pi()); | |
653 | fESDList[iCut]->Add(hESDDalitzElectronPhi[iCut]); | |
654 | ||
655 | hESDDalitzPositronPhi[iCut] = new TH1F("ESD_DalitzPositron_Phi","ESD_DalitzPositron_Phi",360,0,2*TMath::Pi()); | |
656 | fESDList[iCut]->Add(hESDDalitzPositronPhi[iCut]); | |
657 | ||
fcc79cf5 | 658 | |
4803eb1f | 659 | |
fcc79cf5 | 660 | if ( fDoMesonQA ) { |
d9d6352b | 661 | |
662 | fQAFolder[iCut] = new TList(); | |
663 | fQAFolder[iCut]->SetName(Form("%s_%s_%s QA histograms",cutstringGamma.Data(),cutstringElectron.Data(),cutstringMeson.Data())); | |
664 | fQAFolder[iCut]->SetOwner(kTRUE); | |
665 | ||
666 | ||
fcc79cf5 | 667 | |
2d49ea4c | 668 | //const Int_t kDCABins=62; |
669 | //Double_t binsDCADummy[63]={-3.0,-2.7,-2.4,-2.1,-1.8,-1.5,-1.2,-0.9,-0.6,-0.3,-0.25,-0.2,-0.19,-0.18,-0.17,-0.16,-0.15,-0.14,-0.13,-0.12,-0.11,-0.10,-0.09,-0.08,-0.07,-0.06,-0.05,-0.04,-0.03,-0.02,-0.01,0.0,0.01,0.02,0.03,0.04,0.05,0.06,0.07,0.08,0.09,0.1,0.11,0.12,0.13,0.14,0.15,0.16,0.17,0.18,0.19,0.2,0.25,0.3,0.6,0.9,1.2,1.5,1.8,2.1,2.4,2.7,3.0}; | |
d9d6352b | 670 | |
671 | const Int_t kPtBins=110; | |
672 | Double_t binsPtDummy[kPtBins+1]; | |
673 | const Int_t kPBins = 109; | |
674 | Double_t binsPDummy[kPBins+1]; | |
675 | binsPtDummy[0]=0.0; | |
676 | binsPDummy[0]=0.05; | |
677 | ||
678 | for(Int_t i=1;i<kPtBins+1;i++) | |
679 | { | |
680 | if(binsPtDummy[i-1]+0.05<1.01) | |
681 | binsPtDummy[i]=binsPtDummy[i-1]+0.05; | |
682 | else | |
683 | binsPtDummy[i]=binsPtDummy[i-1]+0.1; | |
684 | ||
685 | } | |
686 | for(Int_t i=1; i<kPBins+1;i++){ | |
687 | ||
688 | if( binsPDummy[i-1]+0.05<1.01) | |
689 | binsPDummy[i] = binsPDummy[i-1]+0.05; | |
690 | else | |
691 | binsPDummy[i] = binsPDummy[i-1]+0.1; | |
692 | ||
693 | } | |
694 | ||
58326f11 | 695 | hNGoodESDTracksVsNGoodGammas[iCut] = new TH2F("hNGoodESDTracksVsNGoodGammas","hNGoodESDTracksVsNGoodGammas",200,-0.5,199.5,100,-0.5,99.5); |
696 | fQAFolder[iCut]->Add(hNGoodESDTracksVsNGoodGammas[iCut]); | |
697 | ||
698 | hNGoodESDTracksVsNGoodVGammas[iCut] = new TH2F("hNGoodESDTracksVsNVGoodVGammas","hNGoodESDTracksVsNGoodVGammas",200,-0.5,199.5,100,-0.5,99.5); | |
699 | fQAFolder[iCut]->Add(hNGoodESDTracksVsNGoodVGammas[iCut]); | |
7b3733f6 | 700 | |
258b4572 | 701 | hESDConvGammaZR[iCut]= new TH2F("ESD_ConvGamma_ConversionPoint_ZR","ESD_ConvGamma_ConversionPoint_ZR",1200,-150,150,480,0,120); |
d9d6352b | 702 | fQAFolder[iCut]->Add(hESDConvGammaZR[iCut]); |
703 | ||
4803eb1f | 704 | hESDDalitzElectronAfterPt[iCut] = new TH1F("ESD_DalitzElectron_After_Pt","ESD_DalitzElectron_After_Pt",1000,0,25); |
d9d6352b | 705 | fQAFolder[iCut]->Add(hESDDalitzElectronAfterPt[iCut]); |
a280ac15 | 706 | |
4803eb1f | 707 | hESDDalitzPositronAfterPt[iCut] = new TH1F("ESD_DalitzPositron_After_Pt","ESD_DalitzPositron_After_Pt",1000,0,25); |
d9d6352b | 708 | fQAFolder[iCut]->Add(hESDDalitzPositronAfterPt[iCut]); |
2279d237 | 709 | |
710 | hESDDalitzElectronAfterEta[iCut] = new TH1F("ESD_DalitzElectron_After_Eta","ESD_DalitzElectron_After_Eta",600,-1.5,1.5); | |
d9d6352b | 711 | fQAFolder[iCut]->Add(hESDDalitzElectronAfterEta[iCut]); |
2279d237 | 712 | |
713 | hESDDalitzPositronAfterEta[iCut] = new TH1F("ESD_DalitzPositron_After_Eta","ESD_DalitzElectron_After_Eta",600,-1.5,1.5); | |
d9d6352b | 714 | fQAFolder[iCut]->Add(hESDDalitzPositronAfterEta[iCut]); |
2279d237 | 715 | |
fcc79cf5 | 716 | |
4803eb1f | 717 | hESDDalitzElectronAfterPhi[iCut] = new TH1F("ESD_DalitzElectron_After_Phi","ESD_DalitzElectron_After_Phi",360,0,2*TMath::Pi()); |
d9d6352b | 718 | fQAFolder[iCut]->Add(hESDDalitzElectronAfterPhi[iCut]); |
a280ac15 | 719 | |
4803eb1f | 720 | hESDDalitzPositronAfterPhi[iCut] = new TH1F("ESD_DalitzPositron_After_Phi","ESD_DalitzPositron_After_Phi",360,0,2*TMath::Pi()); |
d9d6352b | 721 | fQAFolder[iCut]->Add(hESDDalitzPositronAfterPhi[iCut]); |
722 | ||
f47b2bb5 | 723 | hESDDalitzElectronAfterNClsITS[iCut] = new TH1F("ESD_DalitzElectron_After_NClsITS","ESD_DalitzElectron_After_NClsITS",7,0.,7.); |
d9d6352b | 724 | fQAFolder[iCut]->Add(hESDDalitzElectronAfterNClsITS[iCut]); |
725 | ||
f47b2bb5 | 726 | hESDDalitzPositronAfterNClsITS[iCut] = new TH1F("ESD_DalitzPositron_After_NClsITS","ESD_DalitzPositron_After_NClsITS",7,0.,7.); |
d9d6352b | 727 | fQAFolder[iCut]->Add(hESDDalitzPositronAfterNClsITS[iCut]); |
728 | ||
4803eb1f | 729 | |
f47b2bb5 | 730 | hESDDalitzElectronAfterNFindClsTPC[iCut] = new TH2F("ESD_DalitzElectron_After_NFindClsTPC","ESD_DalitzElectron_After_NFindClsTPC",60,0,1.5,kPtBins,binsPtDummy); |
d9d6352b | 731 | fQAFolder[iCut]->Add(hESDDalitzElectronAfterNFindClsTPC[iCut]); |
4803eb1f | 732 | |
f47b2bb5 | 733 | hESDDalitzPositronAfterNFindClsTPC[iCut] = new TH2F("ESD_DalitzPositron_After_NFindClsTPC","ESD_DalitzPositron_After_NFindClsTPC",60,0,1.5,kPtBins,binsPtDummy); |
d9d6352b | 734 | fQAFolder[iCut]->Add(hESDDalitzPositronAfterNFindClsTPC[iCut]); |
735 | ||
736 | ||
737 | hESDDalitzElectronAfterNClsTPC[iCut] = new TH2F("ESD_DalitzElectron_After_NClsTPC","ESD_DalitzElectron_After_NClsTPC",200,0,200,kPtBins,binsPtDummy); | |
738 | fQAFolder[iCut]->Add(hESDDalitzElectronAfterNClsTPC[iCut]); | |
739 | ||
740 | hESDDalitzPositronAfterNClsTPC[iCut] = new TH2F("ESD_DalitzPositron_After_NClsTPC","ESD_DalitzPositron_After_NClsTPC",200,0,200,kPtBins,binsPtDummy); | |
741 | fQAFolder[iCut]->Add(hESDDalitzPositronAfterNClsTPC[iCut]); | |
f47b2bb5 | 742 | |
743 | hESDDalitzPositronAfterNCrossedRowsTPC[iCut] = new TH2F("ESD_DalitzPositron_After_NCrossedRowsTPC","ESD_DalitzPositron_After_NCrossedRowsTPC",165,-0.5,164.5,kPtBins,binsPtDummy); | |
744 | fQAFolder[iCut]->Add(hESDDalitzPositronAfterNCrossedRowsTPC[iCut]); | |
d9d6352b | 745 | |
f47b2bb5 | 746 | hESDDalitzElectronAfterNCrossedRowsTPC[iCut] = new TH2F("ESD_DalitzElectron_After_NCrossedRowsTPC","ESD_DalitzElectron_After_NCrossedRowsTPC",165,-0.5,164.5,kPtBins,binsPtDummy); |
747 | fQAFolder[iCut]->Add(hESDDalitzElectronAfterNCrossedRowsTPC[iCut]); | |
748 | ||
2d49ea4c | 749 | hESDDalitzPosEleAfterDCAxy[iCut] = new TH2F("ESD_DalitzPosEle_After_DCAxy","ESD_DalitzPosEle_After_DCAxy",124,-0.62,0.62,kPtBins,binsPtDummy); |
d9d6352b | 750 | fQAFolder[iCut]->Add(hESDDalitzPosEleAfterDCAxy[iCut]); |
4803eb1f | 751 | |
2d49ea4c | 752 | hESDDalitzPosEleAfterDCAz[iCut] = new TH2F("ESD_DalitzPosEle_After_DCAz","ESD_DalitzPosEle_After_DCAz",200,-1.0,1.0,kPtBins,binsPtDummy); |
d9d6352b | 753 | fQAFolder[iCut]->Add(hESDDalitzPosEleAfterDCAz[iCut]); |
4803eb1f | 754 | |
d9d6352b | 755 | hESDDalitzElectronAfterTPCdEdxVsP[iCut] = new TH2F("ESD_DalitzElectron_After_TPCdEdxVsP","ESD_DalitzElectron_After_TPCdEdxVsP_After_TPCdEdx",kPBins,binsPDummy,200,-10,10); |
756 | fQAFolder[iCut]->Add(hESDDalitzElectronAfterTPCdEdxVsP[iCut]); | |
4803eb1f | 757 | |
d9d6352b | 758 | hESDDalitzPositronAfterTPCdEdxVsP[iCut] = new TH2F("ESD_DalitzPositron_After_TPCdEdxVsP","ESD_DalitzPositron_After_TPCdEdxVsP",kPBins,binsPDummy,200,-10,10); |
759 | fQAFolder[iCut]->Add(hESDDalitzPositronAfterTPCdEdxVsP[iCut]); | |
4803eb1f | 760 | |
d9d6352b | 761 | hESDDalitzElectronAfterTPCdEdxSignalVsP[iCut] =new TH2F("ESD_DalitzElectron_After_TPCdEdxSignalVsP","ESD_DalitzElectron_After_TPCdEdxSignalVsP" ,kPBins,binsPDummy,200,0.0,200); |
762 | fQAFolder[iCut]->Add(hESDDalitzElectronAfterTPCdEdxSignalVsP[iCut]); | |
763 | ||
764 | hESDDalitzPositronAfterTPCdEdxSignalVsP[iCut] =new TH2F("ESD_DalitzPositron_After_TPCdEdxSignalVsP","ESD_DalitzPositron_After_TPCdEdxSignalVsP" ,kPBins,binsPDummy,200,0.0,200); | |
765 | fQAFolder[iCut]->Add(hESDDalitzPositronAfterTPCdEdxSignalVsP[iCut]); | |
766 | ||
767 | hESDDalitzElectronAfterTPCdEdxVsEta[iCut] = new TH2F("ESD_DalitzElectron_After_TPCdEdxVsEta","ESD_DalitzElectron_After_TPCdEdxVsEta",140,-1.4,1.4,200,-10,10); | |
768 | fQAFolder[iCut]->Add(hESDDalitzElectronAfterTPCdEdxVsEta[iCut]); | |
769 | ||
770 | hESDDalitzPositronAfterTPCdEdxVsEta[iCut] = new TH2F("ESD_DalitzPositron_After_TPCdEdxVsEta","ESD_DalitzPositron_After_TPCdEdxVsEta",140,-1.4,1.4,200,-10,10); | |
771 | fQAFolder[iCut]->Add(hESDDalitzPositronAfterTPCdEdxVsEta[iCut]); | |
772 | ||
773 | hESDDalitzElectronAfterTPCdEdxVsPhi[iCut] = new TH2F("ESD_DalitzElectron_After_TPCdEdxVsPhi","ESD_DalitzElectron_After_TPCdEdxVsPhi",180,0,2*TMath::Pi(),200,-10,10); | |
774 | fQAFolder[iCut]->Add(hESDDalitzElectronAfterTPCdEdxVsPhi[iCut]); | |
775 | ||
776 | hESDDalitzPositronAfterTPCdEdxVsPhi[iCut] = new TH2F("ESD_DalitzPositron_After_TPCdEdxVsPhi","ESD_DalitzPositron_After_TPCdEdxVsPhi",180,0,2*TMath::Pi(),200,-10,10); | |
777 | fQAFolder[iCut]->Add(hESDDalitzPositronAfterTPCdEdxVsPhi[iCut]); | |
778 | ||
fcc79cf5 | 779 | hESDMotherPhi[iCut] = new TH1F("ESD_DalitzMother_Phi","ESD_DalitzMother_Phi",360,0,2*TMath::Pi()); |
d9d6352b | 780 | fQAFolder[iCut]->Add(hESDMotherPhi[iCut]); |
fcc79cf5 | 781 | |
a280ac15 | 782 | hESDEposEnegPsiPairDPhi[iCut] = new TH2F("ESD_EposEneg_PsiPair_DPhi","ESD_EposEneg_PsiPair_DPhi", 100, -1.0,1.0,100,-1.0,1.0 ); |
d9d6352b | 783 | fQAFolder[iCut]->Add(hESDEposEnegPsiPairDPhi[iCut]); |
a280ac15 | 784 | |
30b9a400 | 785 | hESDEposEnegInvMassPt[iCut] = new TH2F("ESD_EposEneg_InvMassPt","ESD_EposEneg_InvMassPt",4000,0.0,2.0,100,0.,10.); |
258b4572 | 786 | fQAFolder[iCut]->Add(hESDEposEnegInvMassPt[iCut]); |
0a2b2b4b | 787 | |
30b9a400 | 788 | hESDEposEnegAfterMassCutInvMassPi0Pt[iCut] = new TH2F("ESD_EposEneg_AfterMassCut_InvMassPi0Pt","ESD_EposEneg_AfterMassCut_InvMassPi0Pt",4000,0.0,2.0,100,0.,10.); |
789 | fQAFolder[iCut]->Add(hESDEposEnegAfterMassCutInvMassPi0Pt[iCut]); | |
790 | ||
a1c2f90c | 791 | |
792 | hESDEposEnegInvMassPi0Pt[iCut] = new TH2F("ESD_EposEneg_InvMassPi0Pt","ESD_EposEneg_InvMassPi0Pt",1000,0.0,0.5,100,0.,10.); | |
793 | fQAFolder[iCut]->Add(hESDEposEnegInvMassPi0Pt[iCut]); | |
794 | ||
795 | ||
796 | ||
30b9a400 | 797 | hESDEposEnegLikeSignBackInvMassPt[iCut] = new TH2F("ESD_EposEneg_LikeSignBack_InvMassPt","ESD_EposEneg_LikeSignBack_InvMassPt",4000,0.0,2.,100,0.,10.); |
258b4572 | 798 | fQAFolder[iCut]->Add(hESDEposEnegLikeSignBackInvMassPt[iCut]); |
fcc79cf5 | 799 | |
fcc79cf5 | 800 | |
d9d6352b | 801 | TAxis *AxisAfter = hESDDalitzElectronAfterTPCdEdxVsP[iCut]->GetXaxis(); |
802 | Int_t bins = AxisAfter->GetNbins(); | |
803 | Double_t from = AxisAfter->GetXmin(); | |
804 | Double_t to = AxisAfter->GetXmax(); | |
805 | Double_t *newBins = new Double_t[bins+1]; | |
806 | newBins[0] = from; | |
807 | Double_t factor = TMath::Power(to/from, 1./bins); | |
808 | for(Int_t i=1; i<=bins; ++i) newBins[i] = factor * newBins[i-1]; | |
809 | ||
810 | AxisAfter->Set(bins, newBins); | |
811 | AxisAfter = hESDDalitzElectronAfterTPCdEdxSignalVsP[iCut]->GetXaxis(); | |
812 | AxisAfter->Set(bins, newBins); | |
813 | ||
814 | AxisAfter = hESDDalitzPositronAfterTPCdEdxVsP[iCut]->GetXaxis(); | |
815 | AxisAfter->Set(bins, newBins); | |
fcc79cf5 | 816 | |
d9d6352b | 817 | AxisAfter = hESDDalitzPositronAfterTPCdEdxSignalVsP[iCut]->GetXaxis(); |
818 | AxisAfter->Set(bins,newBins); | |
e3d15e19 | 819 | |
820 | ||
d9d6352b | 821 | |
822 | delete [] newBins; | |
fcc79cf5 | 823 | |
e3d15e19 | 824 | |
e3d15e19 | 825 | |
826 | ||
d9d6352b | 827 | fCutFolder[iCut]->Add(fQAFolder[iCut]); |
fcc79cf5 | 828 | |
d9d6352b | 829 | |
fcc79cf5 | 830 | |
d9d6352b | 831 | } |
fcc79cf5 | 832 | |
d9d6352b | 833 | |
834 | ||
fcc79cf5 | 835 | |
a280ac15 | 836 | |
8a52eed5 | 837 | hESDMotherInvMassPt[iCut] = new TH2F("ESD_DalitzMother_InvMass_Pt","ESD_DalitzMother_InvMass_Pt",800,0,0.8,250,0,25); |
a280ac15 | 838 | fESDList[iCut]->Add(hESDMotherInvMassPt[iCut]); |
4803eb1f | 839 | |
fcc79cf5 | 840 | |
841 | if( fDoChicAnalysis) { | |
4803eb1f | 842 | |
a280ac15 | 843 | hESDPi0MotherInvMassPt[iCut] = new TH2F("ESD_Pi0Mother_InvMass_Pt","ESD_Pi0Mother_InvMass_Pt",4000,0,4,250,0,25); |
844 | fESDList[iCut]->Add(hESDPi0MotherInvMassPt[iCut]); | |
ccfa8c0d | 845 | |
a280ac15 | 846 | hESDPi0MotherDiffInvMassPt[iCut] = new TH2F("ESD_Pi0Mother_DiffInvMass_Pt","ESD_Pi0Mother_DiffInvMass_Pt",2000,0,2,250,0,25); |
847 | fESDList[iCut]->Add(hESDPi0MotherDiffInvMassPt[iCut]); | |
2bb2434e | 848 | |
ae947965 | 849 | hESDPi0MotherDiffLimInvMassPt[iCut] = new TH2F("ESD_Pi0Mother_DiffLimInvMass_Pt","ESD_Pi0Mother_DiffLimInvMass_Pt",2000,0,2,250,0,25); |
850 | fESDList[iCut]->Add(hESDPi0MotherDiffLimInvMassPt[iCut]); | |
fcc79cf5 | 851 | |
852 | } | |
853 | ||
2bb2434e | 854 | |
8a52eed5 | 855 | hESDMotherBackInvMassPt[iCut] = new TH2F("ESD_DalitzBackground_InvMass_Pt","ESD_DalitzBackground_InvMass_Pt",800,0,0.8,250,0,25); |
a280ac15 | 856 | fESDList[iCut]->Add(hESDMotherBackInvMassPt[iCut]); |
2bb2434e | 857 | |
d9d6352b | 858 | |
4803eb1f | 859 | |
860 | fCutFolder[iCut]->Add(fESDList[iCut]); | |
d9d6352b | 861 | |
862 | ||
2bb2434e | 863 | |
a280ac15 | 864 | } |
2bb2434e | 865 | |
a280ac15 | 866 | |
867 | InitBack(); // Init Background Handler | |
868 | ||
869 | ||
ae947965 | 870 | //if(MCEvent()){ |
871 | if( fIsMC ){ | |
a280ac15 | 872 | // MC Histogramms |
873 | fMCList = new TList*[fnCuts]; | |
874 | // True Histogramms | |
875 | fTrueList = new TList*[fnCuts]; | |
876 | hESDTrueConvGammaPt = new TH1F*[fnCuts]; | |
ccfa8c0d | 877 | hESDTruePositronPt = new TH1F*[fnCuts]; |
878 | hESDTrueElectronPt = new TH1F*[fnCuts]; | |
ae947965 | 879 | hESDTrueSecConvGammaPt = new TH1F*[fnCuts]; |
880 | hESDTrueSecPositronPt = new TH1F*[fnCuts]; | |
881 | hESDTrueSecElectronPt = new TH1F*[fnCuts]; | |
ccfa8c0d | 882 | hESDTruePi0DalitzConvGammaPt = new TH1F*[fnCuts]; |
883 | hESDTruePi0DalitzPositronPt = new TH1F*[fnCuts]; | |
884 | hESDTruePi0DalitzElectronPt = new TH1F*[fnCuts]; | |
ae947965 | 885 | hESDTruePi0DalitzSecConvGammaPt = new TH1F*[fnCuts]; |
886 | hESDTruePi0DalitzSecPositronPt = new TH1F*[fnCuts]; | |
887 | hESDTruePi0DalitzSecElectronPt = new TH1F*[fnCuts]; | |
a280ac15 | 888 | //if(fDoMesonAnalysis){ |
ae947965 | 889 | hMCAllGammaPt = new TH1F*[fnCuts]; |
890 | hMCConvGammaPt = new TH1F*[fnCuts]; | |
891 | hMCConvGammaRSPt = new TH1F*[fnCuts]; | |
ccfa8c0d | 892 | hMCAllPositronsPt = new TH1F*[fnCuts]; |
893 | hMCAllElectronsPt = new TH1F*[fnCuts]; | |
2d49ea4c | 894 | |
895 | if( fDoMesonQA ) { | |
896 | ||
897 | hMCConvGammaEta = new TH1F*[fnCuts]; | |
898 | hMCAllPositronsEta = new TH1F*[fnCuts]; | |
899 | hMCAllElectronsEta = new TH1F*[fnCuts]; | |
900 | ||
901 | } | |
ccfa8c0d | 902 | hMCPi0DalitzGammaPt = new TH1F*[fnCuts]; |
903 | hMCPi0DalitzElectronPt = new TH1F*[fnCuts]; | |
904 | hMCPi0DalitzPositronPt = new TH1F*[fnCuts]; | |
905 | ||
a280ac15 | 906 | hMCPi0Pt = new TH1F*[fnCuts]; |
907 | hMCPi0GGPt = new TH1F*[fnCuts]; | |
908 | hMCEtaPt = new TH1F*[fnCuts]; | |
909 | hMCEtaGGPt = new TH1F*[fnCuts]; | |
910 | hMCPi0InAccPt = new TH1F*[fnCuts]; | |
911 | hMCEtaInAccPt = new TH1F*[fnCuts]; | |
0f8c33c1 | 912 | hMCChiCPt = new TH1F*[fnCuts]; |
913 | hMCChiCInAccPt = new TH1F*[fnCuts]; | |
fcc79cf5 | 914 | |
915 | ||
916 | if ( fDoMesonQA ) { | |
f4d5bd23 | 917 | |
918 | hMCPi0EposEnegInvMassPt = new TH2F*[fnCuts]; | |
919 | hMCEtaEposEnegInvMassPt = new TH2F*[fnCuts]; | |
920 | ||
fcc79cf5 | 921 | hESDEposEnegTruePi0DalitzInvMassPt = new TH2F*[fnCuts]; |
2d49ea4c | 922 | hESDEposEnegTruePrimPi0DalitzInvMass = new TH1F*[fnCuts]; |
a072aeaa | 923 | hESDEposEnegTruePi0DalitzPsiPairDPhi = new TH2F*[fnCuts]; |
fcc79cf5 | 924 | hESDEposEnegTrueEtaDalitzInvMassPt = new TH2F*[fnCuts]; |
2d49ea4c | 925 | hESDEposEnegTruePrimEtaDalitzInvMass = new TH1F*[fnCuts]; |
a072aeaa | 926 | hESDEposEnegTrueEtaDalitzPsiPairDPhi = new TH2F*[fnCuts]; |
fcc79cf5 | 927 | hESDEposEnegTruePhotonInvMassPt = new TH2F*[fnCuts]; |
f4d5bd23 | 928 | hESDEposEnegTrueInvMassPt = new TH2F*[fnCuts]; |
a072aeaa | 929 | hESDEposEnegTruePhotonPsiPairDPhi = new TH2F*[fnCuts]; |
30b9a400 | 930 | hESDEposEnegTruePhotonPsiPairDPhiPtCut = new TH2F*[fnCuts]; |
fcc79cf5 | 931 | hESDEposEnegTrueJPsiInvMassPt = new TH2F*[fnCuts]; |
932 | } | |
ccfa8c0d | 933 | |
ccfa8c0d | 934 | |
fcc79cf5 | 935 | if( fDoChicAnalysis ){ |
0f8c33c1 | 936 | hESDTrueMotherChiCInvMassPt = new TH2F*[fnCuts]; |
ae947965 | 937 | hESDTrueMotherChiCDiffInvMassPt = new TH2F*[fnCuts]; |
fcc79cf5 | 938 | } |
939 | ||
940 | ||
a280ac15 | 941 | hESDTrueMotherInvMassPt = new TH2F*[fnCuts]; |
4803eb1f | 942 | hESDTrueMotherDalitzInvMassPt = new TH2F*[fnCuts]; |
a280ac15 | 943 | hESDTrueMotherPi0GGInvMassPt = new TH2F*[fnCuts]; |
86eaf9ae | 944 | hESDTruePrimaryMotherPi0GGInvMassPt = new TH2F*[fnCuts]; |
945 | hESDTrueSecondaryMotherPi0GGInvMassPt = new TH2F*[fnCuts]; | |
a280ac15 | 946 | hESDTruePrimaryPi0DalitzESDPtMCPt = new TH2F*[fnCuts]; |
947 | hESDTruePrimaryMotherInvMassMCPt = new TH2F*[fnCuts]; | |
86eaf9ae | 948 | hESDTruePrimaryMotherInvMassPt = new TH2F*[fnCuts]; |
949 | hESDTruePrimaryMotherW0WeightingInvMassPt = new TH2F*[fnCuts]; | |
a280ac15 | 950 | hESDTrueSecondaryMotherInvMassPt = new TH2F*[fnCuts]; |
951 | hESDTrueSecondaryMotherFromK0sInvMassPt = new TH2F*[fnCuts]; | |
952 | hESDTrueBckGGInvMassPt = new TH2F*[fnCuts]; | |
953 | hESDTrueBckContInvMassPt = new TH2F*[fnCuts]; | |
954 | hESDTrueMotherGGInvMassPt = new TH2F*[fnCuts]; | |
955 | //} | |
956 | ||
957 | for(Int_t iCut = 0; iCut<fnCuts;iCut++){ | |
958 | TString cutstringElectron =((AliDalitzElectronCuts*)fCutElectronArray->At(iCut))->GetCutNumber(); | |
959 | TString cutstringMeson= ((AliConversionMesonCuts*)fCutMesonArray->At(iCut))->GetCutNumber(); | |
960 | TString cutstringGamma = ((AliConversionCuts*)fCutGammaArray->At(iCut))->GetCutNumber(); | |
961 | ||
962 | fMCList[iCut] = new TList(); | |
963 | fMCList[iCut]->SetName(Form("%s_%s_%s MC histograms",cutstringGamma.Data(),cutstringElectron.Data(),cutstringMeson.Data())); | |
964 | fMCList[iCut]->SetOwner(kTRUE); | |
965 | fCutFolder[iCut]->Add(fMCList[iCut]); | |
966 | ||
ccfa8c0d | 967 | |
ae947965 | 968 | hMCAllGammaPt[iCut] = new TH1F("MC_AllGamma_Pt","MC_AllGamma_Pt",250,0,25); |
969 | fMCList[iCut]->Add(hMCAllGammaPt[iCut]); | |
970 | ||
971 | hMCConvGammaPt[iCut] = new TH1F("MC_ConvGamma_Pt","MC_ConvGamma_Pt",250,0,25); | |
972 | fMCList[iCut]->Add(hMCConvGammaPt[iCut]); | |
973 | ||
2d49ea4c | 974 | |
ae947965 | 975 | hMCConvGammaRSPt[iCut] = new TH1F("MC_ConvGamma_RS_Pt","MC_ConvGamma_RS_Pt",250,0,25); |
976 | fMCList[iCut]->Add(hMCConvGammaRSPt[iCut]); | |
977 | ||
0f8c33c1 | 978 | |
ae947965 | 979 | hMCAllPositronsPt[iCut] = new TH1F("MC_AllPositrons_Pt","MC_AllPositrons_Pt",1000,0,25); |
980 | fMCList[iCut]->Add(hMCAllPositronsPt[iCut]); | |
0f8c33c1 | 981 | |
ae947965 | 982 | hMCAllElectronsPt[iCut] = new TH1F("MC_AllElectrons_Pt","MC_AllElectrons_Pt",1000,0,25); |
0f8c33c1 | 983 | fMCList[iCut]->Add(hMCAllElectronsPt[iCut]); |
984 | ||
985 | hMCPi0DalitzGammaPt[iCut] = new TH1F("MC_Pi0DalitzGamma_Pt","MC_Pi0DalitzGamma_Pt",250,0,25); | |
86eaf9ae | 986 | hMCPi0DalitzGammaPt[iCut]->Sumw2(); |
0f8c33c1 | 987 | fMCList[iCut]->Add(hMCPi0DalitzGammaPt[iCut]); |
988 | ||
2d49ea4c | 989 | if ( fDoMesonQA ){ |
990 | ||
991 | hMCConvGammaEta[iCut] = new TH1F("MC_ConvGamma_Eta","MC_ConvGamma_Eta",600,-1.5,1.5); | |
992 | fMCList[iCut]->Add(hMCConvGammaEta[iCut]); | |
993 | ||
994 | hMCAllPositronsEta[iCut] = new TH1F("MC_AllPositrons_Eta","MC_AllPositrons_Eta",600,-1.5,1.5); | |
995 | fMCList[iCut]->Add(hMCAllPositronsEta[iCut]); | |
996 | ||
997 | hMCAllElectronsEta[iCut] = new TH1F("MC_AllElectrons_Eta","MC_AllElectrons_Eta",600,-1.5,1.5); | |
998 | fMCList[iCut]->Add(hMCAllElectronsEta[iCut]); | |
999 | ||
1000 | ||
1001 | } | |
1002 | ||
1003 | ||
ae947965 | 1004 | hMCPi0DalitzPositronPt[iCut] = new TH1F("MC_Pi0DalitzPositron_Pt","MC_Pi0DalitzPositron_Pt",1000,0,25); |
86eaf9ae | 1005 | hMCPi0DalitzPositronPt[iCut]->Sumw2(); |
0f8c33c1 | 1006 | fMCList[iCut]->Add(hMCPi0DalitzPositronPt[iCut]); |
1007 | ||
ae947965 | 1008 | hMCPi0DalitzElectronPt[iCut] = new TH1F("MC_Pi0DalitzElectron_Pt","MC_Pi0DalitzElectron_Pt",1000,0,25); |
86eaf9ae | 1009 | hMCPi0DalitzElectronPt[iCut]->Sumw2(); |
0f8c33c1 | 1010 | fMCList[iCut]->Add(hMCPi0DalitzElectronPt[iCut]); |
1011 | ||
1012 | ||
1013 | hMCPi0Pt[iCut] = new TH1F("MC_Pi0_Pt","MC_Pi0_Pt",250,0,25); | |
86eaf9ae | 1014 | hMCPi0Pt[iCut]->Sumw2(); |
0f8c33c1 | 1015 | fMCList[iCut]->Add(hMCPi0Pt[iCut]); |
1016 | ||
1017 | hMCPi0GGPt[iCut] = new TH1F("MC_Pi0_GG_Pt","MC_Pi0_GG_Pt",250,0,25); | |
86eaf9ae | 1018 | hMCPi0GGPt[iCut]->Sumw2(); |
0f8c33c1 | 1019 | fMCList[iCut]->Add(hMCPi0GGPt[iCut]); |
1020 | ||
1021 | hMCEtaPt[iCut] = new TH1F("MC_Eta_Pt","MC_Eta_Pt",250,0,25); | |
86eaf9ae | 1022 | hMCEtaPt[iCut]->Sumw2(); |
0f8c33c1 | 1023 | fMCList[iCut]->Add(hMCEtaPt[iCut]); |
1024 | ||
1025 | hMCEtaGGPt[iCut] = new TH1F("MC_Eta_GG_Pt","MC_Eta_GG_Pt",250,0,25); | |
86eaf9ae | 1026 | hMCEtaGGPt[iCut]->Sumw2(); |
0f8c33c1 | 1027 | fMCList[iCut]->Add(hMCEtaGGPt[iCut]); |
1028 | ||
1029 | hMCPi0InAccPt[iCut] = new TH1F("MC_Pi0DalitzInAcc_Pt","MC_Pi0DalitzInAcc_Pt",250,0,25); | |
86eaf9ae | 1030 | hMCPi0InAccPt[iCut]->Sumw2(); |
0f8c33c1 | 1031 | fMCList[iCut]->Add(hMCPi0InAccPt[iCut]); |
1032 | ||
1033 | hMCEtaInAccPt[iCut] = new TH1F("MC_EtaDalitzInAcc_Pt","MC_EtaDalitzInAcc_Pt",250,0,25); | |
86eaf9ae | 1034 | hMCEtaInAccPt[iCut]->Sumw2(); |
0f8c33c1 | 1035 | fMCList[iCut]->Add(hMCEtaInAccPt[iCut]); |
f4d5bd23 | 1036 | |
1037 | ||
0f8c33c1 | 1038 | |
1039 | hMCChiCPt[iCut] = new TH1F("MC_ChiC_Pt","MC_ChiC_Pt",250,0,25); | |
1040 | fMCList[iCut]->Add(hMCChiCPt[iCut]); | |
1041 | ||
1042 | hMCChiCInAccPt[iCut] = new TH1F("MC_ChiCInAcc_Pt","MC_ChiCInAcc_Pt",250,0,25); | |
1043 | fMCList[iCut]->Add(hMCChiCInAccPt[iCut]); | |
f4d5bd23 | 1044 | |
1045 | if ( fDoMesonQA ) { | |
1046 | ||
30b9a400 | 1047 | hMCPi0EposEnegInvMassPt[iCut] = new TH2F("MC_Pi0EposEneg_InvMassPt","MC_Pi0EposEneg_InvMassPt",1000,0.0,0.5,100,0.,10.); |
f4d5bd23 | 1048 | fMCList[iCut]->Add(hMCPi0EposEnegInvMassPt[iCut]); |
1049 | ||
30b9a400 | 1050 | hMCEtaEposEnegInvMassPt[iCut] = new TH2F("MC_EtaEposEneg_InvMassPt","MC_EtaEposEneg_InvMassPt",1400,0.,0.7,100,0.,10.); |
f4d5bd23 | 1051 | fMCList[iCut]->Add(hMCEtaEposEnegInvMassPt[iCut]); |
1052 | ||
a1c2f90c | 1053 | |
e3d15e19 | 1054 | |
f4d5bd23 | 1055 | } |
1056 | ||
1057 | ||
a280ac15 | 1058 | |
1059 | fTrueList[iCut] = new TList(); | |
1060 | fTrueList[iCut]->SetName(Form("%s_%s_%s True histograms",cutstringGamma.Data(),cutstringElectron.Data(),cutstringMeson.Data())); | |
1061 | fTrueList[iCut]->SetOwner(kTRUE); | |
1062 | fCutFolder[iCut]->Add(fTrueList[iCut]); | |
1063 | ||
fcc79cf5 | 1064 | if ( fDoMesonQA ) { |
a072aeaa | 1065 | |
1066 | ||
30b9a400 | 1067 | hESDEposEnegTruePi0DalitzInvMassPt[iCut] = new TH2F("ESD_EposEneg_TruePi0Dalitz_InvMassPt","ESD_EposEneg_TruePi0Dalitz_InvMassPt",1000,0.0,0.5,100,0.,10.); |
ae947965 | 1068 | fTrueList[iCut]->Add(hESDEposEnegTruePi0DalitzInvMassPt[iCut]); |
2d49ea4c | 1069 | |
1070 | hESDEposEnegTruePrimPi0DalitzInvMass[iCut] = new TH1F("ESD_EposEneg_TruePrimPi0Dalitz_InvMass","ESD_EposEneg_TruePrimPi0Dalitz_InvMass",500,0.,0.5); | |
1071 | fTrueList[iCut]->Add(hESDEposEnegTruePrimPi0DalitzInvMass[iCut]); | |
a072aeaa | 1072 | |
1073 | hESDEposEnegTruePi0DalitzPsiPairDPhi[iCut] = new TH2F("ESD_EposEneg_TruePi0Dalitz_PsiPair_DPhi","ESD_EposEneg_TruePi0Dalitz_PsiPair_DPhi", 100, -1.0,1.0,100,-1.0,1.0 ); | |
1074 | fTrueList[iCut]->Add(hESDEposEnegTruePi0DalitzPsiPairDPhi[iCut]); | |
1075 | ||
ccfa8c0d | 1076 | |
2d49ea4c | 1077 | hESDEposEnegTrueEtaDalitzInvMassPt[iCut] = new TH2F("ESD_EposEneg_TrueEtaDalitz_InvMassPt","ESD_EposEneg_TrueEtaDalitz_InvMassPt",700,0.,0.7,100,0.,10.); |
ae947965 | 1078 | fTrueList[iCut]->Add(hESDEposEnegTrueEtaDalitzInvMassPt[iCut]); |
2d49ea4c | 1079 | |
1080 | hESDEposEnegTruePrimEtaDalitzInvMass[iCut] = new TH1F("ESD_EposEneg_TruePrimEtaDalitz_InvMass","ESD_EposEneg_TruePrimEtaDalitz_InvMass",700,0.,0.7); | |
1081 | fTrueList[iCut]->Add(hESDEposEnegTruePrimEtaDalitzInvMass[iCut]); | |
a072aeaa | 1082 | |
1083 | hESDEposEnegTrueEtaDalitzPsiPairDPhi[iCut] = new TH2F("ESD_EposEneg_TrueEtaDalitz_PsiPair_DPhi","ESD_EposEneg_TrueEtaDalitz_PsiPair_DPhi", 100, -1.0,1.0,100,-1.0,1.0 ); | |
1084 | fTrueList[iCut]->Add(hESDEposEnegTrueEtaDalitzPsiPairDPhi[iCut]); | |
ccfa8c0d | 1085 | |
f4d5bd23 | 1086 | hESDEposEnegTruePhotonInvMassPt[iCut] = new TH2F("ESD_EposEneg_TruePhoton_InvMassPt","ESD_EposEneg_TruePhoton_InvMassPt",500,0.,0.5,100,0.,10.); |
ae947965 | 1087 | fTrueList[iCut]->Add(hESDEposEnegTruePhotonInvMassPt[iCut]); |
f4d5bd23 | 1088 | |
1089 | hESDEposEnegTrueInvMassPt[iCut] = new TH2F("ESD_EposEneg_True_InvMassPt","ESD_EposEneg_True_InvMassPt",5000,0.,5.,100,0.,10.); | |
1090 | fTrueList[iCut]->Add(hESDEposEnegTrueInvMassPt[iCut]); | |
a072aeaa | 1091 | |
1092 | hESDEposEnegTruePhotonPsiPairDPhi[iCut] = new TH2F("ESD_EposEneg_TruePhoton_PsiPair_DPhi","ESD_EposEneg_TruePhoton_PsiPair_DPhi", 100, -1.0,1.0,100,-1.0,1.0 ); | |
1093 | fTrueList[iCut]->Add(hESDEposEnegTruePhotonPsiPairDPhi[iCut]); | |
30b9a400 | 1094 | |
1095 | hESDEposEnegTruePhotonPsiPairDPhiPtCut[iCut] = new TH2F("ESD_EposEneg_TruePhoton_PsiPair_DPhi_PtCut","ESD_EposEneg_TruePhoton_PsiPair_DPhi_PtCut", 100, -1.0,1.0,100,-1.0,1.0 ); | |
1096 | fTrueList[iCut]->Add(hESDEposEnegTruePhotonPsiPairDPhiPtCut[iCut]); | |
1097 | ||
1098 | ||
a072aeaa | 1099 | |
ae947965 | 1100 | hESDEposEnegTrueJPsiInvMassPt[iCut] = new TH2F("ESD_EposEneg_TrueJPsi_InvMassPt","ESD_EposEneg_TrueJPsi_InvMassPt",5000,0.,5.,100,0.,10.); |
1101 | fTrueList[iCut]->Add(hESDEposEnegTrueJPsiInvMassPt[iCut]); | |
e3d15e19 | 1102 | |
1103 | ||
1104 | ||
e3d15e19 | 1105 | |
a072aeaa | 1106 | |
1107 | ||
1108 | ||
fcc79cf5 | 1109 | } |
0f8c33c1 | 1110 | |
ccfa8c0d | 1111 | |
ae947965 | 1112 | hESDTruePositronPt[iCut] = new TH1F("ESD_TruePositron_Pt","ESD_TruePositron_Pt",1000,0,25); |
ccfa8c0d | 1113 | fTrueList[iCut]->Add(hESDTruePositronPt[iCut]); |
1114 | ||
ae947965 | 1115 | hESDTrueElectronPt[iCut] = new TH1F("ESD_TrueElectron_Pt","ESD_TrueElectron_Pt",1000,0,25); |
ccfa8c0d | 1116 | fTrueList[iCut]->Add(hESDTrueElectronPt[iCut]); |
ae947965 | 1117 | |
1118 | hESDTrueSecPositronPt[iCut] = new TH1F("ESD_TrueSecPositron_Pt","ESD_TrueSecPositron_Pt",1000,0,25); | |
1119 | fTrueList[iCut]->Add(hESDTrueSecPositronPt[iCut]); | |
1120 | ||
1121 | hESDTrueSecElectronPt[iCut] = new TH1F("ESD_TrueSecElectron_Pt","ESD_TrueSecElectron_Pt",1000,0,25); | |
1122 | fTrueList[iCut]->Add(hESDTrueSecElectronPt[iCut]); | |
ccfa8c0d | 1123 | |
a280ac15 | 1124 | hESDTrueConvGammaPt[iCut] = new TH1F("ESD_TrueConvGamma_Pt","ESD_TrueConvGamma_Pt",250,0,25); |
1125 | fTrueList[iCut]->Add(hESDTrueConvGammaPt[iCut]); | |
ae947965 | 1126 | |
1127 | hESDTrueSecConvGammaPt[iCut] = new TH1F("ESD_TrueSecConvGamma_Pt","ESD_TrueSecConvGamma_Pt",250,0,25); | |
1128 | fTrueList[iCut]->Add(hESDTrueSecConvGammaPt[iCut]); | |
a280ac15 | 1129 | |
ccfa8c0d | 1130 | hESDTruePi0DalitzConvGammaPt[iCut] = new TH1F("ESD_TruePi0DalitzConvGamma_Pt","ESD_TruePi0DalitzConvGamma_Pt",250,0,25); |
1131 | fTrueList[iCut]->Add(hESDTruePi0DalitzConvGammaPt[iCut]); | |
1132 | ||
ae947965 | 1133 | hESDTruePi0DalitzElectronPt[iCut] = new TH1F("ESD_TruePi0DalitzElectron_Pt","ESD_TruePi0DalitzElectron_Pt",1000,0,25); |
ccfa8c0d | 1134 | fTrueList[iCut]->Add(hESDTruePi0DalitzElectronPt[iCut]); |
1135 | ||
ae947965 | 1136 | hESDTruePi0DalitzPositronPt[iCut] = new TH1F("ESD_TruePi0DalitzPositron_Pt","ESD_TruePi0DalitzPositron_Pt",1000,0,25); |
ccfa8c0d | 1137 | fTrueList[iCut]->Add(hESDTruePi0DalitzPositronPt[iCut]); |
ae947965 | 1138 | |
1139 | hESDTruePi0DalitzSecConvGammaPt[iCut] = new TH1F("ESD_TruePi0DalitzSecConvGamma_Pt","ESD_TruePi0DalitzSecConvGamma_Pt",250,0,25); | |
1140 | fTrueList[iCut]->Add(hESDTruePi0DalitzSecConvGammaPt[iCut]); | |
1141 | ||
1142 | hESDTruePi0DalitzSecElectronPt[iCut] = new TH1F("ESD_TruePi0DalitzSecElectron_Pt","ESD_TruePi0DalitzSecElectron_Pt",1000,0,25); | |
1143 | fTrueList[iCut]->Add(hESDTruePi0DalitzSecElectronPt[iCut]); | |
ccfa8c0d | 1144 | |
ae947965 | 1145 | hESDTruePi0DalitzSecPositronPt[iCut] = new TH1F("ESD_TruePi0DalitzSecPositron_Pt","ESD_TruePi0DalitzSecPositron_Pt",1000,0,25); |
1146 | fTrueList[iCut]->Add(hESDTruePi0DalitzSecPositronPt[iCut]); | |
ccfa8c0d | 1147 | |
fcc79cf5 | 1148 | if( fDoChicAnalysis) { |
1149 | ||
1150 | hESDTrueMotherChiCInvMassPt[iCut] = new TH2F("ESD_TrueMotherChiC_InvMass_Pt","ESD_TrueMotherChiC_InvMass_Pt",4000,0,4,250,0,25); | |
0f8c33c1 | 1151 | fTrueList[iCut]->Add(hESDTrueMotherChiCInvMassPt[iCut]); |
ccfa8c0d | 1152 | |
fcc79cf5 | 1153 | hESDTrueMotherChiCDiffInvMassPt[iCut] = new TH2F("ESD_TrueMotherChiCDiff_InvMass_Pt","ESD_TrueMotherChiCDiff_InvMass_Pt",2000,0,2,250,0,25); |
ae947965 | 1154 | fTrueList[iCut]->Add(hESDTrueMotherChiCDiffInvMassPt[iCut]); |
fcc79cf5 | 1155 | |
1156 | } | |
ccfa8c0d | 1157 | |
8a52eed5 | 1158 | hESDTrueMotherInvMassPt[iCut] = new TH2F("ESD_TrueMother_InvMass_Pt","ESD_TrueMother_InvMass_Pt",800,0,0.8,250,0,25); |
86eaf9ae | 1159 | hESDTrueMotherInvMassPt[iCut]->Sumw2(); |
a280ac15 | 1160 | fTrueList[iCut]->Add(hESDTrueMotherInvMassPt[iCut]); |
4803eb1f | 1161 | |
8a52eed5 | 1162 | hESDTrueMotherDalitzInvMassPt[iCut] = new TH2F("ESD_TrueMother_Dalitz_InvMass_Pt","ESD_TrueMother_Dalitz_InvMass_Pt",800,0,0.8,250,0,25); |
86eaf9ae | 1163 | hESDTrueMotherDalitzInvMassPt[iCut]->Sumw2(); |
4803eb1f | 1164 | fTrueList[iCut]->Add(hESDTrueMotherDalitzInvMassPt[iCut]); |
1165 | ||
1166 | ||
1167 | ||
1168 | ||
a280ac15 | 1169 | |
8a52eed5 | 1170 | hESDTrueMotherPi0GGInvMassPt[iCut] = new TH2F("ESD_TrueMotherPi0GG_InvMass_Pt","ESD_TrueMotherPi0GG_InvMass_Pt",800,0,0.8,250,0,25); |
86eaf9ae | 1171 | hESDTrueMotherPi0GGInvMassPt[iCut]->Sumw2(); |
a280ac15 | 1172 | fTrueList[iCut]->Add(hESDTrueMotherPi0GGInvMassPt[iCut]); |
86eaf9ae | 1173 | |
1174 | hESDTruePrimaryMotherPi0GGInvMassPt[iCut] = new TH2F("ESD_TruePrimaryMotherPi0GG_InvMass_Pt","ESD_TruePrimaryMotherPi0GG_InvMass_Pt",800,0,0.8,250,0,25); | |
1175 | hESDTruePrimaryMotherPi0GGInvMassPt[iCut]->Sumw2(); | |
1176 | fTrueList[iCut]->Add(hESDTruePrimaryMotherPi0GGInvMassPt[iCut]); | |
1177 | ||
1178 | hESDTrueSecondaryMotherPi0GGInvMassPt[iCut] = new TH2F("ESD_TrueSecondaryMotherPi0GG_InvMass_Pt","ESD_TrueSecondaryMotherPi0GG_InvMass_Pt",800,0,0.8,250,0,25); | |
1179 | hESDTrueSecondaryMotherPi0GGInvMassPt[iCut]->Sumw2(); | |
1180 | fTrueList[iCut]->Add(hESDTrueSecondaryMotherPi0GGInvMassPt[iCut]); | |
1181 | ||
a280ac15 | 1182 | hESDTruePrimaryPi0DalitzESDPtMCPt[iCut] = new TH2F("ESD_TruePrimaryPi0Dalitz_ESDPt_MCPt","ESD_TruePrimaryPi0Dalitz_ESDPt_MCPt",250,0,25,250,0,25); |
86eaf9ae | 1183 | hESDTruePrimaryPi0DalitzESDPtMCPt[iCut]->Sumw2(); |
a280ac15 | 1184 | fTrueList[iCut]->Add(hESDTruePrimaryPi0DalitzESDPtMCPt[iCut]); |
8a52eed5 | 1185 | hESDTruePrimaryMotherInvMassMCPt[iCut] = new TH2F("ESD_TruePrimaryMother_InvMass_MCPt","ESD_TrueDalitzPrimaryMother_InvMass_MCPt",800,0,0.8,250,0,25); |
86eaf9ae | 1186 | hESDTruePrimaryMotherInvMassMCPt[iCut]->Sumw2(); |
a280ac15 | 1187 | fTrueList[iCut]->Add(hESDTruePrimaryMotherInvMassMCPt[iCut]); |
86eaf9ae | 1188 | hESDTruePrimaryMotherInvMassPt[iCut] = new TH2F("ESD_TruePrimaryMother_InvMass_Pt","ESD_TruePrimaryMother_InvMass_Pt",800,0,0.8,250,0,25); |
1189 | hESDTruePrimaryMotherInvMassPt[iCut]->Sumw2(); | |
1190 | fTrueList[iCut]->Add(hESDTruePrimaryMotherInvMassPt[iCut]); | |
1191 | hESDTruePrimaryMotherW0WeightingInvMassPt[iCut] = new TH2F("ESD_TruePrimaryMotherW0Weighting_InvMass_Pt","ESD_TruePrimaryMotherW0Weighting_InvMass_Pt",800,0,0.8,250,0,25); | |
1192 | hESDTruePrimaryMotherW0WeightingInvMassPt[iCut]->Sumw2(); | |
1193 | fTrueList[iCut]->Add(hESDTruePrimaryMotherW0WeightingInvMassPt[iCut]); | |
1194 | ||
8a52eed5 | 1195 | hESDTrueSecondaryMotherInvMassPt[iCut] = new TH2F("ESD_TrueDalitzSecondaryMother_InvMass_Pt","ESD_TrueDalitzSecondaryMother_InvMass_Pt",800,0,0.8,250,0,25); |
86eaf9ae | 1196 | hESDTrueSecondaryMotherInvMassPt[iCut]->Sumw2(); |
a280ac15 | 1197 | fTrueList[iCut]->Add(hESDTrueSecondaryMotherInvMassPt[iCut]); |
1198 | // hESDTrueSecondaryMotherFromK0sInvMassPt[iCut] = new TH2F("ESD_TrueDalitzSecondaryMotherFromK0s_InvMass_Pt","ESD_TrueDalitzSecondaryMotherFromK0s_InvMass_Pt",1000,0,1,250,0,25); | |
1199 | // fTrueList[iCut]->Add(hESDTrueSecondaryMotherFromK0sInvMassPt[iCut]); | |
8a52eed5 | 1200 | hESDTrueBckGGInvMassPt[iCut] = new TH2F("ESD_TrueDalitzBckGG_InvMass_Pt","ESD_TrueDalitzBckGG_InvMass_Pt",800,0,0.8,250,0,25); |
a280ac15 | 1201 | fTrueList[iCut]->Add(hESDTrueBckGGInvMassPt[iCut]); |
8a52eed5 | 1202 | hESDTrueBckContInvMassPt[iCut] = new TH2F("ESD_TrueDalitzBckCont_InvMass_Pt","ESD_TrueDalitzBckCont_InvMass_Pt",800,0,0.8,250,0,25); |
a280ac15 | 1203 | fTrueList[iCut]->Add(hESDTrueBckContInvMassPt[iCut]); |
1204 | // hESDTrueMotherGGInvMassPt[iCut] = new TH2F("ESD_TrueGammaGamma_InvMass_Pt","ESD_TrueGammaGamma_InvMass_Pt",1000,0,1,250,0,25); | |
1205 | // fTrueList[iCut]->Add(hESDTrueMotherGGInvMassPt[iCut]); | |
1206 | ||
1207 | } | |
1208 | } | |
03adb3ac | 1209 | |
1210 | fV0Reader=(AliV0ReaderV1*)AliAnalysisManager::GetAnalysisManager()->GetTask("V0ReaderV1"); | |
1211 | if(!fV0Reader){printf("Error: No V0 Reader");return;} // GetV0Reader | |
1212 | ||
1213 | if(fV0Reader) | |
1214 | if((AliConversionCuts*)fV0Reader->GetConversionCuts()) | |
1215 | if(((AliConversionCuts*)fV0Reader->GetConversionCuts())->GetCutHistograms()) | |
1216 | fOutputContainer->Add(((AliConversionCuts*)fV0Reader->GetConversionCuts())->GetCutHistograms()); | |
1217 | ||
1218 | ||
1219 | ||
1220 | fElecSelector=(AliDalitzElectronSelector*)AliAnalysisManager::GetAnalysisManager()->GetTask("ElectronSelector"); | |
1221 | if(!fElecSelector){printf("Error: No ElectronSelector");return;} // GetV0Reader | |
1222 | ||
1223 | if( fElecSelector ){ | |
1224 | ||
1225 | if ( ((AliDalitzElectronCuts*)fElecSelector->GetDalitzElectronCuts())->GetCutHistograms() ){ | |
1226 | fOutputContainer->Add( ((AliDalitzElectronCuts*)fElecSelector->GetDalitzElectronCuts())->GetCutHistograms() ); | |
1227 | } | |
1228 | } | |
1229 | ||
1230 | for(Int_t iCut = 0; iCut<fnCuts;iCut++){ | |
1231 | ||
1232 | if( fCutElectronArray ){ | |
1233 | if( ((AliDalitzElectronCuts*)fCutElectronArray->At(iCut))->GetCutHistograms() ) { | |
1234 | fCutFolder[iCut]->Add( ((AliDalitzElectronCuts*)fCutElectronArray->At(iCut))->GetCutHistograms() ); | |
1235 | } | |
1236 | } | |
1237 | ||
1238 | if( fCutMesonArray ) { | |
1239 | if( ((AliConversionMesonCuts*)fCutMesonArray->At(iCut))->GetCutHistograms() ) { | |
1240 | fCutFolder[iCut]->Add( ((AliConversionMesonCuts*)fCutMesonArray->At(iCut))->GetCutHistograms()); | |
1241 | } | |
1242 | } | |
1243 | ||
1244 | if( fCutGammaArray ) { | |
1245 | if( ((AliConversionCuts*)fCutGammaArray->At(iCut))->GetCutHistograms() ) { | |
1246 | fCutFolder[iCut]->Add( ((AliConversionCuts*)fCutGammaArray->At(iCut))->GetCutHistograms() ); | |
1247 | } | |
1248 | } | |
1249 | } | |
a280ac15 | 1250 | |
1251 | PostData(1, fOutputContainer); | |
2bb2434e | 1252 | |
1253 | } | |
1254 | ||
1255 | //______________________________________________________________________ | |
1256 | void AliAnalysisTaskGammaConvDalitzV1::UserExec(Option_t *) | |
1257 | { | |
a280ac15 | 1258 | |
1259 | // | |
1260 | // Execute analysis for current event | |
1261 | // | |
1262 | ||
2bb2434e | 1263 | fV0Reader=(AliV0ReaderV1*)AliAnalysisManager::GetAnalysisManager()->GetTask("V0ReaderV1"); |
1264 | if(!fV0Reader){printf("Error: No V0 Reader");return;} // GetV0Reader | |
1265 | ||
a280ac15 | 1266 | |
2bb2434e | 1267 | Int_t eventQuality = ((AliConversionCuts*)fV0Reader->GetConversionCuts())->GetEventQuality(); |
1268 | ||
a280ac15 | 1269 | if(eventQuality == 2 || eventQuality == 3){// Event Not Accepted due to MC event missing or wrong trigger for V0ReaderV1 |
ae947965 | 1270 | for(Int_t iCut = 0; iCut<fnCuts; iCut++){ |
1271 | hNEvents[iCut]->Fill(eventQuality); | |
1272 | } | |
2bb2434e | 1273 | return; |
1274 | } | |
1275 | ||
a280ac15 | 1276 | |
2bb2434e | 1277 | fElecSelector=(AliDalitzElectronSelector*)AliAnalysisManager::GetAnalysisManager()->GetTask("ElectronSelector"); |
1278 | if(!fElecSelector){printf("Error: No ElectronSelector");return;} // GetV0Reader | |
1279 | ||
1280 | ||
ae947965 | 1281 | if(fIsMC) fMCEvent = MCEvent(); |
a280ac15 | 1282 | fESDEvent = (AliESDEvent*)InputEvent(); |
1283 | fReaderGammas = fV0Reader->GetReconstructedGammas(); // Gammas from default Cut | |
2bb2434e | 1284 | fSelectorElectronIndex = fElecSelector->GetReconstructedElectronsIndex(); // Electrons from default Cut |
1285 | fSelectorPositronIndex = fElecSelector->GetReconstructedPositronsIndex(); // Positrons from default Cut | |
2bb2434e | 1286 | |
58326f11 | 1287 | CountESDTracks(); // Estimate Event Multiplicity |
fcc79cf5 | 1288 | fNumberOfESDTracks = fV0Reader->GetNumberOfPrimaryTracks(); |
a280ac15 | 1289 | //AddTaskContainers(); //Add conatiner |
2bb2434e | 1290 | |
a280ac15 | 1291 | for(Int_t iCut = 0; iCut<fnCuts; iCut++){ |
e53081c7 | 1292 | |
1293 | ||
1294 | fiCut = iCut; | |
a1c2f90c | 1295 | |
1296 | fNVirtualGammas = 0; | |
2bb2434e | 1297 | |
a280ac15 | 1298 | Int_t eventNotAccepted = |
1299 | ((AliConversionCuts*)fCutGammaArray->At(iCut)) | |
1300 | ->IsEventAcceptedByConversionCut(fV0Reader->GetConversionCuts(),fInputEvent,fMCEvent,fIsHeavyIon); | |
ae947965 | 1301 | |
a280ac15 | 1302 | if(eventNotAccepted){ |
1303 | // cout << "event rejected due to wrong trigger: " <<eventNotAccepted << endl; | |
1304 | hNEvents[iCut]->Fill(eventNotAccepted); // Check Centrality, PileUp, SDD and V0AND --> Not Accepted => eventQuality = 1 | |
2bb2434e | 1305 | continue; |
a280ac15 | 1306 | } |
2bb2434e | 1307 | |
a280ac15 | 1308 | if(eventQuality != 0){// Event Not Accepted |
1309 | // cout << "event rejected due to: " <<eventQuality << endl; | |
1310 | hNEvents[iCut]->Fill(eventQuality); | |
1311 | continue; | |
2bb2434e | 1312 | } |
a280ac15 | 1313 | |
2bb2434e | 1314 | hNEvents[iCut]->Fill(eventQuality); |
1315 | ||
1316 | hNGoodESDTracks[iCut]->Fill(fNumberOfESDTracks); | |
7b3733f6 | 1317 | |
1318 | if(((AliConversionCuts*)fCutGammaArray->At(iCut))->IsHeavyIon() == 2) hNV0Tracks[iCut]->Fill(fInputEvent->GetVZEROData()->GetMTotV0A()); | |
1319 | else hNV0Tracks[iCut]->Fill(fInputEvent->GetVZEROData()->GetMTotV0A()+fInputEvent->GetVZEROData()->GetMTotV0C()); | |
1320 | ||
2bb2434e | 1321 | |
1322 | if(fMCEvent){ // Process MC Particle | |
ae947965 | 1323 | |
1324 | ||
1325 | ||
1326 | fMCStack = fMCEvent->Stack(); | |
1327 | ||
1328 | if(((AliConversionCuts*)fCutGammaArray->At(iCut))->GetSignalRejection() != 0){ | |
1329 | ((AliConversionCuts*)fCutGammaArray->At(iCut))->GetNotRejectedParticles(((AliConversionCuts*)fCutGammaArray->At(iCut))->GetSignalRejection(), | |
1330 | ((AliConversionCuts*)fCutGammaArray->At(iCut))->GetAcceptedHeader(), | |
1331 | fMCEvent); | |
1332 | } | |
1333 | ||
2bb2434e | 1334 | ProcessMCParticles(); |
1335 | } | |
1336 | ||
1337 | ProcessPhotonCandidates(); // Process this cuts gammas | |
1338 | ProcessElectronCandidates(); // Process this cuts gammas | |
ae947965 | 1339 | |
1340 | if(((AliConversionMesonCuts*)fCutMesonArray->At(iCut))->UseMCPSmearing() && fMCEvent){ | |
1341 | ||
1342 | fUnsmearedPx = new Double_t[fGoodGammas->GetEntries()]; // Store unsmeared Momenta | |
1343 | fUnsmearedPy = new Double_t[fGoodGammas->GetEntries()]; | |
1344 | fUnsmearedPz = new Double_t[fGoodGammas->GetEntries()]; | |
1345 | fUnsmearedE = new Double_t[fGoodGammas->GetEntries()]; | |
1346 | ||
1347 | for(Int_t gamma=0;gamma<fGoodGammas->GetEntries();gamma++){ // Smear the AODPhotons in MC | |
1348 | ||
1349 | fUnsmearedPx[gamma] = ((AliAODConversionPhoton*)fGoodGammas->At(gamma))->Px(); | |
1350 | fUnsmearedPy[gamma] = ((AliAODConversionPhoton*)fGoodGammas->At(gamma))->Py(); | |
1351 | fUnsmearedPz[gamma] = ((AliAODConversionPhoton*)fGoodGammas->At(gamma))->Pz(); | |
1352 | fUnsmearedE[gamma] = ((AliAODConversionPhoton*)fGoodGammas->At(gamma))->E(); | |
1353 | ((AliConversionMesonCuts*)fCutMesonArray->At(iCut))->SmearParticle(dynamic_cast<AliAODConversionPhoton*>(fGoodGammas->At(gamma))); | |
1354 | ||
1355 | } | |
30b9a400 | 1356 | } |
1357 | ||
1358 | if( ((AliDalitzElectronCuts*)fCutElectronArray->At(iCut))->GetUseVPhotonMCPmearing() && ((AliConversionMesonCuts*)fCutMesonArray->At(iCut))->UseMCPSmearing() && fMCEvent){ | |
1359 | ||
a1c2f90c | 1360 | // cout<<"Entro virtual photon smearing"<<endl; |
30b9a400 | 1361 | |
1362 | fUnsmearedVPx = new Double_t[fGoodVirtualGammas->GetEntries()]; // Store unsmeared Momenta | |
1363 | fUnsmearedVPy = new Double_t[fGoodVirtualGammas->GetEntries()]; | |
1364 | fUnsmearedVPz = new Double_t[fGoodVirtualGammas->GetEntries()]; | |
1365 | fUnsmearedVE = new Double_t[fGoodVirtualGammas->GetEntries()]; | |
ae947965 | 1366 | |
30b9a400 | 1367 | for(Int_t Vgamma=0;Vgamma<fGoodVirtualGammas->GetEntries();Vgamma++){ // Smear the AODPhotons in MC |
1368 | ||
1369 | fUnsmearedVPx[Vgamma] = ((AliAODConversionPhoton*)fGoodVirtualGammas->At(Vgamma))->Px(); | |
1370 | fUnsmearedVPy[Vgamma] = ((AliAODConversionPhoton*)fGoodVirtualGammas->At(Vgamma))->Py(); | |
1371 | fUnsmearedVPz[Vgamma] = ((AliAODConversionPhoton*)fGoodVirtualGammas->At(Vgamma))->Pz(); | |
1372 | fUnsmearedVE[Vgamma] = ((AliAODConversionPhoton*)fGoodVirtualGammas->At(Vgamma))->E(); | |
a1c2f90c | 1373 | ((AliConversionMesonCuts*)fCutMesonArray->At(iCut))->SmearVirtualPhoton(dynamic_cast<AliAODConversionPhoton*>(fGoodVirtualGammas->At(Vgamma))); |
30b9a400 | 1374 | |
1375 | } | |
1376 | } | |
1377 | ||
1378 | ProcessVirtualGammasCandidates(); | |
2bb2434e | 1379 | CalculatePi0DalitzCandidates(); |
1380 | CalculateBackground(); | |
1381 | UpdateEventByEventData(); | |
ae947965 | 1382 | |
58326f11 | 1383 | if ( fDoMesonQA ) { |
1384 | ||
1385 | hNGoodESDTracksVsNGoodGammas[iCut]->Fill(fNumberOfESDTrackskBoth,fGoodGammas->GetEntries()); | |
a1c2f90c | 1386 | hNGoodESDTracksVsNGoodVGammas[iCut]->Fill(fNumberOfESDTrackskBoth,fNVirtualGammas); |
58326f11 | 1387 | |
1388 | ||
1389 | } | |
1390 | ||
ae947965 | 1391 | |
1392 | if(((AliConversionMesonCuts*)fCutMesonArray->At(iCut))->UseMCPSmearing() && fMCEvent){ | |
1393 | ||
1394 | for(Int_t gamma=0;gamma<fGoodGammas->GetEntries();gamma++){ // Smear the AODPhotons in MC | |
1395 | ((AliAODConversionPhoton*)fGoodGammas->At(gamma))->SetPx(fUnsmearedPx[gamma]); // Reset Unsmeared Momenta | |
1396 | ((AliAODConversionPhoton*)fGoodGammas->At(gamma))->SetPy(fUnsmearedPy[gamma]); | |
1397 | ((AliAODConversionPhoton*)fGoodGammas->At(gamma))->SetPz(fUnsmearedPz[gamma]); | |
1398 | ((AliAODConversionPhoton*)fGoodGammas->At(gamma))->SetE(fUnsmearedE[gamma]); | |
1399 | } | |
1400 | delete[] fUnsmearedPx; fUnsmearedPx = 0x0; | |
1401 | delete[] fUnsmearedPy; fUnsmearedPy = 0x0; | |
1402 | delete[] fUnsmearedPz; fUnsmearedPz = 0x0; | |
1403 | delete[] fUnsmearedE; fUnsmearedE = 0x0; | |
1404 | ||
30b9a400 | 1405 | } |
1406 | ||
1407 | if( ((AliDalitzElectronCuts*)fCutElectronArray->At(iCut))->GetUseVPhotonMCPmearing() && ((AliConversionMesonCuts*)fCutMesonArray->At(iCut))->UseMCPSmearing() && fMCEvent){ | |
1408 | ||
1409 | for(Int_t Vgamma=0;Vgamma<fGoodVirtualGammas->GetEntries();Vgamma++){ // Smear the AODPhotons in MC | |
1410 | ((AliAODConversionPhoton*)fGoodVirtualGammas->At(Vgamma))->SetPx(fUnsmearedVPx[Vgamma]); // Reset Unsmeared Momenta | |
1411 | ((AliAODConversionPhoton*)fGoodVirtualGammas->At(Vgamma))->SetPy(fUnsmearedVPy[Vgamma]); | |
1412 | ((AliAODConversionPhoton*)fGoodVirtualGammas->At(Vgamma))->SetPz(fUnsmearedVPz[Vgamma]); | |
1413 | ((AliAODConversionPhoton*)fGoodVirtualGammas->At(Vgamma))->SetE(fUnsmearedVE[Vgamma]); | |
e53081c7 | 1414 | } |
30b9a400 | 1415 | delete[] fUnsmearedVPx; fUnsmearedVPx = 0x0; |
1416 | delete[] fUnsmearedVPy; fUnsmearedVPy = 0x0; | |
1417 | delete[] fUnsmearedVPz; fUnsmearedVPz = 0x0; | |
1418 | delete[] fUnsmearedVE; fUnsmearedVE = 0x0; | |
1419 | ||
ae947965 | 1420 | } |
a280ac15 | 1421 | |
30b9a400 | 1422 | |
a280ac15 | 1423 | |
2bb2434e | 1424 | fGoodGammas->Clear(); // delete this cuts good gammas |
1425 | fGoodVirtualGammas->Clear(); // delete this cuts good gammas | |
1426 | } | |
1427 | ||
a280ac15 | 1428 | fSelectorElectronIndex.clear(); |
1429 | fSelectorPositronIndex.clear(); | |
2bb2434e | 1430 | |
a280ac15 | 1431 | PostData( 1, fOutputContainer ); |
2bb2434e | 1432 | } |
1433 | ||
ae947965 | 1434 | Bool_t AliAnalysisTaskGammaConvDalitzV1::Notify() |
1435 | { | |
1436 | for(Int_t iCut = 0; iCut<fnCuts;iCut++){ | |
8a52eed5 | 1437 | |
1438 | ||
1439 | if( !((AliConversionCuts*)fCutGammaArray->At(iCut))->GetDoEtaShift() ){ | |
1440 | ||
1441 | /*if (((AliConversionCuts*)fCutGammaArray->At(iCut))->GetEtaShift() != 0.){ | |
1442 | printf("Error: Gamma Conversion Dalitz Task %s :: Eta Shift not requested but set to %f, reset to 00. \n\n", | |
1443 | (((AliConversionCuts*)fCutGammaArray->At(iCut))->GetCutNumber()).Data(),((AliConversionCuts*)fCutGammaArray->At(iCut))->GetEtaShift()); | |
1444 | ((AliConversionCuts*)fCutGammaArray->At(iCut))->SetEtaShift(0.); | |
1445 | ((AliDalitzElectronCuts*)fCutElectronArray->At(iCut))->SetEtaShift(0.); | |
1446 | ||
1447 | ||
1448 | }*/ | |
1449 | hEtaShift[iCut]->Fill(0.,0.); | |
1450 | continue; // No Eta Shift requested, continue | |
1451 | } | |
1452 | ||
ae947965 | 1453 | |
1454 | if( ((AliConversionCuts*)fCutGammaArray->At(iCut))->GetEtaShift() == 0.0){ // Eta Shift requested but not set, get shift automatically | |
1455 | ((AliConversionCuts*)fCutGammaArray->At(iCut))->GetCorrectEtaShiftFromPeriod(fV0Reader->GetPeriodName()); | |
1456 | ((AliConversionCuts*)fCutGammaArray->At(iCut))->DoEtaShift(kFALSE); // Eta Shift Set, make sure that it is called only once | |
1457 | ((AliDalitzElectronCuts*)fCutElectronArray->At(iCut))->SetEtaShift( ((AliConversionCuts*)fCutGammaArray->At(iCut))->GetEtaShift() ); | |
8a52eed5 | 1458 | hEtaShift[iCut]->Fill(0.,(((AliConversionCuts*)fCutGammaArray->At(iCut))->GetEtaShift())); |
ae947965 | 1459 | continue; |
1460 | } | |
1461 | else{ | |
fcc79cf5 | 1462 | printf(" Gamma Conversion Dalitz Task %s :: Eta Shift Manually Set to %f \n\n", |
ae947965 | 1463 | (((AliConversionCuts*)fCutGammaArray->At(iCut))->GetCutNumber()).Data(),((AliConversionCuts*)fCutGammaArray->At(iCut))->GetEtaShift()); |
1464 | ((AliConversionCuts*)fCutGammaArray->At(iCut))->DoEtaShift(kFALSE); // Eta Shift Set, make sure that it is called only once | |
1465 | ((AliDalitzElectronCuts*)fCutElectronArray->At(iCut))->SetEtaShift( ((AliConversionCuts*)fCutGammaArray->At(iCut))->GetEtaShift() ); | |
8a52eed5 | 1466 | hEtaShift[iCut]->Fill(0.,(((AliConversionCuts*)fCutGammaArray->At(iCut))->GetEtaShift())); |
ae947965 | 1467 | } |
1468 | } | |
1469 | ||
1470 | return kTRUE; | |
1471 | } | |
1472 | ||
1473 | ||
2bb2434e | 1474 | void AliAnalysisTaskGammaConvDalitzV1::Terminate(const Option_t *) |
1475 | { | |
1476 | ||
a072aeaa | 1477 | ///Grid |
2bb2434e | 1478 | |
2bb2434e | 1479 | } |
2bb2434e | 1480 | //________________________________________________________________________ |
1481 | void AliAnalysisTaskGammaConvDalitzV1::ProcessPhotonCandidates() | |
1482 | { | |
1483 | Int_t nV0 = 0; | |
1484 | TList *GoodGammasStepOne = new TList(); | |
1485 | TList *GoodGammasStepTwo = new TList(); | |
1486 | // Loop over Photon Candidates allocated by ReaderV1 | |
ae947965 | 1487 | |
2bb2434e | 1488 | for(Int_t i = 0; i < fReaderGammas->GetEntriesFast(); i++){ |
1489 | AliAODConversionPhoton* PhotonCandidate = (AliAODConversionPhoton*) fReaderGammas->At(i); | |
1490 | if(!PhotonCandidate) continue; | |
ae947965 | 1491 | |
ae947965 | 1492 | fIsFromMBHeader = kTRUE; |
1493 | ||
1494 | if( fMCEvent && ((AliConversionCuts*)fCutGammaArray->At(fiCut))->GetSignalRejection() != 0 ){ | |
1495 | ||
1496 | Int_t isPosFromMBHeader | |
1497 | = ((AliConversionCuts*)fCutGammaArray->At(fiCut))->IsParticleFromBGEvent(PhotonCandidate->GetMCLabelPositive(), fMCStack, fInputEvent); | |
1498 | if(isPosFromMBHeader == 0 && ((AliConversionCuts*)fCutGammaArray->At(fiCut))->GetSignalRejection() != 3) continue; | |
1499 | ||
1500 | Int_t isNegFromMBHeader | |
1501 | = ((AliConversionCuts*)fCutGammaArray->At(fiCut))->IsParticleFromBGEvent(PhotonCandidate->GetMCLabelNegative(), fMCStack,fInputEvent); | |
1502 | if(isNegFromMBHeader == 0 && ((AliConversionCuts*)fCutGammaArray->At(fiCut))->GetSignalRejection() != 3) continue; | |
1503 | ||
ae947965 | 1504 | if( (isNegFromMBHeader+isPosFromMBHeader) != 4) fIsFromMBHeader = kFALSE; |
2279d237 | 1505 | |
ae947965 | 1506 | } |
1507 | ||
2bb2434e | 1508 | if(!((AliConversionCuts*)fCutGammaArray->At(fiCut))->PhotonIsSelected(PhotonCandidate,fESDEvent)) continue; |
a280ac15 | 1509 | |
1510 | if(!((AliConversionCuts*)fCutGammaArray->At(fiCut))->UseElecSharingCut() && | |
2bb2434e | 1511 | !((AliConversionCuts*)fCutGammaArray->At(fiCut))->UseToCloseV0sCut()){ // if no post reader loop is required add to events good gammas |
ae947965 | 1512 | |
2bb2434e | 1513 | fGoodGammas->Add(PhotonCandidate); |
2279d237 | 1514 | |
ae947965 | 1515 | if(fIsFromMBHeader){ |
1516 | hESDConvGammaPt[fiCut]->Fill(PhotonCandidate->Pt()); | |
2279d237 | 1517 | hESDConvGammaEta[fiCut]->Fill(PhotonCandidate->Eta()); |
d9d6352b | 1518 | if( fDoMesonQA ) hESDConvGammaZR[fiCut]->Fill(PhotonCandidate->GetConversionZ(),PhotonCandidate->GetConversionRadius()); |
ae947965 | 1519 | } |
2279d237 | 1520 | |
2bb2434e | 1521 | if(fMCEvent){ |
1522 | ProcessTruePhotonCandidates(PhotonCandidate); | |
1523 | } | |
1524 | } | |
1525 | else if(((AliConversionCuts*)fCutGammaArray->At(fiCut))->UseElecSharingCut()){ // if Shared Electron cut is enabled, Fill array, add to step one | |
1526 | ((AliConversionCuts*)fCutGammaArray->At(fiCut))->FillElectonLabelArray(PhotonCandidate,nV0); | |
1527 | nV0++; | |
1528 | GoodGammasStepOne->Add(PhotonCandidate); | |
1529 | } | |
a280ac15 | 1530 | else if(!((AliConversionCuts*)fCutGammaArray->At(fiCut))->UseElecSharingCut() && |
ae947965 | 1531 | ((AliConversionCuts*)fCutGammaArray->At(fiCut))->UseToCloseV0sCut()){ // shared electron is disabled, step one not needed -> step two |
2bb2434e | 1532 | GoodGammasStepTwo->Add(PhotonCandidate); |
1533 | } | |
1534 | } | |
2279d237 | 1535 | |
1536 | ||
2bb2434e | 1537 | if(((AliConversionCuts*)fCutGammaArray->At(fiCut))->UseElecSharingCut()){ |
1538 | for(Int_t i = 0;i<GoodGammasStepOne->GetEntries();i++){ | |
1539 | AliAODConversionPhoton *PhotonCandidate= (AliAODConversionPhoton*) GoodGammasStepOne->At(i); | |
1540 | if(!PhotonCandidate) continue; | |
ae947965 | 1541 | |
1542 | ||
1543 | fIsFromMBHeader = kTRUE; | |
1544 | if(fMCEvent && ((AliConversionCuts*)fCutGammaArray->At(fiCut))->GetSignalRejection() != 0){ | |
1545 | Int_t isPosFromMBHeader | |
1546 | = ((AliConversionCuts*)fCutGammaArray->At(fiCut))->IsParticleFromBGEvent(PhotonCandidate->GetMCLabelPositive(), fMCStack,fInputEvent); | |
1547 | Int_t isNegFromMBHeader | |
1548 | = ((AliConversionCuts*)fCutGammaArray->At(fiCut))->IsParticleFromBGEvent(PhotonCandidate->GetMCLabelNegative(), fMCStack,fInputEvent); | |
1549 | if( (isNegFromMBHeader+isPosFromMBHeader) != 4) fIsFromMBHeader = kFALSE; | |
1550 | } | |
1551 | ||
1552 | ||
2bb2434e | 1553 | if(!((AliConversionCuts*)fCutGammaArray->At(fiCut))->RejectSharedElectronV0s(PhotonCandidate,i,GoodGammasStepOne->GetEntries())) continue; |
a280ac15 | 1554 | if(!((AliConversionCuts*)fCutGammaArray->At(fiCut))->UseToCloseV0sCut()){ // To Colse v0s cut diabled, step two not needed |
2bb2434e | 1555 | fGoodGammas->Add(PhotonCandidate); |
ae947965 | 1556 | |
1557 | if(fIsFromMBHeader){ | |
1558 | hESDConvGammaPt[fiCut]->Fill(PhotonCandidate->Pt()); | |
2279d237 | 1559 | hESDConvGammaEta[fiCut]->Fill(PhotonCandidate->Eta()); |
d9d6352b | 1560 | if( fDoMesonQA )hESDConvGammaZR[fiCut]->Fill(PhotonCandidate->GetConversionZ(),PhotonCandidate->GetConversionRadius()); |
ae947965 | 1561 | } |
1562 | ||
2bb2434e | 1563 | if(fMCEvent){ |
1564 | ProcessTruePhotonCandidates(PhotonCandidate); | |
1565 | } | |
1566 | } | |
1567 | else GoodGammasStepTwo->Add(PhotonCandidate); // Close v0s cut enabled -> add to list two | |
1568 | } | |
1569 | } | |
1570 | if(((AliConversionCuts*)fCutGammaArray->At(fiCut))->UseToCloseV0sCut()){ | |
1571 | for(Int_t i = 0;i<GoodGammasStepTwo->GetEntries();i++){ | |
1572 | AliAODConversionPhoton* PhotonCandidate = (AliAODConversionPhoton*) GoodGammasStepTwo->At(i); | |
1573 | if(!PhotonCandidate) continue; | |
ae947965 | 1574 | |
1575 | if(fMCEvent && ((AliConversionCuts*)fCutGammaArray->At(fiCut))->GetSignalRejection() != 0){ | |
1576 | Int_t isPosFromMBHeader | |
1577 | = ((AliConversionCuts*)fCutGammaArray->At(fiCut))->IsParticleFromBGEvent(PhotonCandidate->GetMCLabelPositive(), fMCStack,fInputEvent); | |
1578 | Int_t isNegFromMBHeader | |
1579 | = ((AliConversionCuts*)fCutGammaArray->At(fiCut))->IsParticleFromBGEvent(PhotonCandidate->GetMCLabelNegative(), fMCStack,fInputEvent); | |
1580 | if( (isNegFromMBHeader+isPosFromMBHeader) != 4) fIsFromMBHeader = kFALSE; | |
1581 | } | |
1582 | ||
2bb2434e | 1583 | if(!((AliConversionCuts*)fCutGammaArray->At(fiCut))->RejectToCloseV0s(PhotonCandidate,GoodGammasStepTwo,i)) continue; |
1584 | fGoodGammas->Add(PhotonCandidate); // Add gamma to current cut TList | |
ae947965 | 1585 | |
1586 | if(fIsFromMBHeader){ | |
1587 | hESDConvGammaPt[fiCut]->Fill(PhotonCandidate->Pt()); // Differences to old V0Reader in p_t due to conversion KF->TLorentzVector | |
2279d237 | 1588 | hESDConvGammaEta[fiCut]->Fill(PhotonCandidate->Eta()); |
d9d6352b | 1589 | if(fDoMesonQA)hESDConvGammaZR[fiCut]->Fill(PhotonCandidate->GetConversionZ(),PhotonCandidate->GetConversionRadius()); |
ae947965 | 1590 | } |
1591 | ||
2bb2434e | 1592 | if(fMCEvent){ |
1593 | ProcessTruePhotonCandidates(PhotonCandidate); | |
1594 | } | |
1595 | } | |
1596 | } | |
1597 | ||
1598 | delete GoodGammasStepOne; | |
1599 | GoodGammasStepOne = 0x0; | |
1600 | delete GoodGammasStepTwo; | |
1601 | GoodGammasStepTwo = 0x0; | |
1602 | } | |
1603 | ||
1604 | //________________________________________________________________________ | |
1605 | void AliAnalysisTaskGammaConvDalitzV1::ProcessTruePhotonCandidates(AliAODConversionPhoton *TruePhotonCandidate) | |
1606 | { | |
1607 | // Process True Photons | |
1608 | AliStack *MCStack = fMCEvent->Stack(); | |
1609 | TParticle *posDaughter = TruePhotonCandidate->GetPositiveMCDaughter(MCStack); | |
1610 | TParticle *negDaughter = TruePhotonCandidate->GetNegativeMCDaughter(MCStack); | |
1611 | ||
1612 | if(posDaughter == NULL || negDaughter == NULL) return; // One particle does not exist | |
1613 | if(posDaughter->GetMother(0) != negDaughter->GetMother(0)){ // Not Same Mother == Combinatorial Bck | |
1614 | return; | |
1615 | } | |
ae947965 | 1616 | |
1617 | else if (posDaughter->GetMother(0) == -1){ | |
1618 | return; | |
1619 | } | |
1620 | ||
2bb2434e | 1621 | if(TMath::Abs(posDaughter->GetPdgCode())!=11 || TMath::Abs(negDaughter->GetPdgCode())!=11) return; //One Particle is not electron |
1622 | if(posDaughter->GetPdgCode()==negDaughter->GetPdgCode()) return; // Same Charge | |
1623 | if(posDaughter->GetUniqueID() != 5 || negDaughter->GetUniqueID() !=5) return;// check if the daughters come from a conversion | |
1624 | ||
1625 | TParticle *Photon = TruePhotonCandidate->GetMCParticle(MCStack); | |
1626 | if(Photon->GetPdgCode() != 22) return; // Mother is no Photon | |
1627 | ||
1628 | // True Photon | |
ccfa8c0d | 1629 | |
ae947965 | 1630 | Int_t labelGamma = TruePhotonCandidate->GetMCParticleLabel(MCStack); |
1631 | ||
1632 | if( labelGamma < MCStack->GetNprimary() ){ | |
1633 | if( fIsFromMBHeader ){ | |
1634 | hESDTrueConvGammaPt[fiCut]->Fill(TruePhotonCandidate->Pt()); | |
1635 | } | |
1636 | } | |
1637 | else { | |
1638 | if( fIsFromMBHeader){ | |
1639 | hESDTrueSecConvGammaPt[fiCut]->Fill(TruePhotonCandidate->Pt()); | |
1640 | } | |
1641 | } | |
1642 | ||
1643 | if( IsPi0DalitzDaughter(labelGamma) == kTRUE ) { | |
1644 | if( labelGamma < MCStack->GetNprimary() ) { | |
1645 | if( fIsFromMBHeader ){ | |
1646 | hESDTruePi0DalitzConvGammaPt[fiCut]->Fill(TruePhotonCandidate->Pt()); | |
1647 | } | |
1648 | } | |
1649 | else { | |
1650 | if( fIsFromMBHeader ) { | |
1651 | hESDTruePi0DalitzSecConvGammaPt[fiCut]->Fill(TruePhotonCandidate->Pt()); | |
1652 | } | |
1653 | } | |
1654 | } | |
ccfa8c0d | 1655 | |
1656 | ||
2bb2434e | 1657 | } |
30b9a400 | 1658 | //________________________________________________________________________ |
1659 | void AliAnalysisTaskGammaConvDalitzV1::ProcessVirtualGammasCandidates(){ | |
1660 | ||
1661 | ||
1662 | Double_t magField = fInputEvent->GetMagneticField(); | |
1663 | ||
1664 | ||
1665 | if( magField < 0.0 ){ | |
1666 | magField = 1.0; | |
1667 | } | |
1668 | else { | |
1669 | magField = -1.0; | |
1670 | } | |
1671 | ||
1672 | AliStack *MCStack = 0x0; | |
1673 | ||
1674 | if( fMCEvent ){ | |
1675 | ||
1676 | MCStack = fMCEvent->Stack(); | |
1677 | ||
1678 | } | |
1679 | ||
1680 | ||
1681 | for(Int_t virtualGammaIndex=0; virtualGammaIndex < fGoodVirtualGammas->GetEntries(); virtualGammaIndex++ ){ | |
1682 | ||
1683 | ||
1684 | AliAODConversionPhoton *Vgamma=dynamic_cast<AliAODConversionPhoton*>(fGoodVirtualGammas->At(virtualGammaIndex)); | |
1685 | ||
1686 | ||
1687 | ||
1688 | AliESDtrack* positronVgamma = fESDEvent->GetTrack( Vgamma->GetTrackLabelPositive() ); | |
1689 | AliESDtrack* electronVgamma = fESDEvent->GetTrack( Vgamma->GetTrackLabelNegative() ); | |
1690 | ||
1691 | ||
1692 | Bool_t isPhoton = kFALSE; | |
1693 | Bool_t isPi0Dalitz = kFALSE; | |
1694 | Bool_t isEtaDalitz = kFALSE; | |
1695 | Bool_t isJPsi = kFALSE; | |
1696 | Bool_t isTrueEposENeg = kFALSE; | |
1697 | Bool_t isMotherPrimary = kFALSE; | |
1698 | ||
1699 | Double_t psiPair = GetPsiPair(positronVgamma,electronVgamma); | |
1700 | Double_t deltaPhi = magField * TVector2::Phi_mpi_pi( electronVgamma->GetConstrainedParam()->Phi()-positronVgamma->GetConstrainedParam()->Phi()); | |
1701 | ||
1702 | ||
1703 | if ( fDoMesonQA ) { | |
1704 | ||
1705 | ||
1706 | ||
1707 | ||
1708 | hESDEposEnegPsiPairDPhi[fiCut]->Fill(deltaPhi,psiPair); | |
e53081c7 | 1709 | hESDEposEnegInvMassPt[fiCut]->Fill(Vgamma->M(),Vgamma->Pt()); |
a1c2f90c | 1710 | |
1711 | ||
e53081c7 | 1712 | |
30b9a400 | 1713 | |
1714 | if( fMCEvent ) { | |
1715 | ||
1716 | ||
1717 | ||
1718 | Int_t virtualGammaMCLabel = Vgamma->GetMCParticleLabel(MCStack); | |
1719 | ||
a1c2f90c | 1720 | TParticle * negativeMC = 0x0; |
1721 | TParticle * positiveMC = 0x0; | |
30b9a400 | 1722 | TParticle * mcVgamma = 0x0; |
1723 | ||
1724 | if( virtualGammaMCLabel != -1 ){ | |
1725 | ||
1726 | mcVgamma = (TParticle*)MCStack->Particle(virtualGammaMCLabel); | |
1727 | ||
1728 | ||
1729 | } | |
1730 | ||
a1c2f90c | 1731 | |
30b9a400 | 1732 | negativeMC = (TParticle*)Vgamma->GetNegativeMCDaughter(MCStack); |
1733 | positiveMC = (TParticle*)Vgamma->GetPositiveMCDaughter(MCStack); | |
1734 | ||
a1c2f90c | 1735 | |
30b9a400 | 1736 | if( negativeMC && positiveMC ) { |
1737 | ||
a1c2f90c | 1738 | if( positiveMC->GetPdgCode() == ::kPositron && negativeMC->GetPdgCode() == ::kElectron ) |
1739 | isTrueEposENeg = kTRUE; | |
30b9a400 | 1740 | |
a1c2f90c | 1741 | if( positiveMC->GetMother(0) > -1 && positiveMC->GetMother(0) < fMCStack->GetNprimary() ) |
1742 | isMotherPrimary = kTRUE; | |
30b9a400 | 1743 | |
1744 | } | |
1745 | ||
1746 | ||
1747 | if(mcVgamma){ | |
a1c2f90c | 1748 | // Check if it is a true photon |
1749 | if(mcVgamma->GetPdgCode() == 22){ | |
1750 | isPhoton = kTRUE; | |
1751 | }else if(mcVgamma->GetPdgCode() == 443){ | |
1752 | isJPsi = kTRUE; | |
1753 | } | |
1754 | else if( IsDalitz( mcVgamma ) ){ | |
1755 | if ( mcVgamma->GetPdgCode() == 111 ) isPi0Dalitz = kTRUE; | |
1756 | else if( mcVgamma->GetPdgCode() == 221 ) isEtaDalitz = kTRUE; | |
1757 | } | |
30b9a400 | 1758 | } |
2bb2434e | 1759 | |
30b9a400 | 1760 | if(isPhoton){ |
a1c2f90c | 1761 | hESDEposEnegTruePhotonInvMassPt[fiCut]->Fill(Vgamma->M(),Vgamma->Pt()); |
30b9a400 | 1762 | |
1763 | hESDEposEnegTruePhotonPsiPairDPhi[fiCut]->Fill(deltaPhi,psiPair); | |
1764 | if( Vgamma->Pt() > 1.5 ){ | |
1765 | hESDEposEnegTruePhotonPsiPairDPhiPtCut[fiCut]->Fill(deltaPhi,psiPair); | |
1766 | } | |
1767 | } | |
1768 | else if(isJPsi){ | |
a1c2f90c | 1769 | hESDEposEnegTrueJPsiInvMassPt[fiCut]->Fill(Vgamma->M(),Vgamma->Pt()); |
30b9a400 | 1770 | } |
1771 | else if(isPi0Dalitz){ | |
a1c2f90c | 1772 | hESDEposEnegTruePi0DalitzInvMassPt[fiCut]->Fill(Vgamma->M(),Vgamma->Pt()); |
30b9a400 | 1773 | hESDEposEnegTruePi0DalitzPsiPairDPhi[fiCut]->Fill(deltaPhi,psiPair); |
a1c2f90c | 1774 | if( isMotherPrimary ) hESDEposEnegTruePrimPi0DalitzInvMass[fiCut]->Fill( Vgamma->M() ); |
30b9a400 | 1775 | } |
1776 | else if(isEtaDalitz){ | |
a1c2f90c | 1777 | hESDEposEnegTrueEtaDalitzInvMassPt[fiCut]->Fill(Vgamma->M(),Vgamma->Pt()); |
30b9a400 | 1778 | hESDEposEnegTrueEtaDalitzPsiPairDPhi[fiCut]->Fill(deltaPhi,psiPair); |
a1c2f90c | 1779 | if( isMotherPrimary ) hESDEposEnegTruePrimEtaDalitzInvMass[fiCut]->Fill( Vgamma->M() ); |
30b9a400 | 1780 | } |
1781 | ||
a1c2f90c | 1782 | if( isTrueEposENeg ) hESDEposEnegTrueInvMassPt[fiCut]->Fill(Vgamma->M(), Vgamma->Pt()); |
30b9a400 | 1783 | |
1784 | } | |
a1c2f90c | 1785 | } |
30b9a400 | 1786 | |
a1c2f90c | 1787 | } |
30b9a400 | 1788 | |
30b9a400 | 1789 | |
1790 | ||
1791 | } | |
1792 | ||
2bb2434e | 1793 | //________________________________________________________________________ |
1794 | void AliAnalysisTaskGammaConvDalitzV1::ProcessElectronCandidates(){ | |
1795 | ||
a280ac15 | 1796 | Double_t magField = fInputEvent->GetMagneticField(); |
2bb2434e | 1797 | |
1798 | ||
1799 | if( magField < 0.0 ){ | |
a280ac15 | 1800 | magField = 1.0; |
2bb2434e | 1801 | } |
1802 | else { | |
a280ac15 | 1803 | magField = -1.0; |
2bb2434e | 1804 | } |
2bb2434e | 1805 | |
2bb2434e | 1806 | |
fcc79cf5 | 1807 | vector<Int_t> lGoodElectronIndexPrev(0); |
1808 | vector<Int_t> lGoodPositronIndexPrev(0); | |
1809 | ||
1810 | ||
1811 | ||
2bb2434e | 1812 | |
a280ac15 | 1813 | for(UInt_t i = 0; i < fSelectorElectronIndex.size(); i++){ |
78cea1d2 | 1814 | |
ae947965 | 1815 | AliESDtrack* electronCandidate = fESDEvent->GetTrack(fSelectorElectronIndex[i]); |
9897e2f5 | 1816 | |
78cea1d2 | 1817 | if( fMCEvent ) { |
1818 | ||
1819 | Int_t labelelectron = TMath::Abs( electronCandidate->GetLabel() ); | |
9897e2f5 | 1820 | Int_t isMCFromMBHeader = -1; |
1821 | if(((AliConversionCuts*)fCutGammaArray->At(fiCut))->GetSignalRejection() != 0) { | |
1822 | isMCFromMBHeader | |
1823 | = ((AliConversionCuts*)fCutGammaArray->At(fiCut))->IsParticleFromBGEvent(labelelectron,fMCStack,fInputEvent); | |
78cea1d2 | 1824 | if(isMCFromMBHeader == 0 && ((AliConversionCuts*)fCutGammaArray->At(fiCut))->GetSignalRejection() != 3) continue; |
9897e2f5 | 1825 | } |
78cea1d2 | 1826 | } |
1827 | ||
1828 | if(! ((AliDalitzElectronCuts*)fCutElectronArray->At(fiCut))->ElectronIsSelected(electronCandidate) ) continue; | |
9897e2f5 | 1829 | |
78cea1d2 | 1830 | lGoodElectronIndexPrev.push_back( fSelectorElectronIndex[i] ); |
1831 | hESDDalitzElectronPt[fiCut]->Fill(electronCandidate->Pt()); | |
1832 | hESDDalitzElectronPhi[fiCut]->Fill(electronCandidate->Phi()); | |
9897e2f5 | 1833 | |
78cea1d2 | 1834 | |
1835 | if( fMCEvent ) { | |
1836 | ||
1837 | Int_t labelelectron = TMath::Abs( electronCandidate->GetLabel() ); | |
ae947965 | 1838 | if( labelelectron < fMCStack->GetNtrack() ){ |
1839 | TParticle* electron = fMCStack->Particle(labelelectron); | |
1840 | if( electron->GetPdgCode() == 11 ){ | |
1841 | if( labelelectron < fMCStack->GetNprimary() ){ | |
1842 | hESDTrueElectronPt[fiCut]->Fill(electronCandidate->Pt()); //primary electron | |
1843 | } | |
1844 | else{ | |
1845 | hESDTrueSecElectronPt[fiCut]->Fill(electronCandidate->Pt()); //secondary electron | |
1846 | } | |
1847 | if( IsPi0DalitzDaughter(labelelectron) == kTRUE ) { | |
1848 | if( labelelectron < fMCStack->GetNprimary() ) { | |
1849 | hESDTruePi0DalitzElectronPt[fiCut]->Fill(electronCandidate->Pt()); | |
1850 | } | |
1851 | else{ | |
1852 | hESDTruePi0DalitzSecElectronPt[fiCut]->Fill(electronCandidate->Pt()); | |
1853 | } | |
1854 | } | |
1855 | } | |
1856 | } | |
1857 | } | |
9897e2f5 | 1858 | |
9897e2f5 | 1859 | |
a280ac15 | 1860 | } |
1861 | ||
1862 | for(UInt_t i = 0; i < fSelectorPositronIndex.size(); i++){ | |
1863 | ||
ccfa8c0d | 1864 | AliESDtrack* positronCandidate = fESDEvent->GetTrack( fSelectorPositronIndex[i] ); |
4803eb1f | 1865 | |
78cea1d2 | 1866 | if( fMCEvent ) { |
1867 | ||
1868 | Int_t labelpositron = TMath::Abs( positronCandidate->GetLabel() ); | |
1869 | Int_t isMCFromMBHeader = -1; | |
9897e2f5 | 1870 | |
1871 | if(((AliConversionCuts*)fCutGammaArray->At(fiCut))->GetSignalRejection() != 0) { | |
1872 | isMCFromMBHeader | |
1873 | = ((AliConversionCuts*)fCutGammaArray->At(fiCut))->IsParticleFromBGEvent(labelpositron,fMCStack,fInputEvent); | |
1874 | if(isMCFromMBHeader == 0 && ((AliConversionCuts*)fCutGammaArray->At(fiCut))->GetSignalRejection() != 3) continue; | |
78cea1d2 | 1875 | |
9897e2f5 | 1876 | } |
78cea1d2 | 1877 | } |
1878 | ||
1879 | ||
1880 | ||
1881 | if(! ((AliDalitzElectronCuts*)fCutElectronArray->At(fiCut))->ElectronIsSelected(positronCandidate) ) continue; | |
1882 | ||
1883 | lGoodPositronIndexPrev.push_back( fSelectorPositronIndex[i] ); | |
1884 | hESDDalitzPositronPt[fiCut]->Fill( positronCandidate->Pt() ); | |
1885 | hESDDalitzPositronPhi[fiCut]->Fill( positronCandidate->Phi() ); | |
1886 | ||
1887 | ||
1888 | if( fMCEvent ) { | |
1889 | ||
1890 | Int_t labelpositron = TMath::Abs( positronCandidate->GetLabel() ); | |
9897e2f5 | 1891 | |
ae947965 | 1892 | if( labelpositron < fMCStack->GetNtrack() ) { |
1893 | TParticle* positron = fMCStack->Particle(labelpositron); | |
1894 | if( positron->GetPdgCode() == -11 ){ | |
1895 | if( labelpositron < fMCStack->GetNprimary() ){ | |
1896 | hESDTruePositronPt[fiCut]->Fill(positronCandidate->Pt()); | |
1897 | } | |
1898 | else{ | |
1899 | hESDTrueSecPositronPt[fiCut]->Fill(positronCandidate->Pt()); | |
1900 | } | |
1901 | if( IsPi0DalitzDaughter(labelpositron) == kTRUE ) { | |
1902 | if( labelpositron < fMCStack->GetNprimary() ){ | |
1903 | hESDTruePi0DalitzPositronPt[fiCut]->Fill(positronCandidate->Pt()); | |
1904 | } | |
1905 | else{ | |
1906 | hESDTruePi0DalitzSecPositronPt[fiCut]->Fill(positronCandidate->Pt()); | |
1907 | } | |
1908 | } | |
1909 | } | |
1910 | } | |
ccfa8c0d | 1911 | } |
78cea1d2 | 1912 | } |
a280ac15 | 1913 | |
1914 | ||
fcc79cf5 | 1915 | vector<Bool_t> lElectronPsiIndex(lGoodElectronIndexPrev.size(), kTRUE); |
1916 | vector<Bool_t> lPositronPsiIndex(lGoodPositronIndexPrev.size(), kTRUE); | |
a280ac15 | 1917 | |
1918 | ||
1919 | if( ((AliDalitzElectronCuts*)fCutElectronArray->At(fiCut))->DoPsiPairCut() == kTRUE ){ | |
1920 | ||
fcc79cf5 | 1921 | for( UInt_t i = 0; i < lGoodElectronIndexPrev.size(); i++ ) { |
a280ac15 | 1922 | |
fcc79cf5 | 1923 | AliESDtrack *electronCandidate = fESDEvent->GetTrack(lGoodElectronIndexPrev[i]); |
a280ac15 | 1924 | |
fcc79cf5 | 1925 | for(UInt_t j = 0; j < lGoodPositronIndexPrev.size(); j++){ |
1926 | AliESDtrack *positronCandidate = fESDEvent->GetTrack(lGoodPositronIndexPrev[j]); | |
a280ac15 | 1927 | Double_t psiPair = GetPsiPair(positronCandidate,electronCandidate); |
1928 | Double_t deltaPhi = magField * TVector2::Phi_mpi_pi( electronCandidate->GetConstrainedParam()->Phi()-positronCandidate->GetConstrainedParam()->Phi()); | |
1929 | ||
1930 | if( ((AliDalitzElectronCuts*)fCutElectronArray->At(fiCut))->IsFromGammaConversion(psiPair,deltaPhi ) ){ | |
1931 | lElectronPsiIndex[i] = kFALSE; | |
1932 | lPositronPsiIndex[j] = kFALSE; | |
1933 | } | |
a280ac15 | 1934 | } |
1935 | } | |
1936 | } | |
2bb2434e | 1937 | |
2bb2434e | 1938 | |
fcc79cf5 | 1939 | vector<Int_t> lGoodElectronIndex(0); |
1940 | vector<Int_t> lGoodPositronIndex(0); | |
1941 | ||
1942 | ||
1943 | for( UInt_t i = 0; i < lGoodElectronIndexPrev.size(); i++ ) { | |
1944 | ||
1945 | if( lElectronPsiIndex[i] == kTRUE ) | |
1946 | lGoodElectronIndex.push_back( lGoodElectronIndexPrev[i] ); | |
1947 | } | |
1948 | ||
1949 | for( UInt_t i = 0; i < lGoodPositronIndexPrev.size(); i++ ) { | |
1950 | ||
1951 | if( lPositronPsiIndex[i] == kTRUE ) | |
1952 | lGoodPositronIndex.push_back( lGoodPositronIndexPrev[i] ); | |
1953 | } | |
1954 | ||
2bb2434e | 1955 | |
1956 | ||
fcc79cf5 | 1957 | |
1958 | ||
2bb2434e | 1959 | for(UInt_t i = 0; i < lGoodElectronIndex.size(); i++){ |
1960 | ||
a1c2f90c | 1961 | |
2bb2434e | 1962 | |
a280ac15 | 1963 | AliESDtrack *electronCandidate = fESDEvent->GetTrack(lGoodElectronIndex[i]); |
1964 | ||
1965 | AliKFParticle electronCandidateKF( *electronCandidate->GetConstrainedParam(), ::kElectron ); | |
1966 | ||
1967 | for(UInt_t j = 0; j < lGoodPositronIndex.size(); j++){ | |
1968 | ||
a1c2f90c | 1969 | |
a280ac15 | 1970 | AliESDtrack *positronCandidate = fESDEvent->GetTrack(lGoodPositronIndex[j]); |
1971 | AliKFParticle positronCandidateKF( *positronCandidate->GetConstrainedParam(), ::kPositron ); | |
30b9a400 | 1972 | |
a1c2f90c | 1973 | |
a280ac15 | 1974 | |
fcc79cf5 | 1975 | AliKFConversionPhoton* virtualPhoton = NULL; |
1976 | virtualPhoton = new AliKFConversionPhoton(electronCandidateKF,positronCandidateKF); | |
a280ac15 | 1977 | |
2d49ea4c | 1978 | if( fSetProductionVertextoVGamma == kTRUE ){ |
1979 | ||
1980 | AliKFVertex primaryVertexImproved(*fInputEvent->GetPrimaryVertex()); | |
1981 | primaryVertexImproved+=*virtualPhoton; | |
1982 | virtualPhoton->SetProductionVertex(primaryVertexImproved); | |
1983 | ||
1984 | } | |
a280ac15 | 1985 | |
1986 | virtualPhoton->SetTrackLabels( lGoodPositronIndex[j], lGoodElectronIndex[i]); | |
a1c2f90c | 1987 | |
8a52eed5 | 1988 | |
fcc79cf5 | 1989 | if( fMCEvent ) { |
1990 | ||
1991 | Int_t labeln=TMath::Abs(electronCandidate->GetLabel()); | |
1992 | Int_t labelp=TMath::Abs(positronCandidate->GetLabel()); | |
1993 | TParticle *fNegativeMCParticle = fMCStack->Particle(labeln); | |
1994 | TParticle *fPositiveMCParticle = fMCStack->Particle(labelp); | |
2d49ea4c | 1995 | |
fcc79cf5 | 1996 | |
1997 | if( fPositiveMCParticle && fNegativeMCParticle) { | |
a1c2f90c | 1998 | |
fcc79cf5 | 1999 | virtualPhoton->SetMCLabelPositive(labelp); |
2000 | virtualPhoton->SetMCLabelNegative(labeln); | |
a1c2f90c | 2001 | |
fcc79cf5 | 2002 | } |
a1c2f90c | 2003 | |
2004 | ||
8a52eed5 | 2005 | } |
2006 | ||
2007 | AliAODConversionPhoton *vphoton = new AliAODConversionPhoton(virtualPhoton); //To Apply PsiPairCut | |
2008 | ||
fcc79cf5 | 2009 | |
fcc79cf5 | 2010 | fGoodVirtualGammas->Add( vphoton ); |
2011 | delete virtualPhoton; | |
2012 | virtualPhoton=NULL; | |
0f8c33c1 | 2013 | |
a280ac15 | 2014 | } |
2bb2434e | 2015 | } |
0a2b2b4b | 2016 | |
fcc79cf5 | 2017 | |
0a2b2b4b | 2018 | //Computing mixing event |
fcc79cf5 | 2019 | |
258b4572 | 2020 | if( fDoMesonQA ) { |
0a2b2b4b | 2021 | |
fcc79cf5 | 2022 | for(UInt_t i = 0; i < lGoodElectronIndex.size(); i++){ |
0a2b2b4b | 2023 | |
0a2b2b4b | 2024 | |
2025 | AliESDtrack *electronCandidate1 = fESDEvent->GetTrack(lGoodElectronIndex[i]); | |
2026 | ||
2027 | AliKFParticle electronCandidate1KF( *electronCandidate1->GetConstrainedParam(), ::kElectron ); | |
2028 | ||
2029 | ||
2030 | for(UInt_t j = i+1; j < lGoodElectronIndex.size(); j++){ | |
2031 | ||
0a2b2b4b | 2032 | |
2033 | ||
2034 | AliESDtrack *electronCandidate2 = fESDEvent->GetTrack(lGoodElectronIndex[j]); | |
2035 | ||
2036 | AliKFParticle electronCandidate2KF( *electronCandidate2->GetConstrainedParam(), ::kElectron ); | |
2037 | ||
2038 | AliKFConversionPhoton* virtualPhoton = new AliKFConversionPhoton(electronCandidate1KF,electronCandidate2KF); | |
2039 | ||
2d49ea4c | 2040 | //AliKFVertex primaryVertexImproved(*fInputEvent->GetPrimaryVertex()); |
2041 | //primaryVertexImproved+=*virtualPhoton; | |
2042 | //virtualPhoton->SetProductionVertex(primaryVertexImproved); | |
0a2b2b4b | 2043 | |
2044 | ||
2045 | AliAODConversionPhoton *vphoton = new AliAODConversionPhoton(virtualPhoton); | |
a1c2f90c | 2046 | hESDEposEnegLikeSignBackInvMassPt[fiCut]->Fill(vphoton->M(),vphoton->Pt()); |
0a2b2b4b | 2047 | delete vphoton; |
2048 | delete virtualPhoton; | |
fcc79cf5 | 2049 | vphoton = 0x0; |
2050 | virtualPhoton = 0x0; | |
0a2b2b4b | 2051 | |
2052 | } | |
2053 | } | |
2054 | ||
2055 | ||
fcc79cf5 | 2056 | for(UInt_t i = 0; i < lGoodPositronIndex.size(); i++){ |
2057 | ||
2058 | ||
0a2b2b4b | 2059 | |
0a2b2b4b | 2060 | |
2061 | AliESDtrack *positronCandidate1 = fESDEvent->GetTrack(lGoodPositronIndex[i]); | |
2062 | ||
2063 | AliKFParticle positronCandidate1KF( *positronCandidate1->GetConstrainedParam(), ::kPositron ); | |
2064 | ||
2065 | ||
2066 | for(UInt_t j = i+1; j < lGoodPositronIndex.size(); j++){ | |
2067 | ||
0a2b2b4b | 2068 | |
2069 | AliESDtrack *positronCandidate2 = fESDEvent->GetTrack(lGoodPositronIndex[j]); | |
2070 | ||
2071 | AliKFParticle positronCandidate2KF( *positronCandidate2->GetConstrainedParam(), ::kPositron ); | |
2072 | ||
2073 | AliKFConversionPhoton* virtualPhoton = new AliKFConversionPhoton(positronCandidate1KF,positronCandidate2KF); | |
2d49ea4c | 2074 | //AliKFVertex primaryVertexImproved(*fInputEvent->GetPrimaryVertex()); |
2075 | //primaryVertexImproved+=*virtualPhoton; | |
2076 | //virtualPhoton->SetProductionVertex(primaryVertexImproved); | |
0a2b2b4b | 2077 | |
2078 | AliAODConversionPhoton *vphoton = new AliAODConversionPhoton(virtualPhoton); | |
a1c2f90c | 2079 | hESDEposEnegLikeSignBackInvMassPt[fiCut]->Fill(vphoton->M(),vphoton->Pt()); |
0a2b2b4b | 2080 | |
2081 | ||
2082 | delete vphoton; | |
fcc79cf5 | 2083 | delete virtualPhoton; |
2084 | vphoton = 0x0; | |
2085 | virtualPhoton = 0x0; | |
0a2b2b4b | 2086 | |
2087 | } | |
258b4572 | 2088 | } |
0a2b2b4b | 2089 | |
fcc79cf5 | 2090 | } |
2bb2434e | 2091 | } |
2092 | ||
2093 | //________________________________________________________________________ | |
2094 | void AliAnalysisTaskGammaConvDalitzV1::CalculatePi0DalitzCandidates(){ | |
2095 | ||
2096 | // Conversion Gammas | |
2097 | ||
a280ac15 | 2098 | |
2bb2434e | 2099 | |
2100 | ||
2101 | if( fGoodGammas->GetEntries() > 0 && fGoodVirtualGammas->GetEntries() > 0 ){ | |
2102 | ||
4803eb1f | 2103 | vector<Bool_t> lGoodVirtualGamma(fGoodVirtualGammas->GetEntries(), kFALSE); |
2104 | ||
2bb2434e | 2105 | for(Int_t GammaIndex=0; GammaIndex<fGoodGammas->GetEntries(); GammaIndex++){ |
2106 | ||
2107 | AliAODConversionPhoton *gamma=dynamic_cast<AliAODConversionPhoton*>(fGoodGammas->At(GammaIndex)); | |
0a2b2b4b | 2108 | if (gamma==NULL) continue; |
2bb2434e | 2109 | for(Int_t virtualGammaIndex=0;virtualGammaIndex<fGoodVirtualGammas->GetEntries();virtualGammaIndex++){ |
2110 | ||
2111 | AliAODConversionPhoton *Vgamma=dynamic_cast<AliAODConversionPhoton*>(fGoodVirtualGammas->At(virtualGammaIndex)); | |
0a2b2b4b | 2112 | if (Vgamma==NULL) continue; |
2bb2434e | 2113 | //Check for same Electron ID |
2114 | if(gamma->GetTrackLabelPositive() == Vgamma->GetTrackLabelPositive() || | |
2115 | gamma->GetTrackLabelNegative() == Vgamma->GetTrackLabelNegative() || | |
2116 | gamma->GetTrackLabelNegative() == Vgamma->GetTrackLabelPositive() || | |
2117 | gamma->GetTrackLabelPositive() == Vgamma->GetTrackLabelNegative() ) continue; | |
2118 | ||
2119 | AliAODConversionMother *pi0cand = new AliAODConversionMother(gamma,Vgamma); | |
2120 | pi0cand->SetLabels(GammaIndex,virtualGammaIndex); | |
8a52eed5 | 2121 | |
2bb2434e | 2122 | |
8a52eed5 | 2123 | if( ( ((AliConversionMesonCuts*)fCutMesonArray->At(fiCut))->MesonIsSelected(pi0cand,kTRUE,((AliConversionCuts*)fCutGammaArray->At(fiCut))->GetEtaShift())) ){ |
2124 | ||
2125 | //cout<< "Meson Accepted "<<endl; | |
ae947965 | 2126 | |
2127 | Int_t zbin= fBGHandler[fiCut]->GetZBinIndex(fESDEvent->GetPrimaryVertex()->GetZ()); | |
2bb2434e | 2128 | Int_t mbin = 0; |
a280ac15 | 2129 | if( ((AliDalitzElectronCuts*)fCutElectronArray->At(fiCut))->UseTrackMultiplicity() ){ |
2bb2434e | 2130 | mbin = fBGHandler[fiCut]->GetMultiplicityBinIndex(fNumberOfESDTracks); |
2131 | } else { | |
2132 | mbin = fBGHandler[fiCut]->GetMultiplicityBinIndex(fGoodGammas->GetEntries()); | |
2133 | } | |
ae947965 | 2134 | |
a1c2f90c | 2135 | if ( fDoMesonQA ) { |
2136 | ||
2137 | hESDEposEnegInvMassPi0Pt[fiCut]->Fill( Vgamma->M(), pi0cand->Pt() ); | |
2138 | ||
2139 | if( pi0cand->M() > 0.1 && pi0cand->M() < 0.145 ){ | |
2140 | ||
2141 | hESDEposEnegAfterMassCutInvMassPi0Pt[fiCut]->Fill(Vgamma->M(),pi0cand->Pt()); | |
2142 | ||
2143 | } | |
2144 | } | |
ae947965 | 2145 | |
2146 | if( ((AliDalitzElectronCuts*) fCutElectronArray->At(fiCut))->DoMassCut() == kTRUE ) { | |
4803eb1f | 2147 | |
2148 | ||
a1c2f90c | 2149 | if( ((AliDalitzElectronCuts*) fCutElectronArray->At(fiCut))->MassCut( pi0cand->Pt() , Vgamma->M() ) == kTRUE ){ |
4803eb1f | 2150 | |
ae947965 | 2151 | hESDMotherInvMassPt[fiCut]->Fill(pi0cand->M(),pi0cand->Pt()); |
fcc79cf5 | 2152 | |
ae947965 | 2153 | Double_t sparesFill[4] = {pi0cand->M(),pi0cand->Pt(),(Double_t)zbin,(Double_t)mbin}; |
2154 | sESDMotherInvMassPtZM[fiCut]->Fill(sparesFill,1); | |
4803eb1f | 2155 | |
4803eb1f | 2156 | |
fcc79cf5 | 2157 | if ( fDoMesonQA ) { |
2158 | ||
d9d6352b | 2159 | hESDMotherPhi[fiCut]->Fill(pi0cand->Phi()); |
4803eb1f | 2160 | |
fcc79cf5 | 2161 | if( lGoodVirtualGamma[virtualGammaIndex] == kFALSE ) { |
2162 | ||
a1c2f90c | 2163 | FillElectronQAHistos(Vgamma); |
2279d237 | 2164 | |
fcc79cf5 | 2165 | lGoodVirtualGamma[virtualGammaIndex] = kTRUE; |
a1c2f90c | 2166 | fNVirtualGammas++; |
fcc79cf5 | 2167 | } |
2279d237 | 2168 | } |
ae947965 | 2169 | } |
2170 | } | |
2171 | else { | |
2172 | hESDMotherInvMassPt[fiCut]->Fill(pi0cand->M(),pi0cand->Pt()); | |
2173 | Double_t sparesFill[4] = {pi0cand->M(),pi0cand->Pt(),(Double_t)zbin,(Double_t)mbin}; | |
2174 | sESDMotherInvMassPtZM[fiCut]->Fill(sparesFill,1); | |
4803eb1f | 2175 | |
fcc79cf5 | 2176 | |
2177 | if ( fDoMesonQA ) { | |
2178 | ||
2179 | hESDMotherPhi[fiCut]->Fill(pi0cand->Phi()); | |
2180 | ||
2181 | if( lGoodVirtualGamma[virtualGammaIndex] == kFALSE ) { | |
2279d237 | 2182 | |
a1c2f90c | 2183 | FillElectronQAHistos(Vgamma); |
4803eb1f | 2184 | |
4803eb1f | 2185 | lGoodVirtualGamma[virtualGammaIndex] = kTRUE; |
a1c2f90c | 2186 | fNVirtualGammas++; |
4803eb1f | 2187 | |
fcc79cf5 | 2188 | } |
2279d237 | 2189 | } |
ae947965 | 2190 | } |
2191 | ||
fcc79cf5 | 2192 | if( fDoChicAnalysis) { |
ae947965 | 2193 | |
2194 | hESDPi0MotherInvMassPt[fiCut]->Fill(pi0cand->M(),pi0cand->Pt()); | |
2195 | ||
a1c2f90c | 2196 | Double_t diffMass = pi0cand->M() - Vgamma->M(); |
ae947965 | 2197 | |
2198 | hESDPi0MotherDiffInvMassPt[fiCut]->Fill( diffMass , pi0cand->Pt() ); | |
2199 | ||
a1c2f90c | 2200 | if( Vgamma->M() > 2.5 && Vgamma->M() < 3.4){ |
ae947965 | 2201 | hESDPi0MotherDiffLimInvMassPt[fiCut]->Fill( diffMass , pi0cand->Pt() ); |
fcc79cf5 | 2202 | } |
2203 | } | |
ae947965 | 2204 | |
2205 | if(fMCEvent){ | |
2bb2434e | 2206 | ProcessTrueMesonCandidates(pi0cand,gamma,Vgamma); |
ae947965 | 2207 | } |
a280ac15 | 2208 | } |
2bb2434e | 2209 | delete pi0cand; |
2210 | pi0cand=0x0; | |
2211 | } | |
2212 | } | |
a280ac15 | 2213 | } |
2bb2434e | 2214 | } |
2215 | ||
2216 | //________________________________________________________________________ | |
2217 | void AliAnalysisTaskGammaConvDalitzV1::CalculateBackground(){ | |
2218 | ||
2219 | Int_t zbin= fBGHandler[fiCut]->GetZBinIndex(fESDEvent->GetPrimaryVertex()->GetZ()); | |
2220 | Int_t mbin = 0; | |
a280ac15 | 2221 | |
2bb2434e | 2222 | Int_t method = 0; |
2223 | ||
2224 | method = ((AliDalitzElectronCuts*) fCutElectronArray->At(fiCut))->GetBKGMethod(); | |
2225 | ||
2226 | ||
2227 | if(((AliDalitzElectronCuts*)fCutElectronArray->At(fiCut))->UseTrackMultiplicity()){ | |
2228 | mbin = fBGHandler[fiCut]->GetMultiplicityBinIndex(fNumberOfESDTracks); | |
2229 | } else { | |
2230 | mbin = fBGHandler[fiCut]->GetMultiplicityBinIndex(fGoodGammas->GetEntries()); | |
2231 | } | |
2232 | ||
2233 | if( method == 1 || method == 2 ) { | |
2234 | ||
2235 | AliGammaConversionAODBGHandler::GammaConversionVertex *bgEventVertex = NULL; | |
2236 | ||
2237 | if( ((AliDalitzElectronCuts*)fCutElectronArray->At(fiCut))->UseTrackMultiplicity() ) { | |
2238 | ||
2239 | for(Int_t nEventsInBG=0;nEventsInBG<fBGHandler[fiCut]->GetNBGEvents();nEventsInBG++){ | |
2240 | ||
2241 | AliGammaConversionAODVector *previousEventV0s = fBGHandler[fiCut]->GetBGGoodV0s(zbin,mbin,nEventsInBG); | |
2242 | ||
2243 | if(fMoveParticleAccordingToVertex == kTRUE && method == 1){ | |
2244 | bgEventVertex = fBGHandler[fiCut]->GetBGEventVertex(zbin,mbin,nEventsInBG); | |
2245 | } | |
2246 | ||
2247 | for(Int_t iCurrent=0;iCurrent<fGoodVirtualGammas->GetEntries();iCurrent++){ | |
2248 | AliAODConversionPhoton currentEventGoodV0 = *(AliAODConversionPhoton*)(fGoodVirtualGammas->At(iCurrent)); | |
a280ac15 | 2249 | |
2250 | for(UInt_t iPrevious=0;iPrevious<previousEventV0s->size();iPrevious++){ | |
2bb2434e | 2251 | AliAODConversionPhoton previousGoodV0 = (AliAODConversionPhoton)(*(previousEventV0s->at(iPrevious))); |
2252 | ||
2253 | if(fMoveParticleAccordingToVertex == kTRUE && method == 1 ){ | |
2254 | MoveParticleAccordingToVertex(&previousGoodV0,bgEventVertex); | |
2255 | } | |
2256 | ||
2257 | AliAODConversionMother *backgroundCandidate = new AliAODConversionMother(¤tEventGoodV0,&previousGoodV0); | |
8a52eed5 | 2258 | |
2259 | ||
2260 | if( ( ((AliConversionMesonCuts*)fCutMesonArray->At(fiCut))->MesonIsSelected(backgroundCandidate,kFALSE, ((AliConversionCuts*)fCutGammaArray->At(fiCut))->GetEtaShift()))){ | |
ae947965 | 2261 | if( ((AliDalitzElectronCuts*) fCutElectronArray->At(fiCut))->DoMassCut() == kTRUE ) { |
4803eb1f | 2262 | |
a1c2f90c | 2263 | if( ((AliDalitzElectronCuts*) fCutElectronArray->At(fiCut))->MassCut( backgroundCandidate->Pt() , currentEventGoodV0.M() ) == kTRUE ){ |
4803eb1f | 2264 | |
ae947965 | 2265 | hESDMotherBackInvMassPt[fiCut]->Fill(backgroundCandidate->M(),backgroundCandidate->Pt()); |
2266 | Double_t sparesFill[4] = {backgroundCandidate->M(),backgroundCandidate->Pt(),(Double_t)zbin,(Double_t)mbin}; | |
2267 | sESDMotherBackInvMassPtZM[fiCut]->Fill(sparesFill,1); | |
2268 | } | |
2269 | } | |
2270 | else { | |
2271 | hESDMotherBackInvMassPt[fiCut]->Fill(backgroundCandidate->M(),backgroundCandidate->Pt()); | |
2272 | Double_t sparesFill[4] = {backgroundCandidate->M(),backgroundCandidate->Pt(),(Double_t)zbin,(Double_t)mbin}; | |
2273 | sESDMotherBackInvMassPtZM[fiCut]->Fill(sparesFill,1); | |
2274 | } | |
2bb2434e | 2275 | } |
2276 | delete backgroundCandidate; | |
2277 | backgroundCandidate = 0x0; | |
2278 | } | |
2279 | } | |
2280 | } | |
2281 | } | |
2282 | else{ | |
2283 | for(Int_t nEventsInBG=0;nEventsInBG <fBGHandler[fiCut]->GetNBGEvents();nEventsInBG++){ | |
2284 | AliGammaConversionAODVector *previousEventV0s = fBGHandler[fiCut]->GetBGGoodV0s(zbin,mbin,nEventsInBG); | |
2285 | if(previousEventV0s){ | |
2286 | if(fMoveParticleAccordingToVertex == kTRUE && method == 1){ | |
2287 | bgEventVertex = fBGHandler[fiCut]->GetBGEventVertex(zbin,mbin,nEventsInBG); | |
2288 | } | |
2289 | for(Int_t iCurrent=0;iCurrent<fGoodVirtualGammas->GetEntries();iCurrent++){ | |
a280ac15 | 2290 | |
2bb2434e | 2291 | AliAODConversionPhoton currentEventGoodV0 = *(AliAODConversionPhoton*)(fGoodVirtualGammas->At(iCurrent)); |
a280ac15 | 2292 | |
2bb2434e | 2293 | for(UInt_t iPrevious=0;iPrevious<previousEventV0s->size();iPrevious++){ |
2294 | ||
2295 | AliAODConversionPhoton previousGoodV0 = (AliAODConversionPhoton)(*(previousEventV0s->at(iPrevious))); | |
2296 | ||
2297 | if(fMoveParticleAccordingToVertex == kTRUE && method ==1){ | |
2298 | MoveParticleAccordingToVertex(&previousGoodV0,bgEventVertex); | |
2299 | } | |
2300 | ||
2301 | AliAODConversionMother *backgroundCandidate = new AliAODConversionMother(¤tEventGoodV0,&previousGoodV0); | |
8a52eed5 | 2302 | |
2303 | if((((AliConversionMesonCuts*)fCutMesonArray->At(fiCut))->MesonIsSelected(backgroundCandidate,kFALSE,((AliConversionCuts*)fCutGammaArray->At(fiCut))->GetEtaShift()))){ | |
ae947965 | 2304 | |
2305 | if( ((AliDalitzElectronCuts*) fCutElectronArray->At(fiCut))->DoMassCut() == kTRUE ) { | |
4803eb1f | 2306 | |
a1c2f90c | 2307 | if( ((AliDalitzElectronCuts*) fCutElectronArray->At(fiCut))->MassCut( backgroundCandidate->Pt() , currentEventGoodV0.M() ) == kTRUE ){ |
4803eb1f | 2308 | |
ae947965 | 2309 | |
2310 | hESDMotherBackInvMassPt[fiCut]->Fill(backgroundCandidate->M(),backgroundCandidate->Pt()); | |
2311 | Double_t sparesFill[4] = {backgroundCandidate->M(),backgroundCandidate->Pt(),(Double_t)zbin,(Double_t)mbin}; | |
2312 | sESDMotherBackInvMassPtZM[fiCut]->Fill(sparesFill,1); | |
2313 | } | |
2314 | } | |
2315 | else { | |
2316 | hESDMotherBackInvMassPt[fiCut]->Fill(backgroundCandidate->M(),backgroundCandidate->Pt()); | |
2317 | Double_t sparesFill[4] = {backgroundCandidate->M(),backgroundCandidate->Pt(),(Double_t)zbin,(Double_t)mbin}; | |
2318 | sESDMotherBackInvMassPtZM[fiCut]->Fill(sparesFill,1); | |
2319 | } | |
2bb2434e | 2320 | } |
2321 | delete backgroundCandidate; | |
2322 | backgroundCandidate = 0x0; | |
2323 | } | |
2324 | } | |
2325 | } | |
2326 | } | |
2327 | } | |
2328 | } | |
2329 | ||
2330 | else if( method == 3 ){ | |
2331 | ||
a280ac15 | 2332 | for(Int_t iCurrent=0;iCurrent<fGoodVirtualGammas->GetEntries();iCurrent++){ |
2bb2434e | 2333 | |
a280ac15 | 2334 | AliAODConversionPhoton currentEventGoodV0 = *(AliAODConversionPhoton*)(fGoodVirtualGammas->At(iCurrent)); |
2bb2434e | 2335 | |
a280ac15 | 2336 | for(Int_t iPrevious=0;iPrevious<fGammasPool[fiCut]->GetEntries();iPrevious++){ |
2bb2434e | 2337 | |
a280ac15 | 2338 | AliAODConversionPhoton previousGoodV0 = *(AliAODConversionPhoton*)((fGammasPool[fiCut]->At(iPrevious) )); |
2bb2434e | 2339 | |
2bb2434e | 2340 | |
a280ac15 | 2341 | AliAODConversionMother *backgroundCandidate = new AliAODConversionMother(¤tEventGoodV0,&previousGoodV0); |
8a52eed5 | 2342 | |
a280ac15 | 2343 | |
8a52eed5 | 2344 | if((((AliConversionMesonCuts*)fCutMesonArray->At(fiCut))->MesonIsSelected(backgroundCandidate,kFALSE, ((AliConversionCuts*)fCutGammaArray->At(fiCut))->GetEtaShift()))){ |
ae947965 | 2345 | |
2346 | if( ((AliDalitzElectronCuts*) fCutElectronArray->At(fiCut))->DoMassCut() == kTRUE ) { | |
4803eb1f | 2347 | |
a1c2f90c | 2348 | if( ((AliDalitzElectronCuts*) fCutElectronArray->At(fiCut))->MassCut( backgroundCandidate->Pt() , currentEventGoodV0.M() ) == kTRUE ){ |
4803eb1f | 2349 | |
ae947965 | 2350 | |
2351 | hESDMotherBackInvMassPt[fiCut]->Fill(backgroundCandidate->M(),backgroundCandidate->Pt()); | |
2352 | Double_t sparesFill[4] = {backgroundCandidate->M(),backgroundCandidate->Pt(),(Double_t)zbin,(Double_t)mbin}; | |
2353 | sESDMotherBackInvMassPtZM[fiCut]->Fill(sparesFill,1); | |
2354 | ||
2355 | } | |
2356 | } | |
2357 | else{ | |
2358 | ||
2359 | hESDMotherBackInvMassPt[fiCut]->Fill(backgroundCandidate->M(),backgroundCandidate->Pt()); | |
2360 | Double_t sparesFill[4] = {backgroundCandidate->M(),backgroundCandidate->Pt(),(Double_t)zbin,(Double_t)mbin}; | |
2361 | sESDMotherBackInvMassPtZM[fiCut]->Fill(sparesFill,1); | |
2362 | ||
2363 | } | |
2bb2434e | 2364 | } |
a280ac15 | 2365 | delete backgroundCandidate; |
2366 | backgroundCandidate = 0x0; | |
2367 | } | |
2368 | } | |
2bb2434e | 2369 | } |
2370 | ||
2371 | } | |
2372 | //________________________________________________________________________ | |
2373 | void AliAnalysisTaskGammaConvDalitzV1::UpdateEventByEventData(){ | |
2374 | //see header file for documentation | |
2375 | ||
2376 | Int_t method = 0; | |
2377 | ||
2378 | method = ( (AliDalitzElectronCuts*)fCutElectronArray->At(fiCut))->GetBKGMethod(); | |
a280ac15 | 2379 | |
fcc79cf5 | 2380 | |
2381 | ||
2382 | ||
2bb2434e | 2383 | if( method == 1 ) { |
2384 | ||
a280ac15 | 2385 | if(fGoodGammas->GetEntries() > 0 ){ |
2bb2434e | 2386 | |
a280ac15 | 2387 | if( ((AliDalitzElectronCuts*)fCutElectronArray->At(fiCut))->UseTrackMultiplicity() ){ |
2388 | fBGHandler[fiCut]->AddEvent(fGoodGammas,fESDEvent->GetPrimaryVertex()->GetX(),fESDEvent->GetPrimaryVertex()->GetY(),fESDEvent->GetPrimaryVertex()->GetZ(),fNumberOfESDTracks); | |
2389 | } | |
2bb2434e | 2390 | |
a280ac15 | 2391 | else{ // means we use #V0s for multiplicity |
2392 | fBGHandler[fiCut]->AddEvent(fGoodGammas,fESDEvent->GetPrimaryVertex()->GetX(),fESDEvent->GetPrimaryVertex()->GetY(),fESDEvent->GetPrimaryVertex()->GetZ(),fGoodGammas->GetEntries()); | |
2393 | } | |
2bb2434e | 2394 | } |
2bb2434e | 2395 | } |
2396 | ||
2397 | else if ( method == 2 ){ | |
a280ac15 | 2398 | |
2399 | if(fGoodVirtualGammas->GetEntries() > 0 ){ | |
2400 | if(((AliDalitzElectronCuts*)fCutElectronArray->At(fiCut))->UseTrackMultiplicity()){ | |
2401 | fBGHandler[fiCut]->AddEvent(fGoodVirtualGammas,fESDEvent->GetPrimaryVertex()->GetX(),fESDEvent->GetPrimaryVertex()->GetY(),fESDEvent->GetPrimaryVertex()->GetZ(),fNumberOfESDTracks); | |
2402 | } | |
2403 | else{ // means we use #V0s for multiplicity | |
2404 | fBGHandler[fiCut]->AddEvent(fGoodVirtualGammas,fESDEvent->GetPrimaryVertex()->GetX(),fESDEvent->GetPrimaryVertex()->GetY(),fESDEvent->GetPrimaryVertex()->GetZ(),fGoodVirtualGammas->GetEntries()); | |
2405 | } | |
2bb2434e | 2406 | } |
2bb2434e | 2407 | } |
a280ac15 | 2408 | else if ( method == 3 ) { |
2409 | ||
2410 | ||
2411 | ||
2412 | for(Int_t index = 0; index < fGoodGammas->GetEntries(); index++){ | |
2413 | ||
2414 | ||
2415 | if ( fGammasPool[fiCut]->GetEntries() > ((AliDalitzElectronCuts*)fCutElectronArray->At(fiCut))->NumberOfRotationEvents() ){ | |
2416 | fGammasPool[fiCut]->RemoveLast(); | |
2417 | } | |
2418 | fGammasPool[fiCut]->AddFirst( new AliAODConversionPhoton(*(AliAODConversionPhoton*)(fGoodGammas->At(index)) ) ); | |
2bb2434e | 2419 | |
2bb2434e | 2420 | } |
a280ac15 | 2421 | } |
2bb2434e | 2422 | } |
2423 | //______________________________________________________________________ | |
2424 | void AliAnalysisTaskGammaConvDalitzV1::ProcessTrueMesonCandidates(AliAODConversionMother *Pi0Candidate, AliAODConversionPhoton *TrueGammaCandidate, AliAODConversionPhoton *TrueVirtualGammaCandidate) | |
2425 | { | |
2426 | ||
2427 | // Process True Mesons | |
2428 | ||
2429 | AliStack *MCStack = fMCEvent->Stack(); | |
2430 | ||
ae947965 | 2431 | if( TrueGammaCandidate->GetV0Index()<fESDEvent->GetNumberOfV0s() ){ |
8a52eed5 | 2432 | |
2433 | ||
2434 | //cout<<"Entro True Meson"<<endl; | |
2bb2434e | 2435 | |
2436 | ||
2437 | Bool_t isTruePi0 = kFALSE; | |
2438 | Bool_t isTrueEta = kFALSE; | |
ae947965 | 2439 | Bool_t massCutAccept = kFALSE; |
86eaf9ae | 2440 | //Bool_t isTrueChiC = kFALSE; |
2bb2434e | 2441 | Int_t gammaMCLabel = TrueGammaCandidate->GetMCParticleLabel(MCStack); |
2442 | Int_t gammaMotherLabel = -1; | |
2443 | ||
2444 | ||
ae947965 | 2445 | if( ((AliDalitzElectronCuts*) fCutElectronArray->At(fiCut))->DoMassCut() == kTRUE ) { |
2446 | ||
a1c2f90c | 2447 | if( ((AliDalitzElectronCuts*) fCutElectronArray->At(fiCut))->MassCut( Pi0Candidate->Pt() , TrueVirtualGammaCandidate->M() ) == kTRUE ){ |
4803eb1f | 2448 | |
ae947965 | 2449 | massCutAccept = kTRUE; |
2450 | } | |
2451 | } | |
2452 | else { | |
a1c2f90c | 2453 | massCutAccept = kTRUE; |
ae947965 | 2454 | } |
2455 | ||
2456 | ||
2457 | ||
2bb2434e | 2458 | |
2459 | ||
2460 | if(gammaMCLabel != -1){ // Gamma is Combinatorial; MC Particles don't belong to the same Mother | |
2461 | ||
2462 | ||
2463 | // Daughters Gamma 0 | |
2464 | TParticle * negativeMC = (TParticle*)TrueGammaCandidate->GetNegativeMCDaughter(MCStack); | |
2465 | TParticle * positiveMC = (TParticle*)TrueGammaCandidate->GetPositiveMCDaughter(MCStack); | |
2466 | TParticle * gammaMC = (TParticle*)MCStack->Particle(gammaMCLabel); | |
2467 | ||
2468 | ||
2469 | if(TMath::Abs(negativeMC->GetPdgCode())==11 && TMath::Abs(positiveMC->GetPdgCode())==11){ // Electrons ... | |
2470 | ||
2471 | if(negativeMC->GetUniqueID() == 5 && positiveMC->GetUniqueID() ==5){ // ... From Conversion ... | |
2bb2434e | 2472 | |
a280ac15 | 2473 | if(gammaMC->GetPdgCode() == 22){ // ... with Gamma Mother |
2474 | gammaMotherLabel=gammaMC->GetFirstMother(); | |
2475 | } | |
2bb2434e | 2476 | } |
2477 | } | |
a280ac15 | 2478 | } |
2479 | ||
2480 | ||
2481 | Int_t virtualGammaMCLabel = TrueVirtualGammaCandidate->GetMCParticleLabel(MCStack); | |
2482 | Int_t virtualGammaMotherLabel = -1; | |
2483 | Int_t virtualGamma = 1; | |
ae947965 | 2484 | Int_t virtualGammaGrandMotherLabel =-1; |
2485 | ||
2bb2434e | 2486 | |
a280ac15 | 2487 | if(virtualGammaMCLabel != -1){ // Gamma is Combinatorial; MC Particles don't belong to the same Mother |
2488 | // Daughters Gamma 1 | |
2489 | TParticle * negativeMC = (TParticle*)TrueVirtualGammaCandidate->GetNegativeMCDaughter(MCStack); | |
2490 | TParticle * positiveMC = (TParticle*)TrueVirtualGammaCandidate->GetPositiveMCDaughter(MCStack); | |
2491 | TParticle * virtualGammaMotherMC = (TParticle*)MCStack->Particle(virtualGammaMCLabel); | |
2bb2434e | 2492 | |
a280ac15 | 2493 | if(TMath::Abs(negativeMC->GetPdgCode())==11 && TMath::Abs(positiveMC->GetPdgCode())==11){ // Electrons ... |
2bb2434e | 2494 | |
a280ac15 | 2495 | if( virtualGammaMotherMC->GetPdgCode() != 22 ){ |
2496 | virtualGammaMotherLabel=virtualGammaMCLabel; | |
ae947965 | 2497 | if(virtualGammaMotherMC->GetPdgCode() == 443){ |
2498 | virtualGammaGrandMotherLabel=virtualGammaMotherMC->GetFirstMother(); | |
2499 | } | |
2500 | } | |
2bb2434e | 2501 | |
a280ac15 | 2502 | else if(negativeMC->GetUniqueID() == 5 && positiveMC->GetUniqueID() ==5){ // ... From Conversion ... |
a280ac15 | 2503 | virtualGammaMotherLabel=virtualGammaMotherMC->GetFirstMother(); |
2504 | virtualGamma = 0; //no virtual gamma | |
2bb2434e | 2505 | } |
a280ac15 | 2506 | } |
2507 | } | |
2508 | ||
2509 | ||
ae947965 | 2510 | if(gammaMotherLabel >= 0 && ( gammaMotherLabel == virtualGammaMotherLabel) ){ |
2bb2434e | 2511 | |
a280ac15 | 2512 | if(((TParticle*)MCStack->Particle(virtualGammaMotherLabel))->GetPdgCode() == 111){ |
2513 | isTruePi0=kTRUE; | |
2bb2434e | 2514 | } |
2515 | ||
a280ac15 | 2516 | if(((TParticle*)MCStack->Particle(virtualGammaMotherLabel))->GetPdgCode() == 221){ |
2517 | isTrueEta=kTRUE; | |
2518 | } | |
ae947965 | 2519 | |
2520 | ||
2521 | } | |
a280ac15 | 2522 | |
fcc79cf5 | 2523 | if( fDoChicAnalysis) { |
2524 | if(gammaMotherLabel>=0 && ( gammaMotherLabel == virtualGammaGrandMotherLabel) ){ | |
2525 | if(((TParticle*)MCStack->Particle(virtualGammaGrandMotherLabel))->GetPdgCode() == 445 || | |
2526 | ((TParticle*)MCStack->Particle(virtualGammaGrandMotherLabel))->GetPdgCode() == 10443 || | |
2527 | ((TParticle*)MCStack->Particle(virtualGammaGrandMotherLabel))->GetPdgCode() == 20443 ){ | |
a1c2f90c | 2528 | |
fcc79cf5 | 2529 | hESDTrueMotherChiCInvMassPt[fiCut]->Fill(Pi0Candidate->M(),Pi0Candidate->Pt()); |
a1c2f90c | 2530 | hESDTrueMotherChiCDiffInvMassPt[fiCut]->Fill(Pi0Candidate->M()-TrueVirtualGammaCandidate->M(),Pi0Candidate->Pt()); |
fcc79cf5 | 2531 | } |
2532 | } | |
2533 | } | |
a280ac15 | 2534 | |
ae947965 | 2535 | if( ( isTruePi0 || isTrueEta) && massCutAccept ){ // True Pion or Eta |
2536 | ||
86eaf9ae | 2537 | if ( virtualGamma == 1 ) { //True Dalitz |
2538 | ||
2539 | Float_t weighted= 1; | |
2540 | ||
2279d237 | 2541 | if( ((AliDalitzElectronCuts*) fCutElectronArray->At(fiCut))->DoWeights() ) { |
86eaf9ae | 2542 | if(((AliConversionCuts*)fCutGammaArray->At(fiCut))->IsParticleFromBGEvent(gammaMotherLabel, fMCStack,fInputEvent)){ |
2543 | if (((TParticle*)MCStack->Particle(gammaMotherLabel))->Pt()>0.005){ | |
2544 | weighted= ((AliConversionCuts*)fCutGammaArray->At(fiCut))->GetWeightForMeson(fV0Reader->GetPeriodName(),gammaMotherLabel,fMCStack,fInputEvent); | |
2545 | } | |
2546 | } | |
2547 | } | |
2548 | ||
2549 | hESDTrueMotherInvMassPt[fiCut]->Fill(Pi0Candidate->M(),Pi0Candidate->Pt(),weighted); | |
a1c2f90c | 2550 | hESDTrueMotherDalitzInvMassPt[fiCut]->Fill( TrueVirtualGammaCandidate->M(),Pi0Candidate->Pt(),weighted); |
86eaf9ae | 2551 | |
ae947965 | 2552 | if(gammaMotherLabel < MCStack->GetNprimary()){ // Only primary pi0 for efficiency calculation |
2553 | ||
86eaf9ae | 2554 | |
2555 | hESDTruePrimaryMotherInvMassPt[fiCut]->Fill( Pi0Candidate->M(),Pi0Candidate->Pt(),weighted); | |
2556 | hESDTruePrimaryMotherW0WeightingInvMassPt[fiCut]->Fill( Pi0Candidate->M(), Pi0Candidate->Pt() ); | |
2557 | ||
ae947965 | 2558 | hESDTruePrimaryMotherInvMassMCPt[fiCut]->Fill(Pi0Candidate->M(),((TParticle*)MCStack->Particle(virtualGammaMotherLabel))->Pt(),weighted); |
2bb2434e | 2559 | if(isTruePi0){ // Only primaries for unfolding |
ae947965 | 2560 | hESDTruePrimaryPi0DalitzESDPtMCPt[fiCut]->Fill(Pi0Candidate->Pt(),((TParticle*)MCStack->Particle(virtualGammaMotherLabel))->Pt(),weighted); |
2bb2434e | 2561 | } |
2562 | } | |
ae947965 | 2563 | else { // Secondary Meson |
86eaf9ae | 2564 | Float_t weightedSec= 1; |
2565 | ||
2566 | if( ((AliDalitzElectronCuts*) fCutElectronArray->At(fiCut))->DoWeights() ) { | |
2567 | Int_t secMotherLabel = ((TParticle*)MCStack->Particle(gammaMotherLabel))->GetMother(0); | |
2568 | if(((AliConversionCuts*)fCutGammaArray->At(fiCut))->IsParticleFromBGEvent(gammaMotherLabel, fMCStack, fInputEvent) && MCStack->Particle(gammaMotherLabel)->GetPdgCode()==310){ | |
2569 | weightedSec= ((AliConversionCuts*)fCutGammaArray->At(fiCut))->GetWeightForMeson(fV0Reader->GetPeriodName(),secMotherLabel, fMCStack, fInputEvent)/2.; //invariant mass is additive thus the weight for the daughters has to be devide by two for the K0s at a certain pt | |
2570 | } | |
2571 | } | |
2572 | ||
2573 | hESDTrueSecondaryMotherInvMassPt[fiCut]->Fill(Pi0Candidate->M(),Pi0Candidate->Pt(),weightedSec); | |
2bb2434e | 2574 | } |
2575 | } | |
86eaf9ae | 2576 | |
2577 | ||
a280ac15 | 2578 | else if ( virtualGamma == 0 ){ |
86eaf9ae | 2579 | |
2580 | Float_t weighted= 1; | |
2581 | ||
2582 | if( ((AliDalitzElectronCuts*) fCutElectronArray->At(fiCut))->DoWeights() ) { | |
2583 | if(((AliConversionCuts*)fCutGammaArray->At(fiCut))->IsParticleFromBGEvent(gammaMotherLabel, fMCStack,fInputEvent)){ | |
2584 | if (((TParticle*)MCStack->Particle(gammaMotherLabel))->Pt()>0.005){ | |
2585 | weighted= ((AliConversionCuts*)fCutGammaArray->At(fiCut))->GetWeightForMeson(fV0Reader->GetPeriodName(),gammaMotherLabel,fMCStack,fInputEvent); | |
2586 | } | |
2587 | } | |
2588 | } | |
2589 | ||
2590 | hESDTrueMotherPi0GGInvMassPt[fiCut]->Fill(Pi0Candidate->M(),Pi0Candidate->Pt(),weighted); // Pi0 from GG | |
2591 | ||
2592 | if( gammaMotherLabel < MCStack->GetNprimary() ){ | |
2593 | hESDTruePrimaryMotherPi0GGInvMassPt[fiCut]->Fill(Pi0Candidate->M(),Pi0Candidate->Pt(),weighted); | |
2594 | } | |
2595 | else { | |
2596 | ||
2597 | Float_t weightedSec= 1; | |
2598 | ||
2599 | if( ((AliDalitzElectronCuts*) fCutElectronArray->At(fiCut))->DoWeights() ) { | |
2600 | Int_t secMotherLabel = ((TParticle*)MCStack->Particle(gammaMotherLabel))->GetMother(0); | |
2601 | if(((AliConversionCuts*)fCutGammaArray->At(fiCut))->IsParticleFromBGEvent(gammaMotherLabel, fMCStack, fInputEvent) && MCStack->Particle(gammaMotherLabel)->GetPdgCode()==310){ | |
2602 | weightedSec= ((AliConversionCuts*)fCutGammaArray->At(fiCut))->GetWeightForMeson(fV0Reader->GetPeriodName(),secMotherLabel, fMCStack, fInputEvent)/2.; //invariant mass is additive thus the weight for the daughters has to be devide by two for the K0s at a certain pt | |
2603 | } | |
2604 | } | |
2605 | hESDTrueSecondaryMotherPi0GGInvMassPt[fiCut]->Fill(Pi0Candidate->M(),Pi0Candidate->Pt(),weightedSec); | |
2606 | } | |
a280ac15 | 2607 | } |
2608 | } | |
2609 | ||
ae947965 | 2610 | if(!isTruePi0 && !isTrueEta && massCutAccept ){ // Background |
a280ac15 | 2611 | if(gammaMotherLabel>-1 && virtualGammaMotherLabel>-1 && virtualGamma == 0){ // Both Tracks are Photons and have a mother but not Pi0 or Eta |
2612 | hESDTrueBckGGInvMassPt[fiCut]->Fill(Pi0Candidate->M(),Pi0Candidate->Pt()); | |
2613 | } else { // No photon or without mother | |
2614 | hESDTrueBckContInvMassPt[fiCut]->Fill(Pi0Candidate->M(),Pi0Candidate->Pt()); | |
2615 | } | |
2616 | } | |
2617 | } | |
2bb2434e | 2618 | } |
0f8c33c1 | 2619 | |
2620 | ||
2bb2434e | 2621 | //________________________________________________________________________ |
2622 | void AliAnalysisTaskGammaConvDalitzV1::MoveParticleAccordingToVertex(AliAODConversionPhoton* particle,const AliGammaConversionAODBGHandler::GammaConversionVertex *vertex){ | |
2623 | //see header file for documentation | |
2624 | ||
2625 | Double_t dx = vertex->fX - fESDEvent->GetPrimaryVertex()->GetX(); | |
2626 | Double_t dy = vertex->fY - fESDEvent->GetPrimaryVertex()->GetY(); | |
2627 | Double_t dz = vertex->fZ - fESDEvent->GetPrimaryVertex()->GetZ(); | |
2628 | ||
2629 | Double_t movedPlace[3] = {particle->GetConversionX() - dx,particle->GetConversionY() - dy,particle->GetConversionZ() - dz}; | |
2630 | particle->SetConversionPoint(movedPlace); | |
2631 | } | |
2632 | ||
2633 | ||
2634 | //________________________________________________________________________ | |
2635 | void AliAnalysisTaskGammaConvDalitzV1::CountESDTracks(){ | |
2636 | ||
2bb2434e | 2637 | // Using standard function for setting Cuts |
2638 | Bool_t selectPrimaries=kTRUE; | |
0a2b2b4b | 2639 | AliESDtrackCuts *EsdTrackCuts = AliESDtrackCuts::GetStandardITSTPCTrackCuts2010(selectPrimaries); |
2bb2434e | 2640 | EsdTrackCuts->SetMaxDCAToVertexZ(2); |
2641 | EsdTrackCuts->SetEtaRange(-0.8, 0.8); | |
2642 | EsdTrackCuts->SetPtRange(0.15); | |
58326f11 | 2643 | EsdTrackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD, AliESDtrackCuts::kBoth); |
2bb2434e | 2644 | |
58326f11 | 2645 | fNumberOfESDTrackskBoth = 0; |
2bb2434e | 2646 | for(Int_t iTracks = 0; iTracks < fESDEvent->GetNumberOfTracks(); iTracks++){ |
2647 | AliESDtrack* curTrack = fESDEvent->GetTrack(iTracks); | |
2648 | if(!curTrack) continue; | |
58326f11 | 2649 | if(EsdTrackCuts->AcceptTrack(curTrack) ) fNumberOfESDTrackskBoth++; |
2bb2434e | 2650 | } |
2651 | delete EsdTrackCuts; | |
2652 | EsdTrackCuts=0x0; | |
2653 | ||
2654 | return; | |
2655 | } | |
2656 | ||
2657 | //_____________________________________________________________________________ | |
2658 | void AliAnalysisTaskGammaConvDalitzV1::ProcessMCParticles() | |
2659 | { | |
2660 | ||
2bb2434e | 2661 | // Loop over all primary MC particle |
ccfa8c0d | 2662 | |
ae947965 | 2663 | for(Int_t i = 0; i < fMCStack->GetNprimary(); i++) { |
2664 | ||
2665 | ||
2666 | TParticle* particle = (TParticle *)fMCStack->Particle(i); | |
2667 | if (!particle) continue; | |
2668 | ||
2669 | ||
2670 | Bool_t mcIsFromMB = kTRUE; | |
2671 | Int_t isMCFromMBHeader = -1; | |
2672 | ||
2673 | if(((AliConversionCuts*)fCutGammaArray->At(fiCut))->GetSignalRejection() != 0) { | |
2674 | isMCFromMBHeader | |
2675 | = ((AliConversionCuts*)fCutGammaArray->At(fiCut))->IsParticleFromBGEvent(i,fMCStack,fInputEvent); | |
2676 | if(isMCFromMBHeader == 0 && ((AliConversionCuts*)fCutGammaArray->At(fiCut))->GetSignalRejection() != 3) continue; | |
2677 | if(isMCFromMBHeader != 2) mcIsFromMB = kFALSE; | |
2678 | } | |
2679 | ||
2680 | if(((AliConversionCuts*)fCutGammaArray->At(fiCut))->PhotonIsSelectedMC(particle,fMCStack,kFALSE)){ | |
2681 | hMCAllGammaPt[fiCut]->Fill(particle->Pt()); // All MC Gamma | |
2682 | } | |
2683 | ||
2684 | if(((AliConversionCuts*)fCutGammaArray->At(fiCut))->PhotonIsSelectedMC(particle,fMCStack,kTRUE)){ | |
2685 | hMCConvGammaPt[fiCut]->Fill(particle->Pt()); | |
2d49ea4c | 2686 | if(fDoMesonQA) hMCConvGammaEta[fiCut]->Fill( particle->Eta()); |
2687 | ||
ae947965 | 2688 | if(mcIsFromMB){ |
2689 | hMCConvGammaRSPt[fiCut]->Fill(particle->Pt()); | |
2690 | } | |
2691 | } // Converted MC Gamma | |
2692 | ||
2693 | if(((AliDalitzElectronCuts*)fCutElectronArray->At(fiCut))->ElectronIsSelectedMC(i,fMCStack)){ | |
2d49ea4c | 2694 | if( particle->GetPdgCode() == -11) { |
2695 | hMCAllPositronsPt[fiCut]->Fill(particle->Pt()); // All positrons | |
2696 | if(fDoMesonQA) hMCAllPositronsEta[fiCut]->Fill( particle->Eta() ); | |
2697 | } | |
2698 | if( particle->GetPdgCode() == 11){ | |
2699 | hMCAllElectronsPt[fiCut]->Fill(particle->Pt()); // All electrons | |
2700 | if (fDoMesonQA) hMCAllElectronsEta[fiCut]->Fill(particle->Eta()); // All electrons | |
2701 | } | |
2702 | ||
ae947965 | 2703 | } |
2704 | ||
86eaf9ae | 2705 | if(((AliConversionMesonCuts*)fCutMesonArray->At(fiCut))->MesonIsSelectedMC( particle,fMCStack,((AliConversionCuts*)fCutGammaArray->At(fiCut))->GetEtaShift() ) ){ |
ae947965 | 2706 | |
2d49ea4c | 2707 | Float_t weighted= 1; |
86eaf9ae | 2708 | |
2709 | if( ((AliDalitzElectronCuts*) fCutElectronArray->At(fiCut))->DoWeights() ) { | |
ae947965 | 2710 | if(((AliConversionCuts*)fCutGammaArray->At(fiCut))->IsParticleFromBGEvent(i, fMCStack, fInputEvent)){ |
2711 | if (particle->Pt()>0.005){ | |
2712 | weighted= ((AliConversionCuts*)fCutGammaArray->At(fiCut))->GetWeightForMeson(fV0Reader->GetPeriodName(),i, fMCStack,fInputEvent); | |
2713 | } | |
2714 | } | |
86eaf9ae | 2715 | } |
2716 | ||
ae947965 | 2717 | if(particle->GetPdgCode() == 111)hMCPi0GGPt[fiCut]->Fill( particle->Pt() , weighted); // All MC Pi0 GG decay |
2718 | if(particle->GetPdgCode() == 221)hMCEtaGGPt[fiCut]->Fill( particle->Pt() , weighted); // All MC Eta GG decay | |
2719 | } | |
2720 | ||
2721 | ||
2722 | Int_t labelgamma = -1; | |
2723 | Int_t labelelectron = -1; | |
2724 | Int_t labelpositron = -1; | |
2725 | ||
a280ac15 | 2726 | |
ae947965 | 2727 | if( ((AliConversionMesonCuts*)fCutMesonArray->At(fiCut))->MesonIsSelectedMCDalitz(particle,fMCStack,labelelectron,labelpositron,labelgamma,((AliConversionCuts*)fCutGammaArray->At(fiCut))->GetEtaShift()) ) |
2728 | { | |
2729 | ||
2730 | ||
2d49ea4c | 2731 | Float_t weighted= 1; |
86eaf9ae | 2732 | if( ((AliDalitzElectronCuts*) fCutElectronArray->At(fiCut))->DoWeights() ) { |
ae947965 | 2733 | if(((AliConversionCuts*)fCutGammaArray->At(fiCut))->IsParticleFromBGEvent(i, fMCStack,fInputEvent)){ |
2734 | if (particle->Pt()>0.005){ | |
2735 | weighted= ((AliConversionCuts*)fCutGammaArray->At(fiCut))->GetWeightForMeson(fV0Reader->GetPeriodName(),i, fMCStack,fInputEvent); | |
2736 | } | |
2737 | } | |
86eaf9ae | 2738 | } |
ae947965 | 2739 | if(particle->GetPdgCode() == 111)hMCPi0Pt[fiCut]->Fill(particle->Pt(), weighted); // All MC Pi0 |
2740 | if(particle->GetPdgCode() == 221)hMCEtaPt[fiCut]->Fill(particle->Pt(), weighted); // All MC Eta | |
0f8c33c1 | 2741 | |
2742 | // Check the acceptance for gamma and electrons | |
2743 | ||
0f8c33c1 | 2744 | |
2745 | TParticle *gamma = fMCStack->Particle(labelgamma); | |
2746 | TParticle *electron = fMCStack->Particle(labelelectron); | |
2747 | TParticle *positron = fMCStack->Particle(labelpositron); | |
2748 | ||
2749 | ||
2750 | if(((AliConversionCuts*)fCutGammaArray->At(fiCut))->PhotonIsSelectedMC(gamma,fMCStack,kFALSE) && | |
ae947965 | 2751 | ((AliDalitzElectronCuts*)fCutElectronArray->At(fiCut))->ElectronIsSelectedMC(labelelectron,fMCStack) && |
2752 | ((AliDalitzElectronCuts*)fCutElectronArray->At(fiCut))->ElectronIsSelectedMC(labelpositron,fMCStack) ) { | |
f4d5bd23 | 2753 | |
2754 | Double_t massDalitz = -1; | |
2755 | ||
2756 | if( fDoMesonQA){ | |
2757 | ||
2758 | TLorentzVector TLVEpos,TLVEneg,TLVDalitz; | |
2759 | Double_t electronMass = TDatabasePDG::Instance()->GetParticle( ::kElectron )->Mass(); | |
2760 | ||
2761 | TLVEpos.SetXYZM(positron->Px(),positron->Py(),positron->Pz(),electronMass); | |
2762 | TLVEneg.SetXYZM(electron->Px(),electron->Py(),electron->Pz(),electronMass); | |
2763 | TLVDalitz = TLVEpos + TLVEneg ; | |
2764 | massDalitz = TLVDalitz.M(); | |
2765 | } | |
2766 | ||
2767 | ||
2768 | ||
ae947965 | 2769 | |
0f8c33c1 | 2770 | if(particle->GetPdgCode() == 111){ |
ae947965 | 2771 | |
2772 | hMCPi0InAccPt[fiCut]->Fill(particle->Pt() , weighted); // MC Pi0Dalitz with gamma and e+e- in acc | |
2d49ea4c | 2773 | hMCPi0DalitzGammaPt[fiCut]->Fill( gamma->Pt() ); |
2774 | hMCPi0DalitzPositronPt[fiCut]->Fill( positron->Pt() ); | |
2775 | hMCPi0DalitzElectronPt[fiCut]->Fill( electron->Pt() ); | |
ae947965 | 2776 | |
f4d5bd23 | 2777 | if ( fDoMesonQA )hMCPi0EposEnegInvMassPt[fiCut]->Fill(massDalitz,particle->Pt()); |
2778 | ||
2779 | ||
2780 | } | |
2781 | if(particle->GetPdgCode() == 221){ | |
2782 | hMCEtaInAccPt[fiCut]->Fill(particle->Pt(), weighted ); // MC EtaDalitz with gamma and e+e- in acc | |
2d49ea4c | 2783 | if( fDoMesonQA ) hMCEtaEposEnegInvMassPt[fiCut]->Fill( massDalitz, particle->Pt()); |
0f8c33c1 | 2784 | } |
0f8c33c1 | 2785 | } |
ae947965 | 2786 | |
2787 | ||
2788 | } | |
0f8c33c1 | 2789 | Int_t labelgammaChiC=-1; |
2790 | Int_t labelpositronChiC=-1; | |
2791 | Int_t labelelectronChiC=-1; | |
2792 | ||
ae947965 | 2793 | if(((AliConversionMesonCuts*)fCutMesonArray->At(fiCut))->MesonIsSelectedMCChiC(particle,fMCStack,labelelectronChiC,labelpositronChiC,labelgammaChiC,((AliConversionCuts*)fCutGammaArray->At(fiCut))->GetEtaShift())){ |
2794 | ||
0f8c33c1 | 2795 | hMCChiCPt[fiCut]->Fill(particle->Pt()); // All MC ChiC |
2796 | TParticle * gammaChiC =fMCStack->Particle(labelgammaChiC); | |
2797 | ||
2798 | if( ((AliConversionCuts*)fCutGammaArray->At(fiCut))->PhotonIsSelectedMC( gammaChiC,fMCStack,kFALSE) && | |
ae947965 | 2799 | ((AliDalitzElectronCuts*)fCutElectronArray->At(fiCut))->ElectronIsSelectedMC(labelelectronChiC,fMCStack) && |
2800 | ((AliDalitzElectronCuts*)fCutElectronArray->At(fiCut))->ElectronIsSelectedMC(labelpositronChiC,fMCStack) ){ | |
0f8c33c1 | 2801 | hMCChiCInAccPt[fiCut]->Fill(particle->Pt()); // All MC ChiC |
2802 | } | |
2803 | } | |
2804 | } | |
ccfa8c0d | 2805 | } |
2806 | //_____________________________________________________________________________ | |
ae947965 | 2807 | Bool_t AliAnalysisTaskGammaConvDalitzV1::IsDalitz(TParticle *fMCMother) const |
ccfa8c0d | 2808 | { |
2809 | ||
0f8c33c1 | 2810 | if( fMCMother->GetNDaughters() != 3 ) return kFALSE; |
2811 | if( fMCMother->GetPdgCode() != 111 && fMCMother->GetPdgCode() != 221 ) return kFALSE; | |
2812 | ||
ae947965 | 2813 | |
0f8c33c1 | 2814 | TParticle *positron = 0x0; |
2815 | TParticle *electron = 0x0; | |
ae947965 | 2816 | TParticle *gamma = 0x0; |
0f8c33c1 | 2817 | |
2818 | for(Int_t index= fMCMother->GetFirstDaughter();index<= fMCMother->GetLastDaughter();index++){ | |
2bb2434e | 2819 | |
0f8c33c1 | 2820 | TParticle* temp = (TParticle*)fMCStack->Particle( index ); |
2821 | ||
2822 | switch( temp->GetPdgCode() ) { | |
2823 | case ::kPositron: | |
2824 | positron = temp; | |
0f8c33c1 | 2825 | break; |
2826 | case ::kElectron: | |
2827 | electron = temp; | |
0f8c33c1 | 2828 | break; |
2829 | case ::kGamma: | |
2830 | gamma = temp; | |
0f8c33c1 | 2831 | break; |
2832 | } | |
2833 | } | |
2834 | ||
2835 | if( positron && electron && gamma) return kTRUE; | |
2836 | ||
2837 | return kFALSE; | |
a280ac15 | 2838 | } |
ccfa8c0d | 2839 | //_____________________________________________________________________________________ |
2840 | Bool_t AliAnalysisTaskGammaConvDalitzV1::IsPi0DalitzDaughter( Int_t label ) const | |
2841 | { | |
2842 | // | |
2843 | // Returns true if the particle comes from Pi0 -> e+ e- gamma | |
2844 | // | |
ccfa8c0d | 2845 | |
2846 | Int_t motherLabel = fMCStack->Particle( label )->GetMother(0); | |
2847 | ||
ae947965 | 2848 | if( motherLabel < 0 || motherLabel >= fMCStack->GetNtrack() ) return kFALSE; |
ccfa8c0d | 2849 | |
2850 | TParticle* mother = fMCStack->Particle( motherLabel ); | |
ae947965 | 2851 | |
2852 | if( mother->GetPdgCode() != 111 ) return kFALSE; | |
2853 | ||
2854 | if( IsDalitz( mother ) ) return kTRUE; | |
2855 | ||
2856 | ||
2857 | return kFALSE; | |
ccfa8c0d | 2858 | |
ae947965 | 2859 | |
d9d6352b | 2860 | } |
2861 | ||
a1c2f90c | 2862 | void AliAnalysisTaskGammaConvDalitzV1::FillElectronQAHistos(AliAODConversionPhoton *Vgamma) const |
d9d6352b | 2863 | { |
2864 | ||
2865 | ||
2866 | AliESDtrack *positronVgamma = 0; | |
2867 | AliESDtrack *electronVgamma = 0; | |
2868 | ||
2869 | Double_t clsToFPos = -1.0; | |
2870 | Double_t clsToFNeg = -1.0; | |
f47b2bb5 | 2871 | |
d9d6352b | 2872 | |
2873 | Double_t NumClsITSPos = -1.0; | |
2874 | Double_t NumClsITSNeg = -1.0; | |
2875 | Double_t NumClsTPCPos = -1.0; | |
2876 | Double_t NumClsTPCNeg = -1.0; | |
f47b2bb5 | 2877 | Double_t nCrossedRowsTPCPos = -1.0; |
2878 | Double_t nCrossedRowsTPCNeg = -1.0; | |
2879 | ||
2880 | ||
d9d6352b | 2881 | |
2882 | Float_t dcaToVertexXYPos = -1.0; | |
2883 | Float_t dcaToVertexZPos = -1.0; | |
2884 | Float_t dcaToVertexXYNeg = -1.0; | |
2885 | Float_t dcaToVertexZNeg = -1.0; | |
2886 | ||
2887 | Double_t nSigmaPosTPC = -999.; | |
2888 | Double_t nSigmaNegTPC = -999.; | |
2889 | ||
2890 | positronVgamma = fESDEvent->GetTrack( Vgamma->GetTrackLabelPositive() ); | |
2891 | electronVgamma = fESDEvent->GetTrack( Vgamma->GetTrackLabelNegative() ); | |
2892 | clsToFPos = ((AliDalitzElectronCuts*)fCutElectronArray->At(fiCut))->GetNFindableClustersTPC(positronVgamma); | |
2893 | clsToFNeg = ((AliDalitzElectronCuts*)fCutElectronArray->At(fiCut))->GetNFindableClustersTPC(electronVgamma); | |
2894 | ||
2895 | nSigmaPosTPC = ((AliDalitzElectronCuts*)fCutElectronArray->At(fiCut))->GetPIDResponse()->NumberOfSigmasTPC(positronVgamma, AliPID::kElectron) ; | |
2896 | nSigmaNegTPC = ((AliDalitzElectronCuts*)fCutElectronArray->At(fiCut))->GetPIDResponse()->NumberOfSigmasTPC(electronVgamma, AliPID::kElectron) ; | |
2897 | ||
2898 | ||
2899 | ||
2900 | NumClsITSPos = positronVgamma->GetNcls(0); //Get number of ITS clusters | |
2901 | NumClsITSNeg = electronVgamma->GetNcls(0); | |
2902 | NumClsTPCPos = positronVgamma->GetNcls(1); //Get number of TPC clusters | |
2903 | NumClsTPCNeg = electronVgamma->GetNcls(1); | |
2904 | ||
f47b2bb5 | 2905 | nCrossedRowsTPCPos = positronVgamma->GetTPCCrossedRows(); |
2906 | nCrossedRowsTPCNeg = electronVgamma->GetTPCCrossedRows(); | |
2907 | ||
30b9a400 | 2908 | |
f47b2bb5 | 2909 | |
d9d6352b | 2910 | |
2911 | Float_t bPos[2]; | |
2912 | Float_t bCovPos[3]; | |
2913 | positronVgamma->GetImpactParameters(bPos,bCovPos); | |
2914 | ||
2915 | if (bCovPos[0]<=0 || bCovPos[2]<=0) { | |
2916 | AliDebug(1, "Estimated b resolution lower or equal zero!"); | |
2917 | bCovPos[0]=0; bCovPos[2]=0; | |
2918 | } | |
2919 | ||
2920 | Float_t bNeg[2]; | |
2921 | Float_t bCovNeg[3]; | |
2922 | positronVgamma->GetImpactParameters(bNeg,bCovNeg); | |
2923 | ||
2924 | if (bCovNeg[0]<=0 || bCovNeg[2]<=0) { | |
2925 | AliDebug(1, "Estimated b resolution lower or equal zero!"); | |
2926 | bCovNeg[0]=0; bCovNeg[2]=0; | |
2927 | } | |
2928 | ||
2929 | dcaToVertexXYPos = bPos[0]; | |
2930 | dcaToVertexZPos = bPos[1]; | |
2931 | dcaToVertexXYNeg = bNeg[0]; | |
2932 | dcaToVertexZNeg = bNeg[1]; | |
2933 | ||
2934 | hESDDalitzElectronAfterPt[fiCut]->Fill( electronVgamma->Pt() ); | |
2935 | hESDDalitzPositronAfterPt[fiCut]->Fill( positronVgamma->Pt() ); | |
2936 | ||
2937 | hESDDalitzElectronAfterEta[fiCut]->Fill( electronVgamma->Eta() ); | |
2938 | hESDDalitzPositronAfterEta[fiCut]->Fill( positronVgamma->Eta() ); | |
2939 | ||
2940 | hESDDalitzElectronAfterPhi[fiCut]->Fill( electronVgamma->Phi() ); | |
2941 | hESDDalitzPositronAfterPhi[fiCut]->Fill( positronVgamma->Phi() ); | |
2942 | ||
2943 | hESDDalitzElectronAfterNFindClsTPC[fiCut]->Fill(clsToFNeg,electronVgamma->Pt()); | |
2944 | hESDDalitzPositronAfterNFindClsTPC[fiCut]->Fill(clsToFPos,positronVgamma->Pt()); | |
2945 | ||
f47b2bb5 | 2946 | hESDDalitzElectronAfterNClsTPC[fiCut]->Fill( NumClsTPCNeg,electronVgamma->Pt()); |
2947 | hESDDalitzPositronAfterNClsTPC[fiCut]->Fill( NumClsTPCPos,positronVgamma->Pt()); | |
2948 | ||
2949 | hESDDalitzElectronAfterNCrossedRowsTPC[fiCut]->Fill( nCrossedRowsTPCNeg, electronVgamma->Pt() ); | |
2950 | hESDDalitzPositronAfterNCrossedRowsTPC[fiCut]->Fill( nCrossedRowsTPCPos, positronVgamma->Pt() ); | |
d9d6352b | 2951 | |
2952 | hESDDalitzElectronAfterNClsITS[fiCut]->Fill( NumClsITSNeg); | |
2953 | hESDDalitzPositronAfterNClsITS[fiCut]->Fill( NumClsITSPos); | |
2954 | ||
2955 | hESDDalitzPosEleAfterDCAxy[fiCut]->Fill( dcaToVertexXYNeg, electronVgamma->Pt() ); | |
2956 | hESDDalitzPosEleAfterDCAz[fiCut]->Fill( dcaToVertexZNeg, electronVgamma->Pt() ); | |
2957 | hESDDalitzPosEleAfterDCAxy[fiCut]->Fill( dcaToVertexXYPos, positronVgamma->Pt() ); | |
2958 | hESDDalitzPosEleAfterDCAz[fiCut]->Fill( dcaToVertexZPos, positronVgamma->Pt() ); | |
2959 | ||
2960 | hESDDalitzElectronAfterTPCdEdxVsP[fiCut]->Fill( electronVgamma->P(),nSigmaNegTPC); | |
2961 | hESDDalitzPositronAfterTPCdEdxVsP[fiCut]->Fill( positronVgamma->P(), nSigmaPosTPC); | |
2962 | ||
2963 | hESDDalitzElectronAfterTPCdEdxVsEta[fiCut]->Fill( electronVgamma->Eta(),nSigmaNegTPC); | |
2964 | hESDDalitzPositronAfterTPCdEdxVsEta[fiCut]->Fill( positronVgamma->Eta(),nSigmaPosTPC); | |
2965 | ||
2966 | hESDDalitzElectronAfterTPCdEdxVsPhi[fiCut]->Fill( electronVgamma->Phi(),nSigmaNegTPC); | |
2967 | hESDDalitzPositronAfterTPCdEdxVsPhi[fiCut]->Fill( positronVgamma->Phi(),nSigmaPosTPC); | |
2968 | ||
2969 | ||
2970 | hESDDalitzElectronAfterTPCdEdxSignalVsP[fiCut]->Fill( electronVgamma->P(), TMath::Abs(electronVgamma->GetTPCsignal())); | |
2971 | hESDDalitzPositronAfterTPCdEdxSignalVsP[fiCut]->Fill( positronVgamma->P(), TMath::Abs(positronVgamma->GetTPCsignal())); | |
2972 | ||
2973 | ||
2974 | ||
ccfa8c0d | 2975 | } |
2976 | ||
2977 | ||
a280ac15 | 2978 | //_____________________________________________________________________________ |
2979 | Double_t AliAnalysisTaskGammaConvDalitzV1::GetPsiPair( const AliESDtrack *trackPos, const AliESDtrack *trackNeg ) const | |
2980 | { | |
2981 | // | |
2982 | // This angle is a measure for the contribution of the opening in polar | |
ae947965 | 2983 | // direction ?0 to the opening angle ? Pair |
a280ac15 | 2984 | // |
2985 | // Ref. Measurement of photons via conversion pairs with the PHENIX experiment at RHIC | |
d9d6352b | 2986 | // Mas ter Thesis. Thorsten Dahms. 2005 |
a280ac15 | 2987 | // https://twiki.cern.ch/twiki/pub/ALICE/GammaPhysicsPublications/tdahms_thesis.pdf |
2988 | // | |
2989 | Double_t momPos[3]; | |
2990 | Double_t momNeg[3]; | |
2991 | if( trackPos->GetConstrainedPxPyPz(momPos) == 0 ) trackPos->GetPxPyPz( momPos ); | |
2992 | if( trackNeg->GetConstrainedPxPyPz(momNeg) == 0 ) trackNeg->GetPxPyPz( momNeg ); | |
2993 | ||
2994 | TVector3 posDaughter; | |
2995 | TVector3 negDaughter; | |
2996 | ||
2997 | posDaughter.SetXYZ( momPos[0], momPos[1], momPos[2] ); | |
2998 | negDaughter.SetXYZ( momNeg[0], momNeg[1], momNeg[2] ); | |
2999 | ||
3000 | Double_t deltaTheta = negDaughter.Theta() - posDaughter.Theta(); | |
3001 | Double_t openingAngle = posDaughter.Angle( negDaughter ); //TMath::ACos( posDaughter.Dot(negDaughter)/(negDaughter.Mag()*posDaughter.Mag()) ); | |
3002 | ||
3003 | if( openingAngle < 1e-20 ) return 0.; | |
3004 | ||
3005 | Double_t psiAngle = TMath::ASin( deltaTheta/openingAngle ); | |
3006 | ||
3007 | return psiAngle; | |
4803eb1f | 3008 | } |