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