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