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