AliPhysics  d497547 (d497547)
 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  fProfileContainingMaterialBudgetWeights(NULL),
223  fMaterialBudgetWeightsInitialized(kFALSE)
224 {
225  InitPIDResponse();
226  for(Int_t jj=0;jj<kNCuts;jj++){fCuts[jj]=0;}
227  fCutString=new TObjString((GetCutNumber()).Data());
228 
230 }
231 
232 //________________________________________________________________________
234  AliAnalysisCuts(ref),
235  fHistograms(NULL),
236  fPIDResponse(NULL),
237  fDoLightOutput(ref.fDoLightOutput),
238  fV0ReaderName("V0ReaderV1"),
239  fMaxR(ref.fMaxR),
240  fMinR(ref.fMinR),
241  fEtaCut(ref.fEtaCut),
242  fEtaCutMin(ref.fEtaCutMin),
243  fEtaForPhiCutMin(ref.fEtaForPhiCutMin),
244  fEtaForPhiCutMax(ref.fEtaForPhiCutMax),
245  fMinPhiCut(ref.fMinPhiCut),
246  fMaxPhiCut(ref.fMaxPhiCut),
247  fDoShrinkTPCAcceptance(ref.fDoShrinkTPCAcceptance),
248  fPtCut(ref.fPtCut),
249  fSinglePtCut(ref.fSinglePtCut),
250  fSinglePtCut2(ref.fSinglePtCut2),
251  fDoAsymPtCut(ref.fDoAsymPtCut),
252  fMaxZ(ref.fMaxZ),
253  fMinClsTPC(ref.fMinClsTPC),
254  fMinClsTPCToF(ref.fMinClsTPCToF),
255  fLineCutZRSlope(ref.fLineCutZRSlope),
256  fLineCutZValue(ref.fLineCutZValue),
257  fLineCutZRSlopeMin(ref.fLineCutZRSlopeMin),
258  fLineCutZValueMin(ref.fLineCutZValueMin),
259  fChi2CutConversion(ref.fChi2CutConversion),
260  fPIDProbabilityCutNegativeParticle(ref.fPIDProbabilityCutNegativeParticle),
261  fPIDProbabilityCutPositiveParticle(ref.fPIDProbabilityCutPositiveParticle),
262  fDodEdxSigmaCut(ref. fDodEdxSigmaCut),
263  fDoTOFsigmaCut(ref.fDoTOFsigmaCut),
264  fPIDTRDEfficiency(ref.fPIDTRDEfficiency),
265  fDoTRDPID(ref.fDoTRDPID),
266  fPIDnSigmaAboveElectronLine(ref.fPIDnSigmaAboveElectronLine),
267  fPIDnSigmaBelowElectronLine(ref.fPIDnSigmaBelowElectronLine),
268  fTofPIDnSigmaAboveElectronLine(ref.fTofPIDnSigmaAboveElectronLine),
269  fTofPIDnSigmaBelowElectronLine(ref.fTofPIDnSigmaBelowElectronLine),
270  fPIDnSigmaAbovePionLine(ref.fPIDnSigmaAbovePionLine),
271  fPIDnSigmaAbovePionLineHighPt(ref.fPIDnSigmaAbovePionLineHighPt),
272  fPIDMinPnSigmaAbovePionLine(ref.fPIDMinPnSigmaAbovePionLine),
273  fPIDMaxPnSigmaAbovePionLine(ref.fPIDMaxPnSigmaAbovePionLine),
274  fDoKaonRejectionLowP(ref.fDoKaonRejectionLowP),
275  fDoProtonRejectionLowP(ref.fDoProtonRejectionLowP),
276  fDoPionRejectionLowP(ref.fDoPionRejectionLowP),
277  fPIDnSigmaAtLowPAroundKaonLine(ref.fPIDnSigmaAtLowPAroundKaonLine),
278  fPIDnSigmaAtLowPAroundProtonLine(ref.fPIDnSigmaAtLowPAroundProtonLine),
279  fPIDnSigmaAtLowPAroundPionLine(ref.fPIDnSigmaAtLowPAroundPionLine),
280  fPIDMinPKaonRejectionLowP(ref.fPIDMinPKaonRejectionLowP),
281  fPIDMinPProtonRejectionLowP(ref.fPIDMinPProtonRejectionLowP),
282  fPIDMinPPionRejectionLowP(ref.fPIDMinPPionRejectionLowP),
283  fDoQtGammaSelection(ref.fDoQtGammaSelection),
284  fDo2DQt(ref.fDo2DQt),
285  fQtMax(ref.fQtMax),
286  fNSigmaMass(ref.fNSigmaMass),
287  fUseEtaMinCut(ref.fUseEtaMinCut),
288  fUseOnFlyV0Finder(ref.fUseOnFlyV0Finder),
289  fUseOnFlyV0FinderSameSign(ref.fUseOnFlyV0FinderSameSign),
290  fDoPhotonAsymmetryCut(ref.fDoPhotonAsymmetryCut),
291  fDoPhotonPDependentAsymCut(ref.fDoPhotonPDependentAsymCut),
292  fFAsymmetryCut(ref.fFAsymmetryCut),
293  fMinPPhotonAsymmetryCut(ref.fMinPPhotonAsymmetryCut),
294  fMinPhotonAsymmetry(ref.fMinPhotonAsymmetry),
295  fUseCorrectedTPCClsInfo(ref.fUseCorrectedTPCClsInfo),
296  fUseTOFpid(ref.fUseTOFpid),
297  fOpeningAngle(ref.fOpeningAngle),
298  fPsiPairCut(ref.fPsiPairCut),
299  fDo2DPsiPairChi2(ref.fDo2DPsiPairChi2),
300  fIncludeRejectedPsiPair(ref.fIncludeRejectedPsiPair),
301  fCosPAngleCut(ref.fCosPAngleCut),
302  fDoToCloseV0sCut(ref.fDoToCloseV0sCut),
303  fminV0Dist(ref.fminV0Dist),
304  fDoSharedElecCut(ref.fDoSharedElecCut),
305  fDoPhotonQualitySelectionCut(ref.fDoPhotonQualitySelectionCut),
306  fPhotonQualityCut(ref.fPhotonQualityCut),
307  fRandom(ref.fRandom),
308  fElectronArraySize(ref.fElectronArraySize),
309  fElectronLabelArray(NULL),
310  fDCAZPrimVtxCut(ref.fDCAZPrimVtxCut),
311  fDCARPrimVtxCut(ref.fDCAZPrimVtxCut),
312  fInPlaneOutOfPlane(ref.fInPlaneOutOfPlane),
313  fConversionPointXArray(ref.fConversionPointXArray),
314  fConversionPointYArray(ref.fConversionPointYArray),
315  fConversionPointZArray(ref.fConversionPointZArray),
316  fCutString(NULL),
317  fCutStringRead(""),
318  fIsHeavyIon(ref.fIsHeavyIon),
319  fUseITSpid(ref.fUseITSpid),
320  fITSPIDnSigmaAboveElectronLine(ref.fITSPIDnSigmaAboveElectronLine),
321  fITSPIDnSigmaBelowElectronLine(ref.fITSPIDnSigmaBelowElectronLine),
322  fMaxPtPIDITS(ref.fMaxPtPIDITS),
323  fTRDPIDAboveCut(ref.fTRDPIDAboveCut),
324  fTRDPIDBelowCut(ref.fTRDPIDBelowCut),
325  fDoDoubleCountingCut(ref.fDoDoubleCountingCut),
326  fMinRDC(ref.fMinRDC),
327  fDeltaR(ref.fDeltaR),
328  fOpenAngle(ref.fOpenAngle),
329  fSwitchToKappa(ref.fSwitchToKappa),
330  fKappaMinCut(ref.fKappaMinCut),
331  fKappaMaxCut(ref.fKappaMaxCut),
332  fHistoEtaDistV0s(NULL),
333  fHistoEtaDistV0sAfterdEdxCuts(NULL),
334  fHistodEdxCuts(NULL),
335  fHistoTPCdEdxbefore(NULL),
336  fHistoTPCdEdxafter(NULL),
337  fHistoTPCdEdxSigbefore(NULL),
338  fHistoTPCdEdxSigafter(NULL),
339  fHistoKappaafter(NULL),
340  fHistoTOFbefore(NULL),
341  fHistoTOFSigbefore(NULL),
342  fHistoTOFSigafter(NULL),
343  fHistoITSSigbefore(NULL),
344  fHistoITSSigafter(NULL),
345  fHistoPsiPairDeltaPhiafter(NULL),
346  fHistoTrackCuts(NULL),
347  fHistoPhotonCuts(NULL),
348  fHistoInvMassbefore(NULL),
349  fHistoArmenterosbefore(NULL),
350  fHistoInvMassafter(NULL),
351  fHistoArmenterosafter(NULL),
352  fHistoAsymmetryafter(NULL),
353  fHistoAcceptanceCuts(NULL),
354  fHistoCutIndex(NULL),
355  fHistoEventPlanePhi(NULL),
356  fPreSelCut(ref.fPreSelCut),
357  fProcessAODCheck(ref.fProcessAODCheck),
358  fProfileContainingMaterialBudgetWeights(ref.fProfileContainingMaterialBudgetWeights),
359  fMaterialBudgetWeightsInitialized(ref.fMaterialBudgetWeightsInitialized)
360 {
361  // Copy Constructor
362  for(Int_t jj=0;jj<kNCuts;jj++){fCuts[jj]=ref.fCuts[jj];}
363  fCutString=new TObjString((GetCutNumber()).Data());
365  // dont copy histograms (if you like histograms, call InitCutHistograms())
366 }
367 
368 
369 //________________________________________________________________________
371  // Destructor
372  //Deleting fHistograms leads to seg fault it it's added to output collection of a task
373  // if(fHistograms)
374  // delete fHistograms;
375  // fHistograms = NULL;
376  if(fCutString != NULL){
377  delete fCutString;
378  fCutString = NULL;
379  }
381  delete fElectronLabelArray;
382  fElectronLabelArray = NULL;
383  }
384 
385  if(fFAsymmetryCut != NULL){
386  delete fFAsymmetryCut;
387  fFAsymmetryCut = NULL;
388  }
392  }
393 }
394 
395 //________________________________________________________________________
397 
398  // Initialize Cut Histograms for QA (only initialized and filled if function is called)
399  TH1::AddDirectory(kFALSE);
400 
401  if(fHistograms != NULL){
402  delete fHistograms;
403  fHistograms=NULL;
404  }
405  if(fHistograms==NULL){
406  fHistograms=new TList();
407  fHistograms->SetOwner(kTRUE);
408  if(name=="")fHistograms->SetName(Form("ConvCuts_%s",GetCutNumber().Data()));
409  else fHistograms->SetName(Form("%s_%s",name.Data(),GetCutNumber().Data()));
410  }
411 
412  // IsPhotonSelected
413  fHistoCutIndex=new TH1F(Form("IsPhotonSelected %s",GetCutNumber().Data()),"IsPhotonSelected",12,-0.5,11.5);
414  fHistoCutIndex->GetXaxis()->SetBinLabel(kPhotonIn+1,"in");
415  fHistoCutIndex->GetXaxis()->SetBinLabel(kOnFly+1,"onfly");
416  fHistoCutIndex->GetXaxis()->SetBinLabel(kNoTracks+1,"no tracks");
417  fHistoCutIndex->GetXaxis()->SetBinLabel(kNoV0+1,"miss. V0 in AOD");
418  if (!fSwitchToKappa)fHistoCutIndex->GetXaxis()->SetBinLabel(kdEdxCuts+1,"PID");
419  else fHistoCutIndex->GetXaxis()->SetBinLabel(kdEdxCuts+1,"Kappa+[TOF,ITS,TRD] PID");
420  fHistoCutIndex->GetXaxis()->SetBinLabel(kTrackCuts+1,"Track cuts");
421  fHistoCutIndex->GetXaxis()->SetBinLabel(kConvPointFail+1,"ConvPoint fail");
422  fHistoCutIndex->GetXaxis()->SetBinLabel(kPhotonCuts+1,"PhotonCuts");
423  fHistoCutIndex->GetXaxis()->SetBinLabel(kEventPlane+1,"EventPlane");
424  fHistoCutIndex->GetXaxis()->SetBinLabel(kPhotonOut+1,"out");
426 
427  // Track Cuts
428  fHistoTrackCuts=new TH1F(Form("TrackCuts %s",GetCutNumber().Data()),"TrackCuts",9,-0.5,8.5);
429  fHistoTrackCuts->GetXaxis()->SetBinLabel(1,"in");
430  fHistoTrackCuts->GetXaxis()->SetBinLabel(2,"likesign");
431  fHistoTrackCuts->GetXaxis()->SetBinLabel(3,"ntpccl");
432  fHistoTrackCuts->GetXaxis()->SetBinLabel(4,"acceptance");
433  fHistoTrackCuts->GetXaxis()->SetBinLabel(5,"singlept");
434  fHistoTrackCuts->GetXaxis()->SetBinLabel(6,"TPCrefit");
435  fHistoTrackCuts->GetXaxis()->SetBinLabel(7,"kink");
436  fHistoTrackCuts->GetXaxis()->SetBinLabel(8,"out");
438 
439  // Photon Cuts
440  fHistoPhotonCuts=new TH2F(Form("PhotonCuts %s",GetCutNumber().Data()),"PhotonCuts vs p_{T,#gamma}",15,-0.5,14.5,250,0,50);
441  fHistoPhotonCuts->GetXaxis()->SetBinLabel(1,"in");
442  fHistoPhotonCuts->GetXaxis()->SetBinLabel(2,"qtcut");
443  fHistoPhotonCuts->GetXaxis()->SetBinLabel(3,"chi2");
444  fHistoPhotonCuts->GetXaxis()->SetBinLabel(4,"acceptance");
445  fHistoPhotonCuts->GetXaxis()->SetBinLabel(5,"asymmetry");
446  fHistoPhotonCuts->GetXaxis()->SetBinLabel(6,"pidprob");
447  fHistoPhotonCuts->GetXaxis()->SetBinLabel(7,"cortpcclinfo");
448  fHistoPhotonCuts->GetXaxis()->SetBinLabel(8,"PsiPair");
449  fHistoPhotonCuts->GetXaxis()->SetBinLabel(9,"CosPAngle");
450  fHistoPhotonCuts->GetXaxis()->SetBinLabel(10,"DCA R");
451  fHistoPhotonCuts->GetXaxis()->SetBinLabel(11,"DCA Z");
452  fHistoPhotonCuts->GetXaxis()->SetBinLabel(12,"Photon Quality");
453  fHistoPhotonCuts->GetXaxis()->SetBinLabel(13,"out");
455 
457  fProfileContainingMaterialBudgetWeights->SetName("InputMaterialBudgetWeightsPerGamma");
459  }
460 
461  if(!fDoLightOutput){
462  if(preCut){
463  fHistoInvMassbefore=new TH1F(Form("InvMass_before %s",GetCutNumber().Data()),"InvMass_before",1000,0,0.3);
465  fHistoArmenterosbefore=new TH2F(Form("Armenteros_before %s",GetCutNumber().Data()),"Armenteros_before",200,-1,1,1000,0,1.);
467  fHistoEtaDistV0s = new TH1F(Form("Eta_before %s",GetCutNumber().Data()),"Eta_before",2000,-2,2);
469 
470  }
471  fHistoInvMassafter=new TH1F(Form("InvMass_after %s",GetCutNumber().Data()),"InvMass_after",1000,0,0.3);
473  fHistoArmenterosafter=new TH2F(Form("Armenteros_after %s",GetCutNumber().Data()),"Armenteros_after",200,-1,1,250,0,0.25);
476  fHistoAsymmetryafter=new TH2F(Form("Asymmetry_after %s",GetCutNumber().Data()),"Asymmetry_after",150,0.03,20.,200,0,1.);
478  }
479  }
480 
481  fHistoAcceptanceCuts=new TH2F(Form("PhotonAcceptanceCuts %s",GetCutNumber().Data()),"PhotonAcceptanceCuts vs p_{T,#gamma}",11,-0.5,10.5,250,0,50);
482  fHistoAcceptanceCuts->GetXaxis()->SetBinLabel(1,"in");
483  fHistoAcceptanceCuts->GetXaxis()->SetBinLabel(2,"maxR");
484  fHistoAcceptanceCuts->GetXaxis()->SetBinLabel(3,"minR");
485  fHistoAcceptanceCuts->GetXaxis()->SetBinLabel(4,"line");
486  fHistoAcceptanceCuts->GetXaxis()->SetBinLabel(5,"maxZ");
487  fHistoAcceptanceCuts->GetXaxis()->SetBinLabel(6,"eta");
488  fHistoAcceptanceCuts->GetXaxis()->SetBinLabel(7,"phisector");
489  fHistoAcceptanceCuts->GetXaxis()->SetBinLabel(8,"minpt");
490  fHistoAcceptanceCuts->GetXaxis()->SetBinLabel(9,"out");
492 
493  // dEdx Cuts
494  fHistodEdxCuts=new TH2F(Form("dEdxCuts %s",GetCutNumber().Data()),"dEdxCuts vs p_{T,e}",11,-0.5,10.5,250,0,50);
495  fHistodEdxCuts->GetXaxis()->SetBinLabel(1,"in");
496  fHistodEdxCuts->GetXaxis()->SetBinLabel(2,"TPCelectron");
497  fHistodEdxCuts->GetXaxis()->SetBinLabel(3,"TPCpion");
498  fHistodEdxCuts->GetXaxis()->SetBinLabel(4,"TPCpionhighp");
499  fHistodEdxCuts->GetXaxis()->SetBinLabel(5,"TPCkaonlowprej");
500  fHistodEdxCuts->GetXaxis()->SetBinLabel(6,"TPCprotonlowprej");
501  fHistodEdxCuts->GetXaxis()->SetBinLabel(7,"TPCpionlowprej");
502  fHistodEdxCuts->GetXaxis()->SetBinLabel(8,"TOFelectron");
503  fHistodEdxCuts->GetXaxis()->SetBinLabel(9,"ITSelectron");
504  fHistodEdxCuts->GetXaxis()->SetBinLabel(10,"TRDelectron");
505  fHistodEdxCuts->GetXaxis()->SetBinLabel(11,"out");
507 
508  if(!fDoLightOutput){
509  TAxis *AxisBeforedEdx = NULL;
510  TAxis *AxisBeforedEdxSig = NULL;
511  TAxis *AxisBeforeTOF = NULL;
512  TAxis *AxisBeforeTOFSig = NULL;
513  TAxis *AxisBeforeITSSig = NULL;
514  if(preCut){
515  fHistoTPCdEdxbefore=new TH2F(Form("Gamma_dEdx_before %s",GetCutNumber().Data()),"dEdx Gamma before" ,150,0.03,20,800,0,200);
517  AxisBeforedEdx = fHistoTPCdEdxbefore->GetXaxis();
518  fHistoTPCdEdxSigbefore=new TH2F(Form("Gamma_dEdxSig_before %s",GetCutNumber().Data()),"dEdx Sigma Gamma before" ,150,0.03,20,400,-10,10);
520  AxisBeforedEdxSig = fHistoTPCdEdxSigbefore->GetXaxis();
521 
522  fHistoTOFbefore=new TH2F(Form("Gamma_TOF_before %s",GetCutNumber().Data()),"TOF Gamma before" ,150,0.03,20,11000,-1000,10000);
524  AxisBeforeTOF = fHistoTOFbefore->GetXaxis();
525  fHistoTOFSigbefore=new TH2F(Form("Gamma_TOFSig_before %s",GetCutNumber().Data()),"TOF Sigma Gamma before" ,150,0.03,20,400,-6,10);
527  AxisBeforeTOFSig = fHistoTOFSigbefore->GetXaxis();
528 
529  fHistoITSSigbefore=new TH2F(Form("Gamma_ITSSig_before %s",GetCutNumber().Data()),"ITS Sigma Gamma before" ,150,0.03,20,400,-10,10);
531  AxisBeforeITSSig = fHistoITSSigbefore->GetXaxis();
532  }
533 
534  fHistoTPCdEdxSigafter=new TH2F(Form("Gamma_dEdxSig_after %s",GetCutNumber().Data()),"dEdx Sigma Gamma after" ,150,0.03,20,400, -10,10);
536 
537  fHistoTPCdEdxafter=new TH2F(Form("Gamma_dEdx_after %s",GetCutNumber().Data()),"dEdx Gamma after" ,150,0.03,20,800,0,200);
539 
540  fHistoKappaafter=new TH2F(Form("Gamma_Kappa_after %s",GetCutNumber().Data()),"Kappa Gamma after" ,150,0.03,20,200,-20,20);
542 
543  fHistoTOFSigafter=new TH2F(Form("Gamma_TOFSig_after %s",GetCutNumber().Data()),"TOF Sigma Gamma after" ,150,0.03,20,400,-6,10);
545 
546  fHistoITSSigafter=new TH2F(Form("Gamma_ITSSig_after %s",GetCutNumber().Data()),"ITS Sigma Gamma after" ,150,0.03,20,400,-10,10);
548 
549  fHistoEtaDistV0sAfterdEdxCuts = new TH1F(Form("Eta_afterdEdx %s",GetCutNumber().Data()),"Eta_afterdEdx",2000,-2,2);
551 
552  fHistoPsiPairDeltaPhiafter=new TH2F(Form("Gamma_PsiPairDeltaPhi_after %s",GetCutNumber().Data()),"Psi Pair vs Delta Phi Gamma after" ,200,-2,2,200,-2,2);
554 
555  TAxis *AxisAfter = fHistoTPCdEdxSigafter->GetXaxis();
556  Int_t bins = AxisAfter->GetNbins();
557  Double_t from = AxisAfter->GetXmin();
558  Double_t to = AxisAfter->GetXmax();
559  Double_t *newBins = new Double_t[bins+1];
560  newBins[0] = from;
561  Double_t factor = TMath::Power(to/from, 1./bins);
562  for(Int_t i=1; i<=bins; ++i) newBins[i] = factor * newBins[i-1];
563  AxisAfter->Set(bins, newBins);
564  AxisAfter = fHistoTOFSigafter->GetXaxis();
565  AxisAfter->Set(bins, newBins);
566  AxisAfter = fHistoTPCdEdxafter->GetXaxis();
567  AxisAfter->Set(bins, newBins);
568  AxisAfter = fHistoKappaafter->GetXaxis();
569  AxisAfter->Set(bins, newBins);
570  AxisAfter = fHistoITSSigafter->GetXaxis();
571  AxisAfter->Set(bins, newBins);
573  AxisAfter = fHistoAsymmetryafter->GetXaxis();
574  AxisAfter->Set(bins, newBins);
575  }
576  if(preCut){
577  AxisBeforedEdx->Set(bins, newBins);
578  AxisBeforeTOF->Set(bins, newBins);
579  AxisBeforedEdxSig->Set(bins, newBins);
580  AxisBeforeTOFSig->Set(bins, newBins);
581  AxisBeforeITSSig->Set(bins, newBins);
582  }
583  delete [] newBins;
584 
585  // Event Cuts and Info
586  if(!preCut){
587  fHistoEventPlanePhi=new TH1F(Form("EventPlaneMinusPhotonAngle %s",GetCutNumber().Data()),"EventPlaneMinusPhotonAngle",360,-TMath::Pi(),TMath::Pi());
589  }
590  }
591 
592  TH1::AddDirectory(kTRUE);
593 }
594 
595 //________________________________________________________________________
597  // Set Pointer to AliPIDResponse
598 
599  AliAnalysisManager *man=AliAnalysisManager::GetAnalysisManager();
600  if(man) {
601  AliInputEventHandler* inputHandler = (AliInputEventHandler*) (man->GetInputEventHandler());
602  fPIDResponse = (AliPIDResponse*)inputHandler->GetPIDResponse();
603  if(fPIDResponse)return kTRUE;
604 
605  }
606 
607 
608  return kFALSE;
609 }
610 
612 Bool_t AliConversionPhotonCuts::PhotonIsSelectedMC(TParticle *particle,AliMCEvent *mcEvent,Bool_t checkForConvertedGamma){
613  // MonteCarlo Photon Selection
614 
615  if(!mcEvent)return kFALSE;
616 
617  if (particle->GetPdgCode() == 22){
618 
619 
620  if( particle->Eta() > (fEtaCut) || particle->Eta() < (-fEtaCut) )
621  return kFALSE;
622  if(fEtaCutMin>-0.1){
623  if( particle->Eta() < (fEtaCutMin) && particle->Eta() > (-fEtaCutMin) )
624  return kFALSE;
625  }
626 
627  if(particle->GetMother(0) >-1 && mcEvent->Particle(particle->GetMother(0))->GetPdgCode() == 22){
628  return kFALSE; // no photon as mothers!
629  }
630 
631  // removed, decision on primary and secondary taken in main task
632 // if(particle->GetMother(0) >= mcEvent->GetNumberOfPrimaries()){
633 // return kFALSE; // the gamma has a mother, and it is not a primary particle
634 // }
635 
636  if(!checkForConvertedGamma) return kTRUE; // return in case of accepted gamma
637 
638  // looking for conversion gammas (electron + positron from pairbuilding (= 5) )
639  TParticle* ePos = NULL;
640  TParticle* eNeg = NULL;
641 
642  if(particle->GetNDaughters() >= 2){
643  for(Int_t daughterIndex=particle->GetFirstDaughter();daughterIndex<=particle->GetLastDaughter();daughterIndex++){
644  if(daughterIndex<0) continue;
645  TParticle *tmpDaughter = mcEvent->Particle(daughterIndex);
646  if(tmpDaughter->GetUniqueID() == 5){
647  if(tmpDaughter->GetPdgCode() == 11){
648  eNeg = tmpDaughter;
649  } else if(tmpDaughter->GetPdgCode() == -11){
650  ePos = tmpDaughter;
651  }
652  }
653  }
654  }
655 
656  if(ePos == NULL || eNeg == NULL){ // means we do not have two daughters from pair production
657  return kFALSE;
658  }
659 
660  if(fDoAsymPtCut){
661  if((ePos->Pt()<fSinglePtCut || eNeg->Pt()<fSinglePtCut2) && (ePos->Pt()<fSinglePtCut2 || eNeg->Pt()<fSinglePtCut) ){
662  return kFALSE; // no reconstruction below the Pt cut (both (pos and neg) require minimum pT)
663  }
664  } else {
665  if(ePos->Pt()<fSinglePtCut || eNeg->Pt()<fSinglePtCut){
666  return kFALSE; // no reconstruction below the Pt cut
667  }
668  }
669 
670  if( ePos->Eta() > (fEtaCut) || ePos->Eta() < (-fEtaCut) ||
671  eNeg->Eta() > (fEtaCut) || eNeg->Eta() < (-fEtaCut) )
672  return kFALSE;
673 
674  if(fEtaCutMin > -0.1){
675  if( (ePos->Eta() < (fEtaCutMin) && ePos->Eta() > (-fEtaCutMin)) ||
676  (eNeg->Eta() < (fEtaCutMin) && eNeg->Eta() > (-fEtaCutMin)) )
677  return kFALSE;
678  }
679 
680  if(ePos->R()>fMaxR){
681  return kFALSE; // cuts on distance from collision point
682  }
683 
684  if(TMath::Abs(ePos->Vz()) > fMaxZ){
685  return kFALSE; // outside material
686  }
687  if(TMath::Abs(eNeg->Vz()) > fMaxZ){
688  return kFALSE; // outside material
689  }
690 
691  if( ePos->R() <= ((TMath::Abs(ePos->Vz()) * fLineCutZRSlope) - fLineCutZValue)){
692  return kFALSE; // line cut to exclude regions where we do not reconstruct
693  } else if ( fEtaCutMin != -0.1 && ePos->R() >= ((TMath::Abs(ePos->Vz()) * fLineCutZRSlopeMin) - fLineCutZValueMin)){
694  return kFALSE;
695  }
696 
697  if( eNeg->R() <= ((TMath::Abs(eNeg->Vz()) * fLineCutZRSlope) - fLineCutZValue)){
698  return kFALSE; // line cut to exclude regions where we do not reconstruct
699  } else if ( fEtaCutMin != -0.1 && eNeg->R() >= ((TMath::Abs(eNeg->Vz()) * fLineCutZRSlopeMin) - fLineCutZValueMin)){
700  return kFALSE;
701  }
702 
703  return kTRUE;
704  //if(AcceptanceCut(particle,ePos,eNeg))return kTRUE;
705  }
706  return kFALSE;
707 }
709 Bool_t AliConversionPhotonCuts::PhotonIsSelectedAODMC(AliAODMCParticle *particle,TClonesArray *aodmcArray,Bool_t checkForConvertedGamma){
710  // MonteCarlo Photon Selection
711 
712  if(!aodmcArray)return kFALSE;
713 
714  if (particle->GetPdgCode() == 22){
715  if( particle->Eta() > (fEtaCut) || particle->Eta() < (-fEtaCut) )
716  return kFALSE;
717  if(fEtaCutMin>-0.1){
718  if( particle->Eta() < (fEtaCutMin) && particle->Eta() > (-fEtaCutMin) )
719  return kFALSE;
720  }
721 
722  if(particle->GetMother() > -1 && (static_cast<AliAODMCParticle*>(aodmcArray->At(particle->GetMother())))->GetPdgCode() == 22){
723  return kFALSE; // no photon as mothers!
724  }
725  // removed, decision on primary and secondary taken in main task
726 // Bool_t isPrimary = ((AliConvEventCuts*)fEventCutArray->At(fiCut))->IsConversionPrimaryAOD(fInputEvent, static_cast<AliAODMCParticle*>(aodmcArray->At(particle->GetMother())), mcProdVtxX, mcProdVtxY, mcProdVtxZ);
727 // if(!isPrimary){
728 // return kFALSE; // the gamma has a mother, and it is not a primary particle
729 // }
730 
731  if(!checkForConvertedGamma) return kTRUE; // return in case of accepted gamma
732 
733  // looking for conversion gammas (electron + positron from pairbuilding (= 5) )
734  AliAODMCParticle* ePos = NULL;
735  AliAODMCParticle* eNeg = NULL;
736 
737  if(particle->GetNDaughters() >= 2){
738  for(Int_t daughterIndex=particle->GetDaughter(0);daughterIndex<=particle->GetDaughter(1);daughterIndex++){
739  AliAODMCParticle *tmpDaughter = static_cast<AliAODMCParticle*>(aodmcArray->At(daughterIndex));
740  if(!tmpDaughter) continue;
741  if(((tmpDaughter->GetMCProcessCode())) == 5){ // STILL A BUG IN ALIROOT >>8 HAS TPO BE REMOVED AFTER FIX
742  if(tmpDaughter->GetPdgCode() == 11){
743  eNeg = tmpDaughter;
744  } else if(tmpDaughter->GetPdgCode() == -11){
745  ePos = tmpDaughter;
746  }
747  }
748  }
749  }
750 
751  if(ePos == NULL || eNeg == NULL){ // means we do not have two daughters from pair production
752  return kFALSE;
753  }
754 
755  if(fDoAsymPtCut){
756  if((ePos->Pt()<fSinglePtCut || eNeg->Pt()<fSinglePtCut2) && (ePos->Pt()<fSinglePtCut2 || eNeg->Pt()<fSinglePtCut) ){
757  return kFALSE; // no reconstruction below the Pt cut (both (pos and neg) require minimum pT)
758  }
759  } else {
760  if(ePos->Pt()<fSinglePtCut || eNeg->Pt()<fSinglePtCut){
761  return kFALSE; // no reconstruction below the Pt cut
762  }
763  }
764 
765  if( ePos->Eta() > (fEtaCut) || ePos->Eta() < (-fEtaCut) ||
766  eNeg->Eta() > (fEtaCut) || eNeg->Eta() < (-fEtaCut) )
767  return kFALSE;
768 
769  if(fEtaCutMin > -0.1){
770  if( (ePos->Eta() < (fEtaCutMin) && ePos->Eta() > (-fEtaCutMin)) ||
771  (eNeg->Eta() < (fEtaCutMin) && eNeg->Eta() > (-fEtaCutMin)) )
772  return kFALSE;
773  }
774 
775  Double_t rPos = sqrt( (ePos->Xv()*ePos->Xv()) + (ePos->Yv()*ePos->Yv()) );
776  Double_t rNeg = sqrt( (eNeg->Xv()*eNeg->Xv()) + (eNeg->Yv()*eNeg->Yv()) );
777 
778  if(rPos>fMaxR){
779  return kFALSE; // cuts on distance from collision point
780  }
781  if(TMath::Abs(ePos->Zv()) > fMaxZ){
782  return kFALSE; // outside material
783  }
784  if(TMath::Abs(eNeg->Zv()) > fMaxZ){
785  return kFALSE; // outside material
786  }
787 
788  if( rPos <= ((TMath::Abs(ePos->Zv()) * fLineCutZRSlope) - fLineCutZValue)){
789  return kFALSE; // line cut to exclude regions where we do not reconstruct
790  } else if ( fEtaCutMin != -0.1 && rPos >= ((TMath::Abs(ePos->Zv()) * fLineCutZRSlopeMin) - fLineCutZValueMin)){
791  return kFALSE;
792  }
793 
794  if( rNeg <= ((TMath::Abs(eNeg->Zv()) * fLineCutZRSlope) - fLineCutZValue)){
795  return kFALSE; // line cut to exclude regions where we do not reconstruct
796  } else if ( fEtaCutMin != -0.1 && rNeg >= ((TMath::Abs(eNeg->Zv()) * fLineCutZRSlopeMin) - fLineCutZValueMin)){
797  return kFALSE;
798  }
799 
800  return kTRUE;
801  //if(AcceptanceCut(particle,ePos,eNeg))return kTRUE;
802  }
803  return kFALSE;
804 }
805 
807 Bool_t AliConversionPhotonCuts::PhotonCuts(AliConversionPhotonBase *photon,AliVEvent *event){ // Specific Photon Cuts
808 
809  Int_t cutIndex = 0;
810  if(fHistoPhotonCuts)fHistoPhotonCuts->Fill(cutIndex, photon->GetPhotonPt());
811  cutIndex++;
812 
813  // Fill Histos before Cuts
814  if(fHistoInvMassbefore)fHistoInvMassbefore->Fill(photon->GetMass());
816 
817  // Gamma selection based on QT from Armenteros
818  if(fDoQtGammaSelection == kTRUE){
819  if(!ArmenterosQtCut(photon)){
820  if(fHistoPhotonCuts)fHistoPhotonCuts->Fill(cutIndex, photon->GetPhotonPt()); //1
821  return kFALSE;
822  }
823  }
824  cutIndex++; //2
825 
826  // Chi Cut
827  if(photon->GetChi2perNDF() > fChi2CutConversion || photon->GetChi2perNDF() <=0){
828  {
829  if(fHistoPhotonCuts)fHistoPhotonCuts->Fill(cutIndex, photon->GetPhotonPt()); //2
830  return kFALSE;
831  }
832  }
833  cutIndex++;//3
834 
835  // Reconstruction Acceptance Cuts
836  if(!AcceptanceCuts(photon)){
837  if(fHistoPhotonCuts)fHistoPhotonCuts->Fill(cutIndex, photon->GetPhotonPt()); //3
838  return kFALSE;
839  }
840 
841  cutIndex++; //4
842  // Asymmetry Cut
843  if(fDoPhotonAsymmetryCut == kTRUE){
844  if(!AsymmetryCut(photon,event)){
845  if(fHistoPhotonCuts)fHistoPhotonCuts->Fill(cutIndex, photon->GetPhotonPt()); //4
846  return kFALSE;
847  }
848  }
849 
850  //Check the pid probability
851  cutIndex++; //5
852  if(!PIDProbabilityCut(photon, event)) {
853  if(fHistoPhotonCuts)fHistoPhotonCuts->Fill(cutIndex, photon->GetPhotonPt()); //5
854  return kFALSE;
855  }
856 
857  cutIndex++; //6
858  if(!CorrectedTPCClusterCut(photon, event)) {
859  if(fHistoPhotonCuts)fHistoPhotonCuts->Fill(cutIndex, photon->GetPhotonPt()); //6
860  return kFALSE;
861  }
862 
863  Double_t magField = event->GetMagneticField();
864  if( magField < 0.0 ){
865  magField = 1.0;
866  } else {
867  magField = -1.0;
868  }
869 
870  AliVTrack * electronCandidate = GetTrack(event,photon->GetTrackLabelNegative());
871  AliVTrack * positronCandidate = GetTrack(event,photon->GetTrackLabelPositive());
872  Double_t deltaPhi = magField * TVector2::Phi_mpi_pi( electronCandidate->Phi()-positronCandidate->Phi());
873 
874  cutIndex++; //7
875  if(!PsiPairCut(photon)) {
876  if(fHistoPhotonCuts)fHistoPhotonCuts->Fill(cutIndex, photon->GetPhotonPt()); //7
877  return kFALSE;
878  }
879 
880  cutIndex++; //8
881  if(!CosinePAngleCut(photon, event)) {
882  if(fHistoPhotonCuts)fHistoPhotonCuts->Fill(cutIndex, photon->GetPhotonPt()); //8
883  return kFALSE;
884  }
885 
886  AliAODConversionPhoton* photonAOD = dynamic_cast<AliAODConversionPhoton*>(photon);
887  if (photonAOD){
888  photonAOD->CalculateDistanceOfClossetApproachToPrimVtx(event->GetPrimaryVertex());
889 
890  cutIndex++; //9
891  if(photonAOD->GetDCArToPrimVtx() > fDCARPrimVtxCut) { //DCA R cut of photon to primary vertex
892  if(fHistoPhotonCuts)fHistoPhotonCuts->Fill(cutIndex, photon->GetPhotonPt()); //9
893  return kFALSE;
894  }
895 
896  cutIndex++; //10
897  if(TMath::Abs(photonAOD->GetDCAzToPrimVtx()) > fDCAZPrimVtxCut) { //DCA Z cut of photon to primary vertex
898  if(fHistoPhotonCuts)fHistoPhotonCuts->Fill(cutIndex, photon->GetPhotonPt()); //10
899  return kFALSE;
900  }
901  } else {
902  cutIndex++; //9
903  cutIndex++; //10
904  }
905  cutIndex++; //11
906 
907  if (photonAOD){
908  UChar_t photonQuality = 0;
909  AliAODEvent * aodEvent = dynamic_cast<AliAODEvent*>(event);
910  if(aodEvent) {
911  photonQuality = DeterminePhotonQualityAOD(photonAOD, event);
912  } else {
913  photonQuality = photonAOD->GetPhotonQuality();
914  }
915  if (fDoPhotonQualitySelectionCut && photonQuality != fPhotonQualityCut){
916  if(fHistoPhotonCuts)fHistoPhotonCuts->Fill(cutIndex, photon->GetPhotonPt()); //11
917  return kFALSE;
918  }
919  }
920  cutIndex++; //12
921  if(fHistoPhotonCuts)fHistoPhotonCuts->Fill(cutIndex, photon->GetPhotonPt()); //11
922 
923  // Histos after Cuts
924  if(fHistoInvMassafter)fHistoInvMassafter->Fill(photon->GetMass());
927  if(fHistoKappaafter)fHistoKappaafter->Fill(photon->GetPhotonPt(), GetKappaTPC(photon, event));
929  if(photon->GetPhotonP()!=0 && electronCandidate->P()!=0)fHistoAsymmetryafter->Fill(photon->GetPhotonP(),electronCandidate->P()/photon->GetPhotonP());
930  }
931  return kTRUE;
932 
933 }
934 
936 Bool_t AliConversionPhotonCuts::CorrectedTPCClusterCut(AliConversionPhotonBase *photon, AliVEvent * event){ //Cut on corrected TPC Cluster Info
937 
938  AliVTrack * negTrack = GetTrack(event, photon->GetTrackLabelNegative());
939  AliVTrack * posTrack = GetTrack(event, photon->GetTrackLabelPositive());
940 
941  if(!negTrack||!posTrack)return kFALSE;
942 
943  Double_t negclsToF=0;
944 
946  if(negTrack->GetTPCNclsF()!=0){
947  negclsToF = (Double_t)negTrack->GetNcls(1)/(Double_t)negTrack->GetTPCNclsF();}// Ncluster/Nfindablecluster
948  }
949  else {
950  negclsToF = negTrack->GetTPCClusterInfo(2,0,GetFirstTPCRow(photon->GetConversionRadius()));
951  }
952 
953  Double_t posclsToF = 0.;
955  if(posTrack->GetTPCNclsF()!=0){
956  posclsToF = (Double_t)posTrack->GetNcls(1)/(Double_t)posTrack->GetTPCNclsF();
957  }
958  }else{
959  posclsToF = posTrack->GetTPCClusterInfo(2,0,GetFirstTPCRow(photon->GetConversionRadius()));
960  }
961 
962  if( negclsToF < fMinClsTPCToF || posclsToF < fMinClsTPCToF ){
963  return kFALSE;
964  }
965 
966  return kTRUE;
967 }
968 
971  //Selection of Reconstructed Photons
972 
974 
975  if(event->IsA()==AliESDEvent::Class()) {
976  if(!SelectV0Finder( ( ((AliESDEvent*)event)->GetV0(photon->GetV0Index()))->GetOnFlyStatus() ) ){
978  return kFALSE;
979  }
980  }
981 
982  // Get Tracks
983  AliVTrack * negTrack = GetTrack(event, photon->GetTrackLabelNegative());
984  AliVTrack * posTrack = GetTrack(event, photon->GetTrackLabelPositive());
985 
986  if(!negTrack || !posTrack) {
988  return kFALSE;
989  }
990 
991  // check if V0 from AliAODGammaConversion.root is actually contained in AOD by checking if V0 exists with same tracks
992  if(event->IsA()==AliAODEvent::Class() && fPreSelCut && ( fIsHeavyIon != 1 || (fIsHeavyIon == 1 && fProcessAODCheck) )) {
993  AliAODEvent* aodEvent = dynamic_cast<AliAODEvent*>(event);
994 
995  Bool_t bFound = kFALSE;
996  Int_t v0PosID = posTrack->GetID();
997  Int_t v0NegID = negTrack->GetID();
998  AliAODv0* v0 = NULL;
999  for(Int_t iV=0; iV<aodEvent->GetNumberOfV0s(); iV++){
1000  v0 = aodEvent->GetV0(iV);
1001  if(!v0) continue;
1002  if( (v0PosID == v0->GetPosID() && v0NegID == v0->GetNegID()) || (v0PosID == v0->GetNegID() && v0NegID == v0->GetPosID()) ){
1003  bFound = kTRUE;
1004  break;
1005  }
1006  }
1007  if(!bFound){
1009  return kFALSE;
1010  }
1011  }
1012 
1013  photon->DeterminePhotonQuality(negTrack,posTrack);
1014  // Track Cuts
1015  if(!TracksAreSelected(negTrack, posTrack)){
1017  return kFALSE;
1018  }
1019  if (fHistoEtaDistV0s)fHistoEtaDistV0s->Fill(photon->GetPhotonEta());
1020  // dEdx Cuts
1021 
1022  if(!KappaCuts(photon, event) || !dEdxCuts(negTrack) || !dEdxCuts(posTrack)) {
1024  return kFALSE;
1025  }
1026 
1028  // Photon Cuts
1029  if(!PhotonCuts(photon,event)){
1031  return kFALSE;
1032  }
1033 
1034  // Photon passed cuts
1036  return kTRUE;
1037 }
1038 
1041  if(fDo2DQt){
1042  if ( !(TMath::Power(photon->GetArmenterosAlpha()/0.95,2)+TMath::Power(photon->GetArmenterosQt()/fQtMax,2) < 1) ){
1043  return kFALSE;
1044  }
1045  } else {
1046  if(photon->GetArmenterosQt()>fQtMax){
1047  return kFALSE;
1048  }
1049  }
1050  return kTRUE;
1051 }
1052 
1053 
1056  // Exclude certain areas for photon reconstruction
1057 
1058  Int_t cutIndex=0;
1059  if(fHistoAcceptanceCuts)fHistoAcceptanceCuts->Fill(cutIndex, photon->GetPhotonPt());
1060  cutIndex++;
1061 
1062  if(photon->GetConversionRadius()>fMaxR){ // cuts on distance from collision point
1063  if(fHistoAcceptanceCuts)fHistoAcceptanceCuts->Fill(cutIndex, photon->GetPhotonPt());
1064  return kFALSE;
1065  }
1066  cutIndex++;
1067 
1068  if(photon->GetConversionRadius()<fMinR){ // cuts on distance from collision point
1069  if(fHistoAcceptanceCuts)fHistoAcceptanceCuts->Fill(cutIndex, photon->GetPhotonPt());
1070  return kFALSE;
1071  }
1072  cutIndex++;
1073 
1074  if(photon->GetConversionRadius() <= ((TMath::Abs(photon->GetConversionZ())*fLineCutZRSlope)-fLineCutZValue)){
1075  if(fHistoAcceptanceCuts)fHistoAcceptanceCuts->Fill(cutIndex, photon->GetPhotonPt());
1076  return kFALSE;
1077  }
1078  else if (fUseEtaMinCut && photon->GetConversionRadius() >= ((TMath::Abs(photon->GetConversionZ())*fLineCutZRSlopeMin)-fLineCutZValueMin )){
1079  if(fHistoAcceptanceCuts)fHistoAcceptanceCuts->Fill(cutIndex, photon->GetPhotonPt());
1080  return kFALSE;
1081  }
1082  cutIndex++;
1083 
1084  if(TMath::Abs(photon->GetConversionZ()) > fMaxZ ){ // cuts out regions where we do not reconstruct
1085  if(fHistoAcceptanceCuts)fHistoAcceptanceCuts->Fill(cutIndex, photon->GetPhotonPt());
1086  return kFALSE;
1087  }
1088  cutIndex++;
1089 
1090 
1091  if( photon->GetPhotonEta() > (fEtaCut) || photon->GetPhotonEta() < (-fEtaCut) ){
1092  if(fHistoAcceptanceCuts)fHistoAcceptanceCuts->Fill(cutIndex, photon->GetPhotonPt());
1093  return kFALSE;
1094  }
1095  if(fEtaCutMin>-0.1){
1096  if( photon->GetPhotonEta() < (fEtaCutMin) && photon->GetPhotonEta() > (-fEtaCutMin) ){
1097  if(fHistoAcceptanceCuts)fHistoAcceptanceCuts->Fill(cutIndex, photon->GetPhotonPt());
1098  return kFALSE;
1099  }
1100  }
1101  cutIndex++;
1102 
1104  if(photon->GetPhotonEta() > fEtaForPhiCutMin && photon->GetPhotonEta() < fEtaForPhiCutMax ){
1105  if (fMinPhiCut < fMaxPhiCut){
1106  if( photon->GetPhotonPhi() > fMinPhiCut && photon->GetPhotonPhi() < fMaxPhiCut ) {
1107  if(fHistoAcceptanceCuts)fHistoAcceptanceCuts->Fill(cutIndex, photon->GetPhotonPt());
1108  return kFALSE;
1109  }
1110  } else {
1111  Double_t photonPhi = photon->GetPhotonPhi();
1112  if (photon->GetPhotonPhi() < TMath::Pi()) photonPhi = photon->GetPhotonPhi() + 2*TMath::Pi();
1113  if( photonPhi > fMinPhiCut && photonPhi < fMaxPhiCut+2*TMath::Pi() ) {
1114  if(fHistoAcceptanceCuts)fHistoAcceptanceCuts->Fill(cutIndex, photon->GetPhotonPt());
1115  return kFALSE;
1116  }
1117  }
1118  }
1119  }
1120  cutIndex++;
1121 
1122 
1123 
1124  if(photon->GetPhotonPt()<fPtCut){
1125  if(fHistoAcceptanceCuts)fHistoAcceptanceCuts->Fill(cutIndex, photon->GetPhotonPt());
1126  return kFALSE;
1127  }
1128  cutIndex++;
1129 
1130  if(fHistoAcceptanceCuts)fHistoAcceptanceCuts->Fill(cutIndex, photon->GetPhotonPt());
1131 
1132  return kTRUE;
1133 }
1134 
1135 
1137 Bool_t AliConversionPhotonCuts::SpecificTrackCuts(AliAODTrack * negTrack, AliAODTrack * posTrack,Int_t &cutIndex) {
1138  // Track Cuts which require AOD/ESD specific implementation
1139 
1140  if( !negTrack->IsOn(AliESDtrack::kTPCrefit) || !posTrack->IsOn(AliESDtrack::kTPCrefit) ) {
1141  if(fHistoTrackCuts)fHistoTrackCuts->Fill(cutIndex);
1142  return kFALSE;
1143  }
1144  cutIndex++;
1145 
1146  AliAODVertex * NegVtxType=negTrack->GetProdVertex();
1147  AliAODVertex * PosVtxType=posTrack->GetProdVertex();
1148  if( (NegVtxType->GetType())==AliAODVertex::kKink || (PosVtxType->GetType())==AliAODVertex::kKink) {
1149  if(fHistoTrackCuts)fHistoTrackCuts->Fill(cutIndex);
1150  return kFALSE;
1151  }
1152  return kTRUE;
1153 
1154 }
1155 
1156 
1158 Bool_t AliConversionPhotonCuts::SpecificTrackCuts(AliESDtrack * negTrack, AliESDtrack * posTrack,Int_t &cutIndex) {
1159  // Track Cuts which require AOD/ESD specific implementation
1160 
1161  if( !negTrack->IsOn(AliESDtrack::kTPCrefit) || !posTrack->IsOn(AliESDtrack::kTPCrefit) ) {
1162  if(fHistoTrackCuts)fHistoTrackCuts->Fill(cutIndex);
1163  return kFALSE;
1164  }
1165  cutIndex++;
1166 
1167  if(negTrack->GetKinkIndex(0) > 0 || posTrack->GetKinkIndex(0) > 0 ) {
1168  if(fHistoTrackCuts)fHistoTrackCuts->Fill(cutIndex);
1169  return kFALSE;
1170  }
1171  return kTRUE;
1172 }
1173 
1174 
1175 
1177 Bool_t AliConversionPhotonCuts::TracksAreSelected(AliVTrack * negTrack, AliVTrack * posTrack) {
1178  // Track Selection for Photon Reconstruction
1179 
1180  Int_t cutIndex=0;
1181  if(fHistoTrackCuts)fHistoTrackCuts->Fill(cutIndex);
1182  cutIndex++;
1183 
1184  // avoid like sign
1186  if(negTrack->Charge() == posTrack->Charge()) {
1187  if(fHistoTrackCuts)fHistoTrackCuts->Fill(cutIndex);
1188  return kFALSE;
1189  }
1190  }else if(fUseOnFlyV0FinderSameSign==1){
1191  if(negTrack->Charge() != posTrack->Charge()) {
1192  if(fHistoTrackCuts)fHistoTrackCuts->Fill(cutIndex);
1193  return kFALSE;
1194  }
1195  }
1196  cutIndex++;
1197 
1198  // Number of TPC Clusters
1199 
1200 
1201  if( negTrack->GetNcls(1) < fMinClsTPC || posTrack->GetNcls(1) < fMinClsTPC ) {
1202  if(fHistoTrackCuts)fHistoTrackCuts->Fill(cutIndex);
1203  return kFALSE;
1204  }
1205  cutIndex++;
1206 
1207  // Acceptance
1208  if( posTrack->Eta() > (fEtaCut) || posTrack->Eta() < (-fEtaCut) ||
1209  negTrack->Eta() > (fEtaCut) || negTrack->Eta() < (-fEtaCut) ){
1210  if(fHistoTrackCuts)fHistoTrackCuts->Fill(cutIndex);
1211  return kFALSE;
1212  }
1213  if(fEtaCutMin>-0.1){
1214  if( (posTrack->Eta() < (fEtaCutMin) && posTrack->Eta() > (-fEtaCutMin)) ||
1215  (negTrack->Eta() < (fEtaCutMin) && negTrack->Eta() > (-fEtaCutMin)) ){
1216  if(fHistoTrackCuts)fHistoTrackCuts->Fill(cutIndex);
1217  return kFALSE;
1218  }
1219  }
1220  cutIndex++;
1221 
1222  // Single Pt Cut
1223  if(fDoAsymPtCut){
1224  if((posTrack->Pt()<fSinglePtCut || negTrack->Pt()<fSinglePtCut2) && (posTrack->Pt()<fSinglePtCut2 || negTrack->Pt()<fSinglePtCut) ){
1225  if(fHistoTrackCuts)fHistoTrackCuts->Fill(cutIndex);
1226  return kFALSE;
1227  }
1228  } else {
1229  if(posTrack->Pt()<fSinglePtCut || negTrack->Pt()<fSinglePtCut){
1230  if(fHistoTrackCuts)fHistoTrackCuts->Fill(cutIndex);
1231  return kFALSE;
1232  }
1233  }
1234  cutIndex++;
1235 
1236  // AOD ESD specific cuts
1237  Bool_t passCuts = kTRUE;
1238 
1239  if(negTrack->IsA()==AliAODTrack::Class()) {
1240  passCuts = passCuts * SpecificTrackCuts(static_cast<AliAODTrack*>(negTrack), static_cast<AliAODTrack*>(posTrack),cutIndex);
1241  } else {
1242  passCuts = passCuts * SpecificTrackCuts(static_cast<AliESDtrack*>(negTrack), static_cast<AliESDtrack*>(posTrack),cutIndex);
1243  }
1244 
1245  if(!passCuts){
1246  if(fHistoTrackCuts)fHistoTrackCuts->Fill(cutIndex);
1247  return kFALSE;
1248  }
1249  cutIndex++;
1250 
1251  if(fHistoTrackCuts)fHistoTrackCuts->Fill(cutIndex);
1252 
1253  return kTRUE;
1254 
1255 }
1258 
1259  if(!fPIDResponse){InitPIDResponse();}// Try to reinitialize PID Response
1260  if(!fPIDResponse){AliError("No PID Response"); return kTRUE;}// if still missing fatal error
1261 
1262  AliVTrack * negTrack = GetTrack(event, gamma->GetTrackLabelNegative());
1263  AliVTrack * posTrack = GetTrack(event, gamma->GetTrackLabelPositive());
1264 
1265  Float_t KappaPlus, KappaMinus, Kappa;
1266  KappaMinus = fPIDResponse->NumberOfSigmasTPC(negTrack, AliPID::kElectron);
1267  KappaPlus = fPIDResponse->NumberOfSigmasTPC(posTrack, AliPID::kElectron);
1268  Kappa = ( TMath::Abs(KappaMinus) + TMath::Abs(KappaPlus) ) / 2.0 + 2.0*(KappaMinus+KappaPlus);
1269 
1270  return Kappa;
1271 
1272 }
1274 Bool_t AliConversionPhotonCuts::dEdxCuts(AliVTrack *fCurrentTrack){
1275  // Electron Identification Cuts for Photon reconstruction
1276  if(!fPIDResponse){InitPIDResponse();}// Try to reinitialize PID Response
1277  if(!fPIDResponse){AliError("No PID Response"); return kTRUE;}// if still missing fatal error
1278 
1279  Int_t cutIndex=0;
1280  if(fHistodEdxCuts)fHistodEdxCuts->Fill(cutIndex,fCurrentTrack->Pt());
1281  if(fHistoTPCdEdxSigbefore)fHistoTPCdEdxSigbefore->Fill(fCurrentTrack->P(),fPIDResponse->NumberOfSigmasTPC(fCurrentTrack, AliPID::kElectron));
1282  if(fHistoTPCdEdxbefore)fHistoTPCdEdxbefore->Fill(fCurrentTrack->P(),fCurrentTrack->GetTPCsignal());
1283  cutIndex++;
1284  if(fDodEdxSigmaCut == kTRUE && !fSwitchToKappa){
1285  // TPC Electron Line
1286  if( fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kElectron)<fPIDnSigmaBelowElectronLine ||
1287  fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kElectron)>fPIDnSigmaAboveElectronLine){
1288 
1289  if(fHistodEdxCuts)fHistodEdxCuts->Fill(cutIndex,fCurrentTrack->Pt());
1290  return kFALSE;
1291  }
1292  cutIndex++;
1293 
1294  // TPC Pion Line
1295  if( fCurrentTrack->P()>fPIDMinPnSigmaAbovePionLine && fCurrentTrack->P()<fPIDMaxPnSigmaAbovePionLine ){
1296  if(fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kElectron)>fPIDnSigmaBelowElectronLine &&
1297  fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kElectron)<fPIDnSigmaAboveElectronLine&&
1298  fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kPion)<fPIDnSigmaAbovePionLine){
1299 
1300  if(fHistodEdxCuts)fHistodEdxCuts->Fill(cutIndex,fCurrentTrack->Pt());
1301  return kFALSE;
1302  }
1303  }
1304  cutIndex++;
1305 
1306  // High Pt Pion rej
1307  if( fCurrentTrack->P()>fPIDMaxPnSigmaAbovePionLine ){
1308  if(fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kElectron)>fPIDnSigmaBelowElectronLine &&
1309  fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kElectron)<fPIDnSigmaAboveElectronLine &&
1310  fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kPion)<fPIDnSigmaAbovePionLineHighPt){
1311 
1312  if(fHistodEdxCuts)fHistodEdxCuts->Fill(cutIndex,fCurrentTrack->Pt());
1313  return kFALSE;
1314  }
1315  }
1316  cutIndex++;
1317  }
1318  else{cutIndex+=3;}
1319 
1320  if(fDoKaonRejectionLowP == kTRUE && !fSwitchToKappa){
1321  if(fCurrentTrack->P()<fPIDMinPKaonRejectionLowP ){
1322  if( TMath::Abs(fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kKaon))<fPIDnSigmaAtLowPAroundKaonLine){
1323 
1324  if(fHistodEdxCuts)fHistodEdxCuts->Fill(cutIndex,fCurrentTrack->Pt());
1325  return kFALSE;
1326  }
1327  }
1328  }
1329  cutIndex++;
1330  if(fDoProtonRejectionLowP == kTRUE && !fSwitchToKappa){
1331  if( fCurrentTrack->P()<fPIDMinPProtonRejectionLowP ){
1332  if( TMath::Abs(fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kProton))<fPIDnSigmaAtLowPAroundProtonLine){
1333 
1334  if(fHistodEdxCuts)fHistodEdxCuts->Fill(cutIndex,fCurrentTrack->Pt());
1335  return kFALSE;
1336  }
1337  }
1338  }
1339  cutIndex++;
1340 
1341  if(fDoPionRejectionLowP == kTRUE && !fSwitchToKappa){
1342  if( fCurrentTrack->P()<fPIDMinPPionRejectionLowP ){
1343  if( TMath::Abs(fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kPion))<fPIDnSigmaAtLowPAroundPionLine){
1344 
1345  if(fHistodEdxCuts)fHistodEdxCuts->Fill(cutIndex,fCurrentTrack->Pt());
1346  return kFALSE;
1347  }
1348  }
1349  }
1350  cutIndex++;
1351 
1352 
1353  // cout<<"Start"<<endl;
1354  // AliPIDResponse::EDetPidStatus status=fPIDResponse->CheckPIDStatus(AliPIDResponse::kTOF,fCurrentTrack);
1355 
1356  // if( ( (status & AliVTrack::kTOFout) == AliVTrack::kTOFout ) && ( (status & AliVTrack::kTIME) == AliVTrack::kTIME ))
1357  // {cout<<"TOF DA"<<endl;}
1358  // if(status == AliPIDResponse::kDetPidOk){
1359  // Float_t probMis = fPIDResponse->GetTOFMismatchProbability(fCurrentTrack);
1360  // cout<<"--> "<<probMis<<endl;
1361  // if(probMis > 0.01){
1362 
1363  // }
1364  // }
1365 
1366  if((fCurrentTrack->GetStatus() & AliESDtrack::kTOFpid ) && !(fCurrentTrack->GetStatus() & AliESDtrack::kTOFmismatch)){
1367  if(fHistoTOFbefore){
1368  Double_t t0 = fPIDResponse->GetTOFResponse().GetStartTime(fCurrentTrack->P());
1369  Double_t times[AliPID::kSPECIESC];
1370  fCurrentTrack->GetIntegratedTimes(times,AliPID::kSPECIESC);
1371  Double_t TOFsignal = fCurrentTrack->GetTOFsignal();
1372  Double_t dT = TOFsignal - t0 - times[0];
1373  fHistoTOFbefore->Fill(fCurrentTrack->P(),dT);
1374  }
1375  if(fHistoTOFSigbefore) fHistoTOFSigbefore->Fill(fCurrentTrack->P(),fPIDResponse->NumberOfSigmasTOF(fCurrentTrack, AliPID::kElectron));
1376  if(fUseTOFpid){
1377  if(fPIDResponse->NumberOfSigmasTOF(fCurrentTrack, AliPID::kElectron)>fTofPIDnSigmaAboveElectronLine ||
1378  fPIDResponse->NumberOfSigmasTOF(fCurrentTrack, AliPID::kElectron)<fTofPIDnSigmaBelowElectronLine ){
1379  if(fHistodEdxCuts)fHistodEdxCuts->Fill(cutIndex,fCurrentTrack->Pt());
1380  return kFALSE;
1381  }
1382  }
1383  if(fHistoTOFSigafter)fHistoTOFSigafter->Fill(fCurrentTrack->P(),fPIDResponse->NumberOfSigmasTOF(fCurrentTrack, AliPID::kElectron));
1384  }
1385  cutIndex++;
1386 
1387  if((fCurrentTrack->GetStatus() & AliESDtrack::kITSpid)){
1388  if(fHistoITSSigbefore) fHistoITSSigbefore->Fill(fCurrentTrack->P(),fPIDResponse->NumberOfSigmasITS(fCurrentTrack, AliPID::kElectron));
1389  if(fUseITSpid){
1390  if(fCurrentTrack->Pt()<=fMaxPtPIDITS){
1391  if(fPIDResponse->NumberOfSigmasITS(fCurrentTrack, AliPID::kElectron)>fITSPIDnSigmaAboveElectronLine || fPIDResponse->NumberOfSigmasITS(fCurrentTrack, AliPID::kElectron)<fITSPIDnSigmaBelowElectronLine ){
1392  if(fHistodEdxCuts)fHistodEdxCuts->Fill(cutIndex,fCurrentTrack->Pt());
1393  return kFALSE;
1394  }
1395  }
1396  }
1397  if(fHistoITSSigafter)fHistoITSSigafter->Fill(fCurrentTrack->P(),fPIDResponse->NumberOfSigmasITS(fCurrentTrack, AliPID::kElectron));
1398  }
1399 
1400  cutIndex++;
1401 
1402  // Apply TRD PID
1403  if(fDoTRDPID){
1404  if(!fPIDResponse->IdentifiedAsElectronTRD(fCurrentTrack,fPIDTRDEfficiency)){
1405  if(fHistodEdxCuts)fHistodEdxCuts->Fill(cutIndex,fCurrentTrack->Pt());
1406  return kFALSE;
1407  }
1408  }
1409  cutIndex++;
1410 
1411  if(fHistodEdxCuts)fHistodEdxCuts->Fill(cutIndex,fCurrentTrack->Pt());
1412  if(fHistoTPCdEdxSigafter)fHistoTPCdEdxSigafter->Fill(fCurrentTrack->P(),fPIDResponse->NumberOfSigmasTPC(fCurrentTrack, AliPID::kElectron));
1413  if(fHistoTPCdEdxafter)fHistoTPCdEdxafter->Fill(fCurrentTrack->P(),fCurrentTrack->GetTPCsignal());
1414 
1415  return kTRUE;
1416 }
1417 
1419  // abort if Kappa selection not enabled
1420  if (!fSwitchToKappa) return kTRUE;
1421 
1422  Float_t kappa = GetKappaTPC(photon, event);
1423  if (kappa < fKappaMinCut) return kFALSE;
1424  if (kappa > fKappaMaxCut) return kFALSE;
1425  return kTRUE;
1426 }
1427 
1430  // Cut on Energy Assymetry
1431 
1432  for(Int_t ii=0;ii<2;ii++){
1433 
1434  AliVTrack *track=GetTrack(event,photon->GetTrackLabel(ii));
1435 
1437  Double_t trackNegAsy=0;
1438  if (photon->GetPhotonP()!=0.){
1439  trackNegAsy= track->P()/photon->GetPhotonP();
1440  }
1441 
1442  if( trackNegAsy > fFAsymmetryCut->Eval(photon->GetPhotonP()) || trackNegAsy < 1.-fFAsymmetryCut->Eval(photon->GetPhotonP()) ){
1443  return kFALSE;
1444  }
1445 
1446  } else {
1447  if( track->P() > fMinPPhotonAsymmetryCut ){
1448  Double_t trackNegAsy=0;
1449  if (photon->GetPhotonP()!=0.){
1450  trackNegAsy= track->P()/photon->GetPhotonP();
1451  }
1452 
1453  if( trackNegAsy<fMinPhotonAsymmetry ||trackNegAsy>(1.- fMinPhotonAsymmetry)){
1454  return kFALSE;
1455  }
1456  }
1457  }
1458 
1459  }
1460  return kTRUE;
1461 }
1462 
1464 AliVTrack *AliConversionPhotonCuts::GetTrack(AliVEvent * event, Int_t label){
1465  //Returns pointer to the track with given ESD label
1466  //(Important for AOD implementation, since Track array in AOD data is different
1467  //from ESD array, but ESD tracklabels are stored in AOD Tracks)
1468 
1469  AliESDEvent * esdEvent = dynamic_cast<AliESDEvent*>(event);
1470  if(esdEvent) {
1471  if(label > event->GetNumberOfTracks() ) return NULL;
1472  AliESDtrack * track = esdEvent->GetTrack(label);
1473  return track;
1474 
1475  } else {
1476  if(label == -999999) return NULL; // if AOD relabelling goes wrong, immediately return NULL
1477  AliVTrack * track = 0x0;
1478  if(((AliV0ReaderV1*)AliAnalysisManager::GetAnalysisManager()->GetTask(fV0ReaderName.Data()))->AreAODsRelabeled()){
1479  if(event->GetTrack(label)) track = dynamic_cast<AliVTrack*>(event->GetTrack(label));
1480  return track;
1481  }
1482  else{
1483  for(Int_t ii=0; ii<event->GetNumberOfTracks(); ii++) {
1484  if(event->GetTrack(ii)) track = dynamic_cast<AliVTrack*>(event->GetTrack(ii));
1485  if(track){
1486  if(track->GetID() == label) {
1487  return track;
1488  }
1489  }
1490  }
1491  }
1492  }
1493  //AliDebug(5,(Form("track not found %d %d",label,event->GetNumberOfTracks()));
1494  return NULL;
1495 }
1496 
1499  //Returns pointer to the track with given ESD label
1500  //(Important for AOD implementation, since Track array in AOD data is different
1501  //from ESD array, but ESD tracklabels are stored in AOD Tracks)
1502 
1503  if(event) {
1504  if(label > event->GetNumberOfTracks() ) return NULL;
1505  AliESDtrack * track = event->GetTrack(label);
1506  return track;
1507  }
1508  //AliDebug(5,(Form("track not found %d %d",label,event->GetNumberOfTracks()));
1509  return NULL;
1510 }
1511 
1512 
1513 
1516  // Cut on Electron Probability for Photon Reconstruction
1517 
1518  AliESDEvent * esdEvent = dynamic_cast<AliESDEvent*>(event);
1519 
1520  if(esdEvent){
1521 
1522  Bool_t iResult=kFALSE;
1523 
1524  Double_t *posProbArray = new Double_t[AliPID::kSPECIES];
1525  Double_t *negProbArray = new Double_t[AliPID::kSPECIES];
1526 
1527  AliESDtrack* negTrack = esdEvent->GetTrack(photon->GetTrackLabelNegative());
1528  AliESDtrack* posTrack = esdEvent->GetTrack(photon->GetTrackLabelPositive());
1529 
1530  if(negProbArray && posProbArray){
1531 
1532  negTrack->GetTPCpid(negProbArray);
1533  posTrack->GetTPCpid(posProbArray);
1534 
1535  if(negProbArray[AliPID::kElectron]>=fPIDProbabilityCutNegativeParticle && posProbArray[AliPID::kElectron]>=fPIDProbabilityCutPositiveParticle){
1536  iResult=kTRUE;
1537  }
1538  }
1539 
1540  delete [] posProbArray;
1541  delete [] negProbArray;
1542  return iResult;
1543 
1544  } else {
1546  return kTRUE;
1547  }
1548 }
1549 
1550 
1552 Bool_t AliConversionPhotonCuts::AcceptanceCut(TParticle *particle, TParticle * ePos,TParticle* eNeg){
1553  // MC Acceptance Cuts
1554  //(Certain areas were excluded for photon reconstruction)
1555 
1556  if(particle->R()>fMaxR){
1557  return kFALSE;}
1558 
1559  if(ePos->R()>fMaxR){
1560  return kFALSE;
1561  }
1562 
1563  if(ePos->R()<fMinR){
1564  return kFALSE;
1565  }
1566 
1567  if( ePos->R() <= ((TMath::Abs(ePos->Vz())*fLineCutZRSlope)-fLineCutZValue)){
1568  return kFALSE;
1569  }
1570  else if (fUseEtaMinCut && ePos->R() >= ((TMath::Abs(ePos->Vz())*fLineCutZRSlopeMin)-fLineCutZValueMin )){
1571  return kFALSE;
1572  }
1573 
1574  if(TMath::Abs(eNeg->Vz()) > fMaxZ ){ // cuts out regions where we do not reconstruct
1575  return kFALSE;
1576  }
1577 
1578  if(eNeg->Vz()!=ePos->Vz()||eNeg->R()!=ePos->R()){
1579  return kFALSE;
1580  }
1581 
1582  if(TMath::Abs(ePos->Vz()) > fMaxZ ){ // cuts out regions where we do not reconstruct
1583  return kFALSE;
1584  }
1585 
1586 
1587  if( particle->Eta() > (fEtaCut) || particle->Eta() < (-fEtaCut) ){
1588  return kFALSE;
1589  }
1590  if( ePos->Eta() > (fEtaCut) || ePos->Eta() < (-fEtaCut) ){
1591  return kFALSE;
1592  }
1593  if( eNeg->Eta() > (fEtaCut) || eNeg->Eta() < (-fEtaCut) ){
1594  return kFALSE;
1595  }
1596  if(fEtaCutMin>-0.1){
1597  if( particle->Eta() < (fEtaCutMin) && particle->Eta() > (-fEtaCutMin) ){
1598  return kFALSE;
1599  }
1600  if( ePos->Eta() < (fEtaCutMin) && ePos->Eta() > (-fEtaCutMin) ){
1601  return kFALSE;
1602  }
1603  if( eNeg->Eta() < (fEtaCutMin) && eNeg->Eta() > (-fEtaCutMin) ){
1604  return kFALSE;
1605  }
1606  }
1607 
1608  if(fDoAsymPtCut){
1609  if((ePos->Pt()<fSinglePtCut || eNeg->Pt()<fSinglePtCut2) && (ePos->Pt()<fSinglePtCut2 || eNeg->Pt()<fSinglePtCut) ){
1610  return kFALSE;
1611  }
1612  } else {
1613  if(ePos->Pt()<fSinglePtCut || eNeg->Pt()<fSinglePtCut){
1614  return kFALSE;
1615  }
1616  }
1617 
1618  if(particle->Pt()<fPtCut){
1619  return kFALSE;
1620  }
1621 
1622  return kTRUE;
1623 }
1627 
1628  if(fCutString && fCutString->GetString().Length() == kNCuts) {
1629  fCutString->SetString(GetCutNumber());
1630  } else {
1631  return kFALSE;
1632  }
1633  return kTRUE;
1634 }
1635 
1636 
1639  fCutStringRead = Form("%s",analysisCutSelection.Data());
1640 
1641  // Initialize Cuts from a given Cut string
1642  AliInfo(Form("Set Photoncut Number: %s",analysisCutSelection.Data()));
1643  if(analysisCutSelection.Length()!=kNCuts) {
1644  AliError(Form("Cut selection has the wrong length! size is %d, number of cuts is %d", analysisCutSelection.Length(), kNCuts));
1645  return kFALSE;
1646  }
1647  if(!analysisCutSelection.IsAlnum()){
1648  AliError("Cut selection is not alphanumeric");
1649  return kFALSE;
1650  }
1651 
1652  TString analysisCutSelectionLowerCase = Form("%s",analysisCutSelection.Data());
1653  analysisCutSelectionLowerCase.ToLower();
1654  const char *cutSelection = analysisCutSelectionLowerCase.Data();
1655  #define ASSIGNARRAY(i) fCuts[i] = ((int)cutSelection[i]>=(int)'a') ? cutSelection[i]-'a'+10 : cutSelection[i]-'0'
1656  for(Int_t ii=0;ii<kNCuts;ii++){
1657  ASSIGNARRAY(ii);
1658  }
1659 
1660  // Set Individual Cuts
1661  for(Int_t ii=0;ii<kNCuts;ii++){
1662  if(!SetCut(cutIds(ii),fCuts[ii]))return kFALSE;
1663  }
1664 
1666 
1667  return kTRUE;
1668 }
1672 
1673  switch (cutID) {
1674 
1675  case kv0FinderType:
1676  if( SetV0Finder(value)) {
1677  fCuts[kv0FinderType] = value;
1678  UpdateCutString();
1679  return kTRUE;
1680  } else return kFALSE;
1681 
1682  case ketaCut:
1683  if( SetEtaCut(value)) {
1684  fCuts[ketaCut] = value;
1685  UpdateCutString();
1686  return kTRUE;
1687  } else return kFALSE;
1688 
1689  case kRCut:
1690  if( SetRCut(value)) {
1691  fCuts[kRCut] = value;
1692  UpdateCutString();
1693  return kTRUE;
1694  } else return kFALSE;
1695 
1696  case kEtaForPhiSector:
1697  if( SetEtaForPhiCut(value)) {
1698  fCuts[kEtaForPhiSector] = value;
1699  UpdateCutString();
1700  return kTRUE;
1701  } else return kFALSE;
1702  case kMinPhiSector:
1703  if( SetMinPhiSectorCut(value)) {
1704  fCuts[kMinPhiSector] = value;
1705  UpdateCutString();
1706  return kTRUE;
1707  } else return kFALSE;
1708  case kMaxPhiSector:
1709  if( SetMaxPhiSectorCut(value)) {
1710  fCuts[kMaxPhiSector] = value;
1711  UpdateCutString();
1712  return kTRUE;
1713  } else return kFALSE;
1714 
1715  case ksinglePtCut:
1716  if( SetSinglePtCut(value)) {
1717  fCuts[ksinglePtCut] = value;
1718  UpdateCutString();
1719  return kTRUE;
1720  } else return kFALSE;
1721 
1722  case kclsTPCCut:
1723  if( SetTPCClusterCut(value)) {
1724  fCuts[kclsTPCCut] = value;
1725  UpdateCutString();
1726  return kTRUE;
1727  } else return kFALSE;
1728 
1729  case kededxSigmaCut:
1730  if (!fSwitchToKappa){
1731  if( SetTPCdEdxCutElectronLine(value)) {
1732  fCuts[kededxSigmaCut] = value;
1733  UpdateCutString();
1734  return kTRUE;
1735  } else return kFALSE;
1736  } else {
1737  if( SetKappaTPCCut(value)) {
1738  fCuts[kededxSigmaCut] = value;
1739  UpdateCutString();
1740  return kTRUE;
1741  } else return kFALSE;
1742  }
1743  case kpidedxSigmaCut:
1744  if (!fSwitchToKappa){
1745  if( SetTPCdEdxCutPionLine(value)) {
1746  fCuts[kpidedxSigmaCut] = value;
1747  UpdateCutString();
1748  return kTRUE;
1749  } else return kFALSE;
1750  } else {
1751  fCuts[kpidedxSigmaCut] = 0;
1752  return kTRUE;
1753  }
1754  case kpiMomdedxSigmaCut:
1755  if (!fSwitchToKappa){
1756  if( SetMinMomPiondEdxCut(value)) {
1757  fCuts[kpiMomdedxSigmaCut] = value;
1758  UpdateCutString();
1759  return kTRUE;
1760  } else return kFALSE;
1761  } else {
1763  return kTRUE;
1764  }
1765  case kpiMaxMomdedxSigmaCut:
1766  if (!fSwitchToKappa){
1767  if( SetMaxMomPiondEdxCut(value)) {
1768  fCuts[kpiMaxMomdedxSigmaCut] = value;
1769  UpdateCutString();
1770  return kTRUE;
1771  } else return kFALSE;
1772  } else {
1774  return kTRUE;
1775  }
1777  if (!fSwitchToKappa){
1778  if( SetLowPRejectionCuts(value)) {
1779  fCuts[kLowPRejectionSigmaCut] = value;
1780  UpdateCutString();
1781  return kTRUE;
1782  } else return kFALSE;
1783  } else {
1785  return kTRUE;
1786  }
1787  case kTOFelectronPID:
1788  if( SetTOFElectronPIDCut(value)) {
1789  fCuts[kTOFelectronPID] = value;
1790  UpdateCutString();
1791  return kTRUE;
1792  } else return kFALSE;
1793 
1794  case kQtMaxCut:
1795  if( SetQtMaxCut(value)) {
1796  fCuts[kQtMaxCut] = value;
1797  UpdateCutString();
1798  return kTRUE;
1799  } else return kFALSE;
1800 
1801 
1802  case kchi2GammaCut:
1803  if( SetChi2GammaCut(value)) {
1804  fCuts[kchi2GammaCut] = value;
1805  UpdateCutString();
1806  return kTRUE;
1807  } else return kFALSE;
1808 
1809  case kPsiPair:
1810  if( SetPsiPairCut(value)) {
1811  fCuts[kPsiPair] = value;
1812  UpdateCutString();
1813  return kTRUE;
1814  } else return kFALSE;
1815 
1816  case kdoPhotonAsymmetryCut:
1817  if( SetPhotonAsymmetryCut(value)) {
1818  fCuts[kdoPhotonAsymmetryCut] = value;
1819  UpdateCutString();
1820  return kTRUE;
1821  } else return kFALSE;
1822 
1823  case kCosPAngle:
1824  if( SetCosPAngleCut(value)) {
1825  fCuts[kCosPAngle] = value;
1826  UpdateCutString();
1827  return kTRUE;
1828  } else return kFALSE;
1829 
1830  case kElecShare:
1831  if( SetSharedElectronCut(value)) {
1832  fCuts[kElecShare] = value;
1833  UpdateCutString();
1834  return kTRUE;
1835  } else return kFALSE;
1836 
1837  case kToCloseV0s:
1838  if( SetToCloseV0sCut(value)) {
1839  fCuts[kToCloseV0s] = value;
1840  UpdateCutString();
1841  return kTRUE;
1842  } else return kFALSE;
1843 
1844  case kDcaRPrimVtx:
1845  if( SetDCARPhotonPrimVtxCut(value)) {
1846  fCuts[kDcaRPrimVtx] = value;
1847  UpdateCutString();
1848  return kTRUE;
1849  } else return kFALSE;
1850 
1851  case kDcaZPrimVtx:
1852  if( SetDCAZPhotonPrimVtxCut(value)) {
1853  fCuts[kDcaZPrimVtx] = value;
1854  UpdateCutString();
1855  return kTRUE;
1856  } else return kFALSE;
1857 
1858  case kInPlaneOutOfPlane:
1859  if( SetInPlaneOutOfPlane(value)) {
1860  fCuts[kInPlaneOutOfPlane] = value;
1861  UpdateCutString();
1862  return kTRUE;
1863  } else return kFALSE;
1864 
1865  case kITSelectronPID:
1866  if( SetITSElectronPIDCut(value)) {
1867  fCuts[kITSelectronPID] = value;
1868  UpdateCutString();
1869  return kTRUE;
1870  } else return kFALSE;
1871 
1872  case kTRDelectronPID:
1873  if( SetTRDElectronPIDCut(value)) {
1874  fCuts[kTRDelectronPID] = value;
1875  UpdateCutString();
1876  return kTRUE;
1877  } else return kFALSE;
1878 
1879  case kNCuts:
1880  AliError("Cut id out of range");
1881  return kFALSE;
1882  }
1883 
1884  AliError("Cut id %d not recognized");
1885  return kFALSE;
1886 }
1889  // Print out current Cut Selection
1890  for(Int_t ic = 0; ic < kNCuts; ic++) {
1891  printf("%-30s : %d \n", fgkCutNames[ic], fCuts[ic]);
1892  }
1893 }
1894 
1896  // Print out current Cut Selection with value
1897  printf("\nConversion cutnumber \n");
1898  for(Int_t ic = 0; ic < kNCuts; ic++) {
1899  printf("%d",fCuts[ic]);
1900  }
1901  printf("\n\n");
1902  printf("Electron cuts & Secondary Track Cuts - only track from secondaries enter analysis: \n");
1903  printf("\t no like sign pairs from V0s \n");
1904  if (!fUseCorrectedTPCClsInfo) printf("\t # TPC clusters > %3.2f \n", fMinClsTPC);
1905  if (fEtaCutMin > -0.1) printf("\t %3.2f < eta_{e} < %3.2f\n", fEtaCutMin, fEtaCut );
1906  else printf("\t eta_{e} < %3.2f\n", fEtaCut );
1907  printf("\t reject: %3.2f < phi < %3.2f with %3.2f < eta < %3.2f \n", fMinPhiCut, fMaxPhiCut, fEtaForPhiCutMin, fEtaForPhiCutMax);
1908  if(fDoAsymPtCut)
1909  printf("\t Asymmetric cut: p_{T,e1} > %3.2f and p_{T,e2} > %3.2f\n", fSinglePtCut, fSinglePtCut2 );
1910  else
1911  printf("\t p_{T,e} > %3.2f\n", fSinglePtCut );
1912  printf("\t TPC refit \n");
1913  printf("\t no kinks \n");
1914  if (!fSwitchToKappa){
1915  printf("\t accept: %3.2f < n sigma_{e,TPC} < %3.2f\n", fPIDnSigmaBelowElectronLine, fPIDnSigmaAboveElectronLine );
1916  printf("\t reject: %3.2f < p_{e,T} < %3.2f, n sigma_{pi,TPC} < %3.2f\n", fPIDMinPnSigmaAbovePionLine, fPIDMaxPnSigmaAbovePionLine, fPIDnSigmaAbovePionLine );
1917  printf("\t reject: p_{e,T} > %3.2f, n sigma_{pi,TPC} < %3.2f\n", fPIDMaxPnSigmaAbovePionLine, fPIDnSigmaAbovePionLineHighPt );
1918  if (fDoPionRejectionLowP) printf("\t reject: p_{e,T} < %3.2f, -%3.2f < n sigma_{pi,TPC} < %3.2f\n", fPIDMinPPionRejectionLowP, fPIDnSigmaAtLowPAroundPionLine, fPIDnSigmaAtLowPAroundPionLine );
1919  if (fDoKaonRejectionLowP) printf("\t reject: -%3.2f < n sigma_{K,TPC} < %3.2f\n", fPIDnSigmaAtLowPAroundKaonLine, fPIDnSigmaAtLowPAroundKaonLine );
1920  if (fDoProtonRejectionLowP) printf("\t reject: -%3.2f < n sigma_{p,TPC} < %3.2f\n", fPIDnSigmaAtLowPAroundProtonLine, fPIDnSigmaAtLowPAroundProtonLine );
1921  } else {
1922  printf("\t accept: %3.2f <= Kappa_{TPC} < %3.2f\n", fKappaMinCut, fKappaMaxCut );
1923  }
1924  if (fUseTOFpid) printf("\t accept: %3.2f < n sigma_{e,TOF} < %3.2f\n", fTofPIDnSigmaBelowElectronLine, fTofPIDnSigmaAboveElectronLine);
1925  if (fUseITSpid) printf("\t accept: %3.2f < n sigma_{e,ITS} < %3.2f\n -- up to pT %3.2f", fITSPIDnSigmaBelowElectronLine, fITSPIDnSigmaAboveElectronLine, fMaxPtPIDITS);
1926 
1927  printf("Photon cuts: \n");
1928  if (fUseOnFlyV0Finder) printf("\t using Onfly V0 finder \n");
1929  else printf("\t using Offline V0 finder \n");
1930  if (fDo2DQt){
1931  printf("\t 2 dimensional q_{T} cut applied with maximum of %3.2f \n", fQtMax );
1932  } else {
1933  printf("\t 1 dimensional q_{T} cut applied with maximum of %3.2f \n", fQtMax );
1934  }
1935  if (fDo2DPsiPairChi2){
1936  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 );
1937  } else {
1938  printf("\t chi^{2} max cut chi^{2} < %3.2f \n", fChi2CutConversion );
1939  printf("\t psi_{pair} max cut |psi_{pair}| < %3.2f \n", fPsiPairCut );
1940  }
1941  printf("\t %3.2f < R_{conv} < %3.2f\n", fMinR, fMaxR );
1942  printf("\t Z_{conv} < %3.2f\n", fMaxZ );
1943  if (fEtaCutMin > -0.1) printf("\t %3.2f < eta_{conv} < %3.2f\n", fEtaCutMin, fEtaCut );
1944  else printf("\t eta_{conv} < %3.2f\n", fEtaCut );
1945  if (fDoPhotonAsymmetryCut) printf("\t for p_{T,track} > %3.2f, A_{gamma} < %3.2f \n", fMinPPhotonAsymmetryCut, fMinPhotonAsymmetry );
1946  if (fDoPhotonPDependentAsymCut && fDoPhotonAsymmetryCut) printf("\t p-dependent asymmetry cut \n");
1947  if (fUseCorrectedTPCClsInfo) printf("\t #cluster TPC/ #findable clusters TPC (corrected for radius) > %3.2f\n", fMinClsTPCToF );
1948  printf("\t p_{T,gamma} > %3.2f\n", fPtCut );
1949  printf("\t cos(Theta_{point}) > %3.2f \n", fCosPAngleCut );
1950  printf("\t dca_{R} < %3.2f \n", fDCARPrimVtxCut );
1951  printf("\t dca_{Z} < %3.2f \n", fDCAZPrimVtxCut );
1952  if (fDoPhotonQualitySelectionCut) printf("\t selection based on photon quality with quality %d \n", fPhotonQualityCut );
1953  if (fDoDoubleCountingCut) printf("\t Reject doubly counted photons with R > %3.2f, DeltaR < %3.2f, OpenAngle < %3.2f \n", fMinRDC, fDeltaR,fOpenAngle );
1954 
1955 }
1956 
1959  switch (v0FinderType){
1960  case 0: // on fly V0 finder
1961  cout << "have chosen onfly V0" << endl;
1962  fUseOnFlyV0Finder=kTRUE;
1964  break;
1965  case 1: // offline V0 finder
1966  cout << "have chosen offline V0" << endl;
1967  fUseOnFlyV0Finder=kFALSE;
1969  break;
1970  case 2: // on fly V0 finder with same signs
1971  cout << "have chosen onfly V0 same sign pairing" << endl;
1972  fUseOnFlyV0Finder=kTRUE;
1974  break;
1975  case 3: // on fly V0 finder with unlike signs and same signs
1976  cout << "have chosen onfly V0 unlike sign and same signs pairing" << endl;
1977  fUseOnFlyV0Finder=kTRUE;
1979  break;
1980  default:
1981  AliError(Form(" v0FinderType not defined %d",v0FinderType));
1982  return kFALSE;
1983  }
1984  return kTRUE;
1985 }
1986 
1989 
1990  //Set Standard LineCutZValues
1991  fLineCutZValueMin = -2;
1992  fLineCutZValue = 7.;
1993 
1994  switch(etaCut){
1995  case 0: // 0.9
1996  fEtaCut = 0.9;
1997  fLineCutZRSlope = tan(2*atan(exp(-fEtaCut)));
1998  fEtaCutMin = -0.1;
1999  fLineCutZRSlopeMin = 0.;
2000  break;
2001  case 1: // 0.6 // changed from 1.2 to 0.6 on 2013.06.10
2002  fEtaCut = 0.6;
2003  fLineCutZRSlope = tan(2*atan(exp(-fEtaCut)));
2004  fEtaCutMin = -0.1;
2005  fLineCutZRSlopeMin = 0.;
2006  break;
2007  case 2: // 1.4
2008  fEtaCut = 1.4;
2009  fLineCutZRSlope = tan(2*atan(exp(-fEtaCut)));
2010  fEtaCutMin = -0.1;
2011  fLineCutZRSlopeMin = 0.;
2012  break;
2013  case 3: // 0.65
2014  fEtaCut = 0.65;
2015  fLineCutZRSlope = tan(2*atan(exp(-fEtaCut)));
2016  fEtaCutMin = -0.1;
2017  fLineCutZRSlopeMin = 0.;
2018  break;
2019  case 4: // 0.75
2020  fEtaCut = 0.75;
2021  fLineCutZRSlope = tan(2*atan(exp(-fEtaCut)));
2022  fEtaCutMin = -0.1;
2023  fLineCutZRSlopeMin = 0.;
2024  break;
2025  case 5: // 0.5
2026  fEtaCut = 0.5;
2027  fLineCutZRSlope = tan(2*atan(exp(-fEtaCut)));
2028  fEtaCutMin = -0.1;
2029  fLineCutZRSlopeMin = 0.;
2030  break;
2031  case 6: // 5.
2032  fEtaCut = 5.;
2033  fLineCutZRSlope = tan(2*atan(exp(-fEtaCut)));
2034  fEtaCutMin = -0.1;
2035  fLineCutZRSlopeMin = 0.;
2036  break;
2037  case 7:
2038  if (fIsHeavyIon==1){
2039  fEtaCut = 0.7;
2040  fLineCutZRSlope = tan(2*atan(exp(-fEtaCut)));
2041  fEtaCutMin = -0.1;
2042  fLineCutZRSlopeMin = 0.;
2043  break;
2044  } else {
2045  fEtaCut = 0.3;
2046  fLineCutZRSlope = tan(2*atan(exp(-fEtaCut)));
2047  fEtaCutMin = -0.1;
2048  fLineCutZRSlopeMin = 0.;
2049  break;
2050  }
2051  // case 8: // 0.1 - 0.8
2052  // fEtaCut = 0.9;
2053  // fLineCutZRSlope = tan(2*atan(exp(-fEtaCut)));
2054  // fEtaCutMin = 0.1;
2055  // fLineCutZRSlopeMin = tan(2*atan(exp(-fEtaCutMin)));
2056  // break;
2057  case 8: // 0.4
2058  fEtaCut = 0.4;
2059  fLineCutZRSlope = tan(2*atan(exp(-fEtaCut)));
2060  fEtaCutMin = -0.1;
2061  fLineCutZRSlopeMin = 0.;
2062  break;
2063  case 9: // 10
2064  fEtaCut = 10;
2065  fLineCutZRSlope = tan(2*atan(exp(-fEtaCut)));
2066  fEtaCutMin = -0.1;
2067  fLineCutZRSlopeMin = 0.;
2068  break;
2069  case 10: // 0.2-0.9
2070  fEtaCut = 0.9;
2071  fLineCutZRSlope = tan(2*atan(exp(-fEtaCut)));
2072  fEtaCutMin = 0.2;
2073  fLineCutZRSlopeMin = 0.;
2074  break;
2075  case 11: // 0.2-0.9
2076  fEtaCut = 0.9;
2077  fLineCutZRSlope = tan(2*atan(exp(-fEtaCut)));
2078  fEtaCutMin = 0.2;
2079  fLineCutZRSlopeMin = tan(2*atan(exp(-fEtaCutMin)));
2080  break;
2081  default:
2082  AliError(Form(" EtaCut not defined %d",etaCut));
2083  return kFALSE;
2084  }
2085  return kTRUE;
2086 }
2087 
2090  // Set Cut
2091  switch(RCut){
2092  case 0:
2093  fMinR=0;
2094  fMaxR = 180.;
2095  break;
2096  case 1:
2097  fMinR=2.8;
2098  fMaxR = 180.;
2099  break;
2100  case 2:
2101  fMinR=5.;
2102  fMaxR = 180.;
2103  break;
2104  case 3:
2105  fMaxR = 70.;
2106  fMinR = 10.;
2107  break;
2108  case 4:
2109  fMaxR = 70.;
2110  fMinR = 5.;
2111  break;
2112  case 5:
2113  fMaxR = 180.;
2114  fMinR = 10.;
2115  break;
2116  case 6:
2117  fMaxR = 180.;
2118  fMinR = 20.;
2119  break;
2120  case 7:
2121  fMaxR = 180.;
2122  fMinR = 35.; //old 26.
2123  break;
2124  case 8:
2125  fMaxR = 180.;
2126  fMinR = 12.5;
2127  break;
2128  case 9:
2129  fMaxR = 180.;
2130  fMinR = 7.5;
2131  break;
2132 
2133  default:
2134  AliError("RCut not defined");
2135  return kFALSE;
2136  }
2137  return kTRUE;
2138 }
2139 
2142 
2143  switch(etaPhiCut) {
2144  case 0: //no specific eta range selected, full eta range
2147  break;
2148  case 1: //eta < 0 only
2151  fEtaForPhiCutMax = 0.;
2152  break;
2153  case 2://eta > 0 only
2155  fEtaForPhiCutMin = 0.;
2157  break;
2158  default:
2159  AliError(Form("EtaForPhiCut not defined %d",etaPhiCut));
2160  return kFALSE;
2161  }
2162 
2163  return kTRUE;
2164 }
2165 
2167 // This are exclusion cuts, everything between fMinPhiCut & fMaxPhiCut will be excluded
2169 
2170  switch(minPhiCut) {
2171  case 0:
2172  fDoShrinkTPCAcceptance = kFALSE;
2173  fMinPhiCut = 0;
2174  break;
2175  case 1:
2177  fMinPhiCut = 1.7; //OROC C08 large cut
2178  break;
2179  case 2:
2181  fMinPhiCut = 4.4; //EMCal
2182  break;
2183  case 3:
2185  fMinPhiCut = 1.0; //PHOS
2186  break;
2187  case 4:
2189  fMinPhiCut = 3.4; //EMCal tight
2190  break;
2191  case 5:
2193  fMinPhiCut = 2.0; //OROC C08 medium cut
2194  break;
2195  case 6:
2197  fMinPhiCut = 2.2; //OROC C08 small cut
2198  break;
2199  case 7:
2201  fMinPhiCut = 2.4; //OROC C08 tightest cut
2202  break;
2203  case 8:
2205  fMinPhiCut = 4.54; //PHOS phi
2206  break;
2207  default:
2208  AliError(Form("MinPhiCut not defined %d",minPhiCut));
2209  return kFALSE;
2210  }
2211 
2212  return kTRUE;
2213 }
2214 
2216 // This are exclusion cuts, everything between fMinPhiCut & fMaxPhiCut will be excluded
2218 
2219  switch(maxPhiCut) {
2220  case 0:
2222  fMaxPhiCut = 2*TMath::Pi()+0.00001;
2223  break;
2224  case 1:
2226  fMaxPhiCut = 4.3; //OROC C08 large cut
2227  break;
2228  case 2:
2230  fMaxPhiCut = 5.8; //EMCal
2231  break;
2232  case 3:
2234  fMaxPhiCut = 3.0; //PHOS
2235  break;
2236  case 4:
2238  fMaxPhiCut = 1.; //EMCal
2239  break;
2240  case 5:
2242  fMaxPhiCut = 4.0; //OROC C08 medium cut
2243  break;
2244  case 6:
2246  fMaxPhiCut = 3.8; //OROC C08 small cut
2247  break;
2248  case 7:
2250  fMaxPhiCut = 3.6; //OROC C08 tighest cut
2251  break;
2252  case 8:
2254  fMaxPhiCut = 5.59; //PHOS phi
2255  break;
2256  default:
2257  AliError(Form("MaxPhiCut not defined %d",maxPhiCut));
2258  return kFALSE;
2259  }
2260 
2261  return kTRUE;
2262 }
2263 
2264 
2267  switch(singlePtCut){
2268  case 0: // 0.050 GeV
2269  fSinglePtCut = 0.050;
2270  break;
2271  case 1: // 0.100 GeV
2272  fSinglePtCut = 0.100;
2273  break;
2274  case 2: // 0.150 GeV
2275  fSinglePtCut = 0.150;
2276  break;
2277  case 3: // 0.200 GeV
2278  fSinglePtCut = 0.200;
2279  break;
2280  case 4: // 0.075 GeV
2281  fSinglePtCut = 0.075;
2282  break;
2283  case 5: // 0.125 GeV
2284  fSinglePtCut = 0.125;
2285  break;
2286  case 6: // 0.04 GeV
2287  fSinglePtCut = 0.040;
2288  break;
2289  case 7: // 0.0 GeV
2290  fSinglePtCut = 0.0;
2291  break;
2292  case 8: // 0.02 GeV ; equivalent to .05 for the low B field runs
2293  fSinglePtCut = 0.02;
2294  break;
2295  case 9: // 0.050 GeV + min gamma pT cut of 100 MeV
2296  fSinglePtCut = 0.050;
2297  fPtCut = 0.100;
2298  break;
2299  case 10: //a: 0.050 GeV + min gamma pT cut of 150 MeV
2300  fSinglePtCut = 0.050;
2301  fPtCut = 0.150;
2302  break;
2303  case 11: //b: 0.050 GeV + min gamma pT cut of 200 MeV
2304  fSinglePtCut = 0.050;
2305  fPtCut = 0.200;
2306  break;
2307  case 12: //c: 0.060 GeV
2308  fSinglePtCut = 0.060;
2309  break;
2310  case 13: //d: 0.060 GeV + min gamma pT cut of 100 MeV
2311  fSinglePtCut = 0.060;
2312  fPtCut = 0.100;
2313  break;
2314  case 14: //e: 0.060 GeV + min gamma pT cut of 150 MeV
2315  fSinglePtCut = 0.060;
2316  fPtCut = 0.150;
2317  break;
2318  case 15: //f: 0.060 GeV + min gamma pT cut of 200 MeV
2319  fSinglePtCut = 0.060;
2320  fPtCut = 0.200;
2321  break;
2322  case 16: //g: 0.075 GeV + min gamma pT cut of 150 MeV
2323  fSinglePtCut = 0.075;
2324  fPtCut = 0.150;
2325  break;
2326  case 17: //h: 0.100 GeV + min gamma pT cut of 200 MeV
2327  fSinglePtCut = 0.100;
2328  fPtCut = 0.200;
2329  break;
2330  case 18: //i: 0.150 GeV + min gamma pT cut of 300 MeV
2331  fSinglePtCut = 0.150;
2332  fPtCut = 0.300;
2333  break;
2334  case 19: //j: asym: 0.100 GeV and 0.075 GeV
2335  fSinglePtCut = 0.100;
2336  fDoAsymPtCut = kTRUE;
2337  fSinglePtCut2= 0.075;
2338  break;
2339  case 20: //k: asym: 0.150 GeV and 0.075 GeV
2340  fSinglePtCut = 0.150;
2341  fDoAsymPtCut = kTRUE;
2342  fSinglePtCut2= 0.075;
2343  break;
2344  case 21: //l: asym: 0.200 GeV and 0.075 GeV
2345  fSinglePtCut = 0.200;
2346  fDoAsymPtCut = kTRUE;
2347  fSinglePtCut2= 0.075;
2348  break;
2349  default:
2350  AliError(Form("singlePtCut not defined %d",singlePtCut));
2351  return kFALSE;
2352  }
2353  return kTRUE;
2354 }
2355 
2358  switch(clsTPCCut){
2359  case 0: // 0
2360  fMinClsTPC= 0.;
2361  break;
2362  case 1: // 60
2363  fMinClsTPC= 60.;
2364  break;
2365  case 2: // 80
2366  fMinClsTPC= 80.;
2367  break;
2368  case 3: // 100
2369  fMinClsTPC= 100.;
2370  break;
2371  case 4: // 95% of findable clusters
2372  fMinClsTPCToF= 0.95;
2374  break;
2375  case 5: // 0% of findable clusters
2376  fMinClsTPCToF= 0.0;
2378  break;
2379  case 6: // 70% of findable clusters
2380  fMinClsTPCToF= 0.7;
2382  break;
2383  case 7: // 0% of findable clusters
2384  fMinClsTPCToF= 0.35;
2386  break;
2387  case 8:
2388  fMinClsTPCToF= 0.35;
2390  break;
2391  case 9:
2392  fMinClsTPCToF= 0.6;
2394  break;
2395  default:
2396  AliError(Form("Warning: clsTPCCut not defined %d",clsTPCCut));
2397  return kFALSE;
2398  }
2399  return kTRUE;
2400 }
2401 
2404  switch(ededxSigmaCut){
2405  case 0: // -10,10
2408  break;
2409  case 1: // -5,5
2412  break;
2413  case 2: // -3,5
2416  break;
2417  case 3: // -4,5
2420  break;
2421  case 4: // -6,7
2424  break;
2425  case 5: // -4,4
2428  break;
2429  case 6: // -2.5,4
2432  break;
2433  case 7: // -2,3.5
2436  break;
2437  case 8: // -2.5,3.
2440  break;
2441  case 9: // -2.5,5.
2444  break;
2445  default:
2446  AliError("TPCdEdxCutElectronLine not defined");
2447  return kFALSE;
2448 
2449  }
2450  return kTRUE;
2451 }
2452 
2455 
2456  switch(pidedxSigmaCut){
2457  case 0: // -10
2460  break;
2461  case 1: // 0
2464  break;
2465  case 2: // 1
2468  break;
2469  case 3: // 1
2472  break;
2473  case 4: // 3.0sigma, 1.0 sigma at high pt
2476  break;
2477  case 5: // 1
2480  break;
2481  case 6: // 1
2484  break;
2485  case 7: // 1
2488  break;
2489  case 8: // 1
2492  break;
2493  case 9:
2494  fPIDnSigmaAbovePionLine=1; // We need a bit less tight cut on dE/dx
2496  break;
2497  default:
2498  AliError(Form("Warning: pidedxSigmaCut not defined %d",pidedxSigmaCut));
2499  return kFALSE;
2500  }
2501  return kTRUE;
2502 }
2503 
2506  switch(piMomdedxSigmaCut){
2507  case 0: // 0.5 GeV
2509  break;
2510  case 1: // 1. GeV
2512  break;
2513  case 2: // 1.5 GeV
2515  break;
2516  case 3: // 20.0 GeV
2518  break;
2519  case 4: // 50.0 GeV
2521  break;
2522  case 5: // 0.3 GeV
2524  break;
2525  case 6: // 0.25 GeV
2527  break;
2528  case 7: // 0.4 GeV
2530  break;
2531  case 8: // 0.2 GeV
2533  break;
2534  default:
2535  AliError(Form("piMomdedxSigmaCut not defined %d",piMomdedxSigmaCut));
2536  return kFALSE;
2537  }
2538  return kTRUE;
2539 }
2540 
2543  switch(piMaxMomdedxSigmaCut){
2544  case 0: // 100. GeV
2546  break;
2547  case 1: // 5. GeV
2549  break;
2550  case 2: // 4. GeV
2552  break;
2553  case 3: // 3.5 GeV
2555  break;
2556  case 4: // 3. GeV
2558  break;
2559  case 5: // 7. GeV
2561  break;
2562  case 6: // 2. GeV
2564  break;
2565  default:
2566  AliError(Form("piMaxMomdedxSigmaCut not defined %d",piMaxMomdedxSigmaCut));
2567  return kFALSE;
2568  }
2569  return kTRUE;
2570 }
2571 
2574  switch(LowPRejectionSigmaCut){
2575  case 0: //
2579  fDoKaonRejectionLowP = kFALSE;
2580  fDoProtonRejectionLowP = kFALSE;
2581  fDoPionRejectionLowP = kFALSE;
2583  break;
2584  case 1: //
2588  fDoKaonRejectionLowP = kTRUE;
2589  fDoProtonRejectionLowP = kTRUE;
2590  fDoPionRejectionLowP = kTRUE;
2592  break;
2593  case 2: //
2597  fDoKaonRejectionLowP = kTRUE;
2598  fDoProtonRejectionLowP = kTRUE;
2599  fDoPionRejectionLowP = kTRUE;
2601  break;
2602  case 3: //
2606  fDoKaonRejectionLowP = kTRUE;
2607  fDoProtonRejectionLowP = kTRUE;
2608  fDoPionRejectionLowP = kTRUE;
2610  break;
2611  case 4: //
2615  fDoKaonRejectionLowP = kFALSE;
2616  fDoProtonRejectionLowP = kFALSE;
2617  fDoPionRejectionLowP = kTRUE;
2619  break;
2620  case 5: //
2624  fDoKaonRejectionLowP = kFALSE;
2625  fDoProtonRejectionLowP = kFALSE;
2626  fDoPionRejectionLowP = kTRUE;
2628  break;
2629  case 6: //
2633  fDoKaonRejectionLowP = kFALSE;
2634  fDoProtonRejectionLowP = kFALSE;
2635  fDoPionRejectionLowP = kTRUE;
2637  break;
2638  case 7: //
2642  fDoKaonRejectionLowP = kFALSE;
2643  fDoProtonRejectionLowP = kFALSE;
2644  fDoPionRejectionLowP = kTRUE;
2646  break;
2647  case 8: //
2651  fDoKaonRejectionLowP = kFALSE;
2652  fDoProtonRejectionLowP = kTRUE;
2653  fDoPionRejectionLowP = kFALSE;
2655  break;
2656  default:
2657  AliError(Form("LowPRejectionSigmaCut not defined %d",LowPRejectionSigmaCut));
2658  return kFALSE;
2659  }
2660  return kTRUE;
2661 }
2662 
2665  switch(kappaCut){
2666  case 0: // completely open
2667  fKappaMaxCut=200;
2668  fKappaMinCut=-200;
2669  break;
2670  case 1: // mainly pi pi
2671  fKappaMaxCut=-13;
2672  fKappaMinCut=-20;
2673  break;
2674  case 2: // mainly pi e
2675  fKappaMaxCut=-6;
2676  fKappaMinCut=-11;
2677  break;
2678  case 3: // signal
2679  fKappaMaxCut=5;
2680  fKappaMinCut=-3;
2681  break;
2682  case 4: // remaining
2683  fKappaMaxCut=20;
2684  fKappaMinCut=11;
2685  break;
2686  case 5: // -5-10 full signal peak(including background)
2687  fKappaMaxCut=10;
2688  fKappaMinCut=-5;
2689  break;
2690  case 6: //
2691  fKappaMaxCut=10;
2692  fKappaMinCut=-3;
2693  break;
2694  case 7: //
2695  fKappaMaxCut=10;
2696  fKappaMinCut=0;
2697  break;
2698  default:
2699  AliError("KappaTPCCut not defined");
2700  return kFALSE;
2701 
2702  }
2703  return kTRUE;
2704 }
2705 
2706 
2709  // Set Cut
2710  switch(TOFelectronPID){
2711  case 0: // no cut
2712  fUseTOFpid = kFALSE;
2715  break;
2716  case 1: // -7,7
2717  fUseTOFpid = kTRUE;
2720  break;
2721  case 2: // -5,5
2722  fUseTOFpid = kTRUE;
2725  break;
2726  case 3: // -3,5
2727  fUseTOFpid = kTRUE;
2730  break;
2731  case 4: // -2,3
2732  fUseTOFpid = kTRUE;
2735  break;
2736  case 5: // -3,3
2737  fUseTOFpid = kTRUE;
2740  break;
2741  default:
2742  AliError(Form("TOFElectronCut not defined %d",TOFelectronPID));
2743  return kFALSE;
2744  }
2745  return kTRUE;
2746 }
2747 
2750  // Set Cut
2751  switch(ITSelectronPID){
2752  case 0: // no cut
2753  fUseITSpid = kFALSE;
2756  fMaxPtPIDITS = 1.5;
2757  break;
2758  case 1: // -3,3
2759  fUseITSpid = kTRUE;
2762  fMaxPtPIDITS = 1.5;
2763  break;
2764  case 2: // -2,2
2765  fUseITSpid = kTRUE;
2768  fMaxPtPIDITS = 1.5;
2769  break;
2770  case 3: // -1,1
2771  fUseITSpid = kTRUE;
2774  fMaxPtPIDITS = 1.5;
2775  break;
2776  case 4: // -3,5
2777  fUseITSpid = kTRUE;
2780  fMaxPtPIDITS = 1.5;
2781  break;
2782  case 5: // -5,5
2783  fUseITSpid = kTRUE;
2786  fMaxPtPIDITS = 1.5;
2787  break;
2788  case 6: // -3,3
2789  fUseITSpid = kTRUE;
2792  fMaxPtPIDITS = 2;
2793  break;
2794  case 7: // -2,2
2795  fUseITSpid = kTRUE;
2798  fMaxPtPIDITS = 2;
2799  break;
2800  case 8: // -1,1
2801  fUseITSpid = kTRUE;
2804  fMaxPtPIDITS = 2;
2805  break;
2806  case 9: // -3,5
2807  fUseITSpid = kTRUE;
2810  fMaxPtPIDITS = 2;
2811  break;
2812  default:
2813  AliError(Form("ITSelectronPID not defined %d",ITSelectronPID));
2814  return kFALSE;
2815  }
2816  return kTRUE;
2817 }
2818 
2821  // Set Cut
2822  switch(TRDelectronPID){
2823  case 0: // no cut
2824  fDoTRDPID = kFALSE;
2825  fTRDPIDBelowCut=-100;
2826  fTRDPIDAboveCut=100;
2827  break;
2828  default:
2829  AliError(Form("TRDelectronPID not defined %d",TRDelectronPID));
2830  return kFALSE;
2831  }
2832  return kTRUE;
2833 }
2834 
2835 
2838  switch(QtMaxCut){
2839  case 0: //
2840  fQtMax=1.;
2841  fDoQtGammaSelection=kFALSE;
2842  fDo2DQt=kFALSE;
2843  break;
2844  case 1:
2845  fQtMax=0.1;
2846  fDo2DQt=kFALSE;
2847  break;
2848  case 2:
2849  fQtMax=0.06;
2850  fDo2DQt=kTRUE;
2851  break;
2852  case 3:
2853  fQtMax=0.05;
2854  fDo2DQt=kFALSE;
2855  break;
2856  case 4:
2857  fQtMax=0.03;
2858  fDo2DQt=kFALSE;
2859  break;
2860  case 5:
2861  fQtMax=0.02;
2862  fDo2DQt=kFALSE;
2863  break;
2864  case 6:
2865  fQtMax=0.02;
2866  fDo2DQt=kTRUE;
2867  break;
2868  case 7:
2869  fQtMax=0.15;
2870  fDo2DQt=kFALSE;
2871  break;
2872  case 8:
2873  fQtMax=0.05;
2874  fDo2DQt=kTRUE;
2875  break;
2876  case 9:
2877  fQtMax=0.03;
2878  fDo2DQt=kTRUE;
2879  break;
2880  default:
2881  AliError(Form("Warning: QtMaxCut not defined %d",QtMaxCut));
2882  return kFALSE;
2883  }
2884  return kTRUE;
2885 }
2886 
2889 
2890  switch(chi2GammaCut){
2891  case 0: // 100
2892  fChi2CutConversion = 100.;
2893  break;
2894  case 1: // 50
2895  fChi2CutConversion = 50.;
2896  break;
2897  case 2: // 30
2898  fChi2CutConversion = 30.;
2899  break;
2900  case 3:
2901  fChi2CutConversion = 200.;
2902  break;
2903  case 4:
2904  if (fIsHeavyIon==1){
2905  fChi2CutConversion = 7.;
2906  } else {
2907  fChi2CutConversion = 500.;
2908  }
2909  break;
2910  case 5:
2911  fChi2CutConversion = 100000.;
2912  break;
2913  case 6:
2914  fChi2CutConversion = 5.;
2915  break;
2916  case 7:
2917  fChi2CutConversion = 10.;
2918  break;
2919  case 8:
2920  fChi2CutConversion = 20.;
2921  break;
2922  case 9:
2923  fChi2CutConversion = 15.;
2924  break;
2925  case 10:
2926  fChi2CutConversion = 25.;
2927  break;
2928  default:
2929  AliError(Form("Warning: Chi2GammaCut not defined %d",chi2GammaCut));
2930  return kFALSE;
2931  }
2932  return kTRUE;
2933 }
2934 
2937  switch(psiCut) {
2938  case 0:
2939  fPsiPairCut = 10000; //
2940  break;
2941  case 1:
2942  fPsiPairCut = 0.1; //
2943  break;
2944  case 2:
2945  fPsiPairCut = 0.05; // Standard
2946  break;
2947  case 3:
2948  fPsiPairCut = 0.035; //
2949  break;
2950  case 4:
2951  fPsiPairCut = 0.2; //
2952  break;
2953  case 5:
2954  fPsiPairCut = 0.1; //
2955  fDo2DPsiPairChi2 = kTRUE;
2956  break;
2957  case 6:
2958  fPsiPairCut = 0.05; //
2959  fDo2DPsiPairChi2 = kTRUE;
2960  break;
2961  case 7:
2962  if (fIsHeavyIon==1){
2963  fPsiPairCut = 0.07; //
2964  } else {
2965  fPsiPairCut = 0.035; //
2966  }
2967  fDo2DPsiPairChi2 = kTRUE;
2968  break;
2969  case 8:
2970  fPsiPairCut = 0.2; //
2971  fDo2DPsiPairChi2 = kTRUE; //
2972  break;
2973  case 9:
2974  // if (fIsHeavyIon==1){ //AM 2016-05-13
2975  fPsiPairCut = 0.1; //
2976  fDo2DPsiPairChi2 = kTRUE;
2977  fIncludeRejectedPsiPair = kTRUE;
2978  break;
2979  // } else {
2980  // fPsiPairCut = 0.5; //
2981  // break;
2982  // }
2983  default:
2984  AliError(Form("PsiPairCut not defined %d",psiCut));
2985  return kFALSE;
2986  }
2987 
2988  return kTRUE;
2989 }
2990 
2993  // Set Cut
2994  switch(doPhotonAsymmetryCut){
2995  case 0:
2999  break;
3000  case 1:
3003  fMinPhotonAsymmetry=0.04;
3004  break;
3005  case 2:
3008  fMinPhotonAsymmetry=0.06;
3009  break;
3010  case 3:
3013  fMinPhotonAsymmetry=0.05;
3014  break;
3015  case 4:
3018  fFAsymmetryCut = new TF1("fFAsymmetryCut","[0] + [1]*tanh(2*TMath::Power(x,[2]))",0.,100.);
3019  fFAsymmetryCut->SetParameter(0,0.3);
3020  fFAsymmetryCut->SetParameter(1,0.66);
3021  fFAsymmetryCut->SetParameter(2,0.7);
3024  break;
3025  case 5:
3028  fFAsymmetryCut = new TF1("fFAsymmetryCut","[0] + [1]*tanh(2*TMath::Power(x,[2]))",0.,100.);
3029  fFAsymmetryCut->SetParameter(0,0.14);
3030  fFAsymmetryCut->SetParameter(1,0.66);
3031  fFAsymmetryCut->SetParameter(2,0.5);
3034  break;
3035  case 6:
3038  fMinPhotonAsymmetry=0.05;
3039  break;
3040  case 7:
3043  fMinPhotonAsymmetry=0.05;
3044  break;
3045  default:
3046  AliError(Form("PhotonAsymmetryCut not defined %d",doPhotonAsymmetryCut));
3047  return kFALSE;
3048  }
3049  fCuts[kdoPhotonAsymmetryCut]=doPhotonAsymmetryCut;
3050  return kTRUE;
3051 }
3052 
3055 
3056  switch(cosCut){
3057  case 0:
3058  fCosPAngleCut = -1;
3059  break;
3060  case 1:
3061  fCosPAngleCut = 0;
3062  break;
3063  case 2:
3064  fCosPAngleCut = 0.5;
3065  break;
3066  case 3:
3067  fCosPAngleCut = 0.75;
3068  break;
3069  case 4:
3070  fCosPAngleCut = 0.85;
3071  break;
3072  case 5:
3073  fCosPAngleCut = 0.88;
3074  break;
3075  case 6:
3076  fCosPAngleCut = 0.9;
3077  break;
3078  case 7:
3079  fCosPAngleCut = 0.95;
3080  break;
3081  default:
3082  AliError(Form("Cosine Pointing Angle cut not defined %d",cosCut));
3083  return kFALSE;
3084  }
3085 
3086  return kTRUE;
3087 }
3088 
3091 
3092  switch(sharedElec){
3093  case 0:
3094  fDoSharedElecCut = kFALSE;
3096  fPhotonQualityCut = 0;
3097  break;
3098  case 1:
3099  fDoSharedElecCut = kTRUE;
3101  fPhotonQualityCut = 0;
3102  break;
3103  case 2:
3104  fDoSharedElecCut = kFALSE;
3106  fPhotonQualityCut = 1;
3107  break;
3108  case 3:
3109  fDoSharedElecCut = kFALSE;
3111  fPhotonQualityCut = 2;
3112  break;
3113  case 4:
3114  fDoSharedElecCut = kFALSE;
3116  fPhotonQualityCut = 3;
3117  break;
3118  default:
3119  AliError(Form("Shared Electron Cut not defined %d",sharedElec));
3120  return kFALSE;
3121  }
3122 
3123  return kTRUE;
3124 }
3125 
3128 
3129  switch(toClose){
3130  case 0:
3131  fDoToCloseV0sCut = kFALSE;
3132  fminV0Dist = 250;
3133  break;
3134  case 1:
3135  fDoToCloseV0sCut = kTRUE;
3136  fminV0Dist = 1;
3137  break;
3138  case 2:
3139  fDoToCloseV0sCut = kTRUE;
3140  fminV0Dist = 2;
3141  break;
3142  case 3:
3143  fDoToCloseV0sCut = kTRUE;
3144  fminV0Dist = 3;
3145  break;
3146  case 4:
3147  fDoToCloseV0sCut = kTRUE;
3148  fDoDoubleCountingCut = kTRUE;
3149  fMinRDC=0.;
3150  fDeltaR=6.;
3151  fOpenAngle=0.02;
3152  break;
3153  case 5:
3154  fDoToCloseV0sCut = kTRUE;
3155  fDoDoubleCountingCut = kTRUE;
3156  fMinRDC=0.;
3157  fDeltaR=6.;
3158  fOpenAngle=0.03;
3159  break;
3160  case 6:
3161  fDoToCloseV0sCut = kTRUE;
3162  fDoDoubleCountingCut = kTRUE;
3163  fMinRDC=0.;
3164  fDeltaR=6.;
3165  fOpenAngle=0.04;
3166  break;
3167 
3168  default:
3169  AliError(Form("Shared Electron Cut not defined %d",toClose));
3170  return kFALSE;
3171  }
3172  return kTRUE;
3173 }
3174 
3177  switch(TRDElectronCut){
3178  case 0:
3179  fDoTRDPID=kFALSE;
3180  break;
3181  case 1:
3182  fDoTRDPID=kTRUE;
3183  fPIDTRDEfficiency=0.1;
3184  break;
3185  case 8:
3186  fDoTRDPID=kTRUE;
3187  fPIDTRDEfficiency=0.8;
3188  break;
3189  case 9:
3190  fDoTRDPID=kTRUE;
3191  fPIDTRDEfficiency=0.9;
3192  break;
3193  default:
3194  AliError(Form("TRDElectronCut not defined %d",TRDElectronCut));
3195  return kFALSE;
3196  }
3197 
3198  return kTRUE;
3199 }
3200 
3203  // Set Cut
3204  switch(DCAZPhotonPrimVtx){
3205  case 0: //
3206  fDCAZPrimVtxCut = 1000;
3207  break;
3208  case 1: //
3209  fDCAZPrimVtxCut = 10;
3210  break;
3211  case 2: //
3212  fDCAZPrimVtxCut = 5;
3213  break;
3214  case 3: //
3215  fDCAZPrimVtxCut = 4;
3216  break;
3217  case 4: //
3218  fDCAZPrimVtxCut = 3;
3219  break;
3220  case 5: //
3221  fDCAZPrimVtxCut = 2.5;
3222  break;
3223  case 6: //
3224  fDCAZPrimVtxCut = 2;
3225  break;
3226  case 7: //
3227  fDCAZPrimVtxCut = 1.5;
3228  break;
3229  case 8: //
3230  fDCAZPrimVtxCut = 1;
3231  break;
3232  case 9: //
3233  fDCAZPrimVtxCut = 0.5;
3234  break;
3235  default:
3236  cout<<"Warning: DCAZPhotonPrimVtx not defined "<<DCAZPhotonPrimVtx<<endl;
3237  return kFALSE;
3238  }
3239  return kTRUE;
3240 }
3241 
3244  // Set Cut
3245  switch(DCARPhotonPrimVtx){
3246  case 0: //
3247  fDCARPrimVtxCut = 1000;
3248  break;
3249  case 1: //
3250  fDCARPrimVtxCut = 10;
3251  break;
3252  case 2: //
3253  fDCARPrimVtxCut = 5;
3254  break;
3255  case 3: //
3256  fDCARPrimVtxCut = 4;
3257  break;
3258  case 4: //
3259  fDCARPrimVtxCut = 3;
3260  break;
3261  case 5: //
3262  fDCARPrimVtxCut = 2.5;
3263  break;
3264  case 6: //
3265  fDCARPrimVtxCut = 2;
3266  break;
3267  case 7: //
3268  fDCARPrimVtxCut = 1.5;
3269  break;
3270  case 8: //
3271  fDCARPrimVtxCut = 1;
3272  break;
3273  case 9: //
3274  fDCARPrimVtxCut = 0.5;
3275  break;
3276  default:
3277  cout<<"Warning: DCARPhotonPrimVtx not defined "<<DCARPhotonPrimVtx<<endl;
3278  return kFALSE;
3279  }
3280  return kTRUE;
3281 }
3282 
3285  // Set Cut
3286  switch(inOutPlane){
3287  case 0: //
3288  fInPlaneOutOfPlane = 0; // No Event Plane
3289  break;
3290  case 1: //
3291  fInPlaneOutOfPlane = 1; // In-Plane
3292  break;
3293  case 2: //
3294  fInPlaneOutOfPlane = 2; // Out-Of-Plane
3295  break;
3296  default:
3297  cout<<"Warning: In-Plane or Out-Of-Plane not defined "<<inOutPlane<<endl;
3298  return kFALSE;
3299  }
3300  return kTRUE;
3301 }
3302 
3303 
3306  // Get first TPC row
3307  Int_t firstTPCRow = 0;
3308  Double_t radiusI = 84.8;
3309  Double_t radiusO = 134.6;
3310  Double_t radiusOB = 198.;
3311  Double_t rSizeI = 0.75;
3312  Double_t rSizeO = 1.;
3313  Double_t rSizeOB = 1.5;
3314  Int_t nClsI = 63;
3315  Int_t nClsIO = 127;
3316 
3317  if(radius <= radiusI){
3318  return firstTPCRow;
3319  }
3320  if(radius>radiusI && radius<=radiusO){
3321  firstTPCRow = (Int_t)((radius-radiusI)/rSizeI);
3322  }
3323  if(radius>radiusO && radius<=radiusOB){
3324  firstTPCRow = (Int_t)(nClsI+(radius-radiusO)/rSizeO);
3325  }
3326 
3327  if(radius>radiusOB){
3328  firstTPCRow =(Int_t)(nClsIO+(radius-radiusOB)/rSizeOB);
3329  }
3330 
3331  return firstTPCRow;
3332 }
3333 
3337  if(GetCosineOfPointingAngle(photon, event) < fCosPAngleCut){
3338  return kFALSE;
3339  }
3340  return kTRUE;
3341 }
3342 
3345  // calculates the pointing angle of the recalculated V0
3346 
3347  Double_t momV0[3] = {0,0,0};
3348  if(event->IsA()==AliESDEvent::Class()){
3349  AliESDEvent *esdEvent = dynamic_cast<AliESDEvent*>(event);
3350  if(!esdEvent) return -999;
3351  AliESDv0 *v0 = esdEvent->GetV0(photon->GetV0Index());
3352  if(!v0) return -999;
3353  v0->GetPxPyPz(momV0[0],momV0[1],momV0[2]);
3354  }
3355  if(event->IsA()==AliAODEvent::Class()){
3356  momV0[0] = photon->GetPx();
3357  momV0[1] = photon->GetPy();
3358  momV0[2] = photon->GetPz();
3359  }
3360 
3361  //Double_t momV0[3] = { photon->GetPx(), photon->GetPy(), photon->GetPz() }; //momentum of the V0
3362  Double_t PosV0[3] = { photon->GetConversionX() - event->GetPrimaryVertex()->GetX(),
3363  photon->GetConversionY() - event->GetPrimaryVertex()->GetY(),
3364  photon->GetConversionZ() - event->GetPrimaryVertex()->GetZ() }; //Recalculated V0 Position vector
3365 
3366  Double_t momV02 = momV0[0]*momV0[0] + momV0[1]*momV0[1] + momV0[2]*momV0[2];
3367  Double_t PosV02 = PosV0[0]*PosV0[0] + PosV0[1]*PosV0[1] + PosV0[2]*PosV0[2];
3368 
3369 
3370  Double_t cosinePointingAngle = -999;
3371  if(momV02*PosV02 > 0.0)
3372  cosinePointingAngle = (PosV0[0]*momV0[0] + PosV0[1]*momV0[1] + PosV0[2]*momV0[2] ) / TMath::Sqrt(momV02 * PosV02);
3373 
3374  return cosinePointingAngle;
3375 }
3376 
3379 
3380  if (fDo2DPsiPairChi2){
3382  if (TMath::Abs(photon->GetPsiPair()) < -fPsiPairCut/fChi2CutConversion*photon->GetChi2perNDF() + fPsiPairCut || (photon->GetPsiPair()) == 4){
3383  return kTRUE;
3384  } else {
3385  return kFALSE;
3386  }
3387 
3388  } else {
3389  if (TMath::Abs(photon->GetPsiPair()) < -fPsiPairCut/fChi2CutConversion*photon->GetChi2perNDF() + fPsiPairCut ){
3390  return kTRUE;
3391  } else {
3392  return kFALSE;
3393  }
3394  }
3395  } else {
3397  if(TMath::Abs(photon->GetPsiPair()) > fPsiPairCut || (photon->GetPsiPair()) != 4){
3398  return kFALSE;
3399  } else {
3400  return kTRUE;
3401  }
3402  } else {
3403  if(TMath::Abs(photon->GetPsiPair()) > fPsiPairCut){
3404  return kFALSE;
3405  } else {
3406  return kTRUE;
3407  }
3408  }
3409  }
3410 }
3411 
3414  // returns TString with current cut number
3415  return fCutStringRead;
3416 }
3417 
3420 
3421  Int_t posLabel = photon->GetTrackLabelPositive();
3422  Int_t negLabel = photon->GetTrackLabelNegative();
3423 
3424  fElectronLabelArray[nV0*2] = posLabel;
3425  fElectronLabelArray[(nV0*2)+1] = negLabel;
3426 }
3427 
3430 
3431  Int_t posLabel = photon->GetTrackLabelPositive();
3432  Int_t negLabel = photon->GetTrackLabelNegative();
3433 
3434  for(Int_t i = 0; i<nV0s*2;i++){
3435  if(i==nV0*2) continue;
3436  if(i==(nV0*2)+1) continue;
3437  if(fElectronLabelArray[i] == posLabel){
3438  return kFALSE;}
3439  if(fElectronLabelArray[i] == negLabel){
3440  return kFALSE;}
3441  }
3442 
3443  return kTRUE;
3444 }
3445 
3448 
3449  if (fDoDoubleCountingCut && photon->GetConversionRadius() < fMinRDC) return kTRUE;
3450 
3451  Double_t posX = photon->GetConversionX();
3452  Double_t posY = photon->GetConversionY();
3453  Double_t posZ = photon->GetConversionZ();
3454 
3455  for(Int_t i = 0;i<photons->GetEntries();i++){
3456  if(nV0 == i) continue;
3457  AliAODConversionPhoton *photonComp = (AliAODConversionPhoton*) photons->At(i);
3458  Double_t posCompX = photonComp->GetConversionX();
3459  Double_t posCompY = photonComp->GetConversionY();
3460  Double_t posCompZ = photonComp->GetConversionZ();
3461 
3462  if (!fDoDoubleCountingCut){
3463  Double_t dist = pow((posX - posCompX),2)+pow((posY - posCompY),2)+pow((posZ - posCompZ),2);
3464 
3465  if(dist < fminV0Dist*fminV0Dist){
3466  if(photon->GetChi2perNDF() > photonComp->GetChi2perNDF()) return kFALSE;
3467  }
3468  }else{
3469  TVector3 v1(photon->Px(),photon->Py(),photon->Pz());
3470  TVector3 v2(photonComp->Px(),photonComp->Py(),photonComp->Pz());
3471  Double_t OpeningAngle=v1.Angle(v2);
3472  if( OpeningAngle < fOpenAngle && TMath::Abs(photon->GetConversionRadius()-photonComp->GetConversionRadius()) < fDeltaR){
3473  if(photon->GetChi2perNDF() > photonComp->GetChi2perNDF()) return kFALSE;
3474  }
3475  }
3476 
3477  }
3478  return kTRUE;
3479 }
3480 
3481 
3484  //Create and return standard 2010 PbPb cuts
3485  AliConversionPhotonCuts *cuts=new AliConversionPhotonCuts("StandardCuts2010PbPb","StandardCuts2010PbPb");
3486  if(!cuts->InitializeCutsFromCutString("04209297002322000000")){
3487  cout<<"Warning: Initialization of Standardcuts2010PbPb failed"<<endl;}
3488  return cuts;
3489 }
3490 
3493  //Create and return standard 2010 PbPb cuts
3494  AliConversionPhotonCuts *cuts=new AliConversionPhotonCuts("StandardCuts2010pp","StandardCuts2010pp");
3495  if(!cuts->InitializeCutsFromCutString("00209366300380000000")){
3496  cout<<"Warning: Initialization of Standardcuts2010pp failed"<<endl;}
3497  return cuts;
3498 }
3499 
3502 
3503  //GetPhotonPhi() 0-2 Pi //eventPlaneAngle -1pi-1pi
3504  eventPlaneAngle=eventPlaneAngle+TMath::Pi();
3505  Double_t gammaToEPAngle = eventPlaneAngle-photonPhi;
3506  if(gammaToEPAngle < 0) gammaToEPAngle=gammaToEPAngle+2*TMath::Pi();
3507  gammaToEPAngle = gammaToEPAngle-TMath::Pi(); // angle from -pi +pi
3508 
3509  if(!fInPlaneOutOfPlane){
3510  if(fill&&fHistoEventPlanePhi)fHistoEventPlanePhi->Fill(gammaToEPAngle);
3511  return kTRUE;
3512  }
3513  else if(fInPlaneOutOfPlane == 1){
3514  if(TMath::Abs(gammaToEPAngle)<=0.25*TMath::Pi() || TMath::Abs(gammaToEPAngle)>=0.75*TMath::Pi()){
3515  if(fill&&fHistoEventPlanePhi)fHistoEventPlanePhi->Fill(gammaToEPAngle);
3516  return kTRUE;
3517  }
3518  else return kFALSE;
3519  }
3520  else if(fInPlaneOutOfPlane == 2){
3521  if(TMath::Abs(gammaToEPAngle)>0.25*TMath::Pi() && TMath::Abs(gammaToEPAngle)<0.75*TMath::Pi()){
3522  if(fill&&fHistoEventPlanePhi)fHistoEventPlanePhi->Fill(gammaToEPAngle);
3523  return kTRUE;
3524  }
3525  else return kFALSE;
3526  }
3527  return kFALSE;
3528 }
3529 
3532 
3533  AliAODTrack * negTrack = static_cast<AliAODTrack*>(GetTrack(eventDummy, photon->GetTrackLabelNegative()));
3534  AliAODTrack * posTrack = static_cast<AliAODTrack*>(GetTrack(eventDummy, photon->GetTrackLabelPositive()));
3535 
3536  if(!negTrack || !posTrack) {
3537  return 0;
3538  }
3539  if(negTrack->Charge() == posTrack->Charge()){
3540  return 0;
3541  }
3542  Int_t nClusterITSneg = negTrack->GetITSNcls();
3543  Int_t nClusterITSpos = posTrack->GetITSNcls();
3544  // cout << nClusterITSneg << "\t" << nClusterITSpos <<endl;
3545 
3546  if (nClusterITSneg > 1 && nClusterITSpos > 1){
3547  return 3;
3548  } else if (nClusterITSneg > 1 || nClusterITSpos > 1){
3549  return 2;
3550  } else {
3551  return 1;
3552  }
3553  return 0;
3554 }
3555 
3558 
3559  TString nameProfile;
3560  if (flag==1){
3561  nameProfile = "profileContainingMaterialBudgetWeights_fewRadialBins";}
3562  else if (flag==2){
3563  nameProfile = "profileContainingMaterialBudgetWeights_manyRadialBins";}
3564  else {
3565  AliError(Form("%d not a valid flag for InitMaterialBudgetWeightingOfPi0Candidates()",flag));
3566  return kFALSE;
3567  }
3568  TFile* file = TFile::Open(filename.Data());
3569  if (!file) {
3570  AliError(Form("File %s for materialbudgetweights not found",filename.Data()));
3571  return kFALSE;
3572  }
3573  fProfileContainingMaterialBudgetWeights = (TProfile*)file->Get(nameProfile.Data());
3575  AliError(Form("Histogram %s not found in file",nameProfile.Data()));
3576  return kFALSE;
3577  }
3578  fProfileContainingMaterialBudgetWeights->SetDirectory(0);
3579  file->Close();
3580  delete file;
3581 
3583  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()));
3584  return kTRUE;
3585 }
3586 
3589 
3590  Float_t weight = 1.0;
3591  Float_t gammaConversionRadius = gamma->GetConversionRadius();
3592  Int_t bin = fProfileContainingMaterialBudgetWeights->FindBin(gammaConversionRadius);
3593  if (bin > 0 && bin <= fProfileContainingMaterialBudgetWeights->GetNbinsX()){
3594  weight = fProfileContainingMaterialBudgetWeights->GetBinContent(bin);
3595  }
3596  return weight;
3597 }
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)