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