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