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