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