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