]>
Commit | Line | Data |
---|---|---|
cb287740 | 1 | /************************************************************************** |
2 | * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * | |
3 | * * | |
4 | * Author: Friederike Bock * | |
5 | * Version 1 * | |
6 | * * | |
7 | * Permission to use, copy, modify and distribute this software and its * | |
8 | * documentation strictly for non-commercial purposes is hereby granted * | |
9 | * without fee, provided that the above copyright notice appears in all * | |
10 | * copies and that both the copyright notice and this permission notice * | |
11 | * appear in the supporting documentation. The authors make no claims * | |
12 | * about the suitability of this software for any purpose. It is * | |
13 | * provided "as is" without express or implied warranty. * | |
14 | **************************************************************************/ | |
15 | ||
16 | // | |
17 | ||
18 | #include <vector> | |
19 | ||
20 | #include "TParticle.h" | |
21 | #include "TPDGCode.h" | |
22 | #include "TMCProcess.h" | |
23 | #include "TDatabasePDG.h" | |
24 | #include "TList.h" | |
25 | #include "TChain.h" | |
26 | #include "TDirectory.h" | |
27 | #include "TTree.h" | |
28 | #include "TH1.h" | |
29 | #include "TH1F.h" | |
30 | #include "THnSparse.h" | |
31 | #include "TH2F.h" | |
32 | #include "AliStack.h" | |
33 | #include "AliAnalysisManager.h" | |
34 | #include "AliESDInputHandler.h" | |
35 | #include "AliESDtrack.h" | |
36 | #include "AliMCEvent.h" | |
37 | #include "AliStack.h" | |
38 | #include "AliMCEventHandler.h" | |
39 | #include "AliPID.h" | |
40 | #include "AliLog.h" | |
41 | #include "AliESDtrackCuts.h" | |
42 | #include "AliESDpidCuts.h" | |
43 | #include "AliMCEvent.h" | |
44 | #include "AliESDv0.h" | |
45 | #include "AliESDEvent.h" | |
46 | #include "AliESDpid.h" | |
47 | #include "AliKFParticle.h" | |
48 | #include "AliMCEventHandler.h" | |
49 | #include "AliKFVertex.h" | |
50 | #include "AliTriggerAnalysis.h" | |
51 | #include "AliCentrality.h" | |
52 | #include "AliMultiplicity.h" | |
53 | #include "AliAnalysisTaskNeutralMesonToPiPlPiMiPiZero.h" | |
54 | ||
55 | ||
56 | ClassImp( AliAnalysisTaskNeutralMesonToPiPlPiMiPiZero ) | |
57 | ||
58 | //----------------------------------------------------------------------------------------------- | |
59 | AliAnalysisTaskNeutralMesonToPiPlPiMiPiZero::AliAnalysisTaskNeutralMesonToPiPlPiMiPiZero(): | |
60 | fV0Reader(NULL), | |
61 | fPionSelector(NULL), | |
62 | fBGHandler(NULL), | |
63 | fESDEvent(NULL), | |
64 | fMCEvent(NULL), | |
65 | fMCStack(NULL), | |
66 | fCutFolder(NULL), | |
67 | fESDList(NULL), | |
68 | fBackList(NULL), | |
69 | fMotherList(NULL), | |
70 | fTrueList(NULL), | |
71 | fMCList(NULL), | |
72 | fOutputContainer(0), | |
73 | fReaderGammas(NULL), | |
74 | fSelectorNegPionIndex(0), | |
75 | fSelectorPosPionIndex(0), | |
76 | fGoodGammas(NULL), | |
77 | fNeutralPionCandidates(NULL), | |
78 | fGoodVirtualParticles(NULL), | |
79 | fEventCutArray(NULL), | |
80 | fGammaCutArray(NULL), | |
81 | fPionCutArray(NULL), | |
82 | fNeutralPionMesonCutArray(NULL), | |
83 | fMesonCutArray(NULL), | |
84 | fEventCuts(NULL), | |
85 | fConversionCuts(NULL), | |
86 | fHistoConvGammaPt(NULL), | |
87 | fHistoConvGammaEta(NULL), | |
88 | fHistoNegPionPt(NULL), | |
89 | fHistoPosPionPt(NULL), | |
90 | fHistoNegPionPhi(NULL), | |
91 | fHistoPosPionPhi(NULL), | |
92 | fHistoNegPionEta(NULL), | |
93 | fHistoPosPionEta(NULL), | |
94 | fHistoNegPionClsTPC(NULL), | |
95 | fHistoPosPionClsTPC(NULL), | |
96 | fHistoPionDCAxy(NULL), | |
97 | fHistoPionDCAz(NULL), | |
98 | fHistoPionTPCdEdxNSigma(NULL), | |
99 | fHistoPionTPCdEdx(NULL), | |
100 | fHistoPionPionInvMassPt(NULL), | |
101 | fHistoGammaGammaInvMassPt(NULL), | |
102 | fHistoMotherInvMassPt(NULL), | |
103 | fTHnSparseMotherInvMassPtZM(NULL), | |
104 | fHistoMotherBackInvMassPt(NULL), | |
105 | fTHnSparseMotherBackInvMassPtZM(NULL), | |
106 | fHistoMCAllGammaPt(NULL), | |
107 | fHistoMCConvGammaPt(NULL), | |
108 | fHistoMCAllPosPionsPt(NULL), | |
109 | fHistoMCAllNegPionsPt(NULL), | |
110 | fHistoMCGammaFromNeutralMesonPt(NULL), | |
111 | fHistoMCPosPionsFromNeutralMesonPt(NULL), | |
112 | fHistoMCNegPionsFromNeutralMesonPt(NULL), | |
113 | fHistoMCEtaPiPlPiMiPiZeroPt(NULL), | |
114 | fHistoMCEtaPiPlPiMiPiZeroInAccPt(NULL), | |
115 | fHistoMCOmegaPiPlPiMiPiZeroPt(NULL), | |
116 | fHistoMCOmegaPiPlPiMiPiZeroInAccPt(NULL), | |
117 | fHistoTrueMotherPiPlPiMiPiZeroInvMassPt(NULL), | |
118 | fHistoTrueMotherGammaGammaInvMassPt(NULL), | |
119 | fHistoTrueConvGammaPt(NULL), | |
120 | fHistoTrueConvGammaFromNeutralMesonPt(NULL), | |
121 | fHistoTruePosPionPt(NULL), | |
122 | fHistoTruePosPionFromNeutralMesonPt(NULL), | |
123 | fHistoTrueNegPionPt(NULL), | |
124 | fHistoTrueNegPionFromNeutralMesonPt(NULL), | |
125 | fHistoTruePionPionInvMassPt(NULL), | |
95bd6d60 | 126 | fHistoTruePionPionFromSameMotherInvMassPt(NULL), |
cb287740 | 127 | fHistoTruePionPionFromNeutralMesonInvMassPt(NULL), |
128 | fHistoNEvents(NULL), | |
129 | fHistoNGoodESDTracks(NULL), | |
130 | fProfileEtaShift(NULL), | |
131 | fRandom(0), | |
132 | fnCuts(0), | |
133 | fiCut(0), | |
134 | fNumberOfESDTracks(0), | |
135 | fMoveParticleAccordingToVertex(kFALSE), | |
136 | fIsHeavyIon(0), | |
137 | fDoMesonAnalysis(kTRUE), | |
138 | fDoMesonQA(kFALSE), | |
139 | fIsFromMBHeader(kTRUE), | |
140 | fIsMC(kFALSE) | |
141 | { | |
142 | ||
143 | } | |
144 | ||
145 | //----------------------------------------------------------------------------------------------- | |
146 | AliAnalysisTaskNeutralMesonToPiPlPiMiPiZero::AliAnalysisTaskNeutralMesonToPiPlPiMiPiZero( const char* name ): | |
147 | AliAnalysisTaskSE(name), | |
148 | fV0Reader(NULL), | |
149 | fPionSelector(NULL), | |
150 | fBGHandler(NULL), | |
151 | fESDEvent(NULL), | |
152 | fMCEvent(NULL), | |
153 | fMCStack(NULL), | |
154 | fCutFolder(NULL), | |
155 | fESDList(NULL), | |
156 | fBackList(NULL), | |
157 | fMotherList(NULL), | |
158 | fTrueList(NULL), | |
159 | fMCList(NULL), | |
160 | fOutputContainer(0), | |
161 | fReaderGammas(NULL), | |
162 | fSelectorNegPionIndex(0), | |
163 | fSelectorPosPionIndex(0), | |
164 | fGoodGammas(NULL), | |
165 | fNeutralPionCandidates(NULL), | |
166 | fGoodVirtualParticles(NULL), | |
167 | fEventCutArray(NULL), | |
168 | fGammaCutArray(NULL), | |
169 | fPionCutArray(NULL), | |
170 | fNeutralPionMesonCutArray(NULL), | |
171 | fMesonCutArray(NULL), | |
172 | fEventCuts(NULL), | |
173 | fConversionCuts(NULL), | |
174 | fHistoConvGammaPt(NULL), | |
175 | fHistoConvGammaEta(NULL), | |
176 | fHistoNegPionPt(NULL), | |
177 | fHistoPosPionPt(NULL), | |
178 | fHistoNegPionPhi(NULL), | |
179 | fHistoPosPionPhi(NULL), | |
180 | fHistoNegPionEta(NULL), | |
181 | fHistoPosPionEta(NULL), | |
182 | fHistoNegPionClsTPC(NULL), | |
183 | fHistoPosPionClsTPC(NULL), | |
184 | fHistoPionDCAxy(NULL), | |
185 | fHistoPionDCAz(NULL), | |
186 | fHistoPionTPCdEdxNSigma(NULL), | |
187 | fHistoPionTPCdEdx(NULL), | |
188 | fHistoPionPionInvMassPt(NULL), | |
189 | fHistoGammaGammaInvMassPt(NULL), | |
190 | fHistoMotherInvMassPt(NULL), | |
191 | fTHnSparseMotherInvMassPtZM(NULL), | |
192 | fHistoMotherBackInvMassPt(NULL), | |
193 | fTHnSparseMotherBackInvMassPtZM(NULL), | |
194 | fHistoMCAllGammaPt(NULL), | |
195 | fHistoMCConvGammaPt(NULL), | |
196 | fHistoMCAllPosPionsPt(NULL), | |
197 | fHistoMCAllNegPionsPt(NULL), | |
198 | fHistoMCGammaFromNeutralMesonPt(NULL), | |
199 | fHistoMCPosPionsFromNeutralMesonPt(NULL), | |
200 | fHistoMCNegPionsFromNeutralMesonPt(NULL), | |
201 | fHistoMCEtaPiPlPiMiPiZeroPt(NULL), | |
202 | fHistoMCEtaPiPlPiMiPiZeroInAccPt(NULL), | |
203 | fHistoMCOmegaPiPlPiMiPiZeroPt(NULL), | |
204 | fHistoMCOmegaPiPlPiMiPiZeroInAccPt(NULL), | |
205 | fHistoTrueMotherPiPlPiMiPiZeroInvMassPt(NULL), | |
206 | fHistoTrueMotherGammaGammaInvMassPt(NULL), | |
207 | fHistoTrueConvGammaPt(NULL), | |
208 | fHistoTrueConvGammaFromNeutralMesonPt(NULL), | |
209 | fHistoTruePosPionPt(NULL), | |
210 | fHistoTruePosPionFromNeutralMesonPt(NULL), | |
211 | fHistoTrueNegPionPt(NULL), | |
212 | fHistoTrueNegPionFromNeutralMesonPt(NULL), | |
213 | fHistoTruePionPionInvMassPt(NULL), | |
95bd6d60 | 214 | fHistoTruePionPionFromSameMotherInvMassPt(NULL), |
cb287740 | 215 | fHistoTruePionPionFromNeutralMesonInvMassPt(NULL), |
216 | fHistoNEvents(NULL), | |
217 | fHistoNGoodESDTracks(NULL), | |
218 | fProfileEtaShift(NULL), | |
219 | fRandom(0), | |
220 | fnCuts(0), | |
221 | fiCut(0), | |
222 | fNumberOfESDTracks(0), | |
223 | fMoveParticleAccordingToVertex(kFALSE), | |
224 | fIsHeavyIon(0), | |
225 | fDoMesonAnalysis(kTRUE), | |
226 | fDoMesonQA(kFALSE), | |
227 | fIsFromMBHeader(kTRUE), | |
228 | fIsMC(kFALSE) | |
229 | { | |
230 | DefineOutput(1, TList::Class()); | |
231 | } | |
232 | ||
233 | //----------------------------------------------------------------------------------------------- | |
234 | AliAnalysisTaskNeutralMesonToPiPlPiMiPiZero::~AliAnalysisTaskNeutralMesonToPiPlPiMiPiZero() | |
235 | { | |
236 | // | |
237 | // virtual destructor | |
238 | // | |
239 | cout<<"Destructor"<<endl; | |
240 | if(fGoodGammas){ | |
241 | delete fGoodGammas; | |
242 | fGoodGammas = 0x0; | |
243 | } | |
244 | if(fNeutralPionCandidates){ | |
245 | delete fNeutralPionCandidates; | |
246 | fNeutralPionCandidates = 0x0; | |
247 | } | |
248 | ||
249 | if(fGoodVirtualParticles){ | |
250 | delete fGoodVirtualParticles; | |
251 | fGoodVirtualParticles = 0x0; | |
252 | } | |
253 | if(fBGHandler){ | |
254 | delete[] fBGHandler; | |
255 | fBGHandler = 0x0; | |
256 | } | |
257 | } | |
258 | //___________________________________________________________ | |
259 | void AliAnalysisTaskNeutralMesonToPiPlPiMiPiZero::InitBack(){ | |
260 | ||
261 | const Int_t nDim = 4; | |
d53bf4ac | 262 | Int_t nBins[nDim] = {500,250,7,4}; |
263 | Double_t xMin[nDim] = {0.4,0, 0,0}; | |
264 | Double_t xMax[nDim] = {0.9,25,7,4}; | |
cb287740 | 265 | |
266 | fTHnSparseMotherInvMassPtZM = new THnSparseF*[fnCuts]; | |
267 | fTHnSparseMotherBackInvMassPtZM = new THnSparseF*[fnCuts]; | |
268 | ||
269 | fBGHandler = new AliGammaConversionAODBGHandler*[fnCuts]; | |
270 | for(Int_t iCut = 0; iCut<fnCuts;iCut++){ | |
271 | ||
272 | TString cutstringEvent = ((AliConvEventCuts*)fEventCutArray->At(iCut))->GetCutNumber(); | |
273 | TString cutstringPion = ((AliPrimaryPionCuts*)fPionCutArray->At(iCut))->GetCutNumber(); | |
274 | TString cutstringGamma = ((AliConversionPhotonCuts*)fGammaCutArray->At(iCut))->GetCutNumber(); | |
275 | TString cutstringNeutralPion= ((AliConversionMesonCuts*)fNeutralPionMesonCutArray->At(iCut))->GetCutNumber(); | |
276 | TString cutstringMeson = ((AliConversionMesonCuts*)fMesonCutArray->At(iCut))->GetCutNumber(); | |
277 | ||
278 | TString fullCutString = Form("%s_%s_%s_%s_%s",cutstringEvent.Data(),cutstringGamma.Data(),cutstringNeutralPion.Data(), cutstringPion.Data(),cutstringMeson.Data()); | |
279 | TString nameBackList = Form("%s Back histograms",fullCutString.Data()); | |
280 | TString nameMotherList = Form("%s Mother histograms",fullCutString.Data()); | |
281 | ||
282 | Int_t collisionSystem = atoi((TString)(((AliConvEventCuts*)fEventCutArray->At(iCut))->GetCutNumber())(0,1)); | |
283 | Int_t centMin = atoi((TString)(((AliConvEventCuts*)fEventCutArray->At(iCut))->GetCutNumber())(1,1)); | |
284 | Int_t centMax = atoi((TString)(((AliConvEventCuts*)fEventCutArray->At(iCut))->GetCutNumber())(2,1)); | |
285 | ||
286 | if(collisionSystem == 1 || collisionSystem == 2 || | |
287 | collisionSystem == 5 || collisionSystem == 8 || | |
288 | collisionSystem == 9){ | |
289 | centMin = centMin*10; | |
290 | centMax = centMax*10; | |
291 | } | |
292 | else if(collisionSystem == 3 || collisionSystem == 6){ | |
293 | centMin = centMin*5; | |
294 | centMax = centMax*5; | |
295 | } | |
296 | else if(collisionSystem == 4 || collisionSystem == 7){ | |
297 | centMin = ((centMin*5)+45); | |
298 | centMax = ((centMax*5)+45); | |
299 | } | |
300 | ||
301 | ||
302 | fBackList[iCut] = new TList(); | |
303 | ||
304 | fBackList[iCut]->SetName(nameBackList.Data()); | |
305 | fBackList[iCut]->SetOwner(kTRUE); | |
306 | fCutFolder[iCut]->Add(fBackList[iCut]); | |
307 | ||
308 | fTHnSparseMotherBackInvMassPtZM[iCut] = new THnSparseF("Back_Back_InvMass_Pt_z_m","Back_Back_InvMass_Pt_z_m",nDim,nBins,xMin,xMax); | |
309 | fBackList[iCut]->Add(fTHnSparseMotherBackInvMassPtZM[iCut]); | |
310 | ||
311 | fMotherList[iCut] = new TList(); | |
312 | fMotherList[iCut]->SetName(nameMotherList.Data()); | |
313 | fMotherList[iCut]->SetOwner(kTRUE); | |
314 | fCutFolder[iCut]->Add(fMotherList[iCut]); | |
315 | ||
316 | fTHnSparseMotherInvMassPtZM[iCut] = new THnSparseF("Back_Mother_InvMass_Pt_z_m","Back_Mother_InvMass_Pt_z_m",nDim,nBins,xMin,xMax); | |
317 | fMotherList[iCut]->Add(fTHnSparseMotherInvMassPtZM[iCut]); | |
318 | ||
319 | ||
320 | fBGHandler[iCut] = new AliGammaConversionAODBGHandler( collisionSystem,centMin,centMax, | |
321 | ((AliConversionMesonCuts*)fMesonCutArray->At(fiCut))->GetNumberOfBGEvents(), | |
322 | ((AliConversionMesonCuts*)fMesonCutArray->At(fiCut))->UseTrackMultiplicity()); | |
323 | } | |
324 | } | |
325 | ||
326 | //______________________________________________________________________ | |
327 | void AliAnalysisTaskNeutralMesonToPiPlPiMiPiZero::UserCreateOutputObjects() | |
328 | { | |
329 | // | |
330 | // Create ouput objects | |
331 | // | |
332 | ||
333 | // Create the output container | |
334 | if(fOutputContainer != NULL){ | |
335 | delete fOutputContainer; | |
336 | fOutputContainer = NULL; | |
337 | } | |
338 | if(fOutputContainer == NULL){ | |
339 | fOutputContainer = new TList(); | |
340 | fOutputContainer->SetOwner(kTRUE); | |
341 | } | |
342 | ||
343 | fGoodGammas = new TList(); | |
344 | fNeutralPionCandidates = new TList(); | |
345 | fGoodVirtualParticles = new TList(); | |
346 | ||
347 | fCutFolder = new TList*[fnCuts]; | |
348 | fESDList = new TList*[fnCuts]; | |
349 | fBackList = new TList*[fnCuts]; | |
350 | fMotherList = new TList*[fnCuts]; | |
351 | fHistoNEvents = new TH1I*[fnCuts]; | |
352 | fHistoNGoodESDTracks = new TH1I*[fnCuts]; | |
353 | fProfileEtaShift = new TProfile*[fnCuts]; | |
354 | fHistoConvGammaPt = new TH1F*[fnCuts]; | |
355 | fHistoConvGammaEta = new TH1F*[fnCuts]; | |
356 | fHistoNegPionPt = new TH1F*[fnCuts]; | |
357 | fHistoPosPionPt = new TH1F*[fnCuts]; | |
358 | fHistoNegPionPhi = new TH1F*[fnCuts]; | |
359 | fHistoPosPionPhi = new TH1F*[fnCuts]; | |
360 | ||
361 | if( fDoMesonQA ) { | |
362 | fHistoNegPionEta = new TH1F*[fnCuts]; | |
363 | fHistoPosPionEta = new TH1F*[fnCuts]; | |
364 | fHistoNegPionClsTPC = new TH2F*[fnCuts]; | |
365 | fHistoPosPionClsTPC = new TH2F*[fnCuts]; | |
366 | fHistoPionDCAxy = new TH2F*[fnCuts]; | |
367 | fHistoPionDCAz = new TH2F*[fnCuts]; | |
368 | fHistoPionTPCdEdxNSigma = new TH2F*[fnCuts]; | |
369 | fHistoPionTPCdEdx = new TH2F*[fnCuts]; | |
370 | fHistoPionPionInvMassPt = new TH2F*[fnCuts]; | |
371 | ||
372 | } | |
373 | fHistoGammaGammaInvMassPt = new TH2F*[fnCuts]; | |
374 | fHistoMotherInvMassPt = new TH2F*[fnCuts]; | |
375 | fHistoMotherBackInvMassPt = new TH2F*[fnCuts]; | |
376 | ||
377 | for(Int_t iCut = 0; iCut<fnCuts;iCut++){ | |
378 | TString cutstringEvent = ((AliConvEventCuts*)fEventCutArray->At(iCut))->GetCutNumber(); | |
379 | TString cutstringPion = ((AliPrimaryPionCuts*)fPionCutArray->At(iCut))->GetCutNumber(); | |
380 | TString cutstringGamma = ((AliConversionPhotonCuts*)fGammaCutArray->At(iCut))->GetCutNumber(); | |
381 | TString cutstringNeutralPion= ((AliConversionMesonCuts*)fNeutralPionMesonCutArray->At(iCut))->GetCutNumber(); | |
382 | TString cutstringMeson = ((AliConversionMesonCuts*)fMesonCutArray->At(iCut))->GetCutNumber(); | |
383 | ||
384 | TString fullCutString = Form("%s_%s_%s_%s_%s",cutstringEvent.Data(),cutstringGamma.Data(),cutstringNeutralPion.Data(), cutstringPion.Data(),cutstringMeson.Data()); | |
385 | TString nameCutFolder = Form("Cut Number %s", fullCutString.Data()); | |
386 | TString nameESDList = Form("%s ESD histograms", fullCutString.Data()); | |
387 | ||
388 | ||
389 | fCutFolder[iCut] = new TList(); | |
390 | fCutFolder[iCut]->SetName(nameCutFolder.Data()); | |
391 | fCutFolder[iCut]->SetOwner(kTRUE); | |
392 | fOutputContainer->Add(fCutFolder[iCut]); | |
393 | ||
394 | fESDList[iCut] = new TList(); | |
395 | fESDList[iCut]->SetName(nameESDList.Data()); | |
396 | fESDList[iCut]->SetOwner(kTRUE); | |
397 | ||
398 | fHistoNEvents[iCut] = new TH1I("NEvents","NEvents",9,-0.5,8.5); | |
399 | fHistoNEvents[iCut]->GetXaxis()->SetBinLabel(1,"Accepted"); | |
400 | fHistoNEvents[iCut]->GetXaxis()->SetBinLabel(2,"Centrality"); | |
401 | fHistoNEvents[iCut]->GetXaxis()->SetBinLabel(3,"Missing MC"); | |
402 | fHistoNEvents[iCut]->GetXaxis()->SetBinLabel(4,"Trigger"); | |
403 | fHistoNEvents[iCut]->GetXaxis()->SetBinLabel(5,"Vertex Z"); | |
404 | fHistoNEvents[iCut]->GetXaxis()->SetBinLabel(6,"Cont. Vertex"); | |
405 | fHistoNEvents[iCut]->GetXaxis()->SetBinLabel(7,"Pile-Up"); | |
406 | fHistoNEvents[iCut]->GetXaxis()->SetBinLabel(8,"no SDD"); | |
407 | fHistoNEvents[iCut]->GetXaxis()->SetBinLabel(9,"no V0AND"); | |
408 | fESDList[iCut]->Add(fHistoNEvents[iCut]); | |
409 | ||
410 | if(fIsHeavyIon>0) fHistoNGoodESDTracks[iCut] = new TH1I("GoodESDTracks","GoodESDTracks",3000,0,3000); | |
411 | else fHistoNGoodESDTracks[iCut] = new TH1I("GoodESDTracks","GoodESDTracks",200,0,200); | |
412 | fESDList[iCut]->Add(fHistoNGoodESDTracks[iCut]); | |
413 | ||
414 | fProfileEtaShift[iCut] = new TProfile("Eta Shift","Eta Shift",1, -0.5,0.5); | |
415 | fESDList[iCut]->Add(fProfileEtaShift[iCut]); | |
416 | fHistoConvGammaPt[iCut] = new TH1F("ESD_ConvGamma_Pt","ESD_ConvGamma_Pt",250,0,25); | |
417 | fESDList[iCut]->Add(fHistoConvGammaPt[iCut]); | |
418 | fHistoConvGammaEta[iCut] = new TH1F("ESD_ConvGamma_Eta","ESD_ConvGamma_Eta",600,-1.5,1.5); | |
419 | fESDList[iCut]->Add(fHistoConvGammaEta[iCut]); | |
420 | fHistoNegPionPt[iCut] = new TH1F("ESD_PrimaryNegPions_Pt","ESD_PrimaryNegPions_Pt",1000,0,25); | |
421 | fESDList[iCut]->Add(fHistoNegPionPt[iCut]); | |
422 | fHistoPosPionPt[iCut] = new TH1F("ESD_PrimaryPosPions_Pt","ESD_PrimaryPosPions_Pt",1000,0,25); | |
423 | fESDList[iCut]->Add(fHistoPosPionPt[iCut]); | |
424 | fHistoNegPionPhi[iCut] = new TH1F("ESD_PrimaryNegPions_Phi","ESD_PrimaryNegPions_Phi",360,0,2*TMath::Pi()); | |
425 | fESDList[iCut]->Add(fHistoNegPionPhi[iCut]); | |
426 | fHistoPosPionPhi[iCut] = new TH1F("ESD_PrimaryPosPions_Phi","ESD_PrimaryPosPions_Phi",360,0,2*TMath::Pi()); | |
427 | fESDList[iCut]->Add(fHistoPosPionPhi[iCut]); | |
428 | ||
429 | if ( fDoMesonQA ) { | |
430 | fHistoNegPionEta[iCut] = new TH1F("ESD_PrimaryNegPions_Eta","ESD_PrimaryNegPions_Eta",600,-1.5,1.5); | |
431 | fESDList[iCut]->Add(fHistoNegPionEta[iCut]); | |
432 | fHistoPosPionEta[iCut] = new TH1F("ESD_PrimaryPosPions_Eta","ESD_PrimaryPosPions_Eta",600,-1.5,1.5); | |
433 | fESDList[iCut]->Add(fHistoPosPionEta[iCut]); | |
434 | fHistoNegPionClsTPC[iCut] = new TH2F("ESD_PrimaryNegPions_ClsTPC","ESD_PrimaryNegPions_ClsTPC",100,0,1,400,0.,10.); | |
435 | fESDList[iCut]->Add(fHistoNegPionClsTPC[iCut]); | |
436 | fHistoPosPionClsTPC[iCut] = new TH2F("ESD_PrimaryPosPions_ClsTPC","ESD_PrimaryPosPions_ClsTPC",100,0,1,400,0.,10.); | |
437 | fESDList[iCut]->Add(fHistoPosPionClsTPC[iCut]); | |
438 | fHistoPionDCAxy[iCut] = new TH2F("ESD_PrimaryPions_DCAxy","ESD_PrimaryPions_DCAxy",800,-4.0,4.0,400,0.,10.); | |
439 | fESDList[iCut]->Add(fHistoPionDCAxy[iCut]); | |
440 | fHistoPionDCAz[iCut] = new TH2F("ESD_PrimaryPions_DCAz","ESD_PrimaryPions_DCAz",800,-4.0,4.0,400,0.,10.); | |
441 | fESDList[iCut]->Add(fHistoPionDCAz[iCut]); | |
442 | fHistoPionTPCdEdxNSigma[iCut] = new TH2F("ESD_PrimaryPions_TPCdEdx","ESD_PrimaryPions_TPCdEdx",150,0.05,20,400,-10,10); | |
443 | fESDList[iCut]->Add(fHistoPionTPCdEdxNSigma[iCut]); | |
444 | fHistoPionTPCdEdx[iCut] =new TH2F("ESD_PrimaryPions_TPCdEdxSignal","ESD_PrimaryPions_TPCdEdxSignal" ,150,0.05,20.0,800,0.0,200); | |
445 | fESDList[iCut]->Add(fHistoPionTPCdEdx[iCut]); | |
446 | fHistoPionPionInvMassPt[iCut] = new TH2F("ESD_PiPlusPiNeg_InvMassPt","ESD_PiPlusPiNeg_InvMassPt",2000,0.,2.,200,0.,20.); | |
447 | fESDList[iCut]->Add(fHistoPionPionInvMassPt[iCut]); | |
448 | } | |
449 | fHistoGammaGammaInvMassPt[iCut] = new TH2F("ESD_GammaGamma_InvMass_Pt","ESD_GammaGamma_InvMass_Pt",450,0.,0.45,250,0,25); | |
450 | fESDList[iCut]->Add(fHistoGammaGammaInvMassPt[iCut]); | |
451 | fHistoMotherInvMassPt[iCut] = new TH2F("ESD_Mother_InvMass_Pt","ESD_Mother_InvMass_Pt",500,0.4,0.9,250,0,25); | |
452 | fESDList[iCut]->Add(fHistoMotherInvMassPt[iCut]); | |
453 | fHistoMotherBackInvMassPt[iCut] = new TH2F("ESD_Background_InvMass_Pt","ESD_Background_InvMass_Pt",500,0.4,0.9,250,0,25); | |
454 | fESDList[iCut]->Add(fHistoMotherBackInvMassPt[iCut]); | |
455 | ||
456 | if ( fDoMesonQA ) { | |
457 | TAxis *AxisAfter = fHistoPionTPCdEdxNSigma[iCut]->GetXaxis(); | |
458 | Int_t bins = AxisAfter->GetNbins(); | |
459 | Double_t from = AxisAfter->GetXmin(); | |
460 | Double_t to = AxisAfter->GetXmax(); | |
461 | Double_t *newBins = new Double_t[bins+1]; | |
462 | newBins[0] = from; | |
463 | Double_t factor = TMath::Power(to/from, 1./bins); | |
464 | for(Int_t i=1; i<=bins; ++i) newBins[i] = factor * newBins[i-1]; | |
465 | ||
466 | AxisAfter->Set(bins, newBins); | |
467 | AxisAfter = fHistoPionTPCdEdx[iCut]->GetXaxis(); | |
468 | AxisAfter->Set(bins, newBins); | |
469 | ||
470 | delete [] newBins; | |
471 | } | |
472 | ||
473 | fCutFolder[iCut]->Add(fESDList[iCut]); | |
474 | ||
475 | } | |
476 | ||
477 | if( fIsMC ){ | |
478 | // MC Histogramms | |
479 | fMCList = new TList*[fnCuts]; | |
480 | // True Histogramms | |
481 | fTrueList = new TList*[fnCuts]; | |
482 | fHistoTrueConvGammaPt = new TH1F*[fnCuts]; | |
483 | fHistoTrueConvGammaFromNeutralMesonPt = new TH1F*[fnCuts]; | |
484 | fHistoTruePosPionPt = new TH1F*[fnCuts]; | |
485 | fHistoTrueNegPionPt = new TH1F*[fnCuts]; | |
486 | fHistoTruePosPionFromNeutralMesonPt = new TH1F*[fnCuts]; | |
487 | fHistoTrueNegPionFromNeutralMesonPt = new TH1F*[fnCuts]; | |
488 | ||
489 | ||
490 | fHistoMCAllGammaPt = new TH1F*[fnCuts]; | |
491 | fHistoMCConvGammaPt = new TH1F*[fnCuts]; | |
492 | fHistoMCAllPosPionsPt = new TH1F*[fnCuts]; | |
493 | fHistoMCAllNegPionsPt = new TH1F*[fnCuts]; | |
494 | fHistoMCGammaFromNeutralMesonPt = new TH1F*[fnCuts]; | |
495 | fHistoMCPosPionsFromNeutralMesonPt = new TH1F*[fnCuts]; | |
496 | fHistoMCNegPionsFromNeutralMesonPt = new TH1F*[fnCuts]; | |
497 | ||
498 | // hMCPi0DalitzGammaPt = new TH1F*[fnCuts]; | |
499 | // hMCPi0DalitzElectronPt = new TH1F*[fnCuts]; | |
500 | // hMCPi0DalitzPositronPt = new TH1F*[fnCuts]; | |
501 | ||
502 | fHistoMCEtaPiPlPiMiPiZeroPt = new TH1F*[fnCuts]; | |
503 | fHistoMCEtaPiPlPiMiPiZeroInAccPt = new TH1F*[fnCuts]; | |
504 | fHistoMCOmegaPiPlPiMiPiZeroPt = new TH1F*[fnCuts]; | |
505 | fHistoMCOmegaPiPlPiMiPiZeroInAccPt = new TH1F*[fnCuts]; | |
506 | ||
507 | fHistoTrueMotherPiPlPiMiPiZeroInvMassPt = new TH2F*[fnCuts]; | |
508 | fHistoTrueMotherGammaGammaInvMassPt = new TH2F*[fnCuts]; | |
509 | ||
358b4979 | 510 | // if (fDoMesonQA){ |
cb287740 | 511 | fHistoTruePionPionInvMassPt = new TH2F*[fnCuts]; |
95bd6d60 | 512 | fHistoTruePionPionFromSameMotherInvMassPt = new TH2F*[fnCuts]; |
cb287740 | 513 | fHistoTruePionPionFromNeutralMesonInvMassPt = new TH2F*[fnCuts]; |
358b4979 | 514 | // } |
cb287740 | 515 | |
516 | for(Int_t iCut = 0; iCut<fnCuts;iCut++){ | |
517 | TString cutstringEvent = ((AliConvEventCuts*)fEventCutArray->At(iCut))->GetCutNumber(); | |
518 | TString cutstringPion = ((AliPrimaryPionCuts*)fPionCutArray->At(iCut))->GetCutNumber(); | |
519 | TString cutstringGamma = ((AliConversionPhotonCuts*)fGammaCutArray->At(iCut))->GetCutNumber(); | |
520 | TString cutstringNeutralPion= ((AliConversionMesonCuts*)fNeutralPionMesonCutArray->At(iCut))->GetCutNumber(); | |
521 | TString cutstringMeson = ((AliConversionMesonCuts*)fMesonCutArray->At(iCut))->GetCutNumber(); | |
522 | ||
523 | TString fullCutString = Form("%s_%s_%s_%s_%s",cutstringEvent.Data(),cutstringGamma.Data(),cutstringNeutralPion.Data(), cutstringPion.Data(),cutstringMeson.Data()); | |
524 | TString nameMCList = Form("%s MC histograms", fullCutString.Data()); | |
525 | TString nameTrueRecList = Form("%s True histograms", fullCutString.Data()); | |
526 | ||
527 | fMCList[iCut] = new TList(); | |
528 | fMCList[iCut]->SetName(nameMCList.Data()); | |
529 | fMCList[iCut]->SetOwner(kTRUE); | |
530 | fCutFolder[iCut]->Add(fMCList[iCut]); | |
531 | ||
532 | fHistoMCAllGammaPt[iCut] = new TH1F("MC_AllGamma_Pt","MC_AllGamma_Pt",250,0,25); | |
533 | fMCList[iCut]->Add(fHistoMCAllGammaPt[iCut]); | |
534 | fHistoMCConvGammaPt[iCut] = new TH1F("MC_ConvGamma_Pt","MC_ConvGamma_Pt",250,0,25); | |
535 | fMCList[iCut]->Add(fHistoMCConvGammaPt[iCut]); | |
536 | fHistoMCAllPosPionsPt[iCut] = new TH1F("MC_AllPosPions_Pt","MC_AllPosPions_Pt",1000,0,25); | |
537 | fMCList[iCut]->Add(fHistoMCAllPosPionsPt[iCut]); | |
538 | fHistoMCAllNegPionsPt[iCut] = new TH1F("MC_AllNegPions_Pt","MC_AllNegPions_Pt",1000,0,25); | |
539 | fMCList[iCut]->Add(fHistoMCAllNegPionsPt[iCut]); | |
540 | fHistoMCGammaFromNeutralMesonPt[iCut] = new TH1F("MC_GammaFromNeutralMeson_Pt","MC_GammaFromNeutralMeson_Pt",250,0,25); | |
541 | fMCList[iCut]->Add(fHistoMCGammaFromNeutralMesonPt[iCut]); | |
542 | fHistoMCPosPionsFromNeutralMesonPt[iCut] = new TH1F("MC_PosPionsFromNeutralMeson_Pt","MC_PosPionsFromNeutralMeson_Pt",1000,0,25); | |
543 | fMCList[iCut]->Add(fHistoMCPosPionsFromNeutralMesonPt[iCut]); | |
544 | fHistoMCNegPionsFromNeutralMesonPt[iCut] = new TH1F("MC_NegPionsFromNeutralMeson_Pt","MC_NegPionsFromNeutralMeson_Pt",1000,0,25); | |
545 | fMCList[iCut]->Add(fHistoMCNegPionsFromNeutralMesonPt[iCut]); | |
546 | ||
547 | fHistoMCEtaPiPlPiMiPiZeroPt[iCut] = new TH1F("MC_Eta_Pt","MC_Eta_Pt",250,0,25); | |
548 | fHistoMCEtaPiPlPiMiPiZeroPt[iCut]->Sumw2(); | |
549 | fMCList[iCut]->Add(fHistoMCEtaPiPlPiMiPiZeroPt[iCut]); | |
550 | ||
551 | fHistoMCEtaPiPlPiMiPiZeroInAccPt[iCut] = new TH1F("MC_EtaInAcc_Pt","MC_EtaInAcc_Pt",250,0,25); | |
552 | fHistoMCEtaPiPlPiMiPiZeroInAccPt[iCut]->Sumw2(); | |
553 | fMCList[iCut]->Add(fHistoMCEtaPiPlPiMiPiZeroInAccPt[iCut]); | |
554 | ||
555 | fHistoMCOmegaPiPlPiMiPiZeroPt[iCut] = new TH1F("MC_Omega_Pt","MC_Omega_Pt",250,0,25); | |
556 | fHistoMCOmegaPiPlPiMiPiZeroPt[iCut]->Sumw2(); | |
557 | fMCList[iCut]->Add(fHistoMCOmegaPiPlPiMiPiZeroPt[iCut]); | |
558 | ||
559 | fHistoMCOmegaPiPlPiMiPiZeroInAccPt[iCut] = new TH1F("MC_OmegaInAcc_Pt","MC_OmegaInAcc_Pt",250,0,25); | |
560 | fHistoMCOmegaPiPlPiMiPiZeroInAccPt[iCut]->Sumw2(); | |
561 | fMCList[iCut]->Add(fHistoMCOmegaPiPlPiMiPiZeroInAccPt[iCut]); | |
562 | ||
563 | fTrueList[iCut] = new TList(); | |
564 | fTrueList[iCut]->SetName(nameTrueRecList.Data()); | |
565 | fTrueList[iCut]->SetOwner(kTRUE); | |
566 | fCutFolder[iCut]->Add(fTrueList[iCut]); | |
567 | ||
568 | fHistoTrueConvGammaPt[iCut] = new TH1F("ESD_TrueConvGamma_Pt","ESD_TrueConvGamma_Pt",250,0,25); | |
569 | fTrueList[iCut]->Add(fHistoTrueConvGammaPt[iCut]); | |
570 | fHistoTrueConvGammaFromNeutralMesonPt[iCut] = new TH1F("ESD_TrueConvGammaFromNeutralMeson_Pt","ESD_TrueConvGammaFromNeutralMeson_Pt",250,0,25); | |
571 | fTrueList[iCut]->Add(fHistoTrueConvGammaFromNeutralMesonPt[iCut]); | |
572 | ||
573 | fHistoTruePosPionPt[iCut] = new TH1F("ESD_TruePosPion_Pt","ESD_TruePosPion_Pt",1000,0,25); | |
574 | fTrueList[iCut]->Add(fHistoTruePosPionPt[iCut]); | |
575 | fHistoTrueNegPionPt[iCut] = new TH1F("ESD_TrueNegPion_Pt","ESD_TrueNegPion_Pt",1000,0,25); | |
576 | fTrueList[iCut]->Add(fHistoTrueNegPionPt[iCut]); | |
577 | ||
578 | fHistoTrueNegPionFromNeutralMesonPt[iCut] = new TH1F("ESD_TrueNegPionFromNeutralMeson_Pt","ESD_TrueNegPionFromNeutralMeson_Pt",1000,0,25); | |
579 | fTrueList[iCut]->Add(fHistoTrueNegPionFromNeutralMesonPt[iCut]); | |
580 | fHistoTruePosPionFromNeutralMesonPt[iCut] = new TH1F("ESD_TruePosPionFromNeutralMeson_Pt","ESD_TruePosPionFromNeutralMeson_Pt",1000,0,25); | |
581 | fTrueList[iCut]->Add(fHistoTruePosPionFromNeutralMesonPt[iCut]); | |
582 | ||
583 | fHistoTrueMotherPiPlPiMiPiZeroInvMassPt[iCut] = new TH2F("ESD_TrueMotherPiPlPiMiPiZero_InvMass_Pt","ESD_TrueMotherPiPlPiMiPiZero_InvMass_Pt",500,0.4,0.9,250,0,25); | |
584 | fHistoTrueMotherPiPlPiMiPiZeroInvMassPt[iCut]->Sumw2(); | |
585 | fTrueList[iCut]->Add(fHistoTrueMotherPiPlPiMiPiZeroInvMassPt[iCut]); | |
586 | ||
587 | fHistoTrueMotherGammaGammaInvMassPt[iCut] = new TH2F("ESD_TrueMotherGG_InvMass_Pt","ESD_TrueMotherGG_InvMass_Pt",450,0.,0.45,250,0,25); | |
588 | fHistoTrueMotherGammaGammaInvMassPt[iCut]->Sumw2(); | |
589 | fTrueList[iCut]->Add(fHistoTrueMotherGammaGammaInvMassPt[iCut]); | |
590 | ||
358b4979 | 591 | // if (fDoMesonQA){ |
cb287740 | 592 | fHistoTruePionPionInvMassPt[iCut] = new TH2F("ESD_TruePiPlusPiNeg_InvMassPt","ESD_TruePiPlusPiNeg_InvMassPt",2000,0.,2.,200,0.,20.); |
593 | fTrueList[iCut]->Add(fHistoTruePionPionInvMassPt[iCut]); | |
95bd6d60 | 594 | fHistoTruePionPionFromSameMotherInvMassPt[iCut] = new TH2F("ESD_TruePiPlusPiNegFromSameMother_InvMassPt","ESD_TruePiPlusPiNegFromSameMother_InvMassPt",2000,0.,2.,200,0.,20.); |
595 | fTrueList[iCut]->Add(fHistoTruePionPionFromSameMotherInvMassPt[iCut]); | |
cb287740 | 596 | fHistoTruePionPionFromNeutralMesonInvMassPt[iCut] = new TH2F("ESD_TruePiPlusPiNegFromNeutralMeson_InvMassPt","ESD_TruePiPlusPiNegFromNeutralMeson_InvMassPt",2000,0.,2.,200,0.,20.); |
597 | fTrueList[iCut]->Add(fHistoTruePionPionFromNeutralMesonInvMassPt[iCut]); | |
358b4979 | 598 | // } |
cb287740 | 599 | } |
600 | } | |
601 | ||
602 | ||
603 | ||
604 | InitBack(); // Init Background Handler | |
605 | ||
606 | fV0Reader=(AliV0ReaderV1*)AliAnalysisManager::GetAnalysisManager()->GetTask("V0ReaderV1"); | |
607 | if(!fV0Reader){printf("Error: No V0 Reader");return;} // GetV0Reader | |
608 | ||
609 | if(fV0Reader) | |
610 | if((AliConversionPhotonCuts*)fV0Reader->GetConversionCuts()) | |
611 | if(((AliConversionPhotonCuts*)fV0Reader->GetConversionCuts())->GetCutHistograms()) | |
612 | fOutputContainer->Add(((AliConversionPhotonCuts*)fV0Reader->GetConversionCuts())->GetCutHistograms()); | |
613 | ||
614 | ||
615 | ||
616 | fPionSelector=(AliPrimaryPionSelector*)AliAnalysisManager::GetAnalysisManager()->GetTask("PionSelector"); | |
617 | if(!fPionSelector){printf("Error: No PionSelector");return;} // GetV0Reader | |
618 | ||
619 | if( fPionSelector ){ | |
620 | if ( ((AliPrimaryPionCuts*)fPionSelector->GetPrimaryPionCuts())->GetCutHistograms() ){ | |
621 | fOutputContainer->Add( ((AliPrimaryPionCuts*)fPionSelector->GetPrimaryPionCuts())->GetCutHistograms() ); | |
622 | } | |
623 | } | |
624 | ||
625 | for(Int_t iCut = 0; iCut<fnCuts;iCut++){ | |
626 | if( fPionCutArray ){ | |
627 | if( ((AliPrimaryPionCuts*)fPionCutArray->At(iCut))->GetCutHistograms() ) { | |
628 | fCutFolder[iCut]->Add( ((AliPrimaryPionCuts*)fPionCutArray->At(iCut))->GetCutHistograms() ); | |
629 | } | |
630 | } | |
631 | if( fGammaCutArray ) { | |
632 | if( ((AliConversionPhotonCuts*)fGammaCutArray->At(iCut))->GetCutHistograms() ) { | |
633 | fCutFolder[iCut]->Add( ((AliConversionPhotonCuts*)fGammaCutArray->At(iCut))->GetCutHistograms() ); | |
634 | } | |
635 | } | |
636 | if( fNeutralPionMesonCutArray ) { | |
637 | if( ((AliConversionMesonCuts*)fNeutralPionMesonCutArray->At(iCut))->GetCutHistograms() ) { | |
638 | fCutFolder[iCut]->Add( ((AliConversionMesonCuts*)fNeutralPionMesonCutArray->At(iCut))->GetCutHistograms()); | |
639 | } | |
640 | } | |
641 | if( fMesonCutArray ) { | |
642 | if( ((AliConversionMesonCuts*)fMesonCutArray->At(iCut))->GetCutHistograms() ) { | |
643 | fCutFolder[iCut]->Add( ((AliConversionMesonCuts*)fMesonCutArray->At(iCut))->GetCutHistograms()); | |
644 | } | |
645 | } | |
646 | } | |
647 | ||
648 | PostData(1, fOutputContainer); | |
649 | ||
650 | } | |
651 | ||
652 | //______________________________________________________________________ | |
653 | void AliAnalysisTaskNeutralMesonToPiPlPiMiPiZero::UserExec(Option_t *){ | |
654 | ||
655 | // | |
656 | // Execute analysis for current event | |
657 | // | |
658 | ||
659 | fV0Reader=(AliV0ReaderV1*)AliAnalysisManager::GetAnalysisManager()->GetTask("V0ReaderV1"); | |
660 | if(!fV0Reader){printf("Error: No V0 Reader");return;} // GetV0Reader | |
661 | ||
662 | Int_t eventQuality = ((AliConvEventCuts*)fV0Reader->GetEventCuts())->GetEventQuality(); | |
663 | ||
664 | if(eventQuality == 2 || eventQuality == 3){// Event Not Accepted due to MC event missing or wrong trigger for V0ReaderV1 | |
665 | for(Int_t iCut = 0; iCut<fnCuts; iCut++){ | |
666 | fHistoNEvents[iCut]->Fill(eventQuality); | |
667 | } | |
668 | return; | |
669 | } | |
670 | ||
671 | fPionSelector=(AliPrimaryPionSelector*)AliAnalysisManager::GetAnalysisManager()->GetTask("PionSelector"); | |
672 | if(!fPionSelector){printf("Error: No PionSelector");return;} // GetV0Reader | |
673 | ||
674 | if(fIsMC) fMCEvent = MCEvent(); | |
675 | fESDEvent = (AliESDEvent*)InputEvent(); | |
676 | fReaderGammas = fV0Reader->GetReconstructedGammas(); // Gammas from default Cut | |
677 | fSelectorNegPionIndex = fPionSelector->GetReconstructedNegPionIndex(); // Electrons from default Cut | |
678 | fSelectorPosPionIndex = fPionSelector->GetReconstructedPosPionIndex(); // Positrons from default Cut | |
679 | ||
680 | fNumberOfESDTracks = fV0Reader->GetNumberOfPrimaryTracks(); | |
681 | //AddTaskContainers(); //Add conatiner | |
682 | ||
683 | for(Int_t iCut = 0; iCut<fnCuts; iCut++){ | |
684 | fiCut = iCut; | |
685 | Int_t eventNotAccepted = ((AliConvEventCuts*)fEventCutArray->At(iCut))->IsEventAcceptedByCut(fV0Reader->GetEventCuts(),fInputEvent,fMCEvent,fIsHeavyIon); | |
686 | ||
687 | if(eventNotAccepted){ | |
688 | // cout << "event rejected due to wrong trigger: " <<eventNotAccepted << endl; | |
689 | fHistoNEvents[iCut]->Fill(eventNotAccepted); // Check Centrality, PileUp, SDD and V0AND --> Not Accepted => eventQuality = 1 | |
690 | continue; | |
691 | } | |
692 | ||
693 | if(eventQuality != 0){// Event Not Accepted | |
694 | // cout << "event rejected due to: " <<eventQuality << endl; | |
695 | fHistoNEvents[iCut]->Fill(eventQuality); | |
696 | continue; | |
697 | } | |
698 | ||
699 | fHistoNEvents[iCut]->Fill(eventQuality); | |
700 | fHistoNGoodESDTracks[iCut]->Fill(fNumberOfESDTracks); | |
701 | ||
702 | if(fMCEvent){ // Process MC Particle | |
703 | fMCStack = fMCEvent->Stack(); | |
704 | if(((AliConvEventCuts*)fEventCutArray->At(iCut))->GetSignalRejection() != 0){ | |
705 | ((AliConvEventCuts*)fEventCutArray->At(iCut))->GetNotRejectedParticles(((AliConvEventCuts*)fEventCutArray->At(iCut))->GetSignalRejection(), | |
706 | ((AliConvEventCuts*)fEventCutArray->At(iCut))->GetAcceptedHeader(), | |
707 | fMCEvent); | |
708 | } | |
709 | ProcessMCParticles(); | |
710 | } | |
711 | ||
712 | ProcessPhotonCandidates(); // Process this cuts gammas | |
713 | ProcessNeutralPionCandidatesPureConversions(); // Process neutral pion candidates | |
714 | ProcessPionCandidates(); // Process this cuts gammas | |
715 | ||
716 | CalculateMesonCandidates(); | |
f61c548e | 717 | CalculateBackground(); |
718 | UpdateEventByEventData(); | |
cb287740 | 719 | |
720 | fGoodGammas->Clear(); // delete this cuts good gammas | |
2f19ad02 | 721 | // if (fNeutralPionCandidates->GetEntries()>0)cout << "##################################"<< fNeutralPionCandidates->GetEntries() << endl; |
722 | if(fNeutralPionCandidates->GetEntries()>0){ | |
723 | fNeutralPionCandidates->Clear(); | |
724 | } | |
cb287740 | 725 | fGoodVirtualParticles->Clear(); // delete this cuts good gammas |
726 | } | |
727 | ||
728 | fSelectorNegPionIndex.clear(); | |
729 | fSelectorPosPionIndex.clear(); | |
730 | ||
731 | PostData( 1, fOutputContainer ); | |
732 | } | |
733 | ||
734 | Bool_t AliAnalysisTaskNeutralMesonToPiPlPiMiPiZero::Notify(){ | |
735 | for(Int_t iCut = 0; iCut<fnCuts;iCut++){ | |
736 | if( !((AliConvEventCuts*)fEventCutArray->At(iCut))->GetDoEtaShift() ){ | |
737 | fProfileEtaShift[iCut]->Fill(0.,0.); | |
738 | continue; // No Eta Shift requested, continue | |
739 | } | |
740 | if( ((AliConvEventCuts*)fEventCutArray->At(iCut))->GetEtaShift() == 0.0){ // Eta Shift requested but not set, get shift automatically | |
741 | ((AliConvEventCuts*)fEventCutArray->At(iCut))->GetCorrectEtaShiftFromPeriod(fV0Reader->GetPeriodName()); | |
742 | ((AliConvEventCuts*)fEventCutArray->At(iCut))->DoEtaShift(kFALSE); // Eta Shift Set, make sure that it is called only once | |
743 | ((AliPrimaryPionCuts*)fPionCutArray->At(iCut))->SetEtaShift( ((AliConvEventCuts*)fEventCutArray->At(iCut))->GetEtaShift() ); | |
744 | fProfileEtaShift[iCut]->Fill(0.,(((AliConvEventCuts*)fEventCutArray->At(iCut))->GetEtaShift())); | |
745 | continue; | |
746 | } else { | |
747 | printf(" Eta t PiPlusPiMinus Gamma Task %s :: Eta Shift Manually Set to %f \n\n", | |
748 | (((AliConvEventCuts*)fEventCutArray->At(iCut))->GetCutNumber()).Data(),((AliConvEventCuts*)fEventCutArray->At(iCut))->GetEtaShift()); | |
749 | ((AliConvEventCuts*)fEventCutArray->At(iCut))->DoEtaShift(kFALSE); // Eta Shift Set, make sure that it is called only once | |
750 | ((AliPrimaryPionCuts*)fPionCutArray->At(iCut))->SetEtaShift( ((AliConvEventCuts*)fEventCutArray->At(iCut))->GetEtaShift() ); | |
751 | fProfileEtaShift[iCut]->Fill(0.,(((AliConvEventCuts*)fEventCutArray->At(iCut))->GetEtaShift())); | |
752 | } | |
753 | } | |
754 | return kTRUE; | |
755 | } | |
756 | ||
757 | ||
758 | void AliAnalysisTaskNeutralMesonToPiPlPiMiPiZero::Terminate(const Option_t *){ | |
759 | ///Grid | |
760 | } | |
761 | ||
762 | //________________________________________________________________________ | |
763 | void AliAnalysisTaskNeutralMesonToPiPlPiMiPiZero::ProcessPhotonCandidates(){ | |
764 | Int_t nV0 = 0; | |
765 | TList *GoodGammasStepOne = new TList(); | |
766 | TList *GoodGammasStepTwo = new TList(); | |
767 | // Loop over Photon Candidates allocated by ReaderV1 | |
768 | ||
769 | for(Int_t i = 0; i < fReaderGammas->GetEntriesFast(); i++){ | |
770 | AliAODConversionPhoton* PhotonCandidate = (AliAODConversionPhoton*) fReaderGammas->At(i); | |
771 | if(!PhotonCandidate) continue; | |
772 | ||
773 | fIsFromMBHeader = kTRUE; | |
774 | ||
775 | if( fMCEvent && ((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetSignalRejection() != 0 ){ | |
776 | Int_t isPosFromMBHeader | |
777 | = ((AliConvEventCuts*)fEventCutArray->At(fiCut))->IsParticleFromBGEvent(PhotonCandidate->GetMCLabelPositive(), fMCStack, fInputEvent); | |
778 | if(isPosFromMBHeader == 0 && ((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetSignalRejection() != 3) continue; | |
779 | Int_t isNegFromMBHeader | |
780 | = ((AliConvEventCuts*)fEventCutArray->At(fiCut))->IsParticleFromBGEvent(PhotonCandidate->GetMCLabelNegative(), fMCStack,fInputEvent); | |
781 | if(isNegFromMBHeader == 0 && ((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetSignalRejection() != 3) continue; | |
782 | if( (isNegFromMBHeader+isPosFromMBHeader) != 4) fIsFromMBHeader = kFALSE; | |
783 | } | |
784 | ||
785 | if(!((AliConversionPhotonCuts*)fGammaCutArray->At(fiCut))->PhotonIsSelected(PhotonCandidate,fESDEvent)) continue; | |
786 | ||
787 | if(!((AliConversionPhotonCuts*)fGammaCutArray->At(fiCut))->UseElecSharingCut() && | |
788 | !((AliConversionPhotonCuts*)fGammaCutArray->At(fiCut))->UseToCloseV0sCut()){ // if no post reader loop is required add to events good gammas | |
789 | ||
790 | fGoodGammas->Add(PhotonCandidate); | |
791 | ||
792 | if(fIsFromMBHeader){ | |
793 | fHistoConvGammaPt[fiCut]->Fill(PhotonCandidate->Pt()); | |
794 | fHistoConvGammaEta[fiCut]->Fill(PhotonCandidate->Eta()); | |
795 | } | |
796 | ||
797 | if(fMCEvent){ | |
798 | ProcessTruePhotonCandidates(PhotonCandidate); | |
799 | } | |
800 | } else if(((AliConversionPhotonCuts*)fGammaCutArray->At(fiCut))->UseElecSharingCut()){ // if Shared Electron cut is enabled, Fill array, add to step one | |
801 | ((AliConversionPhotonCuts*)fGammaCutArray->At(fiCut))->FillElectonLabelArray(PhotonCandidate,nV0); | |
802 | nV0++; | |
803 | GoodGammasStepOne->Add(PhotonCandidate); | |
804 | } else if(!((AliConversionPhotonCuts*)fGammaCutArray->At(fiCut))->UseElecSharingCut() && | |
805 | ((AliConversionPhotonCuts*)fGammaCutArray->At(fiCut))->UseToCloseV0sCut()){ // shared electron is disabled, step one not needed -> step two | |
806 | GoodGammasStepTwo->Add(PhotonCandidate); | |
807 | } | |
808 | } | |
809 | ||
810 | ||
811 | if(((AliConversionPhotonCuts*)fGammaCutArray->At(fiCut))->UseElecSharingCut()){ | |
812 | for(Int_t i = 0;i<GoodGammasStepOne->GetEntries();i++){ | |
813 | AliAODConversionPhoton *PhotonCandidate= (AliAODConversionPhoton*) GoodGammasStepOne->At(i); | |
814 | if(!PhotonCandidate) continue; | |
815 | fIsFromMBHeader = kTRUE; | |
816 | if(fMCEvent && ((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetSignalRejection() != 0){ | |
817 | Int_t isPosFromMBHeader | |
818 | = ((AliConvEventCuts*)fEventCutArray->At(fiCut))->IsParticleFromBGEvent(PhotonCandidate->GetMCLabelPositive(), fMCStack,fInputEvent); | |
819 | Int_t isNegFromMBHeader | |
820 | = ((AliConvEventCuts*)fEventCutArray->At(fiCut))->IsParticleFromBGEvent(PhotonCandidate->GetMCLabelNegative(), fMCStack,fInputEvent); | |
821 | if( (isNegFromMBHeader+isPosFromMBHeader) != 4) fIsFromMBHeader = kFALSE; | |
822 | } | |
823 | if(!((AliConversionPhotonCuts*)fGammaCutArray->At(fiCut))->RejectSharedElectronV0s(PhotonCandidate,i,GoodGammasStepOne->GetEntries())) continue; | |
824 | if(!((AliConversionPhotonCuts*)fGammaCutArray->At(fiCut))->UseToCloseV0sCut()){ // To Colse v0s cut diabled, step two not needed | |
825 | fGoodGammas->Add(PhotonCandidate); | |
826 | if(fIsFromMBHeader){ | |
827 | fHistoConvGammaPt[fiCut]->Fill(PhotonCandidate->Pt()); | |
828 | fHistoConvGammaEta[fiCut]->Fill(PhotonCandidate->Eta()); | |
829 | } | |
830 | if(fMCEvent){ | |
831 | ProcessTruePhotonCandidates(PhotonCandidate); | |
832 | } | |
833 | } | |
834 | else GoodGammasStepTwo->Add(PhotonCandidate); // Close v0s cut enabled -> add to list two | |
835 | } | |
836 | } | |
837 | if(((AliConversionPhotonCuts*)fGammaCutArray->At(fiCut))->UseToCloseV0sCut()){ | |
838 | for(Int_t i = 0;i<GoodGammasStepTwo->GetEntries();i++){ | |
839 | AliAODConversionPhoton* PhotonCandidate = (AliAODConversionPhoton*) GoodGammasStepTwo->At(i); | |
840 | if(!PhotonCandidate) continue; | |
841 | ||
842 | if(fMCEvent && ((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetSignalRejection() != 0){ | |
843 | Int_t isPosFromMBHeader | |
844 | = ((AliConvEventCuts*)fEventCutArray->At(fiCut))->IsParticleFromBGEvent(PhotonCandidate->GetMCLabelPositive(), fMCStack,fInputEvent); | |
845 | Int_t isNegFromMBHeader | |
846 | = ((AliConvEventCuts*)fEventCutArray->At(fiCut))->IsParticleFromBGEvent(PhotonCandidate->GetMCLabelNegative(), fMCStack,fInputEvent); | |
847 | if( (isNegFromMBHeader+isPosFromMBHeader) != 4) fIsFromMBHeader = kFALSE; | |
848 | } | |
849 | ||
850 | if(!((AliConversionPhotonCuts*)fGammaCutArray->At(fiCut))->RejectToCloseV0s(PhotonCandidate,GoodGammasStepTwo,i)) continue; | |
851 | fGoodGammas->Add(PhotonCandidate); // Add gamma to current cut TList | |
852 | ||
853 | if(fIsFromMBHeader){ | |
854 | fHistoConvGammaPt[fiCut]->Fill(PhotonCandidate->Pt()); // Differences to old V0Reader in p_t due to conversion KF->TLorentzVector | |
855 | fHistoConvGammaEta[fiCut]->Fill(PhotonCandidate->Eta()); | |
856 | } | |
857 | ||
858 | if(fMCEvent){ | |
859 | ProcessTruePhotonCandidates(PhotonCandidate); | |
860 | } | |
861 | } | |
862 | } | |
863 | ||
864 | delete GoodGammasStepOne; | |
865 | GoodGammasStepOne = 0x0; | |
866 | delete GoodGammasStepTwo; | |
867 | GoodGammasStepTwo = 0x0; | |
868 | } | |
869 | ||
870 | //________________________________________________________________________ | |
871 | void AliAnalysisTaskNeutralMesonToPiPlPiMiPiZero::ProcessTruePhotonCandidates(AliAODConversionPhoton *TruePhotonCandidate) | |
872 | { | |
873 | // Process True Photons | |
874 | AliStack *MCStack = fMCEvent->Stack(); | |
875 | TParticle *posDaughter = TruePhotonCandidate->GetPositiveMCDaughter(MCStack); | |
876 | TParticle *negDaughter = TruePhotonCandidate->GetNegativeMCDaughter(MCStack); | |
877 | ||
878 | if(posDaughter == NULL || negDaughter == NULL) return; // One particle does not exist | |
879 | if(posDaughter->GetMother(0) != negDaughter->GetMother(0)){ // Not Same Mother == Combinatorial Bck | |
880 | return; | |
881 | } | |
882 | ||
883 | else if (posDaughter->GetMother(0) == -1){ | |
884 | return; | |
885 | } | |
886 | ||
887 | if(TMath::Abs(posDaughter->GetPdgCode())!=11 || TMath::Abs(negDaughter->GetPdgCode())!=11) return; //One Particle is not electron | |
888 | if(posDaughter->GetPdgCode()==negDaughter->GetPdgCode()) return; // Same Charge | |
889 | if(posDaughter->GetUniqueID() != 5 || negDaughter->GetUniqueID() !=5) return;// check if the daughters come from a conversion | |
890 | ||
891 | TParticle *Photon = TruePhotonCandidate->GetMCParticle(MCStack); | |
892 | if(Photon->GetPdgCode() != 22) return; // Mother is no Photon | |
893 | ||
894 | // True Photon | |
895 | ||
896 | Int_t labelGamma = TruePhotonCandidate->GetMCParticleLabel(MCStack); | |
897 | ||
898 | if( labelGamma < MCStack->GetNprimary() ){ | |
899 | if( fIsFromMBHeader ){ | |
900 | fHistoTrueConvGammaPt[fiCut]->Fill(TruePhotonCandidate->Pt()); | |
6671ffac | 901 | if (GammaIsNeutralMesonPiPlPiMiPiZeroDaughter(labelGamma)){ |
902 | fHistoTrueConvGammaFromNeutralMesonPt[fiCut]->Fill(TruePhotonCandidate->Pt()); | |
903 | } | |
cb287740 | 904 | } |
905 | } | |
906 | } | |
907 | ||
908 | //________________________________________________________________________ | |
909 | void AliAnalysisTaskNeutralMesonToPiPlPiMiPiZero::ProcessNeutralPionCandidatesPureConversions(){ | |
910 | // Conversion Gammas | |
911 | if(fGoodGammas->GetEntries()>1){ | |
912 | for(Int_t firstGammaIndex=0;firstGammaIndex<fGoodGammas->GetEntries()-1;firstGammaIndex++){ | |
913 | AliAODConversionPhoton *gamma0=dynamic_cast<AliAODConversionPhoton*>(fGoodGammas->At(firstGammaIndex)); | |
914 | if (gamma0==NULL) continue; | |
915 | for(Int_t secondGammaIndex=firstGammaIndex+1;secondGammaIndex<fGoodGammas->GetEntries();secondGammaIndex++){ | |
916 | AliAODConversionPhoton *gamma1=dynamic_cast<AliAODConversionPhoton*>(fGoodGammas->At(secondGammaIndex)); | |
917 | //Check for same Electron ID | |
918 | if (gamma1==NULL) continue; | |
919 | if(gamma0->GetTrackLabelPositive() == gamma1->GetTrackLabelPositive() || | |
920 | gamma0->GetTrackLabelNegative() == gamma1->GetTrackLabelNegative() || | |
921 | gamma0->GetTrackLabelNegative() == gamma1->GetTrackLabelPositive() || | |
922 | gamma0->GetTrackLabelPositive() == gamma1->GetTrackLabelNegative() ) continue; | |
923 | ||
924 | AliAODConversionMother *pi0cand = new AliAODConversionMother(gamma0,gamma1); | |
925 | pi0cand->SetLabels(firstGammaIndex,secondGammaIndex); | |
926 | ||
927 | pi0cand->CalculateDistanceOfClossetApproachToPrimVtx(fInputEvent->GetPrimaryVertex()); | |
928 | if((((AliConversionMesonCuts*)fNeutralPionMesonCutArray->At(fiCut))->MesonIsSelected(pi0cand,kTRUE,((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetEtaShift()))){ | |
929 | fHistoGammaGammaInvMassPt[fiCut]->Fill(pi0cand->M(),pi0cand->Pt()); | |
42fe34e2 | 930 | if (pi0cand->M() > ((AliConversionMesonCuts*)fNeutralPionMesonCutArray->At(fiCut))->GetSelectionLow() && pi0cand->M() < ((AliConversionMesonCuts*)fNeutralPionMesonCutArray->At(fiCut))->GetSelectionHigh()){ |
cb287740 | 931 | fNeutralPionCandidates->Add(pi0cand); |
932 | // cout << "Pi0 candidate " << pi0cand->M() << "\t" << pi0cand->Pt() << endl; | |
933 | } | |
934 | ||
935 | if(fIsMC){ | |
936 | if(fInputEvent->IsA()==AliESDEvent::Class()) | |
937 | ProcessTrueNeutralPionCandidatesPureConversions(pi0cand,gamma0,gamma1); | |
938 | if(fInputEvent->IsA()==AliAODEvent::Class()) | |
939 | ProcessTrueNeutralPionCandidatesPureConversionsAOD(pi0cand,gamma0,gamma1); | |
940 | } | |
941 | } | |
358e5f57 | 942 | // delete pi0cand; |
943 | // pi0cand=0x0; | |
cb287740 | 944 | } |
945 | } | |
946 | } | |
947 | } | |
948 | ||
949 | ||
950 | //______________________________________________________________________ | |
951 | void AliAnalysisTaskNeutralMesonToPiPlPiMiPiZero::ProcessTrueNeutralPionCandidatesPureConversions(AliAODConversionMother *Pi0Candidate, AliAODConversionPhoton *TrueGammaCandidate0, AliAODConversionPhoton *TrueGammaCandidate1) | |
952 | { | |
953 | // Process True Mesons | |
954 | AliStack *MCStack = fMCEvent->Stack(); | |
955 | if(TrueGammaCandidate0->GetV0Index()<fInputEvent->GetNumberOfV0s()){ | |
956 | Bool_t isTruePi0 = kFALSE; | |
957 | Bool_t isTruePi0Dalitz = kFALSE; | |
958 | Bool_t gamma0DalitzCand = kFALSE; | |
959 | Bool_t gamma1DalitzCand = kFALSE; | |
960 | Int_t gamma0MCLabel = TrueGammaCandidate0->GetMCParticleLabel(MCStack); | |
961 | Int_t gamma0MotherLabel = -1; | |
eed82f0e | 962 | Int_t motherRealLabel = -1; |
cb287740 | 963 | if(gamma0MCLabel != -1){ // Gamma is Combinatorial; MC Particles don't belong to the same Mother |
964 | // Daughters Gamma 0 | |
965 | TParticle * negativeMC = (TParticle*)TrueGammaCandidate0->GetNegativeMCDaughter(MCStack); | |
966 | TParticle * positiveMC = (TParticle*)TrueGammaCandidate0->GetPositiveMCDaughter(MCStack); | |
967 | TParticle * gammaMC0 = (TParticle*)MCStack->Particle(gamma0MCLabel); | |
968 | if(abs(negativeMC->GetPdgCode())==11 && abs(positiveMC->GetPdgCode())==11){ // Electrons ... | |
969 | if(negativeMC->GetUniqueID() == 5 && positiveMC->GetUniqueID() ==5){ // ... From Conversion ... | |
970 | if(gammaMC0->GetPdgCode() == 22){ // ... with Gamma Mother | |
971 | gamma0MotherLabel=gammaMC0->GetFirstMother(); | |
eed82f0e | 972 | motherRealLabel=gammaMC0->GetFirstMother(); |
cb287740 | 973 | } |
974 | } | |
975 | if(gammaMC0->GetPdgCode() ==111){ // Dalitz candidate | |
976 | gamma0DalitzCand = kTRUE; | |
977 | gamma0MotherLabel=-111; | |
978 | } | |
979 | } | |
980 | } | |
981 | if(TrueGammaCandidate1->GetV0Index()<fInputEvent->GetNumberOfV0s()){ | |
982 | Int_t gamma1MCLabel = TrueGammaCandidate1->GetMCParticleLabel(MCStack); | |
983 | Int_t gamma1MotherLabel = -1; | |
984 | if(gamma1MCLabel != -1){ // Gamma is Combinatorial; MC Particles don't belong to the same Mother | |
985 | // Daughters Gamma 1 | |
986 | TParticle * negativeMC = (TParticle*)TrueGammaCandidate1->GetNegativeMCDaughter(MCStack); | |
987 | TParticle * positiveMC = (TParticle*)TrueGammaCandidate1->GetPositiveMCDaughter(MCStack); | |
988 | TParticle * gammaMC1 = (TParticle*)MCStack->Particle(gamma1MCLabel); | |
989 | if(abs(negativeMC->GetPdgCode())==11 && abs(positiveMC->GetPdgCode())==11){ // Electrons ... | |
990 | if(negativeMC->GetUniqueID() == 5 && positiveMC->GetUniqueID() ==5){ // ... From Conversion ... | |
991 | if(gammaMC1->GetPdgCode() == 22){ // ... with Gamma Mother | |
992 | gamma1MotherLabel=gammaMC1->GetFirstMother(); | |
993 | } | |
994 | } | |
995 | if(gammaMC1->GetPdgCode() ==111 ){ // Dalitz candidate | |
996 | gamma1DalitzCand = kTRUE; | |
997 | gamma1MotherLabel=-111; | |
998 | } | |
999 | } | |
1000 | } | |
1001 | if(gamma0MotherLabel>=0 && gamma0MotherLabel==gamma1MotherLabel){ | |
1002 | if(((TParticle*)MCStack->Particle(gamma1MotherLabel))->GetPdgCode() == 111){ | |
1003 | isTruePi0=kTRUE; | |
1004 | } | |
1005 | } | |
1006 | ||
1007 | //Identify Dalitz candidate | |
1008 | if (gamma1DalitzCand || gamma0DalitzCand){ | |
1009 | if (gamma0DalitzCand && gamma0MCLabel >=0 && gamma0MCLabel==gamma1MotherLabel){ | |
1010 | if (gamma0MotherLabel == -111) isTruePi0Dalitz = kTRUE; | |
1011 | } | |
1012 | if (gamma1DalitzCand && gamma1MCLabel >=0 && gamma1MCLabel==gamma0MotherLabel){ | |
1013 | if (gamma1MotherLabel == -111) isTruePi0Dalitz = kTRUE; | |
1014 | } | |
1015 | } | |
1016 | ||
1017 | ||
1018 | if(isTruePi0 || isTruePi0Dalitz){// True Pion | |
eed82f0e | 1019 | Pi0Candidate->SetTrueMesonValue(1); |
1020 | Pi0Candidate->SetMCLabel(motherRealLabel); | |
cb287740 | 1021 | fHistoTrueMotherGammaGammaInvMassPt[fiCut]->Fill(Pi0Candidate->M(),Pi0Candidate->Pt()); |
1022 | } | |
1023 | } | |
1024 | } | |
1025 | } | |
1026 | //______________________________________________________________________ | |
1027 | void AliAnalysisTaskNeutralMesonToPiPlPiMiPiZero::ProcessTrueNeutralPionCandidatesPureConversionsAOD(AliAODConversionMother *Pi0Candidate, AliAODConversionPhoton *TrueGammaCandidate0, AliAODConversionPhoton *TrueGammaCandidate1) | |
1028 | { | |
1029 | ||
1030 | // Process True Mesons | |
1031 | TClonesArray *AODMCTrackArray = dynamic_cast<TClonesArray*>(fInputEvent->FindListObject(AliAODMCParticle::StdBranchName())); | |
1032 | Bool_t isTruePi0 = kFALSE; | |
1033 | Bool_t isTruePi0Dalitz = kFALSE; | |
1034 | Bool_t gamma0DalitzCand = kFALSE; | |
1035 | Bool_t gamma1DalitzCand = kFALSE; | |
eed82f0e | 1036 | Int_t motherRealLabel = -1; |
1037 | ||
cb287740 | 1038 | if (AODMCTrackArray!=NULL && TrueGammaCandidate0 != NULL){ |
1039 | AliAODMCParticle *positiveMC = static_cast<AliAODMCParticle*>(AODMCTrackArray->At(TrueGammaCandidate0->GetMCLabelPositive())); | |
1040 | AliAODMCParticle *negativeMC = static_cast<AliAODMCParticle*>(AODMCTrackArray->At(TrueGammaCandidate0->GetMCLabelNegative())); | |
1041 | ||
1042 | Int_t gamma0MCLabel = -1; | |
1043 | Int_t gamma0MotherLabel = -1; | |
1044 | if(!positiveMC||!negativeMC) | |
1045 | return; | |
1046 | ||
1047 | if(positiveMC->GetMother()>-1&&(negativeMC->GetMother() == positiveMC->GetMother())){ | |
1048 | gamma0MCLabel = positiveMC->GetMother(); | |
1049 | } | |
1050 | ||
1051 | if(gamma0MCLabel != -1){ // Gamma is Combinatorial; MC Particles don't belong to the same Mother | |
1052 | // Daughters Gamma 0 | |
1053 | AliAODMCParticle * gammaMC0 = static_cast<AliAODMCParticle*>(AODMCTrackArray->At(gamma0MCLabel)); | |
1054 | if(abs(negativeMC->GetPdgCode())==11 && abs(positiveMC->GetPdgCode())==11){ // Electrons ... | |
1055 | if(((positiveMC->GetMCProcessCode())) == 5 && ((negativeMC->GetMCProcessCode())) == 5){ // ... From Conversion ... | |
1056 | if(gammaMC0->GetPdgCode() == 22){ // ... with Gamma Mother | |
eed82f0e | 1057 | gamma0MotherLabel=gammaMC0->GetMother(); |
1058 | motherRealLabel=gammaMC0->GetMother(); | |
cb287740 | 1059 | } |
1060 | } | |
1061 | if(gammaMC0->GetPdgCode() ==111){ // Dalitz candidate | |
1062 | gamma0DalitzCand = kTRUE; | |
1063 | gamma0MotherLabel=-111; | |
1064 | } | |
1065 | } | |
1066 | } | |
1067 | positiveMC = static_cast<AliAODMCParticle*>(AODMCTrackArray->At(TrueGammaCandidate1->GetMCLabelPositive())); | |
1068 | negativeMC = static_cast<AliAODMCParticle*>(AODMCTrackArray->At(TrueGammaCandidate1->GetMCLabelNegative())); | |
1069 | ||
1070 | Int_t gamma1MCLabel = -1; | |
1071 | Int_t gamma1MotherLabel = -1; | |
1072 | if(!positiveMC||!negativeMC) | |
1073 | return; | |
1074 | ||
1075 | if(positiveMC->GetMother()>-1&&(negativeMC->GetMother() == positiveMC->GetMother())){ | |
1076 | gamma1MCLabel = positiveMC->GetMother(); | |
1077 | } | |
1078 | if(gamma1MCLabel != -1){ // Gamma is Combinatorial; MC Particles don't belong to the same Mother | |
1079 | // Daughters Gamma 1 | |
1080 | AliAODMCParticle * gammaMC1 = static_cast<AliAODMCParticle*>(AODMCTrackArray->At(gamma1MCLabel)); | |
1081 | if(abs(negativeMC->GetPdgCode())==11 && abs(positiveMC->GetPdgCode())==11){ // Electrons ... | |
1082 | if(((positiveMC->GetMCProcessCode())) == 5 && ((negativeMC->GetMCProcessCode())) == 5){ // ... From Conversion ... | |
1083 | if(gammaMC1->GetPdgCode() == 22){ // ... with Gamma Mother | |
1084 | gamma1MotherLabel=gammaMC1->GetMother(); | |
1085 | } | |
1086 | } | |
1087 | if(gammaMC1->GetPdgCode() ==111 ){ // Dalitz candidate | |
1088 | gamma1DalitzCand = kTRUE; | |
1089 | gamma1MotherLabel=-111; | |
1090 | } | |
1091 | } | |
1092 | } | |
1093 | if(gamma0MotherLabel>=0 && gamma0MotherLabel==gamma1MotherLabel){ | |
1094 | if(static_cast<AliAODMCParticle*>(AODMCTrackArray->At(gamma1MotherLabel))->GetPdgCode() == 111){ | |
1095 | isTruePi0=kTRUE; | |
1096 | } | |
1097 | } | |
1098 | ||
1099 | //Identify Dalitz candidate | |
1100 | if (gamma1DalitzCand || gamma0DalitzCand){ | |
1101 | if (gamma0DalitzCand && gamma0MCLabel >=0 && gamma0MCLabel==gamma1MotherLabel){ | |
1102 | if (gamma0MotherLabel == -111) isTruePi0Dalitz = kTRUE; | |
1103 | } | |
1104 | if (gamma1DalitzCand && gamma1MCLabel >=0 && gamma1MCLabel==gamma0MotherLabel){ | |
1105 | if (gamma1MotherLabel == -111) isTruePi0Dalitz = kTRUE; | |
1106 | } | |
1107 | } | |
1108 | ||
1109 | if(isTruePi0 || isTruePi0Dalitz){// True Pion | |
eed82f0e | 1110 | Pi0Candidate->SetTrueMesonValue(1); |
1111 | Pi0Candidate->SetMCLabel(motherRealLabel); | |
cb287740 | 1112 | fHistoTrueMotherGammaGammaInvMassPt[fiCut]->Fill(Pi0Candidate->M(),Pi0Candidate->Pt()); |
1113 | } | |
1114 | } | |
1115 | return; | |
1116 | } | |
1117 | ||
1118 | ||
1119 | ||
1120 | //________________________________________________________________________ | |
1121 | void AliAnalysisTaskNeutralMesonToPiPlPiMiPiZero::ProcessPionCandidates(){ | |
1122 | ||
1123 | Double_t magField = fInputEvent->GetMagneticField(); | |
1124 | if( magField < 0.0 ){ | |
1125 | magField = 1.0; | |
1126 | } else { | |
1127 | magField = -1.0; | |
1128 | } | |
1129 | ||
1130 | vector<Int_t> lGoodNegPionIndexPrev(0); | |
1131 | vector<Int_t> lGoodPosPionIndexPrev(0); | |
1132 | ||
1133 | for(UInt_t i = 0; i < fSelectorNegPionIndex.size(); i++){ | |
1134 | AliESDtrack* negPionCandidate = fESDEvent->GetTrack(fSelectorNegPionIndex[i]); | |
1135 | if(! ((AliPrimaryPionCuts*)fPionCutArray->At(fiCut))->PionIsSelected(negPionCandidate) ) continue; | |
1136 | lGoodNegPionIndexPrev.push_back( fSelectorNegPionIndex[i] ); | |
1137 | fHistoNegPionPt[fiCut]->Fill(negPionCandidate->Pt()); | |
1138 | fHistoNegPionPhi[fiCut]->Fill(negPionCandidate->Phi()); | |
1139 | if( fMCEvent ) { | |
1140 | Int_t labelNegPion = TMath::Abs( negPionCandidate->GetLabel() ); | |
1141 | if( labelNegPion < fMCStack->GetNtrack() ){ | |
1142 | TParticle* negPion = fMCStack->Particle(labelNegPion); | |
1143 | if( negPion->GetPdgCode() == -211 ){ | |
1144 | if( labelNegPion < fMCStack->GetNprimary() ){ | |
1145 | fHistoTrueNegPionPt[fiCut]->Fill(negPionCandidate->Pt()); //primary negPion | |
1146 | } | |
1147 | if( IsEtaPiPlPiMiPiZeroDaughter(labelNegPion) || IsOmegaPiPlPiMiPiZeroDaughter(labelNegPion) ) { | |
1148 | if( labelNegPion < fMCStack->GetNprimary() ) { | |
1149 | fHistoTrueNegPionFromNeutralMesonPt[fiCut]->Fill(negPionCandidate->Pt()); | |
1150 | } | |
1151 | } | |
1152 | } | |
1153 | } | |
1154 | } | |
1155 | } | |
1156 | ||
1157 | for(UInt_t i = 0; i < fSelectorPosPionIndex.size(); i++){ | |
1158 | AliESDtrack* posPionCandidate = fESDEvent->GetTrack( fSelectorPosPionIndex[i] ); | |
1159 | if(! ((AliPrimaryPionCuts*)fPionCutArray->At(fiCut))->PionIsSelected(posPionCandidate) ) continue; | |
1160 | lGoodPosPionIndexPrev.push_back( fSelectorPosPionIndex[i] ); | |
1161 | fHistoPosPionPt[fiCut]->Fill( posPionCandidate->Pt() ); | |
1162 | fHistoPosPionPhi[fiCut]->Fill( posPionCandidate->Phi() ); | |
1163 | ||
1164 | if( fMCEvent ) { | |
1165 | Int_t labelPosPion = TMath::Abs( posPionCandidate->GetLabel() ); | |
1166 | if( labelPosPion < fMCStack->GetNtrack() ) { | |
1167 | TParticle* posPion = fMCStack->Particle(labelPosPion); | |
1168 | if( posPion->GetPdgCode() == 211 ){ | |
1169 | if( labelPosPion < fMCStack->GetNprimary() ){ | |
1170 | fHistoTruePosPionPt[fiCut]->Fill(posPionCandidate->Pt()); | |
1171 | } | |
1172 | if( IsEtaPiPlPiMiPiZeroDaughter(labelPosPion) || IsOmegaPiPlPiMiPiZeroDaughter(labelPosPion) ) { | |
1173 | if( labelPosPion < fMCStack->GetNprimary() ){ | |
1174 | fHistoTruePosPionFromNeutralMesonPt[fiCut]->Fill(posPionCandidate->Pt()); | |
1175 | } | |
1176 | } | |
1177 | } | |
1178 | } | |
1179 | } | |
1180 | } | |
1181 | ||
1182 | ||
1183 | for(UInt_t i = 0; i < lGoodNegPionIndexPrev.size(); i++){ | |
1184 | ||
1185 | AliESDtrack *negPionCandidate = fESDEvent->GetTrack(lGoodNegPionIndexPrev[i]); | |
1186 | AliKFParticle negPionCandidateKF( *negPionCandidate->GetConstrainedParam(), 211 ); | |
1187 | ||
1188 | for(UInt_t j = 0; j < lGoodPosPionIndexPrev.size(); j++){ | |
1189 | ||
1190 | AliESDtrack *posPionCandidate = fESDEvent->GetTrack(lGoodPosPionIndexPrev[j]); | |
1191 | AliKFParticle posPionCandidateKF( *posPionCandidate->GetConstrainedParam(), 211 ); | |
1192 | ||
1193 | AliKFConversionPhoton* virtualPhoton = NULL; | |
1194 | virtualPhoton = new AliKFConversionPhoton(negPionCandidateKF,posPionCandidateKF); | |
1195 | AliKFVertex primaryVertexImproved(*fInputEvent->GetPrimaryVertex()); | |
1196 | // primaryVertexImproved+=*virtualPhoton; | |
1197 | virtualPhoton->SetProductionVertex(primaryVertexImproved); | |
1198 | virtualPhoton->SetTrackLabels( lGoodPosPionIndexPrev[j], lGoodNegPionIndexPrev[i]); | |
1199 | ||
01871c25 | 1200 | Int_t labeln=0; |
1201 | Int_t labelp=0; | |
95bd6d60 | 1202 | Int_t motherlabelp = 0; |
1203 | Int_t motherlabeln = 0; | |
e5315892 | 1204 | TParticle *fNegativeMCParticle =NULL; |
1205 | TParticle *fPositiveMCParticle =NULL; | |
cb287740 | 1206 | if( fMCEvent ) { |
01871c25 | 1207 | labeln=TMath::Abs(negPionCandidate->GetLabel()); |
1208 | labelp=TMath::Abs(posPionCandidate->GetLabel()); | |
e5315892 | 1209 | fNegativeMCParticle = fMCStack->Particle(labeln); |
1210 | fPositiveMCParticle = fMCStack->Particle(labelp); | |
95bd6d60 | 1211 | motherlabeln = fNegativeMCParticle->GetMother(0); |
1212 | motherlabelp = fPositiveMCParticle->GetMother(0); | |
cb287740 | 1213 | if( fPositiveMCParticle && fNegativeMCParticle) { |
1214 | virtualPhoton->SetMCLabelPositive(labelp); | |
1215 | virtualPhoton->SetMCLabelNegative(labeln); | |
e5315892 | 1216 | } |
cb287740 | 1217 | } |
1218 | ||
1219 | AliAODConversionPhoton *vParticle = new AliAODConversionPhoton(virtualPhoton); //To Apply PsiPairCut | |
1220 | if (((AliPrimaryPionCuts*)fPionCutArray->At(fiCut))->DoMassCut()){ | |
1221 | if (vParticle->GetMass() < ((AliPrimaryPionCuts*)fPionCutArray->At(fiCut))->GetMassCut()){ | |
1222 | fGoodVirtualParticles->Add( vParticle ); | |
1223 | } | |
1224 | } else { | |
1225 | fGoodVirtualParticles->Add( vParticle ); | |
1226 | } | |
01871c25 | 1227 | |
1228 | if (fMCEvent){ | |
e5315892 | 1229 | if (fPositiveMCParticle && fNegativeMCParticle ) { |
1230 | if(TMath::Abs(fNegativeMCParticle->GetPdgCode())==211 && TMath::Abs(fPositiveMCParticle->GetPdgCode())==211){ // Pions ... | |
1231 | fHistoTruePionPionInvMassPt[fiCut]->Fill(vParticle->GetMass(),vParticle->Pt()); | |
1232 | if (motherlabeln == motherlabelp){ | |
1233 | fHistoTruePionPionFromSameMotherInvMassPt[fiCut]->Fill(vParticle->GetMass(),vParticle->Pt()); | |
1234 | if( IsEtaPiPlPiMiPiZeroDaughter(labeln) || IsOmegaPiPlPiMiPiZeroDaughter(labeln) ) { | |
1235 | fHistoTruePionPionFromNeutralMesonInvMassPt[fiCut]->Fill(vParticle->GetMass(),vParticle->Pt()); | |
1236 | } | |
1237 | } | |
95bd6d60 | 1238 | } |
1239 | } | |
01871c25 | 1240 | } |
1241 | ||
1242 | ||
cb287740 | 1243 | delete virtualPhoton; |
1244 | virtualPhoton=NULL; | |
1245 | ||
1246 | } | |
1247 | } | |
1248 | } | |
1249 | ||
1250 | //_____________________________________________________________________________ | |
1251 | void AliAnalysisTaskNeutralMesonToPiPlPiMiPiZero::ProcessMCParticles(){ | |
1252 | ||
1253 | // Loop over all primary MC particle | |
1254 | ||
1255 | for(Int_t i = 0; i < fMCStack->GetNprimary(); i++) { | |
1256 | ||
1257 | TParticle* particle = (TParticle *)fMCStack->Particle(i); | |
1258 | if (!particle) continue; | |
1259 | ||
1260 | Int_t isMCFromMBHeader = -1; | |
1261 | if(((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetSignalRejection() != 0){ | |
1262 | isMCFromMBHeader | |
1263 | = ((AliConvEventCuts*)fEventCutArray->At(fiCut))->IsParticleFromBGEvent(i, fMCStack, fInputEvent); | |
1264 | if(isMCFromMBHeader == 0 && ((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetSignalRejection() != 3) continue; | |
1265 | } | |
1266 | ||
1267 | if(((AliConvEventCuts*)fEventCutArray->At(fiCut))->IsParticleFromBGEvent(i, fMCStack,fInputEvent)){ | |
1268 | ||
1269 | // find MC photons | |
1270 | if(((AliConversionPhotonCuts*)fGammaCutArray->At(fiCut))->PhotonIsSelectedMC(particle,fMCStack,kFALSE)){ | |
1271 | fHistoMCAllGammaPt[fiCut]->Fill(particle->Pt()); // All MC Gamma | |
1272 | if(particle->GetMother(0) >-1){ | |
1273 | if (fMCStack->Particle(particle->GetMother(0))->GetPdgCode() ==111){ | |
1274 | if (fMCStack->Particle(particle->GetMother(0))->GetMother(0) > -1){ | |
1275 | if ( fMCStack->Particle((fMCStack->Particle(particle->GetMother(0)))->GetMother(0))->GetPdgCode() == 221 || | |
1276 | fMCStack->Particle((fMCStack->Particle(particle->GetMother(0)))->GetMother(0))->GetPdgCode() == 223 ){ | |
1277 | if ( fMCStack->Particle(particle->GetMother(0))->GetNDaughters()==3 ) | |
1278 | fHistoMCGammaFromNeutralMesonPt[fiCut]->Fill(particle->Pt()); // All photons from eta or omega via pi0 | |
1279 | } | |
1280 | } | |
1281 | } | |
1282 | } | |
1283 | } | |
1284 | ||
1285 | if(((AliConversionPhotonCuts*)fGammaCutArray->At(fiCut))->PhotonIsSelectedMC(particle,fMCStack,kTRUE)){ | |
1286 | fHistoMCConvGammaPt[fiCut]->Fill(particle->Pt()); | |
1287 | } // Converted MC Gamma | |
1288 | ||
1289 | if(((AliPrimaryPionCuts*)fPionCutArray->At(fiCut))->PionIsSelectedMC(i,fMCStack)){ | |
1290 | if( particle->GetPdgCode() == 211){ | |
1291 | fHistoMCAllPosPionsPt[fiCut]->Fill(particle->Pt()); // All pos pions | |
1292 | if(particle->GetMother(0) >-1){ | |
1293 | if (fMCStack->Particle(particle->GetMother(0))->GetPdgCode() ==221 || fMCStack->Particle(particle->GetMother(0))->GetPdgCode() ==223) | |
1294 | fHistoMCPosPionsFromNeutralMesonPt[fiCut]->Fill(particle->Pt()); // All pos from eta or omega | |
1295 | } | |
1296 | } | |
1297 | if( particle->GetPdgCode() == -211){ | |
1298 | fHistoMCAllNegPionsPt[fiCut]->Fill(particle->Pt()); // All neg pions | |
1299 | if(particle->GetMother(0) >-1){ | |
1300 | if (fMCStack->Particle(particle->GetMother(0))->GetPdgCode() ==221 || fMCStack->Particle(particle->GetMother(0))->GetPdgCode() ==223 ) | |
1301 | fHistoMCNegPionsFromNeutralMesonPt[fiCut]->Fill(particle->Pt()); // All pos from eta or omega | |
1302 | } | |
1303 | } | |
1304 | } | |
1305 | ||
1306 | ||
1307 | // \eta -> pi+ pi- \gamma | |
1308 | Int_t labelNeutPion = -1; | |
1309 | Int_t labelNegPion = -1; | |
1310 | Int_t labelPosPion = -1; | |
1311 | ||
1312 | if( ((AliConversionMesonCuts*)fMesonCutArray->At(fiCut))->MesonIsSelectedMCPiPlPiMiPiZero(particle,fMCStack,labelNegPion,labelPosPion,labelNeutPion,((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetEtaShift())){ | |
1313 | Float_t weighted= 1; | |
1314 | if( ((AliPrimaryPionCuts*) fPionCutArray->At(fiCut))->DoWeights() ) { | |
1315 | if(((AliConvEventCuts*)fEventCutArray->At(fiCut))->IsParticleFromBGEvent(i, fMCStack,fInputEvent)){ | |
1316 | if (particle->Pt()>0.005){ | |
1317 | weighted= ((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetWeightForMeson(fV0Reader->GetPeriodName(),i, fMCStack,fInputEvent); | |
1318 | } | |
1319 | } | |
1320 | } | |
1321 | if(particle->GetPdgCode() == 221)fHistoMCEtaPiPlPiMiPiZeroPt[fiCut]->Fill(particle->Pt(), weighted); // All MC Eta in respective decay channel | |
1322 | if(particle->GetPdgCode() == 223)fHistoMCOmegaPiPlPiMiPiZeroPt[fiCut]->Fill(particle->Pt(), weighted); // All MC Omega in respective decay channel | |
1323 | ||
1324 | TParticle *neutPion = fMCStack->Particle(labelNeutPion); | |
1325 | TParticle *gamma1 = fMCStack->Particle(neutPion->GetDaughter(0)); | |
1326 | TParticle *gamma2 = fMCStack->Particle(neutPion->GetDaughter(1)); | |
1327 | if( | |
1328 | ((AliConversionPhotonCuts*)fGammaCutArray->At(fiCut))->PhotonIsSelectedMC(gamma1,fMCStack,kFALSE) && // test first daugther of pi0 | |
1329 | ((AliConversionPhotonCuts*)fGammaCutArray->At(fiCut))->PhotonIsSelectedMC(gamma2,fMCStack,kFALSE) && // test second daughter of pi0 | |
1330 | ((AliPrimaryPionCuts*)fPionCutArray->At(fiCut))->PionIsSelectedMC(labelNegPion,fMCStack) && // test negative pion | |
1331 | ((AliPrimaryPionCuts*)fPionCutArray->At(fiCut))->PionIsSelectedMC(labelPosPion,fMCStack) // test positive pion | |
1332 | ) { | |
1333 | if(particle->GetPdgCode() == 221) fHistoMCEtaPiPlPiMiPiZeroInAccPt[fiCut]->Fill(particle->Pt(), weighted ); // MC Eta pi+ pi- pi0 with gamma's and e+e- in acc | |
1334 | if(particle->GetPdgCode() == 223) fHistoMCOmegaPiPlPiMiPiZeroInAccPt[fiCut]->Fill(particle->Pt(), weighted ); // MC Omega pi+ pi- pi0 with gamma's and e+e- in acc | |
1335 | } | |
1336 | } | |
1337 | } | |
1338 | } | |
1339 | } | |
1340 | ||
1341 | ||
1342 | //________________________________________________________________________ | |
1343 | void AliAnalysisTaskNeutralMesonToPiPlPiMiPiZero::CalculateMesonCandidates(){ | |
1344 | ||
1345 | // Conversion Gammas | |
1346 | if( fNeutralPionCandidates->GetEntries() > 0 && fGoodVirtualParticles->GetEntries() > 0 ){ | |
1347 | ||
1348 | vector<Bool_t> lGoodVirtualParticle(fGoodVirtualParticles->GetEntries(), kFALSE); | |
1349 | ||
1350 | for(Int_t mesonIndex=0; mesonIndex<fNeutralPionCandidates->GetEntries(); mesonIndex++){ | |
f61c548e | 1351 | AliAODConversionMother *neutralPion=dynamic_cast<AliAODConversionMother*>(fNeutralPionCandidates->At(mesonIndex)); |
cb287740 | 1352 | if (neutralPion==NULL) continue; |
1353 | for(Int_t virtualParticleIndex=0;virtualParticleIndex<fGoodVirtualParticles->GetEntries();virtualParticleIndex++){ | |
1354 | ||
1355 | AliAODConversionPhoton *vParticle=dynamic_cast<AliAODConversionPhoton*>(fGoodVirtualParticles->At(virtualParticleIndex)); | |
1356 | if (vParticle==NULL) continue; | |
1357 | //Check for same Electron ID | |
1358 | ||
1359 | AliAODConversionMother *mesoncand = new AliAODConversionMother(neutralPion,vParticle); | |
1360 | mesoncand->SetLabels(mesonIndex,virtualParticleIndex); | |
1361 | ||
1362 | if( ( ((AliConversionMesonCuts*)fMesonCutArray->At(fiCut))->MesonIsSelected(mesoncand,kTRUE,((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetEtaShift())) ){ | |
1363 | ||
1364 | // cout<< "Meson Accepted "<<endl; | |
1365 | ||
1366 | Int_t zbin= fBGHandler[fiCut]->GetZBinIndex(fESDEvent->GetPrimaryVertex()->GetZ()); | |
1367 | Int_t mbin = 0; | |
1368 | if( ((AliConversionMesonCuts*)fMesonCutArray->At(fiCut))->UseTrackMultiplicity()){ | |
1369 | mbin = fBGHandler[fiCut]->GetMultiplicityBinIndex(fNumberOfESDTracks); | |
1370 | } else { | |
1371 | mbin = fBGHandler[fiCut]->GetMultiplicityBinIndex(fGoodGammas->GetEntries()); | |
1372 | } | |
1373 | ||
1374 | AliESDtrack *posPionVParticle = 0; | |
1375 | AliESDtrack *negPionVParticle = 0; | |
1376 | ||
1377 | Double_t clsToFPos = -1.0; | |
1378 | Double_t clsToFNeg = -1.0; | |
1379 | ||
1380 | Float_t dcaToVertexXYPos = -1.0; | |
1381 | Float_t dcaToVertexZPos = -1.0; | |
1382 | Float_t dcaToVertexXYNeg = -1.0; | |
1383 | Float_t dcaToVertexZNeg = -1.0; | |
1384 | ||
1385 | ||
1386 | if ( fDoMesonQA ) { | |
1387 | ||
1388 | fHistoPionPionInvMassPt[fiCut]->Fill( vParticle->GetMass(),vParticle->Pt()); | |
1389 | ||
1390 | posPionVParticle = fESDEvent->GetTrack( vParticle->GetTrackLabelPositive() ); | |
1391 | negPionVParticle = fESDEvent->GetTrack( vParticle->GetTrackLabelNegative() ); | |
1392 | clsToFPos = ((AliPrimaryPionCuts*)fPionCutArray->At(fiCut))->GetNFindableClustersTPC(posPionVParticle); | |
1393 | clsToFNeg = ((AliPrimaryPionCuts*)fPionCutArray->At(fiCut))->GetNFindableClustersTPC(negPionVParticle); | |
1394 | ||
1395 | Float_t bPos[2]; | |
1396 | Float_t bCovPos[3]; | |
1397 | posPionVParticle->GetImpactParameters(bPos,bCovPos); | |
1398 | if (bCovPos[0]<=0 || bCovPos[2]<=0) { | |
1399 | AliDebug(1, "Estimated b resolution lower or equal zero!"); | |
1400 | bCovPos[0]=0; bCovPos[2]=0; | |
1401 | } | |
1402 | ||
1403 | Float_t bNeg[2]; | |
1404 | Float_t bCovNeg[3]; | |
1405 | posPionVParticle->GetImpactParameters(bNeg,bCovNeg); | |
1406 | if (bCovNeg[0]<=0 || bCovNeg[2]<=0) { | |
1407 | AliDebug(1, "Estimated b resolution lower or equal zero!"); | |
1408 | bCovNeg[0]=0; bCovNeg[2]=0; | |
1409 | } | |
1410 | ||
1411 | dcaToVertexXYPos = bPos[0]; | |
1412 | dcaToVertexZPos = bPos[1]; | |
1413 | dcaToVertexXYNeg = bNeg[0]; | |
1414 | dcaToVertexZNeg = bNeg[1]; | |
1415 | } | |
1416 | ||
1417 | fHistoMotherInvMassPt[fiCut]->Fill(mesoncand->M(),mesoncand->Pt()); | |
1418 | Double_t sparesFill[4] = {mesoncand->M(),mesoncand->Pt(),(Double_t)zbin,(Double_t)mbin}; | |
1419 | fTHnSparseMotherInvMassPtZM[fiCut]->Fill(sparesFill,1); | |
1420 | ||
1421 | if ( fDoMesonQA ) { | |
1422 | if( lGoodVirtualParticle[virtualParticleIndex] == kFALSE ) { | |
1423 | ||
1424 | fHistoNegPionEta[fiCut]->Fill( negPionVParticle->Eta() ); | |
1425 | fHistoPosPionEta[fiCut]->Fill( posPionVParticle->Eta() ); | |
1426 | ||
1427 | fHistoNegPionClsTPC[fiCut]->Fill(clsToFNeg,negPionVParticle->Pt()); | |
1428 | fHistoPosPionClsTPC[fiCut]->Fill(clsToFPos,posPionVParticle->Pt()); | |
1429 | ||
1430 | fHistoPionDCAxy[fiCut]->Fill( dcaToVertexXYNeg, negPionVParticle->Pt() ); | |
1431 | fHistoPionDCAz[fiCut]->Fill( dcaToVertexZNeg, negPionVParticle->Pt() ); | |
1432 | fHistoPionDCAxy[fiCut]->Fill( dcaToVertexXYPos, posPionVParticle->Pt() ); | |
1433 | fHistoPionDCAz[fiCut]->Fill( dcaToVertexZPos, posPionVParticle->Pt() ); | |
1434 | ||
1435 | fHistoPionTPCdEdxNSigma[fiCut]->Fill( posPionVParticle->P(),((AliPrimaryPionCuts*)fPionCutArray->At(fiCut))->GetPIDResponse()->NumberOfSigmasTPC(posPionVParticle, AliPID::kPion) ); | |
1436 | fHistoPionTPCdEdxNSigma[fiCut]->Fill( negPionVParticle->P(),((AliPrimaryPionCuts*)fPionCutArray->At(fiCut))->GetPIDResponse()->NumberOfSigmasTPC(negPionVParticle, AliPID::kPion) ); | |
1437 | ||
1438 | fHistoPionTPCdEdx[fiCut]->Fill( posPionVParticle->P(), TMath::Abs(posPionVParticle->GetTPCsignal())); | |
1439 | fHistoPionTPCdEdx[fiCut]->Fill( negPionVParticle->P(), TMath::Abs(negPionVParticle->GetTPCsignal())); | |
1440 | ||
1441 | lGoodVirtualParticle[virtualParticleIndex] = kTRUE; | |
1442 | ||
1443 | } | |
1444 | } | |
1445 | ||
1446 | ||
1447 | if(fMCEvent){ | |
1448 | ProcessTrueMesonCandidates(mesoncand,neutralPion,vParticle); | |
1449 | } | |
1450 | } | |
1451 | delete mesoncand; | |
1452 | mesoncand=0x0; | |
1453 | } | |
1454 | } | |
1455 | } | |
1456 | } | |
1457 | ||
1458 | //________________________________________________________________________ | |
1459 | void AliAnalysisTaskNeutralMesonToPiPlPiMiPiZero::CalculateBackground(){ | |
1460 | ||
1461 | Int_t zbin= fBGHandler[fiCut]->GetZBinIndex(fESDEvent->GetPrimaryVertex()->GetZ()); | |
1462 | Int_t mbin = 0; | |
1463 | ||
1464 | ||
1465 | if(((AliConversionMesonCuts*)fMesonCutArray->At(fiCut))->UseTrackMultiplicity()){ | |
1466 | mbin = fBGHandler[fiCut]->GetMultiplicityBinIndex(fNumberOfESDTracks); | |
1467 | } else { | |
1468 | mbin = fBGHandler[fiCut]->GetMultiplicityBinIndex(fGoodGammas->GetEntries()); | |
1469 | } | |
1470 | ||
1471 | Int_t method = 1; | |
1472 | AliGammaConversionAODBGHandler::GammaConversionVertex *bgEventVertex = NULL; | |
1473 | if( ((AliConversionMesonCuts*)fMesonCutArray->At(fiCut))->UseTrackMultiplicity() ) { | |
1474 | for(Int_t nEventsInBG=0;nEventsInBG<fBGHandler[fiCut]->GetNBGEvents();nEventsInBG++){ | |
f61c548e | 1475 | AliGammaConversionMotherAODVector *previousEventMesons = fBGHandler[fiCut]->GetBGGoodMesons(zbin,mbin,nEventsInBG); |
cb287740 | 1476 | if(fMoveParticleAccordingToVertex == kTRUE && method == 1){ |
1477 | bgEventVertex = fBGHandler[fiCut]->GetBGEventVertex(zbin,mbin,nEventsInBG); | |
1478 | } | |
1479 | ||
1480 | for(Int_t iCurrent=0;iCurrent<fGoodVirtualParticles->GetEntries();iCurrent++){ | |
1481 | AliAODConversionPhoton currentEventGoodV0 = *(AliAODConversionPhoton*)(fGoodVirtualParticles->At(iCurrent)); | |
1482 | ||
f61c548e | 1483 | for(UInt_t iPrevious=0;iPrevious<previousEventMesons->size();iPrevious++){ |
1484 | AliAODConversionMother previousGoodMeson = (AliAODConversionMother)(*(previousEventMesons->at(iPrevious))); | |
cb287740 | 1485 | |
1486 | if(fMoveParticleAccordingToVertex == kTRUE && method == 1 ){ | |
f61c548e | 1487 | MoveParticleAccordingToVertex(&previousGoodMeson,bgEventVertex); |
cb287740 | 1488 | } |
1489 | ||
f61c548e | 1490 | AliAODConversionMother *backgroundCandidate = new AliAODConversionMother(&previousGoodMeson,¤tEventGoodV0); |
cb287740 | 1491 | |
1492 | ||
1493 | if( ( ((AliConversionMesonCuts*)fMesonCutArray->At(fiCut))->MesonIsSelected(backgroundCandidate,kFALSE, ((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetEtaShift()))){ | |
1494 | fHistoMotherBackInvMassPt[fiCut]->Fill(backgroundCandidate->M(),backgroundCandidate->Pt()); | |
1495 | Double_t sparesFill[4] = {backgroundCandidate->M(),backgroundCandidate->Pt(),(Double_t)zbin,(Double_t)mbin}; | |
1496 | fTHnSparseMotherBackInvMassPtZM[fiCut]->Fill(sparesFill,1); | |
1497 | } | |
1498 | delete backgroundCandidate; | |
1499 | backgroundCandidate = 0x0; | |
1500 | } | |
1501 | } | |
1502 | } | |
1503 | } else { | |
1504 | for(Int_t nEventsInBG=0;nEventsInBG <fBGHandler[fiCut]->GetNBGEvents();nEventsInBG++){ | |
f61c548e | 1505 | AliGammaConversionMotherAODVector *previousEventMesons = fBGHandler[fiCut]->GetBGGoodMesons(zbin,mbin,nEventsInBG); |
1506 | if(previousEventMesons){ | |
cb287740 | 1507 | if(fMoveParticleAccordingToVertex == kTRUE && method == 1){ |
1508 | bgEventVertex = fBGHandler[fiCut]->GetBGEventVertex(zbin,mbin,nEventsInBG); | |
1509 | } | |
1510 | for(Int_t iCurrent=0;iCurrent<fGoodVirtualParticles->GetEntries();iCurrent++){ | |
1511 | ||
1512 | AliAODConversionPhoton currentEventGoodV0 = *(AliAODConversionPhoton*)(fGoodVirtualParticles->At(iCurrent)); | |
1513 | ||
f61c548e | 1514 | for(UInt_t iPrevious=0;iPrevious<previousEventMesons->size();iPrevious++){ |
cb287740 | 1515 | |
f61c548e | 1516 | AliAODConversionMother previousGoodMeson = (AliAODConversionMother)(*(previousEventMesons->at(iPrevious))); |
cb287740 | 1517 | |
1518 | if(fMoveParticleAccordingToVertex == kTRUE && method ==1){ | |
f61c548e | 1519 | MoveParticleAccordingToVertex(&previousGoodMeson,bgEventVertex); |
cb287740 | 1520 | } |
1521 | ||
f61c548e | 1522 | AliAODConversionMother *backgroundCandidate = new AliAODConversionMother(&previousGoodMeson,¤tEventGoodV0); |
cb287740 | 1523 | |
1524 | if((((AliConversionMesonCuts*)fMesonCutArray->At(fiCut))->MesonIsSelected(backgroundCandidate,kFALSE,((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetEtaShift()))){ | |
1525 | fHistoMotherBackInvMassPt[fiCut]->Fill(backgroundCandidate->M(),backgroundCandidate->Pt()); | |
1526 | Double_t sparesFill[4] = {backgroundCandidate->M(),backgroundCandidate->Pt(),(Double_t)zbin,(Double_t)mbin}; | |
1527 | fTHnSparseMotherBackInvMassPtZM[fiCut]->Fill(sparesFill,1); | |
1528 | } | |
1529 | delete backgroundCandidate; | |
1530 | backgroundCandidate = 0x0; | |
1531 | } | |
1532 | } | |
1533 | } | |
1534 | } | |
1535 | } | |
1536 | } | |
1537 | ||
1538 | //______________________________________________________________________ | |
1539 | void AliAnalysisTaskNeutralMesonToPiPlPiMiPiZero::ProcessTrueMesonCandidates(AliAODConversionMother *mesoncand, AliAODConversionMother *TrueNeutralPionCandidate, AliAODConversionPhoton *TrueVirtualParticleCandidate){ | |
1540 | ||
eed82f0e | 1541 | // Process True Mesons |
1542 | AliStack *MCStack = fMCEvent->Stack(); | |
1543 | ||
1544 | Bool_t isTrueEta = kFALSE; | |
1545 | Bool_t isTrueOmega = kFALSE; | |
1546 | Int_t trueMesonFlag = TrueNeutralPionCandidate->GetTrueMesonValue(); | |
1547 | Int_t pi0MCLabel= TrueNeutralPionCandidate->GetMCLabel(); | |
1548 | ||
1549 | ||
1550 | if ( !(trueMesonFlag == 1 && pi0MCLabel != -1)) return; | |
1551 | // cout << trueMesonFlag << "\t" << pi0MCLabel << endl; | |
1552 | ||
1553 | ||
1554 | Int_t virtualParticleMCLabel = TrueVirtualParticleCandidate->GetMCParticleLabel(MCStack); | |
1555 | Int_t virtualParticleMotherLabel = -1; | |
1556 | ||
1557 | Bool_t isPiPiDecay = kFALSE; | |
1558 | ||
358b4979 | 1559 | // if (fDoMesonQA){ |
eed82f0e | 1560 | TParticle * negativeMC = (TParticle*)TrueVirtualParticleCandidate->GetNegativeMCDaughter(MCStack); |
1561 | TParticle * positiveMC = (TParticle*)TrueVirtualParticleCandidate->GetPositiveMCDaughter(MCStack); | |
358b4979 | 1562 | // } |
eed82f0e | 1563 | |
1564 | if(virtualParticleMCLabel != -1){ // if virtualParticleMCLabel==-1 particles don't have same mother | |
358b4979 | 1565 | // TParticle * negativeMC = (TParticle*)TrueVirtualParticleCandidate->GetNegativeMCDaughter(MCStack); |
1566 | // TParticle * positiveMC = (TParticle*)TrueVirtualParticleCandidate->GetPositiveMCDaughter(MCStack); | |
eed82f0e | 1567 | // TParticle * virtualParticleMotherMC = (TParticle*)MCStack->Particle(virtualParticleMCLabel); |
1568 | // cout << "pdg code same mother - " << virtualParticleMotherMC->GetPdgCode() << endl; | |
1569 | ||
1570 | if(TMath::Abs(negativeMC->GetPdgCode())==211 && TMath::Abs(positiveMC->GetPdgCode())==211){ // Pions ... | |
1571 | virtualParticleMotherLabel=virtualParticleMCLabel; | |
1572 | isPiPiDecay=kTRUE; | |
1573 | // } else if(TMath::Abs(negativeMC->GetPdgCode())==11 && TMath::Abs(positiveMC->GetPdgCode())==11){ // Electrons ... | |
1574 | // if( virtualParticleMotherMC->GetPdgCode() != 22 ){ | |
1575 | // virtualParticleMotherLabel=virtualParticleMCLabel; | |
1576 | // isDalitz = kTRUE; | |
1577 | // } else if(negativeMC->GetUniqueID() == 5 && positiveMC->GetUniqueID() ==5){ // ... From Conversion ... | |
1578 | // virtualParticleMotherLabel=virtualParticleMotherMC->GetFirstMother(); | |
1579 | // isRealGamma = kTRUE; //no virtual gamma | |
cb287740 | 1580 | // } |
eed82f0e | 1581 | } |
1582 | } | |
1583 | ||
1584 | if( pi0MCLabel == virtualParticleMotherLabel ){ | |
1585 | if(((TParticle*)MCStack->Particle(virtualParticleMotherLabel))->GetPdgCode() == 221){ | |
1586 | isTrueEta=kTRUE; | |
1587 | } | |
1588 | if(((TParticle*)MCStack->Particle(virtualParticleMotherLabel))->GetPdgCode() == 223){ | |
1589 | isTrueOmega=kTRUE; | |
1590 | } | |
1591 | } | |
1592 | ||
1593 | if( isTrueEta || isTrueOmega ){ // True Eta or Omega | |
1594 | if ( isPiPiDecay) { //real eta -> Pi+ Pi- Pi0 | |
1595 | Float_t weighted= 1; | |
cb287740 | 1596 | // if( ((AliPrimaryPionCuts*) fPionCutArray->At(fiCut))->DoWeights() ) { |
1597 | // if(((AliConvEventCuts*)fEventCutArray->At(fiCut))->IsParticleFromBGEvent(gammaMotherLabel, fMCStack,fInputEvent)){ | |
1598 | // if (((TParticle*)MCStack->Particle(gammaMotherLabel))->Pt()>0.005){ | |
1599 | // weighted= ((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetWeightForMeson(fV0Reader->GetPeriodName(),gammaMotherLabel,fMCStack,fInputEvent); | |
1600 | // } | |
1601 | // } | |
1602 | // } | |
eed82f0e | 1603 | fHistoTrueMotherPiPlPiMiPiZeroInvMassPt[fiCut]->Fill(mesoncand->M(),mesoncand->Pt(),weighted); |
1604 | } | |
1605 | } | |
cb287740 | 1606 | |
1607 | } | |
1608 | ||
1609 | ||
1610 | //________________________________________________________________________ | |
1611 | void AliAnalysisTaskNeutralMesonToPiPlPiMiPiZero::UpdateEventByEventData(){ | |
1612 | //see header file for documentation | |
1613 | ||
1614 | Int_t method = 1; | |
1615 | if( method == 1 ) { | |
f61c548e | 1616 | if(fNeutralPionCandidates->GetEntries() >0 ){ |
cb287740 | 1617 | if(((AliConversionMesonCuts*)fMesonCutArray->At(fiCut))->UseTrackMultiplicity()){ |
f61c548e | 1618 | fBGHandler[fiCut]->AddMesonEvent(fNeutralPionCandidates,fInputEvent->GetPrimaryVertex()->GetX(),fInputEvent->GetPrimaryVertex()->GetY(),fInputEvent->GetPrimaryVertex()->GetZ(),fV0Reader->GetNumberOfPrimaryTracks(),0); |
cb287740 | 1619 | } else{ // means we use #V0s for multiplicity |
f61c548e | 1620 | fBGHandler[fiCut]->AddMesonEvent(fNeutralPionCandidates,fInputEvent->GetPrimaryVertex()->GetX(),fInputEvent->GetPrimaryVertex()->GetY(),fInputEvent->GetPrimaryVertex()->GetZ(),fGoodGammas->GetEntries(),0); |
cb287740 | 1621 | } |
1622 | } | |
1623 | } else if ( method == 2 ){ | |
1624 | if(fGoodVirtualParticles->GetEntries() > 0 ){ | |
1625 | if(((AliConversionMesonCuts*)fMesonCutArray->At(fiCut))->UseTrackMultiplicity()){ | |
1626 | fBGHandler[fiCut]->AddEvent(fGoodVirtualParticles,fInputEvent->GetPrimaryVertex()->GetX(),fInputEvent->GetPrimaryVertex()->GetY(),fInputEvent->GetPrimaryVertex()->GetZ(),fV0Reader->GetNumberOfPrimaryTracks(),0); | |
1627 | } else{ // means we use #V0s for multiplicity | |
1628 | fBGHandler[fiCut]->AddEvent(fGoodVirtualParticles,fInputEvent->GetPrimaryVertex()->GetX(),fInputEvent->GetPrimaryVertex()->GetY(),fInputEvent->GetPrimaryVertex()->GetZ(),fGoodVirtualParticles->GetEntries(),0); | |
1629 | } | |
1630 | } | |
1631 | } | |
1632 | } | |
1633 | ||
1634 | //________________________________________________________________________ | |
f61c548e | 1635 | void AliAnalysisTaskNeutralMesonToPiPlPiMiPiZero::MoveParticleAccordingToVertex(AliAODConversionMother* particle,const AliGammaConversionAODBGHandler::GammaConversionVertex *vertex){ |
cb287740 | 1636 | //see header file for documentation |
1637 | ||
1638 | Double_t dx = vertex->fX - fInputEvent->GetPrimaryVertex()->GetX(); | |
1639 | Double_t dy = vertex->fY - fInputEvent->GetPrimaryVertex()->GetY(); | |
1640 | Double_t dz = vertex->fZ - fInputEvent->GetPrimaryVertex()->GetZ(); | |
1641 | ||
f61c548e | 1642 | Double_t movedPlace[3] = {particle->GetProductionX() - dx,particle->GetProductionY() - dy,particle->GetProductionZ() - dz}; |
1643 | particle->SetProductionPoint(movedPlace); | |
cb287740 | 1644 | } |
1645 | ||
1646 | //_____________________________________________________________________________________ | |
1647 | Bool_t AliAnalysisTaskNeutralMesonToPiPlPiMiPiZero::IsEtaPiPlPiMiPiZeroDaughter( Int_t label ) const { | |
1648 | // | |
1649 | // Returns true if the particle comes from eta -> pi+ pi- gamma | |
1650 | // | |
1651 | Int_t motherLabel = fMCStack->Particle( label )->GetMother(0); | |
1652 | if( motherLabel < 0 || motherLabel >= fMCStack->GetNtrack() ) return kFALSE; | |
1653 | ||
1654 | TParticle* mother = fMCStack->Particle( motherLabel ); | |
6671ffac | 1655 | // cout << "found eta? " << endl; |
cb287740 | 1656 | if( mother->GetPdgCode() != 221 ) return kFALSE; |
6671ffac | 1657 | // else cout << "YES" << endl; |
cb287740 | 1658 | if( IsPiPlPiMiPiZeroDecay( mother ) ) return kTRUE; |
1659 | return kFALSE; | |
1660 | } | |
1661 | ||
1662 | //_____________________________________________________________________________________ | |
1663 | Bool_t AliAnalysisTaskNeutralMesonToPiPlPiMiPiZero::IsOmegaPiPlPiMiPiZeroDaughter( Int_t label ) const { | |
1664 | // | |
1665 | // Returns true if the particle comes from eta -> pi+ pi- gamma | |
1666 | // | |
1667 | Int_t motherLabel = fMCStack->Particle( label )->GetMother(0); | |
1668 | if( motherLabel < 0 || motherLabel >= fMCStack->GetNtrack() ) return kFALSE; | |
1669 | ||
1670 | TParticle* mother = fMCStack->Particle( motherLabel ); | |
6671ffac | 1671 | // cout << "found omega? " << endl; |
cb287740 | 1672 | if( mother->GetPdgCode() != 223 ) return kFALSE; |
6671ffac | 1673 | // else cout << "YES" << endl; |
cb287740 | 1674 | if( IsPiPlPiMiPiZeroDecay( mother ) ) return kTRUE; |
1675 | return kFALSE; | |
1676 | } | |
1677 | ||
1678 | ||
1679 | //_____________________________________________________________________________ | |
1680 | Bool_t AliAnalysisTaskNeutralMesonToPiPlPiMiPiZero::IsPiPlPiMiPiZeroDecay(TParticle *fMCMother) const | |
1681 | { | |
6671ffac | 1682 | // cout << fMCMother->GetNDaughters() << endl; |
cb287740 | 1683 | if( fMCMother->GetNDaughters() != 3 ) return kFALSE; |
6671ffac | 1684 | // cout << fMCMother->GetPdgCode() << endl; |
1685 | if( !(fMCMother->GetPdgCode() == 221 || fMCMother->GetPdgCode() == 223) ) return kFALSE; | |
1686 | // cout << "made it til here" << endl; | |
cb287740 | 1687 | |
1688 | TParticle *posPion = 0x0; | |
1689 | TParticle *negPion = 0x0; | |
1690 | TParticle *neutPion = 0x0; | |
1691 | ||
1692 | for(Int_t index= fMCMother->GetFirstDaughter();index<= fMCMother->GetLastDaughter();index++){ | |
1693 | TParticle* temp = (TParticle*)fMCStack->Particle( index ); | |
1694 | ||
1695 | switch( temp->GetPdgCode() ) { | |
1696 | case 211: | |
1697 | posPion = temp; | |
1698 | break; | |
1699 | case -211: | |
1700 | negPion = temp; | |
1701 | break; | |
1702 | case 111: | |
1703 | neutPion = temp; | |
1704 | break; | |
1705 | } | |
1706 | } | |
1707 | ||
1708 | if( posPion && negPion && neutPion) return kTRUE; | |
1709 | ||
1710 | return kFALSE; | |
1711 | } | |
6671ffac | 1712 | |
1713 | //_____________________________________________________________________________________ | |
1714 | Bool_t AliAnalysisTaskNeutralMesonToPiPlPiMiPiZero::GammaIsNeutralMesonPiPlPiMiPiZeroDaughter( Int_t label ) const { | |
1715 | // | |
1716 | // Returns true if the particle comes from eta -> pi+ pi- gamma | |
1717 | // | |
1718 | Int_t motherLabel = fMCStack->Particle( label )->GetMother(0); | |
1719 | if( motherLabel < 0 || motherLabel >= fMCStack->GetNtrack() ) return kFALSE; | |
1720 | ||
1721 | TParticle* mother = fMCStack->Particle( motherLabel ); | |
1722 | // cout << "found omega? " << endl; | |
1723 | if( mother->GetPdgCode() != 111 ) return kFALSE; | |
1724 | // else cout << "YES" << endl; | |
1725 | Int_t grandMotherLabel = mother->GetMother(0); | |
1726 | if( grandMotherLabel < 0 || grandMotherLabel >= fMCStack->GetNtrack() ) return kFALSE; | |
1727 | TParticle* grandmother = fMCStack->Particle( grandMotherLabel ); | |
1728 | ||
1729 | if( IsPiPlPiMiPiZeroDecay( grandmother ) ) return kTRUE; | |
1730 | return kFALSE; | |
1731 | } |