AliPhysics  2aaea23 (2aaea23)
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( ePos->Eta() > (fEtaCut) || ePos->Eta() < (-fEtaCut) ||
663  eNeg->Eta() > (fEtaCut) || eNeg->Eta() < (-fEtaCut) )
664  return kFALSE;
665 
666  if(fEtaCutMin > -0.1){
667  if( (ePos->Eta() < (fEtaCutMin) && ePos->Eta() > (-fEtaCutMin)) ||
668  (eNeg->Eta() < (fEtaCutMin) && eNeg->Eta() > (-fEtaCutMin)) )
669  return kFALSE;
670  }
671 
672  if(ePos->R()>fMaxR){
673  return kFALSE; // cuts on distance from collision point
674  }
675 
676  if(TMath::Abs(ePos->Vz()) > fMaxZ){
677  return kFALSE; // outside material
678  }
679  if(TMath::Abs(eNeg->Vz()) > fMaxZ){
680  return kFALSE; // outside material
681  }
682 
683  if( ePos->R() <= ((TMath::Abs(ePos->Vz()) * fLineCutZRSlope) - fLineCutZValue)){
684  return kFALSE; // line cut to exclude regions where we do not reconstruct
685  } else if ( fEtaCutMin != -0.1 && ePos->R() >= ((TMath::Abs(ePos->Vz()) * fLineCutZRSlopeMin) - fLineCutZValueMin)){
686  return kFALSE;
687  }
688 
689  if( eNeg->R() <= ((TMath::Abs(eNeg->Vz()) * fLineCutZRSlope) - fLineCutZValue)){
690  return kFALSE; // line cut to exclude regions where we do not reconstruct
691  } else if ( fEtaCutMin != -0.1 && eNeg->R() >= ((TMath::Abs(eNeg->Vz()) * fLineCutZRSlopeMin) - fLineCutZValueMin)){
692  return kFALSE;
693  }
694 
695  return kTRUE;
696  //if(AcceptanceCut(particle,ePos,eNeg))return kTRUE;
697  }
698  return kFALSE;
699 }
701 Bool_t AliConversionPhotonCuts::PhotonIsSelectedAODMC(AliAODMCParticle *particle,TClonesArray *aodmcArray,Bool_t checkForConvertedGamma){
702  // MonteCarlo Photon Selection
703 
704  if(!aodmcArray)return kFALSE;
705 
706  if (particle->GetPdgCode() == 22){
707  if( particle->Eta() > (fEtaCut) || particle->Eta() < (-fEtaCut) )
708  return kFALSE;
709  if(fEtaCutMin>-0.1){
710  if( particle->Eta() < (fEtaCutMin) && particle->Eta() > (-fEtaCutMin) )
711  return kFALSE;
712  }
713 
714  if(particle->GetMother() > -1 && (static_cast<AliAODMCParticle*>(aodmcArray->At(particle->GetMother())))->GetPdgCode() == 22){
715  return kFALSE; // no photon as mothers!
716  }
717 
718  if(!checkForConvertedGamma) return kTRUE; // return in case of accepted gamma
719 
720  // looking for conversion gammas (electron + positron from pairbuilding (= 5) )
721  AliAODMCParticle* ePos = NULL;
722  AliAODMCParticle* eNeg = NULL;
723 
724  if(particle->GetNDaughters() >= 2){
725  for(Int_t daughterIndex=particle->GetDaughter(0);daughterIndex<=particle->GetDaughter(1);daughterIndex++){
726  AliAODMCParticle *tmpDaughter = static_cast<AliAODMCParticle*>(aodmcArray->At(daughterIndex));
727  if(!tmpDaughter) continue;
728  if(((tmpDaughter->GetMCProcessCode())) == 5){ // STILL A BUG IN ALIROOT >>8 HAS TPO BE REMOVED AFTER FIX
729  if(tmpDaughter->GetPdgCode() == 11){
730  eNeg = tmpDaughter;
731  } else if(tmpDaughter->GetPdgCode() == -11){
732  ePos = tmpDaughter;
733  }
734  }
735  }
736  }
737 
738  if(ePos == NULL || eNeg == NULL){ // means we do not have two daughters from pair production
739  return kFALSE;
740  }
741 
742  if( ePos->Eta() > (fEtaCut) || ePos->Eta() < (-fEtaCut) ||
743  eNeg->Eta() > (fEtaCut) || eNeg->Eta() < (-fEtaCut) )
744  return kFALSE;
745 
746  if(fEtaCutMin > -0.1){
747  if( (ePos->Eta() < (fEtaCutMin) && ePos->Eta() > (-fEtaCutMin)) ||
748  (eNeg->Eta() < (fEtaCutMin) && eNeg->Eta() > (-fEtaCutMin)) )
749  return kFALSE;
750  }
751 
752  Double_t rPos = sqrt( (ePos->Xv()*ePos->Xv()) + (ePos->Yv()*ePos->Yv()) );
753  Double_t rNeg = sqrt( (eNeg->Xv()*eNeg->Xv()) + (eNeg->Yv()*eNeg->Yv()) );
754 
755  if(rPos>fMaxR){
756  return kFALSE; // cuts on distance from collision point
757  }
758  if(TMath::Abs(ePos->Zv()) > fMaxZ){
759  return kFALSE; // outside material
760  }
761  if(TMath::Abs(eNeg->Zv()) > fMaxZ){
762  return kFALSE; // outside material
763  }
764 
765  if( rPos <= ((TMath::Abs(ePos->Zv()) * fLineCutZRSlope) - fLineCutZValue)){
766  return kFALSE; // line cut to exclude regions where we do not reconstruct
767  } else if ( fEtaCutMin != -0.1 && rPos >= ((TMath::Abs(ePos->Zv()) * fLineCutZRSlopeMin) - fLineCutZValueMin)){
768  return kFALSE;
769  }
770 
771  if( rNeg <= ((TMath::Abs(eNeg->Zv()) * fLineCutZRSlope) - fLineCutZValue)){
772  return kFALSE; // line cut to exclude regions where we do not reconstruct
773  } else if ( fEtaCutMin != -0.1 && rNeg >= ((TMath::Abs(eNeg->Zv()) * fLineCutZRSlopeMin) - fLineCutZValueMin)){
774  return kFALSE;
775  }
776 
777  return kTRUE;
778  //if(AcceptanceCut(particle,ePos,eNeg))return kTRUE;
779  }
780  return kFALSE;
781 }
782 
784 Bool_t AliConversionPhotonCuts::PhotonCuts(AliConversionPhotonBase *photon,AliVEvent *event){ // Specific Photon Cuts
785 
786  Int_t cutIndex = 0;
787  if(fHistoPhotonCuts)fHistoPhotonCuts->Fill(cutIndex, photon->GetPhotonPt());
788  cutIndex++;
789 
790  // Fill Histos before Cuts
791  if(fHistoInvMassbefore)fHistoInvMassbefore->Fill(photon->GetMass());
793 
794  // Gamma selection based on QT from Armenteros
795  if(fDoQtGammaSelection == kTRUE){
796  if(!ArmenterosQtCut(photon)){
797  if(fHistoPhotonCuts)fHistoPhotonCuts->Fill(cutIndex, photon->GetPhotonPt()); //1
798  return kFALSE;
799  }
800  }
801  cutIndex++; //2
802 
803  // Chi Cut
804  if(photon->GetChi2perNDF() > fChi2CutConversion || photon->GetChi2perNDF() <=0){
805  {
806  if(fHistoPhotonCuts)fHistoPhotonCuts->Fill(cutIndex, photon->GetPhotonPt()); //2
807  return kFALSE;
808  }
809  }
810  cutIndex++;//3
811 
812  // Reconstruction Acceptance Cuts
813  if(!AcceptanceCuts(photon)){
814  if(fHistoPhotonCuts)fHistoPhotonCuts->Fill(cutIndex, photon->GetPhotonPt()); //3
815  return kFALSE;
816  }
817 
818  cutIndex++; //4
819  // Asymmetry Cut
820  if(fDoPhotonAsymmetryCut == kTRUE){
821  if(!AsymmetryCut(photon,event)){
822  if(fHistoPhotonCuts)fHistoPhotonCuts->Fill(cutIndex, photon->GetPhotonPt()); //4
823  return kFALSE;
824  }
825  }
826 
827  //Check the pid probability
828  cutIndex++; //5
829  if(!PIDProbabilityCut(photon, event)) {
830  if(fHistoPhotonCuts)fHistoPhotonCuts->Fill(cutIndex, photon->GetPhotonPt()); //5
831  return kFALSE;
832  }
833 
834  cutIndex++; //6
835  if(!CorrectedTPCClusterCut(photon, event)) {
836  if(fHistoPhotonCuts)fHistoPhotonCuts->Fill(cutIndex, photon->GetPhotonPt()); //6
837  return kFALSE;
838  }
839 
840  Double_t magField = event->GetMagneticField();
841  if( magField < 0.0 ){
842  magField = 1.0;
843  } else {
844  magField = -1.0;
845  }
846 
847  AliVTrack * electronCandidate = GetTrack(event,photon->GetTrackLabelNegative());
848  AliVTrack * positronCandidate = GetTrack(event,photon->GetTrackLabelPositive());
849  Double_t deltaPhi = magField * TVector2::Phi_mpi_pi( electronCandidate->Phi()-positronCandidate->Phi());
850 
851  cutIndex++; //7
852  if(!PsiPairCut(photon)) {
853  if(fHistoPhotonCuts)fHistoPhotonCuts->Fill(cutIndex, photon->GetPhotonPt()); //7
854  return kFALSE;
855  }
856 
857  cutIndex++; //8
858  if(!CosinePAngleCut(photon, event)) {
859  if(fHistoPhotonCuts)fHistoPhotonCuts->Fill(cutIndex, photon->GetPhotonPt()); //8
860  return kFALSE;
861  }
862 
863  AliAODConversionPhoton* photonAOD = dynamic_cast<AliAODConversionPhoton*>(photon);
864  if (photonAOD){
865  photonAOD->CalculateDistanceOfClossetApproachToPrimVtx(event->GetPrimaryVertex());
866 
867  cutIndex++; //9
868  if(photonAOD->GetDCArToPrimVtx() > fDCARPrimVtxCut) { //DCA R cut of photon to primary vertex
869  if(fHistoPhotonCuts)fHistoPhotonCuts->Fill(cutIndex, photon->GetPhotonPt()); //9
870  return kFALSE;
871  }
872 
873  cutIndex++; //10
874  if(TMath::Abs(photonAOD->GetDCAzToPrimVtx()) > fDCAZPrimVtxCut) { //DCA Z cut of photon to primary vertex
875  if(fHistoPhotonCuts)fHistoPhotonCuts->Fill(cutIndex, photon->GetPhotonPt()); //10
876  return kFALSE;
877  }
878  } else {
879  cutIndex++; //9
880  cutIndex++; //10
881  }
882  cutIndex++; //11
883 
884  if (photonAOD){
885  UChar_t photonQuality = 0;
886  AliAODEvent * aodEvent = dynamic_cast<AliAODEvent*>(event);
887  if(aodEvent) {
888  photonQuality = DeterminePhotonQualityAOD(photonAOD, event);
889  } else {
890  photonQuality = photonAOD->GetPhotonQuality();
891  }
892  if (fDoPhotonQualitySelectionCut && photonQuality != fPhotonQualityCut){
893  if(fHistoPhotonCuts)fHistoPhotonCuts->Fill(cutIndex, photon->GetPhotonPt()); //11
894  return kFALSE;
895  }
896  }
897  cutIndex++; //12
898  if(fHistoPhotonCuts)fHistoPhotonCuts->Fill(cutIndex, photon->GetPhotonPt()); //11
899 
900  // Histos after Cuts
901  if(fHistoInvMassafter)fHistoInvMassafter->Fill(photon->GetMass());
904  if(fHistoKappaafter)fHistoKappaafter->Fill(photon->GetPhotonPt(), GetKappaTPC(photon, event));
906  if(photon->GetPhotonP()!=0 && electronCandidate->P()!=0)fHistoAsymmetryafter->Fill(photon->GetPhotonP(),electronCandidate->P()/photon->GetPhotonP());
907  }
908  return kTRUE;
909 
910 }
911 
913 Bool_t AliConversionPhotonCuts::CorrectedTPCClusterCut(AliConversionPhotonBase *photon, AliVEvent * event){ //Cut on corrected TPC Cluster Info
914 
915  AliVTrack * negTrack = GetTrack(event, photon->GetTrackLabelNegative());
916  AliVTrack * posTrack = GetTrack(event, photon->GetTrackLabelPositive());
917 
918  if(!negTrack||!posTrack)return kFALSE;
919 
920  Double_t negclsToF=0;
921 
923  if(negTrack->GetTPCNclsF()!=0){
924  negclsToF = (Double_t)negTrack->GetNcls(1)/(Double_t)negTrack->GetTPCNclsF();}// Ncluster/Nfindablecluster
925  }
926  else {
927  negclsToF = negTrack->GetTPCClusterInfo(2,0,GetFirstTPCRow(photon->GetConversionRadius()));
928  }
929 
930  Double_t posclsToF = 0.;
932  if(posTrack->GetTPCNclsF()!=0){
933  posclsToF = (Double_t)posTrack->GetNcls(1)/(Double_t)posTrack->GetTPCNclsF();
934  }
935  }else{
936  posclsToF = posTrack->GetTPCClusterInfo(2,0,GetFirstTPCRow(photon->GetConversionRadius()));
937  }
938 
939  if( negclsToF < fMinClsTPCToF || posclsToF < fMinClsTPCToF ){
940  return kFALSE;
941  }
942 
943  return kTRUE;
944 }
945 
948  //Selection of Reconstructed Photons
949 
951 
952  if(event->IsA()==AliESDEvent::Class()) {
953  if(!SelectV0Finder( ( ((AliESDEvent*)event)->GetV0(photon->GetV0Index()))->GetOnFlyStatus() ) ){
955  return kFALSE;
956  }
957  }
958 
959  // Get Tracks
960  AliVTrack * negTrack = GetTrack(event, photon->GetTrackLabelNegative());
961  AliVTrack * posTrack = GetTrack(event, photon->GetTrackLabelPositive());
962 
963  if(!negTrack || !posTrack) {
965  return kFALSE;
966  }
967 
968  // check if V0 from AliAODGammaConversion.root is actually contained in AOD by checking if V0 exists with same tracks
969  if(event->IsA()==AliAODEvent::Class() && fPreSelCut && ( fIsHeavyIon != 1 || (fIsHeavyIon == 1 && fProcessAODCheck) )) {
970  AliAODEvent* aodEvent = dynamic_cast<AliAODEvent*>(event);
971 
972  Bool_t bFound = kFALSE;
973  Int_t v0PosID = posTrack->GetID();
974  Int_t v0NegID = negTrack->GetID();
975  AliAODv0* v0 = NULL;
976  for(Int_t iV=0; iV<aodEvent->GetNumberOfV0s(); iV++){
977  v0 = aodEvent->GetV0(iV);
978  if(!v0) continue;
979  if( (v0PosID == v0->GetPosID() && v0NegID == v0->GetNegID()) || (v0PosID == v0->GetNegID() && v0NegID == v0->GetPosID()) ){
980  bFound = kTRUE;
981  break;
982  }
983  }
984  if(!bFound){
986  return kFALSE;
987  }
988  }
989 
990  photon->DeterminePhotonQuality(negTrack,posTrack);
991  // Track Cuts
992  if(!TracksAreSelected(negTrack, posTrack)){
994  return kFALSE;
995  }
996  if (fHistoEtaDistV0s)fHistoEtaDistV0s->Fill(photon->GetPhotonEta());
997  // dEdx Cuts
998 
999  if(!KappaCuts(photon, event) || !dEdxCuts(negTrack) || !dEdxCuts(posTrack)) {
1001  return kFALSE;
1002  }
1003 
1005  // Photon Cuts
1006  if(!PhotonCuts(photon,event)){
1008  return kFALSE;
1009  }
1010 
1011  // Photon passed cuts
1013  return kTRUE;
1014 }
1015 
1018  if(fDo2DQt){
1019  if ( !(TMath::Power(photon->GetArmenterosAlpha()/0.95,2)+TMath::Power(photon->GetArmenterosQt()/fQtMax,2) < 1) ){
1020  return kFALSE;
1021  }
1022  } else {
1023  if(photon->GetArmenterosQt()>fQtMax){
1024  return kFALSE;
1025  }
1026  }
1027  return kTRUE;
1028 }
1029 
1030 
1033  // Exclude certain areas for photon reconstruction
1034 
1035  Int_t cutIndex=0;
1036  if(fHistoAcceptanceCuts)fHistoAcceptanceCuts->Fill(cutIndex, photon->GetPhotonPt());
1037  cutIndex++;
1038 
1039  if(photon->GetConversionRadius()>fMaxR){ // cuts on distance from collision point
1040  if(fHistoAcceptanceCuts)fHistoAcceptanceCuts->Fill(cutIndex, photon->GetPhotonPt());
1041  return kFALSE;
1042  }
1043  cutIndex++;
1044 
1045  if(photon->GetConversionRadius()<fMinR){ // cuts on distance from collision point
1046  if(fHistoAcceptanceCuts)fHistoAcceptanceCuts->Fill(cutIndex, photon->GetPhotonPt());
1047  return kFALSE;
1048  }
1049  cutIndex++;
1050 
1051  if(photon->GetConversionRadius() <= ((TMath::Abs(photon->GetConversionZ())*fLineCutZRSlope)-fLineCutZValue)){
1052  if(fHistoAcceptanceCuts)fHistoAcceptanceCuts->Fill(cutIndex, photon->GetPhotonPt());
1053  return kFALSE;
1054  }
1055  else if (fUseEtaMinCut && photon->GetConversionRadius() >= ((TMath::Abs(photon->GetConversionZ())*fLineCutZRSlopeMin)-fLineCutZValueMin )){
1056  if(fHistoAcceptanceCuts)fHistoAcceptanceCuts->Fill(cutIndex, photon->GetPhotonPt());
1057  return kFALSE;
1058  }
1059  cutIndex++;
1060 
1061  if(TMath::Abs(photon->GetConversionZ()) > fMaxZ ){ // cuts out regions where we do not reconstruct
1062  if(fHistoAcceptanceCuts)fHistoAcceptanceCuts->Fill(cutIndex, photon->GetPhotonPt());
1063  return kFALSE;
1064  }
1065  cutIndex++;
1066 
1067 
1068  if( photon->GetPhotonEta() > (fEtaCut) || photon->GetPhotonEta() < (-fEtaCut) ){
1069  if(fHistoAcceptanceCuts)fHistoAcceptanceCuts->Fill(cutIndex, photon->GetPhotonPt());
1070  return kFALSE;
1071  }
1072  if(fEtaCutMin>-0.1){
1073  if( photon->GetPhotonEta() < (fEtaCutMin) && photon->GetPhotonEta() > (-fEtaCutMin) ){
1074  if(fHistoAcceptanceCuts)fHistoAcceptanceCuts->Fill(cutIndex, photon->GetPhotonPt());
1075  return kFALSE;
1076  }
1077  }
1078  cutIndex++;
1079 
1081  if(photon->GetPhotonEta() > fEtaForPhiCutMin && photon->GetPhotonEta() < fEtaForPhiCutMax ){
1082  if (fMinPhiCut < fMaxPhiCut){
1083  if( photon->GetPhotonPhi() > fMinPhiCut && photon->GetPhotonPhi() < fMaxPhiCut ) {
1084  if(fHistoAcceptanceCuts)fHistoAcceptanceCuts->Fill(cutIndex, photon->GetPhotonPt());
1085  return kFALSE;
1086  }
1087  } else {
1088  Double_t photonPhi = photon->GetPhotonPhi();
1089  if (photon->GetPhotonPhi() < TMath::Pi()) photonPhi = photon->GetPhotonPhi() + 2*TMath::Pi();
1090  if( photonPhi > fMinPhiCut && photonPhi < fMaxPhiCut+2*TMath::Pi() ) {
1091  if(fHistoAcceptanceCuts)fHistoAcceptanceCuts->Fill(cutIndex, photon->GetPhotonPt());
1092  return kFALSE;
1093  }
1094  }
1095  }
1096  }
1097  cutIndex++;
1098 
1099 
1100 
1101  if(photon->GetPhotonPt()<fPtCut){
1102  if(fHistoAcceptanceCuts)fHistoAcceptanceCuts->Fill(cutIndex, photon->GetPhotonPt());
1103  return kFALSE;
1104  }
1105  cutIndex++;
1106 
1107  if(fHistoAcceptanceCuts)fHistoAcceptanceCuts->Fill(cutIndex, photon->GetPhotonPt());
1108 
1109  return kTRUE;
1110 }
1111 
1112 
1114 Bool_t AliConversionPhotonCuts::SpecificTrackCuts(AliAODTrack * negTrack, AliAODTrack * posTrack,Int_t &cutIndex) {
1115  // Track Cuts which require AOD/ESD specific implementation
1116 
1117  if( !negTrack->IsOn(AliESDtrack::kTPCrefit) || !posTrack->IsOn(AliESDtrack::kTPCrefit) ) {
1118  if(fHistoTrackCuts)fHistoTrackCuts->Fill(cutIndex);
1119  return kFALSE;
1120  }
1121  cutIndex++;
1122 
1123  AliAODVertex * NegVtxType=negTrack->GetProdVertex();
1124  AliAODVertex * PosVtxType=posTrack->GetProdVertex();
1125  if( (NegVtxType->GetType())==AliAODVertex::kKink || (PosVtxType->GetType())==AliAODVertex::kKink) {
1126  if(fHistoTrackCuts)fHistoTrackCuts->Fill(cutIndex);
1127  return kFALSE;
1128  }
1129  return kTRUE;
1130 
1131 }
1132 
1133 
1135 Bool_t AliConversionPhotonCuts::SpecificTrackCuts(AliESDtrack * negTrack, AliESDtrack * posTrack,Int_t &cutIndex) {
1136  // Track Cuts which require AOD/ESD specific implementation
1137 
1138  if( !negTrack->IsOn(AliESDtrack::kTPCrefit) || !posTrack->IsOn(AliESDtrack::kTPCrefit) ) {
1139  if(fHistoTrackCuts)fHistoTrackCuts->Fill(cutIndex);
1140  return kFALSE;
1141  }
1142  cutIndex++;
1143 
1144  if(negTrack->GetKinkIndex(0) > 0 || posTrack->GetKinkIndex(0) > 0 ) {
1145  if(fHistoTrackCuts)fHistoTrackCuts->Fill(cutIndex);
1146  return kFALSE;
1147  }
1148  return kTRUE;
1149 }
1150 
1151 
1152 
1154 Bool_t AliConversionPhotonCuts::TracksAreSelected(AliVTrack * negTrack, AliVTrack * posTrack) {
1155  // Track Selection for Photon Reconstruction
1156 
1157  Int_t cutIndex=0;
1158  if(fHistoTrackCuts)fHistoTrackCuts->Fill(cutIndex);
1159  cutIndex++;
1160 
1161  // avoid like sign
1163  if(negTrack->Charge() == posTrack->Charge()) {
1164  if(fHistoTrackCuts)fHistoTrackCuts->Fill(cutIndex);
1165  return kFALSE;
1166  }
1167  }else if(fUseOnFlyV0FinderSameSign==1){
1168  if(negTrack->Charge() != posTrack->Charge()) {
1169  if(fHistoTrackCuts)fHistoTrackCuts->Fill(cutIndex);
1170  return kFALSE;
1171  }
1172  }
1173  cutIndex++;
1174 
1175  // Number of TPC Clusters
1176 
1177 
1178  if( negTrack->GetNcls(1) < fMinClsTPC || posTrack->GetNcls(1) < fMinClsTPC ) {
1179  if(fHistoTrackCuts)fHistoTrackCuts->Fill(cutIndex);
1180  return kFALSE;
1181  }
1182  cutIndex++;
1183 
1184  // Acceptance
1185  if( posTrack->Eta() > (fEtaCut) || posTrack->Eta() < (-fEtaCut) ||
1186  negTrack->Eta() > (fEtaCut) || negTrack->Eta() < (-fEtaCut) ){
1187  if(fHistoTrackCuts)fHistoTrackCuts->Fill(cutIndex);
1188  return kFALSE;
1189  }
1190  if(fEtaCutMin>-0.1){
1191  if( (posTrack->Eta() < (fEtaCutMin) && posTrack->Eta() > (-fEtaCutMin)) ||
1192  (negTrack->Eta() < (fEtaCutMin) && negTrack->Eta() > (-fEtaCutMin)) ){
1193  if(fHistoTrackCuts)fHistoTrackCuts->Fill(cutIndex);
1194  return kFALSE;
1195  }
1196  }
1197  cutIndex++;
1198 
1199  // Single Pt Cut
1200  if(fDoAsymPtCut){
1201  if((posTrack->Pt()<fSinglePtCut || negTrack->Pt()<fSinglePtCut2) && (posTrack->Pt()<fSinglePtCut2 || negTrack->Pt()<fSinglePtCut) ){
1202  if(fHistoTrackCuts)fHistoTrackCuts->Fill(cutIndex);
1203  return kFALSE;
1204  }
1205  } else {
1206  if(posTrack->Pt()<fSinglePtCut || negTrack->Pt()<fSinglePtCut){
1207  if(fHistoTrackCuts)fHistoTrackCuts->Fill(cutIndex);
1208  return kFALSE;
1209  }
1210  }
1211  cutIndex++;
1212 
1213  // AOD ESD specific cuts
1214  Bool_t passCuts = kTRUE;
1215 
1216  if(negTrack->IsA()==AliAODTrack::Class()) {
1217  passCuts = passCuts * SpecificTrackCuts(static_cast<AliAODTrack*>(negTrack), static_cast<AliAODTrack*>(posTrack),cutIndex);
1218  } else {
1219  passCuts = passCuts * SpecificTrackCuts(static_cast<AliESDtrack*>(negTrack), static_cast<AliESDtrack*>(posTrack),cutIndex);
1220  }
1221 
1222  if(!passCuts){
1223  if(fHistoTrackCuts)fHistoTrackCuts->Fill(cutIndex);
1224  return kFALSE;
1225  }
1226  cutIndex++;
1227 
1228  if(fHistoTrackCuts)fHistoTrackCuts->Fill(cutIndex);
1229 
1230  return kTRUE;
1231 
1232 }
1235 
1236  if(!fPIDResponse){InitPIDResponse();}// Try to reinitialize PID Response
1237  if(!fPIDResponse){AliError("No PID Response"); return kTRUE;}// if still missing fatal error
1238 
1239  AliVTrack * negTrack = GetTrack(event, gamma->GetTrackLabelNegative());
1240  AliVTrack * posTrack = GetTrack(event, gamma->GetTrackLabelPositive());
1241 
1242  Float_t KappaPlus, KappaMinus, Kappa;
1243  KappaMinus = fPIDResponse->NumberOfSigmasTPC(negTrack, AliPID::kElectron);
1244  KappaPlus = fPIDResponse->NumberOfSigmasTPC(posTrack, AliPID::kElectron);
1245  Kappa = ( TMath::Abs(KappaMinus) + TMath::Abs(KappaPlus) ) / 2.0 + 2.0*(KappaMinus+KappaPlus);
1246 
1247  return Kappa;
1248 
1249 }
1251 Bool_t AliConversionPhotonCuts::dEdxCuts(AliVTrack *fCurrentTrack){
1252  // Electron Identification Cuts for Photon reconstruction
1253  if(!fPIDResponse){InitPIDResponse();}// Try to reinitialize PID Response
1254  if(!fPIDResponse){AliError("No PID Response"); return kTRUE;}// if still missing fatal error
1255 
1256  Int_t cutIndex=0;
1257  if(fHistodEdxCuts)fHistodEdxCuts->Fill(cutIndex,fCurrentTrack->Pt());
1258  if(fHistoTPCdEdxSigbefore)fHistoTPCdEdxSigbefore->Fill(fCurrentTrack->P(),fPIDResponse->NumberOfSigmasTPC(fCurrentTrack, AliPID::kElectron));
1259  if(fHistoTPCdEdxbefore)fHistoTPCdEdxbefore->Fill(fCurrentTrack->P(),fCurrentTrack->GetTPCsignal());
1260  cutIndex++;
1261  if(fDodEdxSigmaCut == kTRUE && !fSwitchToKappa){
1262  // TPC Electron Line
1263  if( fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kElectron)<fPIDnSigmaBelowElectronLine ||
1264  fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kElectron)>fPIDnSigmaAboveElectronLine){
1265 
1266  if(fHistodEdxCuts)fHistodEdxCuts->Fill(cutIndex,fCurrentTrack->Pt());
1267  return kFALSE;
1268  }
1269  cutIndex++;
1270 
1271  // TPC Pion Line
1272  if( fCurrentTrack->P()>fPIDMinPnSigmaAbovePionLine && fCurrentTrack->P()<fPIDMaxPnSigmaAbovePionLine ){
1273  if(fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kElectron)>fPIDnSigmaBelowElectronLine &&
1274  fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kElectron)<fPIDnSigmaAboveElectronLine&&
1275  fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kPion)<fPIDnSigmaAbovePionLine){
1276 
1277  if(fHistodEdxCuts)fHistodEdxCuts->Fill(cutIndex,fCurrentTrack->Pt());
1278  return kFALSE;
1279  }
1280  }
1281  cutIndex++;
1282 
1283  // High Pt Pion rej
1284  if( fCurrentTrack->P()>fPIDMaxPnSigmaAbovePionLine ){
1285  if(fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kElectron)>fPIDnSigmaBelowElectronLine &&
1286  fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kElectron)<fPIDnSigmaAboveElectronLine &&
1287  fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kPion)<fPIDnSigmaAbovePionLineHighPt){
1288 
1289  if(fHistodEdxCuts)fHistodEdxCuts->Fill(cutIndex,fCurrentTrack->Pt());
1290  return kFALSE;
1291  }
1292  }
1293  cutIndex++;
1294  }
1295  else{cutIndex+=3;}
1296 
1297  if(fDoKaonRejectionLowP == kTRUE && !fSwitchToKappa){
1298  if(fCurrentTrack->P()<fPIDMinPKaonRejectionLowP ){
1299  if( TMath::Abs(fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kKaon))<fPIDnSigmaAtLowPAroundKaonLine){
1300 
1301  if(fHistodEdxCuts)fHistodEdxCuts->Fill(cutIndex,fCurrentTrack->Pt());
1302  return kFALSE;
1303  }
1304  }
1305  }
1306  cutIndex++;
1307  if(fDoProtonRejectionLowP == kTRUE && !fSwitchToKappa){
1308  if( fCurrentTrack->P()<fPIDMinPProtonRejectionLowP ){
1309  if( TMath::Abs(fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kProton))<fPIDnSigmaAtLowPAroundProtonLine){
1310 
1311  if(fHistodEdxCuts)fHistodEdxCuts->Fill(cutIndex,fCurrentTrack->Pt());
1312  return kFALSE;
1313  }
1314  }
1315  }
1316  cutIndex++;
1317 
1318  if(fDoPionRejectionLowP == kTRUE && !fSwitchToKappa){
1319  if( fCurrentTrack->P()<fPIDMinPPionRejectionLowP ){
1320  if( TMath::Abs(fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kPion))<fPIDnSigmaAtLowPAroundPionLine){
1321 
1322  if(fHistodEdxCuts)fHistodEdxCuts->Fill(cutIndex,fCurrentTrack->Pt());
1323  return kFALSE;
1324  }
1325  }
1326  }
1327  cutIndex++;
1328 
1329 
1330  // cout<<"Start"<<endl;
1331  // AliPIDResponse::EDetPidStatus status=fPIDResponse->CheckPIDStatus(AliPIDResponse::kTOF,fCurrentTrack);
1332 
1333  // if( ( (status & AliVTrack::kTOFout) == AliVTrack::kTOFout ) && ( (status & AliVTrack::kTIME) == AliVTrack::kTIME ))
1334  // {cout<<"TOF DA"<<endl;}
1335  // if(status == AliPIDResponse::kDetPidOk){
1336  // Float_t probMis = fPIDResponse->GetTOFMismatchProbability(fCurrentTrack);
1337  // cout<<"--> "<<probMis<<endl;
1338  // if(probMis > 0.01){
1339 
1340  // }
1341  // }
1342 
1343  if((fCurrentTrack->GetStatus() & AliESDtrack::kTOFpid ) && !(fCurrentTrack->GetStatus() & AliESDtrack::kTOFmismatch)){
1344  if(fHistoTOFbefore){
1345  Double_t t0 = fPIDResponse->GetTOFResponse().GetStartTime(fCurrentTrack->P());
1346  Double_t times[AliPID::kSPECIESC];
1347  fCurrentTrack->GetIntegratedTimes(times,AliPID::kSPECIESC);
1348  Double_t TOFsignal = fCurrentTrack->GetTOFsignal();
1349  Double_t dT = TOFsignal - t0 - times[0];
1350  fHistoTOFbefore->Fill(fCurrentTrack->P(),dT);
1351  }
1352  if(fHistoTOFSigbefore) fHistoTOFSigbefore->Fill(fCurrentTrack->P(),fPIDResponse->NumberOfSigmasTOF(fCurrentTrack, AliPID::kElectron));
1353  if(fUseTOFpid){
1354  if(fPIDResponse->NumberOfSigmasTOF(fCurrentTrack, AliPID::kElectron)>fTofPIDnSigmaAboveElectronLine ||
1355  fPIDResponse->NumberOfSigmasTOF(fCurrentTrack, AliPID::kElectron)<fTofPIDnSigmaBelowElectronLine ){
1356  if(fHistodEdxCuts)fHistodEdxCuts->Fill(cutIndex,fCurrentTrack->Pt());
1357  return kFALSE;
1358  }
1359  }
1360  if(fHistoTOFSigafter)fHistoTOFSigafter->Fill(fCurrentTrack->P(),fPIDResponse->NumberOfSigmasTOF(fCurrentTrack, AliPID::kElectron));
1361  }
1362  cutIndex++;
1363 
1364  if((fCurrentTrack->GetStatus() & AliESDtrack::kITSpid)){
1365  if(fHistoITSSigbefore) fHistoITSSigbefore->Fill(fCurrentTrack->P(),fPIDResponse->NumberOfSigmasITS(fCurrentTrack, AliPID::kElectron));
1366  if(fUseITSpid){
1367  if(fCurrentTrack->Pt()<=fMaxPtPIDITS){
1368  if(fPIDResponse->NumberOfSigmasITS(fCurrentTrack, AliPID::kElectron)>fITSPIDnSigmaAboveElectronLine || fPIDResponse->NumberOfSigmasITS(fCurrentTrack, AliPID::kElectron)<fITSPIDnSigmaBelowElectronLine ){
1369  if(fHistodEdxCuts)fHistodEdxCuts->Fill(cutIndex,fCurrentTrack->Pt());
1370  return kFALSE;
1371  }
1372  }
1373  }
1374  if(fHistoITSSigafter)fHistoITSSigafter->Fill(fCurrentTrack->P(),fPIDResponse->NumberOfSigmasITS(fCurrentTrack, AliPID::kElectron));
1375  }
1376 
1377  cutIndex++;
1378 
1379  // Apply TRD PID
1380  if(fDoTRDPID){
1381  if(!fPIDResponse->IdentifiedAsElectronTRD(fCurrentTrack,fPIDTRDEfficiency)){
1382  if(fHistodEdxCuts)fHistodEdxCuts->Fill(cutIndex,fCurrentTrack->Pt());
1383  return kFALSE;
1384  }
1385  }
1386  cutIndex++;
1387 
1388  if(fHistodEdxCuts)fHistodEdxCuts->Fill(cutIndex,fCurrentTrack->Pt());
1389  if(fHistoTPCdEdxSigafter)fHistoTPCdEdxSigafter->Fill(fCurrentTrack->P(),fPIDResponse->NumberOfSigmasTPC(fCurrentTrack, AliPID::kElectron));
1390  if(fHistoTPCdEdxafter)fHistoTPCdEdxafter->Fill(fCurrentTrack->P(),fCurrentTrack->GetTPCsignal());
1391 
1392  return kTRUE;
1393 }
1394 
1396  // abort if Kappa selection not enabled
1397  if (!fSwitchToKappa) return kTRUE;
1398 
1399  Float_t kappa = GetKappaTPC(photon, event);
1400  if (kappa < fKappaMinCut) return kFALSE;
1401  if (kappa > fKappaMaxCut) return kFALSE;
1402  return kTRUE;
1403 }
1404 
1407  // Cut on Energy Assymetry
1408 
1409  for(Int_t ii=0;ii<2;ii++){
1410 
1411  AliVTrack *track=GetTrack(event,photon->GetTrackLabel(ii));
1412 
1414  Double_t trackNegAsy=0;
1415  if (photon->GetPhotonP()!=0.){
1416  trackNegAsy= track->P()/photon->GetPhotonP();
1417  }
1418 
1419  if( trackNegAsy > fFAsymmetryCut->Eval(photon->GetPhotonP()) || trackNegAsy < 1.-fFAsymmetryCut->Eval(photon->GetPhotonP()) ){
1420  return kFALSE;
1421  }
1422 
1423  } else {
1424  if( track->P() > fMinPPhotonAsymmetryCut ){
1425  Double_t trackNegAsy=0;
1426  if (photon->GetPhotonP()!=0.){
1427  trackNegAsy= track->P()/photon->GetPhotonP();
1428  }
1429 
1430  if( trackNegAsy<fMinPhotonAsymmetry ||trackNegAsy>(1.- fMinPhotonAsymmetry)){
1431  return kFALSE;
1432  }
1433  }
1434  }
1435 
1436  }
1437  return kTRUE;
1438 }
1439 
1441 AliVTrack *AliConversionPhotonCuts::GetTrack(AliVEvent * event, Int_t label){
1442  //Returns pointer to the track with given ESD label
1443  //(Important for AOD implementation, since Track array in AOD data is different
1444  //from ESD array, but ESD tracklabels are stored in AOD Tracks)
1445 
1446  AliESDEvent * esdEvent = dynamic_cast<AliESDEvent*>(event);
1447  if(esdEvent) {
1448  if(label > event->GetNumberOfTracks() ) return NULL;
1449  AliESDtrack * track = esdEvent->GetTrack(label);
1450  return track;
1451 
1452  } else {
1453  if(label == -999999) return NULL; // if AOD relabelling goes wrong, immediately return NULL
1454  AliVTrack * track = 0x0;
1455  if(((AliV0ReaderV1*)AliAnalysisManager::GetAnalysisManager()->GetTask(fV0ReaderName.Data()))->AreAODsRelabeled()){
1456  if(event->GetTrack(label)) track = dynamic_cast<AliVTrack*>(event->GetTrack(label));
1457  return track;
1458  }
1459  else{
1460  for(Int_t ii=0; ii<event->GetNumberOfTracks(); ii++) {
1461  if(event->GetTrack(ii)) track = dynamic_cast<AliVTrack*>(event->GetTrack(ii));
1462  if(track){
1463  if(track->GetID() == label) {
1464  return track;
1465  }
1466  }
1467  }
1468  }
1469  }
1470  //AliDebug(5,(Form("track not found %d %d",label,event->GetNumberOfTracks()));
1471  return NULL;
1472 }
1473 
1476  //Returns pointer to the track with given ESD label
1477  //(Important for AOD implementation, since Track array in AOD data is different
1478  //from ESD array, but ESD tracklabels are stored in AOD Tracks)
1479 
1480  if(event) {
1481  if(label > event->GetNumberOfTracks() ) return NULL;
1482  AliESDtrack * track = event->GetTrack(label);
1483  return track;
1484  }
1485  //AliDebug(5,(Form("track not found %d %d",label,event->GetNumberOfTracks()));
1486  return NULL;
1487 }
1488 
1489 
1490 
1493  // Cut on Electron Probability for Photon Reconstruction
1494 
1495  AliESDEvent * esdEvent = dynamic_cast<AliESDEvent*>(event);
1496 
1497  if(esdEvent){
1498 
1499  Bool_t iResult=kFALSE;
1500 
1501  Double_t *posProbArray = new Double_t[AliPID::kSPECIES];
1502  Double_t *negProbArray = new Double_t[AliPID::kSPECIES];
1503 
1504  AliESDtrack* negTrack = esdEvent->GetTrack(photon->GetTrackLabelNegative());
1505  AliESDtrack* posTrack = esdEvent->GetTrack(photon->GetTrackLabelPositive());
1506 
1507  if(negProbArray && posProbArray){
1508 
1509  negTrack->GetTPCpid(negProbArray);
1510  posTrack->GetTPCpid(posProbArray);
1511 
1512  if(negProbArray[AliPID::kElectron]>=fPIDProbabilityCutNegativeParticle && posProbArray[AliPID::kElectron]>=fPIDProbabilityCutPositiveParticle){
1513  iResult=kTRUE;
1514  }
1515  }
1516 
1517  delete [] posProbArray;
1518  delete [] negProbArray;
1519  return iResult;
1520 
1521  } else {
1523  return kTRUE;
1524  }
1525 }
1526 
1527 
1529 Bool_t AliConversionPhotonCuts::AcceptanceCut(TParticle *particle, TParticle * ePos,TParticle* eNeg){
1530  // MC Acceptance Cuts
1531  //(Certain areas were excluded for photon reconstruction)
1532 
1533  if(particle->R()>fMaxR){
1534  return kFALSE;}
1535 
1536  if(ePos->R()>fMaxR){
1537  return kFALSE;
1538  }
1539 
1540  if(ePos->R()<fMinR){
1541  return kFALSE;
1542  }
1543 
1544  if( ePos->R() <= ((TMath::Abs(ePos->Vz())*fLineCutZRSlope)-fLineCutZValue)){
1545  return kFALSE;
1546  }
1547  else if (fUseEtaMinCut && ePos->R() >= ((TMath::Abs(ePos->Vz())*fLineCutZRSlopeMin)-fLineCutZValueMin )){
1548  return kFALSE;
1549  }
1550 
1551  if(TMath::Abs(eNeg->Vz()) > fMaxZ ){ // cuts out regions where we do not reconstruct
1552  return kFALSE;
1553  }
1554 
1555  if(eNeg->Vz()!=ePos->Vz()||eNeg->R()!=ePos->R()){
1556  return kFALSE;
1557  }
1558 
1559  if(TMath::Abs(ePos->Vz()) > fMaxZ ){ // cuts out regions where we do not reconstruct
1560  return kFALSE;
1561  }
1562 
1563 
1564  if( particle->Eta() > (fEtaCut) || particle->Eta() < (-fEtaCut) ){
1565  return kFALSE;
1566  }
1567  if( ePos->Eta() > (fEtaCut) || ePos->Eta() < (-fEtaCut) ){
1568  return kFALSE;
1569  }
1570  if( eNeg->Eta() > (fEtaCut) || eNeg->Eta() < (-fEtaCut) ){
1571  return kFALSE;
1572  }
1573  if(fEtaCutMin>-0.1){
1574  if( particle->Eta() < (fEtaCutMin) && particle->Eta() > (-fEtaCutMin) ){
1575  return kFALSE;
1576  }
1577  if( ePos->Eta() < (fEtaCutMin) && ePos->Eta() > (-fEtaCutMin) ){
1578  return kFALSE;
1579  }
1580  if( eNeg->Eta() < (fEtaCutMin) && eNeg->Eta() > (-fEtaCutMin) ){
1581  return kFALSE;
1582  }
1583  }
1584 
1585  if(fDoAsymPtCut){
1586  if((ePos->Pt()<fSinglePtCut || eNeg->Pt()<fSinglePtCut2) && (ePos->Pt()<fSinglePtCut2 || eNeg->Pt()<fSinglePtCut) ){
1587  return kFALSE;
1588  }
1589  } else {
1590  if(ePos->Pt()<fSinglePtCut || eNeg->Pt()<fSinglePtCut){
1591  return kFALSE;
1592  }
1593  }
1594 
1595  if(particle->Pt()<fPtCut){
1596  return kFALSE;
1597  }
1598 
1599  return kTRUE;
1600 }
1604 
1605  if(fCutString && fCutString->GetString().Length() == kNCuts) {
1606  fCutString->SetString(GetCutNumber());
1607  } else {
1608  return kFALSE;
1609  }
1610  return kTRUE;
1611 }
1612 
1613 
1616  fCutStringRead = Form("%s",analysisCutSelection.Data());
1617 
1618  // Initialize Cuts from a given Cut string
1619  AliInfo(Form("Set Photoncut Number: %s",analysisCutSelection.Data()));
1620  if(analysisCutSelection.Length()!=kNCuts) {
1621  AliError(Form("Cut selection has the wrong length! size is %d, number of cuts is %d", analysisCutSelection.Length(), kNCuts));
1622  return kFALSE;
1623  }
1624  if(!analysisCutSelection.IsAlnum()){
1625  AliError("Cut selection is not alphanumeric");
1626  return kFALSE;
1627  }
1628 
1629  TString analysisCutSelectionLowerCase = Form("%s",analysisCutSelection.Data());
1630  analysisCutSelectionLowerCase.ToLower();
1631  const char *cutSelection = analysisCutSelectionLowerCase.Data();
1632  #define ASSIGNARRAY(i) fCuts[i] = ((int)cutSelection[i]>=(int)'a') ? cutSelection[i]-'a'+10 : cutSelection[i]-'0'
1633  for(Int_t ii=0;ii<kNCuts;ii++){
1634  ASSIGNARRAY(ii);
1635  }
1636 
1637  // Set Individual Cuts
1638  for(Int_t ii=0;ii<kNCuts;ii++){
1639  if(!SetCut(cutIds(ii),fCuts[ii]))return kFALSE;
1640  }
1641 
1643 
1644  return kTRUE;
1645 }
1649 
1650  switch (cutID) {
1651 
1652  case kv0FinderType:
1653  if( SetV0Finder(value)) {
1654  fCuts[kv0FinderType] = value;
1655  UpdateCutString();
1656  return kTRUE;
1657  } else return kFALSE;
1658 
1659  case ketaCut:
1660  if( SetEtaCut(value)) {
1661  fCuts[ketaCut] = value;
1662  UpdateCutString();
1663  return kTRUE;
1664  } else return kFALSE;
1665 
1666  case kRCut:
1667  if( SetRCut(value)) {
1668  fCuts[kRCut] = value;
1669  UpdateCutString();
1670  return kTRUE;
1671  } else return kFALSE;
1672 
1673  case kEtaForPhiSector:
1674  if( SetEtaForPhiCut(value)) {
1675  fCuts[kEtaForPhiSector] = value;
1676  UpdateCutString();
1677  return kTRUE;
1678  } else return kFALSE;
1679  case kMinPhiSector:
1680  if( SetMinPhiSectorCut(value)) {
1681  fCuts[kMinPhiSector] = value;
1682  UpdateCutString();
1683  return kTRUE;
1684  } else return kFALSE;
1685  case kMaxPhiSector:
1686  if( SetMaxPhiSectorCut(value)) {
1687  fCuts[kMaxPhiSector] = value;
1688  UpdateCutString();
1689  return kTRUE;
1690  } else return kFALSE;
1691 
1692  case ksinglePtCut:
1693  if( SetSinglePtCut(value)) {
1694  fCuts[ksinglePtCut] = value;
1695  UpdateCutString();
1696  return kTRUE;
1697  } else return kFALSE;
1698 
1699  case kclsTPCCut:
1700  if( SetTPCClusterCut(value)) {
1701  fCuts[kclsTPCCut] = value;
1702  UpdateCutString();
1703  return kTRUE;
1704  } else return kFALSE;
1705 
1706  case kededxSigmaCut:
1707  if (!fSwitchToKappa){
1708  if( SetTPCdEdxCutElectronLine(value)) {
1709  fCuts[kededxSigmaCut] = value;
1710  UpdateCutString();
1711  return kTRUE;
1712  } else return kFALSE;
1713  } else {
1714  if( SetKappaTPCCut(value)) {
1715  fCuts[kededxSigmaCut] = value;
1716  UpdateCutString();
1717  return kTRUE;
1718  } else return kFALSE;
1719  }
1720  case kpidedxSigmaCut:
1721  if (!fSwitchToKappa){
1722  if( SetTPCdEdxCutPionLine(value)) {
1723  fCuts[kpidedxSigmaCut] = value;
1724  UpdateCutString();
1725  return kTRUE;
1726  } else return kFALSE;
1727  } else {
1728  fCuts[kpidedxSigmaCut] = 0;
1729  return kTRUE;
1730  }
1731  case kpiMomdedxSigmaCut:
1732  if (!fSwitchToKappa){
1733  if( SetMinMomPiondEdxCut(value)) {
1734  fCuts[kpiMomdedxSigmaCut] = value;
1735  UpdateCutString();
1736  return kTRUE;
1737  } else return kFALSE;
1738  } else {
1740  return kTRUE;
1741  }
1742  case kpiMaxMomdedxSigmaCut:
1743  if (!fSwitchToKappa){
1744  if( SetMaxMomPiondEdxCut(value)) {
1745  fCuts[kpiMaxMomdedxSigmaCut] = value;
1746  UpdateCutString();
1747  return kTRUE;
1748  } else return kFALSE;
1749  } else {
1751  return kTRUE;
1752  }
1754  if (!fSwitchToKappa){
1755  if( SetLowPRejectionCuts(value)) {
1756  fCuts[kLowPRejectionSigmaCut] = value;
1757  UpdateCutString();
1758  return kTRUE;
1759  } else return kFALSE;
1760  } else {
1762  return kTRUE;
1763  }
1764  case kTOFelectronPID:
1765  if( SetTOFElectronPIDCut(value)) {
1766  fCuts[kTOFelectronPID] = value;
1767  UpdateCutString();
1768  return kTRUE;
1769  } else return kFALSE;
1770 
1771  case kQtMaxCut:
1772  if( SetQtMaxCut(value)) {
1773  fCuts[kQtMaxCut] = value;
1774  UpdateCutString();
1775  return kTRUE;
1776  } else return kFALSE;
1777 
1778 
1779  case kchi2GammaCut:
1780  if( SetChi2GammaCut(value)) {
1781  fCuts[kchi2GammaCut] = value;
1782  UpdateCutString();
1783  return kTRUE;
1784  } else return kFALSE;
1785 
1786  case kPsiPair:
1787  if( SetPsiPairCut(value)) {
1788  fCuts[kPsiPair] = value;
1789  UpdateCutString();
1790  return kTRUE;
1791  } else return kFALSE;
1792 
1793  case kdoPhotonAsymmetryCut:
1794  if( SetPhotonAsymmetryCut(value)) {
1795  fCuts[kdoPhotonAsymmetryCut] = value;
1796  UpdateCutString();
1797  return kTRUE;
1798  } else return kFALSE;
1799 
1800  case kCosPAngle:
1801  if( SetCosPAngleCut(value)) {
1802  fCuts[kCosPAngle] = value;
1803  UpdateCutString();
1804  return kTRUE;
1805  } else return kFALSE;
1806 
1807  case kElecShare:
1808  if( SetSharedElectronCut(value)) {
1809  fCuts[kElecShare] = value;
1810  UpdateCutString();
1811  return kTRUE;
1812  } else return kFALSE;
1813 
1814  case kToCloseV0s:
1815  if( SetToCloseV0sCut(value)) {
1816  fCuts[kToCloseV0s] = value;
1817  UpdateCutString();
1818  return kTRUE;
1819  } else return kFALSE;
1820 
1821  case kDcaRPrimVtx:
1822  if( SetDCARPhotonPrimVtxCut(value)) {
1823  fCuts[kDcaRPrimVtx] = value;
1824  UpdateCutString();
1825  return kTRUE;
1826  } else return kFALSE;
1827 
1828  case kDcaZPrimVtx:
1829  if( SetDCAZPhotonPrimVtxCut(value)) {
1830  fCuts[kDcaZPrimVtx] = value;
1831  UpdateCutString();
1832  return kTRUE;
1833  } else return kFALSE;
1834 
1835  case kInPlaneOutOfPlane:
1836  if( SetInPlaneOutOfPlane(value)) {
1837  fCuts[kInPlaneOutOfPlane] = value;
1838  UpdateCutString();
1839  return kTRUE;
1840  } else return kFALSE;
1841 
1842  case kITSelectronPID:
1843  if( SetITSElectronPIDCut(value)) {
1844  fCuts[kITSelectronPID] = value;
1845  UpdateCutString();
1846  return kTRUE;
1847  } else return kFALSE;
1848 
1849  case kTRDelectronPID:
1850  if( SetTRDElectronPIDCut(value)) {
1851  fCuts[kTRDelectronPID] = value;
1852  UpdateCutString();
1853  return kTRUE;
1854  } else return kFALSE;
1855 
1856  case kNCuts:
1857  AliError("Cut id out of range");
1858  return kFALSE;
1859  }
1860 
1861  AliError("Cut id %d not recognized");
1862  return kFALSE;
1863 }
1866  // Print out current Cut Selection
1867  for(Int_t ic = 0; ic < kNCuts; ic++) {
1868  printf("%-30s : %d \n", fgkCutNames[ic], fCuts[ic]);
1869  }
1870 }
1871 
1873  // Print out current Cut Selection with value
1874  printf("\nConversion cutnumber \n");
1875  for(Int_t ic = 0; ic < kNCuts; ic++) {
1876  printf("%d",fCuts[ic]);
1877  }
1878  printf("\n\n");
1879  printf("Electron cuts & Secondary Track Cuts - only track from secondaries enter analysis: \n");
1880  printf("\t no like sign pairs from V0s \n");
1881  if (!fUseCorrectedTPCClsInfo) printf("\t # TPC clusters > %3.2f \n", fMinClsTPC);
1882  if (fEtaCutMin > -0.1) printf("\t %3.2f < eta_{e} < %3.2f\n", fEtaCutMin, fEtaCut );
1883  else printf("\t eta_{e} < %3.2f\n", fEtaCut );
1884  printf("\t reject: %3.2f < phi < %3.2f with %3.2f < eta < %3.2f \n", fMinPhiCut, fMaxPhiCut, fEtaForPhiCutMin, fEtaForPhiCutMax);
1885  if(fDoAsymPtCut)
1886  printf("\t Asymmetric cut: p_{T,e1} > %3.2f and p_{T,e2} > %3.2f\n", fSinglePtCut, fSinglePtCut2 );
1887  else
1888  printf("\t p_{T,e} > %3.2f\n", fSinglePtCut );
1889  printf("\t TPC refit \n");
1890  printf("\t no kinks \n");
1891  if (!fSwitchToKappa){
1892  printf("\t accept: %3.2f < n sigma_{e,TPC} < %3.2f\n", fPIDnSigmaBelowElectronLine, fPIDnSigmaAboveElectronLine );
1893  printf("\t reject: %3.2f < p_{e,T} < %3.2f, n sigma_{pi,TPC} < %3.2f\n", fPIDMinPnSigmaAbovePionLine, fPIDMaxPnSigmaAbovePionLine, fPIDnSigmaAbovePionLine );
1894  printf("\t reject: p_{e,T} > %3.2f, n sigma_{pi,TPC} < %3.2f\n", fPIDMaxPnSigmaAbovePionLine, fPIDnSigmaAbovePionLineHighPt );
1895  if (fDoPionRejectionLowP) printf("\t reject: p_{e,T} < %3.2f, -%3.2f < n sigma_{pi,TPC} < %3.2f\n", fPIDMinPPionRejectionLowP, fPIDnSigmaAtLowPAroundPionLine, fPIDnSigmaAtLowPAroundPionLine );
1896  if (fDoKaonRejectionLowP) printf("\t reject: -%3.2f < n sigma_{K,TPC} < %3.2f\n", fPIDnSigmaAtLowPAroundKaonLine, fPIDnSigmaAtLowPAroundKaonLine );
1897  if (fDoProtonRejectionLowP) printf("\t reject: -%3.2f < n sigma_{p,TPC} < %3.2f\n", fPIDnSigmaAtLowPAroundProtonLine, fPIDnSigmaAtLowPAroundProtonLine );
1898  } else {
1899  printf("\t accept: %3.2f <= Kappa_{TPC} < %3.2f\n", fKappaMinCut, fKappaMaxCut );
1900  }
1901  if (fUseTOFpid) printf("\t accept: %3.2f < n sigma_{e,TOF} < %3.2f\n", fTofPIDnSigmaBelowElectronLine, fTofPIDnSigmaAboveElectronLine);
1902  if (fUseITSpid) printf("\t accept: %3.2f < n sigma_{e,ITS} < %3.2f\n -- up to pT %3.2f", fITSPIDnSigmaBelowElectronLine, fITSPIDnSigmaAboveElectronLine, fMaxPtPIDITS);
1903 
1904  printf("Photon cuts: \n");
1905  if (fUseOnFlyV0Finder) printf("\t using Onfly V0 finder \n");
1906  else printf("\t using Offline V0 finder \n");
1907  if (fDo2DQt){
1908  printf("\t 2 dimensional q_{T} cut applied with maximum of %3.2f \n", fQtMax );
1909  } else {
1910  printf("\t 1 dimensional q_{T} cut applied with maximum of %3.2f \n", fQtMax );
1911  }
1912  if (fDo2DPsiPairChi2){
1913  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 );
1914  } else {
1915  printf("\t chi^{2} max cut chi^{2} < %3.2f \n", fChi2CutConversion );
1916  printf("\t psi_{pair} max cut |psi_{pair}| < %3.2f \n", fPsiPairCut );
1917  }
1918  printf("\t %3.2f < R_{conv} < %3.2f\n", fMinR, fMaxR );
1919  printf("\t Z_{conv} < %3.2f\n", fMaxZ );
1920  if (fEtaCutMin > -0.1) printf("\t %3.2f < eta_{conv} < %3.2f\n", fEtaCutMin, fEtaCut );
1921  else printf("\t eta_{conv} < %3.2f\n", fEtaCut );
1922  if (fDoPhotonAsymmetryCut) printf("\t for p_{T,track} > %3.2f, A_{gamma} < %3.2f \n", fMinPPhotonAsymmetryCut, fMinPhotonAsymmetry );
1923  if (fDoPhotonPDependentAsymCut && fDoPhotonAsymmetryCut) printf("\t p-dependent asymmetry cut \n");
1924  if (fUseCorrectedTPCClsInfo) printf("\t #cluster TPC/ #findable clusters TPC (corrected for radius) > %3.2f\n", fMinClsTPCToF );
1925  printf("\t p_{T,gamma} > %3.2f\n", fPtCut );
1926  printf("\t cos(Theta_{point}) > %3.2f \n", fCosPAngleCut );
1927  printf("\t dca_{R} < %3.2f \n", fDCARPrimVtxCut );
1928  printf("\t dca_{Z} < %3.2f \n", fDCAZPrimVtxCut );
1929  if (fDoPhotonQualitySelectionCut) printf("\t selection based on photon quality with quality %d \n", fPhotonQualityCut );
1930  if (fDoDoubleCountingCut) printf("\t Reject doubly counted photons with R > %3.2f, DeltaR < %3.2f, OpenAngle < %3.2f \n", fMinRDC, fDeltaR,fOpenAngle );
1931 
1932 }
1933 
1936  switch (v0FinderType){
1937  case 0: // on fly V0 finder
1938  cout << "have chosen onfly V0" << endl;
1939  fUseOnFlyV0Finder=kTRUE;
1941  break;
1942  case 1: // offline V0 finder
1943  cout << "have chosen offline V0" << endl;
1944  fUseOnFlyV0Finder=kFALSE;
1946  break;
1947  case 2: // on fly V0 finder with same signs
1948  cout << "have chosen onfly V0 same sign pairing" << endl;
1949  fUseOnFlyV0Finder=kTRUE;
1951  break;
1952  case 3: // on fly V0 finder with unlike signs and same signs
1953  cout << "have chosen onfly V0 unlike sign and same signs pairing" << endl;
1954  fUseOnFlyV0Finder=kTRUE;
1956  break;
1957  default:
1958  AliError(Form(" v0FinderType not defined %d",v0FinderType));
1959  return kFALSE;
1960  }
1961  return kTRUE;
1962 }
1963 
1966 
1967  //Set Standard LineCutZValues
1968  fLineCutZValueMin = -2;
1969  fLineCutZValue = 7.;
1970 
1971  switch(etaCut){
1972  case 0: // 0.9
1973  fEtaCut = 0.9;
1974  fLineCutZRSlope = tan(2*atan(exp(-fEtaCut)));
1975  fEtaCutMin = -0.1;
1976  fLineCutZRSlopeMin = 0.;
1977  break;
1978  case 1: // 0.6 // changed from 1.2 to 0.6 on 2013.06.10
1979  fEtaCut = 0.6;
1980  fLineCutZRSlope = tan(2*atan(exp(-fEtaCut)));
1981  fEtaCutMin = -0.1;
1982  fLineCutZRSlopeMin = 0.;
1983  break;
1984  case 2: // 1.4
1985  fEtaCut = 1.4;
1986  fLineCutZRSlope = tan(2*atan(exp(-fEtaCut)));
1987  fEtaCutMin = -0.1;
1988  fLineCutZRSlopeMin = 0.;
1989  break;
1990  case 3: // 0.65
1991  fEtaCut = 0.65;
1992  fLineCutZRSlope = tan(2*atan(exp(-fEtaCut)));
1993  fEtaCutMin = -0.1;
1994  fLineCutZRSlopeMin = 0.;
1995  break;
1996  case 4: // 0.75
1997  fEtaCut = 0.75;
1998  fLineCutZRSlope = tan(2*atan(exp(-fEtaCut)));
1999  fEtaCutMin = -0.1;
2000  fLineCutZRSlopeMin = 0.;
2001  break;
2002  case 5: // 0.5
2003  fEtaCut = 0.5;
2004  fLineCutZRSlope = tan(2*atan(exp(-fEtaCut)));
2005  fEtaCutMin = -0.1;
2006  fLineCutZRSlopeMin = 0.;
2007  break;
2008  case 6: // 5.
2009  fEtaCut = 5.;
2010  fLineCutZRSlope = tan(2*atan(exp(-fEtaCut)));
2011  fEtaCutMin = -0.1;
2012  fLineCutZRSlopeMin = 0.;
2013  break;
2014  case 7:
2015  if (fIsHeavyIon==1){
2016  fEtaCut = 0.7;
2017  fLineCutZRSlope = tan(2*atan(exp(-fEtaCut)));
2018  fEtaCutMin = -0.1;
2019  fLineCutZRSlopeMin = 0.;
2020  break;
2021  } else {
2022  fEtaCut = 0.3;
2023  fLineCutZRSlope = tan(2*atan(exp(-fEtaCut)));
2024  fEtaCutMin = -0.1;
2025  fLineCutZRSlopeMin = 0.;
2026  break;
2027  }
2028  // case 8: // 0.1 - 0.8
2029  // fEtaCut = 0.9;
2030  // fLineCutZRSlope = tan(2*atan(exp(-fEtaCut)));
2031  // fEtaCutMin = 0.1;
2032  // fLineCutZRSlopeMin = tan(2*atan(exp(-fEtaCutMin)));
2033  // break;
2034  case 8: // 0.4
2035  fEtaCut = 0.4;
2036  fLineCutZRSlope = tan(2*atan(exp(-fEtaCut)));
2037  fEtaCutMin = -0.1;
2038  fLineCutZRSlopeMin = 0.;
2039  break;
2040  case 9: // 10
2041  fEtaCut = 10;
2042  fLineCutZRSlope = tan(2*atan(exp(-fEtaCut)));
2043  fEtaCutMin = -0.1;
2044  fLineCutZRSlopeMin = 0.;
2045  break;
2046  case 10: // 0.2-0.9
2047  fEtaCut = 0.9;
2048  fLineCutZRSlope = tan(2*atan(exp(-fEtaCut)));
2049  fEtaCutMin = 0.2;
2050  fLineCutZRSlopeMin = 0.;
2051  break;
2052  case 11: // 0.2-0.9
2053  fEtaCut = 0.9;
2054  fLineCutZRSlope = tan(2*atan(exp(-fEtaCut)));
2055  fEtaCutMin = 0.2;
2056  fLineCutZRSlopeMin = tan(2*atan(exp(-fEtaCutMin)));
2057  break;
2058  default:
2059  AliError(Form(" EtaCut not defined %d",etaCut));
2060  return kFALSE;
2061  }
2062  return kTRUE;
2063 }
2064 
2067  // Set Cut
2068  switch(RCut){
2069  case 0:
2070  fMinR=0;
2071  fMaxR = 180.;
2072  break;
2073  case 1:
2074  fMinR=2.8;
2075  fMaxR = 180.;
2076  break;
2077  case 2:
2078  fMinR=5.;
2079  fMaxR = 180.;
2080  break;
2081  case 3:
2082  fMaxR = 70.;
2083  fMinR = 10.;
2084  break;
2085  case 4:
2086  fMaxR = 70.;
2087  fMinR = 5.;
2088  break;
2089  case 5:
2090  fMaxR = 180.;
2091  fMinR = 10.;
2092  break;
2093  case 6:
2094  fMaxR = 180.;
2095  fMinR = 20.;
2096  break;
2097  case 7:
2098  fMaxR = 180.;
2099  fMinR = 35.; //old 26.
2100  break;
2101  case 8:
2102  fMaxR = 180.;
2103  fMinR = 12.5;
2104  break;
2105  case 9:
2106  fMaxR = 180.;
2107  fMinR = 7.5;
2108  break;
2109  case 10:
2110  fMaxR = 33.5;
2111  fMinR = 5.;
2112  break;
2113  case 11:
2114  fMaxR = 72.;
2115  fMinR = 33.5;
2116  break;
2117  case 12:
2118  fMaxR = 180.;
2119  fMinR = 72.;
2120  break;
2121  case 13:
2122  fMaxR = 55.;
2123  fMinR = 5.;
2124  break;
2125  case 14:
2126  fMaxR = 180.;
2127  fMinR = 55.;
2128  break;
2129  case 15:
2130  fMaxR = 72.;
2131  fMinR = 5.;
2132  break;
2133  case 16:
2134  fMaxR = 180.;
2135  fMinR = 95.;
2136  break;
2137 
2138  default:
2139  AliError("RCut not defined");
2140  return kFALSE;
2141  }
2142  return kTRUE;
2143 }
2144 
2147 
2148  switch(etaPhiCut) {
2149  case 0: //no specific eta range selected, full eta range
2152  break;
2153  case 1: //eta < 0 only
2156  fEtaForPhiCutMax = 0.;
2157  break;
2158  case 2://eta > 0 only
2160  fEtaForPhiCutMin = 0.;
2162  break;
2163  default:
2164  AliError(Form("EtaForPhiCut not defined %d",etaPhiCut));
2165  return kFALSE;
2166  }
2167 
2168  return kTRUE;
2169 }
2170 
2172 // This are exclusion cuts, everything between fMinPhiCut & fMaxPhiCut will be excluded
2174 
2175  switch(minPhiCut) {
2176  case 0:
2177  fDoShrinkTPCAcceptance = kFALSE;
2178  fMinPhiCut = 0;
2179  break;
2180  case 1:
2182  fMinPhiCut = 1.7; //OROC C08 large cut
2183  break;
2184  case 2:
2186  fMinPhiCut = 4.4; //EMCal
2187  break;
2188  case 3:
2190  fMinPhiCut = 1.0; //PHOS
2191  break;
2192  case 4:
2194  fMinPhiCut = 3.4; //EMCal tight
2195  break;
2196  case 5:
2198  fMinPhiCut = 2.0; //OROC C08 medium cut
2199  break;
2200  case 6:
2202  fMinPhiCut = 2.2; //OROC C08 small cut
2203  break;
2204  case 7:
2206  fMinPhiCut = 2.4; //OROC C08 tightest cut
2207  break;
2208  case 8:
2210  fMinPhiCut = 4.54; //PHOS phi
2211  break;
2212  default:
2213  AliError(Form("MinPhiCut not defined %d",minPhiCut));
2214  return kFALSE;
2215  }
2216 
2217  return kTRUE;
2218 }
2219 
2221 // This are exclusion cuts, everything between fMinPhiCut & fMaxPhiCut will be excluded
2223 
2224  switch(maxPhiCut) {
2225  case 0:
2227  fMaxPhiCut = 2*TMath::Pi()+0.00001;
2228  break;
2229  case 1:
2231  fMaxPhiCut = 4.3; //OROC C08 large cut
2232  break;
2233  case 2:
2235  fMaxPhiCut = 5.8; //EMCal
2236  break;
2237  case 3:
2239  fMaxPhiCut = 3.0; //PHOS
2240  break;
2241  case 4:
2243  fMaxPhiCut = 1.; //EMCal
2244  break;
2245  case 5:
2247  fMaxPhiCut = 4.0; //OROC C08 medium cut
2248  break;
2249  case 6:
2251  fMaxPhiCut = 3.8; //OROC C08 small cut
2252  break;
2253  case 7:
2255  fMaxPhiCut = 3.6; //OROC C08 tighest cut
2256  break;
2257  case 8:
2259  fMaxPhiCut = 5.59; //PHOS phi
2260  break;
2261  default:
2262  AliError(Form("MaxPhiCut not defined %d",maxPhiCut));
2263  return kFALSE;
2264  }
2265 
2266  return kTRUE;
2267 }
2268 
2269 
2272  switch(singlePtCut){
2273  case 0: // 0.050 GeV + min gamma pT cut of 20 MeV
2274  fSinglePtCut = 0.050;
2275  fPtCut = 0.02;
2276  break;
2277  case 1: // 0.100 GeV + min gamma pT cut of 20 MeV
2278  fSinglePtCut = 0.100;
2279  fPtCut = 0.02;
2280  break;
2281  case 2: // 0.150 GeV + min gamma pT cut of 20 MeV
2282  fSinglePtCut = 0.150;
2283  fPtCut = 0.02;
2284  break;
2285  case 3: // 0.200 GeV + min gamma pT cut of 20 MeV
2286  fSinglePtCut = 0.200;
2287  fPtCut = 0.02;
2288  break;
2289  case 4: // 0.075 GeV + min gamma pT cut of 20 MeV
2290  fSinglePtCut = 0.075;
2291  fPtCut = 0.02;
2292  break;
2293  case 5: // 0.125 GeV + min gamma pT cut of 20 MeV
2294  fSinglePtCut = 0.125;
2295  fPtCut = 0.02;
2296  break;
2297  case 6: // 0.04 GeV + min gamma pT cut of 10 MeV
2298  fSinglePtCut = 0.040;
2299  fPtCut = 0.01;
2300  break;
2301  case 7: // 0.0 GeV + min gamma pT cut of 0 MeV
2302  fSinglePtCut = 0.0;
2303  fPtCut = 0.0;
2304  break;
2305  case 8: // 0.02 GeV + min gamma pT cut of 20 MeV, equivalent to .05 for the low B field runs
2306  fSinglePtCut = 0.02;
2307  fPtCut = 0.01;
2308  break;
2309  case 9: // 0.050 GeV + min gamma pT cut of 100 MeV
2310  fSinglePtCut = 0.050;
2311  fPtCut = 0.100;
2312  break;
2313  case 10: //a: 0.050 GeV + min gamma pT cut of 150 MeV
2314  fSinglePtCut = 0.050;
2315  fPtCut = 0.150;
2316  break;
2317  case 11: //b: 0.050 GeV + min gamma pT cut of 200 MeV
2318  fSinglePtCut = 0.050;
2319  fPtCut = 0.200;
2320  break;
2321  case 12: //c: 0.060 GeV
2322  fSinglePtCut = 0.060;
2323  break;
2324  case 13: //d: 0.060 GeV + min gamma pT cut of 100 MeV
2325  fSinglePtCut = 0.060;
2326  fPtCut = 0.100;
2327  break;
2328  case 14: //e: 0.060 GeV + min gamma pT cut of 150 MeV
2329  fSinglePtCut = 0.060;
2330  fPtCut = 0.150;
2331  break;
2332  case 15: //f: 0.060 GeV + min gamma pT cut of 200 MeV
2333  fSinglePtCut = 0.060;
2334  fPtCut = 0.200;
2335  break;
2336  case 16: //g: 0.075 GeV + min gamma pT cut of 150 MeV
2337  fSinglePtCut = 0.075;
2338  fPtCut = 0.150;
2339  break;
2340  case 17: //h: 0.100 GeV + min gamma pT cut of 200 MeV
2341  fSinglePtCut = 0.100;
2342  fPtCut = 0.200;
2343  break;
2344  case 18: //i: 0.150 GeV + min gamma pT cut of 300 MeV
2345  fSinglePtCut = 0.150;
2346  fPtCut = 0.300;
2347  break;
2348  case 19: //j: asym: 0.100 GeV and 0.075 GeV
2349  fSinglePtCut = 0.100;
2350  fDoAsymPtCut = kTRUE;
2351  fSinglePtCut2= 0.075;
2352  break;
2353  case 20: //k: asym: 0.150 GeV and 0.075 GeV
2354  fSinglePtCut = 0.150;
2355  fDoAsymPtCut = kTRUE;
2356  fSinglePtCut2= 0.075;
2357  break;
2358  case 21: //l: asym: 0.200 GeV and 0.075 GeV
2359  fSinglePtCut = 0.200;
2360  fDoAsymPtCut = kTRUE;
2361  fSinglePtCut2= 0.075;
2362  break;
2363  case 22: // m: 0.080 GeV + min gamma pT cut of 20 MeV
2364  fSinglePtCut = 0.080;
2365  fPtCut = 0.02;
2366  break;
2367  case 23: // n: 0.090 GeV + min gamma pT cut of 20 MeV
2368  fSinglePtCut = 0.090;
2369  fPtCut = 0.02;
2370  break;
2371  case 24: // o: 0.024 GeV + min gamma pT cut of 20 MeV ; equiv. 0.06 for lowB
2372  fSinglePtCut = 0.024;
2373  fPtCut = 0.01;
2374  break;
2375  case 25: // p: 0.030 GeV + min gamma pT cut of 20 MeV ; equiv. 0.075 for lowB
2376  fSinglePtCut = 0.030;
2377  fPtCut = 0.01;
2378  break;
2379  case 26: // q: 0.032 GeV + min gamma pT cut of 20 MeV ; equiv. 0.08 for lowB
2380  fSinglePtCut = 0.032;
2381  fPtCut = 0.01;
2382  break;
2383  case 27: // r: 0.036 GeV + min gamma pT cut of 20 MeV ; equiv. 0.09 for lowB
2384  fSinglePtCut = 0.036;
2385  fPtCut = 0.01;
2386  break;
2387  case 28: // s: 0.040 GeV + min gamma pT cut of 20 MeV ; equiv. 0.075 for lowB
2388  fSinglePtCut = 0.040;
2389  fPtCut = 0.01;
2390  break;
2391 
2392  default:
2393  AliError(Form("singlePtCut not defined %d",singlePtCut));
2394  return kFALSE;
2395  }
2396  return kTRUE;
2397 }
2398 
2401  switch(clsTPCCut){
2402  case 0: // 0
2403  fMinClsTPC= 0.;
2404  break;
2405  case 1: // 60
2406  fMinClsTPC= 60.;
2407  break;
2408  case 2: // 80
2409  fMinClsTPC= 80.;
2410  break;
2411  case 3: // 100
2412  fMinClsTPC= 100.;
2413  break;
2414  case 4: // 95% of findable clusters
2415  fMinClsTPCToF= 0.95;
2417  break;
2418  case 5: // 0% of findable clusters
2419  fMinClsTPCToF= 0.0;
2421  break;
2422  case 6: // 70% of findable clusters
2423  fMinClsTPCToF= 0.7;
2425  break;
2426  case 7: // 0% of findable clusters
2427  fMinClsTPCToF= 0.35;
2429  break;
2430  case 8:
2431  fMinClsTPCToF= 0.35;
2433  break;
2434  case 9:
2435  fMinClsTPCToF= 0.6;
2437  break;
2438  default:
2439  AliError(Form("Warning: clsTPCCut not defined %d",clsTPCCut));
2440  return kFALSE;
2441  }
2442  return kTRUE;
2443 }
2444 
2447  switch(ededxSigmaCut){
2448  case 0: // -10,10
2451  break;
2452  case 1: // -5,5
2455  break;
2456  case 2: // -3,5
2459  break;
2460  case 3: // -4,5
2463  break;
2464  case 4: // -6,7
2467  break;
2468  case 5: // -4,4
2471  break;
2472  case 6: // -2.5,4
2475  break;
2476  case 7: // -2,3.5
2479  break;
2480  case 8: // -2.5,3.
2483  break;
2484  case 9: // -2.5,5.
2487  break;
2488  default:
2489  AliError("TPCdEdxCutElectronLine not defined");
2490  return kFALSE;
2491 
2492  }
2493  return kTRUE;
2494 }
2495 
2498 
2499  switch(pidedxSigmaCut){
2500  case 0: // -10
2503  break;
2504  case 1: // 0
2507  break;
2508  case 2: // 1
2511  break;
2512  case 3: // 1
2515  break;
2516  case 4: // 3.0sigma, 1.0 sigma at high pt
2519  break;
2520  case 5: // 1
2523  break;
2524  case 6: // 1
2527  break;
2528  case 7: // 1
2531  break;
2532  case 8: // 1
2535  break;
2536  case 9:
2537  fPIDnSigmaAbovePionLine=1; // We need a bit less tight cut on dE/dx
2539  break;
2540  default:
2541  AliError(Form("Warning: pidedxSigmaCut not defined %d",pidedxSigmaCut));
2542  return kFALSE;
2543  }
2544  return kTRUE;
2545 }
2546 
2549  switch(piMomdedxSigmaCut){
2550  case 0: // 0.5 GeV
2552  break;
2553  case 1: // 1. GeV
2555  break;
2556  case 2: // 1.5 GeV
2558  break;
2559  case 3: // 20.0 GeV
2561  break;
2562  case 4: // 50.0 GeV
2564  break;
2565  case 5: // 0.3 GeV
2567  break;
2568  case 6: // 0.25 GeV
2570  break;
2571  case 7: // 0.4 GeV
2573  break;
2574  case 8: // 0.2 GeV
2576  break;
2577  default:
2578  AliError(Form("piMomdedxSigmaCut not defined %d",piMomdedxSigmaCut));
2579  return kFALSE;
2580  }
2581  return kTRUE;
2582 }
2583 
2586  switch(piMaxMomdedxSigmaCut){
2587  case 0: // 100. GeV
2589  break;
2590  case 1: // 5. GeV
2592  break;
2593  case 2: // 4. GeV
2595  break;
2596  case 3: // 3.5 GeV
2598  break;
2599  case 4: // 3. GeV
2601  break;
2602  case 5: // 7. GeV
2604  break;
2605  case 6: // 2. GeV
2607  break;
2608  default:
2609  AliError(Form("piMaxMomdedxSigmaCut not defined %d",piMaxMomdedxSigmaCut));
2610  return kFALSE;
2611  }
2612  return kTRUE;
2613 }
2614 
2617  switch(LowPRejectionSigmaCut){
2618  case 0: //
2622  fDoKaonRejectionLowP = kFALSE;
2623  fDoProtonRejectionLowP = kFALSE;
2624  fDoPionRejectionLowP = kFALSE;
2626  break;
2627  case 1: //
2631  fDoKaonRejectionLowP = kTRUE;
2632  fDoProtonRejectionLowP = kTRUE;
2633  fDoPionRejectionLowP = kTRUE;
2635  break;
2636  case 2: //
2640  fDoKaonRejectionLowP = kTRUE;
2641  fDoProtonRejectionLowP = kTRUE;
2642  fDoPionRejectionLowP = kTRUE;
2644  break;
2645  case 3: //
2649  fDoKaonRejectionLowP = kTRUE;
2650  fDoProtonRejectionLowP = kTRUE;
2651  fDoPionRejectionLowP = kTRUE;
2653  break;
2654  case 4: //
2658  fDoKaonRejectionLowP = kFALSE;
2659  fDoProtonRejectionLowP = kFALSE;
2660  fDoPionRejectionLowP = kTRUE;
2662  break;
2663  case 5: //
2667  fDoKaonRejectionLowP = kFALSE;
2668  fDoProtonRejectionLowP = kFALSE;
2669  fDoPionRejectionLowP = kTRUE;
2671  break;
2672  case 6: //
2676  fDoKaonRejectionLowP = kFALSE;
2677  fDoProtonRejectionLowP = kFALSE;
2678  fDoPionRejectionLowP = kTRUE;
2680  break;
2681  case 7: //
2685  fDoKaonRejectionLowP = kFALSE;
2686  fDoProtonRejectionLowP = kFALSE;
2687  fDoPionRejectionLowP = kTRUE;
2689  break;
2690  case 8: //
2694  fDoKaonRejectionLowP = kFALSE;
2695  fDoProtonRejectionLowP = kTRUE;
2696  fDoPionRejectionLowP = kFALSE;
2698  break;
2699  default:
2700  AliError(Form("LowPRejectionSigmaCut not defined %d",LowPRejectionSigmaCut));
2701  return kFALSE;
2702  }
2703  return kTRUE;
2704 }
2705 
2708  switch(kappaCut){
2709  case 0: // completely open
2710  fKappaMaxCut=200;
2711  fKappaMinCut=-200;
2712  break;
2713  case 1: // mainly pi pi
2714  fKappaMaxCut=-13;
2715  fKappaMinCut=-20;
2716  break;
2717  case 2: // mainly pi e
2718  fKappaMaxCut=-6;
2719  fKappaMinCut=-11;
2720  break;
2721  case 3: // signal
2722  fKappaMaxCut=5;
2723  fKappaMinCut=-3;
2724  break;
2725  case 4: // remaining
2726  fKappaMaxCut=20;
2727  fKappaMinCut=11;
2728  break;
2729  case 5: // -5-10 full signal peak(including background)
2730  fKappaMaxCut=10;
2731  fKappaMinCut=-5;
2732  break;
2733  case 6: //
2734  fKappaMaxCut=10;
2735  fKappaMinCut=-3;
2736  break;
2737  case 7: //
2738  fKappaMaxCut=10;
2739  fKappaMinCut=0;
2740  break;
2741  default:
2742  AliError("KappaTPCCut not defined");
2743  return kFALSE;
2744 
2745  }
2746  return kTRUE;
2747 }
2748 
2749 
2752  // Set Cut
2753  switch(TOFelectronPID){
2754  case 0: // no cut
2755  fUseTOFpid = kFALSE;
2758  break;
2759  case 1: // -7,7
2760  fUseTOFpid = kTRUE;
2763  break;
2764  case 2: // -5,5
2765  fUseTOFpid = kTRUE;
2768  break;
2769  case 3: // -3,5
2770  fUseTOFpid = kTRUE;
2773  break;
2774  case 4: // -2,3
2775  fUseTOFpid = kTRUE;
2778  break;
2779  case 5: // -3,3
2780  fUseTOFpid = kTRUE;
2783  break;
2784  default:
2785  AliError(Form("TOFElectronCut not defined %d",TOFelectronPID));
2786  return kFALSE;
2787  }
2788  return kTRUE;
2789 }
2790 
2793  // Set Cut
2794  switch(ITSelectronPID){
2795  case 0: // no cut
2796  fUseITSpid = kFALSE;
2799  fMaxPtPIDITS = 1.5;
2800  break;
2801  case 1: // -3,3
2802  fUseITSpid = kTRUE;
2805  fMaxPtPIDITS = 1.5;
2806  break;
2807  case 2: // -2,2
2808  fUseITSpid = kTRUE;
2811  fMaxPtPIDITS = 1.5;
2812  break;
2813  case 3: // -1,1
2814  fUseITSpid = kTRUE;
2817  fMaxPtPIDITS = 1.5;
2818  break;
2819  case 4: // -3,5
2820  fUseITSpid = kTRUE;
2823  fMaxPtPIDITS = 1.5;
2824  break;
2825  case 5: // -5,5
2826  fUseITSpid = kTRUE;
2829  fMaxPtPIDITS = 1.5;
2830  break;
2831  case 6: // -3,3
2832  fUseITSpid = kTRUE;
2835  fMaxPtPIDITS = 2;
2836  break;
2837  case 7: // -2,2
2838  fUseITSpid = kTRUE;
2841  fMaxPtPIDITS = 2;
2842  break;
2843  case 8: // -1,1
2844  fUseITSpid = kTRUE;
2847  fMaxPtPIDITS = 2;
2848  break;
2849  case 9: // -3,5
2850  fUseITSpid = kTRUE;
2853  fMaxPtPIDITS = 2;
2854  break;
2855  default:
2856  AliError(Form("ITSelectronPID not defined %d",ITSelectronPID));
2857  return kFALSE;
2858  }
2859  return kTRUE;
2860 }
2861 
2864  // Set Cut
2865  switch(TRDelectronPID){
2866  case 0: // no cut
2867  fDoTRDPID = kFALSE;
2868  fTRDPIDBelowCut=-100;
2869  fTRDPIDAboveCut=100;
2870  break;
2871  default:
2872  AliError(Form("TRDelectronPID not defined %d",TRDelectronPID));
2873  return kFALSE;
2874  }
2875  return kTRUE;
2876 }
2877 
2878 
2881  switch(QtMaxCut){
2882  case 0: //
2883  fQtMax=1.;
2884  fDoQtGammaSelection=kFALSE;
2885  fDo2DQt=kFALSE;
2886  break;
2887  case 1:
2888  fQtMax=0.1;
2889  fDo2DQt=kFALSE;
2890  break;
2891  case 2:
2892  fQtMax=0.06;
2893  fDo2DQt=kTRUE;
2894  break;
2895  case 3:
2896  fQtMax=0.05;
2897  fDo2DQt=kFALSE;
2898  break;
2899  case 4:
2900  fQtMax=0.03;
2901  fDo2DQt=kFALSE;
2902  break;
2903  case 5:
2904  fQtMax=0.02;
2905  fDo2DQt=kFALSE;
2906  break;
2907  case 6:
2908  fQtMax=0.02;
2909  fDo2DQt=kTRUE;
2910  break;
2911  case 7:
2912  fQtMax=0.15;
2913  fDo2DQt=kFALSE;
2914  break;
2915  case 8:
2916  fQtMax=0.05;
2917  fDo2DQt=kTRUE;
2918  break;
2919  case 9:
2920  fQtMax=0.03;
2921  fDo2DQt=kTRUE;
2922  break;
2923  default:
2924  AliError(Form("Warning: QtMaxCut not defined %d",QtMaxCut));
2925  return kFALSE;
2926  }
2927  return kTRUE;
2928 }
2929 
2932 
2933  switch(chi2GammaCut){
2934  case 0: // 100
2935  fChi2CutConversion = 100.;
2936  break;
2937  case 1: // 50
2938  fChi2CutConversion = 50.;
2939  break;
2940  case 2: // 30
2941  fChi2CutConversion = 30.;
2942  break;
2943  case 3:
2944  fChi2CutConversion = 200.;
2945  break;
2946  case 4:
2947  if (fIsHeavyIon==1){
2948  fChi2CutConversion = 7.;
2949  } else {
2950  fChi2CutConversion = 500.;
2951  }
2952  break;
2953  case 5:
2954  fChi2CutConversion = 100000.;
2955  break;
2956  case 6:
2957  fChi2CutConversion = 5.;
2958  break;
2959  case 7:
2960  fChi2CutConversion = 10.;
2961  break;
2962  case 8:
2963  fChi2CutConversion = 20.;
2964  break;
2965  case 9:
2966  fChi2CutConversion = 15.;
2967  break;
2968  case 10:
2969  fChi2CutConversion = 25.;
2970  break;
2971  default:
2972  AliError(Form("Warning: Chi2GammaCut not defined %d",chi2GammaCut));
2973  return kFALSE;
2974  }
2975  return kTRUE;
2976 }
2977 
2980  switch(psiCut) {
2981  case 0:
2982  fPsiPairCut = 10000; //
2983  break;
2984  case 1:
2985  fPsiPairCut = 0.1; //
2986  break;
2987  case 2:
2988  fPsiPairCut = 0.05; // Standard
2989  break;
2990  case 3:
2991  fPsiPairCut = 0.035; //
2992  break;
2993  case 4:
2994  fPsiPairCut = 0.2; //
2995  break;
2996  case 5:
2997  fPsiPairCut = 0.1; //
2998  fDo2DPsiPairChi2 = kTRUE;
2999  break;
3000  case 6:
3001  fPsiPairCut = 0.05; //
3002  fDo2DPsiPairChi2 = kTRUE;
3003  break;
3004  case 7:
3005  if (fIsHeavyIon==1){
3006  fPsiPairCut = 0.07; //
3007  } else {
3008  fPsiPairCut = 0.035; //
3009  }
3010  fDo2DPsiPairChi2 = kTRUE;
3011  break;
3012  case 8:
3013  fPsiPairCut = 0.2; //
3014  fDo2DPsiPairChi2 = kTRUE; //
3015  break;
3016  case 9:
3017  // if (fIsHeavyIon==1){ //AM 2016-05-13
3018  fPsiPairCut = 0.1; //
3019  fDo2DPsiPairChi2 = kTRUE;
3020  fIncludeRejectedPsiPair = kTRUE;
3021  break;
3022  // } else {
3023  // fPsiPairCut = 0.5; //
3024  // break;
3025  // }
3026  default:
3027  AliError(Form("PsiPairCut not defined %d",psiCut));
3028  return kFALSE;
3029  }
3030 
3031  return kTRUE;
3032 }
3033 
3036  // Set Cut
3037  switch(doPhotonAsymmetryCut){
3038  case 0:
3042  break;
3043  case 1:
3046  fMinPhotonAsymmetry=0.04;
3047  break;
3048  case 2:
3051  fMinPhotonAsymmetry=0.06;
3052  break;
3053  case 3:
3056  fMinPhotonAsymmetry=0.05;
3057  break;
3058  case 4:
3061  fFAsymmetryCut = new TF1("fFAsymmetryCut","[0] + [1]*tanh(2*TMath::Power(x,[2]))",0.,100.);
3062  fFAsymmetryCut->SetParameter(0,0.3);
3063  fFAsymmetryCut->SetParameter(1,0.66);
3064  fFAsymmetryCut->SetParameter(2,0.7);
3067  break;
3068  case 5:
3071  fFAsymmetryCut = new TF1("fFAsymmetryCut","[0] + [1]*tanh(2*TMath::Power(x,[2]))",0.,100.);
3072  fFAsymmetryCut->SetParameter(0,0.14);
3073  fFAsymmetryCut->SetParameter(1,0.66);
3074  fFAsymmetryCut->SetParameter(2,0.5);
3077  break;
3078  case 6:
3081  fMinPhotonAsymmetry=0.05;
3082  break;
3083  case 7:
3086  fMinPhotonAsymmetry=0.05;
3087  break;
3088  default:
3089  AliError(Form("PhotonAsymmetryCut not defined %d",doPhotonAsymmetryCut));
3090  return kFALSE;
3091  }
3092  fCuts[kdoPhotonAsymmetryCut]=doPhotonAsymmetryCut;
3093  return kTRUE;
3094 }
3095 
3098 
3099  switch(cosCut){
3100  case 0:
3101  fCosPAngleCut = -1;
3102  break;
3103  case 1:
3104  fCosPAngleCut = 0;
3105  break;
3106  case 2:
3107  fCosPAngleCut = 0.5;
3108  break;
3109  case 3:
3110  fCosPAngleCut = 0.75;
3111  break;
3112  case 4:
3113  fCosPAngleCut = 0.85;
3114  break;
3115  case 5:
3116  fCosPAngleCut = 0.88;
3117  break;
3118  case 6:
3119  fCosPAngleCut = 0.9;
3120  break;
3121  case 7:
3122  fCosPAngleCut = 0.95;
3123  break;
3124  default:
3125  AliError(Form("Cosine Pointing Angle cut not defined %d",cosCut));
3126  return kFALSE;
3127  }
3128 
3129  return kTRUE;
3130 }
3131 
3134 
3135  switch(sharedElec){
3136  case 0:
3137  fDoSharedElecCut = kFALSE;
3139  fPhotonQualityCut = 0;
3140  break;
3141  case 1:
3142  fDoSharedElecCut = kTRUE;
3144  fPhotonQualityCut = 0;
3145  break;
3146  case 2:
3147  fDoSharedElecCut = kFALSE;
3149  fPhotonQualityCut = 1;
3150  break;
3151  case 3:
3152  fDoSharedElecCut = kFALSE;
3154  fPhotonQualityCut = 2;
3155  break;
3156  case 4:
3157  fDoSharedElecCut = kFALSE;
3159  fPhotonQualityCut = 3;
3160  break;
3161  default:
3162  AliError(Form("Shared Electron Cut not defined %d",sharedElec));
3163  return kFALSE;
3164  }
3165 
3166  return kTRUE;
3167 }
3168 
3171 
3172  switch(toClose){
3173  case 0:
3174  fDoToCloseV0sCut = kFALSE;
3175  fminV0Dist = 250;
3176  break;
3177  case 1:
3178  fDoToCloseV0sCut = kTRUE;
3179  fminV0Dist = 1;
3180  break;
3181  case 2:
3182  fDoToCloseV0sCut = kTRUE;
3183  fminV0Dist = 2;
3184  break;
3185  case 3:
3186  fDoToCloseV0sCut = kTRUE;
3187  fminV0Dist = 3;
3188  break;
3189  case 4:
3190  fDoToCloseV0sCut = kTRUE;
3191  fDoDoubleCountingCut = kTRUE;
3192  fMinRDC=0.;
3193  fDeltaR=6.;
3194  fOpenAngle=0.02;
3195  break;
3196  case 5:
3197  fDoToCloseV0sCut = kTRUE;
3198  fDoDoubleCountingCut = kTRUE;
3199  fMinRDC=0.;
3200  fDeltaR=6.;
3201  fOpenAngle=0.03;
3202  break;
3203  case 6:
3204  fDoToCloseV0sCut = kTRUE;
3205  fDoDoubleCountingCut = kTRUE;
3206  fMinRDC=0.;
3207  fDeltaR=6.;
3208  fOpenAngle=0.04;
3209  break;
3210 
3211  default:
3212  AliError(Form("Shared Electron Cut not defined %d",toClose));
3213  return kFALSE;
3214  }
3215  return kTRUE;
3216 }
3217 
3220  switch(TRDElectronCut){
3221  case 0:
3222  fDoTRDPID=kFALSE;
3223  break;
3224  case 1:
3225  fDoTRDPID=kTRUE;
3226  fPIDTRDEfficiency=0.1;
3227  break;
3228  case 8:
3229  fDoTRDPID=kTRUE;
3230  fPIDTRDEfficiency=0.8;
3231  break;
3232  case 9:
3233  fDoTRDPID=kTRUE;
3234  fPIDTRDEfficiency=0.9;
3235  break;
3236  default:
3237  AliError(Form("TRDElectronCut not defined %d",TRDElectronCut));
3238  return kFALSE;
3239  }
3240 
3241  return kTRUE;
3242 }
3243 
3246  // Set Cut
3247  switch(DCAZPhotonPrimVtx){
3248  case 0: //
3249  fDCAZPrimVtxCut = 1000;
3250  break;
3251  case 1: //
3252  fDCAZPrimVtxCut = 10;
3253  break;
3254  case 2: //
3255  fDCAZPrimVtxCut = 5;
3256  break;
3257  case 3: //
3258  fDCAZPrimVtxCut = 4;
3259  break;
3260  case 4: //
3261  fDCAZPrimVtxCut = 3;
3262  break;
3263  case 5: //
3264  fDCAZPrimVtxCut = 2.5;
3265  break;
3266  case 6: //
3267  fDCAZPrimVtxCut = 2;
3268  break;
3269  case 7: //
3270  fDCAZPrimVtxCut = 1.5;
3271  break;
3272  case 8: //
3273  fDCAZPrimVtxCut = 1;
3274  break;
3275  case 9: //
3276  fDCAZPrimVtxCut = 0.5;
3277  break;
3278  default:
3279  cout<<"Warning: DCAZPhotonPrimVtx not defined "<<DCAZPhotonPrimVtx<<endl;
3280  return kFALSE;
3281  }
3282  return kTRUE;
3283 }
3284 
3287  // Set Cut
3288  switch(DCARPhotonPrimVtx){
3289  case 0: //
3290  fDCARPrimVtxCut = 1000;
3291  break;
3292  case 1: //
3293  fDCARPrimVtxCut = 10;
3294  break;
3295  case 2: //
3296  fDCARPrimVtxCut = 5;
3297  break;
3298  case 3: //
3299  fDCARPrimVtxCut = 4;
3300  break;
3301  case 4: //
3302  fDCARPrimVtxCut = 3;
3303  break;
3304  case 5: //
3305  fDCARPrimVtxCut = 2.5;
3306  break;
3307  case 6: //
3308  fDCARPrimVtxCut = 2;
3309  break;
3310  case 7: //
3311  fDCARPrimVtxCut = 1.5;
3312  break;
3313  case 8: //
3314  fDCARPrimVtxCut = 1;
3315  break;
3316  case 9: //
3317  fDCARPrimVtxCut = 0.5;
3318  break;
3319  default:
3320  cout<<"Warning: DCARPhotonPrimVtx not defined "<<DCARPhotonPrimVtx<<endl;
3321  return kFALSE;
3322  }
3323  return kTRUE;
3324 }
3325 
3328  // Set Cut
3329  switch(inOutPlane){
3330  case 0: //
3331  fInPlaneOutOfPlane = 0; // No Event Plane
3332  break;
3333  case 1: //
3334  fInPlaneOutOfPlane = 1; // In-Plane
3335  break;
3336  case 2: //
3337  fInPlaneOutOfPlane = 2; // Out-Of-Plane
3338  break;
3339  default:
3340  cout<<"Warning: In-Plane or Out-Of-Plane not defined "<<inOutPlane<<endl;
3341  return kFALSE;
3342  }
3343  return kTRUE;
3344 }
3345 
3346 
3349  // Get first TPC row
3350  Int_t firstTPCRow = 0;
3351  Double_t radiusI = 84.8;
3352  Double_t radiusO = 134.6;
3353  Double_t radiusOB = 198.;
3354  Double_t rSizeI = 0.75;
3355  Double_t rSizeO = 1.;
3356  Double_t rSizeOB = 1.5;
3357  Int_t nClsI = 63;
3358  Int_t nClsIO = 127;
3359 
3360  if(radius <= radiusI){
3361  return firstTPCRow;
3362  }
3363  if(radius>radiusI && radius<=radiusO){
3364  firstTPCRow = (Int_t)((radius-radiusI)/rSizeI);
3365  }
3366  if(radius>radiusO && radius<=radiusOB){
3367  firstTPCRow = (Int_t)(nClsI+(radius-radiusO)/rSizeO);
3368  }
3369 
3370  if(radius>radiusOB){
3371  firstTPCRow =(Int_t)(nClsIO+(radius-radiusOB)/rSizeOB);
3372  }
3373 
3374  return firstTPCRow;
3375 }
3376 
3380  if(GetCosineOfPointingAngle(photon, event) < fCosPAngleCut){
3381  return kFALSE;
3382  }
3383  return kTRUE;
3384 }
3385 
3388  // calculates the pointing angle of the recalculated V0
3389 
3390  Double_t momV0[3] = {0,0,0};
3391  if(event->IsA()==AliESDEvent::Class()){
3392  AliESDEvent *esdEvent = dynamic_cast<AliESDEvent*>(event);
3393  if(!esdEvent) return -999;
3394  AliESDv0 *v0 = esdEvent->GetV0(photon->GetV0Index());
3395  if(!v0) return -999;
3396  v0->GetPxPyPz(momV0[0],momV0[1],momV0[2]);
3397  }
3398  if(event->IsA()==AliAODEvent::Class()){
3399  momV0[0] = photon->GetPx();
3400  momV0[1] = photon->GetPy();
3401  momV0[2] = photon->GetPz();
3402  }
3403 
3404  //Double_t momV0[3] = { photon->GetPx(), photon->GetPy(), photon->GetPz() }; //momentum of the V0
3405  Double_t PosV0[3] = { photon->GetConversionX() - event->GetPrimaryVertex()->GetX(),
3406  photon->GetConversionY() - event->GetPrimaryVertex()->GetY(),
3407  photon->GetConversionZ() - event->GetPrimaryVertex()->GetZ() }; //Recalculated V0 Position vector
3408 
3409  Double_t momV02 = momV0[0]*momV0[0] + momV0[1]*momV0[1] + momV0[2]*momV0[2];
3410  Double_t PosV02 = PosV0[0]*PosV0[0] + PosV0[1]*PosV0[1] + PosV0[2]*PosV0[2];
3411 
3412 
3413  Double_t cosinePointingAngle = -999;
3414  if(momV02*PosV02 > 0.0)
3415  cosinePointingAngle = (PosV0[0]*momV0[0] + PosV0[1]*momV0[1] + PosV0[2]*momV0[2] ) / TMath::Sqrt(momV02 * PosV02);
3416 
3417  return cosinePointingAngle;
3418 }
3419 
3422 
3423  if (fDo2DPsiPairChi2){
3425  if (TMath::Abs(photon->GetPsiPair()) < -fPsiPairCut/fChi2CutConversion*photon->GetChi2perNDF() + fPsiPairCut || (photon->GetPsiPair()) == 4){
3426  return kTRUE;
3427  } else {
3428  return kFALSE;
3429  }
3430 
3431  } else {
3432  if (TMath::Abs(photon->GetPsiPair()) < -fPsiPairCut/fChi2CutConversion*photon->GetChi2perNDF() + fPsiPairCut ){
3433  return kTRUE;
3434  } else {
3435  return kFALSE;
3436  }
3437  }
3438  } else {
3440  if(TMath::Abs(photon->GetPsiPair()) > fPsiPairCut || (photon->GetPsiPair()) != 4){
3441  return kFALSE;
3442  } else {
3443  return kTRUE;
3444  }
3445  } else {
3446  if(TMath::Abs(photon->GetPsiPair()) > fPsiPairCut){
3447  return kFALSE;
3448  } else {
3449  return kTRUE;
3450  }
3451  }
3452  }
3453 }
3454 
3457  // returns TString with current cut number
3458  return fCutStringRead;
3459 }
3460 
3463 
3464  Int_t posLabel = photon->GetTrackLabelPositive();
3465  Int_t negLabel = photon->GetTrackLabelNegative();
3466 
3467  fElectronLabelArray[nV0*2] = posLabel;
3468  fElectronLabelArray[(nV0*2)+1] = negLabel;
3469 }
3470 
3473 
3474  Int_t posLabel = photon->GetTrackLabelPositive();
3475  Int_t negLabel = photon->GetTrackLabelNegative();
3476 
3477  for(Int_t i = 0; i<nV0s*2;i++){
3478  if(i==nV0*2) continue;
3479  if(i==(nV0*2)+1) continue;
3480  if(fElectronLabelArray[i] == posLabel){
3481  return kFALSE;}
3482  if(fElectronLabelArray[i] == negLabel){
3483  return kFALSE;}
3484  }
3485 
3486  return kTRUE;
3487 }
3488 
3491 
3492  if (fDoDoubleCountingCut && photon->GetConversionRadius() < fMinRDC) return kTRUE;
3493 
3494  Double_t posX = photon->GetConversionX();
3495  Double_t posY = photon->GetConversionY();
3496  Double_t posZ = photon->GetConversionZ();
3497 
3498  for(Int_t i = 0;i<photons->GetEntries();i++){
3499  if(nV0 == i) continue;
3500  AliAODConversionPhoton *photonComp = (AliAODConversionPhoton*) photons->At(i);
3501  Double_t posCompX = photonComp->GetConversionX();
3502  Double_t posCompY = photonComp->GetConversionY();
3503  Double_t posCompZ = photonComp->GetConversionZ();
3504 
3505  if (!fDoDoubleCountingCut){
3506  Double_t dist = pow((posX - posCompX),2)+pow((posY - posCompY),2)+pow((posZ - posCompZ),2);
3507 
3508  if(dist < fminV0Dist*fminV0Dist){
3509  if(photon->GetChi2perNDF() > photonComp->GetChi2perNDF()) return kFALSE;
3510  }
3511  }else{
3512  TVector3 v1(photon->Px(),photon->Py(),photon->Pz());
3513  TVector3 v2(photonComp->Px(),photonComp->Py(),photonComp->Pz());
3514  Double_t OpeningAngle=v1.Angle(v2);
3515  if( OpeningAngle < fOpenAngle && TMath::Abs(photon->GetConversionRadius()-photonComp->GetConversionRadius()) < fDeltaR){
3516  if(photon->GetChi2perNDF() > photonComp->GetChi2perNDF()) return kFALSE;
3517  }
3518  }
3519 
3520  }
3521  return kTRUE;
3522 }
3523 
3524 
3527  //Create and return standard 2010 PbPb cuts
3528  AliConversionPhotonCuts *cuts=new AliConversionPhotonCuts("StandardCuts2010PbPb","StandardCuts2010PbPb");
3529  if(!cuts->InitializeCutsFromCutString("04209297002322000000")){
3530  cout<<"Warning: Initialization of Standardcuts2010PbPb failed"<<endl;}
3531  return cuts;
3532 }
3533 
3536  //Create and return standard 2010 PbPb cuts
3537  AliConversionPhotonCuts *cuts=new AliConversionPhotonCuts("StandardCuts2010pp","StandardCuts2010pp");
3538  if(!cuts->InitializeCutsFromCutString("00209366300380000000")){
3539  cout<<"Warning: Initialization of Standardcuts2010pp failed"<<endl;}
3540  return cuts;
3541 }
3542 
3545 
3546  //GetPhotonPhi() 0-2 Pi //eventPlaneAngle -1pi-1pi
3547  eventPlaneAngle=eventPlaneAngle+TMath::Pi();
3548  Double_t gammaToEPAngle = eventPlaneAngle-photonPhi;
3549  if(gammaToEPAngle < 0) gammaToEPAngle=gammaToEPAngle+2*TMath::Pi();
3550  gammaToEPAngle = gammaToEPAngle-TMath::Pi(); // angle from -pi +pi
3551 
3552  if(!fInPlaneOutOfPlane){
3553  if(fill&&fHistoEventPlanePhi)fHistoEventPlanePhi->Fill(gammaToEPAngle);
3554  return kTRUE;
3555  }
3556  else if(fInPlaneOutOfPlane == 1){
3557  if(TMath::Abs(gammaToEPAngle)<=0.25*TMath::Pi() || TMath::Abs(gammaToEPAngle)>=0.75*TMath::Pi()){
3558  if(fill&&fHistoEventPlanePhi)fHistoEventPlanePhi->Fill(gammaToEPAngle);
3559  return kTRUE;
3560  }
3561  else return kFALSE;
3562  }
3563  else if(fInPlaneOutOfPlane == 2){
3564  if(TMath::Abs(gammaToEPAngle)>0.25*TMath::Pi() && TMath::Abs(gammaToEPAngle)<0.75*TMath::Pi()){
3565  if(fill&&fHistoEventPlanePhi)fHistoEventPlanePhi->Fill(gammaToEPAngle);
3566  return kTRUE;
3567  }
3568  else return kFALSE;
3569  }
3570  return kFALSE;
3571 }
3572 
3575 
3576  AliAODTrack * negTrack = static_cast<AliAODTrack*>(GetTrack(eventDummy, photon->GetTrackLabelNegative()));
3577  AliAODTrack * posTrack = static_cast<AliAODTrack*>(GetTrack(eventDummy, photon->GetTrackLabelPositive()));
3578 
3579  if(!negTrack || !posTrack) {
3580  return 0;
3581  }
3582  if(negTrack->Charge() == posTrack->Charge()){
3583  return 0;
3584  }
3585  Int_t nClusterITSneg = negTrack->GetITSNcls();
3586  Int_t nClusterITSpos = posTrack->GetITSNcls();
3587  // cout << nClusterITSneg << "\t" << nClusterITSpos <<endl;
3588 
3589  if (nClusterITSneg > 1 && nClusterITSpos > 1){
3590  return 3;
3591  } else if (nClusterITSneg > 1 || nClusterITSpos > 1){
3592  return 2;
3593  } else {
3594  return 1;
3595  }
3596  return 0;
3597 }
3598 
3601 
3602  TString nameProfile;
3603  if (flag==1){
3604  nameProfile = "profileContainingMaterialBudgetWeights_fewRadialBins";}
3605  else if (flag==2){
3606  nameProfile = "profileContainingMaterialBudgetWeights_manyRadialBins";}
3607  else {
3608  AliError(Form("%d not a valid flag for InitMaterialBudgetWeightingOfPi0Candidates()",flag));
3609  return kFALSE;
3610  }
3611  TFile* file = TFile::Open(filename.Data());
3612  if (!file) {
3613  AliError(Form("File %s for materialbudgetweights not found",filename.Data()));
3614  return kFALSE;
3615  }
3616  fProfileContainingMaterialBudgetWeights = (TProfile*)file->Get(nameProfile.Data());
3618  AliError(Form("Histogram %s not found in file",nameProfile.Data()));
3619  return kFALSE;
3620  }
3621  fProfileContainingMaterialBudgetWeights->SetDirectory(0);
3622  file->Close();
3623  delete file;
3624 
3626  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()));
3627  return kTRUE;
3628 }
3629 
3632 
3633  Float_t weight = 1.0;
3634  Float_t gammaConversionRadius = gamma->GetConversionRadius();
3635  Int_t bin = fProfileContainingMaterialBudgetWeights->FindBin(gammaConversionRadius);
3636  if (bin > 0 && bin <= fProfileContainingMaterialBudgetWeights->GetNbinsX()){
3637  weight = fProfileContainingMaterialBudgetWeights->GetBinContent(bin);
3638  }
3639  return weight;
3640 }
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)