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