AliPhysics  58f3d52 (58f3d52)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AliConversionPhotonCuts.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 // Class handling photon selection cuts for
19 // Gamma Conversion analysis
20 //---------------------------------------------
22 
24 
25 #include "AliKFVertex.h"
26 #include "AliAODTrack.h"
27 #include "AliAODv0.h"
28 #include "AliAODEvent.h"
29 #include "AliESDtrack.h"
30 #include "AliAnalysisManager.h"
31 #include "AliInputEventHandler.h"
32 #include "AliMCEventHandler.h"
33 #include "AliAODHandler.h"
34 #include "AliPIDResponse.h"
35 #include "TH1.h"
36 #include "TH2.h"
37 #include "TF1.h"
38 #include "TProfile.h"
39 #include "AliMCEvent.h"
40 #include "AliAODConversionMother.h"
41 #include "TObjString.h"
42 #include "AliAODEvent.h"
43 #include "AliESDEvent.h"
44 #include "AliCentrality.h"
45 #include "TList.h"
46 #include "TFile.h"
47 #include "AliLog.h"
48 #include "AliGenCocktailEventHeader.h"
49 #include "AliGenDPMjetEventHeader.h"
50 #include "AliGenPythiaEventHeader.h"
51 #include "AliGenHijingEventHeader.h"
52 #include "AliTriggerAnalysis.h"
53 #include "AliV0ReaderV1.h"
54 #include "AliAODMCParticle.h"
55 #include "AliAODMCHeader.h"
56 #include "AliTRDTriggerAnalysis.h"
57 
58 class iostream;
59 
60 using namespace std;
61 
65 
66 const char* AliConversionPhotonCuts::fgkCutNames[AliConversionPhotonCuts::kNCuts] = {
67  "V0FinderType", // 0
68  "EtaCut", // 1
69  "MinRCut", // 2
70  "EtaForPhiCut", // 3
71  "MinPhiCut", // 4
72  "MaxPhiCut", // 5
73  "SinglePtCut", // 6
74  "ClsTPCCut", // 7
75  "ededxSigmaCut", // 8
76  "pidedxSigmaCut", // 9
77  "piMomdedxSigmaCut", // 10
78  "piMaxMomdedxSigmaCut", // 11
79  "LowPRejectionSigmaCut", // 12
80  "TOFelectronPID", // 13
81  "ITSelectronPID", // 14 -- new ITS PID
82  "TRDelectronPID", // 15 -- new TRD PID
83  "QtMaxCut", // 16
84  "Chi2GammaCut", // 17
85  "PsiPair", // 18
86  "DoPhotonAsymmetryCut", // 19
87  "CosinePointingAngle", // 20
88  "SharedElectronCuts", // 21
89  "RejectToCloseV0s", // 22
90  "DcaRPrimVtx", // 23
91  "DcaZPrimVtx", // 24
92  "EvetPlane" // 25
93 };
94 
95 
96 //________________________________________________________________________
98  AliAnalysisCuts(name,title),
99  fHistograms(NULL),
100  fPIDResponse(NULL),
101  fDoLightOutput(kFALSE),
102  fV0ReaderName("V0ReaderV1"),
103  fMaxR(200),
104  fMinR(0),
105  fEtaCut(0.9),
106  fEtaCutMin(-0.1),
107  fEtaForPhiCutMin(-10.),
108  fEtaForPhiCutMax(10.),
109  fMinPhiCut(0.),
110  fMaxPhiCut(100.),
111  fDoShrinkTPCAcceptance(kFALSE),
112  fPtCut(0.02),
113  fSinglePtCut(0),
114  fSinglePtCut2(0),
115  fDoAsymPtCut(kFALSE),
116  fMaxZ(1000),
117  fMinClsTPC(0.),
118  fMinClsTPCToF(0.),
119  fLineCutZRSlope(0.),
120  fLineCutZValue(0),
121  fLineCutZRSlopeMin(0.),
122  fLineCutZValueMin(0),
123  fChi2CutConversion(1000),
124  fPIDProbabilityCutNegativeParticle(0),
125  fPIDProbabilityCutPositiveParticle(0),
126  fDodEdxSigmaCut(kTRUE),
127  fDoTOFsigmaCut(kFALSE),
128  fPIDTRDEfficiency(1),
129  fDoTRDPID(kFALSE),
130  fPIDnSigmaAboveElectronLine(100),
131  fPIDnSigmaBelowElectronLine(-100),
132  fTofPIDnSigmaAboveElectronLine(100),
133  fTofPIDnSigmaBelowElectronLine(-100),
134  fPIDnSigmaAbovePionLine(0),
135  fPIDnSigmaAbovePionLineHighPt(-100),
136  fPIDMinPnSigmaAbovePionLine(0),
137  fPIDMaxPnSigmaAbovePionLine(0),
138  fDoKaonRejectionLowP(kFALSE),
139  fDoProtonRejectionLowP(kFALSE),
140  fDoPionRejectionLowP(kFALSE),
141  fPIDnSigmaAtLowPAroundKaonLine(0),
142  fPIDnSigmaAtLowPAroundProtonLine(0),
143  fPIDnSigmaAtLowPAroundPionLine(0),
144  fPIDMinPKaonRejectionLowP(1.5),
145  fPIDMinPProtonRejectionLowP(2),
146  fPIDMinPPionRejectionLowP(0),
147  fDoQtGammaSelection(kTRUE),
148  fDo2DQt(kFALSE),
149  fQtMax(100),
150  fNSigmaMass(0.),
151  fUseEtaMinCut(kFALSE),
152  fUseOnFlyV0Finder(kTRUE),
153  fUseOnFlyV0FinderSameSign(0),
154  fDoPhotonAsymmetryCut(kTRUE),
155  fDoPhotonPDependentAsymCut(kFALSE),
156  fFAsymmetryCut(0),
157  fMinPPhotonAsymmetryCut(100.),
158  fMinPhotonAsymmetry(0.),
159  fUseCorrectedTPCClsInfo(kFALSE),
160  fUseTOFpid(kFALSE),
161  fOpeningAngle(0.005),
162  fPsiPairCut(10000),
163  fDo2DPsiPairChi2(kFALSE),
164  fIncludeRejectedPsiPair(kFALSE),
165  fCosPAngleCut(10000),
166  fDoToCloseV0sCut(kFALSE),
167  fminV0Dist(200.),
168  fDoSharedElecCut(kFALSE),
169  fDoPhotonQualitySelectionCut(kFALSE),
170  fPhotonQualityCut(0),
171  fRandom(0),
172  fElectronArraySize(500),
173  fElectronLabelArray(NULL),
174  fDCAZPrimVtxCut(1000),
175  fDCARPrimVtxCut(1000),
176  fInPlaneOutOfPlane(0),
177  fConversionPointXArray(0.0),
178  fConversionPointYArray(0.0),
179  fConversionPointZArray(0.0),
180  fCutString(NULL),
181  fCutStringRead(""),
182  fIsHeavyIon(0),
183  fUseITSpid(kFALSE),
184  fITSPIDnSigmaAboveElectronLine(100),
185  fITSPIDnSigmaBelowElectronLine(-100),
186  fMaxPtPIDITS(1.5),
187  fTRDPIDAboveCut(100),
188  fTRDPIDBelowCut(-100),
189  fDoDoubleCountingCut(kFALSE),
190  fMinRDC(0.),
191  fDeltaR(0.),
192  fOpenAngle(0.),
193  fSwitchToKappa(kFALSE),
194  fKappaMinCut(-1),
195  fKappaMaxCut(1000),
196  fHistoEtaDistV0s(NULL),
197  fHistoEtaDistV0sAfterdEdxCuts(NULL),
198  fHistodEdxCuts(NULL),
199  fHistoTPCdEdxbefore(NULL),
200  fHistoTPCdEdxafter(NULL),
201  fHistoTPCdEdxSigbefore(NULL),
202  fHistoTPCdEdxSigafter(NULL),
203  fHistoKappaafter(NULL),
204  fHistoTOFbefore(NULL),
205  fHistoTOFSigbefore(NULL),
206  fHistoTOFSigafter(NULL),
207  fHistoITSSigbefore(NULL),
208  fHistoITSSigafter(NULL),
209  fHistoPsiPairDeltaPhiafter(NULL),
210  fHistoTrackCuts(NULL),
211  fHistoPhotonCuts(NULL),
212  fHistoInvMassbefore(NULL),
213  fHistoArmenterosbefore(NULL),
214  fHistoInvMassafter(NULL),
215  fHistoArmenterosafter(NULL),
216  fHistoAsymmetryafter(NULL),
217  fHistoAcceptanceCuts(NULL),
218  fHistoCutIndex(NULL),
219  fHistoEventPlanePhi(NULL),
220  fPreSelCut(kFALSE),
221  fProcessAODCheck(kFALSE),
222  fMaterialBudgetWeightsInitialized(kFALSE),
223  fProfileContainingMaterialBudgetWeights(NULL)
224 
225 {
226  InitPIDResponse();
227  for(Int_t jj=0;jj<kNCuts;jj++){fCuts[jj]=0;}
228  fCutString=new TObjString((GetCutNumber()).Data());
229 
231 }
232 
233 //________________________________________________________________________
235  AliAnalysisCuts(ref),
236  fHistograms(NULL),
237  fPIDResponse(NULL),
238  fDoLightOutput(ref.fDoLightOutput),
239  fV0ReaderName("V0ReaderV1"),
240  fMaxR(ref.fMaxR),
241  fMinR(ref.fMinR),
242  fEtaCut(ref.fEtaCut),
243  fEtaCutMin(ref.fEtaCutMin),
244  fEtaForPhiCutMin(ref.fEtaForPhiCutMin),
245  fEtaForPhiCutMax(ref.fEtaForPhiCutMax),
246  fMinPhiCut(ref.fMinPhiCut),
247  fMaxPhiCut(ref.fMaxPhiCut),
248  fDoShrinkTPCAcceptance(ref.fDoShrinkTPCAcceptance),
249  fPtCut(ref.fPtCut),
250  fSinglePtCut(ref.fSinglePtCut),
251  fSinglePtCut2(ref.fSinglePtCut2),
252  fDoAsymPtCut(ref.fDoAsymPtCut),
253  fMaxZ(ref.fMaxZ),
254  fMinClsTPC(ref.fMinClsTPC),
255  fMinClsTPCToF(ref.fMinClsTPCToF),
256  fLineCutZRSlope(ref.fLineCutZRSlope),
257  fLineCutZValue(ref.fLineCutZValue),
258  fLineCutZRSlopeMin(ref.fLineCutZRSlopeMin),
259  fLineCutZValueMin(ref.fLineCutZValueMin),
260  fChi2CutConversion(ref.fChi2CutConversion),
261  fPIDProbabilityCutNegativeParticle(ref.fPIDProbabilityCutNegativeParticle),
262  fPIDProbabilityCutPositiveParticle(ref.fPIDProbabilityCutPositiveParticle),
263  fDodEdxSigmaCut(ref. fDodEdxSigmaCut),
264  fDoTOFsigmaCut(ref.fDoTOFsigmaCut),
265  fPIDTRDEfficiency(ref.fPIDTRDEfficiency),
266  fDoTRDPID(ref.fDoTRDPID),
267  fPIDnSigmaAboveElectronLine(ref.fPIDnSigmaAboveElectronLine),
268  fPIDnSigmaBelowElectronLine(ref.fPIDnSigmaBelowElectronLine),
269  fTofPIDnSigmaAboveElectronLine(ref.fTofPIDnSigmaAboveElectronLine),
270  fTofPIDnSigmaBelowElectronLine(ref.fTofPIDnSigmaBelowElectronLine),
271  fPIDnSigmaAbovePionLine(ref.fPIDnSigmaAbovePionLine),
272  fPIDnSigmaAbovePionLineHighPt(ref.fPIDnSigmaAbovePionLineHighPt),
273  fPIDMinPnSigmaAbovePionLine(ref.fPIDMinPnSigmaAbovePionLine),
274  fPIDMaxPnSigmaAbovePionLine(ref.fPIDMaxPnSigmaAbovePionLine),
275  fDoKaonRejectionLowP(ref.fDoKaonRejectionLowP),
276  fDoProtonRejectionLowP(ref.fDoProtonRejectionLowP),
277  fDoPionRejectionLowP(ref.fDoPionRejectionLowP),
278  fPIDnSigmaAtLowPAroundKaonLine(ref.fPIDnSigmaAtLowPAroundKaonLine),
279  fPIDnSigmaAtLowPAroundProtonLine(ref.fPIDnSigmaAtLowPAroundProtonLine),
280  fPIDnSigmaAtLowPAroundPionLine(ref.fPIDnSigmaAtLowPAroundPionLine),
281  fPIDMinPKaonRejectionLowP(ref.fPIDMinPKaonRejectionLowP),
282  fPIDMinPProtonRejectionLowP(ref.fPIDMinPProtonRejectionLowP),
283  fPIDMinPPionRejectionLowP(ref.fPIDMinPPionRejectionLowP),
284  fDoQtGammaSelection(ref.fDoQtGammaSelection),
285  fDo2DQt(ref.fDo2DQt),
286  fQtMax(ref.fQtMax),
287  fNSigmaMass(ref.fNSigmaMass),
288  fUseEtaMinCut(ref.fUseEtaMinCut),
289  fUseOnFlyV0Finder(ref.fUseOnFlyV0Finder),
290  fUseOnFlyV0FinderSameSign(ref.fUseOnFlyV0FinderSameSign),
291  fDoPhotonAsymmetryCut(ref.fDoPhotonAsymmetryCut),
292  fDoPhotonPDependentAsymCut(ref.fDoPhotonPDependentAsymCut),
293  fFAsymmetryCut(ref.fFAsymmetryCut),
294  fMinPPhotonAsymmetryCut(ref.fMinPPhotonAsymmetryCut),
295  fMinPhotonAsymmetry(ref.fMinPhotonAsymmetry),
296  fUseCorrectedTPCClsInfo(ref.fUseCorrectedTPCClsInfo),
297  fUseTOFpid(ref.fUseTOFpid),
298  fOpeningAngle(ref.fOpeningAngle),
299  fPsiPairCut(ref.fPsiPairCut),
300  fDo2DPsiPairChi2(ref.fDo2DPsiPairChi2),
301  fIncludeRejectedPsiPair(ref.fIncludeRejectedPsiPair),
302  fCosPAngleCut(ref.fCosPAngleCut),
303  fDoToCloseV0sCut(ref.fDoToCloseV0sCut),
304  fminV0Dist(ref.fminV0Dist),
305  fDoSharedElecCut(ref.fDoSharedElecCut),
306  fDoPhotonQualitySelectionCut(ref.fDoPhotonQualitySelectionCut),
307  fPhotonQualityCut(ref.fPhotonQualityCut),
308  fRandom(ref.fRandom),
309  fElectronArraySize(ref.fElectronArraySize),
310  fElectronLabelArray(NULL),
311  fDCAZPrimVtxCut(ref.fDCAZPrimVtxCut),
312  fDCARPrimVtxCut(ref.fDCAZPrimVtxCut),
313  fInPlaneOutOfPlane(ref.fInPlaneOutOfPlane),
314  fConversionPointXArray(ref.fConversionPointXArray),
315  fConversionPointYArray(ref.fConversionPointYArray),
316  fConversionPointZArray(ref.fConversionPointZArray),
317  fCutString(NULL),
318  fCutStringRead(""),
319  fIsHeavyIon(ref.fIsHeavyIon),
320  fUseITSpid(ref.fUseITSpid),
321  fITSPIDnSigmaAboveElectronLine(ref.fITSPIDnSigmaAboveElectronLine),
322  fITSPIDnSigmaBelowElectronLine(ref.fITSPIDnSigmaBelowElectronLine),
323  fMaxPtPIDITS(ref.fMaxPtPIDITS),
324  fTRDPIDAboveCut(ref.fTRDPIDAboveCut),
325  fTRDPIDBelowCut(ref.fTRDPIDBelowCut),
326  fDoDoubleCountingCut(ref.fDoDoubleCountingCut),
327  fMinRDC(ref.fMinRDC),
328  fDeltaR(ref.fDeltaR),
329  fOpenAngle(ref.fOpenAngle),
330  fSwitchToKappa(ref.fSwitchToKappa),
331  fKappaMinCut(ref.fKappaMinCut),
332  fKappaMaxCut(ref.fKappaMaxCut),
333  fHistoEtaDistV0s(NULL),
334  fHistoEtaDistV0sAfterdEdxCuts(NULL),
335  fHistodEdxCuts(NULL),
336  fHistoTPCdEdxbefore(NULL),
337  fHistoTPCdEdxafter(NULL),
338  fHistoTPCdEdxSigbefore(NULL),
339  fHistoTPCdEdxSigafter(NULL),
340  fHistoKappaafter(NULL),
341  fHistoTOFbefore(NULL),
342  fHistoTOFSigbefore(NULL),
343  fHistoTOFSigafter(NULL),
344  fHistoITSSigbefore(NULL),
345  fHistoITSSigafter(NULL),
346  fHistoPsiPairDeltaPhiafter(NULL),
347  fHistoTrackCuts(NULL),
348  fHistoPhotonCuts(NULL),
349  fHistoInvMassbefore(NULL),
350  fHistoArmenterosbefore(NULL),
351  fHistoInvMassafter(NULL),
352  fHistoArmenterosafter(NULL),
353  fHistoAsymmetryafter(NULL),
354  fHistoAcceptanceCuts(NULL),
355  fHistoCutIndex(NULL),
356  fHistoEventPlanePhi(NULL),
357  fPreSelCut(ref.fPreSelCut),
358  fProcessAODCheck(ref.fProcessAODCheck),
359  fMaterialBudgetWeightsInitialized(ref.fMaterialBudgetWeightsInitialized),
360  fProfileContainingMaterialBudgetWeights(ref.fProfileContainingMaterialBudgetWeights)
361 
362 {
363  // Copy Constructor
364  for(Int_t jj=0;jj<kNCuts;jj++){fCuts[jj]=ref.fCuts[jj];}
365  fCutString=new TObjString((GetCutNumber()).Data());
367  // dont copy histograms (if you like histograms, call InitCutHistograms())
368 }
369 
370 
371 //________________________________________________________________________
373  // Destructor
374  //Deleting fHistograms leads to seg fault it it's added to output collection of a task
375  // if(fHistograms)
376  // delete fHistograms;
377  // fHistograms = NULL;
378  if(fCutString != NULL){
379  delete fCutString;
380  fCutString = NULL;
381  }
383  delete fElectronLabelArray;
384  fElectronLabelArray = NULL;
385  }
386 
387  if(fFAsymmetryCut != NULL){
388  delete fFAsymmetryCut;
389  fFAsymmetryCut = NULL;
390  }
394  }
395 }
396 
397 //________________________________________________________________________
399 
400  // Initialize Cut Histograms for QA (only initialized and filled if function is called)
401  TH1::AddDirectory(kFALSE);
402 
403  if(fHistograms != NULL){
404  delete fHistograms;
405  fHistograms=NULL;
406  }
407  if(fHistograms==NULL){
408  fHistograms=new TList();
409  fHistograms->SetOwner(kTRUE);
410  if(name=="")fHistograms->SetName(Form("ConvCuts_%s",GetCutNumber().Data()));
411  else fHistograms->SetName(Form("%s_%s",name.Data(),GetCutNumber().Data()));
412  }
413 
414  // IsPhotonSelected
415  fHistoCutIndex=new TH1F(Form("IsPhotonSelected %s",GetCutNumber().Data()),"IsPhotonSelected",12,-0.5,11.5);
416  fHistoCutIndex->GetXaxis()->SetBinLabel(kPhotonIn+1,"in");
417  fHistoCutIndex->GetXaxis()->SetBinLabel(kOnFly+1,"onfly");
418  fHistoCutIndex->GetXaxis()->SetBinLabel(kNoTracks+1,"no tracks");
419  fHistoCutIndex->GetXaxis()->SetBinLabel(kNoV0+1,"miss. V0 in AOD");
420  if (!fSwitchToKappa)fHistoCutIndex->GetXaxis()->SetBinLabel(kdEdxCuts+1,"PID");
421  else fHistoCutIndex->GetXaxis()->SetBinLabel(kdEdxCuts+1,"Kappa+[TOF,ITS,TRD] PID");
422  fHistoCutIndex->GetXaxis()->SetBinLabel(kTrackCuts+1,"Track cuts");
423  fHistoCutIndex->GetXaxis()->SetBinLabel(kConvPointFail+1,"ConvPoint fail");
424  fHistoCutIndex->GetXaxis()->SetBinLabel(kPhotonCuts+1,"PhotonCuts");
425  fHistoCutIndex->GetXaxis()->SetBinLabel(kEventPlane+1,"EventPlane");
426  fHistoCutIndex->GetXaxis()->SetBinLabel(kPhotonOut+1,"out");
428 
429  // Track Cuts
430  fHistoTrackCuts=new TH1F(Form("TrackCuts %s",GetCutNumber().Data()),"TrackCuts",9,-0.5,8.5);
431  fHistoTrackCuts->GetXaxis()->SetBinLabel(1,"in");
432  fHistoTrackCuts->GetXaxis()->SetBinLabel(2,"likesign");
433  fHistoTrackCuts->GetXaxis()->SetBinLabel(3,"ntpccl");
434  fHistoTrackCuts->GetXaxis()->SetBinLabel(4,"acceptance");
435  fHistoTrackCuts->GetXaxis()->SetBinLabel(5,"singlept");
436  fHistoTrackCuts->GetXaxis()->SetBinLabel(6,"TPCrefit");
437  fHistoTrackCuts->GetXaxis()->SetBinLabel(7,"kink");
438  fHistoTrackCuts->GetXaxis()->SetBinLabel(8,"out");
440 
441  // Photon Cuts
442  fHistoPhotonCuts=new TH2F(Form("PhotonCuts %s",GetCutNumber().Data()),"PhotonCuts vs p_{T,#gamma}",15,-0.5,14.5,250,0,50);
443  fHistoPhotonCuts->GetXaxis()->SetBinLabel(1,"in");
444  fHistoPhotonCuts->GetXaxis()->SetBinLabel(2,"qtcut");
445  fHistoPhotonCuts->GetXaxis()->SetBinLabel(3,"chi2");
446  fHistoPhotonCuts->GetXaxis()->SetBinLabel(4,"acceptance");
447  fHistoPhotonCuts->GetXaxis()->SetBinLabel(5,"asymmetry");
448  fHistoPhotonCuts->GetXaxis()->SetBinLabel(6,"pidprob");
449  fHistoPhotonCuts->GetXaxis()->SetBinLabel(7,"cortpcclinfo");
450  fHistoPhotonCuts->GetXaxis()->SetBinLabel(8,"PsiPair");
451  fHistoPhotonCuts->GetXaxis()->SetBinLabel(9,"CosPAngle");
452  fHistoPhotonCuts->GetXaxis()->SetBinLabel(10,"DCA R");
453  fHistoPhotonCuts->GetXaxis()->SetBinLabel(11,"DCA Z");
454  fHistoPhotonCuts->GetXaxis()->SetBinLabel(12,"Photon Quality");
455  fHistoPhotonCuts->GetXaxis()->SetBinLabel(13,"out");
457 
459  fProfileContainingMaterialBudgetWeights->SetName("InputMaterialBudgetWeightsPerGamma");
461  }
462 
463  if(!fDoLightOutput){
464  if(preCut){
465  fHistoInvMassbefore=new TH1F(Form("InvMass_before %s",GetCutNumber().Data()),"InvMass_before",1000,0,0.3);
467  fHistoArmenterosbefore=new TH2F(Form("Armenteros_before %s",GetCutNumber().Data()),"Armenteros_before",200,-1,1,1000,0,1.);
469  fHistoEtaDistV0s = new TH1F(Form("Eta_before %s",GetCutNumber().Data()),"Eta_before",2000,-2,2);
471 
472  }
473  fHistoInvMassafter=new TH1F(Form("InvMass_after %s",GetCutNumber().Data()),"InvMass_after",1000,0,0.3);
475  fHistoArmenterosafter=new TH2F(Form("Armenteros_after %s",GetCutNumber().Data()),"Armenteros_after",200,-1,1,250,0,0.25);
478  fHistoAsymmetryafter=new TH2F(Form("Asymmetry_after %s",GetCutNumber().Data()),"Asymmetry_after",150,0.03,20.,200,0,1.);
480  }
481  }
482 
483  fHistoAcceptanceCuts=new TH2F(Form("PhotonAcceptanceCuts %s",GetCutNumber().Data()),"PhotonAcceptanceCuts vs p_{T,#gamma}",11,-0.5,10.5,250,0,50);
484  fHistoAcceptanceCuts->GetXaxis()->SetBinLabel(1,"in");
485  fHistoAcceptanceCuts->GetXaxis()->SetBinLabel(2,"maxR");
486  fHistoAcceptanceCuts->GetXaxis()->SetBinLabel(3,"minR");
487  fHistoAcceptanceCuts->GetXaxis()->SetBinLabel(4,"line");
488  fHistoAcceptanceCuts->GetXaxis()->SetBinLabel(5,"maxZ");
489  fHistoAcceptanceCuts->GetXaxis()->SetBinLabel(6,"eta");
490  fHistoAcceptanceCuts->GetXaxis()->SetBinLabel(7,"phisector");
491  fHistoAcceptanceCuts->GetXaxis()->SetBinLabel(8,"minpt");
492  fHistoAcceptanceCuts->GetXaxis()->SetBinLabel(9,"out");
494 
495  // dEdx Cuts
496  fHistodEdxCuts=new TH2F(Form("dEdxCuts %s",GetCutNumber().Data()),"dEdxCuts vs p_{T,e}",11,-0.5,10.5,250,0,50);
497  fHistodEdxCuts->GetXaxis()->SetBinLabel(1,"in");
498  fHistodEdxCuts->GetXaxis()->SetBinLabel(2,"TPCelectron");
499  fHistodEdxCuts->GetXaxis()->SetBinLabel(3,"TPCpion");
500  fHistodEdxCuts->GetXaxis()->SetBinLabel(4,"TPCpionhighp");
501  fHistodEdxCuts->GetXaxis()->SetBinLabel(5,"TPCkaonlowprej");
502  fHistodEdxCuts->GetXaxis()->SetBinLabel(6,"TPCprotonlowprej");
503  fHistodEdxCuts->GetXaxis()->SetBinLabel(7,"TPCpionlowprej");
504  fHistodEdxCuts->GetXaxis()->SetBinLabel(8,"TOFelectron");
505  fHistodEdxCuts->GetXaxis()->SetBinLabel(9,"ITSelectron");
506  fHistodEdxCuts->GetXaxis()->SetBinLabel(10,"TRDelectron");
507  fHistodEdxCuts->GetXaxis()->SetBinLabel(11,"out");
509 
510  if(!fDoLightOutput){
511  TAxis *AxisBeforedEdx = NULL;
512  TAxis *AxisBeforedEdxSig = NULL;
513  TAxis *AxisBeforeTOF = NULL;
514  TAxis *AxisBeforeTOFSig = NULL;
515  TAxis *AxisBeforeITSSig = NULL;
516  if(preCut){
517  fHistoTPCdEdxbefore=new TH2F(Form("Gamma_dEdx_before %s",GetCutNumber().Data()),"dEdx Gamma before" ,150,0.03,20,800,0,200);
519  AxisBeforedEdx = fHistoTPCdEdxbefore->GetXaxis();
520  fHistoTPCdEdxSigbefore=new TH2F(Form("Gamma_dEdxSig_before %s",GetCutNumber().Data()),"dEdx Sigma Gamma before" ,150,0.03,20,400,-10,10);
522  AxisBeforedEdxSig = fHistoTPCdEdxSigbefore->GetXaxis();
523 
524  fHistoTOFbefore=new TH2F(Form("Gamma_TOF_before %s",GetCutNumber().Data()),"TOF Gamma before" ,150,0.03,20,11000,-1000,10000);
526  AxisBeforeTOF = fHistoTOFbefore->GetXaxis();
527  fHistoTOFSigbefore=new TH2F(Form("Gamma_TOFSig_before %s",GetCutNumber().Data()),"TOF Sigma Gamma before" ,150,0.03,20,400,-6,10);
529  AxisBeforeTOFSig = fHistoTOFSigbefore->GetXaxis();
530 
531  fHistoITSSigbefore=new TH2F(Form("Gamma_ITSSig_before %s",GetCutNumber().Data()),"ITS Sigma Gamma before" ,150,0.03,20,400,-10,10);
533  AxisBeforeITSSig = fHistoITSSigbefore->GetXaxis();
534  }
535 
536  fHistoTPCdEdxSigafter=new TH2F(Form("Gamma_dEdxSig_after %s",GetCutNumber().Data()),"dEdx Sigma Gamma after" ,150,0.03,20,400, -10,10);
538 
539  fHistoTPCdEdxafter=new TH2F(Form("Gamma_dEdx_after %s",GetCutNumber().Data()),"dEdx Gamma after" ,150,0.03,20,800,0,200);
541 
542  fHistoKappaafter=new TH2F(Form("Gamma_Kappa_after %s",GetCutNumber().Data()),"Kappa Gamma after" ,150,0.03,20,200,-20,20);
544 
545  fHistoTOFSigafter=new TH2F(Form("Gamma_TOFSig_after %s",GetCutNumber().Data()),"TOF Sigma Gamma after" ,150,0.03,20,400,-6,10);
547 
548  fHistoITSSigafter=new TH2F(Form("Gamma_ITSSig_after %s",GetCutNumber().Data()),"ITS Sigma Gamma after" ,150,0.03,20,400,-10,10);
550 
551  fHistoEtaDistV0sAfterdEdxCuts = new TH1F(Form("Eta_afterdEdx %s",GetCutNumber().Data()),"Eta_afterdEdx",2000,-2,2);
553 
554  fHistoPsiPairDeltaPhiafter=new TH2F(Form("Gamma_PsiPairDeltaPhi_after %s",GetCutNumber().Data()),"Psi Pair vs Delta Phi Gamma after" ,200,-2,2,200,-2,2);
556 
557  TAxis *AxisAfter = fHistoTPCdEdxSigafter->GetXaxis();
558  Int_t bins = AxisAfter->GetNbins();
559  Double_t from = AxisAfter->GetXmin();
560  Double_t to = AxisAfter->GetXmax();
561  Double_t *newBins = new Double_t[bins+1];
562  newBins[0] = from;
563  Double_t factor = TMath::Power(to/from, 1./bins);
564  for(Int_t i=1; i<=bins; ++i) newBins[i] = factor * newBins[i-1];
565  AxisAfter->Set(bins, newBins);
566  AxisAfter = fHistoTOFSigafter->GetXaxis();
567  AxisAfter->Set(bins, newBins);
568  AxisAfter = fHistoTPCdEdxafter->GetXaxis();
569  AxisAfter->Set(bins, newBins);
570  AxisAfter = fHistoKappaafter->GetXaxis();
571  AxisAfter->Set(bins, newBins);
572  AxisAfter = fHistoITSSigafter->GetXaxis();
573  AxisAfter->Set(bins, newBins);
575  AxisAfter = fHistoAsymmetryafter->GetXaxis();
576  AxisAfter->Set(bins, newBins);
577  }
578  if(preCut){
579  AxisBeforedEdx->Set(bins, newBins);
580  AxisBeforeTOF->Set(bins, newBins);
581  AxisBeforedEdxSig->Set(bins, newBins);
582  AxisBeforeTOFSig->Set(bins, newBins);
583  AxisBeforeITSSig->Set(bins, newBins);
584  }
585  delete [] newBins;
586 
587  // Event Cuts and Info
588  if(!preCut){
589  fHistoEventPlanePhi=new TH1F(Form("EventPlaneMinusPhotonAngle %s",GetCutNumber().Data()),"EventPlaneMinusPhotonAngle",360,-TMath::Pi(),TMath::Pi());
591  }
592  }
593 
594  TH1::AddDirectory(kTRUE);
595 }
596 
597 //________________________________________________________________________
599  // Set Pointer to AliPIDResponse
600 
601  AliAnalysisManager *man=AliAnalysisManager::GetAnalysisManager();
602  if(man) {
603  AliInputEventHandler* inputHandler = (AliInputEventHandler*) (man->GetInputEventHandler());
604  fPIDResponse = (AliPIDResponse*)inputHandler->GetPIDResponse();
605  if(fPIDResponse)return kTRUE;
606 
607  }
608 
609 
610  return kFALSE;
611 }
612 
614 Bool_t AliConversionPhotonCuts::PhotonIsSelectedMC(TParticle *particle,AliMCEvent *mcEvent,Bool_t checkForConvertedGamma){
615  // MonteCarlo Photon Selection
616 
617  if(!mcEvent)return kFALSE;
618 
619  if (particle->GetPdgCode() == 22){
620 
621 
622  if( particle->Eta() > (fEtaCut) || particle->Eta() < (-fEtaCut) )
623  return kFALSE;
624  if(fEtaCutMin>-0.1){
625  if( particle->Eta() < (fEtaCutMin) && particle->Eta() > (-fEtaCutMin) )
626  return kFALSE;
627  }
628 
629  if(particle->GetMother(0) >-1 && mcEvent->Particle(particle->GetMother(0))->GetPdgCode() == 22){
630  return kFALSE; // no photon as mothers!
631  }
632 
633  // removed, decision on primary and secondary taken in main task
634 // if(particle->GetMother(0) >= mcEvent->GetNumberOfPrimaries()){
635 // return kFALSE; // the gamma has a mother, and it is not a primary particle
636 // }
637 
638  if(!checkForConvertedGamma) return kTRUE; // return in case of accepted gamma
639 
640  // looking for conversion gammas (electron + positron from pairbuilding (= 5) )
641  TParticle* ePos = NULL;
642  TParticle* eNeg = NULL;
643 
644  if(particle->GetNDaughters() >= 2){
645  for(Int_t daughterIndex=particle->GetFirstDaughter();daughterIndex<=particle->GetLastDaughter();daughterIndex++){
646  if(daughterIndex<0) continue;
647  TParticle *tmpDaughter = mcEvent->Particle(daughterIndex);
648  if(tmpDaughter->GetUniqueID() == 5){
649  if(tmpDaughter->GetPdgCode() == 11){
650  eNeg = tmpDaughter;
651  } else if(tmpDaughter->GetPdgCode() == -11){
652  ePos = tmpDaughter;
653  }
654  }
655  }
656  }
657 
658  if(ePos == NULL || eNeg == NULL){ // means we do not have two daughters from pair production
659  return kFALSE;
660  }
661 
662  if(fDoAsymPtCut){
663  if((ePos->Pt()<fSinglePtCut || eNeg->Pt()<fSinglePtCut2) && (ePos->Pt()<fSinglePtCut2 || eNeg->Pt()<fSinglePtCut) ){
664  return kFALSE; // no reconstruction below the Pt cut (both (pos and neg) require minimum pT)
665  }
666  } else {
667  if(ePos->Pt()<fSinglePtCut || eNeg->Pt()<fSinglePtCut){
668  return kFALSE; // no reconstruction below the Pt cut
669  }
670  }
671 
672  if( ePos->Eta() > (fEtaCut) || ePos->Eta() < (-fEtaCut) ||
673  eNeg->Eta() > (fEtaCut) || eNeg->Eta() < (-fEtaCut) )
674  return kFALSE;
675 
676  if(fEtaCutMin > -0.1){
677  if( (ePos->Eta() < (fEtaCutMin) && ePos->Eta() > (-fEtaCutMin)) ||
678  (eNeg->Eta() < (fEtaCutMin) && eNeg->Eta() > (-fEtaCutMin)) )
679  return kFALSE;
680  }
681 
682  if(ePos->R()>fMaxR){
683  return kFALSE; // cuts on distance from collision point
684  }
685 
686  if(TMath::Abs(ePos->Vz()) > fMaxZ){
687  return kFALSE; // outside material
688  }
689  if(TMath::Abs(eNeg->Vz()) > fMaxZ){
690  return kFALSE; // outside material
691  }
692 
693  if( ePos->R() <= ((TMath::Abs(ePos->Vz()) * fLineCutZRSlope) - fLineCutZValue)){
694  return kFALSE; // line cut to exclude regions where we do not reconstruct
695  } else if ( fEtaCutMin != -0.1 && ePos->R() >= ((TMath::Abs(ePos->Vz()) * fLineCutZRSlopeMin) - fLineCutZValueMin)){
696  return kFALSE;
697  }
698 
699  if( eNeg->R() <= ((TMath::Abs(eNeg->Vz()) * fLineCutZRSlope) - fLineCutZValue)){
700  return kFALSE; // line cut to exclude regions where we do not reconstruct
701  } else if ( fEtaCutMin != -0.1 && eNeg->R() >= ((TMath::Abs(eNeg->Vz()) * fLineCutZRSlopeMin) - fLineCutZValueMin)){
702  return kFALSE;
703  }
704 
705  return kTRUE;
706  //if(AcceptanceCut(particle,ePos,eNeg))return kTRUE;
707  }
708  return kFALSE;
709 }
711 Bool_t AliConversionPhotonCuts::PhotonIsSelectedAODMC(AliAODMCParticle *particle,TClonesArray *aodmcArray,Bool_t checkForConvertedGamma){
712  // MonteCarlo Photon Selection
713 
714  if(!aodmcArray)return kFALSE;
715 
716  if (particle->GetPdgCode() == 22){
717  if( particle->Eta() > (fEtaCut) || particle->Eta() < (-fEtaCut) )
718  return kFALSE;
719  if(fEtaCutMin>-0.1){
720  if( particle->Eta() < (fEtaCutMin) && particle->Eta() > (-fEtaCutMin) )
721  return kFALSE;
722  }
723 
724  if(particle->GetMother() > -1 && (static_cast<AliAODMCParticle*>(aodmcArray->At(particle->GetMother())))->GetPdgCode() == 22){
725  return kFALSE; // no photon as mothers!
726  }
727  // removed, decision on primary and secondary taken in main task
728 // Bool_t isPrimary = ((AliConvEventCuts*)fEventCutArray->At(fiCut))->IsConversionPrimaryAOD(fInputEvent, static_cast<AliAODMCParticle*>(aodmcArray->At(particle->GetMother())), mcProdVtxX, mcProdVtxY, mcProdVtxZ);
729 // if(!isPrimary){
730 // return kFALSE; // the gamma has a mother, and it is not a primary particle
731 // }
732 
733  if(!checkForConvertedGamma) return kTRUE; // return in case of accepted gamma
734 
735  // looking for conversion gammas (electron + positron from pairbuilding (= 5) )
736  AliAODMCParticle* ePos = NULL;
737  AliAODMCParticle* eNeg = NULL;
738 
739  if(particle->GetNDaughters() >= 2){
740  for(Int_t daughterIndex=particle->GetDaughter(0);daughterIndex<=particle->GetDaughter(1);daughterIndex++){
741  AliAODMCParticle *tmpDaughter = static_cast<AliAODMCParticle*>(aodmcArray->At(daughterIndex));
742  if(!tmpDaughter) continue;
743  if(((tmpDaughter->GetMCProcessCode())) == 5){ // STILL A BUG IN ALIROOT >>8 HAS TPO BE REMOVED AFTER FIX
744  if(tmpDaughter->GetPdgCode() == 11){
745  eNeg = tmpDaughter;
746  } else if(tmpDaughter->GetPdgCode() == -11){
747  ePos = tmpDaughter;
748  }
749  }
750  }
751  }
752 
753  if(ePos == NULL || eNeg == NULL){ // means we do not have two daughters from pair production
754  return kFALSE;
755  }
756 
757  if(fDoAsymPtCut){
758  if((ePos->Pt()<fSinglePtCut || eNeg->Pt()<fSinglePtCut2) && (ePos->Pt()<fSinglePtCut2 || eNeg->Pt()<fSinglePtCut) ){
759  return kFALSE; // no reconstruction below the Pt cut (both (pos and neg) require minimum pT)
760  }
761  } else {
762  if(ePos->Pt()<fSinglePtCut || eNeg->Pt()<fSinglePtCut){
763  return kFALSE; // no reconstruction below the Pt cut
764  }
765  }
766 
767  if( ePos->Eta() > (fEtaCut) || ePos->Eta() < (-fEtaCut) ||
768  eNeg->Eta() > (fEtaCut) || eNeg->Eta() < (-fEtaCut) )
769  return kFALSE;
770 
771  if(fEtaCutMin > -0.1){
772  if( (ePos->Eta() < (fEtaCutMin) && ePos->Eta() > (-fEtaCutMin)) ||
773  (eNeg->Eta() < (fEtaCutMin) && eNeg->Eta() > (-fEtaCutMin)) )
774  return kFALSE;
775  }
776 
777  Double_t rPos = sqrt( (ePos->Xv()*ePos->Xv()) + (ePos->Yv()*ePos->Yv()) );
778  Double_t rNeg = sqrt( (eNeg->Xv()*eNeg->Xv()) + (eNeg->Yv()*eNeg->Yv()) );
779 
780  if(rPos>fMaxR){
781  return kFALSE; // cuts on distance from collision point
782  }
783  if(TMath::Abs(ePos->Zv()) > fMaxZ){
784  return kFALSE; // outside material
785  }
786  if(TMath::Abs(eNeg->Zv()) > fMaxZ){
787  return kFALSE; // outside material
788  }
789 
790  if( rPos <= ((TMath::Abs(ePos->Zv()) * fLineCutZRSlope) - fLineCutZValue)){
791  return kFALSE; // line cut to exclude regions where we do not reconstruct
792  } else if ( fEtaCutMin != -0.1 && rPos >= ((TMath::Abs(ePos->Zv()) * fLineCutZRSlopeMin) - fLineCutZValueMin)){
793  return kFALSE;
794  }
795 
796  if( rNeg <= ((TMath::Abs(eNeg->Zv()) * fLineCutZRSlope) - fLineCutZValue)){
797  return kFALSE; // line cut to exclude regions where we do not reconstruct
798  } else if ( fEtaCutMin != -0.1 && rNeg >= ((TMath::Abs(eNeg->Zv()) * fLineCutZRSlopeMin) - fLineCutZValueMin)){
799  return kFALSE;
800  }
801 
802  return kTRUE;
803  //if(AcceptanceCut(particle,ePos,eNeg))return kTRUE;
804  }
805  return kFALSE;
806 }
807 
809 Bool_t AliConversionPhotonCuts::PhotonCuts(AliConversionPhotonBase *photon,AliVEvent *event){ // Specific Photon Cuts
810 
811  Int_t cutIndex = 0;
812  if(fHistoPhotonCuts)fHistoPhotonCuts->Fill(cutIndex, photon->GetPhotonPt());
813  cutIndex++;
814 
815  // Fill Histos before Cuts
816  if(fHistoInvMassbefore)fHistoInvMassbefore->Fill(photon->GetMass());
818 
819  // Gamma selection based on QT from Armenteros
820  if(fDoQtGammaSelection == kTRUE){
821  if(!ArmenterosQtCut(photon)){
822  if(fHistoPhotonCuts)fHistoPhotonCuts->Fill(cutIndex, photon->GetPhotonPt()); //1
823  return kFALSE;
824  }
825  }
826  cutIndex++; //2
827 
828  // Chi Cut
829  if(photon->GetChi2perNDF() > fChi2CutConversion || photon->GetChi2perNDF() <=0){
830  {
831  if(fHistoPhotonCuts)fHistoPhotonCuts->Fill(cutIndex, photon->GetPhotonPt()); //2
832  return kFALSE;
833  }
834  }
835  cutIndex++;//3
836 
837  // Reconstruction Acceptance Cuts
838  if(!AcceptanceCuts(photon)){
839  if(fHistoPhotonCuts)fHistoPhotonCuts->Fill(cutIndex, photon->GetPhotonPt()); //3
840  return kFALSE;
841  }
842 
843  cutIndex++; //4
844  // Asymmetry Cut
845  if(fDoPhotonAsymmetryCut == kTRUE){
846  if(!AsymmetryCut(photon,event)){
847  if(fHistoPhotonCuts)fHistoPhotonCuts->Fill(cutIndex, photon->GetPhotonPt()); //4
848  return kFALSE;
849  }
850  }
851 
852  //Check the pid probability
853  cutIndex++; //5
854  if(!PIDProbabilityCut(photon, event)) {
855  if(fHistoPhotonCuts)fHistoPhotonCuts->Fill(cutIndex, photon->GetPhotonPt()); //5
856  return kFALSE;
857  }
858 
859  cutIndex++; //6
860  if(!CorrectedTPCClusterCut(photon, event)) {
861  if(fHistoPhotonCuts)fHistoPhotonCuts->Fill(cutIndex, photon->GetPhotonPt()); //6
862  return kFALSE;
863  }
864 
865  Double_t magField = event->GetMagneticField();
866  if( magField < 0.0 ){
867  magField = 1.0;
868  } else {
869  magField = -1.0;
870  }
871 
872  AliVTrack * electronCandidate = GetTrack(event,photon->GetTrackLabelNegative());
873  AliVTrack * positronCandidate = GetTrack(event,photon->GetTrackLabelPositive());
874  Double_t deltaPhi = magField * TVector2::Phi_mpi_pi( electronCandidate->Phi()-positronCandidate->Phi());
875 
876  cutIndex++; //7
877  if(!PsiPairCut(photon)) {
878  if(fHistoPhotonCuts)fHistoPhotonCuts->Fill(cutIndex, photon->GetPhotonPt()); //7
879  return kFALSE;
880  }
881 
882  cutIndex++; //8
883  if(!CosinePAngleCut(photon, event)) {
884  if(fHistoPhotonCuts)fHistoPhotonCuts->Fill(cutIndex, photon->GetPhotonPt()); //8
885  return kFALSE;
886  }
887 
888  AliAODConversionPhoton* photonAOD = dynamic_cast<AliAODConversionPhoton*>(photon);
889  if (photonAOD){
890  photonAOD->CalculateDistanceOfClossetApproachToPrimVtx(event->GetPrimaryVertex());
891 
892  cutIndex++; //9
893  if(photonAOD->GetDCArToPrimVtx() > fDCARPrimVtxCut) { //DCA R cut of photon to primary vertex
894  if(fHistoPhotonCuts)fHistoPhotonCuts->Fill(cutIndex, photon->GetPhotonPt()); //9
895  return kFALSE;
896  }
897 
898  cutIndex++; //10
899  if(TMath::Abs(photonAOD->GetDCAzToPrimVtx()) > fDCAZPrimVtxCut) { //DCA Z cut of photon to primary vertex
900  if(fHistoPhotonCuts)fHistoPhotonCuts->Fill(cutIndex, photon->GetPhotonPt()); //10
901  return kFALSE;
902  }
903  } else {
904  cutIndex++; //9
905  cutIndex++; //10
906  }
907  cutIndex++; //11
908 
909  if (photonAOD){
910  UChar_t photonQuality = 0;
911  AliAODEvent * aodEvent = dynamic_cast<AliAODEvent*>(event);
912  if(aodEvent) {
913  photonQuality = DeterminePhotonQualityAOD(photonAOD, event);
914  } else {
915  photonQuality = photonAOD->GetPhotonQuality();
916  }
917  if (fDoPhotonQualitySelectionCut && photonQuality != fPhotonQualityCut){
918  if(fHistoPhotonCuts)fHistoPhotonCuts->Fill(cutIndex, photon->GetPhotonPt()); //11
919  return kFALSE;
920  }
921  }
922  cutIndex++; //12
923  if(fHistoPhotonCuts)fHistoPhotonCuts->Fill(cutIndex, photon->GetPhotonPt()); //11
924 
925  // Histos after Cuts
926  if(fHistoInvMassafter)fHistoInvMassafter->Fill(photon->GetMass());
929  if(fHistoKappaafter)fHistoKappaafter->Fill(photon->GetPhotonPt(), GetKappaTPC(photon, event));
931  if(photon->GetPhotonP()!=0 && electronCandidate->P()!=0)fHistoAsymmetryafter->Fill(photon->GetPhotonP(),electronCandidate->P()/photon->GetPhotonP());
932  }
933  return kTRUE;
934 
935 }
936 
938 Bool_t AliConversionPhotonCuts::CorrectedTPCClusterCut(AliConversionPhotonBase *photon, AliVEvent * event){ //Cut on corrected TPC Cluster Info
939 
940  AliVTrack * negTrack = GetTrack(event, photon->GetTrackLabelNegative());
941  AliVTrack * posTrack = GetTrack(event, photon->GetTrackLabelPositive());
942 
943  if(!negTrack||!posTrack)return kFALSE;
944 
945  Double_t negclsToF=0;
946 
948  if(negTrack->GetTPCNclsF()!=0){
949  negclsToF = (Double_t)negTrack->GetNcls(1)/(Double_t)negTrack->GetTPCNclsF();}// Ncluster/Nfindablecluster
950  }
951  else {
952  negclsToF = negTrack->GetTPCClusterInfo(2,0,GetFirstTPCRow(photon->GetConversionRadius()));
953  }
954 
955  Double_t posclsToF = 0.;
957  if(posTrack->GetTPCNclsF()!=0){
958  posclsToF = (Double_t)posTrack->GetNcls(1)/(Double_t)posTrack->GetTPCNclsF();
959  }
960  }else{
961  posclsToF = posTrack->GetTPCClusterInfo(2,0,GetFirstTPCRow(photon->GetConversionRadius()));
962  }
963 
964  if( negclsToF < fMinClsTPCToF || posclsToF < fMinClsTPCToF ){
965  return kFALSE;
966  }
967 
968  return kTRUE;
969 }
970 
973  //Selection of Reconstructed Photons
974 
976 
977  if(event->IsA()==AliESDEvent::Class()) {
978  if(!SelectV0Finder( ( ((AliESDEvent*)event)->GetV0(photon->GetV0Index()))->GetOnFlyStatus() ) ){
980  return kFALSE;
981  }
982  }
983 
984  // Get Tracks
985  AliVTrack * negTrack = GetTrack(event, photon->GetTrackLabelNegative());
986  AliVTrack * posTrack = GetTrack(event, photon->GetTrackLabelPositive());
987 
988  if(!negTrack || !posTrack) {
990  return kFALSE;
991  }
992 
993  // check if V0 from AliAODGammaConversion.root is actually contained in AOD by checking if V0 exists with same tracks
994  if(event->IsA()==AliAODEvent::Class() && fPreSelCut && ( fIsHeavyIon != 1 || (fIsHeavyIon == 1 && fProcessAODCheck) )) {
995  AliAODEvent* aodEvent = dynamic_cast<AliAODEvent*>(event);
996 
997  Bool_t bFound = kFALSE;
998  Int_t v0PosID = posTrack->GetID();
999  Int_t v0NegID = negTrack->GetID();
1000  AliAODv0* v0 = NULL;
1001  for(Int_t iV=0; iV<aodEvent->GetNumberOfV0s(); iV++){
1002  v0 = aodEvent->GetV0(iV);
1003  if(!v0) continue;
1004  if( (v0PosID == v0->GetPosID() && v0NegID == v0->GetNegID()) || (v0PosID == v0->GetNegID() && v0NegID == v0->GetPosID()) ){
1005  bFound = kTRUE;
1006  break;
1007  }
1008  }
1009  if(!bFound){
1011  return kFALSE;
1012  }
1013  }
1014 
1015  photon->DeterminePhotonQuality(negTrack,posTrack);
1016  // Track Cuts
1017  if(!TracksAreSelected(negTrack, posTrack)){
1019  return kFALSE;
1020  }
1021  if (fHistoEtaDistV0s)fHistoEtaDistV0s->Fill(photon->GetPhotonEta());
1022  // dEdx Cuts
1023 
1024  if(!KappaCuts(photon, event) || !dEdxCuts(negTrack) || !dEdxCuts(posTrack)) {
1026  return kFALSE;
1027  }
1028 
1030  // Photon Cuts
1031  if(!PhotonCuts(photon,event)){
1033  return kFALSE;
1034  }
1035 
1036  // Photon passed cuts
1038  return kTRUE;
1039 }
1040 
1043  if(fDo2DQt){
1044  if ( !(TMath::Power(photon->GetArmenterosAlpha()/0.95,2)+TMath::Power(photon->GetArmenterosQt()/fQtMax,2) < 1) ){
1045  return kFALSE;
1046  }
1047  } else {
1048  if(photon->GetArmenterosQt()>fQtMax){
1049  return kFALSE;
1050  }
1051  }
1052  return kTRUE;
1053 }
1054 
1055 
1058  // Exclude certain areas for photon reconstruction
1059 
1060  Int_t cutIndex=0;
1061  if(fHistoAcceptanceCuts)fHistoAcceptanceCuts->Fill(cutIndex, photon->GetPhotonPt());
1062  cutIndex++;
1063 
1064  if(photon->GetConversionRadius()>fMaxR){ // cuts on distance from collision point
1065  if(fHistoAcceptanceCuts)fHistoAcceptanceCuts->Fill(cutIndex, photon->GetPhotonPt());
1066  return kFALSE;
1067  }
1068  cutIndex++;
1069 
1070  if(photon->GetConversionRadius()<fMinR){ // cuts on distance from collision point
1071  if(fHistoAcceptanceCuts)fHistoAcceptanceCuts->Fill(cutIndex, photon->GetPhotonPt());
1072  return kFALSE;
1073  }
1074  cutIndex++;
1075 
1076  if(photon->GetConversionRadius() <= ((TMath::Abs(photon->GetConversionZ())*fLineCutZRSlope)-fLineCutZValue)){
1077  if(fHistoAcceptanceCuts)fHistoAcceptanceCuts->Fill(cutIndex, photon->GetPhotonPt());
1078  return kFALSE;
1079  }
1080  else if (fUseEtaMinCut && photon->GetConversionRadius() >= ((TMath::Abs(photon->GetConversionZ())*fLineCutZRSlopeMin)-fLineCutZValueMin )){
1081  if(fHistoAcceptanceCuts)fHistoAcceptanceCuts->Fill(cutIndex, photon->GetPhotonPt());
1082  return kFALSE;
1083  }
1084  cutIndex++;
1085 
1086  if(TMath::Abs(photon->GetConversionZ()) > fMaxZ ){ // cuts out regions where we do not reconstruct
1087  if(fHistoAcceptanceCuts)fHistoAcceptanceCuts->Fill(cutIndex, photon->GetPhotonPt());
1088  return kFALSE;
1089  }
1090  cutIndex++;
1091 
1092 
1093  if( photon->GetPhotonEta() > (fEtaCut) || photon->GetPhotonEta() < (-fEtaCut) ){
1094  if(fHistoAcceptanceCuts)fHistoAcceptanceCuts->Fill(cutIndex, photon->GetPhotonPt());
1095  return kFALSE;
1096  }
1097  if(fEtaCutMin>-0.1){
1098  if( photon->GetPhotonEta() < (fEtaCutMin) && photon->GetPhotonEta() > (-fEtaCutMin) ){
1099  if(fHistoAcceptanceCuts)fHistoAcceptanceCuts->Fill(cutIndex, photon->GetPhotonPt());
1100  return kFALSE;
1101  }
1102  }
1103  cutIndex++;
1104 
1106  if(photon->GetPhotonEta() > fEtaForPhiCutMin && photon->GetPhotonEta() < fEtaForPhiCutMax ){
1107  if (fMinPhiCut < fMaxPhiCut){
1108  if( photon->GetPhotonPhi() > fMinPhiCut && photon->GetPhotonPhi() < fMaxPhiCut ) {
1109  if(fHistoAcceptanceCuts)fHistoAcceptanceCuts->Fill(cutIndex, photon->GetPhotonPt());
1110  return kFALSE;
1111  }
1112  } else {
1113  Double_t photonPhi = photon->GetPhotonPhi();
1114  if (photon->GetPhotonPhi() < TMath::Pi()) photonPhi = photon->GetPhotonPhi() + 2*TMath::Pi();
1115  if( photonPhi > fMinPhiCut && photonPhi < fMaxPhiCut+2*TMath::Pi() ) {
1116  if(fHistoAcceptanceCuts)fHistoAcceptanceCuts->Fill(cutIndex, photon->GetPhotonPt());
1117  return kFALSE;
1118  }
1119  }
1120  }
1121  }
1122  cutIndex++;
1123 
1124 
1125 
1126  if(photon->GetPhotonPt()<fPtCut){
1127  if(fHistoAcceptanceCuts)fHistoAcceptanceCuts->Fill(cutIndex, photon->GetPhotonPt());
1128  return kFALSE;
1129  }
1130  cutIndex++;
1131 
1132  if(fHistoAcceptanceCuts)fHistoAcceptanceCuts->Fill(cutIndex, photon->GetPhotonPt());
1133 
1134  return kTRUE;
1135 }
1136 
1137 
1139 Bool_t AliConversionPhotonCuts::SpecificTrackCuts(AliAODTrack * negTrack, AliAODTrack * posTrack,Int_t &cutIndex) {
1140  // Track Cuts which require AOD/ESD specific implementation
1141 
1142  if( !negTrack->IsOn(AliESDtrack::kTPCrefit) || !posTrack->IsOn(AliESDtrack::kTPCrefit) ) {
1143  if(fHistoTrackCuts)fHistoTrackCuts->Fill(cutIndex);
1144  return kFALSE;
1145  }
1146  cutIndex++;
1147 
1148  AliAODVertex * NegVtxType=negTrack->GetProdVertex();
1149  AliAODVertex * PosVtxType=posTrack->GetProdVertex();
1150  if( (NegVtxType->GetType())==AliAODVertex::kKink || (PosVtxType->GetType())==AliAODVertex::kKink) {
1151  if(fHistoTrackCuts)fHistoTrackCuts->Fill(cutIndex);
1152  return kFALSE;
1153  }
1154  return kTRUE;
1155 
1156 }
1157 
1158 
1160 Bool_t AliConversionPhotonCuts::SpecificTrackCuts(AliESDtrack * negTrack, AliESDtrack * posTrack,Int_t &cutIndex) {
1161  // Track Cuts which require AOD/ESD specific implementation
1162 
1163  if( !negTrack->IsOn(AliESDtrack::kTPCrefit) || !posTrack->IsOn(AliESDtrack::kTPCrefit) ) {
1164  if(fHistoTrackCuts)fHistoTrackCuts->Fill(cutIndex);
1165  return kFALSE;
1166  }
1167  cutIndex++;
1168 
1169  if(negTrack->GetKinkIndex(0) > 0 || posTrack->GetKinkIndex(0) > 0 ) {
1170  if(fHistoTrackCuts)fHistoTrackCuts->Fill(cutIndex);
1171  return kFALSE;
1172  }
1173  return kTRUE;
1174 }
1175 
1176 
1177 
1179 Bool_t AliConversionPhotonCuts::TracksAreSelected(AliVTrack * negTrack, AliVTrack * posTrack) {
1180  // Track Selection for Photon Reconstruction
1181 
1182  Int_t cutIndex=0;
1183  if(fHistoTrackCuts)fHistoTrackCuts->Fill(cutIndex);
1184  cutIndex++;
1185 
1186  // avoid like sign
1188  if(negTrack->Charge() == posTrack->Charge()) {
1189  if(fHistoTrackCuts)fHistoTrackCuts->Fill(cutIndex);
1190  return kFALSE;
1191  }
1192  }else if(fUseOnFlyV0FinderSameSign==1){
1193  if(negTrack->Charge() != posTrack->Charge()) {
1194  if(fHistoTrackCuts)fHistoTrackCuts->Fill(cutIndex);
1195  return kFALSE;
1196  }
1197  }
1198  cutIndex++;
1199 
1200  // Number of TPC Clusters
1201 
1202 
1203  if( negTrack->GetNcls(1) < fMinClsTPC || posTrack->GetNcls(1) < fMinClsTPC ) {
1204  if(fHistoTrackCuts)fHistoTrackCuts->Fill(cutIndex);
1205  return kFALSE;
1206  }
1207  cutIndex++;
1208 
1209  // Acceptance
1210  if( posTrack->Eta() > (fEtaCut) || posTrack->Eta() < (-fEtaCut) ||
1211  negTrack->Eta() > (fEtaCut) || negTrack->Eta() < (-fEtaCut) ){
1212  if(fHistoTrackCuts)fHistoTrackCuts->Fill(cutIndex);
1213  return kFALSE;
1214  }
1215  if(fEtaCutMin>-0.1){
1216  if( (posTrack->Eta() < (fEtaCutMin) && posTrack->Eta() > (-fEtaCutMin)) ||
1217  (negTrack->Eta() < (fEtaCutMin) && negTrack->Eta() > (-fEtaCutMin)) ){
1218  if(fHistoTrackCuts)fHistoTrackCuts->Fill(cutIndex);
1219  return kFALSE;
1220  }
1221  }
1222  cutIndex++;
1223 
1224  // Single Pt Cut
1225  if(fDoAsymPtCut){
1226  if((posTrack->Pt()<fSinglePtCut || negTrack->Pt()<fSinglePtCut2) && (posTrack->Pt()<fSinglePtCut2 || negTrack->Pt()<fSinglePtCut) ){
1227  if(fHistoTrackCuts)fHistoTrackCuts->Fill(cutIndex);
1228  return kFALSE;
1229  }
1230  } else {
1231  if(posTrack->Pt()<fSinglePtCut || negTrack->Pt()<fSinglePtCut){
1232  if(fHistoTrackCuts)fHistoTrackCuts->Fill(cutIndex);
1233  return kFALSE;
1234  }
1235  }
1236  cutIndex++;
1237 
1238  // AOD ESD specific cuts
1239  Bool_t passCuts = kTRUE;
1240 
1241  if(negTrack->IsA()==AliAODTrack::Class()) {
1242  passCuts = passCuts * SpecificTrackCuts(static_cast<AliAODTrack*>(negTrack), static_cast<AliAODTrack*>(posTrack),cutIndex);
1243  } else {
1244  passCuts = passCuts * SpecificTrackCuts(static_cast<AliESDtrack*>(negTrack), static_cast<AliESDtrack*>(posTrack),cutIndex);
1245  }
1246 
1247  if(!passCuts){
1248  if(fHistoTrackCuts)fHistoTrackCuts->Fill(cutIndex);
1249  return kFALSE;
1250  }
1251  cutIndex++;
1252 
1253  if(fHistoTrackCuts)fHistoTrackCuts->Fill(cutIndex);
1254 
1255  return kTRUE;
1256 
1257 }
1260 
1261  if(!fPIDResponse){InitPIDResponse();}// Try to reinitialize PID Response
1262  if(!fPIDResponse){AliError("No PID Response"); return kTRUE;}// if still missing fatal error
1263 
1264  AliVTrack * negTrack = GetTrack(event, gamma->GetTrackLabelNegative());
1265  AliVTrack * posTrack = GetTrack(event, gamma->GetTrackLabelPositive());
1266 
1267  Float_t KappaPlus, KappaMinus, Kappa;
1268  KappaMinus = fPIDResponse->NumberOfSigmasTPC(negTrack, AliPID::kElectron);
1269  KappaPlus = fPIDResponse->NumberOfSigmasTPC(posTrack, AliPID::kElectron);
1270  Kappa = ( TMath::Abs(KappaMinus) + TMath::Abs(KappaPlus) ) / 2.0 + 2.0*(KappaMinus+KappaPlus);
1271 
1272  return Kappa;
1273 
1274 }
1276 Bool_t AliConversionPhotonCuts::dEdxCuts(AliVTrack *fCurrentTrack){
1277  // Electron Identification Cuts for Photon reconstruction
1278  if(!fPIDResponse){InitPIDResponse();}// Try to reinitialize PID Response
1279  if(!fPIDResponse){AliError("No PID Response"); return kTRUE;}// if still missing fatal error
1280 
1281  Int_t cutIndex=0;
1282  if(fHistodEdxCuts)fHistodEdxCuts->Fill(cutIndex,fCurrentTrack->Pt());
1283  if(fHistoTPCdEdxSigbefore)fHistoTPCdEdxSigbefore->Fill(fCurrentTrack->P(),fPIDResponse->NumberOfSigmasTPC(fCurrentTrack, AliPID::kElectron));
1284  if(fHistoTPCdEdxbefore)fHistoTPCdEdxbefore->Fill(fCurrentTrack->P(),fCurrentTrack->GetTPCsignal());
1285  cutIndex++;
1286  if(fDodEdxSigmaCut == kTRUE && !fSwitchToKappa){
1287  // TPC Electron Line
1288  if( fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kElectron)<fPIDnSigmaBelowElectronLine ||
1289  fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kElectron)>fPIDnSigmaAboveElectronLine){
1290 
1291  if(fHistodEdxCuts)fHistodEdxCuts->Fill(cutIndex,fCurrentTrack->Pt());
1292  return kFALSE;
1293  }
1294  cutIndex++;
1295 
1296  // TPC Pion Line
1297  if( fCurrentTrack->P()>fPIDMinPnSigmaAbovePionLine && fCurrentTrack->P()<fPIDMaxPnSigmaAbovePionLine ){
1298  if(fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kElectron)>fPIDnSigmaBelowElectronLine &&
1299  fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kElectron)<fPIDnSigmaAboveElectronLine&&
1300  fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kPion)<fPIDnSigmaAbovePionLine){
1301 
1302  if(fHistodEdxCuts)fHistodEdxCuts->Fill(cutIndex,fCurrentTrack->Pt());
1303  return kFALSE;
1304  }
1305  }
1306  cutIndex++;
1307 
1308  // High Pt Pion rej
1309  if( fCurrentTrack->P()>fPIDMaxPnSigmaAbovePionLine ){
1310  if(fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kElectron)>fPIDnSigmaBelowElectronLine &&
1311  fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kElectron)<fPIDnSigmaAboveElectronLine &&
1312  fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kPion)<fPIDnSigmaAbovePionLineHighPt){
1313 
1314  if(fHistodEdxCuts)fHistodEdxCuts->Fill(cutIndex,fCurrentTrack->Pt());
1315  return kFALSE;
1316  }
1317  }
1318  cutIndex++;
1319  }
1320  else{cutIndex+=3;}
1321 
1322  if(fDoKaonRejectionLowP == kTRUE && !fSwitchToKappa){
1323  if(fCurrentTrack->P()<fPIDMinPKaonRejectionLowP ){
1324  if( TMath::Abs(fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kKaon))<fPIDnSigmaAtLowPAroundKaonLine){
1325 
1326  if(fHistodEdxCuts)fHistodEdxCuts->Fill(cutIndex,fCurrentTrack->Pt());
1327  return kFALSE;
1328  }
1329  }
1330  }
1331  cutIndex++;
1332  if(fDoProtonRejectionLowP == kTRUE && !fSwitchToKappa){
1333  if( fCurrentTrack->P()<fPIDMinPProtonRejectionLowP ){
1334  if( TMath::Abs(fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kProton))<fPIDnSigmaAtLowPAroundProtonLine){
1335 
1336  if(fHistodEdxCuts)fHistodEdxCuts->Fill(cutIndex,fCurrentTrack->Pt());
1337  return kFALSE;
1338  }
1339  }
1340  }
1341  cutIndex++;
1342 
1343  if(fDoPionRejectionLowP == kTRUE && !fSwitchToKappa){
1344  if( fCurrentTrack->P()<fPIDMinPPionRejectionLowP ){
1345  if( TMath::Abs(fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kPion))<fPIDnSigmaAtLowPAroundPionLine){
1346 
1347  if(fHistodEdxCuts)fHistodEdxCuts->Fill(cutIndex,fCurrentTrack->Pt());
1348  return kFALSE;
1349  }
1350  }
1351  }
1352  cutIndex++;
1353 
1354 
1355  // cout<<"Start"<<endl;
1356  // AliPIDResponse::EDetPidStatus status=fPIDResponse->CheckPIDStatus(AliPIDResponse::kTOF,fCurrentTrack);
1357 
1358  // if( ( (status & AliVTrack::kTOFout) == AliVTrack::kTOFout ) && ( (status & AliVTrack::kTIME) == AliVTrack::kTIME ))
1359  // {cout<<"TOF DA"<<endl;}
1360  // if(status == AliPIDResponse::kDetPidOk){
1361  // Float_t probMis = fPIDResponse->GetTOFMismatchProbability(fCurrentTrack);
1362  // cout<<"--> "<<probMis<<endl;
1363  // if(probMis > 0.01){
1364 
1365  // }
1366  // }
1367 
1368  if((fCurrentTrack->GetStatus() & AliESDtrack::kTOFpid ) && !(fCurrentTrack->GetStatus() & AliESDtrack::kTOFmismatch)){
1369  if(fHistoTOFbefore){
1370  Double_t t0 = fPIDResponse->GetTOFResponse().GetStartTime(fCurrentTrack->P());
1371  Double_t times[AliPID::kSPECIESC];
1372  fCurrentTrack->GetIntegratedTimes(times,AliPID::kSPECIESC);
1373  Double_t TOFsignal = fCurrentTrack->GetTOFsignal();
1374  Double_t dT = TOFsignal - t0 - times[0];
1375  fHistoTOFbefore->Fill(fCurrentTrack->P(),dT);
1376  }
1377  if(fHistoTOFSigbefore) fHistoTOFSigbefore->Fill(fCurrentTrack->P(),fPIDResponse->NumberOfSigmasTOF(fCurrentTrack, AliPID::kElectron));
1378  if(fUseTOFpid){
1379  if(fPIDResponse->NumberOfSigmasTOF(fCurrentTrack, AliPID::kElectron)>fTofPIDnSigmaAboveElectronLine ||
1380  fPIDResponse->NumberOfSigmasTOF(fCurrentTrack, AliPID::kElectron)<fTofPIDnSigmaBelowElectronLine ){
1381  if(fHistodEdxCuts)fHistodEdxCuts->Fill(cutIndex,fCurrentTrack->Pt());
1382  return kFALSE;
1383  }
1384  }
1385  if(fHistoTOFSigafter)fHistoTOFSigafter->Fill(fCurrentTrack->P(),fPIDResponse->NumberOfSigmasTOF(fCurrentTrack, AliPID::kElectron));
1386  }
1387  cutIndex++;
1388 
1389  if((fCurrentTrack->GetStatus() & AliESDtrack::kITSpid)){
1390  if(fHistoITSSigbefore) fHistoITSSigbefore->Fill(fCurrentTrack->P(),fPIDResponse->NumberOfSigmasITS(fCurrentTrack, AliPID::kElectron));
1391  if(fUseITSpid){
1392  if(fCurrentTrack->Pt()<=fMaxPtPIDITS){
1393  if(fPIDResponse->NumberOfSigmasITS(fCurrentTrack, AliPID::kElectron)>fITSPIDnSigmaAboveElectronLine || fPIDResponse->NumberOfSigmasITS(fCurrentTrack, AliPID::kElectron)<fITSPIDnSigmaBelowElectronLine ){
1394  if(fHistodEdxCuts)fHistodEdxCuts->Fill(cutIndex,fCurrentTrack->Pt());
1395  return kFALSE;
1396  }
1397  }
1398  }
1399  if(fHistoITSSigafter)fHistoITSSigafter->Fill(fCurrentTrack->P(),fPIDResponse->NumberOfSigmasITS(fCurrentTrack, AliPID::kElectron));
1400  }
1401 
1402  cutIndex++;
1403 
1404  // Apply TRD PID
1405  if(fDoTRDPID){
1406  if(!fPIDResponse->IdentifiedAsElectronTRD(fCurrentTrack,fPIDTRDEfficiency)){
1407  if(fHistodEdxCuts)fHistodEdxCuts->Fill(cutIndex,fCurrentTrack->Pt());
1408  return kFALSE;
1409  }
1410  }
1411  cutIndex++;
1412 
1413  if(fHistodEdxCuts)fHistodEdxCuts->Fill(cutIndex,fCurrentTrack->Pt());
1414  if(fHistoTPCdEdxSigafter)fHistoTPCdEdxSigafter->Fill(fCurrentTrack->P(),fPIDResponse->NumberOfSigmasTPC(fCurrentTrack, AliPID::kElectron));
1415  if(fHistoTPCdEdxafter)fHistoTPCdEdxafter->Fill(fCurrentTrack->P(),fCurrentTrack->GetTPCsignal());
1416 
1417  return kTRUE;
1418 }
1419 
1421  // abort if Kappa selection not enabled
1422  if (!fSwitchToKappa) return kTRUE;
1423 
1424  Float_t kappa = GetKappaTPC(photon, event);
1425  if (kappa < fKappaMinCut) return kFALSE;
1426  if (kappa > fKappaMaxCut) return kFALSE;
1427  return kTRUE;
1428 }
1429 
1432  // Cut on Energy Assymetry
1433 
1434  for(Int_t ii=0;ii<2;ii++){
1435 
1436  AliVTrack *track=GetTrack(event,photon->GetTrackLabel(ii));
1437 
1439  Double_t trackNegAsy=0;
1440  if (photon->GetPhotonP()!=0.){
1441  trackNegAsy= track->P()/photon->GetPhotonP();
1442  }
1443 
1444  if( trackNegAsy > fFAsymmetryCut->Eval(photon->GetPhotonP()) || trackNegAsy < 1.-fFAsymmetryCut->Eval(photon->GetPhotonP()) ){
1445  return kFALSE;
1446  }
1447 
1448  } else {
1449  if( track->P() > fMinPPhotonAsymmetryCut ){
1450  Double_t trackNegAsy=0;
1451  if (photon->GetPhotonP()!=0.){
1452  trackNegAsy= track->P()/photon->GetPhotonP();
1453  }
1454 
1455  if( trackNegAsy<fMinPhotonAsymmetry ||trackNegAsy>(1.- fMinPhotonAsymmetry)){
1456  return kFALSE;
1457  }
1458  }
1459  }
1460 
1461  }
1462  return kTRUE;
1463 }
1464 
1466 AliVTrack *AliConversionPhotonCuts::GetTrack(AliVEvent * event, Int_t label){
1467  //Returns pointer to the track with given ESD label
1468  //(Important for AOD implementation, since Track array in AOD data is different
1469  //from ESD array, but ESD tracklabels are stored in AOD Tracks)
1470 
1471  AliESDEvent * esdEvent = dynamic_cast<AliESDEvent*>(event);
1472  if(esdEvent) {
1473  if(label > event->GetNumberOfTracks() ) return NULL;
1474  AliESDtrack * track = esdEvent->GetTrack(label);
1475  return track;
1476 
1477  } else {
1478  if(label == -999999) return NULL; // if AOD relabelling goes wrong, immediately return NULL
1479  AliVTrack * track = 0x0;
1480  if(((AliV0ReaderV1*)AliAnalysisManager::GetAnalysisManager()->GetTask(fV0ReaderName.Data()))->AreAODsRelabeled()){
1481  if(event->GetTrack(label)) track = dynamic_cast<AliVTrack*>(event->GetTrack(label));
1482  return track;
1483  }
1484  else{
1485  for(Int_t ii=0; ii<event->GetNumberOfTracks(); ii++) {
1486  if(event->GetTrack(ii)) track = dynamic_cast<AliVTrack*>(event->GetTrack(ii));
1487  if(track){
1488  if(track->GetID() == label) {
1489  return track;
1490  }
1491  }
1492  }
1493  }
1494  }
1495  //AliDebug(5,(Form("track not found %d %d",label,event->GetNumberOfTracks()));
1496  return NULL;
1497 }
1498 
1501  //Returns pointer to the track with given ESD label
1502  //(Important for AOD implementation, since Track array in AOD data is different
1503  //from ESD array, but ESD tracklabels are stored in AOD Tracks)
1504 
1505  if(event) {
1506  if(label > event->GetNumberOfTracks() ) return NULL;
1507  AliESDtrack * track = event->GetTrack(label);
1508  return track;
1509  }
1510  //AliDebug(5,(Form("track not found %d %d",label,event->GetNumberOfTracks()));
1511  return NULL;
1512 }
1513 
1514 
1515 
1518  // Cut on Electron Probability for Photon Reconstruction
1519 
1520  AliESDEvent * esdEvent = dynamic_cast<AliESDEvent*>(event);
1521 
1522  if(esdEvent){
1523 
1524  Bool_t iResult=kFALSE;
1525 
1526  Double_t *posProbArray = new Double_t[AliPID::kSPECIES];
1527  Double_t *negProbArray = new Double_t[AliPID::kSPECIES];
1528 
1529  AliESDtrack* negTrack = esdEvent->GetTrack(photon->GetTrackLabelNegative());
1530  AliESDtrack* posTrack = esdEvent->GetTrack(photon->GetTrackLabelPositive());
1531 
1532  if(negProbArray && posProbArray){
1533 
1534  negTrack->GetTPCpid(negProbArray);
1535  posTrack->GetTPCpid(posProbArray);
1536 
1537  if(negProbArray[AliPID::kElectron]>=fPIDProbabilityCutNegativeParticle && posProbArray[AliPID::kElectron]>=fPIDProbabilityCutPositiveParticle){
1538  iResult=kTRUE;
1539  }
1540  }
1541 
1542  delete [] posProbArray;
1543  delete [] negProbArray;
1544  return iResult;
1545 
1546  } else {
1548  return kTRUE;
1549  }
1550 }
1551 
1552 
1554 Bool_t AliConversionPhotonCuts::AcceptanceCut(TParticle *particle, TParticle * ePos,TParticle* eNeg){
1555  // MC Acceptance Cuts
1556  //(Certain areas were excluded for photon reconstruction)
1557 
1558  if(particle->R()>fMaxR){
1559  return kFALSE;}
1560 
1561  if(ePos->R()>fMaxR){
1562  return kFALSE;
1563  }
1564 
1565  if(ePos->R()<fMinR){
1566  return kFALSE;
1567  }
1568 
1569  if( ePos->R() <= ((TMath::Abs(ePos->Vz())*fLineCutZRSlope)-fLineCutZValue)){
1570  return kFALSE;
1571  }
1572  else if (fUseEtaMinCut && ePos->R() >= ((TMath::Abs(ePos->Vz())*fLineCutZRSlopeMin)-fLineCutZValueMin )){
1573  return kFALSE;
1574  }
1575 
1576  if(TMath::Abs(eNeg->Vz()) > fMaxZ ){ // cuts out regions where we do not reconstruct
1577  return kFALSE;
1578  }
1579 
1580  if(eNeg->Vz()!=ePos->Vz()||eNeg->R()!=ePos->R()){
1581  return kFALSE;
1582  }
1583 
1584  if(TMath::Abs(ePos->Vz()) > fMaxZ ){ // cuts out regions where we do not reconstruct
1585  return kFALSE;
1586  }
1587 
1588 
1589  if( particle->Eta() > (fEtaCut) || particle->Eta() < (-fEtaCut) ){
1590  return kFALSE;
1591  }
1592  if( ePos->Eta() > (fEtaCut) || ePos->Eta() < (-fEtaCut) ){
1593  return kFALSE;
1594  }
1595  if( eNeg->Eta() > (fEtaCut) || eNeg->Eta() < (-fEtaCut) ){
1596  return kFALSE;
1597  }
1598  if(fEtaCutMin>-0.1){
1599  if( particle->Eta() < (fEtaCutMin) && particle->Eta() > (-fEtaCutMin) ){
1600  return kFALSE;
1601  }
1602  if( ePos->Eta() < (fEtaCutMin) && ePos->Eta() > (-fEtaCutMin) ){
1603  return kFALSE;
1604  }
1605  if( eNeg->Eta() < (fEtaCutMin) && eNeg->Eta() > (-fEtaCutMin) ){
1606  return kFALSE;
1607  }
1608  }
1609 
1610  if(fDoAsymPtCut){
1611  if((ePos->Pt()<fSinglePtCut || eNeg->Pt()<fSinglePtCut2) && (ePos->Pt()<fSinglePtCut2 || eNeg->Pt()<fSinglePtCut) ){
1612  return kFALSE;
1613  }
1614  } else {
1615  if(ePos->Pt()<fSinglePtCut || eNeg->Pt()<fSinglePtCut){
1616  return kFALSE;
1617  }
1618  }
1619 
1620  if(particle->Pt()<fPtCut){
1621  return kFALSE;
1622  }
1623 
1624  return kTRUE;
1625 }
1629 
1630  if(fCutString && fCutString->GetString().Length() == kNCuts) {
1631  fCutString->SetString(GetCutNumber());
1632  } else {
1633  return kFALSE;
1634  }
1635  return kTRUE;
1636 }
1637 
1638 
1641  fCutStringRead = Form("%s",analysisCutSelection.Data());
1642 
1643  // Initialize Cuts from a given Cut string
1644  AliInfo(Form("Set Photoncut Number: %s",analysisCutSelection.Data()));
1645  if(analysisCutSelection.Length()!=kNCuts) {
1646  AliError(Form("Cut selection has the wrong length! size is %d, number of cuts is %d", analysisCutSelection.Length(), kNCuts));
1647  return kFALSE;
1648  }
1649  if(!analysisCutSelection.IsAlnum()){
1650  AliError("Cut selection is not alphanumeric");
1651  return kFALSE;
1652  }
1653 
1654  TString analysisCutSelectionLowerCase = Form("%s",analysisCutSelection.Data());
1655  analysisCutSelectionLowerCase.ToLower();
1656  const char *cutSelection = analysisCutSelectionLowerCase.Data();
1657  #define ASSIGNARRAY(i) fCuts[i] = ((int)cutSelection[i]>=(int)'a') ? cutSelection[i]-'a'+10 : cutSelection[i]-'0'
1658  for(Int_t ii=0;ii<kNCuts;ii++){
1659  ASSIGNARRAY(ii);
1660  }
1661 
1662  // Set Individual Cuts
1663  for(Int_t ii=0;ii<kNCuts;ii++){
1664  if(!SetCut(cutIds(ii),fCuts[ii]))return kFALSE;
1665  }
1666 
1668 
1669  return kTRUE;
1670 }
1674 
1675  switch (cutID) {
1676 
1677  case kv0FinderType:
1678  if( SetV0Finder(value)) {
1679  fCuts[kv0FinderType] = value;
1680  UpdateCutString();
1681  return kTRUE;
1682  } else return kFALSE;
1683 
1684  case ketaCut:
1685  if( SetEtaCut(value)) {
1686  fCuts[ketaCut] = value;
1687  UpdateCutString();
1688  return kTRUE;
1689  } else return kFALSE;
1690 
1691  case kRCut:
1692  if( SetRCut(value)) {
1693  fCuts[kRCut] = value;
1694  UpdateCutString();
1695  return kTRUE;
1696  } else return kFALSE;
1697 
1698  case kEtaForPhiSector:
1699  if( SetEtaForPhiCut(value)) {
1700  fCuts[kEtaForPhiSector] = value;
1701  UpdateCutString();
1702  return kTRUE;
1703  } else return kFALSE;
1704  case kMinPhiSector:
1705  if( SetMinPhiSectorCut(value)) {
1706  fCuts[kMinPhiSector] = value;
1707  UpdateCutString();
1708  return kTRUE;
1709  } else return kFALSE;
1710  case kMaxPhiSector:
1711  if( SetMaxPhiSectorCut(value)) {
1712  fCuts[kMaxPhiSector] = value;
1713  UpdateCutString();
1714  return kTRUE;
1715  } else return kFALSE;
1716 
1717  case ksinglePtCut:
1718  if( SetSinglePtCut(value)) {
1719  fCuts[ksinglePtCut] = value;
1720  UpdateCutString();
1721  return kTRUE;
1722  } else return kFALSE;
1723 
1724  case kclsTPCCut:
1725  if( SetTPCClusterCut(value)) {
1726  fCuts[kclsTPCCut] = value;
1727  UpdateCutString();
1728  return kTRUE;
1729  } else return kFALSE;
1730 
1731  case kededxSigmaCut:
1732  if (!fSwitchToKappa){
1733  if( SetTPCdEdxCutElectronLine(value)) {
1734  fCuts[kededxSigmaCut] = value;
1735  UpdateCutString();
1736  return kTRUE;
1737  } else return kFALSE;
1738  } else {
1739  if( SetKappaTPCCut(value)) {
1740  fCuts[kededxSigmaCut] = value;
1741  UpdateCutString();
1742  return kTRUE;
1743  } else return kFALSE;
1744  }
1745  case kpidedxSigmaCut:
1746  if (!fSwitchToKappa){
1747  if( SetTPCdEdxCutPionLine(value)) {
1748  fCuts[kpidedxSigmaCut] = value;
1749  UpdateCutString();
1750  return kTRUE;
1751  } else return kFALSE;
1752  } else {
1753  fCuts[kpidedxSigmaCut] = 0;
1754  return kTRUE;
1755  }
1756  case kpiMomdedxSigmaCut:
1757  if (!fSwitchToKappa){
1758  if( SetMinMomPiondEdxCut(value)) {
1759  fCuts[kpiMomdedxSigmaCut] = value;
1760  UpdateCutString();
1761  return kTRUE;
1762  } else return kFALSE;
1763  } else {
1765  return kTRUE;
1766  }
1767  case kpiMaxMomdedxSigmaCut:
1768  if (!fSwitchToKappa){
1769  if( SetMaxMomPiondEdxCut(value)) {
1770  fCuts[kpiMaxMomdedxSigmaCut] = value;
1771  UpdateCutString();
1772  return kTRUE;
1773  } else return kFALSE;
1774  } else {
1776  return kTRUE;
1777  }
1779  if (!fSwitchToKappa){
1780  if( SetLowPRejectionCuts(value)) {
1781  fCuts[kLowPRejectionSigmaCut] = value;
1782  UpdateCutString();
1783  return kTRUE;
1784  } else return kFALSE;
1785  } else {
1787  return kTRUE;
1788  }
1789  case kTOFelectronPID:
1790  if( SetTOFElectronPIDCut(value)) {
1791  fCuts[kTOFelectronPID] = value;
1792  UpdateCutString();
1793  return kTRUE;
1794  } else return kFALSE;
1795 
1796  case kQtMaxCut:
1797  if( SetQtMaxCut(value)) {
1798  fCuts[kQtMaxCut] = value;
1799  UpdateCutString();
1800  return kTRUE;
1801  } else return kFALSE;
1802 
1803 
1804  case kchi2GammaCut:
1805  if( SetChi2GammaCut(value)) {
1806  fCuts[kchi2GammaCut] = value;
1807  UpdateCutString();
1808  return kTRUE;
1809  } else return kFALSE;
1810 
1811  case kPsiPair:
1812  if( SetPsiPairCut(value)) {
1813  fCuts[kPsiPair] = value;
1814  UpdateCutString();
1815  return kTRUE;
1816  } else return kFALSE;
1817 
1818  case kdoPhotonAsymmetryCut:
1819  if( SetPhotonAsymmetryCut(value)) {
1820  fCuts[kdoPhotonAsymmetryCut] = value;
1821  UpdateCutString();
1822  return kTRUE;
1823  } else return kFALSE;
1824 
1825  case kCosPAngle:
1826  if( SetCosPAngleCut(value)) {
1827  fCuts[kCosPAngle] = value;
1828  UpdateCutString();
1829  return kTRUE;
1830  } else return kFALSE;
1831 
1832  case kElecShare:
1833  if( SetSharedElectronCut(value)) {
1834  fCuts[kElecShare] = value;
1835  UpdateCutString();
1836  return kTRUE;
1837  } else return kFALSE;
1838 
1839  case kToCloseV0s:
1840  if( SetToCloseV0sCut(value)) {
1841  fCuts[kToCloseV0s] = value;
1842  UpdateCutString();
1843  return kTRUE;
1844  } else return kFALSE;
1845 
1846  case kDcaRPrimVtx:
1847  if( SetDCARPhotonPrimVtxCut(value)) {
1848  fCuts[kDcaRPrimVtx] = value;
1849  UpdateCutString();
1850  return kTRUE;
1851  } else return kFALSE;
1852 
1853  case kDcaZPrimVtx:
1854  if( SetDCAZPhotonPrimVtxCut(value)) {
1855  fCuts[kDcaZPrimVtx] = value;
1856  UpdateCutString();
1857  return kTRUE;
1858  } else return kFALSE;
1859 
1860  case kInPlaneOutOfPlane:
1861  if( SetInPlaneOutOfPlane(value)) {
1862  fCuts[kInPlaneOutOfPlane] = value;
1863  UpdateCutString();
1864  return kTRUE;
1865  } else return kFALSE;
1866 
1867  case kITSelectronPID:
1868  if( SetITSElectronPIDCut(value)) {
1869  fCuts[kITSelectronPID] = value;
1870  UpdateCutString();
1871  return kTRUE;
1872  } else return kFALSE;
1873 
1874  case kTRDelectronPID:
1875  if( SetTRDElectronPIDCut(value)) {
1876  fCuts[kTRDelectronPID] = value;
1877  UpdateCutString();
1878  return kTRUE;
1879  } else return kFALSE;
1880 
1881  case kNCuts:
1882  AliError("Cut id out of range");
1883  return kFALSE;
1884  }
1885 
1886  AliError("Cut id %d not recognized");
1887  return kFALSE;
1888 }
1891  // Print out current Cut Selection
1892  for(Int_t ic = 0; ic < kNCuts; ic++) {
1893  printf("%-30s : %d \n", fgkCutNames[ic], fCuts[ic]);
1894  }
1895 }
1896 
1898  // Print out current Cut Selection with value
1899  printf("\nConversion cutnumber \n");
1900  for(Int_t ic = 0; ic < kNCuts; ic++) {
1901  printf("%d",fCuts[ic]);
1902  }
1903  printf("\n\n");
1904  printf("Electron cuts & Secondary Track Cuts - only track from secondaries enter analysis: \n");
1905  printf("\t no like sign pairs from V0s \n");
1906  if (!fUseCorrectedTPCClsInfo) printf("\t # TPC clusters > %3.2f \n", fMinClsTPC);
1907  if (fEtaCutMin > -0.1) printf("\t %3.2f < eta_{e} < %3.2f\n", fEtaCutMin, fEtaCut );
1908  else printf("\t eta_{e} < %3.2f\n", fEtaCut );
1909  printf("\t reject: %3.2f < phi < %3.2f with %3.2f < eta < %3.2f \n", fMinPhiCut, fMaxPhiCut, fEtaForPhiCutMin, fEtaForPhiCutMax);
1910  if(fDoAsymPtCut)
1911  printf("\t Asymmetric cut: p_{T,e1} > %3.2f and p_{T,e2} > %3.2f\n", fSinglePtCut, fSinglePtCut2 );
1912  else
1913  printf("\t p_{T,e} > %3.2f\n", fSinglePtCut );
1914  printf("\t TPC refit \n");
1915  printf("\t no kinks \n");
1916  if (!fSwitchToKappa){
1917  printf("\t accept: %3.2f < n sigma_{e,TPC} < %3.2f\n", fPIDnSigmaBelowElectronLine, fPIDnSigmaAboveElectronLine );
1918  printf("\t reject: %3.2f < p_{e,T} < %3.2f, n sigma_{pi,TPC} < %3.2f\n", fPIDMinPnSigmaAbovePionLine, fPIDMaxPnSigmaAbovePionLine, fPIDnSigmaAbovePionLine );
1919  printf("\t reject: p_{e,T} > %3.2f, n sigma_{pi,TPC} < %3.2f\n", fPIDMaxPnSigmaAbovePionLine, fPIDnSigmaAbovePionLineHighPt );
1920  if (fDoPionRejectionLowP) printf("\t reject: p_{e,T} < %3.2f, -%3.2f < n sigma_{pi,TPC} < %3.2f\n", fPIDMinPPionRejectionLowP, fPIDnSigmaAtLowPAroundPionLine, fPIDnSigmaAtLowPAroundPionLine );
1921  if (fDoKaonRejectionLowP) printf("\t reject: -%3.2f < n sigma_{K,TPC} < %3.2f\n", fPIDnSigmaAtLowPAroundKaonLine, fPIDnSigmaAtLowPAroundKaonLine );
1922  if (fDoProtonRejectionLowP) printf("\t reject: -%3.2f < n sigma_{p,TPC} < %3.2f\n", fPIDnSigmaAtLowPAroundProtonLine, fPIDnSigmaAtLowPAroundProtonLine );
1923  } else {
1924  printf("\t accept: %3.2f <= Kappa_{TPC} < %3.2f\n", fKappaMinCut, fKappaMaxCut );
1925  }
1926  if (fUseTOFpid) printf("\t accept: %3.2f < n sigma_{e,TOF} < %3.2f\n", fTofPIDnSigmaBelowElectronLine, fTofPIDnSigmaAboveElectronLine);
1927  if (fUseITSpid) printf("\t accept: %3.2f < n sigma_{e,ITS} < %3.2f\n -- up to pT %3.2f", fITSPIDnSigmaBelowElectronLine, fITSPIDnSigmaAboveElectronLine, fMaxPtPIDITS);
1928 
1929  printf("Photon cuts: \n");
1930  if (fUseOnFlyV0Finder) printf("\t using Onfly V0 finder \n");
1931  else printf("\t using Offline V0 finder \n");
1932  if (fDo2DQt){
1933  printf("\t 2 dimensional q_{T} cut applied with maximum of %3.2f \n", fQtMax );
1934  } else {
1935  printf("\t 1 dimensional q_{T} cut applied with maximum of %3.2f \n", fQtMax );
1936  }
1937  if (fDo2DPsiPairChi2){
1938  printf("\t 2 dimensional triangle chi^{2} and psi_{pair} cut applied with maximum of chi^{2} = %3.2f and |psi_{pair}| = %3.2f \n", fChi2CutConversion, fPsiPairCut );
1939  } else {
1940  printf("\t chi^{2} max cut chi^{2} < %3.2f \n", fChi2CutConversion );
1941  printf("\t psi_{pair} max cut |psi_{pair}| < %3.2f \n", fPsiPairCut );
1942  }
1943  printf("\t %3.2f < R_{conv} < %3.2f\n", fMinR, fMaxR );
1944  printf("\t Z_{conv} < %3.2f\n", fMaxZ );
1945  if (fEtaCutMin > -0.1) printf("\t %3.2f < eta_{conv} < %3.2f\n", fEtaCutMin, fEtaCut );
1946  else printf("\t eta_{conv} < %3.2f\n", fEtaCut );
1947  if (fDoPhotonAsymmetryCut) printf("\t for p_{T,track} > %3.2f, A_{gamma} < %3.2f \n", fMinPPhotonAsymmetryCut, fMinPhotonAsymmetry );
1948  if (fDoPhotonPDependentAsymCut && fDoPhotonAsymmetryCut) printf("\t p-dependent asymmetry cut \n");
1949  if (fUseCorrectedTPCClsInfo) printf("\t #cluster TPC/ #findable clusters TPC (corrected for radius) > %3.2f\n", fMinClsTPCToF );
1950  printf("\t p_{T,gamma} > %3.2f\n", fPtCut );
1951  printf("\t cos(Theta_{point}) > %3.2f \n", fCosPAngleCut );
1952  printf("\t dca_{R} < %3.2f \n", fDCARPrimVtxCut );
1953  printf("\t dca_{Z} < %3.2f \n", fDCAZPrimVtxCut );
1954  if (fDoPhotonQualitySelectionCut) printf("\t selection based on photon quality with quality %d \n", fPhotonQualityCut );
1955  if (fDoDoubleCountingCut) printf("\t Reject doubly counted photons with R > %3.2f, DeltaR < %3.2f, OpenAngle < %3.2f \n", fMinRDC, fDeltaR,fOpenAngle );
1956 
1957 }
1958 
1961  switch (v0FinderType){
1962  case 0: // on fly V0 finder
1963  cout << "have chosen onfly V0" << endl;
1964  fUseOnFlyV0Finder=kTRUE;
1966  break;
1967  case 1: // offline V0 finder
1968  cout << "have chosen offline V0" << endl;
1969  fUseOnFlyV0Finder=kFALSE;
1971  break;
1972  case 2: // on fly V0 finder with same signs
1973  cout << "have chosen onfly V0 same sign pairing" << endl;
1974  fUseOnFlyV0Finder=kTRUE;
1976  break;
1977  case 3: // on fly V0 finder with unlike signs and same signs
1978  cout << "have chosen onfly V0 unlike sign and same signs pairing" << endl;
1979  fUseOnFlyV0Finder=kTRUE;
1981  break;
1982  default:
1983  AliError(Form(" v0FinderType not defined %d",v0FinderType));
1984  return kFALSE;
1985  }
1986  return kTRUE;
1987 }
1988 
1991 
1992  //Set Standard LineCutZValues
1993  fLineCutZValueMin = -2;
1994  fLineCutZValue = 7.;
1995 
1996  switch(etaCut){
1997  case 0: // 0.9
1998  fEtaCut = 0.9;
1999  fLineCutZRSlope = tan(2*atan(exp(-fEtaCut)));
2000  fEtaCutMin = -0.1;
2001  fLineCutZRSlopeMin = 0.;
2002  break;
2003  case 1: // 0.6 // changed from 1.2 to 0.6 on 2013.06.10
2004  fEtaCut = 0.6;
2005  fLineCutZRSlope = tan(2*atan(exp(-fEtaCut)));
2006  fEtaCutMin = -0.1;
2007  fLineCutZRSlopeMin = 0.;
2008  break;
2009  case 2: // 1.4
2010  fEtaCut = 1.4;
2011  fLineCutZRSlope = tan(2*atan(exp(-fEtaCut)));
2012  fEtaCutMin = -0.1;
2013  fLineCutZRSlopeMin = 0.;
2014  break;
2015  case 3: // 0.65
2016  fEtaCut = 0.65;
2017  fLineCutZRSlope = tan(2*atan(exp(-fEtaCut)));
2018  fEtaCutMin = -0.1;
2019  fLineCutZRSlopeMin = 0.;
2020  break;
2021  case 4: // 0.75
2022  fEtaCut = 0.75;
2023  fLineCutZRSlope = tan(2*atan(exp(-fEtaCut)));
2024  fEtaCutMin = -0.1;
2025  fLineCutZRSlopeMin = 0.;
2026  break;
2027  case 5: // 0.5
2028  fEtaCut = 0.5;
2029  fLineCutZRSlope = tan(2*atan(exp(-fEtaCut)));
2030  fEtaCutMin = -0.1;
2031  fLineCutZRSlopeMin = 0.;
2032  break;
2033  case 6: // 5.
2034  fEtaCut = 5.;
2035  fLineCutZRSlope = tan(2*atan(exp(-fEtaCut)));
2036  fEtaCutMin = -0.1;
2037  fLineCutZRSlopeMin = 0.;
2038  break;
2039  case 7:
2040  if (fIsHeavyIon==1){
2041  fEtaCut = 0.7;
2042  fLineCutZRSlope = tan(2*atan(exp(-fEtaCut)));
2043  fEtaCutMin = -0.1;
2044  fLineCutZRSlopeMin = 0.;
2045  break;
2046  } else {
2047  fEtaCut = 0.3;
2048  fLineCutZRSlope = tan(2*atan(exp(-fEtaCut)));
2049  fEtaCutMin = -0.1;
2050  fLineCutZRSlopeMin = 0.;
2051  break;
2052  }
2053  // case 8: // 0.1 - 0.8
2054  // fEtaCut = 0.9;
2055  // fLineCutZRSlope = tan(2*atan(exp(-fEtaCut)));
2056  // fEtaCutMin = 0.1;
2057  // fLineCutZRSlopeMin = tan(2*atan(exp(-fEtaCutMin)));
2058  // break;
2059  case 8: // 0.4
2060  fEtaCut = 0.4;
2061  fLineCutZRSlope = tan(2*atan(exp(-fEtaCut)));
2062  fEtaCutMin = -0.1;
2063  fLineCutZRSlopeMin = 0.;
2064  break;
2065  case 9: // 10
2066  fEtaCut = 10;
2067  fLineCutZRSlope = tan(2*atan(exp(-fEtaCut)));
2068  fEtaCutMin = -0.1;
2069  fLineCutZRSlopeMin = 0.;
2070  break;
2071  case 10: // 0.2-0.9
2072  fEtaCut = 0.9;
2073  fLineCutZRSlope = tan(2*atan(exp(-fEtaCut)));
2074  fEtaCutMin = 0.2;
2075  fLineCutZRSlopeMin = 0.;
2076  break;
2077  case 11: // 0.2-0.9
2078  fEtaCut = 0.9;
2079  fLineCutZRSlope = tan(2*atan(exp(-fEtaCut)));
2080  fEtaCutMin = 0.2;
2081  fLineCutZRSlopeMin = tan(2*atan(exp(-fEtaCutMin)));
2082  break;
2083  default:
2084  AliError(Form(" EtaCut not defined %d",etaCut));
2085  return kFALSE;
2086  }
2087  return kTRUE;
2088 }
2089 
2092  // Set Cut
2093  switch(RCut){
2094  case 0:
2095  fMinR=0;
2096  fMaxR = 180.;
2097  break;
2098  case 1:
2099  fMinR=2.8;
2100  fMaxR = 180.;
2101  break;
2102  case 2:
2103  fMinR=5.;
2104  fMaxR = 180.;
2105  break;
2106  case 3:
2107  fMaxR = 70.;
2108  fMinR = 10.;
2109  break;
2110  case 4:
2111  fMaxR = 70.;
2112  fMinR = 5.;
2113  break;
2114  case 5:
2115  fMaxR = 180.;
2116  fMinR = 10.;
2117  break;
2118  case 6:
2119  fMaxR = 180.;
2120  fMinR = 20.;
2121  break;
2122  case 7:
2123  fMaxR = 180.;
2124  fMinR = 35.; //old 26.
2125  break;
2126  case 8:
2127  fMaxR = 180.;
2128  fMinR = 12.5;
2129  break;
2130  case 9:
2131  fMaxR = 180.;
2132  fMinR = 7.5;
2133  break;
2134 
2135  default:
2136  AliError("RCut not defined");
2137  return kFALSE;
2138  }
2139  return kTRUE;
2140 }
2141 
2144 
2145  switch(etaPhiCut) {
2146  case 0: //no specific eta range selected, full eta range
2149  break;
2150  case 1: //eta < 0 only
2153  fEtaForPhiCutMax = 0.;
2154  break;
2155  case 2://eta > 0 only
2157  fEtaForPhiCutMin = 0.;
2159  break;
2160  default:
2161  AliError(Form("EtaForPhiCut not defined %d",etaPhiCut));
2162  return kFALSE;
2163  }
2164 
2165  return kTRUE;
2166 }
2167 
2169 // This are exclusion cuts, everything between fMinPhiCut & fMaxPhiCut will be excluded
2171 
2172  switch(minPhiCut) {
2173  case 0:
2174  fDoShrinkTPCAcceptance = kFALSE;
2175  fMinPhiCut = 0;
2176  break;
2177  case 1:
2179  fMinPhiCut = 1.7; //OROC C08 large cut
2180  break;
2181  case 2:
2183  fMinPhiCut = 4.4; //EMCal
2184  break;
2185  case 3:
2187  fMinPhiCut = 1.0; //PHOS
2188  break;
2189  case 4:
2191  fMinPhiCut = 3.4; //EMCal tight
2192  break;
2193  case 5:
2195  fMinPhiCut = 2.0; //OROC C08 medium cut
2196  break;
2197  case 6:
2199  fMinPhiCut = 2.2; //OROC C08 small cut
2200  break;
2201  case 7:
2203  fMinPhiCut = 2.4; //OROC C08 tightest cut
2204  break;
2205  case 8:
2207  fMinPhiCut = 4.54; //PHOS phi
2208  break;
2209  default:
2210  AliError(Form("MinPhiCut not defined %d",minPhiCut));
2211  return kFALSE;
2212  }
2213 
2214  return kTRUE;
2215 }
2216 
2218 // This are exclusion cuts, everything between fMinPhiCut & fMaxPhiCut will be excluded
2220 
2221  switch(maxPhiCut) {
2222  case 0:
2224  fMaxPhiCut = 2*TMath::Pi()+0.00001;
2225  break;
2226  case 1:
2228  fMaxPhiCut = 4.3; //OROC C08 large cut
2229  break;
2230  case 2:
2232  fMaxPhiCut = 5.8; //EMCal
2233  break;
2234  case 3:
2236  fMaxPhiCut = 3.0; //PHOS
2237  break;
2238  case 4:
2240  fMaxPhiCut = 1.; //EMCal
2241  break;
2242  case 5:
2244  fMaxPhiCut = 4.0; //OROC C08 medium cut
2245  break;
2246  case 6:
2248  fMaxPhiCut = 3.8; //OROC C08 small cut
2249  break;
2250  case 7:
2252  fMaxPhiCut = 3.6; //OROC C08 tighest cut
2253  break;
2254  case 8:
2256  fMaxPhiCut = 5.59; //PHOS phi
2257  break;
2258  default:
2259  AliError(Form("MaxPhiCut not defined %d",maxPhiCut));
2260  return kFALSE;
2261  }
2262 
2263  return kTRUE;
2264 }
2265 
2266 
2269  switch(singlePtCut){
2270  case 0: // 0.050 GeV
2271  fSinglePtCut = 0.050;
2272  break;
2273  case 1: // 0.100 GeV
2274  fSinglePtCut = 0.100;
2275  break;
2276  case 2: // 0.150 GeV
2277  fSinglePtCut = 0.150;
2278  break;
2279  case 3: // 0.200 GeV
2280  fSinglePtCut = 0.200;
2281  break;
2282  case 4: // 0.075 GeV
2283  fSinglePtCut = 0.075;
2284  break;
2285  case 5: // 0.125 GeV
2286  fSinglePtCut = 0.125;
2287  break;
2288  case 6: // 0.04 GeV
2289  fSinglePtCut = 0.040;
2290  break;
2291  case 7: // 0.0 GeV
2292  fSinglePtCut = 0.0;
2293  break;
2294  case 8: // 0.02 GeV ; equivalent to .05 for the low B field runs
2295  fSinglePtCut = 0.02;
2296  break;
2297  case 9: // 0.050 GeV + min gamma pT cut of 100 MeV
2298  fSinglePtCut = 0.050;
2299  fPtCut = 0.100;
2300  break;
2301  case 10: //a: 0.050 GeV + min gamma pT cut of 150 MeV
2302  fSinglePtCut = 0.050;
2303  fPtCut = 0.150;
2304  break;
2305  case 11: //b: 0.050 GeV + min gamma pT cut of 200 MeV
2306  fSinglePtCut = 0.050;
2307  fPtCut = 0.200;
2308  break;
2309  case 12: //c: 0.060 GeV
2310  fSinglePtCut = 0.060;
2311  break;
2312  case 13: //d: 0.060 GeV + min gamma pT cut of 100 MeV
2313  fSinglePtCut = 0.060;
2314  fPtCut = 0.100;
2315  break;
2316  case 14: //e: 0.060 GeV + min gamma pT cut of 150 MeV
2317  fSinglePtCut = 0.060;
2318  fPtCut = 0.150;
2319  break;
2320  case 15: //f: 0.060 GeV + min gamma pT cut of 200 MeV
2321  fSinglePtCut = 0.060;
2322  fPtCut = 0.200;
2323  break;
2324  case 16: //g: 0.075 GeV + min gamma pT cut of 150 MeV
2325  fSinglePtCut = 0.075;
2326  fPtCut = 0.150;
2327  break;
2328  case 17: //h: 0.100 GeV + min gamma pT cut of 200 MeV
2329  fSinglePtCut = 0.100;
2330  fPtCut = 0.200;
2331  break;
2332  case 18: //i: 0.150 GeV + min gamma pT cut of 300 MeV
2333  fSinglePtCut = 0.150;
2334  fPtCut = 0.300;
2335  break;
2336  case 19: //j: asym: 0.100 GeV and 0.075 GeV
2337  fSinglePtCut = 0.100;
2338  fDoAsymPtCut = kTRUE;
2339  fSinglePtCut2= 0.075;
2340  break;
2341  case 20: //k: asym: 0.150 GeV and 0.075 GeV
2342  fSinglePtCut = 0.150;
2343  fDoAsymPtCut = kTRUE;
2344  fSinglePtCut2= 0.075;
2345  break;
2346  case 21: //l: asym: 0.200 GeV and 0.075 GeV
2347  fSinglePtCut = 0.200;
2348  fDoAsymPtCut = kTRUE;
2349  fSinglePtCut2= 0.075;
2350  break;
2351  default:
2352  AliError(Form("singlePtCut not defined %d",singlePtCut));
2353  return kFALSE;
2354  }
2355  return kTRUE;
2356 }
2357 
2360  switch(clsTPCCut){
2361  case 0: // 0
2362  fMinClsTPC= 0.;
2363  break;
2364  case 1: // 60
2365  fMinClsTPC= 60.;
2366  break;
2367  case 2: // 80
2368  fMinClsTPC= 80.;
2369  break;
2370  case 3: // 100
2371  fMinClsTPC= 100.;
2372  break;
2373  case 4: // 95% of findable clusters
2374  fMinClsTPCToF= 0.95;
2376  break;
2377  case 5: // 0% of findable clusters
2378  fMinClsTPCToF= 0.0;
2380  break;
2381  case 6: // 70% of findable clusters
2382  fMinClsTPCToF= 0.7;
2384  break;
2385  case 7: // 0% of findable clusters
2386  fMinClsTPCToF= 0.35;
2388  break;
2389  case 8:
2390  fMinClsTPCToF= 0.35;
2392  break;
2393  case 9:
2394  fMinClsTPCToF= 0.6;
2396  break;
2397  default:
2398  AliError(Form("Warning: clsTPCCut not defined %d",clsTPCCut));
2399  return kFALSE;
2400  }
2401  return kTRUE;
2402 }
2403 
2406  switch(ededxSigmaCut){
2407  case 0: // -10,10
2410  break;
2411  case 1: // -5,5
2414  break;
2415  case 2: // -3,5
2418  break;
2419  case 3: // -4,5
2422  break;
2423  case 4: // -6,7
2426  break;
2427  case 5: // -4,4
2430  break;
2431  case 6: // -2.5,4
2434  break;
2435  case 7: // -2,3.5
2438  break;
2439  case 8: // -2.5,3.
2442  break;
2443  case 9: // -2.5,5.
2446  break;
2447  default:
2448  AliError("TPCdEdxCutElectronLine not defined");
2449  return kFALSE;
2450 
2451  }
2452  return kTRUE;
2453 }
2454 
2457 
2458  switch(pidedxSigmaCut){
2459  case 0: // -10
2462  break;
2463  case 1: // 0
2466  break;
2467  case 2: // 1
2470  break;
2471  case 3: // 1
2474  break;
2475  case 4: // 3.0sigma, 1.0 sigma at high pt
2478  break;
2479  case 5: // 1
2482  break;
2483  case 6: // 1
2486  break;
2487  case 7: // 1
2490  break;
2491  case 8: // 1
2494  break;
2495  case 9:
2496  fPIDnSigmaAbovePionLine=1; // We need a bit less tight cut on dE/dx
2498  break;
2499  default:
2500  AliError(Form("Warning: pidedxSigmaCut not defined %d",pidedxSigmaCut));
2501  return kFALSE;
2502  }
2503  return kTRUE;
2504 }
2505 
2508  switch(piMomdedxSigmaCut){
2509  case 0: // 0.5 GeV
2511  break;
2512  case 1: // 1. GeV
2514  break;
2515  case 2: // 1.5 GeV
2517  break;
2518  case 3: // 20.0 GeV
2520  break;
2521  case 4: // 50.0 GeV
2523  break;
2524  case 5: // 0.3 GeV
2526  break;
2527  case 6: // 0.25 GeV
2529  break;
2530  case 7: // 0.4 GeV
2532  break;
2533  case 8: // 0.2 GeV
2535  break;
2536  default:
2537  AliError(Form("piMomdedxSigmaCut not defined %d",piMomdedxSigmaCut));
2538  return kFALSE;
2539  }
2540  return kTRUE;
2541 }
2542 
2545  switch(piMaxMomdedxSigmaCut){
2546  case 0: // 100. GeV
2548  break;
2549  case 1: // 5. GeV
2551  break;
2552  case 2: // 4. GeV
2554  break;
2555  case 3: // 3.5 GeV
2557  break;
2558  case 4: // 3. GeV
2560  break;
2561  case 5: // 7. GeV
2563  break;
2564  case 6: // 2. GeV
2566  break;
2567  default:
2568  AliError(Form("piMaxMomdedxSigmaCut not defined %d",piMaxMomdedxSigmaCut));
2569  return kFALSE;
2570  }
2571  return kTRUE;
2572 }
2573 
2576  switch(LowPRejectionSigmaCut){
2577  case 0: //
2581  fDoKaonRejectionLowP = kFALSE;
2582  fDoProtonRejectionLowP = kFALSE;
2583  fDoPionRejectionLowP = kFALSE;
2585  break;
2586  case 1: //
2590  fDoKaonRejectionLowP = kTRUE;
2591  fDoProtonRejectionLowP = kTRUE;
2592  fDoPionRejectionLowP = kTRUE;
2594  break;
2595  case 2: //
2599  fDoKaonRejectionLowP = kTRUE;
2600  fDoProtonRejectionLowP = kTRUE;
2601  fDoPionRejectionLowP = kTRUE;
2603  break;
2604  case 3: //
2608  fDoKaonRejectionLowP = kTRUE;
2609  fDoProtonRejectionLowP = kTRUE;
2610  fDoPionRejectionLowP = kTRUE;
2612  break;
2613  case 4: //
2617  fDoKaonRejectionLowP = kFALSE;
2618  fDoProtonRejectionLowP = kFALSE;
2619  fDoPionRejectionLowP = kTRUE;
2621  break;
2622  case 5: //
2626  fDoKaonRejectionLowP = kFALSE;
2627  fDoProtonRejectionLowP = kFALSE;
2628  fDoPionRejectionLowP = kTRUE;
2630  break;
2631  case 6: //
2635  fDoKaonRejectionLowP = kFALSE;
2636  fDoProtonRejectionLowP = kFALSE;
2637  fDoPionRejectionLowP = kTRUE;
2639  break;
2640  case 7: //
2644  fDoKaonRejectionLowP = kFALSE;
2645  fDoProtonRejectionLowP = kFALSE;
2646  fDoPionRejectionLowP = kTRUE;
2648  break;
2649  case 8: //
2653  fDoKaonRejectionLowP = kFALSE;
2654  fDoProtonRejectionLowP = kTRUE;
2655  fDoPionRejectionLowP = kFALSE;
2657  break;
2658  default:
2659  AliError(Form("LowPRejectionSigmaCut not defined %d",LowPRejectionSigmaCut));
2660  return kFALSE;
2661  }
2662  return kTRUE;
2663 }
2664 
2667  switch(kappaCut){
2668  case 0: // completely open
2669  fKappaMaxCut=200;
2670  fKappaMinCut=-200;
2671  break;
2672  case 1: // mainly pi pi
2673  fKappaMaxCut=-13;
2674  fKappaMinCut=-20;
2675  break;
2676  case 2: // mainly pi e
2677  fKappaMaxCut=-6;
2678  fKappaMinCut=-11;
2679  break;
2680  case 3: // signal
2681  fKappaMaxCut=5;
2682  fKappaMinCut=-3;
2683  break;
2684  case 4: // remaining
2685  fKappaMaxCut=20;
2686  fKappaMinCut=11;
2687  break;
2688  case 5: // -5-10 full signal peak(including background)
2689  fKappaMaxCut=10;
2690  fKappaMinCut=-5;
2691  break;
2692  case 6: //
2693  fKappaMaxCut=10;
2694  fKappaMinCut=-3;
2695  break;
2696  case 7: //
2697  fKappaMaxCut=10;
2698  fKappaMinCut=0;
2699  break;
2700  default:
2701  AliError("KappaTPCCut not defined");
2702  return kFALSE;
2703 
2704  }
2705  return kTRUE;
2706 }
2707 
2708 
2711  // Set Cut
2712  switch(TOFelectronPID){
2713  case 0: // no cut
2714  fUseTOFpid = kFALSE;
2717  break;
2718  case 1: // -7,7
2719  fUseTOFpid = kTRUE;
2722  break;
2723  case 2: // -5,5
2724  fUseTOFpid = kTRUE;
2727  break;
2728  case 3: // -3,5
2729  fUseTOFpid = kTRUE;
2732  break;
2733  case 4: // -2,3
2734  fUseTOFpid = kTRUE;
2737  break;
2738  case 5: // -3,3
2739  fUseTOFpid = kTRUE;
2742  break;
2743  default:
2744  AliError(Form("TOFElectronCut not defined %d",TOFelectronPID));
2745  return kFALSE;
2746  }
2747  return kTRUE;
2748 }
2749 
2752  // Set Cut
2753  switch(ITSelectronPID){
2754  case 0: // no cut
2755  fUseITSpid = kFALSE;
2758  fMaxPtPIDITS = 1.5;
2759  break;
2760  case 1: // -3,3
2761  fUseITSpid = kTRUE;
2764  fMaxPtPIDITS = 1.5;
2765  break;
2766  case 2: // -2,2
2767  fUseITSpid = kTRUE;
2770  fMaxPtPIDITS = 1.5;
2771  break;
2772  case 3: // -1,1
2773  fUseITSpid = kTRUE;
2776  fMaxPtPIDITS = 1.5;
2777  break;
2778  case 4: // -3,5
2779  fUseITSpid = kTRUE;
2782  fMaxPtPIDITS = 1.5;
2783  break;
2784  case 5: // -5,5
2785  fUseITSpid = kTRUE;
2788  fMaxPtPIDITS = 1.5;
2789  break;
2790  case 6: // -3,3
2791  fUseITSpid = kTRUE;
2794  fMaxPtPIDITS = 2;
2795  break;
2796  case 7: // -2,2
2797  fUseITSpid = kTRUE;
2800  fMaxPtPIDITS = 2;
2801  break;
2802  case 8: // -1,1
2803  fUseITSpid = kTRUE;
2806  fMaxPtPIDITS = 2;
2807  break;
2808  case 9: // -3,5
2809  fUseITSpid = kTRUE;
2812  fMaxPtPIDITS = 2;
2813  break;
2814  default:
2815  AliError(Form("ITSelectronPID not defined %d",ITSelectronPID));
2816  return kFALSE;
2817  }
2818  return kTRUE;
2819 }
2820 
2823  // Set Cut
2824  switch(TRDelectronPID){
2825  case 0: // no cut
2826  fDoTRDPID = kFALSE;
2827  fTRDPIDBelowCut=-100;
2828  fTRDPIDAboveCut=100;
2829  break;
2830  default:
2831  AliError(Form("TRDelectronPID not defined %d",TRDelectronPID));
2832  return kFALSE;
2833  }
2834  return kTRUE;
2835 }
2836 
2837 
2840  switch(QtMaxCut){
2841  case 0: //
2842  fQtMax=1.;
2843  fDoQtGammaSelection=kFALSE;
2844  fDo2DQt=kFALSE;
2845  break;
2846  case 1:
2847  fQtMax=0.1;
2848  fDo2DQt=kFALSE;
2849  break;
2850  case 2:
2851  fQtMax=0.06;
2852  fDo2DQt=kTRUE;
2853  break;
2854  case 3:
2855  fQtMax=0.05;
2856  fDo2DQt=kFALSE;
2857  break;
2858  case 4:
2859  fQtMax=0.03;
2860  fDo2DQt=kFALSE;
2861  break;
2862  case 5:
2863  fQtMax=0.02;
2864  fDo2DQt=kFALSE;
2865  break;
2866  case 6:
2867  fQtMax=0.02;
2868  fDo2DQt=kTRUE;
2869  break;
2870  case 7:
2871  fQtMax=0.15;
2872  fDo2DQt=kFALSE;
2873  break;
2874  case 8:
2875  fQtMax=0.05;
2876  fDo2DQt=kTRUE;
2877  break;
2878  case 9:
2879  fQtMax=0.03;
2880  fDo2DQt=kTRUE;
2881  break;
2882  default:
2883  AliError(Form("Warning: QtMaxCut not defined %d",QtMaxCut));
2884  return kFALSE;
2885  }
2886  return kTRUE;
2887 }
2888 
2891 
2892  switch(chi2GammaCut){
2893  case 0: // 100
2894  fChi2CutConversion = 100.;
2895  break;
2896  case 1: // 50
2897  fChi2CutConversion = 50.;
2898  break;
2899  case 2: // 30
2900  fChi2CutConversion = 30.;
2901  break;
2902  case 3:
2903  fChi2CutConversion = 200.;
2904  break;
2905  case 4:
2906  if (fIsHeavyIon==1){
2907  fChi2CutConversion = 7.;
2908  } else {
2909  fChi2CutConversion = 500.;
2910  }
2911  break;
2912  case 5:
2913  fChi2CutConversion = 100000.;
2914  break;
2915  case 6:
2916  fChi2CutConversion = 5.;
2917  break;
2918  case 7:
2919  fChi2CutConversion = 10.;
2920  break;
2921  case 8:
2922  fChi2CutConversion = 20.;
2923  break;
2924  case 9:
2925  fChi2CutConversion = 15.;
2926  break;
2927  case 10:
2928  fChi2CutConversion = 25.;
2929  break;
2930  default:
2931  AliError(Form("Warning: Chi2GammaCut not defined %d",chi2GammaCut));
2932  return kFALSE;
2933  }
2934  return kTRUE;
2935 }
2936 
2939  switch(psiCut) {
2940  case 0:
2941  fPsiPairCut = 10000; //
2942  break;
2943  case 1:
2944  fPsiPairCut = 0.1; //
2945  break;
2946  case 2:
2947  fPsiPairCut = 0.05; // Standard
2948  break;
2949  case 3:
2950  fPsiPairCut = 0.035; //
2951  break;
2952  case 4:
2953  fPsiPairCut = 0.2; //
2954  break;
2955  case 5:
2956  fPsiPairCut = 0.1; //
2957  fDo2DPsiPairChi2 = kTRUE;
2958  break;
2959  case 6:
2960  fPsiPairCut = 0.05; //
2961  fDo2DPsiPairChi2 = kTRUE;
2962  break;
2963  case 7:
2964  if (fIsHeavyIon==1){
2965  fPsiPairCut = 0.07; //
2966  } else {
2967  fPsiPairCut = 0.035; //
2968  }
2969  fDo2DPsiPairChi2 = kTRUE;
2970  break;
2971  case 8:
2972  fPsiPairCut = 0.2; //
2973  fDo2DPsiPairChi2 = kTRUE; //
2974  break;
2975  case 9:
2976  // if (fIsHeavyIon==1){ //AM 2016-05-13
2977  fPsiPairCut = 0.1; //
2978  fDo2DPsiPairChi2 = kTRUE;
2979  fIncludeRejectedPsiPair = kTRUE;
2980  break;
2981  // } else {
2982  // fPsiPairCut = 0.5; //
2983  // break;
2984  // }
2985  default:
2986  AliError(Form("PsiPairCut not defined %d",psiCut));
2987  return kFALSE;
2988  }
2989 
2990  return kTRUE;
2991 }
2992 
2995  // Set Cut
2996  switch(doPhotonAsymmetryCut){
2997  case 0:
3001  break;
3002  case 1:
3005  fMinPhotonAsymmetry=0.04;
3006  break;
3007  case 2:
3010  fMinPhotonAsymmetry=0.06;
3011  break;
3012  case 3:
3015  fMinPhotonAsymmetry=0.05;
3016  break;
3017  case 4:
3020  fFAsymmetryCut = new TF1("fFAsymmetryCut","[0] + [1]*tanh(2*TMath::Power(x,[2]))",0.,100.);
3021  fFAsymmetryCut->SetParameter(0,0.3);
3022  fFAsymmetryCut->SetParameter(1,0.66);
3023  fFAsymmetryCut->SetParameter(2,0.7);
3026  break;
3027  case 5:
3030  fFAsymmetryCut = new TF1("fFAsymmetryCut","[0] + [1]*tanh(2*TMath::Power(x,[2]))",0.,100.);
3031  fFAsymmetryCut->SetParameter(0,0.14);
3032  fFAsymmetryCut->SetParameter(1,0.66);
3033  fFAsymmetryCut->SetParameter(2,0.5);
3036  break;
3037  case 6:
3040  fMinPhotonAsymmetry=0.05;
3041  break;
3042  case 7:
3045  fMinPhotonAsymmetry=0.05;
3046  break;
3047  default:
3048  AliError(Form("PhotonAsymmetryCut not defined %d",doPhotonAsymmetryCut));
3049  return kFALSE;
3050  }
3051  fCuts[kdoPhotonAsymmetryCut]=doPhotonAsymmetryCut;
3052  return kTRUE;
3053 }
3054 
3057 
3058  switch(cosCut){
3059  case 0:
3060  fCosPAngleCut = -1;
3061  break;
3062  case 1:
3063  fCosPAngleCut = 0;
3064  break;
3065  case 2:
3066  fCosPAngleCut = 0.5;
3067  break;
3068  case 3:
3069  fCosPAngleCut = 0.75;
3070  break;
3071  case 4:
3072  fCosPAngleCut = 0.85;
3073  break;
3074  case 5:
3075  fCosPAngleCut = 0.88;
3076  break;
3077  case 6:
3078  fCosPAngleCut = 0.9;
3079  break;
3080  case 7:
3081  fCosPAngleCut = 0.95;
3082  break;
3083  default:
3084  AliError(Form("Cosine Pointing Angle cut not defined %d",cosCut));
3085  return kFALSE;
3086  }
3087 
3088  return kTRUE;
3089 }
3090 
3093 
3094  switch(sharedElec){
3095  case 0:
3096  fDoSharedElecCut = kFALSE;
3098  fPhotonQualityCut = 0;
3099  break;
3100  case 1:
3101  fDoSharedElecCut = kTRUE;
3103  fPhotonQualityCut = 0;
3104  break;
3105  case 2:
3106  fDoSharedElecCut = kFALSE;
3108  fPhotonQualityCut = 1;
3109  break;
3110  case 3:
3111  fDoSharedElecCut = kFALSE;
3113  fPhotonQualityCut = 2;
3114  break;
3115  case 4:
3116  fDoSharedElecCut = kFALSE;
3118  fPhotonQualityCut = 3;
3119  break;
3120  default:
3121  AliError(Form("Shared Electron Cut not defined %d",sharedElec));
3122  return kFALSE;
3123  }
3124 
3125  return kTRUE;
3126 }
3127 
3130 
3131  switch(toClose){
3132  case 0:
3133  fDoToCloseV0sCut = kFALSE;
3134  fminV0Dist = 250;
3135  break;
3136  case 1:
3137  fDoToCloseV0sCut = kTRUE;
3138  fminV0Dist = 1;
3139  break;
3140  case 2:
3141  fDoToCloseV0sCut = kTRUE;
3142  fminV0Dist = 2;
3143  break;
3144  case 3:
3145  fDoToCloseV0sCut = kTRUE;
3146  fminV0Dist = 3;
3147  break;
3148  case 4:
3149  fDoToCloseV0sCut = kTRUE;
3150  fDoDoubleCountingCut = kTRUE;
3151  fMinRDC=0.;
3152  fDeltaR=6.;
3153  fOpenAngle=0.02;
3154  break;
3155  case 5:
3156  fDoToCloseV0sCut = kTRUE;
3157  fDoDoubleCountingCut = kTRUE;
3158  fMinRDC=0.;
3159  fDeltaR=6.;
3160  fOpenAngle=0.03;
3161  break;
3162  case 6:
3163  fDoToCloseV0sCut = kTRUE;
3164  fDoDoubleCountingCut = kTRUE;
3165  fMinRDC=0.;
3166  fDeltaR=6.;
3167  fOpenAngle=0.04;
3168  break;
3169 
3170  default:
3171  AliError(Form("Shared Electron Cut not defined %d",toClose));
3172  return kFALSE;
3173  }
3174  return kTRUE;
3175 }
3176 
3179  switch(TRDElectronCut){
3180  case 0:
3181  fDoTRDPID=kFALSE;
3182  break;
3183  case 1:
3184  fDoTRDPID=kTRUE;
3185  fPIDTRDEfficiency=0.1;
3186  break;
3187  case 8:
3188  fDoTRDPID=kTRUE;
3189  fPIDTRDEfficiency=0.8;
3190  break;
3191  case 9:
3192  fDoTRDPID=kTRUE;
3193  fPIDTRDEfficiency=0.9;
3194  break;
3195  default:
3196  AliError(Form("TRDElectronCut not defined %d",TRDElectronCut));
3197  return kFALSE;
3198  }
3199 
3200  return kTRUE;
3201 }
3202 
3205  // Set Cut
3206  switch(DCAZPhotonPrimVtx){
3207  case 0: //
3208  fDCAZPrimVtxCut = 1000;
3209  break;
3210  case 1: //
3211  fDCAZPrimVtxCut = 10;
3212  break;
3213  case 2: //
3214  fDCAZPrimVtxCut = 5;
3215  break;
3216  case 3: //
3217  fDCAZPrimVtxCut = 4;
3218  break;
3219  case 4: //
3220  fDCAZPrimVtxCut = 3;
3221  break;
3222  case 5: //
3223  fDCAZPrimVtxCut = 2.5;
3224  break;
3225  case 6: //
3226  fDCAZPrimVtxCut = 2;
3227  break;
3228  case 7: //
3229  fDCAZPrimVtxCut = 1.5;
3230  break;
3231  case 8: //
3232  fDCAZPrimVtxCut = 1;
3233  break;
3234  case 9: //
3235  fDCAZPrimVtxCut = 0.5;
3236  break;
3237  default:
3238  cout<<"Warning: DCAZPhotonPrimVtx not defined "<<DCAZPhotonPrimVtx<<endl;
3239  return kFALSE;
3240  }
3241  return kTRUE;
3242 }
3243 
3246  // Set Cut
3247  switch(DCARPhotonPrimVtx){
3248  case 0: //
3249  fDCARPrimVtxCut = 1000;
3250  break;
3251  case 1: //
3252  fDCARPrimVtxCut = 10;
3253  break;
3254  case 2: //
3255  fDCARPrimVtxCut = 5;
3256  break;
3257  case 3: //
3258  fDCARPrimVtxCut = 4;
3259  break;
3260  case 4: //
3261  fDCARPrimVtxCut = 3;
3262  break;
3263  case 5: //
3264  fDCARPrimVtxCut = 2.5;
3265  break;
3266  case 6: //
3267  fDCARPrimVtxCut = 2;
3268  break;
3269  case 7: //
3270  fDCARPrimVtxCut = 1.5;
3271  break;
3272  case 8: //
3273  fDCARPrimVtxCut = 1;
3274  break;
3275  case 9: //
3276  fDCARPrimVtxCut = 0.5;
3277  break;
3278  default:
3279  cout<<"Warning: DCARPhotonPrimVtx not defined "<<DCARPhotonPrimVtx<<endl;
3280  return kFALSE;
3281  }
3282  return kTRUE;
3283 }
3284 
3287  // Set Cut
3288  switch(inOutPlane){
3289  case 0: //
3290  fInPlaneOutOfPlane = 0; // No Event Plane
3291  break;
3292  case 1: //
3293  fInPlaneOutOfPlane = 1; // In-Plane
3294  break;
3295  case 2: //
3296  fInPlaneOutOfPlane = 2; // Out-Of-Plane
3297  break;
3298  default:
3299  cout<<"Warning: In-Plane or Out-Of-Plane not defined "<<inOutPlane<<endl;
3300  return kFALSE;
3301  }
3302  return kTRUE;
3303 }
3304 
3305 
3308  // Get first TPC row
3309  Int_t firstTPCRow = 0;
3310  Double_t radiusI = 84.8;
3311  Double_t radiusO = 134.6;
3312  Double_t radiusOB = 198.;
3313  Double_t rSizeI = 0.75;
3314  Double_t rSizeO = 1.;
3315  Double_t rSizeOB = 1.5;
3316  Int_t nClsI = 63;
3317  Int_t nClsIO = 127;
3318 
3319  if(radius <= radiusI){
3320  return firstTPCRow;
3321  }
3322  if(radius>radiusI && radius<=radiusO){
3323  firstTPCRow = (Int_t)((radius-radiusI)/rSizeI);
3324  }
3325  if(radius>radiusO && radius<=radiusOB){
3326  firstTPCRow = (Int_t)(nClsI+(radius-radiusO)/rSizeO);
3327  }
3328 
3329  if(radius>radiusOB){
3330  firstTPCRow =(Int_t)(nClsIO+(radius-radiusOB)/rSizeOB);
3331  }
3332 
3333  return firstTPCRow;
3334 }
3335 
3339  if(GetCosineOfPointingAngle(photon, event) < fCosPAngleCut){
3340  return kFALSE;
3341  }
3342  return kTRUE;
3343 }
3344 
3347  // calculates the pointing angle of the recalculated V0
3348 
3349  Double_t momV0[3] = {0,0,0};
3350  if(event->IsA()==AliESDEvent::Class()){
3351  AliESDEvent *esdEvent = dynamic_cast<AliESDEvent*>(event);
3352  if(!esdEvent) return -999;
3353  AliESDv0 *v0 = esdEvent->GetV0(photon->GetV0Index());
3354  if(!v0) return -999;
3355  v0->GetPxPyPz(momV0[0],momV0[1],momV0[2]);
3356  }
3357  if(event->IsA()==AliAODEvent::Class()){
3358  momV0[0] = photon->GetPx();
3359  momV0[1] = photon->GetPy();
3360  momV0[2] = photon->GetPz();
3361  }
3362 
3363  //Double_t momV0[3] = { photon->GetPx(), photon->GetPy(), photon->GetPz() }; //momentum of the V0
3364  Double_t PosV0[3] = { photon->GetConversionX() - event->GetPrimaryVertex()->GetX(),
3365  photon->GetConversionY() - event->GetPrimaryVertex()->GetY(),
3366  photon->GetConversionZ() - event->GetPrimaryVertex()->GetZ() }; //Recalculated V0 Position vector
3367 
3368  Double_t momV02 = momV0[0]*momV0[0] + momV0[1]*momV0[1] + momV0[2]*momV0[2];
3369  Double_t PosV02 = PosV0[0]*PosV0[0] + PosV0[1]*PosV0[1] + PosV0[2]*PosV0[2];
3370 
3371 
3372  Double_t cosinePointingAngle = -999;
3373  if(momV02*PosV02 > 0.0)
3374  cosinePointingAngle = (PosV0[0]*momV0[0] + PosV0[1]*momV0[1] + PosV0[2]*momV0[2] ) / TMath::Sqrt(momV02 * PosV02);
3375 
3376  return cosinePointingAngle;
3377 }
3378 
3381 
3382  if (fDo2DPsiPairChi2){
3384  if (TMath::Abs(photon->GetPsiPair()) < -fPsiPairCut/fChi2CutConversion*photon->GetChi2perNDF() + fPsiPairCut || (photon->GetPsiPair()) == 4){
3385  return kTRUE;
3386  } else {
3387  return kFALSE;
3388  }
3389 
3390  } else {
3391  if (TMath::Abs(photon->GetPsiPair()) < -fPsiPairCut/fChi2CutConversion*photon->GetChi2perNDF() + fPsiPairCut ){
3392  return kTRUE;
3393  } else {
3394  return kFALSE;
3395  }
3396  }
3397  } else {
3399  if(TMath::Abs(photon->GetPsiPair()) > fPsiPairCut || (photon->GetPsiPair()) != 4){
3400  return kFALSE;
3401  } else {
3402  return kTRUE;
3403  }
3404  } else {
3405  if(TMath::Abs(photon->GetPsiPair()) > fPsiPairCut){
3406  return kFALSE;
3407  } else {
3408  return kTRUE;
3409  }
3410  }
3411  }
3412 }
3413 
3416  // returns TString with current cut number
3417  return fCutStringRead;
3418 }
3419 
3422 
3423  Int_t posLabel = photon->GetTrackLabelPositive();
3424  Int_t negLabel = photon->GetTrackLabelNegative();
3425 
3426  fElectronLabelArray[nV0*2] = posLabel;
3427  fElectronLabelArray[(nV0*2)+1] = negLabel;
3428 }
3429 
3432 
3433  Int_t posLabel = photon->GetTrackLabelPositive();
3434  Int_t negLabel = photon->GetTrackLabelNegative();
3435 
3436  for(Int_t i = 0; i<nV0s*2;i++){
3437  if(i==nV0*2) continue;
3438  if(i==(nV0*2)+1) continue;
3439  if(fElectronLabelArray[i] == posLabel){
3440  return kFALSE;}
3441  if(fElectronLabelArray[i] == negLabel){
3442  return kFALSE;}
3443  }
3444 
3445  return kTRUE;
3446 }
3447 
3450 
3451  if (fDoDoubleCountingCut && photon->GetConversionRadius() < fMinRDC) return kTRUE;
3452 
3453  Double_t posX = photon->GetConversionX();
3454  Double_t posY = photon->GetConversionY();
3455  Double_t posZ = photon->GetConversionZ();
3456 
3457  for(Int_t i = 0;i<photons->GetEntries();i++){
3458  if(nV0 == i) continue;
3459  AliAODConversionPhoton *photonComp = (AliAODConversionPhoton*) photons->At(i);
3460  Double_t posCompX = photonComp->GetConversionX();
3461  Double_t posCompY = photonComp->GetConversionY();
3462  Double_t posCompZ = photonComp->GetConversionZ();
3463 
3464  if (!fDoDoubleCountingCut){
3465  Double_t dist = pow((posX - posCompX),2)+pow((posY - posCompY),2)+pow((posZ - posCompZ),2);
3466 
3467  if(dist < fminV0Dist*fminV0Dist){
3468  if(photon->GetChi2perNDF() > photonComp->GetChi2perNDF()) return kFALSE;
3469  }
3470  }else{
3471  TVector3 v1(photon->Px(),photon->Py(),photon->Pz());
3472  TVector3 v2(photonComp->Px(),photonComp->Py(),photonComp->Pz());
3473  Double_t OpeningAngle=v1.Angle(v2);
3474  if( OpeningAngle < fOpenAngle && TMath::Abs(photon->GetConversionRadius()-photonComp->GetConversionRadius()) < fDeltaR){
3475  if(photon->GetChi2perNDF() > photonComp->GetChi2perNDF()) return kFALSE;
3476  }
3477  }
3478 
3479  }
3480  return kTRUE;
3481 }
3482 
3483 
3486  //Create and return standard 2010 PbPb cuts
3487  AliConversionPhotonCuts *cuts=new AliConversionPhotonCuts("StandardCuts2010PbPb","StandardCuts2010PbPb");
3488  if(!cuts->InitializeCutsFromCutString("04209297002322000000")){
3489  cout<<"Warning: Initialization of Standardcuts2010PbPb failed"<<endl;}
3490  return cuts;
3491 }
3492 
3495  //Create and return standard 2010 PbPb cuts
3496  AliConversionPhotonCuts *cuts=new AliConversionPhotonCuts("StandardCuts2010pp","StandardCuts2010pp");
3497  if(!cuts->InitializeCutsFromCutString("00209366300380000000")){
3498  cout<<"Warning: Initialization of Standardcuts2010pp failed"<<endl;}
3499  return cuts;
3500 }
3501 
3504 
3505  //GetPhotonPhi() 0-2 Pi //eventPlaneAngle -1pi-1pi
3506  eventPlaneAngle=eventPlaneAngle+TMath::Pi();
3507  Double_t gammaToEPAngle = eventPlaneAngle-photonPhi;
3508  if(gammaToEPAngle < 0) gammaToEPAngle=gammaToEPAngle+2*TMath::Pi();
3509  gammaToEPAngle = gammaToEPAngle-TMath::Pi(); // angle from -pi +pi
3510 
3511  if(!fInPlaneOutOfPlane){
3512  if(fill&&fHistoEventPlanePhi)fHistoEventPlanePhi->Fill(gammaToEPAngle);
3513  return kTRUE;
3514  }
3515  else if(fInPlaneOutOfPlane == 1){
3516  if(TMath::Abs(gammaToEPAngle)<=0.25*TMath::Pi() || TMath::Abs(gammaToEPAngle)>=0.75*TMath::Pi()){
3517  if(fill&&fHistoEventPlanePhi)fHistoEventPlanePhi->Fill(gammaToEPAngle);
3518  return kTRUE;
3519  }
3520  else return kFALSE;
3521  }
3522  else if(fInPlaneOutOfPlane == 2){
3523  if(TMath::Abs(gammaToEPAngle)>0.25*TMath::Pi() && TMath::Abs(gammaToEPAngle)<0.75*TMath::Pi()){
3524  if(fill&&fHistoEventPlanePhi)fHistoEventPlanePhi->Fill(gammaToEPAngle);
3525  return kTRUE;
3526  }
3527  else return kFALSE;
3528  }
3529  return kFALSE;
3530 }
3531 
3534 
3535  AliAODTrack * negTrack = static_cast<AliAODTrack*>(GetTrack(eventDummy, photon->GetTrackLabelNegative()));
3536  AliAODTrack * posTrack = static_cast<AliAODTrack*>(GetTrack(eventDummy, photon->GetTrackLabelPositive()));
3537 
3538  if(!negTrack || !posTrack) {
3539  return 0;
3540  }
3541  if(negTrack->Charge() == posTrack->Charge()){
3542  return 0;
3543  }
3544  Int_t nClusterITSneg = negTrack->GetITSNcls();
3545  Int_t nClusterITSpos = posTrack->GetITSNcls();
3546  // cout << nClusterITSneg << "\t" << nClusterITSpos <<endl;
3547 
3548  if (nClusterITSneg > 1 && nClusterITSpos > 1){
3549  return 3;
3550  } else if (nClusterITSneg > 1 || nClusterITSpos > 1){
3551  return 2;
3552  } else {
3553  return 1;
3554  }
3555  return 0;
3556 }
3557 
3560 
3561  TString nameProfile;
3562  if (flag==1){
3563  nameProfile = "profileContainingMaterialBudgetWeights_fewRadialBins";}
3564  else if (flag==2){
3565  nameProfile = "profileContainingMaterialBudgetWeights_manyRadialBins";}
3566  else {
3567  AliError(Form("%d not a valid flag for InitMaterialBudgetWeightingOfPi0Candidates()",flag));
3568  return kFALSE;
3569  }
3570  TFile* file = TFile::Open(filename.Data());
3571  if (!file) {
3572  AliError(Form("File %s for materialbudgetweights not found",filename.Data()));
3573  return kFALSE;
3574  }
3575  fProfileContainingMaterialBudgetWeights = (TProfile*)file->Get(nameProfile.Data());
3577  AliError(Form("Histogram %s not found in file",nameProfile.Data()));
3578  return kFALSE;
3579  }
3580  fProfileContainingMaterialBudgetWeights->SetDirectory(0);
3581  file->Close();
3582  delete file;
3583 
3585  AliInfo(Form("MaterialBudgetWeightingOfPi0Candidates initialized with flag %d. This means %d radial bins will be used for the weighting. File used: %s.",flag, fProfileContainingMaterialBudgetWeights->GetNbinsX(), filename.Data()));
3586  return kTRUE;
3587 }
3588 
3591 
3592  Float_t weight = 1.0;
3593  Float_t gammaConversionRadius = gamma->GetConversionRadius();
3594  Int_t bin = fProfileContainingMaterialBudgetWeights->FindBin(gammaConversionRadius);
3595  if (bin > 0 && bin <= fProfileContainingMaterialBudgetWeights->GetNbinsX()){
3596  weight = fProfileContainingMaterialBudgetWeights->GetBinContent(bin);
3597  }
3598  return weight;
3599 }
Double_t fTofPIDnSigmaAboveElectronLine
sigma cut RRnewTOF
Double_t fMinRDC
Min R for Double Counting Cut.
Bool_t SetDCARPhotonPrimVtxCut(Int_t DCARPhotonPrimVtx)
const char * filename
Definition: TestFCM.C:1
TH2F * fHistoTOFSigafter
TOF Sigma after cuts.
Bool_t SetQtMaxCut(Int_t QtMaxCut)
Float_t fMaxPhiCut
phi sector cut
Bool_t fPreSelCut
Flag for preselection cut used in V0Reader.
Double_t fMinPPhotonAsymmetryCut
Min Momentum for Asymmetry Cut.
TH2F * fHistoAcceptanceCuts
bookkeeping for acceptance cuts
Double_t fPIDTRDEfficiency
required electron efficiency for TRD PID
Double_t GetArmenterosAlpha() const
double Double_t
Definition: External.C:58
TH2F * fHistodEdxCuts
bookkeeping for dEdx cuts
Bool_t RejectSharedElectronV0s(AliAODConversionPhoton *photon, Int_t nV0, Int_t nV0s)
Double_t fOpenAngle
Opening Angle for Double Counting Cut.
TH2F * fHistoPhotonCuts
bookkeeping for photon specific cuts
Double_t fPIDnSigmaAbovePionLine
sigma cut
virtual Double_t GetPz() const =0
Definition: External.C:236
Bool_t fDodEdxSigmaCut
flag to use the dEdxCut based on sigmas
TObjString * fCutString
cut number used for analysis
Double_t fMinClsTPC
minimum clusters in the TPC
const char * title
Definition: MakeQAPdf.C:27
Int_t GetFirstTPCRow(Double_t radius)
static const char * fgkCutNames[kNCuts]
Double_t fDCAZPrimVtxCut
cut value for the maximum distance in Z between the photon & the primary vertex [cm] ...
Bool_t fSwitchToKappa
switches from standard dEdx nSigma TPC cuts to Kappa TPC
TH1F * fHistoCutIndex
bookkeeping for cuts
Bool_t PIDProbabilityCut(AliConversionPhotonBase *photon, AliVEvent *event)
Bool_t SetLowPRejectionCuts(Int_t LowPRejectionSigmaCut)
TH2F * fHistoTPCdEdxSigafter
TPC Sigm dEdx after cuts.
Double_t fMinPhotonAsymmetry
Asymmetry Cut.
Double_t fTRDPIDAboveCut
TRD cut range.
Float_t fEtaForPhiCutMin
eta cut for phi sector selection
#define ASSIGNARRAY(i)
Bool_t SetSinglePtCut(Int_t singlePtCut)
Bool_t fMaterialBudgetWeightsInitialized
weights for conversions photons due due deviating material budget in MC compared to data ...
TH2F * fHistoTPCdEdxafter
TPC dEdx after cuts.
Double_t fDeltaR
Delta R for Double Counting Cut.
Int_t fInPlaneOutOfPlane
In-Plane Out-Of Plane Analysis.
Float_t GetDCAzToPrimVtx() const
TH2F * fHistoArmenterosafter
armenteros podolanski plot after cuts
AliPIDResponse * fPIDResponse
PID response.
Bool_t AsymmetryCut(AliConversionPhotonBase *photon, AliVEvent *event)
virtual Double_t GetPx() const =0
Double_t fPIDMinPPionRejectionLowP
Momentum limit to apply proton rejection.
TH2F * fHistoPsiPairDeltaPhiafter
TOF Sigma after cuts.
Bool_t dEdxCuts(AliVTrack *track)
TH2F * fHistoArmenterosbefore
armenteros podolanski plot before cuts
Bool_t SetToCloseV0sCut(Int_t toClose)
void InitCutHistograms(TString name="", Bool_t preCut=kTRUE)
TH2F * fHistoTOFbefore
TOF before cuts.
Bool_t SetTOFElectronPIDCut(Int_t TOFelectronPID)
Bool_t fDoShrinkTPCAcceptance
Flag for shrinking the TPC acceptance due to different reasons.
Bool_t PhotonIsSelectedAODMC(AliAODMCParticle *particle, TClonesArray *aodmcArray, Bool_t checkForConvertedGamma=kTRUE)
AliConversionPhotonCuts(const char *name="V0Cuts", const char *title="V0 Cuts")
Float_t fMinPhiCut
phi sector cut
TH1F * fHistoInvMassafter
e+e- inv mass distribution after cuts
Bool_t SetMinPhiSectorCut(Int_t minPhiCut)
void FillElectonLabelArray(AliAODConversionPhoton *photon, Int_t nV0)
Double_t fSinglePtCut2
second pt cut for electron/positron if asymmetric cut is chosen
AliESDtrack * GetESDTrack(AliESDEvent *event, Int_t label)
TH2F * fHistoITSSigafter
ITS Sigma after cuts.
static AliConversionPhotonCuts * GetStandardCuts2010PbPb()
Double_t fDoKaonRejectionLowP
Kaon rejection at low p.
Int_t fElectronArraySize
Size of electron array.
TH2F * fHistoTOFSigbefore
TOF Sigma before cuts.
Int_t fIsHeavyIon
flag for pp (0), PbPb (1), pPb (2)
Bool_t RejectToCloseV0s(AliAODConversionPhoton *photon, TList *photons, Int_t nV0)
virtual Double_t GetPhotonP() const =0
virtual Double_t GetPhotonPhi() const =0
Bool_t InPlaneOutOfPlaneCut(Double_t photonPhi, Double_t eventPlaneAngle=-100, Bool_t fill=kTRUE)
Bool_t PhotonCuts(AliConversionPhotonBase *photon, AliVEvent *event)
Bool_t SetChi2GammaCut(Int_t chi2GammaCut)
int Int_t
Definition: External.C:63
Bool_t SetCut(cutIds cutID, Int_t cut)
Double_t fDoPionRejectionLowP
Pion rejection at low p.
TH1F * fHistoInvMassbefore
e+e- inv mass distribution before cuts
TH1F * fHistoEventPlanePhi
EventPlaneAngle Minus Photon Angle.
float Float_t
Definition: External.C:68
Bool_t fUseITSpid
flag to use tof pid
TH1F * fHistoEtaDistV0sAfterdEdxCuts
eta-distribution of all V0s after Finder selection after dEdx cuts
Double_t fTRDPIDBelowCut
TRD cut range.
Double_t fPIDMaxPnSigmaAbovePionLine
sigma cut
Double_t fITSPIDnSigmaAboveElectronLine
sigma cut RRnewTOF
Double_t fDCARPrimVtxCut
cut value for the maximum distance in R between the photon & the primary vertex [cm] ...
void DeterminePhotonQuality(AliVTrack *negTrack, AliVTrack *posTrack)
Bool_t SetITSElectronPIDCut(Int_t ITSelectronPID)
Bool_t SetPhotonAsymmetryCut(Int_t doPhotonAsymmetryCut)
TH2F * fHistoITSSigbefore
ITS Sigma before cuts.
Double_t fPIDnSigmaAtLowPAroundKaonLine
sigma cut
Bool_t SetKappaTPCCut(Int_t kappaCut)
Double_t fPIDnSigmaAtLowPAroundPionLine
sigma cut
Bool_t SetDCAZPhotonPrimVtxCut(Int_t DCAZPhotonPrimVtx)
Int_t GetTrackLabel(Int_t i) const
Bool_t SetMinMomPiondEdxCut(Int_t piMinMomdedxSigmaCut)
Double_t fPIDMinPnSigmaAbovePionLine
sigma cut
Double_t fPIDnSigmaBelowElectronLine
sigma cut
Bool_t PhotonIsSelectedMC(TParticle *particle, AliMCEvent *mcEvent, Bool_t checkForConvertedGamma=kTRUE)
Class handling all kinds of selection cuts for Gamma Conversion analysis.
Bool_t fDoPhotonAsymmetryCut
flag to use the PhotonAsymetryCut
TString fV0ReaderName
Name of the V0 reader.
Float_t GetDCArToPrimVtx() const
TH2F * fHistoAsymmetryafter
asymmetry plot after cuts
Bool_t fDoPhotonPDependentAsymCut
flag to use the PhotonAsymetryCut with P dependent cut
virtual Double_t GetPhotonPt() const =0
TProfile * fProfileContainingMaterialBudgetWeights
Bool_t InitializeCutsFromCutString(const TString analysisCutSelection)
Bool_t SetCosPAngleCut(Int_t cosCut)
Bool_t SetEtaForPhiCut(Int_t etaPhiCut)
Bool_t SetTPCClusterCut(Int_t clsTPCCut)
Bool_t InitializeMaterialBudgetWeights(Int_t flag, TString filename)
Bool_t fUseTOFpid
flag to use tof pid
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)
Float_t GetMaterialBudgetCorrectingWeightForTrueGamma(AliAODConversionPhoton *gamma)
TList * fHistograms
List of QA histograms.
Bool_t fDoQtGammaSelection
Select gammas using qtMax.
Float_t fKappaMinCut
maximum Kappa cut
TH2F * fHistoTPCdEdxbefore
TPC dEdx before cuts.
Bool_t fProcessAODCheck
Flag for processing check for AOD to be contained in AliAODs.root and AliAODGammaConversion.root.
TH2F * fHistoKappaafter
Kappa vs photon pt after cuts.
Float_t fKappaMaxCut
maximum Kappa cut
virtual Double_t GetPy() const =0
Bool_t SetTRDElectronCut(Int_t TRDElectronCut)
void FillPhotonCutIndex(Int_t photoncut)
Double_t fSinglePtCut
pt cut for electron/positron
Bool_t SetPsiPairCut(Int_t psiCut)
TH2F * fHistoTPCdEdxSigbefore
TPC Sigma dEdx before cuts.
Bool_t SpecificTrackCuts(AliAODTrack *negTrack, AliAODTrack *posTrack, Int_t &cutIndex)
Cut functions.
Double_t fQtMax
Maximum Qt from Armenteros to select Gammas.
Double_t fTofPIDnSigmaBelowElectronLine
sigma cut RRnewTOF
UChar_t DeterminePhotonQualityAOD(AliAODConversionPhoton *, AliVEvent *)
Bool_t SelectV0Finder(Bool_t onfly)
TH1F * fHistoEtaDistV0s
eta-distribution of all V0s after Finder selection
Bool_t fDo2DQt
Select gammas using ellipse cut.
Bool_t AcceptanceCuts(AliConversionPhotonBase *photon)
Bool_t fDoDoubleCountingCut
Flag to reject double counting.
Double_t fMinClsTPCToF
minimum clusters to findable clusters
TFile * file
TList with histograms for a given trigger.
Float_t GetKappaTPC(AliConversionPhotonBase *gamma, AliVEvent *event)
AliVTrack * GetTrack(AliVEvent *event, Int_t label)
Bool_t CosinePAngleCut(const AliConversionPhotonBase *photon, AliVEvent *event) const
Int_t fUseOnFlyV0FinderSameSign
int to set same sign pairing
Double_t fPIDnSigmaAbovePionLineHighPt
sigma cut
Double_t fPIDMinPProtonRejectionLowP
Momentum limit to apply proton rejection.
static AliConversionPhotonCuts * GetStandardCuts2010pp()
Bool_t SetMaxMomPiondEdxCut(Int_t piMaxMomdedxSigmaCut)
Double_t fPIDnSigmaAtLowPAroundProtonLine
sigma cut
Bool_t PsiPairCut(const AliConversionPhotonBase *photon) const
Double_t fMaxPtPIDITS
max pt for ITS PID
Bool_t SetTPCdEdxCutElectronLine(Int_t ededxSigmaCut)
bool Bool_t
Definition: External.C:53
void CalculateDistanceOfClossetApproachToPrimVtx(const AliVVertex *primVertex)
Bool_t fUseCorrectedTPCClsInfo
flag to use corrected tpc cl info
Double_t fPIDnSigmaAboveElectronLine
sigma cut
Bool_t TracksAreSelected(AliVTrack *negTrack, AliVTrack *posTrack)
Bool_t KappaCuts(AliConversionPhotonBase *photon, AliVEvent *event)
Bool_t SetInPlaneOutOfPlane(Int_t inOutPlane)
Bool_t SetMaxPhiSectorCut(Int_t maxPhiCut)
Bool_t fDoTRDPID
flag to use TRD pid
Bool_t SetSharedElectronCut(Int_t sharedElec)
Double_t fITSPIDnSigmaBelowElectronLine
sigma cut RRnewTOF
Bool_t SetV0Finder(Int_t v0FinderType)
Bool_t AcceptanceCut(TParticle *particle, TParticle *ePos, TParticle *eNeg)
Bool_t SetTRDElectronPIDCut(Int_t TRDelectronPID)
Bool_t fDoLightOutput
switch for running light output, kFALSE -> normal mode, kTRUE -> light mode
Bool_t fDoAsymPtCut
Flag for setting asymmetric pT cut on electron/positron.
TH1F * fHistoTrackCuts
bookkeeping for track cuts
Double_t GetCosineOfPointingAngle(const AliConversionPhotonBase *photon, AliVEvent *event) const
Double_t GetConversionRadius() const
Bool_t ArmenterosQtCut(AliConversionPhotonBase *photon)
Bool_t CorrectedTPCClusterCut(AliConversionPhotonBase *photon, AliVEvent *event)
Float_t fEtaForPhiCutMax
eta cut for phi sector selection
Double_t fDoProtonRejectionLowP
Proton rejection at low p.
virtual Double_t GetPhotonEta() const =0
Double_t fPIDMinPKaonRejectionLowP
Momentum limit to apply kaon rejection.
Bool_t PhotonIsSelected(AliConversionPhotonBase *photon, AliVEvent *event)
Bool_t SetTPCdEdxCutPionLine(Int_t pidedxSigmaCut)