AliPhysics  b752f14 (b752f14)
 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 "AliStack.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,AliStack *fMCStack,Bool_t checkForConvertedGamma){
613  // MonteCarlo Photon Selection
614 
615  if(!fMCStack)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 && fMCStack->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) >= fMCStack->GetNprimary()){
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 = fMCStack->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  default:
2442  AliError("TPCdEdxCutElectronLine not defined");
2443  return kFALSE;
2444 
2445  }
2446  return kTRUE;
2447 }
2448 
2451 
2452  switch(pidedxSigmaCut){
2453  case 0: // -10
2456  break;
2457  case 1: // 0
2460  break;
2461  case 2: // 1
2464  break;
2465  case 3: // 1
2468  break;
2469  case 4: // 3.0sigma, 1.0 sigma at high pt
2472  break;
2473  case 5: // 1
2476  break;
2477  case 6: // 1
2480  break;
2481  case 7: // 1
2484  break;
2485  case 8: // 1
2488  break;
2489  case 9:
2490  fPIDnSigmaAbovePionLine=1; // We need a bit less tight cut on dE/dx
2492  break;
2493  default:
2494  AliError(Form("Warning: pidedxSigmaCut not defined %d",pidedxSigmaCut));
2495  return kFALSE;
2496  }
2497  return kTRUE;
2498 }
2499 
2502  switch(piMomdedxSigmaCut){
2503  case 0: // 0.5 GeV
2505  break;
2506  case 1: // 1. GeV
2508  break;
2509  case 2: // 1.5 GeV
2511  break;
2512  case 3: // 20.0 GeV
2514  break;
2515  case 4: // 50.0 GeV
2517  break;
2518  case 5: // 0.3 GeV
2520  break;
2521  case 6: // 0.25 GeV
2523  break;
2524  case 7: // 0.4 GeV
2526  break;
2527  case 8: // 0.2 GeV
2529  break;
2530  default:
2531  AliError(Form("piMomdedxSigmaCut not defined %d",piMomdedxSigmaCut));
2532  return kFALSE;
2533  }
2534  return kTRUE;
2535 }
2536 
2539  switch(piMaxMomdedxSigmaCut){
2540  case 0: // 100. GeV
2542  break;
2543  case 1: // 5. GeV
2545  break;
2546  case 2: // 4. GeV
2548  break;
2549  case 3: // 3.5 GeV
2551  break;
2552  case 4: // 3. GeV
2554  break;
2555  case 5: // 7. GeV
2557  break;
2558  case 6: // 2. GeV
2560  break;
2561  default:
2562  AliError(Form("piMaxMomdedxSigmaCut not defined %d",piMaxMomdedxSigmaCut));
2563  return kFALSE;
2564  }
2565  return kTRUE;
2566 }
2567 
2570  switch(LowPRejectionSigmaCut){
2571  case 0: //
2575  fDoKaonRejectionLowP = kFALSE;
2576  fDoProtonRejectionLowP = kFALSE;
2577  fDoPionRejectionLowP = kFALSE;
2579  break;
2580  case 1: //
2584  fDoKaonRejectionLowP = kTRUE;
2585  fDoProtonRejectionLowP = kTRUE;
2586  fDoPionRejectionLowP = kTRUE;
2588  break;
2589  case 2: //
2593  fDoKaonRejectionLowP = kTRUE;
2594  fDoProtonRejectionLowP = kTRUE;
2595  fDoPionRejectionLowP = kTRUE;
2597  break;
2598  case 3: //
2602  fDoKaonRejectionLowP = kTRUE;
2603  fDoProtonRejectionLowP = kTRUE;
2604  fDoPionRejectionLowP = kTRUE;
2606  break;
2607  case 4: //
2611  fDoKaonRejectionLowP = kFALSE;
2612  fDoProtonRejectionLowP = kFALSE;
2613  fDoPionRejectionLowP = kTRUE;
2615  break;
2616  case 5: //
2620  fDoKaonRejectionLowP = kFALSE;
2621  fDoProtonRejectionLowP = kFALSE;
2622  fDoPionRejectionLowP = kTRUE;
2624  break;
2625  case 6: //
2629  fDoKaonRejectionLowP = kFALSE;
2630  fDoProtonRejectionLowP = kFALSE;
2631  fDoPionRejectionLowP = kTRUE;
2633  break;
2634  case 7: //
2638  fDoKaonRejectionLowP = kFALSE;
2639  fDoProtonRejectionLowP = kFALSE;
2640  fDoPionRejectionLowP = kTRUE;
2642  break;
2643  case 8: //
2647  fDoKaonRejectionLowP = kFALSE;
2648  fDoProtonRejectionLowP = kTRUE;
2649  fDoPionRejectionLowP = kFALSE;
2651  break;
2652  default:
2653  AliError(Form("LowPRejectionSigmaCut not defined %d",LowPRejectionSigmaCut));
2654  return kFALSE;
2655  }
2656  return kTRUE;
2657 }
2658 
2661  switch(kappaCut){
2662  case 0: // completely open
2663  fKappaMaxCut=200;
2664  fKappaMinCut=-200;
2665  break;
2666  case 1: // mainly pi pi
2667  fKappaMaxCut=-13;
2668  fKappaMinCut=-20;
2669  break;
2670  case 2: // mainly pi e
2671  fKappaMaxCut=-6;
2672  fKappaMinCut=-11;
2673  break;
2674  case 3: // signal
2675  fKappaMaxCut=5;
2676  fKappaMinCut=-3;
2677  break;
2678  case 4: // remaining
2679  fKappaMaxCut=20;
2680  fKappaMinCut=11;
2681  break;
2682  case 5: // -5-10 full signal peak(including background)
2683  fKappaMaxCut=10;
2684  fKappaMinCut=-5;
2685  break;
2686  case 6: //
2687  fKappaMaxCut=10;
2688  fKappaMinCut=-3;
2689  break;
2690  case 7: //
2691  fKappaMaxCut=10;
2692  fKappaMinCut=0;
2693  break;
2694  default:
2695  AliError("KappaTPCCut not defined");
2696  return kFALSE;
2697 
2698  }
2699  return kTRUE;
2700 }
2701 
2702 
2705  // Set Cut
2706  switch(TOFelectronPID){
2707  case 0: // no cut
2708  fUseTOFpid = kFALSE;
2711  break;
2712  case 1: // -7,7
2713  fUseTOFpid = kTRUE;
2716  break;
2717  case 2: // -5,5
2718  fUseTOFpid = kTRUE;
2721  break;
2722  case 3: // -3,5
2723  fUseTOFpid = kTRUE;
2726  break;
2727  case 4: // -2,3
2728  fUseTOFpid = kTRUE;
2731  break;
2732  case 5: // -3,3
2733  fUseTOFpid = kTRUE;
2736  break;
2737  default:
2738  AliError(Form("TOFElectronCut not defined %d",TOFelectronPID));
2739  return kFALSE;
2740  }
2741  return kTRUE;
2742 }
2743 
2746  // Set Cut
2747  switch(ITSelectronPID){
2748  case 0: // no cut
2749  fUseITSpid = kFALSE;
2752  fMaxPtPIDITS = 1.5;
2753  break;
2754  case 1: // -3,3
2755  fUseITSpid = kTRUE;
2758  fMaxPtPIDITS = 1.5;
2759  break;
2760  case 2: // -2,2
2761  fUseITSpid = kTRUE;
2764  fMaxPtPIDITS = 1.5;
2765  break;
2766  case 3: // -1,1
2767  fUseITSpid = kTRUE;
2770  fMaxPtPIDITS = 1.5;
2771  break;
2772  case 4: // -3,5
2773  fUseITSpid = kTRUE;
2776  fMaxPtPIDITS = 1.5;
2777  break;
2778  case 5: // -5,5
2779  fUseITSpid = kTRUE;
2782  fMaxPtPIDITS = 1.5;
2783  break;
2784  case 6: // -3,3
2785  fUseITSpid = kTRUE;
2788  fMaxPtPIDITS = 2;
2789  break;
2790  case 7: // -2,2
2791  fUseITSpid = kTRUE;
2794  fMaxPtPIDITS = 2;
2795  break;
2796  case 8: // -1,1
2797  fUseITSpid = kTRUE;
2800  fMaxPtPIDITS = 2;
2801  break;
2802  case 9: // -3,5
2803  fUseITSpid = kTRUE;
2806  fMaxPtPIDITS = 2;
2807  break;
2808  default:
2809  AliError(Form("ITSelectronPID not defined %d",ITSelectronPID));
2810  return kFALSE;
2811  }
2812  return kTRUE;
2813 }
2814 
2817  // Set Cut
2818  switch(TRDelectronPID){
2819  case 0: // no cut
2820  fDoTRDPID = kFALSE;
2821  fTRDPIDBelowCut=-100;
2822  fTRDPIDAboveCut=100;
2823  break;
2824  default:
2825  AliError(Form("TRDelectronPID not defined %d",TRDelectronPID));
2826  return kFALSE;
2827  }
2828  return kTRUE;
2829 }
2830 
2831 
2834  switch(QtMaxCut){
2835  case 0: //
2836  fQtMax=1.;
2837  fDoQtGammaSelection=kFALSE;
2838  fDo2DQt=kFALSE;
2839  break;
2840  case 1:
2841  fQtMax=0.1;
2842  fDo2DQt=kFALSE;
2843  break;
2844  case 2:
2845  fQtMax=0.06;
2846  fDo2DQt=kTRUE;
2847  break;
2848  case 3:
2849  fQtMax=0.05;
2850  fDo2DQt=kFALSE;
2851  break;
2852  case 4:
2853  fQtMax=0.03;
2854  fDo2DQt=kFALSE;
2855  break;
2856  case 5:
2857  fQtMax=0.02;
2858  fDo2DQt=kFALSE;
2859  break;
2860  case 6:
2861  fQtMax=0.02;
2862  fDo2DQt=kTRUE;
2863  break;
2864  case 7:
2865  fQtMax=0.15;
2866  fDo2DQt=kFALSE;
2867  break;
2868  case 8:
2869  fQtMax=0.05;
2870  fDo2DQt=kTRUE;
2871  break;
2872  case 9:
2873  fQtMax=0.03;
2874  fDo2DQt=kTRUE;
2875  break;
2876  default:
2877  AliError(Form("Warning: QtMaxCut not defined %d",QtMaxCut));
2878  return kFALSE;
2879  }
2880  return kTRUE;
2881 }
2882 
2885 
2886  switch(chi2GammaCut){
2887  case 0: // 100
2888  fChi2CutConversion = 100.;
2889  break;
2890  case 1: // 50
2891  fChi2CutConversion = 50.;
2892  break;
2893  case 2: // 30
2894  fChi2CutConversion = 30.;
2895  break;
2896  case 3:
2897  fChi2CutConversion = 200.;
2898  break;
2899  case 4:
2900  if (fIsHeavyIon==1){
2901  fChi2CutConversion = 7.;
2902  } else {
2903  fChi2CutConversion = 500.;
2904  }
2905  break;
2906  case 5:
2907  fChi2CutConversion = 100000.;
2908  break;
2909  case 6:
2910  fChi2CutConversion = 5.;
2911  break;
2912  case 7:
2913  fChi2CutConversion = 10.;
2914  break;
2915  case 8:
2916  fChi2CutConversion = 20.;
2917  break;
2918  case 9:
2919  fChi2CutConversion = 15.;
2920  break;
2921  case 10:
2922  fChi2CutConversion = 25.;
2923  break;
2924  default:
2925  AliError(Form("Warning: Chi2GammaCut not defined %d",chi2GammaCut));
2926  return kFALSE;
2927  }
2928  return kTRUE;
2929 }
2930 
2933  switch(psiCut) {
2934  case 0:
2935  fPsiPairCut = 10000; //
2936  break;
2937  case 1:
2938  fPsiPairCut = 0.1; //
2939  break;
2940  case 2:
2941  fPsiPairCut = 0.05; // Standard
2942  break;
2943  case 3:
2944  fPsiPairCut = 0.035; //
2945  break;
2946  case 4:
2947  fPsiPairCut = 0.2; //
2948  break;
2949  case 5:
2950  fPsiPairCut = 0.1; //
2951  fDo2DPsiPairChi2 = kTRUE;
2952  break;
2953  case 6:
2954  fPsiPairCut = 0.05; //
2955  fDo2DPsiPairChi2 = kTRUE;
2956  break;
2957  case 7:
2958  if (fIsHeavyIon==1){
2959  fPsiPairCut = 0.07; //
2960  } else {
2961  fPsiPairCut = 0.035; //
2962  }
2963  fDo2DPsiPairChi2 = kTRUE;
2964  break;
2965  case 8:
2966  fPsiPairCut = 0.2; //
2967  fDo2DPsiPairChi2 = kTRUE; //
2968  break;
2969  case 9:
2970  // if (fIsHeavyIon==1){ //AM 2016-05-13
2971  fPsiPairCut = 0.1; //
2972  fDo2DPsiPairChi2 = kTRUE;
2973  fIncludeRejectedPsiPair = kTRUE;
2974  break;
2975  // } else {
2976  // fPsiPairCut = 0.5; //
2977  // break;
2978  // }
2979  default:
2980  AliError(Form("PsiPairCut not defined %d",psiCut));
2981  return kFALSE;
2982  }
2983 
2984  return kTRUE;
2985 }
2986 
2989  // Set Cut
2990  switch(doPhotonAsymmetryCut){
2991  case 0:
2995  break;
2996  case 1:
2999  fMinPhotonAsymmetry=0.04;
3000  break;
3001  case 2:
3004  fMinPhotonAsymmetry=0.06;
3005  break;
3006  case 3:
3009  fMinPhotonAsymmetry=0.05;
3010  break;
3011  case 4:
3014  fFAsymmetryCut = new TF1("fFAsymmetryCut","[0] + [1]*tanh(2*TMath::Power(x,[2]))",0.,100.);
3015  fFAsymmetryCut->SetParameter(0,0.3);
3016  fFAsymmetryCut->SetParameter(1,0.66);
3017  fFAsymmetryCut->SetParameter(2,0.7);
3020  break;
3021  case 5:
3024  fFAsymmetryCut = new TF1("fFAsymmetryCut","[0] + [1]*tanh(2*TMath::Power(x,[2]))",0.,100.);
3025  fFAsymmetryCut->SetParameter(0,0.14);
3026  fFAsymmetryCut->SetParameter(1,0.66);
3027  fFAsymmetryCut->SetParameter(2,0.5);
3030  break;
3031  case 6:
3034  fMinPhotonAsymmetry=0.05;
3035  break;
3036  case 7:
3039  fMinPhotonAsymmetry=0.05;
3040  break;
3041  default:
3042  AliError(Form("PhotonAsymmetryCut not defined %d",doPhotonAsymmetryCut));
3043  return kFALSE;
3044  }
3045  fCuts[kdoPhotonAsymmetryCut]=doPhotonAsymmetryCut;
3046  return kTRUE;
3047 }
3048 
3051 
3052  switch(cosCut){
3053  case 0:
3054  fCosPAngleCut = -1;
3055  break;
3056  case 1:
3057  fCosPAngleCut = 0;
3058  break;
3059  case 2:
3060  fCosPAngleCut = 0.5;
3061  break;
3062  case 3:
3063  fCosPAngleCut = 0.75;
3064  break;
3065  case 4:
3066  fCosPAngleCut = 0.85;
3067  break;
3068  case 5:
3069  fCosPAngleCut = 0.88;
3070  break;
3071  case 6:
3072  fCosPAngleCut = 0.9;
3073  break;
3074  case 7:
3075  fCosPAngleCut = 0.95;
3076  break;
3077  default:
3078  AliError(Form("Cosine Pointing Angle cut not defined %d",cosCut));
3079  return kFALSE;
3080  }
3081 
3082  return kTRUE;
3083 }
3084 
3087 
3088  switch(sharedElec){
3089  case 0:
3090  fDoSharedElecCut = kFALSE;
3092  fPhotonQualityCut = 0;
3093  break;
3094  case 1:
3095  fDoSharedElecCut = kTRUE;
3097  fPhotonQualityCut = 0;
3098  break;
3099  case 2:
3100  fDoSharedElecCut = kFALSE;
3102  fPhotonQualityCut = 1;
3103  break;
3104  case 3:
3105  fDoSharedElecCut = kFALSE;
3107  fPhotonQualityCut = 2;
3108  break;
3109  case 4:
3110  fDoSharedElecCut = kFALSE;
3112  fPhotonQualityCut = 3;
3113  break;
3114  default:
3115  AliError(Form("Shared Electron Cut not defined %d",sharedElec));
3116  return kFALSE;
3117  }
3118 
3119  return kTRUE;
3120 }
3121 
3124 
3125  switch(toClose){
3126  case 0:
3127  fDoToCloseV0sCut = kFALSE;
3128  fminV0Dist = 250;
3129  break;
3130  case 1:
3131  fDoToCloseV0sCut = kTRUE;
3132  fminV0Dist = 1;
3133  break;
3134  case 2:
3135  fDoToCloseV0sCut = kTRUE;
3136  fminV0Dist = 2;
3137  break;
3138  case 3:
3139  fDoToCloseV0sCut = kTRUE;
3140  fminV0Dist = 3;
3141  break;
3142  case 4:
3143  fDoToCloseV0sCut = kTRUE;
3144  fDoDoubleCountingCut = kTRUE;
3145  fMinRDC=0.;
3146  fDeltaR=6.;
3147  fOpenAngle=0.02;
3148  break;
3149  case 5:
3150  fDoToCloseV0sCut = kTRUE;
3151  fDoDoubleCountingCut = kTRUE;
3152  fMinRDC=0.;
3153  fDeltaR=6.;
3154  fOpenAngle=0.03;
3155  break;
3156  case 6:
3157  fDoToCloseV0sCut = kTRUE;
3158  fDoDoubleCountingCut = kTRUE;
3159  fMinRDC=0.;
3160  fDeltaR=6.;
3161  fOpenAngle=0.04;
3162  break;
3163 
3164  default:
3165  AliError(Form("Shared Electron Cut not defined %d",toClose));
3166  return kFALSE;
3167  }
3168  return kTRUE;
3169 }
3170 
3173  switch(TRDElectronCut){
3174  case 0:
3175  fDoTRDPID=kFALSE;
3176  break;
3177  case 1:
3178  fDoTRDPID=kTRUE;
3179  fPIDTRDEfficiency=0.1;
3180  break;
3181  case 8:
3182  fDoTRDPID=kTRUE;
3183  fPIDTRDEfficiency=0.8;
3184  break;
3185  case 9:
3186  fDoTRDPID=kTRUE;
3187  fPIDTRDEfficiency=0.9;
3188  break;
3189  default:
3190  AliError(Form("TRDElectronCut not defined %d",TRDElectronCut));
3191  return kFALSE;
3192  }
3193 
3194  return kTRUE;
3195 }
3196 
3199  // Set Cut
3200  switch(DCAZPhotonPrimVtx){
3201  case 0: //
3202  fDCAZPrimVtxCut = 1000;
3203  break;
3204  case 1: //
3205  fDCAZPrimVtxCut = 10;
3206  break;
3207  case 2: //
3208  fDCAZPrimVtxCut = 5;
3209  break;
3210  case 3: //
3211  fDCAZPrimVtxCut = 4;
3212  break;
3213  case 4: //
3214  fDCAZPrimVtxCut = 3;
3215  break;
3216  case 5: //
3217  fDCAZPrimVtxCut = 2.5;
3218  break;
3219  case 6: //
3220  fDCAZPrimVtxCut = 2;
3221  break;
3222  case 7: //
3223  fDCAZPrimVtxCut = 1.5;
3224  break;
3225  case 8: //
3226  fDCAZPrimVtxCut = 1;
3227  break;
3228  case 9: //
3229  fDCAZPrimVtxCut = 0.5;
3230  break;
3231  default:
3232  cout<<"Warning: DCAZPhotonPrimVtx not defined "<<DCAZPhotonPrimVtx<<endl;
3233  return kFALSE;
3234  }
3235  return kTRUE;
3236 }
3237 
3240  // Set Cut
3241  switch(DCARPhotonPrimVtx){
3242  case 0: //
3243  fDCARPrimVtxCut = 1000;
3244  break;
3245  case 1: //
3246  fDCARPrimVtxCut = 10;
3247  break;
3248  case 2: //
3249  fDCARPrimVtxCut = 5;
3250  break;
3251  case 3: //
3252  fDCARPrimVtxCut = 4;
3253  break;
3254  case 4: //
3255  fDCARPrimVtxCut = 3;
3256  break;
3257  case 5: //
3258  fDCARPrimVtxCut = 2.5;
3259  break;
3260  case 6: //
3261  fDCARPrimVtxCut = 2;
3262  break;
3263  case 7: //
3264  fDCARPrimVtxCut = 1.5;
3265  break;
3266  case 8: //
3267  fDCARPrimVtxCut = 1;
3268  break;
3269  case 9: //
3270  fDCARPrimVtxCut = 0.5;
3271  break;
3272  default:
3273  cout<<"Warning: DCARPhotonPrimVtx not defined "<<DCARPhotonPrimVtx<<endl;
3274  return kFALSE;
3275  }
3276  return kTRUE;
3277 }
3278 
3281  // Set Cut
3282  switch(inOutPlane){
3283  case 0: //
3284  fInPlaneOutOfPlane = 0; // No Event Plane
3285  break;
3286  case 1: //
3287  fInPlaneOutOfPlane = 1; // In-Plane
3288  break;
3289  case 2: //
3290  fInPlaneOutOfPlane = 2; // Out-Of-Plane
3291  break;
3292  default:
3293  cout<<"Warning: In-Plane or Out-Of-Plane not defined "<<inOutPlane<<endl;
3294  return kFALSE;
3295  }
3296  return kTRUE;
3297 }
3298 
3299 
3302  // Get first TPC row
3303  Int_t firstTPCRow = 0;
3304  Double_t radiusI = 84.8;
3305  Double_t radiusO = 134.6;
3306  Double_t radiusOB = 198.;
3307  Double_t rSizeI = 0.75;
3308  Double_t rSizeO = 1.;
3309  Double_t rSizeOB = 1.5;
3310  Int_t nClsI = 63;
3311  Int_t nClsIO = 127;
3312 
3313  if(radius <= radiusI){
3314  return firstTPCRow;
3315  }
3316  if(radius>radiusI && radius<=radiusO){
3317  firstTPCRow = (Int_t)((radius-radiusI)/rSizeI);
3318  }
3319  if(radius>radiusO && radius<=radiusOB){
3320  firstTPCRow = (Int_t)(nClsI+(radius-radiusO)/rSizeO);
3321  }
3322 
3323  if(radius>radiusOB){
3324  firstTPCRow =(Int_t)(nClsIO+(radius-radiusOB)/rSizeOB);
3325  }
3326 
3327  return firstTPCRow;
3328 }
3329 
3333  if(GetCosineOfPointingAngle(photon, event) < fCosPAngleCut){
3334  return kFALSE;
3335  }
3336  return kTRUE;
3337 }
3338 
3341  // calculates the pointing angle of the recalculated V0
3342 
3343  Double_t momV0[3] = {0,0,0};
3344  if(event->IsA()==AliESDEvent::Class()){
3345  AliESDEvent *esdEvent = dynamic_cast<AliESDEvent*>(event);
3346  if(!esdEvent) return -999;
3347  AliESDv0 *v0 = esdEvent->GetV0(photon->GetV0Index());
3348  if(!v0) return -999;
3349  v0->GetPxPyPz(momV0[0],momV0[1],momV0[2]);
3350  }
3351  if(event->IsA()==AliAODEvent::Class()){
3352  momV0[0] = photon->GetPx();
3353  momV0[1] = photon->GetPy();
3354  momV0[2] = photon->GetPz();
3355  }
3356 
3357  //Double_t momV0[3] = { photon->GetPx(), photon->GetPy(), photon->GetPz() }; //momentum of the V0
3358  Double_t PosV0[3] = { photon->GetConversionX() - event->GetPrimaryVertex()->GetX(),
3359  photon->GetConversionY() - event->GetPrimaryVertex()->GetY(),
3360  photon->GetConversionZ() - event->GetPrimaryVertex()->GetZ() }; //Recalculated V0 Position vector
3361 
3362  Double_t momV02 = momV0[0]*momV0[0] + momV0[1]*momV0[1] + momV0[2]*momV0[2];
3363  Double_t PosV02 = PosV0[0]*PosV0[0] + PosV0[1]*PosV0[1] + PosV0[2]*PosV0[2];
3364 
3365 
3366  Double_t cosinePointingAngle = -999;
3367  if(momV02*PosV02 > 0.0)
3368  cosinePointingAngle = (PosV0[0]*momV0[0] + PosV0[1]*momV0[1] + PosV0[2]*momV0[2] ) / TMath::Sqrt(momV02 * PosV02);
3369 
3370  return cosinePointingAngle;
3371 }
3372 
3375 
3376  if (fDo2DPsiPairChi2){
3378  if (TMath::Abs(photon->GetPsiPair()) < -fPsiPairCut/fChi2CutConversion*photon->GetChi2perNDF() + fPsiPairCut || (photon->GetPsiPair()) == 4){
3379  return kTRUE;
3380  } else {
3381  return kFALSE;
3382  }
3383 
3384  } else {
3385  if (TMath::Abs(photon->GetPsiPair()) < -fPsiPairCut/fChi2CutConversion*photon->GetChi2perNDF() + fPsiPairCut ){
3386  return kTRUE;
3387  } else {
3388  return kFALSE;
3389  }
3390  }
3391  } else {
3393  if(TMath::Abs(photon->GetPsiPair()) > fPsiPairCut || (photon->GetPsiPair()) != 4){
3394  return kFALSE;
3395  } else {
3396  return kTRUE;
3397  }
3398  } else {
3399  if(TMath::Abs(photon->GetPsiPair()) > fPsiPairCut){
3400  return kFALSE;
3401  } else {
3402  return kTRUE;
3403  }
3404  }
3405  }
3406 }
3407 
3410  // returns TString with current cut number
3411  return fCutStringRead;
3412 }
3413 
3416 
3417  Int_t posLabel = photon->GetTrackLabelPositive();
3418  Int_t negLabel = photon->GetTrackLabelNegative();
3419 
3420  fElectronLabelArray[nV0*2] = posLabel;
3421  fElectronLabelArray[(nV0*2)+1] = negLabel;
3422 }
3423 
3426 
3427  Int_t posLabel = photon->GetTrackLabelPositive();
3428  Int_t negLabel = photon->GetTrackLabelNegative();
3429 
3430  for(Int_t i = 0; i<nV0s*2;i++){
3431  if(i==nV0*2) continue;
3432  if(i==(nV0*2)+1) continue;
3433  if(fElectronLabelArray[i] == posLabel){
3434  return kFALSE;}
3435  if(fElectronLabelArray[i] == negLabel){
3436  return kFALSE;}
3437  }
3438 
3439  return kTRUE;
3440 }
3441 
3444 
3445  if (fDoDoubleCountingCut && photon->GetConversionRadius() < fMinRDC) return kTRUE;
3446 
3447  Double_t posX = photon->GetConversionX();
3448  Double_t posY = photon->GetConversionY();
3449  Double_t posZ = photon->GetConversionZ();
3450 
3451  for(Int_t i = 0;i<photons->GetEntries();i++){
3452  if(nV0 == i) continue;
3453  AliAODConversionPhoton *photonComp = (AliAODConversionPhoton*) photons->At(i);
3454  Double_t posCompX = photonComp->GetConversionX();
3455  Double_t posCompY = photonComp->GetConversionY();
3456  Double_t posCompZ = photonComp->GetConversionZ();
3457 
3458  if (!fDoDoubleCountingCut){
3459  Double_t dist = pow((posX - posCompX),2)+pow((posY - posCompY),2)+pow((posZ - posCompZ),2);
3460 
3461  if(dist < fminV0Dist*fminV0Dist){
3462  if(photon->GetChi2perNDF() > photonComp->GetChi2perNDF()) return kFALSE;
3463  }
3464  }else{
3465  TVector3 v1(photon->Px(),photon->Py(),photon->Pz());
3466  TVector3 v2(photonComp->Px(),photonComp->Py(),photonComp->Pz());
3467  Double_t OpeningAngle=v1.Angle(v2);
3468  if( OpeningAngle < fOpenAngle && TMath::Abs(photon->GetConversionRadius()-photonComp->GetConversionRadius()) < fDeltaR){
3469  if(photon->GetChi2perNDF() > photonComp->GetChi2perNDF()) return kFALSE;
3470  }
3471  }
3472 
3473  }
3474  return kTRUE;
3475 }
3476 
3477 
3480  //Create and return standard 2010 PbPb cuts
3481  AliConversionPhotonCuts *cuts=new AliConversionPhotonCuts("StandardCuts2010PbPb","StandardCuts2010PbPb");
3482  if(!cuts->InitializeCutsFromCutString("04209297002322000000")){
3483  cout<<"Warning: Initialization of Standardcuts2010PbPb failed"<<endl;}
3484  return cuts;
3485 }
3486 
3489  //Create and return standard 2010 PbPb cuts
3490  AliConversionPhotonCuts *cuts=new AliConversionPhotonCuts("StandardCuts2010pp","StandardCuts2010pp");
3491  if(!cuts->InitializeCutsFromCutString("00209366300380000000")){
3492  cout<<"Warning: Initialization of Standardcuts2010pp failed"<<endl;}
3493  return cuts;
3494 }
3495 
3498 
3499  //GetPhotonPhi() 0-2 Pi //eventPlaneAngle -1pi-1pi
3500  eventPlaneAngle=eventPlaneAngle+TMath::Pi();
3501  Double_t gammaToEPAngle = eventPlaneAngle-photonPhi;
3502  if(gammaToEPAngle < 0) gammaToEPAngle=gammaToEPAngle+2*TMath::Pi();
3503  gammaToEPAngle = gammaToEPAngle-TMath::Pi(); // angle from -pi +pi
3504 
3505  if(!fInPlaneOutOfPlane){
3506  if(fill&&fHistoEventPlanePhi)fHistoEventPlanePhi->Fill(gammaToEPAngle);
3507  return kTRUE;
3508  }
3509  else if(fInPlaneOutOfPlane == 1){
3510  if(TMath::Abs(gammaToEPAngle)<=0.25*TMath::Pi() || TMath::Abs(gammaToEPAngle)>=0.75*TMath::Pi()){
3511  if(fill&&fHistoEventPlanePhi)fHistoEventPlanePhi->Fill(gammaToEPAngle);
3512  return kTRUE;
3513  }
3514  else return kFALSE;
3515  }
3516  else if(fInPlaneOutOfPlane == 2){
3517  if(TMath::Abs(gammaToEPAngle)>0.25*TMath::Pi() && TMath::Abs(gammaToEPAngle)<0.75*TMath::Pi()){
3518  if(fill&&fHistoEventPlanePhi)fHistoEventPlanePhi->Fill(gammaToEPAngle);
3519  return kTRUE;
3520  }
3521  else return kFALSE;
3522  }
3523  return kFALSE;
3524 }
3525 
3528 
3529  AliAODTrack * negTrack = static_cast<AliAODTrack*>(GetTrack(eventDummy, photon->GetTrackLabelNegative()));
3530  AliAODTrack * posTrack = static_cast<AliAODTrack*>(GetTrack(eventDummy, photon->GetTrackLabelPositive()));
3531 
3532  if(!negTrack || !posTrack) {
3533  return 0;
3534  }
3535  if(negTrack->Charge() == posTrack->Charge()){
3536  return 0;
3537  }
3538  Int_t nClusterITSneg = negTrack->GetITSNcls();
3539  Int_t nClusterITSpos = posTrack->GetITSNcls();
3540  // cout << nClusterITSneg << "\t" << nClusterITSpos <<endl;
3541 
3542  if (nClusterITSneg > 1 && nClusterITSpos > 1){
3543  return 3;
3544  } else if (nClusterITSneg > 1 || nClusterITSpos > 1){
3545  return 2;
3546  } else {
3547  return 1;
3548  }
3549  return 0;
3550 }
3551 
3554 
3555  TString nameProfile;
3556  if (flag==1){
3557  nameProfile = "profileContainingMaterialBudgetWeights_fewRadialBins";}
3558  else if (flag==2){
3559  nameProfile = "profileContainingMaterialBudgetWeights_manyRadialBins";}
3560  else {
3561  AliError(Form("%d not a valid flag for InitMaterialBudgetWeightingOfPi0Candidates()",flag));
3562  return kFALSE;
3563  }
3564  TFile* file = TFile::Open(filename.Data());
3565  if (!file) {
3566  AliError(Form("File %s for materialbudgetweights not found",filename.Data()));
3567  return kFALSE;
3568  }
3569  fProfileContainingMaterialBudgetWeights = (TProfile*)file->Get(nameProfile.Data());
3571  AliError(Form("Histogram %s not found in file",nameProfile.Data()));
3572  return kFALSE;
3573  }
3574  fProfileContainingMaterialBudgetWeights->SetDirectory(0);
3575  file->Close();
3576  delete file;
3577 
3579  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()));
3580  return kTRUE;
3581 }
3582 
3585 
3586  Float_t weight = 1.0;
3587  Float_t gammaConversionRadius = gamma->GetConversionRadius();
3588  Int_t bin = fProfileContainingMaterialBudgetWeights->FindBin(gammaConversionRadius);
3589  if (bin > 0 && bin <= fProfileContainingMaterialBudgetWeights->GetNbinsX()){
3590  weight = fProfileContainingMaterialBudgetWeights->GetBinContent(bin);
3591  }
3592  return weight;
3593 }
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
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.
ClassImp(AliAnalysisTaskDeltaPt) AliAnalysisTaskDeltaPt
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 PhotonIsSelectedMC(TParticle *particle, AliStack *fMCStack, Bool_t checkForConvertedGamma=kTRUE)
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)