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"
37 #include "AliAODConversionMother.h"
38 #include "TObjString.h"
39 #include "AliAODEvent.h"
40 #include "AliESDEvent.h"
41 #include "AliCentrality.h"
45 #include "AliGenCocktailEventHeader.h"
46 #include "AliGenDPMjetEventHeader.h"
47 #include "AliGenPythiaEventHeader.h"
48 #include "AliGenHijingEventHeader.h"
49 #include "AliTriggerAnalysis.h"
50 #include "AliV0ReaderV1.h"
51 #include "AliAODMCParticle.h"
52 #include "AliAODMCHeader.h"
58 ClassImp(AliConversionCuts)
61 const char* AliConversionCuts::fgkCutNames[AliConversionCuts::kNCuts] = {
66 "MultiplicityMethod",//4
68 "RejectExtraSignals",//6
76 "piMomdedxSigmaCut",//14
77 "piMaxMomdedxSigmaCut",//15
78 "LowPRejectionSigmaCut",//16
83 "DoPhotonAsymmetryCut",//21
84 "CosinePointingAngle", //22
85 "SharedElectronCuts", //23
86 "RejectToCloseV0s", //24
92 //________________________________________________________________________
93 AliConversionCuts::AliConversionCuts(const char *name,const char *title) :
94 AliAnalysisCuts(name,title),
110 fLineCutZRSlopeMin(0.),
111 fLineCutZValueMin(0),
112 fChi2CutConversion(1000),
113 fPIDProbabilityCutNegativeParticle(0),
114 fPIDProbabilityCutPositiveParticle(0),
115 fDodEdxSigmaCut(kTRUE),
116 fDoTOFsigmaCut(kFALSE),
117 fPIDTRDEfficiency(1),
119 fPIDnSigmaAboveElectronLine(100),
120 fPIDnSigmaBelowElectronLine(-100),
121 fTofPIDnSigmaAboveElectronLine(100),
122 fTofPIDnSigmaBelowElectronLine(-100),
123 fPIDnSigmaAbovePionLine(0),
124 fPIDnSigmaAbovePionLineHighPt(-100),
125 fPIDMinPnSigmaAbovePionLine(0),
126 fPIDMaxPnSigmaAbovePionLine(0),
127 fDoKaonRejectionLowP(kFALSE),
128 fDoProtonRejectionLowP(kFALSE),
129 fDoPionRejectionLowP(kFALSE),
130 fPIDnSigmaAtLowPAroundKaonLine(0),
131 fPIDnSigmaAtLowPAroundProtonLine(0),
132 fPIDnSigmaAtLowPAroundPionLine(0),
133 fPIDMinPKaonRejectionLowP(1.5),
134 fPIDMinPProtonRejectionLowP(2),
135 fPIDMinPPionRejectionLowP(0),
136 fDoQtGammaSelection(kTRUE),
137 fDoHighPtQtGammaSelection(kFALSE),
145 fUseEtaMinCut(kFALSE),
146 fUseOnFlyV0Finder(kTRUE),
147 fDoPhotonAsymmetryCut(kTRUE),
148 fMinPPhotonAsymmetryCut(100.),
149 fMinPhotonAsymmetry(0.),
151 fDetectorCentrality(0),
152 fModCentralityClass(0),
156 fUseCorrectedTPCClsInfo(kFALSE),
158 fMultiplicityMethod(0),
160 fRemovePileUp(kFALSE),
161 fOpeningAngle(0.005),
163 fPsiPairDeltaPhiCut(10000),
164 fDo2DPsiPair(kFALSE),
165 fCosPAngleCut(10000),
166 fDoToCloseV0sCut(kFALSE),
167 fRejectExtraSignals(0),
169 fDoSharedElecCut(kFALSE),
170 fOfflineTriggerMask(0),
174 fElectronArraySize(500),
175 fElectronLabelArray(NULL),
176 fDCAZPrimVtxCut(1000),
177 fDCARPrimVtxCut(1000),
178 fConversionPointXArray(0.0),
179 fConversionPointYArray(0.0),
180 fConversionPointZArray(0.0),
182 fNotRejectedStart(NULL),
183 fNotRejectedEnd(NULL),
184 fGeneratorNames(NULL),
189 fDoReweightHistoMCPi0(kFALSE),
190 fDoReweightHistoMCEta(kFALSE),
191 fDoReweightHistoMCK0s(kFALSE),
192 fPathTrFReweighting(""),
193 fNameHistoReweightingPi0(""),
194 fNameHistoReweightingEta(""),
195 fNameHistoReweightingK0s(""),
200 hTPCdEdxbefore(NULL),
202 hTPCdEdxSigbefore(NULL),
203 hTPCdEdxSigafter(NULL),
207 hPsiPairDeltaPhiafter(NULL),
210 hInvMassbefore(NULL),
211 hArmenterosbefore(NULL),
213 hArmenterosafter(NULL),
214 hAcceptanceCuts(NULL),
218 hCentralityVsNumberOfPrimaryTracks(NULL),
221 hTriggerClassSelected(NULL),
222 hReweightMCHistPi0(NULL),
223 hReweightMCHistEta(NULL),
224 hReweightMCHistK0s(NULL),
229 fTriggerSelectedManually(kFALSE),
230 fSpecialTriggerName("")
234 for(Int_t jj=0;jj<kNCuts;jj++){fCuts[jj]=0;}
235 fCutString=new TObjString((GetCutNumber()).Data());
237 fElectronLabelArray = new Int_t[fElectronArraySize];
238 fUtils = new AliAnalysisUtils();
239 //if you do not want to apply the cut on the distance between the SPD and TRK vertex:
240 //fUtils->SetCutOnZVertexSPD(kFALSE);
245 //________________________________________________________________________
246 AliConversionCuts::AliConversionCuts(const AliConversionCuts &ref) :
247 AliAnalysisCuts(ref),
249 fHeaderList(ref.fHeaderList),
251 fEventQuality(ref.fEventQuality),
254 fEtaCut(ref.fEtaCut),
255 fEtaCutMin(ref.fEtaCutMin),
257 fSinglePtCut(ref.fSinglePtCut),
259 fMinClsTPC(ref.fMinClsTPC),
260 fMinClsTPCToF(ref.fMinClsTPCToF),
261 fLineCutZRSlope(ref.fLineCutZRSlope),
262 fLineCutZValue(ref.fLineCutZValue),
263 fLineCutZRSlopeMin(ref.fLineCutZRSlopeMin),
264 fLineCutZValueMin(ref.fLineCutZValueMin),
265 fChi2CutConversion(ref.fChi2CutConversion),
266 fPIDProbabilityCutNegativeParticle(ref.fPIDProbabilityCutNegativeParticle),
267 fPIDProbabilityCutPositiveParticle(ref.fPIDProbabilityCutPositiveParticle),
268 fDodEdxSigmaCut(ref. fDodEdxSigmaCut),
269 fDoTOFsigmaCut(ref.fDoTOFsigmaCut),
270 fPIDTRDEfficiency(ref.fPIDTRDEfficiency),
271 fDoTRDPID(ref.fDoTRDPID),
272 fPIDnSigmaAboveElectronLine(ref.fPIDnSigmaAboveElectronLine),
273 fPIDnSigmaBelowElectronLine(ref.fPIDnSigmaBelowElectronLine),
274 fTofPIDnSigmaAboveElectronLine(ref.fTofPIDnSigmaAboveElectronLine),
275 fTofPIDnSigmaBelowElectronLine(ref.fTofPIDnSigmaBelowElectronLine),
276 fPIDnSigmaAbovePionLine(ref.fPIDnSigmaAbovePionLine),
277 fPIDnSigmaAbovePionLineHighPt(ref.fPIDnSigmaAbovePionLineHighPt),
278 fPIDMinPnSigmaAbovePionLine(ref.fPIDMinPnSigmaAbovePionLine),
279 fPIDMaxPnSigmaAbovePionLine(ref.fPIDMaxPnSigmaAbovePionLine),
280 fDoKaonRejectionLowP(ref.fDoKaonRejectionLowP),
281 fDoProtonRejectionLowP(ref.fDoProtonRejectionLowP),
282 fDoPionRejectionLowP(ref.fDoPionRejectionLowP),
283 fPIDnSigmaAtLowPAroundKaonLine(ref.fPIDnSigmaAtLowPAroundKaonLine),
284 fPIDnSigmaAtLowPAroundProtonLine(ref.fPIDnSigmaAtLowPAroundProtonLine),
285 fPIDnSigmaAtLowPAroundPionLine(ref.fPIDnSigmaAtLowPAroundPionLine),
286 fPIDMinPKaonRejectionLowP(ref.fPIDMinPKaonRejectionLowP),
287 fPIDMinPProtonRejectionLowP(ref.fPIDMinPProtonRejectionLowP),
288 fPIDMinPPionRejectionLowP(ref.fPIDMinPPionRejectionLowP),
289 fDoQtGammaSelection(ref.fDoQtGammaSelection),
290 fDoHighPtQtGammaSelection(ref.fDoHighPtQtGammaSelection),
292 fHighPtQtMax(ref.fHighPtQtMax),
293 fPtBorderForQt(ref.fPtBorderForQt),
294 fXVertexCut(ref.fXVertexCut),
295 fYVertexCut(ref.fYVertexCut),
296 fZVertexCut(ref.fZVertexCut),
297 fNSigmaMass(ref.fNSigmaMass),
298 fUseEtaMinCut(ref.fUseEtaMinCut),
299 fUseOnFlyV0Finder(ref.fUseOnFlyV0Finder),
300 fDoPhotonAsymmetryCut(ref.fDoPhotonAsymmetryCut),
301 fMinPPhotonAsymmetryCut(ref.fMinPPhotonAsymmetryCut),
302 fMinPhotonAsymmetry(ref.fMinPhotonAsymmetry),
303 fIsHeavyIon(ref.fIsHeavyIon),
304 fDetectorCentrality(ref.fDetectorCentrality),
305 fModCentralityClass(ref.fModCentralityClass),
306 fMaxVertexZ(ref.fMaxVertexZ),
307 fCentralityMin(ref.fCentralityMin),
308 fCentralityMax(ref.fCentralityMax),
309 fUseCorrectedTPCClsInfo(ref.fUseCorrectedTPCClsInfo),
310 fUseTOFpid(ref.fUseTOFpid),
311 fMultiplicityMethod(ref.fMultiplicityMethod),
312 fSpecialTrigger(ref.fSpecialTrigger),
313 fRemovePileUp(ref.fRemovePileUp),
314 fOpeningAngle(ref.fOpeningAngle),
315 fPsiPairCut(ref.fPsiPairCut),
316 fPsiPairDeltaPhiCut(ref.fPsiPairDeltaPhiCut),
317 fDo2DPsiPair(ref.fDo2DPsiPair),
318 fCosPAngleCut(ref.fCosPAngleCut),
319 fDoToCloseV0sCut(ref.fDoToCloseV0sCut),
320 fRejectExtraSignals(ref.fRejectExtraSignals),
321 fminV0Dist(ref.fminV0Dist),
322 fDoSharedElecCut(ref.fDoSharedElecCut),
323 fOfflineTriggerMask(ref.fOfflineTriggerMask),
324 fHasV0AND(ref.fHasV0AND),
325 fIsSDDFired(ref.fIsSDDFired),
326 fRandom(ref.fRandom),
327 fElectronArraySize(ref.fElectronArraySize),
328 fElectronLabelArray(NULL),
329 fDCAZPrimVtxCut(ref.fDCAZPrimVtxCut),
330 fDCARPrimVtxCut(ref.fDCAZPrimVtxCut),
331 fConversionPointXArray(ref.fConversionPointXArray),
332 fConversionPointYArray(ref.fConversionPointYArray),
333 fConversionPointZArray(ref.fConversionPointZArray),
334 fnHeaders(ref.fnHeaders),
335 fNotRejectedStart(NULL),
336 fNotRejectedEnd(NULL),
337 fGeneratorNames(ref.fGeneratorNames),
340 fEtaShift(ref.fEtaShift),
341 fDoEtaShift(ref.fDoEtaShift),
342 fDoReweightHistoMCPi0(ref.fDoReweightHistoMCPi0),
343 fDoReweightHistoMCEta(ref.fDoReweightHistoMCEta),
344 fDoReweightHistoMCK0s(ref.fDoReweightHistoMCK0s),
345 fPathTrFReweighting(ref.fPathTrFReweighting),
346 fNameHistoReweightingPi0(ref.fNameHistoReweightingPi0),
347 fNameHistoReweightingEta(ref.fNameHistoReweightingEta),
348 fNameHistoReweightingK0s(ref.fNameHistoReweightingK0s),
349 fNameFitDataPi0(ref.fNameFitDataPi0),
350 fNameFitDataEta(ref.fNameFitDataEta),
351 fNameFitDataK0s(ref.fNameFitDataK0s),
353 hTPCdEdxbefore(NULL),
355 hTPCdEdxSigbefore(NULL),
356 hTPCdEdxSigafter(NULL),
360 hPsiPairDeltaPhiafter(NULL),
363 hInvMassbefore(NULL),
364 hArmenterosbefore(NULL),
366 hArmenterosafter(NULL),
367 hAcceptanceCuts(NULL),
371 hCentralityVsNumberOfPrimaryTracks(NULL),
374 hTriggerClassSelected(NULL),
375 hReweightMCHistPi0(ref.hReweightMCHistPi0),
376 hReweightMCHistEta(ref.hReweightMCHistEta),
377 hReweightMCHistK0s(ref.hReweightMCHistK0s),
378 fFitDataPi0(ref.fFitDataPi0),
379 fFitDataEta(ref.fFitDataEta),
380 fFitDataK0s(ref.fFitDataK0s),
381 fPreSelCut(ref.fPreSelCut),
382 fTriggerSelectedManually(ref.fTriggerSelectedManually),
383 fSpecialTriggerName(ref.fSpecialTriggerName)
386 for(Int_t jj=0;jj<kNCuts;jj++){fCuts[jj]=ref.fCuts[jj];}
387 fCutString=new TObjString((GetCutNumber()).Data());
388 fElectronLabelArray = new Int_t[fElectronArraySize];
389 fUtils = new AliAnalysisUtils();
390 // dont copy histograms (if you like histograms, call InitCutHistograms())
395 //________________________________________________________________________
396 AliConversionCuts::~AliConversionCuts() {
398 //Deleting fHistograms leads to seg fault it it's added to output collection of a task
400 // delete fHistograms;
401 // fHistograms = NULL;
402 if(fCutString != NULL){
406 if(fElectronLabelArray){
407 delete fElectronLabelArray;
408 fElectronLabelArray = NULL;
410 if(fNotRejectedStart){
411 delete[] fNotRejectedStart;
412 fNotRejectedStart = NULL;
415 delete[] fNotRejectedEnd;
416 fNotRejectedEnd = NULL;
419 delete[] fGeneratorNames;
420 fGeneratorNames = NULL;
429 //________________________________________________________________________
430 void AliConversionCuts::InitCutHistograms(TString name, Bool_t preCut){
432 // Initialize Cut Histograms for QA (only initialized and filled if function is called)
433 TH1::AddDirectory(kFALSE);
435 if(fHistograms != NULL){
439 if(fHistograms==NULL){
440 fHistograms=new TList();
441 fHistograms->SetOwner(kTRUE);
442 if(name=="")fHistograms->SetName(Form("ConvCuts_%s",GetCutNumber().Data()));
443 else fHistograms->SetName(Form("%s_%s",name.Data(),GetCutNumber().Data()));
446 if (hReweightMCHistPi0){
447 hReweightMCHistPi0->SetName("MCInputForWeightingPi0");
448 fHistograms->Add(hReweightMCHistPi0);
450 if (hReweightMCHistEta){
451 hReweightMCHistEta->SetName("MCInputForWeightingEta");
452 fHistograms->Add(hReweightMCHistEta);
454 if (hReweightMCHistK0s){
455 hReweightMCHistK0s->SetName("MCInputForWeightingK0s");
456 fHistograms->Add(hReweightMCHistK0s);
459 // fFitDataPi0->SetName("DataFitForWeightingPi0");
460 // fHistograms->Add(fFitDataPi0);
463 // fFitDataEta->SetName("DataFitForWeightingEta");
464 // fHistograms->Add(fFitDataEta);
467 // fFitDataK0s->SetName("DataFitForWeightingK0s");
468 // fHistograms->Add(fFitDataK0s);
471 hCutIndex=new TH1F(Form("IsPhotonSelected %s",GetCutNumber().Data()),"IsPhotonSelected",10,-0.5,9.5);
472 hCutIndex->GetXaxis()->SetBinLabel(kPhotonIn+1,"in");
473 hCutIndex->GetXaxis()->SetBinLabel(kOnFly+1,"onfly");
474 hCutIndex->GetXaxis()->SetBinLabel(kNoTracks+1,"no tracks");
475 hCutIndex->GetXaxis()->SetBinLabel(kdEdxCuts+1,"dEdx");
476 hCutIndex->GetXaxis()->SetBinLabel(kTrackCuts+1,"Track cuts");
477 hCutIndex->GetXaxis()->SetBinLabel(kConvPointFail+1,"ConvPoint fail");
478 hCutIndex->GetXaxis()->SetBinLabel(kPhotonCuts+1,"PhotonCuts");
479 hCutIndex->GetXaxis()->SetBinLabel(kPhotonOut+1,"out");
480 fHistograms->Add(hCutIndex);
483 hTrackCuts=new TH1F(Form("TrackCuts %s",GetCutNumber().Data()),"TrackCuts",9,-0.5,8.5);
484 hTrackCuts->GetXaxis()->SetBinLabel(1,"in");
485 hTrackCuts->GetXaxis()->SetBinLabel(2,"likesign");
486 hTrackCuts->GetXaxis()->SetBinLabel(3,"ntpccl");
487 hTrackCuts->GetXaxis()->SetBinLabel(4,"acceptance");
488 hTrackCuts->GetXaxis()->SetBinLabel(5,"singlept");
489 hTrackCuts->GetXaxis()->SetBinLabel(6,"TPCrefit");
490 hTrackCuts->GetXaxis()->SetBinLabel(7,"kink");
491 hTrackCuts->GetXaxis()->SetBinLabel(8,"out");
492 fHistograms->Add(hTrackCuts);
495 hPhotonCuts=new TH1F(Form("PhotonCuts %s",GetCutNumber().Data()),"PhotonCuts",14,-0.5,13.5);
496 hPhotonCuts->GetXaxis()->SetBinLabel(1,"in");
497 hPhotonCuts->GetXaxis()->SetBinLabel(2,"qtcut");
498 hPhotonCuts->GetXaxis()->SetBinLabel(3,"chi2");
499 hPhotonCuts->GetXaxis()->SetBinLabel(4,"acceptance");
500 hPhotonCuts->GetXaxis()->SetBinLabel(5,"asymmetry");
501 hPhotonCuts->GetXaxis()->SetBinLabel(6,"pidprob");
502 hPhotonCuts->GetXaxis()->SetBinLabel(7,"cortpcclinfo");
503 hPhotonCuts->GetXaxis()->SetBinLabel(8,"PsiPair");
504 hPhotonCuts->GetXaxis()->SetBinLabel(9,"CosPAngle");
505 hPhotonCuts->GetXaxis()->SetBinLabel(10,"DCA R");
506 hPhotonCuts->GetXaxis()->SetBinLabel(11,"DCA Z");
507 hPhotonCuts->GetXaxis()->SetBinLabel(12,"out");
508 fHistograms->Add(hPhotonCuts);
511 hInvMassbefore=new TH1F(Form("InvMass_before %s",GetCutNumber().Data()),"InvMass_before",1000,0,0.3);
512 fHistograms->Add(hInvMassbefore);
513 hArmenterosbefore=new TH2F(Form("Armenteros_before %s",GetCutNumber().Data()),"Armenteros_before",200,-1,1,1000,0,1.);
514 fHistograms->Add(hArmenterosbefore);
516 hInvMassafter=new TH1F(Form("InvMass_after %s",GetCutNumber().Data()),"InvMass_after",1000,0,0.3);
517 fHistograms->Add(hInvMassafter);
518 hArmenterosafter=new TH2F(Form("Armenteros_after %s",GetCutNumber().Data()),"Armenteros_after",200,-1,1,250,0,0.25);
519 fHistograms->Add(hArmenterosafter);
521 hAcceptanceCuts=new TH1F(Form("PhotonAcceptanceCuts %s",GetCutNumber().Data()),"PhotonAcceptanceCuts",10,-0.5,9.5);
522 hAcceptanceCuts->GetXaxis()->SetBinLabel(1,"in");
523 hAcceptanceCuts->GetXaxis()->SetBinLabel(2,"maxR");
524 hAcceptanceCuts->GetXaxis()->SetBinLabel(3,"minR");
525 hAcceptanceCuts->GetXaxis()->SetBinLabel(4,"line");
526 hAcceptanceCuts->GetXaxis()->SetBinLabel(5,"maxZ");
527 hAcceptanceCuts->GetXaxis()->SetBinLabel(6,"eta");
528 hAcceptanceCuts->GetXaxis()->SetBinLabel(7,"minpt");
529 hAcceptanceCuts->GetXaxis()->SetBinLabel(8,"out");
530 fHistograms->Add(hAcceptanceCuts);
533 hdEdxCuts=new TH1F(Form("dEdxCuts %s",GetCutNumber().Data()),"dEdxCuts",10,-0.5,9.5);
534 hdEdxCuts->GetXaxis()->SetBinLabel(1,"in");
535 hdEdxCuts->GetXaxis()->SetBinLabel(2,"TPCelectron");
536 hdEdxCuts->GetXaxis()->SetBinLabel(3,"TPCpion");
537 hdEdxCuts->GetXaxis()->SetBinLabel(4,"TPCpionhighp");
538 hdEdxCuts->GetXaxis()->SetBinLabel(5,"TPCkaonlowprej");
539 hdEdxCuts->GetXaxis()->SetBinLabel(6,"TPCprotonlowprej");
540 hdEdxCuts->GetXaxis()->SetBinLabel(7,"TPCpionlowprej");
541 hdEdxCuts->GetXaxis()->SetBinLabel(8,"TOFelectron");
542 hdEdxCuts->GetXaxis()->SetBinLabel(9,"TRDelectron");
543 hdEdxCuts->GetXaxis()->SetBinLabel(10,"out");
544 fHistograms->Add(hdEdxCuts);
546 TAxis *AxisBeforedEdx = NULL;
547 TAxis *AxisBeforedEdxSig = NULL;
548 TAxis *AxisBeforeTOF = NULL;
549 TAxis *AxisBeforeTOFSig = NULL;
551 hTPCdEdxbefore=new TH2F(Form("Gamma_dEdx_before %s",GetCutNumber().Data()),"dEdx Gamma before" ,150,0.03,20,800,0,200);
552 fHistograms->Add(hTPCdEdxbefore);
553 AxisBeforedEdx = hTPCdEdxbefore->GetXaxis();
554 hTPCdEdxSigbefore=new TH2F(Form("Gamma_dEdxSig_before %s",GetCutNumber().Data()),"dEdx Sigma Gamma before" ,150,0.03,20,400,-10,10);
555 fHistograms->Add(hTPCdEdxSigbefore);
556 AxisBeforedEdxSig = hTPCdEdxSigbefore->GetXaxis();
558 hTOFbefore=new TH2F(Form("Gamma_TOF_before %s",GetCutNumber().Data()),"TOF Gamma before" ,150,0.03,20,11000,-1000,10000);
559 fHistograms->Add(hTOFbefore);
560 AxisBeforeTOF = hTOFbefore->GetXaxis();
561 hTOFSigbefore=new TH2F(Form("Gamma_TOFSig_before %s",GetCutNumber().Data()),"TOF Sigma Gamma before" ,150,0.03,20,400,-6,10);
562 fHistograms->Add(hTOFSigbefore);
563 AxisBeforeTOFSig = hTOFSigbefore->GetXaxis();
566 hTPCdEdxSigafter=new TH2F(Form("Gamma_dEdxSig_after %s",GetCutNumber().Data()),"dEdx Sigma Gamma after" ,150,0.03,20,400, -10,10);
567 fHistograms->Add(hTPCdEdxSigafter);
569 hTPCdEdxafter=new TH2F(Form("Gamma_dEdx_after %s",GetCutNumber().Data()),"dEdx Gamma after" ,150,0.03,20,800,0,200);
570 fHistograms->Add(hTPCdEdxafter);
572 hTOFSigafter=new TH2F(Form("Gamma_TOFSig_after %s",GetCutNumber().Data()),"TOF Sigma Gamma after" ,150,0.03,20,400,-6,10);
573 fHistograms->Add(hTOFSigafter);
575 hPsiPairDeltaPhiafter=new TH2F(Form("Gamma_PsiPairDeltaPhi_after %s",GetCutNumber().Data()),"Psi Pair vs Delta Phi Gamma after" ,200,-2,2,200,-2,2);
576 fHistograms->Add(hPsiPairDeltaPhiafter);
578 TAxis *AxisAfter = hTPCdEdxSigafter->GetXaxis();
579 Int_t bins = AxisAfter->GetNbins();
580 Double_t from = AxisAfter->GetXmin();
581 Double_t to = AxisAfter->GetXmax();
582 Double_t *newBins = new Double_t[bins+1];
584 Double_t factor = TMath::Power(to/from, 1./bins);
585 for(Int_t i=1; i<=bins; ++i) newBins[i] = factor * newBins[i-1];
586 AxisAfter->Set(bins, newBins);
587 AxisAfter = hTOFSigafter->GetXaxis();
588 AxisAfter->Set(bins, newBins);
589 AxisAfter = hTPCdEdxafter->GetXaxis();
590 AxisAfter->Set(bins, newBins);
592 AxisBeforedEdx->Set(bins, newBins);
593 AxisBeforeTOF->Set(bins, newBins);
594 AxisBeforedEdxSig->Set(bins, newBins);
595 AxisBeforeTOFSig->Set(bins, newBins);
599 // Event Cuts and Info
601 hV0EventCuts=new TH1F(Form("ESD_EventCuts %s",GetCutNumber().Data()),"Event Cuts",7,-0.5,6.5);
602 hV0EventCuts->GetXaxis()->SetBinLabel(1,"in");
603 hV0EventCuts->GetXaxis()->SetBinLabel(2,"OfflineTrigger");
604 hV0EventCuts->GetXaxis()->SetBinLabel(3,"nvtxcontr");
605 hV0EventCuts->GetXaxis()->SetBinLabel(4,"VertexZ");
606 hV0EventCuts->GetXaxis()->SetBinLabel(5,"pileup");
607 hV0EventCuts->GetXaxis()->SetBinLabel(6,"centrsel");
608 hV0EventCuts->GetXaxis()->SetBinLabel(7,"out");
609 fHistograms->Add(hV0EventCuts);
611 hCentrality=new TH1F(Form("Centrality %s",GetCutNumber().Data()),"Centrality",1000,0,100);
612 fHistograms->Add(hCentrality);
613 hCentralityVsNumberOfPrimaryTracks=new TH2F(Form("Centrality vs Primary Tracks %s",GetCutNumber().Data()),"Centrality vs Primary Tracks ",100,0,100,4000,0,4000);
614 fHistograms->Add(hCentralityVsNumberOfPrimaryTracks);
615 hVertexZ=new TH1F(Form("VertexZ %s",GetCutNumber().Data()),"VertexZ",1000,-50,50);
616 fHistograms->Add(hVertexZ);
618 hTriggerClass= new TH1F(Form("OfflineTrigger %s",GetCutNumber().Data()),"OfflineTrigger",35,-0.5,34.5);
619 hTriggerClass->GetXaxis()->SetBinLabel( 1,"kMB");
620 hTriggerClass->GetXaxis()->SetBinLabel( 2,"kINT7");
621 hTriggerClass->GetXaxis()->SetBinLabel( 3,"kMUON");
622 hTriggerClass->GetXaxis()->SetBinLabel( 4,"kHighMult");
623 hTriggerClass->GetXaxis()->SetBinLabel( 5,"kKEMC1");
624 hTriggerClass->GetXaxis()->SetBinLabel( 6,"kCINT5");
625 hTriggerClass->GetXaxis()->SetBinLabel( 7,"kCMUS5/kMUSPB");
626 hTriggerClass->GetXaxis()->SetBinLabel( 8,"kMUSH7/kMUSHPB");
627 hTriggerClass->GetXaxis()->SetBinLabel( 9,"kMUL7/kMuonLikePB");
628 hTriggerClass->GetXaxis()->SetBinLabel(10,"kMUU7/kMuonUnlikePB");
629 hTriggerClass->GetXaxis()->SetBinLabel(11,"kEMC7/kEMC8");
630 hTriggerClass->GetXaxis()->SetBinLabel(12,"kMUS7");
631 hTriggerClass->GetXaxis()->SetBinLabel(13,"kPHI1");
632 hTriggerClass->GetXaxis()->SetBinLabel(14,"kPHI7/kPHI8/kPHOSPb");
633 hTriggerClass->GetXaxis()->SetBinLabel(15,"kEMCEJE");
634 hTriggerClass->GetXaxis()->SetBinLabel(16,"kEMCEGA");
635 hTriggerClass->GetXaxis()->SetBinLabel(17,"kCentral");
636 hTriggerClass->GetXaxis()->SetBinLabel(18,"kSemiCentral");
637 hTriggerClass->GetXaxis()->SetBinLabel(19,"kDG5");
638 hTriggerClass->GetXaxis()->SetBinLabel(20,"kZED");
639 hTriggerClass->GetXaxis()->SetBinLabel(21,"kSPI7/kSPI");
640 hTriggerClass->GetXaxis()->SetBinLabel(22,"kINT8");
641 hTriggerClass->GetXaxis()->SetBinLabel(23,"kMuonSingleLowPt8");
642 hTriggerClass->GetXaxis()->SetBinLabel(24,"kMuonSingleHighPt8");
643 hTriggerClass->GetXaxis()->SetBinLabel(25,"kMuonLikeLowPt8");
644 hTriggerClass->GetXaxis()->SetBinLabel(26,"kMuonUnlikeLowPt8");
645 hTriggerClass->GetXaxis()->SetBinLabel(27,"kMuonUnlikeLowPt0");
646 hTriggerClass->GetXaxis()->SetBinLabel(28,"kUserDefined");
647 hTriggerClass->GetXaxis()->SetBinLabel(29,"kTRD");
648 hTriggerClass->GetXaxis()->SetBinLabel(30,"kFastOnly");
649 hTriggerClass->GetXaxis()->SetBinLabel(31,"kAnyINT");
650 hTriggerClass->GetXaxis()->SetBinLabel(32,"kAny");
651 hTriggerClass->GetXaxis()->SetBinLabel(33,"V0AND");
652 hTriggerClass->GetXaxis()->SetBinLabel(34,"NOT kFastOnly");
653 hTriggerClass->GetXaxis()->SetBinLabel(35,"failed Physics Selection");
654 fHistograms->Add(hTriggerClass);
657 hTriggerClassSelected= new TH1F(Form("OfflineTriggerSelected %s",GetCutNumber().Data()),"OfflineTriggerSelected",34,-0.5,33.5);
658 hTriggerClassSelected->GetXaxis()->SetBinLabel( 1,"kMB");
659 hTriggerClassSelected->GetXaxis()->SetBinLabel( 2,"kINT7");
660 hTriggerClassSelected->GetXaxis()->SetBinLabel( 3,"kMUON");
661 hTriggerClassSelected->GetXaxis()->SetBinLabel( 4,"kHighMult");
662 hTriggerClassSelected->GetXaxis()->SetBinLabel( 5,"kKEMC1");
663 hTriggerClassSelected->GetXaxis()->SetBinLabel( 6,"kCINT5");
664 hTriggerClassSelected->GetXaxis()->SetBinLabel( 7,"kCMUS5/kMUSPB");
665 hTriggerClassSelected->GetXaxis()->SetBinLabel( 8,"kMUSH7/kMUSHPB");
666 hTriggerClassSelected->GetXaxis()->SetBinLabel( 9,"kMUL7/kMuonLikePB");
667 hTriggerClassSelected->GetXaxis()->SetBinLabel(10,"kMUU7/kMuonUnlikePB");
668 hTriggerClassSelected->GetXaxis()->SetBinLabel(11,"kEMC7/kEMC8");
669 hTriggerClassSelected->GetXaxis()->SetBinLabel(12,"kMUS7");
670 hTriggerClassSelected->GetXaxis()->SetBinLabel(13,"kPHI1");
671 hTriggerClassSelected->GetXaxis()->SetBinLabel(14,"kPHI7/kPHI8/kPHOSPb");
672 hTriggerClassSelected->GetXaxis()->SetBinLabel(15,"kEMCEJE");
673 hTriggerClassSelected->GetXaxis()->SetBinLabel(16,"kEMCEGA");
674 hTriggerClassSelected->GetXaxis()->SetBinLabel(17,"kCentral");
675 hTriggerClassSelected->GetXaxis()->SetBinLabel(18,"kSemiCentral");
676 hTriggerClassSelected->GetXaxis()->SetBinLabel(19,"kDG5");
677 hTriggerClassSelected->GetXaxis()->SetBinLabel(20,"kZED");
678 hTriggerClassSelected->GetXaxis()->SetBinLabel(21,"kSPI7/kSPI");
679 hTriggerClassSelected->GetXaxis()->SetBinLabel(22,"kINT8");
680 hTriggerClassSelected->GetXaxis()->SetBinLabel(23,"kMuonSingleLowPt8");
681 hTriggerClassSelected->GetXaxis()->SetBinLabel(24,"kMuonSingleHighPt8");
682 hTriggerClassSelected->GetXaxis()->SetBinLabel(25,"kMuonLikeLowPt8");
683 hTriggerClassSelected->GetXaxis()->SetBinLabel(26,"kMuonUnlikeLowPt8");
684 hTriggerClassSelected->GetXaxis()->SetBinLabel(27,"kMuonUnlikeLowPt0");
685 hTriggerClassSelected->GetXaxis()->SetBinLabel(28,"kUserDefined");
686 hTriggerClassSelected->GetXaxis()->SetBinLabel(29,"kTRD");
687 hTriggerClassSelected->GetXaxis()->SetBinLabel(30,"kFastOnly");
688 hTriggerClassSelected->GetXaxis()->SetBinLabel(31,"kAnyINT");
689 hTriggerClassSelected->GetXaxis()->SetBinLabel(32,"kAny");
690 hTriggerClassSelected->GetXaxis()->SetBinLabel(33,"V0AND");
691 hTriggerClassSelected->GetXaxis()->SetBinLabel(34,"NOT kFastOnly");
692 fHistograms->Add(hTriggerClassSelected);
694 TH1::AddDirectory(kTRUE);
697 //________________________________________________________________________
698 Bool_t AliConversionCuts::InitPIDResponse(){
699 // Set Pointer to AliPIDResponse
701 AliAnalysisManager *man=AliAnalysisManager::GetAnalysisManager();
703 AliInputEventHandler* inputHandler = (AliInputEventHandler*) (man->GetInputEventHandler());
704 fPIDResponse = (AliPIDResponse*)inputHandler->GetPIDResponse();
705 if(fPIDResponse)return kTRUE;
712 ///________________________________________________________________________
713 Bool_t AliConversionCuts::EventIsSelected(AliVEvent *fInputEvent, AliVEvent *fMCEvent){
714 // Process Event Selection
717 if(hV0EventCuts)hV0EventCuts->Fill(cutindex);
720 // Check for MC event
721 if(fMCEvent && fInputEvent->IsA()==AliESDEvent::Class()){
722 // Check if MC event is correctly loaded
723 AliMCEventHandler* mcHandler = dynamic_cast<AliMCEventHandler*> (AliAnalysisManager::GetAnalysisManager()->GetMCtruthEventHandler());
728 if (!mcHandler->InitOk() ){
732 if (!mcHandler->TreeK() ){
736 if (!mcHandler->TreeTR() ) {
743 // cout << "before event trigger" << endl;
744 if(!IsTriggerSelected(fInputEvent)){
745 if(hV0EventCuts)hV0EventCuts->Fill(cutindex);
751 if(fInputEvent->IsA()==AliESDEvent::Class()){
752 AliTriggerAnalysis fTriggerAnalysis;// = new AliTriggerAnalysis;
753 fHasV0AND = fTriggerAnalysis.IsOfflineTriggerFired((AliESDEvent*)fInputEvent, AliTriggerAnalysis::kV0AND);
754 if(fHasV0AND&&hTriggerClass)hTriggerClass->Fill(32);
756 // cout << "event number " << ((AliESDEvent*)fInputEvent)->GetEventNumberInFile() << " entered"<< endl;
759 // Number of Contributors Cut
760 if(GetNumberOfContributorsVtx(fInputEvent)<=0) {
761 if(hV0EventCuts)hV0EventCuts->Fill(cutindex);
767 // Z Vertex Position Cut
768 if(!VertexZCut(fInputEvent)){
769 if(hV0EventCuts)hV0EventCuts->Fill(cutindex);
778 if(fInputEvent->IsPileupFromSPD(3,0.8,3.,2.,5.)){
779 if(hV0EventCuts)hV0EventCuts->Fill(cutindex);
786 // Centrality Selection
787 if(!IsCentralitySelected(fInputEvent,fMCEvent)){
788 if(hV0EventCuts)hV0EventCuts->Fill(cutindex);
794 // Fill Event Histograms
795 if(hV0EventCuts)hV0EventCuts->Fill(cutindex);
796 if(hVertexZ)hVertexZ->Fill(fInputEvent->GetPrimaryVertex()->GetZ());
797 if(hCentrality)hCentrality->Fill(GetCentrality(fInputEvent));
798 if(hCentralityVsNumberOfPrimaryTracks)
799 hCentralityVsNumberOfPrimaryTracks->Fill(GetCentrality(fInputEvent),
800 ((AliV0ReaderV1*)AliAnalysisManager::GetAnalysisManager()
801 ->GetTask("V0ReaderV1"))->GetNumberOfPrimaryTracks());
806 ///________________________________________________________________________
807 Bool_t AliConversionCuts::PhotonIsSelectedMC(TParticle *particle,AliStack *fMCStack,Bool_t checkForConvertedGamma){
808 // MonteCarlo Photon Selection
810 if(!fMCStack)return kFALSE;
812 if (particle->GetPdgCode() == 22){
815 if( particle->Eta() > (fEtaCut + fEtaShift) || particle->Eta() < (-fEtaCut + fEtaShift) )
818 if( particle->Eta() < (fEtaCutMin + fEtaShift) && particle->Eta() > (-fEtaCutMin + fEtaShift) )
822 if(particle->GetMother(0) >-1 && fMCStack->Particle(particle->GetMother(0))->GetPdgCode() == 22){
823 return kFALSE; // no photon as mothers!
826 if(particle->GetMother(0) >= fMCStack->GetNprimary()){
827 return kFALSE; // the gamma has a mother, and it is not a primary particle
830 if(!checkForConvertedGamma) return kTRUE; // return in case of accepted gamma
832 // looking for conversion gammas (electron + positron from pairbuilding (= 5) )
833 TParticle* ePos = NULL;
834 TParticle* eNeg = NULL;
836 if(particle->GetNDaughters() >= 2){
837 for(Int_t daughterIndex=particle->GetFirstDaughter();daughterIndex<=particle->GetLastDaughter();daughterIndex++){
838 TParticle *tmpDaughter = fMCStack->Particle(daughterIndex);
839 if(tmpDaughter->GetUniqueID() == 5){
840 if(tmpDaughter->GetPdgCode() == 11){
842 } else if(tmpDaughter->GetPdgCode() == -11){
849 if(ePos == NULL || eNeg == NULL){ // means we do not have two daughters from pair production
853 if(ePos->Pt()<fSinglePtCut || eNeg->Pt()<fSinglePtCut){
854 return kFALSE; // no reconstruction below the Pt cut
857 if( ePos->Eta() > (fEtaCut + fEtaShift) || ePos->Eta() < (-fEtaCut + fEtaShift) ||
858 eNeg->Eta() > (fEtaCut + fEtaShift) || eNeg->Eta() < (-fEtaCut + fEtaShift) )
861 if(fEtaCutMin > -0.1){
862 if( (ePos->Eta() < (fEtaCutMin + fEtaShift) && ePos->Eta() > (-fEtaCutMin + fEtaShift)) ||
863 (eNeg->Eta() < (fEtaCutMin + fEtaShift) && eNeg->Eta() > (-fEtaCutMin + fEtaShift)) )
868 return kFALSE; // cuts on distance from collision point
871 if(abs(ePos->Vz()) > fMaxZ){
872 return kFALSE; // outside material
874 if(abs(eNeg->Vz()) > fMaxZ){
875 return kFALSE; // outside material
878 if( ePos->R() <= ((abs(ePos->Vz()) * fLineCutZRSlope) - fLineCutZValue)){
879 return kFALSE; // line cut to exclude regions where we do not reconstruct
880 } else if ( fEtaCutMin != -0.1 && ePos->R() >= ((abs(ePos->Vz()) * fLineCutZRSlopeMin) - fLineCutZValueMin)){
884 if( eNeg->R() <= ((abs(eNeg->Vz()) * fLineCutZRSlope) - fLineCutZValue)){
885 return kFALSE; // line cut to exclude regions where we do not reconstruct
886 } else if ( fEtaCutMin != -0.1 && eNeg->R() >= ((abs(eNeg->Vz()) * fLineCutZRSlopeMin) - fLineCutZValueMin)){
891 //if(AcceptanceCut(particle,ePos,eNeg))return kTRUE;
895 ///________________________________________________________________________
896 Bool_t AliConversionCuts::PhotonIsSelectedAODMC(AliAODMCParticle *particle,TClonesArray *aodmcArray,Bool_t checkForConvertedGamma){
897 // MonteCarlo Photon Selection
899 if(!aodmcArray)return kFALSE;
901 if (particle->GetPdgCode() == 22){
902 if( particle->Eta() > (fEtaCut + fEtaShift) || particle->Eta() < (-fEtaCut + fEtaShift) )
905 if( particle->Eta() < (fEtaCutMin + fEtaShift) && particle->Eta() > (-fEtaCutMin + fEtaShift) )
909 if(particle->GetMother() > -1){
910 if((static_cast<AliAODMCParticle*>(aodmcArray->At(particle->GetMother())))->GetPdgCode() == 22){
911 return kFALSE; // no photon as mothers!
913 if(!(static_cast<AliAODMCParticle*>(aodmcArray->At(particle->GetMother()))->IsPrimary())){
914 return kFALSE; // the gamma has a mother, and it is not a primary particle
918 if(!checkForConvertedGamma) return kTRUE; // return in case of accepted gamma
920 // looking for conversion gammas (electron + positron from pairbuilding (= 5) )
921 AliAODMCParticle* ePos = NULL;
922 AliAODMCParticle* eNeg = NULL;
924 if(particle->GetNDaughters() >= 2){
925 for(Int_t daughterIndex=particle->GetDaughter(0);daughterIndex<=particle->GetDaughter(1);daughterIndex++){
926 AliAODMCParticle *tmpDaughter = static_cast<AliAODMCParticle*>(aodmcArray->At(daughterIndex));
927 if(!tmpDaughter) continue;
928 if(((tmpDaughter->GetMCProcessCode())) == 5){ // STILL A BUG IN ALIROOT >>8 HAS TPO BE REMOVED AFTER FIX
929 if(tmpDaughter->GetPdgCode() == 11){
931 } else if(tmpDaughter->GetPdgCode() == -11){
938 if(ePos == NULL || eNeg == NULL){ // means we do not have two daughters from pair production
942 if(ePos->Pt()<fSinglePtCut || eNeg->Pt()<fSinglePtCut){
943 return kFALSE; // no reconstruction below the Pt cut
946 if( ePos->Eta() > (fEtaCut + fEtaShift) || ePos->Eta() < (-fEtaCut + fEtaShift) ||
947 eNeg->Eta() > (fEtaCut + fEtaShift) || eNeg->Eta() < (-fEtaCut + fEtaShift) )
950 if(fEtaCutMin > -0.1){
951 if( (ePos->Eta() < (fEtaCutMin + fEtaShift) && ePos->Eta() > (-fEtaCutMin + fEtaShift)) ||
952 (eNeg->Eta() < (fEtaCutMin + fEtaShift) && eNeg->Eta() > (-fEtaCutMin + fEtaShift)) )
956 Double_t rPos = sqrt( (ePos->Xv()*ePos->Xv()) + (ePos->Yv()*ePos->Yv()) );
957 Double_t rNeg = sqrt( (eNeg->Xv()*eNeg->Xv()) + (eNeg->Yv()*eNeg->Yv()) );
960 return kFALSE; // cuts on distance from collision point
962 if(abs(ePos->Zv()) > fMaxZ){
963 return kFALSE; // outside material
965 if(abs(eNeg->Zv()) > fMaxZ){
966 return kFALSE; // outside material
969 if( rPos <= ((abs(ePos->Zv()) * fLineCutZRSlope) - fLineCutZValue)){
970 return kFALSE; // line cut to exclude regions where we do not reconstruct
971 } else if ( fEtaCutMin != -0.1 && rPos >= ((abs(ePos->Zv()) * fLineCutZRSlopeMin) - fLineCutZValueMin)){
975 if( rNeg <= ((abs(eNeg->Zv()) * fLineCutZRSlope) - fLineCutZValue)){
976 return kFALSE; // line cut to exclude regions where we do not reconstruct
977 } else if ( fEtaCutMin != -0.1 && rNeg >= ((abs(eNeg->Zv()) * fLineCutZRSlopeMin) - fLineCutZValueMin)){
982 //if(AcceptanceCut(particle,ePos,eNeg))return kTRUE;
986 ///________________________________________________________________________
987 Bool_t AliConversionCuts::PhotonCuts(AliConversionPhotonBase *photon,AliVEvent *event)
988 { // Specific Photon Cuts
991 if(hPhotonCuts)hPhotonCuts->Fill(cutIndex);
994 // Fill Histos before Cuts
995 if(hInvMassbefore)hInvMassbefore->Fill(photon->GetMass());
997 if(hArmenterosbefore)hArmenterosbefore->Fill(photon->GetArmenterosAlpha(),photon->GetArmenterosQt());
999 // Gamma selection based on QT from Armenteros
1000 if(fDoQtGammaSelection == kTRUE){
1001 if(!ArmenterosQtCut(photon)){
1002 if(hPhotonCuts)hPhotonCuts->Fill(cutIndex); //1
1009 if(photon->GetChi2perNDF() > fChi2CutConversion || photon->GetChi2perNDF() <=0){
1011 if(hPhotonCuts)hPhotonCuts->Fill(cutIndex); //2
1017 // Reconstruction Acceptance Cuts
1018 if(!AcceptanceCuts(photon)){
1019 if(hPhotonCuts)hPhotonCuts->Fill(cutIndex); //3
1025 if(fDoPhotonAsymmetryCut == kTRUE){
1026 if(!AsymmetryCut(photon,event)){
1027 if(hPhotonCuts)hPhotonCuts->Fill(cutIndex); //4
1032 //Check the pid probability
1034 if(!PIDProbabilityCut(photon, event)) {
1035 if(hPhotonCuts)hPhotonCuts->Fill(cutIndex); //5
1040 if(!CorrectedTPCClusterCut(photon, event)) {
1041 if(hPhotonCuts)hPhotonCuts->Fill(cutIndex); //6
1045 Double_t magField = event->GetMagneticField();
1046 if( magField < 0.0 ){
1051 AliVTrack * electronCandidate = GetTrack(event,photon->GetTrackLabelNegative() );
1052 AliVTrack * positronCandidate = GetTrack(event,photon->GetTrackLabelPositive() );
1053 Double_t deltaPhi = magField * TVector2::Phi_mpi_pi( electronCandidate->Phi()-positronCandidate->Phi());
1056 if(!PsiPairCut(photon,deltaPhi)) {
1057 if(hPhotonCuts)hPhotonCuts->Fill(cutIndex); //7
1062 if(!CosinePAngleCut(photon, event)) {
1063 if(hPhotonCuts)hPhotonCuts->Fill(cutIndex); //8
1067 AliAODConversionPhoton* photonAOD = dynamic_cast<AliAODConversionPhoton*>(photon);
1069 photonAOD->CalculateDistanceOfClossetApproachToPrimVtx(event->GetPrimaryVertex());
1072 if(photonAOD->GetDCArToPrimVtx() > fDCARPrimVtxCut) { //DCA R cut of photon to primary vertex
1073 if(hPhotonCuts)hPhotonCuts->Fill(cutIndex); //9
1078 if(abs(photonAOD->GetDCAzToPrimVtx()) > fDCAZPrimVtxCut) { //DCA Z cut of photon to primary vertex
1079 if(hPhotonCuts)hPhotonCuts->Fill(cutIndex); //10
1087 if(hPhotonCuts)hPhotonCuts->Fill(cutIndex); //11
1089 // Histos after Cuts
1090 if(hInvMassafter)hInvMassafter->Fill(photon->GetMass());
1091 if(hArmenterosafter)hArmenterosafter->Fill(photon->GetArmenterosAlpha(),photon->GetArmenterosQt());
1092 if(hPsiPairDeltaPhiafter)hPsiPairDeltaPhiafter->Fill(deltaPhi,photon->GetPsiPair());
1097 ///________________________________________________________________________
1098 Bool_t AliConversionCuts::CorrectedTPCClusterCut(AliConversionPhotonBase *photon, AliVEvent * event)
1099 { //Cut on corrected TPC Cluster Info
1101 AliVTrack * negTrack = GetTrack(event, photon->GetTrackLabelNegative());
1102 AliVTrack * posTrack = GetTrack(event, photon->GetTrackLabelPositive());
1104 if(!negTrack||!posTrack)return kFALSE;
1106 Double_t negclsToF=0;
1108 if (!fUseCorrectedTPCClsInfo ){
1109 if(negTrack->GetTPCNclsF()!=0){
1110 negclsToF = (Double_t)negTrack->GetNcls(1)/(Double_t)negTrack->GetTPCNclsF();}// Ncluster/Nfindablecluster
1113 negclsToF = negTrack->GetTPCClusterInfo(2,0,GetFirstTPCRow(photon->GetConversionRadius()));
1116 Double_t posclsToF = 0.;
1117 if (!fUseCorrectedTPCClsInfo ){
1118 if(posTrack->GetTPCNclsF()!=0){
1119 posclsToF = (Double_t)posTrack->GetNcls(1)/(Double_t)posTrack->GetTPCNclsF();
1122 posclsToF = posTrack->GetTPCClusterInfo(2,0,GetFirstTPCRow(photon->GetConversionRadius()));
1125 if( negclsToF < fMinClsTPCToF || posclsToF < fMinClsTPCToF ){
1132 ///________________________________________________________________________
1133 Bool_t AliConversionCuts::PhotonIsSelected(AliConversionPhotonBase *photon, AliVEvent * event)
1135 //Selection of Reconstructed Photons
1137 FillPhotonCutIndex(kPhotonIn);
1139 if(event->IsA()==AliESDEvent::Class()) {
1140 if(!SelectV0Finder( ( ((AliESDEvent*)event)->GetV0(photon->GetV0Index()))->GetOnFlyStatus() ) ){
1141 FillPhotonCutIndex(kOnFly);
1145 // else if(event->IsA()==AliAODEvent::Class()) {
1146 // if(!SelectV0Finder( ( ((AliAODEvent*)event)->GetV0(photon->GetV0Index())) ) ){
1147 // FillPhotonCutIndex(kOnFly);
1153 AliVTrack * negTrack = GetTrack(event, photon->GetTrackLabelNegative());
1154 AliVTrack * posTrack = GetTrack(event, photon->GetTrackLabelPositive());
1156 if(!negTrack || !posTrack) {
1157 FillPhotonCutIndex(kNoTracks);
1160 photon->DeterminePhotonQuality(negTrack,posTrack);
1162 if(!TracksAreSelected(negTrack, posTrack)){
1163 FillPhotonCutIndex(kTrackCuts);
1168 if(!dEdxCuts(negTrack) || !dEdxCuts(posTrack)) {
1169 FillPhotonCutIndex(kdEdxCuts);
1174 if(!PhotonCuts(photon,event)){
1175 FillPhotonCutIndex(kPhotonCuts);
1179 // Photon passed cuts
1180 FillPhotonCutIndex(kPhotonOut);
1184 ///________________________________________________________________________
1185 Bool_t AliConversionCuts::ArmenterosQtCut(AliConversionPhotonBase *photon)
1186 { // Armenteros Qt Cut
1188 if(fDoHighPtQtGammaSelection){
1189 if(photon->GetPhotonPt() < fPtBorderForQt){
1190 if(photon->GetArmenterosQt()>fQtMax){
1194 if(photon->GetArmenterosQt()>fHighPtQtMax){
1200 if(photon->GetArmenterosQt()>fQtMax){
1208 ///________________________________________________________________________
1209 Bool_t AliConversionCuts::AcceptanceCuts(AliConversionPhotonBase *photon) {
1210 // Exclude certain areas for photon reconstruction
1213 if(hAcceptanceCuts)hAcceptanceCuts->Fill(cutIndex);
1216 if(photon->GetConversionRadius()>fMaxR){ // cuts on distance from collision point
1217 if(hAcceptanceCuts)hAcceptanceCuts->Fill(cutIndex);
1222 if(photon->GetConversionRadius()<fMinR){ // cuts on distance from collision point
1223 if(hAcceptanceCuts)hAcceptanceCuts->Fill(cutIndex);
1228 if(photon->GetConversionRadius() <= ((abs(photon->GetConversionZ())*fLineCutZRSlope)-fLineCutZValue)){
1229 if(hAcceptanceCuts)hAcceptanceCuts->Fill(cutIndex);
1232 else if (fUseEtaMinCut && photon->GetConversionRadius() >= ((abs(photon->GetConversionZ())*fLineCutZRSlopeMin)-fLineCutZValueMin )){
1233 if(hAcceptanceCuts)hAcceptanceCuts->Fill(cutIndex);
1238 if(abs(photon->GetConversionZ()) > fMaxZ ){ // cuts out regions where we do not reconstruct
1239 if(hAcceptanceCuts)hAcceptanceCuts->Fill(cutIndex);
1245 if( photon->GetPhotonEta() > (fEtaCut + fEtaShift) || photon->GetPhotonEta() < (-fEtaCut + fEtaShift) ){
1246 if(hAcceptanceCuts)hAcceptanceCuts->Fill(cutIndex);
1249 if(fEtaCutMin>-0.1){
1250 if( photon->GetPhotonEta() < (fEtaCutMin + fEtaShift) && photon->GetPhotonEta() > (-fEtaCutMin + fEtaShift) ){
1251 if(hAcceptanceCuts)hAcceptanceCuts->Fill(cutIndex);
1257 if(photon->GetPhotonPt()<fPtCut){
1258 if(hAcceptanceCuts)hAcceptanceCuts->Fill(cutIndex);
1263 if(hAcceptanceCuts)hAcceptanceCuts->Fill(cutIndex);
1269 ///________________________________________________________________________
1270 Bool_t AliConversionCuts::SpecificTrackCuts(AliAODTrack * negTrack, AliAODTrack * posTrack,Int_t &cutIndex) {
1271 // Track Cuts which require AOD/ESD specific implementation
1273 if( !negTrack->IsOn(AliESDtrack::kTPCrefit) || !posTrack->IsOn(AliESDtrack::kTPCrefit) ) {
1274 if(hTrackCuts)hTrackCuts->Fill(cutIndex);
1279 AliAODVertex * NegVtxType=negTrack->GetProdVertex();
1280 AliAODVertex * PosVtxType=posTrack->GetProdVertex();
1281 if( (NegVtxType->GetType())==AliAODVertex::kKink || (PosVtxType->GetType())==AliAODVertex::kKink) {
1282 if(hTrackCuts)hTrackCuts->Fill(cutIndex);
1290 ///________________________________________________________________________
1291 Bool_t AliConversionCuts::SpecificTrackCuts(AliESDtrack * negTrack, AliESDtrack * posTrack,Int_t &cutIndex) {
1292 // Track Cuts which require AOD/ESD specific implementation
1294 if( !negTrack->IsOn(AliESDtrack::kTPCrefit) || !posTrack->IsOn(AliESDtrack::kTPCrefit) ) {
1295 if(hTrackCuts)hTrackCuts->Fill(cutIndex);
1300 if(negTrack->GetKinkIndex(0) > 0 || posTrack->GetKinkIndex(0) > 0 ) {
1301 if(hTrackCuts)hTrackCuts->Fill(cutIndex);
1309 ///________________________________________________________________________
1310 Bool_t AliConversionCuts::TracksAreSelected(AliVTrack * negTrack, AliVTrack * posTrack) {
1311 // Track Selection for Photon Reconstruction
1314 if(hTrackCuts)hTrackCuts->Fill(cutIndex);
1318 if(negTrack->Charge() == posTrack->Charge()) {
1319 if(hTrackCuts)hTrackCuts->Fill(cutIndex);
1324 // Number of TPC Clusters
1327 if( negTrack->GetNcls(1) < fMinClsTPC || posTrack->GetNcls(1) < fMinClsTPC ) {
1328 if(hTrackCuts)hTrackCuts->Fill(cutIndex);
1334 if( posTrack->Eta() > (fEtaCut + fEtaShift) || posTrack->Eta() < (-fEtaCut + fEtaShift) ||
1335 negTrack->Eta() > (fEtaCut + fEtaShift) || negTrack->Eta() < (-fEtaCut + fEtaShift) ){
1336 if(hTrackCuts)hTrackCuts->Fill(cutIndex);
1339 if(fEtaCutMin>-0.1){
1340 if( (posTrack->Eta() < (fEtaCutMin + fEtaShift) && posTrack->Eta() > (-fEtaCutMin + fEtaShift)) ||
1341 (negTrack->Eta() < (fEtaCutMin + fEtaShift) && negTrack->Eta() > (-fEtaCutMin + fEtaShift)) ){
1342 if(hTrackCuts)hTrackCuts->Fill(cutIndex);
1349 if( negTrack->Pt()< fSinglePtCut || posTrack->Pt()< fSinglePtCut){
1350 if(hTrackCuts)hTrackCuts->Fill(cutIndex);
1355 // AOD ESD specific cuts
1356 Bool_t passCuts = kTRUE;
1358 if(negTrack->IsA()==AliAODTrack::Class()) {
1359 passCuts = passCuts * SpecificTrackCuts(static_cast<AliAODTrack*>(negTrack), static_cast<AliAODTrack*>(posTrack),cutIndex);
1361 passCuts = passCuts * SpecificTrackCuts(static_cast<AliESDtrack*>(negTrack), static_cast<AliESDtrack*>(posTrack),cutIndex);
1365 if(hTrackCuts)hTrackCuts->Fill(cutIndex);
1370 if(hTrackCuts)hTrackCuts->Fill(cutIndex);
1376 ///________________________________________________________________________
1377 Bool_t AliConversionCuts::dEdxCuts(AliVTrack *fCurrentTrack){
1378 // Electron Identification Cuts for Photon reconstruction
1380 if(!fPIDResponse){InitPIDResponse();}// Try to reinitialize PID Response
1381 if(!fPIDResponse){AliError("No PID Response"); return kTRUE;}// if still missing fatal error
1384 if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);
1385 if(hTPCdEdxSigbefore)hTPCdEdxSigbefore->Fill(fCurrentTrack->P(),fPIDResponse->NumberOfSigmasTPC(fCurrentTrack, AliPID::kElectron));
1386 if(hTPCdEdxbefore)hTPCdEdxbefore->Fill(fCurrentTrack->P(),fCurrentTrack->GetTPCsignal());
1390 if(fDodEdxSigmaCut == kTRUE){
1391 // TPC Electron Line
1392 if( fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kElectron)<fPIDnSigmaBelowElectronLine ||
1393 fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kElectron)>fPIDnSigmaAboveElectronLine){
1395 if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);
1401 if( fCurrentTrack->P()>fPIDMinPnSigmaAbovePionLine && fCurrentTrack->P()<fPIDMaxPnSigmaAbovePionLine ){
1402 if(fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kElectron)>fPIDnSigmaBelowElectronLine &&
1403 fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kElectron)<fPIDnSigmaAboveElectronLine&&
1404 fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kPion)<fPIDnSigmaAbovePionLine){
1406 if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);
1413 if( fCurrentTrack->P()>fPIDMaxPnSigmaAbovePionLine ){
1414 if(fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kElectron)>fPIDnSigmaBelowElectronLine &&
1415 fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kElectron)<fPIDnSigmaAboveElectronLine &&
1416 fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kPion)<fPIDnSigmaAbovePionLineHighPt){
1418 if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);
1426 if(fDoKaonRejectionLowP == kTRUE){
1427 if(fCurrentTrack->P()<fPIDMinPKaonRejectionLowP ){
1428 if( abs(fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kKaon))<fPIDnSigmaAtLowPAroundKaonLine){
1430 if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);
1437 if(fDoProtonRejectionLowP == kTRUE){
1438 if( fCurrentTrack->P()<fPIDMinPProtonRejectionLowP ){
1439 if( abs(fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kProton))<fPIDnSigmaAtLowPAroundProtonLine){
1441 if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);
1448 if(fDoPionRejectionLowP == kTRUE){
1449 if( fCurrentTrack->P()<fPIDMinPPionRejectionLowP ){
1450 if( abs(fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kPion))<fPIDnSigmaAtLowPAroundPionLine){
1452 if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);
1460 // cout<<"Start"<<endl;
1461 // AliPIDResponse::EDetPidStatus status=fPIDResponse->CheckPIDStatus(AliPIDResponse::kTOF,fCurrentTrack);
1463 // if( ( (status & AliVTrack::kTOFout) == AliVTrack::kTOFout ) && ( (status & AliVTrack::kTIME) == AliVTrack::kTIME ))
1464 // {cout<<"TOF DA"<<endl;}
1465 // if(status == AliPIDResponse::kDetPidOk){
1466 // Float_t probMis = fPIDResponse->GetTOFMismatchProbability(fCurrentTrack);
1467 // cout<<"--> "<<probMis<<endl;
1468 // if(probMis > 0.01){
1473 if((fCurrentTrack->GetStatus() & AliESDtrack::kTOFpid) && !(fCurrentTrack->GetStatus() & AliESDtrack::kTOFmismatch)){
1475 Double_t t0 = fPIDResponse->GetTOFResponse().GetStartTime(fCurrentTrack->P());
1477 fCurrentTrack->GetIntegratedTimes(times);
1478 Double_t TOFsignal = fCurrentTrack->GetTOFsignal();
1479 Double_t dT = TOFsignal - t0 - times[0];
1480 hTOFbefore->Fill(fCurrentTrack->P(),dT);
1482 if(hTOFSigbefore) hTOFSigbefore->Fill(fCurrentTrack->P(),fPIDResponse->NumberOfSigmasTOF(fCurrentTrack, AliPID::kElectron));
1484 if(fPIDResponse->NumberOfSigmasTOF(fCurrentTrack, AliPID::kElectron)>fTofPIDnSigmaAboveElectronLine ||
1485 fPIDResponse->NumberOfSigmasTOF(fCurrentTrack, AliPID::kElectron)<fTofPIDnSigmaBelowElectronLine ){
1486 if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);
1490 if(hTOFSigafter)hTOFSigafter->Fill(fCurrentTrack->P(),fPIDResponse->NumberOfSigmasTOF(fCurrentTrack, AliPID::kElectron));
1496 if(!fPIDResponse->IdentifiedAsElectronTRD(fCurrentTrack,fPIDTRDEfficiency)){
1497 if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);
1503 if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);
1504 if(hTPCdEdxSigafter)hTPCdEdxSigafter->Fill(fCurrentTrack->P(),fPIDResponse->NumberOfSigmasTPC(fCurrentTrack, AliPID::kElectron));
1505 if(hTPCdEdxafter)hTPCdEdxafter->Fill(fCurrentTrack->P(),fCurrentTrack->GetTPCsignal());
1510 ///________________________________________________________________________
1511 Bool_t AliConversionCuts::AsymmetryCut(AliConversionPhotonBase * photon,AliVEvent *event) {
1512 // Cut on Energy Assymetry
1514 for(Int_t ii=0;ii<2;ii++){
1516 AliVTrack *track=GetTrack(event,photon->GetTrackLabel(ii));
1518 if( track->P() > fMinPPhotonAsymmetryCut ){
1519 Double_t trackNegAsy=0;
1520 if (photon->GetPhotonP()!=0.){
1521 trackNegAsy= track->P()/photon->GetPhotonP();
1524 if( trackNegAsy<fMinPhotonAsymmetry ||trackNegAsy>(1.- fMinPhotonAsymmetry)){
1533 ///________________________________________________________________________
1534 AliVTrack *AliConversionCuts::GetTrack(AliVEvent * event, Int_t label){
1535 //Returns pointer to the track with given ESD label
1536 //(Important for AOD implementation, since Track array in AOD data is different
1537 //from ESD array, but ESD tracklabels are stored in AOD Tracks)
1539 AliESDEvent * esdEvent = dynamic_cast<AliESDEvent*>(event);
1541 if(label > event->GetNumberOfTracks() ) return NULL;
1542 AliESDtrack * track = esdEvent->GetTrack(label);
1546 AliVTrack * track = 0x0;
1547 if(((AliV0ReaderV1*)AliAnalysisManager::GetAnalysisManager()->GetTask("V0ReaderV1"))->AreAODsRelabeled()){
1548 track = dynamic_cast<AliVTrack*>(event->GetTrack(label));
1552 for(Int_t ii=0; ii<event->GetNumberOfTracks(); ii++) {
1553 track = dynamic_cast<AliVTrack*>(event->GetTrack(ii));
1555 if(track->GetID() == label) {
1562 //AliDebug(5,(Form("track not found %d %d",label,event->GetNumberOfTracks()));
1566 ///________________________________________________________________________
1567 AliESDtrack *AliConversionCuts::GetESDTrack(AliESDEvent * event, Int_t label){
1568 //Returns pointer to the track with given ESD label
1569 //(Important for AOD implementation, since Track array in AOD data is different
1570 //from ESD array, but ESD tracklabels are stored in AOD Tracks)
1573 if(label > event->GetNumberOfTracks() ) return NULL;
1574 AliESDtrack * track = event->GetTrack(label);
1577 //AliDebug(5,(Form("track not found %d %d",label,event->GetNumberOfTracks()));
1583 ///________________________________________________________________________
1584 Bool_t AliConversionCuts::PIDProbabilityCut(AliConversionPhotonBase *photon, AliVEvent * event){
1585 // Cut on Electron Probability for Photon Reconstruction
1587 AliESDEvent * esdEvent = dynamic_cast<AliESDEvent*>(event);
1591 Bool_t iResult=kFALSE;
1593 Double_t *posProbArray = new Double_t[AliPID::kSPECIES];
1594 Double_t *negProbArray = new Double_t[AliPID::kSPECIES];
1596 AliESDtrack* negTrack = esdEvent->GetTrack(photon->GetTrackLabelNegative());
1597 AliESDtrack* posTrack = esdEvent->GetTrack(photon->GetTrackLabelPositive());
1599 if(negProbArray && posProbArray){
1601 negTrack->GetTPCpid(negProbArray);
1602 posTrack->GetTPCpid(posProbArray);
1604 if(negProbArray[AliPID::kElectron]>=fPIDProbabilityCutNegativeParticle && posProbArray[AliPID::kElectron]>=fPIDProbabilityCutPositiveParticle){
1609 delete [] posProbArray;
1610 delete [] negProbArray;
1614 ///Not possible for AODs
1624 ///________________________________________________________________________
1625 Bool_t AliConversionCuts::AcceptanceCut(TParticle *particle, TParticle * ePos,TParticle* eNeg){
1626 // MC Acceptance Cuts
1627 //(Certain areas were excluded for photon reconstruction)
1629 if(particle->R()>fMaxR){
1632 if(ePos->R()>fMaxR){
1636 if(ePos->R()<fMinR){
1640 if( ePos->R() <= ((abs(ePos->Vz())*fLineCutZRSlope)-fLineCutZValue)){
1643 else if (fUseEtaMinCut && ePos->R() >= ((abs(ePos->Vz())*fLineCutZRSlopeMin)-fLineCutZValueMin )){
1647 if(abs(eNeg->Vz()) > fMaxZ ){ // cuts out regions where we do not reconstruct
1651 if(eNeg->Vz()!=ePos->Vz()||eNeg->R()!=ePos->R()){
1655 if(abs(ePos->Vz()) > fMaxZ ){ // cuts out regions where we do not reconstruct
1660 if( particle->Eta() > (fEtaCut + fEtaShift) || particle->Eta() < (-fEtaCut + fEtaShift) ){
1663 if( ePos->Eta() > (fEtaCut + fEtaShift) || ePos->Eta() < (-fEtaCut + fEtaShift) ){
1666 if( eNeg->Eta() > (fEtaCut + fEtaShift) || eNeg->Eta() < (-fEtaCut + fEtaShift) ){
1669 if(fEtaCutMin>-0.1){
1670 if( particle->Eta() < (fEtaCutMin + fEtaShift) && particle->Eta() > (-fEtaCutMin + fEtaShift) ){
1673 if( ePos->Eta() < (fEtaCutMin + fEtaShift) && ePos->Eta() > (-fEtaCutMin + fEtaShift) ){
1676 if( eNeg->Eta() < (fEtaCutMin + fEtaShift) && eNeg->Eta() > (-fEtaCutMin + fEtaShift) ){
1681 if( ePos->Pt()< fSinglePtCut || eNeg->Pt()< fSinglePtCut){
1685 if(particle->Pt()<fPtCut){
1691 ///________________________________________________________________________
1692 Bool_t AliConversionCuts::UpdateCutString() {
1693 ///Update the cut string (if it has been created yet)
1695 if(fCutString && fCutString->GetString().Length() == kNCuts) {
1696 fCutString->SetString(GetCutNumber());
1702 ///________________________________________________________________________
1703 void AliConversionCuts::LoadReweightingHistosMCFromFile() {
1705 AliInfo("Entering loading of histograms for weighting");
1706 TFile *f = TFile::Open(fPathTrFReweighting.Data());
1708 AliError(Form("file for weighting %s not found",fPathTrFReweighting.Data()));
1711 if (fNameHistoReweightingPi0.CompareTo("") != 0 && fDoReweightHistoMCPi0 ){
1712 TH1D *hReweightMCHistPi0temp = (TH1D*)f->Get(fNameHistoReweightingPi0.Data());
1713 hReweightMCHistPi0 = new TH1D(*hReweightMCHistPi0temp);
1714 hReweightMCHistPi0->SetDirectory(0);
1715 if (hReweightMCHistPi0) AliInfo(Form("%s has been loaded from %s", fNameHistoReweightingPi0.Data(),fPathTrFReweighting.Data() ));
1716 else AliWarning(Form("%s not found in %s", fNameHistoReweightingPi0.Data() ,fPathTrFReweighting.Data()));
1718 if (fNameFitDataPi0.CompareTo("") != 0 && fDoReweightHistoMCPi0 ){
1719 TF1 *fFitDataPi0temp = (TF1*)f->Get(fNameFitDataPi0.Data());
1720 fFitDataPi0 = new TF1(*fFitDataPi0temp);
1721 if (fFitDataPi0) AliInfo(Form("%s has been loaded from %s", fNameFitDataPi0.Data(),fPathTrFReweighting.Data() ));
1722 else AliWarning(Form("%s not found in %s",fPathTrFReweighting.Data(), fNameFitDataPi0.Data() ));
1725 if (fNameHistoReweightingEta.CompareTo("") != 0 && fDoReweightHistoMCEta){
1726 TH1D *hReweightMCHistEtatemp = (TH1D*)f->Get(fNameHistoReweightingEta.Data());
1727 hReweightMCHistEta = new TH1D(*hReweightMCHistEtatemp);
1728 hReweightMCHistEta->SetDirectory(0);
1729 if (hReweightMCHistEta) AliInfo(Form("%s has been loaded from %s", fNameHistoReweightingEta.Data(),fPathTrFReweighting.Data() ));
1730 else AliWarning(Form("%s not found in %s", fNameHistoReweightingEta.Data(),fPathTrFReweighting.Data() ));
1733 if (fNameFitDataEta.CompareTo("") != 0 && fDoReweightHistoMCEta){
1734 TF1 *fFitDataEtatemp = (TF1*)f->Get(fNameFitDataEta.Data());
1735 fFitDataEta = new TF1(*fFitDataEtatemp);
1736 if (fFitDataEta) AliInfo(Form("%s has been loaded from %s", fNameFitDataEta.Data(),fPathTrFReweighting.Data() ));
1737 else AliWarning(Form("%s not found in %s", fNameFitDataEta.Data(),fPathTrFReweighting.Data() ));
1740 if (fNameHistoReweightingK0s.CompareTo("") != 0 && fDoReweightHistoMCK0s){
1741 TH1D *hReweightMCHistK0stemp = (TH1D*)f->Get(fNameHistoReweightingK0s.Data());
1742 hReweightMCHistK0s = new TH1D(*hReweightMCHistK0stemp);
1743 hReweightMCHistK0s->SetDirectory(0);
1744 if (hReweightMCHistK0s) AliInfo(Form("%s has been loaded from %s", fNameHistoReweightingK0s.Data(),fPathTrFReweighting.Data() ));
1745 else AliWarning(Form("%s not found in %s", fNameHistoReweightingK0s.Data(),fPathTrFReweighting.Data() ));
1748 if (fNameFitDataK0s.CompareTo("") != 0 && fDoReweightHistoMCK0s){
1749 TF1 *fFitDataK0stemp = (TF1*)f->Get(fNameFitDataK0s.Data());
1750 fFitDataK0s = new TF1(*fFitDataK0stemp);
1751 if (fFitDataK0s) AliInfo(Form("%s has been loaded from %s", fNameFitDataK0s.Data(),fPathTrFReweighting.Data() ));
1752 else AliWarning(Form("%s not found in %s", fNameFitDataK0s.Data(),fPathTrFReweighting.Data() ));
1760 ///________________________________________________________________________
1761 Bool_t AliConversionCuts::InitializeCutsFromCutString(const TString analysisCutSelection ) {
1762 // Initialize Cuts from a given Cut string
1763 if(fDoReweightHistoMCPi0 || fDoReweightHistoMCEta || fDoReweightHistoMCK0s) {
1764 AliInfo("Weighting was enabled");
1765 LoadReweightingHistosMCFromFile();
1768 AliInfo(Form("Set Photoncut Number: %s",analysisCutSelection.Data()));
1769 if(analysisCutSelection.Length()!=kNCuts) {
1770 AliError(Form("Cut selection has the wrong length! size is %d, number of cuts is %d", analysisCutSelection.Length(), kNCuts));
1773 if(!analysisCutSelection.IsDigit()){
1774 AliError("Cut selection contains characters");
1778 const char *cutSelection = analysisCutSelection.Data();
1779 #define ASSIGNARRAY(i) fCuts[i] = cutSelection[i] - '0'
1780 for(Int_t ii=0;ii<kNCuts;ii++){
1784 // Set Individual Cuts
1785 for(Int_t ii=0;ii<kNCuts;ii++){
1786 if(!SetCut(cutIds(ii),fCuts[ii]))return kFALSE;
1793 ///________________________________________________________________________
1794 Bool_t AliConversionCuts::SetCut(cutIds cutID, const Int_t value) {
1795 ///Set individual cut ID
1800 if( SetV0Finder(value)) {
1801 fCuts[kv0FinderType] = value;
1804 } else return kFALSE;
1806 case kededxSigmaCut:
1807 if( SetTPCdEdxCutElectronLine(value)) {
1808 fCuts[kededxSigmaCut] = value;
1811 } else return kFALSE;
1813 case kpidedxSigmaCut:
1814 if( SetTPCdEdxCutPionLine(value)) {
1815 fCuts[kpidedxSigmaCut] = value;
1818 } else return kFALSE;
1820 case kpiMomdedxSigmaCut:
1821 if( SetMinMomPiondEdxCut(value)) {
1822 fCuts[kpiMomdedxSigmaCut] = value;
1825 } else return kFALSE;
1828 if( SetChi2GammaCut(value)) {
1829 fCuts[kchi2GammaCut] = value;
1832 } else return kFALSE;
1835 if( SetSinglePtCut(value)) {
1836 fCuts[ksinglePtCut] = value;
1839 } else return kFALSE;
1842 if( SetTPCClusterCut(value)) {
1843 fCuts[kclsTPCCut] = value;
1846 } else return kFALSE;
1849 if( SetEtaCut(value)) {
1850 fCuts[ketaCut] = value;
1853 } else return kFALSE;
1855 case kLowPRejectionSigmaCut:
1856 if( SetLowPRejectionCuts(value)) {
1857 fCuts[kLowPRejectionSigmaCut] = value;
1860 } else return kFALSE;
1863 if( SetQtMaxCut(value)) {
1864 fCuts[kQtMaxCut] = value;
1867 } else return kFALSE;
1869 case kpiMaxMomdedxSigmaCut:
1870 if( SetMaxMomPiondEdxCut(value)) {
1871 fCuts[kpiMaxMomdedxSigmaCut] = value;
1874 } else return kFALSE;
1877 if( SetRCut(value)) {
1878 fCuts[kRCut] = value;
1881 } else return kFALSE;
1884 if( SetRemovePileUp(value)) {
1885 fCuts[kremovePileUp] = value;
1888 } else return kFALSE;
1891 if( SetSelectSpecialTrigger(value)) {
1892 fCuts[kselectV0AND] = value;
1895 } else return kFALSE;
1897 case kmultiplicityMethod:
1898 if( SetMultiplicityMethod(value)) {
1899 fCuts[kmultiplicityMethod] = value;
1902 } else return kFALSE;
1905 if( SetIsHeavyIon(value)) {
1906 fCuts[kisHeavyIon] = value;
1909 } else return kFALSE;
1911 case kCentralityMin:
1912 if( SetCentralityMin(value)) {
1913 fCuts[kCentralityMin] = value;
1916 } else return kFALSE;
1918 case kCentralityMax:
1919 if( SetCentralityMax(value)) {
1920 fCuts[kCentralityMax] = value;
1923 } else return kFALSE;
1925 case kTOFelectronPID:
1926 if( SetTOFElectronPIDCut(value)) {
1927 fCuts[kTOFelectronPID] = value;
1930 } else return kFALSE;
1932 case kdoPhotonAsymmetryCut:
1933 if( SetPhotonAsymmetryCut(value)) {
1934 fCuts[kdoPhotonAsymmetryCut] = value;
1937 } else return kFALSE;
1940 if( SetPsiPairCut(value)) {
1941 fCuts[kPsiPair] = value;
1944 } else return kFALSE;
1947 if( SetCosPAngleCut(value)) {
1948 fCuts[kCosPAngle] = value;
1951 } else return kFALSE;
1955 if( SetSharedElectronCut(value)) {
1956 fCuts[kElecShare] = value;
1959 } else return kFALSE;
1962 if( SetToCloseV0sCut(value)) {
1963 fCuts[kToCloseV0s] = value;
1966 } else return kFALSE;
1969 if( SetRejectExtraSignalsCut(value)) {
1970 fCuts[kExtraSignals] = value;
1973 } else return kFALSE;
1976 if( SetDCARPhotonPrimVtxCut(value)) {
1977 fCuts[kDcaRPrimVtx] = value;
1980 } else return kFALSE;
1983 if( SetDCAZPhotonPrimVtxCut(value)) {
1984 fCuts[kDcaZPrimVtx] = value;
1987 } else return kFALSE;
1991 AliError("Cut id out of range");
1995 AliError("Cut id %d not recognized");
2000 ///________________________________________________________________________
2001 void AliConversionCuts::PrintCuts() {
2002 // Print out current Cut Selection
2003 for(Int_t ic = 0; ic < kNCuts; ic++) {
2004 printf("%-30s : %d \n", fgkCutNames[ic], fCuts[ic]);
2007 ///________________________________________________________________________
2008 Bool_t AliConversionCuts::SetIsHeavyIon(Int_t isHeavyIon)
2016 fDetectorCentrality=0;
2020 fDetectorCentrality=1;
2022 case 3: //allows to select centrality 0-45% in steps of 5% for V0 Multiplicity
2024 fDetectorCentrality=0;
2025 fModCentralityClass=1;
2027 case 4: //allows to select centrality 45-90% in steps of 5% for V0 Multiplicity
2029 fDetectorCentrality=0;
2030 fModCentralityClass=2;
2032 case 5: //strict cut on v0 tracks for MC
2034 fDetectorCentrality=0;
2035 fModCentralityClass=3;
2037 case 6: //allows to select centrality 0-45% in steps of 5% for track mult
2038 //strict cut on v0 tracks for MC
2040 fDetectorCentrality=0;
2041 fModCentralityClass=4;
2043 case 7: //allows to select centrality 45-90% in steps of 5% for V0 Multiplicity
2044 //strict cut on v0 tracks for MC
2046 fDetectorCentrality=0;
2047 fModCentralityClass=5;
2051 fDetectorCentrality=0;
2055 fDetectorCentrality=1;
2058 AliError(Form("SetHeavyIon not defined %d",isHeavyIon));
2064 //___________________________________________________________________
2065 Bool_t AliConversionCuts::SetCentralityMin(Int_t minCentrality)
2068 if(minCentrality<0||minCentrality>9){
2069 AliError(Form("minCentrality not defined %d",minCentrality));
2073 fCentralityMin=minCentrality;
2076 //___________________________________________________________________
2077 Bool_t AliConversionCuts::SetCentralityMax(Int_t maxCentrality)
2080 if(maxCentrality<0||maxCentrality>9){
2081 AliError(Form("maxCentrality not defined %d",maxCentrality));
2084 fCentralityMax=maxCentrality;
2087 ///________________________________________________________________________
2088 Int_t AliConversionCuts::SetSelectSpecialTrigger(Int_t selectSpecialTrigger)
2091 switch(selectSpecialTrigger){
2093 fSpecialTrigger=0; // dont care
2096 fSpecialTrigger=1; // V0AND
2099 fSpecialTrigger=2; // with SDD requested
2102 fSpecialTrigger=3; // V0AND plus with SDD requested
2104 // allows to run MB & 6 other different trigger classes in parallel with the same photon cut
2106 fSpecialTrigger=4; // different trigger class as MB
2107 fTriggerSelectedManually = kTRUE;
2110 fSpecialTrigger=4; // different trigger class as MB
2111 fTriggerSelectedManually = kTRUE;
2114 fSpecialTrigger=4; // different trigger class as MB
2115 fTriggerSelectedManually = kTRUE;
2118 fSpecialTrigger=4; // different trigger class as MB
2119 fTriggerSelectedManually = kTRUE;
2122 fSpecialTrigger=4; // different trigger class as MB
2123 fTriggerSelectedManually = kTRUE;
2126 fSpecialTrigger=4; // different trigger class as MB
2127 fTriggerSelectedManually = kTRUE;
2130 AliError("Warning: Special Trigger Not known");
2135 ///________________________________________________________________________
2136 Bool_t AliConversionCuts::SetMultiplicityMethod(Int_t multiplicityMethod)
2139 fMultiplicityMethod=multiplicityMethod;
2141 // 0 Photon Multiplicity
2142 // 1 TPC Track multiplicity
2148 ///________________________________________________________________________
2149 Bool_t AliConversionCuts::SetRemovePileUp(Int_t removePileUp)
2151 switch(removePileUp){
2153 fRemovePileUp=kFALSE;
2156 fRemovePileUp=kTRUE;
2159 AliError("RemovePileUpCut not defined");
2164 ///________________________________________________________________________
2165 Bool_t AliConversionCuts::SetRejectExtraSignalsCut(Int_t extraSignal) {
2167 switch(extraSignal){
2169 fRejectExtraSignals = 0;
2170 break; // No Rejection
2172 fRejectExtraSignals = 1;
2173 break; // MinBias Header
2175 fRejectExtraSignals = 2;
2176 break; // User String Array
2178 fRejectExtraSignals = 3;
2179 break; // Rejection for Gamma Correction only
2181 AliError(Form("Extra Signal Rejection not defined %d",extraSignal));
2186 ///________________________________________________________________________
2187 Bool_t AliConversionCuts::SetV0Finder(Int_t v0FinderType)
2189 switch (v0FinderType){
2190 case 0: // on fly V0 finder
2191 cout << "have chosen onfly V0" << endl;
2192 fUseOnFlyV0Finder=kTRUE;
2194 case 1: // offline V0 finder
2195 cout << "have chosen offline V0" << endl;
2196 fUseOnFlyV0Finder=kFALSE;
2199 AliError(Form(" v0FinderType not defined %d",v0FinderType));
2204 ///________________________________________________________________________
2205 Bool_t AliConversionCuts::SetEtaCut(Int_t etaCut)
2208 //Set Standard LineCutZValues
2209 fLineCutZValueMin = -2;
2210 fLineCutZValue = 7.;
2215 fLineCutZRSlope = tan(2*atan(exp(-fEtaCut)));
2217 fLineCutZRSlopeMin = 0.;
2219 case 1: // 1.2 // changed from 1.2 to 0.6 on 2013.06.10
2221 fLineCutZRSlope = tan(2*atan(exp(-fEtaCut)));
2223 fLineCutZRSlopeMin = 0.;
2227 fLineCutZRSlope = tan(2*atan(exp(-fEtaCut)));
2229 fLineCutZRSlopeMin = 0.;
2233 fLineCutZRSlope = tan(2*atan(exp(-fEtaCut)));
2235 fLineCutZRSlopeMin = 0.;
2239 fLineCutZRSlope = tan(2*atan(exp(-fEtaCut)));
2241 fLineCutZRSlopeMin = 0.;
2245 fLineCutZRSlope = tan(2*atan(exp(-fEtaCut)));
2247 fLineCutZRSlopeMin = 0.;
2251 fLineCutZRSlope = tan(2*atan(exp(-fEtaCut)));
2253 fLineCutZRSlopeMin = 0.;
2257 fLineCutZRSlope = tan(2*atan(exp(-fEtaCut)));
2259 fLineCutZRSlopeMin = 0.;
2261 // case 8: // 0.1 - 0.8
2263 // fLineCutZRSlope = tan(2*atan(exp(-fEtaCut)));
2264 // fEtaCutMin = 0.1;
2265 // fLineCutZRSlopeMin = tan(2*atan(exp(-fEtaCutMin)));
2269 fLineCutZRSlope = tan(2*atan(exp(-fEtaCut)));
2271 fLineCutZRSlopeMin = 0.;
2275 fLineCutZRSlope = tan(2*atan(exp(-fEtaCut)));
2277 fLineCutZRSlopeMin = 0.;
2280 AliError(Form(" EtaCut not defined %d",etaCut));
2285 ///________________________________________________________________________
2286 Bool_t AliConversionCuts::SetRCut(Int_t RCut){
2309 // High purity cuts for PbPb (remove first layers of material)
2332 AliError("RCut not defined");
2337 ///________________________________________________________________________
2338 Bool_t AliConversionCuts::SetSinglePtCut(Int_t singlePtCut)
2340 switch(singlePtCut){
2341 case 0: // 0.050 GeV
2342 fSinglePtCut = 0.050;
2344 case 1: // 0.100 GeV
2345 fSinglePtCut = 0.100;
2347 case 2: // 0.150 GeV
2348 fSinglePtCut = 0.150;
2350 case 3: // 0.200 GeV
2351 fSinglePtCut = 0.200;
2353 case 4: // 0.075 GeV
2354 fSinglePtCut = 0.075;
2356 case 5: // 0.125 GeV
2357 fSinglePtCut = 0.125;
2360 fSinglePtCut = 0.040;
2366 AliError(Form("singlePtCut not defined %d",singlePtCut));
2371 ///________________________________________________________________________
2372 Bool_t AliConversionCuts::SetTPCClusterCut(Int_t clsTPCCut)
2387 case 4: // 95% of findable clusters
2388 fMinClsTPCToF= 0.95;
2389 fUseCorrectedTPCClsInfo=1;
2391 case 5: // 0% of findable clusters
2393 fUseCorrectedTPCClsInfo=1;
2395 case 6: // 70% of findable clusters
2397 fUseCorrectedTPCClsInfo=1;
2399 case 7: // 0% of findable clusters
2400 fMinClsTPCToF= 0.35;
2401 fUseCorrectedTPCClsInfo=0;
2404 fMinClsTPCToF= 0.35;
2405 fUseCorrectedTPCClsInfo=1;
2409 fUseCorrectedTPCClsInfo=1;
2412 AliError(Form("Warning: clsTPCCut not defined %d",clsTPCCut));
2417 ///________________________________________________________________________
2418 Bool_t AliConversionCuts::SetTPCdEdxCutElectronLine(Int_t ededxSigmaCut)
2420 switch(ededxSigmaCut){
2422 fPIDnSigmaBelowElectronLine=-10;
2423 fPIDnSigmaAboveElectronLine=10;
2426 fPIDnSigmaBelowElectronLine=-5;
2427 fPIDnSigmaAboveElectronLine=5;
2430 fPIDnSigmaBelowElectronLine=-3;
2431 fPIDnSigmaAboveElectronLine=5;
2434 fPIDnSigmaBelowElectronLine=-4;
2435 fPIDnSigmaAboveElectronLine=5;
2438 fPIDnSigmaBelowElectronLine=-6;
2439 fPIDnSigmaAboveElectronLine=7;
2442 fPIDnSigmaBelowElectronLine=-4;
2443 fPIDnSigmaAboveElectronLine=4;
2446 fPIDnSigmaBelowElectronLine=-2.5;
2447 fPIDnSigmaAboveElectronLine=4;
2450 fPIDnSigmaBelowElectronLine=-2;
2451 fPIDnSigmaAboveElectronLine=3.5;
2454 AliError("TPCdEdxCutElectronLine not defined");
2460 ///________________________________________________________________________
2461 Bool_t AliConversionCuts::SetTPCdEdxCutPionLine(Int_t pidedxSigmaCut)
2464 switch(pidedxSigmaCut){
2466 fPIDnSigmaAbovePionLine=-10;
2467 fPIDnSigmaAbovePionLineHighPt=-10;
2470 fPIDnSigmaAbovePionLine=0;
2471 fPIDnSigmaAbovePionLineHighPt=-10;
2474 fPIDnSigmaAbovePionLine=1;
2475 fPIDnSigmaAbovePionLineHighPt=-10;
2478 fPIDnSigmaAbovePionLine=2.5;
2479 fPIDnSigmaAbovePionLineHighPt=-10;
2482 fPIDnSigmaAbovePionLine=0.5;
2483 fPIDnSigmaAbovePionLineHighPt=-10;
2486 fPIDnSigmaAbovePionLine=2.;
2487 fPIDnSigmaAbovePionLineHighPt=-10;
2490 fPIDnSigmaAbovePionLine=2.;
2491 fPIDnSigmaAbovePionLineHighPt=0.5;
2494 fPIDnSigmaAbovePionLine=3.5;
2495 fPIDnSigmaAbovePionLineHighPt=-10;
2498 fPIDnSigmaAbovePionLine=2.;
2499 fPIDnSigmaAbovePionLineHighPt=1.;
2502 fPIDnSigmaAbovePionLine=3.0; // We need a bit less tight cut on dE/dx
2503 fPIDnSigmaAbovePionLineHighPt=-10;
2506 AliError(Form("Warning: pidedxSigmaCut not defined %d",pidedxSigmaCut));
2511 ///________________________________________________________________________
2512 Bool_t AliConversionCuts::SetMinMomPiondEdxCut(Int_t piMomdedxSigmaCut)
2514 switch(piMomdedxSigmaCut){
2516 fPIDMinPnSigmaAbovePionLine=0.5;
2519 fPIDMinPnSigmaAbovePionLine=1.;
2522 fPIDMinPnSigmaAbovePionLine=1.5;
2525 fPIDMinPnSigmaAbovePionLine=20.;
2528 fPIDMinPnSigmaAbovePionLine=50.;
2531 fPIDMinPnSigmaAbovePionLine=0.3;
2534 fPIDMinPnSigmaAbovePionLine=0.25;
2537 fPIDMinPnSigmaAbovePionLine=0.4;
2540 fPIDMinPnSigmaAbovePionLine=0.2;
2543 AliError(Form("piMomdedxSigmaCut not defined %d",piMomdedxSigmaCut));
2548 ///________________________________________________________________________
2549 Bool_t AliConversionCuts::SetMaxMomPiondEdxCut(Int_t piMaxMomdedxSigmaCut)
2551 switch(piMaxMomdedxSigmaCut){
2553 fPIDMaxPnSigmaAbovePionLine=100.;
2556 fPIDMaxPnSigmaAbovePionLine=5.;
2559 fPIDMaxPnSigmaAbovePionLine=4.;
2562 fPIDMaxPnSigmaAbovePionLine=3.5;
2565 fPIDMaxPnSigmaAbovePionLine=3.;
2568 fPIDMaxPnSigmaAbovePionLine=7.;
2571 AliError(Form("piMaxMomdedxSigmaCut not defined %d",piMaxMomdedxSigmaCut));
2576 ///________________________________________________________________________
2577 Bool_t AliConversionCuts::SetLowPRejectionCuts(Int_t LowPRejectionSigmaCut)
2579 switch(LowPRejectionSigmaCut){
2581 fPIDnSigmaAtLowPAroundKaonLine=0;
2582 fPIDnSigmaAtLowPAroundProtonLine=0;
2583 fPIDnSigmaAtLowPAroundPionLine=0;
2584 fDoKaonRejectionLowP = kFALSE;
2585 fDoProtonRejectionLowP = kFALSE;
2586 fDoPionRejectionLowP = kFALSE;
2587 fPIDMinPPionRejectionLowP = fPIDMinPnSigmaAbovePionLine;
2590 fPIDnSigmaAtLowPAroundKaonLine=0.5;
2591 fPIDnSigmaAtLowPAroundProtonLine=0.5;
2592 fPIDnSigmaAtLowPAroundPionLine=0.5;
2593 fDoKaonRejectionLowP = kTRUE;
2594 fDoProtonRejectionLowP = kTRUE;
2595 fDoPionRejectionLowP = kTRUE;
2596 fPIDMinPPionRejectionLowP = fPIDMinPnSigmaAbovePionLine;
2599 fPIDnSigmaAtLowPAroundKaonLine=1;
2600 fPIDnSigmaAtLowPAroundProtonLine=1;
2601 fPIDnSigmaAtLowPAroundPionLine=1;
2602 fDoKaonRejectionLowP = kTRUE;
2603 fDoProtonRejectionLowP = kTRUE;
2604 fDoPionRejectionLowP = kTRUE;
2605 fPIDMinPPionRejectionLowP = fPIDMinPnSigmaAbovePionLine;
2608 fPIDnSigmaAtLowPAroundKaonLine=2.;
2609 fPIDnSigmaAtLowPAroundProtonLine=2.;
2610 fPIDnSigmaAtLowPAroundPionLine=2.;
2611 fDoKaonRejectionLowP = kTRUE;
2612 fDoProtonRejectionLowP = kTRUE;
2613 fDoPionRejectionLowP = kTRUE;
2614 fPIDMinPPionRejectionLowP = fPIDMinPnSigmaAbovePionLine;
2617 fPIDnSigmaAtLowPAroundKaonLine=0.;
2618 fPIDnSigmaAtLowPAroundProtonLine=0.;
2619 fPIDnSigmaAtLowPAroundPionLine=1;
2620 fDoKaonRejectionLowP = kFALSE;
2621 fDoProtonRejectionLowP = kFALSE;
2622 fDoPionRejectionLowP = kTRUE;
2623 fPIDMinPPionRejectionLowP = fPIDMinPnSigmaAbovePionLine;
2626 fPIDnSigmaAtLowPAroundKaonLine=0.;
2627 fPIDnSigmaAtLowPAroundProtonLine=0.;
2628 fPIDnSigmaAtLowPAroundPionLine=1.5;
2629 fDoKaonRejectionLowP = kFALSE;
2630 fDoProtonRejectionLowP = kFALSE;
2631 fDoPionRejectionLowP = kTRUE;
2632 fPIDMinPPionRejectionLowP = fPIDMinPnSigmaAbovePionLine;
2635 fPIDnSigmaAtLowPAroundKaonLine=0.;
2636 fPIDnSigmaAtLowPAroundProtonLine=0.;
2637 fPIDnSigmaAtLowPAroundPionLine=2.;
2638 fDoKaonRejectionLowP = kFALSE;
2639 fDoProtonRejectionLowP = kFALSE;
2640 fDoPionRejectionLowP = kTRUE;
2641 fPIDMinPPionRejectionLowP = fPIDMinPnSigmaAbovePionLine;
2644 fPIDnSigmaAtLowPAroundKaonLine=0.;
2645 fPIDnSigmaAtLowPAroundProtonLine=0.;
2646 fPIDnSigmaAtLowPAroundPionLine=0.5;
2647 fDoKaonRejectionLowP = kFALSE;
2648 fDoProtonRejectionLowP = kFALSE;
2649 fDoPionRejectionLowP = kTRUE;
2650 fPIDMinPPionRejectionLowP = fPIDMinPnSigmaAbovePionLine;
2653 AliError(Form("LowPRejectionSigmaCut not defined %d",LowPRejectionSigmaCut));
2658 ///________________________________________________________________________
2659 Bool_t AliConversionCuts::SetTOFElectronPIDCut(Int_t TOFelectronPID){
2661 switch(TOFelectronPID){
2663 fUseTOFpid = kFALSE;
2664 fTofPIDnSigmaBelowElectronLine=-100;
2665 fTofPIDnSigmaAboveElectronLine=100;
2669 fTofPIDnSigmaBelowElectronLine=-7;
2670 fTofPIDnSigmaAboveElectronLine=7;
2674 fTofPIDnSigmaBelowElectronLine=-5;
2675 fTofPIDnSigmaAboveElectronLine=5;
2679 fTofPIDnSigmaBelowElectronLine=-3;
2680 fTofPIDnSigmaAboveElectronLine=5;
2684 fTofPIDnSigmaBelowElectronLine=-2;
2685 fTofPIDnSigmaAboveElectronLine=3;
2689 fTofPIDnSigmaBelowElectronLine=-3;
2690 fTofPIDnSigmaAboveElectronLine=3;
2693 AliError(Form("TOFElectronCut not defined %d",TOFelectronPID));
2698 ///________________________________________________________________________
2699 Bool_t AliConversionCuts::SetQtMaxCut(Int_t QtMaxCut)
2704 fDoQtGammaSelection=kFALSE;
2705 fDoHighPtQtGammaSelection=kFALSE;
2707 fPtBorderForQt=100.;
2711 fDoHighPtQtGammaSelection=kFALSE;
2713 fPtBorderForQt=100.;
2717 fDoHighPtQtGammaSelection=kFALSE;
2719 fPtBorderForQt=100.;
2723 fDoHighPtQtGammaSelection=kFALSE;
2725 fPtBorderForQt=100.;
2729 fDoHighPtQtGammaSelection=kFALSE;
2731 fPtBorderForQt=100.;
2735 fDoHighPtQtGammaSelection=kFALSE;
2737 fPtBorderForQt=100.;
2741 fDoHighPtQtGammaSelection=kTRUE;
2747 fDoHighPtQtGammaSelection=kFALSE;
2749 fPtBorderForQt=100.;
2752 AliError(Form("Warning: QtMaxCut not defined %d",QtMaxCut));
2757 ///________________________________________________________________________
2758 Bool_t AliConversionCuts::SetChi2GammaCut(Int_t chi2GammaCut)
2761 switch(chi2GammaCut){
2763 fChi2CutConversion = 100.;
2766 fChi2CutConversion = 50.;
2769 fChi2CutConversion = 30.;
2772 fChi2CutConversion = 200.;
2775 fChi2CutConversion = 500.;
2778 fChi2CutConversion = 100000.;
2781 fChi2CutConversion = 5.;
2784 fChi2CutConversion = 10.;
2787 fChi2CutConversion = 20.;
2790 fChi2CutConversion = 15.;
2793 AliError(Form("Warning: Chi2GammaCut not defined %d",chi2GammaCut));
2798 ///________________________________________________________________________
2799 Bool_t AliConversionCuts::SetPsiPairCut(Int_t psiCut) {
2803 fPsiPairCut = 10000; //
2806 fPsiPairCut = 0.1; //
2809 fPsiPairCut = 0.05; // Standard
2812 fPsiPairCut = 0.035; //
2815 fPsiPairCut = 0.2; //
2818 fPsiPairCut = 0.1; //
2819 fPsiPairDeltaPhiCut = 1;
2820 fDo2DPsiPair = kTRUE;
2823 fPsiPairCut = 0.05; //
2824 fPsiPairDeltaPhiCut = 1;
2825 fDo2DPsiPair = kTRUE;
2828 fPsiPairCut = 0.035; //
2829 fPsiPairDeltaPhiCut = 1;
2830 fDo2DPsiPair = kTRUE;
2833 fPsiPairCut = 0.2; //
2834 fPsiPairDeltaPhiCut = 1;
2835 fDo2DPsiPair = kTRUE; //
2838 fPsiPairCut = 0.5; //
2841 AliError(Form("PsiPairCut not defined %d",psiCut));
2847 ///________________________________________________________________________
2848 Bool_t AliConversionCuts::SetPhotonAsymmetryCut(Int_t doPhotonAsymmetryCut){
2850 switch(doPhotonAsymmetryCut){
2852 fDoPhotonAsymmetryCut=0;
2853 fMinPPhotonAsymmetryCut=100.;
2854 fMinPhotonAsymmetry=0.;
2857 fDoPhotonAsymmetryCut=1;
2858 fMinPPhotonAsymmetryCut=3.5;
2859 fMinPhotonAsymmetry=0.04;
2862 fDoPhotonAsymmetryCut=1;
2863 fMinPPhotonAsymmetryCut=3.5;
2864 fMinPhotonAsymmetry=0.06;
2867 fDoPhotonAsymmetryCut=1;
2868 fMinPPhotonAsymmetryCut=0.0;
2869 fMinPhotonAsymmetry=0.05;
2872 AliError(Form("PhotonAsymmetryCut not defined %d",doPhotonAsymmetryCut));
2875 fCuts[kdoPhotonAsymmetryCut]=doPhotonAsymmetryCut;
2878 ///________________________________________________________________________
2879 Bool_t AliConversionCuts::SetCosPAngleCut(Int_t cosCut) {
2883 fCosPAngleCut = TMath::Pi(); // -1
2886 fCosPAngleCut = 0.1; // 0.99500
2889 fCosPAngleCut = 0.05; // 0.99875
2892 fCosPAngleCut = 0.025; // 0.99969
2895 fCosPAngleCut = 0.01; // 0.99995
2898 fCosPAngleCut = 0.2; // 0.98007
2901 fCosPAngleCut = 0.5; // 0.87758
2904 fCosPAngleCut = 0.075; // 0.73169
2907 AliError(Form("Cosine Pointing Angle cut not defined %d",cosCut));
2913 ///________________________________________________________________________
2914 Bool_t AliConversionCuts::SetSharedElectronCut(Int_t sharedElec) {
2918 fDoSharedElecCut = kFALSE;
2921 fDoSharedElecCut = kTRUE;
2924 AliError(Form("Shared Electron Cut not defined %d",sharedElec));
2930 ///________________________________________________________________________
2931 Bool_t AliConversionCuts::SetToCloseV0sCut(Int_t toClose) {
2935 fDoToCloseV0sCut = kFALSE;
2939 fDoToCloseV0sCut = kTRUE;
2943 fDoToCloseV0sCut = kTRUE;
2947 fDoToCloseV0sCut = kTRUE;
2951 AliError(Form("Shared Electron Cut not defined %d",toClose));
2956 ///________________________________________________________________________
2957 Bool_t AliConversionCuts::SetTRDElectronCut(Int_t TRDElectronCut)
2959 switch(TRDElectronCut){
2965 fPIDTRDEfficiency=0.1;
2969 fPIDTRDEfficiency=0.8;
2973 fPIDTRDEfficiency=0.9;
2976 AliError(Form("TRDElectronCut not defined %d",TRDElectronCut));
2983 ///________________________________________________________________________
2984 Bool_t AliConversionCuts::SetDCAZPhotonPrimVtxCut(Int_t DCAZPhotonPrimVtx){
2986 switch(DCAZPhotonPrimVtx){
2988 fDCAZPrimVtxCut = 1000;
2991 fDCAZPrimVtxCut = 10;
2994 fDCAZPrimVtxCut = 5;
2997 fDCAZPrimVtxCut = 4;
3000 fDCAZPrimVtxCut = 3;
3003 fDCAZPrimVtxCut = 2.5;
3006 fDCAZPrimVtxCut = 2;
3009 fDCAZPrimVtxCut = 1.5;
3012 fDCAZPrimVtxCut = 1;
3015 fDCAZPrimVtxCut = 0.5;
3018 cout<<"Warning: DCAZPhotonPrimVtx not defined "<<DCAZPhotonPrimVtx<<endl;
3024 ///________________________________________________________________________
3025 Bool_t AliConversionCuts::SetDCARPhotonPrimVtxCut(Int_t DCARPhotonPrimVtx){
3027 switch(DCARPhotonPrimVtx){
3029 fDCARPrimVtxCut = 1000;
3032 fDCARPrimVtxCut = 10;
3035 fDCARPrimVtxCut = 5;
3038 fDCARPrimVtxCut = 4;
3041 fDCARPrimVtxCut = 3;
3044 fDCARPrimVtxCut = 2.5;
3047 fDCARPrimVtxCut = 2;
3050 fDCARPrimVtxCut = 1.5;
3053 fDCARPrimVtxCut = 1;
3056 fDCARPrimVtxCut = 0.5;
3059 cout<<"Warning: DCARPhotonPrimVtx not defined "<<DCARPhotonPrimVtx<<endl;
3066 //-------------------------------------------------------------
3067 Double_t AliConversionCuts::GetCentrality(AliVEvent *event)
3068 { // Get Event Centrality
3070 AliESDEvent *esdEvent=dynamic_cast<AliESDEvent*>(event);
3072 AliCentrality *fESDCentrality=(AliCentrality*)esdEvent->GetCentrality();
3074 if(fDetectorCentrality==0){
3075 if (fIsHeavyIon==2){
3076 return fESDCentrality->GetCentralityPercentile("V0A"); // default for pPb
3078 return fESDCentrality->GetCentralityPercentile("V0M"); // default
3081 if(fDetectorCentrality==1){
3082 return fESDCentrality->GetCentralityPercentile("CL1");
3086 AliAODEvent *aodEvent=dynamic_cast<AliAODEvent*>(event);
3088 if(aodEvent->GetHeader()){return aodEvent->GetHeader()->GetCentrality();}
3093 //-------------------------------------------------------------
3094 Bool_t AliConversionCuts::IsCentralitySelected(AliVEvent *event, AliVEvent *fMCEvent)
3095 { // Centrality Selection
3096 if(!fIsHeavyIon)return kTRUE;
3098 if(fCentralityMin == fCentralityMax ) return kTRUE;//0-100%
3099 else if(fCentralityMax==0) fCentralityMax=10; //CentralityRange = fCentralityMin-100%
3101 Double_t centrality=GetCentrality(event);
3102 if(centrality<0)return kFALSE;
3104 Int_t centralityC=0;
3105 if (fModCentralityClass == 0){
3106 centralityC= Int_t(centrality/10);
3107 if(centralityC >= fCentralityMin && centralityC < fCentralityMax)
3111 else if (fModCentralityClass ==1){
3112 centralityC= Int_t(centrality);
3113 if(centralityC >= fCentralityMin*5 && centralityC < fCentralityMax*5){
3115 } else return kFALSE;
3117 else if (fModCentralityClass ==2){
3118 centralityC= Int_t(centrality);
3119 if(centralityC >= ((fCentralityMin*5)+45) && centralityC < ((fCentralityMax*5)+45))
3124 Int_t nprimaryTracks = ((AliV0ReaderV1*)AliAnalysisManager::GetAnalysisManager()->GetTask("V0ReaderV1"))->GetNumberOfPrimaryTracks();
3125 Int_t PrimaryTracks10[10][2] =
3138 Int_t PrimaryTracks5a[10][2] =
3151 Int_t PrimaryTracks5b[10][2] =
3166 if(event->IsA()==AliESDEvent::Class()) column = 0;
3167 if(event->IsA()==AliAODEvent::Class()) column = 1;
3169 if (fModCentralityClass == 3){
3171 if(nprimaryTracks > PrimaryTracks10[fCentralityMax][column] && nprimaryTracks <= PrimaryTracks10[fCentralityMin][column])
3176 centralityC= Int_t(centrality/10);
3177 if(centralityC >= fCentralityMin && centralityC < fCentralityMax)
3182 else if (fModCentralityClass ==4){
3184 if(nprimaryTracks > PrimaryTracks5a[fCentralityMax][column] && nprimaryTracks <= PrimaryTracks5a[fCentralityMin][column])
3189 centralityC= Int_t(centrality);
3190 if(centralityC >= fCentralityMin*5 && centralityC < fCentralityMax*5){
3192 } else return kFALSE;
3195 else if (fModCentralityClass ==5){
3197 if(nprimaryTracks > PrimaryTracks5b[fCentralityMax][column] && nprimaryTracks <= PrimaryTracks5b[fCentralityMin][column])
3202 centralityC= Int_t(centrality);
3203 if(centralityC >= ((fCentralityMin*5)+45) && centralityC < ((fCentralityMax*5)+45))
3211 ///________________________________________________________________________
3212 Bool_t AliConversionCuts::VertexZCut(AliVEvent *event){
3213 // Cut on z position of primary vertex
3214 Double_t fVertexZ=event->GetPrimaryVertex()->GetZ();
3216 if(abs(fVertexZ)>fMaxVertexZ)return kFALSE;
3218 if (fIsHeavyIon == 2){
3219 if(fUtils->IsFirstEventInChunk(event)) return kFALSE;
3220 if(!fUtils->IsVertexSelected2013pA(event)) return kFALSE;
3226 ///________________________________________________________________________
3228 Int_t AliConversionCuts::GetNumberOfContributorsVtx(AliVEvent *event){
3229 // returns number of contributors to the vertex
3231 AliESDEvent *fESDEvent=dynamic_cast<AliESDEvent*>(event);
3233 if (fESDEvent->GetPrimaryVertex() != NULL){
3234 if(fESDEvent->GetPrimaryVertex()->GetNContributors()>0) {
3235 // cout << "accepted global" << fESDEvent->GetEventNumberInFile() << " with NCont: " << fESDEvent->GetPrimaryVertex()->GetNContributors() << endl;
3236 return fESDEvent->GetPrimaryVertex()->GetNContributors();
3240 if(fESDEvent->GetPrimaryVertexSPD() !=NULL){
3241 if(fESDEvent->GetPrimaryVertexSPD()->GetNContributors()>0) {
3242 // cout << "accepted SPD" << fESDEvent->GetEventNumberInFile() << " with NCont: " << fESDEvent->GetPrimaryVertexSPD()->GetNContributors() << endl;
3243 return fESDEvent->GetPrimaryVertexSPD()->GetNContributors();
3245 AliWarning(Form("Number of contributors from bad vertex type:: %s",fESDEvent->GetPrimaryVertex()->GetName()));
3246 // cout << "rejected " << fESDEvent->GetEventNumberInFile() << endl;
3252 AliAODEvent *fAODEvent=dynamic_cast<AliAODEvent*>(event);
3254 if (fAODEvent->GetPrimaryVertex() != NULL){
3255 if(fAODEvent->GetPrimaryVertex()->GetNContributors()>0) {
3256 return fAODEvent->GetPrimaryVertex()->GetNContributors();
3259 if(fAODEvent->GetPrimaryVertexSPD() !=NULL){
3260 if(fAODEvent->GetPrimaryVertexSPD()->GetNContributors()>0) {
3261 return fAODEvent->GetPrimaryVertexSPD()->GetNContributors();
3263 AliWarning(Form("Number of contributors from bad vertex type:: %s",fAODEvent->GetPrimaryVertex()->GetName()));
3268 // cout << "rejected " << fESDEvent->GetEventNumberInFile() << endl;
3272 ///________________________________________________________________________
3274 Bool_t AliConversionCuts::IsTriggerSelected(AliVEvent *fInputEvent)
3277 AliInputEventHandler *fInputHandler=(AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler());
3279 UInt_t isSelected = AliVEvent::kAny;
3280 if (fInputHandler==NULL) return kFALSE;
3281 if( fInputHandler->GetEventSelection() || fInputEvent->IsA()==AliAODEvent::Class()) {
3282 if (!fTriggerSelectedManually){
3283 if (fPreSelCut) fOfflineTriggerMask = AliVEvent::kAny;
3285 if (fIsHeavyIon == 1) fOfflineTriggerMask = AliVEvent::kMB | AliVEvent::kCentral | AliVEvent::kSemiCentral;
3286 else if (fIsHeavyIon == 2) fOfflineTriggerMask = AliVEvent::kINT7;
3287 else fOfflineTriggerMask = AliVEvent::kMB;
3290 // Get the actual offline trigger mask for the event and AND it with the
3291 // requested mask. If no mask requested select by default the event.
3292 // if (fPreSelCut) cout << "Trigger selected from outside: "<< fTriggerSelectedManually <<"\t Offline Trigger mask for Precut: " << fOfflineTriggerMask << endl;
3293 // else cout << "Trigger selected from outside: "<< fTriggerSelectedManually <<"\t Offline Trigger mask: " << fOfflineTriggerMask << endl;
3295 if (fOfflineTriggerMask)
3296 isSelected = fOfflineTriggerMask & fInputHandler->IsEventSelected();
3298 fIsSDDFired = !(fInputHandler->IsEventSelected() & AliVEvent::kFastOnly);
3302 if (fIsSDDFired) hTriggerClass->Fill(33);
3303 if (fInputHandler->IsEventSelected() & AliVEvent::kMB)hTriggerClass->Fill(0);
3304 if (fInputHandler->IsEventSelected() & AliVEvent::kINT7)hTriggerClass->Fill(1);
3305 if (fInputHandler->IsEventSelected() & AliVEvent::kMUON)hTriggerClass->Fill(2);
3306 if (fInputHandler->IsEventSelected() & AliVEvent::kHighMult)hTriggerClass->Fill(3);
3307 if (fInputHandler->IsEventSelected() & AliVEvent::kEMC1)hTriggerClass->Fill(4);
3308 if (fInputHandler->IsEventSelected() & AliVEvent::kCINT5)hTriggerClass->Fill(5);
3309 if (fInputHandler->IsEventSelected() & AliVEvent::kCMUS5)hTriggerClass->Fill(6);
3310 if (fInputHandler->IsEventSelected() & AliVEvent::kMUSPB)hTriggerClass->Fill(6);
3311 if (fInputHandler->IsEventSelected() & AliVEvent::kMUSH7)hTriggerClass->Fill(7);
3312 if (fInputHandler->IsEventSelected() & AliVEvent::kMUSHPB)hTriggerClass->Fill(7);
3313 if (fInputHandler->IsEventSelected() & AliVEvent::kMUL7)hTriggerClass->Fill(8);
3314 if (fInputHandler->IsEventSelected() & AliVEvent::kMuonLikePB)hTriggerClass->Fill(8);
3315 if (fInputHandler->IsEventSelected() & AliVEvent::kMUU7)hTriggerClass->Fill(9);
3316 if (fInputHandler->IsEventSelected() & AliVEvent::kMuonUnlikePB)hTriggerClass->Fill(9);
3317 if (fInputHandler->IsEventSelected() & AliVEvent::kEMC7)hTriggerClass->Fill(10);
3318 if (fInputHandler->IsEventSelected() & AliVEvent::kEMC8)hTriggerClass->Fill(10);
3319 if (fInputHandler->IsEventSelected() & AliVEvent::kMUS7)hTriggerClass->Fill(11);
3320 if (fInputHandler->IsEventSelected() & AliVEvent::kPHI1)hTriggerClass->Fill(12);
3321 if (fInputHandler->IsEventSelected() & AliVEvent::kPHI7)hTriggerClass->Fill(13);
3322 if (fInputHandler->IsEventSelected() & AliVEvent::kPHI8)hTriggerClass->Fill(13);
3323 if (fInputHandler->IsEventSelected() & AliVEvent::kPHOSPb)hTriggerClass->Fill(13);
3324 if (fInputHandler->IsEventSelected() & AliVEvent::kEMCEJE)hTriggerClass->Fill(14);
3325 if (fInputHandler->IsEventSelected() & AliVEvent::kEMCEGA)hTriggerClass->Fill(15);
3326 if (fInputHandler->IsEventSelected() & AliVEvent::kCentral)hTriggerClass->Fill(16);
3327 if (fInputHandler->IsEventSelected() & AliVEvent::kSemiCentral)hTriggerClass->Fill(17);
3328 if (fInputHandler->IsEventSelected() & AliVEvent::kDG5)hTriggerClass->Fill(18);
3329 if (fInputHandler->IsEventSelected() & AliVEvent::kZED)hTriggerClass->Fill(19);
3330 if (fInputHandler->IsEventSelected() & AliVEvent::kSPI7)hTriggerClass->Fill(20);
3331 if (fInputHandler->IsEventSelected() & AliVEvent::kSPI)hTriggerClass->Fill(20);
3332 if (fInputHandler->IsEventSelected() & AliVEvent::kINT8)hTriggerClass->Fill(21);
3333 if (fInputHandler->IsEventSelected() & AliVEvent::kMuonSingleLowPt8)hTriggerClass->Fill(22);
3334 if (fInputHandler->IsEventSelected() & AliVEvent::kMuonSingleHighPt8)hTriggerClass->Fill(23);
3335 if (fInputHandler->IsEventSelected() & AliVEvent::kMuonLikeLowPt8)hTriggerClass->Fill(24);
3336 if (fInputHandler->IsEventSelected() & AliVEvent::kMuonUnlikeLowPt8)hTriggerClass->Fill(25);
3337 if (fInputHandler->IsEventSelected() & AliVEvent::kMuonUnlikeLowPt0)hTriggerClass->Fill(26);
3338 if (fInputHandler->IsEventSelected() & AliVEvent::kUserDefined)hTriggerClass->Fill(27);
3339 if (fInputHandler->IsEventSelected() & AliVEvent::kTRD)hTriggerClass->Fill(28);
3340 if (fInputHandler->IsEventSelected() & AliVEvent::kFastOnly)hTriggerClass->Fill(29);
3341 if (fInputHandler->IsEventSelected() & AliVEvent::kAnyINT)hTriggerClass->Fill(30);
3342 if (fInputHandler->IsEventSelected() & AliVEvent::kAny)hTriggerClass->Fill(31);
3343 if (!fInputHandler->IsEventSelected()) hTriggerClass->Fill(34);
3346 if(hTriggerClassSelected && isSelected){
3347 if (!fIsSDDFired) hTriggerClassSelected->Fill(33);
3348 if (fInputHandler->IsEventSelected() & AliVEvent::kMB)hTriggerClassSelected->Fill(0);
3349 if (fInputHandler->IsEventSelected() & AliVEvent::kINT7)hTriggerClassSelected->Fill(1);
3350 if (fInputHandler->IsEventSelected() & AliVEvent::kMUON)hTriggerClassSelected->Fill(2);
3351 if (fInputHandler->IsEventSelected() & AliVEvent::kHighMult)hTriggerClassSelected->Fill(3);
3352 if (fInputHandler->IsEventSelected() & AliVEvent::kEMC1)hTriggerClassSelected->Fill(4);
3353 if (fInputHandler->IsEventSelected() & AliVEvent::kCINT5)hTriggerClassSelected->Fill(5);
3354 if (fInputHandler->IsEventSelected() & AliVEvent::kCMUS5)hTriggerClassSelected->Fill(6);
3355 if (fInputHandler->IsEventSelected() & AliVEvent::kMUSPB)hTriggerClassSelected->Fill(6);
3356 if (fInputHandler->IsEventSelected() & AliVEvent::kMUSH7)hTriggerClassSelected->Fill(7);
3357 if (fInputHandler->IsEventSelected() & AliVEvent::kMUSHPB)hTriggerClassSelected->Fill(7);
3358 if (fInputHandler->IsEventSelected() & AliVEvent::kMUL7)hTriggerClassSelected->Fill(8);
3359 if (fInputHandler->IsEventSelected() & AliVEvent::kMuonLikePB)hTriggerClassSelected->Fill(8);
3360 if (fInputHandler->IsEventSelected() & AliVEvent::kMUU7)hTriggerClassSelected->Fill(9);
3361 if (fInputHandler->IsEventSelected() & AliVEvent::kMuonUnlikePB)hTriggerClassSelected->Fill(9);
3362 if (fInputHandler->IsEventSelected() & AliVEvent::kEMC7)hTriggerClassSelected->Fill(10);
3363 if (fInputHandler->IsEventSelected() & AliVEvent::kEMC8)hTriggerClassSelected->Fill(10);
3364 if (fInputHandler->IsEventSelected() & AliVEvent::kMUS7)hTriggerClassSelected->Fill(11);
3365 if (fInputHandler->IsEventSelected() & AliVEvent::kPHI1)hTriggerClassSelected->Fill(12);
3366 if (fInputHandler->IsEventSelected() & AliVEvent::kPHI7)hTriggerClassSelected->Fill(13);
3367 if (fInputHandler->IsEventSelected() & AliVEvent::kPHI8)hTriggerClassSelected->Fill(13);
3368 if (fInputHandler->IsEventSelected() & AliVEvent::kPHOSPb)hTriggerClassSelected->Fill(13);
3369 if (fInputHandler->IsEventSelected() & AliVEvent::kEMCEJE)hTriggerClassSelected->Fill(14);
3370 if (fInputHandler->IsEventSelected() & AliVEvent::kEMCEGA)hTriggerClassSelected->Fill(15);
3371 if (fInputHandler->IsEventSelected() & AliVEvent::kCentral)hTriggerClassSelected->Fill(16);
3372 if (fInputHandler->IsEventSelected() & AliVEvent::kSemiCentral)hTriggerClassSelected->Fill(17);
3373 if (fInputHandler->IsEventSelected() & AliVEvent::kDG5)hTriggerClassSelected->Fill(18);
3374 if (fInputHandler->IsEventSelected() & AliVEvent::kZED)hTriggerClassSelected->Fill(19);
3375 if (fInputHandler->IsEventSelected() & AliVEvent::kSPI7)hTriggerClassSelected->Fill(20);
3376 if (fInputHandler->IsEventSelected() & AliVEvent::kSPI)hTriggerClassSelected->Fill(20);
3377 if (fInputHandler->IsEventSelected() & AliVEvent::kINT8)hTriggerClassSelected->Fill(21);
3378 if (fInputHandler->IsEventSelected() & AliVEvent::kMuonSingleLowPt8)hTriggerClassSelected->Fill(22);
3379 if (fInputHandler->IsEventSelected() & AliVEvent::kMuonSingleHighPt8)hTriggerClassSelected->Fill(23);
3380 if (fInputHandler->IsEventSelected() & AliVEvent::kMuonLikeLowPt8)hTriggerClassSelected->Fill(24);
3381 if (fInputHandler->IsEventSelected() & AliVEvent::kMuonUnlikeLowPt8)hTriggerClassSelected->Fill(25);
3382 if (fInputHandler->IsEventSelected() & AliVEvent::kMuonUnlikeLowPt0)hTriggerClassSelected->Fill(26);
3383 if (fInputHandler->IsEventSelected() & AliVEvent::kUserDefined)hTriggerClassSelected->Fill(27);
3384 if (fInputHandler->IsEventSelected() & AliVEvent::kTRD)hTriggerClassSelected->Fill(28);
3385 if (fInputHandler->IsEventSelected() & AliVEvent::kFastOnly)hTriggerClassSelected->Fill(29);
3386 if (fInputHandler->IsEventSelected() & AliVEvent::kAnyINT)hTriggerClassSelected->Fill(30);
3387 if (fInputHandler->IsEventSelected() & AliVEvent::kAny)hTriggerClassSelected->Fill(31);
3390 if(!isSelected)return kFALSE;
3396 ///________________________________________________________________________
3397 Int_t AliConversionCuts::GetFirstTPCRow(Double_t radius){
3398 // Get first TPC row
3399 Int_t firstTPCRow = 0;
3400 Double_t radiusI = 84.8;
3401 Double_t radiusO = 134.6;
3402 Double_t radiusOB = 198.;
3403 Double_t rSizeI = 0.75;
3404 Double_t rSizeO = 1.;
3405 Double_t rSizeOB = 1.5;
3409 if(radius <= radiusI){
3412 if(radius>radiusI && radius<=radiusO){
3413 firstTPCRow = (Int_t)((radius-radiusI)/rSizeI);
3415 if(radius>radiusO && radius<=radiusOB){
3416 firstTPCRow = (Int_t)(nClsI+(radius-radiusO)/rSizeO);
3419 if(radius>radiusOB){
3420 firstTPCRow =(Int_t)(nClsIO+(radius-radiusOB)/rSizeOB);
3426 Bool_t AliConversionCuts::CosinePAngleCut(const AliConversionPhotonBase * photon, AliVEvent * event) const {
3427 ///Check if passes cosine of pointing angle cut
3428 if(GetCosineOfPointingAngle(photon, event) < (TMath::Cos(fCosPAngleCut))){
3434 Double_t AliConversionCuts::GetCosineOfPointingAngle( const AliConversionPhotonBase * photon, AliVEvent * event) const{
3435 // calculates the pointing angle of the recalculated V0
3437 Double_t momV0[3] = {0,0,0};
3438 if(event->IsA()==AliESDEvent::Class()){
3439 AliESDEvent *esdEvent = dynamic_cast<AliESDEvent*>(event);
3440 if(!esdEvent) return -999;
3441 AliESDv0 *v0 = esdEvent->GetV0(photon->GetV0Index());
3442 if(!v0) return -999;
3443 v0->GetPxPyPz(momV0[0],momV0[1],momV0[2]);
3445 if(event->IsA()==AliAODEvent::Class()){
3446 momV0[0] = photon->GetPx();
3447 momV0[1] = photon->GetPy();
3448 momV0[2] = photon->GetPz();
3451 //Double_t momV0[3] = { photon->GetPx(), photon->GetPy(), photon->GetPz() }; //momentum of the V0
3452 Double_t PosV0[3] = { photon->GetConversionX() - event->GetPrimaryVertex()->GetX(),
3453 photon->GetConversionY() - event->GetPrimaryVertex()->GetY(),
3454 photon->GetConversionZ() - event->GetPrimaryVertex()->GetZ() }; //Recalculated V0 Position vector
3456 Double_t momV02 = momV0[0]*momV0[0] + momV0[1]*momV0[1] + momV0[2]*momV0[2];
3457 Double_t PosV02 = PosV0[0]*PosV0[0] + PosV0[1]*PosV0[1] + PosV0[2]*PosV0[2];
3460 Double_t cosinePointingAngle = -999;
3461 if(momV02*PosV02 > 0.0)
3462 cosinePointingAngle = (PosV0[0]*momV0[0] + PosV0[1]*momV0[1] + PosV0[2]*momV0[2] ) / TMath::Sqrt(momV02 * PosV02);
3464 return cosinePointingAngle;
3467 ///________________________________________________________________________
3468 Bool_t AliConversionCuts::PsiPairCut(const AliConversionPhotonBase * photon, Double_t deltaPhi) const {
3470 // cout << fDo2DPsiPair << "\t" << fPsiPairCut << "\t" << fPsiPairDeltaPhiCut << endl;
3474 if ( (deltaPhi > 0 && deltaPhi < fPsiPairDeltaPhiCut) &&
3475 TMath::Abs(photon->GetPsiPair()) < ( fPsiPairCut - fPsiPairCut/fPsiPairDeltaPhiCut * deltaPhi ) ) return kTRUE;
3478 if(abs(photon->GetPsiPair()) > fPsiPairCut){
3484 ///________________________________________________________________________
3485 TString AliConversionCuts::GetCutNumber(){
3486 // returns TString with current cut number
3488 for(Int_t ii=0;ii<kNCuts;ii++){
3489 a.Append(Form("%d",fCuts[ii]));
3494 ///________________________________________________________________________
3495 void AliConversionCuts::FillElectonLabelArray(AliAODConversionPhoton* photon, Int_t nV0){
3497 Int_t posLabel = photon->GetTrackLabelPositive();
3498 Int_t negLabel = photon->GetTrackLabelNegative();
3500 fElectronLabelArray[nV0*2] = posLabel;
3501 fElectronLabelArray[(nV0*2)+1] = negLabel;
3503 ///________________________________________________________________________
3504 Bool_t AliConversionCuts::RejectSharedElectronV0s(AliAODConversionPhoton* photon, Int_t nV0, Int_t nV0s){
3506 Int_t posLabel = photon->GetTrackLabelPositive();
3507 Int_t negLabel = photon->GetTrackLabelNegative();
3509 for(Int_t i = 0; i<nV0s*2;i++){
3510 if(i==nV0*2) continue;
3511 if(i==(nV0*2)+1) continue;
3512 if(fElectronLabelArray[i] == posLabel){
3514 if(fElectronLabelArray[i] == negLabel){
3520 ///________________________________________________________________________
3521 Bool_t AliConversionCuts::RejectToCloseV0s(AliAODConversionPhoton* photon, TList *photons, Int_t nV0){
3524 Double_t posX = photon->GetConversionX();
3525 Double_t posY = photon->GetConversionY();
3526 Double_t posZ = photon->GetConversionZ();
3528 for(Int_t i = 0;i<photons->GetEntries();i++){
3529 if(nV0 == i) continue;
3530 AliAODConversionPhoton *photonComp = (AliAODConversionPhoton*) photons->At(i);
3531 Double_t posCompX = photonComp->GetConversionX();
3532 Double_t posCompY = photonComp->GetConversionY();
3533 Double_t posCompZ = photonComp->GetConversionZ();
3535 Double_t dist = pow((posX - posCompX),2)+pow((posY - posCompY),2)+pow((posZ - posCompZ),2);
3537 if(dist < fminV0Dist*fminV0Dist){
3538 if(photon->GetChi2perNDF() < photonComp->GetChi2perNDF()) return kTRUE;
3546 ///________________________________________________________________________
3547 void AliConversionCuts::GetNotRejectedParticles(Int_t rejection, TList *HeaderList, AliVEvent *MCEvent){
3551 if(fNotRejectedStart){
3552 delete[] fNotRejectedStart;
3553 fNotRejectedStart = NULL;
3555 if(fNotRejectedEnd){
3556 delete[] fNotRejectedEnd;
3557 fNotRejectedEnd = NULL;
3559 if(fGeneratorNames){
3560 delete[] fGeneratorNames;
3561 fGeneratorNames = NULL;
3564 if(rejection == 0) return; // No Rejection
3566 AliGenCocktailEventHeader *cHeader = 0x0;
3567 AliAODMCHeader *cHeaderAOD = 0x0;
3568 Bool_t headerFound = kFALSE;
3570 if(MCEvent->IsA()==AliMCEvent::Class()){
3571 cHeader = dynamic_cast<AliGenCocktailEventHeader*>(dynamic_cast<AliMCEvent*>(MCEvent)->GenEventHeader());
3572 if(cHeader) headerFound = kTRUE;
3574 if(MCEvent->IsA()==AliAODEvent::Class()){ // MCEvent is a AODEvent in case of AOD
3575 cHeaderAOD = dynamic_cast<AliAODMCHeader*>(MCEvent->FindListObject(AliAODMCHeader::StdBranchName()));
3576 if(cHeaderAOD) headerFound = kTRUE;
3580 TList *genHeaders = 0x0;
3581 if(cHeader) genHeaders = cHeader->GetHeaders();
3583 genHeaders = cHeaderAOD->GetCocktailHeaders();
3584 if(genHeaders->GetEntries()==1){
3585 SetRejectExtraSignalsCut(0);
3589 AliGenEventHeader* gh = 0;
3591 if(rejection == 1 || rejection == 3) fnHeaders = 1; // MinBiasHeader
3592 if(rejection == 2){ // TList of Headers Names
3593 for(Int_t i = 0; i<genHeaders->GetEntries();i++){
3594 gh = (AliGenEventHeader*)genHeaders->At(i);
3595 TString GeneratorName = gh->GetName();
3596 for(Int_t j = 0; j<HeaderList->GetEntries();j++){
3597 TString GeneratorInList = ((TObjString*)HeaderList->At(j))->GetString();
3598 if(GeneratorName.CompareTo(GeneratorInList) == 0){
3606 fNotRejectedStart = new Int_t[fnHeaders];
3607 fNotRejectedEnd = new Int_t[fnHeaders];
3608 fGeneratorNames = new TString[fnHeaders];
3610 if(rejection == 1 || rejection == 3){
3611 fNotRejectedStart[0] = 0;
3612 fNotRejectedEnd[0] = ((AliGenEventHeader*)genHeaders->At(0))->NProduced()-1;
3613 fGeneratorNames[0] = ((AliGenEventHeader*)genHeaders->At(0))->GetName();
3617 Int_t firstindex = 0;
3618 Int_t lastindex = -1;
3620 for(Int_t i = 0; i<genHeaders->GetEntries();i++){
3621 gh = (AliGenEventHeader*)genHeaders->At(i);
3622 TString GeneratorName = gh->GetName();
3623 lastindex = lastindex + gh->NProduced();
3624 for(Int_t j = 0; j<HeaderList->GetEntries();j++){
3625 TString GeneratorInList = ((TObjString*)HeaderList->At(j))->GetString();
3626 if(GeneratorName.CompareTo(GeneratorInList) == 0){
3627 fNotRejectedStart[nummer] = firstindex;
3628 fNotRejectedEnd[nummer] = lastindex;
3629 fGeneratorNames[nummer] = GeneratorName;
3630 //cout << "Number of particles produced for: " << i << "\t" << GeneratorName.Data() << "\t" << lastindex-firstindex+1 << endl;
3635 firstindex = firstindex + gh->NProduced();
3637 } else { // No Cocktail Header Found
3638 fNotRejectedStart = new Int_t[1];
3639 fNotRejectedEnd = new Int_t[1];
3642 fNotRejectedStart[0] = 0;
3643 fNotRejectedEnd[0] = static_cast<AliMCEvent*>(MCEvent)->Stack()->GetNprimary()-1;
3644 fGeneratorNames = new TString[1];
3645 fGeneratorNames[0] = "NoCocktailGeneratorFound";
3647 AliGenPythiaEventHeader *mcHeaderPythia = dynamic_cast<AliGenPythiaEventHeader*>(static_cast<AliMCEvent*>(MCEvent)->GenEventHeader());
3648 if (mcHeaderPythia) fGeneratorNames[0] = "NoCocktailGeneratorFound_Pythia";
3649 AliGenDPMjetEventHeader *mcHeaderPhojet = dynamic_cast<AliGenDPMjetEventHeader*>(static_cast<AliMCEvent*>(MCEvent)->GenEventHeader());
3650 if (mcHeaderPhojet) fGeneratorNames[0] = "NoCocktailGeneratorFound_Phojet";
3651 AliGenHijingEventHeader *mcHeaderHijing = dynamic_cast<AliGenHijingEventHeader*>(static_cast<AliMCEvent*>(MCEvent)->GenEventHeader());
3652 if (mcHeaderHijing) fGeneratorNames[0] = "NoCocktailGeneratorFound_Hijing";
3654 SetRejectExtraSignalsCut(0);
3658 //_________________________________________________________________________
3659 Int_t AliConversionCuts::IsParticleFromBGEvent(Int_t index, AliStack *MCStack, AliVEvent *InputEvent){
3661 // Not Accepted == kFALSE == 0
3662 // Accepted == kTRUE == 1
3663 // FirstHeader == kTRUE == 3
3664 if(index < 0) return 0; // No Particle
3667 if(!InputEvent || InputEvent->IsA()==AliESDEvent::Class()){
3668 if( index >= MCStack->GetNprimary()){ // Secondary Particle
3669 if( ((TParticle*)MCStack->Particle(index))->GetMother(0) < 0) return 1; // Secondary Particle without Mother??
3670 return IsParticleFromBGEvent(((TParticle*)MCStack->Particle(index))->GetMother(0),MCStack,InputEvent);
3672 for(Int_t i = 0;i<fnHeaders;i++){
3673 if(index >= fNotRejectedStart[i] && index <= fNotRejectedEnd[i]){
3675 if(i == 0) accepted = 2; // MB Header
3679 else if(InputEvent->IsA()==AliAODEvent::Class()){
3680 TClonesArray *AODMCTrackArray = dynamic_cast<TClonesArray*>(InputEvent->FindListObject(AliAODMCParticle::StdBranchName()));
3681 AliAODMCParticle *aodMCParticle = static_cast<AliAODMCParticle*>(AODMCTrackArray->At(index));
3682 if(!aodMCParticle) return 1; // Photon Without a Mother ? --> Accepted
3683 if(!aodMCParticle->IsPrimary()){
3684 if( aodMCParticle->GetMother() < 0) return 1;// Secondary Particle without Mother??
3685 return IsParticleFromBGEvent(aodMCParticle->GetMother(),MCStack,InputEvent);
3687 index = abs(static_cast<AliAODMCParticle*>(AODMCTrackArray->At(index))->GetLabel());
3688 for(Int_t i = 0;i<fnHeaders;i++){
3689 if(index >= fNotRejectedStart[i] && index <= fNotRejectedEnd[i]){
3691 if(i == 0) accepted = 2; // MB Header
3698 //_________________________________________________________________________
3699 Int_t AliConversionCuts::IsEventAcceptedByConversionCut(AliConversionCuts *ReaderCuts, AliVEvent *InputEvent, AliMCEvent *MCEvent, Bool_t isHeavyIon){
3701 if ( !IsTriggerSelected(InputEvent) )
3704 if(isHeavyIon && !(IsCentralitySelected(InputEvent,MCEvent)))
3705 return 1; // Check Centrality --> Not Accepted => eventQuality = 1
3707 if(!isHeavyIon && GetIsFromPileup()){
3708 if(InputEvent->IsPileupFromSPD(3,0.8,3.,2.,5.)){
3710 return 6; // Check Pileup --> Not Accepted => eventQuality = 6
3714 Bool_t hasV0And = ReaderCuts->HasV0AND();
3715 Bool_t isSDDFired = ReaderCuts->IsSDDFired();
3716 if( (IsSpecialTrigger() == 2 || IsSpecialTrigger() == 3) && !isSDDFired && !MCEvent)
3717 return 7; // With SDD requested but no fired
3719 if( (IsSpecialTrigger() == 1 || IsSpecialTrigger() == 3) && !hasV0And)
3720 return 8; // V0AND requested but no fired
3725 //_________________________________________________________________________
3726 Float_t AliConversionCuts::GetWeightForMeson(TString period, Int_t index, AliStack *MCStack, AliVEvent *InputEvent){
3727 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.Contains("LHC13d2"))) return 1.;
3730 for (Int_t i = 0; i < fnHeaders; i++){
3731 if (index >= fNotRejectedStart[i] && index < fNotRejectedEnd[i]+1){
3732 if (fGeneratorNames[i].CompareTo("Pythia") == 0){
3734 } else if (fGeneratorNames[i].CompareTo("DPMJET") == 0){
3736 } else if (fGeneratorNames[i].CompareTo("HIJING") == 0 ||
3737 fGeneratorNames[i].CompareTo("Hijing") == 0 ||
3738 fGeneratorNames[i].Contains("hijing")){
3740 } else if (fGeneratorNames[i].CompareTo("BOX") == 0){
3742 } else if (fGeneratorNames[i].CompareTo("PARAM") == 0){
3744 } else if (fGeneratorNames[i].CompareTo("NoCocktailGeneratorFound") == 0){
3746 } else if (fGeneratorNames[i].CompareTo("NoCocktailGeneratorFound_Pythia") == 0){
3748 } else if (fGeneratorNames[i].CompareTo("NoCocktailGeneratorFound_Phojet") == 0){
3750 } else if (fGeneratorNames[i].CompareTo("NoCocktailGeneratorFound_Hijing") == 0){
3753 if (period.Contains("LHC13d2")){
3758 if (kCaseGen == 0) return 1;
3761 Double_t mesonPt = 0;
3762 Double_t mesonMass = 0;
3764 if(!InputEvent || InputEvent->IsA()==AliESDEvent::Class()){
3765 mesonPt = ((TParticle*)MCStack->Particle(index))->Pt();
3766 mesonMass = ((TParticle*)MCStack->Particle(index))->GetCalcMass();
3767 PDGCode = ((TParticle*)MCStack->Particle(index))->GetPdgCode();
3769 else if(InputEvent->IsA()==AliAODEvent::Class()){
3770 TClonesArray *AODMCTrackArray = dynamic_cast<TClonesArray*>(InputEvent->FindListObject(AliAODMCParticle::StdBranchName()));
3771 AliAODMCParticle *aodMCParticle = static_cast<AliAODMCParticle*>(AODMCTrackArray->At(index));
3772 mesonPt = aodMCParticle->Pt();
3773 mesonMass = aodMCParticle->GetCalcMass();
3774 PDGCode = aodMCParticle->GetPdgCode();
3777 Float_t functionResultMC = 1.;
3778 if (kCaseGen == 1){ // Pythia 6
3779 Float_t dNdyMC = 2.1462;
3780 Float_t nMC = 7.06055;
3781 Float_t tMC = 0.12533;
3782 if ( PDGCode == 111){
3786 } else if ( PDGCode == 221){
3791 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);
3792 } else if (kCaseGen == 2){ // Phojet
3793 Float_t dNdyMC = 2.35978;
3794 Float_t nMC = 6.81795;
3795 Float_t tMC = 0.11492;
3796 if ( PDGCode == 111){
3800 } else if ( PDGCode == 221){
3805 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);
3806 } else if (kCaseGen == 4){ // BOX generators pp
3807 // functionResultMC = 1./sqrt(1.-mesonMass*mesonMass/((mesonMass*mesonMass+mesonPt*mesonPt)*cosh(mesonY)*cosh(mesonY)));
3808 Float_t a = 0.23437;
3810 Float_t c = -1430.5863;
3811 Float_t d = -0.6966624;
3812 Float_t e = 252.3742;
3813 if ( PDGCode == 111){
3819 } else if ( PDGCode == 221){
3826 functionResultMC = a*TMath::Power(mesonPt,-1.*(b+c/(TMath::Power(mesonPt,d)+e)))*1./mesonPt *1./1.6 *1./(2.* TMath::Pi());
3827 // cout << functionResultMC << endl;
3828 } else if (kCaseGen == 3 ){ // HIJING
3829 if ( PDGCode == 111 && fDoReweightHistoMCPi0 && hReweightMCHistPi0!= 0x0){
3830 functionResultMC = hReweightMCHistPi0->Interpolate(mesonPt);
3832 if ( PDGCode == 221 && fDoReweightHistoMCEta && hReweightMCHistEta!= 0x0){
3833 functionResultMC = hReweightMCHistEta->Interpolate(mesonPt);
3835 if ( PDGCode == 310 && fDoReweightHistoMCK0s && hReweightMCHistK0s!= 0x0){
3836 functionResultMC = hReweightMCHistK0s->Interpolate(mesonPt);
3840 Float_t functionResultData = 1;
3841 if (kCaseGen == 1 || kCaseGen == 2 || kCaseGen == 4 ){
3842 Float_t dNdyData = 2.2328;
3843 Float_t nData = 7.1473;
3844 Float_t tData = 0.1346;
3845 if ( PDGCode == 111){
3849 } else if ( PDGCode == 221){
3850 dNdyData = 0.38992; //be careful this fit is not optimal, eta in data still has problems
3854 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);
3855 // cout << functionResultData << endl;
3857 if ( PDGCode == 111 && fDoReweightHistoMCPi0 && fFitDataPi0!= 0x0){
3858 functionResultData = fFitDataPi0->Eval(mesonPt);
3860 if ( PDGCode == 221 && fDoReweightHistoMCEta && fFitDataEta!= 0x0){
3861 functionResultData = fFitDataEta->Eval(mesonPt);
3863 if ( PDGCode == 310 && fDoReweightHistoMCK0s && fFitDataK0s!= 0x0){
3864 functionResultData = fFitDataK0s->Eval(mesonPt);
3872 // if ( PDGCode == 111 ){
3873 // if (fModCentralityClass == 1 && fCentralityMin == 0 && fCentralityMax == 1 ){ // 0-5 % PbPb
3874 // a = 25.8747458223;
3875 // b = 5.8761820045;
3876 // c = -33.9928191673;
3877 // d = 3.0731850142;
3878 // e = 13.2500447620;
3879 // } else if (fModCentralityClass == 1 && fCentralityMin == 1 && fCentralityMax == 2){ // 5-10% PbPb
3880 // a = 21.7518148922;
3881 // b = 5.8441200081;
3882 // c = -17.1497051691;
3883 // d = 2.3799090842;
3884 // e = 5.4346404718;
3885 // } else if (fModCentralityClass == 0 && fCentralityMin == 0 && fCentralityMax == 1){ // 0-10% PbPb
3886 // a = 22.9852133622;
3887 // b = 5.8602063916;
3888 // c = -17.0992478654;
3889 // d = 2.4426218039;
3890 // e = 5.1194526345;
3891 // } else if (fModCentralityClass == 0 && fCentralityMin == 1 && fCentralityMax == 2){ // 10-20% PbPb
3892 // a = 19.3237333776;
3893 // b = 5.8145906958;
3894 // c = -13.8316665424;
3895 // d = 2.3737630637;
3896 // e = 4.7690300693;
3897 // } else if (fModCentralityClass == 0 && fCentralityMin == 2 && fCentralityMax == 4){ // 20-40% PbPb
3898 // a = 11.2656032751;
3899 // b = 5.8003194354;
3900 // c = -13.3936105929;
3901 // d = 2.3371452334;
3902 // e = 4.4726244958;
3903 // } else if (fModCentralityClass == 0 && fCentralityMin == 4 && fCentralityMax == 6){ // 40-60% PbPb
3904 // a = 4.1578154081;
3905 // b = 5.6450005163;
3906 // c = -8.4309375240;
3907 // d = 1.8918308704;
3908 // e = 2.9429194709;
3909 // } else if (fModCentralityClass == 0 && fCentralityMin == 6 && fCentralityMax == 8){ // 60-80% PbPb
3910 // a = 1.0635443810;
3911 // b = 5.1337469970;
3912 // c = -8.5906997238;
3913 // d = 2.9794995997;
3914 // e = 3.9294980048;
3915 // } else if (fModCentralityClass == 0 && fCentralityMin == 0 && fCentralityMax == 2){ // 0-20% PbPb
3916 // a = 21.7018745556;
3917 // b = 5.9019352094;
3918 // c = -14.2295510326;
3919 // d = 2.2104490688;
3920 // e = 4.2969671500;
3921 // } else if (fModCentralityClass == 0 && fCentralityMin == 0 && fCentralityMax == 4){ // 0-40% PbPb
3922 // a = 16.8227412106;
3923 // b = 5.8660502207;
3924 // c = -12.0978551215;
3925 // d = 2.1695068981;
3926 // e = 3.5349621182;
3927 // } else if (fModCentralityClass == 0 && fCentralityMin == 0 && fCentralityMax == 8){ // 0-80% PbPb
3928 // a = 9.4675681080;
3929 // b = 5.8114944205;
3930 // c = -10.4901523616;
3931 // d = 2.0607982712;
3932 // e = 2.9262259130;
3933 // } else if (fModCentralityClass == 0 && fCentralityMin == 4 && fCentralityMax == 8){ // 60-80% PbPb
3934 // a = 2.5985551785;
3935 // b = 5.4118895738;
3936 // c = -8.2510958428;
3937 // d = 2.2551249190;
3938 // e = 3.0700919491;
3941 // functionResultData = a*TMath::Power(mesonPt,-1*(b+c/(TMath::Power(mesonPt,d)+e)));
3946 Double_t weight = 1;
3947 if (PDGCode == 111 || PDGCode == 221){
3948 if (functionResultData != 0. && functionResultMC != 0. && isfinite(functionResultData) && isfinite(functionResultMC)){
3949 weight = functionResultData/functionResultMC;
3950 if ( kCaseGen == 3){
3951 if (!(fDoReweightHistoMCPi0 && hReweightMCHistPi0!= 0x0 && PDGCode == 111)){
3955 if (!isfinite(functionResultData)) weight = 1.;
3956 if (!isfinite(weight)) weight = 1.;
3958 } else if (PDGCode == 310 && functionResultMC != 0 && isfinite(functionResultMC)){
3959 weight = functionResultMC;
3962 // if (fModCentralityClass == 0 && fCentralityMin == 4 && fCentralityMax == 6 && PDGCode == 111){
3963 // cout << period.Data() << "\t" << kCaseGen << "\t" <<fModCentralityClass<< "\t" <<fCentralityMin<< "\t" <<fCentralityMax << "\t" << mesonPt << "\t" <<mesonMass<< "\t"<<functionResultData << "\t"<< functionResultMC << "\t" << weight <<endl;
3967 ///________________________________________________________________________
3968 AliConversionCuts* AliConversionCuts::GetStandardCuts2010PbPb(){
3969 //Create and return standard 2010 PbPb cuts
3970 AliConversionCuts *cuts=new AliConversionCuts("StandardCuts2010PbPb","StandardCuts2010PbPb");
3971 if(!cuts->InitializeCutsFromCutString("100000204209297002322000000")){
3972 cout<<"Warning: Initialization of Standardcuts2010PbPb failed"<<endl;}
3976 ///________________________________________________________________________
3977 AliConversionCuts* AliConversionCuts::GetStandardCuts2010pp(){
3978 //Create and return standard 2010 PbPb cuts
3979 AliConversionCuts *cuts=new AliConversionCuts("StandardCuts2010pp","StandardCuts2010pp");
3980 if(!cuts->InitializeCutsFromCutString("000001100209366300380000000")){
3981 cout<<"Warning: Initialization of Standardcuts2010pp failed"<<endl;}
3984 ///________________________________________________________________________
3985 void AliConversionCuts::GetCorrectEtaShiftFromPeriod(TString periodName){
3987 if(periodName.CompareTo("LHC12g") == 0 || //pilot run 2012
3988 periodName.CompareTo("LHC13b") == 0 || //mainly minimum bias
3989 periodName.CompareTo("LHC13c") == 0 || //mainly minimum bias
3990 periodName.CompareTo("LHC13d") == 0 || //mainly triggered
3991 periodName.CompareTo("LHC13e") == 0 || //mainly triggered
3992 periodName.CompareTo("LHC13c3") == 0 || //MC Starlight, anchor LHC13d+e
3993 periodName.CompareTo("LHC13c2") == 0 || //MC Starlight, coherent J/Psi, UPC muon anchor LHC13d+e
3994 periodName.CompareTo("LHC13b4") == 0 || //MC Pythia 6 (Jet-Jet), anchor LHC13b
3995 periodName.CompareTo("LHC13b2_fix_1") == 0 || //MC DPMJET, anchr LHC13b+c
3996 periodName.CompareTo("LHC13b2_efix_p1") == 0 || //MC DPMJET, anchr LHC13b+c
3997 periodName.CompareTo("LHC13b2_efix_p2") == 0 || //MC DPMJET, anchr LHC13b+c
3998 periodName.CompareTo("LHC13b2_efix_p3") == 0 || //MC DPMJET, anchr LHC13b+c
3999 periodName.CompareTo("LHC13b2_efix_p4") == 0 || //MC DPMJET, anchr LHC13b+c
4000 periodName.CompareTo("LHC13b3") == 0 || //MC HIJING, weighted to number of events per run, anchor LHC13b
4001 periodName.CompareTo("LHC13b2") == 0 || // MC DPMJET, wrong energy, anchor LHC13b
4002 periodName.CompareTo("LHC13b2_plus") == 0 || // MC DPMJET, weighted to number event per run, anchor LHC13b
4003 periodName.CompareTo("LHC13c1_bis") == 0 || // MC AMPT fast generation, pT hardbin, anchor ?
4004 periodName.CompareTo("LHC13c1") == 0 || // MC AMPT fast generation, anchor ?
4005 periodName.CompareTo("LHC13b1") == 0 || // MC DPMJET, fragments, with fixed label 0, anchor LHC12g
4006 periodName.CompareTo("LHC12g4b_fix") == 0 || // MC DPMJET, with fixed label 0, anchor LHC12g
4007 periodName.CompareTo("LHC12g1_fix") == 0 || // MC ?, with fixed label 0, anchor LHC12g
4008 periodName.CompareTo("LHC12g4c") == 0 || // MC DPMJET, shifted vertex runs, anchor LHC12g
4009 periodName.CompareTo("LHC12h6") == 0 || // MC muon cocktail, anchor LHC12g
4010 periodName.CompareTo("LHC12g4b") == 0 || // MC DPMJET 3rd iteration, anchor LHC12g
4011 periodName.CompareTo("LHC12g4a") == 0 || // MC DPMJET improved, anchor LHC12g
4012 periodName.CompareTo("LHC12g4") == 0 || // MC DPMJET, anchor LHC12g
4013 periodName.CompareTo("LHC12g5") == 0 || // MC PHOJET, anchor LHC12g
4014 periodName.CompareTo("LHC12g2") == 0 || // MC Starlight background, anchor LHC12g
4015 periodName.CompareTo("LHC12g1") == 0 ) // MC ?, anchor LHC12g
4017 printf(" Gamma Conversion Cuts %s :: pPb Run doing Eta Shift of %f \n\n",(GetCutNumber()).Data(),-0.465);
4018 SetEtaShift(-0.465);
4020 else if(periodName.CompareTo("LHC13f") == 0 ||
4021 periodName.CompareTo("LHC13c6b") == 0 ||// MC Jpsi -> mumu, anchor LHC13f
4022 periodName.CompareTo("LHC13c5") == 0 || //MC Starlight, gamma gamma UPC muon, anchor LHC13f
4023 periodName.CompareTo("LHC13c4") == 0 )//MC Starlight, coherent JPsi, UPC muon, anchor LHC13f
4025 printf(" Gamma Conversion Cuts %s :: Pbp Run doing Eta Shift of %f \n\n",(GetCutNumber()).Data(),0.465);
4026 SetEtaShift(+0.465);
4028 else printf(" Gamma Conversion Cuts %s :: Automatic Eta Shift requested but Period is not known -> No Shift \n\n",(GetCutNumber()).Data());