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