AliPhysics  608b256 (608b256)
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 #include "AliDalitzAODESDMC.h"
58 #include "AliDalitzEventMC.h"
59 
60 class iostream;
61 
62 using namespace std;
63 
67 
68 const char* AliConversionPhotonCuts::fgkCutNames[AliConversionPhotonCuts::kNCuts] = {
69  "V0FinderType", // 0
70  "EtaCut", // 1
71  "MinRCut", // 2
72  "EtaForPhiCut", // 3
73  "MinPhiCut", // 4
74  "MaxPhiCut", // 5
75  "SinglePtCut", // 6
76  "ClsTPCCut", // 7
77  "ededxSigmaCut", // 8
78  "pidedxSigmaCut", // 9
79  "piMomdedxSigmaCut", // 10
80  "piMaxMomdedxSigmaCut", // 11
81  "LowPRejectionSigmaCut", // 12
82  "TOFelectronPID", // 13
83  "ITSelectronPID", // 14 -- new ITS PID
84  "TRDelectronPID", // 15 -- new TRD PID
85  "QtMaxCut", // 16
86  "Chi2GammaCut", // 17
87  "PsiPair", // 18
88  "DoPhotonAsymmetryCut", // 19
89  "CosinePointingAngle", // 20
90  "SharedElectronCuts", // 21
91  "RejectToCloseV0s", // 22
92  "DcaRPrimVtx", // 23
93  "DcaZPrimVtx", // 24
94  "EvetPlane" // 25
95 };
96 
97 
98 //________________________________________________________________________
100  AliAnalysisCuts(name,title),
101  fHistograms(NULL),
102  fPIDResponse(NULL),
103  fDoLightOutput(kFALSE),
104  fV0ReaderName("V0ReaderV1"),
105  fMaxR(200),
106  fMinR(0),
107  fEtaCut(0.9),
108  fEtaCutMin(-0.1),
109  fEtaForPhiCutMin(-10.),
110  fEtaForPhiCutMax(10.),
111  fMinPhiCut(0.),
112  fMaxPhiCut(100.),
113  fDoShrinkTPCAcceptance(kFALSE),
114  fPtCut(0.02),
115  fSinglePtCut(0),
116  fSinglePtCut2(0),
117  fDoAsymPtCut(kFALSE),
118  fMaxZ(1000),
119  fMinClsTPC(0.),
120  fMinClsTPCToF(0.),
121  fLineCutZRSlope(0.),
122  fLineCutZValue(0),
123  fLineCutZRSlopeMin(0.),
124  fLineCutZValueMin(0),
125  fChi2CutConversion(1000),
126  fPIDProbabilityCutNegativeParticle(0),
127  fPIDProbabilityCutPositiveParticle(0),
128  fDodEdxSigmaCut(kTRUE),
129  fDoTOFsigmaCut(kFALSE),
130  fPIDTRDEfficiency(1),
131  fDoTRDPID(kFALSE),
132  fPIDnSigmaAboveElectronLine(100),
133  fPIDnSigmaBelowElectronLine(-100),
134  fTofPIDnSigmaAboveElectronLine(100),
135  fTofPIDnSigmaBelowElectronLine(-100),
136  fPIDnSigmaAbovePionLine(0),
137  fPIDnSigmaAbovePionLineHighPt(-100),
138  fPIDMinPnSigmaAbovePionLine(0),
139  fPIDMaxPnSigmaAbovePionLine(0),
140  fDoKaonRejectionLowP(kFALSE),
141  fDoProtonRejectionLowP(kFALSE),
142  fDoPionRejectionLowP(kFALSE),
143  fPIDnSigmaAtLowPAroundKaonLine(0),
144  fPIDnSigmaAtLowPAroundProtonLine(0),
145  fPIDnSigmaAtLowPAroundPionLine(0),
146  fPIDMinPKaonRejectionLowP(1.5),
147  fPIDMinPProtonRejectionLowP(2),
148  fPIDMinPPionRejectionLowP(0),
149  fDoQtGammaSelection(kTRUE),
150  fDo2DQt(kFALSE),
151  fQtMax(100),
152  fNSigmaMass(0.),
153  fUseEtaMinCut(kFALSE),
154  fUseOnFlyV0Finder(kTRUE),
155  fUseOnFlyV0FinderSameSign(0),
156  fDoPhotonAsymmetryCut(kTRUE),
157  fDoPhotonPDependentAsymCut(kFALSE),
158  fFAsymmetryCut(0),
159  fMinPPhotonAsymmetryCut(100.),
160  fMinPhotonAsymmetry(0.),
161  fUseCorrectedTPCClsInfo(kFALSE),
162  fUseTOFpid(kFALSE),
163  fOpeningAngle(0.005),
164  fPsiPairCut(10000),
165  fDo2DPsiPairChi2(kFALSE),
166  fIncludeRejectedPsiPair(kFALSE),
167  fCosPAngleCut(10000),
168  fDoToCloseV0sCut(kFALSE),
169  fminV0Dist(200.),
170  fDoSharedElecCut(kFALSE),
171  fDoPhotonQualitySelectionCut(kFALSE),
172  fDoPhotonQualityRejectionCut(kFALSE),
173  fPhotonQualityCut(0),
174  fRandom(0),
175  fElectronArraySize(500),
176  fElectronLabelArray(NULL),
177  fDCAZPrimVtxCut(1000),
178  fDCARPrimVtxCut(1000),
179  fInPlaneOutOfPlane(0),
180  fConversionPointXArray(0.0),
181  fConversionPointYArray(0.0),
182  fConversionPointZArray(0.0),
183  fCutString(NULL),
184  fCutStringRead(""),
185  fIsHeavyIon(0),
186  fUseITSpid(kFALSE),
187  fITSPIDnSigmaAboveElectronLine(100),
188  fITSPIDnSigmaBelowElectronLine(-100),
189  fMaxPtPIDITS(1.5),
190  fTRDPIDAboveCut(100),
191  fTRDPIDBelowCut(-100),
192  fDoDoubleCountingCut(kFALSE),
193  fMinRDC(0.),
194  fDeltaR(0.),
195  fOpenAngle(0.),
196  fSwitchToKappa(kFALSE),
197  fKappaMinCut(-1),
198  fKappaMaxCut(1000),
199  fDoElecDeDxPostCalibration(kFALSE),
200  fHistoEtaDistV0s(NULL),
201  fHistoEtaDistV0sAfterdEdxCuts(NULL),
202  fHistodEdxCuts(NULL),
203  fHistoTPCdEdxbefore(NULL),
204  fHistoTPCdEdxafter(NULL),
205  fHistoTPCdEdxSigbefore(NULL),
206  fHistoTPCdEdxSigafter(NULL),
207  fHistoKappaafter(NULL),
208  fHistoTOFbefore(NULL),
209  fHistoTOFSigbefore(NULL),
210  fHistoTOFSigafter(NULL),
211  fHistoITSSigbefore(NULL),
212  fHistoITSSigafter(NULL),
213  fHistoPsiPairDeltaPhiafter(NULL),
214  fHistoTrackCuts(NULL),
215  fHistoPhotonCuts(NULL),
216  fHistoInvMassbefore(NULL),
217  fHistoArmenterosbefore(NULL),
218  fHistoInvMassafter(NULL),
219  fHistoArmenterosafter(NULL),
220  fHistoAsymmetrybefore(NULL),
221  fHistoAsymmetryafter(NULL),
222  fHistoAcceptanceCuts(NULL),
223  fHistoCutIndex(NULL),
224  fHistoEventPlanePhi(NULL),
225  fPreSelCut(kFALSE),
226  fProcessAODCheck(kFALSE),
227  fMaterialBudgetWeightsInitialized(kFALSE),
228  fProfileContainingMaterialBudgetWeights(NULL),
229  fElecDeDxPostCalibrationInitialized(kFALSE),
230  fnRBins(4),
231  fHistoEleMapMean(NULL),
232  fHistoEleMapWidth(NULL),
233  fHistoPosMapMean(NULL),
234  fHistoPosMapWidth(NULL)
235 {
236  InitPIDResponse();
237  for(Int_t jj=0;jj<kNCuts;jj++){fCuts[jj]=0;}
238  fCutString=new TObjString((GetCutNumber()).Data());
239 
241 
242  fHistoEleMapMean = new TH2F*[fnRBins];
244  fHistoPosMapMean = new TH2F*[fnRBins];
246 
247  for (Int_t i = 0; i < fnRBins; i++) {
248  fHistoEleMapMean[i] = NULL;
249  fHistoEleMapWidth[i] = NULL;
250  fHistoPosMapMean[i] = NULL;
251  fHistoPosMapWidth[i] = NULL;
252  }
253 }
254 
255 //________________________________________________________________________
257  AliAnalysisCuts(ref),
258  fHistograms(NULL),
259  fPIDResponse(NULL),
261  fV0ReaderName("V0ReaderV1"),
262  fMaxR(ref.fMaxR),
263  fMinR(ref.fMinR),
264  fEtaCut(ref.fEtaCut),
265  fEtaCutMin(ref.fEtaCutMin),
268  fMinPhiCut(ref.fMinPhiCut),
269  fMaxPhiCut(ref.fMaxPhiCut),
271  fPtCut(ref.fPtCut),
275  fMaxZ(ref.fMaxZ),
276  fMinClsTPC(ref.fMinClsTPC),
288  fDoTRDPID(ref.fDoTRDPID),
307  fDo2DQt(ref.fDo2DQt),
308  fQtMax(ref.fQtMax),
319  fUseTOFpid(ref.fUseTOFpid),
326  fminV0Dist(ref.fminV0Dist),
331  fRandom(ref.fRandom),
333  fElectronLabelArray(NULL),
340  fCutString(NULL),
341  fCutStringRead(""),
343  fUseITSpid(ref.fUseITSpid),
350  fMinRDC(ref.fMinRDC),
351  fDeltaR(ref.fDeltaR),
352  fOpenAngle(ref.fOpenAngle),
357  fHistoEtaDistV0s(NULL),
359  fHistodEdxCuts(NULL),
360  fHistoTPCdEdxbefore(NULL),
361  fHistoTPCdEdxafter(NULL),
363  fHistoTPCdEdxSigafter(NULL),
364  fHistoKappaafter(NULL),
365  fHistoTOFbefore(NULL),
366  fHistoTOFSigbefore(NULL),
367  fHistoTOFSigafter(NULL),
368  fHistoITSSigbefore(NULL),
369  fHistoITSSigafter(NULL),
371  fHistoTrackCuts(NULL),
372  fHistoPhotonCuts(NULL),
373  fHistoInvMassbefore(NULL),
375  fHistoInvMassafter(NULL),
376  fHistoArmenterosafter(NULL),
377  fHistoAsymmetrybefore(NULL),
378  fHistoAsymmetryafter(NULL),
379  fHistoAcceptanceCuts(NULL),
380  fHistoCutIndex(NULL),
381  fHistoEventPlanePhi(NULL),
382  fPreSelCut(ref.fPreSelCut),
387  fnRBins(ref.fnRBins),
392 {
393  // Copy Constructor
394  for(Int_t jj=0;jj<kNCuts;jj++){fCuts[jj]=ref.fCuts[jj];}
395  fCutString=new TObjString((GetCutNumber()).Data());
397  // dont copy histograms (if you like histograms, call InitCutHistograms())
398 }
399 
400 
401 //________________________________________________________________________
403  // Destructor
404  //Deleting fHistograms leads to seg fault it it's added to output collection of a task
405  // if(fHistograms)
406  // delete fHistograms;
407  // fHistograms = NULL;
408  if(fCutString != NULL){
409  delete fCutString;
410  fCutString = NULL;
411  }
413  delete fElectronLabelArray;
414  fElectronLabelArray = NULL;
415  }
416 
417  if(fFAsymmetryCut != NULL){
418  delete fFAsymmetryCut;
419  fFAsymmetryCut = NULL;
420  }
424  }
425 
426  // if( fHistoEleMapMean != NULL){
427  // delete fHistoEleMapMean;
428  // fHistoEleMapMean =NULL;
429  // }
430 
431  for (Int_t i = 0; i < fnRBins; i++) {
432  if( fHistoEleMapMean[i] != NULL){
433  delete fHistoEleMapMean[i] ;
434  fHistoEleMapMean[i] =NULL;
435  }
436  if( fHistoEleMapWidth[i] != NULL){
437  delete fHistoEleMapWidth[i] ;
438  fHistoEleMapWidth[i] =NULL;
439  }
440 
441  if( fHistoPosMapMean[i] != NULL){
442  delete fHistoPosMapMean[i] ;
443  fHistoPosMapMean[i] =NULL;
444  }
445  if( fHistoPosMapWidth[i] != NULL){
446  delete fHistoPosMapWidth[i] ;
447  fHistoPosMapWidth[i] =NULL;
448  }
449 
450  }
451 
452 
453 }
454 
455 //________________________________________________________________________
457 
458  // Initialize Cut Histograms for QA (only initialized and filled if function is called)
459  TH1::AddDirectory(kFALSE);
460 
461  if(fHistograms != NULL){
462  delete fHistograms;
463  fHistograms=NULL;
464  }
465  if(fHistograms==NULL){
466  fHistograms=new TList();
467  fHistograms->SetOwner(kTRUE);
468  if(name=="")fHistograms->SetName(Form("ConvCuts_%s",GetCutNumber().Data()));
469  else fHistograms->SetName(Form("%s_%s",name.Data(),GetCutNumber().Data()));
470  }
471 
472  // IsPhotonSelected
473  fHistoCutIndex=new TH1F(Form("IsPhotonSelected %s",GetCutNumber().Data()),"IsPhotonSelected",12,-0.5,11.5);
474  fHistoCutIndex->GetXaxis()->SetBinLabel(kPhotonIn+1,"in");
475  fHistoCutIndex->GetXaxis()->SetBinLabel(kOnFly+1,"onfly");
476  fHistoCutIndex->GetXaxis()->SetBinLabel(kNoTracks+1,"no tracks");
477  fHistoCutIndex->GetXaxis()->SetBinLabel(kNoV0+1,"miss. V0 in AOD");
478  if (!fSwitchToKappa)fHistoCutIndex->GetXaxis()->SetBinLabel(kdEdxCuts+1,"PID");
479  else fHistoCutIndex->GetXaxis()->SetBinLabel(kdEdxCuts+1,"Kappa+[TOF,ITS,TRD] PID");
480  fHistoCutIndex->GetXaxis()->SetBinLabel(kTrackCuts+1,"Track cuts");
481  fHistoCutIndex->GetXaxis()->SetBinLabel(kConvPointFail+1,"ConvPoint fail");
482  fHistoCutIndex->GetXaxis()->SetBinLabel(kPhotonCuts+1,"PhotonCuts");
483  fHistoCutIndex->GetXaxis()->SetBinLabel(kEventPlane+1,"EventPlane");
484  fHistoCutIndex->GetXaxis()->SetBinLabel(kPhotonOut+1,"out");
486 
487  // Track Cuts
488  fHistoTrackCuts=new TH1F(Form("TrackCuts %s",GetCutNumber().Data()),"TrackCuts",9,-0.5,8.5);
489  fHistoTrackCuts->GetXaxis()->SetBinLabel(1,"in");
490  fHistoTrackCuts->GetXaxis()->SetBinLabel(2,"likesign");
491  fHistoTrackCuts->GetXaxis()->SetBinLabel(3,"ntpccl");
492  fHistoTrackCuts->GetXaxis()->SetBinLabel(4,"acceptance");
493  fHistoTrackCuts->GetXaxis()->SetBinLabel(5,"singlept");
494  fHistoTrackCuts->GetXaxis()->SetBinLabel(6,"TPCrefit");
495  fHistoTrackCuts->GetXaxis()->SetBinLabel(7,"kink");
496  fHistoTrackCuts->GetXaxis()->SetBinLabel(8,"out");
498 
499  // Photon Cuts
500  fHistoPhotonCuts=new TH2F(Form("PhotonCuts %s",GetCutNumber().Data()),"PhotonCuts vs p_{T,#gamma}",15,-0.5,14.5,250,0,50);
501  fHistoPhotonCuts->GetXaxis()->SetBinLabel(1,"in");
502  fHistoPhotonCuts->GetXaxis()->SetBinLabel(2,"qtcut");
503  fHistoPhotonCuts->GetXaxis()->SetBinLabel(3,"chi2");
504  fHistoPhotonCuts->GetXaxis()->SetBinLabel(4,"acceptance");
505  fHistoPhotonCuts->GetXaxis()->SetBinLabel(5,"asymmetry");
506  fHistoPhotonCuts->GetXaxis()->SetBinLabel(6,"pidprob");
507  fHistoPhotonCuts->GetXaxis()->SetBinLabel(7,"cortpcclinfo");
508  fHistoPhotonCuts->GetXaxis()->SetBinLabel(8,"PsiPair");
509  fHistoPhotonCuts->GetXaxis()->SetBinLabel(9,"CosPAngle");
510  fHistoPhotonCuts->GetXaxis()->SetBinLabel(10,"DCA R");
511  fHistoPhotonCuts->GetXaxis()->SetBinLabel(11,"DCA Z");
512  fHistoPhotonCuts->GetXaxis()->SetBinLabel(12,"Photon Quality");
513  fHistoPhotonCuts->GetXaxis()->SetBinLabel(13,"out");
515 
517  fProfileContainingMaterialBudgetWeights->SetName("InputMaterialBudgetWeightsPerGamma");
519  }
520 
522  for (Int_t i = 0; i < fnRBins; i++) {
523  if( fHistoEleMapMean[i] ){
524  fHistograms->Add(fHistoEleMapMean[i]);
525  }
526  if( fHistoEleMapWidth[i]){
528  }
529  if(fHistoPosMapMean[i]){
530  fHistograms->Add(fHistoPosMapMean[i]);
531  }
532  if( fHistoPosMapWidth[i]){
534  }
535  }
536  }
537 
538  if(!fDoLightOutput){
539 
540  if(preCut){
541  fHistoInvMassbefore=new TH1F(Form("InvMass_before %s",GetCutNumber().Data()),"InvMass_before",1000,0,0.3);
543  fHistoArmenterosbefore=new TH2F(Form("Armenteros_before %s",GetCutNumber().Data()),"Armenteros_before",200,-1,1,1000,0,1.);
545  fHistoEtaDistV0s = new TH1F(Form("Eta_before %s",GetCutNumber().Data()),"Eta_before",2000,-2,2);
547  fHistoAsymmetrybefore=new TH2F(Form("Asymmetry_before %s",GetCutNumber().Data()),"Asymmetry_before",150,0.03,20.,200,0,1.);
549  }
550  fHistoInvMassafter=new TH1F(Form("InvMass_after %s",GetCutNumber().Data()),"InvMass_after",1000,0,0.3);
552  fHistoArmenterosafter=new TH2F(Form("Armenteros_after %s",GetCutNumber().Data()),"Armenteros_after",200,-1,1,250,0,0.25);
554  // AM - save always to see distribution after selections cut
555  // if(fDoPhotonAsymmetryCut){
556  fHistoAsymmetryafter=new TH2F(Form("Asymmetry_after %s",GetCutNumber().Data()),"Asymmetry_after",150,0.03,20.,200,0,1.);
558  // }
559  }
560 
561  fHistoAcceptanceCuts=new TH2F(Form("PhotonAcceptanceCuts %s",GetCutNumber().Data()),"PhotonAcceptanceCuts vs p_{T,#gamma}",11,-0.5,10.5,250,0,50);
562  fHistoAcceptanceCuts->GetXaxis()->SetBinLabel(1,"in");
563  fHistoAcceptanceCuts->GetXaxis()->SetBinLabel(2,"maxR");
564  fHistoAcceptanceCuts->GetXaxis()->SetBinLabel(3,"minR");
565  fHistoAcceptanceCuts->GetXaxis()->SetBinLabel(4,"line");
566  fHistoAcceptanceCuts->GetXaxis()->SetBinLabel(5,"maxZ");
567  fHistoAcceptanceCuts->GetXaxis()->SetBinLabel(6,"eta");
568  fHistoAcceptanceCuts->GetXaxis()->SetBinLabel(7,"phisector");
569  fHistoAcceptanceCuts->GetXaxis()->SetBinLabel(8,"minpt");
570  fHistoAcceptanceCuts->GetXaxis()->SetBinLabel(9,"out");
572 
573  // dEdx Cuts
574  fHistodEdxCuts=new TH2F(Form("dEdxCuts %s",GetCutNumber().Data()),"dEdxCuts vs p_{T,e}",11,-0.5,10.5,250,0,50);
575  fHistodEdxCuts->GetXaxis()->SetBinLabel(1,"in");
576  fHistodEdxCuts->GetXaxis()->SetBinLabel(2,"TPCelectron");
577  fHistodEdxCuts->GetXaxis()->SetBinLabel(3,"TPCpion");
578  fHistodEdxCuts->GetXaxis()->SetBinLabel(4,"TPCpionhighp");
579  fHistodEdxCuts->GetXaxis()->SetBinLabel(5,"TPCkaonlowprej");
580  fHistodEdxCuts->GetXaxis()->SetBinLabel(6,"TPCprotonlowprej");
581  fHistodEdxCuts->GetXaxis()->SetBinLabel(7,"TPCpionlowprej");
582  fHistodEdxCuts->GetXaxis()->SetBinLabel(8,"TOFelectron");
583  fHistodEdxCuts->GetXaxis()->SetBinLabel(9,"ITSelectron");
584  fHistodEdxCuts->GetXaxis()->SetBinLabel(10,"TRDelectron");
585  fHistodEdxCuts->GetXaxis()->SetBinLabel(11,"out");
587 
588  if(!fDoLightOutput){
589  TAxis *AxisBeforedEdx = NULL;
590  TAxis *AxisBeforedEdxSig = NULL;
591  TAxis *AxisBeforeTOF = NULL;
592  TAxis *AxisBeforeTOFSig = NULL;
593  TAxis *AxisBeforeITSSig = NULL;
594  TAxis *AxisBeforeAsymmetry = NULL;
595 
596  if(preCut){
597  fHistoTPCdEdxbefore=new TH2F(Form("Gamma_dEdx_before %s",GetCutNumber().Data()),"dEdx Gamma before" ,150,0.03,20,800,0,200);
599  AxisBeforedEdx = fHistoTPCdEdxbefore->GetXaxis();
600  fHistoTPCdEdxSigbefore=new TH2F(Form("Gamma_dEdxSig_before %s",GetCutNumber().Data()),"dEdx Sigma Gamma before" ,150,0.03,20,400,-10,10);
602  AxisBeforedEdxSig = fHistoTPCdEdxSigbefore->GetXaxis();
603 
604  fHistoTOFbefore=new TH2F(Form("Gamma_TOF_before %s",GetCutNumber().Data()),"TOF Gamma before" ,150,0.03,20,11000,-1000,10000);
606  AxisBeforeTOF = fHistoTOFbefore->GetXaxis();
607  fHistoTOFSigbefore=new TH2F(Form("Gamma_TOFSig_before %s",GetCutNumber().Data()),"TOF Sigma Gamma before" ,150,0.03,20,400,-6,10);
609  AxisBeforeTOFSig = fHistoTOFSigbefore->GetXaxis();
610 
611  fHistoITSSigbefore=new TH2F(Form("Gamma_ITSSig_before %s",GetCutNumber().Data()),"ITS Sigma Gamma before" ,150,0.03,20,400,-10,10);
613  AxisBeforeITSSig = fHistoITSSigbefore->GetXaxis();
614 
615  AxisBeforeAsymmetry = fHistoAsymmetrybefore->GetXaxis();
616  }
617 
618  fHistoTPCdEdxSigafter=new TH2F(Form("Gamma_dEdxSig_after %s",GetCutNumber().Data()),"dEdx Sigma Gamma after" ,150,0.03,20,400, -10,10);
620 
621  fHistoTPCdEdxafter=new TH2F(Form("Gamma_dEdx_after %s",GetCutNumber().Data()),"dEdx Gamma after" ,150,0.03,20,800,0,200);
623 
624  fHistoKappaafter=new TH2F(Form("Gamma_Kappa_after %s",GetCutNumber().Data()),"Kappa Gamma after" ,150,0.03,20,200,-20,20);
626 
627  fHistoTOFSigafter=new TH2F(Form("Gamma_TOFSig_after %s",GetCutNumber().Data()),"TOF Sigma Gamma after" ,150,0.03,20,400,-6,10);
629 
630  fHistoITSSigafter=new TH2F(Form("Gamma_ITSSig_after %s",GetCutNumber().Data()),"ITS Sigma Gamma after" ,150,0.03,20,400,-10,10);
632 
633  fHistoEtaDistV0sAfterdEdxCuts = new TH1F(Form("Eta_afterdEdx %s",GetCutNumber().Data()),"Eta_afterdEdx",2000,-2,2);
635 
636  fHistoPsiPairDeltaPhiafter=new TH2F(Form("Gamma_PsiPairDeltaPhi_after %s",GetCutNumber().Data()),"Psi Pair vs Delta Phi Gamma after" ,200,-2,2,200,-2,2);
638 
639  TAxis *AxisAfter = fHistoTPCdEdxSigafter->GetXaxis();
640  Int_t bins = AxisAfter->GetNbins();
641  Double_t from = AxisAfter->GetXmin();
642  Double_t to = AxisAfter->GetXmax();
643  Double_t *newBins = new Double_t[bins+1];
644  newBins[0] = from;
645  Double_t factor = TMath::Power(to/from, 1./bins);
646  for(Int_t i=1; i<=bins; ++i) newBins[i] = factor * newBins[i-1];
647  AxisAfter->Set(bins, newBins);
648  AxisAfter = fHistoTOFSigafter->GetXaxis();
649  AxisAfter->Set(bins, newBins);
650  AxisAfter = fHistoTPCdEdxafter->GetXaxis();
651  AxisAfter->Set(bins, newBins);
652  AxisAfter = fHistoKappaafter->GetXaxis();
653  AxisAfter->Set(bins, newBins);
654  AxisAfter = fHistoITSSigafter->GetXaxis();
655  AxisAfter->Set(bins, newBins);
656  // if(fDoPhotonAsymmetryCut){
657  AxisAfter = fHistoAsymmetryafter->GetXaxis();
658  AxisAfter->Set(bins, newBins);
659  // }
660  if(preCut){
661  AxisBeforedEdx->Set(bins, newBins);
662  AxisBeforeTOF->Set(bins, newBins);
663  AxisBeforedEdxSig->Set(bins, newBins);
664  AxisBeforeTOFSig->Set(bins, newBins);
665  AxisBeforeITSSig->Set(bins, newBins);
666  AxisBeforeAsymmetry->Set(bins, newBins);
667  }
668  delete [] newBins;
669 
670  // Event Cuts and Info
671  if(!preCut){
672  fHistoEventPlanePhi=new TH1F(Form("EventPlaneMinusPhotonAngle %s",GetCutNumber().Data()),"EventPlaneMinusPhotonAngle",360,-TMath::Pi(),TMath::Pi());
674  }
675  }
676 
677  TH1::AddDirectory(kTRUE);
678 }
679 
680 //________________________________________________________________________
682  // Set Pointer to AliPIDResponse
683 
684  AliAnalysisManager *man=AliAnalysisManager::GetAnalysisManager();
685  if(man) {
686  AliInputEventHandler* inputHandler = (AliInputEventHandler*) (man->GetInputEventHandler());
687  fPIDResponse = (AliPIDResponse*)inputHandler->GetPIDResponse();
688  if(fPIDResponse)return kTRUE;
689 
690  }
691 
692 
693  return kFALSE;
694 }
697 
698  AliInfo("Entering loading of correction map for post calibration");
699 
700  TFile *file = TFile::Open(filename.Data());
701  if(!file){
702  AliError(Form("file for electron dEdx post calibration %s not found",filename.Data()));
703  return kFALSE;
704  }else{
705  AliInfo(Form("found %s ",filename.Data()));
706  }
707 
708  for(Int_t i=0;i<fnRBins;i++){
709  fHistoEleMapMean[i] = (TH2F*)file->Get(Form("Ele_R%d_mean",i));
710  fHistoEleMapWidth[i] = (TH2F*)file->Get(Form("Ele_R%d_width",i));
711  fHistoPosMapMean[i] = (TH2F*)file->Get(Form("Pos_R%d_mean",i));
712  fHistoPosMapWidth[i] = (TH2F*)file->Get(Form("Pos_R%d_width",i));
713  }
714  if (fHistoEleMapMean[0] == NULL || fHistoEleMapWidth[0] == NULL ||
715  fHistoEleMapMean[1] == NULL || fHistoEleMapWidth[1] == NULL ||
716  fHistoEleMapMean[2] == NULL || fHistoEleMapWidth[2] == NULL ||
717  fHistoEleMapMean[3] == NULL || fHistoEleMapWidth[3] == NULL ){
718  AliError("Histograms for dedx post calibration not found not found");
719  return kFALSE;// do nothing if correction map is not avaible
720  }
721  for(Int_t i=0;i<fnRBins;i++){
722  fHistoEleMapMean[i] ->SetDirectory(0);
723  fHistoEleMapWidth[i] ->SetDirectory(0);
724  fHistoPosMapMean[i] ->SetDirectory(0);
725  fHistoPosMapWidth[i] ->SetDirectory(0);
726  }
727 
728  file->Close();
729  delete file;
731  return kTRUE;
732 }
733 //_________________________________________________________________________
735 
736  Double_t Charge = charge;
737  Double_t CornSig = nsig;
738  Double_t mean = 1.;
739  Double_t width = 1.;
740  //X axis 12 Y axis 18 ... common for all R slice
741  Int_t BinP=4; // default value
742  Int_t BinEta=9; // default value
743 
744  if(Charge<0){
745  if (fHistoEleMapMean[0] == NULL || fHistoEleMapWidth[0] == NULL ||
746  fHistoEleMapMean[1] == NULL || fHistoEleMapWidth[1] == NULL ||
747  fHistoEleMapMean[2] == NULL || fHistoEleMapWidth[2] == NULL ||
748  fHistoEleMapMean[3] == NULL || fHistoEleMapWidth[3] == NULL ){
749  cout<< " histograms are null..., going out"<< endl;
750  return CornSig;// do nothing if correction map is not avaible
751  }
752 
753  BinP = fHistoEleMapMean[0]->GetXaxis()->FindBin(P);
754  BinEta = fHistoEleMapMean[0]->GetYaxis()->FindBin(Eta);
755 
756 
757 
758  if( R > 0. && R < 33.5){//0,33.5,72,145., 180 cm
759  if(P>0. && P<10.){
760  mean = fHistoEleMapMean[0]->GetBinContent(BinP,BinEta);
761  width = fHistoEleMapWidth[0]->GetBinContent(BinP,BinEta);
762  }else if(P>=10.){// use bin edge value
763  mean = fHistoEleMapMean[0]->GetBinContent(12,BinEta);;
764  width = fHistoEleMapWidth[0]->GetBinContent(12,BinEta);
765  }
766  }else if( R >= 30.5 && R < 72.){
767  if(P>0. && P<10.){
768  mean = fHistoEleMapMean[1]->GetBinContent(BinP,BinEta);
769  width = fHistoEleMapWidth[1]->GetBinContent(BinP,BinEta);
770  }else if(P>=10.){// use bin edge value
771  mean = fHistoEleMapMean[1]->GetBinContent(12,BinEta);
772  width = fHistoEleMapWidth[1]->GetBinContent(12,BinEta);
773  }
774  }else if( R >= 72. && R < 145.){
775  if(P>0. && P<10.){
776  mean = fHistoEleMapMean[2]->GetBinContent(BinP,BinEta);
777  width = fHistoEleMapWidth[2]->GetBinContent(BinP,BinEta);
778  }else if(P>=10.){// use bin edge value
779  mean = fHistoEleMapMean[2]->GetBinContent(12,BinEta);
780  width = fHistoEleMapWidth[2]->GetBinContent(12,BinEta);
781  }
782  }else if( R >= 145. && R < 180.){
783  if(P>0. && P<10.){
784  mean = fHistoEleMapMean[3]->GetBinContent(BinP,BinEta);
785  width = fHistoEleMapWidth[3]->GetBinContent(BinP,BinEta);
786  }else if(P>=10.){// use bin edge value
787  mean = fHistoEleMapMean[3]->GetBinContent(12,BinEta);
788  width = fHistoEleMapWidth[3]->GetBinContent(12,BinEta);
789  }
790  }else{
791  mean = 0.;
792  width = 1.;
793  }
794  }else{
795  //X axis 12 Y axis 18 ... common for all R slice
796  if (fHistoPosMapMean[0] == NULL || fHistoPosMapWidth[0] == NULL ||
797  fHistoPosMapMean[1] == NULL || fHistoPosMapWidth[1] == NULL ||
798  fHistoPosMapMean[2] == NULL || fHistoPosMapWidth[2] == NULL ||
799  fHistoPosMapMean[3] == NULL || fHistoPosMapWidth[3] == NULL ){
800  cout<< " histograms are null..., going out"<< endl;
801  return CornSig;// do nothing if correction map is not avaible
802  }
803 
804  BinP = fHistoPosMapMean[0]->GetXaxis()->FindBin(P);
805  BinEta = fHistoPosMapMean[0]->GetYaxis()->FindBin(Eta);
806 
807  if( R > 0. && R < 33.5){//0,33.5,72.,145.,180. cm
808  if(P>0. && P<10.){
809  mean = fHistoPosMapMean[0]->GetBinContent(BinP,BinEta);
810  width = fHistoPosMapWidth[0]->GetBinContent(BinP,BinEta);
811  }else if(P>=10.){// use bin edge value
812  mean = fHistoPosMapMean[0]->GetBinContent(12,BinEta);;
813  width = fHistoPosMapWidth[0]->GetBinContent(12,BinEta);
814  }
815  }else if( R >= 33.5 && R < 72.){
816  if(P>0. && P<10.){
817  mean = fHistoPosMapMean[1]->GetBinContent(BinP,BinEta);
818  width = fHistoPosMapWidth[1]->GetBinContent(BinP,BinEta);
819  }else if(P>=10.){// use bin edge value
820  mean = fHistoPosMapMean[1]->GetBinContent(12,BinEta);
821  width = fHistoPosMapWidth[1]->GetBinContent(12,BinEta);
822  }
823  }else if( R >= 72. && R < 145.){
824  if(P>0. && P<10.){
825  mean = fHistoPosMapMean[2]->GetBinContent(BinP,BinEta);
826  width = fHistoPosMapWidth[2]->GetBinContent(BinP,BinEta);
827  }else if(P>=10.){// use bin edge value
828  mean = fHistoPosMapMean[2]->GetBinContent(12,BinEta);
829  width = fHistoPosMapWidth[2]->GetBinContent(12,BinEta);
830  }
831  }else if( R >= 145. && R < 180.){
832  if(P>0. && P<10.){
833  mean = fHistoPosMapMean[3]->GetBinContent(BinP,BinEta);
834  width = fHistoPosMapWidth[3]->GetBinContent(BinP,BinEta);
835  }else if(P>=10.){// use bin edge value
836  mean = fHistoPosMapMean[3]->GetBinContent(12,BinEta);
837  width = fHistoPosMapWidth[3]->GetBinContent(12,BinEta);
838  }
839  }else{
840  mean = 0.;
841  width = 1.;
842  }
843  }
844  if (width!=0.){
845  CornSig = (nsig - mean) / width;
846  }
847  return CornSig;
848 }
850 Bool_t AliConversionPhotonCuts::PhotonIsSelectedMC(TParticle *particle,AliMCEvent *mcEvent,Bool_t checkForConvertedGamma){
851  // MonteCarlo Photon Selection
852 
853  if(!mcEvent)return kFALSE;
854 
855  if (particle->GetPdgCode() == 22){
856 
857 
858  if( particle->Eta() > (fEtaCut) || particle->Eta() < (-fEtaCut) )
859  return kFALSE;
860  if(fEtaCutMin>-0.1){
861  if( particle->Eta() < (fEtaCutMin) && particle->Eta() > (-fEtaCutMin) )
862  return kFALSE;
863  }
864 
865  if(particle->GetMother(0) >-1 && mcEvent->Particle(particle->GetMother(0))->GetPdgCode() == 22){
866  return kFALSE; // no photon as mothers!
867  }
868 
869  // removed, decision on primary and secondary taken in main task
870 // if(particle->GetMother(0) >= mcEvent->GetNumberOfPrimaries()){
871 // return kFALSE; // the gamma has a mother, and it is not a primary particle
872 // }
873 
874  if(!checkForConvertedGamma) return kTRUE; // return in case of accepted gamma
875 
876  // looking for conversion gammas (electron + positron from pairbuilding (= 5) )
877  TParticle* ePos = NULL;
878  TParticle* eNeg = NULL;
879 
880  if(particle->GetNDaughters() >= 2){
881  for(Int_t daughterIndex=particle->GetFirstDaughter();daughterIndex<=particle->GetLastDaughter();daughterIndex++){
882  if(daughterIndex<0) continue;
883  TParticle *tmpDaughter = mcEvent->Particle(daughterIndex);
884  if(tmpDaughter->GetUniqueID() == 5){
885  if(tmpDaughter->GetPdgCode() == 11){
886  eNeg = tmpDaughter;
887  } else if(tmpDaughter->GetPdgCode() == -11){
888  ePos = tmpDaughter;
889  }
890  }
891  }
892  }
893 
894  if(ePos == NULL || eNeg == NULL){ // means we do not have two daughters from pair production
895  return kFALSE;
896  }
897 
898  if( ePos->Eta() > (fEtaCut) || ePos->Eta() < (-fEtaCut) ||
899  eNeg->Eta() > (fEtaCut) || eNeg->Eta() < (-fEtaCut) )
900  return kFALSE;
901 
902  if(fEtaCutMin > -0.1){
903  if( (ePos->Eta() < (fEtaCutMin) && ePos->Eta() > (-fEtaCutMin)) ||
904  (eNeg->Eta() < (fEtaCutMin) && eNeg->Eta() > (-fEtaCutMin)) )
905  return kFALSE;
906  }
907 
908  if(ePos->R()>fMaxR){
909  return kFALSE; // cuts on distance from collision point
910  }
911 
912  if(TMath::Abs(ePos->Vz()) > fMaxZ){
913  return kFALSE; // outside material
914  }
915  if(TMath::Abs(eNeg->Vz()) > fMaxZ){
916  return kFALSE; // outside material
917  }
918 
919  if( ePos->R() <= ((TMath::Abs(ePos->Vz()) * fLineCutZRSlope) - fLineCutZValue)){
920  return kFALSE; // line cut to exclude regions where we do not reconstruct
921  } else if ( fEtaCutMin != -0.1 && ePos->R() >= ((TMath::Abs(ePos->Vz()) * fLineCutZRSlopeMin) - fLineCutZValueMin)){
922  return kFALSE;
923  }
924 
925  if( eNeg->R() <= ((TMath::Abs(eNeg->Vz()) * fLineCutZRSlope) - fLineCutZValue)){
926  return kFALSE; // line cut to exclude regions where we do not reconstruct
927  } else if ( fEtaCutMin != -0.1 && eNeg->R() >= ((TMath::Abs(eNeg->Vz()) * fLineCutZRSlopeMin) - fLineCutZValueMin)){
928  return kFALSE;
929  }
930 
931  return kTRUE;
932  //if(AcceptanceCut(particle,ePos,eNeg))return kTRUE;
933  }
934  return kFALSE;
935 }
937 Bool_t AliConversionPhotonCuts::PhotonIsSelectedAODMC(AliAODMCParticle *particle,TClonesArray *aodmcArray,Bool_t checkForConvertedGamma){
938  // MonteCarlo Photon Selection
939 
940  if(!aodmcArray)return kFALSE;
941 
942  if (particle->GetPdgCode() == 22){
943  if( particle->Eta() > (fEtaCut) || particle->Eta() < (-fEtaCut) )
944  return kFALSE;
945  if(fEtaCutMin>-0.1){
946  if( particle->Eta() < (fEtaCutMin) && particle->Eta() > (-fEtaCutMin) )
947  return kFALSE;
948  }
949 
950  if(particle->GetMother() > -1 && (static_cast<AliAODMCParticle*>(aodmcArray->At(particle->GetMother())))->GetPdgCode() == 22){
951  return kFALSE; // no photon as mothers!
952  }
953 
954  if(!checkForConvertedGamma) return kTRUE; // return in case of accepted gamma
955 
956  // looking for conversion gammas (electron + positron from pairbuilding (= 5) )
957  AliAODMCParticle* ePos = NULL;
958  AliAODMCParticle* eNeg = NULL;
959 
960  if(particle->GetNDaughters() >= 2){
961  for(Int_t daughterIndex=particle->GetDaughterLabel(0);daughterIndex<=particle->GetDaughterLabel(1);daughterIndex++){
962  AliAODMCParticle *tmpDaughter = static_cast<AliAODMCParticle*>(aodmcArray->At(daughterIndex));
963  if(!tmpDaughter) continue;
964  if(((tmpDaughter->GetMCProcessCode())) == 5){ // STILL A BUG IN ALIROOT >>8 HAS TPO BE REMOVED AFTER FIX
965  if(tmpDaughter->GetPdgCode() == 11){
966  eNeg = tmpDaughter;
967  } else if(tmpDaughter->GetPdgCode() == -11){
968  ePos = tmpDaughter;
969  }
970  }
971  }
972  }
973 
974  if(ePos == NULL || eNeg == NULL){ // means we do not have two daughters from pair production
975  return kFALSE;
976  }
977 
978  if( ePos->Eta() > (fEtaCut) || ePos->Eta() < (-fEtaCut) ||
979  eNeg->Eta() > (fEtaCut) || eNeg->Eta() < (-fEtaCut) )
980  return kFALSE;
981 
982  if(fEtaCutMin > -0.1){
983  if( (ePos->Eta() < (fEtaCutMin) && ePos->Eta() > (-fEtaCutMin)) ||
984  (eNeg->Eta() < (fEtaCutMin) && eNeg->Eta() > (-fEtaCutMin)) )
985  return kFALSE;
986  }
987 
988  Double_t rPos = sqrt( (ePos->Xv()*ePos->Xv()) + (ePos->Yv()*ePos->Yv()) );
989  Double_t rNeg = sqrt( (eNeg->Xv()*eNeg->Xv()) + (eNeg->Yv()*eNeg->Yv()) );
990 
991  if(rPos>fMaxR){
992  return kFALSE; // cuts on distance from collision point
993  }
994  if(TMath::Abs(ePos->Zv()) > fMaxZ){
995  return kFALSE; // outside material
996  }
997  if(TMath::Abs(eNeg->Zv()) > fMaxZ){
998  return kFALSE; // outside material
999  }
1000 
1001  if( rPos <= ((TMath::Abs(ePos->Zv()) * fLineCutZRSlope) - fLineCutZValue)){
1002  return kFALSE; // line cut to exclude regions where we do not reconstruct
1003  } else if ( fEtaCutMin != -0.1 && rPos >= ((TMath::Abs(ePos->Zv()) * fLineCutZRSlopeMin) - fLineCutZValueMin)){
1004  return kFALSE;
1005  }
1006 
1007  if( rNeg <= ((TMath::Abs(eNeg->Zv()) * fLineCutZRSlope) - fLineCutZValue)){
1008  return kFALSE; // line cut to exclude regions where we do not reconstruct
1009  } else if ( fEtaCutMin != -0.1 && rNeg >= ((TMath::Abs(eNeg->Zv()) * fLineCutZRSlopeMin) - fLineCutZValueMin)){
1010  return kFALSE;
1011  }
1012 
1013  return kTRUE;
1014  //if(AcceptanceCut(particle,ePos,eNeg))return kTRUE;
1015  }
1016  return kFALSE;
1017 }
1018 
1021 // MonteCarlo Photon Selection
1022  if(!mcEvent)return kFALSE;
1023  if (particle->GetPdgCodeG() == 22){
1024  if( particle->EtaG() > (fEtaCut) || particle->EtaG() < (-fEtaCut) )
1025  return kFALSE;
1026  if(fEtaCutMin>-0.1){
1027  if( particle->EtaG() < (fEtaCutMin) && particle->EtaG() > (-fEtaCutMin) )
1028  return kFALSE;
1029  }
1030  if(particle->GetMotherG() >-1 && mcEvent->Particle(particle->GetMotherG())->GetPdgCodeG() == 22){
1031  return kFALSE; // no photon as mothers!
1032  }
1033  if(!checkForConvertedGamma) return kTRUE; // return in case of accepted gamma
1034  // looking for conversion gammas (electron + positron from pairbuilding (= 5) )
1035  AliDalitzAODESDMC* ePos = NULL;
1036  AliDalitzAODESDMC* eNeg = NULL;
1037  if(particle->GetNDaughtersG() >= 2){
1038  // cout<<particle->GetNDaughtersG()<<endl;
1039  for(Int_t daughterIndex=particle->GetFirstDaughterG();daughterIndex<=particle->GetLastDaughterG();daughterIndex++){
1040  if(daughterIndex<0) continue;
1041  AliDalitzAODESDMC *tmpDaughter = mcEvent->Particle(daughterIndex);
1042  // cout<<tmpDaughter->GetPdgCodeG()<<endl;
1043  //NOTE 8 Marzo problem here. never and ID 5
1044  if(tmpDaughter->GetUniqueIDG() == 5){
1045  if(tmpDaughter->GetPdgCodeG() == 11){
1046  eNeg = tmpDaughter;
1047  } else if(tmpDaughter->GetPdgCodeG() == -11){
1048  ePos = tmpDaughter;
1049  }
1050  }
1051  }
1052  }
1053  if(ePos == NULL || eNeg == NULL){ // means we do not have two daughters from pair production
1054  return kFALSE;
1055  }
1056  if( ePos->EtaG() > (fEtaCut) || ePos->EtaG() < (-fEtaCut) ||
1057  eNeg->EtaG() > (fEtaCut) || eNeg->EtaG() < (-fEtaCut) )
1058  return kFALSE;
1059  if(fEtaCutMin > -0.1){
1060  if( (ePos->EtaG() < (fEtaCutMin) && ePos->EtaG() > (-fEtaCutMin)) ||
1061  (eNeg->EtaG() < (fEtaCutMin) && eNeg->EtaG() > (-fEtaCutMin)) )
1062  return kFALSE;
1063  }
1064  if(ePos->GetRatioVxyG()>fMaxR){
1065  return kFALSE; // cuts on distance from collision point
1066  }
1067  //cout<<" Paso RadioXY "<<endl;
1068  if(TMath::Abs(ePos->VertexOnZ()) > fMaxZ){
1069  return kFALSE; // outside material
1070  }
1071  if(TMath::Abs(eNeg->VertexOnZ()) > fMaxZ){
1072  return kFALSE; // outside material
1073  }
1074  if( ePos->GetRatioVxyG() <= ((TMath::Abs(ePos->VertexOnZ()) * fLineCutZRSlope) - fLineCutZValue)){
1075  return kFALSE; // line cut to exclude regions where we do not reconstruct
1076  } else if ( fEtaCutMin != -0.1 && ePos->GetRatioVxyG() >= ((TMath::Abs(ePos->VertexOnZ()) * fLineCutZRSlopeMin) - fLineCutZValueMin)){
1077  return kFALSE;
1078  }
1079  if( eNeg->GetRatioVxyG() <= ((TMath::Abs(eNeg->VertexOnZ()) * fLineCutZRSlope) - fLineCutZValue)){
1080  return kFALSE; // line cut to exclude regions where we do not reconstruct
1081  } else if ( fEtaCutMin != -0.1 && eNeg->GetRatioVxyG() >= ((TMath::Abs(eNeg->VertexOnZ()) * fLineCutZRSlopeMin) - fLineCutZValueMin)){
1082  return kFALSE;
1083  }
1084  return kTRUE;
1085  //if(AcceptanceCut(particle,ePos,eNeg))return kTRUE;
1086  }
1087  return kFALSE;
1088 }
1090 Bool_t AliConversionPhotonCuts::PhotonCuts(AliConversionPhotonBase *photon,AliVEvent *event){ // Specific Photon Cuts
1091 
1092  Int_t cutIndex = 0;
1093  if(fHistoPhotonCuts)fHistoPhotonCuts->Fill(cutIndex, photon->GetPhotonPt());
1094  cutIndex++;
1095 
1096  AliVTrack * electronCandidate = GetTrack(event,photon->GetTrackLabelNegative());
1097  AliVTrack * positronCandidate = GetTrack(event,photon->GetTrackLabelPositive());
1098 
1099  // Fill Histos before Cuts
1100  if(fHistoInvMassbefore)fHistoInvMassbefore->Fill(photon->GetMass());
1103  if(photon->GetPhotonP()!=0 && electronCandidate->P()!=0)fHistoAsymmetrybefore->Fill(photon->GetPhotonP(),electronCandidate->P()/photon->GetPhotonP());
1104  }
1105  // Gamma selection based on QT from Armenteros
1106  if(fDoQtGammaSelection == kTRUE){
1107  if(!ArmenterosQtCut(photon)){
1108  if(fHistoPhotonCuts)fHistoPhotonCuts->Fill(cutIndex, photon->GetPhotonPt()); //1
1109  return kFALSE;
1110  }
1111  }
1112  cutIndex++; //2
1113 
1114  // Chi Cut
1115  if(photon->GetChi2perNDF() > fChi2CutConversion || photon->GetChi2perNDF() <=0){
1116  {
1117  if(fHistoPhotonCuts)fHistoPhotonCuts->Fill(cutIndex, photon->GetPhotonPt()); //2
1118  return kFALSE;
1119  }
1120  }
1121  cutIndex++;//3
1122 
1123  // Reconstruction Acceptance Cuts
1124  if(!AcceptanceCuts(photon)){
1125  if(fHistoPhotonCuts)fHistoPhotonCuts->Fill(cutIndex, photon->GetPhotonPt()); //3
1126  return kFALSE;
1127  }
1128 
1129  cutIndex++; //4
1130  // Asymmetry Cut
1131  if(fDoPhotonAsymmetryCut == kTRUE){
1132  if(!AsymmetryCut(photon,event)){
1133  if(fHistoPhotonCuts)fHistoPhotonCuts->Fill(cutIndex, photon->GetPhotonPt()); //4
1134  return kFALSE;
1135  }
1136  }
1137 
1138  //Check the pid probability
1139  cutIndex++; //5
1140  if(!PIDProbabilityCut(photon, event)) {
1141  if(fHistoPhotonCuts)fHistoPhotonCuts->Fill(cutIndex, photon->GetPhotonPt()); //5
1142  return kFALSE;
1143  }
1144 
1145  cutIndex++; //6
1146  if(!CorrectedTPCClusterCut(photon, event)) {
1147  if(fHistoPhotonCuts)fHistoPhotonCuts->Fill(cutIndex, photon->GetPhotonPt()); //6
1148  return kFALSE;
1149  }
1150 
1151  Double_t magField = event->GetMagneticField();
1152  if( magField < 0.0 ){
1153  magField = 1.0;
1154  } else {
1155  magField = -1.0;
1156  }
1157 
1158  Double_t deltaPhi = magField * TVector2::Phi_mpi_pi( electronCandidate->Phi()-positronCandidate->Phi());
1159 
1160  cutIndex++; //7
1161  if(!PsiPairCut(photon)) {
1162  if(fHistoPhotonCuts)fHistoPhotonCuts->Fill(cutIndex, photon->GetPhotonPt()); //7
1163  return kFALSE;
1164  }
1165 
1166  cutIndex++; //8
1167  if(!CosinePAngleCut(photon, event)) {
1168  if(fHistoPhotonCuts)fHistoPhotonCuts->Fill(cutIndex, photon->GetPhotonPt()); //8
1169  return kFALSE;
1170  }
1171 
1172  AliAODConversionPhoton* photonAOD = dynamic_cast<AliAODConversionPhoton*>(photon);
1173  if (photonAOD){
1174  photonAOD->CalculateDistanceOfClossetApproachToPrimVtx(event->GetPrimaryVertex());
1175 
1176  cutIndex++; //9
1177  if(photonAOD->GetDCArToPrimVtx() > fDCARPrimVtxCut) { //DCA R cut of photon to primary vertex
1178  if(fHistoPhotonCuts)fHistoPhotonCuts->Fill(cutIndex, photon->GetPhotonPt()); //9
1179  return kFALSE;
1180  }
1181 
1182  cutIndex++; //10
1183  if(TMath::Abs(photonAOD->GetDCAzToPrimVtx()) > fDCAZPrimVtxCut) { //DCA Z cut of photon to primary vertex
1184  if(fHistoPhotonCuts)fHistoPhotonCuts->Fill(cutIndex, photon->GetPhotonPt()); //10
1185  return kFALSE;
1186  }
1187  } else {
1188  cutIndex++; //9
1189  cutIndex++; //10
1190  }
1191  cutIndex++; //11
1192 
1193  if (photonAOD){
1194  UChar_t photonQuality = 0;
1195  AliAODEvent * aodEvent = dynamic_cast<AliAODEvent*>(event);
1196  if(aodEvent) {
1197  photonQuality = DeterminePhotonQualityAOD(photonAOD, event);
1198  } else {
1199  photonQuality = photonAOD->GetPhotonQuality();
1200  }
1201  if (fDoPhotonQualitySelectionCut && photonQuality != fPhotonQualityCut){
1202  if(fHistoPhotonCuts)fHistoPhotonCuts->Fill(cutIndex, photon->GetPhotonPt()); //11
1203  return kFALSE;
1204  }
1205  if (fDoPhotonQualityRejectionCut && photonQuality == fPhotonQualityCut){
1206  if(fHistoPhotonCuts)fHistoPhotonCuts->Fill(cutIndex, photon->GetPhotonPt()); //11
1207  return kFALSE;
1208  }
1209  }
1210  cutIndex++; //12
1211  if(fHistoPhotonCuts)fHistoPhotonCuts->Fill(cutIndex, photon->GetPhotonPt()); //11
1212 
1213  // Histos after Cuts
1214  if(fHistoInvMassafter)fHistoInvMassafter->Fill(photon->GetMass());
1217  if(fHistoKappaafter)fHistoKappaafter->Fill(photon->GetPhotonPt(), GetKappaTPC(photon, event));
1219  if(photon->GetPhotonP()!=0 && electronCandidate->P()!=0)fHistoAsymmetryafter->Fill(photon->GetPhotonP(),electronCandidate->P()/photon->GetPhotonP());
1220  }
1221  return kTRUE;
1222 
1223 }
1224 
1226 Bool_t AliConversionPhotonCuts::CorrectedTPCClusterCut(AliConversionPhotonBase *photon, AliVEvent * event){ //Cut on corrected TPC Cluster Info
1227 
1228  AliVTrack * negTrack = GetTrack(event, photon->GetTrackLabelNegative());
1229  AliVTrack * posTrack = GetTrack(event, photon->GetTrackLabelPositive());
1230 
1231  if(!negTrack||!posTrack)return kFALSE;
1232 
1233  Double_t negclsToF=0;
1234 
1235  if (!fUseCorrectedTPCClsInfo ){
1236  if(negTrack->GetTPCNclsF()!=0){
1237  negclsToF = (Double_t)negTrack->GetNcls(1)/(Double_t)negTrack->GetTPCNclsF();}// Ncluster/Nfindablecluster
1238  }
1239  else {
1240  negclsToF = negTrack->GetTPCClusterInfo(2,0,GetFirstTPCRow(photon->GetConversionRadius()));
1241  }
1242 
1243  Double_t posclsToF = 0.;
1244  if (!fUseCorrectedTPCClsInfo ){
1245  if(posTrack->GetTPCNclsF()!=0){
1246  posclsToF = (Double_t)posTrack->GetNcls(1)/(Double_t)posTrack->GetTPCNclsF();
1247  }
1248  }else{
1249  posclsToF = posTrack->GetTPCClusterInfo(2,0,GetFirstTPCRow(photon->GetConversionRadius()));
1250  }
1251 
1252  if( negclsToF < fMinClsTPCToF || posclsToF < fMinClsTPCToF ){
1253  return kFALSE;
1254  }
1255 
1256  return kTRUE;
1257 }
1258 
1261  //Selection of Reconstructed Photons
1262 
1264 
1265  if(event->IsA()==AliESDEvent::Class()) {
1266  if(!SelectV0Finder( ( ((AliESDEvent*)event)->GetV0(photon->GetV0Index()))->GetOnFlyStatus() ) ){
1268  return kFALSE;
1269  }
1270  }
1271 
1272  // Get Tracks
1273  AliVTrack * negTrack = GetTrack(event, photon->GetTrackLabelNegative());
1274  AliVTrack * posTrack = GetTrack(event, photon->GetTrackLabelPositive());
1275 
1276  if(!negTrack || !posTrack) {
1278  return kFALSE;
1279  }
1280 
1281  // check if V0 from AliAODGammaConversion.root is actually contained in AOD by checking if V0 exists with same tracks
1282  if(event->IsA()==AliAODEvent::Class() && fPreSelCut && ( fIsHeavyIon != 1 || (fIsHeavyIon == 1 && fProcessAODCheck) )) {
1283  AliAODEvent* aodEvent = dynamic_cast<AliAODEvent*>(event);
1284 
1285  Bool_t bFound = kFALSE;
1286  Int_t v0PosID = posTrack->GetID();
1287  Int_t v0NegID = negTrack->GetID();
1288  AliAODv0* v0 = NULL;
1289  for(Int_t iV=0; iV<aodEvent->GetNumberOfV0s(); iV++){
1290  v0 = aodEvent->GetV0(iV);
1291  if(!v0) continue;
1292  if( (v0PosID == v0->GetPosID() && v0NegID == v0->GetNegID()) || (v0PosID == v0->GetNegID() && v0NegID == v0->GetPosID()) ){
1293  bFound = kTRUE;
1294  break;
1295  }
1296  }
1297  if(!bFound){
1299  return kFALSE;
1300  }
1301  }
1302 
1303  photon->DeterminePhotonQuality(negTrack,posTrack);
1304 
1305  // Track Cuts
1306  if(!TracksAreSelected(negTrack, posTrack)){
1308  return kFALSE;
1309  }
1310  if (fHistoEtaDistV0s)fHistoEtaDistV0s->Fill(photon->GetPhotonEta());
1311 
1312  // dEdx Cuts
1313  // if(fDoElecDeDxPostCalibration && fElecDeDxPostCalibrationInitialized){
1314  if(!KappaCuts(photon, event) || !dEdxCuts(negTrack,photon) || !dEdxCuts(posTrack,photon)) {
1316  return kFALSE;
1317  }
1318 
1320  // Photon Cuts
1321  if(!PhotonCuts(photon,event)){
1323  return kFALSE;
1324  }
1325 
1326  // Photon passed cuts
1328  return kTRUE;
1329 }
1330 
1333  if(fDo2DQt){
1334  if ( !(TMath::Power(photon->GetArmenterosAlpha()/0.95,2)+TMath::Power(photon->GetArmenterosQt()/fQtMax,2) < 1) ){
1335  return kFALSE;
1336  }
1337  } else {
1338  if(photon->GetArmenterosQt()>fQtMax){
1339  return kFALSE;
1340  }
1341  }
1342  return kTRUE;
1343 }
1344 
1345 
1348  // Exclude certain areas for photon reconstruction
1349 
1350  Int_t cutIndex=0;
1351  if(fHistoAcceptanceCuts)fHistoAcceptanceCuts->Fill(cutIndex, photon->GetPhotonPt());
1352  cutIndex++;
1353 
1354  if(photon->GetConversionRadius()>fMaxR){ // cuts on distance from collision point
1355  if(fHistoAcceptanceCuts)fHistoAcceptanceCuts->Fill(cutIndex, photon->GetPhotonPt());
1356  return kFALSE;
1357  }
1358  cutIndex++;
1359 
1360  if(photon->GetConversionRadius()<fMinR){ // cuts on distance from collision point
1361  if(fHistoAcceptanceCuts)fHistoAcceptanceCuts->Fill(cutIndex, photon->GetPhotonPt());
1362  return kFALSE;
1363  }
1364  cutIndex++;
1365 
1366  if(photon->GetConversionRadius() <= ((TMath::Abs(photon->GetConversionZ())*fLineCutZRSlope)-fLineCutZValue)){
1367  if(fHistoAcceptanceCuts)fHistoAcceptanceCuts->Fill(cutIndex, photon->GetPhotonPt());
1368  return kFALSE;
1369  }
1370  else if (fUseEtaMinCut && photon->GetConversionRadius() >= ((TMath::Abs(photon->GetConversionZ())*fLineCutZRSlopeMin)-fLineCutZValueMin )){
1371  if(fHistoAcceptanceCuts)fHistoAcceptanceCuts->Fill(cutIndex, photon->GetPhotonPt());
1372  return kFALSE;
1373  }
1374  cutIndex++;
1375 
1376  if(TMath::Abs(photon->GetConversionZ()) > fMaxZ ){ // cuts out regions where we do not reconstruct
1377  if(fHistoAcceptanceCuts)fHistoAcceptanceCuts->Fill(cutIndex, photon->GetPhotonPt());
1378  return kFALSE;
1379  }
1380  cutIndex++;
1381 
1382 
1383  if( photon->GetPhotonEta() > (fEtaCut) || photon->GetPhotonEta() < (-fEtaCut) ){
1384  if(fHistoAcceptanceCuts)fHistoAcceptanceCuts->Fill(cutIndex, photon->GetPhotonPt());
1385  return kFALSE;
1386  }
1387  if(fEtaCutMin>-0.1){
1388  if( photon->GetPhotonEta() < (fEtaCutMin) && photon->GetPhotonEta() > (-fEtaCutMin) ){
1389  if(fHistoAcceptanceCuts)fHistoAcceptanceCuts->Fill(cutIndex, photon->GetPhotonPt());
1390  return kFALSE;
1391  }
1392  }
1393  cutIndex++;
1394 
1396  if(photon->GetPhotonEta() > fEtaForPhiCutMin && photon->GetPhotonEta() < fEtaForPhiCutMax ){
1397  if (fMinPhiCut < fMaxPhiCut){
1398  if( photon->GetPhotonPhi() > fMinPhiCut && photon->GetPhotonPhi() < fMaxPhiCut ) {
1399  if(fHistoAcceptanceCuts)fHistoAcceptanceCuts->Fill(cutIndex, photon->GetPhotonPt());
1400  return kFALSE;
1401  }
1402  } else {
1403  Double_t photonPhi = photon->GetPhotonPhi();
1404  if (photon->GetPhotonPhi() < TMath::Pi()) photonPhi = photon->GetPhotonPhi() + 2*TMath::Pi();
1405  if( photonPhi > fMinPhiCut && photonPhi < fMaxPhiCut+2*TMath::Pi() ) {
1406  if(fHistoAcceptanceCuts)fHistoAcceptanceCuts->Fill(cutIndex, photon->GetPhotonPt());
1407  return kFALSE;
1408  }
1409  }
1410  }
1411  }
1412  cutIndex++;
1413 
1414 
1415 
1416  if(photon->GetPhotonPt()<fPtCut){
1417  if(fHistoAcceptanceCuts)fHistoAcceptanceCuts->Fill(cutIndex, photon->GetPhotonPt());
1418  return kFALSE;
1419  }
1420  cutIndex++;
1421 
1422  if(fHistoAcceptanceCuts)fHistoAcceptanceCuts->Fill(cutIndex, photon->GetPhotonPt());
1423 
1424  return kTRUE;
1425 }
1426 
1427 
1429 Bool_t AliConversionPhotonCuts::SpecificTrackCuts(AliAODTrack * negTrack, AliAODTrack * posTrack,Int_t &cutIndex) {
1430  // Track Cuts which require AOD/ESD specific implementation
1431 
1432  if( !negTrack->IsOn(AliESDtrack::kTPCrefit) || !posTrack->IsOn(AliESDtrack::kTPCrefit) ) {
1433  if(fHistoTrackCuts)fHistoTrackCuts->Fill(cutIndex);
1434  return kFALSE;
1435  }
1436  cutIndex++;
1437 
1438  AliAODVertex * NegVtxType=negTrack->GetProdVertex();
1439  AliAODVertex * PosVtxType=posTrack->GetProdVertex();
1440  if( (NegVtxType->GetType())==AliAODVertex::kKink || (PosVtxType->GetType())==AliAODVertex::kKink) {
1441  if(fHistoTrackCuts)fHistoTrackCuts->Fill(cutIndex);
1442  return kFALSE;
1443  }
1444  return kTRUE;
1445 
1446 }
1447 
1448 
1450 Bool_t AliConversionPhotonCuts::SpecificTrackCuts(AliESDtrack * negTrack, AliESDtrack * posTrack,Int_t &cutIndex) {
1451  // Track Cuts which require AOD/ESD specific implementation
1452 
1453  if( !negTrack->IsOn(AliESDtrack::kTPCrefit) || !posTrack->IsOn(AliESDtrack::kTPCrefit) ) {
1454  if(fHistoTrackCuts)fHistoTrackCuts->Fill(cutIndex);
1455  return kFALSE;
1456  }
1457  cutIndex++;
1458 
1459  if(negTrack->GetKinkIndex(0) > 0 || posTrack->GetKinkIndex(0) > 0 ) {
1460  if(fHistoTrackCuts)fHistoTrackCuts->Fill(cutIndex);
1461  return kFALSE;
1462  }
1463  return kTRUE;
1464 }
1465 
1466 
1467 
1469 Bool_t AliConversionPhotonCuts::TracksAreSelected(AliVTrack * negTrack, AliVTrack * posTrack) {
1470  // Track Selection for Photon Reconstruction
1471 
1472  Int_t cutIndex=0;
1473  if(fHistoTrackCuts)fHistoTrackCuts->Fill(cutIndex);
1474  cutIndex++;
1475 
1476  // avoid like sign
1478  if(negTrack->Charge() == posTrack->Charge()) {
1479  if(fHistoTrackCuts)fHistoTrackCuts->Fill(cutIndex);
1480  return kFALSE;
1481  }
1482  }else if(fUseOnFlyV0FinderSameSign==1){
1483  if(negTrack->Charge() != posTrack->Charge()) {
1484  if(fHistoTrackCuts)fHistoTrackCuts->Fill(cutIndex);
1485  return kFALSE;
1486  }
1487  }
1488  cutIndex++;
1489 
1490  // Number of TPC Clusters
1491 
1492 
1493  if( negTrack->GetNcls(1) < fMinClsTPC || posTrack->GetNcls(1) < fMinClsTPC ) {
1494  if(fHistoTrackCuts)fHistoTrackCuts->Fill(cutIndex);
1495  return kFALSE;
1496  }
1497  cutIndex++;
1498 
1499  // Acceptance
1500  if( posTrack->Eta() > (fEtaCut) || posTrack->Eta() < (-fEtaCut) ||
1501  negTrack->Eta() > (fEtaCut) || negTrack->Eta() < (-fEtaCut) ){
1502  if(fHistoTrackCuts)fHistoTrackCuts->Fill(cutIndex);
1503  return kFALSE;
1504  }
1505  if(fEtaCutMin>-0.1){
1506  if( (posTrack->Eta() < (fEtaCutMin) && posTrack->Eta() > (-fEtaCutMin)) ||
1507  (negTrack->Eta() < (fEtaCutMin) && negTrack->Eta() > (-fEtaCutMin)) ){
1508  if(fHistoTrackCuts)fHistoTrackCuts->Fill(cutIndex);
1509  return kFALSE;
1510  }
1511  }
1512  cutIndex++;
1513 
1514  // Single Pt Cut
1515  if(fDoAsymPtCut){
1516  if((posTrack->Pt()<fSinglePtCut || negTrack->Pt()<fSinglePtCut2) && (posTrack->Pt()<fSinglePtCut2 || negTrack->Pt()<fSinglePtCut) ){
1517  if(fHistoTrackCuts)fHistoTrackCuts->Fill(cutIndex);
1518  return kFALSE;
1519  }
1520  } else {
1521  if(posTrack->Pt()<fSinglePtCut || negTrack->Pt()<fSinglePtCut){
1522  if(fHistoTrackCuts)fHistoTrackCuts->Fill(cutIndex);
1523  return kFALSE;
1524  }
1525  }
1526  cutIndex++;
1527 
1528  // AOD ESD specific cuts
1529  Bool_t passCuts = kTRUE;
1530 
1531  if(negTrack->IsA()==AliAODTrack::Class()) {
1532  passCuts = SpecificTrackCuts(static_cast<AliAODTrack*>(negTrack), static_cast<AliAODTrack*>(posTrack),cutIndex);
1533  } else {
1534  passCuts = SpecificTrackCuts(static_cast<AliESDtrack*>(negTrack), static_cast<AliESDtrack*>(posTrack),cutIndex);
1535  }
1536 
1537  if(!passCuts){
1538  if(fHistoTrackCuts)fHistoTrackCuts->Fill(cutIndex);
1539  return kFALSE;
1540  }
1541  cutIndex++;
1542 
1543  if(fHistoTrackCuts)fHistoTrackCuts->Fill(cutIndex);
1544 
1545  return kTRUE;
1546 
1547 }
1550 
1551  if(!fPIDResponse){InitPIDResponse();}// Try to reinitialize PID Response
1552  if(!fPIDResponse){AliError("No PID Response"); return kTRUE;}// if still missing fatal error
1553 
1554  AliVTrack * negTrack = GetTrack(event, gamma->GetTrackLabelNegative());
1555  AliVTrack * posTrack = GetTrack(event, gamma->GetTrackLabelPositive());
1556 
1557  Double_t CentrnSig[2] ={-1.,-1.};//negative, positive
1558  Double_t P[2] ={-1.,-1.};
1559  Double_t Eta[2] ={-1.,-1.};
1560  Double_t R =-1.;
1561 
1562  Float_t KappaPlus, KappaMinus, Kappa;
1564  CentrnSig[0]=fPIDResponse->NumberOfSigmasTPC(negTrack,AliPID::kElectron);
1565  CentrnSig[1]=fPIDResponse->NumberOfSigmasTPC(posTrack,AliPID::kElectron);
1566  P[0] =negTrack->P();
1567  P[1] =posTrack->P();
1568  Eta[0] =negTrack->Eta();
1569  Eta[1] =posTrack->Eta();
1570  R =gamma->GetConversionRadius();
1571  KappaMinus = GetCorrectedElectronTPCResponse(negTrack->Charge(),CentrnSig[0],P[0],Eta[0],R);
1572  KappaPlus = GetCorrectedElectronTPCResponse(posTrack->Charge(),CentrnSig[1],P[1],Eta[1],R);
1573  }else{
1574  KappaMinus = fPIDResponse->NumberOfSigmasTPC(negTrack, AliPID::kElectron);
1575  KappaPlus = fPIDResponse->NumberOfSigmasTPC(posTrack, AliPID::kElectron);
1576  }
1577  Kappa = ( TMath::Abs(KappaMinus) + TMath::Abs(KappaPlus) ) / 2.0 + 2.0*(KappaMinus+KappaPlus);
1578 
1579  return Kappa;
1580 
1581 }
1582 
1583 
1586  // Supposed to use post calibration
1587  // Electron Identification Cuts for Photon reconstruction
1588 
1589  if(!fPIDResponse){InitPIDResponse();}// Try to reinitialize PID Response
1590  if(!fPIDResponse){AliError("No PID Response"); return kTRUE;}// if still missing fatal error
1591 
1592  Short_t Charge = fCurrentTrack->Charge();
1593  Double_t electronNSigmaTPC = fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kElectron);
1594  Double_t electronNSigmaTPCCor=0.;
1595  Double_t P=0.;
1596  Double_t Eta=0.;
1597  Double_t R=0.;
1598 
1600  P = fCurrentTrack->P();
1601  Eta = fCurrentTrack->Eta();
1602  R = photon->GetConversionRadius();
1603  electronNSigmaTPCCor = GetCorrectedElectronTPCResponse(Charge,electronNSigmaTPC,P,Eta,R);
1604  }
1605 
1606  Int_t cutIndex=0;
1607  if(fHistodEdxCuts)fHistodEdxCuts->Fill(cutIndex,fCurrentTrack->Pt());
1608  if(fHistoTPCdEdxSigbefore)fHistoTPCdEdxSigbefore->Fill(fCurrentTrack->P(), electronNSigmaTPC);
1609  if(fHistoTPCdEdxbefore)fHistoTPCdEdxbefore->Fill(fCurrentTrack->P(),fCurrentTrack->GetTPCsignal());
1610  cutIndex++;
1611  if(fDodEdxSigmaCut == kTRUE && !fSwitchToKappa){
1612  // TPC Electron Line
1614  if( electronNSigmaTPCCor < fPIDnSigmaBelowElectronLine || electronNSigmaTPCCor >fPIDnSigmaAboveElectronLine ){
1615  if(fHistodEdxCuts)fHistodEdxCuts->Fill(cutIndex,fCurrentTrack->Pt());
1616  return kFALSE;
1617  }
1618  } else{
1619  if( electronNSigmaTPC < fPIDnSigmaBelowElectronLine ||
1620  electronNSigmaTPC > fPIDnSigmaAboveElectronLine){
1621  if(fHistodEdxCuts)fHistodEdxCuts->Fill(cutIndex,fCurrentTrack->Pt());
1622  return kFALSE;
1623  }
1624  }
1625  cutIndex++;
1626  // TPC Pion Line
1627  if( fCurrentTrack->P()>fPIDMinPnSigmaAbovePionLine && fCurrentTrack->P()<fPIDMaxPnSigmaAbovePionLine ){
1629  if( electronNSigmaTPCCor >fPIDnSigmaBelowElectronLine && electronNSigmaTPCCor < fPIDnSigmaAboveElectronLine&&
1630  fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kPion)<fPIDnSigmaAbovePionLine){
1631  if(fHistodEdxCuts)fHistodEdxCuts->Fill(cutIndex,fCurrentTrack->Pt());
1632  return kFALSE;
1633  }
1634  } else{
1635  if( electronNSigmaTPC > fPIDnSigmaBelowElectronLine &&
1636  electronNSigmaTPC < fPIDnSigmaAboveElectronLine&&
1637  fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kPion)<fPIDnSigmaAbovePionLine){
1638  if(fHistodEdxCuts)fHistodEdxCuts->Fill(cutIndex,fCurrentTrack->Pt());
1639  return kFALSE;
1640  }
1641  }
1642  cutIndex++;
1643  }
1644 
1645  // High Pt Pion rej
1646  if( fCurrentTrack->P()>fPIDMaxPnSigmaAbovePionLine ){
1648  if( electronNSigmaTPCCor > fPIDnSigmaBelowElectronLine &&
1649  electronNSigmaTPCCor < fPIDnSigmaAboveElectronLine &&
1650  fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kPion)<fPIDnSigmaAbovePionLineHighPt){
1651  if(fHistodEdxCuts)fHistodEdxCuts->Fill(cutIndex,fCurrentTrack->Pt());
1652  return kFALSE;
1653  }
1654  } else{
1655  if( electronNSigmaTPC > fPIDnSigmaBelowElectronLine &&
1656  electronNSigmaTPC < fPIDnSigmaAboveElectronLine &&
1657  fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kPion)<fPIDnSigmaAbovePionLineHighPt){
1658  if(fHistodEdxCuts)fHistodEdxCuts->Fill(cutIndex,fCurrentTrack->Pt());
1659  return kFALSE;
1660  }
1661  }
1662  }
1663  cutIndex++;
1664  }
1665  else{cutIndex+=3;}
1666 
1667  if(fDoKaonRejectionLowP == kTRUE && !fSwitchToKappa){
1668  if(fCurrentTrack->P()<fPIDMinPKaonRejectionLowP ){
1669  if( TMath::Abs(fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kKaon))<fPIDnSigmaAtLowPAroundKaonLine){
1670  if(fHistodEdxCuts)fHistodEdxCuts->Fill(cutIndex,fCurrentTrack->Pt());
1671  return kFALSE;
1672  }
1673  }
1674  }
1675  cutIndex++;
1676 
1677  if(fDoProtonRejectionLowP == kTRUE && !fSwitchToKappa){
1678  if( fCurrentTrack->P()<fPIDMinPProtonRejectionLowP ){
1679  if( TMath::Abs(fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kProton))<fPIDnSigmaAtLowPAroundProtonLine){
1680  if(fHistodEdxCuts)fHistodEdxCuts->Fill(cutIndex,fCurrentTrack->Pt());
1681  return kFALSE;
1682  }
1683  }
1684  }
1685  cutIndex++;
1686 
1687  if(fDoPionRejectionLowP == kTRUE && !fSwitchToKappa){
1688  if( fCurrentTrack->P()<fPIDMinPPionRejectionLowP ){
1689  if( TMath::Abs(fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kPion))<fPIDnSigmaAtLowPAroundPionLine){
1690  if(fHistodEdxCuts)fHistodEdxCuts->Fill(cutIndex,fCurrentTrack->Pt());
1691  return kFALSE;
1692  }
1693  }
1694  }
1695  cutIndex++;
1696 
1697 
1698  // cout<<"Start"<<endl;
1699  // AliPIDResponse::EDetPidStatus status=fPIDResponse->CheckPIDStatus(AliPIDResponse::kTOF,fCurrentTrack);
1700 
1701  // if( ( (status & AliVTrack::kTOFout) == AliVTrack::kTOFout ) && ( (status & AliVTrack::kTIME) == AliVTrack::kTIME ))
1702  // {cout<<"TOF DA"<<endl;}
1703  // if(status == AliPIDResponse::kDetPidOk){
1704  // Float_t probMis = fPIDResponse->GetTOFMismatchProbability(fCurrentTrack);
1705  // cout<<"--> "<<probMis<<endl;
1706  // if(probMis > 0.01){
1707 
1708  // }
1709  // }
1710 
1711  if((fCurrentTrack->GetStatus() & AliESDtrack::kTOFpid ) && !(fCurrentTrack->GetStatus() & AliESDtrack::kTOFmismatch)){
1712  if(fHistoTOFbefore){
1713  Double_t t0 = fPIDResponse->GetTOFResponse().GetStartTime(fCurrentTrack->P());
1714  Double_t times[AliPID::kSPECIESC];
1715  fCurrentTrack->GetIntegratedTimes(times,AliPID::kSPECIESC);
1716  Double_t TOFsignal = fCurrentTrack->GetTOFsignal();
1717  Double_t dT = TOFsignal - t0 - times[0];
1718  fHistoTOFbefore->Fill(fCurrentTrack->P(),dT);
1719  }
1720  if(fHistoTOFSigbefore) fHistoTOFSigbefore->Fill(fCurrentTrack->P(),fPIDResponse->NumberOfSigmasTOF(fCurrentTrack, AliPID::kElectron));
1721  if(fUseTOFpid){
1722  if(fPIDResponse->NumberOfSigmasTOF(fCurrentTrack, AliPID::kElectron)>fTofPIDnSigmaAboveElectronLine ||
1723  fPIDResponse->NumberOfSigmasTOF(fCurrentTrack, AliPID::kElectron)<fTofPIDnSigmaBelowElectronLine ){
1724  if(fHistodEdxCuts)fHistodEdxCuts->Fill(cutIndex,fCurrentTrack->Pt());
1725  return kFALSE;
1726  }
1727  }
1728  if(fHistoTOFSigafter)fHistoTOFSigafter->Fill(fCurrentTrack->P(),fPIDResponse->NumberOfSigmasTOF(fCurrentTrack, AliPID::kElectron));
1729  }
1730  cutIndex++;
1731 
1732  if((fCurrentTrack->GetStatus() & AliESDtrack::kITSpid)){
1733  if(fHistoITSSigbefore) fHistoITSSigbefore->Fill(fCurrentTrack->P(),fPIDResponse->NumberOfSigmasITS(fCurrentTrack, AliPID::kElectron));
1734  if(fUseITSpid){
1735  if(fCurrentTrack->Pt()<=fMaxPtPIDITS){
1736  if(fPIDResponse->NumberOfSigmasITS(fCurrentTrack, AliPID::kElectron)>fITSPIDnSigmaAboveElectronLine || fPIDResponse->NumberOfSigmasITS(fCurrentTrack, AliPID::kElectron)<fITSPIDnSigmaBelowElectronLine ){
1737  if(fHistodEdxCuts)fHistodEdxCuts->Fill(cutIndex,fCurrentTrack->Pt());
1738  return kFALSE;
1739  }
1740  }
1741  }
1742  if(fHistoITSSigafter)fHistoITSSigafter->Fill(fCurrentTrack->P(),fPIDResponse->NumberOfSigmasITS(fCurrentTrack, AliPID::kElectron));
1743  }
1744 
1745  cutIndex++;
1746 
1747  // Apply TRD PID
1748  if(fDoTRDPID){
1749  if(!fPIDResponse->IdentifiedAsElectronTRD(fCurrentTrack,fPIDTRDEfficiency)){
1750  if(fHistodEdxCuts)fHistodEdxCuts->Fill(cutIndex,fCurrentTrack->Pt());
1751  return kFALSE;
1752  }
1753  }
1754  cutIndex++;
1755 
1756  if(fHistodEdxCuts)fHistodEdxCuts->Fill(cutIndex,fCurrentTrack->Pt());
1758  if(fHistoTPCdEdxSigafter)fHistoTPCdEdxSigafter->Fill(fCurrentTrack->P(),electronNSigmaTPCCor);
1759  }else{
1760  if(fHistoTPCdEdxSigafter)fHistoTPCdEdxSigafter->Fill(fCurrentTrack->P(),electronNSigmaTPC);
1761  }
1762  if(fHistoTPCdEdxafter)fHistoTPCdEdxafter->Fill(fCurrentTrack->P(),fCurrentTrack->GetTPCsignal());
1763 
1764  return kTRUE;
1765 }
1766 
1769  // abort if Kappa selection not enabled
1770  if (!fSwitchToKappa) return kTRUE;
1771 
1772  Float_t kappa = GetKappaTPC(photon, event);
1773  if (kappa < fKappaMinCut) return kFALSE;
1774  if (kappa > fKappaMaxCut) return kFALSE;
1775  return kTRUE;
1776 }
1777 
1780  // Cut on Energy Asymmetry
1781 
1782  for(Int_t ii=0;ii<2;ii++){
1783 
1784  AliVTrack *track=GetTrack(event,photon->GetTrackLabel(ii));
1785 
1787  Double_t trackNegAsy=0;
1788  if (photon->GetPhotonP()!=0.){
1789  trackNegAsy= track->P()/photon->GetPhotonP();
1790  }
1791 
1792  if( trackNegAsy > fFAsymmetryCut->Eval(photon->GetPhotonP()) || trackNegAsy < 1.-fFAsymmetryCut->Eval(photon->GetPhotonP()) ){
1793  return kFALSE;
1794  }
1795 
1796  } else {
1797  if( track->P() > fMinPPhotonAsymmetryCut ){
1798  Double_t trackNegAsy=0;
1799  if (photon->GetPhotonP()!=0.){
1800  trackNegAsy= track->P()/photon->GetPhotonP();
1801  }
1802 
1803  if( trackNegAsy<fMinPhotonAsymmetry ||trackNegAsy>(1.- fMinPhotonAsymmetry)){
1804  return kFALSE;
1805  }
1806  }
1807  }
1808 
1809  }
1810  return kTRUE;
1811 }
1812 
1814 AliVTrack *AliConversionPhotonCuts::GetTrack(AliVEvent * event, Int_t label){
1815  //Returns pointer to the track with given ESD label
1816  //(Important for AOD implementation, since Track array in AOD data is different
1817  //from ESD array, but ESD tracklabels are stored in AOD Tracks)
1818 
1819  AliESDEvent * esdEvent = dynamic_cast<AliESDEvent*>(event);
1820  if(esdEvent) {
1821  if(label > event->GetNumberOfTracks() ) return NULL;
1822  AliESDtrack * track = esdEvent->GetTrack(label);
1823  return track;
1824 
1825  } else {
1826  if(label == -999999) return NULL; // if AOD relabelling goes wrong, immediately return NULL
1827  AliVTrack * track = 0x0;
1828  if(((AliV0ReaderV1*)AliAnalysisManager::GetAnalysisManager()->GetTask(fV0ReaderName.Data()))->AreAODsRelabeled()){
1829  if(event->GetTrack(label)) track = dynamic_cast<AliVTrack*>(event->GetTrack(label));
1830  return track;
1831  }
1832  else{
1833  for(Int_t ii=0; ii<event->GetNumberOfTracks(); ii++) {
1834  if(event->GetTrack(ii)) track = dynamic_cast<AliVTrack*>(event->GetTrack(ii));
1835  if(track){
1836  if(track->GetID() == label) {
1837  return track;
1838  }
1839  }
1840  }
1841  }
1842  }
1843  //AliDebug(5,(Form("track not found %d %d",label,event->GetNumberOfTracks()));
1844  return NULL;
1845 }
1846 
1849  //Returns pointer to the track with given ESD label
1850  //(Important for AOD implementation, since Track array in AOD data is different
1851  //from ESD array, but ESD tracklabels are stored in AOD Tracks)
1852 
1853  if(event) {
1854  if(label > event->GetNumberOfTracks() ) return NULL;
1855  AliESDtrack * track = event->GetTrack(label);
1856  return track;
1857  }
1858  //AliDebug(5,(Form("track not found %d %d",label,event->GetNumberOfTracks()));
1859  return NULL;
1860 }
1861 
1862 
1863 
1866  // Cut on Electron Probability for Photon Reconstruction
1867 
1868  AliESDEvent * esdEvent = dynamic_cast<AliESDEvent*>(event);
1869 
1870  if(esdEvent){
1871 
1872  Bool_t iResult=kFALSE;
1873 
1874  Double_t posProbArray[AliPID::kSPECIES];
1875  Double_t negProbArray[AliPID::kSPECIES];
1876 
1877  AliESDtrack* negTrack = esdEvent->GetTrack(photon->GetTrackLabelNegative());
1878  AliESDtrack* posTrack = esdEvent->GetTrack(photon->GetTrackLabelPositive());
1879 
1880  if(negProbArray && posProbArray){
1881 
1882  negTrack->GetTPCpid(negProbArray);
1883  posTrack->GetTPCpid(posProbArray);
1884 
1886  iResult=kTRUE;
1887  }
1888  }
1889 
1890  return iResult;
1891 
1892  } else {
1894  return kTRUE;
1895  }
1896 }
1897 
1898 
1900 Bool_t AliConversionPhotonCuts::AcceptanceCut(TParticle *particle, TParticle * ePos,TParticle* eNeg){
1901  // MC Acceptance Cuts
1902  //(Certain areas were excluded for photon reconstruction)
1903 
1904  if(particle->R()>fMaxR){
1905  return kFALSE;}
1906 
1907  if(ePos->R()>fMaxR){
1908  return kFALSE;
1909  }
1910 
1911  if(ePos->R()<fMinR){
1912  return kFALSE;
1913  }
1914 
1915  if( ePos->R() <= ((TMath::Abs(ePos->Vz())*fLineCutZRSlope)-fLineCutZValue)){
1916  return kFALSE;
1917  }
1918  else if (fUseEtaMinCut && ePos->R() >= ((TMath::Abs(ePos->Vz())*fLineCutZRSlopeMin)-fLineCutZValueMin )){
1919  return kFALSE;
1920  }
1921 
1922  if(TMath::Abs(eNeg->Vz()) > fMaxZ ){ // cuts out regions where we do not reconstruct
1923  return kFALSE;
1924  }
1925 
1926  if(eNeg->Vz()!=ePos->Vz()||eNeg->R()!=ePos->R()){
1927  return kFALSE;
1928  }
1929 
1930  if(TMath::Abs(ePos->Vz()) > fMaxZ ){ // cuts out regions where we do not reconstruct
1931  return kFALSE;
1932  }
1933 
1934 
1935  if( particle->Eta() > (fEtaCut) || particle->Eta() < (-fEtaCut) ){
1936  return kFALSE;
1937  }
1938  if( ePos->Eta() > (fEtaCut) || ePos->Eta() < (-fEtaCut) ){
1939  return kFALSE;
1940  }
1941  if( eNeg->Eta() > (fEtaCut) || eNeg->Eta() < (-fEtaCut) ){
1942  return kFALSE;
1943  }
1944  if(fEtaCutMin>-0.1){
1945  if( particle->Eta() < (fEtaCutMin) && particle->Eta() > (-fEtaCutMin) ){
1946  return kFALSE;
1947  }
1948  if( ePos->Eta() < (fEtaCutMin) && ePos->Eta() > (-fEtaCutMin) ){
1949  return kFALSE;
1950  }
1951  if( eNeg->Eta() < (fEtaCutMin) && eNeg->Eta() > (-fEtaCutMin) ){
1952  return kFALSE;
1953  }
1954  }
1955 
1956  if(fDoAsymPtCut){
1957  if((ePos->Pt()<fSinglePtCut || eNeg->Pt()<fSinglePtCut2) && (ePos->Pt()<fSinglePtCut2 || eNeg->Pt()<fSinglePtCut) ){
1958  return kFALSE;
1959  }
1960  } else {
1961  if(ePos->Pt()<fSinglePtCut || eNeg->Pt()<fSinglePtCut){
1962  return kFALSE;
1963  }
1964  }
1965 
1966  if(particle->Pt()<fPtCut){
1967  return kFALSE;
1968  }
1969 
1970  return kTRUE;
1971 }
1975 
1976  if(fCutString && fCutString->GetString().Length() == kNCuts) {
1977  fCutString->SetString(GetCutNumber());
1978  } else {
1979  return kFALSE;
1980  }
1981  return kTRUE;
1982 }
1983 
1984 
1987  fCutStringRead = Form("%s",analysisCutSelection.Data());
1988 
1989  // Initialize Cuts from a given Cut string
1990  AliInfo(Form("Set Photoncut Number: %s",analysisCutSelection.Data()));
1991  if(analysisCutSelection.Length()!=kNCuts) {
1992  AliError(Form("Cut selection has the wrong length! size is %d, number of cuts is %d", analysisCutSelection.Length(), kNCuts));
1993  return kFALSE;
1994  }
1995  if(!analysisCutSelection.IsAlnum()){
1996  AliError("Cut selection is not alphanumeric");
1997  return kFALSE;
1998  }
1999 
2000  TString analysisCutSelectionLowerCase = Form("%s",analysisCutSelection.Data());
2001  analysisCutSelectionLowerCase.ToLower();
2002  const char *cutSelection = analysisCutSelectionLowerCase.Data();
2003  #define ASSIGNARRAY(i) fCuts[i] = ((int)cutSelection[i]>=(int)'a') ? cutSelection[i]-'a'+10 : cutSelection[i]-'0'
2004  for(Int_t ii=0;ii<kNCuts;ii++){
2005  ASSIGNARRAY(ii);
2006  }
2007 
2008  // Set Individual Cuts
2009  for(Int_t ii=0;ii<kNCuts;ii++){
2010  if(!SetCut(cutIds(ii),fCuts[ii]))return kFALSE;
2011  }
2012 
2014 
2015  return kTRUE;
2016 }
2020 
2021  switch (cutID) {
2022 
2023  case kv0FinderType:
2024  if( SetV0Finder(value)) {
2025  fCuts[kv0FinderType] = value;
2026  UpdateCutString();
2027  return kTRUE;
2028  } else return kFALSE;
2029 
2030  case ketaCut:
2031  if( SetEtaCut(value)) {
2032  fCuts[ketaCut] = value;
2033  UpdateCutString();
2034  return kTRUE;
2035  } else return kFALSE;
2036 
2037  case kRCut:
2038  if( SetRCut(value)) {
2039  fCuts[kRCut] = value;
2040  UpdateCutString();
2041  return kTRUE;
2042  } else return kFALSE;
2043 
2044  case kEtaForPhiSector:
2045  if( SetEtaForPhiCut(value)) {
2046  fCuts[kEtaForPhiSector] = value;
2047  UpdateCutString();
2048  return kTRUE;
2049  } else return kFALSE;
2050  case kMinPhiSector:
2051  if( SetMinPhiSectorCut(value)) {
2052  fCuts[kMinPhiSector] = value;
2053  UpdateCutString();
2054  return kTRUE;
2055  } else return kFALSE;
2056  case kMaxPhiSector:
2057  if( SetMaxPhiSectorCut(value)) {
2058  fCuts[kMaxPhiSector] = value;
2059  UpdateCutString();
2060  return kTRUE;
2061  } else return kFALSE;
2062 
2063  case ksinglePtCut:
2064  if( SetSinglePtCut(value)) {
2065  fCuts[ksinglePtCut] = value;
2066  UpdateCutString();
2067  return kTRUE;
2068  } else return kFALSE;
2069 
2070  case kclsTPCCut:
2071  if( SetTPCClusterCut(value)) {
2072  fCuts[kclsTPCCut] = value;
2073  UpdateCutString();
2074  return kTRUE;
2075  } else return kFALSE;
2076 
2077  case kededxSigmaCut:
2078  if (!fSwitchToKappa){
2079  if( SetTPCdEdxCutElectronLine(value)) {
2080  fCuts[kededxSigmaCut] = value;
2081  UpdateCutString();
2082  return kTRUE;
2083  } else return kFALSE;
2084  } else {
2085  if( SetKappaTPCCut(value)) {
2086  fCuts[kededxSigmaCut] = value;
2087  UpdateCutString();
2088  return kTRUE;
2089  } else return kFALSE;
2090  }
2091  case kpidedxSigmaCut:
2092  if (!fSwitchToKappa){
2093  if( SetTPCdEdxCutPionLine(value)) {
2094  fCuts[kpidedxSigmaCut] = value;
2095  UpdateCutString();
2096  return kTRUE;
2097  } else return kFALSE;
2098  } else {
2099  fCuts[kpidedxSigmaCut] = 0;
2100  return kTRUE;
2101  }
2102  case kpiMomdedxSigmaCut:
2103  if (!fSwitchToKappa){
2104  if( SetMinMomPiondEdxCut(value)) {
2105  fCuts[kpiMomdedxSigmaCut] = value;
2106  UpdateCutString();
2107  return kTRUE;
2108  } else return kFALSE;
2109  } else {
2111  return kTRUE;
2112  }
2113  case kpiMaxMomdedxSigmaCut:
2114  if (!fSwitchToKappa){
2115  if( SetMaxMomPiondEdxCut(value)) {
2116  fCuts[kpiMaxMomdedxSigmaCut] = value;
2117  UpdateCutString();
2118  return kTRUE;
2119  } else return kFALSE;
2120  } else {
2122  return kTRUE;
2123  }
2125  if (!fSwitchToKappa){
2126  if( SetLowPRejectionCuts(value)) {
2127  fCuts[kLowPRejectionSigmaCut] = value;
2128  UpdateCutString();
2129  return kTRUE;
2130  } else return kFALSE;
2131  } else {
2133  return kTRUE;
2134  }
2135  case kTOFelectronPID:
2136  if( SetTOFElectronPIDCut(value)) {
2137  fCuts[kTOFelectronPID] = value;
2138  UpdateCutString();
2139  return kTRUE;
2140  } else return kFALSE;
2141 
2142  case kQtMaxCut:
2143  if( SetQtMaxCut(value)) {
2144  fCuts[kQtMaxCut] = value;
2145  UpdateCutString();
2146  return kTRUE;
2147  } else return kFALSE;
2148 
2149 
2150  case kchi2GammaCut:
2151  if( SetChi2GammaCut(value)) {
2152  fCuts[kchi2GammaCut] = value;
2153  UpdateCutString();
2154  return kTRUE;
2155  } else return kFALSE;
2156 
2157  case kPsiPair:
2158  if( SetPsiPairCut(value)) {
2159  fCuts[kPsiPair] = value;
2160  UpdateCutString();
2161  return kTRUE;
2162  } else return kFALSE;
2163 
2164  case kdoPhotonAsymmetryCut:
2165  if( SetPhotonAsymmetryCut(value)) {
2166  fCuts[kdoPhotonAsymmetryCut] = value;
2167  UpdateCutString();
2168  return kTRUE;
2169  } else return kFALSE;
2170 
2171  case kCosPAngle:
2172  if( SetCosPAngleCut(value)) {
2173  fCuts[kCosPAngle] = value;
2174  UpdateCutString();
2175  return kTRUE;
2176  } else return kFALSE;
2177 
2178  case kElecShare:
2179  if( SetSharedElectronCut(value)) {
2180  fCuts[kElecShare] = value;
2181  UpdateCutString();
2182  return kTRUE;
2183  } else return kFALSE;
2184 
2185  case kToCloseV0s:
2186  if( SetToCloseV0sCut(value)) {
2187  fCuts[kToCloseV0s] = value;
2188  UpdateCutString();
2189  return kTRUE;
2190  } else return kFALSE;
2191 
2192  case kDcaRPrimVtx:
2193  if( SetDCARPhotonPrimVtxCut(value)) {
2194  fCuts[kDcaRPrimVtx] = value;
2195  UpdateCutString();
2196  return kTRUE;
2197  } else return kFALSE;
2198 
2199  case kDcaZPrimVtx:
2200  if( SetDCAZPhotonPrimVtxCut(value)) {
2201  fCuts[kDcaZPrimVtx] = value;
2202  UpdateCutString();
2203  return kTRUE;
2204  } else return kFALSE;
2205 
2206  case kInPlaneOutOfPlane:
2207  if( SetInPlaneOutOfPlane(value)) {
2208  fCuts[kInPlaneOutOfPlane] = value;
2209  UpdateCutString();
2210  return kTRUE;
2211  } else return kFALSE;
2212 
2213  case kITSelectronPID:
2214  if( SetITSElectronPIDCut(value)) {
2215  fCuts[kITSelectronPID] = value;
2216  UpdateCutString();
2217  return kTRUE;
2218  } else return kFALSE;
2219 
2220  case kTRDelectronPID:
2221  if( SetTRDElectronPIDCut(value)) {
2222  fCuts[kTRDelectronPID] = value;
2223  UpdateCutString();
2224  return kTRUE;
2225  } else return kFALSE;
2226 
2227  case kNCuts:
2228  AliError("Cut id out of range");
2229  return kFALSE;
2230  }
2231 
2232  AliError("Cut id %d not recognized");
2233  return kFALSE;
2234 }
2237  // Print out current Cut Selection
2238  for(Int_t ic = 0; ic < kNCuts; ic++) {
2239  printf("%-30s : %d \n", fgkCutNames[ic], fCuts[ic]);
2240  }
2241 }
2242 
2244  // Print out current Cut Selection with value
2245  printf("\nConversion cutnumber \n");
2246  for(Int_t ic = 0; ic < kNCuts; ic++) {
2247  printf("%d",fCuts[ic]);
2248  }
2249  printf("\n\n");
2250  printf("Electron cuts & Secondary Track Cuts - only track from secondaries enter analysis: \n");
2251  printf("\t no like sign pairs from V0s \n");
2252  if (!fUseCorrectedTPCClsInfo) printf("\t # TPC clusters > %3.2f \n", fMinClsTPC);
2253  if (fEtaCutMin > -0.1) printf("\t %3.2f < eta_{e} < %3.2f\n", fEtaCutMin, fEtaCut );
2254  else printf("\t eta_{e} < %3.2f\n", fEtaCut );
2255  printf("\t reject: %3.2f < phi < %3.2f with %3.2f < eta < %3.2f \n", fMinPhiCut, fMaxPhiCut, fEtaForPhiCutMin, fEtaForPhiCutMax);
2256  if(fDoAsymPtCut)
2257  printf("\t Asymmetric cut: p_{T,e1} > %3.2f and p_{T,e2} > %3.2f\n", fSinglePtCut, fSinglePtCut2 );
2258  else
2259  printf("\t p_{T,e} > %3.2f\n", fSinglePtCut );
2260  printf("\t TPC refit \n");
2261  printf("\t no kinks \n");
2262  if (!fSwitchToKappa){
2263  printf("\t accept: %3.2f < n sigma_{e,TPC} < %3.2f\n", fPIDnSigmaBelowElectronLine, fPIDnSigmaAboveElectronLine );
2264  printf("\t reject: %3.2f < p_{e,T} < %3.2f, n sigma_{pi,TPC} < %3.2f\n", fPIDMinPnSigmaAbovePionLine, fPIDMaxPnSigmaAbovePionLine, fPIDnSigmaAbovePionLine );
2265  printf("\t reject: p_{e,T} > %3.2f, n sigma_{pi,TPC} < %3.2f\n", fPIDMaxPnSigmaAbovePionLine, fPIDnSigmaAbovePionLineHighPt );
2266  if (fDoPionRejectionLowP) printf("\t reject: p_{e,T} < %3.2f, -%3.2f < n sigma_{pi,TPC} < %3.2f\n", fPIDMinPPionRejectionLowP, fPIDnSigmaAtLowPAroundPionLine, fPIDnSigmaAtLowPAroundPionLine );
2267  if (fDoKaonRejectionLowP) printf("\t reject: -%3.2f < n sigma_{K,TPC} < %3.2f\n", fPIDnSigmaAtLowPAroundKaonLine, fPIDnSigmaAtLowPAroundKaonLine );
2268  if (fDoProtonRejectionLowP) printf("\t reject: -%3.2f < n sigma_{p,TPC} < %3.2f\n", fPIDnSigmaAtLowPAroundProtonLine, fPIDnSigmaAtLowPAroundProtonLine );
2269  } else {
2270  printf("\t accept: %3.2f <= Kappa_{TPC} < %3.2f\n", fKappaMinCut, fKappaMaxCut );
2271  }
2272  if (fUseTOFpid) printf("\t accept: %3.2f < n sigma_{e,TOF} < %3.2f\n", fTofPIDnSigmaBelowElectronLine, fTofPIDnSigmaAboveElectronLine);
2273  if (fUseITSpid) printf("\t accept: %3.2f < n sigma_{e,ITS} < %3.2f\n -- up to pT %3.2f", fITSPIDnSigmaBelowElectronLine, fITSPIDnSigmaAboveElectronLine, fMaxPtPIDITS);
2274 
2275  printf("Photon cuts: \n");
2276  if (fUseOnFlyV0Finder) printf("\t using Onfly V0 finder \n");
2277  else printf("\t using Offline V0 finder \n");
2278  if (fDo2DQt){
2279  printf("\t 2 dimensional q_{T} cut applied with maximum of %3.2f \n", fQtMax );
2280  } else {
2281  printf("\t 1 dimensional q_{T} cut applied with maximum of %3.2f \n", fQtMax );
2282  }
2283  if (fDo2DPsiPairChi2){
2284  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 );
2285  } else {
2286  printf("\t chi^{2} max cut chi^{2} < %3.2f \n", fChi2CutConversion );
2287  printf("\t psi_{pair} max cut |psi_{pair}| < %3.2f \n", fPsiPairCut );
2288  }
2289  printf("\t %3.2f < R_{conv} < %3.2f\n", fMinR, fMaxR );
2290  printf("\t Z_{conv} < %3.2f\n", fMaxZ );
2291  if (fEtaCutMin > -0.1) printf("\t %3.2f < eta_{conv} < %3.2f\n", fEtaCutMin, fEtaCut );
2292  else printf("\t eta_{conv} < %3.2f\n", fEtaCut );
2293  if (fDoPhotonAsymmetryCut) printf("\t for p_{T,track} > %3.2f, A_{gamma} < %3.2f \n", fMinPPhotonAsymmetryCut, fMinPhotonAsymmetry );
2294  if (fDoPhotonPDependentAsymCut && fDoPhotonAsymmetryCut) printf("\t p-dependent asymmetry cut \n");
2295  if (fUseCorrectedTPCClsInfo) printf("\t #cluster TPC/ #findable clusters TPC (corrected for radius) > %3.2f\n", fMinClsTPCToF );
2296  printf("\t p_{T,gamma} > %3.2f\n", fPtCut );
2297  printf("\t cos(Theta_{point}) > %3.2f \n", fCosPAngleCut );
2298  printf("\t dca_{R} < %3.2f \n", fDCARPrimVtxCut );
2299  printf("\t dca_{Z} < %3.2f \n", fDCAZPrimVtxCut );
2300  if (fDoPhotonQualitySelectionCut) printf("\t selection based on photon quality with quality %d \n", fPhotonQualityCut );
2301  if (fDoPhotonQualityRejectionCut) printf("\t rejection based on photon quality with quality %d \n", fPhotonQualityCut );
2302  if (fDoDoubleCountingCut) printf("\t Reject doubly counted photons with R > %3.2f, DeltaR < %3.2f, OpenAngle < %3.2f \n", fMinRDC, fDeltaR,fOpenAngle );
2303 
2304 }
2305 
2308  switch (v0FinderType){
2309  case 0: // on fly V0 finder
2310  cout << "have chosen onfly V0" << endl;
2311  fUseOnFlyV0Finder=kTRUE;
2313  break;
2314  case 1: // offline V0 finder
2315  cout << "have chosen offline V0" << endl;
2316  fUseOnFlyV0Finder=kFALSE;
2318  break;
2319  case 2: // on fly V0 finder with same signs
2320  cout << "have chosen onfly V0 same sign pairing" << endl;
2321  fUseOnFlyV0Finder=kTRUE;
2323  break;
2324  case 3: // on fly V0 finder with unlike signs and same signs
2325  cout << "have chosen onfly V0 unlike sign and same signs pairing" << endl;
2326  fUseOnFlyV0Finder=kTRUE;
2328  break;
2329  default:
2330  AliError(Form(" v0FinderType not defined %d",v0FinderType));
2331  return kFALSE;
2332  }
2333  return kTRUE;
2334 }
2335 
2338 
2339  //Set Standard LineCutZValues
2340  fLineCutZValueMin = -2;
2341  fLineCutZValue = 7.;
2342 
2343  switch(etaCut){
2344  case 0: // 0.9
2345  fEtaCut = 0.9;
2346  fLineCutZRSlope = tan(2*atan(exp(-fEtaCut)));
2347  fEtaCutMin = -0.1;
2348  fLineCutZRSlopeMin = 0.;
2349  break;
2350  case 1: // 0.6 // changed from 1.2 to 0.6 on 2013.06.10
2351  fEtaCut = 0.6;
2352  fLineCutZRSlope = tan(2*atan(exp(-fEtaCut)));
2353  fEtaCutMin = -0.1;
2354  fLineCutZRSlopeMin = 0.;
2355  break;
2356  case 2: // 1.4
2357  fEtaCut = 1.4;
2358  fLineCutZRSlope = tan(2*atan(exp(-fEtaCut)));
2359  fEtaCutMin = -0.1;
2360  fLineCutZRSlopeMin = 0.;
2361  break;
2362  case 3: // 0.65
2363  fEtaCut = 0.65;
2364  fLineCutZRSlope = tan(2*atan(exp(-fEtaCut)));
2365  fEtaCutMin = -0.1;
2366  fLineCutZRSlopeMin = 0.;
2367  break;
2368  case 4: // 0.75
2369  fEtaCut = 0.75;
2370  fLineCutZRSlope = tan(2*atan(exp(-fEtaCut)));
2371  fEtaCutMin = -0.1;
2372  fLineCutZRSlopeMin = 0.;
2373  break;
2374  case 5: // 0.5
2375  fEtaCut = 0.5;
2376  fLineCutZRSlope = tan(2*atan(exp(-fEtaCut)));
2377  fEtaCutMin = -0.1;
2378  fLineCutZRSlopeMin = 0.;
2379  break;
2380  case 6: // 5.
2381  fEtaCut = 5.;
2382  fLineCutZRSlope = tan(2*atan(exp(-fEtaCut)));
2383  fEtaCutMin = -0.1;
2384  fLineCutZRSlopeMin = 0.;
2385  break;
2386  case 7:
2387  if (fIsHeavyIon==1){
2388  fEtaCut = 0.7;
2389  fLineCutZRSlope = tan(2*atan(exp(-fEtaCut)));
2390  fEtaCutMin = -0.1;
2391  fLineCutZRSlopeMin = 0.;
2392  break;
2393  } else {
2394  fEtaCut = 0.3;
2395  fLineCutZRSlope = tan(2*atan(exp(-fEtaCut)));
2396  fEtaCutMin = -0.1;
2397  fLineCutZRSlopeMin = 0.;
2398  break;
2399  }
2400  // case 8: // 0.1 - 0.8
2401  // fEtaCut = 0.9;
2402  // fLineCutZRSlope = tan(2*atan(exp(-fEtaCut)));
2403  // fEtaCutMin = 0.1;
2404  // fLineCutZRSlopeMin = tan(2*atan(exp(-fEtaCutMin)));
2405  // break;
2406  case 8: // 0.4
2407  fEtaCut = 0.4;
2408  fLineCutZRSlope = tan(2*atan(exp(-fEtaCut)));
2409  fEtaCutMin = -0.1;
2410  fLineCutZRSlopeMin = 0.;
2411  break;
2412  case 9: // 10
2413  fEtaCut = 10;
2414  fLineCutZRSlope = tan(2*atan(exp(-fEtaCut)));
2415  fEtaCutMin = -0.1;
2416  fLineCutZRSlopeMin = 0.;
2417  break;
2418  case 10: // 0.2-0.9
2419  fEtaCut = 0.9;
2420  fLineCutZRSlope = tan(2*atan(exp(-fEtaCut)));
2421  fEtaCutMin = 0.2;
2422  fLineCutZRSlopeMin = 0.;
2423  break;
2424  case 11: // 0.2-0.9
2425  fEtaCut = 0.9;
2426  fLineCutZRSlope = tan(2*atan(exp(-fEtaCut)));
2427  fEtaCutMin = 0.2;
2428  fLineCutZRSlopeMin = tan(2*atan(exp(-fEtaCutMin)));
2429  break;
2430  case 12: // 0.85
2431  fEtaCut = 0.85;
2432  fLineCutZRSlope = tan(2*atan(exp(-fEtaCut)));
2433  fEtaCutMin = -0.1;
2434  fLineCutZRSlopeMin = 0.;
2435  break;
2436  case 13: // 0.8
2437  fEtaCut = 0.8;
2438  fLineCutZRSlope = tan(2*atan(exp(-fEtaCut)));
2439  fEtaCutMin = -0.1;
2440  fLineCutZRSlopeMin = 0.;
2441  break;
2442  default:
2443  AliError(Form(" EtaCut not defined %d",etaCut));
2444  return kFALSE;
2445  }
2446  return kTRUE;
2447 }
2448 
2451  // Set Cut
2452  switch(RCut){
2453  case 0:
2454  fMinR=0;
2455  fMaxR = 180.;
2456  break;
2457  case 1:
2458  fMinR=2.8;
2459  fMaxR = 180.;
2460  break;
2461  case 2:
2462  fMinR=5.;
2463  fMaxR = 180.;
2464  break;
2465  case 3:
2466  fMaxR = 70.;
2467  fMinR = 10.;
2468  break;
2469  case 4:
2470  fMaxR = 70.;
2471  fMinR = 5.;
2472  break;
2473  case 5:
2474  fMaxR = 180.;
2475  fMinR = 10.;
2476  break;
2477  case 6:
2478  fMaxR = 180.;
2479  fMinR = 20.;
2480  break;
2481  case 7:
2482  fMaxR = 180.;
2483  fMinR = 35.; //old 26.
2484  break;
2485  case 8:
2486  fMaxR = 180.;
2487  fMinR = 12.5;
2488  break;
2489  case 9:
2490  fMaxR = 180.;
2491  fMinR = 7.5;
2492  break;
2493  case 10:
2494  fMaxR = 33.5;
2495  fMinR = 5.;
2496  break;
2497  case 11:
2498  fMaxR = 72.;
2499  fMinR = 33.5;
2500  break;
2501  case 12:
2502  fMaxR = 180.;
2503  fMinR = 72.;
2504  break;
2505  case 13:
2506  fMaxR = 55.;
2507  fMinR = 5.;
2508  break;
2509  case 14:
2510  fMaxR = 180.;
2511  fMinR = 55.;
2512  break;
2513  case 15:
2514  fMaxR = 72.;
2515  fMinR = 5.;
2516  break;
2517  case 16:
2518  fMaxR = 180.;
2519  fMinR = 95.;
2520  break;
2521 
2522  default:
2523  AliError("RCut not defined");
2524  return kFALSE;
2525  }
2526  return kTRUE;
2527 }
2528 
2531 
2532  switch(etaPhiCut) {
2533  case 0: //no specific eta range selected, full eta range
2536  break;
2537  case 1: //eta < 0 only
2540  fEtaForPhiCutMax = 0.;
2541  break;
2542  case 2://eta > 0 only
2544  fEtaForPhiCutMin = 0.;
2546  break;
2547  default:
2548  AliError(Form("EtaForPhiCut not defined %d",etaPhiCut));
2549  return kFALSE;
2550  }
2551 
2552  return kTRUE;
2553 }
2554 
2556 // This are exclusion cuts, everything between fMinPhiCut & fMaxPhiCut will be excluded
2558 
2559  switch(minPhiCut) {
2560  case 0:
2561  fDoShrinkTPCAcceptance = kFALSE;
2562  fMinPhiCut = 0;
2563  break;
2564  case 1:
2566  fMinPhiCut = 1.7; //OROC C08 large cut
2567  break;
2568  case 2:
2570  fMinPhiCut = 4.4; //EMCal
2571  break;
2572  case 3:
2574  fMinPhiCut = 1.0; //PHOS
2575  break;
2576  case 4:
2578  fMinPhiCut = 3.4; //EMCal tight
2579  break;
2580  case 5:
2582  fMinPhiCut = 2.0; //OROC C08 medium cut
2583  break;
2584  case 6:
2586  fMinPhiCut = 2.2; //OROC C08 small cut
2587  break;
2588  case 7:
2590  fMinPhiCut = 2.4; //OROC C08 tightest cut
2591  break;
2592  case 8:
2594  fMinPhiCut = 4.54; //PHOS phi
2595  break;
2596  default:
2597  AliError(Form("MinPhiCut not defined %d",minPhiCut));
2598  return kFALSE;
2599  }
2600 
2601  return kTRUE;
2602 }
2603 
2605 // This are exclusion cuts, everything between fMinPhiCut & fMaxPhiCut will be excluded
2607 
2608  switch(maxPhiCut) {
2609  case 0:
2611  fMaxPhiCut = 2*TMath::Pi()+0.00001;
2612  break;
2613  case 1:
2615  fMaxPhiCut = 4.3; //OROC C08 large cut
2616  break;
2617  case 2:
2619  fMaxPhiCut = 5.8; //EMCal
2620  break;
2621  case 3:
2623  fMaxPhiCut = 3.0; //PHOS
2624  break;
2625  case 4:
2627  fMaxPhiCut = 1.; //EMCal
2628  break;
2629  case 5:
2631  fMaxPhiCut = 4.0; //OROC C08 medium cut
2632  break;
2633  case 6:
2635  fMaxPhiCut = 3.8; //OROC C08 small cut
2636  break;
2637  case 7:
2639  fMaxPhiCut = 3.6; //OROC C08 tighest cut
2640  break;
2641  case 8:
2643  fMaxPhiCut = 5.59; //PHOS phi
2644  break;
2645  default:
2646  AliError(Form("MaxPhiCut not defined %d",maxPhiCut));
2647  return kFALSE;
2648  }
2649 
2650  return kTRUE;
2651 }
2652 
2653 
2656  switch(singlePtCut){
2657  case 0: // 0.050 GeV + min gamma pT cut of 20 MeV
2658  fSinglePtCut = 0.050;
2659  fPtCut = 0.02;
2660  break;
2661  case 1: // 0.100 GeV + min gamma pT cut of 20 MeV
2662  fSinglePtCut = 0.100;
2663  fPtCut = 0.02;
2664  break;
2665  case 2: // 0.150 GeV + min gamma pT cut of 20 MeV
2666  fSinglePtCut = 0.150;
2667  fPtCut = 0.02;
2668  break;
2669  case 3: // 0.200 GeV + min gamma pT cut of 20 MeV
2670  fSinglePtCut = 0.200;
2671  fPtCut = 0.02;
2672  break;
2673  case 4: // 0.075 GeV + min gamma pT cut of 20 MeV
2674  fSinglePtCut = 0.075;
2675  fPtCut = 0.02;
2676  break;
2677  case 5: // 0.125 GeV + min gamma pT cut of 20 MeV
2678  fSinglePtCut = 0.125;
2679  fPtCut = 0.02;
2680  break;
2681  case 6: // 0.04 GeV + min gamma pT cut of 10 MeV
2682  fSinglePtCut = 0.040;
2683  fPtCut = 0.01;
2684  break;
2685  case 7: // 0.0 GeV + min gamma pT cut of 0 MeV
2686  fSinglePtCut = 0.0;
2687  fPtCut = 0.0;
2688  break;
2689  case 8: // 0.02 GeV + min gamma pT cut of 20 MeV, equivalent to .05 for the low B field runs
2690  fSinglePtCut = 0.02;
2691  fPtCut = 0.01;
2692  break;
2693  case 9: // 0.050 GeV + min gamma pT cut of 100 MeV
2694  fSinglePtCut = 0.050;
2695  fPtCut = 0.100;
2696  break;
2697  case 10: //a: 0.050 GeV + min gamma pT cut of 150 MeV
2698  fSinglePtCut = 0.050;
2699  fPtCut = 0.150;
2700  break;
2701  case 11: //b: 0.050 GeV + min gamma pT cut of 200 MeV
2702  fSinglePtCut = 0.050;
2703  fPtCut = 0.200;
2704  break;
2705  case 12: //c: 0.060 GeV
2706  fSinglePtCut = 0.060;
2707  break;
2708  case 13: //d: 0.060 GeV + min gamma pT cut of 100 MeV
2709  fSinglePtCut = 0.060;
2710  fPtCut = 0.100;
2711  break;
2712  case 14: //e: 0.060 GeV + min gamma pT cut of 150 MeV
2713  fSinglePtCut = 0.060;
2714  fPtCut = 0.150;
2715  break;
2716  case 15: //f: 0.060 GeV + min gamma pT cut of 200 MeV
2717  fSinglePtCut = 0.060;
2718  fPtCut = 0.200;
2719  break;
2720  case 16: //g: 0.075 GeV + min gamma pT cut of 150 MeV
2721  fSinglePtCut = 0.075;
2722  fPtCut = 0.150;
2723  break;
2724  case 17: //h: 0.100 GeV + min gamma pT cut of 200 MeV
2725  fSinglePtCut = 0.100;
2726  fPtCut = 0.200;
2727  break;
2728  case 18: //i: 0.150 GeV + min gamma pT cut of 300 MeV
2729  fSinglePtCut = 0.150;
2730  fPtCut = 0.300;
2731  break;
2732  case 19: //j: asym: 0.100 GeV and 0.075 GeV
2733  fSinglePtCut = 0.100;
2734  fDoAsymPtCut = kTRUE;
2735  fSinglePtCut2= 0.075;
2736  break;
2737  case 20: //k: asym: 0.150 GeV and 0.075 GeV
2738  fSinglePtCut = 0.150;
2739  fDoAsymPtCut = kTRUE;
2740  fSinglePtCut2= 0.075;
2741  break;
2742  case 21: //l: asym: 0.200 GeV and 0.075 GeV
2743  fSinglePtCut = 0.200;
2744  fDoAsymPtCut = kTRUE;
2745  fSinglePtCut2= 0.075;
2746  break;
2747  case 22: // m: 0.080 GeV + min gamma pT cut of 20 MeV
2748  fSinglePtCut = 0.080;
2749  fPtCut = 0.02;
2750  break;
2751  case 23: // n: 0.090 GeV + min gamma pT cut of 20 MeV
2752  fSinglePtCut = 0.090;
2753  fPtCut = 0.02;
2754  break;
2755  case 24: // o: 0.024 GeV + min gamma pT cut of 20 MeV ; equiv. 0.06 for lowB
2756  fSinglePtCut = 0.024;
2757  fPtCut = 0.01;
2758  break;
2759  case 25: // p: 0.030 GeV + min gamma pT cut of 20 MeV ; equiv. 0.075 for lowB
2760  fSinglePtCut = 0.030;
2761  fPtCut = 0.01;
2762  break;
2763  case 26: // q: 0.032 GeV + min gamma pT cut of 20 MeV ; equiv. 0.08 for lowB
2764  fSinglePtCut = 0.032;
2765  fPtCut = 0.01;
2766  break;
2767  case 27: // r: 0.036 GeV + min gamma pT cut of 20 MeV ; equiv. 0.09 for lowB
2768  fSinglePtCut = 0.036;
2769  fPtCut = 0.01;
2770  break;
2771  case 28: // s: 0.040 GeV + min gamma pT cut of 20 MeV ; equiv. 0.075 for lowB
2772  fSinglePtCut = 0.040;
2773  fPtCut = 0.01;
2774  break;
2775 
2776  default:
2777  AliError(Form("singlePtCut not defined %d",singlePtCut));
2778  return kFALSE;
2779  }
2780  return kTRUE;
2781 }
2782 
2785  switch(clsTPCCut){
2786  case 0: // 0
2787  fMinClsTPC= 0.;
2788  break;
2789  case 1: // 60
2790  fMinClsTPC= 60.;
2791  break;
2792  case 2: // 80
2793  fMinClsTPC= 80.;
2794  break;
2795  case 3: // 100
2796  fMinClsTPC= 100.;
2797  break;
2798  case 4: // 95% of findable clusters
2799  fMinClsTPCToF= 0.95;
2801  break;
2802  case 5: // 0% of findable clusters
2803  fMinClsTPCToF= 0.0;
2805  break;
2806  case 6: // 70% of findable clusters
2807  fMinClsTPCToF= 0.7;
2809  break;
2810  case 7: // 0% of findable clusters
2811  fMinClsTPCToF= 0.35;
2813  break;
2814  case 8:
2815  fMinClsTPCToF= 0.35;
2817  break;
2818  case 9:
2819  fMinClsTPCToF= 0.6;
2821  break;
2822  default:
2823  AliError(Form("Warning: clsTPCCut not defined %d",clsTPCCut));
2824  return kFALSE;
2825  }
2826  return kTRUE;
2827 }
2828 
2831  switch(ededxSigmaCut){
2832  case 0: // -10,10
2835  break;
2836  case 1: // -5,5
2839  break;
2840  case 2: // -3,5
2843  break;
2844  case 3: // -4,5
2847  break;
2848  case 4: // -6,7
2851  break;
2852  case 5: // -4,4
2855  break;
2856  case 6: // -2.5,4
2859  break;
2860  case 7: // -2,3.5
2863  break;
2864  case 8: // -2.5,3.
2867  break;
2868  case 9: // -2.5,5.
2871  break;
2872  case 10: //a -3,3.
2875  break;
2876  case 11: //b -3.2,3.2.
2879  break;
2880  case 12: //c -2.8,2.8
2883  break;
2884  case 13: //d -1E9,1E9
2887  break;
2888  case 14: //e -7,1
2891  break;
2892  default:
2893  AliError("TPCdEdxCutElectronLine not defined");
2894  return kFALSE;
2895 
2896  }
2897  return kTRUE;
2898 }
2899 
2902 
2903  switch(pidedxSigmaCut){
2904  case 0: // -10
2907  break;
2908  case 1: // 0
2911  break;
2912  case 2: // 1
2915  break;
2916  case 3: // 1
2919  break;
2920  case 4: // 3.0sigma, 1.0 sigma at high pt
2923  break;
2924  case 5: // 1
2927  break;
2928  case 6: // 1
2931  break;
2932  case 7: // 1
2935  break;
2936  case 8: // 1
2939  break;
2940  case 9:
2941  fPIDnSigmaAbovePionLine=1; // We need a bit less tight cut on dE/dx
2943  break;
2944  case 10: //a
2945  fPIDnSigmaAbovePionLine=-3; // We need a bit less tight cut on dE/dx
2947  break;
2948  default:
2949  AliError(Form("Warning: pidedxSigmaCut not defined %d",pidedxSigmaCut));
2950  return kFALSE;
2951  }
2952  return kTRUE;
2953 }
2954 
2957  switch(piMomdedxSigmaCut){
2958  case 0: // 0.5 GeV
2960  break;
2961  case 1: // 1. GeV
2963  break;
2964  case 2: // 1.5 GeV
2966  break;
2967  case 3: // 20.0 GeV
2969  break;
2970  case 4: // 50.0 GeV
2972  break;
2973  case 5: // 0.3 GeV
2975  break;
2976  case 6: // 0.25 GeV
2978  break;
2979  case 7: // 0.4 GeV
2981  break;
2982  case 8: // 0.2 GeV
2984  break;
2985  default:
2986  AliError(Form("piMomdedxSigmaCut not defined %d",piMomdedxSigmaCut));
2987  return kFALSE;
2988  }
2989  return kTRUE;
2990 }
2991 
2994  switch(piMaxMomdedxSigmaCut){
2995  case 0: // 100. GeV
2997  break;
2998  case 1: // 5. GeV
3000  break;
3001  case 2: // 4. GeV
3003  break;
3004  case 3: // 3.5 GeV
3006  break;
3007  case 4: // 3. GeV
3009  break;
3010  case 5: // 7. GeV
3012  break;
3013  case 6: // 2. GeV
3015  break;
3016  default:
3017  AliError(Form("piMaxMomdedxSigmaCut not defined %d",piMaxMomdedxSigmaCut));
3018  return kFALSE;
3019  }
3020  return kTRUE;
3021 }
3022 
3025  switch(LowPRejectionSigmaCut){
3026  case 0: //
3030  fDoKaonRejectionLowP = kFALSE;
3031  fDoProtonRejectionLowP = kFALSE;
3032  fDoPionRejectionLowP = kFALSE;
3034  break;
3035  case 1: //
3039  fDoKaonRejectionLowP = kTRUE;
3040  fDoProtonRejectionLowP = kTRUE;
3041  fDoPionRejectionLowP = kTRUE;
3043  break;
3044  case 2: //
3048  fDoKaonRejectionLowP = kTRUE;
3049  fDoProtonRejectionLowP = kTRUE;
3050  fDoPionRejectionLowP = kTRUE;
3052  break;
3053  case 3: //
3057  fDoKaonRejectionLowP = kTRUE;
3058  fDoProtonRejectionLowP = kTRUE;
3059  fDoPionRejectionLowP = kTRUE;
3061  break;
3062  case 4: //
3066  fDoKaonRejectionLowP = kFALSE;
3067  fDoProtonRejectionLowP = kFALSE;
3068  fDoPionRejectionLowP = kTRUE;
3070  break;
3071  case 5: //
3075  fDoKaonRejectionLowP = kFALSE;
3076  fDoProtonRejectionLowP = kFALSE;
3077  fDoPionRejectionLowP = kTRUE;
3079  break;
3080  case 6: //
3084  fDoKaonRejectionLowP = kFALSE;
3085  fDoProtonRejectionLowP = kFALSE;
3086  fDoPionRejectionLowP = kTRUE;
3088  break;
3089  case 7: //
3093  fDoKaonRejectionLowP = kFALSE;
3094  fDoProtonRejectionLowP = kFALSE;
3095  fDoPionRejectionLowP = kTRUE;
3097  break;
3098  case 8: //
3102  fDoKaonRejectionLowP = kFALSE;
3103  fDoProtonRejectionLowP = kTRUE;
3104  fDoPionRejectionLowP = kFALSE;
3106  break;
3107  default:
3108  AliError(Form("LowPRejectionSigmaCut not defined %d",LowPRejectionSigmaCut));
3109  return kFALSE;
3110  }
3111  return kTRUE;
3112 }
3113 
3116  switch(kappaCut){
3117  case 0: // completely open
3118  fKappaMaxCut=200;
3119  fKappaMinCut=-200;
3120  break;
3121  case 1: // mainly pi pi
3122  fKappaMaxCut=-13;
3123  fKappaMinCut=-20;
3124  break;
3125  case 2: // mainly pi e
3126  fKappaMaxCut=-6;
3127  fKappaMinCut=-11;
3128  break;
3129  case 3: // signal
3130  fKappaMaxCut=5;
3131  fKappaMinCut=-3;
3132  break;
3133  case 4: // remaining
3134  fKappaMaxCut=20;
3135  fKappaMinCut=11;
3136  break;
3137  case 5: // -5-10 full signal peak(including background)
3138  fKappaMaxCut=10;
3139  fKappaMinCut=-5;
3140  break;
3141  case 6: //
3142  fKappaMaxCut=10;
3143  fKappaMinCut=-3;
3144  break;
3145  case 7: //
3146  fKappaMaxCut=10;
3147  fKappaMinCut=0;
3148  break;
3149  default:
3150  AliError("KappaTPCCut not defined");
3151  return kFALSE;
3152 
3153  }
3154  return kTRUE;
3155 }
3156 
3157 
3160  // Set Cut
3161  switch(TOFelectronPID){
3162  case 0: // no cut
3163  fUseTOFpid = kFALSE;
3166  break;
3167  case 1: // -7,7
3168  fUseTOFpid = kTRUE;
3171  break;
3172  case 2: // -5,5
3173  fUseTOFpid = kTRUE;
3176  break;
3177  case 3: // -3,5
3178  fUseTOFpid = kTRUE;
3181  break;
3182  case 4: // -2,3
3183  fUseTOFpid = kTRUE;
3186  break;
3187  case 5: // -3,3
3188  fUseTOFpid = kTRUE;
3191  break;
3192  default:
3193  AliError(Form("TOFElectronCut not defined %d",TOFelectronPID));
3194  return kFALSE;
3195  }
3196  return kTRUE;
3197 }
3198 
3201  // Set Cut
3202  switch(ITSelectronPID){
3203  case 0: // no cut
3204  fUseITSpid = kFALSE;
3207  fMaxPtPIDITS = 1.5;
3208  break;
3209  case 1: // -3,3
3210  fUseITSpid = kTRUE;
3213  fMaxPtPIDITS = 1.5;
3214  break;
3215  case 2: // -2,2
3216  fUseITSpid = kTRUE;
3219  fMaxPtPIDITS = 1.5;
3220  break;
3221  case 3: // -1,1
3222  fUseITSpid = kTRUE;
3225  fMaxPtPIDITS = 1.5;
3226  break;
3227  case 4: // -3,5
3228  fUseITSpid = kTRUE;
3231  fMaxPtPIDITS = 1.5;
3232  break;
3233  case 5: // -5,5
3234  fUseITSpid = kTRUE;
3237  fMaxPtPIDITS = 1.5;
3238  break;
3239  case 6: // -3,3
3240  fUseITSpid = kTRUE;
3243  fMaxPtPIDITS = 2;
3244  break;
3245  case 7: // -2,2
3246  fUseITSpid = kTRUE;
3249  fMaxPtPIDITS = 2;
3250  break;
3251  case 8: // -1,1
3252  fUseITSpid = kTRUE;
3255  fMaxPtPIDITS = 2;
3256  break;
3257  case 9: // -3,5
3258  fUseITSpid = kTRUE;
3261  fMaxPtPIDITS = 2;
3262  break;
3263  default:
3264  AliError(Form("ITSelectronPID not defined %d",ITSelectronPID));
3265  return kFALSE;
3266  }
3267  return kTRUE;
3268 }
3269 
3272  // Set Cut
3273  switch(TRDelectronPID){
3274  case 0: // no cut
3275  fDoTRDPID = kFALSE;
3276  fTRDPIDBelowCut=-100;
3277  fTRDPIDAboveCut=100;
3278  break;
3279  default:
3280  AliError(Form("TRDelectronPID not defined %d",TRDelectronPID));
3281  return kFALSE;
3282  }
3283  return kTRUE;
3284 }
3285 
3286 
3289  switch(QtMaxCut){
3290  case 0: //
3291  fQtMax=1.;
3292  fDoQtGammaSelection=kFALSE;
3293  fDo2DQt=kFALSE;
3294  break;
3295  case 1:
3296  fQtMax=0.1;
3297  fDo2DQt=kFALSE;
3298  break;
3299  case 2:
3300  fQtMax=0.06;
3301  fDo2DQt=kTRUE;
3302  break;
3303  case 3:
3304  fQtMax=0.05;
3305  fDo2DQt=kFALSE;
3306  break;
3307  case 4:
3308  fQtMax=0.03;
3309  fDo2DQt=kFALSE;
3310  break;
3311  case 5:
3312  fQtMax=0.02;
3313  fDo2DQt=kFALSE;
3314  break;
3315  case 6:
3316  fQtMax=0.02;
3317  fDo2DQt=kTRUE;
3318  break;
3319  case 7:
3320  fQtMax=0.15;
3321  fDo2DQt=kFALSE;
3322  break;
3323  case 8:
3324  fQtMax=0.05;
3325  fDo2DQt=kTRUE;
3326  break;
3327  case 9:
3328  fQtMax=0.03;
3329  fDo2DQt=kTRUE;
3330  break;
3331  default:
3332  AliError(Form("Warning: QtMaxCut not defined %d",QtMaxCut));
3333  return kFALSE;
3334  }
3335  return kTRUE;
3336 }
3337 
3340 
3341  switch(chi2GammaCut){
3342  case 0: // 100
3343  fChi2CutConversion = 100.;
3344  break;
3345  case 1: // 50
3346  fChi2CutConversion = 50.;
3347  break;
3348  case 2: // 30
3349  fChi2CutConversion = 30.;
3350  break;
3351  case 3:
3352  fChi2CutConversion = 200.;
3353  break;
3354  case 4:
3355  if (fIsHeavyIon==1){
3356  fChi2CutConversion = 7.;
3357  } else {
3358  fChi2CutConversion = 500.;
3359  }
3360  break;
3361  case 5:
3362  fChi2CutConversion = 100000.;
3363  break;
3364  case 6:
3365  fChi2CutConversion = 5.;
3366  break;
3367  case 7:
3368  fChi2CutConversion = 10.;
3369  break;
3370  case 8:
3371  fChi2CutConversion = 20.;
3372  break;
3373  case 9:
3374  fChi2CutConversion = 15.;
3375  break;
3376  case 10:
3377  fChi2CutConversion = 25.;
3378  break;
3379  case 11:
3380  fChi2CutConversion = 35.;
3381  break;
3382  case 12:
3383  fChi2CutConversion = 40.;
3384  break;
3385  case 13:
3386  fChi2CutConversion = 45.;
3387  break;
3388  case 14:
3389  fChi2CutConversion = 55.;
3390  break;
3391  default:
3392  AliError(Form("Warning: Chi2GammaCut not defined %d",chi2GammaCut));
3393  return kFALSE;
3394  }
3395  return kTRUE;
3396 }
3397 
3400  switch(psiCut) {
3401  case 0:
3402  fPsiPairCut = 10000; //
3403  break;
3404  case 1:
3405  fPsiPairCut = 0.1; //
3406  break;
3407  case 2:
3408  fPsiPairCut = 0.05; // Standard
3409  break;
3410  case 3:
3411  fPsiPairCut = 0.035; //
3412  break;
3413  case 4:
3414  fPsiPairCut = 0.2; //
3415  break;
3416  case 5:
3417  fPsiPairCut = 0.1; //
3418  fDo2DPsiPairChi2 = kTRUE;
3419  break;
3420  case 6:
3421  fPsiPairCut = 0.05; //
3422  fDo2DPsiPairChi2 = kTRUE;
3423  break;
3424  case 7:
3425  if (fIsHeavyIon==1){
3426  fPsiPairCut = 0.07; //
3427  } else {
3428  fPsiPairCut = 0.035; //
3429  }
3430  fDo2DPsiPairChi2 = kTRUE;
3431  break;
3432  case 8:
3433  fPsiPairCut = 0.2; //
3434  fDo2DPsiPairChi2 = kTRUE; //
3435  break;
3436  case 9:
3437  // if (fIsHeavyIon==1){ //AM 2016-05-13
3438  fPsiPairCut = 0.1; //
3439  fDo2DPsiPairChi2 = kTRUE;
3440  fIncludeRejectedPsiPair = kTRUE;
3441  break;
3442 
3443  case 10:
3444  fPsiPairCut = 0.25; //
3445  fDo2DPsiPairChi2 = kTRUE; //
3446  break;
3447 
3448  case 11:
3449  fPsiPairCut = 0.3; //
3450  fDo2DPsiPairChi2 = kTRUE; //
3451  break;
3452 
3453  case 12:
3454  fPsiPairCut = 0.15; //
3455  fDo2DPsiPairChi2 = kTRUE; //
3456  break;
3457 
3458 
3459  // } else {
3460  // fPsiPairCut = 0.5; //
3461  // break;
3462  // }
3463  default:
3464  AliError(Form("PsiPairCut not defined %d",psiCut));
3465  return kFALSE;
3466  }
3467 
3468  return kTRUE;
3469 }
3470 
3473  // Set Cut
3474  switch(doPhotonAsymmetryCut){
3475  case 0:
3479  break;
3480  case 1:
3483  fMinPhotonAsymmetry=0.04;
3484  break;
3485  case 2:
3488  fMinPhotonAsymmetry=0.06;
3489  break;
3490  case 3:
3493  fMinPhotonAsymmetry=0.05;
3494  break;
3495  case 4:
3498  fFAsymmetryCut = new TF1("fFAsymmetryCut","[0] + [1]*tanh(2*TMath::Power(x,[2]))",0.,100.);
3499  fFAsymmetryCut->SetParameter(0,0.3);
3500  fFAsymmetryCut->SetParameter(1,0.66);
3501  fFAsymmetryCut->SetParameter(2,0.7);
3504  break;
3505  case 5:
3508  fFAsymmetryCut = new TF1("fFAsymmetryCut","[0] + [1]*tanh(2*TMath::Power(x,[2]))",0.,100.);
3509  fFAsymmetryCut->SetParameter(0,0.14);
3510  fFAsymmetryCut->SetParameter(1,0.66);
3511  fFAsymmetryCut->SetParameter(2,0.5);
3514  break;
3515  case 6:
3518  fMinPhotonAsymmetry=0.05;
3519  break;
3520  case 7:
3523  fMinPhotonAsymmetry=0.05;
3524  break;
3525  case 8:
3528  fFAsymmetryCut = new TF1("fFAsymmetryCut","[0] + [1]*tanh(2*TMath::Power(x,[2]))",0.,100.);
3529  fFAsymmetryCut->SetParameter(0,0.5);
3530  fFAsymmetryCut->SetParameter(1,0.46);
3531  fFAsymmetryCut->SetParameter(2,0.7);
3534  break;
3535  default:
3536  AliError(Form("PhotonAsymmetryCut not defined %d",doPhotonAsymmetryCut));
3537  return kFALSE;
3538  }
3539  fCuts[kdoPhotonAsymmetryCut]=doPhotonAsymmetryCut;
3540  return kTRUE;
3541 }
3542 
3545 
3546  switch(cosCut){
3547  case 0:
3548  fCosPAngleCut = -1;
3549  break;
3550  case 1:
3551  fCosPAngleCut = 0;
3552  break;
3553  case 2:
3554  fCosPAngleCut = 0.5;
3555  break;
3556  case 3:
3557  fCosPAngleCut = 0.75;
3558  break;
3559  case 4:
3560  fCosPAngleCut = 0.85;
3561  break;
3562  case 5:
3563  fCosPAngleCut = 0.88;
3564  break;
3565  case 6:
3566  fCosPAngleCut = 0.9;
3567  break;
3568  case 7:
3569  fCosPAngleCut = 0.95;
3570  break;
3571  case 8:
3572  fCosPAngleCut = 0.98;
3573  break;
3574  case 9:
3575  fCosPAngleCut = 0.99;
3576  break;
3577  case 10://a
3578  fCosPAngleCut = 0.995;
3579  break;
3580  case 11://b
3581  fCosPAngleCut = 0.985;
3582  break;
3583  case 12://c
3584  fCosPAngleCut = 0.996;
3585  break;
3586  case 13://d
3587  fCosPAngleCut = 0.997;
3588  break;
3589  case 14://e
3590  fCosPAngleCut = 0.998;
3591  break;
3592  case 15://f
3593  fCosPAngleCut = 0.999;
3594  break;
3595  default:
3596  AliError(Form("Cosine Pointing Angle cut not defined %d",cosCut));
3597  return kFALSE;
3598  }
3599 
3600  return kTRUE;
3601 }
3602 
3605 
3606  switch(sharedElec){
3607  case 0:
3608  fDoSharedElecCut = kFALSE;
3611  fPhotonQualityCut = 0;
3612  break;
3613  case 1:
3614  fDoSharedElecCut = kTRUE;
3617  fPhotonQualityCut = 0;
3618  break;
3619  case 2:
3620  fDoSharedElecCut = kFALSE;
3623  fPhotonQualityCut = 1;
3624  break;
3625  case 3:
3626  fDoSharedElecCut = kFALSE;
3629  fPhotonQualityCut = 2;
3630  break;
3631  case 4:
3632  fDoSharedElecCut = kFALSE;
3635  fPhotonQualityCut = 3;
3636  break;
3637  case 5://Cat1 rejection
3638  fDoSharedElecCut = kFALSE;
3641  fPhotonQualityCut = 1;
3642  break;
3643  default:
3644  AliError(Form("Shared Electron Cut not defined %d",sharedElec));
3645  return kFALSE;
3646  }
3647 
3648  return kTRUE;
3649 }
3650 
3653 
3654  switch(toClose){
3655  case 0:
3656  fDoToCloseV0sCut = kFALSE;
3657  fminV0Dist = 250;
3658  break;
3659  case 1:
3660  fDoToCloseV0sCut = kTRUE;
3661  fminV0Dist = 1;
3662  break;
3663  case 2:
3664  fDoToCloseV0sCut = kTRUE;
3665  fminV0Dist = 2;
3666  break;
3667  case 3:
3668  fDoToCloseV0sCut = kTRUE;
3669  fminV0Dist = 3;
3670  break;
3671  case 4:
3672  fDoToCloseV0sCut = kTRUE;
3673  fDoDoubleCountingCut = kTRUE;
3674  fMinRDC=0.;
3675  fDeltaR=6.;
3676  fOpenAngle=0.02;
3677  break;
3678  case 5:
3679  fDoToCloseV0sCut = kTRUE;
3680  fDoDoubleCountingCut = kTRUE;
3681  fMinRDC=0.;
3682  fDeltaR=6.;
3683  fOpenAngle=0.03;
3684  break;
3685  case 6:
3686  fDoToCloseV0sCut = kTRUE;
3687  fDoDoubleCountingCut = kTRUE;
3688  fMinRDC=0.;
3689  fDeltaR=6.;
3690  fOpenAngle=0.04;
3691  break;
3692 
3693  default:
3694  AliError(Form("Shared Electron Cut not defined %d",toClose));
3695  return kFALSE;
3696  }
3697  return kTRUE;
3698 }
3699 
3702  switch(TRDElectronCut){
3703  case 0:
3704  fDoTRDPID=kFALSE;
3705  break;
3706  case 1:
3707  fDoTRDPID=kTRUE;
3708  fPIDTRDEfficiency=0.1;
3709  break;
3710  case 8:
3711  fDoTRDPID=kTRUE;
3712  fPIDTRDEfficiency=0.8;
3713  break;
3714  case 9:
3715  fDoTRDPID=kTRUE;
3716  fPIDTRDEfficiency=0.9;
3717  break;
3718  default:
3719  AliError(Form("TRDElectronCut not defined %d",TRDElectronCut));
3720  return kFALSE;
3721  }
3722 
3723  return kTRUE;
3724 }
3725 
3728  // Set Cut
3729  switch(DCAZPhotonPrimVtx){
3730  case 0: //
3731  fDCAZPrimVtxCut = 1000;
3732  break;
3733  case 1: //
3734  fDCAZPrimVtxCut = 10;
3735  break;
3736  case 2: //
3737  fDCAZPrimVtxCut = 5;
3738  break;
3739  case 3: //
3740  fDCAZPrimVtxCut = 4;
3741  break;
3742  case 4: //
3743  fDCAZPrimVtxCut = 3;
3744  break;
3745  case 5: //
3746  fDCAZPrimVtxCut = 2.5;
3747  break;
3748  case 6: //
3749  fDCAZPrimVtxCut = 2;
3750  break;
3751  case 7: //
3752  fDCAZPrimVtxCut = 1.5;
3753  break;
3754  case 8: //
3755  fDCAZPrimVtxCut = 1;
3756  break;
3757  case 9: //
3758  fDCAZPrimVtxCut = 0.5;
3759  break;
3760  default:
3761  cout<<"Warning: DCAZPhotonPrimVtx not defined "<<DCAZPhotonPrimVtx<<endl;
3762  return kFALSE;
3763  }
3764  return kTRUE;
3765 }
3766 
3769  // Set Cut
3770  switch(DCARPhotonPrimVtx){
3771  case 0: //
3772  fDCARPrimVtxCut = 1000;
3773  break;
3774  case 1: //
3775  fDCARPrimVtxCut = 10;
3776  break;
3777  case 2: //
3778  fDCARPrimVtxCut = 5;
3779  break;
3780  case 3: //
3781  fDCARPrimVtxCut = 4;
3782  break;
3783  case 4: //
3784  fDCARPrimVtxCut = 3;
3785  break;
3786  case 5: //
3787  fDCARPrimVtxCut = 2.5;
3788  break;
3789  case 6: //
3790  fDCARPrimVtxCut = 2;
3791  break;
3792  case 7: //
3793  fDCARPrimVtxCut = 1.5;
3794  break;
3795  case 8: //
3796  fDCARPrimVtxCut = 1;
3797  break;
3798  case 9: //
3799  fDCARPrimVtxCut = 0.5;
3800  break;
3801  default:
3802  cout<<"Warning: DCARPhotonPrimVtx not defined "<<DCARPhotonPrimVtx<<endl;
3803  return kFALSE;
3804  }
3805  return kTRUE;
3806 }
3807 
3810  // Set Cut
3811  switch(inOutPlane){
3812  case 0: //
3813  fInPlaneOutOfPlane = 0; // No Event Plane
3814  break;
3815  case 1: //
3816  fInPlaneOutOfPlane = 1; // In-Plane
3817  break;
3818  case 2: //
3819  fInPlaneOutOfPlane = 2; // Out-Of-Plane
3820  break;
3821  default:
3822  cout<<"Warning: In-Plane or Out-Of-Plane not defined "<<inOutPlane<<endl;
3823  return kFALSE;
3824  }
3825  return kTRUE;
3826 }
3827 
3828 
3831  // Get first TPC row
3832  Int_t firstTPCRow = 0;
3833  Double_t radiusI = 84.8;
3834  Double_t radiusO = 134.6;
3835  Double_t radiusOB = 198.;
3836  Double_t rSizeI = 0.75;
3837  Double_t rSizeO = 1.;
3838  Double_t rSizeOB = 1.5;
3839  Int_t nClsI = 63;
3840  Int_t nClsIO = 127;
3841 
3842  if(radius <= radiusI){
3843  return firstTPCRow;
3844  }
3845  if(radius>radiusI && radius<=radiusO){
3846  firstTPCRow = (Int_t)((radius-radiusI)/rSizeI);
3847  }
3848  if(radius>radiusO && radius<=radiusOB){
3849  firstTPCRow = (Int_t)(nClsI+(radius-radiusO)/rSizeO);
3850  }
3851 
3852  if(radius>radiusOB){
3853  firstTPCRow =(Int_t)(nClsIO+(radius-radiusOB)/rSizeOB);
3854  }
3855 
3856  return firstTPCRow;
3857 }
3858 
3862  if(GetCosineOfPointingAngle(photon, event) < fCosPAngleCut){
3863  return kFALSE;
3864  }
3865  return kTRUE;
3866 }
3867 
3870  // calculates the pointing angle of the recalculated V0
3871 
3872  Double_t momV0[3] = {0,0,0};
3873  if(event->IsA()==AliESDEvent::Class()){
3874  AliESDEvent *esdEvent = dynamic_cast<AliESDEvent*>(event);
3875  if(!esdEvent) return -999;
3876  AliESDv0 *v0 = esdEvent->GetV0(photon->GetV0Index());
3877  if(!v0) return -999;
3878  v0->GetPxPyPz(momV0[0],momV0[1],momV0[2]);
3879  }
3880  if(event->IsA()==AliAODEvent::Class()){
3881  momV0[0] = photon->GetPx();
3882  momV0[1] = photon->GetPy();
3883  momV0[2] = photon->GetPz();
3884  }
3885 
3886  //Double_t momV0[3] = { photon->GetPx(), photon->GetPy(), photon->GetPz() }; //momentum of the V0
3887  Double_t PosV0[3] = { photon->GetConversionX() - event->GetPrimaryVertex()->GetX(),
3888  photon->GetConversionY() - event->GetPrimaryVertex()->GetY(),
3889  photon->GetConversionZ() - event->GetPrimaryVertex()->GetZ() }; //Recalculated V0 Position vector
3890 
3891  Double_t momV02 = momV0[0]*momV0[0] + momV0[1]*momV0[1] + momV0[2]*momV0[2];
3892  Double_t PosV02 = PosV0[0]*PosV0[0] + PosV0[1]*PosV0[1] + PosV0[2]*PosV0[2];
3893 
3894 
3895  Double_t cosinePointingAngle = -999;
3896  if(momV02*PosV02 > 0.0)
3897  cosinePointingAngle = (PosV0[0]*momV0[0] + PosV0[1]*momV0[1] + PosV0[2]*momV0[2] ) / TMath::Sqrt(momV02 * PosV02);
3898 
3899  return cosinePointingAngle;
3900 }
3901 
3904 
3905  if (fDo2DPsiPairChi2){
3907  if (TMath::Abs(photon->GetPsiPair()) < -fPsiPairCut/fChi2CutConversion*photon->GetChi2perNDF() + fPsiPairCut || (photon->GetPsiPair()) == 4){
3908  return kTRUE;
3909  } else {
3910  return kFALSE;
3911  }
3912 
3913  } else {
3914  if (TMath::Abs(photon->GetPsiPair()) < -fPsiPairCut/fChi2CutConversion*photon->GetChi2perNDF() + fPsiPairCut ){
3915  return kTRUE;
3916  } else {
3917  return kFALSE;
3918  }
3919  }
3920  } else {
3922  if(TMath::Abs(photon->GetPsiPair()) > fPsiPairCut || (photon->GetPsiPair()) != 4){
3923  return kFALSE;
3924  } else {
3925  return kTRUE;
3926  }
3927  } else {
3928  if(TMath::Abs(photon->GetPsiPair()) > fPsiPairCut){
3929  return kFALSE;
3930  } else {
3931  return kTRUE;
3932  }
3933  }
3934  }
3935 }
3936 
3939  // returns TString with current cut number
3940  return fCutStringRead;
3941 }
3942 
3945 
3946  Int_t posLabel = photon->GetTrackLabelPositive();
3947  Int_t negLabel = photon->GetTrackLabelNegative();
3948 
3949  fElectronLabelArray[nV0*2] = posLabel;
3950  fElectronLabelArray[(nV0*2)+1] = negLabel;
3951 }
3952 
3955 
3956  Int_t posLabel = photon->GetTrackLabelPositive();
3957  Int_t negLabel = photon->GetTrackLabelNegative();
3958 
3959  for(Int_t i = 0; i<nV0s*2;i++){
3960  if(i==nV0*2) continue;
3961  if(i==(nV0*2)+1) continue;
3962  if(fElectronLabelArray[i] == posLabel){
3963  return kFALSE;}
3964  if(fElectronLabelArray[i] == negLabel){
3965  return kFALSE;}
3966  }
3967 
3968  return kTRUE;
3969 }
3970 
3973 
3974  if (fDoDoubleCountingCut && photon->GetConversionRadius() < fMinRDC) return kTRUE;
3975 
3976  Double_t posX = photon->GetConversionX();
3977  Double_t posY = photon->GetConversionY();
3978  Double_t posZ = photon->GetConversionZ();
3979 
3980  for(Int_t i = 0;i<photons->GetEntries();i++){
3981  if(nV0 == i) continue;
3982  AliAODConversionPhoton *photonComp = (AliAODConversionPhoton*) photons->At(i);
3983  Double_t posCompX = photonComp->GetConversionX();
3984  Double_t posCompY = photonComp->GetConversionY();
3985  Double_t posCompZ = photonComp->GetConversionZ();
3986 
3987  if (!fDoDoubleCountingCut){
3988  Double_t dist = pow((posX - posCompX),2)+pow((posY - posCompY),2)+pow((posZ - posCompZ),2);
3989 
3990  if(dist < fminV0Dist*fminV0Dist){
3991  if(photon->GetChi2perNDF() > photonComp->GetChi2perNDF()) return kFALSE;
3992  }
3993  }else{
3994  TVector3 v1(photon->Px(),photon->Py(),photon->Pz());
3995  TVector3 v2(photonComp->Px(),photonComp->Py(),photonComp->Pz());
3996  Double_t OpeningAngle=v1.Angle(v2);
3997  if( OpeningAngle < fOpenAngle && TMath::Abs(photon->GetConversionRadius()-photonComp->GetConversionRadius()) < fDeltaR){
3998  if(photon->GetChi2perNDF() > photonComp->GetChi2perNDF()) return kFALSE;
3999  }
4000  }
4001 
4002  }
4003  return kTRUE;
4004 }
4005 
4006 
4009  //Create and return standard 2010 PbPb cuts
4010  AliConversionPhotonCuts *cuts=new AliConversionPhotonCuts("StandardCuts2010PbPb","StandardCuts2010PbPb");
4011  if(!cuts->InitializeCutsFromCutString("04209297002322000000")){
4012  cout<<"Warning: Initialization of Standardcuts2010PbPb failed"<<endl;}
4013  return cuts;
4014 }
4015 
4018  //Create and return standard 2010 PbPb cuts
4019  AliConversionPhotonCuts *cuts=new AliConversionPhotonCuts("StandardCuts2010pp","StandardCuts2010pp");
4020  if(!cuts->InitializeCutsFromCutString("00209366300380000000")){
4021  cout<<"Warning: Initialization of Standardcuts2010pp failed"<<endl;}
4022  return cuts;
4023 }
4024 
4027 
4028  //GetPhotonPhi() 0-2 Pi //eventPlaneAngle -1pi-1pi
4029  eventPlaneAngle=eventPlaneAngle+TMath::Pi();
4030  Double_t gammaToEPAngle = eventPlaneAngle-photonPhi;
4031  if(gammaToEPAngle < 0) gammaToEPAngle=gammaToEPAngle+2*TMath::Pi();
4032  gammaToEPAngle = gammaToEPAngle-TMath::Pi(); // angle from -pi +pi
4033 
4034  if(!fInPlaneOutOfPlane){
4035  if(fill&&fHistoEventPlanePhi)fHistoEventPlanePhi->Fill(gammaToEPAngle);
4036  return kTRUE;
4037  }
4038  else if(fInPlaneOutOfPlane == 1){
4039  if(TMath::Abs(gammaToEPAngle)<=0.25*TMath::Pi() || TMath::Abs(gammaToEPAngle)>=0.75*TMath::Pi()){
4040  if(fill&&fHistoEventPlanePhi)fHistoEventPlanePhi->Fill(gammaToEPAngle);
4041  return kTRUE;
4042  }
4043  else return kFALSE;
4044  }
4045  else if(fInPlaneOutOfPlane == 2){
4046  if(TMath::Abs(gammaToEPAngle)>0.25*TMath::Pi() && TMath::Abs(gammaToEPAngle)<0.75*TMath::Pi()){
4047  if(fill&&fHistoEventPlanePhi)fHistoEventPlanePhi->Fill(gammaToEPAngle);
4048  return kTRUE;
4049  }
4050  else return kFALSE;
4051  }
4052  return kFALSE;
4053 }
4054 
4057 
4058  AliAODTrack * negTrack = static_cast<AliAODTrack*>(GetTrack(eventDummy, photon->GetTrackLabelNegative()));
4059  AliAODTrack * posTrack = static_cast<AliAODTrack*>(GetTrack(eventDummy, photon->GetTrackLabelPositive()));
4060 
4061  if(!negTrack || !posTrack) {
4062  return 0;
4063  }
4064  if(negTrack->Charge() == posTrack->Charge()){
4065  return 0;
4066  }
4067  Int_t nClusterITSneg = negTrack->GetITSNcls();
4068  Int_t nClusterITSpos = posTrack->GetITSNcls();
4069  // cout << nClusterITSneg << "\t" << nClusterITSpos <<endl;
4070 
4071  if (nClusterITSneg > 1 && nClusterITSpos > 1){
4072  return 3;
4073  } else if (nClusterITSneg > 1 || nClusterITSpos > 1){
4074  return 2;
4075  } else {
4076  return 1;
4077  }
4078  return 0;
4079 }
4080 
4083 
4084  TString nameProfile;
4085  if (flag==1){
4086  nameProfile = "profileContainingMaterialBudgetWeights_fewRadialBins";}
4087  else if (flag==2){
4088  nameProfile = "profileContainingMaterialBudgetWeights_manyRadialBins";}
4089  else {
4090  AliError(Form("%d not a valid flag for InitMaterialBudgetWeightingOfPi0Candidates()",flag));
4091  return kFALSE;
4092  }
4093  TFile* file = TFile::Open(filename.Data());
4094  if (!file) {
4095  AliError(Form("File %s for materialbudgetweights not found",filename.Data()));
4096  return kFALSE;
4097  }
4098  fProfileContainingMaterialBudgetWeights = (TProfile*)file->Get(nameProfile.Data());
4100  AliError(Form("Histogram %s not found in file",nameProfile.Data()));
4101  return kFALSE;
4102  }
4103  fProfileContainingMaterialBudgetWeights->SetDirectory(0);
4104  file->Close();
4105  delete file;
4106 
4108  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()));
4109  return kTRUE;
4110 }
4111 
4114 
4115  Float_t weight = 1.0;
4116  Float_t gammaConversionRadius = gamma->GetConversionRadius();
4117  Int_t bin = fProfileContainingMaterialBudgetWeights->FindBin(gammaConversionRadius);
4118  if (bin > 0 && bin <= fProfileContainingMaterialBudgetWeights->GetNbinsX()){
4119  weight = fProfileContainingMaterialBudgetWeights->GetBinContent(bin);
4120  }
4121  return weight;
4122 }
Int_t charge
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
#define P(T, U, S)
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]
Bool_t InitializeElecDeDxPostCalibration(TString filename)
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
AliDalitzAODESDMC * Particle(Int_t i)
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.
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
Double_t GetCorrectedElectronTPCResponse(Short_t charge, Double_t nsig, Double_t P, Double_t Eta, Double_t R)
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 fElecDeDxPostCalibrationInitialized
flag to check that initialization worked
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)
short Short_t
Definition: External.C:23
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 PhotonIsSelectedMCAODESD(AliDalitzAODESDMC *particle, AliDalitzEventMC *mcEvent, Bool_t checkForConvertedGamma)
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
Bool_t dEdxCuts(AliVTrack *track, AliConversionPhotonBase *photon)
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)
TH2F * fHistoAsymmetrybefore
asymmetry plot after cuts