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