1 /****************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Authors: Friederike Bock *
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 ***************************************************************************/
16 ////////////////////////////////////////////////
17 //---------------------------------------------
18 // Class handling photon selection cuts for
19 // Gamma Conversion analysis
20 //---------------------------------------------
21 ////////////////////////////////////////////////
23 #include "AliConversionPhotonCuts.h"
25 #include "AliKFVertex.h"
26 #include "AliAODTrack.h"
27 #include "AliESDtrack.h"
28 #include "AliAnalysisManager.h"
29 #include "AliInputEventHandler.h"
30 #include "AliMCEventHandler.h"
31 #include "AliAODHandler.h"
32 #include "AliPIDResponse.h"
37 #include "AliAODConversionMother.h"
38 #include "TObjString.h"
39 #include "AliAODEvent.h"
40 #include "AliESDEvent.h"
41 #include "AliCentrality.h"
45 #include "AliGenCocktailEventHeader.h"
46 #include "AliGenDPMjetEventHeader.h"
47 #include "AliGenPythiaEventHeader.h"
48 #include "AliGenHijingEventHeader.h"
49 #include "AliTriggerAnalysis.h"
50 #include "AliV0ReaderV1.h"
51 #include "AliAODMCParticle.h"
52 #include "AliAODMCHeader.h"
53 #include "AliTRDTriggerAnalysis.h"
59 ClassImp(AliConversionPhotonCuts)
62 const char* AliConversionPhotonCuts::fgkCutNames[AliConversionPhotonCuts::kNCuts] = {
72 "pidedxSigmaCut", // 6
73 "piMomdedxSigmaCut", // 7
74 "piMaxMomdedxSigmaCut", // 8
75 "LowPRejectionSigmaCut", // 9
76 "TOFelectronPID", // 10
80 "DoPhotonAsymmetryCut", // 14
81 "CosinePointingAngle", // 15
82 "SharedElectronCuts", // 16
83 "RejectToCloseV0s", // 17
90 //________________________________________________________________________
91 AliConversionPhotonCuts::AliConversionPhotonCuts(const char *name,const char *title) :
92 AliAnalysisCuts(name,title),
99 fEtaForPhiCutMin(-10.),
100 fEtaForPhiCutMax(10.),
103 fDoShrinkTPCAcceptance(kFALSE),
111 fLineCutZRSlopeMin(0.),
112 fLineCutZValueMin(0),
113 fChi2CutConversion(1000),
114 fPIDProbabilityCutNegativeParticle(0),
115 fPIDProbabilityCutPositiveParticle(0),
116 fDodEdxSigmaCut(kTRUE),
117 fDoTOFsigmaCut(kFALSE),
118 fPIDTRDEfficiency(1),
120 fPIDnSigmaAboveElectronLine(100),
121 fPIDnSigmaBelowElectronLine(-100),
122 fTofPIDnSigmaAboveElectronLine(100),
123 fTofPIDnSigmaBelowElectronLine(-100),
124 fPIDnSigmaAbovePionLine(0),
125 fPIDnSigmaAbovePionLineHighPt(-100),
126 fPIDMinPnSigmaAbovePionLine(0),
127 fPIDMaxPnSigmaAbovePionLine(0),
128 fDoKaonRejectionLowP(kFALSE),
129 fDoProtonRejectionLowP(kFALSE),
130 fDoPionRejectionLowP(kFALSE),
131 fPIDnSigmaAtLowPAroundKaonLine(0),
132 fPIDnSigmaAtLowPAroundProtonLine(0),
133 fPIDnSigmaAtLowPAroundPionLine(0),
134 fPIDMinPKaonRejectionLowP(1.5),
135 fPIDMinPProtonRejectionLowP(2),
136 fPIDMinPPionRejectionLowP(0),
137 fDoQtGammaSelection(kTRUE),
141 fUseEtaMinCut(kFALSE),
142 fUseOnFlyV0Finder(kTRUE),
143 fDoPhotonAsymmetryCut(kTRUE),
144 fMinPPhotonAsymmetryCut(100.),
145 fMinPhotonAsymmetry(0.),
146 fUseCorrectedTPCClsInfo(kFALSE),
148 fOpeningAngle(0.005),
150 fDo2DPsiPairChi2(kFALSE),
151 fCosPAngleCut(10000),
152 fDoToCloseV0sCut(kFALSE),
154 fDoSharedElecCut(kFALSE),
155 fDoPhotonQualitySelectionCut(kFALSE),
156 fPhotonQualityCut(0),
158 fElectronArraySize(500),
159 fElectronLabelArray(NULL),
160 fDCAZPrimVtxCut(1000),
161 fDCARPrimVtxCut(1000),
162 fInPlaneOutOfPlane(0),
163 fConversionPointXArray(0.0),
164 fConversionPointYArray(0.0),
165 fConversionPointZArray(0.0),
169 hEtaDistV0sAfterdEdxCuts(NULL),
171 hTPCdEdxbefore(NULL),
173 hTPCdEdxSigbefore(NULL),
174 hTPCdEdxSigafter(NULL),
178 hPsiPairDeltaPhiafter(NULL),
181 hInvMassbefore(NULL),
182 hArmenterosbefore(NULL),
184 hArmenterosafter(NULL),
185 hAcceptanceCuts(NULL),
187 hEventPlanePhi(NULL),
191 for(Int_t jj=0;jj<kNCuts;jj++){fCuts[jj]=0;}
192 fCutString=new TObjString((GetCutNumber()).Data());
194 fElectronLabelArray = new Int_t[fElectronArraySize];
197 //________________________________________________________________________
198 AliConversionPhotonCuts::AliConversionPhotonCuts(const AliConversionPhotonCuts &ref) :
199 AliAnalysisCuts(ref),
204 fEtaCut(ref.fEtaCut),
205 fEtaCutMin(ref.fEtaCutMin),
206 fEtaForPhiCutMin(ref.fEtaForPhiCutMin),
207 fEtaForPhiCutMax(ref.fEtaForPhiCutMax),
208 fMinPhiCut(ref.fMinPhiCut),
209 fMaxPhiCut(ref.fMaxPhiCut),
210 fDoShrinkTPCAcceptance(ref.fDoShrinkTPCAcceptance),
212 fSinglePtCut(ref.fSinglePtCut),
214 fMinClsTPC(ref.fMinClsTPC),
215 fMinClsTPCToF(ref.fMinClsTPCToF),
216 fLineCutZRSlope(ref.fLineCutZRSlope),
217 fLineCutZValue(ref.fLineCutZValue),
218 fLineCutZRSlopeMin(ref.fLineCutZRSlopeMin),
219 fLineCutZValueMin(ref.fLineCutZValueMin),
220 fChi2CutConversion(ref.fChi2CutConversion),
221 fPIDProbabilityCutNegativeParticle(ref.fPIDProbabilityCutNegativeParticle),
222 fPIDProbabilityCutPositiveParticle(ref.fPIDProbabilityCutPositiveParticle),
223 fDodEdxSigmaCut(ref. fDodEdxSigmaCut),
224 fDoTOFsigmaCut(ref.fDoTOFsigmaCut),
225 fPIDTRDEfficiency(ref.fPIDTRDEfficiency),
226 fDoTRDPID(ref.fDoTRDPID),
227 fPIDnSigmaAboveElectronLine(ref.fPIDnSigmaAboveElectronLine),
228 fPIDnSigmaBelowElectronLine(ref.fPIDnSigmaBelowElectronLine),
229 fTofPIDnSigmaAboveElectronLine(ref.fTofPIDnSigmaAboveElectronLine),
230 fTofPIDnSigmaBelowElectronLine(ref.fTofPIDnSigmaBelowElectronLine),
231 fPIDnSigmaAbovePionLine(ref.fPIDnSigmaAbovePionLine),
232 fPIDnSigmaAbovePionLineHighPt(ref.fPIDnSigmaAbovePionLineHighPt),
233 fPIDMinPnSigmaAbovePionLine(ref.fPIDMinPnSigmaAbovePionLine),
234 fPIDMaxPnSigmaAbovePionLine(ref.fPIDMaxPnSigmaAbovePionLine),
235 fDoKaonRejectionLowP(ref.fDoKaonRejectionLowP),
236 fDoProtonRejectionLowP(ref.fDoProtonRejectionLowP),
237 fDoPionRejectionLowP(ref.fDoPionRejectionLowP),
238 fPIDnSigmaAtLowPAroundKaonLine(ref.fPIDnSigmaAtLowPAroundKaonLine),
239 fPIDnSigmaAtLowPAroundProtonLine(ref.fPIDnSigmaAtLowPAroundProtonLine),
240 fPIDnSigmaAtLowPAroundPionLine(ref.fPIDnSigmaAtLowPAroundPionLine),
241 fPIDMinPKaonRejectionLowP(ref.fPIDMinPKaonRejectionLowP),
242 fPIDMinPProtonRejectionLowP(ref.fPIDMinPProtonRejectionLowP),
243 fPIDMinPPionRejectionLowP(ref.fPIDMinPPionRejectionLowP),
244 fDoQtGammaSelection(ref.fDoQtGammaSelection),
245 fDo2DQt(ref.fDo2DQt),
247 fNSigmaMass(ref.fNSigmaMass),
248 fUseEtaMinCut(ref.fUseEtaMinCut),
249 fUseOnFlyV0Finder(ref.fUseOnFlyV0Finder),
250 fDoPhotonAsymmetryCut(ref.fDoPhotonAsymmetryCut),
251 fMinPPhotonAsymmetryCut(ref.fMinPPhotonAsymmetryCut),
252 fMinPhotonAsymmetry(ref.fMinPhotonAsymmetry),
253 fUseCorrectedTPCClsInfo(ref.fUseCorrectedTPCClsInfo),
254 fUseTOFpid(ref.fUseTOFpid),
255 fOpeningAngle(ref.fOpeningAngle),
256 fPsiPairCut(ref.fPsiPairCut),
257 fDo2DPsiPairChi2(ref.fDo2DPsiPairChi2),
258 fCosPAngleCut(ref.fCosPAngleCut),
259 fDoToCloseV0sCut(ref.fDoToCloseV0sCut),
260 fminV0Dist(ref.fminV0Dist),
261 fDoSharedElecCut(ref.fDoSharedElecCut),
262 fDoPhotonQualitySelectionCut(ref.fDoPhotonQualitySelectionCut),
263 fPhotonQualityCut(ref.fPhotonQualityCut),
264 fRandom(ref.fRandom),
265 fElectronArraySize(ref.fElectronArraySize),
266 fElectronLabelArray(NULL),
267 fDCAZPrimVtxCut(ref.fDCAZPrimVtxCut),
268 fDCARPrimVtxCut(ref.fDCAZPrimVtxCut),
269 fInPlaneOutOfPlane(ref.fInPlaneOutOfPlane),
270 fConversionPointXArray(ref.fConversionPointXArray),
271 fConversionPointYArray(ref.fConversionPointYArray),
272 fConversionPointZArray(ref.fConversionPointZArray),
274 fIsHeavyIon(ref.fIsHeavyIon),
276 hEtaDistV0sAfterdEdxCuts(NULL),
278 hTPCdEdxbefore(NULL),
280 hTPCdEdxSigbefore(NULL),
281 hTPCdEdxSigafter(NULL),
285 hPsiPairDeltaPhiafter(NULL),
288 hInvMassbefore(NULL),
289 hArmenterosbefore(NULL),
291 hArmenterosafter(NULL),
292 hAcceptanceCuts(NULL),
294 hEventPlanePhi(NULL),
295 fPreSelCut(ref.fPreSelCut)
298 for(Int_t jj=0;jj<kNCuts;jj++){fCuts[jj]=ref.fCuts[jj];}
299 fCutString=new TObjString((GetCutNumber()).Data());
300 fElectronLabelArray = new Int_t[fElectronArraySize];
301 // dont copy histograms (if you like histograms, call InitCutHistograms())
306 //________________________________________________________________________
307 AliConversionPhotonCuts::~AliConversionPhotonCuts() {
309 //Deleting fHistograms leads to seg fault it it's added to output collection of a task
311 // delete fHistograms;
312 // fHistograms = NULL;
313 if(fCutString != NULL){
317 if(fElectronLabelArray){
318 delete fElectronLabelArray;
319 fElectronLabelArray = NULL;
323 //________________________________________________________________________
324 void AliConversionPhotonCuts::InitCutHistograms(TString name, Bool_t preCut){
326 // Initialize Cut Histograms for QA (only initialized and filled if function is called)
327 TH1::AddDirectory(kFALSE);
329 if(fHistograms != NULL){
333 if(fHistograms==NULL){
334 fHistograms=new TList();
335 fHistograms->SetOwner(kTRUE);
336 if(name=="")fHistograms->SetName(Form("ConvCuts_%s",GetCutNumber().Data()));
337 else fHistograms->SetName(Form("%s_%s",name.Data(),GetCutNumber().Data()));
341 hCutIndex=new TH1F(Form("IsPhotonSelected %s",GetCutNumber().Data()),"IsPhotonSelected",11,-0.5,10.5);
342 hCutIndex->GetXaxis()->SetBinLabel(kPhotonIn+1,"in");
343 hCutIndex->GetXaxis()->SetBinLabel(kOnFly+1,"onfly");
344 hCutIndex->GetXaxis()->SetBinLabel(kNoTracks+1,"no tracks");
345 hCutIndex->GetXaxis()->SetBinLabel(kdEdxCuts+1,"dEdx");
346 hCutIndex->GetXaxis()->SetBinLabel(kTrackCuts+1,"Track cuts");
347 hCutIndex->GetXaxis()->SetBinLabel(kConvPointFail+1,"ConvPoint fail");
348 hCutIndex->GetXaxis()->SetBinLabel(kPhotonCuts+1,"PhotonCuts");
349 hCutIndex->GetXaxis()->SetBinLabel(kEventPlane+1,"EventPlane");
350 hCutIndex->GetXaxis()->SetBinLabel(kPhotonOut+1,"out");
351 fHistograms->Add(hCutIndex);
354 hTrackCuts=new TH1F(Form("TrackCuts %s",GetCutNumber().Data()),"TrackCuts",9,-0.5,8.5);
355 hTrackCuts->GetXaxis()->SetBinLabel(1,"in");
356 hTrackCuts->GetXaxis()->SetBinLabel(2,"likesign");
357 hTrackCuts->GetXaxis()->SetBinLabel(3,"ntpccl");
358 hTrackCuts->GetXaxis()->SetBinLabel(4,"acceptance");
359 hTrackCuts->GetXaxis()->SetBinLabel(5,"singlept");
360 hTrackCuts->GetXaxis()->SetBinLabel(6,"TPCrefit");
361 hTrackCuts->GetXaxis()->SetBinLabel(7,"kink");
362 hTrackCuts->GetXaxis()->SetBinLabel(8,"out");
363 fHistograms->Add(hTrackCuts);
366 hPhotonCuts=new TH1F(Form("PhotonCuts %s",GetCutNumber().Data()),"PhotonCuts",15,-0.5,14.5);
367 hPhotonCuts->GetXaxis()->SetBinLabel(1,"in");
368 hPhotonCuts->GetXaxis()->SetBinLabel(2,"qtcut");
369 hPhotonCuts->GetXaxis()->SetBinLabel(3,"chi2");
370 hPhotonCuts->GetXaxis()->SetBinLabel(4,"acceptance");
371 hPhotonCuts->GetXaxis()->SetBinLabel(5,"asymmetry");
372 hPhotonCuts->GetXaxis()->SetBinLabel(6,"pidprob");
373 hPhotonCuts->GetXaxis()->SetBinLabel(7,"cortpcclinfo");
374 hPhotonCuts->GetXaxis()->SetBinLabel(8,"PsiPair");
375 hPhotonCuts->GetXaxis()->SetBinLabel(9,"CosPAngle");
376 hPhotonCuts->GetXaxis()->SetBinLabel(10,"DCA R");
377 hPhotonCuts->GetXaxis()->SetBinLabel(11,"DCA Z");
378 hPhotonCuts->GetXaxis()->SetBinLabel(12,"Photon Quality");
379 hPhotonCuts->GetXaxis()->SetBinLabel(13,"out");
380 fHistograms->Add(hPhotonCuts);
383 hInvMassbefore=new TH1F(Form("InvMass_before %s",GetCutNumber().Data()),"InvMass_before",1000,0,0.3);
384 fHistograms->Add(hInvMassbefore);
385 hArmenterosbefore=new TH2F(Form("Armenteros_before %s",GetCutNumber().Data()),"Armenteros_before",200,-1,1,1000,0,1.);
386 fHistograms->Add(hArmenterosbefore);
387 hEtaDistV0s = new TH1F(Form("Eta_before %s",GetCutNumber().Data()),"Eta_before",2000,-2,2);
388 fHistograms->Add(hEtaDistV0s);
391 hInvMassafter=new TH1F(Form("InvMass_after %s",GetCutNumber().Data()),"InvMass_after",1000,0,0.3);
392 fHistograms->Add(hInvMassafter);
393 hArmenterosafter=new TH2F(Form("Armenteros_after %s",GetCutNumber().Data()),"Armenteros_after",200,-1,1,250,0,0.25);
394 fHistograms->Add(hArmenterosafter);
396 hAcceptanceCuts=new TH1F(Form("PhotonAcceptanceCuts %s",GetCutNumber().Data()),"PhotonAcceptanceCuts",11,-0.5,10.5);
397 hAcceptanceCuts->GetXaxis()->SetBinLabel(1,"in");
398 hAcceptanceCuts->GetXaxis()->SetBinLabel(2,"maxR");
399 hAcceptanceCuts->GetXaxis()->SetBinLabel(3,"minR");
400 hAcceptanceCuts->GetXaxis()->SetBinLabel(4,"line");
401 hAcceptanceCuts->GetXaxis()->SetBinLabel(5,"maxZ");
402 hAcceptanceCuts->GetXaxis()->SetBinLabel(6,"eta");
403 hAcceptanceCuts->GetXaxis()->SetBinLabel(7,"phisector");
404 hAcceptanceCuts->GetXaxis()->SetBinLabel(8,"minpt");
405 hAcceptanceCuts->GetXaxis()->SetBinLabel(9,"out");
406 fHistograms->Add(hAcceptanceCuts);
409 hdEdxCuts=new TH1F(Form("dEdxCuts %s",GetCutNumber().Data()),"dEdxCuts",10,-0.5,9.5);
410 hdEdxCuts->GetXaxis()->SetBinLabel(1,"in");
411 hdEdxCuts->GetXaxis()->SetBinLabel(2,"TPCelectron");
412 hdEdxCuts->GetXaxis()->SetBinLabel(3,"TPCpion");
413 hdEdxCuts->GetXaxis()->SetBinLabel(4,"TPCpionhighp");
414 hdEdxCuts->GetXaxis()->SetBinLabel(5,"TPCkaonlowprej");
415 hdEdxCuts->GetXaxis()->SetBinLabel(6,"TPCprotonlowprej");
416 hdEdxCuts->GetXaxis()->SetBinLabel(7,"TPCpionlowprej");
417 hdEdxCuts->GetXaxis()->SetBinLabel(8,"TOFelectron");
418 hdEdxCuts->GetXaxis()->SetBinLabel(9,"TRDelectron");
419 hdEdxCuts->GetXaxis()->SetBinLabel(10,"out");
420 fHistograms->Add(hdEdxCuts);
422 TAxis *AxisBeforedEdx = NULL;
423 TAxis *AxisBeforedEdxSig = NULL;
424 TAxis *AxisBeforeTOF = NULL;
425 TAxis *AxisBeforeTOFSig = NULL;
427 hTPCdEdxbefore=new TH2F(Form("Gamma_dEdx_before %s",GetCutNumber().Data()),"dEdx Gamma before" ,150,0.03,20,800,0,200);
428 fHistograms->Add(hTPCdEdxbefore);
429 AxisBeforedEdx = hTPCdEdxbefore->GetXaxis();
430 hTPCdEdxSigbefore=new TH2F(Form("Gamma_dEdxSig_before %s",GetCutNumber().Data()),"dEdx Sigma Gamma before" ,150,0.03,20,400,-10,10);
431 fHistograms->Add(hTPCdEdxSigbefore);
432 AxisBeforedEdxSig = hTPCdEdxSigbefore->GetXaxis();
434 hTOFbefore=new TH2F(Form("Gamma_TOF_before %s",GetCutNumber().Data()),"TOF Gamma before" ,150,0.03,20,11000,-1000,10000);
435 fHistograms->Add(hTOFbefore);
436 AxisBeforeTOF = hTOFbefore->GetXaxis();
437 hTOFSigbefore=new TH2F(Form("Gamma_TOFSig_before %s",GetCutNumber().Data()),"TOF Sigma Gamma before" ,150,0.03,20,400,-6,10);
438 fHistograms->Add(hTOFSigbefore);
439 AxisBeforeTOFSig = hTOFSigbefore->GetXaxis();
442 hTPCdEdxSigafter=new TH2F(Form("Gamma_dEdxSig_after %s",GetCutNumber().Data()),"dEdx Sigma Gamma after" ,150,0.03,20,400, -10,10);
443 fHistograms->Add(hTPCdEdxSigafter);
445 hTPCdEdxafter=new TH2F(Form("Gamma_dEdx_after %s",GetCutNumber().Data()),"dEdx Gamma after" ,150,0.03,20,800,0,200);
446 fHistograms->Add(hTPCdEdxafter);
448 hTOFSigafter=new TH2F(Form("Gamma_TOFSig_after %s",GetCutNumber().Data()),"TOF Sigma Gamma after" ,150,0.03,20,400,-6,10);
449 fHistograms->Add(hTOFSigafter);
451 hEtaDistV0sAfterdEdxCuts = new TH1F(Form("Eta_afterdEdx %s",GetCutNumber().Data()),"Eta_afterdEdx",2000,-2,2);
452 fHistograms->Add(hEtaDistV0sAfterdEdxCuts);
454 hPsiPairDeltaPhiafter=new TH2F(Form("Gamma_PsiPairDeltaPhi_after %s",GetCutNumber().Data()),"Psi Pair vs Delta Phi Gamma after" ,200,-2,2,200,-2,2);
455 fHistograms->Add(hPsiPairDeltaPhiafter);
457 TAxis *AxisAfter = hTPCdEdxSigafter->GetXaxis();
458 Int_t bins = AxisAfter->GetNbins();
459 Double_t from = AxisAfter->GetXmin();
460 Double_t to = AxisAfter->GetXmax();
461 Double_t *newBins = new Double_t[bins+1];
463 Double_t factor = TMath::Power(to/from, 1./bins);
464 for(Int_t i=1; i<=bins; ++i) newBins[i] = factor * newBins[i-1];
465 AxisAfter->Set(bins, newBins);
466 AxisAfter = hTOFSigafter->GetXaxis();
467 AxisAfter->Set(bins, newBins);
468 AxisAfter = hTPCdEdxafter->GetXaxis();
469 AxisAfter->Set(bins, newBins);
471 AxisBeforedEdx->Set(bins, newBins);
472 AxisBeforeTOF->Set(bins, newBins);
473 AxisBeforedEdxSig->Set(bins, newBins);
474 AxisBeforeTOFSig->Set(bins, newBins);
478 // Event Cuts and Info
480 hEventPlanePhi=new TH1F(Form("EventPlaneMinusPhotonAngle %s",GetCutNumber().Data()),"EventPlaneMinusPhotonAngle",360,-TMath::Pi(),TMath::Pi());
481 fHistograms->Add(hEventPlanePhi);
485 TH1::AddDirectory(kTRUE);
488 //________________________________________________________________________
489 Bool_t AliConversionPhotonCuts::InitPIDResponse(){
490 // Set Pointer to AliPIDResponse
492 AliAnalysisManager *man=AliAnalysisManager::GetAnalysisManager();
494 AliInputEventHandler* inputHandler = (AliInputEventHandler*) (man->GetInputEventHandler());
495 fPIDResponse = (AliPIDResponse*)inputHandler->GetPIDResponse();
496 if(fPIDResponse)return kTRUE;
504 ///________________________________________________________________________
505 Bool_t AliConversionPhotonCuts::PhotonIsSelectedMC(TParticle *particle,AliStack *fMCStack,Bool_t checkForConvertedGamma){
506 // MonteCarlo Photon Selection
508 if(!fMCStack)return kFALSE;
510 if (particle->GetPdgCode() == 22){
513 if( particle->Eta() > (fEtaCut) || particle->Eta() < (-fEtaCut) )
516 if( particle->Eta() < (fEtaCutMin) && particle->Eta() > (-fEtaCutMin) )
520 if(particle->GetMother(0) >-1 && fMCStack->Particle(particle->GetMother(0))->GetPdgCode() == 22){
521 return kFALSE; // no photon as mothers!
524 if(particle->GetMother(0) >= fMCStack->GetNprimary()){
525 return kFALSE; // the gamma has a mother, and it is not a primary particle
528 if(!checkForConvertedGamma) return kTRUE; // return in case of accepted gamma
530 // looking for conversion gammas (electron + positron from pairbuilding (= 5) )
531 TParticle* ePos = NULL;
532 TParticle* eNeg = NULL;
534 if(particle->GetNDaughters() >= 2){
535 for(Int_t daughterIndex=particle->GetFirstDaughter();daughterIndex<=particle->GetLastDaughter();daughterIndex++){
536 TParticle *tmpDaughter = fMCStack->Particle(daughterIndex);
537 if(tmpDaughter->GetUniqueID() == 5){
538 if(tmpDaughter->GetPdgCode() == 11){
540 } else if(tmpDaughter->GetPdgCode() == -11){
547 if(ePos == NULL || eNeg == NULL){ // means we do not have two daughters from pair production
551 if(ePos->Pt()<fSinglePtCut || eNeg->Pt()<fSinglePtCut){
552 return kFALSE; // no reconstruction below the Pt cut
555 if( ePos->Eta() > (fEtaCut) || ePos->Eta() < (-fEtaCut) ||
556 eNeg->Eta() > (fEtaCut) || eNeg->Eta() < (-fEtaCut) )
559 if(fEtaCutMin > -0.1){
560 if( (ePos->Eta() < (fEtaCutMin) && ePos->Eta() > (-fEtaCutMin)) ||
561 (eNeg->Eta() < (fEtaCutMin) && eNeg->Eta() > (-fEtaCutMin)) )
566 return kFALSE; // cuts on distance from collision point
569 if(abs(ePos->Vz()) > fMaxZ){
570 return kFALSE; // outside material
572 if(abs(eNeg->Vz()) > fMaxZ){
573 return kFALSE; // outside material
576 if( ePos->R() <= ((abs(ePos->Vz()) * fLineCutZRSlope) - fLineCutZValue)){
577 return kFALSE; // line cut to exclude regions where we do not reconstruct
578 } else if ( fEtaCutMin != -0.1 && ePos->R() >= ((abs(ePos->Vz()) * fLineCutZRSlopeMin) - fLineCutZValueMin)){
582 if( eNeg->R() <= ((abs(eNeg->Vz()) * fLineCutZRSlope) - fLineCutZValue)){
583 return kFALSE; // line cut to exclude regions where we do not reconstruct
584 } else if ( fEtaCutMin != -0.1 && eNeg->R() >= ((abs(eNeg->Vz()) * fLineCutZRSlopeMin) - fLineCutZValueMin)){
589 //if(AcceptanceCut(particle,ePos,eNeg))return kTRUE;
593 ///________________________________________________________________________
594 Bool_t AliConversionPhotonCuts::PhotonIsSelectedAODMC(AliAODMCParticle *particle,TClonesArray *aodmcArray,Bool_t checkForConvertedGamma){
595 // MonteCarlo Photon Selection
597 if(!aodmcArray)return kFALSE;
599 if (particle->GetPdgCode() == 22){
600 if( particle->Eta() > (fEtaCut) || particle->Eta() < (-fEtaCut) )
603 if( particle->Eta() < (fEtaCutMin) && particle->Eta() > (-fEtaCutMin) )
607 if(particle->GetMother() > -1){
608 if((static_cast<AliAODMCParticle*>(aodmcArray->At(particle->GetMother())))->GetPdgCode() == 22){
609 return kFALSE; // no photon as mothers!
611 if(!(static_cast<AliAODMCParticle*>(aodmcArray->At(particle->GetMother()))->IsPrimary())){
612 return kFALSE; // the gamma has a mother, and it is not a primary particle
616 if(!checkForConvertedGamma) return kTRUE; // return in case of accepted gamma
618 // looking for conversion gammas (electron + positron from pairbuilding (= 5) )
619 AliAODMCParticle* ePos = NULL;
620 AliAODMCParticle* eNeg = NULL;
622 if(particle->GetNDaughters() >= 2){
623 for(Int_t daughterIndex=particle->GetDaughter(0);daughterIndex<=particle->GetDaughter(1);daughterIndex++){
624 AliAODMCParticle *tmpDaughter = static_cast<AliAODMCParticle*>(aodmcArray->At(daughterIndex));
625 if(!tmpDaughter) continue;
626 if(((tmpDaughter->GetMCProcessCode())) == 5){ // STILL A BUG IN ALIROOT >>8 HAS TPO BE REMOVED AFTER FIX
627 if(tmpDaughter->GetPdgCode() == 11){
629 } else if(tmpDaughter->GetPdgCode() == -11){
636 if(ePos == NULL || eNeg == NULL){ // means we do not have two daughters from pair production
640 if(ePos->Pt()<fSinglePtCut || eNeg->Pt()<fSinglePtCut){
641 return kFALSE; // no reconstruction below the Pt cut
644 if( ePos->Eta() > (fEtaCut) || ePos->Eta() < (-fEtaCut) ||
645 eNeg->Eta() > (fEtaCut) || eNeg->Eta() < (-fEtaCut) )
648 if(fEtaCutMin > -0.1){
649 if( (ePos->Eta() < (fEtaCutMin) && ePos->Eta() > (-fEtaCutMin)) ||
650 (eNeg->Eta() < (fEtaCutMin) && eNeg->Eta() > (-fEtaCutMin)) )
654 Double_t rPos = sqrt( (ePos->Xv()*ePos->Xv()) + (ePos->Yv()*ePos->Yv()) );
655 Double_t rNeg = sqrt( (eNeg->Xv()*eNeg->Xv()) + (eNeg->Yv()*eNeg->Yv()) );
658 return kFALSE; // cuts on distance from collision point
660 if(abs(ePos->Zv()) > fMaxZ){
661 return kFALSE; // outside material
663 if(abs(eNeg->Zv()) > fMaxZ){
664 return kFALSE; // outside material
667 if( rPos <= ((abs(ePos->Zv()) * fLineCutZRSlope) - fLineCutZValue)){
668 return kFALSE; // line cut to exclude regions where we do not reconstruct
669 } else if ( fEtaCutMin != -0.1 && rPos >= ((abs(ePos->Zv()) * fLineCutZRSlopeMin) - fLineCutZValueMin)){
673 if( rNeg <= ((abs(eNeg->Zv()) * fLineCutZRSlope) - fLineCutZValue)){
674 return kFALSE; // line cut to exclude regions where we do not reconstruct
675 } else if ( fEtaCutMin != -0.1 && rNeg >= ((abs(eNeg->Zv()) * fLineCutZRSlopeMin) - fLineCutZValueMin)){
680 //if(AcceptanceCut(particle,ePos,eNeg))return kTRUE;
685 ///________________________________________________________________________
686 Bool_t AliConversionPhotonCuts::PhotonCuts(AliConversionPhotonBase *photon,AliVEvent *event)
687 { // Specific Photon Cuts
690 if(hPhotonCuts)hPhotonCuts->Fill(cutIndex);
693 // Fill Histos before Cuts
694 if(hInvMassbefore)hInvMassbefore->Fill(photon->GetMass());
695 if(hArmenterosbefore)hArmenterosbefore->Fill(photon->GetArmenterosAlpha(),photon->GetArmenterosQt());
697 // Gamma selection based on QT from Armenteros
698 if(fDoQtGammaSelection == kTRUE){
699 if(!ArmenterosQtCut(photon)){
700 if(hPhotonCuts)hPhotonCuts->Fill(cutIndex); //1
707 if(photon->GetChi2perNDF() > fChi2CutConversion || photon->GetChi2perNDF() <=0){
709 if(hPhotonCuts)hPhotonCuts->Fill(cutIndex); //2
715 // Reconstruction Acceptance Cuts
716 if(!AcceptanceCuts(photon)){
717 if(hPhotonCuts)hPhotonCuts->Fill(cutIndex); //3
723 if(fDoPhotonAsymmetryCut == kTRUE){
724 if(!AsymmetryCut(photon,event)){
725 if(hPhotonCuts)hPhotonCuts->Fill(cutIndex); //4
730 //Check the pid probability
732 if(!PIDProbabilityCut(photon, event)) {
733 if(hPhotonCuts)hPhotonCuts->Fill(cutIndex); //5
738 if(!CorrectedTPCClusterCut(photon, event)) {
739 if(hPhotonCuts)hPhotonCuts->Fill(cutIndex); //6
743 Double_t magField = event->GetMagneticField();
744 if( magField < 0.0 ){
750 AliVTrack * electronCandidate = GetTrack(event,photon->GetTrackLabelNegative() );
751 AliVTrack * positronCandidate = GetTrack(event,photon->GetTrackLabelPositive() );
752 Double_t deltaPhi = magField * TVector2::Phi_mpi_pi( electronCandidate->Phi()-positronCandidate->Phi());
755 if(!PsiPairCut(photon)) {
756 if(hPhotonCuts)hPhotonCuts->Fill(cutIndex); //7
761 if(!CosinePAngleCut(photon, event)) {
762 if(hPhotonCuts)hPhotonCuts->Fill(cutIndex); //8
766 AliAODConversionPhoton* photonAOD = dynamic_cast<AliAODConversionPhoton*>(photon);
768 photonAOD->CalculateDistanceOfClossetApproachToPrimVtx(event->GetPrimaryVertex());
771 if(photonAOD->GetDCArToPrimVtx() > fDCARPrimVtxCut) { //DCA R cut of photon to primary vertex
772 if(hPhotonCuts)hPhotonCuts->Fill(cutIndex); //9
777 if(abs(photonAOD->GetDCAzToPrimVtx()) > fDCAZPrimVtxCut) { //DCA Z cut of photon to primary vertex
778 if(hPhotonCuts)hPhotonCuts->Fill(cutIndex); //10
788 UChar_t photonQuality = 0;
789 AliAODEvent * aodEvent = dynamic_cast<AliAODEvent*>(event);
791 photonQuality = DeterminePhotonQualityAOD(photonAOD, event);
793 photonQuality = photonAOD->GetPhotonQuality();
795 if (fDoPhotonQualitySelectionCut && photonQuality != fPhotonQualityCut){
796 if(hPhotonCuts)hPhotonCuts->Fill(cutIndex); //11
801 if(hPhotonCuts)hPhotonCuts->Fill(cutIndex); //11
804 if(hInvMassafter)hInvMassafter->Fill(photon->GetMass());
805 if(hArmenterosafter)hArmenterosafter->Fill(photon->GetArmenterosAlpha(),photon->GetArmenterosQt());
806 if(hPsiPairDeltaPhiafter)hPsiPairDeltaPhiafter->Fill(deltaPhi,photon->GetPsiPair());
811 ///________________________________________________________________________
812 Bool_t AliConversionPhotonCuts::CorrectedTPCClusterCut(AliConversionPhotonBase *photon, AliVEvent * event)
813 { //Cut on corrected TPC Cluster Info
815 AliVTrack * negTrack = GetTrack(event, photon->GetTrackLabelNegative());
816 AliVTrack * posTrack = GetTrack(event, photon->GetTrackLabelPositive());
818 if(!negTrack||!posTrack)return kFALSE;
820 Double_t negclsToF=0;
822 if (!fUseCorrectedTPCClsInfo ){
823 if(negTrack->GetTPCNclsF()!=0){
824 negclsToF = (Double_t)negTrack->GetNcls(1)/(Double_t)negTrack->GetTPCNclsF();}// Ncluster/Nfindablecluster
827 negclsToF = negTrack->GetTPCClusterInfo(2,0,GetFirstTPCRow(photon->GetConversionRadius()));
830 Double_t posclsToF = 0.;
831 if (!fUseCorrectedTPCClsInfo ){
832 if(posTrack->GetTPCNclsF()!=0){
833 posclsToF = (Double_t)posTrack->GetNcls(1)/(Double_t)posTrack->GetTPCNclsF();
836 posclsToF = posTrack->GetTPCClusterInfo(2,0,GetFirstTPCRow(photon->GetConversionRadius()));
839 if( negclsToF < fMinClsTPCToF || posclsToF < fMinClsTPCToF ){
846 ///________________________________________________________________________
847 Bool_t AliConversionPhotonCuts::PhotonIsSelected(AliConversionPhotonBase *photon, AliVEvent * event)
849 //Selection of Reconstructed Photons
851 FillPhotonCutIndex(kPhotonIn);
853 if(event->IsA()==AliESDEvent::Class()) {
854 if(!SelectV0Finder( ( ((AliESDEvent*)event)->GetV0(photon->GetV0Index()))->GetOnFlyStatus() ) ){
855 FillPhotonCutIndex(kOnFly);
859 // else if(event->IsA()==AliAODEvent::Class()) {
860 // if(!SelectV0Finder( ( ((AliAODEvent*)event)->GetV0(photon->GetV0Index())) ) ){
861 // FillPhotonCutIndex(kOnFly);
867 AliVTrack * negTrack = GetTrack(event, photon->GetTrackLabelNegative());
868 AliVTrack * posTrack = GetTrack(event, photon->GetTrackLabelPositive());
870 if(!negTrack || !posTrack) {
871 FillPhotonCutIndex(kNoTracks);
874 photon->DeterminePhotonQuality(negTrack,posTrack);
876 if(!TracksAreSelected(negTrack, posTrack)){
877 FillPhotonCutIndex(kTrackCuts);
880 if (hEtaDistV0s)hEtaDistV0s->Fill(photon->GetPhotonEta());
882 if(!dEdxCuts(negTrack) || !dEdxCuts(posTrack)) {
883 FillPhotonCutIndex(kdEdxCuts);
886 if (hEtaDistV0sAfterdEdxCuts)hEtaDistV0sAfterdEdxCuts->Fill(photon->GetPhotonEta());
888 if(!PhotonCuts(photon,event)){
889 FillPhotonCutIndex(kPhotonCuts);
893 // Photon passed cuts
894 FillPhotonCutIndex(kPhotonOut);
898 ///________________________________________________________________________
899 Bool_t AliConversionPhotonCuts::ArmenterosQtCut(AliConversionPhotonBase *photon)
900 { // Armenteros Qt Cut
902 if ( !(TMath::Power(photon->GetArmenterosAlpha()/0.95,2)+TMath::Power(photon->GetArmenterosQt()/fQtMax,2) < 1) ){
906 if(photon->GetArmenterosQt()>fQtMax){
914 ///________________________________________________________________________
915 Bool_t AliConversionPhotonCuts::AcceptanceCuts(AliConversionPhotonBase *photon) {
916 // Exclude certain areas for photon reconstruction
919 if(hAcceptanceCuts)hAcceptanceCuts->Fill(cutIndex);
922 if(photon->GetConversionRadius()>fMaxR){ // cuts on distance from collision point
923 if(hAcceptanceCuts)hAcceptanceCuts->Fill(cutIndex);
928 if(photon->GetConversionRadius()<fMinR){ // cuts on distance from collision point
929 if(hAcceptanceCuts)hAcceptanceCuts->Fill(cutIndex);
934 if(photon->GetConversionRadius() <= ((abs(photon->GetConversionZ())*fLineCutZRSlope)-fLineCutZValue)){
935 if(hAcceptanceCuts)hAcceptanceCuts->Fill(cutIndex);
938 else if (fUseEtaMinCut && photon->GetConversionRadius() >= ((abs(photon->GetConversionZ())*fLineCutZRSlopeMin)-fLineCutZValueMin )){
939 if(hAcceptanceCuts)hAcceptanceCuts->Fill(cutIndex);
944 if(abs(photon->GetConversionZ()) > fMaxZ ){ // cuts out regions where we do not reconstruct
945 if(hAcceptanceCuts)hAcceptanceCuts->Fill(cutIndex);
951 if( photon->GetPhotonEta() > (fEtaCut) || photon->GetPhotonEta() < (-fEtaCut) ){
952 if(hAcceptanceCuts)hAcceptanceCuts->Fill(cutIndex);
956 if( photon->GetPhotonEta() < (fEtaCutMin) && photon->GetPhotonEta() > (-fEtaCutMin) ){
957 if(hAcceptanceCuts)hAcceptanceCuts->Fill(cutIndex);
963 if (fDoShrinkTPCAcceptance){
964 if(photon->GetPhotonEta() > fEtaForPhiCutMin && photon->GetPhotonEta() < fEtaForPhiCutMax ){
965 if (fMinPhiCut < fMaxPhiCut){
966 if( photon->GetPhotonPhi() > fMinPhiCut && photon->GetPhotonPhi() < fMaxPhiCut ) {
967 if(hAcceptanceCuts)hAcceptanceCuts->Fill(cutIndex);
971 Double_t photonPhi = photon->GetPhotonPhi();
972 if (photon->GetPhotonPhi() < TMath::Pi()) photonPhi = photon->GetPhotonPhi() + 2*TMath::Pi();
973 if( photonPhi > fMinPhiCut && photonPhi < fMaxPhiCut+2*TMath::Pi() ) {
974 if(hAcceptanceCuts)hAcceptanceCuts->Fill(cutIndex);
984 if(photon->GetPhotonPt()<fPtCut){
985 if(hAcceptanceCuts)hAcceptanceCuts->Fill(cutIndex);
990 if(hAcceptanceCuts)hAcceptanceCuts->Fill(cutIndex);
996 ///________________________________________________________________________
997 Bool_t AliConversionPhotonCuts::SpecificTrackCuts(AliAODTrack * negTrack, AliAODTrack * posTrack,Int_t &cutIndex) {
998 // Track Cuts which require AOD/ESD specific implementation
1000 if( !negTrack->IsOn(AliESDtrack::kTPCrefit) || !posTrack->IsOn(AliESDtrack::kTPCrefit) ) {
1001 if(hTrackCuts)hTrackCuts->Fill(cutIndex);
1006 AliAODVertex * NegVtxType=negTrack->GetProdVertex();
1007 AliAODVertex * PosVtxType=posTrack->GetProdVertex();
1008 if( (NegVtxType->GetType())==AliAODVertex::kKink || (PosVtxType->GetType())==AliAODVertex::kKink) {
1009 if(hTrackCuts)hTrackCuts->Fill(cutIndex);
1017 ///________________________________________________________________________
1018 Bool_t AliConversionPhotonCuts::SpecificTrackCuts(AliESDtrack * negTrack, AliESDtrack * posTrack,Int_t &cutIndex) {
1019 // Track Cuts which require AOD/ESD specific implementation
1021 if( !negTrack->IsOn(AliESDtrack::kTPCrefit) || !posTrack->IsOn(AliESDtrack::kTPCrefit) ) {
1022 if(hTrackCuts)hTrackCuts->Fill(cutIndex);
1027 if(negTrack->GetKinkIndex(0) > 0 || posTrack->GetKinkIndex(0) > 0 ) {
1028 if(hTrackCuts)hTrackCuts->Fill(cutIndex);
1036 ///________________________________________________________________________
1037 Bool_t AliConversionPhotonCuts::TracksAreSelected(AliVTrack * negTrack, AliVTrack * posTrack) {
1038 // Track Selection for Photon Reconstruction
1041 if(hTrackCuts)hTrackCuts->Fill(cutIndex);
1045 if(negTrack->Charge() == posTrack->Charge()) {
1046 if(hTrackCuts)hTrackCuts->Fill(cutIndex);
1051 // Number of TPC Clusters
1054 if( negTrack->GetNcls(1) < fMinClsTPC || posTrack->GetNcls(1) < fMinClsTPC ) {
1055 if(hTrackCuts)hTrackCuts->Fill(cutIndex);
1061 if( posTrack->Eta() > (fEtaCut) || posTrack->Eta() < (-fEtaCut) ||
1062 negTrack->Eta() > (fEtaCut) || negTrack->Eta() < (-fEtaCut) ){
1063 if(hTrackCuts)hTrackCuts->Fill(cutIndex);
1066 if(fEtaCutMin>-0.1){
1067 if( (posTrack->Eta() < (fEtaCutMin) && posTrack->Eta() > (-fEtaCutMin)) ||
1068 (negTrack->Eta() < (fEtaCutMin) && negTrack->Eta() > (-fEtaCutMin)) ){
1069 if(hTrackCuts)hTrackCuts->Fill(cutIndex);
1076 if( negTrack->Pt()< fSinglePtCut || posTrack->Pt()< fSinglePtCut){
1077 if(hTrackCuts)hTrackCuts->Fill(cutIndex);
1082 // AOD ESD specific cuts
1083 Bool_t passCuts = kTRUE;
1085 if(negTrack->IsA()==AliAODTrack::Class()) {
1086 passCuts = passCuts * SpecificTrackCuts(static_cast<AliAODTrack*>(negTrack), static_cast<AliAODTrack*>(posTrack),cutIndex);
1088 passCuts = passCuts * SpecificTrackCuts(static_cast<AliESDtrack*>(negTrack), static_cast<AliESDtrack*>(posTrack),cutIndex);
1092 if(hTrackCuts)hTrackCuts->Fill(cutIndex);
1097 if(hTrackCuts)hTrackCuts->Fill(cutIndex);
1103 ///________________________________________________________________________
1104 Bool_t AliConversionPhotonCuts::dEdxCuts(AliVTrack *fCurrentTrack){
1105 // Electron Identification Cuts for Photon reconstruction
1106 if(!fPIDResponse){InitPIDResponse();}// Try to reinitialize PID Response
1107 if(!fPIDResponse){AliError("No PID Response"); return kTRUE;}// if still missing fatal error
1110 if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);
1111 if(hTPCdEdxSigbefore)hTPCdEdxSigbefore->Fill(fCurrentTrack->P(),fPIDResponse->NumberOfSigmasTPC(fCurrentTrack, AliPID::kElectron));
1112 if(hTPCdEdxbefore)hTPCdEdxbefore->Fill(fCurrentTrack->P(),fCurrentTrack->GetTPCsignal());
1115 if(fDodEdxSigmaCut == kTRUE){
1116 // TPC Electron Line
1117 if( fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kElectron)<fPIDnSigmaBelowElectronLine ||
1118 fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kElectron)>fPIDnSigmaAboveElectronLine){
1120 if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);
1126 if( fCurrentTrack->P()>fPIDMinPnSigmaAbovePionLine && fCurrentTrack->P()<fPIDMaxPnSigmaAbovePionLine ){
1127 if(fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kElectron)>fPIDnSigmaBelowElectronLine &&
1128 fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kElectron)<fPIDnSigmaAboveElectronLine&&
1129 fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kPion)<fPIDnSigmaAbovePionLine){
1131 if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);
1138 if( fCurrentTrack->P()>fPIDMaxPnSigmaAbovePionLine ){
1139 if(fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kElectron)>fPIDnSigmaBelowElectronLine &&
1140 fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kElectron)<fPIDnSigmaAboveElectronLine &&
1141 fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kPion)<fPIDnSigmaAbovePionLineHighPt){
1143 if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);
1151 if(fDoKaonRejectionLowP == kTRUE){
1152 if(fCurrentTrack->P()<fPIDMinPKaonRejectionLowP ){
1153 if( abs(fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kKaon))<fPIDnSigmaAtLowPAroundKaonLine){
1155 if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);
1161 if(fDoProtonRejectionLowP == kTRUE){
1162 if( fCurrentTrack->P()<fPIDMinPProtonRejectionLowP ){
1163 if( abs(fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kProton))<fPIDnSigmaAtLowPAroundProtonLine){
1165 if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);
1172 if(fDoPionRejectionLowP == kTRUE){
1173 if( fCurrentTrack->P()<fPIDMinPPionRejectionLowP ){
1174 if( abs(fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kPion))<fPIDnSigmaAtLowPAroundPionLine){
1176 if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);
1184 // cout<<"Start"<<endl;
1185 // AliPIDResponse::EDetPidStatus status=fPIDResponse->CheckPIDStatus(AliPIDResponse::kTOF,fCurrentTrack);
1187 // if( ( (status & AliVTrack::kTOFout) == AliVTrack::kTOFout ) && ( (status & AliVTrack::kTIME) == AliVTrack::kTIME ))
1188 // {cout<<"TOF DA"<<endl;}
1189 // if(status == AliPIDResponse::kDetPidOk){
1190 // Float_t probMis = fPIDResponse->GetTOFMismatchProbability(fCurrentTrack);
1191 // cout<<"--> "<<probMis<<endl;
1192 // if(probMis > 0.01){
1197 if((fCurrentTrack->GetStatus() & AliESDtrack::kTOFpid) && !(fCurrentTrack->GetStatus() & AliESDtrack::kTOFmismatch)){
1199 Double_t t0 = fPIDResponse->GetTOFResponse().GetStartTime(fCurrentTrack->P());
1200 Double_t times[AliPID::kSPECIESC];
1201 fCurrentTrack->GetIntegratedTimes(times);
1202 Double_t TOFsignal = fCurrentTrack->GetTOFsignal();
1203 Double_t dT = TOFsignal - t0 - times[0];
1204 hTOFbefore->Fill(fCurrentTrack->P(),dT);
1206 if(hTOFSigbefore) hTOFSigbefore->Fill(fCurrentTrack->P(),fPIDResponse->NumberOfSigmasTOF(fCurrentTrack, AliPID::kElectron));
1208 if(fPIDResponse->NumberOfSigmasTOF(fCurrentTrack, AliPID::kElectron)>fTofPIDnSigmaAboveElectronLine ||
1209 fPIDResponse->NumberOfSigmasTOF(fCurrentTrack, AliPID::kElectron)<fTofPIDnSigmaBelowElectronLine ){
1210 if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);
1214 if(hTOFSigafter)hTOFSigafter->Fill(fCurrentTrack->P(),fPIDResponse->NumberOfSigmasTOF(fCurrentTrack, AliPID::kElectron));
1219 if(!fPIDResponse->IdentifiedAsElectronTRD(fCurrentTrack,fPIDTRDEfficiency)){
1220 if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);
1226 if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);
1227 if(hTPCdEdxSigafter)hTPCdEdxSigafter->Fill(fCurrentTrack->P(),fPIDResponse->NumberOfSigmasTPC(fCurrentTrack, AliPID::kElectron));
1228 if(hTPCdEdxafter)hTPCdEdxafter->Fill(fCurrentTrack->P(),fCurrentTrack->GetTPCsignal());
1233 ///________________________________________________________________________
1234 Bool_t AliConversionPhotonCuts::AsymmetryCut(AliConversionPhotonBase * photon,AliVEvent *event) {
1235 // Cut on Energy Assymetry
1237 for(Int_t ii=0;ii<2;ii++){
1239 AliVTrack *track=GetTrack(event,photon->GetTrackLabel(ii));
1241 if( track->P() > fMinPPhotonAsymmetryCut ){
1242 Double_t trackNegAsy=0;
1243 if (photon->GetPhotonP()!=0.){
1244 trackNegAsy= track->P()/photon->GetPhotonP();
1247 if( trackNegAsy<fMinPhotonAsymmetry ||trackNegAsy>(1.- fMinPhotonAsymmetry)){
1256 ///________________________________________________________________________
1257 AliVTrack *AliConversionPhotonCuts::GetTrack(AliVEvent * event, Int_t label){
1258 //Returns pointer to the track with given ESD label
1259 //(Important for AOD implementation, since Track array in AOD data is different
1260 //from ESD array, but ESD tracklabels are stored in AOD Tracks)
1262 AliESDEvent * esdEvent = dynamic_cast<AliESDEvent*>(event);
1264 if(label > event->GetNumberOfTracks() ) return NULL;
1265 AliESDtrack * track = esdEvent->GetTrack(label);
1269 AliVTrack * track = 0x0;
1270 if(((AliV0ReaderV1*)AliAnalysisManager::GetAnalysisManager()->GetTask("V0ReaderV1"))->AreAODsRelabeled()){
1271 track = dynamic_cast<AliVTrack*>(event->GetTrack(label));
1275 for(Int_t ii=0; ii<event->GetNumberOfTracks(); ii++) {
1276 track = dynamic_cast<AliVTrack*>(event->GetTrack(ii));
1278 if(track->GetID() == label) {
1285 //AliDebug(5,(Form("track not found %d %d",label,event->GetNumberOfTracks()));
1289 ///________________________________________________________________________
1290 AliESDtrack *AliConversionPhotonCuts::GetESDTrack(AliESDEvent * event, Int_t label){
1291 //Returns pointer to the track with given ESD label
1292 //(Important for AOD implementation, since Track array in AOD data is different
1293 //from ESD array, but ESD tracklabels are stored in AOD Tracks)
1296 if(label > event->GetNumberOfTracks() ) return NULL;
1297 AliESDtrack * track = event->GetTrack(label);
1300 //AliDebug(5,(Form("track not found %d %d",label,event->GetNumberOfTracks()));
1306 ///________________________________________________________________________
1307 Bool_t AliConversionPhotonCuts::PIDProbabilityCut(AliConversionPhotonBase *photon, AliVEvent * event){
1308 // Cut on Electron Probability for Photon Reconstruction
1310 AliESDEvent * esdEvent = dynamic_cast<AliESDEvent*>(event);
1314 Bool_t iResult=kFALSE;
1316 Double_t *posProbArray = new Double_t[AliPID::kSPECIES];
1317 Double_t *negProbArray = new Double_t[AliPID::kSPECIES];
1319 AliESDtrack* negTrack = esdEvent->GetTrack(photon->GetTrackLabelNegative());
1320 AliESDtrack* posTrack = esdEvent->GetTrack(photon->GetTrackLabelPositive());
1322 if(negProbArray && posProbArray){
1324 negTrack->GetTPCpid(negProbArray);
1325 posTrack->GetTPCpid(posProbArray);
1327 if(negProbArray[AliPID::kElectron]>=fPIDProbabilityCutNegativeParticle && posProbArray[AliPID::kElectron]>=fPIDProbabilityCutPositiveParticle){
1332 delete [] posProbArray;
1333 delete [] negProbArray;
1337 ///Not possible for AODs
1343 ///________________________________________________________________________
1344 Bool_t AliConversionPhotonCuts::AcceptanceCut(TParticle *particle, TParticle * ePos,TParticle* eNeg){
1345 // MC Acceptance Cuts
1346 //(Certain areas were excluded for photon reconstruction)
1348 if(particle->R()>fMaxR){
1351 if(ePos->R()>fMaxR){
1355 if(ePos->R()<fMinR){
1359 if( ePos->R() <= ((abs(ePos->Vz())*fLineCutZRSlope)-fLineCutZValue)){
1362 else if (fUseEtaMinCut && ePos->R() >= ((abs(ePos->Vz())*fLineCutZRSlopeMin)-fLineCutZValueMin )){
1366 if(abs(eNeg->Vz()) > fMaxZ ){ // cuts out regions where we do not reconstruct
1370 if(eNeg->Vz()!=ePos->Vz()||eNeg->R()!=ePos->R()){
1374 if(abs(ePos->Vz()) > fMaxZ ){ // cuts out regions where we do not reconstruct
1379 if( particle->Eta() > (fEtaCut) || particle->Eta() < (-fEtaCut) ){
1382 if( ePos->Eta() > (fEtaCut) || ePos->Eta() < (-fEtaCut) ){
1385 if( eNeg->Eta() > (fEtaCut) || eNeg->Eta() < (-fEtaCut) ){
1388 if(fEtaCutMin>-0.1){
1389 if( particle->Eta() < (fEtaCutMin) && particle->Eta() > (-fEtaCutMin) ){
1392 if( ePos->Eta() < (fEtaCutMin) && ePos->Eta() > (-fEtaCutMin) ){
1395 if( eNeg->Eta() < (fEtaCutMin) && eNeg->Eta() > (-fEtaCutMin) ){
1400 if( ePos->Pt()< fSinglePtCut || eNeg->Pt()< fSinglePtCut){
1404 if(particle->Pt()<fPtCut){
1410 ///________________________________________________________________________
1411 Bool_t AliConversionPhotonCuts::UpdateCutString() {
1412 ///Update the cut string (if it has been created yet)
1414 if(fCutString && fCutString->GetString().Length() == kNCuts) {
1415 fCutString->SetString(GetCutNumber());
1423 ///________________________________________________________________________
1424 Bool_t AliConversionPhotonCuts::InitializeCutsFromCutString(const TString analysisCutSelection ) {
1425 // Initialize Cuts from a given Cut string
1426 AliInfo(Form("Set Photoncut Number: %s",analysisCutSelection.Data()));
1427 if(analysisCutSelection.Length()!=kNCuts) {
1428 AliError(Form("Cut selection has the wrong length! size is %d, number of cuts is %d", analysisCutSelection.Length(), kNCuts));
1431 if(!analysisCutSelection.IsDigit()){
1432 AliError("Cut selection contains characters");
1436 const char *cutSelection = analysisCutSelection.Data();
1437 #define ASSIGNARRAY(i) fCuts[i] = cutSelection[i] - '0'
1438 for(Int_t ii=0;ii<kNCuts;ii++){
1442 // Set Individual Cuts
1443 for(Int_t ii=0;ii<kNCuts;ii++){
1444 if(!SetCut(cutIds(ii),fCuts[ii]))return kFALSE;
1447 PrintCutsWithValues();
1451 ///________________________________________________________________________
1452 Bool_t AliConversionPhotonCuts::SetCut(cutIds cutID, const Int_t value) {
1453 ///Set individual cut ID
1458 if( SetV0Finder(value)) {
1459 fCuts[kv0FinderType] = value;
1462 } else return kFALSE;
1465 if( SetEtaCut(value)) {
1466 fCuts[ketaCut] = value;
1469 } else return kFALSE;
1472 if( SetRCut(value)) {
1473 fCuts[kRCut] = value;
1476 } else return kFALSE;
1478 case kEtaForPhiSector:
1479 if( SetEtaForPhiCut(value)) {
1480 fCuts[kEtaForPhiSector] = value;
1483 } else return kFALSE;
1485 if( SetMinPhiSectorCut(value)) {
1486 fCuts[kMinPhiSector] = value;
1489 } else return kFALSE;
1491 if( SetMaxPhiSectorCut(value)) {
1492 fCuts[kMaxPhiSector] = value;
1495 } else return kFALSE;
1498 if( SetSinglePtCut(value)) {
1499 fCuts[ksinglePtCut] = value;
1502 } else return kFALSE;
1505 if( SetTPCClusterCut(value)) {
1506 fCuts[kclsTPCCut] = value;
1509 } else return kFALSE;
1511 case kededxSigmaCut:
1512 if( SetTPCdEdxCutElectronLine(value)) {
1513 fCuts[kededxSigmaCut] = value;
1516 } else return kFALSE;
1518 case kpidedxSigmaCut:
1519 if( SetTPCdEdxCutPionLine(value)) {
1520 fCuts[kpidedxSigmaCut] = value;
1523 } else return kFALSE;
1525 case kpiMomdedxSigmaCut:
1526 if( SetMinMomPiondEdxCut(value)) {
1527 fCuts[kpiMomdedxSigmaCut] = value;
1530 } else return kFALSE;
1532 case kpiMaxMomdedxSigmaCut:
1533 if( SetMaxMomPiondEdxCut(value)) {
1534 fCuts[kpiMaxMomdedxSigmaCut] = value;
1537 } else return kFALSE;
1539 case kLowPRejectionSigmaCut:
1540 if( SetLowPRejectionCuts(value)) {
1541 fCuts[kLowPRejectionSigmaCut] = value;
1544 } else return kFALSE;
1546 case kTOFelectronPID:
1547 if( SetTOFElectronPIDCut(value)) {
1548 fCuts[kTOFelectronPID] = value;
1551 } else return kFALSE;
1554 if( SetQtMaxCut(value)) {
1555 fCuts[kQtMaxCut] = value;
1558 } else return kFALSE;
1562 if( SetChi2GammaCut(value)) {
1563 fCuts[kchi2GammaCut] = value;
1566 } else return kFALSE;
1569 if( SetPsiPairCut(value)) {
1570 fCuts[kPsiPair] = value;
1573 } else return kFALSE;
1575 case kdoPhotonAsymmetryCut:
1576 if( SetPhotonAsymmetryCut(value)) {
1577 fCuts[kdoPhotonAsymmetryCut] = value;
1580 } else return kFALSE;
1583 if( SetCosPAngleCut(value)) {
1584 fCuts[kCosPAngle] = value;
1587 } else return kFALSE;
1590 if( SetSharedElectronCut(value)) {
1591 fCuts[kElecShare] = value;
1594 } else return kFALSE;
1597 if( SetToCloseV0sCut(value)) {
1598 fCuts[kToCloseV0s] = value;
1601 } else return kFALSE;
1604 if( SetDCARPhotonPrimVtxCut(value)) {
1605 fCuts[kDcaRPrimVtx] = value;
1608 } else return kFALSE;
1611 if( SetDCAZPhotonPrimVtxCut(value)) {
1612 fCuts[kDcaZPrimVtx] = value;
1615 } else return kFALSE;
1617 case kInPlaneOutOfPlane:
1618 if( SetInPlaneOutOfPlane(value)) {
1619 fCuts[kInPlaneOutOfPlane] = value;
1622 } else return kFALSE;
1625 AliError("Cut id out of range");
1629 AliError("Cut id %d not recognized");
1634 ///________________________________________________________________________
1635 void AliConversionPhotonCuts::PrintCuts() {
1636 // Print out current Cut Selection
1637 for(Int_t ic = 0; ic < kNCuts; ic++) {
1638 printf("%-30s : %d \n", fgkCutNames[ic], fCuts[ic]);
1642 void AliConversionPhotonCuts::PrintCutsWithValues() {
1643 // Print out current Cut Selection with value
1644 printf("\nConversion cutnumber \n");
1645 for(Int_t ic = 0; ic < kNCuts; ic++) {
1646 printf("%d",fCuts[ic]);
1649 printf("Electron cuts & Secondary Track Cuts - only track from secondaries enter analysis: \n");
1650 printf("\t no like sign pairs from V0s \n");
1651 if (!fUseCorrectedTPCClsInfo) printf("\t # TPC clusters > %3.2f \n", fMinClsTPC);
1652 if (fEtaCutMin > -0.1) printf("\t %3.2f < eta_{e} < %3.2f\n", fEtaCutMin, fEtaCut );
1653 else printf("\t eta_{e} < %3.2f\n", fEtaCut );
1654 printf("\t reject: %3.2f < phi < %3.2f with %3.2f < eta < %3.2f \n", fMinPhiCut, fMaxPhiCut, fEtaForPhiCutMin, fEtaForPhiCutMax);
1655 printf("\t p_{T,e} > %3.2f\n", fSinglePtCut );
1656 printf("\t TPC refit \n");
1657 printf("\t no kinks \n");
1658 printf("\t accept: %3.2f < n sigma_{e,TPC} < %3.2f\n", fPIDnSigmaBelowElectronLine, fPIDnSigmaAboveElectronLine );
1659 printf("\t reject: %3.2f < p_{e,T} < %3.2f, n sigma_{pi,TPC} < %3.2f\n", fPIDMinPnSigmaAbovePionLine, fPIDMaxPnSigmaAbovePionLine, fPIDnSigmaAbovePionLine );
1660 printf("\t reject: p_{e,T} > %3.2f, n sigma_{pi,TPC} < %3.2f\n", fPIDMaxPnSigmaAbovePionLine, fPIDnSigmaAbovePionLineHighPt );
1661 if (fDoPionRejectionLowP) printf("\t reject: p_{e,T} < %3.2f, -%3.2f < n sigma_{pi,TPC} < %3.2f\n", fPIDMinPPionRejectionLowP, fPIDnSigmaAtLowPAroundPionLine, fPIDnSigmaAtLowPAroundPionLine );
1662 if (fDoKaonRejectionLowP) printf("\t reject: -%3.2f < n sigma_{K,TPC} < %3.2f\n", fPIDnSigmaAtLowPAroundKaonLine, fPIDnSigmaAtLowPAroundKaonLine );
1663 if (fDoProtonRejectionLowP) printf("\t reject: -%3.2f < n sigma_{K,TPC} < %3.2f\n", fPIDnSigmaAtLowPAroundProtonLine, fPIDnSigmaAtLowPAroundProtonLine );
1664 if (fUseTOFpid) printf("\t accept: %3.2f < n sigma_{e,TOF} < %3.2f\n", fTofPIDnSigmaBelowElectronLine, fTofPIDnSigmaAboveElectronLine);
1666 printf("Photon cuts: \n");
1667 if (fUseOnFlyV0Finder) printf("\t using Onfly V0 finder \n");
1668 else printf("\t using Offline V0 finder \n");
1670 printf("\t 2 dimensional q_{T} cut applied with maximum of %3.2f \n", fQtMax );
1672 printf("\t 1 dimensional q_{T} cut applied with maximum of %3.2f \n", fQtMax );
1674 if (fDo2DPsiPairChi2){
1675 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 );
1677 printf("\t chi^{2} max cut chi^{2} < %3.2f \n", fChi2CutConversion );
1678 printf("\t psi_{pair} max cut |psi_{pair}| < %3.2f \n", fPsiPairCut );
1680 printf("\t %3.2f < R_{conv} < %3.2f\n", fMinR, fMaxR );
1681 printf("\t Z_{conv} < %3.2f\n", fMaxZ );
1682 if (fEtaCutMin > -0.1) printf("\t %3.2f < eta_{conv} < %3.2f\n", fEtaCutMin, fEtaCut );
1683 else printf("\t eta_{conv} < %3.2f\n", fEtaCut );
1684 if (fDoPhotonAsymmetryCut) printf("\t for p_{T,track} > %3.2f, A_{gamma} < %3.2f \n", fMinPPhotonAsymmetryCut, fMinPhotonAsymmetry );
1685 if (fUseCorrectedTPCClsInfo) printf("\t #cluster TPC/ #findable clusters TPC (corrected for radius) > %3.2f\n", fMinClsTPCToF );
1686 printf("\t p_{T,gamma} > %3.2f\n", fPtCut );
1687 printf("\t cos(Theta_{point}) > %3.2f \n", fCosPAngleCut );
1688 printf("\t dca_{R} < %3.2f \n", fDCARPrimVtxCut );
1689 printf("\t dca_{Z} < %3.2f \n", fDCAZPrimVtxCut );
1690 if (fDoPhotonQualitySelectionCut) printf("\t selection based on photon quality with quality %d \n", fPhotonQualityCut );
1693 ///________________________________________________________________________
1694 Bool_t AliConversionPhotonCuts::SetV0Finder(Int_t v0FinderType)
1696 switch (v0FinderType){
1697 case 0: // on fly V0 finder
1698 cout << "have chosen onfly V0" << endl;
1699 fUseOnFlyV0Finder=kTRUE;
1701 case 1: // offline V0 finder
1702 cout << "have chosen offline V0" << endl;
1703 fUseOnFlyV0Finder=kFALSE;
1706 AliError(Form(" v0FinderType not defined %d",v0FinderType));
1712 ///________________________________________________________________________
1713 Bool_t AliConversionPhotonCuts::SetEtaCut(Int_t etaCut)
1716 //Set Standard LineCutZValues
1717 fLineCutZValueMin = -2;
1718 fLineCutZValue = 7.;
1723 fLineCutZRSlope = tan(2*atan(exp(-fEtaCut)));
1725 fLineCutZRSlopeMin = 0.;
1727 case 1: // 0.6 // changed from 1.2 to 0.6 on 2013.06.10
1729 fLineCutZRSlope = tan(2*atan(exp(-fEtaCut)));
1731 fLineCutZRSlopeMin = 0.;
1735 fLineCutZRSlope = tan(2*atan(exp(-fEtaCut)));
1737 fLineCutZRSlopeMin = 0.;
1741 fLineCutZRSlope = tan(2*atan(exp(-fEtaCut)));
1743 fLineCutZRSlopeMin = 0.;
1747 fLineCutZRSlope = tan(2*atan(exp(-fEtaCut)));
1749 fLineCutZRSlopeMin = 0.;
1753 fLineCutZRSlope = tan(2*atan(exp(-fEtaCut)));
1755 fLineCutZRSlopeMin = 0.;
1759 fLineCutZRSlope = tan(2*atan(exp(-fEtaCut)));
1761 fLineCutZRSlopeMin = 0.;
1764 if (fIsHeavyIon==1){
1766 fLineCutZRSlope = tan(2*atan(exp(-fEtaCut)));
1768 fLineCutZRSlopeMin = 0.;
1772 fLineCutZRSlope = tan(2*atan(exp(-fEtaCut)));
1774 fLineCutZRSlopeMin = 0.;
1777 // case 8: // 0.1 - 0.8
1779 // fLineCutZRSlope = tan(2*atan(exp(-fEtaCut)));
1780 // fEtaCutMin = 0.1;
1781 // fLineCutZRSlopeMin = tan(2*atan(exp(-fEtaCutMin)));
1785 fLineCutZRSlope = tan(2*atan(exp(-fEtaCut)));
1787 fLineCutZRSlopeMin = 0.;
1791 fLineCutZRSlope = tan(2*atan(exp(-fEtaCut)));
1793 fLineCutZRSlopeMin = 0.;
1796 AliError(Form(" EtaCut not defined %d",etaCut));
1802 ///________________________________________________________________________
1803 Bool_t AliConversionPhotonCuts::SetRCut(Int_t RCut){
1836 fMinR = 35.; //old 26.
1848 AliError("RCut not defined");
1854 ///________________________________________________________________________
1855 Bool_t AliConversionPhotonCuts::SetEtaForPhiCut(Int_t etaPhiCut) {
1858 case 0: //no specific eta range selected, full eta range
1859 fEtaForPhiCutMin = -fEtaCut;
1860 fEtaForPhiCutMax = fEtaCut;
1862 case 1: //eta < 0 only
1863 if (!fDoShrinkTPCAcceptance) fDoShrinkTPCAcceptance = kTRUE;
1864 fEtaForPhiCutMin = -fEtaCut;
1865 fEtaForPhiCutMax = 0.;
1867 case 2://eta > 0 only
1868 if (!fDoShrinkTPCAcceptance) fDoShrinkTPCAcceptance = kTRUE;
1869 fEtaForPhiCutMin = 0.;
1870 fEtaForPhiCutMax = fEtaCut;
1873 AliError(Form("EtaForPhiCut not defined %d",etaPhiCut));
1880 ///________________________________________________________________________
1881 // This are exclusion cuts, everything between fMinPhiCut & fMaxPhiCut will be excluded
1882 Bool_t AliConversionPhotonCuts::SetMinPhiSectorCut(Int_t minPhiCut) {
1886 fDoShrinkTPCAcceptance = kFALSE;
1890 if (!fDoShrinkTPCAcceptance) fDoShrinkTPCAcceptance = kTRUE;
1891 fMinPhiCut = 1.7; //OROC C08
1894 if (!fDoShrinkTPCAcceptance) fDoShrinkTPCAcceptance = kTRUE;
1895 fMinPhiCut = 4.4; //EMCal
1898 if (!fDoShrinkTPCAcceptance) fDoShrinkTPCAcceptance = kTRUE;
1899 fMinPhiCut = 1.0; //PHOS
1902 if (!fDoShrinkTPCAcceptance) fDoShrinkTPCAcceptance = kTRUE;
1903 fMinPhiCut = 3.4; //EMCal tight
1907 AliError(Form("MinPhiCut not defined %d",minPhiCut));
1914 ///________________________________________________________________________
1915 // This are exclusion cuts, everything between fMinPhiCut & fMaxPhiCut will be excluded
1916 Bool_t AliConversionPhotonCuts::SetMaxPhiSectorCut(Int_t maxPhiCut) {
1920 if (!fDoShrinkTPCAcceptance) fDoShrinkTPCAcceptance = kFALSE;
1921 fMaxPhiCut = 2*TMath::Pi()+0.00001;
1924 if (!fDoShrinkTPCAcceptance) fDoShrinkTPCAcceptance = kTRUE;
1925 fMaxPhiCut = 4.3; //OROC C08
1928 if (!fDoShrinkTPCAcceptance) fDoShrinkTPCAcceptance = kTRUE;
1929 fMaxPhiCut = 5.8; //EMCal
1932 if (!fDoShrinkTPCAcceptance) fDoShrinkTPCAcceptance = kTRUE;
1933 fMaxPhiCut = 3.0; //PHOS
1936 if (!fDoShrinkTPCAcceptance) fDoShrinkTPCAcceptance = kTRUE;
1937 fMaxPhiCut = 1.; //EMCal
1941 AliError(Form("MaxPhiCut not defined %d",maxPhiCut));
1949 ///________________________________________________________________________
1950 Bool_t AliConversionPhotonCuts::SetSinglePtCut(Int_t singlePtCut)
1952 switch(singlePtCut){
1953 case 0: // 0.050 GeV
1954 fSinglePtCut = 0.050;
1956 case 1: // 0.100 GeV
1957 fSinglePtCut = 0.100;
1959 case 2: // 0.150 GeV
1960 fSinglePtCut = 0.150;
1962 case 3: // 0.200 GeV
1963 fSinglePtCut = 0.200;
1965 case 4: // 0.075 GeV
1966 fSinglePtCut = 0.075;
1968 case 5: // 0.125 GeV
1969 fSinglePtCut = 0.125;
1972 fSinglePtCut = 0.040;
1978 AliError(Form("singlePtCut not defined %d",singlePtCut));
1984 ///________________________________________________________________________
1985 Bool_t AliConversionPhotonCuts::SetTPCClusterCut(Int_t clsTPCCut)
2000 case 4: // 95% of findable clusters
2001 fMinClsTPCToF= 0.95;
2002 fUseCorrectedTPCClsInfo=1;
2004 case 5: // 0% of findable clusters
2006 fUseCorrectedTPCClsInfo=1;
2008 case 6: // 70% of findable clusters
2010 fUseCorrectedTPCClsInfo=1;
2012 case 7: // 0% of findable clusters
2013 fMinClsTPCToF= 0.35;
2014 fUseCorrectedTPCClsInfo=0;
2017 fMinClsTPCToF= 0.35;
2018 fUseCorrectedTPCClsInfo=1;
2022 fUseCorrectedTPCClsInfo=1;
2025 AliError(Form("Warning: clsTPCCut not defined %d",clsTPCCut));
2031 ///________________________________________________________________________
2032 Bool_t AliConversionPhotonCuts::SetTPCdEdxCutElectronLine(Int_t ededxSigmaCut)
2034 switch(ededxSigmaCut){
2036 fPIDnSigmaBelowElectronLine=-10;
2037 fPIDnSigmaAboveElectronLine=10;
2040 fPIDnSigmaBelowElectronLine=-5;
2041 fPIDnSigmaAboveElectronLine=5;
2044 fPIDnSigmaBelowElectronLine=-3;
2045 fPIDnSigmaAboveElectronLine=5;
2048 fPIDnSigmaBelowElectronLine=-4;
2049 fPIDnSigmaAboveElectronLine=5;
2052 fPIDnSigmaBelowElectronLine=-6;
2053 fPIDnSigmaAboveElectronLine=7;
2056 fPIDnSigmaBelowElectronLine=-4;
2057 fPIDnSigmaAboveElectronLine=4;
2060 fPIDnSigmaBelowElectronLine=-2.5;
2061 fPIDnSigmaAboveElectronLine=4;
2064 fPIDnSigmaBelowElectronLine=-2;
2065 fPIDnSigmaAboveElectronLine=3.5;
2068 AliError("TPCdEdxCutElectronLine not defined");
2075 ///________________________________________________________________________
2076 Bool_t AliConversionPhotonCuts::SetTPCdEdxCutPionLine(Int_t pidedxSigmaCut)
2079 switch(pidedxSigmaCut){
2081 fPIDnSigmaAbovePionLine=-10;
2082 fPIDnSigmaAbovePionLineHighPt=-10;
2085 fPIDnSigmaAbovePionLine=0;
2086 fPIDnSigmaAbovePionLineHighPt=-10;
2089 fPIDnSigmaAbovePionLine=1;
2090 fPIDnSigmaAbovePionLineHighPt=-10;
2093 fPIDnSigmaAbovePionLine=2.5;
2094 fPIDnSigmaAbovePionLineHighPt=-10;
2097 fPIDnSigmaAbovePionLine=0.5;
2098 fPIDnSigmaAbovePionLineHighPt=-10;
2101 fPIDnSigmaAbovePionLine=2.;
2102 fPIDnSigmaAbovePionLineHighPt=-10;
2105 fPIDnSigmaAbovePionLine=2.;
2106 fPIDnSigmaAbovePionLineHighPt=0.5;
2109 fPIDnSigmaAbovePionLine=3.5;
2110 fPIDnSigmaAbovePionLineHighPt=-10;
2113 fPIDnSigmaAbovePionLine=2.;
2114 fPIDnSigmaAbovePionLineHighPt=1.;
2117 fPIDnSigmaAbovePionLine=3.0; // We need a bit less tight cut on dE/dx
2118 fPIDnSigmaAbovePionLineHighPt=-10;
2121 AliError(Form("Warning: pidedxSigmaCut not defined %d",pidedxSigmaCut));
2127 ///________________________________________________________________________
2128 Bool_t AliConversionPhotonCuts::SetMinMomPiondEdxCut(Int_t piMomdedxSigmaCut)
2130 switch(piMomdedxSigmaCut){
2132 fPIDMinPnSigmaAbovePionLine=0.5;
2135 fPIDMinPnSigmaAbovePionLine=1.;
2138 fPIDMinPnSigmaAbovePionLine=1.5;
2141 fPIDMinPnSigmaAbovePionLine=20.;
2144 fPIDMinPnSigmaAbovePionLine=50.;
2147 fPIDMinPnSigmaAbovePionLine=0.3;
2150 fPIDMinPnSigmaAbovePionLine=0.25;
2153 fPIDMinPnSigmaAbovePionLine=0.4;
2156 fPIDMinPnSigmaAbovePionLine=0.2;
2159 AliError(Form("piMomdedxSigmaCut not defined %d",piMomdedxSigmaCut));
2165 ///________________________________________________________________________
2166 Bool_t AliConversionPhotonCuts::SetMaxMomPiondEdxCut(Int_t piMaxMomdedxSigmaCut)
2168 switch(piMaxMomdedxSigmaCut){
2170 fPIDMaxPnSigmaAbovePionLine=100.;
2173 fPIDMaxPnSigmaAbovePionLine=5.;
2176 fPIDMaxPnSigmaAbovePionLine=4.;
2179 fPIDMaxPnSigmaAbovePionLine=3.5;
2182 fPIDMaxPnSigmaAbovePionLine=3.;
2185 fPIDMaxPnSigmaAbovePionLine=7.;
2188 AliError(Form("piMaxMomdedxSigmaCut not defined %d",piMaxMomdedxSigmaCut));
2194 ///________________________________________________________________________
2195 Bool_t AliConversionPhotonCuts::SetLowPRejectionCuts(Int_t LowPRejectionSigmaCut)
2197 switch(LowPRejectionSigmaCut){
2199 fPIDnSigmaAtLowPAroundKaonLine=0;
2200 fPIDnSigmaAtLowPAroundProtonLine=0;
2201 fPIDnSigmaAtLowPAroundPionLine=0;
2202 fDoKaonRejectionLowP = kFALSE;
2203 fDoProtonRejectionLowP = kFALSE;
2204 fDoPionRejectionLowP = kFALSE;
2205 fPIDMinPPionRejectionLowP = fPIDMinPnSigmaAbovePionLine;
2208 fPIDnSigmaAtLowPAroundKaonLine=0.5;
2209 fPIDnSigmaAtLowPAroundProtonLine=0.5;
2210 fPIDnSigmaAtLowPAroundPionLine=0.5;
2211 fDoKaonRejectionLowP = kTRUE;
2212 fDoProtonRejectionLowP = kTRUE;
2213 fDoPionRejectionLowP = kTRUE;
2214 fPIDMinPPionRejectionLowP = fPIDMinPnSigmaAbovePionLine;
2217 fPIDnSigmaAtLowPAroundKaonLine=1;
2218 fPIDnSigmaAtLowPAroundProtonLine=1;
2219 fPIDnSigmaAtLowPAroundPionLine=1;
2220 fDoKaonRejectionLowP = kTRUE;
2221 fDoProtonRejectionLowP = kTRUE;
2222 fDoPionRejectionLowP = kTRUE;
2223 fPIDMinPPionRejectionLowP = fPIDMinPnSigmaAbovePionLine;
2226 fPIDnSigmaAtLowPAroundKaonLine=2.;
2227 fPIDnSigmaAtLowPAroundProtonLine=2.;
2228 fPIDnSigmaAtLowPAroundPionLine=2.;
2229 fDoKaonRejectionLowP = kTRUE;
2230 fDoProtonRejectionLowP = kTRUE;
2231 fDoPionRejectionLowP = kTRUE;
2232 fPIDMinPPionRejectionLowP = fPIDMinPnSigmaAbovePionLine;
2235 fPIDnSigmaAtLowPAroundKaonLine=0.;
2236 fPIDnSigmaAtLowPAroundProtonLine=0.;
2237 fPIDnSigmaAtLowPAroundPionLine=1;
2238 fDoKaonRejectionLowP = kFALSE;
2239 fDoProtonRejectionLowP = kFALSE;
2240 fDoPionRejectionLowP = kTRUE;
2241 fPIDMinPPionRejectionLowP = fPIDMinPnSigmaAbovePionLine;
2244 fPIDnSigmaAtLowPAroundKaonLine=0.;
2245 fPIDnSigmaAtLowPAroundProtonLine=0.;
2246 fPIDnSigmaAtLowPAroundPionLine=1.5;
2247 fDoKaonRejectionLowP = kFALSE;
2248 fDoProtonRejectionLowP = kFALSE;
2249 fDoPionRejectionLowP = kTRUE;
2250 fPIDMinPPionRejectionLowP = fPIDMinPnSigmaAbovePionLine;
2253 fPIDnSigmaAtLowPAroundKaonLine=0.;
2254 fPIDnSigmaAtLowPAroundProtonLine=0.;
2255 fPIDnSigmaAtLowPAroundPionLine=2.;
2256 fDoKaonRejectionLowP = kFALSE;
2257 fDoProtonRejectionLowP = kFALSE;
2258 fDoPionRejectionLowP = kTRUE;
2259 fPIDMinPPionRejectionLowP = fPIDMinPnSigmaAbovePionLine;
2262 fPIDnSigmaAtLowPAroundKaonLine=0.;
2263 fPIDnSigmaAtLowPAroundProtonLine=0.;
2264 fPIDnSigmaAtLowPAroundPionLine=0.5;
2265 fDoKaonRejectionLowP = kFALSE;
2266 fDoProtonRejectionLowP = kFALSE;
2267 fDoPionRejectionLowP = kTRUE;
2268 fPIDMinPPionRejectionLowP = fPIDMinPnSigmaAbovePionLine;
2271 AliError(Form("LowPRejectionSigmaCut not defined %d",LowPRejectionSigmaCut));
2277 ///________________________________________________________________________
2278 Bool_t AliConversionPhotonCuts::SetTOFElectronPIDCut(Int_t TOFelectronPID){
2280 switch(TOFelectronPID){
2282 fUseTOFpid = kFALSE;
2283 fTofPIDnSigmaBelowElectronLine=-100;
2284 fTofPIDnSigmaAboveElectronLine=100;
2288 fTofPIDnSigmaBelowElectronLine=-7;
2289 fTofPIDnSigmaAboveElectronLine=7;
2293 fTofPIDnSigmaBelowElectronLine=-5;
2294 fTofPIDnSigmaAboveElectronLine=5;
2298 fTofPIDnSigmaBelowElectronLine=-3;
2299 fTofPIDnSigmaAboveElectronLine=5;
2303 fTofPIDnSigmaBelowElectronLine=-2;
2304 fTofPIDnSigmaAboveElectronLine=3;
2308 fTofPIDnSigmaBelowElectronLine=-3;
2309 fTofPIDnSigmaAboveElectronLine=3;
2312 AliError(Form("TOFElectronCut not defined %d",TOFelectronPID));
2318 ///________________________________________________________________________
2319 Bool_t AliConversionPhotonCuts::SetQtMaxCut(Int_t QtMaxCut)
2324 fDoQtGammaSelection=kFALSE;
2364 AliError(Form("Warning: QtMaxCut not defined %d",QtMaxCut));
2370 ///________________________________________________________________________
2371 Bool_t AliConversionPhotonCuts::SetChi2GammaCut(Int_t chi2GammaCut)
2374 switch(chi2GammaCut){
2376 fChi2CutConversion = 100.;
2379 fChi2CutConversion = 50.;
2382 fChi2CutConversion = 30.;
2385 fChi2CutConversion = 200.;
2388 fChi2CutConversion = 500.;
2391 fChi2CutConversion = 100000.;
2394 fChi2CutConversion = 5.;
2397 fChi2CutConversion = 10.;
2400 fChi2CutConversion = 20.;
2403 fChi2CutConversion = 15.;
2406 AliError(Form("Warning: Chi2GammaCut not defined %d",chi2GammaCut));
2412 ///________________________________________________________________________
2413 Bool_t AliConversionPhotonCuts::SetPsiPairCut(Int_t psiCut) {
2417 fPsiPairCut = 10000; //
2420 fPsiPairCut = 0.1; //
2423 fPsiPairCut = 0.05; // Standard
2426 fPsiPairCut = 0.035; //
2429 fPsiPairCut = 0.2; //
2432 fPsiPairCut = 0.1; //
2433 fDo2DPsiPairChi2 = kTRUE;
2436 fPsiPairCut = 0.05; //
2437 fDo2DPsiPairChi2 = kTRUE;
2440 fPsiPairCut = 0.035; //
2441 fDo2DPsiPairChi2 = kTRUE;
2444 fPsiPairCut = 0.2; //
2445 fDo2DPsiPairChi2 = kTRUE; //
2448 fPsiPairCut = 0.5; //
2451 AliError(Form("PsiPairCut not defined %d",psiCut));
2458 ///________________________________________________________________________
2459 Bool_t AliConversionPhotonCuts::SetPhotonAsymmetryCut(Int_t doPhotonAsymmetryCut){
2461 switch(doPhotonAsymmetryCut){
2463 fDoPhotonAsymmetryCut=0;
2464 fMinPPhotonAsymmetryCut=100.;
2465 fMinPhotonAsymmetry=0.;
2468 fDoPhotonAsymmetryCut=1;
2469 fMinPPhotonAsymmetryCut=3.5;
2470 fMinPhotonAsymmetry=0.04;
2473 fDoPhotonAsymmetryCut=1;
2474 fMinPPhotonAsymmetryCut=3.5;
2475 fMinPhotonAsymmetry=0.06;
2478 fDoPhotonAsymmetryCut=1;
2479 fMinPPhotonAsymmetryCut=0.0;
2480 fMinPhotonAsymmetry=0.05;
2483 AliError(Form("PhotonAsymmetryCut not defined %d",doPhotonAsymmetryCut));
2486 fCuts[kdoPhotonAsymmetryCut]=doPhotonAsymmetryCut;
2490 ///________________________________________________________________________
2491 Bool_t AliConversionPhotonCuts::SetCosPAngleCut(Int_t cosCut) {
2501 fCosPAngleCut = 0.5;
2504 fCosPAngleCut = 0.75;
2507 fCosPAngleCut = 0.85;
2510 fCosPAngleCut = 0.88;
2513 fCosPAngleCut = 0.9;
2516 fCosPAngleCut = 0.95;
2519 AliError(Form("Cosine Pointing Angle cut not defined %d",cosCut));
2526 ///________________________________________________________________________
2527 Bool_t AliConversionPhotonCuts::SetSharedElectronCut(Int_t sharedElec) {
2531 fDoSharedElecCut = kFALSE;
2532 fDoPhotonQualitySelectionCut = kFALSE;
2533 fPhotonQualityCut = 0;
2536 fDoSharedElecCut = kTRUE;
2537 fDoPhotonQualitySelectionCut = kFALSE;
2538 fPhotonQualityCut = 0;
2541 fDoSharedElecCut = kFALSE;
2542 fDoPhotonQualitySelectionCut = kTRUE;
2543 fPhotonQualityCut = 1;
2546 fDoSharedElecCut = kFALSE;
2547 fDoPhotonQualitySelectionCut = kTRUE;
2548 fPhotonQualityCut = 2;
2551 fDoSharedElecCut = kFALSE;
2552 fDoPhotonQualitySelectionCut = kTRUE;
2553 fPhotonQualityCut = 3;
2556 AliError(Form("Shared Electron Cut not defined %d",sharedElec));
2563 ///________________________________________________________________________
2564 Bool_t AliConversionPhotonCuts::SetToCloseV0sCut(Int_t toClose) {
2568 fDoToCloseV0sCut = kFALSE;
2572 fDoToCloseV0sCut = kTRUE;
2576 fDoToCloseV0sCut = kTRUE;
2580 fDoToCloseV0sCut = kTRUE;
2584 AliError(Form("Shared Electron Cut not defined %d",toClose));
2590 ///________________________________________________________________________
2591 Bool_t AliConversionPhotonCuts::SetTRDElectronCut(Int_t TRDElectronCut)
2593 switch(TRDElectronCut){
2599 fPIDTRDEfficiency=0.1;
2603 fPIDTRDEfficiency=0.8;
2607 fPIDTRDEfficiency=0.9;
2610 AliError(Form("TRDElectronCut not defined %d",TRDElectronCut));
2617 ///________________________________________________________________________
2618 Bool_t AliConversionPhotonCuts::SetDCAZPhotonPrimVtxCut(Int_t DCAZPhotonPrimVtx){
2620 switch(DCAZPhotonPrimVtx){
2622 fDCAZPrimVtxCut = 1000;
2625 fDCAZPrimVtxCut = 10;
2628 fDCAZPrimVtxCut = 5;
2631 fDCAZPrimVtxCut = 4;
2634 fDCAZPrimVtxCut = 3;
2637 fDCAZPrimVtxCut = 2.5;
2640 fDCAZPrimVtxCut = 2;
2643 fDCAZPrimVtxCut = 1.5;
2646 fDCAZPrimVtxCut = 1;
2649 fDCAZPrimVtxCut = 0.5;
2652 cout<<"Warning: DCAZPhotonPrimVtx not defined "<<DCAZPhotonPrimVtx<<endl;
2658 ///________________________________________________________________________
2659 Bool_t AliConversionPhotonCuts::SetDCARPhotonPrimVtxCut(Int_t DCARPhotonPrimVtx){
2661 switch(DCARPhotonPrimVtx){
2663 fDCARPrimVtxCut = 1000;
2666 fDCARPrimVtxCut = 10;
2669 fDCARPrimVtxCut = 5;
2672 fDCARPrimVtxCut = 4;
2675 fDCARPrimVtxCut = 3;
2678 fDCARPrimVtxCut = 2.5;
2681 fDCARPrimVtxCut = 2;
2684 fDCARPrimVtxCut = 1.5;
2687 fDCARPrimVtxCut = 1;
2690 fDCARPrimVtxCut = 0.5;
2693 cout<<"Warning: DCARPhotonPrimVtx not defined "<<DCARPhotonPrimVtx<<endl;
2699 ///________________________________________________________________________
2700 Bool_t AliConversionPhotonCuts::SetInPlaneOutOfPlane(Int_t inOutPlane){
2704 fInPlaneOutOfPlane = 0; // No Event Plane
2707 fInPlaneOutOfPlane = 1; // In-Plane
2710 fInPlaneOutOfPlane = 2; // Out-Of-Plane
2713 cout<<"Warning: In-Plane or Out-Of-Plane not defined "<<inOutPlane<<endl;
2720 ///________________________________________________________________________
2721 Int_t AliConversionPhotonCuts::GetFirstTPCRow(Double_t radius){
2722 // Get first TPC row
2723 Int_t firstTPCRow = 0;
2724 Double_t radiusI = 84.8;
2725 Double_t radiusO = 134.6;
2726 Double_t radiusOB = 198.;
2727 Double_t rSizeI = 0.75;
2728 Double_t rSizeO = 1.;
2729 Double_t rSizeOB = 1.5;
2733 if(radius <= radiusI){
2736 if(radius>radiusI && radius<=radiusO){
2737 firstTPCRow = (Int_t)((radius-radiusI)/rSizeI);
2739 if(radius>radiusO && radius<=radiusOB){
2740 firstTPCRow = (Int_t)(nClsI+(radius-radiusO)/rSizeO);
2743 if(radius>radiusOB){
2744 firstTPCRow =(Int_t)(nClsIO+(radius-radiusOB)/rSizeOB);
2750 ///________________________________________________________________________
2751 Bool_t AliConversionPhotonCuts::CosinePAngleCut(const AliConversionPhotonBase * photon, AliVEvent * event) const {
2752 ///Check if passes cosine of pointing angle cut
2753 if(GetCosineOfPointingAngle(photon, event) < fCosPAngleCut){
2759 ///________________________________________________________________________
2760 Double_t AliConversionPhotonCuts::GetCosineOfPointingAngle( const AliConversionPhotonBase * photon, AliVEvent * event) const{
2761 // calculates the pointing angle of the recalculated V0
2763 Double_t momV0[3] = {0,0,0};
2764 if(event->IsA()==AliESDEvent::Class()){
2765 AliESDEvent *esdEvent = dynamic_cast<AliESDEvent*>(event);
2766 if(!esdEvent) return -999;
2767 AliESDv0 *v0 = esdEvent->GetV0(photon->GetV0Index());
2768 if(!v0) return -999;
2769 v0->GetPxPyPz(momV0[0],momV0[1],momV0[2]);
2771 if(event->IsA()==AliAODEvent::Class()){
2772 momV0[0] = photon->GetPx();
2773 momV0[1] = photon->GetPy();
2774 momV0[2] = photon->GetPz();
2777 //Double_t momV0[3] = { photon->GetPx(), photon->GetPy(), photon->GetPz() }; //momentum of the V0
2778 Double_t PosV0[3] = { photon->GetConversionX() - event->GetPrimaryVertex()->GetX(),
2779 photon->GetConversionY() - event->GetPrimaryVertex()->GetY(),
2780 photon->GetConversionZ() - event->GetPrimaryVertex()->GetZ() }; //Recalculated V0 Position vector
2782 Double_t momV02 = momV0[0]*momV0[0] + momV0[1]*momV0[1] + momV0[2]*momV0[2];
2783 Double_t PosV02 = PosV0[0]*PosV0[0] + PosV0[1]*PosV0[1] + PosV0[2]*PosV0[2];
2786 Double_t cosinePointingAngle = -999;
2787 if(momV02*PosV02 > 0.0)
2788 cosinePointingAngle = (PosV0[0]*momV0[0] + PosV0[1]*momV0[1] + PosV0[2]*momV0[2] ) / TMath::Sqrt(momV02 * PosV02);
2790 return cosinePointingAngle;
2793 ///________________________________________________________________________
2794 Bool_t AliConversionPhotonCuts::PsiPairCut(const AliConversionPhotonBase * photon) const {
2796 if (fDo2DPsiPairChi2){
2797 if (abs(photon->GetPsiPair()) < -fPsiPairCut/fChi2CutConversion*photon->GetChi2perNDF() + fPsiPairCut ){
2803 if(abs(photon->GetPsiPair()) > fPsiPairCut){
2809 ///________________________________________________________________________
2810 TString AliConversionPhotonCuts::GetCutNumber(){
2811 // returns TString with current cut number
2813 for(Int_t ii=0;ii<kNCuts;ii++){
2814 a.Append(Form("%d",fCuts[ii]));
2819 ///________________________________________________________________________
2820 void AliConversionPhotonCuts::FillElectonLabelArray(AliAODConversionPhoton* photon, Int_t nV0){
2822 Int_t posLabel = photon->GetTrackLabelPositive();
2823 Int_t negLabel = photon->GetTrackLabelNegative();
2825 fElectronLabelArray[nV0*2] = posLabel;
2826 fElectronLabelArray[(nV0*2)+1] = negLabel;
2828 ///________________________________________________________________________
2829 Bool_t AliConversionPhotonCuts::RejectSharedElectronV0s(AliAODConversionPhoton* photon, Int_t nV0, Int_t nV0s){
2831 Int_t posLabel = photon->GetTrackLabelPositive();
2832 Int_t negLabel = photon->GetTrackLabelNegative();
2834 for(Int_t i = 0; i<nV0s*2;i++){
2835 if(i==nV0*2) continue;
2836 if(i==(nV0*2)+1) continue;
2837 if(fElectronLabelArray[i] == posLabel){
2839 if(fElectronLabelArray[i] == negLabel){
2846 ///________________________________________________________________________
2847 Bool_t AliConversionPhotonCuts::RejectToCloseV0s(AliAODConversionPhoton* photon, TList *photons, Int_t nV0){
2850 Double_t posX = photon->GetConversionX();
2851 Double_t posY = photon->GetConversionY();
2852 Double_t posZ = photon->GetConversionZ();
2854 for(Int_t i = 0;i<photons->GetEntries();i++){
2855 if(nV0 == i) continue;
2856 AliAODConversionPhoton *photonComp = (AliAODConversionPhoton*) photons->At(i);
2857 Double_t posCompX = photonComp->GetConversionX();
2858 Double_t posCompY = photonComp->GetConversionY();
2859 Double_t posCompZ = photonComp->GetConversionZ();
2861 Double_t dist = pow((posX - posCompX),2)+pow((posY - posCompY),2)+pow((posZ - posCompZ),2);
2863 if(dist < fminV0Dist*fminV0Dist){
2864 if(photon->GetChi2perNDF() < photonComp->GetChi2perNDF()) return kTRUE;
2874 ///________________________________________________________________________
2875 AliConversionPhotonCuts* AliConversionPhotonCuts::GetStandardCuts2010PbPb(){
2876 //Create and return standard 2010 PbPb cuts
2877 AliConversionPhotonCuts *cuts=new AliConversionPhotonCuts("StandardCuts2010PbPb","StandardCuts2010PbPb");
2878 if(!cuts->InitializeCutsFromCutString("04209297002322000000")){
2879 cout<<"Warning: Initialization of Standardcuts2010PbPb failed"<<endl;}
2883 ///________________________________________________________________________
2884 AliConversionPhotonCuts* AliConversionPhotonCuts::GetStandardCuts2010pp(){
2885 //Create and return standard 2010 PbPb cuts
2886 AliConversionPhotonCuts *cuts=new AliConversionPhotonCuts("StandardCuts2010pp","StandardCuts2010pp");
2887 if(!cuts->InitializeCutsFromCutString("00209366300380000000")){
2888 cout<<"Warning: Initialization of Standardcuts2010pp failed"<<endl;}
2892 ///________________________________________________________________________
2893 Bool_t AliConversionPhotonCuts::InPlaneOutOfPlaneCut(Double_t photonPhi, Double_t eventPlaneAngle, Bool_t fill){
2895 //GetPhotonPhi() 0-2 Pi //eventPlaneAngle -1pi-1pi
2896 eventPlaneAngle=eventPlaneAngle+TMath::Pi();
2897 Double_t gammaToEPAngle = eventPlaneAngle-photonPhi;
2898 if(gammaToEPAngle < 0) gammaToEPAngle=gammaToEPAngle+2*TMath::Pi();
2899 gammaToEPAngle = gammaToEPAngle-TMath::Pi(); // angle from -pi +pi
2901 if(!fInPlaneOutOfPlane){
2902 if(fill&&hEventPlanePhi)hEventPlanePhi->Fill(gammaToEPAngle);
2905 else if(fInPlaneOutOfPlane == 1){
2906 if(abs(gammaToEPAngle)<=0.25*TMath::Pi() || abs(gammaToEPAngle)>=0.75*TMath::Pi()){
2907 if(fill&&hEventPlanePhi)hEventPlanePhi->Fill(gammaToEPAngle);
2912 else if(fInPlaneOutOfPlane == 2){
2913 if(abs(gammaToEPAngle)>0.25*TMath::Pi() && abs(gammaToEPAngle)<0.75*TMath::Pi()){
2914 if(fill&&hEventPlanePhi)hEventPlanePhi->Fill(gammaToEPAngle);
2922 ///________________________________________________________________________
2923 UChar_t AliConversionPhotonCuts::DeterminePhotonQualityAOD(AliAODConversionPhoton* photon, AliVEvent* eventDummy){
2925 AliAODTrack * negTrack = static_cast<AliAODTrack*>(GetTrack(eventDummy, photon->GetTrackLabelNegative()));
2926 AliAODTrack * posTrack = static_cast<AliAODTrack*>(GetTrack(eventDummy, photon->GetTrackLabelPositive()));
2928 if(!negTrack || !posTrack) {
2931 if(negTrack->Charge() == posTrack->Charge()){
2934 Int_t nClusterITSneg = negTrack->GetITSNcls();
2935 Int_t nClusterITSpos = posTrack->GetITSNcls();
2936 // cout << nClusterITSneg << "\t" << nClusterITSpos <<endl;
2938 if (nClusterITSneg > 1 && nClusterITSpos > 1){
2940 } else if (nClusterITSneg > 1 || nClusterITSpos > 1){