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( photon->GetPhotonPhi() > fMinPhiCut && photon->GetPhotonPhi() < fMaxPhiCut ) {
966 if(hAcceptanceCuts)hAcceptanceCuts->Fill(cutIndex);
975 if(photon->GetPhotonPt()<fPtCut){
976 if(hAcceptanceCuts)hAcceptanceCuts->Fill(cutIndex);
981 if(hAcceptanceCuts)hAcceptanceCuts->Fill(cutIndex);
987 ///________________________________________________________________________
988 Bool_t AliConversionPhotonCuts::SpecificTrackCuts(AliAODTrack * negTrack, AliAODTrack * posTrack,Int_t &cutIndex) {
989 // Track Cuts which require AOD/ESD specific implementation
991 if( !negTrack->IsOn(AliESDtrack::kTPCrefit) || !posTrack->IsOn(AliESDtrack::kTPCrefit) ) {
992 if(hTrackCuts)hTrackCuts->Fill(cutIndex);
997 AliAODVertex * NegVtxType=negTrack->GetProdVertex();
998 AliAODVertex * PosVtxType=posTrack->GetProdVertex();
999 if( (NegVtxType->GetType())==AliAODVertex::kKink || (PosVtxType->GetType())==AliAODVertex::kKink) {
1000 if(hTrackCuts)hTrackCuts->Fill(cutIndex);
1008 ///________________________________________________________________________
1009 Bool_t AliConversionPhotonCuts::SpecificTrackCuts(AliESDtrack * negTrack, AliESDtrack * posTrack,Int_t &cutIndex) {
1010 // Track Cuts which require AOD/ESD specific implementation
1012 if( !negTrack->IsOn(AliESDtrack::kTPCrefit) || !posTrack->IsOn(AliESDtrack::kTPCrefit) ) {
1013 if(hTrackCuts)hTrackCuts->Fill(cutIndex);
1018 if(negTrack->GetKinkIndex(0) > 0 || posTrack->GetKinkIndex(0) > 0 ) {
1019 if(hTrackCuts)hTrackCuts->Fill(cutIndex);
1027 ///________________________________________________________________________
1028 Bool_t AliConversionPhotonCuts::TracksAreSelected(AliVTrack * negTrack, AliVTrack * posTrack) {
1029 // Track Selection for Photon Reconstruction
1032 if(hTrackCuts)hTrackCuts->Fill(cutIndex);
1036 if(negTrack->Charge() == posTrack->Charge()) {
1037 if(hTrackCuts)hTrackCuts->Fill(cutIndex);
1042 // Number of TPC Clusters
1045 if( negTrack->GetNcls(1) < fMinClsTPC || posTrack->GetNcls(1) < fMinClsTPC ) {
1046 if(hTrackCuts)hTrackCuts->Fill(cutIndex);
1052 if( posTrack->Eta() > (fEtaCut) || posTrack->Eta() < (-fEtaCut) ||
1053 negTrack->Eta() > (fEtaCut) || negTrack->Eta() < (-fEtaCut) ){
1054 if(hTrackCuts)hTrackCuts->Fill(cutIndex);
1057 if(fEtaCutMin>-0.1){
1058 if( (posTrack->Eta() < (fEtaCutMin) && posTrack->Eta() > (-fEtaCutMin)) ||
1059 (negTrack->Eta() < (fEtaCutMin) && negTrack->Eta() > (-fEtaCutMin)) ){
1060 if(hTrackCuts)hTrackCuts->Fill(cutIndex);
1067 if( negTrack->Pt()< fSinglePtCut || posTrack->Pt()< fSinglePtCut){
1068 if(hTrackCuts)hTrackCuts->Fill(cutIndex);
1073 // AOD ESD specific cuts
1074 Bool_t passCuts = kTRUE;
1076 if(negTrack->IsA()==AliAODTrack::Class()) {
1077 passCuts = passCuts * SpecificTrackCuts(static_cast<AliAODTrack*>(negTrack), static_cast<AliAODTrack*>(posTrack),cutIndex);
1079 passCuts = passCuts * SpecificTrackCuts(static_cast<AliESDtrack*>(negTrack), static_cast<AliESDtrack*>(posTrack),cutIndex);
1083 if(hTrackCuts)hTrackCuts->Fill(cutIndex);
1088 if(hTrackCuts)hTrackCuts->Fill(cutIndex);
1094 ///________________________________________________________________________
1095 Bool_t AliConversionPhotonCuts::dEdxCuts(AliVTrack *fCurrentTrack){
1096 // Electron Identification Cuts for Photon reconstruction
1097 if(!fPIDResponse){InitPIDResponse();}// Try to reinitialize PID Response
1098 if(!fPIDResponse){AliError("No PID Response"); return kTRUE;}// if still missing fatal error
1101 if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);
1102 if(hTPCdEdxSigbefore)hTPCdEdxSigbefore->Fill(fCurrentTrack->P(),fPIDResponse->NumberOfSigmasTPC(fCurrentTrack, AliPID::kElectron));
1103 if(hTPCdEdxbefore)hTPCdEdxbefore->Fill(fCurrentTrack->P(),fCurrentTrack->GetTPCsignal());
1106 if(fDodEdxSigmaCut == kTRUE){
1107 // TPC Electron Line
1108 if( fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kElectron)<fPIDnSigmaBelowElectronLine ||
1109 fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kElectron)>fPIDnSigmaAboveElectronLine){
1111 if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);
1117 if( fCurrentTrack->P()>fPIDMinPnSigmaAbovePionLine && fCurrentTrack->P()<fPIDMaxPnSigmaAbovePionLine ){
1118 if(fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kElectron)>fPIDnSigmaBelowElectronLine &&
1119 fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kElectron)<fPIDnSigmaAboveElectronLine&&
1120 fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kPion)<fPIDnSigmaAbovePionLine){
1122 if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);
1129 if( fCurrentTrack->P()>fPIDMaxPnSigmaAbovePionLine ){
1130 if(fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kElectron)>fPIDnSigmaBelowElectronLine &&
1131 fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kElectron)<fPIDnSigmaAboveElectronLine &&
1132 fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kPion)<fPIDnSigmaAbovePionLineHighPt){
1134 if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);
1142 if(fDoKaonRejectionLowP == kTRUE){
1143 if(fCurrentTrack->P()<fPIDMinPKaonRejectionLowP ){
1144 if( abs(fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kKaon))<fPIDnSigmaAtLowPAroundKaonLine){
1146 if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);
1152 if(fDoProtonRejectionLowP == kTRUE){
1153 if( fCurrentTrack->P()<fPIDMinPProtonRejectionLowP ){
1154 if( abs(fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kProton))<fPIDnSigmaAtLowPAroundProtonLine){
1156 if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);
1163 if(fDoPionRejectionLowP == kTRUE){
1164 if( fCurrentTrack->P()<fPIDMinPPionRejectionLowP ){
1165 if( abs(fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kPion))<fPIDnSigmaAtLowPAroundPionLine){
1167 if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);
1175 // cout<<"Start"<<endl;
1176 // AliPIDResponse::EDetPidStatus status=fPIDResponse->CheckPIDStatus(AliPIDResponse::kTOF,fCurrentTrack);
1178 // if( ( (status & AliVTrack::kTOFout) == AliVTrack::kTOFout ) && ( (status & AliVTrack::kTIME) == AliVTrack::kTIME ))
1179 // {cout<<"TOF DA"<<endl;}
1180 // if(status == AliPIDResponse::kDetPidOk){
1181 // Float_t probMis = fPIDResponse->GetTOFMismatchProbability(fCurrentTrack);
1182 // cout<<"--> "<<probMis<<endl;
1183 // if(probMis > 0.01){
1188 if((fCurrentTrack->GetStatus() & AliESDtrack::kTOFpid) && !(fCurrentTrack->GetStatus() & AliESDtrack::kTOFmismatch)){
1190 Double_t t0 = fPIDResponse->GetTOFResponse().GetStartTime(fCurrentTrack->P());
1191 Double_t times[AliPID::kSPECIESC];
1192 fCurrentTrack->GetIntegratedTimes(times);
1193 Double_t TOFsignal = fCurrentTrack->GetTOFsignal();
1194 Double_t dT = TOFsignal - t0 - times[0];
1195 hTOFbefore->Fill(fCurrentTrack->P(),dT);
1197 if(hTOFSigbefore) hTOFSigbefore->Fill(fCurrentTrack->P(),fPIDResponse->NumberOfSigmasTOF(fCurrentTrack, AliPID::kElectron));
1199 if(fPIDResponse->NumberOfSigmasTOF(fCurrentTrack, AliPID::kElectron)>fTofPIDnSigmaAboveElectronLine ||
1200 fPIDResponse->NumberOfSigmasTOF(fCurrentTrack, AliPID::kElectron)<fTofPIDnSigmaBelowElectronLine ){
1201 if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);
1205 if(hTOFSigafter)hTOFSigafter->Fill(fCurrentTrack->P(),fPIDResponse->NumberOfSigmasTOF(fCurrentTrack, AliPID::kElectron));
1210 if(!fPIDResponse->IdentifiedAsElectronTRD(fCurrentTrack,fPIDTRDEfficiency)){
1211 if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);
1217 if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);
1218 if(hTPCdEdxSigafter)hTPCdEdxSigafter->Fill(fCurrentTrack->P(),fPIDResponse->NumberOfSigmasTPC(fCurrentTrack, AliPID::kElectron));
1219 if(hTPCdEdxafter)hTPCdEdxafter->Fill(fCurrentTrack->P(),fCurrentTrack->GetTPCsignal());
1224 ///________________________________________________________________________
1225 Bool_t AliConversionPhotonCuts::AsymmetryCut(AliConversionPhotonBase * photon,AliVEvent *event) {
1226 // Cut on Energy Assymetry
1228 for(Int_t ii=0;ii<2;ii++){
1230 AliVTrack *track=GetTrack(event,photon->GetTrackLabel(ii));
1232 if( track->P() > fMinPPhotonAsymmetryCut ){
1233 Double_t trackNegAsy=0;
1234 if (photon->GetPhotonP()!=0.){
1235 trackNegAsy= track->P()/photon->GetPhotonP();
1238 if( trackNegAsy<fMinPhotonAsymmetry ||trackNegAsy>(1.- fMinPhotonAsymmetry)){
1247 ///________________________________________________________________________
1248 AliVTrack *AliConversionPhotonCuts::GetTrack(AliVEvent * event, Int_t label){
1249 //Returns pointer to the track with given ESD label
1250 //(Important for AOD implementation, since Track array in AOD data is different
1251 //from ESD array, but ESD tracklabels are stored in AOD Tracks)
1253 AliESDEvent * esdEvent = dynamic_cast<AliESDEvent*>(event);
1255 if(label > event->GetNumberOfTracks() ) return NULL;
1256 AliESDtrack * track = esdEvent->GetTrack(label);
1260 AliVTrack * track = 0x0;
1261 if(((AliV0ReaderV1*)AliAnalysisManager::GetAnalysisManager()->GetTask("V0ReaderV1"))->AreAODsRelabeled()){
1262 track = dynamic_cast<AliVTrack*>(event->GetTrack(label));
1266 for(Int_t ii=0; ii<event->GetNumberOfTracks(); ii++) {
1267 track = dynamic_cast<AliVTrack*>(event->GetTrack(ii));
1269 if(track->GetID() == label) {
1276 //AliDebug(5,(Form("track not found %d %d",label,event->GetNumberOfTracks()));
1280 ///________________________________________________________________________
1281 AliESDtrack *AliConversionPhotonCuts::GetESDTrack(AliESDEvent * event, Int_t label){
1282 //Returns pointer to the track with given ESD label
1283 //(Important for AOD implementation, since Track array in AOD data is different
1284 //from ESD array, but ESD tracklabels are stored in AOD Tracks)
1287 if(label > event->GetNumberOfTracks() ) return NULL;
1288 AliESDtrack * track = event->GetTrack(label);
1291 //AliDebug(5,(Form("track not found %d %d",label,event->GetNumberOfTracks()));
1297 ///________________________________________________________________________
1298 Bool_t AliConversionPhotonCuts::PIDProbabilityCut(AliConversionPhotonBase *photon, AliVEvent * event){
1299 // Cut on Electron Probability for Photon Reconstruction
1301 AliESDEvent * esdEvent = dynamic_cast<AliESDEvent*>(event);
1305 Bool_t iResult=kFALSE;
1307 Double_t *posProbArray = new Double_t[AliPID::kSPECIES];
1308 Double_t *negProbArray = new Double_t[AliPID::kSPECIES];
1310 AliESDtrack* negTrack = esdEvent->GetTrack(photon->GetTrackLabelNegative());
1311 AliESDtrack* posTrack = esdEvent->GetTrack(photon->GetTrackLabelPositive());
1313 if(negProbArray && posProbArray){
1315 negTrack->GetTPCpid(negProbArray);
1316 posTrack->GetTPCpid(posProbArray);
1318 if(negProbArray[AliPID::kElectron]>=fPIDProbabilityCutNegativeParticle && posProbArray[AliPID::kElectron]>=fPIDProbabilityCutPositiveParticle){
1323 delete [] posProbArray;
1324 delete [] negProbArray;
1328 ///Not possible for AODs
1334 ///________________________________________________________________________
1335 Bool_t AliConversionPhotonCuts::AcceptanceCut(TParticle *particle, TParticle * ePos,TParticle* eNeg){
1336 // MC Acceptance Cuts
1337 //(Certain areas were excluded for photon reconstruction)
1339 if(particle->R()>fMaxR){
1342 if(ePos->R()>fMaxR){
1346 if(ePos->R()<fMinR){
1350 if( ePos->R() <= ((abs(ePos->Vz())*fLineCutZRSlope)-fLineCutZValue)){
1353 else if (fUseEtaMinCut && ePos->R() >= ((abs(ePos->Vz())*fLineCutZRSlopeMin)-fLineCutZValueMin )){
1357 if(abs(eNeg->Vz()) > fMaxZ ){ // cuts out regions where we do not reconstruct
1361 if(eNeg->Vz()!=ePos->Vz()||eNeg->R()!=ePos->R()){
1365 if(abs(ePos->Vz()) > fMaxZ ){ // cuts out regions where we do not reconstruct
1370 if( particle->Eta() > (fEtaCut) || particle->Eta() < (-fEtaCut) ){
1373 if( ePos->Eta() > (fEtaCut) || ePos->Eta() < (-fEtaCut) ){
1376 if( eNeg->Eta() > (fEtaCut) || eNeg->Eta() < (-fEtaCut) ){
1379 if(fEtaCutMin>-0.1){
1380 if( particle->Eta() < (fEtaCutMin) && particle->Eta() > (-fEtaCutMin) ){
1383 if( ePos->Eta() < (fEtaCutMin) && ePos->Eta() > (-fEtaCutMin) ){
1386 if( eNeg->Eta() < (fEtaCutMin) && eNeg->Eta() > (-fEtaCutMin) ){
1391 if( ePos->Pt()< fSinglePtCut || eNeg->Pt()< fSinglePtCut){
1395 if(particle->Pt()<fPtCut){
1401 ///________________________________________________________________________
1402 Bool_t AliConversionPhotonCuts::UpdateCutString() {
1403 ///Update the cut string (if it has been created yet)
1405 if(fCutString && fCutString->GetString().Length() == kNCuts) {
1406 fCutString->SetString(GetCutNumber());
1414 ///________________________________________________________________________
1415 Bool_t AliConversionPhotonCuts::InitializeCutsFromCutString(const TString analysisCutSelection ) {
1416 // Initialize Cuts from a given Cut string
1417 AliInfo(Form("Set Photoncut Number: %s",analysisCutSelection.Data()));
1418 if(analysisCutSelection.Length()!=kNCuts) {
1419 AliError(Form("Cut selection has the wrong length! size is %d, number of cuts is %d", analysisCutSelection.Length(), kNCuts));
1422 if(!analysisCutSelection.IsDigit()){
1423 AliError("Cut selection contains characters");
1427 const char *cutSelection = analysisCutSelection.Data();
1428 #define ASSIGNARRAY(i) fCuts[i] = cutSelection[i] - '0'
1429 for(Int_t ii=0;ii<kNCuts;ii++){
1433 // Set Individual Cuts
1434 for(Int_t ii=0;ii<kNCuts;ii++){
1435 if(!SetCut(cutIds(ii),fCuts[ii]))return kFALSE;
1438 PrintCutsWithValues();
1442 ///________________________________________________________________________
1443 Bool_t AliConversionPhotonCuts::SetCut(cutIds cutID, const Int_t value) {
1444 ///Set individual cut ID
1449 if( SetV0Finder(value)) {
1450 fCuts[kv0FinderType] = value;
1453 } else return kFALSE;
1456 if( SetEtaCut(value)) {
1457 fCuts[ketaCut] = value;
1460 } else return kFALSE;
1463 if( SetRCut(value)) {
1464 fCuts[kRCut] = value;
1467 } else return kFALSE;
1469 case kEtaForPhiSector:
1470 if( SetEtaForPhiCut(value)) {
1471 fCuts[kEtaForPhiSector] = value;
1474 } else return kFALSE;
1476 if( SetMinPhiSectorCut(value)) {
1477 fCuts[kMinPhiSector] = value;
1480 } else return kFALSE;
1482 if( SetMaxPhiSectorCut(value)) {
1483 fCuts[kMaxPhiSector] = value;
1486 } else return kFALSE;
1489 if( SetSinglePtCut(value)) {
1490 fCuts[ksinglePtCut] = value;
1493 } else return kFALSE;
1496 if( SetTPCClusterCut(value)) {
1497 fCuts[kclsTPCCut] = value;
1500 } else return kFALSE;
1502 case kededxSigmaCut:
1503 if( SetTPCdEdxCutElectronLine(value)) {
1504 fCuts[kededxSigmaCut] = value;
1507 } else return kFALSE;
1509 case kpidedxSigmaCut:
1510 if( SetTPCdEdxCutPionLine(value)) {
1511 fCuts[kpidedxSigmaCut] = value;
1514 } else return kFALSE;
1516 case kpiMomdedxSigmaCut:
1517 if( SetMinMomPiondEdxCut(value)) {
1518 fCuts[kpiMomdedxSigmaCut] = value;
1521 } else return kFALSE;
1523 case kpiMaxMomdedxSigmaCut:
1524 if( SetMaxMomPiondEdxCut(value)) {
1525 fCuts[kpiMaxMomdedxSigmaCut] = value;
1528 } else return kFALSE;
1530 case kLowPRejectionSigmaCut:
1531 if( SetLowPRejectionCuts(value)) {
1532 fCuts[kLowPRejectionSigmaCut] = value;
1535 } else return kFALSE;
1537 case kTOFelectronPID:
1538 if( SetTOFElectronPIDCut(value)) {
1539 fCuts[kTOFelectronPID] = value;
1542 } else return kFALSE;
1545 if( SetQtMaxCut(value)) {
1546 fCuts[kQtMaxCut] = value;
1549 } else return kFALSE;
1553 if( SetChi2GammaCut(value)) {
1554 fCuts[kchi2GammaCut] = value;
1557 } else return kFALSE;
1560 if( SetPsiPairCut(value)) {
1561 fCuts[kPsiPair] = value;
1564 } else return kFALSE;
1566 case kdoPhotonAsymmetryCut:
1567 if( SetPhotonAsymmetryCut(value)) {
1568 fCuts[kdoPhotonAsymmetryCut] = value;
1571 } else return kFALSE;
1574 if( SetCosPAngleCut(value)) {
1575 fCuts[kCosPAngle] = value;
1578 } else return kFALSE;
1581 if( SetSharedElectronCut(value)) {
1582 fCuts[kElecShare] = value;
1585 } else return kFALSE;
1588 if( SetToCloseV0sCut(value)) {
1589 fCuts[kToCloseV0s] = value;
1592 } else return kFALSE;
1595 if( SetDCARPhotonPrimVtxCut(value)) {
1596 fCuts[kDcaRPrimVtx] = value;
1599 } else return kFALSE;
1602 if( SetDCAZPhotonPrimVtxCut(value)) {
1603 fCuts[kDcaZPrimVtx] = value;
1606 } else return kFALSE;
1608 case kInPlaneOutOfPlane:
1609 if( SetInPlaneOutOfPlane(value)) {
1610 fCuts[kInPlaneOutOfPlane] = value;
1613 } else return kFALSE;
1616 AliError("Cut id out of range");
1620 AliError("Cut id %d not recognized");
1625 ///________________________________________________________________________
1626 void AliConversionPhotonCuts::PrintCuts() {
1627 // Print out current Cut Selection
1628 for(Int_t ic = 0; ic < kNCuts; ic++) {
1629 printf("%-30s : %d \n", fgkCutNames[ic], fCuts[ic]);
1633 void AliConversionPhotonCuts::PrintCutsWithValues() {
1634 // Print out current Cut Selection with value
1635 printf("\nConversion cutnumber \n");
1636 for(Int_t ic = 0; ic < kNCuts; ic++) {
1637 printf("%d",fCuts[ic]);
1640 printf("Electron cuts & Secondary Track Cuts - only track from secondaries enter analysis: \n");
1641 printf("\t no like sign pairs from V0s \n");
1642 if (!fUseCorrectedTPCClsInfo) printf("\t # TPC clusters > %3.2f \n", fMinClsTPC);
1643 if (fEtaCutMin > -0.1) printf("\t %3.2f < eta_{e} < %3.2f\n", fEtaCutMin, fEtaCut );
1644 else printf("\t eta_{e} < %3.2f\n", fEtaCut );
1645 printf("\t reject: %3.2f < phi < %3.2f with %3.2f < eta < %3.2f \n", fMinPhiCut, fMaxPhiCut, fEtaForPhiCutMin, fEtaForPhiCutMax);
1646 printf("\t p_{T,e} > %3.2f\n", fSinglePtCut );
1647 printf("\t TPC refit \n");
1648 printf("\t no kinks \n");
1649 printf("\t accept: %3.2f < n sigma_{e,TPC} < %3.2f\n", fPIDnSigmaBelowElectronLine, fPIDnSigmaAboveElectronLine );
1650 printf("\t reject: %3.2f < p_{e,T} < %3.2f, n sigma_{pi,TPC} < %3.2f\n", fPIDMinPnSigmaAbovePionLine, fPIDMaxPnSigmaAbovePionLine, fPIDnSigmaAbovePionLine );
1651 printf("\t reject: p_{e,T} > %3.2f, n sigma_{pi,TPC} < %3.2f\n", fPIDMaxPnSigmaAbovePionLine, fPIDnSigmaAbovePionLineHighPt );
1652 if (fDoPionRejectionLowP) printf("\t reject: p_{e,T} < %3.2f, -%3.2f < n sigma_{pi,TPC} < %3.2f\n", fPIDMinPPionRejectionLowP, fPIDnSigmaAtLowPAroundPionLine, fPIDnSigmaAtLowPAroundPionLine );
1653 if (fDoKaonRejectionLowP) printf("\t reject: -%3.2f < n sigma_{K,TPC} < %3.2f\n", fPIDnSigmaAtLowPAroundKaonLine, fPIDnSigmaAtLowPAroundKaonLine );
1654 if (fDoProtonRejectionLowP) printf("\t reject: -%3.2f < n sigma_{K,TPC} < %3.2f\n", fPIDnSigmaAtLowPAroundProtonLine, fPIDnSigmaAtLowPAroundProtonLine );
1655 if (fUseTOFpid) printf("\t accept: %3.2f < n sigma_{e,TOF} < %3.2f\n", fTofPIDnSigmaBelowElectronLine, fTofPIDnSigmaAboveElectronLine);
1657 printf("Photon cuts: \n");
1658 if (fUseOnFlyV0Finder) printf("\t using Onfly V0 finder \n");
1659 else printf("\t using Offline V0 finder \n");
1661 printf("\t 2 dimensional q_{T} cut applied with maximum of %3.2f \n", fQtMax );
1663 printf("\t 1 dimensional q_{T} cut applied with maximum of %3.2f \n", fQtMax );
1665 if (fDo2DPsiPairChi2){
1666 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 );
1668 printf("\t chi^{2} max cut chi^{2} < %3.2f \n", fChi2CutConversion );
1669 printf("\t psi_{pair} max cut |psi_{pair}| < %3.2f \n", fPsiPairCut );
1671 printf("\t %3.2f < R_{conv} < %3.2f\n", fMinR, fMaxR );
1672 printf("\t Z_{conv} < %3.2f\n", fMaxZ );
1673 if (fEtaCutMin > -0.1) printf("\t %3.2f < eta_{conv} < %3.2f\n", fEtaCutMin, fEtaCut );
1674 else printf("\t eta_{conv} < %3.2f\n", fEtaCut );
1675 if (fDoPhotonAsymmetryCut) printf("\t for p_{T,track} > %3.2f, A_{gamma} < %3.2f \n", fMinPPhotonAsymmetryCut, fMinPhotonAsymmetry );
1676 if (fUseCorrectedTPCClsInfo) printf("\t #cluster TPC/ #findable clusters TPC (corrected for radius) > %3.2f\n", fMinClsTPCToF );
1677 printf("\t p_{T,gamma} > %3.2f\n", fPtCut );
1678 printf("\t cos(Theta_{point}) > %3.2f \n", fCosPAngleCut );
1679 printf("\t dca_{R} < %3.2f \n", fDCARPrimVtxCut );
1680 printf("\t dca_{Z} < %3.2f \n", fDCAZPrimVtxCut );
1681 if (fDoPhotonQualitySelectionCut) printf("\t selection based on photon quality with quality %d \n", fPhotonQualityCut );
1684 ///________________________________________________________________________
1685 Bool_t AliConversionPhotonCuts::SetV0Finder(Int_t v0FinderType)
1687 switch (v0FinderType){
1688 case 0: // on fly V0 finder
1689 cout << "have chosen onfly V0" << endl;
1690 fUseOnFlyV0Finder=kTRUE;
1692 case 1: // offline V0 finder
1693 cout << "have chosen offline V0" << endl;
1694 fUseOnFlyV0Finder=kFALSE;
1697 AliError(Form(" v0FinderType not defined %d",v0FinderType));
1703 ///________________________________________________________________________
1704 Bool_t AliConversionPhotonCuts::SetEtaCut(Int_t etaCut)
1707 //Set Standard LineCutZValues
1708 fLineCutZValueMin = -2;
1709 fLineCutZValue = 7.;
1714 fLineCutZRSlope = tan(2*atan(exp(-fEtaCut)));
1716 fLineCutZRSlopeMin = 0.;
1718 case 1: // 0.6 // changed from 1.2 to 0.6 on 2013.06.10
1720 fLineCutZRSlope = tan(2*atan(exp(-fEtaCut)));
1722 fLineCutZRSlopeMin = 0.;
1726 fLineCutZRSlope = tan(2*atan(exp(-fEtaCut)));
1728 fLineCutZRSlopeMin = 0.;
1732 fLineCutZRSlope = tan(2*atan(exp(-fEtaCut)));
1734 fLineCutZRSlopeMin = 0.;
1738 fLineCutZRSlope = tan(2*atan(exp(-fEtaCut)));
1740 fLineCutZRSlopeMin = 0.;
1744 fLineCutZRSlope = tan(2*atan(exp(-fEtaCut)));
1746 fLineCutZRSlopeMin = 0.;
1750 fLineCutZRSlope = tan(2*atan(exp(-fEtaCut)));
1752 fLineCutZRSlopeMin = 0.;
1755 if (fIsHeavyIon==1){
1757 fLineCutZRSlope = tan(2*atan(exp(-fEtaCut)));
1759 fLineCutZRSlopeMin = 0.;
1763 fLineCutZRSlope = tan(2*atan(exp(-fEtaCut)));
1765 fLineCutZRSlopeMin = 0.;
1768 // case 8: // 0.1 - 0.8
1770 // fLineCutZRSlope = tan(2*atan(exp(-fEtaCut)));
1771 // fEtaCutMin = 0.1;
1772 // fLineCutZRSlopeMin = tan(2*atan(exp(-fEtaCutMin)));
1776 fLineCutZRSlope = tan(2*atan(exp(-fEtaCut)));
1778 fLineCutZRSlopeMin = 0.;
1782 fLineCutZRSlope = tan(2*atan(exp(-fEtaCut)));
1784 fLineCutZRSlopeMin = 0.;
1787 AliError(Form(" EtaCut not defined %d",etaCut));
1793 ///________________________________________________________________________
1794 Bool_t AliConversionPhotonCuts::SetRCut(Int_t RCut){
1827 fMinR = 35.; //old 26.
1839 AliError("RCut not defined");
1845 ///________________________________________________________________________
1846 Bool_t AliConversionPhotonCuts::SetEtaForPhiCut(Int_t etaPhiCut) {
1849 case 0: //no specific eta range selected, full eta range
1850 fEtaForPhiCutMin = -fEtaCut;
1851 fEtaForPhiCutMax = fEtaCut;
1853 case 1: //eta < 0 only
1854 if (!fDoShrinkTPCAcceptance) fDoShrinkTPCAcceptance = kTRUE;
1855 fEtaForPhiCutMin = -fEtaCut;
1856 fEtaForPhiCutMax = 0.;
1858 case 2://eta > 0 only
1859 if (!fDoShrinkTPCAcceptance) fDoShrinkTPCAcceptance = kTRUE;
1860 fEtaForPhiCutMin = 0.;
1861 fEtaForPhiCutMax = fEtaCut;
1864 AliError(Form("EtaForPhiCut not defined %d",etaPhiCut));
1871 ///________________________________________________________________________
1872 Bool_t AliConversionPhotonCuts::SetMinPhiSectorCut(Int_t minPhiCut) {
1876 fMinPhiCut = 6.3; //no cut on phi
1879 if (!fDoShrinkTPCAcceptance) fDoShrinkTPCAcceptance = kTRUE;
1880 fMinPhiCut = 1.7; //OROC C08
1883 if (!fDoShrinkTPCAcceptance) fDoShrinkTPCAcceptance = kTRUE;
1884 fMinPhiCut = 4.4; //EMCal
1887 if (!fDoShrinkTPCAcceptance) fDoShrinkTPCAcceptance = kTRUE;
1888 fMinPhiCut = 1.0; //PHOS
1891 AliError(Form("MinPhiCut not defined %d",minPhiCut));
1898 ///________________________________________________________________________
1899 Bool_t AliConversionPhotonCuts::SetMaxPhiSectorCut(Int_t maxPhiCut) {
1903 fMaxPhiCut = 0.; //no cut
1906 if (!fDoShrinkTPCAcceptance) fDoShrinkTPCAcceptance = kTRUE;
1907 fMaxPhiCut = 4.3; //OROC C08
1910 if (!fDoShrinkTPCAcceptance) fDoShrinkTPCAcceptance = kTRUE;
1911 fMaxPhiCut = 5.8; //EMCal
1914 if (!fDoShrinkTPCAcceptance) fDoShrinkTPCAcceptance = kTRUE;
1915 fMaxPhiCut = 3.0; //PHOS
1918 AliError(Form("MaxPhiCut not defined %d",maxPhiCut));
1926 ///________________________________________________________________________
1927 Bool_t AliConversionPhotonCuts::SetSinglePtCut(Int_t singlePtCut)
1929 switch(singlePtCut){
1930 case 0: // 0.050 GeV
1931 fSinglePtCut = 0.050;
1933 case 1: // 0.100 GeV
1934 fSinglePtCut = 0.100;
1936 case 2: // 0.150 GeV
1937 fSinglePtCut = 0.150;
1939 case 3: // 0.200 GeV
1940 fSinglePtCut = 0.200;
1942 case 4: // 0.075 GeV
1943 fSinglePtCut = 0.075;
1945 case 5: // 0.125 GeV
1946 fSinglePtCut = 0.125;
1949 fSinglePtCut = 0.040;
1955 AliError(Form("singlePtCut not defined %d",singlePtCut));
1961 ///________________________________________________________________________
1962 Bool_t AliConversionPhotonCuts::SetTPCClusterCut(Int_t clsTPCCut)
1977 case 4: // 95% of findable clusters
1978 fMinClsTPCToF= 0.95;
1979 fUseCorrectedTPCClsInfo=1;
1981 case 5: // 0% of findable clusters
1983 fUseCorrectedTPCClsInfo=1;
1985 case 6: // 70% of findable clusters
1987 fUseCorrectedTPCClsInfo=1;
1989 case 7: // 0% of findable clusters
1990 fMinClsTPCToF= 0.35;
1991 fUseCorrectedTPCClsInfo=0;
1994 fMinClsTPCToF= 0.35;
1995 fUseCorrectedTPCClsInfo=1;
1999 fUseCorrectedTPCClsInfo=1;
2002 AliError(Form("Warning: clsTPCCut not defined %d",clsTPCCut));
2008 ///________________________________________________________________________
2009 Bool_t AliConversionPhotonCuts::SetTPCdEdxCutElectronLine(Int_t ededxSigmaCut)
2011 switch(ededxSigmaCut){
2013 fPIDnSigmaBelowElectronLine=-10;
2014 fPIDnSigmaAboveElectronLine=10;
2017 fPIDnSigmaBelowElectronLine=-5;
2018 fPIDnSigmaAboveElectronLine=5;
2021 fPIDnSigmaBelowElectronLine=-3;
2022 fPIDnSigmaAboveElectronLine=5;
2025 fPIDnSigmaBelowElectronLine=-4;
2026 fPIDnSigmaAboveElectronLine=5;
2029 fPIDnSigmaBelowElectronLine=-6;
2030 fPIDnSigmaAboveElectronLine=7;
2033 fPIDnSigmaBelowElectronLine=-4;
2034 fPIDnSigmaAboveElectronLine=4;
2037 fPIDnSigmaBelowElectronLine=-2.5;
2038 fPIDnSigmaAboveElectronLine=4;
2041 fPIDnSigmaBelowElectronLine=-2;
2042 fPIDnSigmaAboveElectronLine=3.5;
2045 AliError("TPCdEdxCutElectronLine not defined");
2052 ///________________________________________________________________________
2053 Bool_t AliConversionPhotonCuts::SetTPCdEdxCutPionLine(Int_t pidedxSigmaCut)
2056 switch(pidedxSigmaCut){
2058 fPIDnSigmaAbovePionLine=-10;
2059 fPIDnSigmaAbovePionLineHighPt=-10;
2062 fPIDnSigmaAbovePionLine=0;
2063 fPIDnSigmaAbovePionLineHighPt=-10;
2066 fPIDnSigmaAbovePionLine=1;
2067 fPIDnSigmaAbovePionLineHighPt=-10;
2070 fPIDnSigmaAbovePionLine=2.5;
2071 fPIDnSigmaAbovePionLineHighPt=-10;
2074 fPIDnSigmaAbovePionLine=0.5;
2075 fPIDnSigmaAbovePionLineHighPt=-10;
2078 fPIDnSigmaAbovePionLine=2.;
2079 fPIDnSigmaAbovePionLineHighPt=-10;
2082 fPIDnSigmaAbovePionLine=2.;
2083 fPIDnSigmaAbovePionLineHighPt=0.5;
2086 fPIDnSigmaAbovePionLine=3.5;
2087 fPIDnSigmaAbovePionLineHighPt=-10;
2090 fPIDnSigmaAbovePionLine=2.;
2091 fPIDnSigmaAbovePionLineHighPt=1.;
2094 fPIDnSigmaAbovePionLine=3.0; // We need a bit less tight cut on dE/dx
2095 fPIDnSigmaAbovePionLineHighPt=-10;
2098 AliError(Form("Warning: pidedxSigmaCut not defined %d",pidedxSigmaCut));
2104 ///________________________________________________________________________
2105 Bool_t AliConversionPhotonCuts::SetMinMomPiondEdxCut(Int_t piMomdedxSigmaCut)
2107 switch(piMomdedxSigmaCut){
2109 fPIDMinPnSigmaAbovePionLine=0.5;
2112 fPIDMinPnSigmaAbovePionLine=1.;
2115 fPIDMinPnSigmaAbovePionLine=1.5;
2118 fPIDMinPnSigmaAbovePionLine=20.;
2121 fPIDMinPnSigmaAbovePionLine=50.;
2124 fPIDMinPnSigmaAbovePionLine=0.3;
2127 fPIDMinPnSigmaAbovePionLine=0.25;
2130 fPIDMinPnSigmaAbovePionLine=0.4;
2133 fPIDMinPnSigmaAbovePionLine=0.2;
2136 AliError(Form("piMomdedxSigmaCut not defined %d",piMomdedxSigmaCut));
2142 ///________________________________________________________________________
2143 Bool_t AliConversionPhotonCuts::SetMaxMomPiondEdxCut(Int_t piMaxMomdedxSigmaCut)
2145 switch(piMaxMomdedxSigmaCut){
2147 fPIDMaxPnSigmaAbovePionLine=100.;
2150 fPIDMaxPnSigmaAbovePionLine=5.;
2153 fPIDMaxPnSigmaAbovePionLine=4.;
2156 fPIDMaxPnSigmaAbovePionLine=3.5;
2159 fPIDMaxPnSigmaAbovePionLine=3.;
2162 fPIDMaxPnSigmaAbovePionLine=7.;
2165 AliError(Form("piMaxMomdedxSigmaCut not defined %d",piMaxMomdedxSigmaCut));
2171 ///________________________________________________________________________
2172 Bool_t AliConversionPhotonCuts::SetLowPRejectionCuts(Int_t LowPRejectionSigmaCut)
2174 switch(LowPRejectionSigmaCut){
2176 fPIDnSigmaAtLowPAroundKaonLine=0;
2177 fPIDnSigmaAtLowPAroundProtonLine=0;
2178 fPIDnSigmaAtLowPAroundPionLine=0;
2179 fDoKaonRejectionLowP = kFALSE;
2180 fDoProtonRejectionLowP = kFALSE;
2181 fDoPionRejectionLowP = kFALSE;
2182 fPIDMinPPionRejectionLowP = fPIDMinPnSigmaAbovePionLine;
2185 fPIDnSigmaAtLowPAroundKaonLine=0.5;
2186 fPIDnSigmaAtLowPAroundProtonLine=0.5;
2187 fPIDnSigmaAtLowPAroundPionLine=0.5;
2188 fDoKaonRejectionLowP = kTRUE;
2189 fDoProtonRejectionLowP = kTRUE;
2190 fDoPionRejectionLowP = kTRUE;
2191 fPIDMinPPionRejectionLowP = fPIDMinPnSigmaAbovePionLine;
2194 fPIDnSigmaAtLowPAroundKaonLine=1;
2195 fPIDnSigmaAtLowPAroundProtonLine=1;
2196 fPIDnSigmaAtLowPAroundPionLine=1;
2197 fDoKaonRejectionLowP = kTRUE;
2198 fDoProtonRejectionLowP = kTRUE;
2199 fDoPionRejectionLowP = kTRUE;
2200 fPIDMinPPionRejectionLowP = fPIDMinPnSigmaAbovePionLine;
2203 fPIDnSigmaAtLowPAroundKaonLine=2.;
2204 fPIDnSigmaAtLowPAroundProtonLine=2.;
2205 fPIDnSigmaAtLowPAroundPionLine=2.;
2206 fDoKaonRejectionLowP = kTRUE;
2207 fDoProtonRejectionLowP = kTRUE;
2208 fDoPionRejectionLowP = kTRUE;
2209 fPIDMinPPionRejectionLowP = fPIDMinPnSigmaAbovePionLine;
2212 fPIDnSigmaAtLowPAroundKaonLine=0.;
2213 fPIDnSigmaAtLowPAroundProtonLine=0.;
2214 fPIDnSigmaAtLowPAroundPionLine=1;
2215 fDoKaonRejectionLowP = kFALSE;
2216 fDoProtonRejectionLowP = kFALSE;
2217 fDoPionRejectionLowP = kTRUE;
2218 fPIDMinPPionRejectionLowP = fPIDMinPnSigmaAbovePionLine;
2221 fPIDnSigmaAtLowPAroundKaonLine=0.;
2222 fPIDnSigmaAtLowPAroundProtonLine=0.;
2223 fPIDnSigmaAtLowPAroundPionLine=1.5;
2224 fDoKaonRejectionLowP = kFALSE;
2225 fDoProtonRejectionLowP = kFALSE;
2226 fDoPionRejectionLowP = kTRUE;
2227 fPIDMinPPionRejectionLowP = fPIDMinPnSigmaAbovePionLine;
2230 fPIDnSigmaAtLowPAroundKaonLine=0.;
2231 fPIDnSigmaAtLowPAroundProtonLine=0.;
2232 fPIDnSigmaAtLowPAroundPionLine=2.;
2233 fDoKaonRejectionLowP = kFALSE;
2234 fDoProtonRejectionLowP = kFALSE;
2235 fDoPionRejectionLowP = kTRUE;
2236 fPIDMinPPionRejectionLowP = fPIDMinPnSigmaAbovePionLine;
2239 fPIDnSigmaAtLowPAroundKaonLine=0.;
2240 fPIDnSigmaAtLowPAroundProtonLine=0.;
2241 fPIDnSigmaAtLowPAroundPionLine=0.5;
2242 fDoKaonRejectionLowP = kFALSE;
2243 fDoProtonRejectionLowP = kFALSE;
2244 fDoPionRejectionLowP = kTRUE;
2245 fPIDMinPPionRejectionLowP = fPIDMinPnSigmaAbovePionLine;
2248 AliError(Form("LowPRejectionSigmaCut not defined %d",LowPRejectionSigmaCut));
2254 ///________________________________________________________________________
2255 Bool_t AliConversionPhotonCuts::SetTOFElectronPIDCut(Int_t TOFelectronPID){
2257 switch(TOFelectronPID){
2259 fUseTOFpid = kFALSE;
2260 fTofPIDnSigmaBelowElectronLine=-100;
2261 fTofPIDnSigmaAboveElectronLine=100;
2265 fTofPIDnSigmaBelowElectronLine=-7;
2266 fTofPIDnSigmaAboveElectronLine=7;
2270 fTofPIDnSigmaBelowElectronLine=-5;
2271 fTofPIDnSigmaAboveElectronLine=5;
2275 fTofPIDnSigmaBelowElectronLine=-3;
2276 fTofPIDnSigmaAboveElectronLine=5;
2280 fTofPIDnSigmaBelowElectronLine=-2;
2281 fTofPIDnSigmaAboveElectronLine=3;
2285 fTofPIDnSigmaBelowElectronLine=-3;
2286 fTofPIDnSigmaAboveElectronLine=3;
2289 AliError(Form("TOFElectronCut not defined %d",TOFelectronPID));
2295 ///________________________________________________________________________
2296 Bool_t AliConversionPhotonCuts::SetQtMaxCut(Int_t QtMaxCut)
2301 fDoQtGammaSelection=kFALSE;
2341 AliError(Form("Warning: QtMaxCut not defined %d",QtMaxCut));
2347 ///________________________________________________________________________
2348 Bool_t AliConversionPhotonCuts::SetChi2GammaCut(Int_t chi2GammaCut)
2351 switch(chi2GammaCut){
2353 fChi2CutConversion = 100.;
2356 fChi2CutConversion = 50.;
2359 fChi2CutConversion = 30.;
2362 fChi2CutConversion = 200.;
2365 fChi2CutConversion = 500.;
2368 fChi2CutConversion = 100000.;
2371 fChi2CutConversion = 5.;
2374 fChi2CutConversion = 10.;
2377 fChi2CutConversion = 20.;
2380 fChi2CutConversion = 15.;
2383 AliError(Form("Warning: Chi2GammaCut not defined %d",chi2GammaCut));
2389 ///________________________________________________________________________
2390 Bool_t AliConversionPhotonCuts::SetPsiPairCut(Int_t psiCut) {
2394 fPsiPairCut = 10000; //
2397 fPsiPairCut = 0.1; //
2400 fPsiPairCut = 0.05; // Standard
2403 fPsiPairCut = 0.035; //
2406 fPsiPairCut = 0.2; //
2409 fPsiPairCut = 0.1; //
2410 fDo2DPsiPairChi2 = kTRUE;
2413 fPsiPairCut = 0.05; //
2414 fDo2DPsiPairChi2 = kTRUE;
2417 fPsiPairCut = 0.035; //
2418 fDo2DPsiPairChi2 = kTRUE;
2421 fPsiPairCut = 0.2; //
2422 fDo2DPsiPairChi2 = kTRUE; //
2425 fPsiPairCut = 0.5; //
2428 AliError(Form("PsiPairCut not defined %d",psiCut));
2435 ///________________________________________________________________________
2436 Bool_t AliConversionPhotonCuts::SetPhotonAsymmetryCut(Int_t doPhotonAsymmetryCut){
2438 switch(doPhotonAsymmetryCut){
2440 fDoPhotonAsymmetryCut=0;
2441 fMinPPhotonAsymmetryCut=100.;
2442 fMinPhotonAsymmetry=0.;
2445 fDoPhotonAsymmetryCut=1;
2446 fMinPPhotonAsymmetryCut=3.5;
2447 fMinPhotonAsymmetry=0.04;
2450 fDoPhotonAsymmetryCut=1;
2451 fMinPPhotonAsymmetryCut=3.5;
2452 fMinPhotonAsymmetry=0.06;
2455 fDoPhotonAsymmetryCut=1;
2456 fMinPPhotonAsymmetryCut=0.0;
2457 fMinPhotonAsymmetry=0.05;
2460 AliError(Form("PhotonAsymmetryCut not defined %d",doPhotonAsymmetryCut));
2463 fCuts[kdoPhotonAsymmetryCut]=doPhotonAsymmetryCut;
2467 ///________________________________________________________________________
2468 Bool_t AliConversionPhotonCuts::SetCosPAngleCut(Int_t cosCut) {
2478 fCosPAngleCut = 0.5;
2481 fCosPAngleCut = 0.75;
2484 fCosPAngleCut = 0.85;
2487 fCosPAngleCut = 0.88;
2490 fCosPAngleCut = 0.9;
2493 fCosPAngleCut = 0.95;
2496 AliError(Form("Cosine Pointing Angle cut not defined %d",cosCut));
2503 ///________________________________________________________________________
2504 Bool_t AliConversionPhotonCuts::SetSharedElectronCut(Int_t sharedElec) {
2508 fDoSharedElecCut = kFALSE;
2509 fDoPhotonQualitySelectionCut = kFALSE;
2510 fPhotonQualityCut = 0;
2513 fDoSharedElecCut = kTRUE;
2514 fDoPhotonQualitySelectionCut = kFALSE;
2515 fPhotonQualityCut = 0;
2518 fDoSharedElecCut = kFALSE;
2519 fDoPhotonQualitySelectionCut = kTRUE;
2520 fPhotonQualityCut = 1;
2523 fDoSharedElecCut = kFALSE;
2524 fDoPhotonQualitySelectionCut = kTRUE;
2525 fPhotonQualityCut = 2;
2528 fDoSharedElecCut = kFALSE;
2529 fDoPhotonQualitySelectionCut = kTRUE;
2530 fPhotonQualityCut = 3;
2533 AliError(Form("Shared Electron Cut not defined %d",sharedElec));
2540 ///________________________________________________________________________
2541 Bool_t AliConversionPhotonCuts::SetToCloseV0sCut(Int_t toClose) {
2545 fDoToCloseV0sCut = kFALSE;
2549 fDoToCloseV0sCut = kTRUE;
2553 fDoToCloseV0sCut = kTRUE;
2557 fDoToCloseV0sCut = kTRUE;
2561 AliError(Form("Shared Electron Cut not defined %d",toClose));
2567 ///________________________________________________________________________
2568 Bool_t AliConversionPhotonCuts::SetTRDElectronCut(Int_t TRDElectronCut)
2570 switch(TRDElectronCut){
2576 fPIDTRDEfficiency=0.1;
2580 fPIDTRDEfficiency=0.8;
2584 fPIDTRDEfficiency=0.9;
2587 AliError(Form("TRDElectronCut not defined %d",TRDElectronCut));
2594 ///________________________________________________________________________
2595 Bool_t AliConversionPhotonCuts::SetDCAZPhotonPrimVtxCut(Int_t DCAZPhotonPrimVtx){
2597 switch(DCAZPhotonPrimVtx){
2599 fDCAZPrimVtxCut = 1000;
2602 fDCAZPrimVtxCut = 10;
2605 fDCAZPrimVtxCut = 5;
2608 fDCAZPrimVtxCut = 4;
2611 fDCAZPrimVtxCut = 3;
2614 fDCAZPrimVtxCut = 2.5;
2617 fDCAZPrimVtxCut = 2;
2620 fDCAZPrimVtxCut = 1.5;
2623 fDCAZPrimVtxCut = 1;
2626 fDCAZPrimVtxCut = 0.5;
2629 cout<<"Warning: DCAZPhotonPrimVtx not defined "<<DCAZPhotonPrimVtx<<endl;
2635 ///________________________________________________________________________
2636 Bool_t AliConversionPhotonCuts::SetDCARPhotonPrimVtxCut(Int_t DCARPhotonPrimVtx){
2638 switch(DCARPhotonPrimVtx){
2640 fDCARPrimVtxCut = 1000;
2643 fDCARPrimVtxCut = 10;
2646 fDCARPrimVtxCut = 5;
2649 fDCARPrimVtxCut = 4;
2652 fDCARPrimVtxCut = 3;
2655 fDCARPrimVtxCut = 2.5;
2658 fDCARPrimVtxCut = 2;
2661 fDCARPrimVtxCut = 1.5;
2664 fDCARPrimVtxCut = 1;
2667 fDCARPrimVtxCut = 0.5;
2670 cout<<"Warning: DCARPhotonPrimVtx not defined "<<DCARPhotonPrimVtx<<endl;
2676 ///________________________________________________________________________
2677 Bool_t AliConversionPhotonCuts::SetInPlaneOutOfPlane(Int_t inOutPlane){
2681 fInPlaneOutOfPlane = 0; // No Event Plane
2684 fInPlaneOutOfPlane = 1; // In-Plane
2687 fInPlaneOutOfPlane = 2; // Out-Of-Plane
2690 cout<<"Warning: In-Plane or Out-Of-Plane not defined "<<inOutPlane<<endl;
2697 ///________________________________________________________________________
2698 Int_t AliConversionPhotonCuts::GetFirstTPCRow(Double_t radius){
2699 // Get first TPC row
2700 Int_t firstTPCRow = 0;
2701 Double_t radiusI = 84.8;
2702 Double_t radiusO = 134.6;
2703 Double_t radiusOB = 198.;
2704 Double_t rSizeI = 0.75;
2705 Double_t rSizeO = 1.;
2706 Double_t rSizeOB = 1.5;
2710 if(radius <= radiusI){
2713 if(radius>radiusI && radius<=radiusO){
2714 firstTPCRow = (Int_t)((radius-radiusI)/rSizeI);
2716 if(radius>radiusO && radius<=radiusOB){
2717 firstTPCRow = (Int_t)(nClsI+(radius-radiusO)/rSizeO);
2720 if(radius>radiusOB){
2721 firstTPCRow =(Int_t)(nClsIO+(radius-radiusOB)/rSizeOB);
2727 ///________________________________________________________________________
2728 Bool_t AliConversionPhotonCuts::CosinePAngleCut(const AliConversionPhotonBase * photon, AliVEvent * event) const {
2729 ///Check if passes cosine of pointing angle cut
2730 if(GetCosineOfPointingAngle(photon, event) < fCosPAngleCut){
2736 ///________________________________________________________________________
2737 Double_t AliConversionPhotonCuts::GetCosineOfPointingAngle( const AliConversionPhotonBase * photon, AliVEvent * event) const{
2738 // calculates the pointing angle of the recalculated V0
2740 Double_t momV0[3] = {0,0,0};
2741 if(event->IsA()==AliESDEvent::Class()){
2742 AliESDEvent *esdEvent = dynamic_cast<AliESDEvent*>(event);
2743 if(!esdEvent) return -999;
2744 AliESDv0 *v0 = esdEvent->GetV0(photon->GetV0Index());
2745 if(!v0) return -999;
2746 v0->GetPxPyPz(momV0[0],momV0[1],momV0[2]);
2748 if(event->IsA()==AliAODEvent::Class()){
2749 momV0[0] = photon->GetPx();
2750 momV0[1] = photon->GetPy();
2751 momV0[2] = photon->GetPz();
2754 //Double_t momV0[3] = { photon->GetPx(), photon->GetPy(), photon->GetPz() }; //momentum of the V0
2755 Double_t PosV0[3] = { photon->GetConversionX() - event->GetPrimaryVertex()->GetX(),
2756 photon->GetConversionY() - event->GetPrimaryVertex()->GetY(),
2757 photon->GetConversionZ() - event->GetPrimaryVertex()->GetZ() }; //Recalculated V0 Position vector
2759 Double_t momV02 = momV0[0]*momV0[0] + momV0[1]*momV0[1] + momV0[2]*momV0[2];
2760 Double_t PosV02 = PosV0[0]*PosV0[0] + PosV0[1]*PosV0[1] + PosV0[2]*PosV0[2];
2763 Double_t cosinePointingAngle = -999;
2764 if(momV02*PosV02 > 0.0)
2765 cosinePointingAngle = (PosV0[0]*momV0[0] + PosV0[1]*momV0[1] + PosV0[2]*momV0[2] ) / TMath::Sqrt(momV02 * PosV02);
2767 return cosinePointingAngle;
2770 ///________________________________________________________________________
2771 Bool_t AliConversionPhotonCuts::PsiPairCut(const AliConversionPhotonBase * photon) const {
2773 if (fDo2DPsiPairChi2){
2774 if (abs(photon->GetPsiPair()) < -fPsiPairCut/fChi2CutConversion*photon->GetChi2perNDF() + fPsiPairCut ){
2780 if(abs(photon->GetPsiPair()) > fPsiPairCut){
2786 ///________________________________________________________________________
2787 TString AliConversionPhotonCuts::GetCutNumber(){
2788 // returns TString with current cut number
2790 for(Int_t ii=0;ii<kNCuts;ii++){
2791 a.Append(Form("%d",fCuts[ii]));
2796 ///________________________________________________________________________
2797 void AliConversionPhotonCuts::FillElectonLabelArray(AliAODConversionPhoton* photon, Int_t nV0){
2799 Int_t posLabel = photon->GetTrackLabelPositive();
2800 Int_t negLabel = photon->GetTrackLabelNegative();
2802 fElectronLabelArray[nV0*2] = posLabel;
2803 fElectronLabelArray[(nV0*2)+1] = negLabel;
2805 ///________________________________________________________________________
2806 Bool_t AliConversionPhotonCuts::RejectSharedElectronV0s(AliAODConversionPhoton* photon, Int_t nV0, Int_t nV0s){
2808 Int_t posLabel = photon->GetTrackLabelPositive();
2809 Int_t negLabel = photon->GetTrackLabelNegative();
2811 for(Int_t i = 0; i<nV0s*2;i++){
2812 if(i==nV0*2) continue;
2813 if(i==(nV0*2)+1) continue;
2814 if(fElectronLabelArray[i] == posLabel){
2816 if(fElectronLabelArray[i] == negLabel){
2823 ///________________________________________________________________________
2824 Bool_t AliConversionPhotonCuts::RejectToCloseV0s(AliAODConversionPhoton* photon, TList *photons, Int_t nV0){
2827 Double_t posX = photon->GetConversionX();
2828 Double_t posY = photon->GetConversionY();
2829 Double_t posZ = photon->GetConversionZ();
2831 for(Int_t i = 0;i<photons->GetEntries();i++){
2832 if(nV0 == i) continue;
2833 AliAODConversionPhoton *photonComp = (AliAODConversionPhoton*) photons->At(i);
2834 Double_t posCompX = photonComp->GetConversionX();
2835 Double_t posCompY = photonComp->GetConversionY();
2836 Double_t posCompZ = photonComp->GetConversionZ();
2838 Double_t dist = pow((posX - posCompX),2)+pow((posY - posCompY),2)+pow((posZ - posCompZ),2);
2840 if(dist < fminV0Dist*fminV0Dist){
2841 if(photon->GetChi2perNDF() < photonComp->GetChi2perNDF()) return kTRUE;
2851 ///________________________________________________________________________
2852 AliConversionPhotonCuts* AliConversionPhotonCuts::GetStandardCuts2010PbPb(){
2853 //Create and return standard 2010 PbPb cuts
2854 AliConversionPhotonCuts *cuts=new AliConversionPhotonCuts("StandardCuts2010PbPb","StandardCuts2010PbPb");
2855 if(!cuts->InitializeCutsFromCutString("04209297002322000000")){
2856 cout<<"Warning: Initialization of Standardcuts2010PbPb failed"<<endl;}
2860 ///________________________________________________________________________
2861 AliConversionPhotonCuts* AliConversionPhotonCuts::GetStandardCuts2010pp(){
2862 //Create and return standard 2010 PbPb cuts
2863 AliConversionPhotonCuts *cuts=new AliConversionPhotonCuts("StandardCuts2010pp","StandardCuts2010pp");
2864 if(!cuts->InitializeCutsFromCutString("00209366300380000000")){
2865 cout<<"Warning: Initialization of Standardcuts2010pp failed"<<endl;}
2869 ///________________________________________________________________________
2870 Bool_t AliConversionPhotonCuts::InPlaneOutOfPlaneCut(Double_t photonPhi, Double_t eventPlaneAngle, Bool_t fill){
2872 //GetPhotonPhi() 0-2 Pi //eventPlaneAngle -1pi-1pi
2873 eventPlaneAngle=eventPlaneAngle+TMath::Pi();
2874 Double_t gammaToEPAngle = eventPlaneAngle-photonPhi;
2875 if(gammaToEPAngle < 0) gammaToEPAngle=gammaToEPAngle+2*TMath::Pi();
2876 gammaToEPAngle = gammaToEPAngle-TMath::Pi(); // angle from -pi +pi
2878 if(!fInPlaneOutOfPlane){
2879 if(fill&&hEventPlanePhi)hEventPlanePhi->Fill(gammaToEPAngle);
2882 else if(fInPlaneOutOfPlane == 1){
2883 if(abs(gammaToEPAngle)<=0.25*TMath::Pi() || abs(gammaToEPAngle)>=0.75*TMath::Pi()){
2884 if(fill&&hEventPlanePhi)hEventPlanePhi->Fill(gammaToEPAngle);
2889 else if(fInPlaneOutOfPlane == 2){
2890 if(abs(gammaToEPAngle)>0.25*TMath::Pi() && abs(gammaToEPAngle)<0.75*TMath::Pi()){
2891 if(fill&&hEventPlanePhi)hEventPlanePhi->Fill(gammaToEPAngle);
2899 ///________________________________________________________________________
2900 UChar_t AliConversionPhotonCuts::DeterminePhotonQualityAOD(AliAODConversionPhoton* photon, AliVEvent* eventDummy){
2902 AliAODTrack * negTrack = static_cast<AliAODTrack*>(GetTrack(eventDummy, photon->GetTrackLabelNegative()));
2903 AliAODTrack * posTrack = static_cast<AliAODTrack*>(GetTrack(eventDummy, photon->GetTrackLabelPositive()));
2905 if(!negTrack || !posTrack) {
2908 if(negTrack->Charge() == posTrack->Charge()){
2911 Int_t nClusterITSneg = negTrack->GetITSNcls();
2912 Int_t nClusterITSpos = posTrack->GetITSNcls();
2913 // cout << nClusterITSneg << "\t" << nClusterITSpos <<endl;
2915 if (nClusterITSneg > 1 && nClusterITSpos > 1){
2917 } else if (nClusterITSneg > 1 || nClusterITSpos > 1){