AliPhysics  d565ceb (d565ceb)
AliAnalysisTaskMaterialHistos.cxx
Go to the documentation of this file.
1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3 * *
4 * Authors: Friederike Bock *
5 * Version 1.0 *
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 
17 //---------------------------------------------
18 // QA Task for V0 Reader V1
19 //---------------------------------------------
21 
23 #include "TChain.h"
24 #include "AliAnalysisManager.h"
25 #include "TParticle.h"
26 #include "TVectorF.h"
27 #include "AliPIDResponse.h"
28 #include "AliESDtrackCuts.h"
29 #include "TFile.h"
30 
31 class iostream;
32 
33 using namespace std;
34 
36 
38  fV0Reader(NULL),
39  fV0ReaderName("V0ReaderV1"),
40  fConversionGammas(NULL),
41  fGammaCandidates(NULL),
42  fConversionCutArray(NULL),
43  fEventCutArray(NULL),
44  fCutFolder(NULL),
45  fESDList(NULL),
46  fTrueList(NULL),
47  fMCList(NULL),
48  fOutputList(NULL),
49  fAllMCGammaList(NULL),
50  fAllMCConvGammaList(NULL),
51  fPrimVtxZ(0.),
52  fNContrVtx(0),
53  fNESDtracksEta09(0),
54  fNESDtracksEta0914(0),
55  fNESDtracksEta14(0),
56  fGammaMCPt(0.),
57  fGammaMCTheta(0.),
58  fGammaMCConvPt(0.),
59  fGammaMCConvTheta(0.),
60  fGammaPt(0.),
61  fGammaTheta(0.),
62  fGammaChi2NDF(0.),
63  fKind(0),
64  fIsHeavyIon(0),
65  fIsMC(0),
66  fInputEvent(NULL),
67  fMCEvent(NULL),
68  fnCuts(0),
69  fiCut(0),
70  hNEvents(NULL),
71  hNGoodESDTracksEta09(NULL),
72  hNGoodESDTracksEta14(NULL),
73  hNGoodESDTracksEta09_14(NULL),
74  hESDConversionRPhi(NULL),
75  hESDConversionRZ(NULL),
76  hESDConversionRPt(NULL),
77  hESDConversionREta(NULL),
78  hESDConversionDCA(NULL),
79  hESDConversionPsiPair(NULL),
80  hESDConversionChi2(NULL),
81  hESDConversionMass(NULL),
82  hESDConversionRRejSmall(NULL),
83  hESDConversionRRejLarge(NULL),
84  hElectronRdEdx(NULL),
85  hElectronRNSigmadEdx(NULL),
86  hPositronRdEdx(NULL),
87  hPositronRNSigmadEdx(NULL),
88  hMCConversionRPhi(NULL),
89  hMCConversionRPt(NULL),
90  hMCConversionREta(NULL),
91  hMCConversionRRejSmall(NULL),
92  hMCConversionRRejLarge(NULL),
93  hMCAllGammaPt(NULL),
94  hMCTrueConversionRPhi(NULL),
95  hMCTrueConversionRZ(NULL),
96  hMCTrueConversionRPt(NULL),
97  hMCTrueConversionREta(NULL),
98  hMCTrueConversionDCA(NULL),
99  hMCTrueConversionPsiPair(NULL),
100  hMCTrueConversionChi2(NULL),
101  hMCTrueConversionMass(NULL),
102  hMCTrueConversionRRejSmall(NULL),
103  hMCTrueConversionRRejLarge(NULL),
104  hMCTruePi0DalConversionRPt(NULL),
105  hMCTruePi0DalConversionEta(NULL),
106  hMCTrueEtaDalConversionRPt(NULL),
107  hMCTrueEtaDalConversionEta(NULL),
108  hMCTrueCombinatorialConversionRPt(NULL),
109  hMCTrueCombinatorialConversionEta(NULL)
110 {
111 
112 }
113 
114 
115 //________________________________________________________________________
117  fV0Reader(NULL),
118  fV0ReaderName("V0ReaderV1"),
119  fConversionGammas(NULL),
120  fGammaCandidates(NULL),
121  fConversionCutArray(NULL),
122  fEventCutArray(NULL),
123  fCutFolder(NULL),
124  fESDList(NULL),
125  fTrueList(NULL),
126  fMCList(NULL),
127  fOutputList(NULL),
128  fAllMCGammaList(NULL),
129  fAllMCConvGammaList(NULL),
130  fPrimVtxZ(0.),
131  fNContrVtx(0),
132  fNESDtracksEta09(0),
133  fNESDtracksEta0914(0),
134  fNESDtracksEta14(0),
135  fGammaMCPt(0.),
136  fGammaMCTheta(0.),
137  fGammaMCConvPt(0.),
138  fGammaMCConvTheta(0.),
139  fGammaPt(0.),
140  fGammaTheta(0.),
141  fGammaChi2NDF(0.),
142  fKind(0),
143  fIsHeavyIon(0),
144  fIsMC(0),
145  fInputEvent(NULL),
146  fMCEvent(NULL),
147  fnCuts(0),
148  fiCut(0),
149  hNEvents(NULL),
150  hNGoodESDTracksEta09(NULL),
151  hNGoodESDTracksEta14(NULL),
152  hNGoodESDTracksEta09_14(NULL),
153  hESDConversionRPhi(NULL),
154  hESDConversionRZ(NULL),
155  hESDConversionRPt(NULL),
156  hESDConversionREta(NULL),
157  hESDConversionDCA(NULL),
158  hESDConversionPsiPair(NULL),
159  hESDConversionChi2(NULL),
160  hESDConversionMass(NULL),
161  hESDConversionRRejSmall(NULL),
162  hESDConversionRRejLarge(NULL),
163  hElectronRdEdx(NULL),
164  hElectronRNSigmadEdx(NULL),
165  hPositronRdEdx(NULL),
166  hPositronRNSigmadEdx(NULL),
167  hMCConversionRPhi(NULL),
168  hMCConversionRPt(NULL),
169  hMCConversionREta(NULL),
170  hMCConversionRRejSmall(NULL),
171  hMCConversionRRejLarge(NULL),
172  hMCAllGammaPt(NULL),
173  hMCTrueConversionRPhi(NULL),
174  hMCTrueConversionRZ(NULL),
175  hMCTrueConversionRPt(NULL),
176  hMCTrueConversionREta(NULL),
177  hMCTrueConversionDCA(NULL),
178  hMCTrueConversionPsiPair(NULL),
179  hMCTrueConversionChi2(NULL),
180  hMCTrueConversionMass(NULL),
181  hMCTrueConversionRRejSmall(NULL),
182  hMCTrueConversionRRejLarge(NULL),
183  hMCTruePi0DalConversionRPt(NULL),
184  hMCTruePi0DalConversionEta(NULL),
185  hMCTrueEtaDalConversionRPt(NULL),
186  hMCTrueEtaDalConversionEta(NULL),
187  hMCTrueCombinatorialConversionRPt(NULL),
188  hMCTrueCombinatorialConversionEta(NULL)
189 {
190  // Default constructor
191 
192  DefineInput(0, TChain::Class());
193  DefineOutput(1, TList::Class());
194 }
195 
196 //________________________________________________________________________
198 {
199  // default deconstructor
200  if(fGammaCandidates){
201  delete fGammaCandidates;
202  fGammaCandidates = 0x0;
203  }
204 }
205 //________________________________________________________________________
207 {
208  // Create User Output Objects
209 
210  if(fOutputList != NULL){
211  delete fOutputList;
212  fOutputList = NULL;
213  }
214  if(fOutputList == NULL){
215  fOutputList = new TList();
216  fOutputList->SetOwner(kTRUE);
217  }
218 
219  // Array of current cut's gammas
220 
221  fGammaCandidates = new TList();
222  fCutFolder = new TList*[fnCuts];
223  fESDList = new TList*[fnCuts];
224  fMCList = new TList*[fnCuts];
225  fTrueList = new TList*[fnCuts];
226 
227  hNEvents = new TH1F*[fnCuts];
228  hNGoodESDTracksEta09 = new TH1F*[fnCuts];
229  hNGoodESDTracksEta14 = new TH1F*[fnCuts];
230  hNGoodESDTracksEta09_14 = new TH1F*[fnCuts];
232  hESDConversionRZ = new TH2F*[fnCuts];
233  hESDConversionRPt = new TH2F*[fnCuts];
235  hESDConversionDCA = new TH1F*[fnCuts];
236  hESDConversionPsiPair = new TH1F*[fnCuts];
237  hESDConversionChi2 = new TH1F*[fnCuts];
238  hESDConversionMass = new TH1F*[fnCuts];
239  hESDConversionRRejLarge = new TH1F*[fnCuts];
240  hESDConversionRRejSmall = new TH1F*[fnCuts];
241 
242  hElectronRdEdx = new TH2F*[fnCuts];
244  hPositronRdEdx = new TH2F*[fnCuts];
246 
247  hMCConversionRPhi = new TH2F*[fnCuts];
248  hMCConversionRPt = new TH2F*[fnCuts];
249  hMCConversionREta = new TH2F*[fnCuts];
250  hMCConversionRRejLarge = new TH1F*[fnCuts];
251  hMCConversionRRejSmall = new TH1F*[fnCuts];
252  hMCAllGammaPt = new TH1F*[fnCuts];
253 
258  hMCTrueConversionDCA = new TH1F*[fnCuts];
259  hMCTrueConversionPsiPair = new TH1F*[fnCuts];
260  hMCTrueConversionChi2 = new TH1F*[fnCuts];
261  hMCTrueConversionMass = new TH1F*[fnCuts];
262  hMCTrueConversionRRejLarge = new TH1F*[fnCuts];
263  hMCTrueConversionRRejSmall = new TH1F*[fnCuts];
264 
266  hMCTruePi0DalConversionEta = new TH1F*[fnCuts];
268  hMCTrueEtaDalConversionEta = new TH1F*[fnCuts];
271 
272 
273  for(Int_t iCut = 0; iCut<fnCuts;iCut++){
274 
275 
276  TString cutstringEvent = ((AliConvEventCuts*)fEventCutArray->At(iCut))->GetCutNumber();
277  TString cutstringPhoton = ((AliConversionPhotonCuts*)fConversionCutArray->At(iCut))->GetCutNumber();
278  fCutFolder[iCut] = new TList();
279  fCutFolder[iCut]->SetName(Form("Cut Number %s_%s",cutstringEvent.Data() ,cutstringPhoton.Data()));
280  fCutFolder[iCut]->SetOwner(kTRUE);
281  fOutputList->Add(fCutFolder[iCut]);
282 
283  fESDList[iCut] = new TList();
284  fESDList[iCut]->SetName(Form("%s_%s ESD histograms",cutstringEvent.Data() ,cutstringPhoton.Data()));
285  fESDList[iCut]->SetOwner(kTRUE);
286  fCutFolder[iCut]->Add(fESDList[iCut]);
287 
288  Int_t nBinsR=400;
289 // Int_t nBinsX=2000;
290 // Int_t nBinsY=2000;
291  Int_t nBinsZ=750;
292  Int_t nBinsPhi=750;
293  Int_t nBinsEta=2000;
294  Int_t nBinsPt=400;
295 
296  hNEvents[iCut] = new TH1F("NEvents","NEvents",14,-0.5,13.5);
297  hNEvents[iCut]->GetXaxis()->SetBinLabel(1,"Accepted");
298  hNEvents[iCut]->GetXaxis()->SetBinLabel(2,"Centrality");
299  hNEvents[iCut]->GetXaxis()->SetBinLabel(3,"Miss. MC or inc. ev.");
300  if (((AliConvEventCuts*)fEventCutArray->At(iCut))->IsSpecialTrigger() > 1 ){
301  TString TriggerNames = "Not Trigger: ";
302  TriggerNames = TriggerNames+ ( (AliConvEventCuts*)fEventCutArray->At(iCut))->GetSpecialTriggerName();
303  hNEvents[iCut]->GetXaxis()->SetBinLabel(4,TriggerNames.Data());
304  } else {
305  hNEvents[iCut]->GetXaxis()->SetBinLabel(4,"Trigger");
306  }
307  hNEvents[iCut]->GetXaxis()->SetBinLabel(5,"Vertex Z");
308  hNEvents[iCut]->GetXaxis()->SetBinLabel(6,"Cont. Vertex");
309  hNEvents[iCut]->GetXaxis()->SetBinLabel(7,"Pile-Up");
310  hNEvents[iCut]->GetXaxis()->SetBinLabel(8,"no SDD");
311  hNEvents[iCut]->GetXaxis()->SetBinLabel(9,"no V0AND");
312  hNEvents[iCut]->GetXaxis()->SetBinLabel(10,"EMCAL problem");
313  hNEvents[iCut]->GetXaxis()->SetBinLabel(11,"rejectedForJetJetMC");
314  hNEvents[iCut]->GetXaxis()->SetBinLabel(12,"SPD hits vs tracklet");
315  hNEvents[iCut]->GetXaxis()->SetBinLabel(13,"Out-of-Bunch pileup Past-Future");
316  hNEvents[iCut]->GetXaxis()->SetBinLabel(14,"Pileup V0M-TPCout Tracks");
317  fESDList[iCut]->Add(hNEvents[iCut]);
318 
319 
320  hNGoodESDTracksEta09[iCut] = new TH1F("GoodESDTracksEta09","GoodESDTracksEta09",4000,0,4000);
321  fESDList[iCut]->Add(hNGoodESDTracksEta09[iCut]);
322  hNGoodESDTracksEta14[iCut] = new TH1F("GoodESDTracksEta14","GoodESDTracksEta14",4000,0,4000);
323  fESDList[iCut]->Add(hNGoodESDTracksEta14[iCut]);
324  hNGoodESDTracksEta09_14[iCut] = new TH1F("GoodESDTracksEta09_14","GoodESDTracksEta09_14",4000,0,4000);
325  fESDList[iCut]->Add(hNGoodESDTracksEta09_14[iCut]);
326 
327  hESDConversionRPhi[iCut] = new TH2F("ESD_Conversion_RPhi","ESD_Conversion_RPhi",nBinsPhi,0.,2*TMath::Pi(),nBinsR,0.,200.);
328  fESDList[iCut]->Add(hESDConversionRPhi[iCut]);
329  hESDConversionREta[iCut] = new TH2F("ESD_Conversion_REta","ESD_Conversion_REta",nBinsEta,-2.,2.,nBinsR,0.,200.);
330  fESDList[iCut]->Add(hESDConversionREta[iCut]);
331  hESDConversionRPt[iCut] = new TH2F("ESD_Conversion_RPt","ESD_Conversion_RPt",nBinsPt,0.,20.,nBinsR,0.,200.);
332  fESDList[iCut]->Add(hESDConversionRPt[iCut]);
333  hESDConversionRZ[iCut] = new TH2F("ESD_Conversion_RZ","ESD_Conversion_RZ",nBinsZ,-180.,180.,nBinsR,0.,200.);
334  fESDList[iCut]->Add(hESDConversionRZ[iCut]);
335 
336  hElectronRdEdx[iCut] = new TH2F("Electron_RdEdx","Electron_RdEdx",200,0.,200.,nBinsR,0.,200.);
337  fESDList[iCut]->Add(hElectronRdEdx[iCut]);
338  hElectronRNSigmadEdx[iCut] = new TH2F("Electron_RNSigmadEdx","Electron_RNSigmadEdx",200,-10.,10.,nBinsR,0.,200.);
339  fESDList[iCut]->Add(hElectronRNSigmadEdx[iCut]);
340  hPositronRdEdx[iCut] = new TH2F("Positron_RdEdx","Positron_RdEdx",200,0.,200.,nBinsR,0.,200.);
341  fESDList[iCut]->Add(hPositronRdEdx[iCut]);
342  hPositronRNSigmadEdx[iCut] = new TH2F("Positron_RNSigmadEdx","Positron_RNSigmadEdx",200,-10.,10.,nBinsR,0.,200.);
343  fESDList[iCut]->Add(hPositronRNSigmadEdx[iCut]);
344 
345  hESDConversionDCA[iCut] = new TH1F("ESD_Conversion_DCA","ESD_Conversion_DCA",400,0.,5.);
346  fESDList[iCut]->Add(hESDConversionDCA[iCut]);
347  hESDConversionPsiPair[iCut] = new TH1F("ESD_Conversion_PsiPair","ESD_Conversion_PsiPair",400,0.,5.);
348  fESDList[iCut]->Add(hESDConversionPsiPair[iCut]);
349  hESDConversionChi2[iCut] = new TH1F("ESD_Conversion_Chi2","ESD_Conversion_Chi2",400,0.,50.);
350  fESDList[iCut]->Add(hESDConversionChi2[iCut]);
351  hESDConversionMass[iCut] = new TH1F("ESD_Conversion_Mass","ESD_Conversion_Mass",400,0.,1.);
352  fESDList[iCut]->Add(hESDConversionMass[iCut]);
353 
354  hESDConversionRRejLarge[iCut] = new TH1F("ESD_Conversion_RLarge","ESD_Conversion_RLarge",nBinsR,0.,200.);
355  fESDList[iCut]->Add(hESDConversionRRejLarge[iCut]);
356  hESDConversionRRejSmall[iCut] = new TH1F("ESD_Conversion_RSmall","ESD_Conversion_RSmall",nBinsR,0.,200.);
357  fESDList[iCut]->Add(hESDConversionRRejSmall[iCut]);
358 
359  if (fIsMC>0) {
360 
361  fMCList[iCut] = new TList();
362  fMCList[iCut]->SetName(Form("%s_%s MC histograms",cutstringEvent.Data() ,cutstringPhoton.Data()));
363  fMCList[iCut]->SetOwner(kTRUE);
364  fCutFolder[iCut]->Add(fMCList[iCut]);
365 
366  fTrueList[iCut] = new TList();
367  fTrueList[iCut]->SetName(Form("%s_%s True histograms",cutstringEvent.Data() ,cutstringPhoton.Data()));
368  fTrueList[iCut]->SetOwner(kTRUE);
369  fCutFolder[iCut]->Add(fTrueList[iCut]);
370 
371  hMCAllGammaPt[iCut] = new TH1F("MC_AllGamma_Pt","MC_AllGamma_Pt",nBinsPt,0.,20.);
372  fMCList[iCut]->Add(hMCAllGammaPt[iCut]);
373 
374  hMCConversionRPhi[iCut] = new TH2F("MC_Conversion_RPhi","MC_Conversion_RPhi",nBinsPhi,0.,2*TMath::Pi(),nBinsR,0.,200.);
375  fMCList[iCut]->Add(hMCConversionRPhi[iCut]);
376  hMCConversionREta[iCut] = new TH2F("MC_Conversion_REta","MC_Conversion_REta",nBinsEta,-2.,2.,nBinsR,0.,200.);
377  fMCList[iCut]->Add(hMCConversionREta[iCut]);
378  hMCConversionRPt[iCut] = new TH2F("MC_Conversion_RPt","MC_Conversion_RPt",nBinsPt,0.,20.,nBinsR,0.,200.);
379  fMCList[iCut]->Add(hMCConversionRPt[iCut]);
380  hMCConversionRRejLarge[iCut] = new TH1F("MC_Conversion_RLarge","MC_Conversion_RLarge",nBinsR,0.,200.);
381  fESDList[iCut]->Add(hMCConversionRRejLarge[iCut]);
382  hMCConversionRRejSmall[iCut] = new TH1F("MC_Conversion_RSmall","MC_Conversion_RSmall",nBinsR,0.,200.);
383  fESDList[iCut]->Add(hMCConversionRRejSmall[iCut]);
384 
385  hMCTrueConversionRPhi[iCut] = new TH2F("ESD_TrueConversion_RPhi","ESD_TrueConversion_RPhi",nBinsPhi,0.,2*TMath::Pi(),nBinsR,0.,200.);
386  fTrueList[iCut]->Add(hMCTrueConversionRPhi[iCut]);
387  hMCTrueConversionREta[iCut] = new TH2F("ESD_TrueConversion_REta","ESD_TrueConversion_REta",nBinsEta,-2.,2.,nBinsR,0.,200.);
388  fTrueList[iCut]->Add(hMCTrueConversionREta[iCut]);
389  hMCTrueConversionRPt[iCut] = new TH2F("ESD_TrueConversion_RPt","ESD_TrueConversion_RPt",nBinsPt,0.,20.,nBinsR,0.,200.);
390  fTrueList[iCut]->Add(hMCTrueConversionRPt[iCut]);
391  hMCTrueConversionRZ[iCut] = new TH2F("ESD_TrueConversion_RZ","ESD_TrueConversion_RZ",nBinsZ,-180.,180.,nBinsR,0.,200.);
392  fTrueList[iCut]->Add(hMCTrueConversionRZ[iCut]);
393 
394  hMCTrueConversionDCA[iCut] = new TH1F("ESD_TrueConversion_DCA","ESD_TrueConversion_DCA",400,0.,5.);
395  fTrueList[iCut]->Add(hMCTrueConversionDCA[iCut]);
396  hMCTrueConversionPsiPair[iCut] = new TH1F("ESD_TrueConversion_PsiPair","ESD_TrueConversion_PsiPair",400,0.,5.);
397  fTrueList[iCut]->Add(hMCTrueConversionPsiPair[iCut]);
398  hMCTrueConversionChi2[iCut] = new TH1F("ESD_TrueConversion_Chi2","ESD_TrueConversion_Chi2",400,0.,50.);
399  fTrueList[iCut]->Add(hMCTrueConversionChi2[iCut]);
400  hMCTrueConversionMass[iCut] = new TH1F("ESD_TrueConversion_Mass","ESD_TrueConversion_Mass",400,0.,1.);
401  fTrueList[iCut]->Add(hMCTrueConversionMass[iCut]);
402 
403  hMCTrueConversionRRejLarge[iCut] = new TH1F("ESD_TrueConversion_RLarge","ESD_TrueConversion_RLarge",nBinsR,0.,200.);
404  fESDList[iCut]->Add(hMCTrueConversionRRejLarge[iCut]);
405  hMCTrueConversionRRejSmall[iCut] = new TH1F("ESD_TrueConversion_RSmall","ESD_TrueConversion_RSmall",nBinsR,0.,200.);
406  fESDList[iCut]->Add(hMCTrueConversionRRejSmall[iCut]);
407 
408  hMCTruePi0DalConversionRPt[iCut] = new TH2F("ESD_TruePi0DalConversion_RPt","ESD_TruePi0DalConversion_RPt",nBinsPt,0.,20.,nBinsR,0.,200.);
409  fTrueList[iCut]->Add(hMCTruePi0DalConversionRPt[iCut]);
410  hMCTruePi0DalConversionEta[iCut] = new TH1F("ESD_TruePi0DalConversion_Eta","ESD_TruePi0DalConversion_Eta",nBinsEta,-2.,2.);
411  fTrueList[iCut]->Add(hMCTruePi0DalConversionEta[iCut]);
412 
413  hMCTrueEtaDalConversionRPt[iCut] = new TH2F("ESD_TrueEtaDalConversion_RPt","ESD_TrueEtaDalConversion_RPt",nBinsPt,0.,20.,nBinsR,0.,200.);
414  fTrueList[iCut]->Add(hMCTrueEtaDalConversionRPt[iCut]);
415  hMCTrueEtaDalConversionEta[iCut] = new TH1F("ESD_TrueEtaDalConversion_Eta","ESD_TrueEtaDalConversion_Eta",nBinsEta,-2.,2.);
416  fTrueList[iCut]->Add(hMCTrueEtaDalConversionEta[iCut]);
417 
418  hMCTrueCombinatorialConversionRPt[iCut] = new TH2F("ESD_TrueCombinatorialConversion_RPt","ESD_TrueCombinatorialConversion_RPt",nBinsPt,0.,20.,nBinsR,0.,200.);
420  hMCTrueCombinatorialConversionEta[iCut] = new TH1F("ESD_TrueCombinatorialConversion_Eta","ESD_TrueCombinatorialConversion_Eta",nBinsEta,-2.,2.);
422 
423 
424  }
425  }
426 
427 
428  fV0Reader=(AliV0ReaderV1*)AliAnalysisManager::GetAnalysisManager()->GetTask(fV0ReaderName.Data());
432 
433  if(fV0Reader){
435  if(((AliConvEventCuts*)fV0Reader->GetEventCuts())->GetCutHistograms())
436  fOutputList->Add(((AliConvEventCuts*)fV0Reader->GetEventCuts())->GetCutHistograms());
437 
439  if(((AliConversionPhotonCuts*)fV0Reader->GetConversionCuts())->GetCutHistograms())
440  fOutputList->Add(((AliConversionPhotonCuts*)fV0Reader->GetConversionCuts())->GetCutHistograms());
441 
442  }
443 
444  for(Int_t iCut = 0; iCut<fnCuts;iCut++){
445  if(!((AliConvEventCuts*)fEventCutArray->At(iCut))) continue;
446  if(((AliConvEventCuts*)fEventCutArray->At(iCut))->GetCutHistograms()){
447  fCutFolder[iCut]->Add(((AliConvEventCuts*)fEventCutArray->At(iCut))->GetCutHistograms());
448  }
449  if(!((AliConversionPhotonCuts*)fConversionCutArray->At(iCut))) continue;
450  if(((AliConversionPhotonCuts*)fConversionCutArray->At(iCut))->GetCutHistograms()){
451  fCutFolder[iCut]->Add(((AliConversionPhotonCuts*)fConversionCutArray->At(iCut))->GetCutHistograms());
452  }
453  }
454 
455  PostData(1, fOutputList);
456 
457 }
458 
459 //________________________________________________________________________
461 
462  fInputEvent = InputEvent();
463  if (fInputEvent==NULL) return;
464 
465  if(fIsMC>0) fMCEvent = MCEvent();
466 
467  Int_t eventQuality = ((AliConvEventCuts*)fV0Reader->GetEventCuts())->GetEventQuality();
468  if(fInputEvent->IsIncompleteDAQ()==kTRUE) eventQuality = 2; // incomplete event
469  // Event Not Accepted due to MC event missing or because it is incomplere or wrong trigger for V0ReaderV1 => skip broken event/file
470  if(eventQuality == 2 || eventQuality == 3){
471  for(Int_t iCut = 0; iCut<fnCuts; iCut++){
472  hNEvents[iCut]->Fill(eventQuality);
473  }
474  return;
475  }
476 
477  fConversionGammas=fV0Reader->GetReconstructedGammas();// Gammas from default Cut
478 
479  // ------------------- BeginEvent ----------------------------
480 
481  for(Int_t iCut = 0; iCut<fnCuts; iCut++){
482  fiCut = iCut;
483  Int_t eventNotAccepted = ((AliConvEventCuts*)fEventCutArray->At(iCut))->IsEventAcceptedByCut(fV0Reader->GetEventCuts(),fInputEvent,fMCEvent,fIsHeavyIon,kFALSE);
484  if(eventNotAccepted){
485  // cout << "event rejected due to wrong trigger: " <<eventNotAccepted << endl;
486  hNEvents[iCut]->Fill(eventNotAccepted); // Check Centrality, PileUp, SDD and V0AND --> Not Accepted => eventQuality = 1
487  continue;
488  }
489 
490  if(eventQuality != 0){// Event Not Accepted
491  // cout << "event rejected due to: " <<eventQuality << endl;
492  hNEvents[iCut]->Fill(eventQuality);
493  continue;
494  }
495 
496  hNEvents[iCut]->Fill(eventQuality); // Should be 0 here
497 
498  if(fIsMC > 0){
499  // Process MC Particle
500  if(((AliConvEventCuts*)fEventCutArray->At(iCut))->GetSignalRejection() != 0){
501  if(fInputEvent->IsA()==AliESDEvent::Class()){
502  ((AliConvEventCuts*)fEventCutArray->At(iCut))->GetNotRejectedParticles(((AliConvEventCuts*)fEventCutArray->At(iCut))->GetSignalRejection(),
503  ((AliConvEventCuts*)fEventCutArray->At(iCut))->GetAcceptedHeader(),
504  fMCEvent);
505  }
506  }
508  }
509 
510  fNESDtracksEta09 = CountTracks09(); // Estimate Event Multiplicity
511  fNESDtracksEta0914 = CountTracks0914(); // Estimate Event Multiplicity
513 
516  hNGoodESDTracksEta09_14[iCut]->Fill(fNESDtracksEta0914);
517 
518 
519  if(fInputEvent){
520  if(fInputEvent->GetPrimaryVertexTracks()->GetNContributors()>0) {
521  fNContrVtx = fInputEvent->GetPrimaryVertexTracks()->GetNContributors();
522  } else {
523  fNContrVtx = 0;
524  }
525  }
526  ProcessPhotons();
527  fGammaCandidates->Clear(); // delete this cuts good gammas
528  }
529 
530  //cout<<" done with the event"<<endl;
531 
532  PostData(1, fOutputList);
533 }
534 
537  TParticle* candidate = (TParticle *)fMCEvent->Particle(eventPos);
538 
539  if(((AliConversionPhotonCuts*)fConversionCutArray->At(fiCut))->PhotonIsSelectedMC(candidate,fMCEvent,kFALSE)){
540 
541  fGammaMCPt = candidate->Pt();
542  fGammaMCTheta = candidate->Theta();
543 
544  hMCAllGammaPt[fiCut]->Fill(candidate->Pt());
545 
546  }
547 
548  if(((AliConversionPhotonCuts*)fConversionCutArray->At(fiCut))->PhotonIsSelectedMC(candidate,fMCEvent,kTRUE)){
549 
550  fGammaMCConvPt = candidate->Pt();
551  fGammaMCConvTheta = candidate->Theta();
552 
553  TParticle* daughter1 = (TParticle *)fMCEvent->Particle(candidate->GetFirstDaughter());
554 // TParticle* daughter2 = (TParticle *)fMCEvent->Particle(candidate->GetLastDaughter());
555 
556  hMCConversionRPhi[fiCut]->Fill(candidate->Phi(),daughter1->R());
557  hMCConversionREta[fiCut]->Fill(candidate->Eta(),daughter1->R());
558  hMCConversionRPt[fiCut]->Fill(candidate->Pt(),daughter1->R());
559 
560  if(daughter1->R() < 75. || daughter1->R() > 85.) hMCConversionRRejSmall[fiCut]->Fill(daughter1->R());
561  if(daughter1->R() < 70. || daughter1->R() > 90.) hMCConversionRRejLarge[fiCut]->Fill(daughter1->R());
562 
563  } // Converted MC Gamma
564 }
565 
568  // Loop over all primary MC particle
569  for(Int_t i = 0; i < fMCEvent->GetNumberOfPrimaries(); i++) {
570  TParticle* particle = (TParticle *)fMCEvent->Particle(i);
571  if (!particle) continue;
572 
573 
574  if(fMCEvent && ((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetSignalRejection() != 0){
575  Int_t isPosFromMBHeader = ((AliConvEventCuts*)fEventCutArray->At(fiCut))->IsParticleFromBGEvent(i, fMCEvent, fInputEvent);
576  Int_t isNegFromMBHeader = ((AliConvEventCuts*)fEventCutArray->At(fiCut))->IsParticleFromBGEvent(i, fMCEvent, fInputEvent);
577  if( (isNegFromMBHeader < 1) || (isPosFromMBHeader < 1)) continue;
578  }
579 
580 
581  if (particle->GetPdgCode() == 111 && particle->GetFirstDaughter() >= fMCEvent->GetNumberOfPrimaries()){
582  //cout << "Undecayed pi0 found with mother: " << particle->GetMother(0) << endl;
583  for (Int_t j = 0; j < 2 ; j++){
584  FillMCHistograms(particle->GetDaughter(j));
585  }
586  } else {
587  FillMCHistograms(i);
588  }
589 
590  }
591 }
592 
595 
596  // Fill Histograms for QA and MC
597  TList *GammaCandidatesStepTwo = new TList();
598 
599  for(Int_t firstGammaIndex=0;firstGammaIndex<fConversionGammas->GetEntriesFast();firstGammaIndex++){
600  AliAODConversionPhoton *gamma= (AliAODConversionPhoton*)fConversionGammas->At(firstGammaIndex);
601 
602  if (gamma == NULL) continue;
603 
604  if(!((AliConversionPhotonCuts*)fConversionCutArray->At(fiCut))->PhotonIsSelected(gamma,fInputEvent))continue;
605 
606  if( ! ((AliConversionPhotonCuts*)fConversionCutArray->At(fiCut))->UseToCloseV0sCut()){
607  fGammaCandidates->Add(gamma); // if no second loop is required add to events good gammas
608  }else if(((AliConversionPhotonCuts*)fConversionCutArray->At(fiCut))->UseToCloseV0sCut()) { // shared electron is disabled, step one not needed -> step two
609  GammaCandidatesStepTwo->Add(gamma);
610  }
611  }
612 
613  if(((AliConversionPhotonCuts*)fConversionCutArray->At(fiCut))->UseToCloseV0sCut()){
614  for(Int_t i = 0;i<GammaCandidatesStepTwo->GetEntries();i++){
615  AliAODConversionPhoton* PhotonCandidate = (AliAODConversionPhoton*) GammaCandidatesStepTwo->At(i);
616  if(!PhotonCandidate) continue;
617  if(!((AliConversionPhotonCuts*)fConversionCutArray->At(fiCut))->RejectToCloseV0s(PhotonCandidate,GammaCandidatesStepTwo,i)) continue;
618  fGammaCandidates->Add(PhotonCandidate); // Add gamma to current cut TList
619  }
620  }
621 
622  for(Int_t firstGammaIndex=0;firstGammaIndex<fGammaCandidates->GetEntries();firstGammaIndex++){
623  AliAODConversionPhoton *gamma=dynamic_cast<AliAODConversionPhoton*>(fGammaCandidates->At(firstGammaIndex));
624  if (gamma==NULL) continue;
625 
626  fGammaPt = gamma->GetPhotonPt();
627  fGammaTheta = gamma->GetPhotonTheta();
628  fGammaChi2NDF = gamma->GetChi2perNDF();
629 
630  AliPIDResponse* pidResonse = ((AliConversionPhotonCuts*)fV0Reader->GetConversionCuts())->GetPIDResponse();
631 
632  AliVTrack * negTrack = ((AliConversionPhotonCuts*)fConversionCutArray->At(fiCut))->GetTrack(fInputEvent, gamma->GetTrackLabelNegative());
633  AliVTrack * posTrack = ((AliConversionPhotonCuts*)fConversionCutArray->At(fiCut))->GetTrack(fInputEvent, gamma->GetTrackLabelPositive());
634 
635  hESDConversionRPhi[fiCut]->Fill(gamma->GetPhotonPhi(),gamma->GetConversionRadius());
636  hESDConversionRZ[fiCut]->Fill(gamma->GetConversionZ(),gamma->GetConversionRadius());
637  hESDConversionREta[fiCut]->Fill(gamma->GetPhotonEta(),gamma->GetConversionRadius());
638  hESDConversionRPt[fiCut]->Fill(gamma->GetPhotonPt(),gamma->GetConversionRadius());
639 
640  if(negTrack->GetTPCsignal()){
641  hElectronRdEdx[fiCut]->Fill(negTrack->GetTPCsignal(),gamma->GetConversionRadius());
642  hElectronRNSigmadEdx[fiCut]->Fill(pidResonse->NumberOfSigmasTPC(negTrack, AliPID::kElectron),gamma->GetConversionRadius());
643  }
644  if(posTrack->GetTPCsignal()){
645  hPositronRdEdx[fiCut]->Fill(posTrack->GetTPCsignal(),gamma->GetConversionRadius());
646  hPositronRNSigmadEdx[fiCut]->Fill(pidResonse->NumberOfSigmasTPC(posTrack, AliPID::kElectron),gamma->GetConversionRadius());
647  }
648 
649  if(gamma->GetConversionRadius() < 75. || gamma->GetConversionRadius() > 85.) hESDConversionRRejSmall[fiCut]->Fill(gamma->GetConversionRadius());
650  if(gamma->GetConversionRadius() < 70. || gamma->GetConversionRadius() > 90.) hESDConversionRRejLarge[fiCut]->Fill(gamma->GetConversionRadius());
651 
652  if(fInputEvent->IsA()==AliESDEvent::Class()){
653  AliESDEvent *esdEvent = dynamic_cast<AliESDEvent*>(fInputEvent);
654  if(esdEvent){
655  AliESDv0 *v0 = esdEvent->GetV0(gamma->GetV0Index());
656  hESDConversionDCA[fiCut]->Fill(v0->GetDcaV0Daughters());
657  }
658  }
659  hESDConversionPsiPair[fiCut]->Fill(gamma->GetPsiPair());
660  hESDConversionChi2[fiCut]->Fill(gamma->GetChi2perNDF());
661  hESDConversionMass[fiCut]->Fill(gamma->GetInvMassPair());
662 
663  fKind = 9;
664  Int_t pdgCodePos = 0.;
665  Int_t pdgCodeNeg = 0.;
666 
667  if(fIsMC>0){
668 
669  const AliVVertex* primVtxMC = fMCEvent->GetPrimaryVertex();
670  Double_t mcProdVtxX = primVtxMC->GetX();
671  Double_t mcProdVtxY = primVtxMC->GetY();
672  Double_t mcProdVtxZ = primVtxMC->GetZ();
673 
674  TParticle *posDaughter = gamma->GetPositiveMCDaughter(fMCEvent);
675  TParticle *negDaughter = gamma->GetNegativeMCDaughter(fMCEvent);
676  //cout << "generate Daughters: "<<posDaughter << "\t" << negDaughter << endl;
677 
678  if(fMCEvent && ((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetSignalRejection() != 0){
679  Int_t isPosFromMBHeader = ((AliConvEventCuts*)fEventCutArray->At(fiCut))->IsParticleFromBGEvent(gamma->GetMCLabelPositive(), fMCEvent, fInputEvent);
680  Int_t isNegFromMBHeader = ((AliConvEventCuts*)fEventCutArray->At(fiCut))->IsParticleFromBGEvent(gamma->GetMCLabelNegative(), fMCEvent, fInputEvent);
681  if( (isNegFromMBHeader < 1) || (isPosFromMBHeader < 1)) continue;
682  }
683 
684  if(posDaughter == NULL || negDaughter == NULL){
685 
686  fKind = 9; // garbage
687 
688  } else if(posDaughter->GetMother(0) != negDaughter->GetMother(0) || (posDaughter->GetMother(0) == negDaughter->GetMother(0) && posDaughter->GetMother(0) ==-1)){
689 
690  fKind = 1; //Not Same Mother == Combinatorial Bck
691  pdgCodePos = posDaughter->GetPdgCode();
692  pdgCodeNeg = negDaughter->GetPdgCode();
693 
694  if(TMath::Abs(pdgCodePos)==11 && TMath::Abs(pdgCodeNeg)==11)
695  fKind = 10; //Electron Combinatorial
696  if(TMath::Abs(pdgCodePos)==11 && TMath::Abs(pdgCodeNeg)==11 && (posDaughter->GetMother(0) == negDaughter->GetMother(0) && posDaughter->GetMother(0) ==-1))
697  fKind = 15; //direct Electron Combinatorial
698  if(TMath::Abs(pdgCodePos)==211 && TMath::Abs(pdgCodeNeg)==211)
699  fKind = 11; //Pion Combinatorial
700  if((TMath::Abs(pdgCodePos)==211 && TMath::Abs(pdgCodeNeg)==2212) ||
701  (TMath::Abs(pdgCodePos)==2212 && TMath::Abs(pdgCodeNeg)==211))
702  fKind = 12; //Pion, Proton Combinatorics
703  if((TMath::Abs(pdgCodePos)==211 && TMath::Abs(pdgCodeNeg)==11) ||
704  (TMath::Abs(pdgCodePos)==11 && TMath::Abs(pdgCodeNeg)==211))
705  fKind = 13; //Pion, Electron Combinatorics
706  if (TMath::Abs(pdgCodePos)==321 || TMath::Abs(pdgCodeNeg)==321)
707  fKind = 14; //Kaon combinatorics
708 
709  } else {
710  //cout << "same mother" << endl;
711  Int_t pdgCode;
712  pdgCode = gamma->GetMCParticle(fMCEvent)->GetPdgCode();
713  if(TMath::Abs(pdgCodePos)!=11 || TMath::Abs(pdgCodeNeg)!=11)
714  fKind = 2; // combinatorics from hadronic decays
715  else if ( !(pdgCodeNeg==pdgCodePos)){
716  Bool_t gammaIsPrimary = ((AliConvEventCuts*)fEventCutArray->At(fiCut))->IsConversionPrimaryESD( fMCEvent, posDaughter->GetMother(0), mcProdVtxX, mcProdVtxY, mcProdVtxZ);
717  if(pdgCode == 111) fKind = 3; // pi0 Dalitz
718  else if (pdgCode == 221)fKind = 4; // eta Dalitz
719  else if (!(negDaughter->GetUniqueID() != 5 || posDaughter->GetUniqueID() !=5)){
720  if(pdgCode == 22 && gammaIsPrimary){
721  fKind = 0; // primary photons
722  } else if (pdgCode == 22){
723  fKind = 5; //secondary photons
724  }
725  } else fKind = 9; //garbage
726  } else fKind = 9; //garbage
727  }
728 
729  if(fKind==0 || fKind==5){
733  hMCTrueConversionRPt[fiCut]->Fill(gamma->GetPhotonPt(),gamma->GetConversionRadius());
734 
735  if(gamma->GetConversionRadius() < 75. || gamma->GetConversionRadius() > 85.) hMCTrueConversionRRejSmall[fiCut]->Fill(gamma->GetConversionRadius());
736  if(gamma->GetConversionRadius() < 70. || gamma->GetConversionRadius() > 90.) hMCTrueConversionRRejLarge[fiCut]->Fill(gamma->GetConversionRadius());
737 
738  hMCTrueConversionPsiPair[fiCut]->Fill(gamma->GetPsiPair());
739  hMCTrueConversionChi2[fiCut]->Fill(gamma->GetChi2perNDF());
740  hMCTrueConversionMass[fiCut]->Fill(gamma->GetInvMassPair());
741  if(fInputEvent->IsA()==AliESDEvent::Class()){
742  AliESDEvent *esdEvent = dynamic_cast<AliESDEvent*>(fInputEvent);
743  if(esdEvent){
744  AliESDv0 *v0 = esdEvent->GetV0(gamma->GetV0Index());
745  hMCTrueConversionDCA[fiCut]->Fill(v0->GetDcaV0Daughters());
746  }
747  }
748 
749  } else if(fKind==3){
752  } else if(fKind==4){
755  } else {
758  }
759  }
760  }
761 
762  delete GammaCandidatesStepTwo;
763  GammaCandidatesStepTwo = 0x0;
764 
765 
766 }
767 
768 //________________________________________________________________________
770 
771  Int_t fNumberOfESDTracks = 0;
772  if(fInputEvent->IsA()==AliESDEvent::Class()){
773  // Using standard function for setting Cuts
774 
775 // Bool_t selectPrimaries = kTRUE;
776  static AliESDtrackCuts *EsdTrackCuts = 0x0;
777  static int prevRun = -1;
778  // Using standard function for setting Cuts
779  Int_t runNumber = fInputEvent->GetRunNumber();
780  if (prevRun!=runNumber) {
781  delete EsdTrackCuts;
782  EsdTrackCuts = 0;
783  prevRun = runNumber;
784  }
785 // AliESDtrackCuts *EsdTrackCuts = AliESDtrackCuts::GetStandardITSTPCTrackCuts2010(selectPrimaries);
786  if (!EsdTrackCuts) {
787  // if LHC11a or earlier or if LHC13g or if LHC12a-i -> use 2010 cuts
788  if( (runNumber<=146860) || (runNumber>=197470 && runNumber<=197692) || (runNumber>=172440 && runNumber<=193766) ){
789  EsdTrackCuts = AliESDtrackCuts::GetStandardITSTPCTrackCuts2010();
790 
791  } else if (runNumber>=209122){ // else if run2 data use 2015 PbPb cuts
792  //EsdTrackCuts = AliESDtrackCuts::GetStandardITSTPCTrackCuts2015PbPb();
793  // hard coded track cuts for the moment, because AliESDtrackCuts::GetStandardITSTPCTrackCuts2015PbPb() gives spams warnings
794  EsdTrackCuts = new AliESDtrackCuts();
795  // TPC; clusterCut = 1, cutAcceptanceEdges = kTRUE, removeDistortedRegions = kFALSE
796  EsdTrackCuts->AliESDtrackCuts::SetMinNCrossedRowsTPC(70);
797  EsdTrackCuts->AliESDtrackCuts::SetMinRatioCrossedRowsOverFindableClustersTPC(0.8);
798  EsdTrackCuts->SetCutGeoNcrNcl(2., 130., 1.5, 0.0, 0.0); // only dead zone and not clusters per length
799  //EsdTrackCuts->AliESDtrackCuts::SetCutOutDistortedRegionsTPC(kTRUE);
800  EsdTrackCuts->AliESDtrackCuts::SetMaxChi2PerClusterTPC(4);
801  EsdTrackCuts->AliESDtrackCuts::SetAcceptKinkDaughters(kFALSE);
802  EsdTrackCuts->AliESDtrackCuts::SetRequireTPCRefit(kTRUE);
803  // ITS; selPrimaries = 1
804  EsdTrackCuts->AliESDtrackCuts::SetRequireITSRefit(kTRUE);
805  EsdTrackCuts->AliESDtrackCuts::SetClusterRequirementITS(AliESDtrackCuts::kSPD,
806  AliESDtrackCuts::kAny);
807  EsdTrackCuts->AliESDtrackCuts::SetMaxDCAToVertexXYPtDep("0.0105+0.0350/pt^1.1");
808  EsdTrackCuts->AliESDtrackCuts::SetMaxChi2TPCConstrainedGlobal(36);
809  EsdTrackCuts->AliESDtrackCuts::SetMaxDCAToVertexZ(2);
810  EsdTrackCuts->AliESDtrackCuts::SetDCAToVertex2D(kFALSE);
811  EsdTrackCuts->AliESDtrackCuts::SetRequireSigmaToVertex(kFALSE);
812  EsdTrackCuts->AliESDtrackCuts::SetMaxChi2PerClusterITS(36);
813 
814  } else { // else use 2011 version of track cuts
815  EsdTrackCuts = AliESDtrackCuts::GetStandardITSTPCTrackCuts2011();
816  }
817  EsdTrackCuts->SetMaxDCAToVertexZ(2);
818  EsdTrackCuts->SetEtaRange(-0.9, 0.9);
819  EsdTrackCuts->SetPtRange(0.15);
820  }
821 
822  for(Int_t iTracks = 0; iTracks < fInputEvent->GetNumberOfTracks(); iTracks++){
823  AliESDtrack* curTrack = (AliESDtrack*) fInputEvent->GetTrack(iTracks);
824  if(!curTrack) continue;
825  if(EsdTrackCuts->AcceptTrack(curTrack) ){
826  if (fMCEvent){
827  if(((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetSignalRejection() != 0){
828  Int_t isFromMBHeader = ((AliConvEventCuts*)fEventCutArray->At(fiCut))->IsParticleFromBGEvent(TMath::Abs(curTrack->GetLabel()), fMCEvent, fInputEvent);
829  if( (isFromMBHeader < 1) ) continue;
830  }
831  }
832  fNumberOfESDTracks++;
833  }
834  }
835  delete EsdTrackCuts;
836  EsdTrackCuts=0x0;
837 
838  }
839 
840  return fNumberOfESDTracks;
841 
842 }
843 
844 //________________________________________________________________________
846 
847  Int_t fNumberOfESDTracks = 0;
848  if(fInputEvent->IsA()==AliESDEvent::Class()){
849  // Using standard function for setting Cuts
850 
851 // Bool_t selectPrimaries = kTRUE;
852  static AliESDtrackCuts *EsdTrackCuts = 0x0;
853  static int prevRun = -1;
854  // Using standard function for setting Cuts
855  Int_t runNumber = fInputEvent->GetRunNumber();
856  if (prevRun!=runNumber) {
857  delete EsdTrackCuts;
858  EsdTrackCuts = 0;
859  prevRun = runNumber;
860  }
861 // AliESDtrackCuts *EsdTrackCuts = AliESDtrackCuts::GetStandardITSTPCTrackCuts2010(selectPrimaries);
862  if (!EsdTrackCuts) {
863  // if LHC11a or earlier or if LHC13g or if LHC12a-i -> use 2010 cuts
864  if( (runNumber<=146860) || (runNumber>=197470 && runNumber<=197692) || (runNumber>=172440 && runNumber<=193766) ){
865  EsdTrackCuts = AliESDtrackCuts::GetStandardITSTPCTrackCuts2010();
866 
867  } else if (runNumber>=209122){ // else if run2 data use 2015 PbPb cuts
868  //EsdTrackCuts = AliESDtrackCuts::GetStandardITSTPCTrackCuts2015PbPb();
869  // hard coded track cuts for the moment, because AliESDtrackCuts::GetStandardITSTPCTrackCuts2015PbPb() gives spams warnings
870  EsdTrackCuts = new AliESDtrackCuts();
871  // TPC; clusterCut = 1, cutAcceptanceEdges = kTRUE, removeDistortedRegions = kFALSE
872  EsdTrackCuts->AliESDtrackCuts::SetMinNCrossedRowsTPC(70);
873  EsdTrackCuts->AliESDtrackCuts::SetMinRatioCrossedRowsOverFindableClustersTPC(0.8);
874  EsdTrackCuts->SetCutGeoNcrNcl(2., 130., 1.5, 0.0, 0.0); // only dead zone and not clusters per length
875  //EsdTrackCuts->AliESDtrackCuts::SetCutOutDistortedRegionsTPC(kTRUE);
876  EsdTrackCuts->AliESDtrackCuts::SetMaxChi2PerClusterTPC(4);
877  EsdTrackCuts->AliESDtrackCuts::SetAcceptKinkDaughters(kFALSE);
878  EsdTrackCuts->AliESDtrackCuts::SetRequireTPCRefit(kTRUE);
879  // ITS; selPrimaries = 1
880  EsdTrackCuts->AliESDtrackCuts::SetRequireITSRefit(kTRUE);
881  EsdTrackCuts->AliESDtrackCuts::SetClusterRequirementITS(AliESDtrackCuts::kSPD,
882  AliESDtrackCuts::kAny);
883  EsdTrackCuts->AliESDtrackCuts::SetMaxDCAToVertexXYPtDep("0.0105+0.0350/pt^1.1");
884  EsdTrackCuts->AliESDtrackCuts::SetMaxChi2TPCConstrainedGlobal(36);
885  EsdTrackCuts->AliESDtrackCuts::SetMaxDCAToVertexZ(2);
886  EsdTrackCuts->AliESDtrackCuts::SetDCAToVertex2D(kFALSE);
887  EsdTrackCuts->AliESDtrackCuts::SetRequireSigmaToVertex(kFALSE);
888  EsdTrackCuts->AliESDtrackCuts::SetMaxChi2PerClusterITS(36);
889 
890  } else { // else use 2011 version of track cuts
891  EsdTrackCuts = AliESDtrackCuts::GetStandardITSTPCTrackCuts2011();
892  }
893  EsdTrackCuts->SetMaxDCAToVertexZ(2);
894  EsdTrackCuts->SetPtRange(0.15);
895  }
896 
897  EsdTrackCuts->SetEtaRange(0.9, 1.4);
898  for(Int_t iTracks = 0; iTracks < fInputEvent->GetNumberOfTracks(); iTracks++){
899  AliESDtrack* curTrack = (AliESDtrack*) fInputEvent->GetTrack(iTracks);
900  if(!curTrack) continue;
901  if(EsdTrackCuts->AcceptTrack(curTrack) ){
902  if (fMCEvent){
903  if(((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetSignalRejection() != 0){
904  Int_t isFromMBHeader = ((AliConvEventCuts*)fEventCutArray->At(fiCut))->IsParticleFromBGEvent(TMath::Abs(curTrack->GetLabel()), fMCEvent, fInputEvent);
905  if( (isFromMBHeader < 1) ) continue;
906  }
907  }
908  fNumberOfESDTracks++;
909  }
910  }
911 
912  EsdTrackCuts->SetEtaRange(-1.4, -0.9);
913  for(Int_t iTracks = 0; iTracks < fInputEvent->GetNumberOfTracks(); iTracks++){
914  AliESDtrack* curTrack =(AliESDtrack*) fInputEvent->GetTrack(iTracks);
915  if(!curTrack) continue;
916  if(EsdTrackCuts->AcceptTrack(curTrack) ){
917  if (fMCEvent){
918  if(((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetSignalRejection() != 0){
919  Int_t isFromMBHeader = ((AliConvEventCuts*)fEventCutArray->At(fiCut))->IsParticleFromBGEvent(TMath::Abs(curTrack->GetLabel()), fMCEvent, fInputEvent);
920  if( (isFromMBHeader < 1) ) continue;
921  }
922  }
923  fNumberOfESDTracks++;
924  }
925  }
926  delete EsdTrackCuts;
927  EsdTrackCuts=0x0;
928 
929  }
930 
931  return fNumberOfESDTracks;
932 }
933 
934 
935 //________________________________________________________________________
937  TAxis *axisafter = histoRebin->GetXaxis();
938  Int_t bins = axisafter->GetNbins();
939  Double_t from = axisafter->GetXmin();
940  Double_t to = axisafter->GetXmax();
941  Double_t *newbins = new Double_t[bins+1];
942  newbins[0] = from;
943  Double_t factor = TMath::Power(to/from, 1./bins);
944  for(Int_t i=1; i<=bins; ++i) newbins[i] = factor * newbins[i-1];
945  axisafter->Set(bins, newbins);
946  delete [] newbins;
947 }
948 
949 //________________________________________________________________________
951 {
952 // if (fStreamMaterial){
953 // fStreamMaterial->GetFile()->Write();
954 // }
955 }
TParticle * GetMCParticle(AliMCEvent *mcEvent)
virtual Double_t GetPhotonPhi() const
double Double_t
Definition: External.C:58
Definition: External.C:236
virtual Double_t GetPhotonTheta() const
TParticle * GetPositiveMCDaughter(AliMCEvent *mcEvent)
virtual void UserExec(Option_t *option)
Bool_t GetProduceV0FindingEfficiency()
TParticle * GetNegativeMCDaughter(AliMCEvent *mcEvent)
int Int_t
Definition: External.C:63
AliConversionPhotonCuts * GetConversionCuts()
Definition: AliV0ReaderV1.h:89
Class handling all kinds of selection cuts for Gamma Conversion analysis.
virtual Double_t GetPhotonEta() const
Definition: External.C:220
TClonesArray * GetReconstructedGammas() const
Definition: AliV0ReaderV1.h:85
virtual Double_t GetPhotonPt() const
Class handling all kinds of selection cuts for Gamma Conversion analysis.
AliConvEventCuts * GetEventCuts()
Definition: AliV0ReaderV1.h:90
const char Option_t
Definition: External.C:48
virtual void SetLogBinningXTH2(TH2 *histoRebin)
bool Bool_t
Definition: External.C:53
Double_t GetConversionRadius() const
TList * GetV0FindingEfficiencyHistograms()