1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Authors: Svein Lindal, Daniel Lohner *
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 all kinds of selection cuts for
19 // Gamma Conversion analysis
20 //---------------------------------------------
21 ////////////////////////////////////////////////
23 #include "AliConversionCuts.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"
36 #include "AliAODConversionMother.h"
37 #include "TObjString.h"
38 #include "AliAODEvent.h"
39 #include "AliESDEvent.h"
40 #include "AliCentrality.h"
44 #include "AliGenCocktailEventHeader.h"
45 #include "AliGenDPMjetEventHeader.h"
46 #include "AliGenPythiaEventHeader.h"
47 #include "AliGenHijingEventHeader.h"
48 #include "AliTriggerAnalysis.h"
49 #include "AliV0ReaderV1.h"
50 #include "AliAODMCParticle.h"
51 #include "AliAODMCHeader.h"
57 ClassImp(AliConversionCuts)
60 const char* AliConversionCuts::fgkCutNames[AliConversionCuts::kNCuts] = {
65 "MultiplicityMethod",//4
67 "RejectExtraSignals",//6
75 "piMomdedxSigmaCut",//14
76 "piMaxMomdedxSigmaCut",//15
77 "LowPRejectionSigmaCut",//16
82 "DoPhotonAsymmetryCut",//21
83 "CosinePointingAngle", //22
84 "SharedElectronCuts", //23
85 "RejectToCloseV0s", //24
91 //________________________________________________________________________
92 AliConversionCuts::AliConversionCuts(const char *name,const char *title) :
93 AliAnalysisCuts(name,title),
109 fLineCutZRSlopeMin(0.),
110 fLineCutZValueMin(0),
111 fChi2CutConversion(1000),
112 fPIDProbabilityCutNegativeParticle(0),
113 fPIDProbabilityCutPositiveParticle(0),
114 fDodEdxSigmaCut(kTRUE),
115 fDoTOFsigmaCut(kFALSE),
116 fPIDTRDEfficiency(1),
118 fPIDnSigmaAboveElectronLine(100),
119 fPIDnSigmaBelowElectronLine(-100),
120 fTofPIDnSigmaAboveElectronLine(100),
121 fTofPIDnSigmaBelowElectronLine(-100),
122 fPIDnSigmaAbovePionLine(0),
123 fPIDnSigmaAbovePionLineHighPt(-100),
124 fPIDMinPnSigmaAbovePionLine(0),
125 fPIDMaxPnSigmaAbovePionLine(0),
126 fDoKaonRejectionLowP(kFALSE),
127 fDoProtonRejectionLowP(kFALSE),
128 fDoPionRejectionLowP(kFALSE),
129 fPIDnSigmaAtLowPAroundKaonLine(0),
130 fPIDnSigmaAtLowPAroundProtonLine(0),
131 fPIDnSigmaAtLowPAroundPionLine(0),
132 fPIDMinPKaonRejectionLowP(1.5),
133 fPIDMinPProtonRejectionLowP(2),
134 fPIDMinPPionRejectionLowP(0),
135 fDoQtGammaSelection(kTRUE),
136 fDoHighPtQtGammaSelection(kFALSE),
144 fUseEtaMinCut(kFALSE),
145 fUseOnFlyV0Finder(kTRUE),
146 fDoPhotonAsymmetryCut(kTRUE),
147 fMinPPhotonAsymmetryCut(100.),
148 fMinPhotonAsymmetry(0.),
150 fDetectorCentrality(0),
151 fModCentralityClass(0),
155 fUseCorrectedTPCClsInfo(kFALSE),
157 fMultiplicityMethod(0),
159 fRemovePileUp(kFALSE),
160 fOpeningAngle(0.005),
162 fCosPAngleCut(10000),
163 fDoToCloseV0sCut(kFALSE),
164 fRejectExtraSignals(0),
166 fDoSharedElecCut(kFALSE),
167 fOfflineTriggerMask(0),
171 fElectronArraySize(500),
172 fElectronLabelArray(NULL),
173 fDCAZPrimVtxCut(1000),
174 fDCARPrimVtxCut(1000),
175 fConversionPointXArray(0.0),
176 fConversionPointYArray(0.0),
177 fConversionPointZArray(0.0),
179 fNotRejectedStart(NULL),
180 fNotRejectedEnd(NULL),
181 fGeneratorNames(NULL),
186 fDoReweightHistoMCPi0(kFALSE),
187 fDoReweightHistoMCEta(kFALSE),
188 fDoReweightHistoMCK0s(kFALSE),
189 fPathTrFReweighting(""),
190 fNameHistoReweightingPi0(""),
191 fNameHistoReweightingEta(""),
192 fNameHistoReweightingK0s(""),
194 hTPCdEdxbefore(NULL),
196 hTPCdEdxSigbefore(NULL),
197 hTPCdEdxSigafter(NULL),
203 hInvMassbefore(NULL),
204 hArmenterosbefore(NULL),
206 hArmenterosafter(NULL),
207 hAcceptanceCuts(NULL),
211 hCentralityVsNumberOfPrimaryTracks(NULL),
214 hTriggerClassSelected(NULL),
215 hReweightMCHistPi0(NULL),
216 hReweightMCHistEta(NULL),
217 hReweightMCHistK0s(NULL),
219 fTriggerSelectedManually(kFALSE),
220 fSpecialTriggerName("")
224 for(Int_t jj=0;jj<kNCuts;jj++){fCuts[jj]=0;}
225 fCutString=new TObjString((GetCutNumber()).Data());
227 fElectronLabelArray = new Int_t[fElectronArraySize];
228 fUtils = new AliAnalysisUtils();
229 //if you do not want to apply the cut on the distance between the SPD and TRK vertex:
230 //fUtils->SetCutOnZVertexSPD(kFALSE);
235 //________________________________________________________________________
236 AliConversionCuts::AliConversionCuts(const AliConversionCuts &ref) :
237 AliAnalysisCuts(ref),
239 fHeaderList(ref.fHeaderList),
241 fEventQuality(ref.fEventQuality),
244 fEtaCut(ref.fEtaCut),
245 fEtaCutMin(ref.fEtaCutMin),
247 fSinglePtCut(ref.fSinglePtCut),
249 fMinClsTPC(ref.fMinClsTPC),
250 fMinClsTPCToF(ref.fMinClsTPCToF),
251 fLineCutZRSlope(ref.fLineCutZRSlope),
252 fLineCutZValue(ref.fLineCutZValue),
253 fLineCutZRSlopeMin(ref.fLineCutZRSlopeMin),
254 fLineCutZValueMin(ref.fLineCutZValueMin),
255 fChi2CutConversion(ref.fChi2CutConversion),
256 fPIDProbabilityCutNegativeParticle(ref.fPIDProbabilityCutNegativeParticle),
257 fPIDProbabilityCutPositiveParticle(ref.fPIDProbabilityCutPositiveParticle),
258 fDodEdxSigmaCut(ref. fDodEdxSigmaCut),
259 fDoTOFsigmaCut(ref.fDoTOFsigmaCut),
260 fPIDTRDEfficiency(ref.fPIDTRDEfficiency),
261 fDoTRDPID(ref.fDoTRDPID),
262 fPIDnSigmaAboveElectronLine(ref.fPIDnSigmaAboveElectronLine),
263 fPIDnSigmaBelowElectronLine(ref.fPIDnSigmaBelowElectronLine),
264 fTofPIDnSigmaAboveElectronLine(ref.fTofPIDnSigmaAboveElectronLine),
265 fTofPIDnSigmaBelowElectronLine(ref.fTofPIDnSigmaBelowElectronLine),
266 fPIDnSigmaAbovePionLine(ref.fPIDnSigmaAbovePionLine),
267 fPIDnSigmaAbovePionLineHighPt(ref.fPIDnSigmaAbovePionLineHighPt),
268 fPIDMinPnSigmaAbovePionLine(ref.fPIDMinPnSigmaAbovePionLine),
269 fPIDMaxPnSigmaAbovePionLine(ref.fPIDMaxPnSigmaAbovePionLine),
270 fDoKaonRejectionLowP(ref.fDoKaonRejectionLowP),
271 fDoProtonRejectionLowP(ref.fDoProtonRejectionLowP),
272 fDoPionRejectionLowP(ref.fDoPionRejectionLowP),
273 fPIDnSigmaAtLowPAroundKaonLine(ref.fPIDnSigmaAtLowPAroundKaonLine),
274 fPIDnSigmaAtLowPAroundProtonLine(ref.fPIDnSigmaAtLowPAroundProtonLine),
275 fPIDnSigmaAtLowPAroundPionLine(ref.fPIDnSigmaAtLowPAroundPionLine),
276 fPIDMinPKaonRejectionLowP(ref.fPIDMinPKaonRejectionLowP),
277 fPIDMinPProtonRejectionLowP(ref.fPIDMinPProtonRejectionLowP),
278 fPIDMinPPionRejectionLowP(ref.fPIDMinPPionRejectionLowP),
279 fDoQtGammaSelection(ref.fDoQtGammaSelection),
280 fDoHighPtQtGammaSelection(ref.fDoHighPtQtGammaSelection),
282 fHighPtQtMax(ref.fHighPtQtMax),
283 fPtBorderForQt(ref.fPtBorderForQt),
284 fXVertexCut(ref.fXVertexCut),
285 fYVertexCut(ref.fYVertexCut),
286 fZVertexCut(ref.fZVertexCut),
287 fNSigmaMass(ref.fNSigmaMass),
288 fUseEtaMinCut(ref.fUseEtaMinCut),
289 fUseOnFlyV0Finder(ref.fUseOnFlyV0Finder),
290 fDoPhotonAsymmetryCut(ref.fDoPhotonAsymmetryCut),
291 fMinPPhotonAsymmetryCut(ref.fMinPPhotonAsymmetryCut),
292 fMinPhotonAsymmetry(ref.fMinPhotonAsymmetry),
293 fIsHeavyIon(ref.fIsHeavyIon),
294 fDetectorCentrality(ref.fDetectorCentrality),
295 fModCentralityClass(ref.fModCentralityClass),
296 fMaxVertexZ(ref.fMaxVertexZ),
297 fCentralityMin(ref.fCentralityMin),
298 fCentralityMax(ref.fCentralityMax),
299 fUseCorrectedTPCClsInfo(ref.fUseCorrectedTPCClsInfo),
300 fUseTOFpid(ref.fUseTOFpid),
301 fMultiplicityMethod(ref.fMultiplicityMethod),
302 fSpecialTrigger(ref.fSpecialTrigger),
303 fRemovePileUp(ref.fRemovePileUp),
304 fOpeningAngle(ref.fOpeningAngle),
305 fPsiPairCut(ref.fPsiPairCut),
306 fCosPAngleCut(ref.fCosPAngleCut),
307 fDoToCloseV0sCut(ref.fDoToCloseV0sCut),
308 fRejectExtraSignals(ref.fRejectExtraSignals),
309 fminV0Dist(ref.fminV0Dist),
310 fDoSharedElecCut(ref.fDoSharedElecCut),
311 fOfflineTriggerMask(ref.fOfflineTriggerMask),
312 fHasV0AND(ref.fHasV0AND),
313 fIsSDDFired(ref.fIsSDDFired),
314 fRandom(ref.fRandom),
315 fElectronArraySize(ref.fElectronArraySize),
316 fElectronLabelArray(NULL),
317 fDCAZPrimVtxCut(ref.fDCAZPrimVtxCut),
318 fDCARPrimVtxCut(ref.fDCAZPrimVtxCut),
319 fConversionPointXArray(ref.fConversionPointXArray),
320 fConversionPointYArray(ref.fConversionPointYArray),
321 fConversionPointZArray(ref.fConversionPointZArray),
322 fnHeaders(ref.fnHeaders),
323 fNotRejectedStart(NULL),
324 fNotRejectedEnd(NULL),
325 fGeneratorNames(ref.fGeneratorNames),
328 fEtaShift(ref.fEtaShift),
329 fDoEtaShift(ref.fDoEtaShift),
330 fDoReweightHistoMCPi0(ref.fDoReweightHistoMCPi0),
331 fDoReweightHistoMCEta(ref.fDoReweightHistoMCEta),
332 fDoReweightHistoMCK0s(ref.fDoReweightHistoMCK0s),
333 fPathTrFReweighting(ref.fPathTrFReweighting),
334 fNameHistoReweightingPi0(ref.fNameHistoReweightingPi0),
335 fNameHistoReweightingEta(ref.fNameHistoReweightingEta),
336 fNameHistoReweightingK0s(ref.fNameHistoReweightingK0s),
338 hTPCdEdxbefore(NULL),
340 hTPCdEdxSigbefore(NULL),
341 hTPCdEdxSigafter(NULL),
347 hInvMassbefore(NULL),
348 hArmenterosbefore(NULL),
350 hArmenterosafter(NULL),
351 hAcceptanceCuts(NULL),
355 hCentralityVsNumberOfPrimaryTracks(NULL),
358 hTriggerClassSelected(NULL),
359 hReweightMCHistPi0(NULL),
360 hReweightMCHistEta(NULL),
361 hReweightMCHistK0s(NULL),
362 fPreSelCut(ref.fPreSelCut),
363 fTriggerSelectedManually(ref.fTriggerSelectedManually),
364 fSpecialTriggerName(ref.fSpecialTriggerName)
367 for(Int_t jj=0;jj<kNCuts;jj++){fCuts[jj]=ref.fCuts[jj];}
368 fCutString=new TObjString((GetCutNumber()).Data());
369 fElectronLabelArray = new Int_t[fElectronArraySize];
370 fUtils = new AliAnalysisUtils();
371 // dont copy histograms (if you like histograms, call InitCutHistograms())
376 //________________________________________________________________________
377 AliConversionCuts::~AliConversionCuts() {
379 //Deleting fHistograms leads to seg fault it it's added to output collection of a task
381 // delete fHistograms;
382 // fHistograms = NULL;
383 if(fCutString != NULL){
387 if(fElectronLabelArray){
388 delete fElectronLabelArray;
389 fElectronLabelArray = NULL;
391 if(fNotRejectedStart){
392 delete[] fNotRejectedStart;
393 fNotRejectedStart = NULL;
396 delete[] fNotRejectedEnd;
397 fNotRejectedEnd = NULL;
400 delete[] fGeneratorNames;
401 fGeneratorNames = NULL;
410 //________________________________________________________________________
411 void AliConversionCuts::InitCutHistograms(TString name, Bool_t preCut){
413 // Initialize Cut Histograms for QA (only initialized and filled if function is called)
414 TH1::AddDirectory(kFALSE);
416 if(fHistograms != NULL){
420 if(fHistograms==NULL){
421 fHistograms=new TList();
422 fHistograms->SetOwner(kTRUE);
423 if(name=="")fHistograms->SetName(Form("ConvCuts_%s",GetCutNumber().Data()));
424 else fHistograms->SetName(Form("%s_%s",name.Data(),GetCutNumber().Data()));
427 if (hReweightMCHistPi0) fHistograms->Add(hReweightMCHistPi0);
428 if (hReweightMCHistEta) fHistograms->Add(hReweightMCHistEta);
429 if (hReweightMCHistK0s) fHistograms->Add(hReweightMCHistK0s);
432 hCutIndex=new TH1F(Form("IsPhotonSelected %s",GetCutNumber().Data()),"IsPhotonSelected",10,-0.5,9.5);
433 hCutIndex->GetXaxis()->SetBinLabel(kPhotonIn+1,"in");
434 hCutIndex->GetXaxis()->SetBinLabel(kOnFly+1,"onfly");
435 hCutIndex->GetXaxis()->SetBinLabel(kNoTracks+1,"no tracks");
436 hCutIndex->GetXaxis()->SetBinLabel(kdEdxCuts+1,"dEdx");
437 hCutIndex->GetXaxis()->SetBinLabel(kTrackCuts+1,"Track cuts");
438 hCutIndex->GetXaxis()->SetBinLabel(kConvPointFail+1,"ConvPoint fail");
439 hCutIndex->GetXaxis()->SetBinLabel(kPhotonCuts+1,"PhotonCuts");
440 hCutIndex->GetXaxis()->SetBinLabel(kPhotonOut+1,"out");
441 fHistograms->Add(hCutIndex);
444 hTrackCuts=new TH1F(Form("TrackCuts %s",GetCutNumber().Data()),"TrackCuts",9,-0.5,8.5);
445 hTrackCuts->GetXaxis()->SetBinLabel(1,"in");
446 hTrackCuts->GetXaxis()->SetBinLabel(2,"likesign");
447 hTrackCuts->GetXaxis()->SetBinLabel(3,"ntpccl");
448 hTrackCuts->GetXaxis()->SetBinLabel(4,"acceptance");
449 hTrackCuts->GetXaxis()->SetBinLabel(5,"singlept");
450 hTrackCuts->GetXaxis()->SetBinLabel(6,"TPCrefit");
451 hTrackCuts->GetXaxis()->SetBinLabel(7,"kink");
452 hTrackCuts->GetXaxis()->SetBinLabel(8,"out");
453 fHistograms->Add(hTrackCuts);
456 hPhotonCuts=new TH1F(Form("PhotonCuts %s",GetCutNumber().Data()),"PhotonCuts",14,-0.5,13.5);
457 hPhotonCuts->GetXaxis()->SetBinLabel(1,"in");
458 hPhotonCuts->GetXaxis()->SetBinLabel(2,"qtcut");
459 hPhotonCuts->GetXaxis()->SetBinLabel(3,"chi2");
460 hPhotonCuts->GetXaxis()->SetBinLabel(4,"acceptance");
461 hPhotonCuts->GetXaxis()->SetBinLabel(5,"asymmetry");
462 hPhotonCuts->GetXaxis()->SetBinLabel(6,"pidprob");
463 hPhotonCuts->GetXaxis()->SetBinLabel(7,"cortpcclinfo");
464 hPhotonCuts->GetXaxis()->SetBinLabel(8,"PsiPair");
465 hPhotonCuts->GetXaxis()->SetBinLabel(9,"CosPAngle");
466 hPhotonCuts->GetXaxis()->SetBinLabel(10,"DCA R");
467 hPhotonCuts->GetXaxis()->SetBinLabel(11,"DCA Z");
468 hPhotonCuts->GetXaxis()->SetBinLabel(12,"out");
469 fHistograms->Add(hPhotonCuts);
472 hInvMassbefore=new TH1F(Form("InvMass_before %s",GetCutNumber().Data()),"InvMass_before",1000,0,0.3);
473 fHistograms->Add(hInvMassbefore);
474 hArmenterosbefore=new TH2F(Form("Armenteros_before %s",GetCutNumber().Data()),"Armenteros_before",200,-1,1,1000,0,1.);
475 fHistograms->Add(hArmenterosbefore);
477 hInvMassafter=new TH1F(Form("InvMass_after %s",GetCutNumber().Data()),"InvMass_after",1000,0,0.3);
478 fHistograms->Add(hInvMassafter);
479 hArmenterosafter=new TH2F(Form("Armenteros_after %s",GetCutNumber().Data()),"Armenteros_after",200,-1,1,250,0,0.25);
480 fHistograms->Add(hArmenterosafter);
482 hAcceptanceCuts=new TH1F(Form("PhotonAcceptanceCuts %s",GetCutNumber().Data()),"PhotonAcceptanceCuts",10,-0.5,9.5);
483 hAcceptanceCuts->GetXaxis()->SetBinLabel(1,"in");
484 hAcceptanceCuts->GetXaxis()->SetBinLabel(2,"maxR");
485 hAcceptanceCuts->GetXaxis()->SetBinLabel(3,"minR");
486 hAcceptanceCuts->GetXaxis()->SetBinLabel(4,"line");
487 hAcceptanceCuts->GetXaxis()->SetBinLabel(5,"maxZ");
488 hAcceptanceCuts->GetXaxis()->SetBinLabel(6,"eta");
489 hAcceptanceCuts->GetXaxis()->SetBinLabel(7,"minpt");
490 hAcceptanceCuts->GetXaxis()->SetBinLabel(8,"out");
491 fHistograms->Add(hAcceptanceCuts);
494 hdEdxCuts=new TH1F(Form("dEdxCuts %s",GetCutNumber().Data()),"dEdxCuts",10,-0.5,9.5);
495 hdEdxCuts->GetXaxis()->SetBinLabel(1,"in");
496 hdEdxCuts->GetXaxis()->SetBinLabel(2,"TPCelectron");
497 hdEdxCuts->GetXaxis()->SetBinLabel(3,"TPCpion");
498 hdEdxCuts->GetXaxis()->SetBinLabel(4,"TPCpionhighp");
499 hdEdxCuts->GetXaxis()->SetBinLabel(5,"TPCkaonlowprej");
500 hdEdxCuts->GetXaxis()->SetBinLabel(6,"TPCprotonlowprej");
501 hdEdxCuts->GetXaxis()->SetBinLabel(7,"TPCpionlowprej");
502 hdEdxCuts->GetXaxis()->SetBinLabel(8,"TOFelectron");
503 hdEdxCuts->GetXaxis()->SetBinLabel(9,"TRDelectron");
504 hdEdxCuts->GetXaxis()->SetBinLabel(10,"out");
505 fHistograms->Add(hdEdxCuts);
507 TAxis *AxisBeforedEdx = NULL;
508 TAxis *AxisBeforedEdxSig = NULL;
509 TAxis *AxisBeforeTOF = NULL;
510 TAxis *AxisBeforeTOFSig = NULL;
512 hTPCdEdxbefore=new TH2F(Form("Gamma_dEdx_before %s",GetCutNumber().Data()),"dEdx Gamma before" ,150,0.03,20,800,0,200);
513 fHistograms->Add(hTPCdEdxbefore);
514 AxisBeforedEdx = hTPCdEdxbefore->GetXaxis();
515 hTPCdEdxSigbefore=new TH2F(Form("Gamma_dEdxSig_before %s",GetCutNumber().Data()),"dEdx Sigma Gamma before" ,150,0.03,20,400,-10,10);
516 fHistograms->Add(hTPCdEdxSigbefore);
517 AxisBeforedEdxSig = hTPCdEdxSigbefore->GetXaxis();
519 hTOFbefore=new TH2F(Form("Gamma_TOF_before %s",GetCutNumber().Data()),"TOF Gamma before" ,150,0.03,20,11000,-1000,10000);
520 fHistograms->Add(hTOFbefore);
521 AxisBeforeTOF = hTOFbefore->GetXaxis();
522 hTOFSigbefore=new TH2F(Form("Gamma_TOFSig_before %s",GetCutNumber().Data()),"TOF Sigma Gamma before" ,150,0.03,20,400,-6,10);
523 fHistograms->Add(hTOFSigbefore);
524 AxisBeforeTOFSig = hTOFSigbefore->GetXaxis();
527 hTPCdEdxSigafter=new TH2F(Form("Gamma_dEdxSig_after %s",GetCutNumber().Data()),"dEdx Sigma Gamma after" ,150,0.03,20,400, -10,10);
528 fHistograms->Add(hTPCdEdxSigafter);
530 hTPCdEdxafter=new TH2F(Form("Gamma_dEdx_after %s",GetCutNumber().Data()),"dEdx Gamma after" ,150,0.03,20,800,0,200);
531 fHistograms->Add(hTPCdEdxafter);
533 hTOFSigafter=new TH2F(Form("Gamma_TOFSig_after %s",GetCutNumber().Data()),"TOF Sigma Gamma after" ,150,0.03,20,400,-6,10);
534 fHistograms->Add(hTOFSigafter);
536 TAxis *AxisAfter = hTPCdEdxSigafter->GetXaxis();
537 Int_t bins = AxisAfter->GetNbins();
538 Double_t from = AxisAfter->GetXmin();
539 Double_t to = AxisAfter->GetXmax();
540 Double_t *newBins = new Double_t[bins+1];
542 Double_t factor = TMath::Power(to/from, 1./bins);
543 for(Int_t i=1; i<=bins; ++i) newBins[i] = factor * newBins[i-1];
544 AxisAfter->Set(bins, newBins);
545 AxisAfter = hTOFSigafter->GetXaxis();
546 AxisAfter->Set(bins, newBins);
547 AxisAfter = hTPCdEdxafter->GetXaxis();
548 AxisAfter->Set(bins, newBins);
550 AxisBeforedEdx->Set(bins, newBins);
551 AxisBeforeTOF->Set(bins, newBins);
552 AxisBeforedEdxSig->Set(bins, newBins);
553 AxisBeforeTOFSig->Set(bins, newBins);
557 // Event Cuts and Info
559 hV0EventCuts=new TH1F(Form("ESD_EventCuts %s",GetCutNumber().Data()),"Event Cuts",7,-0.5,6.5);
560 hV0EventCuts->GetXaxis()->SetBinLabel(1,"in");
561 hV0EventCuts->GetXaxis()->SetBinLabel(2,"OfflineTrigger");
562 hV0EventCuts->GetXaxis()->SetBinLabel(3,"nvtxcontr");
563 hV0EventCuts->GetXaxis()->SetBinLabel(4,"VertexZ");
564 hV0EventCuts->GetXaxis()->SetBinLabel(5,"pileup");
565 hV0EventCuts->GetXaxis()->SetBinLabel(6,"centrsel");
566 hV0EventCuts->GetXaxis()->SetBinLabel(7,"out");
567 fHistograms->Add(hV0EventCuts);
569 hCentrality=new TH1F(Form("Centrality %s",GetCutNumber().Data()),"Centrality",1000,0,100);
570 fHistograms->Add(hCentrality);
571 hCentralityVsNumberOfPrimaryTracks=new TH2F(Form("Centrality vs Primary Tracks %s",GetCutNumber().Data()),"Centrality vs Primary Tracks ",100,0,100,3000,0,3000);
572 fHistograms->Add(hCentralityVsNumberOfPrimaryTracks);
573 hVertexZ=new TH1F(Form("VertexZ %s",GetCutNumber().Data()),"VertexZ",1000,-50,50);
574 fHistograms->Add(hVertexZ);
576 hTriggerClass= new TH1F(Form("OfflineTrigger %s",GetCutNumber().Data()),"OfflineTrigger",35,-0.5,34.5);
577 hTriggerClass->GetXaxis()->SetBinLabel( 1,"kMB");
578 hTriggerClass->GetXaxis()->SetBinLabel( 2,"kINT7");
579 hTriggerClass->GetXaxis()->SetBinLabel( 3,"kMUON");
580 hTriggerClass->GetXaxis()->SetBinLabel( 4,"kHighMult");
581 hTriggerClass->GetXaxis()->SetBinLabel( 5,"kKEMC1");
582 hTriggerClass->GetXaxis()->SetBinLabel( 6,"kCINT5");
583 hTriggerClass->GetXaxis()->SetBinLabel( 7,"kCMUS5/kMUSPB");
584 hTriggerClass->GetXaxis()->SetBinLabel( 8,"kMUSH7/kMUSHPB");
585 hTriggerClass->GetXaxis()->SetBinLabel( 9,"kMUL7/kMuonLikePB");
586 hTriggerClass->GetXaxis()->SetBinLabel(10,"kMUU7/kMuonUnlikePB");
587 hTriggerClass->GetXaxis()->SetBinLabel(11,"kEMC7/kEMC8");
588 hTriggerClass->GetXaxis()->SetBinLabel(12,"kMUS7");
589 hTriggerClass->GetXaxis()->SetBinLabel(13,"kPHI1");
590 hTriggerClass->GetXaxis()->SetBinLabel(14,"kPHI7/kPHI8/kPHOSPb");
591 hTriggerClass->GetXaxis()->SetBinLabel(15,"kEMCEJE");
592 hTriggerClass->GetXaxis()->SetBinLabel(16,"kEMCEGA");
593 hTriggerClass->GetXaxis()->SetBinLabel(17,"kCentral");
594 hTriggerClass->GetXaxis()->SetBinLabel(18,"kSemiCentral");
595 hTriggerClass->GetXaxis()->SetBinLabel(19,"kDG5");
596 hTriggerClass->GetXaxis()->SetBinLabel(20,"kZED");
597 hTriggerClass->GetXaxis()->SetBinLabel(21,"kSPI7/kSPI");
598 hTriggerClass->GetXaxis()->SetBinLabel(22,"kINT8");
599 hTriggerClass->GetXaxis()->SetBinLabel(23,"kMuonSingleLowPt8");
600 hTriggerClass->GetXaxis()->SetBinLabel(24,"kMuonSingleHighPt8");
601 hTriggerClass->GetXaxis()->SetBinLabel(25,"kMuonLikeLowPt8");
602 hTriggerClass->GetXaxis()->SetBinLabel(26,"kMuonUnlikeLowPt8");
603 hTriggerClass->GetXaxis()->SetBinLabel(27,"kMuonUnlikeLowPt0");
604 hTriggerClass->GetXaxis()->SetBinLabel(28,"kUserDefined");
605 hTriggerClass->GetXaxis()->SetBinLabel(29,"kTRD");
606 hTriggerClass->GetXaxis()->SetBinLabel(30,"kFastOnly");
607 hTriggerClass->GetXaxis()->SetBinLabel(31,"kAnyINT");
608 hTriggerClass->GetXaxis()->SetBinLabel(32,"kAny");
609 hTriggerClass->GetXaxis()->SetBinLabel(33,"V0AND");
610 hTriggerClass->GetXaxis()->SetBinLabel(34,"NOT kFastOnly");
611 hTriggerClass->GetXaxis()->SetBinLabel(35,"failed Physics Selection");
612 fHistograms->Add(hTriggerClass);
615 hTriggerClassSelected= new TH1F(Form("OfflineTriggerSelected %s",GetCutNumber().Data()),"OfflineTriggerSelected",34,-0.5,33.5);
616 hTriggerClassSelected->GetXaxis()->SetBinLabel( 1,"kMB");
617 hTriggerClassSelected->GetXaxis()->SetBinLabel( 2,"kINT7");
618 hTriggerClassSelected->GetXaxis()->SetBinLabel( 3,"kMUON");
619 hTriggerClassSelected->GetXaxis()->SetBinLabel( 4,"kHighMult");
620 hTriggerClassSelected->GetXaxis()->SetBinLabel( 5,"kKEMC1");
621 hTriggerClassSelected->GetXaxis()->SetBinLabel( 6,"kCINT5");
622 hTriggerClassSelected->GetXaxis()->SetBinLabel( 7,"kCMUS5/kMUSPB");
623 hTriggerClassSelected->GetXaxis()->SetBinLabel( 8,"kMUSH7/kMUSHPB");
624 hTriggerClassSelected->GetXaxis()->SetBinLabel( 9,"kMUL7/kMuonLikePB");
625 hTriggerClassSelected->GetXaxis()->SetBinLabel(10,"kMUU7/kMuonUnlikePB");
626 hTriggerClassSelected->GetXaxis()->SetBinLabel(11,"kEMC7/kEMC8");
627 hTriggerClassSelected->GetXaxis()->SetBinLabel(12,"kMUS7");
628 hTriggerClassSelected->GetXaxis()->SetBinLabel(13,"kPHI1");
629 hTriggerClassSelected->GetXaxis()->SetBinLabel(14,"kPHI7/kPHI8/kPHOSPb");
630 hTriggerClassSelected->GetXaxis()->SetBinLabel(15,"kEMCEJE");
631 hTriggerClassSelected->GetXaxis()->SetBinLabel(16,"kEMCEGA");
632 hTriggerClassSelected->GetXaxis()->SetBinLabel(17,"kCentral");
633 hTriggerClassSelected->GetXaxis()->SetBinLabel(18,"kSemiCentral");
634 hTriggerClassSelected->GetXaxis()->SetBinLabel(19,"kDG5");
635 hTriggerClassSelected->GetXaxis()->SetBinLabel(20,"kZED");
636 hTriggerClassSelected->GetXaxis()->SetBinLabel(21,"kSPI7/kSPI");
637 hTriggerClassSelected->GetXaxis()->SetBinLabel(22,"kINT8");
638 hTriggerClassSelected->GetXaxis()->SetBinLabel(23,"kMuonSingleLowPt8");
639 hTriggerClassSelected->GetXaxis()->SetBinLabel(24,"kMuonSingleHighPt8");
640 hTriggerClassSelected->GetXaxis()->SetBinLabel(25,"kMuonLikeLowPt8");
641 hTriggerClassSelected->GetXaxis()->SetBinLabel(26,"kMuonUnlikeLowPt8");
642 hTriggerClassSelected->GetXaxis()->SetBinLabel(27,"kMuonUnlikeLowPt0");
643 hTriggerClassSelected->GetXaxis()->SetBinLabel(28,"kUserDefined");
644 hTriggerClassSelected->GetXaxis()->SetBinLabel(29,"kTRD");
645 hTriggerClassSelected->GetXaxis()->SetBinLabel(30,"kFastOnly");
646 hTriggerClassSelected->GetXaxis()->SetBinLabel(31,"kAnyINT");
647 hTriggerClassSelected->GetXaxis()->SetBinLabel(32,"kAny");
648 hTriggerClassSelected->GetXaxis()->SetBinLabel(33,"V0AND");
649 hTriggerClassSelected->GetXaxis()->SetBinLabel(34,"NOT kFastOnly");
650 fHistograms->Add(hTriggerClassSelected);
652 TH1::AddDirectory(kTRUE);
655 //________________________________________________________________________
656 Bool_t AliConversionCuts::InitPIDResponse(){
657 // Set Pointer to AliPIDResponse
659 AliAnalysisManager *man=AliAnalysisManager::GetAnalysisManager();
661 AliInputEventHandler* inputHandler = (AliInputEventHandler*) (man->GetInputEventHandler());
662 fPIDResponse = (AliPIDResponse*)inputHandler->GetPIDResponse();
663 if(fPIDResponse)return kTRUE;
670 ///________________________________________________________________________
671 Bool_t AliConversionCuts::EventIsSelected(AliVEvent *fInputEvent, AliVEvent *fMCEvent){
672 // Process Event Selection
675 if(hV0EventCuts)hV0EventCuts->Fill(cutindex);
678 // Check for MC event
679 if(fMCEvent && fInputEvent->IsA()==AliESDEvent::Class()){
680 // Check if MC event is correctly loaded
681 AliMCEventHandler* mcHandler = dynamic_cast<AliMCEventHandler*> (AliAnalysisManager::GetAnalysisManager()->GetMCtruthEventHandler());
686 if (!mcHandler->InitOk() ){
690 if (!mcHandler->TreeK() ){
694 if (!mcHandler->TreeTR() ) {
701 // cout << "before event trigger" << endl;
702 if(!IsTriggerSelected(fInputEvent)){
703 if(hV0EventCuts)hV0EventCuts->Fill(cutindex);
709 if(fInputEvent->IsA()==AliESDEvent::Class()){
710 AliTriggerAnalysis fTriggerAnalysis;// = new AliTriggerAnalysis;
711 fHasV0AND = fTriggerAnalysis.IsOfflineTriggerFired((AliESDEvent*)fInputEvent, AliTriggerAnalysis::kV0AND);
712 if(fHasV0AND&&hTriggerClass)hTriggerClass->Fill(32);
714 // cout << "event number " << ((AliESDEvent*)fInputEvent)->GetEventNumberInFile() << " entered"<< endl;
717 // Number of Contributors Cut
718 if(GetNumberOfContributorsVtx(fInputEvent)<=0) {
719 if(hV0EventCuts)hV0EventCuts->Fill(cutindex);
725 // Z Vertex Position Cut
726 if(!VertexZCut(fInputEvent)){
727 if(hV0EventCuts)hV0EventCuts->Fill(cutindex);
736 if(fInputEvent->IsPileupFromSPD(3,0.8,3.,2.,5.)){
737 if(hV0EventCuts)hV0EventCuts->Fill(cutindex);
744 // Centrality Selection
745 if(!IsCentralitySelected(fInputEvent,fMCEvent)){
746 if(hV0EventCuts)hV0EventCuts->Fill(cutindex);
752 // Fill Event Histograms
753 if(hV0EventCuts)hV0EventCuts->Fill(cutindex);
754 if(hVertexZ)hVertexZ->Fill(fInputEvent->GetPrimaryVertex()->GetZ());
755 if(hCentrality)hCentrality->Fill(GetCentrality(fInputEvent));
756 if(hCentralityVsNumberOfPrimaryTracks)
757 hCentralityVsNumberOfPrimaryTracks->Fill(GetCentrality(fInputEvent),
758 ((AliV0ReaderV1*)AliAnalysisManager::GetAnalysisManager()
759 ->GetTask("V0ReaderV1"))->GetNumberOfPrimaryTracks());
764 ///________________________________________________________________________
765 Bool_t AliConversionCuts::PhotonIsSelectedMC(TParticle *particle,AliStack *fMCStack,Bool_t checkForConvertedGamma){
766 // MonteCarlo Photon Selection
768 if(!fMCStack)return kFALSE;
770 if (particle->GetPdgCode() == 22){
773 if( particle->Eta() > (fEtaCut + fEtaShift) || particle->Eta() < (-fEtaCut + fEtaShift) )
776 if( particle->Eta() < (fEtaCutMin + fEtaShift) && particle->Eta() > (-fEtaCutMin + fEtaShift) )
780 if(particle->GetMother(0) >-1 && fMCStack->Particle(particle->GetMother(0))->GetPdgCode() == 22){
781 return kFALSE; // no photon as mothers!
784 if(particle->GetMother(0) >= fMCStack->GetNprimary()){
785 return kFALSE; // the gamma has a mother, and it is not a primary particle
788 if(!checkForConvertedGamma) return kTRUE; // return in case of accepted gamma
790 // looking for conversion gammas (electron + positron from pairbuilding (= 5) )
791 TParticle* ePos = NULL;
792 TParticle* eNeg = NULL;
794 if(particle->GetNDaughters() >= 2){
795 for(Int_t daughterIndex=particle->GetFirstDaughter();daughterIndex<=particle->GetLastDaughter();daughterIndex++){
796 TParticle *tmpDaughter = fMCStack->Particle(daughterIndex);
797 if(tmpDaughter->GetUniqueID() == 5){
798 if(tmpDaughter->GetPdgCode() == 11){
800 } else if(tmpDaughter->GetPdgCode() == -11){
807 if(ePos == NULL || eNeg == NULL){ // means we do not have two daughters from pair production
811 if(ePos->Pt()<fSinglePtCut || eNeg->Pt()<fSinglePtCut){
812 return kFALSE; // no reconstruction below the Pt cut
815 if( ePos->Eta() > (fEtaCut + fEtaShift) || ePos->Eta() < (-fEtaCut + fEtaShift) ||
816 eNeg->Eta() > (fEtaCut + fEtaShift) || eNeg->Eta() < (-fEtaCut + fEtaShift) )
819 if(fEtaCutMin > -0.1){
820 if( (ePos->Eta() < (fEtaCutMin + fEtaShift) && ePos->Eta() > (-fEtaCutMin + fEtaShift)) ||
821 (eNeg->Eta() < (fEtaCutMin + fEtaShift) && eNeg->Eta() > (-fEtaCutMin + fEtaShift)) )
826 return kFALSE; // cuts on distance from collision point
829 if(abs(ePos->Vz()) > fMaxZ){
830 return kFALSE; // outside material
832 if(abs(eNeg->Vz()) > fMaxZ){
833 return kFALSE; // outside material
836 if( ePos->R() <= ((abs(ePos->Vz()) * fLineCutZRSlope) - fLineCutZValue)){
837 return kFALSE; // line cut to exclude regions where we do not reconstruct
838 } else if ( fEtaCutMin != -0.1 && ePos->R() >= ((abs(ePos->Vz()) * fLineCutZRSlopeMin) - fLineCutZValueMin)){
842 if( eNeg->R() <= ((abs(eNeg->Vz()) * fLineCutZRSlope) - fLineCutZValue)){
843 return kFALSE; // line cut to exclude regions where we do not reconstruct
844 } else if ( fEtaCutMin != -0.1 && eNeg->R() >= ((abs(eNeg->Vz()) * fLineCutZRSlopeMin) - fLineCutZValueMin)){
849 //if(AcceptanceCut(particle,ePos,eNeg))return kTRUE;
853 ///________________________________________________________________________
854 Bool_t AliConversionCuts::PhotonIsSelectedAODMC(AliAODMCParticle *particle,TClonesArray *aodmcArray,Bool_t checkForConvertedGamma){
855 // MonteCarlo Photon Selection
857 if(!aodmcArray)return kFALSE;
859 if (particle->GetPdgCode() == 22){
860 if( particle->Eta() > (fEtaCut + fEtaShift) || particle->Eta() < (-fEtaCut + fEtaShift) )
863 if( particle->Eta() < (fEtaCutMin + fEtaShift) && particle->Eta() > (-fEtaCutMin + fEtaShift) )
867 if(particle->GetMother() > -1){
868 if((static_cast<AliAODMCParticle*>(aodmcArray->At(particle->GetMother())))->GetPdgCode() == 22){
869 return kFALSE; // no photon as mothers!
871 if(!(static_cast<AliAODMCParticle*>(aodmcArray->At(particle->GetMother()))->IsPrimary())){
872 return kFALSE; // the gamma has a mother, and it is not a primary particle
876 if(!checkForConvertedGamma) return kTRUE; // return in case of accepted gamma
878 // looking for conversion gammas (electron + positron from pairbuilding (= 5) )
879 AliAODMCParticle* ePos = NULL;
880 AliAODMCParticle* eNeg = NULL;
882 if(particle->GetNDaughters() >= 2){
883 for(Int_t daughterIndex=particle->GetDaughter(0);daughterIndex<=particle->GetDaughter(1);daughterIndex++){
884 AliAODMCParticle *tmpDaughter = static_cast<AliAODMCParticle*>(aodmcArray->At(daughterIndex));
885 if(!tmpDaughter) continue;
886 if(((tmpDaughter->GetMCProcessCode())) == 5){ // STILL A BUG IN ALIROOT >>8 HAS TPO BE REMOVED AFTER FIX
887 if(tmpDaughter->GetPdgCode() == 11){
889 } else if(tmpDaughter->GetPdgCode() == -11){
896 if(ePos == NULL || eNeg == NULL){ // means we do not have two daughters from pair production
900 if(ePos->Pt()<fSinglePtCut || eNeg->Pt()<fSinglePtCut){
901 return kFALSE; // no reconstruction below the Pt cut
904 if( ePos->Eta() > (fEtaCut + fEtaShift) || ePos->Eta() < (-fEtaCut + fEtaShift) ||
905 eNeg->Eta() > (fEtaCut + fEtaShift) || eNeg->Eta() < (-fEtaCut + fEtaShift) )
908 if(fEtaCutMin > -0.1){
909 if( (ePos->Eta() < (fEtaCutMin + fEtaShift) && ePos->Eta() > (-fEtaCutMin + fEtaShift)) ||
910 (eNeg->Eta() < (fEtaCutMin + fEtaShift) && eNeg->Eta() > (-fEtaCutMin + fEtaShift)) )
914 Double_t rPos = sqrt( (ePos->Xv()*ePos->Xv()) + (ePos->Yv()*ePos->Yv()) );
915 Double_t rNeg = sqrt( (eNeg->Xv()*eNeg->Xv()) + (eNeg->Yv()*eNeg->Yv()) );
918 return kFALSE; // cuts on distance from collision point
920 if(abs(ePos->Zv()) > fMaxZ){
921 return kFALSE; // outside material
923 if(abs(eNeg->Zv()) > fMaxZ){
924 return kFALSE; // outside material
927 if( rPos <= ((abs(ePos->Zv()) * fLineCutZRSlope) - fLineCutZValue)){
928 return kFALSE; // line cut to exclude regions where we do not reconstruct
929 } else if ( fEtaCutMin != -0.1 && rPos >= ((abs(ePos->Zv()) * fLineCutZRSlopeMin) - fLineCutZValueMin)){
933 if( rNeg <= ((abs(eNeg->Zv()) * fLineCutZRSlope) - fLineCutZValue)){
934 return kFALSE; // line cut to exclude regions where we do not reconstruct
935 } else if ( fEtaCutMin != -0.1 && rNeg >= ((abs(eNeg->Zv()) * fLineCutZRSlopeMin) - fLineCutZValueMin)){
940 //if(AcceptanceCut(particle,ePos,eNeg))return kTRUE;
944 ///________________________________________________________________________
945 Bool_t AliConversionCuts::PhotonCuts(AliConversionPhotonBase *photon,AliVEvent *event)
946 { // Specific Photon Cuts
949 if(hPhotonCuts)hPhotonCuts->Fill(cutIndex);
952 // Fill Histos before Cuts
953 if(hInvMassbefore)hInvMassbefore->Fill(photon->GetMass());
955 if(hArmenterosbefore)hArmenterosbefore->Fill(photon->GetArmenterosAlpha(),photon->GetArmenterosQt());
957 // Gamma selection based on QT from Armenteros
958 if(fDoQtGammaSelection == kTRUE){
959 if(!ArmenterosQtCut(photon)){
960 if(hPhotonCuts)hPhotonCuts->Fill(cutIndex); //1
967 if(photon->GetChi2perNDF() > fChi2CutConversion || photon->GetChi2perNDF() <=0){
969 if(hPhotonCuts)hPhotonCuts->Fill(cutIndex); //2
975 // Reconstruction Acceptance Cuts
976 if(!AcceptanceCuts(photon)){
977 if(hPhotonCuts)hPhotonCuts->Fill(cutIndex); //3
983 if(fDoPhotonAsymmetryCut == kTRUE){
984 if(!AsymmetryCut(photon,event)){
985 if(hPhotonCuts)hPhotonCuts->Fill(cutIndex); //4
990 //Check the pid probability
992 if(!PIDProbabilityCut(photon, event)) {
993 if(hPhotonCuts)hPhotonCuts->Fill(cutIndex); //5
998 if(!CorrectedTPCClusterCut(photon, event)) {
999 if(hPhotonCuts)hPhotonCuts->Fill(cutIndex); //6
1005 if(!PsiPairCut(photon)) {
1006 if(hPhotonCuts)hPhotonCuts->Fill(cutIndex); //7
1011 if(!CosinePAngleCut(photon, event)) {
1012 if(hPhotonCuts)hPhotonCuts->Fill(cutIndex); //8
1016 AliAODConversionPhoton* photonAOD = dynamic_cast<AliAODConversionPhoton*>(photon);
1018 photonAOD->CalculateDistanceOfClossetApproachToPrimVtx(event->GetPrimaryVertex());
1021 if(photonAOD->GetDCArToPrimVtx() > fDCARPrimVtxCut) { //DCA R cut of photon to primary vertex
1022 if(hPhotonCuts)hPhotonCuts->Fill(cutIndex); //9
1027 if(abs(photonAOD->GetDCAzToPrimVtx()) > fDCAZPrimVtxCut) { //DCA Z cut of photon to primary vertex
1028 if(hPhotonCuts)hPhotonCuts->Fill(cutIndex); //10
1036 if(hPhotonCuts)hPhotonCuts->Fill(cutIndex); //11
1038 // Histos after Cuts
1039 if(hInvMassafter)hInvMassafter->Fill(photon->GetMass());
1040 if(hArmenterosafter)hArmenterosafter->Fill(photon->GetArmenterosAlpha(),photon->GetArmenterosQt());
1046 ///________________________________________________________________________
1047 Bool_t AliConversionCuts::CorrectedTPCClusterCut(AliConversionPhotonBase *photon, AliVEvent * event)
1048 { //Cut on corrected TPC Cluster Info
1050 AliVTrack * negTrack = GetTrack(event, photon->GetTrackLabelNegative());
1051 AliVTrack * posTrack = GetTrack(event, photon->GetTrackLabelPositive());
1053 if(!negTrack||!posTrack)return kFALSE;
1055 Double_t negclsToF=0;
1057 if (!fUseCorrectedTPCClsInfo ){
1058 if(negTrack->GetTPCNclsF()!=0){
1059 negclsToF = (Double_t)negTrack->GetNcls(1)/(Double_t)negTrack->GetTPCNclsF();}// Ncluster/Nfindablecluster
1062 negclsToF = negTrack->GetTPCClusterInfo(2,0,GetFirstTPCRow(photon->GetConversionRadius()));
1065 Double_t posclsToF = 0.;
1066 if (!fUseCorrectedTPCClsInfo ){
1067 if(posTrack->GetTPCNclsF()!=0){
1068 posclsToF = (Double_t)posTrack->GetNcls(1)/(Double_t)posTrack->GetTPCNclsF();
1071 posclsToF = posTrack->GetTPCClusterInfo(2,0,GetFirstTPCRow(photon->GetConversionRadius()));
1074 if( negclsToF < fMinClsTPCToF || posclsToF < fMinClsTPCToF ){
1081 ///________________________________________________________________________
1082 Bool_t AliConversionCuts::PhotonIsSelected(AliConversionPhotonBase *photon, AliVEvent * event)
1084 //Selection of Reconstructed Photons
1086 FillPhotonCutIndex(kPhotonIn);
1088 if(event->IsA()==AliESDEvent::Class()) {
1089 if(!SelectV0Finder( ( ((AliESDEvent*)event)->GetV0(photon->GetV0Index()))->GetOnFlyStatus() ) ){
1090 FillPhotonCutIndex(kOnFly);
1094 // else if(event->IsA()==AliAODEvent::Class()) {
1095 // if(!SelectV0Finder( ( ((AliAODEvent*)event)->GetV0(photon->GetV0Index())) ) ){
1096 // FillPhotonCutIndex(kOnFly);
1102 AliVTrack * negTrack = GetTrack(event, photon->GetTrackLabelNegative());
1103 AliVTrack * posTrack = GetTrack(event, photon->GetTrackLabelPositive());
1105 if(!negTrack || !posTrack) {
1106 FillPhotonCutIndex(kNoTracks);
1109 photon->DeterminePhotonQuality(negTrack,posTrack);
1111 if(!TracksAreSelected(negTrack, posTrack)){
1112 FillPhotonCutIndex(kTrackCuts);
1117 if(!dEdxCuts(negTrack) || !dEdxCuts(posTrack)) {
1118 FillPhotonCutIndex(kdEdxCuts);
1123 if(!PhotonCuts(photon,event)){
1124 FillPhotonCutIndex(kPhotonCuts);
1128 // Photon passed cuts
1129 FillPhotonCutIndex(kPhotonOut);
1133 ///________________________________________________________________________
1134 Bool_t AliConversionCuts::ArmenterosQtCut(AliConversionPhotonBase *photon)
1135 { // Armenteros Qt Cut
1137 if(fDoHighPtQtGammaSelection){
1138 if(photon->GetPhotonPt() < fPtBorderForQt){
1139 if(photon->GetArmenterosQt()>fQtMax){
1143 if(photon->GetArmenterosQt()>fHighPtQtMax){
1149 if(photon->GetArmenterosQt()>fQtMax){
1157 ///________________________________________________________________________
1158 Bool_t AliConversionCuts::AcceptanceCuts(AliConversionPhotonBase *photon) {
1159 // Exclude certain areas for photon reconstruction
1162 if(hAcceptanceCuts)hAcceptanceCuts->Fill(cutIndex);
1165 if(photon->GetConversionRadius()>fMaxR){ // cuts on distance from collision point
1166 if(hAcceptanceCuts)hAcceptanceCuts->Fill(cutIndex);
1171 if(photon->GetConversionRadius()<fMinR){ // cuts on distance from collision point
1172 if(hAcceptanceCuts)hAcceptanceCuts->Fill(cutIndex);
1177 if(photon->GetConversionRadius() <= ((abs(photon->GetConversionZ())*fLineCutZRSlope)-fLineCutZValue)){
1178 if(hAcceptanceCuts)hAcceptanceCuts->Fill(cutIndex);
1181 else if (fUseEtaMinCut && photon->GetConversionRadius() >= ((abs(photon->GetConversionZ())*fLineCutZRSlopeMin)-fLineCutZValueMin )){
1182 if(hAcceptanceCuts)hAcceptanceCuts->Fill(cutIndex);
1187 if(abs(photon->GetConversionZ()) > fMaxZ ){ // cuts out regions where we do not reconstruct
1188 if(hAcceptanceCuts)hAcceptanceCuts->Fill(cutIndex);
1194 if( photon->GetPhotonEta() > (fEtaCut + fEtaShift) || photon->GetPhotonEta() < (-fEtaCut + fEtaShift) ){
1195 if(hAcceptanceCuts)hAcceptanceCuts->Fill(cutIndex);
1198 if(fEtaCutMin>-0.1){
1199 if( photon->GetPhotonEta() < (fEtaCutMin + fEtaShift) && photon->GetPhotonEta() > (-fEtaCutMin + fEtaShift) ){
1200 if(hAcceptanceCuts)hAcceptanceCuts->Fill(cutIndex);
1206 if(photon->GetPhotonPt()<fPtCut){
1207 if(hAcceptanceCuts)hAcceptanceCuts->Fill(cutIndex);
1212 if(hAcceptanceCuts)hAcceptanceCuts->Fill(cutIndex);
1218 ///________________________________________________________________________
1219 Bool_t AliConversionCuts::SpecificTrackCuts(AliAODTrack * negTrack, AliAODTrack * posTrack,Int_t &cutIndex) {
1220 // Track Cuts which require AOD/ESD specific implementation
1222 if( !negTrack->IsOn(AliESDtrack::kTPCrefit) || !posTrack->IsOn(AliESDtrack::kTPCrefit) ) {
1223 if(hTrackCuts)hTrackCuts->Fill(cutIndex);
1228 AliAODVertex * NegVtxType=negTrack->GetProdVertex();
1229 AliAODVertex * PosVtxType=posTrack->GetProdVertex();
1230 if( (NegVtxType->GetType())==AliAODVertex::kKink || (PosVtxType->GetType())==AliAODVertex::kKink) {
1231 if(hTrackCuts)hTrackCuts->Fill(cutIndex);
1239 ///________________________________________________________________________
1240 Bool_t AliConversionCuts::SpecificTrackCuts(AliESDtrack * negTrack, AliESDtrack * posTrack,Int_t &cutIndex) {
1241 // Track Cuts which require AOD/ESD specific implementation
1243 if( !negTrack->IsOn(AliESDtrack::kTPCrefit) || !posTrack->IsOn(AliESDtrack::kTPCrefit) ) {
1244 if(hTrackCuts)hTrackCuts->Fill(cutIndex);
1249 if(negTrack->GetKinkIndex(0) > 0 || posTrack->GetKinkIndex(0) > 0 ) {
1250 if(hTrackCuts)hTrackCuts->Fill(cutIndex);
1258 ///________________________________________________________________________
1259 Bool_t AliConversionCuts::TracksAreSelected(AliVTrack * negTrack, AliVTrack * posTrack) {
1260 // Track Selection for Photon Reconstruction
1263 if(hTrackCuts)hTrackCuts->Fill(cutIndex);
1267 if(negTrack->Charge() == posTrack->Charge()) {
1268 if(hTrackCuts)hTrackCuts->Fill(cutIndex);
1273 // Number of TPC Clusters
1276 if( negTrack->GetNcls(1) < fMinClsTPC || posTrack->GetNcls(1) < fMinClsTPC ) {
1277 if(hTrackCuts)hTrackCuts->Fill(cutIndex);
1283 if( posTrack->Eta() > (fEtaCut + fEtaShift) || posTrack->Eta() < (-fEtaCut + fEtaShift) ||
1284 negTrack->Eta() > (fEtaCut + fEtaShift) || negTrack->Eta() < (-fEtaCut + fEtaShift) ){
1285 if(hTrackCuts)hTrackCuts->Fill(cutIndex);
1288 if(fEtaCutMin>-0.1){
1289 if( (posTrack->Eta() < (fEtaCutMin + fEtaShift) && posTrack->Eta() > (-fEtaCutMin + fEtaShift)) ||
1290 (negTrack->Eta() < (fEtaCutMin + fEtaShift) && negTrack->Eta() > (-fEtaCutMin + fEtaShift)) ){
1291 if(hTrackCuts)hTrackCuts->Fill(cutIndex);
1298 if( negTrack->Pt()< fSinglePtCut || posTrack->Pt()< fSinglePtCut){
1299 if(hTrackCuts)hTrackCuts->Fill(cutIndex);
1304 // AOD ESD specific cuts
1305 Bool_t passCuts = kTRUE;
1307 if(negTrack->IsA()==AliAODTrack::Class()) {
1308 passCuts = passCuts * SpecificTrackCuts(static_cast<AliAODTrack*>(negTrack), static_cast<AliAODTrack*>(posTrack),cutIndex);
1310 passCuts = passCuts * SpecificTrackCuts(static_cast<AliESDtrack*>(negTrack), static_cast<AliESDtrack*>(posTrack),cutIndex);
1314 if(hTrackCuts)hTrackCuts->Fill(cutIndex);
1319 if(hTrackCuts)hTrackCuts->Fill(cutIndex);
1325 ///________________________________________________________________________
1326 Bool_t AliConversionCuts::dEdxCuts(AliVTrack *fCurrentTrack){
1327 // Electron Identification Cuts for Photon reconstruction
1329 if(!fPIDResponse){InitPIDResponse();}// Try to reinitialize PID Response
1330 if(!fPIDResponse){AliError("No PID Response"); return kTRUE;}// if still missing fatal error
1333 if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);
1334 if(hTPCdEdxSigbefore)hTPCdEdxSigbefore->Fill(fCurrentTrack->P(),fPIDResponse->NumberOfSigmasTPC(fCurrentTrack, AliPID::kElectron));
1335 if(hTPCdEdxbefore)hTPCdEdxbefore->Fill(fCurrentTrack->P(),fCurrentTrack->GetTPCsignal());
1339 if(fDodEdxSigmaCut == kTRUE){
1340 // TPC Electron Line
1341 if( fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kElectron)<fPIDnSigmaBelowElectronLine ||
1342 fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kElectron)>fPIDnSigmaAboveElectronLine){
1344 if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);
1350 if( fCurrentTrack->P()>fPIDMinPnSigmaAbovePionLine && fCurrentTrack->P()<fPIDMaxPnSigmaAbovePionLine ){
1351 if(fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kElectron)>fPIDnSigmaBelowElectronLine &&
1352 fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kElectron)<fPIDnSigmaAboveElectronLine&&
1353 fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kPion)<fPIDnSigmaAbovePionLine){
1355 if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);
1362 if( fCurrentTrack->P()>fPIDMaxPnSigmaAbovePionLine ){
1363 if(fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kElectron)>fPIDnSigmaBelowElectronLine &&
1364 fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kElectron)<fPIDnSigmaAboveElectronLine &&
1365 fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kPion)<fPIDnSigmaAbovePionLineHighPt){
1367 if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);
1375 if(fDoKaonRejectionLowP == kTRUE){
1376 if(fCurrentTrack->P()<fPIDMinPKaonRejectionLowP ){
1377 if( abs(fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kKaon))<fPIDnSigmaAtLowPAroundKaonLine){
1379 if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);
1386 if(fDoProtonRejectionLowP == kTRUE){
1387 if( fCurrentTrack->P()<fPIDMinPProtonRejectionLowP ){
1388 if( abs(fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kProton))<fPIDnSigmaAtLowPAroundProtonLine){
1390 if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);
1397 if(fDoPionRejectionLowP == kTRUE){
1398 if( fCurrentTrack->P()<fPIDMinPPionRejectionLowP ){
1399 if( abs(fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kPion))<fPIDnSigmaAtLowPAroundPionLine){
1401 if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);
1409 // cout<<"Start"<<endl;
1410 // AliPIDResponse::EDetPidStatus status=fPIDResponse->CheckPIDStatus(AliPIDResponse::kTOF,fCurrentTrack);
1412 // if( ( (status & AliVTrack::kTOFout) == AliVTrack::kTOFout ) && ( (status & AliVTrack::kTIME) == AliVTrack::kTIME ))
1413 // {cout<<"TOF DA"<<endl;}
1414 // if(status == AliPIDResponse::kDetPidOk){
1415 // Float_t probMis = fPIDResponse->GetTOFMismatchProbability(fCurrentTrack);
1416 // cout<<"--> "<<probMis<<endl;
1417 // if(probMis > 0.01){
1422 if((fCurrentTrack->GetStatus() & AliESDtrack::kTOFpid) && !(fCurrentTrack->GetStatus() & AliESDtrack::kTOFmismatch)){
1424 Double_t t0 = fPIDResponse->GetTOFResponse().GetStartTime(fCurrentTrack->P());
1426 fCurrentTrack->GetIntegratedTimes(times);
1427 Double_t TOFsignal = fCurrentTrack->GetTOFsignal();
1428 Double_t dT = TOFsignal - t0 - times[0];
1429 hTOFbefore->Fill(fCurrentTrack->P(),dT);
1431 if(hTOFSigbefore) hTOFSigbefore->Fill(fCurrentTrack->P(),fPIDResponse->NumberOfSigmasTOF(fCurrentTrack, AliPID::kElectron));
1433 if(fPIDResponse->NumberOfSigmasTOF(fCurrentTrack, AliPID::kElectron)>fTofPIDnSigmaAboveElectronLine ||
1434 fPIDResponse->NumberOfSigmasTOF(fCurrentTrack, AliPID::kElectron)<fTofPIDnSigmaBelowElectronLine ){
1435 if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);
1439 if(hTOFSigafter)hTOFSigafter->Fill(fCurrentTrack->P(),fPIDResponse->NumberOfSigmasTOF(fCurrentTrack, AliPID::kElectron));
1445 if(!fPIDResponse->IdentifiedAsElectronTRD(fCurrentTrack,fPIDTRDEfficiency)){
1446 if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);
1452 if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);
1453 if(hTPCdEdxSigafter)hTPCdEdxSigafter->Fill(fCurrentTrack->P(),fPIDResponse->NumberOfSigmasTPC(fCurrentTrack, AliPID::kElectron));
1454 if(hTPCdEdxafter)hTPCdEdxafter->Fill(fCurrentTrack->P(),fCurrentTrack->GetTPCsignal());
1458 ///________________________________________________________________________
1459 Bool_t AliConversionCuts::AsymmetryCut(AliConversionPhotonBase * photon,AliVEvent *event) {
1460 // Cut on Energy Assymetry
1462 for(Int_t ii=0;ii<2;ii++){
1464 AliVTrack *track=GetTrack(event,photon->GetTrackLabel(ii));
1466 if( track->P() > fMinPPhotonAsymmetryCut ){
1467 Double_t trackNegAsy=0;
1468 if (photon->GetPhotonP()!=0.){
1469 trackNegAsy= track->P()/photon->GetPhotonP();
1472 if( trackNegAsy<fMinPhotonAsymmetry ||trackNegAsy>(1.- fMinPhotonAsymmetry)){
1481 ///________________________________________________________________________
1482 AliVTrack *AliConversionCuts::GetTrack(AliVEvent * event, Int_t label){
1483 //Returns pointer to the track with given ESD label
1484 //(Important for AOD implementation, since Track array in AOD data is different
1485 //from ESD array, but ESD tracklabels are stored in AOD Tracks)
1487 AliESDEvent * esdEvent = dynamic_cast<AliESDEvent*>(event);
1489 if(label > event->GetNumberOfTracks() ) return NULL;
1490 AliESDtrack * track = esdEvent->GetTrack(label);
1494 AliVTrack * track = 0x0;
1495 if(((AliV0ReaderV1*)AliAnalysisManager::GetAnalysisManager()->GetTask("V0ReaderV1"))->AreAODsRelabeled()){
1496 track = dynamic_cast<AliVTrack*>(event->GetTrack(label));
1500 for(Int_t ii=0; ii<event->GetNumberOfTracks(); ii++) {
1501 track = dynamic_cast<AliVTrack*>(event->GetTrack(ii));
1503 if(track->GetID() == label) {
1510 //AliDebug(5,(Form("track not found %d %d",label,event->GetNumberOfTracks()));
1514 ///________________________________________________________________________
1515 AliESDtrack *AliConversionCuts::GetESDTrack(AliESDEvent * event, Int_t label){
1516 //Returns pointer to the track with given ESD label
1517 //(Important for AOD implementation, since Track array in AOD data is different
1518 //from ESD array, but ESD tracklabels are stored in AOD Tracks)
1521 if(label > event->GetNumberOfTracks() ) return NULL;
1522 AliESDtrack * track = event->GetTrack(label);
1525 //AliDebug(5,(Form("track not found %d %d",label,event->GetNumberOfTracks()));
1531 ///________________________________________________________________________
1532 Bool_t AliConversionCuts::PIDProbabilityCut(AliConversionPhotonBase *photon, AliVEvent * event){
1533 // Cut on Electron Probability for Photon Reconstruction
1535 AliESDEvent * esdEvent = dynamic_cast<AliESDEvent*>(event);
1539 Bool_t iResult=kFALSE;
1541 Double_t *posProbArray = new Double_t[AliPID::kSPECIES];
1542 Double_t *negProbArray = new Double_t[AliPID::kSPECIES];
1544 AliESDtrack* negTrack = esdEvent->GetTrack(photon->GetTrackLabelNegative());
1545 AliESDtrack* posTrack = esdEvent->GetTrack(photon->GetTrackLabelPositive());
1547 if(negProbArray && posProbArray){
1549 negTrack->GetTPCpid(negProbArray);
1550 posTrack->GetTPCpid(posProbArray);
1552 if(negProbArray[AliPID::kElectron]>=fPIDProbabilityCutNegativeParticle && posProbArray[AliPID::kElectron]>=fPIDProbabilityCutPositiveParticle){
1557 delete [] posProbArray;
1558 delete [] negProbArray;
1562 ///Not possible for AODs
1572 ///________________________________________________________________________
1573 Bool_t AliConversionCuts::AcceptanceCut(TParticle *particle, TParticle * ePos,TParticle* eNeg){
1574 // MC Acceptance Cuts
1575 //(Certain areas were excluded for photon reconstruction)
1577 if(particle->R()>fMaxR){
1580 if(ePos->R()>fMaxR){
1584 if(ePos->R()<fMinR){
1588 if( ePos->R() <= ((abs(ePos->Vz())*fLineCutZRSlope)-fLineCutZValue)){
1591 else if (fUseEtaMinCut && ePos->R() >= ((abs(ePos->Vz())*fLineCutZRSlopeMin)-fLineCutZValueMin )){
1595 if(abs(eNeg->Vz()) > fMaxZ ){ // cuts out regions where we do not reconstruct
1599 if(eNeg->Vz()!=ePos->Vz()||eNeg->R()!=ePos->R()){
1603 if(abs(ePos->Vz()) > fMaxZ ){ // cuts out regions where we do not reconstruct
1608 if( particle->Eta() > (fEtaCut + fEtaShift) || particle->Eta() < (-fEtaCut + fEtaShift) ){
1611 if( ePos->Eta() > (fEtaCut + fEtaShift) || ePos->Eta() < (-fEtaCut + fEtaShift) ){
1614 if( eNeg->Eta() > (fEtaCut + fEtaShift) || eNeg->Eta() < (-fEtaCut + fEtaShift) ){
1617 if(fEtaCutMin>-0.1){
1618 if( particle->Eta() < (fEtaCutMin + fEtaShift) && particle->Eta() > (-fEtaCutMin + fEtaShift) ){
1621 if( ePos->Eta() < (fEtaCutMin + fEtaShift) && ePos->Eta() > (-fEtaCutMin + fEtaShift) ){
1624 if( eNeg->Eta() < (fEtaCutMin + fEtaShift) && eNeg->Eta() > (-fEtaCutMin + fEtaShift) ){
1629 if( ePos->Pt()< fSinglePtCut || eNeg->Pt()< fSinglePtCut){
1633 if(particle->Pt()<fPtCut){
1639 ///________________________________________________________________________
1640 Bool_t AliConversionCuts::UpdateCutString() {
1641 ///Update the cut string (if it has been created yet)
1643 if(fCutString && fCutString->GetString().Length() == kNCuts) {
1644 fCutString->SetString(GetCutNumber());
1651 void AliConversionCuts::LoadReweightingHistosMCFromFile() {
1653 AliInfo("Entering loading of histograms for weighting");
1654 TFile *f = TFile::Open(fPathTrFReweighting.Data());
1656 AliError(Form("file for weighting %s not found",fPathTrFReweighting.Data()));
1659 if (fNameHistoReweightingPi0.CompareTo("") != 0 && fDoReweightHistoMCPi0 ){
1660 hReweightMCHistPi0 = (TH1D*)f->Get(fNameHistoReweightingPi0.Data());
1661 if (hReweightMCHistPi0) AliInfo(Form("%s has been loaded from %s", fNameHistoReweightingPi0.Data(),fPathTrFReweighting.Data() ));
1662 else AliWarning(Form("%s not found in %s",fPathTrFReweighting.Data(), fNameHistoReweightingPi0.Data() ));
1664 if (fNameHistoReweightingEta.CompareTo("") != 0 && fDoReweightHistoMCEta){
1665 hReweightMCHistEta = (TH1D*)f->Get(fNameHistoReweightingEta.Data());
1666 if (hReweightMCHistEta) AliInfo(Form("%s has been loaded from %s", fNameHistoReweightingEta.Data(),fPathTrFReweighting.Data() ));
1667 else AliWarning(Form("%s not found in %s",fPathTrFReweighting.Data(), fNameHistoReweightingEta.Data() ));
1670 if (fNameHistoReweightingK0s.CompareTo("") != 0 && fDoReweightHistoMCK0s){
1671 hReweightMCHistK0s = (TH1D*)f->Get(fNameHistoReweightingK0s.Data());
1672 if (hReweightMCHistK0s) AliInfo(Form("%s has been loaded from %s", fNameHistoReweightingK0s.Data(),fPathTrFReweighting.Data() ));
1673 else AliWarning(Form("%s not found in %s",fPathTrFReweighting.Data(), fNameHistoReweightingK0s.Data() ));
1680 ///________________________________________________________________________
1681 Bool_t AliConversionCuts::InitializeCutsFromCutString(const TString analysisCutSelection ) {
1682 // Initialize Cuts from a given Cut string
1683 if(fDoReweightHistoMCPi0 || fDoReweightHistoMCEta || fDoReweightHistoMCK0s) LoadReweightingHistosMCFromFile();
1685 AliInfo(Form("Set Photoncut Number: %s",analysisCutSelection.Data()));
1686 if(analysisCutSelection.Length()!=kNCuts) {
1687 AliError(Form("Cut selection has the wrong length! size is %d, number of cuts is %d", analysisCutSelection.Length(), kNCuts));
1690 if(!analysisCutSelection.IsDigit()){
1691 AliError("Cut selection contains characters");
1695 const char *cutSelection = analysisCutSelection.Data();
1696 #define ASSIGNARRAY(i) fCuts[i] = cutSelection[i] - '0'
1697 for(Int_t ii=0;ii<kNCuts;ii++){
1701 // Set Individual Cuts
1702 for(Int_t ii=0;ii<kNCuts;ii++){
1703 if(!SetCut(cutIds(ii),fCuts[ii]))return kFALSE;
1710 ///________________________________________________________________________
1711 Bool_t AliConversionCuts::SetCut(cutIds cutID, const Int_t value) {
1712 ///Set individual cut ID
1717 if( SetV0Finder(value)) {
1718 fCuts[kv0FinderType] = value;
1721 } else return kFALSE;
1723 case kededxSigmaCut:
1724 if( SetTPCdEdxCutElectronLine(value)) {
1725 fCuts[kededxSigmaCut] = value;
1728 } else return kFALSE;
1730 case kpidedxSigmaCut:
1731 if( SetTPCdEdxCutPionLine(value)) {
1732 fCuts[kpidedxSigmaCut] = value;
1735 } else return kFALSE;
1737 case kpiMomdedxSigmaCut:
1738 if( SetMinMomPiondEdxCut(value)) {
1739 fCuts[kpiMomdedxSigmaCut] = value;
1742 } else return kFALSE;
1745 if( SetChi2GammaCut(value)) {
1746 fCuts[kchi2GammaCut] = value;
1749 } else return kFALSE;
1752 if( SetSinglePtCut(value)) {
1753 fCuts[ksinglePtCut] = value;
1756 } else return kFALSE;
1759 if( SetTPCClusterCut(value)) {
1760 fCuts[kclsTPCCut] = value;
1763 } else return kFALSE;
1766 if( SetEtaCut(value)) {
1767 fCuts[ketaCut] = value;
1770 } else return kFALSE;
1772 case kLowPRejectionSigmaCut:
1773 if( SetLowPRejectionCuts(value)) {
1774 fCuts[kLowPRejectionSigmaCut] = value;
1777 } else return kFALSE;
1780 if( SetQtMaxCut(value)) {
1781 fCuts[kQtMaxCut] = value;
1784 } else return kFALSE;
1786 case kpiMaxMomdedxSigmaCut:
1787 if( SetMaxMomPiondEdxCut(value)) {
1788 fCuts[kpiMaxMomdedxSigmaCut] = value;
1791 } else return kFALSE;
1794 if( SetRCut(value)) {
1795 fCuts[kRCut] = value;
1798 } else return kFALSE;
1801 if( SetRemovePileUp(value)) {
1802 fCuts[kremovePileUp] = value;
1805 } else return kFALSE;
1808 if( SetSelectSpecialTrigger(value)) {
1809 fCuts[kselectV0AND] = value;
1812 } else return kFALSE;
1814 case kmultiplicityMethod:
1815 if( SetMultiplicityMethod(value)) {
1816 fCuts[kmultiplicityMethod] = value;
1819 } else return kFALSE;
1822 if( SetIsHeavyIon(value)) {
1823 fCuts[kisHeavyIon] = value;
1826 } else return kFALSE;
1828 case kCentralityMin:
1829 if( SetCentralityMin(value)) {
1830 fCuts[kCentralityMin] = value;
1833 } else return kFALSE;
1835 case kCentralityMax:
1836 if( SetCentralityMax(value)) {
1837 fCuts[kCentralityMax] = value;
1840 } else return kFALSE;
1842 case kTOFelectronPID:
1843 if( SetTOFElectronPIDCut(value)) {
1844 fCuts[kTOFelectronPID] = value;
1847 } else return kFALSE;
1849 case kdoPhotonAsymmetryCut:
1850 if( SetPhotonAsymmetryCut(value)) {
1851 fCuts[kdoPhotonAsymmetryCut] = value;
1854 } else return kFALSE;
1857 if( SetPsiPairCut(value)) {
1858 fCuts[kPsiPair] = value;
1861 } else return kFALSE;
1864 if( SetCosPAngleCut(value)) {
1865 fCuts[kCosPAngle] = value;
1868 } else return kFALSE;
1872 if( SetSharedElectronCut(value)) {
1873 fCuts[kElecShare] = value;
1876 } else return kFALSE;
1879 if( SetToCloseV0sCut(value)) {
1880 fCuts[kToCloseV0s] = value;
1883 } else return kFALSE;
1886 if( SetRejectExtraSignalsCut(value)) {
1887 fCuts[kExtraSignals] = value;
1890 } else return kFALSE;
1893 if( SetDCARPhotonPrimVtxCut(value)) {
1894 fCuts[kDcaRPrimVtx] = value;
1897 } else return kFALSE;
1900 if( SetDCAZPhotonPrimVtxCut(value)) {
1901 fCuts[kDcaZPrimVtx] = value;
1904 } else return kFALSE;
1908 AliError("Cut id out of range");
1912 AliError("Cut id %d not recognized");
1917 ///________________________________________________________________________
1918 void AliConversionCuts::PrintCuts() {
1919 // Print out current Cut Selection
1920 for(Int_t ic = 0; ic < kNCuts; ic++) {
1921 printf("%-30s : %d \n", fgkCutNames[ic], fCuts[ic]);
1924 ///________________________________________________________________________
1925 Bool_t AliConversionCuts::SetIsHeavyIon(Int_t isHeavyIon)
1933 fDetectorCentrality=0;
1937 fDetectorCentrality=1;
1939 case 3: //allows to select centrality 0-45% in steps of 5% for V0 Multiplicity
1941 fDetectorCentrality=0;
1942 fModCentralityClass=1;
1944 case 4: //allows to select centrality 45-90% in steps of 5% for V0 Multiplicity
1946 fDetectorCentrality=0;
1947 fModCentralityClass=2;
1949 case 5: //strict cut on v0 tracks for MC
1951 fDetectorCentrality=0;
1952 fModCentralityClass=3;
1954 case 6: //allows to select centrality 0-45% in steps of 5% for track mult
1955 //strict cut on v0 tracks for MC
1957 fDetectorCentrality=0;
1958 fModCentralityClass=4;
1960 case 7: //allows to select centrality 45-90% in steps of 5% for V0 Multiplicity
1961 //strict cut on v0 tracks for MC
1963 fDetectorCentrality=0;
1964 fModCentralityClass=5;
1968 fDetectorCentrality=0;
1972 fDetectorCentrality=1;
1975 AliError(Form("SetHeavyIon not defined %d",isHeavyIon));
1981 //___________________________________________________________________
1982 Bool_t AliConversionCuts::SetCentralityMin(Int_t minCentrality)
1985 if(minCentrality<0||minCentrality>9){
1986 AliError(Form("minCentrality not defined %d",minCentrality));
1990 fCentralityMin=minCentrality;
1993 //___________________________________________________________________
1994 Bool_t AliConversionCuts::SetCentralityMax(Int_t maxCentrality)
1997 if(maxCentrality<0||maxCentrality>9){
1998 AliError(Form("maxCentrality not defined %d",maxCentrality));
2001 fCentralityMax=maxCentrality;
2004 ///________________________________________________________________________
2005 Int_t AliConversionCuts::SetSelectSpecialTrigger(Int_t selectSpecialTrigger)
2008 switch(selectSpecialTrigger){
2010 fSpecialTrigger=0; // dont care
2013 fSpecialTrigger=1; // V0AND
2016 fSpecialTrigger=2; // with SDD requested
2019 fSpecialTrigger=3; // V0AND plus with SDD requested
2021 // allows to run MB & 6 other different trigger classes in parallel with the same photon cut
2023 fSpecialTrigger=4; // different trigger class as MB
2024 fTriggerSelectedManually = kTRUE;
2027 fSpecialTrigger=4; // different trigger class as MB
2028 fTriggerSelectedManually = kTRUE;
2031 fSpecialTrigger=4; // different trigger class as MB
2032 fTriggerSelectedManually = kTRUE;
2035 fSpecialTrigger=4; // different trigger class as MB
2036 fTriggerSelectedManually = kTRUE;
2039 fSpecialTrigger=4; // different trigger class as MB
2040 fTriggerSelectedManually = kTRUE;
2043 fSpecialTrigger=4; // different trigger class as MB
2044 fTriggerSelectedManually = kTRUE;
2047 AliError("Warning: Special Trigger Not known");
2052 ///________________________________________________________________________
2053 Bool_t AliConversionCuts::SetMultiplicityMethod(Int_t multiplicityMethod)
2056 fMultiplicityMethod=multiplicityMethod;
2058 // 0 Photon Multiplicity
2059 // 1 TPC Track multiplicity
2065 ///________________________________________________________________________
2066 Bool_t AliConversionCuts::SetRemovePileUp(Int_t removePileUp)
2068 switch(removePileUp){
2070 fRemovePileUp=kFALSE;
2073 fRemovePileUp=kTRUE;
2076 AliError("RemovePileUpCut not defined");
2081 ///________________________________________________________________________
2082 Bool_t AliConversionCuts::SetRejectExtraSignalsCut(Int_t extraSignal) {
2084 switch(extraSignal){
2086 fRejectExtraSignals = 0;
2087 break; // No Rejection
2089 fRejectExtraSignals = 1;
2090 break; // MinBias Header
2092 fRejectExtraSignals = 2;
2093 break; // User String Array
2095 fRejectExtraSignals = 3;
2096 break; // Rejection for Gamma Correction only
2098 AliError(Form("Extra Signal Rejection not defined %d",extraSignal));
2103 ///________________________________________________________________________
2104 Bool_t AliConversionCuts::SetV0Finder(Int_t v0FinderType)
2106 switch (v0FinderType){
2107 case 0: // on fly V0 finder
2108 cout << "have chosen onfly V0" << endl;
2109 fUseOnFlyV0Finder=kTRUE;
2111 case 1: // offline V0 finder
2112 cout << "have chosen offline V0" << endl;
2113 fUseOnFlyV0Finder=kFALSE;
2116 AliError(Form(" v0FinderType not defined %d",v0FinderType));
2121 ///________________________________________________________________________
2122 Bool_t AliConversionCuts::SetEtaCut(Int_t etaCut)
2125 //Set Standard LineCutZValues
2126 fLineCutZValueMin = -2;
2127 fLineCutZValue = 7.;
2132 fLineCutZRSlope = tan(2*atan(exp(-fEtaCut)));
2134 fLineCutZRSlopeMin = 0.;
2136 case 1: // 1.2 // changed from 1.2 to 0.6 on 2013.06.10
2138 fLineCutZRSlope = tan(2*atan(exp(-fEtaCut)));
2140 fLineCutZRSlopeMin = 0.;
2144 fLineCutZRSlope = tan(2*atan(exp(-fEtaCut)));
2146 fLineCutZRSlopeMin = 0.;
2150 fLineCutZRSlope = tan(2*atan(exp(-fEtaCut)));
2152 fLineCutZRSlopeMin = 0.;
2156 fLineCutZRSlope = tan(2*atan(exp(-fEtaCut)));
2158 fLineCutZRSlopeMin = 0.;
2162 fLineCutZRSlope = tan(2*atan(exp(-fEtaCut)));
2164 fLineCutZRSlopeMin = 0.;
2168 fLineCutZRSlope = tan(2*atan(exp(-fEtaCut)));
2170 fLineCutZRSlopeMin = 0.;
2174 fLineCutZRSlope = tan(2*atan(exp(-fEtaCut)));
2176 fLineCutZRSlopeMin = 0.;
2178 // case 8: // 0.1 - 0.8
2180 // fLineCutZRSlope = tan(2*atan(exp(-fEtaCut)));
2181 // fEtaCutMin = 0.1;
2182 // fLineCutZRSlopeMin = tan(2*atan(exp(-fEtaCutMin)));
2186 fLineCutZRSlope = tan(2*atan(exp(-fEtaCut)));
2188 fLineCutZRSlopeMin = 0.;
2192 fLineCutZRSlope = tan(2*atan(exp(-fEtaCut)));
2194 fLineCutZRSlopeMin = 0.;
2197 AliError(Form(" EtaCut not defined %d",etaCut));
2202 ///________________________________________________________________________
2203 Bool_t AliConversionCuts::SetRCut(Int_t RCut){
2226 // High purity cuts for PbPb (remove first layers of material)
2249 AliError("RCut not defined");
2254 ///________________________________________________________________________
2255 Bool_t AliConversionCuts::SetSinglePtCut(Int_t singlePtCut)
2257 switch(singlePtCut){
2258 case 0: // 0.050 GeV
2259 fSinglePtCut = 0.050;
2261 case 1: // 0.100 GeV
2262 fSinglePtCut = 0.100;
2264 case 2: // 0.150 GeV
2265 fSinglePtCut = 0.150;
2267 case 3: // 0.200 GeV
2268 fSinglePtCut = 0.200;
2270 case 4: // 0.075 GeV
2271 fSinglePtCut = 0.075;
2273 case 5: // 0.125 GeV
2274 fSinglePtCut = 0.125;
2277 fSinglePtCut = 0.040;
2283 AliError(Form("singlePtCut not defined %d",singlePtCut));
2288 ///________________________________________________________________________
2289 Bool_t AliConversionCuts::SetTPCClusterCut(Int_t clsTPCCut)
2304 case 4: // 95% of findable clusters
2305 fMinClsTPCToF= 0.95;
2306 fUseCorrectedTPCClsInfo=1;
2308 case 5: // 0% of findable clusters
2310 fUseCorrectedTPCClsInfo=1;
2312 case 6: // 70% of findable clusters
2314 fUseCorrectedTPCClsInfo=1;
2316 case 7: // 0% of findable clusters
2317 fMinClsTPCToF= 0.35;
2318 fUseCorrectedTPCClsInfo=0;
2321 fMinClsTPCToF= 0.35;
2322 fUseCorrectedTPCClsInfo=1;
2326 fUseCorrectedTPCClsInfo=1;
2329 AliError(Form("Warning: clsTPCCut not defined %d",clsTPCCut));
2334 ///________________________________________________________________________
2335 Bool_t AliConversionCuts::SetTPCdEdxCutElectronLine(Int_t ededxSigmaCut)
2337 switch(ededxSigmaCut){
2339 fPIDnSigmaBelowElectronLine=-10;
2340 fPIDnSigmaAboveElectronLine=10;
2343 fPIDnSigmaBelowElectronLine=-5;
2344 fPIDnSigmaAboveElectronLine=5;
2347 fPIDnSigmaBelowElectronLine=-3;
2348 fPIDnSigmaAboveElectronLine=5;
2351 fPIDnSigmaBelowElectronLine=-4;
2352 fPIDnSigmaAboveElectronLine=5;
2355 fPIDnSigmaBelowElectronLine=-6;
2356 fPIDnSigmaAboveElectronLine=7;
2359 fPIDnSigmaBelowElectronLine=-4;
2360 fPIDnSigmaAboveElectronLine=4;
2363 fPIDnSigmaBelowElectronLine=-2.5;
2364 fPIDnSigmaAboveElectronLine=4;
2367 fPIDnSigmaBelowElectronLine=-2;
2368 fPIDnSigmaAboveElectronLine=3.5;
2371 AliError("TPCdEdxCutElectronLine not defined");
2377 ///________________________________________________________________________
2378 Bool_t AliConversionCuts::SetTPCdEdxCutPionLine(Int_t pidedxSigmaCut)
2381 switch(pidedxSigmaCut){
2383 fPIDnSigmaAbovePionLine=-10;
2384 fPIDnSigmaAbovePionLineHighPt=-10;
2387 fPIDnSigmaAbovePionLine=0;
2388 fPIDnSigmaAbovePionLineHighPt=-10;
2391 fPIDnSigmaAbovePionLine=1;
2392 fPIDnSigmaAbovePionLineHighPt=-10;
2395 fPIDnSigmaAbovePionLine=2.5;
2396 fPIDnSigmaAbovePionLineHighPt=-10;
2399 fPIDnSigmaAbovePionLine=0.5;
2400 fPIDnSigmaAbovePionLineHighPt=-10;
2403 fPIDnSigmaAbovePionLine=2.;
2404 fPIDnSigmaAbovePionLineHighPt=-10;
2407 fPIDnSigmaAbovePionLine=2.;
2408 fPIDnSigmaAbovePionLineHighPt=0.5;
2411 fPIDnSigmaAbovePionLine=3.5;
2412 fPIDnSigmaAbovePionLineHighPt=-10;
2415 fPIDnSigmaAbovePionLine=2.;
2416 fPIDnSigmaAbovePionLineHighPt=1.;
2419 fPIDnSigmaAbovePionLine=3.0; // We need a bit less tight cut on dE/dx
2420 fPIDnSigmaAbovePionLineHighPt=-10;
2423 AliError(Form("Warning: pidedxSigmaCut not defined %d",pidedxSigmaCut));
2428 ///________________________________________________________________________
2429 Bool_t AliConversionCuts::SetMinMomPiondEdxCut(Int_t piMomdedxSigmaCut)
2431 switch(piMomdedxSigmaCut){
2433 fPIDMinPnSigmaAbovePionLine=0.5;
2436 fPIDMinPnSigmaAbovePionLine=1.;
2439 fPIDMinPnSigmaAbovePionLine=1.5;
2442 fPIDMinPnSigmaAbovePionLine=20.;
2445 fPIDMinPnSigmaAbovePionLine=50.;
2448 fPIDMinPnSigmaAbovePionLine=0.3;
2451 fPIDMinPnSigmaAbovePionLine=0.25;
2454 fPIDMinPnSigmaAbovePionLine=0.4;
2457 fPIDMinPnSigmaAbovePionLine=0.2;
2460 AliError(Form("piMomdedxSigmaCut not defined %d",piMomdedxSigmaCut));
2465 ///________________________________________________________________________
2466 Bool_t AliConversionCuts::SetMaxMomPiondEdxCut(Int_t piMaxMomdedxSigmaCut)
2468 switch(piMaxMomdedxSigmaCut){
2470 fPIDMaxPnSigmaAbovePionLine=100.;
2473 fPIDMaxPnSigmaAbovePionLine=5.;
2476 fPIDMaxPnSigmaAbovePionLine=4.;
2479 fPIDMaxPnSigmaAbovePionLine=3.5;
2482 fPIDMaxPnSigmaAbovePionLine=3.;
2485 fPIDMaxPnSigmaAbovePionLine=7.;
2488 AliError(Form("piMaxMomdedxSigmaCut not defined %d",piMaxMomdedxSigmaCut));
2493 ///________________________________________________________________________
2494 Bool_t AliConversionCuts::SetLowPRejectionCuts(Int_t LowPRejectionSigmaCut)
2496 switch(LowPRejectionSigmaCut){
2498 fPIDnSigmaAtLowPAroundKaonLine=0;
2499 fPIDnSigmaAtLowPAroundProtonLine=0;
2500 fPIDnSigmaAtLowPAroundPionLine=0;
2501 fDoKaonRejectionLowP = kFALSE;
2502 fDoProtonRejectionLowP = kFALSE;
2503 fDoPionRejectionLowP = kFALSE;
2504 fPIDMinPPionRejectionLowP = fPIDMinPnSigmaAbovePionLine;
2507 fPIDnSigmaAtLowPAroundKaonLine=0.5;
2508 fPIDnSigmaAtLowPAroundProtonLine=0.5;
2509 fPIDnSigmaAtLowPAroundPionLine=0.5;
2510 fDoKaonRejectionLowP = kTRUE;
2511 fDoProtonRejectionLowP = kTRUE;
2512 fDoPionRejectionLowP = kTRUE;
2513 fPIDMinPPionRejectionLowP = fPIDMinPnSigmaAbovePionLine;
2516 fPIDnSigmaAtLowPAroundKaonLine=1;
2517 fPIDnSigmaAtLowPAroundProtonLine=1;
2518 fPIDnSigmaAtLowPAroundPionLine=1;
2519 fDoKaonRejectionLowP = kTRUE;
2520 fDoProtonRejectionLowP = kTRUE;
2521 fDoPionRejectionLowP = kTRUE;
2522 fPIDMinPPionRejectionLowP = fPIDMinPnSigmaAbovePionLine;
2525 fPIDnSigmaAtLowPAroundKaonLine=2.;
2526 fPIDnSigmaAtLowPAroundProtonLine=2.;
2527 fPIDnSigmaAtLowPAroundPionLine=2.;
2528 fDoKaonRejectionLowP = kTRUE;
2529 fDoProtonRejectionLowP = kTRUE;
2530 fDoPionRejectionLowP = kTRUE;
2531 fPIDMinPPionRejectionLowP = fPIDMinPnSigmaAbovePionLine;
2534 fPIDnSigmaAtLowPAroundKaonLine=0.;
2535 fPIDnSigmaAtLowPAroundProtonLine=0.;
2536 fPIDnSigmaAtLowPAroundPionLine=1;
2537 fDoKaonRejectionLowP = kFALSE;
2538 fDoProtonRejectionLowP = kFALSE;
2539 fDoPionRejectionLowP = kTRUE;
2540 fPIDMinPPionRejectionLowP = fPIDMinPnSigmaAbovePionLine;
2543 fPIDnSigmaAtLowPAroundKaonLine=0.;
2544 fPIDnSigmaAtLowPAroundProtonLine=0.;
2545 fPIDnSigmaAtLowPAroundPionLine=1.5;
2546 fDoKaonRejectionLowP = kFALSE;
2547 fDoProtonRejectionLowP = kFALSE;
2548 fDoPionRejectionLowP = kTRUE;
2549 fPIDMinPPionRejectionLowP = fPIDMinPnSigmaAbovePionLine;
2552 fPIDnSigmaAtLowPAroundKaonLine=0.;
2553 fPIDnSigmaAtLowPAroundProtonLine=0.;
2554 fPIDnSigmaAtLowPAroundPionLine=2.;
2555 fDoKaonRejectionLowP = kFALSE;
2556 fDoProtonRejectionLowP = kFALSE;
2557 fDoPionRejectionLowP = kTRUE;
2558 fPIDMinPPionRejectionLowP = fPIDMinPnSigmaAbovePionLine;
2561 fPIDnSigmaAtLowPAroundKaonLine=0.;
2562 fPIDnSigmaAtLowPAroundProtonLine=0.;
2563 fPIDnSigmaAtLowPAroundPionLine=0.5;
2564 fDoKaonRejectionLowP = kFALSE;
2565 fDoProtonRejectionLowP = kFALSE;
2566 fDoPionRejectionLowP = kTRUE;
2567 fPIDMinPPionRejectionLowP = fPIDMinPnSigmaAbovePionLine;
2570 AliError(Form("LowPRejectionSigmaCut not defined %d",LowPRejectionSigmaCut));
2575 ///________________________________________________________________________
2576 Bool_t AliConversionCuts::SetTOFElectronPIDCut(Int_t TOFelectronPID){
2578 switch(TOFelectronPID){
2580 fUseTOFpid = kFALSE;
2581 fTofPIDnSigmaBelowElectronLine=-100;
2582 fTofPIDnSigmaAboveElectronLine=100;
2586 fTofPIDnSigmaBelowElectronLine=-7;
2587 fTofPIDnSigmaAboveElectronLine=7;
2591 fTofPIDnSigmaBelowElectronLine=-5;
2592 fTofPIDnSigmaAboveElectronLine=5;
2596 fTofPIDnSigmaBelowElectronLine=-3;
2597 fTofPIDnSigmaAboveElectronLine=5;
2601 fTofPIDnSigmaBelowElectronLine=-2;
2602 fTofPIDnSigmaAboveElectronLine=3;
2606 fTofPIDnSigmaBelowElectronLine=-3;
2607 fTofPIDnSigmaAboveElectronLine=3;
2610 AliError(Form("TOFElectronCut not defined %d",TOFelectronPID));
2615 ///________________________________________________________________________
2616 Bool_t AliConversionCuts::SetQtMaxCut(Int_t QtMaxCut)
2621 fDoQtGammaSelection=kFALSE;
2622 fDoHighPtQtGammaSelection=kFALSE;
2624 fPtBorderForQt=100.;
2628 fDoHighPtQtGammaSelection=kFALSE;
2630 fPtBorderForQt=100.;
2634 fDoHighPtQtGammaSelection=kFALSE;
2636 fPtBorderForQt=100.;
2640 fDoHighPtQtGammaSelection=kFALSE;
2642 fPtBorderForQt=100.;
2646 fDoHighPtQtGammaSelection=kFALSE;
2648 fPtBorderForQt=100.;
2652 fDoHighPtQtGammaSelection=kFALSE;
2654 fPtBorderForQt=100.;
2658 fDoHighPtQtGammaSelection=kTRUE;
2664 fDoHighPtQtGammaSelection=kFALSE;
2666 fPtBorderForQt=100.;
2669 AliError(Form("Warning: QtMaxCut not defined %d",QtMaxCut));
2674 ///________________________________________________________________________
2675 Bool_t AliConversionCuts::SetChi2GammaCut(Int_t chi2GammaCut)
2678 switch(chi2GammaCut){
2680 fChi2CutConversion = 100.;
2683 fChi2CutConversion = 50.;
2686 fChi2CutConversion = 30.;
2689 fChi2CutConversion = 200.;
2692 fChi2CutConversion = 500.;
2695 fChi2CutConversion = 100000.;
2698 fChi2CutConversion = 5.;
2701 fChi2CutConversion = 10.;
2704 fChi2CutConversion = 20.;
2707 fChi2CutConversion = 15.;
2710 AliError(Form("Warning: Chi2GammaCut not defined %d",chi2GammaCut));
2715 ///________________________________________________________________________
2716 Bool_t AliConversionCuts::SetPsiPairCut(Int_t psiCut) {
2720 fPsiPairCut = 10000; //
2723 fPsiPairCut = 0.1; //
2726 fPsiPairCut = 0.05; // Standard
2729 fPsiPairCut = 0.035; //
2732 fPsiPairCut = 0.15; //
2735 fPsiPairCut = 0.2; //
2738 fPsiPairCut = 0.03; //
2741 fPsiPairCut = 0.025; //
2744 fPsiPairCut = 0.01; //
2747 fPsiPairCut = 0.5; //
2750 AliError(Form("PsiPairCut not defined %d",psiCut));
2756 ///________________________________________________________________________
2757 Bool_t AliConversionCuts::SetPhotonAsymmetryCut(Int_t doPhotonAsymmetryCut){
2759 switch(doPhotonAsymmetryCut){
2761 fDoPhotonAsymmetryCut=0;
2762 fMinPPhotonAsymmetryCut=100.;
2763 fMinPhotonAsymmetry=0.;
2766 fDoPhotonAsymmetryCut=1;
2767 fMinPPhotonAsymmetryCut=3.5;
2768 fMinPhotonAsymmetry=0.04;
2771 fDoPhotonAsymmetryCut=1;
2772 fMinPPhotonAsymmetryCut=3.5;
2773 fMinPhotonAsymmetry=0.06;
2776 AliError(Form("PhotonAsymmetryCut not defined %d",doPhotonAsymmetryCut));
2779 fCuts[kdoPhotonAsymmetryCut]=doPhotonAsymmetryCut;
2782 ///________________________________________________________________________
2783 Bool_t AliConversionCuts::SetCosPAngleCut(Int_t cosCut) {
2787 fCosPAngleCut = TMath::Pi(); // -1
2790 fCosPAngleCut = 0.1; // 0.99500
2793 fCosPAngleCut = 0.05; // 0.99875
2796 fCosPAngleCut = 0.025; // 0.99969
2799 fCosPAngleCut = 0.01; // 0.99995
2802 fCosPAngleCut = 0.2; // 0.98007
2805 fCosPAngleCut = 0.5; // 0.87758
2808 fCosPAngleCut = 0.075; // 0.73169
2811 AliError(Form("Cosine Pointing Angle cut not defined %d",cosCut));
2817 ///________________________________________________________________________
2818 Bool_t AliConversionCuts::SetSharedElectronCut(Int_t sharedElec) {
2822 fDoSharedElecCut = kFALSE;
2825 fDoSharedElecCut = kTRUE;
2828 AliError(Form("Shared Electron Cut not defined %d",sharedElec));
2834 ///________________________________________________________________________
2835 Bool_t AliConversionCuts::SetToCloseV0sCut(Int_t toClose) {
2839 fDoToCloseV0sCut = kFALSE;
2843 fDoToCloseV0sCut = kTRUE;
2847 fDoToCloseV0sCut = kTRUE;
2851 fDoToCloseV0sCut = kTRUE;
2855 AliError(Form("Shared Electron Cut not defined %d",toClose));
2860 ///________________________________________________________________________
2861 Bool_t AliConversionCuts::SetTRDElectronCut(Int_t TRDElectronCut)
2863 switch(TRDElectronCut){
2869 fPIDTRDEfficiency=0.1;
2873 fPIDTRDEfficiency=0.8;
2877 fPIDTRDEfficiency=0.9;
2880 AliError(Form("TRDElectronCut not defined %d",TRDElectronCut));
2887 ///________________________________________________________________________
2888 Bool_t AliConversionCuts::SetDCAZPhotonPrimVtxCut(Int_t DCAZPhotonPrimVtx){
2890 switch(DCAZPhotonPrimVtx){
2892 fDCAZPrimVtxCut = 1000;
2895 fDCAZPrimVtxCut = 10;
2898 fDCAZPrimVtxCut = 5;
2901 fDCAZPrimVtxCut = 4;
2904 fDCAZPrimVtxCut = 3;
2907 fDCAZPrimVtxCut = 2.5;
2910 fDCAZPrimVtxCut = 2;
2913 fDCAZPrimVtxCut = 1.5;
2916 fDCAZPrimVtxCut = 1;
2919 fDCAZPrimVtxCut = 0.5;
2922 cout<<"Warning: DCAZPhotonPrimVtx not defined "<<DCAZPhotonPrimVtx<<endl;
2928 ///________________________________________________________________________
2929 Bool_t AliConversionCuts::SetDCARPhotonPrimVtxCut(Int_t DCARPhotonPrimVtx){
2931 switch(DCARPhotonPrimVtx){
2933 fDCARPrimVtxCut = 1000;
2936 fDCARPrimVtxCut = 10;
2939 fDCARPrimVtxCut = 5;
2942 fDCARPrimVtxCut = 4;
2945 fDCARPrimVtxCut = 3;
2948 fDCARPrimVtxCut = 2.5;
2951 fDCARPrimVtxCut = 2;
2954 fDCARPrimVtxCut = 1.5;
2957 fDCARPrimVtxCut = 1;
2960 fDCARPrimVtxCut = 0.5;
2963 cout<<"Warning: DCARPhotonPrimVtx not defined "<<DCARPhotonPrimVtx<<endl;
2970 //-------------------------------------------------------------
2971 Double_t AliConversionCuts::GetCentrality(AliVEvent *event)
2972 { // Get Event Centrality
2974 AliESDEvent *esdEvent=dynamic_cast<AliESDEvent*>(event);
2976 AliCentrality *fESDCentrality=(AliCentrality*)esdEvent->GetCentrality();
2978 if(fDetectorCentrality==0){
2979 if (fIsHeavyIon==2){
2980 return fESDCentrality->GetCentralityPercentile("V0A"); // default for pPb
2982 return fESDCentrality->GetCentralityPercentile("V0M"); // default
2985 if(fDetectorCentrality==1){
2986 return fESDCentrality->GetCentralityPercentile("CL1");
2990 AliAODEvent *aodEvent=dynamic_cast<AliAODEvent*>(event);
2992 if(aodEvent->GetHeader()){return aodEvent->GetHeader()->GetCentrality();}
2997 //-------------------------------------------------------------
2998 Bool_t AliConversionCuts::IsCentralitySelected(AliVEvent *event, AliVEvent *fMCEvent)
2999 { // Centrality Selection
3000 if(!fIsHeavyIon)return kTRUE;
3002 if(fCentralityMin == fCentralityMax ) return kTRUE;//0-100%
3003 else if(fCentralityMax==0) fCentralityMax=10; //CentralityRange = fCentralityMin-100%
3005 Double_t centrality=GetCentrality(event);
3006 if(centrality<0)return kFALSE;
3008 Int_t centralityC=0;
3009 if (fModCentralityClass == 0){
3010 centralityC= Int_t(centrality/10);
3011 if(centralityC >= fCentralityMin && centralityC < fCentralityMax)
3015 else if (fModCentralityClass ==1){
3016 centralityC= Int_t(centrality);
3017 if(centralityC >= fCentralityMin*5 && centralityC < fCentralityMax*5){
3019 } else return kFALSE;
3021 else if (fModCentralityClass ==2){
3022 centralityC= Int_t(centrality);
3023 if(centralityC >= ((fCentralityMin*5)+45) && centralityC < ((fCentralityMax*5)+45))
3028 Int_t nprimaryTracks = ((AliV0ReaderV1*)AliAnalysisManager::GetAnalysisManager()->GetTask("V0ReaderV1"))->GetNumberOfPrimaryTracks();
3029 Int_t PrimaryTracks10[10][2] =
3042 Int_t PrimaryTracks5a[10][2] =
3055 Int_t PrimaryTracks5b[10][2] =
3058 { 197, 333}, // 50 // Below still ESDS for AODs
3070 if(event->IsA()==AliESDEvent::Class()) column = 0;
3071 if(event->IsA()==AliAODEvent::Class()) column = 1;
3073 if (fModCentralityClass == 3){
3075 if(nprimaryTracks > PrimaryTracks10[fCentralityMax][column] && nprimaryTracks <= PrimaryTracks10[fCentralityMin][column])
3080 centralityC= Int_t(centrality/10);
3081 if(centralityC >= fCentralityMin && centralityC < fCentralityMax)
3086 else if (fModCentralityClass ==4){
3088 if(nprimaryTracks > PrimaryTracks5a[fCentralityMax][column] && nprimaryTracks <= PrimaryTracks5a[fCentralityMin][column])
3093 centralityC= Int_t(centrality);
3094 if(centralityC >= fCentralityMin*5 && centralityC < fCentralityMax*5){
3096 } else return kFALSE;
3099 else if (fModCentralityClass ==5){
3101 if(nprimaryTracks > PrimaryTracks5b[fCentralityMax][column] && nprimaryTracks <= PrimaryTracks5b[fCentralityMin][column])
3106 centralityC= Int_t(centrality);
3107 if(centralityC >= ((fCentralityMin*5)+45) && centralityC < ((fCentralityMax*5)+45))
3115 ///________________________________________________________________________
3116 Bool_t AliConversionCuts::VertexZCut(AliVEvent *event){
3117 // Cut on z position of primary vertex
3118 Double_t fVertexZ=event->GetPrimaryVertex()->GetZ();
3120 if(abs(fVertexZ)>fMaxVertexZ)return kFALSE;
3122 if (fIsHeavyIon == 2){
3123 if(fUtils->IsFirstEventInChunk(event)) return kFALSE;
3124 if(!fUtils->IsVertexSelected2013pA(event)) return kFALSE;
3130 ///________________________________________________________________________
3132 Int_t AliConversionCuts::GetNumberOfContributorsVtx(AliVEvent *event){
3133 // returns number of contributors to the vertex
3135 AliESDEvent *fESDEvent=dynamic_cast<AliESDEvent*>(event);
3137 if (fESDEvent->GetPrimaryVertex() != NULL){
3138 if(fESDEvent->GetPrimaryVertex()->GetNContributors()>0) {
3139 // cout << "accepted global" << fESDEvent->GetEventNumberInFile() << " with NCont: " << fESDEvent->GetPrimaryVertex()->GetNContributors() << endl;
3140 return fESDEvent->GetPrimaryVertex()->GetNContributors();
3144 if(fESDEvent->GetPrimaryVertexSPD() !=NULL){
3145 if(fESDEvent->GetPrimaryVertexSPD()->GetNContributors()>0) {
3146 // cout << "accepted SPD" << fESDEvent->GetEventNumberInFile() << " with NCont: " << fESDEvent->GetPrimaryVertexSPD()->GetNContributors() << endl;
3147 return fESDEvent->GetPrimaryVertexSPD()->GetNContributors();
3149 AliWarning(Form("Number of contributors from bad vertex type:: %s",fESDEvent->GetPrimaryVertex()->GetName()));
3150 // cout << "rejected " << fESDEvent->GetEventNumberInFile() << endl;
3156 AliAODEvent *fAODEvent=dynamic_cast<AliAODEvent*>(event);
3158 if (fAODEvent->GetPrimaryVertex() != NULL){
3159 if(fAODEvent->GetPrimaryVertex()->GetNContributors()>0) {
3160 return fAODEvent->GetPrimaryVertex()->GetNContributors();
3163 if(fAODEvent->GetPrimaryVertexSPD() !=NULL){
3164 if(fAODEvent->GetPrimaryVertexSPD()->GetNContributors()>0) {
3165 return fAODEvent->GetPrimaryVertexSPD()->GetNContributors();
3167 AliWarning(Form("Number of contributors from bad vertex type:: %s",fAODEvent->GetPrimaryVertex()->GetName()));
3172 // cout << "rejected " << fESDEvent->GetEventNumberInFile() << endl;
3176 ///________________________________________________________________________
3178 Bool_t AliConversionCuts::IsTriggerSelected(AliVEvent *fInputEvent)
3181 AliInputEventHandler *fInputHandler=(AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler());
3183 UInt_t isSelected = AliVEvent::kAny;
3184 if (fInputHandler==NULL) return kFALSE;
3185 if( fInputHandler->GetEventSelection() || fInputEvent->IsA()==AliAODEvent::Class()) {
3186 if (!fTriggerSelectedManually){
3187 if (fPreSelCut) fOfflineTriggerMask = AliVEvent::kAny;
3189 if (fIsHeavyIon == 1) fOfflineTriggerMask = AliVEvent::kMB | AliVEvent::kCentral | AliVEvent::kSemiCentral;
3190 else if (fIsHeavyIon == 2) fOfflineTriggerMask = AliVEvent::kINT7;
3191 else fOfflineTriggerMask = AliVEvent::kMB;
3194 // Get the actual offline trigger mask for the event and AND it with the
3195 // requested mask. If no mask requested select by default the event.
3196 // if (fPreSelCut) cout << "Trigger selected from outside: "<< fTriggerSelectedManually <<"\t Offline Trigger mask for Precut: " << fOfflineTriggerMask << endl;
3197 // else cout << "Trigger selected from outside: "<< fTriggerSelectedManually <<"\t Offline Trigger mask: " << fOfflineTriggerMask << endl;
3199 if (fOfflineTriggerMask)
3200 isSelected = fOfflineTriggerMask & fInputHandler->IsEventSelected();
3202 fIsSDDFired = !(fInputHandler->IsEventSelected() & AliVEvent::kFastOnly);
3206 if (fIsSDDFired) hTriggerClass->Fill(33);
3207 if (fInputHandler->IsEventSelected() & AliVEvent::kMB)hTriggerClass->Fill(0);
3208 if (fInputHandler->IsEventSelected() & AliVEvent::kINT7)hTriggerClass->Fill(1);
3209 if (fInputHandler->IsEventSelected() & AliVEvent::kMUON)hTriggerClass->Fill(2);
3210 if (fInputHandler->IsEventSelected() & AliVEvent::kHighMult)hTriggerClass->Fill(3);
3211 if (fInputHandler->IsEventSelected() & AliVEvent::kEMC1)hTriggerClass->Fill(4);
3212 if (fInputHandler->IsEventSelected() & AliVEvent::kCINT5)hTriggerClass->Fill(5);
3213 if (fInputHandler->IsEventSelected() & AliVEvent::kCMUS5)hTriggerClass->Fill(6);
3214 if (fInputHandler->IsEventSelected() & AliVEvent::kMUSPB)hTriggerClass->Fill(6);
3215 if (fInputHandler->IsEventSelected() & AliVEvent::kMUSH7)hTriggerClass->Fill(7);
3216 if (fInputHandler->IsEventSelected() & AliVEvent::kMUSHPB)hTriggerClass->Fill(7);
3217 if (fInputHandler->IsEventSelected() & AliVEvent::kMUL7)hTriggerClass->Fill(8);
3218 if (fInputHandler->IsEventSelected() & AliVEvent::kMuonLikePB)hTriggerClass->Fill(8);
3219 if (fInputHandler->IsEventSelected() & AliVEvent::kMUU7)hTriggerClass->Fill(9);
3220 if (fInputHandler->IsEventSelected() & AliVEvent::kMuonUnlikePB)hTriggerClass->Fill(9);
3221 if (fInputHandler->IsEventSelected() & AliVEvent::kEMC7)hTriggerClass->Fill(10);
3222 if (fInputHandler->IsEventSelected() & AliVEvent::kEMC8)hTriggerClass->Fill(10);
3223 if (fInputHandler->IsEventSelected() & AliVEvent::kMUS7)hTriggerClass->Fill(11);
3224 if (fInputHandler->IsEventSelected() & AliVEvent::kPHI1)hTriggerClass->Fill(12);
3225 if (fInputHandler->IsEventSelected() & AliVEvent::kPHI7)hTriggerClass->Fill(13);
3226 if (fInputHandler->IsEventSelected() & AliVEvent::kPHI8)hTriggerClass->Fill(13);
3227 if (fInputHandler->IsEventSelected() & AliVEvent::kPHOSPb)hTriggerClass->Fill(13);
3228 if (fInputHandler->IsEventSelected() & AliVEvent::kEMCEJE)hTriggerClass->Fill(14);
3229 if (fInputHandler->IsEventSelected() & AliVEvent::kEMCEGA)hTriggerClass->Fill(15);
3230 if (fInputHandler->IsEventSelected() & AliVEvent::kCentral)hTriggerClass->Fill(16);
3231 if (fInputHandler->IsEventSelected() & AliVEvent::kSemiCentral)hTriggerClass->Fill(17);
3232 if (fInputHandler->IsEventSelected() & AliVEvent::kDG5)hTriggerClass->Fill(18);
3233 if (fInputHandler->IsEventSelected() & AliVEvent::kZED)hTriggerClass->Fill(19);
3234 if (fInputHandler->IsEventSelected() & AliVEvent::kSPI7)hTriggerClass->Fill(20);
3235 if (fInputHandler->IsEventSelected() & AliVEvent::kSPI)hTriggerClass->Fill(20);
3236 if (fInputHandler->IsEventSelected() & AliVEvent::kINT8)hTriggerClass->Fill(21);
3237 if (fInputHandler->IsEventSelected() & AliVEvent::kMuonSingleLowPt8)hTriggerClass->Fill(22);
3238 if (fInputHandler->IsEventSelected() & AliVEvent::kMuonSingleHighPt8)hTriggerClass->Fill(23);
3239 if (fInputHandler->IsEventSelected() & AliVEvent::kMuonLikeLowPt8)hTriggerClass->Fill(24);
3240 if (fInputHandler->IsEventSelected() & AliVEvent::kMuonUnlikeLowPt8)hTriggerClass->Fill(25);
3241 if (fInputHandler->IsEventSelected() & AliVEvent::kMuonUnlikeLowPt0)hTriggerClass->Fill(26);
3242 if (fInputHandler->IsEventSelected() & AliVEvent::kUserDefined)hTriggerClass->Fill(27);
3243 if (fInputHandler->IsEventSelected() & AliVEvent::kTRD)hTriggerClass->Fill(28);
3244 if (fInputHandler->IsEventSelected() & AliVEvent::kFastOnly)hTriggerClass->Fill(29);
3245 if (fInputHandler->IsEventSelected() & AliVEvent::kAnyINT)hTriggerClass->Fill(30);
3246 if (fInputHandler->IsEventSelected() & AliVEvent::kAny)hTriggerClass->Fill(31);
3247 if (!fInputHandler->IsEventSelected()) hTriggerClass->Fill(34);
3250 if(hTriggerClassSelected && isSelected){
3251 if (!fIsSDDFired) hTriggerClassSelected->Fill(33);
3252 if (fInputHandler->IsEventSelected() & AliVEvent::kMB)hTriggerClassSelected->Fill(0);
3253 if (fInputHandler->IsEventSelected() & AliVEvent::kINT7)hTriggerClassSelected->Fill(1);
3254 if (fInputHandler->IsEventSelected() & AliVEvent::kMUON)hTriggerClassSelected->Fill(2);
3255 if (fInputHandler->IsEventSelected() & AliVEvent::kHighMult)hTriggerClassSelected->Fill(3);
3256 if (fInputHandler->IsEventSelected() & AliVEvent::kEMC1)hTriggerClassSelected->Fill(4);
3257 if (fInputHandler->IsEventSelected() & AliVEvent::kCINT5)hTriggerClassSelected->Fill(5);
3258 if (fInputHandler->IsEventSelected() & AliVEvent::kCMUS5)hTriggerClassSelected->Fill(6);
3259 if (fInputHandler->IsEventSelected() & AliVEvent::kMUSPB)hTriggerClassSelected->Fill(6);
3260 if (fInputHandler->IsEventSelected() & AliVEvent::kMUSH7)hTriggerClassSelected->Fill(7);
3261 if (fInputHandler->IsEventSelected() & AliVEvent::kMUSHPB)hTriggerClassSelected->Fill(7);
3262 if (fInputHandler->IsEventSelected() & AliVEvent::kMUL7)hTriggerClassSelected->Fill(8);
3263 if (fInputHandler->IsEventSelected() & AliVEvent::kMuonLikePB)hTriggerClassSelected->Fill(8);
3264 if (fInputHandler->IsEventSelected() & AliVEvent::kMUU7)hTriggerClassSelected->Fill(9);
3265 if (fInputHandler->IsEventSelected() & AliVEvent::kMuonUnlikePB)hTriggerClassSelected->Fill(9);
3266 if (fInputHandler->IsEventSelected() & AliVEvent::kEMC7)hTriggerClassSelected->Fill(10);
3267 if (fInputHandler->IsEventSelected() & AliVEvent::kEMC8)hTriggerClassSelected->Fill(10);
3268 if (fInputHandler->IsEventSelected() & AliVEvent::kMUS7)hTriggerClassSelected->Fill(11);
3269 if (fInputHandler->IsEventSelected() & AliVEvent::kPHI1)hTriggerClassSelected->Fill(12);
3270 if (fInputHandler->IsEventSelected() & AliVEvent::kPHI7)hTriggerClassSelected->Fill(13);
3271 if (fInputHandler->IsEventSelected() & AliVEvent::kPHI8)hTriggerClassSelected->Fill(13);
3272 if (fInputHandler->IsEventSelected() & AliVEvent::kPHOSPb)hTriggerClassSelected->Fill(13);
3273 if (fInputHandler->IsEventSelected() & AliVEvent::kEMCEJE)hTriggerClassSelected->Fill(14);
3274 if (fInputHandler->IsEventSelected() & AliVEvent::kEMCEGA)hTriggerClassSelected->Fill(15);
3275 if (fInputHandler->IsEventSelected() & AliVEvent::kCentral)hTriggerClassSelected->Fill(16);
3276 if (fInputHandler->IsEventSelected() & AliVEvent::kSemiCentral)hTriggerClassSelected->Fill(17);
3277 if (fInputHandler->IsEventSelected() & AliVEvent::kDG5)hTriggerClassSelected->Fill(18);
3278 if (fInputHandler->IsEventSelected() & AliVEvent::kZED)hTriggerClassSelected->Fill(19);
3279 if (fInputHandler->IsEventSelected() & AliVEvent::kSPI7)hTriggerClassSelected->Fill(20);
3280 if (fInputHandler->IsEventSelected() & AliVEvent::kSPI)hTriggerClassSelected->Fill(20);
3281 if (fInputHandler->IsEventSelected() & AliVEvent::kINT8)hTriggerClassSelected->Fill(21);
3282 if (fInputHandler->IsEventSelected() & AliVEvent::kMuonSingleLowPt8)hTriggerClassSelected->Fill(22);
3283 if (fInputHandler->IsEventSelected() & AliVEvent::kMuonSingleHighPt8)hTriggerClassSelected->Fill(23);
3284 if (fInputHandler->IsEventSelected() & AliVEvent::kMuonLikeLowPt8)hTriggerClassSelected->Fill(24);
3285 if (fInputHandler->IsEventSelected() & AliVEvent::kMuonUnlikeLowPt8)hTriggerClassSelected->Fill(25);
3286 if (fInputHandler->IsEventSelected() & AliVEvent::kMuonUnlikeLowPt0)hTriggerClassSelected->Fill(26);
3287 if (fInputHandler->IsEventSelected() & AliVEvent::kUserDefined)hTriggerClassSelected->Fill(27);
3288 if (fInputHandler->IsEventSelected() & AliVEvent::kTRD)hTriggerClassSelected->Fill(28);
3289 if (fInputHandler->IsEventSelected() & AliVEvent::kFastOnly)hTriggerClassSelected->Fill(29);
3290 if (fInputHandler->IsEventSelected() & AliVEvent::kAnyINT)hTriggerClassSelected->Fill(30);
3291 if (fInputHandler->IsEventSelected() & AliVEvent::kAny)hTriggerClassSelected->Fill(31);
3294 if(!isSelected)return kFALSE;
3300 ///________________________________________________________________________
3301 Int_t AliConversionCuts::GetFirstTPCRow(Double_t radius){
3302 // Get first TPC row
3303 Int_t firstTPCRow = 0;
3304 Double_t radiusI = 84.8;
3305 Double_t radiusO = 134.6;
3306 Double_t radiusOB = 198.;
3307 Double_t rSizeI = 0.75;
3308 Double_t rSizeO = 1.;
3309 Double_t rSizeOB = 1.5;
3313 if(radius <= radiusI){
3316 if(radius>radiusI && radius<=radiusO){
3317 firstTPCRow = (Int_t)((radius-radiusI)/rSizeI);
3319 if(radius>radiusO && radius<=radiusOB){
3320 firstTPCRow = (Int_t)(nClsI+(radius-radiusO)/rSizeO);
3323 if(radius>radiusOB){
3324 firstTPCRow =(Int_t)(nClsIO+(radius-radiusOB)/rSizeOB);
3330 Bool_t AliConversionCuts::CosinePAngleCut(const AliConversionPhotonBase * photon, AliVEvent * event) const {
3331 ///Check if passes cosine of pointing angle cut
3332 if(GetCosineOfPointingAngle(photon, event) < (TMath::Cos(fCosPAngleCut))){
3338 Double_t AliConversionCuts::GetCosineOfPointingAngle( const AliConversionPhotonBase * photon, AliVEvent * event) const{
3339 // calculates the pointing angle of the recalculated V0
3341 Double_t momV0[3] = {0,0,0};
3342 if(event->IsA()==AliESDEvent::Class()){
3343 AliESDEvent *esdEvent = dynamic_cast<AliESDEvent*>(event);
3344 if(!esdEvent) return -999;
3345 AliESDv0 *v0 = esdEvent->GetV0(photon->GetV0Index());
3346 if(!v0) return -999;
3347 v0->GetPxPyPz(momV0[0],momV0[1],momV0[2]);
3349 if(event->IsA()==AliAODEvent::Class()){
3350 momV0[0] = photon->GetPx();
3351 momV0[1] = photon->GetPy();
3352 momV0[2] = photon->GetPz();
3355 //Double_t momV0[3] = { photon->GetPx(), photon->GetPy(), photon->GetPz() }; //momentum of the V0
3356 Double_t PosV0[3] = { photon->GetConversionX() - event->GetPrimaryVertex()->GetX(),
3357 photon->GetConversionY() - event->GetPrimaryVertex()->GetY(),
3358 photon->GetConversionZ() - event->GetPrimaryVertex()->GetZ() }; //Recalculated V0 Position vector
3360 Double_t momV02 = momV0[0]*momV0[0] + momV0[1]*momV0[1] + momV0[2]*momV0[2];
3361 Double_t PosV02 = PosV0[0]*PosV0[0] + PosV0[1]*PosV0[1] + PosV0[2]*PosV0[2];
3364 Double_t cosinePointingAngle = -999;
3365 if(momV02*PosV02 > 0.0)
3366 cosinePointingAngle = (PosV0[0]*momV0[0] + PosV0[1]*momV0[1] + PosV0[2]*momV0[2] ) / TMath::Sqrt(momV02 * PosV02);
3368 return cosinePointingAngle;
3371 ///________________________________________________________________________
3372 Bool_t AliConversionCuts::PsiPairCut(const AliConversionPhotonBase * photon) const {
3374 if(photon->GetPsiPair() > fPsiPairCut){
3380 ///________________________________________________________________________
3381 TString AliConversionCuts::GetCutNumber(){
3382 // returns TString with current cut number
3384 for(Int_t ii=0;ii<kNCuts;ii++){
3385 a.Append(Form("%d",fCuts[ii]));
3390 ///________________________________________________________________________
3391 void AliConversionCuts::FillElectonLabelArray(AliAODConversionPhoton* photon, Int_t nV0){
3393 Int_t posLabel = photon->GetTrackLabelPositive();
3394 Int_t negLabel = photon->GetTrackLabelNegative();
3396 fElectronLabelArray[nV0*2] = posLabel;
3397 fElectronLabelArray[(nV0*2)+1] = negLabel;
3399 ///________________________________________________________________________
3400 Bool_t AliConversionCuts::RejectSharedElectronV0s(AliAODConversionPhoton* photon, Int_t nV0, Int_t nV0s){
3402 Int_t posLabel = photon->GetTrackLabelPositive();
3403 Int_t negLabel = photon->GetTrackLabelNegative();
3405 for(Int_t i = 0; i<nV0s*2;i++){
3406 if(i==nV0*2) continue;
3407 if(i==(nV0*2)+1) continue;
3408 if(fElectronLabelArray[i] == posLabel){
3410 if(fElectronLabelArray[i] == negLabel){
3416 ///________________________________________________________________________
3417 Bool_t AliConversionCuts::RejectToCloseV0s(AliAODConversionPhoton* photon, TList *photons, Int_t nV0){
3420 Double_t posX = photon->GetConversionX();
3421 Double_t posY = photon->GetConversionY();
3422 Double_t posZ = photon->GetConversionZ();
3424 for(Int_t i = 0;i<photons->GetEntries();i++){
3425 if(nV0 == i) continue;
3426 AliAODConversionPhoton *photonComp = (AliAODConversionPhoton*) photons->At(i);
3427 Double_t posCompX = photonComp->GetConversionX();
3428 Double_t posCompY = photonComp->GetConversionY();
3429 Double_t posCompZ = photonComp->GetConversionZ();
3431 Double_t dist = pow((posX - posCompX),2)+pow((posY - posCompY),2)+pow((posZ - posCompZ),2);
3433 if(dist < fminV0Dist*fminV0Dist){
3434 if(photon->GetChi2perNDF() < photonComp->GetChi2perNDF()) return kTRUE;
3442 ///________________________________________________________________________
3443 void AliConversionCuts::GetNotRejectedParticles(Int_t rejection, TList *HeaderList, AliVEvent *MCEvent){
3447 if(fNotRejectedStart){
3448 delete[] fNotRejectedStart;
3449 fNotRejectedStart = NULL;
3451 if(fNotRejectedEnd){
3452 delete[] fNotRejectedEnd;
3453 fNotRejectedEnd = NULL;
3455 if(fGeneratorNames){
3456 delete[] fGeneratorNames;
3457 fGeneratorNames = NULL;
3460 if(rejection == 0) return; // No Rejection
3462 AliGenCocktailEventHeader *cHeader = 0x0;
3463 AliAODMCHeader *cHeaderAOD = 0x0;
3464 Bool_t headerFound = kFALSE;
3466 if(MCEvent->IsA()==AliMCEvent::Class()){
3467 cHeader = dynamic_cast<AliGenCocktailEventHeader*>(dynamic_cast<AliMCEvent*>(MCEvent)->GenEventHeader());
3468 if(cHeader) headerFound = kTRUE;
3470 if(MCEvent->IsA()==AliAODEvent::Class()){ // MCEvent is a AODEvent in case of AOD
3471 cHeaderAOD = dynamic_cast<AliAODMCHeader*>(MCEvent->FindListObject(AliAODMCHeader::StdBranchName()));
3472 if(cHeaderAOD) headerFound = kTRUE;
3476 TList *genHeaders = 0x0;
3477 if(cHeader) genHeaders = cHeader->GetHeaders();
3479 genHeaders = cHeaderAOD->GetCocktailHeaders();
3480 if(genHeaders->GetEntries()==1){
3481 SetRejectExtraSignalsCut(0);
3485 AliGenEventHeader* gh = 0;
3487 if(rejection == 1 || rejection == 3) fnHeaders = 1; // MinBiasHeader
3488 if(rejection == 2){ // TList of Headers Names
3489 for(Int_t i = 0; i<genHeaders->GetEntries();i++){
3490 gh = (AliGenEventHeader*)genHeaders->At(i);
3491 TString GeneratorName = gh->GetName();
3492 for(Int_t j = 0; j<HeaderList->GetEntries();j++){
3493 TString GeneratorInList = ((TObjString*)HeaderList->At(j))->GetString();
3494 if(GeneratorName.CompareTo(GeneratorInList) == 0){
3502 fNotRejectedStart = new Int_t[fnHeaders];
3503 fNotRejectedEnd = new Int_t[fnHeaders];
3504 fGeneratorNames = new TString[fnHeaders];
3506 if(rejection == 1 || rejection == 3){
3507 fNotRejectedStart[0] = 0;
3508 fNotRejectedEnd[0] = ((AliGenEventHeader*)genHeaders->At(0))->NProduced()-1;
3509 fGeneratorNames[0] = ((AliGenEventHeader*)genHeaders->At(0))->GetName();
3513 Int_t firstindex = 0;
3514 Int_t lastindex = -1;
3516 for(Int_t i = 0; i<genHeaders->GetEntries();i++){
3517 gh = (AliGenEventHeader*)genHeaders->At(i);
3518 TString GeneratorName = gh->GetName();
3519 lastindex = lastindex + gh->NProduced();
3520 for(Int_t j = 0; j<HeaderList->GetEntries();j++){
3521 TString GeneratorInList = ((TObjString*)HeaderList->At(j))->GetString();
3522 if(GeneratorName.CompareTo(GeneratorInList) == 0){
3523 fNotRejectedStart[nummer] = firstindex;
3524 fNotRejectedEnd[nummer] = lastindex;
3525 fGeneratorNames[nummer] = GeneratorName;
3526 //cout << "Number of particles produced for: " << i << "\t" << GeneratorName.Data() << "\t" << lastindex-firstindex+1 << endl;
3531 firstindex = firstindex + gh->NProduced();
3533 } else { // No Cocktail Header Found
3534 fNotRejectedStart = new Int_t[1];
3535 fNotRejectedEnd = new Int_t[1];
3538 fNotRejectedStart[0] = 0;
3539 fNotRejectedEnd[0] = static_cast<AliMCEvent*>(MCEvent)->Stack()->GetNprimary()-1;
3540 fGeneratorNames = new TString[1];
3541 fGeneratorNames[0] = "NoCocktailGeneratorFound";
3543 AliGenPythiaEventHeader *mcHeaderPythia = dynamic_cast<AliGenPythiaEventHeader*>(static_cast<AliMCEvent*>(MCEvent)->GenEventHeader());
3544 if (mcHeaderPythia) fGeneratorNames[0] = "NoCocktailGeneratorFound_Pythia";
3545 AliGenDPMjetEventHeader *mcHeaderPhojet = dynamic_cast<AliGenDPMjetEventHeader*>(static_cast<AliMCEvent*>(MCEvent)->GenEventHeader());
3546 if (mcHeaderPhojet) fGeneratorNames[0] = "NoCocktailGeneratorFound_Phojet";
3547 AliGenHijingEventHeader *mcHeaderHijing = dynamic_cast<AliGenHijingEventHeader*>(static_cast<AliMCEvent*>(MCEvent)->GenEventHeader());
3548 if (mcHeaderHijing) fGeneratorNames[0] = "NoCocktailGeneratorFound_Hijing";
3550 SetRejectExtraSignalsCut(0);
3554 //_________________________________________________________________________
3555 Int_t AliConversionCuts::IsParticleFromBGEvent(Int_t index, AliStack *MCStack, AliVEvent *InputEvent){
3557 // Not Accepted == kFALSE == 0
3558 // Accepted == kTRUE == 1
3559 // FirstHeader == kTRUE == 3
3560 if(index < 0) return 0; // No Particle
3563 if(!InputEvent || InputEvent->IsA()==AliESDEvent::Class()){
3564 if( index >= MCStack->GetNprimary()){ // Secondary Particle
3565 if( ((TParticle*)MCStack->Particle(index))->GetMother(0) < 0) return 1; // Secondary Particle without Mother??
3566 return IsParticleFromBGEvent(((TParticle*)MCStack->Particle(index))->GetMother(0),MCStack,InputEvent);
3568 for(Int_t i = 0;i<fnHeaders;i++){
3569 if(index >= fNotRejectedStart[i] && index <= fNotRejectedEnd[i]){
3571 if(i == 0) accepted = 2; // MB Header
3575 else if(InputEvent->IsA()==AliAODEvent::Class()){
3576 TClonesArray *AODMCTrackArray = dynamic_cast<TClonesArray*>(InputEvent->FindListObject(AliAODMCParticle::StdBranchName()));
3577 AliAODMCParticle *aodMCParticle = static_cast<AliAODMCParticle*>(AODMCTrackArray->At(index));
3578 if(!aodMCParticle) return 1; // Photon Without a Mother ? --> Accepted
3579 if(!aodMCParticle->IsPrimary()){
3580 if( aodMCParticle->GetMother() < 0) return 1;// Secondary Particle without Mother??
3581 return IsParticleFromBGEvent(aodMCParticle->GetMother(),MCStack,InputEvent);
3583 index = abs(static_cast<AliAODMCParticle*>(AODMCTrackArray->At(index))->GetLabel());
3584 for(Int_t i = 0;i<fnHeaders;i++){
3585 if(index >= fNotRejectedStart[i] && index <= fNotRejectedEnd[i]){
3587 if(i == 0) accepted = 2; // MB Header
3594 //_________________________________________________________________________
3595 Int_t AliConversionCuts::IsEventAcceptedByConversionCut(AliConversionCuts *ReaderCuts, AliVEvent *InputEvent, AliMCEvent *MCEvent, Bool_t isHeavyIon){
3597 if ( !IsTriggerSelected(InputEvent) )
3600 if(isHeavyIon && !(IsCentralitySelected(InputEvent,MCEvent)))
3601 return 1; // Check Centrality --> Not Accepted => eventQuality = 1
3603 if(!isHeavyIon && GetIsFromPileup()){
3604 if(InputEvent->IsPileupFromSPD(3,0.8,3.,2.,5.)){
3606 return 6; // Check Pileup --> Not Accepted => eventQuality = 6
3610 Bool_t hasV0And = ReaderCuts->HasV0AND();
3611 Bool_t isSDDFired = ReaderCuts->IsSDDFired();
3612 if( (IsSpecialTrigger() == 2 || IsSpecialTrigger() == 3) && !isSDDFired && !MCEvent)
3613 return 7; // With SDD requested but no fired
3615 if( (IsSpecialTrigger() == 1 || IsSpecialTrigger() == 3) && !hasV0And)
3616 return 8; // V0AND requested but no fired
3621 //_________________________________________________________________________
3622 Float_t AliConversionCuts::GetWeightForMeson(TString period, Int_t index, AliStack *MCStack, AliVEvent *InputEvent){
3623 if (!(period.CompareTo("LHC12f1a") == 0 || period.CompareTo("LHC12f1b") == 0 || period.CompareTo("LHC12i3") == 0 || period.CompareTo("LHC11a10a") == 0 || period.CompareTo("LHC11a10b") == 0 || period.CompareTo("LHC11a10b_bis") == 0 || period.CompareTo("LHC11a10a_bis") == 0 || period.CompareTo("LHC11a10b_plus") == 0 || period.CompareTo("LHC13d2") == 0)) return 1.;
3626 for (Int_t i = 0; i < fnHeaders; i++){
3627 if (index >= fNotRejectedStart[i] && index < fNotRejectedEnd[i]+1){
3628 if (fGeneratorNames[i].CompareTo("Pythia") == 0){
3630 } else if (fGeneratorNames[i].CompareTo("DPMJET") == 0){
3632 } else if (fGeneratorNames[i].CompareTo("HIJING") == 0 ||
3633 fGeneratorNames[i].CompareTo("Hijing") == 0 ||
3634 fGeneratorNames[i].Contains("hijing")){
3636 } else if (fGeneratorNames[i].CompareTo("BOX") == 0){
3638 } else if (fGeneratorNames[i].CompareTo("PARAM") == 0){
3640 } else if (fGeneratorNames[i].CompareTo("NoCocktailGeneratorFound") == 0){
3642 } else if (fGeneratorNames[i].CompareTo("NoCocktailGeneratorFound_Pythia") == 0){
3644 } else if (fGeneratorNames[i].CompareTo("NoCocktailGeneratorFound_Phojet") == 0){
3646 } else if (fGeneratorNames[i].CompareTo("NoCocktailGeneratorFound_Hijing") == 0){
3651 if (kCaseGen == 0) return 1;
3654 Double_t mesonPt = 0;
3655 Double_t mesonMass = 0;
3657 if(!InputEvent || InputEvent->IsA()==AliESDEvent::Class()){
3658 mesonPt = ((TParticle*)MCStack->Particle(index))->Pt();
3659 mesonMass = ((TParticle*)MCStack->Particle(index))->GetCalcMass();
3660 PDGCode = ((TParticle*)MCStack->Particle(index))->GetPdgCode();
3662 else if(InputEvent->IsA()==AliAODEvent::Class()){
3663 TClonesArray *AODMCTrackArray = dynamic_cast<TClonesArray*>(InputEvent->FindListObject(AliAODMCParticle::StdBranchName()));
3664 AliAODMCParticle *aodMCParticle = static_cast<AliAODMCParticle*>(AODMCTrackArray->At(index));
3665 mesonPt = aodMCParticle->Pt();
3666 mesonMass = aodMCParticle->GetCalcMass();
3667 PDGCode = aodMCParticle->GetPdgCode();
3670 Float_t functionResultMC = 1.;
3671 if (kCaseGen == 1){ // Pythia 6
3672 Float_t dNdyMC = 2.1462;
3673 Float_t nMC = 7.06055;
3674 Float_t tMC = 0.12533;
3675 if ( PDGCode == 111){
3679 } else if ( PDGCode == 221){
3684 functionResultMC = dNdyMC / ( 2 * TMath::Pi())*(nMC-1.)*(nMC-2.) / (nMC*tMC*(nMC*tMC+mesonMass*(nMC-2.))) * TMath::Power(1.+(TMath::Sqrt(mesonPt*mesonPt+mesonMass*mesonMass)-mesonMass)/(nMC*tMC), -nMC);
3685 } else if (kCaseGen == 2){ // Phojet
3686 Float_t dNdyMC = 2.35978;
3687 Float_t nMC = 6.81795;
3688 Float_t tMC = 0.11492;
3689 if ( PDGCode == 111){
3693 } else if ( PDGCode == 221){
3698 functionResultMC = dNdyMC / ( 2 * TMath::Pi())*(nMC-1.)*(nMC-2.) / (nMC*tMC*(nMC*tMC+mesonMass*(nMC-2.))) * TMath::Power(1.+(TMath::Sqrt(mesonPt*mesonPt+mesonMass*mesonMass)-mesonMass)/(nMC*tMC), -nMC);
3699 } else if (kCaseGen == 4){ // BOX generators pp
3700 // functionResultMC = 1./sqrt(1.-mesonMass*mesonMass/((mesonMass*mesonMass+mesonPt*mesonPt)*cosh(mesonY)*cosh(mesonY)));
3701 Float_t a = 0.23437;
3703 Float_t c = -1430.5863;
3704 Float_t d = -0.6966624;
3705 Float_t e = 252.3742;
3706 if ( PDGCode == 111){
3712 } else if ( PDGCode == 221){
3719 functionResultMC = a*TMath::Power(mesonPt,-1.*(b+c/(TMath::Power(mesonPt,d)+e)))*1./mesonPt *1./1.6 *1./(2.* TMath::Pi());
3720 // cout << functionResultMC << endl;
3721 } else if (kCaseGen == 3 ){ // HIJING
3722 if ( PDGCode == 111 && fDoReweightHistoMCPi0 && hReweightMCHistPi0!= 0x0){
3723 functionResultMC = hReweightMCHistPi0->Interpolate(mesonPt);
3725 if ( PDGCode == 310 && fDoReweightHistoMCK0s && hReweightMCHistK0s!= 0x0){
3726 functionResultMC = hReweightMCHistK0s->Interpolate(mesonPt);
3730 Float_t functionResultData = 1;
3731 if (kCaseGen == 1 || kCaseGen == 2 || kCaseGen == 4 ){
3732 Float_t dNdyData = 2.2328;
3733 Float_t nData = 7.1473;
3734 Float_t tData = 0.1346;
3735 if ( PDGCode == 111){
3739 } else if ( PDGCode == 221){
3740 dNdyData = 0.38992; //be careful this fit is not optimal, eta in data still has problems
3744 functionResultData = dNdyData / ( 2 * TMath::Pi())*(nData-1.)*(nData-2.) / (nData*tData*(nData*tData+mesonMass*(nData-2.))) * TMath::Power(1.+(TMath::Sqrt(mesonPt*mesonPt+mesonMass*mesonMass)-mesonMass)/(nData*tData), -nData);
3745 // cout << functionResultData << endl;
3752 if ( PDGCode == 111 ){
3753 if (fModCentralityClass == 1 && fCentralityMin == 0 && fCentralityMax == 1 ){ // 0-5 % PbPb
3759 } else if (fModCentralityClass == 1 && fCentralityMin == 1 && fCentralityMax == 2){ // 5-10% PbPb
3765 } else if (fModCentralityClass == 0 && fCentralityMin == 0 && fCentralityMax == 1){ // 0-10% PbPb
3771 } else if (fModCentralityClass == 0 && fCentralityMin == 1 && fCentralityMax == 2){ // 10-20% PbPb
3777 } else if (fModCentralityClass == 0 && fCentralityMin == 2 && fCentralityMax == 4){ // 20-40% PbPb
3783 } else if (fModCentralityClass == 0 && fCentralityMin == 4 && fCentralityMax == 6){ // 40-60% PbPb
3789 } else if (fModCentralityClass == 0 && fCentralityMin == 6 && fCentralityMax == 8){ // 60-80% PbPb
3795 } else if (fModCentralityClass == 0 && fCentralityMin == 0 && fCentralityMax == 2){ // 0-20% PbPb
3801 } else if (fModCentralityClass == 0 && fCentralityMin == 0 && fCentralityMax == 4){ // 0-40% PbPb
3807 } else if (fModCentralityClass == 0 && fCentralityMin == 0 && fCentralityMax == 8){ // 0-80% PbPb
3813 } else if (fModCentralityClass == 0 && fCentralityMin == 4 && fCentralityMax == 8){ // 60-80% PbPb
3821 functionResultData = a*TMath::Power(mesonPt,-1*(b+c/(TMath::Power(mesonPt,d)+e)));
3826 Double_t weight = 1;
3827 if (PDGCode == 111 || PDGCode == 221){
3828 if (functionResultData != 0. && functionResultMC != 0. && isfinite(functionResultData) && isfinite(functionResultMC)){
3829 weight = functionResultData/functionResultMC;
3830 if ( kCaseGen == 3){
3831 if (!(fDoReweightHistoMCPi0 && hReweightMCHistPi0!= 0x0 && PDGCode == 111)){
3835 if (!isfinite(functionResultData)) weight = 1.;
3836 if (!isfinite(weight)) weight = 1.;
3838 } else if (PDGCode == 310 && functionResultMC != 0 && isfinite(functionResultMC)){
3839 weight = functionResultMC;
3842 // if (fModCentralityClass == 0 && fCentralityMin == 4 && fCentralityMax == 6 && PDGCode == 111){
3843 // cout << period.Data() << "\t" << kCaseGen << "\t" <<fModCentralityClass<< "\t" <<fCentralityMin<< "\t" <<fCentralityMax << "\t" << mesonPt << "\t" <<mesonMass<< "\t"<<functionResultData << "\t"<< functionResultMC << "\t" << weight <<endl;
3847 ///________________________________________________________________________
3848 AliConversionCuts* AliConversionCuts::GetStandardCuts2010PbPb(){
3849 //Create and return standard 2010 PbPb cuts
3850 AliConversionCuts *cuts=new AliConversionCuts("StandardCuts2010PbPb","StandardCuts2010PbPb");
3851 if(!cuts->InitializeCutsFromCutString("100000204209297002322000000")){
3852 cout<<"Warning: Initialization of Standardcuts2010PbPb failed"<<endl;}
3856 ///________________________________________________________________________
3857 AliConversionCuts* AliConversionCuts::GetStandardCuts2010pp(){
3858 //Create and return standard 2010 PbPb cuts
3859 AliConversionCuts *cuts=new AliConversionCuts("StandardCuts2010pp","StandardCuts2010pp");
3860 if(!cuts->InitializeCutsFromCutString("000001100209366300380000000")){
3861 cout<<"Warning: Initialization of Standardcuts2010pp failed"<<endl;}
3864 ///________________________________________________________________________
3865 void AliConversionCuts::GetCorrectEtaShiftFromPeriod(TString periodName){
3867 if(periodName.CompareTo("LHC12g") == 0 || //pilot run 2012
3868 periodName.CompareTo("LHC13b") == 0 || //mainly minimum bias
3869 periodName.CompareTo("LHC13c") == 0 || //mainly minimum bias
3870 periodName.CompareTo("LHC13d") == 0 || //mainly triggered
3871 periodName.CompareTo("LHC13e") == 0 || //mainly triggered
3872 periodName.CompareTo("LHC13c3") == 0 || //MC Starlight, anchor LHC13d+e
3873 periodName.CompareTo("LHC13c2") == 0 || //MC Starlight, coherent J/Psi, UPC muon anchor LHC13d+e
3874 periodName.CompareTo("LHC13b4") == 0 || //MC Pythia 6 (Jet-Jet), anchor LHC13b
3875 periodName.CompareTo("LHC13b2_fix_1") == 0 || //MC DPMJET, anchr LHC13b+c
3876 periodName.CompareTo("LHC13b3") == 0 || //MC HIJING, weighted to number of events per run, anchor LHC13b
3877 periodName.CompareTo("LHC13b2") == 0 || // MC DPMJET, wrong energy, anchor LHC13b
3878 periodName.CompareTo("LHC13b2_plus") == 0 || // MC DPMJET, weighted to number event per run, anchor LHC13b
3879 periodName.CompareTo("LHC13c1_bis") == 0 || // MC AMPT fast generation, pT hardbin, anchor ?
3880 periodName.CompareTo("LHC13c1") == 0 || // MC AMPT fast generation, anchor ?
3881 periodName.CompareTo("LHC13b1") == 0 || // MC DPMJET, fragments, with fixed label 0, anchor LHC12g
3882 periodName.CompareTo("LHC12g4b_fix") == 0 || // MC DPMJET, with fixed label 0, anchor LHC12g
3883 periodName.CompareTo("LHC12g1_fix") == 0 || // MC ?, with fixed label 0, anchor LHC12g
3884 periodName.CompareTo("LHC12g4c") == 0 || // MC DPMJET, shifted vertex runs, anchor LHC12g
3885 periodName.CompareTo("LHC12h6") == 0 || // MC muon cocktail, anchor LHC12g
3886 periodName.CompareTo("LHC12g4b") == 0 || // MC DPMJET 3rd iteration, anchor LHC12g
3887 periodName.CompareTo("LHC12g4a") == 0 || // MC DPMJET improved, anchor LHC12g
3888 periodName.CompareTo("LHC12g4") == 0 || // MC DPMJET, anchor LHC12g
3889 periodName.CompareTo("LHC12g5") == 0 || // MC PHOJET, anchor LHC12g
3890 periodName.CompareTo("LHC12g2") == 0 || // MC Starlight background, anchor LHC12g
3891 periodName.CompareTo("LHC12g1") == 0 ) // MC ?, anchor LHC12g
3893 printf(" Gamma Conversion Cuts %s :: pPb Run doing Eta Shift of %f \n\n",(GetCutNumber()).Data(),-0.465);
3894 SetEtaShift(-0.465);
3896 else if(periodName.CompareTo("LHC13f") == 0 ||
3897 periodName.CompareTo("LHC13c6b") == 0 ||// MC Jpsi -> mumu, anchor LHC13f
3898 periodName.CompareTo("LHC13c5") == 0 || //MC Starlight, gamma gamma UPC muon, anchor LHC13f
3899 periodName.CompareTo("LHC13c4") == 0 )//MC Starlight, coherent JPsi, UPC muon, anchor LHC13f
3901 printf(" Gamma Conversion Cuts %s :: Pbp Run doing Eta Shift of %f \n\n",(GetCutNumber()).Data(),0.465);
3902 SetEtaShift(+0.465);
3904 else printf(" Gamma Conversion Cuts %s :: Automatic Eta Shift requested but Period is not known -> No Shift \n\n",(GetCutNumber()).Data());