Changed AddTasks
[u/mrichter/AliRoot.git] / PWGGA / GammaConv / AliConversionCuts.cxx
CommitLineData
3b77b2d1 1/**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
aff90284 3 * *
4 * Authors: Svein Lindal, Daniel Lohner *
5 * Version 1.0 *
6 * *
fcc79cf5 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 *
aff90284 12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
3b77b2d1 14 **************************************************************************/
15
16////////////////////////////////////////////////
e5b6e8a6 17//---------------------------------------------
3b77b2d1 18// Class handling all kinds of selection cuts for
19// Gamma Conversion analysis
20//---------------------------------------------
21////////////////////////////////////////////////
22
23#include "AliConversionCuts.h"
24
25#include "AliKFVertex.h"
26#include "AliAODTrack.h"
27#include "AliESDtrack.h"
28#include "AliAnalysisManager.h"
29#include "AliInputEventHandler.h"
92efd725 30#include "AliMCEventHandler.h"
3b77b2d1 31#include "AliAODHandler.h"
32#include "AliPIDResponse.h"
33#include "TH1.h"
34#include "TH2.h"
aff90284 35#include "TF1.h"
3b77b2d1 36#include "AliStack.h"
37#include "AliAODConversionMother.h"
38#include "TObjString.h"
39#include "AliAODEvent.h"
40#include "AliESDEvent.h"
41#include "AliCentrality.h"
42#include "TList.h"
ae947965 43#include "TFile.h"
92efd725 44#include "AliLog.h"
ca91a3e1 45#include "AliGenCocktailEventHeader.h"
a280ac15 46#include "AliGenDPMjetEventHeader.h"
47#include "AliGenPythiaEventHeader.h"
48#include "AliGenHijingEventHeader.h"
e5b6e8a6 49#include "AliTriggerAnalysis.h"
50#include "AliV0ReaderV1.h"
ae947965 51#include "AliAODMCParticle.h"
52#include "AliAODMCHeader.h"
92efd725 53
3b77b2d1 54class iostream;
55
56using namespace std;
57
58ClassImp(AliConversionCuts)
59
60
61const char* AliConversionCuts::fgkCutNames[AliConversionCuts::kNCuts] = {
4803eb1f 62 "HeavyIon",//0
63 "CentralityMin",//1
64 "CentralityMax",//2
65 "SelectV0AND",//3
66 "MultiplicityMethod",//4
67 "RemovePileUp",//5
68 "RejectExtraSignals",//6
69 "V0FinderType",//7
70 "EtaCut",//8
71 "MinRCut",//9
72 "SinglePtCut",//10
73 "ClsTPCCut", //11
74 "ededxSigmaCut",//12
75 "pidedxSigmaCut",//13
76 "piMomdedxSigmaCut",//14
77 "piMaxMomdedxSigmaCut",//15
78 "LowPRejectionSigmaCut",//16
79 "TOFelectronPID",//17
80 "QtMaxCut",//18
81 "Chi2GammaCut", //19
82 "PsiPair", //20
83 "DoPhotonAsymmetryCut",//21
84 "CosinePointingAngle", //22
85 "SharedElectronCuts", //23
86 "RejectToCloseV0s", //24
87 "DcaRPrimVtx", //25
75f195f2 88 "DcaZPrimVtx", //26
ae4f2cfb 89 "EvetPlane" //27
3b77b2d1 90};
91
92
93//________________________________________________________________________
4a0aab28 94AliConversionCuts::AliConversionCuts(const char *name,const char *title) :
95 AliAnalysisCuts(name,title),
96 fHistograms(NULL),
e5b6e8a6 97 fHeaderList(NULL),
4a0aab28 98 fPIDResponse(NULL),
99 fEventQuality(-1),
100 fMaxR(200),
101 fMinR(0),
102 fEtaCut(0.9),
103 fEtaCutMin(-0.1),
104 fPtCut(0.02),
105 fSinglePtCut(0),
106 fMaxZ(1000),
107 fMinClsTPC(0.),
108 fMinClsTPCToF(0.),
109 fLineCutZRSlope(0.),
110 fLineCutZValue(0),
111 fLineCutZRSlopeMin(0.),
112 fLineCutZValueMin(0),
113 fChi2CutConversion(1000),
114 fPIDProbabilityCutNegativeParticle(0),
115 fPIDProbabilityCutPositiveParticle(0),
116 fDodEdxSigmaCut(kTRUE),
e5b6e8a6 117 fDoTOFsigmaCut(kFALSE),
4a0aab28 118 fPIDTRDEfficiency(1),
119 fDoTRDPID(kFALSE),
120 fPIDnSigmaAboveElectronLine(100),
121 fPIDnSigmaBelowElectronLine(-100),
e5b6e8a6 122 fTofPIDnSigmaAboveElectronLine(100),
123 fTofPIDnSigmaBelowElectronLine(-100),
4a0aab28 124 fPIDnSigmaAbovePionLine(0),
125 fPIDnSigmaAbovePionLineHighPt(-100),
126 fPIDMinPnSigmaAbovePionLine(0),
127 fPIDMaxPnSigmaAbovePionLine(0),
128 fDoKaonRejectionLowP(kFALSE),
129 fDoProtonRejectionLowP(kFALSE),
130 fDoPionRejectionLowP(kFALSE),
131 fPIDnSigmaAtLowPAroundKaonLine(0),
132 fPIDnSigmaAtLowPAroundProtonLine(0),
133 fPIDnSigmaAtLowPAroundPionLine(0),
e5b6e8a6 134 fPIDMinPKaonRejectionLowP(1.5),
135 fPIDMinPProtonRejectionLowP(2),
4a0aab28 136 fPIDMinPPionRejectionLowP(0),
137 fDoQtGammaSelection(kTRUE),
d8b864f8 138 fDo2DQt(kFALSE),
4a0aab28 139 fQtMax(100),
4a0aab28 140 fXVertexCut(0.),
141 fYVertexCut(0.),
142 fZVertexCut(0.),
143 fNSigmaMass(0.),
144 fUseEtaMinCut(kFALSE),
145 fUseOnFlyV0Finder(kTRUE),
146 fDoPhotonAsymmetryCut(kTRUE),
147 fMinPPhotonAsymmetryCut(100.),
148 fMinPhotonAsymmetry(0.),
0a2b2b4b 149 fIsHeavyIon(0),
4a0aab28 150 fDetectorCentrality(0),
151 fModCentralityClass(0),
152 fMaxVertexZ(10),
153 fCentralityMin(0),
154 fCentralityMax(0),
155 fUseCorrectedTPCClsInfo(kFALSE),
156 fUseTOFpid(kFALSE),
157 fMultiplicityMethod(0),
e5b6e8a6 158 fSpecialTrigger(0),
4a0aab28 159 fRemovePileUp(kFALSE),
160 fOpeningAngle(0.005),
161 fPsiPairCut(10000),
d8b864f8 162 fDo2DPsiPairChi2(kFALSE),
4a0aab28 163 fCosPAngleCut(10000),
164 fDoToCloseV0sCut(kFALSE),
165 fRejectExtraSignals(0),
166 fminV0Dist(200.),
167 fDoSharedElecCut(kFALSE),
168 fOfflineTriggerMask(0),
e5b6e8a6 169 fHasV0AND(kTRUE),
170 fIsSDDFired(kTRUE),
4a0aab28 171 fRandom(0),
e5b6e8a6 172 fElectronArraySize(500),
4a0aab28 173 fElectronLabelArray(NULL),
4803eb1f 174 fDCAZPrimVtxCut(1000),
175 fDCARPrimVtxCut(1000),
ae4f2cfb 176 fInPlaneOutOfPlane(0),
e5b6e8a6 177 fConversionPointXArray(0.0),
178 fConversionPointYArray(0.0),
179 fConversionPointZArray(0.0),
180 fnHeaders(0),
4a0aab28 181 fNotRejectedStart(NULL),
182 fNotRejectedEnd(NULL),
183 fGeneratorNames(NULL),
184 fCutString(NULL),
0a2b2b4b 185 fUtils(NULL),
11c1e680 186 fEtaShift(0.0),
187 fDoEtaShift(kFALSE),
ae947965 188 fDoReweightHistoMCPi0(kFALSE),
189 fDoReweightHistoMCEta(kFALSE),
190 fDoReweightHistoMCK0s(kFALSE),
191 fPathTrFReweighting(""),
192 fNameHistoReweightingPi0(""),
193 fNameHistoReweightingEta(""),
194 fNameHistoReweightingK0s(""),
fcc79cf5 195 fNameFitDataPi0(""),
196 fNameFitDataEta(""),
197 fNameFitDataK0s(""),
4a0aab28 198 hdEdxCuts(NULL),
199 hTPCdEdxbefore(NULL),
200 hTPCdEdxafter(NULL),
e5b6e8a6 201 hTPCdEdxSigbefore(NULL),
202 hTPCdEdxSigafter(NULL),
4a0aab28 203 hTOFbefore(NULL),
e5b6e8a6 204 hTOFSigbefore(NULL),
205 hTOFSigafter(NULL),
1390f698 206 hPsiPairDeltaPhiafter(NULL),
4a0aab28 207 hTrackCuts(NULL),
208 hPhotonCuts(NULL),
209 hInvMassbefore(NULL),
210 hArmenterosbefore(NULL),
211 hInvMassafter(NULL),
212 hArmenterosafter(NULL),
213 hAcceptanceCuts(NULL),
214 hCutIndex(NULL),
215 hV0EventCuts(NULL),
216 hCentrality(NULL),
4803eb1f 217 hCentralityVsNumberOfPrimaryTracks(NULL),
4a0aab28 218 hVertexZ(NULL),
ae4f2cfb 219 hEventPlanePhi(NULL),
a280ac15 220 hTriggerClass(NULL),
ae947965 221 hTriggerClassSelected(NULL),
222 hReweightMCHistPi0(NULL),
223 hReweightMCHistEta(NULL),
224 hReweightMCHistK0s(NULL),
fcc79cf5 225 fFitDataPi0(NULL),
226 fFitDataEta(NULL),
227 fFitDataK0s(NULL),
ae947965 228 fPreSelCut(kFALSE),
229 fTriggerSelectedManually(kFALSE),
230 fSpecialTriggerName("")
aff90284 231
3b77b2d1 232{
4a0aab28 233 InitPIDResponse();
234 for(Int_t jj=0;jj<kNCuts;jj++){fCuts[jj]=0;}
235 fCutString=new TObjString((GetCutNumber()).Data());
3b77b2d1 236
e5b6e8a6 237 fElectronLabelArray = new Int_t[fElectronArraySize];
0a2b2b4b 238 fUtils = new AliAnalysisUtils();
239 //if you do not want to apply the cut on the distance between the SPD and TRK vertex:
11c1e680 240 //fUtils->SetCutOnZVertexSPD(kFALSE);
241
ca91a3e1 242
3b77b2d1 243}
244
1d9e6011 245//________________________________________________________________________
246AliConversionCuts::AliConversionCuts(const AliConversionCuts &ref) :
247 AliAnalysisCuts(ref),
248 fHistograms(NULL),
249 fHeaderList(ref.fHeaderList),
250 fPIDResponse(NULL),
251 fEventQuality(ref.fEventQuality),
252 fMaxR(ref.fMaxR),
253 fMinR(ref.fMinR),
254 fEtaCut(ref.fEtaCut),
255 fEtaCutMin(ref.fEtaCutMin),
256 fPtCut(ref.fPtCut),
257 fSinglePtCut(ref.fSinglePtCut),
258 fMaxZ(ref.fMaxZ),
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),
d8b864f8 290 fDo2DQt(ref.fDo2DQt),
1d9e6011 291 fQtMax(ref.fQtMax),
1d9e6011 292 fXVertexCut(ref.fXVertexCut),
293 fYVertexCut(ref.fYVertexCut),
294 fZVertexCut(ref.fZVertexCut),
295 fNSigmaMass(ref.fNSigmaMass),
296 fUseEtaMinCut(ref.fUseEtaMinCut),
297 fUseOnFlyV0Finder(ref.fUseOnFlyV0Finder),
0a2b2b4b 298 fDoPhotonAsymmetryCut(ref.fDoPhotonAsymmetryCut),
1d9e6011 299 fMinPPhotonAsymmetryCut(ref.fMinPPhotonAsymmetryCut),
300 fMinPhotonAsymmetry(ref.fMinPhotonAsymmetry),
301 fIsHeavyIon(ref.fIsHeavyIon),
302 fDetectorCentrality(ref.fDetectorCentrality),
303 fModCentralityClass(ref.fModCentralityClass),
304 fMaxVertexZ(ref.fMaxVertexZ),
305 fCentralityMin(ref.fCentralityMin),
306 fCentralityMax(ref.fCentralityMax),
307 fUseCorrectedTPCClsInfo(ref.fUseCorrectedTPCClsInfo),
308 fUseTOFpid(ref.fUseTOFpid),
309 fMultiplicityMethod(ref.fMultiplicityMethod),
310 fSpecialTrigger(ref.fSpecialTrigger),
311 fRemovePileUp(ref.fRemovePileUp),
312 fOpeningAngle(ref.fOpeningAngle),
313 fPsiPairCut(ref.fPsiPairCut),
d8b864f8 314 fDo2DPsiPairChi2(ref.fDo2DPsiPairChi2),
1d9e6011 315 fCosPAngleCut(ref.fCosPAngleCut),
316 fDoToCloseV0sCut(ref.fDoToCloseV0sCut),
317 fRejectExtraSignals(ref.fRejectExtraSignals),
318 fminV0Dist(ref.fminV0Dist),
319 fDoSharedElecCut(ref.fDoSharedElecCut),
320 fOfflineTriggerMask(ref.fOfflineTriggerMask),
321 fHasV0AND(ref.fHasV0AND),
322 fIsSDDFired(ref.fIsSDDFired),
323 fRandom(ref.fRandom),
324 fElectronArraySize(ref.fElectronArraySize),
325 fElectronLabelArray(NULL),
4803eb1f 326 fDCAZPrimVtxCut(ref.fDCAZPrimVtxCut),
327 fDCARPrimVtxCut(ref.fDCAZPrimVtxCut),
ae4f2cfb 328 fInPlaneOutOfPlane(ref.fInPlaneOutOfPlane),
1d9e6011 329 fConversionPointXArray(ref.fConversionPointXArray),
330 fConversionPointYArray(ref.fConversionPointYArray),
331 fConversionPointZArray(ref.fConversionPointZArray),
332 fnHeaders(ref.fnHeaders),
333 fNotRejectedStart(NULL),
334 fNotRejectedEnd(NULL),
335 fGeneratorNames(ref.fGeneratorNames),
336 fCutString(NULL),
0a2b2b4b 337 fUtils(NULL),
11c1e680 338 fEtaShift(ref.fEtaShift),
339 fDoEtaShift(ref.fDoEtaShift),
ae947965 340 fDoReweightHistoMCPi0(ref.fDoReweightHistoMCPi0),
341 fDoReweightHistoMCEta(ref.fDoReweightHistoMCEta),
342 fDoReweightHistoMCK0s(ref.fDoReweightHistoMCK0s),
343 fPathTrFReweighting(ref.fPathTrFReweighting),
344 fNameHistoReweightingPi0(ref.fNameHistoReweightingPi0),
345 fNameHistoReweightingEta(ref.fNameHistoReweightingEta),
346 fNameHistoReweightingK0s(ref.fNameHistoReweightingK0s),
fcc79cf5 347 fNameFitDataPi0(ref.fNameFitDataPi0),
348 fNameFitDataEta(ref.fNameFitDataEta),
349 fNameFitDataK0s(ref.fNameFitDataK0s),
1d9e6011 350 hdEdxCuts(NULL),
351 hTPCdEdxbefore(NULL),
352 hTPCdEdxafter(NULL),
353 hTPCdEdxSigbefore(NULL),
354 hTPCdEdxSigafter(NULL),
355 hTOFbefore(NULL),
356 hTOFSigbefore(NULL),
357 hTOFSigafter(NULL),
1390f698 358 hPsiPairDeltaPhiafter(NULL),
1d9e6011 359 hTrackCuts(NULL),
360 hPhotonCuts(NULL),
361 hInvMassbefore(NULL),
362 hArmenterosbefore(NULL),
363 hInvMassafter(NULL),
364 hArmenterosafter(NULL),
365 hAcceptanceCuts(NULL),
366 hCutIndex(NULL),
367 hV0EventCuts(NULL),
368 hCentrality(NULL),
4803eb1f 369 hCentralityVsNumberOfPrimaryTracks(NULL),
1d9e6011 370 hVertexZ(NULL),
ae4f2cfb 371 hEventPlanePhi(NULL),
a280ac15 372 hTriggerClass(NULL),
ae947965 373 hTriggerClassSelected(NULL),
aff90284 374 hReweightMCHistPi0(ref.hReweightMCHistPi0),
375 hReweightMCHistEta(ref.hReweightMCHistEta),
376 hReweightMCHistK0s(ref.hReweightMCHistK0s),
377 fFitDataPi0(ref.fFitDataPi0),
378 fFitDataEta(ref.fFitDataEta),
379 fFitDataK0s(ref.fFitDataK0s),
ae947965 380 fPreSelCut(ref.fPreSelCut),
381 fTriggerSelectedManually(ref.fTriggerSelectedManually),
382 fSpecialTriggerName(ref.fSpecialTriggerName)
1d9e6011 383{
384 // Copy Constructor
a280ac15 385 for(Int_t jj=0;jj<kNCuts;jj++){fCuts[jj]=ref.fCuts[jj];}
386 fCutString=new TObjString((GetCutNumber()).Data());
387 fElectronLabelArray = new Int_t[fElectronArraySize];
0a2b2b4b 388 fUtils = new AliAnalysisUtils();
a280ac15 389 // dont copy histograms (if you like histograms, call InitCutHistograms())
11c1e680 390
1d9e6011 391}
392
a280ac15 393
3b77b2d1 394//________________________________________________________________________
395AliConversionCuts::~AliConversionCuts() {
4a0aab28 396 // Destructor
397 //Deleting fHistograms leads to seg fault it it's added to output collection of a task
398 // if(fHistograms)
fcc79cf5 399 // delete fHistograms;
4a0aab28 400 // fHistograms = NULL;
92efd725 401 if(fCutString != NULL){
402 delete fCutString;
403 fCutString = NULL;
404 }
92efd725 405 if(fElectronLabelArray){
406 delete fElectronLabelArray;
407 fElectronLabelArray = NULL;
408 }
ca91a3e1 409 if(fNotRejectedStart){
410 delete[] fNotRejectedStart;
411 fNotRejectedStart = NULL;
412 }
413 if(fNotRejectedEnd){
414 delete[] fNotRejectedEnd;
415 fNotRejectedEnd = NULL;
416 }
417 if(fGeneratorNames){
418 delete[] fGeneratorNames;
419 fGeneratorNames = NULL;
420 }
0a2b2b4b 421 if(fUtils){
422 delete fUtils;
423 fUtils = NULL;
424 }
425
3b77b2d1 426}
427
428//________________________________________________________________________
92efd725 429void AliConversionCuts::InitCutHistograms(TString name, Bool_t preCut){
3b77b2d1 430
4a0aab28 431 // Initialize Cut Histograms for QA (only initialized and filled if function is called)
ccfa8c0d 432 TH1::AddDirectory(kFALSE);
4a0aab28 433
434 if(fHistograms != NULL){
435 delete fHistograms;
436 fHistograms=NULL;
437 }
438 if(fHistograms==NULL){
439 fHistograms=new TList();
ccfa8c0d 440 fHistograms->SetOwner(kTRUE);
4a0aab28 441 if(name=="")fHistograms->SetName(Form("ConvCuts_%s",GetCutNumber().Data()));
442 else fHistograms->SetName(Form("%s_%s",name.Data(),GetCutNumber().Data()));
443 }
444
fcc79cf5 445 if (hReweightMCHistPi0){
446 hReweightMCHistPi0->SetName("MCInputForWeightingPi0");
447 fHistograms->Add(hReweightMCHistPi0);
448 }
449 if (hReweightMCHistEta){
450 hReweightMCHistEta->SetName("MCInputForWeightingEta");
451 fHistograms->Add(hReweightMCHistEta);
aff90284 452 }
fcc79cf5 453 if (hReweightMCHistK0s){
454 hReweightMCHistK0s->SetName("MCInputForWeightingK0s");
455 fHistograms->Add(hReweightMCHistK0s);
aff90284 456 }
34a75862 457// if (fFitDataPi0){
458// fFitDataPi0->SetName("DataFitForWeightingPi0");
459// fHistograms->Add(fFitDataPi0);
460// }
461// if (fFitDataEta){
462// fFitDataEta->SetName("DataFitForWeightingEta");
463// fHistograms->Add(fFitDataEta);
464// }
465// if (fFitDataK0s){
466// fFitDataK0s->SetName("DataFitForWeightingK0s");
467// fHistograms->Add(fFitDataK0s);
468// }
4a0aab28 469 // IsPhotonSelected
ae4f2cfb 470 hCutIndex=new TH1F(Form("IsPhotonSelected %s",GetCutNumber().Data()),"IsPhotonSelected",11,-0.5,10.5);
4a0aab28 471 hCutIndex->GetXaxis()->SetBinLabel(kPhotonIn+1,"in");
472 hCutIndex->GetXaxis()->SetBinLabel(kOnFly+1,"onfly");
473 hCutIndex->GetXaxis()->SetBinLabel(kNoTracks+1,"no tracks");
474 hCutIndex->GetXaxis()->SetBinLabel(kdEdxCuts+1,"dEdx");
475 hCutIndex->GetXaxis()->SetBinLabel(kTrackCuts+1,"Track cuts");
476 hCutIndex->GetXaxis()->SetBinLabel(kConvPointFail+1,"ConvPoint fail");
477 hCutIndex->GetXaxis()->SetBinLabel(kPhotonCuts+1,"PhotonCuts");
ae4f2cfb 478 hCutIndex->GetXaxis()->SetBinLabel(kEventPlane+1,"EventPlane");
4a0aab28 479 hCutIndex->GetXaxis()->SetBinLabel(kPhotonOut+1,"out");
480 fHistograms->Add(hCutIndex);
481
482 // Track Cuts
e5b6e8a6 483 hTrackCuts=new TH1F(Form("TrackCuts %s",GetCutNumber().Data()),"TrackCuts",9,-0.5,8.5);
4a0aab28 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);
493
494 // Photon Cuts
4803eb1f 495 hPhotonCuts=new TH1F(Form("PhotonCuts %s",GetCutNumber().Data()),"PhotonCuts",14,-0.5,13.5);
4a0aab28 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");
4803eb1f 505 hPhotonCuts->GetXaxis()->SetBinLabel(10,"DCA R");
506 hPhotonCuts->GetXaxis()->SetBinLabel(11,"DCA Z");
507 hPhotonCuts->GetXaxis()->SetBinLabel(12,"out");
4a0aab28 508 fHistograms->Add(hPhotonCuts);
509
510 if(preCut){
e5b6e8a6 511 hInvMassbefore=new TH1F(Form("InvMass_before %s",GetCutNumber().Data()),"InvMass_before",1000,0,0.3);
4a0aab28 512 fHistograms->Add(hInvMassbefore);
e5b6e8a6 513 hArmenterosbefore=new TH2F(Form("Armenteros_before %s",GetCutNumber().Data()),"Armenteros_before",200,-1,1,1000,0,1.);
4a0aab28 514 fHistograms->Add(hArmenterosbefore);
515 }
e5b6e8a6 516 hInvMassafter=new TH1F(Form("InvMass_after %s",GetCutNumber().Data()),"InvMass_after",1000,0,0.3);
4a0aab28 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);
520
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);
531
532 // dEdx Cuts
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);
e5b6e8a6 545
4a0aab28 546 TAxis *AxisBeforedEdx = NULL;
e5b6e8a6 547 TAxis *AxisBeforedEdxSig = NULL;
4a0aab28 548 TAxis *AxisBeforeTOF = NULL;
e5b6e8a6 549 TAxis *AxisBeforeTOFSig = NULL;
4a0aab28 550 if(preCut){
e5b6e8a6 551 hTPCdEdxbefore=new TH2F(Form("Gamma_dEdx_before %s",GetCutNumber().Data()),"dEdx Gamma before" ,150,0.03,20,800,0,200);
4a0aab28 552 fHistograms->Add(hTPCdEdxbefore);
e5b6e8a6 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();
4a0aab28 557
e5b6e8a6 558 hTOFbefore=new TH2F(Form("Gamma_TOF_before %s",GetCutNumber().Data()),"TOF Gamma before" ,150,0.03,20,11000,-1000,10000);
4a0aab28 559 fHistograms->Add(hTOFbefore);
e5b6e8a6 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();
564
4a0aab28 565 }
e5b6e8a6 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);
568
569 hTPCdEdxafter=new TH2F(Form("Gamma_dEdx_after %s",GetCutNumber().Data()),"dEdx Gamma after" ,150,0.03,20,800,0,200);
4a0aab28 570 fHistograms->Add(hTPCdEdxafter);
571
e5b6e8a6 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);
4a0aab28 574
1390f698 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);
577
e5b6e8a6 578 TAxis *AxisAfter = hTPCdEdxSigafter->GetXaxis();
4a0aab28 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];
583 newBins[0] = from;
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);
e5b6e8a6 587 AxisAfter = hTOFSigafter->GetXaxis();
588 AxisAfter->Set(bins, newBins);
589 AxisAfter = hTPCdEdxafter->GetXaxis();
4a0aab28 590 AxisAfter->Set(bins, newBins);
591 if(preCut){
592 AxisBeforedEdx->Set(bins, newBins);
593 AxisBeforeTOF->Set(bins, newBins);
e5b6e8a6 594 AxisBeforedEdxSig->Set(bins, newBins);
595 AxisBeforeTOFSig->Set(bins, newBins);
4a0aab28 596 }
597 delete [] newBins;
e5b6e8a6 598
d0a4ea74 599 hCentrality=new TH1F(Form("Centrality %s",GetCutNumber().Data()),"Centrality",100,0,100);
ae4f2cfb 600 fHistograms->Add(hCentrality);
601 hCentralityVsNumberOfPrimaryTracks=new TH2F(Form("Centrality vs Primary Tracks %s",GetCutNumber().Data()),"Centrality vs Primary Tracks ",100,0,100,4000,0,4000);
602 fHistograms->Add(hCentralityVsNumberOfPrimaryTracks);
603
4a0aab28 604 // Event Cuts and Info
605 if(preCut){
e5b6e8a6 606 hV0EventCuts=new TH1F(Form("ESD_EventCuts %s",GetCutNumber().Data()),"Event Cuts",7,-0.5,6.5);
4a0aab28 607 hV0EventCuts->GetXaxis()->SetBinLabel(1,"in");
608 hV0EventCuts->GetXaxis()->SetBinLabel(2,"OfflineTrigger");
e5b6e8a6 609 hV0EventCuts->GetXaxis()->SetBinLabel(3,"nvtxcontr");
610 hV0EventCuts->GetXaxis()->SetBinLabel(4,"VertexZ");
4a0aab28 611 hV0EventCuts->GetXaxis()->SetBinLabel(5,"pileup");
612 hV0EventCuts->GetXaxis()->SetBinLabel(6,"centrsel");
613 hV0EventCuts->GetXaxis()->SetBinLabel(7,"out");
614 fHistograms->Add(hV0EventCuts);
e5b6e8a6 615
4a0aab28 616 hVertexZ=new TH1F(Form("VertexZ %s",GetCutNumber().Data()),"VertexZ",1000,-50,50);
617 fHistograms->Add(hVertexZ);
e5b6e8a6 618
11c1e680 619 hTriggerClass= new TH1F(Form("OfflineTrigger %s",GetCutNumber().Data()),"OfflineTrigger",35,-0.5,34.5);
e5b6e8a6 620 hTriggerClass->GetXaxis()->SetBinLabel( 1,"kMB");
621 hTriggerClass->GetXaxis()->SetBinLabel( 2,"kINT7");
622 hTriggerClass->GetXaxis()->SetBinLabel( 3,"kMUON");
623 hTriggerClass->GetXaxis()->SetBinLabel( 4,"kHighMult");
624 hTriggerClass->GetXaxis()->SetBinLabel( 5,"kKEMC1");
625 hTriggerClass->GetXaxis()->SetBinLabel( 6,"kCINT5");
626 hTriggerClass->GetXaxis()->SetBinLabel( 7,"kCMUS5/kMUSPB");
627 hTriggerClass->GetXaxis()->SetBinLabel( 8,"kMUSH7/kMUSHPB");
628 hTriggerClass->GetXaxis()->SetBinLabel( 9,"kMUL7/kMuonLikePB");
629 hTriggerClass->GetXaxis()->SetBinLabel(10,"kMUU7/kMuonUnlikePB");
630 hTriggerClass->GetXaxis()->SetBinLabel(11,"kEMC7/kEMC8");
631 hTriggerClass->GetXaxis()->SetBinLabel(12,"kMUS7");
632 hTriggerClass->GetXaxis()->SetBinLabel(13,"kPHI1");
633 hTriggerClass->GetXaxis()->SetBinLabel(14,"kPHI7/kPHI8/kPHOSPb");
634 hTriggerClass->GetXaxis()->SetBinLabel(15,"kEMCEJE");
635 hTriggerClass->GetXaxis()->SetBinLabel(16,"kEMCEGA");
636 hTriggerClass->GetXaxis()->SetBinLabel(17,"kCentral");
637 hTriggerClass->GetXaxis()->SetBinLabel(18,"kSemiCentral");
638 hTriggerClass->GetXaxis()->SetBinLabel(19,"kDG5");
639 hTriggerClass->GetXaxis()->SetBinLabel(20,"kZED");
640 hTriggerClass->GetXaxis()->SetBinLabel(21,"kSPI7/kSPI");
641 hTriggerClass->GetXaxis()->SetBinLabel(22,"kINT8");
642 hTriggerClass->GetXaxis()->SetBinLabel(23,"kMuonSingleLowPt8");
643 hTriggerClass->GetXaxis()->SetBinLabel(24,"kMuonSingleHighPt8");
644 hTriggerClass->GetXaxis()->SetBinLabel(25,"kMuonLikeLowPt8");
645 hTriggerClass->GetXaxis()->SetBinLabel(26,"kMuonUnlikeLowPt8");
646 hTriggerClass->GetXaxis()->SetBinLabel(27,"kMuonUnlikeLowPt0");
647 hTriggerClass->GetXaxis()->SetBinLabel(28,"kUserDefined");
11c1e680 648 hTriggerClass->GetXaxis()->SetBinLabel(29,"kTRD");
649 hTriggerClass->GetXaxis()->SetBinLabel(30,"kFastOnly");
650 hTriggerClass->GetXaxis()->SetBinLabel(31,"kAnyINT");
651 hTriggerClass->GetXaxis()->SetBinLabel(32,"kAny");
652 hTriggerClass->GetXaxis()->SetBinLabel(33,"V0AND");
653 hTriggerClass->GetXaxis()->SetBinLabel(34,"NOT kFastOnly");
654 hTriggerClass->GetXaxis()->SetBinLabel(35,"failed Physics Selection");
4a0aab28 655 fHistograms->Add(hTriggerClass);
ae947965 656 }
657 if(!preCut){
11c1e680 658 hTriggerClassSelected= new TH1F(Form("OfflineTriggerSelected %s",GetCutNumber().Data()),"OfflineTriggerSelected",34,-0.5,33.5);
a280ac15 659 hTriggerClassSelected->GetXaxis()->SetBinLabel( 1,"kMB");
660 hTriggerClassSelected->GetXaxis()->SetBinLabel( 2,"kINT7");
661 hTriggerClassSelected->GetXaxis()->SetBinLabel( 3,"kMUON");
662 hTriggerClassSelected->GetXaxis()->SetBinLabel( 4,"kHighMult");
663 hTriggerClassSelected->GetXaxis()->SetBinLabel( 5,"kKEMC1");
664 hTriggerClassSelected->GetXaxis()->SetBinLabel( 6,"kCINT5");
665 hTriggerClassSelected->GetXaxis()->SetBinLabel( 7,"kCMUS5/kMUSPB");
666 hTriggerClassSelected->GetXaxis()->SetBinLabel( 8,"kMUSH7/kMUSHPB");
667 hTriggerClassSelected->GetXaxis()->SetBinLabel( 9,"kMUL7/kMuonLikePB");
668 hTriggerClassSelected->GetXaxis()->SetBinLabel(10,"kMUU7/kMuonUnlikePB");
669 hTriggerClassSelected->GetXaxis()->SetBinLabel(11,"kEMC7/kEMC8");
670 hTriggerClassSelected->GetXaxis()->SetBinLabel(12,"kMUS7");
671 hTriggerClassSelected->GetXaxis()->SetBinLabel(13,"kPHI1");
672 hTriggerClassSelected->GetXaxis()->SetBinLabel(14,"kPHI7/kPHI8/kPHOSPb");
673 hTriggerClassSelected->GetXaxis()->SetBinLabel(15,"kEMCEJE");
674 hTriggerClassSelected->GetXaxis()->SetBinLabel(16,"kEMCEGA");
675 hTriggerClassSelected->GetXaxis()->SetBinLabel(17,"kCentral");
676 hTriggerClassSelected->GetXaxis()->SetBinLabel(18,"kSemiCentral");
677 hTriggerClassSelected->GetXaxis()->SetBinLabel(19,"kDG5");
678 hTriggerClassSelected->GetXaxis()->SetBinLabel(20,"kZED");
679 hTriggerClassSelected->GetXaxis()->SetBinLabel(21,"kSPI7/kSPI");
680 hTriggerClassSelected->GetXaxis()->SetBinLabel(22,"kINT8");
681 hTriggerClassSelected->GetXaxis()->SetBinLabel(23,"kMuonSingleLowPt8");
682 hTriggerClassSelected->GetXaxis()->SetBinLabel(24,"kMuonSingleHighPt8");
683 hTriggerClassSelected->GetXaxis()->SetBinLabel(25,"kMuonLikeLowPt8");
684 hTriggerClassSelected->GetXaxis()->SetBinLabel(26,"kMuonUnlikeLowPt8");
685 hTriggerClassSelected->GetXaxis()->SetBinLabel(27,"kMuonUnlikeLowPt0");
686 hTriggerClassSelected->GetXaxis()->SetBinLabel(28,"kUserDefined");
11c1e680 687 hTriggerClassSelected->GetXaxis()->SetBinLabel(29,"kTRD");
688 hTriggerClassSelected->GetXaxis()->SetBinLabel(30,"kFastOnly");
689 hTriggerClassSelected->GetXaxis()->SetBinLabel(31,"kAnyINT");
690 hTriggerClassSelected->GetXaxis()->SetBinLabel(32,"kAny");
691 hTriggerClassSelected->GetXaxis()->SetBinLabel(33,"V0AND");
692 hTriggerClassSelected->GetXaxis()->SetBinLabel(34,"NOT kFastOnly");
a280ac15 693 fHistograms->Add(hTriggerClassSelected);
ae4f2cfb 694
695 hEventPlanePhi=new TH1F(Form("EventPlaneMinusPhotonAngle %s",GetCutNumber().Data()),"EventPlaneMinusPhotonAngle",360,-TMath::Pi(),TMath::Pi());
696 fHistograms->Add(hEventPlanePhi);
697
698
4a0aab28 699 }
ccfa8c0d 700 TH1::AddDirectory(kTRUE);
3b77b2d1 701}
702
703//________________________________________________________________________
704Bool_t AliConversionCuts::InitPIDResponse(){
4a0aab28 705 // Set Pointer to AliPIDResponse
3b77b2d1 706
4a0aab28 707 AliAnalysisManager *man=AliAnalysisManager::GetAnalysisManager();
e5b6e8a6 708 if(man) {
4a0aab28 709 AliInputEventHandler* inputHandler = (AliInputEventHandler*) (man->GetInputEventHandler());
710 fPIDResponse = (AliPIDResponse*)inputHandler->GetPIDResponse();
711 if(fPIDResponse)return kTRUE;
e5b6e8a6 712
4a0aab28 713 }
e5b6e8a6 714
ca91a3e1 715
4a0aab28 716 return kFALSE;
3b77b2d1 717}
718///________________________________________________________________________
92efd725 719Bool_t AliConversionCuts::EventIsSelected(AliVEvent *fInputEvent, AliVEvent *fMCEvent){
4a0aab28 720 // Process Event Selection
3b77b2d1 721
4a0aab28 722 Int_t cutindex=0;
723 if(hV0EventCuts)hV0EventCuts->Fill(cutindex);
724 cutindex++;
e5b6e8a6 725
4a0aab28 726 // Check for MC event
ae947965 727 if(fMCEvent && fInputEvent->IsA()==AliESDEvent::Class()){
4a0aab28 728 // Check if MC event is correctly loaded
729 AliMCEventHandler* mcHandler = dynamic_cast<AliMCEventHandler*> (AliAnalysisManager::GetAnalysisManager()->GetMCtruthEventHandler());
730 if (!mcHandler){
731 fEventQuality = 2;
732 return kFALSE;
733 }
734 if (!mcHandler->InitOk() ){
735 fEventQuality = 2;
736 return kFALSE;
737 }
738 if (!mcHandler->TreeK() ){
739 fEventQuality = 2;
740 return kFALSE;
741 }
742 if (!mcHandler->TreeTR() ) {
743 fEventQuality = 2;
744 return kFALSE;
745 }
746 }
4a0aab28 747
e5b6e8a6 748 // Event Trigger
4803eb1f 749// cout << "before event trigger" << endl;
1186afd2 750 if(!IsTriggerSelected(fInputEvent)){
4a0aab28 751 if(hV0EventCuts)hV0EventCuts->Fill(cutindex);
752 fEventQuality = 3;
753 return kFALSE;
754 }
755 cutindex++;
a280ac15 756
e5b6e8a6 757 if(fInputEvent->IsA()==AliESDEvent::Class()){
758 AliTriggerAnalysis fTriggerAnalysis;// = new AliTriggerAnalysis;
759 fHasV0AND = fTriggerAnalysis.IsOfflineTriggerFired((AliESDEvent*)fInputEvent, AliTriggerAnalysis::kV0AND);
11c1e680 760 if(fHasV0AND&&hTriggerClass)hTriggerClass->Fill(32);
e5b6e8a6 761 }
ccfa8c0d 762// cout << "event number " << ((AliESDEvent*)fInputEvent)->GetEventNumberInFile() << " entered"<< endl;
763
4a0aab28 764
e5b6e8a6 765 // Number of Contributors Cut
766 if(GetNumberOfContributorsVtx(fInputEvent)<=0) {
4a0aab28 767 if(hV0EventCuts)hV0EventCuts->Fill(cutindex);
e5b6e8a6 768 fEventQuality = 5;
4a0aab28 769 return kFALSE;
770 }
771 cutindex++;
772
e5b6e8a6 773 // Z Vertex Position Cut
774 if(!VertexZCut(fInputEvent)){
4a0aab28 775 if(hV0EventCuts)hV0EventCuts->Fill(cutindex);
e5b6e8a6 776 fEventQuality = 4;
4a0aab28 777 return kFALSE;
778 }
779 cutindex++;
92efd725 780
4a0aab28 781 // Pile Up Rejection
3b77b2d1 782
4a0aab28 783 if(fRemovePileUp){
784 if(fInputEvent->IsPileupFromSPD(3,0.8,3.,2.,5.)){
785 if(hV0EventCuts)hV0EventCuts->Fill(cutindex);
786 fEventQuality = 6;
787 return kFALSE;
788 }
789 }
790 cutindex++;
791
792 // Centrality Selection
e5b6e8a6 793 if(!IsCentralitySelected(fInputEvent,fMCEvent)){
4a0aab28 794 if(hV0EventCuts)hV0EventCuts->Fill(cutindex);
795 fEventQuality = 1;
796 return kFALSE;
797 }
798 cutindex++;
799
800 // Fill Event Histograms
801 if(hV0EventCuts)hV0EventCuts->Fill(cutindex);
802 if(hVertexZ)hVertexZ->Fill(fInputEvent->GetPrimaryVertex()->GetZ());
803 if(hCentrality)hCentrality->Fill(GetCentrality(fInputEvent));
4803eb1f 804 if(hCentralityVsNumberOfPrimaryTracks)
805 hCentralityVsNumberOfPrimaryTracks->Fill(GetCentrality(fInputEvent),
806 ((AliV0ReaderV1*)AliAnalysisManager::GetAnalysisManager()
807 ->GetTask("V0ReaderV1"))->GetNumberOfPrimaryTracks());
4a0aab28 808 fEventQuality = 0;
809 return kTRUE;
3b77b2d1 810}
811
812///________________________________________________________________________
92efd725 813Bool_t AliConversionCuts::PhotonIsSelectedMC(TParticle *particle,AliStack *fMCStack,Bool_t checkForConvertedGamma){
4a0aab28 814 // MonteCarlo Photon Selection
3b77b2d1 815
4a0aab28 816 if(!fMCStack)return kFALSE;
3b77b2d1 817
4a0aab28 818 if (particle->GetPdgCode() == 22){
e5b6e8a6 819
4a0aab28 820
11c1e680 821 if( particle->Eta() > (fEtaCut + fEtaShift) || particle->Eta() < (-fEtaCut + fEtaShift) )
822 return kFALSE;
823 if(fEtaCutMin>-0.1){
824 if( particle->Eta() < (fEtaCutMin + fEtaShift) && particle->Eta() > (-fEtaCutMin + fEtaShift) )
825 return kFALSE;
826 }
ccfa8c0d 827
4a0aab28 828 if(particle->GetMother(0) >-1 && fMCStack->Particle(particle->GetMother(0))->GetPdgCode() == 22){
829 return kFALSE; // no photon as mothers!
830 }
831
832 if(particle->GetMother(0) >= fMCStack->GetNprimary()){
833 return kFALSE; // the gamma has a mother, and it is not a primary particle
834 }
835
836 if(!checkForConvertedGamma) return kTRUE; // return in case of accepted gamma
837
838 // looking for conversion gammas (electron + positron from pairbuilding (= 5) )
839 TParticle* ePos = NULL;
840 TParticle* eNeg = NULL;
841
842 if(particle->GetNDaughters() >= 2){
843 for(Int_t daughterIndex=particle->GetFirstDaughter();daughterIndex<=particle->GetLastDaughter();daughterIndex++){
844 TParticle *tmpDaughter = fMCStack->Particle(daughterIndex);
845 if(tmpDaughter->GetUniqueID() == 5){
846 if(tmpDaughter->GetPdgCode() == 11){
847 eNeg = tmpDaughter;
848 } else if(tmpDaughter->GetPdgCode() == -11){
849 ePos = tmpDaughter;
850 }
851 }
852 }
853 }
854
855 if(ePos == NULL || eNeg == NULL){ // means we do not have two daughters from pair production
856 return kFALSE;
857 }
e5b6e8a6 858
4a0aab28 859 if(ePos->Pt()<fSinglePtCut || eNeg->Pt()<fSinglePtCut){
860 return kFALSE; // no reconstruction below the Pt cut
861 }
e5b6e8a6 862
11c1e680 863 if( ePos->Eta() > (fEtaCut + fEtaShift) || ePos->Eta() < (-fEtaCut + fEtaShift) ||
864 eNeg->Eta() > (fEtaCut + fEtaShift) || eNeg->Eta() < (-fEtaCut + fEtaShift) )
4a0aab28 865 return kFALSE;
11c1e680 866
867 if(fEtaCutMin > -0.1){
868 if( (ePos->Eta() < (fEtaCutMin + fEtaShift) && ePos->Eta() > (-fEtaCutMin + fEtaShift)) ||
869 (eNeg->Eta() < (fEtaCutMin + fEtaShift) && eNeg->Eta() > (-fEtaCutMin + fEtaShift)) )
870 return kFALSE;
4a0aab28 871 }
e5b6e8a6 872
4a0aab28 873 if(ePos->R()>fMaxR){
874 return kFALSE; // cuts on distance from collision point
875 }
876
e5b6e8a6 877 if(abs(ePos->Vz()) > fMaxZ){
fcc79cf5 878 return kFALSE; // outside material
4a0aab28 879 }
e5b6e8a6 880 if(abs(eNeg->Vz()) > fMaxZ){
fcc79cf5 881 return kFALSE; // outside material
4a0aab28 882 }
883
e5b6e8a6 884 if( ePos->R() <= ((abs(ePos->Vz()) * fLineCutZRSlope) - fLineCutZValue)){
4a0aab28 885 return kFALSE; // line cut to exclude regions where we do not reconstruct
e5b6e8a6 886 } else if ( fEtaCutMin != -0.1 && ePos->R() >= ((abs(ePos->Vz()) * fLineCutZRSlopeMin) - fLineCutZValueMin)){
4a0aab28 887 return kFALSE;
888 }
e5b6e8a6 889
890 if( eNeg->R() <= ((abs(eNeg->Vz()) * fLineCutZRSlope) - fLineCutZValue)){
4a0aab28 891 return kFALSE; // line cut to exclude regions where we do not reconstruct
e5b6e8a6 892 } else if ( fEtaCutMin != -0.1 && eNeg->R() >= ((abs(eNeg->Vz()) * fLineCutZRSlopeMin) - fLineCutZValueMin)){
4a0aab28 893 return kFALSE;
894 }
e5b6e8a6 895
4a0aab28 896 return kTRUE;
897 //if(AcceptanceCut(particle,ePos,eNeg))return kTRUE;
898 }
899 return kFALSE;
3b77b2d1 900}
ae947965 901///________________________________________________________________________
902Bool_t AliConversionCuts::PhotonIsSelectedAODMC(AliAODMCParticle *particle,TClonesArray *aodmcArray,Bool_t checkForConvertedGamma){
903 // MonteCarlo Photon Selection
904
905 if(!aodmcArray)return kFALSE;
aff90284 906
ae947965 907 if (particle->GetPdgCode() == 22){
908 if( particle->Eta() > (fEtaCut + fEtaShift) || particle->Eta() < (-fEtaCut + fEtaShift) )
909 return kFALSE;
910 if(fEtaCutMin>-0.1){
911 if( particle->Eta() < (fEtaCutMin + fEtaShift) && particle->Eta() > (-fEtaCutMin + fEtaShift) )
912 return kFALSE;
913 }
914
915 if(particle->GetMother() > -1){
916 if((static_cast<AliAODMCParticle*>(aodmcArray->At(particle->GetMother())))->GetPdgCode() == 22){
917 return kFALSE; // no photon as mothers!
918 }
919 if(!(static_cast<AliAODMCParticle*>(aodmcArray->At(particle->GetMother()))->IsPrimary())){
920 return kFALSE; // the gamma has a mother, and it is not a primary particle
921 }
922 }
aff90284 923
ae947965 924 if(!checkForConvertedGamma) return kTRUE; // return in case of accepted gamma
925
926 // looking for conversion gammas (electron + positron from pairbuilding (= 5) )
927 AliAODMCParticle* ePos = NULL;
928 AliAODMCParticle* eNeg = NULL;
929
930 if(particle->GetNDaughters() >= 2){
931 for(Int_t daughterIndex=particle->GetDaughter(0);daughterIndex<=particle->GetDaughter(1);daughterIndex++){
932 AliAODMCParticle *tmpDaughter = static_cast<AliAODMCParticle*>(aodmcArray->At(daughterIndex));
933 if(!tmpDaughter) continue;
934 if(((tmpDaughter->GetMCProcessCode())) == 5){ // STILL A BUG IN ALIROOT >>8 HAS TPO BE REMOVED AFTER FIX
935 if(tmpDaughter->GetPdgCode() == 11){
936 eNeg = tmpDaughter;
937 } else if(tmpDaughter->GetPdgCode() == -11){
938 ePos = tmpDaughter;
939 }
940 }
941 }
942 }
aff90284 943
ae947965 944 if(ePos == NULL || eNeg == NULL){ // means we do not have two daughters from pair production
945 return kFALSE;
946 }
947
948 if(ePos->Pt()<fSinglePtCut || eNeg->Pt()<fSinglePtCut){
949 return kFALSE; // no reconstruction below the Pt cut
950 }
951
952 if( ePos->Eta() > (fEtaCut + fEtaShift) || ePos->Eta() < (-fEtaCut + fEtaShift) ||
953 eNeg->Eta() > (fEtaCut + fEtaShift) || eNeg->Eta() < (-fEtaCut + fEtaShift) )
954 return kFALSE;
955
956 if(fEtaCutMin > -0.1){
957 if( (ePos->Eta() < (fEtaCutMin + fEtaShift) && ePos->Eta() > (-fEtaCutMin + fEtaShift)) ||
958 (eNeg->Eta() < (fEtaCutMin + fEtaShift) && eNeg->Eta() > (-fEtaCutMin + fEtaShift)) )
959 return kFALSE;
960 }
961
962 Double_t rPos = sqrt( (ePos->Xv()*ePos->Xv()) + (ePos->Yv()*ePos->Yv()) );
963 Double_t rNeg = sqrt( (eNeg->Xv()*eNeg->Xv()) + (eNeg->Yv()*eNeg->Yv()) );
aff90284 964
ae947965 965 if(rPos>fMaxR){
966 return kFALSE; // cuts on distance from collision point
967 }
968 if(abs(ePos->Zv()) > fMaxZ){
fcc79cf5 969 return kFALSE; // outside material
ae947965 970 }
971 if(abs(eNeg->Zv()) > fMaxZ){
fcc79cf5 972 return kFALSE; // outside material
ae947965 973 }
3b77b2d1 974
ae947965 975 if( rPos <= ((abs(ePos->Zv()) * fLineCutZRSlope) - fLineCutZValue)){
976 return kFALSE; // line cut to exclude regions where we do not reconstruct
977 } else if ( fEtaCutMin != -0.1 && rPos >= ((abs(ePos->Zv()) * fLineCutZRSlopeMin) - fLineCutZValueMin)){
978 return kFALSE;
979 }
980
981 if( rNeg <= ((abs(eNeg->Zv()) * fLineCutZRSlope) - fLineCutZValue)){
982 return kFALSE; // line cut to exclude regions where we do not reconstruct
983 } else if ( fEtaCutMin != -0.1 && rNeg >= ((abs(eNeg->Zv()) * fLineCutZRSlopeMin) - fLineCutZValueMin)){
984 return kFALSE;
985 }
2bb2434e 986
ae947965 987 return kTRUE;
988 //if(AcceptanceCut(particle,ePos,eNeg))return kTRUE;
989 }
990 return kFALSE;
991}
3b77b2d1 992///________________________________________________________________________
993Bool_t AliConversionCuts::PhotonCuts(AliConversionPhotonBase *photon,AliVEvent *event)
994{ // Specific Photon Cuts
995
4a0aab28 996 Int_t cutIndex = 0;
997 if(hPhotonCuts)hPhotonCuts->Fill(cutIndex);
998 cutIndex++;
999
1000 // Fill Histos before Cuts
1001 if(hInvMassbefore)hInvMassbefore->Fill(photon->GetMass());
e5b6e8a6 1002
4a0aab28 1003 if(hArmenterosbefore)hArmenterosbefore->Fill(photon->GetArmenterosAlpha(),photon->GetArmenterosQt());
1004
1005 // Gamma selection based on QT from Armenteros
1006 if(fDoQtGammaSelection == kTRUE){
1007 if(!ArmenterosQtCut(photon)){
1008 if(hPhotonCuts)hPhotonCuts->Fill(cutIndex); //1
1009 return kFALSE;
1010 }
1011 }
1012 cutIndex++; //2
1013
1014 // Chi Cut
1015 if(photon->GetChi2perNDF() > fChi2CutConversion || photon->GetChi2perNDF() <=0){
1016 {
1017 if(hPhotonCuts)hPhotonCuts->Fill(cutIndex); //2
1018 return kFALSE;
1019 }
1020 }
1021 cutIndex++;//3
1022
1023 // Reconstruction Acceptance Cuts
1024 if(!AcceptanceCuts(photon)){
1025 if(hPhotonCuts)hPhotonCuts->Fill(cutIndex); //3
1026 return kFALSE;
1027 }
1028
1029 cutIndex++; //4
1030 // Asymmetry Cut
1031 if(fDoPhotonAsymmetryCut == kTRUE){
1032 if(!AsymmetryCut(photon,event)){
1033 if(hPhotonCuts)hPhotonCuts->Fill(cutIndex); //4
1034 return kFALSE;
1035 }
1036 }
1037
1038 //Check the pid probability
1039 cutIndex++; //5
1040 if(!PIDProbabilityCut(photon, event)) {
1041 if(hPhotonCuts)hPhotonCuts->Fill(cutIndex); //5
1042 return kFALSE;
1043 }
1044
1045 cutIndex++; //6
1046 if(!CorrectedTPCClusterCut(photon, event)) {
1047 if(hPhotonCuts)hPhotonCuts->Fill(cutIndex); //6
1048 return kFALSE;
1049 }
1050
1390f698 1051 Double_t magField = event->GetMagneticField();
1052 if( magField < 0.0 ){
1053 magField = 1.0;
1054 } else {
1055 magField = -1.0;
1056 }
d8b864f8 1057
1390f698 1058 AliVTrack * electronCandidate = GetTrack(event,photon->GetTrackLabelNegative() );
1059 AliVTrack * positronCandidate = GetTrack(event,photon->GetTrackLabelPositive() );
1060 Double_t deltaPhi = magField * TVector2::Phi_mpi_pi( electronCandidate->Phi()-positronCandidate->Phi());
4a0aab28 1061
1062 cutIndex++; //7
d8b864f8 1063 if(!PsiPairCut(photon)) {
4a0aab28 1064 if(hPhotonCuts)hPhotonCuts->Fill(cutIndex); //7
1065 return kFALSE;
1066 }
1067
1068 cutIndex++; //8
1069 if(!CosinePAngleCut(photon, event)) {
1070 if(hPhotonCuts)hPhotonCuts->Fill(cutIndex); //8
1071 return kFALSE;
1072 }
1073
4803eb1f 1074 AliAODConversionPhoton* photonAOD = dynamic_cast<AliAODConversionPhoton*>(photon);
1075 if (photonAOD){
1076 photonAOD->CalculateDistanceOfClossetApproachToPrimVtx(event->GetPrimaryVertex());
aff90284 1077
4803eb1f 1078 cutIndex++; //9
1079 if(photonAOD->GetDCArToPrimVtx() > fDCARPrimVtxCut) { //DCA R cut of photon to primary vertex
1080 if(hPhotonCuts)hPhotonCuts->Fill(cutIndex); //9
1081 return kFALSE;
1082 }
aff90284 1083
4803eb1f 1084 cutIndex++; //10
1085 if(abs(photonAOD->GetDCAzToPrimVtx()) > fDCAZPrimVtxCut) { //DCA Z cut of photon to primary vertex
1086 if(hPhotonCuts)hPhotonCuts->Fill(cutIndex); //10
1087 return kFALSE;
1088 }
1089 } else {
1090 cutIndex++; //9
1091 cutIndex++; //10
1092 }
1093 cutIndex++; //11
1094 if(hPhotonCuts)hPhotonCuts->Fill(cutIndex); //11
4a0aab28 1095
1096 // Histos after Cuts
1097 if(hInvMassafter)hInvMassafter->Fill(photon->GetMass());
1098 if(hArmenterosafter)hArmenterosafter->Fill(photon->GetArmenterosAlpha(),photon->GetArmenterosQt());
1390f698 1099 if(hPsiPairDeltaPhiafter)hPsiPairDeltaPhiafter->Fill(deltaPhi,photon->GetPsiPair());
4a0aab28 1100 return kTRUE;
3b77b2d1 1101
1102}
1103
1104///________________________________________________________________________
1105Bool_t AliConversionCuts::CorrectedTPCClusterCut(AliConversionPhotonBase *photon, AliVEvent * event)
1106{ //Cut on corrected TPC Cluster Info
1107
4a0aab28 1108 AliVTrack * negTrack = GetTrack(event, photon->GetTrackLabelNegative());
1109 AliVTrack * posTrack = GetTrack(event, photon->GetTrackLabelPositive());
3b77b2d1 1110
4a0aab28 1111 if(!negTrack||!posTrack)return kFALSE;
3b77b2d1 1112
4a0aab28 1113 Double_t negclsToF=0;
3b77b2d1 1114
4a0aab28 1115 if (!fUseCorrectedTPCClsInfo ){
1116 if(negTrack->GetTPCNclsF()!=0){
1117 negclsToF = (Double_t)negTrack->GetNcls(1)/(Double_t)negTrack->GetTPCNclsF();}// Ncluster/Nfindablecluster
1118 }
1119 else {
1120 negclsToF = negTrack->GetTPCClusterInfo(2,0,GetFirstTPCRow(photon->GetConversionRadius()));
1121 }
3b77b2d1 1122
4a0aab28 1123 Double_t posclsToF = 0.;
1124 if (!fUseCorrectedTPCClsInfo ){
e5b6e8a6 1125 if(posTrack->GetTPCNclsF()!=0){
4a0aab28 1126 posclsToF = (Double_t)posTrack->GetNcls(1)/(Double_t)posTrack->GetTPCNclsF();
1127 }
1128 }else{
1129 posclsToF = posTrack->GetTPCClusterInfo(2,0,GetFirstTPCRow(photon->GetConversionRadius()));
1130 }
3b77b2d1 1131
e5b6e8a6 1132 if( negclsToF < fMinClsTPCToF || posclsToF < fMinClsTPCToF ){
4a0aab28 1133 return kFALSE;
1134 }
3b77b2d1 1135
4a0aab28 1136 return kTRUE;
3b77b2d1 1137}
1138
3b77b2d1 1139///________________________________________________________________________
d008165e 1140Bool_t AliConversionCuts::PhotonIsSelected(AliConversionPhotonBase *photon, AliVEvent * event)
1141{
4a0aab28 1142 //Selection of Reconstructed Photons
3b77b2d1 1143
4a0aab28 1144 FillPhotonCutIndex(kPhotonIn);
11c1e680 1145
0a2b2b4b 1146 if(event->IsA()==AliESDEvent::Class()) {
ccfa8c0d 1147 if(!SelectV0Finder( ( ((AliESDEvent*)event)->GetV0(photon->GetV0Index()))->GetOnFlyStatus() ) ){
0a2b2b4b 1148 FillPhotonCutIndex(kOnFly);
1149 return kFALSE;
1150 }
1151 }
1152 // else if(event->IsA()==AliAODEvent::Class()) {
1153 // if(!SelectV0Finder( ( ((AliAODEvent*)event)->GetV0(photon->GetV0Index())) ) ){
1154 // FillPhotonCutIndex(kOnFly);
1155 // return kFALSE;
1156 // }
1157 // }
3b77b2d1 1158
4a0aab28 1159 // Get Tracks
1160 AliVTrack * negTrack = GetTrack(event, photon->GetTrackLabelNegative());
1161 AliVTrack * posTrack = GetTrack(event, photon->GetTrackLabelPositive());
3b77b2d1 1162
4a0aab28 1163 if(!negTrack || !posTrack) {
1164 FillPhotonCutIndex(kNoTracks);
1165 return kFALSE;
1166 }
4803eb1f 1167 photon->DeterminePhotonQuality(negTrack,posTrack);
4a0aab28 1168 // Track Cuts
1169 if(!TracksAreSelected(negTrack, posTrack)){
1170 FillPhotonCutIndex(kTrackCuts);
1171 return kFALSE;
1172 }
aff90284 1173
1186afd2 1174 // dEdx Cuts
1175 if(!dEdxCuts(negTrack) || !dEdxCuts(posTrack)) {
1176 FillPhotonCutIndex(kdEdxCuts);
1177 return kFALSE;
1178 }
1179
4a0aab28 1180 // Photon Cuts
1181 if(!PhotonCuts(photon,event)){
1182 FillPhotonCutIndex(kPhotonCuts);
1183 return kFALSE;
1184 }
3b77b2d1 1185
4a0aab28 1186 // Photon passed cuts
1187 FillPhotonCutIndex(kPhotonOut);
1188 return kTRUE;
3b77b2d1 1189}
1190
3b77b2d1 1191///________________________________________________________________________
1192Bool_t AliConversionCuts::ArmenterosQtCut(AliConversionPhotonBase *photon)
1193{ // Armenteros Qt Cut
1194
d8b864f8
FB
1195 if(fDo2DQt){
1196 if ( !(TMath::Power(photon->GetArmenterosAlpha()/0.95,2)+TMath::Power(photon->GetArmenterosQt()/fQtMax,2) < 1) ){
1197 return kFALSE;
4a0aab28 1198 }
1199 } else {
4a0aab28 1200 if(photon->GetArmenterosQt()>fQtMax){
1201 return kFALSE;
1202 }
1203 }
1204 return kTRUE;
3b77b2d1 1205}
1206
1207
1208///________________________________________________________________________
1209Bool_t AliConversionCuts::AcceptanceCuts(AliConversionPhotonBase *photon) {
4a0aab28 1210 // Exclude certain areas for photon reconstruction
3b77b2d1 1211
4a0aab28 1212 Int_t cutIndex=0;
1213 if(hAcceptanceCuts)hAcceptanceCuts->Fill(cutIndex);
1214 cutIndex++;
3b77b2d1 1215
4a0aab28 1216 if(photon->GetConversionRadius()>fMaxR){ // cuts on distance from collision point
1217 if(hAcceptanceCuts)hAcceptanceCuts->Fill(cutIndex);
1218 return kFALSE;
1219 }
1220 cutIndex++;
3b77b2d1 1221
4a0aab28 1222 if(photon->GetConversionRadius()<fMinR){ // cuts on distance from collision point
1223 if(hAcceptanceCuts)hAcceptanceCuts->Fill(cutIndex);
1224 return kFALSE;
1225 }
1226 cutIndex++;
3b77b2d1 1227
e5b6e8a6 1228 if(photon->GetConversionRadius() <= ((abs(photon->GetConversionZ())*fLineCutZRSlope)-fLineCutZValue)){
3b77b2d1 1229 if(hAcceptanceCuts)hAcceptanceCuts->Fill(cutIndex);
1230 return kFALSE;
4a0aab28 1231 }
e5b6e8a6 1232 else if (fUseEtaMinCut && photon->GetConversionRadius() >= ((abs(photon->GetConversionZ())*fLineCutZRSlopeMin)-fLineCutZValueMin )){
4a0aab28 1233 if(hAcceptanceCuts)hAcceptanceCuts->Fill(cutIndex);
1234 return kFALSE;
1235 }
1236 cutIndex++;
3b77b2d1 1237
e5b6e8a6 1238 if(abs(photon->GetConversionZ()) > fMaxZ ){ // cuts out regions where we do not reconstruct
3b77b2d1 1239 if(hAcceptanceCuts)hAcceptanceCuts->Fill(cutIndex);
1240 return kFALSE;
4a0aab28 1241 }
1242 cutIndex++;
3b77b2d1 1243
1244
11c1e680 1245 if( photon->GetPhotonEta() > (fEtaCut + fEtaShift) || photon->GetPhotonEta() < (-fEtaCut + fEtaShift) ){
3b77b2d1 1246 if(hAcceptanceCuts)hAcceptanceCuts->Fill(cutIndex);
1247 return kFALSE;
4a0aab28 1248 }
11c1e680 1249 if(fEtaCutMin>-0.1){
1250 if( photon->GetPhotonEta() < (fEtaCutMin + fEtaShift) && photon->GetPhotonEta() > (-fEtaCutMin + fEtaShift) ){
1251 if(hAcceptanceCuts)hAcceptanceCuts->Fill(cutIndex);
1252 return kFALSE;
1253 }
1254 }
4a0aab28 1255 cutIndex++;
3b77b2d1 1256
4a0aab28 1257 if(photon->GetPhotonPt()<fPtCut){
3b77b2d1 1258 if(hAcceptanceCuts)hAcceptanceCuts->Fill(cutIndex);
1259 return kFALSE;
4a0aab28 1260 }
1261 cutIndex++;
3b77b2d1 1262
4a0aab28 1263 if(hAcceptanceCuts)hAcceptanceCuts->Fill(cutIndex);
e5b6e8a6 1264
4a0aab28 1265 return kTRUE;
3b77b2d1 1266}
1267
1268
1269///________________________________________________________________________
1270Bool_t AliConversionCuts::SpecificTrackCuts(AliAODTrack * negTrack, AliAODTrack * posTrack,Int_t &cutIndex) {
4a0aab28 1271 // Track Cuts which require AOD/ESD specific implementation
3b77b2d1 1272
4a0aab28 1273 if( !negTrack->IsOn(AliESDtrack::kTPCrefit) || !posTrack->IsOn(AliESDtrack::kTPCrefit) ) {
3b77b2d1 1274 if(hTrackCuts)hTrackCuts->Fill(cutIndex);
1275 return kFALSE;
4a0aab28 1276 }
1277 cutIndex++;
3b77b2d1 1278
4a0aab28 1279 AliAODVertex * NegVtxType=negTrack->GetProdVertex();
1280 AliAODVertex * PosVtxType=posTrack->GetProdVertex();
4803eb1f 1281 if( (NegVtxType->GetType())==AliAODVertex::kKink || (PosVtxType->GetType())==AliAODVertex::kKink) {
3b77b2d1 1282 if(hTrackCuts)hTrackCuts->Fill(cutIndex);
1283 return kFALSE;
4a0aab28 1284 }
1285 return kTRUE;
3b77b2d1 1286
1287}
1288
1289
1290///________________________________________________________________________
1291Bool_t AliConversionCuts::SpecificTrackCuts(AliESDtrack * negTrack, AliESDtrack * posTrack,Int_t &cutIndex) {
4a0aab28 1292 // Track Cuts which require AOD/ESD specific implementation
3b77b2d1 1293
92efd725 1294 if( !negTrack->IsOn(AliESDtrack::kTPCrefit) || !posTrack->IsOn(AliESDtrack::kTPCrefit) ) {
3b77b2d1 1295 if(hTrackCuts)hTrackCuts->Fill(cutIndex);
1296 return kFALSE;
4a0aab28 1297 }
1298 cutIndex++;
3b77b2d1 1299
4a0aab28 1300 if(negTrack->GetKinkIndex(0) > 0 || posTrack->GetKinkIndex(0) > 0 ) {
3b77b2d1 1301 if(hTrackCuts)hTrackCuts->Fill(cutIndex);
1302 return kFALSE;
4a0aab28 1303 }
1304 return kTRUE;
3b77b2d1 1305}
1306
1307
1308
1309///________________________________________________________________________
1310Bool_t AliConversionCuts::TracksAreSelected(AliVTrack * negTrack, AliVTrack * posTrack) {
4a0aab28 1311 // Track Selection for Photon Reconstruction
3b77b2d1 1312
4a0aab28 1313 Int_t cutIndex=0;
1314 if(hTrackCuts)hTrackCuts->Fill(cutIndex);
1315 cutIndex++;
3b77b2d1 1316
4a0aab28 1317 // avoid like sign
1318 if(negTrack->Charge() == posTrack->Charge()) {
1319 if(hTrackCuts)hTrackCuts->Fill(cutIndex);
1320 return kFALSE;
1321 }
1322 cutIndex++;
3b77b2d1 1323
4a0aab28 1324 // Number of TPC Clusters
aff90284 1325
1326
4a0aab28 1327 if( negTrack->GetNcls(1) < fMinClsTPC || posTrack->GetNcls(1) < fMinClsTPC ) {
3b77b2d1 1328 if(hTrackCuts)hTrackCuts->Fill(cutIndex);
4a0aab28 1329 return kFALSE;
1330 }
1331 cutIndex++;
ccfa8c0d 1332
4a0aab28 1333 // Acceptance
11c1e680 1334 if( posTrack->Eta() > (fEtaCut + fEtaShift) || posTrack->Eta() < (-fEtaCut + fEtaShift) ||
1335 negTrack->Eta() > (fEtaCut + fEtaShift) || negTrack->Eta() < (-fEtaCut + fEtaShift) ){
4a0aab28 1336 if(hTrackCuts)hTrackCuts->Fill(cutIndex);
3b77b2d1 1337 return kFALSE;
4a0aab28 1338 }
11c1e680 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);
1343 return kFALSE;
1344 }
1345 }
4a0aab28 1346 cutIndex++;
3b77b2d1 1347
4a0aab28 1348 // Single Pt Cut
fcc79cf5 1349 if( negTrack->Pt()< fSinglePtCut || posTrack->Pt()< fSinglePtCut){
3b77b2d1 1350 if(hTrackCuts)hTrackCuts->Fill(cutIndex);
1351 return kFALSE;
4a0aab28 1352 }
1353 cutIndex++;
3b77b2d1 1354
4a0aab28 1355 // AOD ESD specific cuts
1356 Bool_t passCuts = kTRUE;
3b77b2d1 1357
4a0aab28 1358 if(negTrack->IsA()==AliAODTrack::Class()) {
1359 passCuts = passCuts * SpecificTrackCuts(static_cast<AliAODTrack*>(negTrack), static_cast<AliAODTrack*>(posTrack),cutIndex);
e5b6e8a6 1360 } else {
4a0aab28 1361 passCuts = passCuts * SpecificTrackCuts(static_cast<AliESDtrack*>(negTrack), static_cast<AliESDtrack*>(posTrack),cutIndex);
e5b6e8a6 1362 }
3b77b2d1 1363
4a0aab28 1364 if(!passCuts){
3b77b2d1 1365 if(hTrackCuts)hTrackCuts->Fill(cutIndex);
1366 return kFALSE;
4a0aab28 1367 }
1368 cutIndex++;
3b77b2d1 1369
4a0aab28 1370 if(hTrackCuts)hTrackCuts->Fill(cutIndex);
3b77b2d1 1371
4a0aab28 1372 return kTRUE;
e5b6e8a6 1373
3b77b2d1 1374}
1375
1376///________________________________________________________________________
1377Bool_t AliConversionCuts::dEdxCuts(AliVTrack *fCurrentTrack){
4a0aab28 1378 // Electron Identification Cuts for Photon reconstruction
3b77b2d1 1379
4a0aab28 1380 if(!fPIDResponse){InitPIDResponse();}// Try to reinitialize PID Response
1381 if(!fPIDResponse){AliError("No PID Response"); return kTRUE;}// if still missing fatal error
3b77b2d1 1382
4a0aab28 1383 Int_t cutIndex=0;
1384 if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);
e5b6e8a6 1385 if(hTPCdEdxSigbefore)hTPCdEdxSigbefore->Fill(fCurrentTrack->P(),fPIDResponse->NumberOfSigmasTPC(fCurrentTrack, AliPID::kElectron));
1386 if(hTPCdEdxbefore)hTPCdEdxbefore->Fill(fCurrentTrack->P(),fCurrentTrack->GetTPCsignal());
4a0aab28 1387 cutIndex++;
e5b6e8a6 1388
3b77b2d1 1389
4a0aab28 1390 if(fDodEdxSigmaCut == kTRUE){
3b77b2d1 1391 // TPC Electron Line
1392 if( fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kElectron)<fPIDnSigmaBelowElectronLine ||
4a0aab28 1393 fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kElectron)>fPIDnSigmaAboveElectronLine){
3b77b2d1 1394
4a0aab28 1395 if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);
1396 return kFALSE;
3b77b2d1 1397 }
1398 cutIndex++;
1399
1400 // TPC Pion Line
4a0aab28 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){
1405
1406 if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);
1407 return kFALSE;
1408 }
1409 }
1410 cutIndex++;
e5b6e8a6 1411
4a0aab28 1412 // High Pt Pion rej
1413 if( fCurrentTrack->P()>fPIDMaxPnSigmaAbovePionLine ){
1414 if(fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kElectron)>fPIDnSigmaBelowElectronLine &&
e5b6e8a6 1415 fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kElectron)<fPIDnSigmaAboveElectronLine &&
4a0aab28 1416 fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kPion)<fPIDnSigmaAbovePionLineHighPt){
1417
1418 if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);
1419 return kFALSE;
1420 }
1421 }
1422 cutIndex++;
1423 }
1424 else{cutIndex+=3;}
1425
1426 if(fDoKaonRejectionLowP == kTRUE){
1427 if(fCurrentTrack->P()<fPIDMinPKaonRejectionLowP ){
e5b6e8a6 1428 if( abs(fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kKaon))<fPIDnSigmaAtLowPAroundKaonLine){
4a0aab28 1429
1430 if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);
1431 return kFALSE;
1432 }
1433 }
1434 }
1435 cutIndex++;
e5b6e8a6 1436
4a0aab28 1437 if(fDoProtonRejectionLowP == kTRUE){
1438 if( fCurrentTrack->P()<fPIDMinPProtonRejectionLowP ){
e5b6e8a6 1439 if( abs(fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kProton))<fPIDnSigmaAtLowPAroundProtonLine){
4a0aab28 1440
1441 if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);
1442 return kFALSE;
1443 }
1444 }
1445 }
3b77b2d1 1446 cutIndex++;
e5b6e8a6 1447
4a0aab28 1448 if(fDoPionRejectionLowP == kTRUE){
1449 if( fCurrentTrack->P()<fPIDMinPPionRejectionLowP ){
e5b6e8a6 1450 if( abs(fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kPion))<fPIDnSigmaAtLowPAroundPionLine){
4a0aab28 1451
1452 if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);
1453 return kFALSE;
1454 }
1455 }
1456 }
1457 cutIndex++;
e5b6e8a6 1458
1459
1460 // cout<<"Start"<<endl;
1461 // AliPIDResponse::EDetPidStatus status=fPIDResponse->CheckPIDStatus(AliPIDResponse::kTOF,fCurrentTrack);
a280ac15 1462
e5b6e8a6 1463 // if( ( (status & AliVTrack::kTOFout) == AliVTrack::kTOFout ) && ( (status & AliVTrack::kTIME) == AliVTrack::kTIME ))
1464 // {cout<<"TOF DA"<<endl;}
a280ac15 1465 // if(status == AliPIDResponse::kDetPidOk){
e5b6e8a6 1466 // Float_t probMis = fPIDResponse->GetTOFMismatchProbability(fCurrentTrack);
1467 // cout<<"--> "<<probMis<<endl;
1468 // if(probMis > 0.01){
a280ac15 1469
e5b6e8a6 1470 // }
1471 // }
a280ac15 1472
4a0aab28 1473 if((fCurrentTrack->GetStatus() & AliESDtrack::kTOFpid) && !(fCurrentTrack->GetStatus() & AliESDtrack::kTOFmismatch)){
e5b6e8a6 1474 if(hTOFbefore){
1475 Double_t t0 = fPIDResponse->GetTOFResponse().GetStartTime(fCurrentTrack->P());
1476 Double_t times[5];
1477 fCurrentTrack->GetIntegratedTimes(times);
fcc79cf5 1478 Double_t TOFsignal = fCurrentTrack->GetTOFsignal();
e5b6e8a6 1479 Double_t dT = TOFsignal - t0 - times[0];
1480 hTOFbefore->Fill(fCurrentTrack->P(),dT);
1481 }
1482 if(hTOFSigbefore) hTOFSigbefore->Fill(fCurrentTrack->P(),fPIDResponse->NumberOfSigmasTOF(fCurrentTrack, AliPID::kElectron));
4a0aab28 1483 if(fUseTOFpid){
1484 if(fPIDResponse->NumberOfSigmasTOF(fCurrentTrack, AliPID::kElectron)>fTofPIDnSigmaAboveElectronLine ||
1485 fPIDResponse->NumberOfSigmasTOF(fCurrentTrack, AliPID::kElectron)<fTofPIDnSigmaBelowElectronLine ){
1486 if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);
1487 return kFALSE;
1488 }
1489 }
e5b6e8a6 1490 if(hTOFSigafter)hTOFSigafter->Fill(fCurrentTrack->P(),fPIDResponse->NumberOfSigmasTOF(fCurrentTrack, AliPID::kElectron));
4a0aab28 1491 }
1492 cutIndex++;
e5b6e8a6 1493
4a0aab28 1494 // Apply TRD PID
1495 if(fDoTRDPID){
1496 if(!fPIDResponse->IdentifiedAsElectronTRD(fCurrentTrack,fPIDTRDEfficiency)){
4a0aab28 1497 if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);
1498 return kFALSE;
1499 }
1500 }
1501 cutIndex++;
3b77b2d1 1502
4a0aab28 1503 if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);
e5b6e8a6 1504 if(hTPCdEdxSigafter)hTPCdEdxSigafter->Fill(fCurrentTrack->P(),fPIDResponse->NumberOfSigmasTPC(fCurrentTrack, AliPID::kElectron));
1505 if(hTPCdEdxafter)hTPCdEdxafter->Fill(fCurrentTrack->P(),fCurrentTrack->GetTPCsignal());
1390f698 1506
4a0aab28 1507 return kTRUE;
3b77b2d1 1508}
1509
1510///________________________________________________________________________
1511Bool_t AliConversionCuts::AsymmetryCut(AliConversionPhotonBase * photon,AliVEvent *event) {
4a0aab28 1512 // Cut on Energy Assymetry
3b77b2d1 1513
4a0aab28 1514 for(Int_t ii=0;ii<2;ii++){
3b77b2d1 1515
4a0aab28 1516 AliVTrack *track=GetTrack(event,photon->GetTrackLabel(ii));
3b77b2d1 1517
4a0aab28 1518 if( track->P() > fMinPPhotonAsymmetryCut ){
1519 Double_t trackNegAsy=0;
1520 if (photon->GetPhotonP()!=0.){
1521 trackNegAsy= track->P()/photon->GetPhotonP();
1522 }
aff90284 1523
4a0aab28 1524 if( trackNegAsy<fMinPhotonAsymmetry ||trackNegAsy>(1.- fMinPhotonAsymmetry)){
1525 return kFALSE;
1526 }
1527 }
3b77b2d1 1528
4a0aab28 1529 }
1530 return kTRUE;
3b77b2d1 1531}
1532
1533///________________________________________________________________________
92efd725 1534AliVTrack *AliConversionCuts::GetTrack(AliVEvent * event, Int_t label){
4a0aab28 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)
1538
1539 AliESDEvent * esdEvent = dynamic_cast<AliESDEvent*>(event);
1540 if(esdEvent) {
1541 if(label > event->GetNumberOfTracks() ) return NULL;
1542 AliESDtrack * track = esdEvent->GetTrack(label);
1543 return track;
e5b6e8a6 1544
1545 } else {
ae947965 1546 AliVTrack * track = 0x0;
1186afd2 1547 if(((AliV0ReaderV1*)AliAnalysisManager::GetAnalysisManager()->GetTask("V0ReaderV1"))->AreAODsRelabeled()){
1548 track = dynamic_cast<AliVTrack*>(event->GetTrack(label));
1549 return track;
1550 }
aff90284 1551 else{
1186afd2 1552 for(Int_t ii=0; ii<event->GetNumberOfTracks(); ii++) {
1553 track = dynamic_cast<AliVTrack*>(event->GetTrack(ii));
1554 if(track){
1555 if(track->GetID() == label) {
ae947965 1556 return track;
1557 }
1558 }
1559 }
1560 }
4a0aab28 1561 }
e5b6e8a6 1562 //AliDebug(5,(Form("track not found %d %d",label,event->GetNumberOfTracks()));
1563 return NULL;
1564}
1565
1566///________________________________________________________________________
1567AliESDtrack *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)
1571
1572 if(event) {
1573 if(label > event->GetNumberOfTracks() ) return NULL;
1574 AliESDtrack * track = event->GetTrack(label);
1575 return track;
1576 }
4a0aab28 1577 //AliDebug(5,(Form("track not found %d %d",label,event->GetNumberOfTracks()));
1578 return NULL;
3b77b2d1 1579}
1580
1581
e5b6e8a6 1582
3b77b2d1 1583///________________________________________________________________________
1584Bool_t AliConversionCuts::PIDProbabilityCut(AliConversionPhotonBase *photon, AliVEvent * event){
4a0aab28 1585 // Cut on Electron Probability for Photon Reconstruction
3b77b2d1 1586
4a0aab28 1587 AliESDEvent * esdEvent = dynamic_cast<AliESDEvent*>(event);
3b77b2d1 1588
4a0aab28 1589 if(esdEvent){
e5b6e8a6 1590
4a0aab28 1591 Bool_t iResult=kFALSE;
e5b6e8a6 1592
4a0aab28 1593 Double_t *posProbArray = new Double_t[AliPID::kSPECIES];
1594 Double_t *negProbArray = new Double_t[AliPID::kSPECIES];
e5b6e8a6 1595
fcc79cf5 1596 AliESDtrack* negTrack = esdEvent->GetTrack(photon->GetTrackLabelNegative());
1597 AliESDtrack* posTrack = esdEvent->GetTrack(photon->GetTrackLabelPositive());
e5b6e8a6 1598
4a0aab28 1599 if(negProbArray && posProbArray){
e5b6e8a6 1600
4a0aab28 1601 negTrack->GetTPCpid(negProbArray);
1602 posTrack->GetTPCpid(posProbArray);
3b77b2d1 1603
4a0aab28 1604 if(negProbArray[AliPID::kElectron]>=fPIDProbabilityCutNegativeParticle && posProbArray[AliPID::kElectron]>=fPIDProbabilityCutPositiveParticle){
1605 iResult=kTRUE;
1606 }
1607 }
e5b6e8a6 1608
4a0aab28 1609 delete [] posProbArray;
1610 delete [] negProbArray;
1611 return iResult;
3b77b2d1 1612
4a0aab28 1613 } else {
3b77b2d1 1614 ///Not possible for AODs
1615 return kTRUE;
4a0aab28 1616 }
3b77b2d1 1617
1618
1619
e5b6e8a6 1620
3b77b2d1 1621}
1622
1623
1624///________________________________________________________________________
1625Bool_t AliConversionCuts::AcceptanceCut(TParticle *particle, TParticle * ePos,TParticle* eNeg){
4a0aab28 1626 // MC Acceptance Cuts
1627 //(Certain areas were excluded for photon reconstruction)
3b77b2d1 1628
4a0aab28 1629 if(particle->R()>fMaxR){
1630 return kFALSE;}
3b77b2d1 1631
4a0aab28 1632 if(ePos->R()>fMaxR){
1633 return kFALSE;
1634 }
3b77b2d1 1635
4a0aab28 1636 if(ePos->R()<fMinR){
1637 return kFALSE;
1638 }
3b77b2d1 1639
e5b6e8a6 1640 if( ePos->R() <= ((abs(ePos->Vz())*fLineCutZRSlope)-fLineCutZValue)){
4a0aab28 1641 return kFALSE;
1642 }
e5b6e8a6 1643 else if (fUseEtaMinCut && ePos->R() >= ((abs(ePos->Vz())*fLineCutZRSlopeMin)-fLineCutZValueMin )){
3b77b2d1 1644 return kFALSE;
4a0aab28 1645 }
3b77b2d1 1646
e5b6e8a6 1647 if(abs(eNeg->Vz()) > fMaxZ ){ // cuts out regions where we do not reconstruct
4a0aab28 1648 return kFALSE;
1649 }
3b77b2d1 1650
4a0aab28 1651 if(eNeg->Vz()!=ePos->Vz()||eNeg->R()!=ePos->R()){
1652 return kFALSE;
1653 }
3b77b2d1 1654
e5b6e8a6 1655 if(abs(ePos->Vz()) > fMaxZ ){ // cuts out regions where we do not reconstruct
4a0aab28 1656 return kFALSE;
1657 }
3b77b2d1 1658
ccfa8c0d 1659
11c1e680 1660 if( particle->Eta() > (fEtaCut + fEtaShift) || particle->Eta() < (-fEtaCut + fEtaShift) ){
4a0aab28 1661 return kFALSE;
1662 }
11c1e680 1663 if( ePos->Eta() > (fEtaCut + fEtaShift) || ePos->Eta() < (-fEtaCut + fEtaShift) ){
4a0aab28 1664 return kFALSE;
1665 }
11c1e680 1666 if( eNeg->Eta() > (fEtaCut + fEtaShift) || eNeg->Eta() < (-fEtaCut + fEtaShift) ){
4a0aab28 1667 return kFALSE;
1668 }
11c1e680 1669 if(fEtaCutMin>-0.1){
1670 if( particle->Eta() < (fEtaCutMin + fEtaShift) && particle->Eta() > (-fEtaCutMin + fEtaShift) ){
1671 return kFALSE;
1672 }
1673 if( ePos->Eta() < (fEtaCutMin + fEtaShift) && ePos->Eta() > (-fEtaCutMin + fEtaShift) ){
1674 return kFALSE;
1675 }
1676 if( eNeg->Eta() < (fEtaCutMin + fEtaShift) && eNeg->Eta() > (-fEtaCutMin + fEtaShift) ){
1677 return kFALSE;
1678 }
1679 }
ccfa8c0d 1680
4a0aab28 1681 if( ePos->Pt()< fSinglePtCut || eNeg->Pt()< fSinglePtCut){
1682 return kFALSE;
1683 }
3b77b2d1 1684
4a0aab28 1685 if(particle->Pt()<fPtCut){
1686 return kFALSE;
1687 }
3b77b2d1 1688
4a0aab28 1689 return kTRUE;
3b77b2d1 1690}
1691///________________________________________________________________________
e5b6e8a6 1692Bool_t AliConversionCuts::UpdateCutString() {
4a0aab28 1693 ///Update the cut string (if it has been created yet)
3b77b2d1 1694
4a0aab28 1695 if(fCutString && fCutString->GetString().Length() == kNCuts) {
1696 fCutString->SetString(GetCutNumber());
1697 } else {
1698 return kFALSE;
1699 }
1700 return kTRUE;
3b77b2d1 1701}
aff90284 1702///________________________________________________________________________
ae947965 1703void AliConversionCuts::LoadReweightingHistosMCFromFile() {
1704
1705 AliInfo("Entering loading of histograms for weighting");
1706 TFile *f = TFile::Open(fPathTrFReweighting.Data());
1707 if(!f){
1708 AliError(Form("file for weighting %s not found",fPathTrFReweighting.Data()));
1709 return;
aff90284 1710 }
ae947965 1711 if (fNameHistoReweightingPi0.CompareTo("") != 0 && fDoReweightHistoMCPi0 ){
aff90284 1712 TH1D *hReweightMCHistPi0temp = (TH1D*)f->Get(fNameHistoReweightingPi0.Data());
1713 hReweightMCHistPi0 = new TH1D(*hReweightMCHistPi0temp);
6feb1680 1714 hReweightMCHistPi0->SetDirectory(0);
ae947965 1715 if (hReweightMCHistPi0) AliInfo(Form("%s has been loaded from %s", fNameHistoReweightingPi0.Data(),fPathTrFReweighting.Data() ));
aff90284 1716 else AliWarning(Form("%s not found in %s", fNameHistoReweightingPi0.Data() ,fPathTrFReweighting.Data()));
fcc79cf5 1717 }
1718 if (fNameFitDataPi0.CompareTo("") != 0 && fDoReweightHistoMCPi0 ){
aff90284 1719 TF1 *fFitDataPi0temp = (TF1*)f->Get(fNameFitDataPi0.Data());
1720 fFitDataPi0 = new TF1(*fFitDataPi0temp);
fcc79cf5 1721 if (fFitDataPi0) AliInfo(Form("%s has been loaded from %s", fNameFitDataPi0.Data(),fPathTrFReweighting.Data() ));
aff90284 1722 else AliWarning(Form("%s not found in %s",fPathTrFReweighting.Data(), fNameFitDataPi0.Data() ));
ae947965 1723 }
aff90284 1724
ae947965 1725 if (fNameHistoReweightingEta.CompareTo("") != 0 && fDoReweightHistoMCEta){
aff90284 1726 TH1D *hReweightMCHistEtatemp = (TH1D*)f->Get(fNameHistoReweightingEta.Data());
1727 hReweightMCHistEta = new TH1D(*hReweightMCHistEtatemp);
6feb1680 1728 hReweightMCHistEta->SetDirectory(0);
ae947965 1729 if (hReweightMCHistEta) AliInfo(Form("%s has been loaded from %s", fNameHistoReweightingEta.Data(),fPathTrFReweighting.Data() ));
aff90284 1730 else AliWarning(Form("%s not found in %s", fNameHistoReweightingEta.Data(),fPathTrFReweighting.Data() ));
fcc79cf5 1731 }
aff90284 1732
fcc79cf5 1733 if (fNameFitDataEta.CompareTo("") != 0 && fDoReweightHistoMCEta){
aff90284 1734 TF1 *fFitDataEtatemp = (TF1*)f->Get(fNameFitDataEta.Data());
1735 fFitDataEta = new TF1(*fFitDataEtatemp);
fcc79cf5 1736 if (fFitDataEta) AliInfo(Form("%s has been loaded from %s", fNameFitDataEta.Data(),fPathTrFReweighting.Data() ));
aff90284 1737 else AliWarning(Form("%s not found in %s", fNameFitDataEta.Data(),fPathTrFReweighting.Data() ));
ae947965 1738
1739 }
1740 if (fNameHistoReweightingK0s.CompareTo("") != 0 && fDoReweightHistoMCK0s){
aff90284 1741 TH1D *hReweightMCHistK0stemp = (TH1D*)f->Get(fNameHistoReweightingK0s.Data());
1742 hReweightMCHistK0s = new TH1D(*hReweightMCHistK0stemp);
6feb1680 1743 hReweightMCHistK0s->SetDirectory(0);
ae947965 1744 if (hReweightMCHistK0s) AliInfo(Form("%s has been loaded from %s", fNameHistoReweightingK0s.Data(),fPathTrFReweighting.Data() ));
aff90284 1745 else AliWarning(Form("%s not found in %s", fNameHistoReweightingK0s.Data(),fPathTrFReweighting.Data() ));
ae947965 1746 }
1747
fcc79cf5 1748 if (fNameFitDataK0s.CompareTo("") != 0 && fDoReweightHistoMCK0s){
aff90284 1749 TF1 *fFitDataK0stemp = (TF1*)f->Get(fNameFitDataK0s.Data());
1750 fFitDataK0s = new TF1(*fFitDataK0stemp);
fcc79cf5 1751 if (fFitDataK0s) AliInfo(Form("%s has been loaded from %s", fNameFitDataK0s.Data(),fPathTrFReweighting.Data() ));
aff90284 1752 else AliWarning(Form("%s not found in %s", fNameFitDataK0s.Data(),fPathTrFReweighting.Data() ));
fcc79cf5 1753 }
6feb1680 1754 f->Close();
1755 delete f;
1756
ae947965 1757}
1758
1759
3b77b2d1 1760///________________________________________________________________________
1761Bool_t AliConversionCuts::InitializeCutsFromCutString(const TString analysisCutSelection ) {
1762 // Initialize Cuts from a given Cut string
fcc79cf5 1763 if(fDoReweightHistoMCPi0 || fDoReweightHistoMCEta || fDoReweightHistoMCK0s) {
1764 AliInfo("Weighting was enabled");
1765 LoadReweightingHistosMCFromFile();
fcc79cf5 1766 }
aff90284 1767
4a0aab28 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));
1771 return kFALSE;
1772 }
1773 if(!analysisCutSelection.IsDigit()){
1774 AliError("Cut selection contains characters");
1775 return kFALSE;
1776 }
e5b6e8a6 1777
4a0aab28 1778 const char *cutSelection = analysisCutSelection.Data();
fcc79cf5 1779#define ASSIGNARRAY(i) fCuts[i] = cutSelection[i] - '0'
4a0aab28 1780 for(Int_t ii=0;ii<kNCuts;ii++){
3b77b2d1 1781 ASSIGNARRAY(ii);
4a0aab28 1782 }
3b77b2d1 1783
4a0aab28 1784 // Set Individual Cuts
1785 for(Int_t ii=0;ii<kNCuts;ii++){
3b77b2d1 1786 if(!SetCut(cutIds(ii),fCuts[ii]))return kFALSE;
4a0aab28 1787 }
3b77b2d1 1788
d0a4ea74 1789 PrintCutsWithValues();
92efd725 1790
4a0aab28 1791 return kTRUE;
3b77b2d1 1792}
1793///________________________________________________________________________
1794Bool_t AliConversionCuts::SetCut(cutIds cutID, const Int_t value) {
4a0aab28 1795 ///Set individual cut ID
3b77b2d1 1796
4a0aab28 1797 switch (cutID) {
e5b6e8a6 1798
4a0aab28 1799 case kv0FinderType:
1800 if( SetV0Finder(value)) {
1801 fCuts[kv0FinderType] = value;
e5b6e8a6 1802 UpdateCutString();
4a0aab28 1803 return kTRUE;
1804 } else return kFALSE;
1805
1806 case kededxSigmaCut:
1807 if( SetTPCdEdxCutElectronLine(value)) {
1808 fCuts[kededxSigmaCut] = value;
e5b6e8a6 1809 UpdateCutString();
4a0aab28 1810 return kTRUE;
1811 } else return kFALSE;
1812
1813 case kpidedxSigmaCut:
1814 if( SetTPCdEdxCutPionLine(value)) {
1815 fCuts[kpidedxSigmaCut] = value;
e5b6e8a6 1816 UpdateCutString();
4a0aab28 1817 return kTRUE;
1818 } else return kFALSE;
1819
1820 case kpiMomdedxSigmaCut:
1821 if( SetMinMomPiondEdxCut(value)) {
1822 fCuts[kpiMomdedxSigmaCut] = value;
e5b6e8a6 1823 UpdateCutString();
4a0aab28 1824 return kTRUE;
1825 } else return kFALSE;
1826
1827 case kchi2GammaCut:
1828 if( SetChi2GammaCut(value)) {
1829 fCuts[kchi2GammaCut] = value;
e5b6e8a6 1830 UpdateCutString();
4a0aab28 1831 return kTRUE;
1832 } else return kFALSE;
1833
1834 case ksinglePtCut:
1835 if( SetSinglePtCut(value)) {
1836 fCuts[ksinglePtCut] = value;
e5b6e8a6 1837 UpdateCutString();
4a0aab28 1838 return kTRUE;
1839 } else return kFALSE;
1840
1841 case kclsTPCCut:
1842 if( SetTPCClusterCut(value)) {
1843 fCuts[kclsTPCCut] = value;
e5b6e8a6 1844 UpdateCutString();
4a0aab28 1845 return kTRUE;
1846 } else return kFALSE;
1847
1848 case ketaCut:
1849 if( SetEtaCut(value)) {
1850 fCuts[ketaCut] = value;
e5b6e8a6 1851 UpdateCutString();
4a0aab28 1852 return kTRUE;
1853 } else return kFALSE;
1854
1855 case kLowPRejectionSigmaCut:
1856 if( SetLowPRejectionCuts(value)) {
1857 fCuts[kLowPRejectionSigmaCut] = value;
e5b6e8a6 1858 UpdateCutString();
4a0aab28 1859 return kTRUE;
1860 } else return kFALSE;
1861
1862 case kQtMaxCut:
1863 if( SetQtMaxCut(value)) {
1864 fCuts[kQtMaxCut] = value;
e5b6e8a6 1865 UpdateCutString();
4a0aab28 1866 return kTRUE;
1867 } else return kFALSE;
1868
1869 case kpiMaxMomdedxSigmaCut:
1870 if( SetMaxMomPiondEdxCut(value)) {
1871 fCuts[kpiMaxMomdedxSigmaCut] = value;
e5b6e8a6 1872 UpdateCutString();
4a0aab28 1873 return kTRUE;
1874 } else return kFALSE;
1875
1876 case kRCut:
1877 if( SetRCut(value)) {
1878 fCuts[kRCut] = value;
e5b6e8a6 1879 UpdateCutString();
4a0aab28 1880 return kTRUE;
1881 } else return kFALSE;
1882
1883 case kremovePileUp:
1884 if( SetRemovePileUp(value)) {
1885 fCuts[kremovePileUp] = value;
e5b6e8a6 1886 UpdateCutString();
4a0aab28 1887 return kTRUE;
1888 } else return kFALSE;
1889
1890 case kselectV0AND:
e5b6e8a6 1891 if( SetSelectSpecialTrigger(value)) {
4a0aab28 1892 fCuts[kselectV0AND] = value;
e5b6e8a6 1893 UpdateCutString();
4a0aab28 1894 return kTRUE;
1895 } else return kFALSE;
1896
1897 case kmultiplicityMethod:
1898 if( SetMultiplicityMethod(value)) {
1899 fCuts[kmultiplicityMethod] = value;
e5b6e8a6 1900 UpdateCutString();
4a0aab28 1901 return kTRUE;
1902 } else return kFALSE;
1903
1904 case kisHeavyIon:
1905 if( SetIsHeavyIon(value)) {
1906 fCuts[kisHeavyIon] = value;
e5b6e8a6 1907 UpdateCutString();
4a0aab28 1908 return kTRUE;
1909 } else return kFALSE;
1910
1911 case kCentralityMin:
1912 if( SetCentralityMin(value)) {
1913 fCuts[kCentralityMin] = value;
e5b6e8a6 1914 UpdateCutString();
4a0aab28 1915 return kTRUE;
1916 } else return kFALSE;
1917
1918 case kCentralityMax:
1919 if( SetCentralityMax(value)) {
1920 fCuts[kCentralityMax] = value;
e5b6e8a6 1921 UpdateCutString();
4a0aab28 1922 return kTRUE;
1923 } else return kFALSE;
1924
1925 case kTOFelectronPID:
1926 if( SetTOFElectronPIDCut(value)) {
1927 fCuts[kTOFelectronPID] = value;
e5b6e8a6 1928 UpdateCutString();
4a0aab28 1929 return kTRUE;
1930 } else return kFALSE;
1931
1932 case kdoPhotonAsymmetryCut:
1933 if( SetPhotonAsymmetryCut(value)) {
1934 fCuts[kdoPhotonAsymmetryCut] = value;
e5b6e8a6 1935 UpdateCutString();
4a0aab28 1936 return kTRUE;
1937 } else return kFALSE;
1938
1939 case kPsiPair:
1940 if( SetPsiPairCut(value)) {
1941 fCuts[kPsiPair] = value;
e5b6e8a6 1942 UpdateCutString();
4a0aab28 1943 return kTRUE;
1944 } else return kFALSE;
1945
1946 case kCosPAngle:
1947 if( SetCosPAngleCut(value)) {
1948 fCuts[kCosPAngle] = value;
e5b6e8a6 1949 UpdateCutString();
4a0aab28 1950 return kTRUE;
1951 } else return kFALSE;
1952
1953
1954 case kElecShare:
1955 if( SetSharedElectronCut(value)) {
1956 fCuts[kElecShare] = value;
e5b6e8a6 1957 UpdateCutString();
4a0aab28 1958 return kTRUE;
1959 } else return kFALSE;
1960
4a0aab28 1961 case kToCloseV0s:
1962 if( SetToCloseV0sCut(value)) {
1963 fCuts[kToCloseV0s] = value;
e5b6e8a6 1964 UpdateCutString();
4a0aab28 1965 return kTRUE;
1966 } else return kFALSE;
1967
1968 case kExtraSignals:
1969 if( SetRejectExtraSignalsCut(value)) {
1970 fCuts[kExtraSignals] = value;
e5b6e8a6 1971 UpdateCutString();
4a0aab28 1972 return kTRUE;
1973 } else return kFALSE;
1974
4803eb1f 1975 case kDcaRPrimVtx:
1976 if( SetDCARPhotonPrimVtxCut(value)) {
1977 fCuts[kDcaRPrimVtx] = value;
1978 UpdateCutString();
1979 return kTRUE;
1980 } else return kFALSE;
1981
1982 case kDcaZPrimVtx:
1983 if( SetDCAZPhotonPrimVtxCut(value)) {
1984 fCuts[kDcaZPrimVtx] = value;
1985 UpdateCutString();
1986 return kTRUE;
1987 } else return kFALSE;
1988
ae4f2cfb 1989 case kInPlaneOutOfPlane:
1990 if( SetInPlaneOutOfPlane(value)) {
1991 fCuts[kInPlaneOutOfPlane] = value;
1992 UpdateCutString();
1993 return kTRUE;
1994 } else return kFALSE;
1995
1996
1997
aff90284 1998
4a0aab28 1999 case kNCuts:
92efd725 2000 AliError("Cut id out of range");
4a0aab28 2001 return kFALSE;
2002 }
d008165e 2003
4a0aab28 2004 AliError("Cut id %d not recognized");
2005 return kFALSE;
3b77b2d1 2006
e5b6e8a6 2007
3b77b2d1 2008}
2009///________________________________________________________________________
e5b6e8a6 2010void AliConversionCuts::PrintCuts() {
2011 // Print out current Cut Selection
2012 for(Int_t ic = 0; ic < kNCuts; ic++) {
2013 printf("%-30s : %d \n", fgkCutNames[ic], fCuts[ic]);
2014 }
2015}
d0a4ea74
FB
2016
2017void AliConversionCuts::PrintCutsWithValues() {
2018 // Print out current Cut Selection with value
2019 if (fIsHeavyIon == 0) {
2020 printf("Running in pp mode \n");
2021 if (fSpecialTrigger == 0){
2022 printf("\t only events triggered by V0OR will be analysed \n");
2023 } else if (fSpecialTrigger == 1){
2024 printf("\t only events triggered by V0AND will be analysed \n");
2025 } else if (fSpecialTrigger == 2){
2026 printf("\t only events where SDD was present will be analysed \n");
2027 } else if (fSpecialTrigger == 3){
2028 printf("\t only events where SDD was present will be analysed and triggered by VOAND\n");
2029 } else if (fSpecialTrigger > 3){
2030 printf("\t only events triggered by %s \n", fSpecialTriggerName.Data());
2031 }
2032 } else if (fIsHeavyIon == 1){
2033 printf("Running in PbPb mode \n");
2034 if (fDetectorCentrality == 0){
2035 printf("\t centrality selection based on V0M \n");
2036 } else if (fDetectorCentrality == 1){
2037 printf("\t centrality selection based on Cl1 \n");
2038 }
2039 if (fModCentralityClass == 0){
2040 printf("\t %d - %d \n", fCentralityMin*10, fCentralityMax*10);
2041 } else if ( fModCentralityClass == 1){
2042 printf("\t %d - %d \n", fCentralityMin*5, fCentralityMax*5);
2043 } else if ( fModCentralityClass == 2){
2044 printf("\t %d - %d \n", fCentralityMin*5+45, fCentralityMax*5+45);
2045 } else if (fModCentralityClass == 3){
2046 printf("\t %d - %d, with Track mult in MC as data \n", fCentralityMin*10, fCentralityMax*10);
2047 } else if ( fModCentralityClass == 4){
2048 printf("\t %d - %d, with Track mult in MC as data \n", fCentralityMin*5, fCentralityMax*5);
2049 } else if ( fModCentralityClass == 5){
2050 printf("\t %d - %d, with Track mult in MC as data \n", fCentralityMin*5+45, fCentralityMax*5+45);
2051 }
2052 if (fSpecialTrigger == 0){
2053 printf("\t only events triggered by kMB, kCentral, kSemiCentral will be analysed \n");
2054 } else if (fSpecialTrigger > 4){
2055 printf("\t only events triggered by %s \n", fSpecialTriggerName.Data());
2056 }
2057 } else if (fIsHeavyIon == 2){
2058 printf("Running in pPb mode \n");
2059 if (fDetectorCentrality == 0){
2060 printf("\t centrality selection based on V0A \n");
2061 } else if (fDetectorCentrality == 1){
2062 printf("\t centrality selection based on Cl1 \n");
2063 }
2064 if (fModCentralityClass == 0){
2065 printf("\t %d - %d \n", fCentralityMin*10, fCentralityMax*10);
2066 }
2067 if (fSpecialTrigger == 0){
2068 printf("\t only events triggered by kINT7 will be analysed \n");
2069 } else if (fSpecialTrigger > 4){
2070 printf("\t only events triggered by %s \n", fSpecialTriggerName.Data());
2071 }
2072 }
2073
2074
2075
2076
2077}
2078
e5b6e8a6 2079///________________________________________________________________________
2080Bool_t AliConversionCuts::SetIsHeavyIon(Int_t isHeavyIon)
2081{ // Set Cut
2082 switch(isHeavyIon){
4a0aab28 2083 case 0:
e5b6e8a6 2084 fIsHeavyIon=0;
4a0aab28 2085 break;
2086 case 1:
e5b6e8a6 2087 fIsHeavyIon=1;
2088 fDetectorCentrality=0;
2089 break;
2090 case 2:
2091 fIsHeavyIon=1;
2092 fDetectorCentrality=1;
2093 break;
2094 case 3: //allows to select centrality 0-45% in steps of 5% for V0 Multiplicity
2095 fIsHeavyIon=1;
2096 fDetectorCentrality=0;
2097 fModCentralityClass=1;
2098 break;
2099 case 4: //allows to select centrality 45-90% in steps of 5% for V0 Multiplicity
2100 fIsHeavyIon=1;
2101 fDetectorCentrality=0;
2102 fModCentralityClass=2;
2103 break;
2104 case 5: //strict cut on v0 tracks for MC
2105 fIsHeavyIon=1;
2106 fDetectorCentrality=0;
2107 fModCentralityClass=3;
2108 break;
4803eb1f 2109 case 6: //allows to select centrality 0-45% in steps of 5% for track mult
e5b6e8a6 2110 //strict cut on v0 tracks for MC
2111 fIsHeavyIon=1;
2112 fDetectorCentrality=0;
2113 fModCentralityClass=4;
2114 break;
2115 case 7: //allows to select centrality 45-90% in steps of 5% for V0 Multiplicity
2116 //strict cut on v0 tracks for MC
2117 fIsHeavyIon=1;
2118 fDetectorCentrality=0;
2119 fModCentralityClass=5;
4a0aab28 2120 break;
0a2b2b4b 2121 case 8:
2122 fIsHeavyIon=2;
2123 fDetectorCentrality=0;
2124 break;
2125 case 9:
2126 fIsHeavyIon=2;
2127 fDetectorCentrality=1;
11c1e680 2128 break;
4a0aab28 2129 default:
e5b6e8a6 2130 AliError(Form("SetHeavyIon not defined %d",isHeavyIon));
4a0aab28 2131 return kFALSE;
2132 }
2133 return kTRUE;
3b77b2d1 2134}
0a2b2b4b 2135
e5b6e8a6 2136//___________________________________________________________________
2137Bool_t AliConversionCuts::SetCentralityMin(Int_t minCentrality)
2138{
2139 // Set Cut
2140 if(minCentrality<0||minCentrality>9){
2141 AliError(Form("minCentrality not defined %d",minCentrality));
2142 return kFALSE;
2143 }
3b77b2d1 2144
e5b6e8a6 2145 fCentralityMin=minCentrality;
2146 return kTRUE;
2147}
2148//___________________________________________________________________
2149Bool_t AliConversionCuts::SetCentralityMax(Int_t maxCentrality)
2150{
2151 // Set Cut
2152 if(maxCentrality<0||maxCentrality>9){
2153 AliError(Form("maxCentrality not defined %d",maxCentrality));
2154 return kFALSE;
2155 }
2156 fCentralityMax=maxCentrality;
2157 return kTRUE;
2158}
3b77b2d1 2159///________________________________________________________________________
e5b6e8a6 2160Int_t AliConversionCuts::SetSelectSpecialTrigger(Int_t selectSpecialTrigger)
3b77b2d1 2161{// Set Cut
e5b6e8a6 2162
2163 switch(selectSpecialTrigger){
4a0aab28 2164 case 0:
e5b6e8a6 2165 fSpecialTrigger=0; // dont care
3b77b2d1 2166 break;
4a0aab28 2167 case 1:
e5b6e8a6 2168 fSpecialTrigger=1; // V0AND
2169 break;
2170 case 2:
2171 fSpecialTrigger=2; // with SDD requested
2172 break;
2173 case 3:
2174 fSpecialTrigger=3; // V0AND plus with SDD requested
3b77b2d1 2175 break;
aff90284 2176 // allows to run MB & 6 other different trigger classes in parallel with the same photon cut
2177 case 4:
ae947965 2178 fSpecialTrigger=4; // different trigger class as MB
2179 fTriggerSelectedManually = kTRUE;
2180 break;
aff90284 2181 case 5:
ae947965 2182 fSpecialTrigger=4; // different trigger class as MB
2183 fTriggerSelectedManually = kTRUE;
2184 break;
aff90284 2185 case 6:
ae947965 2186 fSpecialTrigger=4; // different trigger class as MB
2187 fTriggerSelectedManually = kTRUE;
2188 break;
aff90284 2189 case 7:
ae947965 2190 fSpecialTrigger=4; // different trigger class as MB
2191 fTriggerSelectedManually = kTRUE;
2192 break;
aff90284 2193 case 8:
ae947965 2194 fSpecialTrigger=4; // different trigger class as MB
2195 fTriggerSelectedManually = kTRUE;
aff90284 2196 break;
2197 case 9:
ae947965 2198 fSpecialTrigger=4; // different trigger class as MB
2199 fTriggerSelectedManually = kTRUE;
aff90284 2200 break;
4a0aab28 2201 default:
e5b6e8a6 2202 AliError("Warning: Special Trigger Not known");
3b77b2d1 2203 return kFALSE;
4a0aab28 2204 }
2205 return kTRUE;
3b77b2d1 2206}
3b77b2d1 2207///________________________________________________________________________
92efd725 2208Bool_t AliConversionCuts::SetMultiplicityMethod(Int_t multiplicityMethod)
2209{
4a0aab28 2210 // Set Cut
2211 fMultiplicityMethod=multiplicityMethod;
92efd725 2212
4a0aab28 2213 // 0 Photon Multiplicity
2214 // 1 TPC Track multiplicity
2215 // 2 V0 Mult
2216 // 3 SPD Mult
92efd725 2217
4a0aab28 2218 return kTRUE;
3b77b2d1 2219}
3b77b2d1 2220///________________________________________________________________________
e5b6e8a6 2221Bool_t AliConversionCuts::SetRemovePileUp(Int_t removePileUp)
2222{// Set Cut
2223 switch(removePileUp){
2224 case 0:
2225 fRemovePileUp=kFALSE;
2226 break;
2227 case 1:
2228 fRemovePileUp=kTRUE;
2229 break;
2230 default:
2231 AliError("RemovePileUpCut not defined");
2232 return kFALSE;
4a0aab28 2233 }
e5b6e8a6 2234 return kTRUE;
3b77b2d1 2235}
3b77b2d1 2236///________________________________________________________________________
e5b6e8a6 2237Bool_t AliConversionCuts::SetRejectExtraSignalsCut(Int_t extraSignal) {
2238
2239 switch(extraSignal){
4a0aab28 2240 case 0:
e5b6e8a6 2241 fRejectExtraSignals = 0;
2242 break; // No Rejection
4a0aab28 2243 case 1:
e5b6e8a6 2244 fRejectExtraSignals = 1;
2245 break; // MinBias Header
4a0aab28 2246 case 2:
e5b6e8a6 2247 fRejectExtraSignals = 2;
2248 break; // User String Array
4a0aab28 2249 case 3:
e5b6e8a6 2250 fRejectExtraSignals = 3;
2251 break; // Rejection for Gamma Correction only
2252 default:
2253 AliError(Form("Extra Signal Rejection not defined %d",extraSignal));
2254 return kFALSE;
2255 }
2256 return kTRUE;
2257}
2258///________________________________________________________________________
2259Bool_t AliConversionCuts::SetV0Finder(Int_t v0FinderType)
2260{ // Set Cut
2261 switch (v0FinderType){
2262 case 0: // on fly V0 finder
ccfa8c0d 2263 cout << "have chosen onfly V0" << endl;
e5b6e8a6 2264 fUseOnFlyV0Finder=kTRUE;
4a0aab28 2265 break;
e5b6e8a6 2266 case 1: // offline V0 finder
ccfa8c0d 2267 cout << "have chosen offline V0" << endl;
e5b6e8a6 2268 fUseOnFlyV0Finder=kFALSE;
4a0aab28 2269 break;
4a0aab28 2270 default:
e5b6e8a6 2271 AliError(Form(" v0FinderType not defined %d",v0FinderType));
4a0aab28 2272 return kFALSE;
2273 }
2274 return kTRUE;
3b77b2d1 2275}
3b77b2d1 2276///________________________________________________________________________
e5b6e8a6 2277Bool_t AliConversionCuts::SetEtaCut(Int_t etaCut)
3b77b2d1 2278{ // Set Cut
e5b6e8a6 2279
2280 //Set Standard LineCutZValues
2281 fLineCutZValueMin = -2;
2282 fLineCutZValue = 7.;
2283
2284 switch(etaCut){
2285 case 0: // 0.9
fcc79cf5 2286 fEtaCut = 0.9;
e5b6e8a6 2287 fLineCutZRSlope = tan(2*atan(exp(-fEtaCut)));
fcc79cf5 2288 fEtaCutMin = -0.1;
e5b6e8a6 2289 fLineCutZRSlopeMin = 0.;
4a0aab28 2290 break;
c9663716 2291 case 1: // 0.6 // changed from 1.2 to 0.6 on 2013.06.10
fcc79cf5 2292 fEtaCut = 0.6;
e5b6e8a6 2293 fLineCutZRSlope = tan(2*atan(exp(-fEtaCut)));
fcc79cf5 2294 fEtaCutMin = -0.1;
e5b6e8a6 2295 fLineCutZRSlopeMin = 0.;
4a0aab28 2296 break;
fcc79cf5 2297 case 2: // 1.4
2298 fEtaCut = 1.4;
e5b6e8a6 2299 fLineCutZRSlope = tan(2*atan(exp(-fEtaCut)));
fcc79cf5 2300 fEtaCutMin = -0.1;
e5b6e8a6 2301 fLineCutZRSlopeMin = 0.;
4a0aab28 2302 break;
c9663716 2303 case 3: // 0.65
2304 fEtaCut = 0.65;
e5b6e8a6 2305 fLineCutZRSlope = tan(2*atan(exp(-fEtaCut)));
fcc79cf5 2306 fEtaCutMin = -0.1;
e5b6e8a6 2307 fLineCutZRSlopeMin = 0.;
4a0aab28 2308 break;
a280ac15 2309 case 4: // 0.75
fcc79cf5 2310 fEtaCut = 0.75;
e5b6e8a6 2311 fLineCutZRSlope = tan(2*atan(exp(-fEtaCut)));
fcc79cf5 2312 fEtaCutMin = -0.1;
e5b6e8a6 2313 fLineCutZRSlopeMin = 0.;
4a0aab28 2314 break;
11c1e680 2315 case 5: // 0.5
fcc79cf5 2316 fEtaCut = 0.5;
e5b6e8a6 2317 fLineCutZRSlope = tan(2*atan(exp(-fEtaCut)));
fcc79cf5 2318 fEtaCutMin = -0.1;
11c1e680 2319 fLineCutZRSlopeMin = 0.;
4a0aab28 2320 break;
e5b6e8a6 2321 case 6: // 5.
fcc79cf5 2322 fEtaCut = 5.;
e5b6e8a6 2323 fLineCutZRSlope = tan(2*atan(exp(-fEtaCut)));
fcc79cf5 2324 fEtaCutMin = -0.1;
e5b6e8a6 2325 fLineCutZRSlopeMin = 0.;
4a0aab28 2326 break;
ccfa8c0d 2327 case 7:
c9663716 2328 if (fIsHeavyIon==1){
2329 fEtaCut = 0.7;
2330 fLineCutZRSlope = tan(2*atan(exp(-fEtaCut)));
2331 fEtaCutMin = -0.1;
2332 fLineCutZRSlopeMin = 0.;
2333 break;
6fa95389 2334 } else {
c9663716 2335 fEtaCut = 0.3;
2336 fLineCutZRSlope = tan(2*atan(exp(-fEtaCut)));
2337 fEtaCutMin = -0.1;
2338 fLineCutZRSlopeMin = 0.;
2339 break;
2340 }
11c1e680 2341 // case 8: // 0.1 - 0.8
fcc79cf5 2342 // fEtaCut = 0.9;
11c1e680 2343 // fLineCutZRSlope = tan(2*atan(exp(-fEtaCut)));
fcc79cf5 2344 // fEtaCutMin = 0.1;
11c1e680 2345 // fLineCutZRSlopeMin = tan(2*atan(exp(-fEtaCutMin)));
2346 // break;
2347 case 8: // 0.4
fcc79cf5 2348 fEtaCut = 0.4;
e5b6e8a6 2349 fLineCutZRSlope = tan(2*atan(exp(-fEtaCut)));
fcc79cf5 2350 fEtaCutMin = -0.1;
11c1e680 2351 fLineCutZRSlopeMin = 0.;
e5b6e8a6 2352 break;
2353 case 9: // 10
fcc79cf5 2354 fEtaCut = 10;
e5b6e8a6 2355 fLineCutZRSlope = tan(2*atan(exp(-fEtaCut)));
fcc79cf5 2356 fEtaCutMin = -0.1;
e5b6e8a6 2357 fLineCutZRSlopeMin = 0.;
4a0aab28 2358 break;
2359 default:
e5b6e8a6 2360 AliError(Form(" EtaCut not defined %d",etaCut));
4a0aab28 2361 return kFALSE;
4a0aab28 2362 }
2363 return kTRUE;
3b77b2d1 2364}
3b77b2d1 2365///________________________________________________________________________
e5b6e8a6 2366Bool_t AliConversionCuts::SetRCut(Int_t RCut){
2367 // Set Cut
2368 switch(RCut){
2369 case 0:
2370 fMinR=0;
2371 fMaxR = 180.;
4a0aab28 2372 break;
e5b6e8a6 2373 case 1:
2374 fMinR=2.8;
2375 fMaxR = 180.;
4a0aab28 2376 break;
e5b6e8a6 2377 case 2:
2378 fMinR=5.;
2379 fMaxR = 180.;
4a0aab28 2380 break;
e5b6e8a6 2381 case 3:
2382 fMaxR = 70.;
2383 fMinR = 10.;
4a0aab28 2384 break;
e5b6e8a6 2385 case 4:
2386 fMaxR = 70.;
2387 fMinR = 5.;
4a0aab28 2388 break;
e5b6e8a6 2389 // High purity cuts for PbPb (remove first layers of material)
2390 case 5:
2391 fMaxR = 180.;
2392 fMinR = 10.;
4a0aab28 2393 break;
e5b6e8a6 2394 case 6:
2395 fMaxR = 180.;
2396 fMinR = 20.;
4a0aab28 2397 break;
e5b6e8a6 2398 case 7:
2399 fMaxR = 180.;
2400 fMinR = 26.;
4a0aab28 2401 break;
e5b6e8a6 2402 case 8:
2403 fMaxR = 180.;
72395bd9 2404 fMinR = 12.5;
4a0aab28 2405 break;
2406 case 9:
72395bd9 2407 fMaxR = 180.;
2408 fMinR = 7.5;
4a0aab28 2409 break;
e5b6e8a6 2410
4a0aab28 2411 default:
e5b6e8a6 2412 AliError("RCut not defined");
4a0aab28 2413 return kFALSE;
2414 }
2415 return kTRUE;
92efd725 2416}
92efd725 2417///________________________________________________________________________
e5b6e8a6 2418Bool_t AliConversionCuts::SetSinglePtCut(Int_t singlePtCut)
92efd725 2419{ // Set Cut
e5b6e8a6 2420 switch(singlePtCut){
2421 case 0: // 0.050 GeV
2422 fSinglePtCut = 0.050;
4a0aab28 2423 break;
e5b6e8a6 2424 case 1: // 0.100 GeV
2425 fSinglePtCut = 0.100;
4a0aab28 2426 break;
e5b6e8a6 2427 case 2: // 0.150 GeV
2428 fSinglePtCut = 0.150;
4a0aab28 2429 break;
e5b6e8a6 2430 case 3: // 0.200 GeV
2431 fSinglePtCut = 0.200;
4a0aab28 2432 break;
e5b6e8a6 2433 case 4: // 0.075 GeV
2434 fSinglePtCut = 0.075;
4a0aab28 2435 break;
e5b6e8a6 2436 case 5: // 0.125 GeV
2437 fSinglePtCut = 0.125;
4a0aab28 2438 break;
e5b6e8a6 2439 case 6: // 0.04 GeV
2440 fSinglePtCut = 0.040;
4a0aab28 2441 break;
e5b6e8a6 2442 case 7: // 0.0 GeV
2443 fSinglePtCut = 0.0;
4a0aab28 2444 break;
2445 default:
e5b6e8a6 2446 AliError(Form("singlePtCut not defined %d",singlePtCut));
4a0aab28 2447 return kFALSE;
2448 }
2449 return kTRUE;
3b77b2d1 2450}
3b77b2d1 2451///________________________________________________________________________
e5b6e8a6 2452Bool_t AliConversionCuts::SetTPCClusterCut(Int_t clsTPCCut)
3b77b2d1 2453{ // Set Cut
e5b6e8a6 2454 switch(clsTPCCut){
2455 case 0: // 0
2456 fMinClsTPC= 0.;
4a0aab28 2457 break;
ccfa8c0d 2458 case 1: // 60
2459 fMinClsTPC= 60.;
4a0aab28 2460 break;
e5b6e8a6 2461 case 2: // 80
2462 fMinClsTPC= 80.;
4a0aab28 2463 break;
e5b6e8a6 2464 case 3: // 100
2465 fMinClsTPC= 100.;
4a0aab28 2466 break;
ccfa8c0d 2467 case 4: // 95% of findable clusters
2468 fMinClsTPCToF= 0.95;
2469 fUseCorrectedTPCClsInfo=1;
4a0aab28 2470 break;
e5b6e8a6 2471 case 5: // 0% of findable clusters
2472 fMinClsTPCToF= 0.0;
2473 fUseCorrectedTPCClsInfo=1;
4a0aab28 2474 break;
e5b6e8a6 2475 case 6: // 70% of findable clusters
2476 fMinClsTPCToF= 0.7;
2477 fUseCorrectedTPCClsInfo=1;
4a0aab28 2478 break;
e5b6e8a6 2479 case 7: // 0% of findable clusters
2480 fMinClsTPCToF= 0.35;
2481 fUseCorrectedTPCClsInfo=0;
4a0aab28 2482 break;
2483 case 8:
e5b6e8a6 2484 fMinClsTPCToF= 0.35;
2485 fUseCorrectedTPCClsInfo=1;
4a0aab28 2486 break;
2487 case 9:
e5b6e8a6 2488 fMinClsTPCToF= 0.6;
2489 fUseCorrectedTPCClsInfo=1;
4a0aab28 2490 break;
2491 default:
e5b6e8a6 2492 AliError(Form("Warning: clsTPCCut not defined %d",clsTPCCut));
4a0aab28 2493 return kFALSE;
2494 }
2495 return kTRUE;
3b77b2d1 2496}
3b77b2d1 2497///________________________________________________________________________
e5b6e8a6 2498Bool_t AliConversionCuts::SetTPCdEdxCutElectronLine(Int_t ededxSigmaCut)
3b77b2d1 2499{ // Set Cut
e5b6e8a6 2500 switch(ededxSigmaCut){
2501 case 0: // -10,10
2502 fPIDnSigmaBelowElectronLine=-10;
2503 fPIDnSigmaAboveElectronLine=10;
4a0aab28 2504 break;
e5b6e8a6 2505 case 1: // -5,5
2506 fPIDnSigmaBelowElectronLine=-5;
2507 fPIDnSigmaAboveElectronLine=5;
4a0aab28 2508 break;
e5b6e8a6 2509 case 2: // -3,5
2510 fPIDnSigmaBelowElectronLine=-3;
2511 fPIDnSigmaAboveElectronLine=5;
4a0aab28 2512 break;
e5b6e8a6 2513 case 3: // -4,5
2514 fPIDnSigmaBelowElectronLine=-4;
2515 fPIDnSigmaAboveElectronLine=5;
4a0aab28 2516 break;
e5b6e8a6 2517 case 4: // -6,7
2518 fPIDnSigmaBelowElectronLine=-6;
2519 fPIDnSigmaAboveElectronLine=7;
4a0aab28 2520 break;
e5b6e8a6 2521 case 5: // -4,4
2522 fPIDnSigmaBelowElectronLine=-4;
2523 fPIDnSigmaAboveElectronLine=4;
4a0aab28 2524 break;
e5b6e8a6 2525 case 6: // -2.5,4
2526 fPIDnSigmaBelowElectronLine=-2.5;
2527 fPIDnSigmaAboveElectronLine=4;
4a0aab28 2528 break;
e5b6e8a6 2529 case 7: // -2,3.5
2530 fPIDnSigmaBelowElectronLine=-2;
2531 fPIDnSigmaAboveElectronLine=3.5;
4a0aab28 2532 break;
2533 default:
e5b6e8a6 2534 AliError("TPCdEdxCutElectronLine not defined");
4a0aab28 2535 return kFALSE;
e5b6e8a6 2536
4a0aab28 2537 }
2538 return kTRUE;
3b77b2d1 2539}
2540///________________________________________________________________________
e5b6e8a6 2541Bool_t AliConversionCuts::SetTPCdEdxCutPionLine(Int_t pidedxSigmaCut)
3b77b2d1 2542{ // Set Cut
e5b6e8a6 2543
2544 switch(pidedxSigmaCut){
2545 case 0: // -10
2546 fPIDnSigmaAbovePionLine=-10;
2547 fPIDnSigmaAbovePionLineHighPt=-10;
4a0aab28 2548 break;
e5b6e8a6 2549 case 1: // 0
2550 fPIDnSigmaAbovePionLine=0;
2551 fPIDnSigmaAbovePionLineHighPt=-10;
4a0aab28 2552 break;
e5b6e8a6 2553 case 2: // 1
2554 fPIDnSigmaAbovePionLine=1;
2555 fPIDnSigmaAbovePionLineHighPt=-10;
4a0aab28 2556 break;
e5b6e8a6 2557 case 3: // 1
2558 fPIDnSigmaAbovePionLine=2.5;
2559 fPIDnSigmaAbovePionLineHighPt=-10;
4a0aab28 2560 break;
e5b6e8a6 2561 case 4: // 1
2562 fPIDnSigmaAbovePionLine=0.5;
2563 fPIDnSigmaAbovePionLineHighPt=-10;
4a0aab28 2564 break;
e5b6e8a6 2565 case 5: // 1
2566 fPIDnSigmaAbovePionLine=2.;
2567 fPIDnSigmaAbovePionLineHighPt=-10;
4a0aab28 2568 break;
e5b6e8a6 2569 case 6: // 1
2570 fPIDnSigmaAbovePionLine=2.;
2571 fPIDnSigmaAbovePionLineHighPt=0.5;
4a0aab28 2572 break;
e5b6e8a6 2573 case 7: // 1
2574 fPIDnSigmaAbovePionLine=3.5;
2575 fPIDnSigmaAbovePionLineHighPt=-10;
4a0aab28 2576 break;
e5b6e8a6 2577 case 8: // 1
2578 fPIDnSigmaAbovePionLine=2.;
2579 fPIDnSigmaAbovePionLineHighPt=1.;
4a0aab28 2580 break;
2581 case 9:
e5b6e8a6 2582 fPIDnSigmaAbovePionLine=3.0; // We need a bit less tight cut on dE/dx
2583 fPIDnSigmaAbovePionLineHighPt=-10;
4a0aab28 2584 break;
2585 default:
e5b6e8a6 2586 AliError(Form("Warning: pidedxSigmaCut not defined %d",pidedxSigmaCut));
4a0aab28 2587 return kFALSE;
2588 }
2589 return kTRUE;
3b77b2d1 2590}
3b77b2d1 2591///________________________________________________________________________
e5b6e8a6 2592Bool_t AliConversionCuts::SetMinMomPiondEdxCut(Int_t piMomdedxSigmaCut)
3b77b2d1 2593{ // Set Cut
e5b6e8a6 2594 switch(piMomdedxSigmaCut){
2595 case 0: // 0.5 GeV
2596 fPIDMinPnSigmaAbovePionLine=0.5;
4a0aab28 2597 break;
e5b6e8a6 2598 case 1: // 1. GeV
2599 fPIDMinPnSigmaAbovePionLine=1.;
4a0aab28 2600 break;
e5b6e8a6 2601 case 2: // 1.5 GeV
2602 fPIDMinPnSigmaAbovePionLine=1.5;
4a0aab28 2603 break;
e5b6e8a6 2604 case 3: // 20.0 GeV
2605 fPIDMinPnSigmaAbovePionLine=20.;
4a0aab28 2606 break;
e5b6e8a6 2607 case 4: // 50.0 GeV
2608 fPIDMinPnSigmaAbovePionLine=50.;
4a0aab28 2609 break;
e5b6e8a6 2610 case 5: // 0.3 GeV
2611 fPIDMinPnSigmaAbovePionLine=0.3;
4a0aab28 2612 break;
e5b6e8a6 2613 case 6: // 0.25 GeV
2614 fPIDMinPnSigmaAbovePionLine=0.25;
4a0aab28 2615 break;
e5b6e8a6 2616 case 7: // 0.4 GeV
2617 fPIDMinPnSigmaAbovePionLine=0.4;
4a0aab28 2618 break;
e5b6e8a6 2619 case 8: // 0.2 GeV
2620 fPIDMinPnSigmaAbovePionLine=0.2;
4a0aab28 2621 break;
2622 default:
e5b6e8a6 2623 AliError(Form("piMomdedxSigmaCut not defined %d",piMomdedxSigmaCut));
4a0aab28 2624 return kFALSE;
2625 }
2626 return kTRUE;
3b77b2d1 2627}
3b77b2d1 2628///________________________________________________________________________
2629Bool_t AliConversionCuts::SetMaxMomPiondEdxCut(Int_t piMaxMomdedxSigmaCut)
2630{ // Set Cut
4a0aab28 2631 switch(piMaxMomdedxSigmaCut){
2632 case 0: // 100. GeV
2633 fPIDMaxPnSigmaAbovePionLine=100.;
2634 break;
2635 case 1: // 5. GeV
2636 fPIDMaxPnSigmaAbovePionLine=5.;
2637 break;
2638 case 2: // 4. GeV
2639 fPIDMaxPnSigmaAbovePionLine=4.;
2640 break;
2641 case 3: // 3.5 GeV
2642 fPIDMaxPnSigmaAbovePionLine=3.5;
2643 break;
2644 case 4: // 3. GeV
2645 fPIDMaxPnSigmaAbovePionLine=3.;
2646 break;
e5b6e8a6 2647 case 5: // 7. GeV
2648 fPIDMaxPnSigmaAbovePionLine=7.;
4a0aab28 2649 break;
2650 default:
e5b6e8a6 2651 AliError(Form("piMaxMomdedxSigmaCut not defined %d",piMaxMomdedxSigmaCut));
4a0aab28 2652 return kFALSE;
92efd725 2653 }
2654 return kTRUE;
3b77b2d1 2655}
3b77b2d1 2656///________________________________________________________________________
2657Bool_t AliConversionCuts::SetLowPRejectionCuts(Int_t LowPRejectionSigmaCut)
2658{ // Set Cut
4a0aab28 2659 switch(LowPRejectionSigmaCut){
2660 case 0: //
2661 fPIDnSigmaAtLowPAroundKaonLine=0;
2662 fPIDnSigmaAtLowPAroundProtonLine=0;
2663 fPIDnSigmaAtLowPAroundPionLine=0;
e5b6e8a6 2664 fDoKaonRejectionLowP = kFALSE;
2665 fDoProtonRejectionLowP = kFALSE;
2666 fDoPionRejectionLowP = kFALSE;
2667 fPIDMinPPionRejectionLowP = fPIDMinPnSigmaAbovePionLine;
4a0aab28 2668 break;
2669 case 1: //
2670 fPIDnSigmaAtLowPAroundKaonLine=0.5;
2671 fPIDnSigmaAtLowPAroundProtonLine=0.5;
2672 fPIDnSigmaAtLowPAroundPionLine=0.5;
e5b6e8a6 2673 fDoKaonRejectionLowP = kTRUE;
2674 fDoProtonRejectionLowP = kTRUE;
2675 fDoPionRejectionLowP = kTRUE;
2676 fPIDMinPPionRejectionLowP = fPIDMinPnSigmaAbovePionLine;
4a0aab28 2677 break;
2678 case 2: //
2679 fPIDnSigmaAtLowPAroundKaonLine=1;
2680 fPIDnSigmaAtLowPAroundProtonLine=1;
2681 fPIDnSigmaAtLowPAroundPionLine=1;
e5b6e8a6 2682 fDoKaonRejectionLowP = kTRUE;
2683 fDoProtonRejectionLowP = kTRUE;
2684 fDoPionRejectionLowP = kTRUE;
2685 fPIDMinPPionRejectionLowP = fPIDMinPnSigmaAbovePionLine;
4a0aab28 2686 break;
2687 case 3: //
2688 fPIDnSigmaAtLowPAroundKaonLine=2.;
2689 fPIDnSigmaAtLowPAroundProtonLine=2.;
2690 fPIDnSigmaAtLowPAroundPionLine=2.;
e5b6e8a6 2691 fDoKaonRejectionLowP = kTRUE;
2692 fDoProtonRejectionLowP = kTRUE;
2693 fDoPionRejectionLowP = kTRUE;
2694 fPIDMinPPionRejectionLowP = fPIDMinPnSigmaAbovePionLine;
4a0aab28 2695 break;
2696 case 4: //
2697 fPIDnSigmaAtLowPAroundKaonLine=0.;
2698 fPIDnSigmaAtLowPAroundProtonLine=0.;
2699 fPIDnSigmaAtLowPAroundPionLine=1;
e5b6e8a6 2700 fDoKaonRejectionLowP = kFALSE;
2701 fDoProtonRejectionLowP = kFALSE;
2702 fDoPionRejectionLowP = kTRUE;
2703 fPIDMinPPionRejectionLowP = fPIDMinPnSigmaAbovePionLine;
4a0aab28 2704 break;
2705 case 5: //
2706 fPIDnSigmaAtLowPAroundKaonLine=0.;
2707 fPIDnSigmaAtLowPAroundProtonLine=0.;
2708 fPIDnSigmaAtLowPAroundPionLine=1.5;
e5b6e8a6 2709 fDoKaonRejectionLowP = kFALSE;
2710 fDoProtonRejectionLowP = kFALSE;
2711 fDoPionRejectionLowP = kTRUE;
2712 fPIDMinPPionRejectionLowP = fPIDMinPnSigmaAbovePionLine;
4a0aab28 2713 break;
2714 case 6: //
2715 fPIDnSigmaAtLowPAroundKaonLine=0.;
2716 fPIDnSigmaAtLowPAroundProtonLine=0.;
2717 fPIDnSigmaAtLowPAroundPionLine=2.;
e5b6e8a6 2718 fDoKaonRejectionLowP = kFALSE;
2719 fDoProtonRejectionLowP = kFALSE;
2720 fDoPionRejectionLowP = kTRUE;
2721 fPIDMinPPionRejectionLowP = fPIDMinPnSigmaAbovePionLine;
2722 break;
2723 case 7: //
2724 fPIDnSigmaAtLowPAroundKaonLine=0.;
2725 fPIDnSigmaAtLowPAroundProtonLine=0.;
2726 fPIDnSigmaAtLowPAroundPionLine=0.5;
2727 fDoKaonRejectionLowP = kFALSE;
2728 fDoProtonRejectionLowP = kFALSE;
2729 fDoPionRejectionLowP = kTRUE;
2730 fPIDMinPPionRejectionLowP = fPIDMinPnSigmaAbovePionLine;
4a0aab28 2731 break;
2732 default:
2733 AliError(Form("LowPRejectionSigmaCut not defined %d",LowPRejectionSigmaCut));
2734 return kFALSE;
2735 }
2736 return kTRUE;
3b77b2d1 2737}
3b77b2d1 2738///________________________________________________________________________
2739Bool_t AliConversionCuts::SetTOFElectronPIDCut(Int_t TOFelectronPID){
4a0aab28 2740 // Set Cut
e5b6e8a6 2741 switch(TOFelectronPID){
4a0aab28 2742 case 0: // no cut
2743 fUseTOFpid = kFALSE;
2744 fTofPIDnSigmaBelowElectronLine=-100;
2745 fTofPIDnSigmaAboveElectronLine=100;
2746 break;
2747 case 1: // -7,7
2748 fUseTOFpid = kTRUE;
2749 fTofPIDnSigmaBelowElectronLine=-7;
2750 fTofPIDnSigmaAboveElectronLine=7;
2751 break;
2752 case 2: // -5,5
2753 fUseTOFpid = kTRUE;
2754 fTofPIDnSigmaBelowElectronLine=-5;
2755 fTofPIDnSigmaAboveElectronLine=5;
2756 break;
2757 case 3: // -3,5
2758 fUseTOFpid = kTRUE;
2759 fTofPIDnSigmaBelowElectronLine=-3;
2760 fTofPIDnSigmaAboveElectronLine=5;
2761 break;
2762 case 4: // -2,3
2763 fUseTOFpid = kTRUE;
2764 fTofPIDnSigmaBelowElectronLine=-2;
2765 fTofPIDnSigmaAboveElectronLine=3;
2766 break;
e5b6e8a6 2767 case 5: // -3,3
2768 fUseTOFpid = kTRUE;
2769 fTofPIDnSigmaBelowElectronLine=-3;
2770 fTofPIDnSigmaAboveElectronLine=3;
4a0aab28 2771 break;
2772 default:
e5b6e8a6 2773 AliError(Form("TOFElectronCut not defined %d",TOFelectronPID));
4a0aab28 2774 return kFALSE;
2775 }
4a0aab28 2776 return kTRUE;
3b77b2d1 2777}
2778///________________________________________________________________________
2779Bool_t AliConversionCuts::SetQtMaxCut(Int_t QtMaxCut)
2780{ // Set Cut
4a0aab28 2781 switch(QtMaxCut){
2782 case 0: //
2783 fQtMax=1.;
e5b6e8a6 2784 fDoQtGammaSelection=kFALSE;
d8b864f8 2785 fDo2DQt=kFALSE;
4a0aab28 2786 break;
2787 case 1:
2788 fQtMax=0.1;
d8b864f8 2789 fDo2DQt=kFALSE;
4a0aab28 2790 break;
2791 case 2:
2792 fQtMax=0.07;
d8b864f8 2793 fDo2DQt=kFALSE;
4a0aab28 2794 break;
2795 case 3:
2796 fQtMax=0.05;
d8b864f8 2797 fDo2DQt=kFALSE;
4a0aab28 2798 break;
2799 case 4:
2800 fQtMax=0.03;
d8b864f8 2801 fDo2DQt=kFALSE;
4a0aab28 2802 break;
e5b6e8a6 2803 case 5:
4a0aab28 2804 fQtMax=0.02;
d8b864f8 2805 fDo2DQt=kFALSE;
e5b6e8a6 2806 break;
2807 case 6:
4a0aab28 2808 fQtMax=0.02;
d8b864f8 2809 fDo2DQt=kTRUE;
e5b6e8a6 2810 break;
4a0aab28 2811 case 7:
2812 fQtMax=0.15;
d8b864f8 2813 fDo2DQt=kFALSE;
4a0aab28 2814 break;
d8b864f8
FB
2815 case 8:
2816 fQtMax=0.05;
2817 fDo2DQt=kTRUE;
2818 break;
2819 case 9:
2820 fQtMax=0.03;
2821 fDo2DQt=kTRUE;
2822 break;
4a0aab28 2823 default:
2824 AliError(Form("Warning: QtMaxCut not defined %d",QtMaxCut));
2825 return kFALSE;
2826 }
2827 return kTRUE;
3b77b2d1 2828}
3b77b2d1 2829///________________________________________________________________________
e5b6e8a6 2830Bool_t AliConversionCuts::SetChi2GammaCut(Int_t chi2GammaCut)
2831{ // Set Cut
2832
2833 switch(chi2GammaCut){
2834 case 0: // 100
2835 fChi2CutConversion = 100.;
4a0aab28 2836 break;
e5b6e8a6 2837 case 1: // 50
2838 fChi2CutConversion = 50.;
4a0aab28 2839 break;
e5b6e8a6 2840 case 2: // 30
2841 fChi2CutConversion = 30.;
2842 break;
2843 case 3:
2844 fChi2CutConversion = 200.;
2845 break;
2846 case 4:
2847 fChi2CutConversion = 500.;
2848 break;
2849 case 5:
2850 fChi2CutConversion = 100000.;
2851 break;
2852 case 6:
2853 fChi2CutConversion = 5.;
2854 break;
2855 case 7:
2856 fChi2CutConversion = 10.;
2857 break;
2858 case 8:
2859 fChi2CutConversion = 20.;
2860 break;
2861 case 9:
2862 fChi2CutConversion = 15.;
4a0aab28 2863 break;
2864 default:
e5b6e8a6 2865 AliError(Form("Warning: Chi2GammaCut not defined %d",chi2GammaCut));
4a0aab28 2866 return kFALSE;
2867 }
4a0aab28 2868 return kTRUE;
3b77b2d1 2869}
3b77b2d1 2870///________________________________________________________________________
2871Bool_t AliConversionCuts::SetPsiPairCut(Int_t psiCut) {
3b77b2d1 2872
4a0aab28 2873 switch(psiCut) {
2874 case 0:
e5b6e8a6 2875 fPsiPairCut = 10000; //
4a0aab28 2876 break;
2877 case 1:
e5b6e8a6 2878 fPsiPairCut = 0.1; //
4a0aab28 2879 break;
2880 case 2:
2881 fPsiPairCut = 0.05; // Standard
2882 break;
2883 case 3:
e5b6e8a6 2884 fPsiPairCut = 0.035; //
4a0aab28 2885 break;
2886 case 4:
e5b6e8a6 2887 fPsiPairCut = 0.2; //
1390f698 2888 break;
2889 case 5:
2890 fPsiPairCut = 0.1; //
d8b864f8 2891 fDo2DPsiPairChi2 = kTRUE;
4a0aab28 2892 break;
2893 case 6:
1390f698 2894 fPsiPairCut = 0.05; //
d8b864f8