]>
Commit | Line | Data |
---|---|---|
3b77b2d1 | 1 | /************************************************************************** |
2 | * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * | |
aff90284 | 3 | * * |
4 | * Authors: Svein Lindal, Daniel Lohner * | |
5 | * Version 1.0 * | |
6 | * * | |
fcc79cf5 | 7 | * Permission to use, copy, modify and distribute this software and its * |
8 | * documentation strictly for non-commercial purposes is hereby granted * | |
9 | * without fee, provided that the above copyright notice appears in all * | |
10 | * copies and that both the copyright notice and this permission notice * | |
11 | * appear in the supporting documentation. The authors make no claims * | |
aff90284 | 12 | * about the suitability of this software for any purpose. It is * |
13 | * provided "as is" without express or implied warranty. * | |
3b77b2d1 | 14 | **************************************************************************/ |
15 | ||
16 | //////////////////////////////////////////////// | |
e5b6e8a6 | 17 | //--------------------------------------------- |
3b77b2d1 | 18 | // Class handling all kinds of selection cuts for |
19 | // Gamma Conversion analysis | |
20 | //--------------------------------------------- | |
21 | //////////////////////////////////////////////// | |
22 | ||
23 | #include "AliConversionCuts.h" | |
24 | ||
25 | #include "AliKFVertex.h" | |
26 | #include "AliAODTrack.h" | |
27 | #include "AliESDtrack.h" | |
28 | #include "AliAnalysisManager.h" | |
29 | #include "AliInputEventHandler.h" | |
92efd725 | 30 | #include "AliMCEventHandler.h" |
3b77b2d1 | 31 | #include "AliAODHandler.h" |
32 | #include "AliPIDResponse.h" | |
33 | #include "TH1.h" | |
34 | #include "TH2.h" | |
aff90284 | 35 | #include "TF1.h" |
3b77b2d1 | 36 | #include "AliStack.h" |
37 | #include "AliAODConversionMother.h" | |
38 | #include "TObjString.h" | |
39 | #include "AliAODEvent.h" | |
40 | #include "AliESDEvent.h" | |
41 | #include "AliCentrality.h" | |
42 | #include "TList.h" | |
ae947965 | 43 | #include "TFile.h" |
92efd725 | 44 | #include "AliLog.h" |
ca91a3e1 | 45 | #include "AliGenCocktailEventHeader.h" |
a280ac15 | 46 | #include "AliGenDPMjetEventHeader.h" |
47 | #include "AliGenPythiaEventHeader.h" | |
48 | #include "AliGenHijingEventHeader.h" | |
e5b6e8a6 | 49 | #include "AliTriggerAnalysis.h" |
50 | #include "AliV0ReaderV1.h" | |
ae947965 | 51 | #include "AliAODMCParticle.h" |
52 | #include "AliAODMCHeader.h" | |
92efd725 | 53 | |
3b77b2d1 | 54 | class iostream; |
55 | ||
56 | using namespace std; | |
57 | ||
58 | ClassImp(AliConversionCuts) | |
59 | ||
60 | ||
61 | const char* AliConversionCuts::fgkCutNames[AliConversionCuts::kNCuts] = { | |
4803eb1f | 62 | "HeavyIon",//0 |
63 | "CentralityMin",//1 | |
64 | "CentralityMax",//2 | |
65 | "SelectV0AND",//3 | |
66 | "MultiplicityMethod",//4 | |
67 | "RemovePileUp",//5 | |
68 | "RejectExtraSignals",//6 | |
69 | "V0FinderType",//7 | |
70 | "EtaCut",//8 | |
71 | "MinRCut",//9 | |
72 | "SinglePtCut",//10 | |
73 | "ClsTPCCut", //11 | |
74 | "ededxSigmaCut",//12 | |
75 | "pidedxSigmaCut",//13 | |
76 | "piMomdedxSigmaCut",//14 | |
77 | "piMaxMomdedxSigmaCut",//15 | |
78 | "LowPRejectionSigmaCut",//16 | |
79 | "TOFelectronPID",//17 | |
80 | "QtMaxCut",//18 | |
81 | "Chi2GammaCut", //19 | |
82 | "PsiPair", //20 | |
83 | "DoPhotonAsymmetryCut",//21 | |
84 | "CosinePointingAngle", //22 | |
85 | "SharedElectronCuts", //23 | |
86 | "RejectToCloseV0s", //24 | |
87 | "DcaRPrimVtx", //25 | |
88 | "DcaZPrimVtx" //26 | |
3b77b2d1 | 89 | }; |
90 | ||
91 | ||
92 | //________________________________________________________________________ | |
4a0aab28 | 93 | AliConversionCuts::AliConversionCuts(const char *name,const char *title) : |
94 | AliAnalysisCuts(name,title), | |
95 | fHistograms(NULL), | |
e5b6e8a6 | 96 | fHeaderList(NULL), |
4a0aab28 | 97 | fPIDResponse(NULL), |
98 | fEventQuality(-1), | |
99 | fMaxR(200), | |
100 | fMinR(0), | |
101 | fEtaCut(0.9), | |
102 | fEtaCutMin(-0.1), | |
103 | fPtCut(0.02), | |
104 | fSinglePtCut(0), | |
105 | fMaxZ(1000), | |
106 | fMinClsTPC(0.), | |
107 | fMinClsTPCToF(0.), | |
108 | fLineCutZRSlope(0.), | |
109 | fLineCutZValue(0), | |
110 | fLineCutZRSlopeMin(0.), | |
111 | fLineCutZValueMin(0), | |
112 | fChi2CutConversion(1000), | |
113 | fPIDProbabilityCutNegativeParticle(0), | |
114 | fPIDProbabilityCutPositiveParticle(0), | |
115 | fDodEdxSigmaCut(kTRUE), | |
e5b6e8a6 | 116 | fDoTOFsigmaCut(kFALSE), |
4a0aab28 | 117 | fPIDTRDEfficiency(1), |
118 | fDoTRDPID(kFALSE), | |
119 | fPIDnSigmaAboveElectronLine(100), | |
120 | fPIDnSigmaBelowElectronLine(-100), | |
e5b6e8a6 | 121 | fTofPIDnSigmaAboveElectronLine(100), |
122 | fTofPIDnSigmaBelowElectronLine(-100), | |
4a0aab28 | 123 | fPIDnSigmaAbovePionLine(0), |
124 | fPIDnSigmaAbovePionLineHighPt(-100), | |
125 | fPIDMinPnSigmaAbovePionLine(0), | |
126 | fPIDMaxPnSigmaAbovePionLine(0), | |
127 | fDoKaonRejectionLowP(kFALSE), | |
128 | fDoProtonRejectionLowP(kFALSE), | |
129 | fDoPionRejectionLowP(kFALSE), | |
130 | fPIDnSigmaAtLowPAroundKaonLine(0), | |
131 | fPIDnSigmaAtLowPAroundProtonLine(0), | |
132 | fPIDnSigmaAtLowPAroundPionLine(0), | |
e5b6e8a6 | 133 | fPIDMinPKaonRejectionLowP(1.5), |
134 | fPIDMinPProtonRejectionLowP(2), | |
4a0aab28 | 135 | fPIDMinPPionRejectionLowP(0), |
136 | fDoQtGammaSelection(kTRUE), | |
e5b6e8a6 | 137 | fDoHighPtQtGammaSelection(kFALSE), |
4a0aab28 | 138 | fQtMax(100), |
e5b6e8a6 | 139 | fHighPtQtMax(0.), |
140 | fPtBorderForQt(0), | |
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), |
4a0aab28 | 160 | fRemovePileUp(kFALSE), |
161 | fOpeningAngle(0.005), | |
162 | fPsiPairCut(10000), | |
163 | fCosPAngleCut(10000), | |
164 | fDoToCloseV0sCut(kFALSE), | |
165 | fRejectExtraSignals(0), | |
166 | fminV0Dist(200.), | |
167 | fDoSharedElecCut(kFALSE), | |
168 | fOfflineTriggerMask(0), | |
e5b6e8a6 | 169 | fHasV0AND(kTRUE), |
170 | fIsSDDFired(kTRUE), | |
4a0aab28 | 171 | fRandom(0), |
e5b6e8a6 | 172 | fElectronArraySize(500), |
4a0aab28 | 173 | fElectronLabelArray(NULL), |
4803eb1f | 174 | fDCAZPrimVtxCut(1000), |
175 | fDCARPrimVtxCut(1000), | |
e5b6e8a6 | 176 | fConversionPointXArray(0.0), |
177 | fConversionPointYArray(0.0), | |
178 | fConversionPointZArray(0.0), | |
179 | fnHeaders(0), | |
4a0aab28 | 180 | fNotRejectedStart(NULL), |
181 | fNotRejectedEnd(NULL), | |
182 | fGeneratorNames(NULL), | |
183 | fCutString(NULL), | |
0a2b2b4b | 184 | fUtils(NULL), |
11c1e680 | 185 | fEtaShift(0.0), |
186 | fDoEtaShift(kFALSE), | |
ae947965 | 187 | fDoReweightHistoMCPi0(kFALSE), |
188 | fDoReweightHistoMCEta(kFALSE), | |
189 | fDoReweightHistoMCK0s(kFALSE), | |
190 | fPathTrFReweighting(""), | |
191 | fNameHistoReweightingPi0(""), | |
192 | fNameHistoReweightingEta(""), | |
193 | fNameHistoReweightingK0s(""), | |
fcc79cf5 | 194 | fNameFitDataPi0(""), |
195 | fNameFitDataEta(""), | |
196 | fNameFitDataK0s(""), | |
4a0aab28 | 197 | hdEdxCuts(NULL), |
198 | hTPCdEdxbefore(NULL), | |
199 | hTPCdEdxafter(NULL), | |
e5b6e8a6 | 200 | hTPCdEdxSigbefore(NULL), |
201 | hTPCdEdxSigafter(NULL), | |
4a0aab28 | 202 | hTOFbefore(NULL), |
e5b6e8a6 | 203 | hTOFSigbefore(NULL), |
204 | hTOFSigafter(NULL), | |
4a0aab28 | 205 | hTrackCuts(NULL), |
206 | hPhotonCuts(NULL), | |
207 | hInvMassbefore(NULL), | |
208 | hArmenterosbefore(NULL), | |
209 | hInvMassafter(NULL), | |
210 | hArmenterosafter(NULL), | |
211 | hAcceptanceCuts(NULL), | |
212 | hCutIndex(NULL), | |
213 | hV0EventCuts(NULL), | |
214 | hCentrality(NULL), | |
4803eb1f | 215 | hCentralityVsNumberOfPrimaryTracks(NULL), |
4a0aab28 | 216 | hVertexZ(NULL), |
a280ac15 | 217 | hTriggerClass(NULL), |
ae947965 | 218 | hTriggerClassSelected(NULL), |
219 | hReweightMCHistPi0(NULL), | |
220 | hReweightMCHistEta(NULL), | |
221 | hReweightMCHistK0s(NULL), | |
fcc79cf5 | 222 | fFitDataPi0(NULL), |
223 | fFitDataEta(NULL), | |
224 | fFitDataK0s(NULL), | |
ae947965 | 225 | fPreSelCut(kFALSE), |
226 | fTriggerSelectedManually(kFALSE), | |
227 | fSpecialTriggerName("") | |
aff90284 | 228 | |
3b77b2d1 | 229 | { |
4a0aab28 | 230 | InitPIDResponse(); |
231 | for(Int_t jj=0;jj<kNCuts;jj++){fCuts[jj]=0;} | |
232 | fCutString=new TObjString((GetCutNumber()).Data()); | |
3b77b2d1 | 233 | |
e5b6e8a6 | 234 | fElectronLabelArray = new Int_t[fElectronArraySize]; |
0a2b2b4b | 235 | fUtils = new AliAnalysisUtils(); |
236 | //if you do not want to apply the cut on the distance between the SPD and TRK vertex: | |
11c1e680 | 237 | //fUtils->SetCutOnZVertexSPD(kFALSE); |
238 | ||
ca91a3e1 | 239 | |
3b77b2d1 | 240 | } |
241 | ||
1d9e6011 | 242 | //________________________________________________________________________ |
243 | AliConversionCuts::AliConversionCuts(const AliConversionCuts &ref) : | |
244 | AliAnalysisCuts(ref), | |
245 | fHistograms(NULL), | |
246 | fHeaderList(ref.fHeaderList), | |
247 | fPIDResponse(NULL), | |
248 | fEventQuality(ref.fEventQuality), | |
249 | fMaxR(ref.fMaxR), | |
250 | fMinR(ref.fMinR), | |
251 | fEtaCut(ref.fEtaCut), | |
252 | fEtaCutMin(ref.fEtaCutMin), | |
253 | fPtCut(ref.fPtCut), | |
254 | fSinglePtCut(ref.fSinglePtCut), | |
255 | fMaxZ(ref.fMaxZ), | |
256 | fMinClsTPC(ref.fMinClsTPC), | |
257 | fMinClsTPCToF(ref.fMinClsTPCToF), | |
258 | fLineCutZRSlope(ref.fLineCutZRSlope), | |
259 | fLineCutZValue(ref.fLineCutZValue), | |
260 | fLineCutZRSlopeMin(ref.fLineCutZRSlopeMin), | |
261 | fLineCutZValueMin(ref.fLineCutZValueMin), | |
262 | fChi2CutConversion(ref.fChi2CutConversion), | |
263 | fPIDProbabilityCutNegativeParticle(ref.fPIDProbabilityCutNegativeParticle), | |
264 | fPIDProbabilityCutPositiveParticle(ref.fPIDProbabilityCutPositiveParticle), | |
265 | fDodEdxSigmaCut(ref. fDodEdxSigmaCut), | |
266 | fDoTOFsigmaCut(ref.fDoTOFsigmaCut), | |
267 | fPIDTRDEfficiency(ref.fPIDTRDEfficiency), | |
268 | fDoTRDPID(ref.fDoTRDPID), | |
269 | fPIDnSigmaAboveElectronLine(ref.fPIDnSigmaAboveElectronLine), | |
270 | fPIDnSigmaBelowElectronLine(ref.fPIDnSigmaBelowElectronLine), | |
271 | fTofPIDnSigmaAboveElectronLine(ref.fTofPIDnSigmaAboveElectronLine), | |
272 | fTofPIDnSigmaBelowElectronLine(ref.fTofPIDnSigmaBelowElectronLine), | |
273 | fPIDnSigmaAbovePionLine(ref.fPIDnSigmaAbovePionLine), | |
274 | fPIDnSigmaAbovePionLineHighPt(ref.fPIDnSigmaAbovePionLineHighPt), | |
275 | fPIDMinPnSigmaAbovePionLine(ref.fPIDMinPnSigmaAbovePionLine), | |
276 | fPIDMaxPnSigmaAbovePionLine(ref.fPIDMaxPnSigmaAbovePionLine), | |
277 | fDoKaonRejectionLowP(ref.fDoKaonRejectionLowP), | |
278 | fDoProtonRejectionLowP(ref.fDoProtonRejectionLowP), | |
279 | fDoPionRejectionLowP(ref.fDoPionRejectionLowP), | |
280 | fPIDnSigmaAtLowPAroundKaonLine(ref.fPIDnSigmaAtLowPAroundKaonLine), | |
281 | fPIDnSigmaAtLowPAroundProtonLine(ref.fPIDnSigmaAtLowPAroundProtonLine), | |
282 | fPIDnSigmaAtLowPAroundPionLine(ref.fPIDnSigmaAtLowPAroundPionLine), | |
283 | fPIDMinPKaonRejectionLowP(ref.fPIDMinPKaonRejectionLowP), | |
284 | fPIDMinPProtonRejectionLowP(ref.fPIDMinPProtonRejectionLowP), | |
285 | fPIDMinPPionRejectionLowP(ref.fPIDMinPPionRejectionLowP), | |
286 | fDoQtGammaSelection(ref.fDoQtGammaSelection), | |
287 | fDoHighPtQtGammaSelection(ref.fDoHighPtQtGammaSelection), | |
288 | fQtMax(ref.fQtMax), | |
289 | fHighPtQtMax(ref.fHighPtQtMax), | |
290 | fPtBorderForQt(ref.fPtBorderForQt), | |
291 | fXVertexCut(ref.fXVertexCut), | |
292 | fYVertexCut(ref.fYVertexCut), | |
293 | fZVertexCut(ref.fZVertexCut), | |
294 | fNSigmaMass(ref.fNSigmaMass), | |
295 | fUseEtaMinCut(ref.fUseEtaMinCut), | |
296 | fUseOnFlyV0Finder(ref.fUseOnFlyV0Finder), | |
0a2b2b4b | 297 | fDoPhotonAsymmetryCut(ref.fDoPhotonAsymmetryCut), |
1d9e6011 | 298 | fMinPPhotonAsymmetryCut(ref.fMinPPhotonAsymmetryCut), |
299 | fMinPhotonAsymmetry(ref.fMinPhotonAsymmetry), | |
300 | fIsHeavyIon(ref.fIsHeavyIon), | |
301 | fDetectorCentrality(ref.fDetectorCentrality), | |
302 | fModCentralityClass(ref.fModCentralityClass), | |
303 | fMaxVertexZ(ref.fMaxVertexZ), | |
304 | fCentralityMin(ref.fCentralityMin), | |
305 | fCentralityMax(ref.fCentralityMax), | |
306 | fUseCorrectedTPCClsInfo(ref.fUseCorrectedTPCClsInfo), | |
307 | fUseTOFpid(ref.fUseTOFpid), | |
308 | fMultiplicityMethod(ref.fMultiplicityMethod), | |
309 | fSpecialTrigger(ref.fSpecialTrigger), | |
310 | fRemovePileUp(ref.fRemovePileUp), | |
311 | fOpeningAngle(ref.fOpeningAngle), | |
312 | fPsiPairCut(ref.fPsiPairCut), | |
313 | fCosPAngleCut(ref.fCosPAngleCut), | |
314 | fDoToCloseV0sCut(ref.fDoToCloseV0sCut), | |
315 | fRejectExtraSignals(ref.fRejectExtraSignals), | |
316 | fminV0Dist(ref.fminV0Dist), | |
317 | fDoSharedElecCut(ref.fDoSharedElecCut), | |
318 | fOfflineTriggerMask(ref.fOfflineTriggerMask), | |
319 | fHasV0AND(ref.fHasV0AND), | |
320 | fIsSDDFired(ref.fIsSDDFired), | |
321 | fRandom(ref.fRandom), | |
322 | fElectronArraySize(ref.fElectronArraySize), | |
323 | fElectronLabelArray(NULL), | |
4803eb1f | 324 | fDCAZPrimVtxCut(ref.fDCAZPrimVtxCut), |
325 | fDCARPrimVtxCut(ref.fDCAZPrimVtxCut), | |
1d9e6011 | 326 | fConversionPointXArray(ref.fConversionPointXArray), |
327 | fConversionPointYArray(ref.fConversionPointYArray), | |
328 | fConversionPointZArray(ref.fConversionPointZArray), | |
329 | fnHeaders(ref.fnHeaders), | |
330 | fNotRejectedStart(NULL), | |
331 | fNotRejectedEnd(NULL), | |
332 | fGeneratorNames(ref.fGeneratorNames), | |
333 | fCutString(NULL), | |
0a2b2b4b | 334 | fUtils(NULL), |
11c1e680 | 335 | fEtaShift(ref.fEtaShift), |
336 | fDoEtaShift(ref.fDoEtaShift), | |
ae947965 | 337 | fDoReweightHistoMCPi0(ref.fDoReweightHistoMCPi0), |
338 | fDoReweightHistoMCEta(ref.fDoReweightHistoMCEta), | |
339 | fDoReweightHistoMCK0s(ref.fDoReweightHistoMCK0s), | |
340 | fPathTrFReweighting(ref.fPathTrFReweighting), | |
341 | fNameHistoReweightingPi0(ref.fNameHistoReweightingPi0), | |
342 | fNameHistoReweightingEta(ref.fNameHistoReweightingEta), | |
343 | fNameHistoReweightingK0s(ref.fNameHistoReweightingK0s), | |
fcc79cf5 | 344 | fNameFitDataPi0(ref.fNameFitDataPi0), |
345 | fNameFitDataEta(ref.fNameFitDataEta), | |
346 | fNameFitDataK0s(ref.fNameFitDataK0s), | |
1d9e6011 | 347 | hdEdxCuts(NULL), |
348 | hTPCdEdxbefore(NULL), | |
349 | hTPCdEdxafter(NULL), | |
350 | hTPCdEdxSigbefore(NULL), | |
351 | hTPCdEdxSigafter(NULL), | |
352 | hTOFbefore(NULL), | |
353 | hTOFSigbefore(NULL), | |
354 | hTOFSigafter(NULL), | |
355 | hTrackCuts(NULL), | |
356 | hPhotonCuts(NULL), | |
357 | hInvMassbefore(NULL), | |
358 | hArmenterosbefore(NULL), | |
359 | hInvMassafter(NULL), | |
360 | hArmenterosafter(NULL), | |
361 | hAcceptanceCuts(NULL), | |
362 | hCutIndex(NULL), | |
363 | hV0EventCuts(NULL), | |
364 | hCentrality(NULL), | |
4803eb1f | 365 | hCentralityVsNumberOfPrimaryTracks(NULL), |
1d9e6011 | 366 | hVertexZ(NULL), |
a280ac15 | 367 | hTriggerClass(NULL), |
ae947965 | 368 | hTriggerClassSelected(NULL), |
aff90284 | 369 | hReweightMCHistPi0(ref.hReweightMCHistPi0), |
370 | hReweightMCHistEta(ref.hReweightMCHistEta), | |
371 | hReweightMCHistK0s(ref.hReweightMCHistK0s), | |
372 | fFitDataPi0(ref.fFitDataPi0), | |
373 | fFitDataEta(ref.fFitDataEta), | |
374 | fFitDataK0s(ref.fFitDataK0s), | |
ae947965 | 375 | fPreSelCut(ref.fPreSelCut), |
376 | fTriggerSelectedManually(ref.fTriggerSelectedManually), | |
377 | fSpecialTriggerName(ref.fSpecialTriggerName) | |
1d9e6011 | 378 | { |
379 | // Copy Constructor | |
a280ac15 | 380 | for(Int_t jj=0;jj<kNCuts;jj++){fCuts[jj]=ref.fCuts[jj];} |
381 | fCutString=new TObjString((GetCutNumber()).Data()); | |
382 | fElectronLabelArray = new Int_t[fElectronArraySize]; | |
0a2b2b4b | 383 | fUtils = new AliAnalysisUtils(); |
a280ac15 | 384 | // dont copy histograms (if you like histograms, call InitCutHistograms()) |
11c1e680 | 385 | |
1d9e6011 | 386 | } |
387 | ||
a280ac15 | 388 | |
3b77b2d1 | 389 | //________________________________________________________________________ |
390 | AliConversionCuts::~AliConversionCuts() { | |
4a0aab28 | 391 | // Destructor |
392 | //Deleting fHistograms leads to seg fault it it's added to output collection of a task | |
393 | // if(fHistograms) | |
fcc79cf5 | 394 | // delete fHistograms; |
4a0aab28 | 395 | // fHistograms = NULL; |
92efd725 | 396 | if(fCutString != NULL){ |
397 | delete fCutString; | |
398 | fCutString = NULL; | |
399 | } | |
92efd725 | 400 | if(fElectronLabelArray){ |
401 | delete fElectronLabelArray; | |
402 | fElectronLabelArray = NULL; | |
403 | } | |
ca91a3e1 | 404 | if(fNotRejectedStart){ |
405 | delete[] fNotRejectedStart; | |
406 | fNotRejectedStart = NULL; | |
407 | } | |
408 | if(fNotRejectedEnd){ | |
409 | delete[] fNotRejectedEnd; | |
410 | fNotRejectedEnd = NULL; | |
411 | } | |
412 | if(fGeneratorNames){ | |
413 | delete[] fGeneratorNames; | |
414 | fGeneratorNames = NULL; | |
415 | } | |
0a2b2b4b | 416 | if(fUtils){ |
417 | delete fUtils; | |
418 | fUtils = NULL; | |
419 | } | |
420 | ||
3b77b2d1 | 421 | } |
422 | ||
423 | //________________________________________________________________________ | |
92efd725 | 424 | void AliConversionCuts::InitCutHistograms(TString name, Bool_t preCut){ |
3b77b2d1 | 425 | |
4a0aab28 | 426 | // Initialize Cut Histograms for QA (only initialized and filled if function is called) |
ccfa8c0d | 427 | TH1::AddDirectory(kFALSE); |
4a0aab28 | 428 | |
429 | if(fHistograms != NULL){ | |
430 | delete fHistograms; | |
431 | fHistograms=NULL; | |
432 | } | |
433 | if(fHistograms==NULL){ | |
434 | fHistograms=new TList(); | |
ccfa8c0d | 435 | fHistograms->SetOwner(kTRUE); |
4a0aab28 | 436 | if(name=="")fHistograms->SetName(Form("ConvCuts_%s",GetCutNumber().Data())); |
437 | else fHistograms->SetName(Form("%s_%s",name.Data(),GetCutNumber().Data())); | |
438 | } | |
439 | ||
fcc79cf5 | 440 | if (hReweightMCHistPi0){ |
441 | hReweightMCHistPi0->SetName("MCInputForWeightingPi0"); | |
442 | fHistograms->Add(hReweightMCHistPi0); | |
443 | } | |
444 | if (hReweightMCHistEta){ | |
445 | hReweightMCHistEta->SetName("MCInputForWeightingEta"); | |
446 | fHistograms->Add(hReweightMCHistEta); | |
aff90284 | 447 | } |
fcc79cf5 | 448 | if (hReweightMCHistK0s){ |
449 | hReweightMCHistK0s->SetName("MCInputForWeightingK0s"); | |
450 | fHistograms->Add(hReweightMCHistK0s); | |
aff90284 | 451 | } |
34a75862 | 452 | // if (fFitDataPi0){ |
453 | // fFitDataPi0->SetName("DataFitForWeightingPi0"); | |
454 | // fHistograms->Add(fFitDataPi0); | |
455 | // } | |
456 | // if (fFitDataEta){ | |
457 | // fFitDataEta->SetName("DataFitForWeightingEta"); | |
458 | // fHistograms->Add(fFitDataEta); | |
459 | // } | |
460 | // if (fFitDataK0s){ | |
461 | // fFitDataK0s->SetName("DataFitForWeightingK0s"); | |
462 | // fHistograms->Add(fFitDataK0s); | |
463 | // } | |
4a0aab28 | 464 | // IsPhotonSelected |
465 | hCutIndex=new TH1F(Form("IsPhotonSelected %s",GetCutNumber().Data()),"IsPhotonSelected",10,-0.5,9.5); | |
466 | hCutIndex->GetXaxis()->SetBinLabel(kPhotonIn+1,"in"); | |
467 | hCutIndex->GetXaxis()->SetBinLabel(kOnFly+1,"onfly"); | |
468 | hCutIndex->GetXaxis()->SetBinLabel(kNoTracks+1,"no tracks"); | |
469 | hCutIndex->GetXaxis()->SetBinLabel(kdEdxCuts+1,"dEdx"); | |
470 | hCutIndex->GetXaxis()->SetBinLabel(kTrackCuts+1,"Track cuts"); | |
471 | hCutIndex->GetXaxis()->SetBinLabel(kConvPointFail+1,"ConvPoint fail"); | |
472 | hCutIndex->GetXaxis()->SetBinLabel(kPhotonCuts+1,"PhotonCuts"); | |
473 | hCutIndex->GetXaxis()->SetBinLabel(kPhotonOut+1,"out"); | |
474 | fHistograms->Add(hCutIndex); | |
475 | ||
476 | // Track Cuts | |
e5b6e8a6 | 477 | hTrackCuts=new TH1F(Form("TrackCuts %s",GetCutNumber().Data()),"TrackCuts",9,-0.5,8.5); |
4a0aab28 | 478 | hTrackCuts->GetXaxis()->SetBinLabel(1,"in"); |
479 | hTrackCuts->GetXaxis()->SetBinLabel(2,"likesign"); | |
480 | hTrackCuts->GetXaxis()->SetBinLabel(3,"ntpccl"); | |
481 | hTrackCuts->GetXaxis()->SetBinLabel(4,"acceptance"); | |
482 | hTrackCuts->GetXaxis()->SetBinLabel(5,"singlept"); | |
483 | hTrackCuts->GetXaxis()->SetBinLabel(6,"TPCrefit"); | |
484 | hTrackCuts->GetXaxis()->SetBinLabel(7,"kink"); | |
485 | hTrackCuts->GetXaxis()->SetBinLabel(8,"out"); | |
486 | fHistograms->Add(hTrackCuts); | |
487 | ||
488 | // Photon Cuts | |
4803eb1f | 489 | hPhotonCuts=new TH1F(Form("PhotonCuts %s",GetCutNumber().Data()),"PhotonCuts",14,-0.5,13.5); |
4a0aab28 | 490 | hPhotonCuts->GetXaxis()->SetBinLabel(1,"in"); |
491 | hPhotonCuts->GetXaxis()->SetBinLabel(2,"qtcut"); | |
492 | hPhotonCuts->GetXaxis()->SetBinLabel(3,"chi2"); | |
493 | hPhotonCuts->GetXaxis()->SetBinLabel(4,"acceptance"); | |
494 | hPhotonCuts->GetXaxis()->SetBinLabel(5,"asymmetry"); | |
495 | hPhotonCuts->GetXaxis()->SetBinLabel(6,"pidprob"); | |
496 | hPhotonCuts->GetXaxis()->SetBinLabel(7,"cortpcclinfo"); | |
497 | hPhotonCuts->GetXaxis()->SetBinLabel(8,"PsiPair"); | |
498 | hPhotonCuts->GetXaxis()->SetBinLabel(9,"CosPAngle"); | |
4803eb1f | 499 | hPhotonCuts->GetXaxis()->SetBinLabel(10,"DCA R"); |
500 | hPhotonCuts->GetXaxis()->SetBinLabel(11,"DCA Z"); | |
501 | hPhotonCuts->GetXaxis()->SetBinLabel(12,"out"); | |
4a0aab28 | 502 | fHistograms->Add(hPhotonCuts); |
503 | ||
504 | if(preCut){ | |
e5b6e8a6 | 505 | hInvMassbefore=new TH1F(Form("InvMass_before %s",GetCutNumber().Data()),"InvMass_before",1000,0,0.3); |
4a0aab28 | 506 | fHistograms->Add(hInvMassbefore); |
e5b6e8a6 | 507 | hArmenterosbefore=new TH2F(Form("Armenteros_before %s",GetCutNumber().Data()),"Armenteros_before",200,-1,1,1000,0,1.); |
4a0aab28 | 508 | fHistograms->Add(hArmenterosbefore); |
509 | } | |
e5b6e8a6 | 510 | hInvMassafter=new TH1F(Form("InvMass_after %s",GetCutNumber().Data()),"InvMass_after",1000,0,0.3); |
4a0aab28 | 511 | fHistograms->Add(hInvMassafter); |
512 | hArmenterosafter=new TH2F(Form("Armenteros_after %s",GetCutNumber().Data()),"Armenteros_after",200,-1,1,250,0,0.25); | |
513 | fHistograms->Add(hArmenterosafter); | |
514 | ||
515 | hAcceptanceCuts=new TH1F(Form("PhotonAcceptanceCuts %s",GetCutNumber().Data()),"PhotonAcceptanceCuts",10,-0.5,9.5); | |
516 | hAcceptanceCuts->GetXaxis()->SetBinLabel(1,"in"); | |
517 | hAcceptanceCuts->GetXaxis()->SetBinLabel(2,"maxR"); | |
518 | hAcceptanceCuts->GetXaxis()->SetBinLabel(3,"minR"); | |
519 | hAcceptanceCuts->GetXaxis()->SetBinLabel(4,"line"); | |
520 | hAcceptanceCuts->GetXaxis()->SetBinLabel(5,"maxZ"); | |
521 | hAcceptanceCuts->GetXaxis()->SetBinLabel(6,"eta"); | |
522 | hAcceptanceCuts->GetXaxis()->SetBinLabel(7,"minpt"); | |
523 | hAcceptanceCuts->GetXaxis()->SetBinLabel(8,"out"); | |
524 | fHistograms->Add(hAcceptanceCuts); | |
525 | ||
526 | // dEdx Cuts | |
527 | hdEdxCuts=new TH1F(Form("dEdxCuts %s",GetCutNumber().Data()),"dEdxCuts",10,-0.5,9.5); | |
528 | hdEdxCuts->GetXaxis()->SetBinLabel(1,"in"); | |
529 | hdEdxCuts->GetXaxis()->SetBinLabel(2,"TPCelectron"); | |
530 | hdEdxCuts->GetXaxis()->SetBinLabel(3,"TPCpion"); | |
531 | hdEdxCuts->GetXaxis()->SetBinLabel(4,"TPCpionhighp"); | |
532 | hdEdxCuts->GetXaxis()->SetBinLabel(5,"TPCkaonlowprej"); | |
533 | hdEdxCuts->GetXaxis()->SetBinLabel(6,"TPCprotonlowprej"); | |
534 | hdEdxCuts->GetXaxis()->SetBinLabel(7,"TPCpionlowprej"); | |
535 | hdEdxCuts->GetXaxis()->SetBinLabel(8,"TOFelectron"); | |
536 | hdEdxCuts->GetXaxis()->SetBinLabel(9,"TRDelectron"); | |
537 | hdEdxCuts->GetXaxis()->SetBinLabel(10,"out"); | |
538 | fHistograms->Add(hdEdxCuts); | |
e5b6e8a6 | 539 | |
4a0aab28 | 540 | TAxis *AxisBeforedEdx = NULL; |
e5b6e8a6 | 541 | TAxis *AxisBeforedEdxSig = NULL; |
4a0aab28 | 542 | TAxis *AxisBeforeTOF = NULL; |
e5b6e8a6 | 543 | TAxis *AxisBeforeTOFSig = NULL; |
4a0aab28 | 544 | if(preCut){ |
e5b6e8a6 | 545 | hTPCdEdxbefore=new TH2F(Form("Gamma_dEdx_before %s",GetCutNumber().Data()),"dEdx Gamma before" ,150,0.03,20,800,0,200); |
4a0aab28 | 546 | fHistograms->Add(hTPCdEdxbefore); |
e5b6e8a6 | 547 | AxisBeforedEdx = hTPCdEdxbefore->GetXaxis(); |
548 | hTPCdEdxSigbefore=new TH2F(Form("Gamma_dEdxSig_before %s",GetCutNumber().Data()),"dEdx Sigma Gamma before" ,150,0.03,20,400,-10,10); | |
549 | fHistograms->Add(hTPCdEdxSigbefore); | |
550 | AxisBeforedEdxSig = hTPCdEdxSigbefore->GetXaxis(); | |
4a0aab28 | 551 | |
e5b6e8a6 | 552 | hTOFbefore=new TH2F(Form("Gamma_TOF_before %s",GetCutNumber().Data()),"TOF Gamma before" ,150,0.03,20,11000,-1000,10000); |
4a0aab28 | 553 | fHistograms->Add(hTOFbefore); |
e5b6e8a6 | 554 | AxisBeforeTOF = hTOFbefore->GetXaxis(); |
555 | hTOFSigbefore=new TH2F(Form("Gamma_TOFSig_before %s",GetCutNumber().Data()),"TOF Sigma Gamma before" ,150,0.03,20,400,-6,10); | |
556 | fHistograms->Add(hTOFSigbefore); | |
557 | AxisBeforeTOFSig = hTOFSigbefore->GetXaxis(); | |
558 | ||
4a0aab28 | 559 | } |
e5b6e8a6 | 560 | hTPCdEdxSigafter=new TH2F(Form("Gamma_dEdxSig_after %s",GetCutNumber().Data()),"dEdx Sigma Gamma after" ,150,0.03,20,400, -10,10); |
561 | fHistograms->Add(hTPCdEdxSigafter); | |
562 | ||
563 | hTPCdEdxafter=new TH2F(Form("Gamma_dEdx_after %s",GetCutNumber().Data()),"dEdx Gamma after" ,150,0.03,20,800,0,200); | |
4a0aab28 | 564 | fHistograms->Add(hTPCdEdxafter); |
565 | ||
e5b6e8a6 | 566 | hTOFSigafter=new TH2F(Form("Gamma_TOFSig_after %s",GetCutNumber().Data()),"TOF Sigma Gamma after" ,150,0.03,20,400,-6,10); |
567 | fHistograms->Add(hTOFSigafter); | |
4a0aab28 | 568 | |
e5b6e8a6 | 569 | TAxis *AxisAfter = hTPCdEdxSigafter->GetXaxis(); |
4a0aab28 | 570 | Int_t bins = AxisAfter->GetNbins(); |
571 | Double_t from = AxisAfter->GetXmin(); | |
572 | Double_t to = AxisAfter->GetXmax(); | |
573 | Double_t *newBins = new Double_t[bins+1]; | |
574 | newBins[0] = from; | |
575 | Double_t factor = TMath::Power(to/from, 1./bins); | |
576 | for(Int_t i=1; i<=bins; ++i) newBins[i] = factor * newBins[i-1]; | |
577 | AxisAfter->Set(bins, newBins); | |
e5b6e8a6 | 578 | AxisAfter = hTOFSigafter->GetXaxis(); |
579 | AxisAfter->Set(bins, newBins); | |
580 | AxisAfter = hTPCdEdxafter->GetXaxis(); | |
4a0aab28 | 581 | AxisAfter->Set(bins, newBins); |
582 | if(preCut){ | |
583 | AxisBeforedEdx->Set(bins, newBins); | |
584 | AxisBeforeTOF->Set(bins, newBins); | |
e5b6e8a6 | 585 | AxisBeforedEdxSig->Set(bins, newBins); |
586 | AxisBeforeTOFSig->Set(bins, newBins); | |
4a0aab28 | 587 | } |
588 | delete [] newBins; | |
e5b6e8a6 | 589 | |
4a0aab28 | 590 | // Event Cuts and Info |
591 | if(preCut){ | |
e5b6e8a6 | 592 | hV0EventCuts=new TH1F(Form("ESD_EventCuts %s",GetCutNumber().Data()),"Event Cuts",7,-0.5,6.5); |
4a0aab28 | 593 | hV0EventCuts->GetXaxis()->SetBinLabel(1,"in"); |
594 | hV0EventCuts->GetXaxis()->SetBinLabel(2,"OfflineTrigger"); | |
e5b6e8a6 | 595 | hV0EventCuts->GetXaxis()->SetBinLabel(3,"nvtxcontr"); |
596 | hV0EventCuts->GetXaxis()->SetBinLabel(4,"VertexZ"); | |
4a0aab28 | 597 | hV0EventCuts->GetXaxis()->SetBinLabel(5,"pileup"); |
598 | hV0EventCuts->GetXaxis()->SetBinLabel(6,"centrsel"); | |
599 | hV0EventCuts->GetXaxis()->SetBinLabel(7,"out"); | |
600 | fHistograms->Add(hV0EventCuts); | |
e5b6e8a6 | 601 | |
4803eb1f | 602 | hCentrality=new TH1F(Form("Centrality %s",GetCutNumber().Data()),"Centrality",1000,0,100); |
4a0aab28 | 603 | fHistograms->Add(hCentrality); |
46ec68c9 | 604 | hCentralityVsNumberOfPrimaryTracks=new TH2F(Form("Centrality vs Primary Tracks %s",GetCutNumber().Data()),"Centrality vs Primary Tracks ",100,0,100,4000,0,4000); |
4803eb1f | 605 | fHistograms->Add(hCentralityVsNumberOfPrimaryTracks); |
4a0aab28 | 606 | hVertexZ=new TH1F(Form("VertexZ %s",GetCutNumber().Data()),"VertexZ",1000,-50,50); |
607 | fHistograms->Add(hVertexZ); | |
e5b6e8a6 | 608 | |
11c1e680 | 609 | hTriggerClass= new TH1F(Form("OfflineTrigger %s",GetCutNumber().Data()),"OfflineTrigger",35,-0.5,34.5); |
e5b6e8a6 | 610 | hTriggerClass->GetXaxis()->SetBinLabel( 1,"kMB"); |
611 | hTriggerClass->GetXaxis()->SetBinLabel( 2,"kINT7"); | |
612 | hTriggerClass->GetXaxis()->SetBinLabel( 3,"kMUON"); | |
613 | hTriggerClass->GetXaxis()->SetBinLabel( 4,"kHighMult"); | |
614 | hTriggerClass->GetXaxis()->SetBinLabel( 5,"kKEMC1"); | |
615 | hTriggerClass->GetXaxis()->SetBinLabel( 6,"kCINT5"); | |
616 | hTriggerClass->GetXaxis()->SetBinLabel( 7,"kCMUS5/kMUSPB"); | |
617 | hTriggerClass->GetXaxis()->SetBinLabel( 8,"kMUSH7/kMUSHPB"); | |
618 | hTriggerClass->GetXaxis()->SetBinLabel( 9,"kMUL7/kMuonLikePB"); | |
619 | hTriggerClass->GetXaxis()->SetBinLabel(10,"kMUU7/kMuonUnlikePB"); | |
620 | hTriggerClass->GetXaxis()->SetBinLabel(11,"kEMC7/kEMC8"); | |
621 | hTriggerClass->GetXaxis()->SetBinLabel(12,"kMUS7"); | |
622 | hTriggerClass->GetXaxis()->SetBinLabel(13,"kPHI1"); | |
623 | hTriggerClass->GetXaxis()->SetBinLabel(14,"kPHI7/kPHI8/kPHOSPb"); | |
624 | hTriggerClass->GetXaxis()->SetBinLabel(15,"kEMCEJE"); | |
625 | hTriggerClass->GetXaxis()->SetBinLabel(16,"kEMCEGA"); | |
626 | hTriggerClass->GetXaxis()->SetBinLabel(17,"kCentral"); | |
627 | hTriggerClass->GetXaxis()->SetBinLabel(18,"kSemiCentral"); | |
628 | hTriggerClass->GetXaxis()->SetBinLabel(19,"kDG5"); | |
629 | hTriggerClass->GetXaxis()->SetBinLabel(20,"kZED"); | |
630 | hTriggerClass->GetXaxis()->SetBinLabel(21,"kSPI7/kSPI"); | |
631 | hTriggerClass->GetXaxis()->SetBinLabel(22,"kINT8"); | |
632 | hTriggerClass->GetXaxis()->SetBinLabel(23,"kMuonSingleLowPt8"); | |
633 | hTriggerClass->GetXaxis()->SetBinLabel(24,"kMuonSingleHighPt8"); | |
634 | hTriggerClass->GetXaxis()->SetBinLabel(25,"kMuonLikeLowPt8"); | |
635 | hTriggerClass->GetXaxis()->SetBinLabel(26,"kMuonUnlikeLowPt8"); | |
636 | hTriggerClass->GetXaxis()->SetBinLabel(27,"kMuonUnlikeLowPt0"); | |
637 | hTriggerClass->GetXaxis()->SetBinLabel(28,"kUserDefined"); | |
11c1e680 | 638 | hTriggerClass->GetXaxis()->SetBinLabel(29,"kTRD"); |
639 | hTriggerClass->GetXaxis()->SetBinLabel(30,"kFastOnly"); | |
640 | hTriggerClass->GetXaxis()->SetBinLabel(31,"kAnyINT"); | |
641 | hTriggerClass->GetXaxis()->SetBinLabel(32,"kAny"); | |
642 | hTriggerClass->GetXaxis()->SetBinLabel(33,"V0AND"); | |
643 | hTriggerClass->GetXaxis()->SetBinLabel(34,"NOT kFastOnly"); | |
644 | hTriggerClass->GetXaxis()->SetBinLabel(35,"failed Physics Selection"); | |
4a0aab28 | 645 | fHistograms->Add(hTriggerClass); |
ae947965 | 646 | } |
647 | if(!preCut){ | |
11c1e680 | 648 | hTriggerClassSelected= new TH1F(Form("OfflineTriggerSelected %s",GetCutNumber().Data()),"OfflineTriggerSelected",34,-0.5,33.5); |
a280ac15 | 649 | hTriggerClassSelected->GetXaxis()->SetBinLabel( 1,"kMB"); |
650 | hTriggerClassSelected->GetXaxis()->SetBinLabel( 2,"kINT7"); | |
651 | hTriggerClassSelected->GetXaxis()->SetBinLabel( 3,"kMUON"); | |
652 | hTriggerClassSelected->GetXaxis()->SetBinLabel( 4,"kHighMult"); | |
653 | hTriggerClassSelected->GetXaxis()->SetBinLabel( 5,"kKEMC1"); | |
654 | hTriggerClassSelected->GetXaxis()->SetBinLabel( 6,"kCINT5"); | |
655 | hTriggerClassSelected->GetXaxis()->SetBinLabel( 7,"kCMUS5/kMUSPB"); | |
656 | hTriggerClassSelected->GetXaxis()->SetBinLabel( 8,"kMUSH7/kMUSHPB"); | |
657 | hTriggerClassSelected->GetXaxis()->SetBinLabel( 9,"kMUL7/kMuonLikePB"); | |
658 | hTriggerClassSelected->GetXaxis()->SetBinLabel(10,"kMUU7/kMuonUnlikePB"); | |
659 | hTriggerClassSelected->GetXaxis()->SetBinLabel(11,"kEMC7/kEMC8"); | |
660 | hTriggerClassSelected->GetXaxis()->SetBinLabel(12,"kMUS7"); | |
661 | hTriggerClassSelected->GetXaxis()->SetBinLabel(13,"kPHI1"); | |
662 | hTriggerClassSelected->GetXaxis()->SetBinLabel(14,"kPHI7/kPHI8/kPHOSPb"); | |
663 | hTriggerClassSelected->GetXaxis()->SetBinLabel(15,"kEMCEJE"); | |
664 | hTriggerClassSelected->GetXaxis()->SetBinLabel(16,"kEMCEGA"); | |
665 | hTriggerClassSelected->GetXaxis()->SetBinLabel(17,"kCentral"); | |
666 | hTriggerClassSelected->GetXaxis()->SetBinLabel(18,"kSemiCentral"); | |
667 | hTriggerClassSelected->GetXaxis()->SetBinLabel(19,"kDG5"); | |
668 | hTriggerClassSelected->GetXaxis()->SetBinLabel(20,"kZED"); | |
669 | hTriggerClassSelected->GetXaxis()->SetBinLabel(21,"kSPI7/kSPI"); | |
670 | hTriggerClassSelected->GetXaxis()->SetBinLabel(22,"kINT8"); | |
671 | hTriggerClassSelected->GetXaxis()->SetBinLabel(23,"kMuonSingleLowPt8"); | |
672 | hTriggerClassSelected->GetXaxis()->SetBinLabel(24,"kMuonSingleHighPt8"); | |
673 | hTriggerClassSelected->GetXaxis()->SetBinLabel(25,"kMuonLikeLowPt8"); | |
674 | hTriggerClassSelected->GetXaxis()->SetBinLabel(26,"kMuonUnlikeLowPt8"); | |
675 | hTriggerClassSelected->GetXaxis()->SetBinLabel(27,"kMuonUnlikeLowPt0"); | |
676 | hTriggerClassSelected->GetXaxis()->SetBinLabel(28,"kUserDefined"); | |
11c1e680 | 677 | hTriggerClassSelected->GetXaxis()->SetBinLabel(29,"kTRD"); |
678 | hTriggerClassSelected->GetXaxis()->SetBinLabel(30,"kFastOnly"); | |
679 | hTriggerClassSelected->GetXaxis()->SetBinLabel(31,"kAnyINT"); | |
680 | hTriggerClassSelected->GetXaxis()->SetBinLabel(32,"kAny"); | |
681 | hTriggerClassSelected->GetXaxis()->SetBinLabel(33,"V0AND"); | |
682 | hTriggerClassSelected->GetXaxis()->SetBinLabel(34,"NOT kFastOnly"); | |
a280ac15 | 683 | fHistograms->Add(hTriggerClassSelected); |
4a0aab28 | 684 | } |
ccfa8c0d | 685 | TH1::AddDirectory(kTRUE); |
3b77b2d1 | 686 | } |
687 | ||
688 | //________________________________________________________________________ | |
689 | Bool_t AliConversionCuts::InitPIDResponse(){ | |
4a0aab28 | 690 | // Set Pointer to AliPIDResponse |
3b77b2d1 | 691 | |
4a0aab28 | 692 | AliAnalysisManager *man=AliAnalysisManager::GetAnalysisManager(); |
e5b6e8a6 | 693 | if(man) { |
4a0aab28 | 694 | AliInputEventHandler* inputHandler = (AliInputEventHandler*) (man->GetInputEventHandler()); |
695 | fPIDResponse = (AliPIDResponse*)inputHandler->GetPIDResponse(); | |
696 | if(fPIDResponse)return kTRUE; | |
e5b6e8a6 | 697 | |
4a0aab28 | 698 | } |
e5b6e8a6 | 699 | |
ca91a3e1 | 700 | |
4a0aab28 | 701 | return kFALSE; |
3b77b2d1 | 702 | } |
703 | ///________________________________________________________________________ | |
92efd725 | 704 | Bool_t AliConversionCuts::EventIsSelected(AliVEvent *fInputEvent, AliVEvent *fMCEvent){ |
4a0aab28 | 705 | // Process Event Selection |
3b77b2d1 | 706 | |
4a0aab28 | 707 | Int_t cutindex=0; |
708 | if(hV0EventCuts)hV0EventCuts->Fill(cutindex); | |
709 | cutindex++; | |
e5b6e8a6 | 710 | |
4a0aab28 | 711 | // Check for MC event |
ae947965 | 712 | if(fMCEvent && fInputEvent->IsA()==AliESDEvent::Class()){ |
4a0aab28 | 713 | // Check if MC event is correctly loaded |
714 | AliMCEventHandler* mcHandler = dynamic_cast<AliMCEventHandler*> (AliAnalysisManager::GetAnalysisManager()->GetMCtruthEventHandler()); | |
715 | if (!mcHandler){ | |
716 | fEventQuality = 2; | |
717 | return kFALSE; | |
718 | } | |
719 | if (!mcHandler->InitOk() ){ | |
720 | fEventQuality = 2; | |
721 | return kFALSE; | |
722 | } | |
723 | if (!mcHandler->TreeK() ){ | |
724 | fEventQuality = 2; | |
725 | return kFALSE; | |
726 | } | |
727 | if (!mcHandler->TreeTR() ) { | |
728 | fEventQuality = 2; | |
729 | return kFALSE; | |
730 | } | |
731 | } | |
4a0aab28 | 732 | |
e5b6e8a6 | 733 | // Event Trigger |
4803eb1f | 734 | // cout << "before event trigger" << endl; |
1186afd2 | 735 | if(!IsTriggerSelected(fInputEvent)){ |
4a0aab28 | 736 | if(hV0EventCuts)hV0EventCuts->Fill(cutindex); |
737 | fEventQuality = 3; | |
738 | return kFALSE; | |
739 | } | |
740 | cutindex++; | |
a280ac15 | 741 | |
e5b6e8a6 | 742 | if(fInputEvent->IsA()==AliESDEvent::Class()){ |
743 | AliTriggerAnalysis fTriggerAnalysis;// = new AliTriggerAnalysis; | |
744 | fHasV0AND = fTriggerAnalysis.IsOfflineTriggerFired((AliESDEvent*)fInputEvent, AliTriggerAnalysis::kV0AND); | |
11c1e680 | 745 | if(fHasV0AND&&hTriggerClass)hTriggerClass->Fill(32); |
e5b6e8a6 | 746 | } |
ccfa8c0d | 747 | // cout << "event number " << ((AliESDEvent*)fInputEvent)->GetEventNumberInFile() << " entered"<< endl; |
748 | ||
4a0aab28 | 749 | |
e5b6e8a6 | 750 | // Number of Contributors Cut |
751 | if(GetNumberOfContributorsVtx(fInputEvent)<=0) { | |
4a0aab28 | 752 | if(hV0EventCuts)hV0EventCuts->Fill(cutindex); |
e5b6e8a6 | 753 | fEventQuality = 5; |
4a0aab28 | 754 | return kFALSE; |
755 | } | |
756 | cutindex++; | |
757 | ||
e5b6e8a6 | 758 | // Z Vertex Position Cut |
759 | if(!VertexZCut(fInputEvent)){ | |
4a0aab28 | 760 | if(hV0EventCuts)hV0EventCuts->Fill(cutindex); |
e5b6e8a6 | 761 | fEventQuality = 4; |
4a0aab28 | 762 | return kFALSE; |
763 | } | |
764 | cutindex++; | |
92efd725 | 765 | |
4a0aab28 | 766 | // Pile Up Rejection |
3b77b2d1 | 767 | |
4a0aab28 | 768 | if(fRemovePileUp){ |
769 | if(fInputEvent->IsPileupFromSPD(3,0.8,3.,2.,5.)){ | |
770 | if(hV0EventCuts)hV0EventCuts->Fill(cutindex); | |
771 | fEventQuality = 6; | |
772 | return kFALSE; | |
773 | } | |
774 | } | |
775 | cutindex++; | |
776 | ||
777 | // Centrality Selection | |
e5b6e8a6 | 778 | if(!IsCentralitySelected(fInputEvent,fMCEvent)){ |
4a0aab28 | 779 | if(hV0EventCuts)hV0EventCuts->Fill(cutindex); |
780 | fEventQuality = 1; | |
781 | return kFALSE; | |
782 | } | |
783 | cutindex++; | |
784 | ||
785 | // Fill Event Histograms | |
786 | if(hV0EventCuts)hV0EventCuts->Fill(cutindex); | |
787 | if(hVertexZ)hVertexZ->Fill(fInputEvent->GetPrimaryVertex()->GetZ()); | |
788 | if(hCentrality)hCentrality->Fill(GetCentrality(fInputEvent)); | |
4803eb1f | 789 | if(hCentralityVsNumberOfPrimaryTracks) |
790 | hCentralityVsNumberOfPrimaryTracks->Fill(GetCentrality(fInputEvent), | |
791 | ((AliV0ReaderV1*)AliAnalysisManager::GetAnalysisManager() | |
792 | ->GetTask("V0ReaderV1"))->GetNumberOfPrimaryTracks()); | |
4a0aab28 | 793 | fEventQuality = 0; |
794 | return kTRUE; | |
3b77b2d1 | 795 | } |
796 | ||
797 | ///________________________________________________________________________ | |
92efd725 | 798 | Bool_t AliConversionCuts::PhotonIsSelectedMC(TParticle *particle,AliStack *fMCStack,Bool_t checkForConvertedGamma){ |
4a0aab28 | 799 | // MonteCarlo Photon Selection |
3b77b2d1 | 800 | |
4a0aab28 | 801 | if(!fMCStack)return kFALSE; |
3b77b2d1 | 802 | |
4a0aab28 | 803 | if (particle->GetPdgCode() == 22){ |
e5b6e8a6 | 804 | |
4a0aab28 | 805 | |
11c1e680 | 806 | if( particle->Eta() > (fEtaCut + fEtaShift) || particle->Eta() < (-fEtaCut + fEtaShift) ) |
807 | return kFALSE; | |
808 | if(fEtaCutMin>-0.1){ | |
809 | if( particle->Eta() < (fEtaCutMin + fEtaShift) && particle->Eta() > (-fEtaCutMin + fEtaShift) ) | |
810 | return kFALSE; | |
811 | } | |
ccfa8c0d | 812 | |
4a0aab28 | 813 | if(particle->GetMother(0) >-1 && fMCStack->Particle(particle->GetMother(0))->GetPdgCode() == 22){ |
814 | return kFALSE; // no photon as mothers! | |
815 | } | |
816 | ||
817 | if(particle->GetMother(0) >= fMCStack->GetNprimary()){ | |
818 | return kFALSE; // the gamma has a mother, and it is not a primary particle | |
819 | } | |
820 | ||
821 | if(!checkForConvertedGamma) return kTRUE; // return in case of accepted gamma | |
822 | ||
823 | // looking for conversion gammas (electron + positron from pairbuilding (= 5) ) | |
824 | TParticle* ePos = NULL; | |
825 | TParticle* eNeg = NULL; | |
826 | ||
827 | if(particle->GetNDaughters() >= 2){ | |
828 | for(Int_t daughterIndex=particle->GetFirstDaughter();daughterIndex<=particle->GetLastDaughter();daughterIndex++){ | |
829 | TParticle *tmpDaughter = fMCStack->Particle(daughterIndex); | |
830 | if(tmpDaughter->GetUniqueID() == 5){ | |
831 | if(tmpDaughter->GetPdgCode() == 11){ | |
832 | eNeg = tmpDaughter; | |
833 | } else if(tmpDaughter->GetPdgCode() == -11){ | |
834 | ePos = tmpDaughter; | |
835 | } | |
836 | } | |
837 | } | |
838 | } | |
839 | ||
840 | if(ePos == NULL || eNeg == NULL){ // means we do not have two daughters from pair production | |
841 | return kFALSE; | |
842 | } | |
e5b6e8a6 | 843 | |
4a0aab28 | 844 | if(ePos->Pt()<fSinglePtCut || eNeg->Pt()<fSinglePtCut){ |
845 | return kFALSE; // no reconstruction below the Pt cut | |
846 | } | |
e5b6e8a6 | 847 | |
11c1e680 | 848 | if( ePos->Eta() > (fEtaCut + fEtaShift) || ePos->Eta() < (-fEtaCut + fEtaShift) || |
849 | eNeg->Eta() > (fEtaCut + fEtaShift) || eNeg->Eta() < (-fEtaCut + fEtaShift) ) | |
4a0aab28 | 850 | return kFALSE; |
11c1e680 | 851 | |
852 | if(fEtaCutMin > -0.1){ | |
853 | if( (ePos->Eta() < (fEtaCutMin + fEtaShift) && ePos->Eta() > (-fEtaCutMin + fEtaShift)) || | |
854 | (eNeg->Eta() < (fEtaCutMin + fEtaShift) && eNeg->Eta() > (-fEtaCutMin + fEtaShift)) ) | |
855 | return kFALSE; | |
4a0aab28 | 856 | } |
e5b6e8a6 | 857 | |
4a0aab28 | 858 | if(ePos->R()>fMaxR){ |
859 | return kFALSE; // cuts on distance from collision point | |
860 | } | |
861 | ||
e5b6e8a6 | 862 | if(abs(ePos->Vz()) > fMaxZ){ |
fcc79cf5 | 863 | return kFALSE; // outside material |
4a0aab28 | 864 | } |
e5b6e8a6 | 865 | if(abs(eNeg->Vz()) > fMaxZ){ |
fcc79cf5 | 866 | return kFALSE; // outside material |
4a0aab28 | 867 | } |
868 | ||
e5b6e8a6 | 869 | if( ePos->R() <= ((abs(ePos->Vz()) * fLineCutZRSlope) - fLineCutZValue)){ |
4a0aab28 | 870 | return kFALSE; // line cut to exclude regions where we do not reconstruct |
e5b6e8a6 | 871 | } else if ( fEtaCutMin != -0.1 && ePos->R() >= ((abs(ePos->Vz()) * fLineCutZRSlopeMin) - fLineCutZValueMin)){ |
4a0aab28 | 872 | return kFALSE; |
873 | } | |
e5b6e8a6 | 874 | |
875 | if( eNeg->R() <= ((abs(eNeg->Vz()) * fLineCutZRSlope) - fLineCutZValue)){ | |
4a0aab28 | 876 | return kFALSE; // line cut to exclude regions where we do not reconstruct |
e5b6e8a6 | 877 | } else if ( fEtaCutMin != -0.1 && eNeg->R() >= ((abs(eNeg->Vz()) * fLineCutZRSlopeMin) - fLineCutZValueMin)){ |
4a0aab28 | 878 | return kFALSE; |
879 | } | |
e5b6e8a6 | 880 | |
4a0aab28 | 881 | return kTRUE; |
882 | //if(AcceptanceCut(particle,ePos,eNeg))return kTRUE; | |
883 | } | |
884 | return kFALSE; | |
3b77b2d1 | 885 | } |
ae947965 | 886 | ///________________________________________________________________________ |
887 | Bool_t AliConversionCuts::PhotonIsSelectedAODMC(AliAODMCParticle *particle,TClonesArray *aodmcArray,Bool_t checkForConvertedGamma){ | |
888 | // MonteCarlo Photon Selection | |
889 | ||
890 | if(!aodmcArray)return kFALSE; | |
aff90284 | 891 | |
ae947965 | 892 | if (particle->GetPdgCode() == 22){ |
893 | if( particle->Eta() > (fEtaCut + fEtaShift) || particle->Eta() < (-fEtaCut + fEtaShift) ) | |
894 | return kFALSE; | |
895 | if(fEtaCutMin>-0.1){ | |
896 | if( particle->Eta() < (fEtaCutMin + fEtaShift) && particle->Eta() > (-fEtaCutMin + fEtaShift) ) | |
897 | return kFALSE; | |
898 | } | |
899 | ||
900 | if(particle->GetMother() > -1){ | |
901 | if((static_cast<AliAODMCParticle*>(aodmcArray->At(particle->GetMother())))->GetPdgCode() == 22){ | |
902 | return kFALSE; // no photon as mothers! | |
903 | } | |
904 | if(!(static_cast<AliAODMCParticle*>(aodmcArray->At(particle->GetMother()))->IsPrimary())){ | |
905 | return kFALSE; // the gamma has a mother, and it is not a primary particle | |
906 | } | |
907 | } | |
aff90284 | 908 | |
ae947965 | 909 | if(!checkForConvertedGamma) return kTRUE; // return in case of accepted gamma |
910 | ||
911 | // looking for conversion gammas (electron + positron from pairbuilding (= 5) ) | |
912 | AliAODMCParticle* ePos = NULL; | |
913 | AliAODMCParticle* eNeg = NULL; | |
914 | ||
915 | if(particle->GetNDaughters() >= 2){ | |
916 | for(Int_t daughterIndex=particle->GetDaughter(0);daughterIndex<=particle->GetDaughter(1);daughterIndex++){ | |
917 | AliAODMCParticle *tmpDaughter = static_cast<AliAODMCParticle*>(aodmcArray->At(daughterIndex)); | |
918 | if(!tmpDaughter) continue; | |
919 | if(((tmpDaughter->GetMCProcessCode())) == 5){ // STILL A BUG IN ALIROOT >>8 HAS TPO BE REMOVED AFTER FIX | |
920 | if(tmpDaughter->GetPdgCode() == 11){ | |
921 | eNeg = tmpDaughter; | |
922 | } else if(tmpDaughter->GetPdgCode() == -11){ | |
923 | ePos = tmpDaughter; | |
924 | } | |
925 | } | |
926 | } | |
927 | } | |
aff90284 | 928 | |
ae947965 | 929 | if(ePos == NULL || eNeg == NULL){ // means we do not have two daughters from pair production |
930 | return kFALSE; | |
931 | } | |
932 | ||
933 | if(ePos->Pt()<fSinglePtCut || eNeg->Pt()<fSinglePtCut){ | |
934 | return kFALSE; // no reconstruction below the Pt cut | |
935 | } | |
936 | ||
937 | if( ePos->Eta() > (fEtaCut + fEtaShift) || ePos->Eta() < (-fEtaCut + fEtaShift) || | |
938 | eNeg->Eta() > (fEtaCut + fEtaShift) || eNeg->Eta() < (-fEtaCut + fEtaShift) ) | |
939 | return kFALSE; | |
940 | ||
941 | if(fEtaCutMin > -0.1){ | |
942 | if( (ePos->Eta() < (fEtaCutMin + fEtaShift) && ePos->Eta() > (-fEtaCutMin + fEtaShift)) || | |
943 | (eNeg->Eta() < (fEtaCutMin + fEtaShift) && eNeg->Eta() > (-fEtaCutMin + fEtaShift)) ) | |
944 | return kFALSE; | |
945 | } | |
946 | ||
947 | Double_t rPos = sqrt( (ePos->Xv()*ePos->Xv()) + (ePos->Yv()*ePos->Yv()) ); | |
948 | Double_t rNeg = sqrt( (eNeg->Xv()*eNeg->Xv()) + (eNeg->Yv()*eNeg->Yv()) ); | |
aff90284 | 949 | |
ae947965 | 950 | if(rPos>fMaxR){ |
951 | return kFALSE; // cuts on distance from collision point | |
952 | } | |
953 | if(abs(ePos->Zv()) > fMaxZ){ | |
fcc79cf5 | 954 | return kFALSE; // outside material |
ae947965 | 955 | } |
956 | if(abs(eNeg->Zv()) > fMaxZ){ | |
fcc79cf5 | 957 | return kFALSE; // outside material |
ae947965 | 958 | } |
3b77b2d1 | 959 | |
ae947965 | 960 | if( rPos <= ((abs(ePos->Zv()) * fLineCutZRSlope) - fLineCutZValue)){ |
961 | return kFALSE; // line cut to exclude regions where we do not reconstruct | |
962 | } else if ( fEtaCutMin != -0.1 && rPos >= ((abs(ePos->Zv()) * fLineCutZRSlopeMin) - fLineCutZValueMin)){ | |
963 | return kFALSE; | |
964 | } | |
965 | ||
966 | if( rNeg <= ((abs(eNeg->Zv()) * fLineCutZRSlope) - fLineCutZValue)){ | |
967 | return kFALSE; // line cut to exclude regions where we do not reconstruct | |
968 | } else if ( fEtaCutMin != -0.1 && rNeg >= ((abs(eNeg->Zv()) * fLineCutZRSlopeMin) - fLineCutZValueMin)){ | |
969 | return kFALSE; | |
970 | } | |
2bb2434e | 971 | |
ae947965 | 972 | return kTRUE; |
973 | //if(AcceptanceCut(particle,ePos,eNeg))return kTRUE; | |
974 | } | |
975 | return kFALSE; | |
976 | } | |
3b77b2d1 | 977 | ///________________________________________________________________________ |
978 | Bool_t AliConversionCuts::PhotonCuts(AliConversionPhotonBase *photon,AliVEvent *event) | |
979 | { // Specific Photon Cuts | |
980 | ||
4a0aab28 | 981 | Int_t cutIndex = 0; |
982 | if(hPhotonCuts)hPhotonCuts->Fill(cutIndex); | |
983 | cutIndex++; | |
984 | ||
985 | // Fill Histos before Cuts | |
986 | if(hInvMassbefore)hInvMassbefore->Fill(photon->GetMass()); | |
e5b6e8a6 | 987 | |
4a0aab28 | 988 | if(hArmenterosbefore)hArmenterosbefore->Fill(photon->GetArmenterosAlpha(),photon->GetArmenterosQt()); |
989 | ||
990 | // Gamma selection based on QT from Armenteros | |
991 | if(fDoQtGammaSelection == kTRUE){ | |
992 | if(!ArmenterosQtCut(photon)){ | |
993 | if(hPhotonCuts)hPhotonCuts->Fill(cutIndex); //1 | |
994 | return kFALSE; | |
995 | } | |
996 | } | |
997 | cutIndex++; //2 | |
998 | ||
999 | // Chi Cut | |
1000 | if(photon->GetChi2perNDF() > fChi2CutConversion || photon->GetChi2perNDF() <=0){ | |
1001 | { | |
1002 | if(hPhotonCuts)hPhotonCuts->Fill(cutIndex); //2 | |
1003 | return kFALSE; | |
1004 | } | |
1005 | } | |
1006 | cutIndex++;//3 | |
1007 | ||
1008 | // Reconstruction Acceptance Cuts | |
1009 | if(!AcceptanceCuts(photon)){ | |
1010 | if(hPhotonCuts)hPhotonCuts->Fill(cutIndex); //3 | |
1011 | return kFALSE; | |
1012 | } | |
1013 | ||
1014 | cutIndex++; //4 | |
1015 | // Asymmetry Cut | |
1016 | if(fDoPhotonAsymmetryCut == kTRUE){ | |
1017 | if(!AsymmetryCut(photon,event)){ | |
1018 | if(hPhotonCuts)hPhotonCuts->Fill(cutIndex); //4 | |
1019 | return kFALSE; | |
1020 | } | |
1021 | } | |
1022 | ||
1023 | //Check the pid probability | |
1024 | cutIndex++; //5 | |
1025 | if(!PIDProbabilityCut(photon, event)) { | |
1026 | if(hPhotonCuts)hPhotonCuts->Fill(cutIndex); //5 | |
1027 | return kFALSE; | |
1028 | } | |
1029 | ||
1030 | cutIndex++; //6 | |
1031 | if(!CorrectedTPCClusterCut(photon, event)) { | |
1032 | if(hPhotonCuts)hPhotonCuts->Fill(cutIndex); //6 | |
1033 | return kFALSE; | |
1034 | } | |
1035 | ||
1036 | ||
1037 | cutIndex++; //7 | |
1038 | if(!PsiPairCut(photon)) { | |
1039 | if(hPhotonCuts)hPhotonCuts->Fill(cutIndex); //7 | |
1040 | return kFALSE; | |
1041 | } | |
1042 | ||
1043 | cutIndex++; //8 | |
1044 | if(!CosinePAngleCut(photon, event)) { | |
1045 | if(hPhotonCuts)hPhotonCuts->Fill(cutIndex); //8 | |
1046 | return kFALSE; | |
1047 | } | |
1048 | ||
4803eb1f | 1049 | AliAODConversionPhoton* photonAOD = dynamic_cast<AliAODConversionPhoton*>(photon); |
1050 | if (photonAOD){ | |
1051 | photonAOD->CalculateDistanceOfClossetApproachToPrimVtx(event->GetPrimaryVertex()); | |
aff90284 | 1052 | |
4803eb1f | 1053 | cutIndex++; //9 |
1054 | if(photonAOD->GetDCArToPrimVtx() > fDCARPrimVtxCut) { //DCA R cut of photon to primary vertex | |
1055 | if(hPhotonCuts)hPhotonCuts->Fill(cutIndex); //9 | |
1056 | return kFALSE; | |
1057 | } | |
aff90284 | 1058 | |
4803eb1f | 1059 | cutIndex++; //10 |
1060 | if(abs(photonAOD->GetDCAzToPrimVtx()) > fDCAZPrimVtxCut) { //DCA Z cut of photon to primary vertex | |
1061 | if(hPhotonCuts)hPhotonCuts->Fill(cutIndex); //10 | |
1062 | return kFALSE; | |
1063 | } | |
1064 | } else { | |
1065 | cutIndex++; //9 | |
1066 | cutIndex++; //10 | |
1067 | } | |
1068 | cutIndex++; //11 | |
1069 | if(hPhotonCuts)hPhotonCuts->Fill(cutIndex); //11 | |
4a0aab28 | 1070 | |
1071 | // Histos after Cuts | |
1072 | if(hInvMassafter)hInvMassafter->Fill(photon->GetMass()); | |
1073 | if(hArmenterosafter)hArmenterosafter->Fill(photon->GetArmenterosAlpha(),photon->GetArmenterosQt()); | |
aff90284 | 1074 | |
4a0aab28 | 1075 | return kTRUE; |
3b77b2d1 | 1076 | |
1077 | } | |
1078 | ||
1079 | ///________________________________________________________________________ | |
1080 | Bool_t AliConversionCuts::CorrectedTPCClusterCut(AliConversionPhotonBase *photon, AliVEvent * event) | |
1081 | { //Cut on corrected TPC Cluster Info | |
1082 | ||
4a0aab28 | 1083 | AliVTrack * negTrack = GetTrack(event, photon->GetTrackLabelNegative()); |
1084 | AliVTrack * posTrack = GetTrack(event, photon->GetTrackLabelPositive()); | |
3b77b2d1 | 1085 | |
4a0aab28 | 1086 | if(!negTrack||!posTrack)return kFALSE; |
3b77b2d1 | 1087 | |
4a0aab28 | 1088 | Double_t negclsToF=0; |
3b77b2d1 | 1089 | |
4a0aab28 | 1090 | if (!fUseCorrectedTPCClsInfo ){ |
1091 | if(negTrack->GetTPCNclsF()!=0){ | |
1092 | negclsToF = (Double_t)negTrack->GetNcls(1)/(Double_t)negTrack->GetTPCNclsF();}// Ncluster/Nfindablecluster | |
1093 | } | |
1094 | else { | |
1095 | negclsToF = negTrack->GetTPCClusterInfo(2,0,GetFirstTPCRow(photon->GetConversionRadius())); | |
1096 | } | |
3b77b2d1 | 1097 | |
4a0aab28 | 1098 | Double_t posclsToF = 0.; |
1099 | if (!fUseCorrectedTPCClsInfo ){ | |
e5b6e8a6 | 1100 | if(posTrack->GetTPCNclsF()!=0){ |
4a0aab28 | 1101 | posclsToF = (Double_t)posTrack->GetNcls(1)/(Double_t)posTrack->GetTPCNclsF(); |
1102 | } | |
1103 | }else{ | |
1104 | posclsToF = posTrack->GetTPCClusterInfo(2,0,GetFirstTPCRow(photon->GetConversionRadius())); | |
1105 | } | |
3b77b2d1 | 1106 | |
e5b6e8a6 | 1107 | if( negclsToF < fMinClsTPCToF || posclsToF < fMinClsTPCToF ){ |
4a0aab28 | 1108 | return kFALSE; |
1109 | } | |
3b77b2d1 | 1110 | |
4a0aab28 | 1111 | return kTRUE; |
3b77b2d1 | 1112 | } |
1113 | ||
3b77b2d1 | 1114 | ///________________________________________________________________________ |
d008165e | 1115 | Bool_t AliConversionCuts::PhotonIsSelected(AliConversionPhotonBase *photon, AliVEvent * event) |
1116 | { | |
4a0aab28 | 1117 | //Selection of Reconstructed Photons |
3b77b2d1 | 1118 | |
4a0aab28 | 1119 | FillPhotonCutIndex(kPhotonIn); |
11c1e680 | 1120 | |
0a2b2b4b | 1121 | if(event->IsA()==AliESDEvent::Class()) { |
ccfa8c0d | 1122 | if(!SelectV0Finder( ( ((AliESDEvent*)event)->GetV0(photon->GetV0Index()))->GetOnFlyStatus() ) ){ |
0a2b2b4b | 1123 | FillPhotonCutIndex(kOnFly); |
1124 | return kFALSE; | |
1125 | } | |
1126 | } | |
1127 | // else if(event->IsA()==AliAODEvent::Class()) { | |
1128 | // if(!SelectV0Finder( ( ((AliAODEvent*)event)->GetV0(photon->GetV0Index())) ) ){ | |
1129 | // FillPhotonCutIndex(kOnFly); | |
1130 | // return kFALSE; | |
1131 | // } | |
1132 | // } | |
3b77b2d1 | 1133 | |
4a0aab28 | 1134 | // Get Tracks |
1135 | AliVTrack * negTrack = GetTrack(event, photon->GetTrackLabelNegative()); | |
1136 | AliVTrack * posTrack = GetTrack(event, photon->GetTrackLabelPositive()); | |
3b77b2d1 | 1137 | |
4a0aab28 | 1138 | if(!negTrack || !posTrack) { |
1139 | FillPhotonCutIndex(kNoTracks); | |
1140 | return kFALSE; | |
1141 | } | |
4803eb1f | 1142 | photon->DeterminePhotonQuality(negTrack,posTrack); |
4a0aab28 | 1143 | // Track Cuts |
1144 | if(!TracksAreSelected(negTrack, posTrack)){ | |
1145 | FillPhotonCutIndex(kTrackCuts); | |
1146 | return kFALSE; | |
1147 | } | |
aff90284 | 1148 | |
1186afd2 | 1149 | // dEdx Cuts |
1150 | if(!dEdxCuts(negTrack) || !dEdxCuts(posTrack)) { | |
1151 | FillPhotonCutIndex(kdEdxCuts); | |
1152 | return kFALSE; | |
1153 | } | |
1154 | ||
4a0aab28 | 1155 | // Photon Cuts |
1156 | if(!PhotonCuts(photon,event)){ | |
1157 | FillPhotonCutIndex(kPhotonCuts); | |
1158 | return kFALSE; | |
1159 | } | |
3b77b2d1 | 1160 | |
4a0aab28 | 1161 | // Photon passed cuts |
1162 | FillPhotonCutIndex(kPhotonOut); | |
1163 | return kTRUE; | |
3b77b2d1 | 1164 | } |
1165 | ||
3b77b2d1 | 1166 | ///________________________________________________________________________ |
1167 | Bool_t AliConversionCuts::ArmenterosQtCut(AliConversionPhotonBase *photon) | |
1168 | { // Armenteros Qt Cut | |
1169 | ||
4a0aab28 | 1170 | if(fDoHighPtQtGammaSelection){ |
1171 | if(photon->GetPhotonPt() < fPtBorderForQt){ | |
1172 | if(photon->GetArmenterosQt()>fQtMax){ | |
1173 | return kFALSE; | |
1174 | } | |
1175 | } else { | |
1176 | if(photon->GetArmenterosQt()>fHighPtQtMax){ | |
1177 | return kFALSE; | |
1178 | } | |
1179 | } | |
1180 | } else { | |
3b77b2d1 | 1181 | |
4a0aab28 | 1182 | if(photon->GetArmenterosQt()>fQtMax){ |
1183 | return kFALSE; | |
1184 | } | |
1185 | } | |
1186 | return kTRUE; | |
3b77b2d1 | 1187 | } |
1188 | ||
1189 | ||
1190 | ///________________________________________________________________________ | |
1191 | Bool_t AliConversionCuts::AcceptanceCuts(AliConversionPhotonBase *photon) { | |
4a0aab28 | 1192 | // Exclude certain areas for photon reconstruction |
3b77b2d1 | 1193 | |
4a0aab28 | 1194 | Int_t cutIndex=0; |
1195 | if(hAcceptanceCuts)hAcceptanceCuts->Fill(cutIndex); | |
1196 | cutIndex++; | |
3b77b2d1 | 1197 | |
4a0aab28 | 1198 | if(photon->GetConversionRadius()>fMaxR){ // cuts on distance from collision point |
1199 | if(hAcceptanceCuts)hAcceptanceCuts->Fill(cutIndex); | |
1200 | return kFALSE; | |
1201 | } | |
1202 | cutIndex++; | |
3b77b2d1 | 1203 | |
4a0aab28 | 1204 | if(photon->GetConversionRadius()<fMinR){ // cuts on distance from collision point |
1205 | if(hAcceptanceCuts)hAcceptanceCuts->Fill(cutIndex); | |
1206 | return kFALSE; | |
1207 | } | |
1208 | cutIndex++; | |
3b77b2d1 | 1209 | |
e5b6e8a6 | 1210 | if(photon->GetConversionRadius() <= ((abs(photon->GetConversionZ())*fLineCutZRSlope)-fLineCutZValue)){ |
3b77b2d1 | 1211 | if(hAcceptanceCuts)hAcceptanceCuts->Fill(cutIndex); |
1212 | return kFALSE; | |
4a0aab28 | 1213 | } |
e5b6e8a6 | 1214 | else if (fUseEtaMinCut && photon->GetConversionRadius() >= ((abs(photon->GetConversionZ())*fLineCutZRSlopeMin)-fLineCutZValueMin )){ |
4a0aab28 | 1215 | if(hAcceptanceCuts)hAcceptanceCuts->Fill(cutIndex); |
1216 | return kFALSE; | |
1217 | } | |
1218 | cutIndex++; | |
3b77b2d1 | 1219 | |
e5b6e8a6 | 1220 | if(abs(photon->GetConversionZ()) > fMaxZ ){ // cuts out regions where we do not reconstruct |
3b77b2d1 | 1221 | if(hAcceptanceCuts)hAcceptanceCuts->Fill(cutIndex); |
1222 | return kFALSE; | |
4a0aab28 | 1223 | } |
1224 | cutIndex++; | |
3b77b2d1 | 1225 | |
1226 | ||
11c1e680 | 1227 | if( photon->GetPhotonEta() > (fEtaCut + fEtaShift) || photon->GetPhotonEta() < (-fEtaCut + fEtaShift) ){ |
3b77b2d1 | 1228 | if(hAcceptanceCuts)hAcceptanceCuts->Fill(cutIndex); |
1229 | return kFALSE; | |
4a0aab28 | 1230 | } |
11c1e680 | 1231 | if(fEtaCutMin>-0.1){ |
1232 | if( photon->GetPhotonEta() < (fEtaCutMin + fEtaShift) && photon->GetPhotonEta() > (-fEtaCutMin + fEtaShift) ){ | |
1233 | if(hAcceptanceCuts)hAcceptanceCuts->Fill(cutIndex); | |
1234 | return kFALSE; | |
1235 | } | |
1236 | } | |
4a0aab28 | 1237 | cutIndex++; |
3b77b2d1 | 1238 | |
4a0aab28 | 1239 | if(photon->GetPhotonPt()<fPtCut){ |
3b77b2d1 | 1240 | if(hAcceptanceCuts)hAcceptanceCuts->Fill(cutIndex); |
1241 | return kFALSE; | |
4a0aab28 | 1242 | } |
1243 | cutIndex++; | |
3b77b2d1 | 1244 | |
4a0aab28 | 1245 | if(hAcceptanceCuts)hAcceptanceCuts->Fill(cutIndex); |
e5b6e8a6 | 1246 | |
4a0aab28 | 1247 | return kTRUE; |
3b77b2d1 | 1248 | } |
1249 | ||
1250 | ||
1251 | ///________________________________________________________________________ | |
1252 | Bool_t AliConversionCuts::SpecificTrackCuts(AliAODTrack * negTrack, AliAODTrack * posTrack,Int_t &cutIndex) { | |
4a0aab28 | 1253 | // Track Cuts which require AOD/ESD specific implementation |
3b77b2d1 | 1254 | |
4a0aab28 | 1255 | if( !negTrack->IsOn(AliESDtrack::kTPCrefit) || !posTrack->IsOn(AliESDtrack::kTPCrefit) ) { |
3b77b2d1 | 1256 | if(hTrackCuts)hTrackCuts->Fill(cutIndex); |
1257 | return kFALSE; | |
4a0aab28 | 1258 | } |
1259 | cutIndex++; | |
3b77b2d1 | 1260 | |
4a0aab28 | 1261 | AliAODVertex * NegVtxType=negTrack->GetProdVertex(); |
1262 | AliAODVertex * PosVtxType=posTrack->GetProdVertex(); | |
4803eb1f | 1263 | if( (NegVtxType->GetType())==AliAODVertex::kKink || (PosVtxType->GetType())==AliAODVertex::kKink) { |
3b77b2d1 | 1264 | if(hTrackCuts)hTrackCuts->Fill(cutIndex); |
1265 | return kFALSE; | |
4a0aab28 | 1266 | } |
1267 | return kTRUE; | |
3b77b2d1 | 1268 | |
1269 | } | |
1270 | ||
1271 | ||
1272 | ///________________________________________________________________________ | |
1273 | Bool_t AliConversionCuts::SpecificTrackCuts(AliESDtrack * negTrack, AliESDtrack * posTrack,Int_t &cutIndex) { | |
4a0aab28 | 1274 | // Track Cuts which require AOD/ESD specific implementation |
3b77b2d1 | 1275 | |
92efd725 | 1276 | if( !negTrack->IsOn(AliESDtrack::kTPCrefit) || !posTrack->IsOn(AliESDtrack::kTPCrefit) ) { |
3b77b2d1 | 1277 | if(hTrackCuts)hTrackCuts->Fill(cutIndex); |
1278 | return kFALSE; | |
4a0aab28 | 1279 | } |
1280 | cutIndex++; | |
3b77b2d1 | 1281 | |
4a0aab28 | 1282 | if(negTrack->GetKinkIndex(0) > 0 || posTrack->GetKinkIndex(0) > 0 ) { |
3b77b2d1 | 1283 | if(hTrackCuts)hTrackCuts->Fill(cutIndex); |
1284 | return kFALSE; | |
4a0aab28 | 1285 | } |
1286 | return kTRUE; | |
3b77b2d1 | 1287 | } |
1288 | ||
1289 | ||
1290 | ||
1291 | ///________________________________________________________________________ | |
1292 | Bool_t AliConversionCuts::TracksAreSelected(AliVTrack * negTrack, AliVTrack * posTrack) { | |
4a0aab28 | 1293 | // Track Selection for Photon Reconstruction |
3b77b2d1 | 1294 | |
4a0aab28 | 1295 | Int_t cutIndex=0; |
1296 | if(hTrackCuts)hTrackCuts->Fill(cutIndex); | |
1297 | cutIndex++; | |
3b77b2d1 | 1298 | |
4a0aab28 | 1299 | // avoid like sign |
1300 | if(negTrack->Charge() == posTrack->Charge()) { | |
1301 | if(hTrackCuts)hTrackCuts->Fill(cutIndex); | |
1302 | return kFALSE; | |
1303 | } | |
1304 | cutIndex++; | |
3b77b2d1 | 1305 | |
4a0aab28 | 1306 | // Number of TPC Clusters |
aff90284 | 1307 | |
1308 | ||
4a0aab28 | 1309 | if( negTrack->GetNcls(1) < fMinClsTPC || posTrack->GetNcls(1) < fMinClsTPC ) { |
3b77b2d1 | 1310 | if(hTrackCuts)hTrackCuts->Fill(cutIndex); |
4a0aab28 | 1311 | return kFALSE; |
1312 | } | |
1313 | cutIndex++; | |
ccfa8c0d | 1314 | |
4a0aab28 | 1315 | // Acceptance |
11c1e680 | 1316 | if( posTrack->Eta() > (fEtaCut + fEtaShift) || posTrack->Eta() < (-fEtaCut + fEtaShift) || |
1317 | negTrack->Eta() > (fEtaCut + fEtaShift) || negTrack->Eta() < (-fEtaCut + fEtaShift) ){ | |
4a0aab28 | 1318 | if(hTrackCuts)hTrackCuts->Fill(cutIndex); |
3b77b2d1 | 1319 | return kFALSE; |
4a0aab28 | 1320 | } |
11c1e680 | 1321 | if(fEtaCutMin>-0.1){ |
1322 | if( (posTrack->Eta() < (fEtaCutMin + fEtaShift) && posTrack->Eta() > (-fEtaCutMin + fEtaShift)) || | |
1323 | (negTrack->Eta() < (fEtaCutMin + fEtaShift) && negTrack->Eta() > (-fEtaCutMin + fEtaShift)) ){ | |
1324 | if(hTrackCuts)hTrackCuts->Fill(cutIndex); | |
1325 | return kFALSE; | |
1326 | } | |
1327 | } | |
4a0aab28 | 1328 | cutIndex++; |
3b77b2d1 | 1329 | |
4a0aab28 | 1330 | // Single Pt Cut |
fcc79cf5 | 1331 | if( negTrack->Pt()< fSinglePtCut || posTrack->Pt()< fSinglePtCut){ |
3b77b2d1 | 1332 | if(hTrackCuts)hTrackCuts->Fill(cutIndex); |
1333 | return kFALSE; | |
4a0aab28 | 1334 | } |
1335 | cutIndex++; | |
3b77b2d1 | 1336 | |
4a0aab28 | 1337 | // AOD ESD specific cuts |
1338 | Bool_t passCuts = kTRUE; | |
3b77b2d1 | 1339 | |
4a0aab28 | 1340 | if(negTrack->IsA()==AliAODTrack::Class()) { |
1341 | passCuts = passCuts * SpecificTrackCuts(static_cast<AliAODTrack*>(negTrack), static_cast<AliAODTrack*>(posTrack),cutIndex); | |
e5b6e8a6 | 1342 | } else { |
4a0aab28 | 1343 | passCuts = passCuts * SpecificTrackCuts(static_cast<AliESDtrack*>(negTrack), static_cast<AliESDtrack*>(posTrack),cutIndex); |
e5b6e8a6 | 1344 | } |
3b77b2d1 | 1345 | |
4a0aab28 | 1346 | if(!passCuts){ |
3b77b2d1 | 1347 | if(hTrackCuts)hTrackCuts->Fill(cutIndex); |
1348 | return kFALSE; | |
4a0aab28 | 1349 | } |
1350 | cutIndex++; | |
3b77b2d1 | 1351 | |
4a0aab28 | 1352 | if(hTrackCuts)hTrackCuts->Fill(cutIndex); |
3b77b2d1 | 1353 | |
4a0aab28 | 1354 | return kTRUE; |
e5b6e8a6 | 1355 | |
3b77b2d1 | 1356 | } |
1357 | ||
1358 | ///________________________________________________________________________ | |
1359 | Bool_t AliConversionCuts::dEdxCuts(AliVTrack *fCurrentTrack){ | |
4a0aab28 | 1360 | // Electron Identification Cuts for Photon reconstruction |
3b77b2d1 | 1361 | |
4a0aab28 | 1362 | if(!fPIDResponse){InitPIDResponse();}// Try to reinitialize PID Response |
1363 | if(!fPIDResponse){AliError("No PID Response"); return kTRUE;}// if still missing fatal error | |
3b77b2d1 | 1364 | |
4a0aab28 | 1365 | Int_t cutIndex=0; |
1366 | if(hdEdxCuts)hdEdxCuts->Fill(cutIndex); | |
e5b6e8a6 | 1367 | if(hTPCdEdxSigbefore)hTPCdEdxSigbefore->Fill(fCurrentTrack->P(),fPIDResponse->NumberOfSigmasTPC(fCurrentTrack, AliPID::kElectron)); |
1368 | if(hTPCdEdxbefore)hTPCdEdxbefore->Fill(fCurrentTrack->P(),fCurrentTrack->GetTPCsignal()); | |
4a0aab28 | 1369 | cutIndex++; |
e5b6e8a6 | 1370 | |
3b77b2d1 | 1371 | |
4a0aab28 | 1372 | if(fDodEdxSigmaCut == kTRUE){ |
3b77b2d1 | 1373 | // TPC Electron Line |
1374 | if( fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kElectron)<fPIDnSigmaBelowElectronLine || | |
4a0aab28 | 1375 | fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kElectron)>fPIDnSigmaAboveElectronLine){ |
3b77b2d1 | 1376 | |
4a0aab28 | 1377 | if(hdEdxCuts)hdEdxCuts->Fill(cutIndex); |
1378 | return kFALSE; | |
3b77b2d1 | 1379 | } |
1380 | cutIndex++; | |
1381 | ||
1382 | // TPC Pion Line | |
4a0aab28 | 1383 | if( fCurrentTrack->P()>fPIDMinPnSigmaAbovePionLine && fCurrentTrack->P()<fPIDMaxPnSigmaAbovePionLine ){ |
1384 | if(fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kElectron)>fPIDnSigmaBelowElectronLine && | |
1385 | fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kElectron)<fPIDnSigmaAboveElectronLine&& | |
1386 | fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kPion)<fPIDnSigmaAbovePionLine){ | |
1387 | ||
1388 | if(hdEdxCuts)hdEdxCuts->Fill(cutIndex); | |
1389 | return kFALSE; | |
1390 | } | |
1391 | } | |
1392 | cutIndex++; | |
e5b6e8a6 | 1393 | |
4a0aab28 | 1394 | // High Pt Pion rej |
1395 | if( fCurrentTrack->P()>fPIDMaxPnSigmaAbovePionLine ){ | |
1396 | if(fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kElectron)>fPIDnSigmaBelowElectronLine && | |
e5b6e8a6 | 1397 | fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kElectron)<fPIDnSigmaAboveElectronLine && |
4a0aab28 | 1398 | fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kPion)<fPIDnSigmaAbovePionLineHighPt){ |
1399 | ||
1400 | if(hdEdxCuts)hdEdxCuts->Fill(cutIndex); | |
1401 | return kFALSE; | |
1402 | } | |
1403 | } | |
1404 | cutIndex++; | |
1405 | } | |
1406 | else{cutIndex+=3;} | |
1407 | ||
1408 | if(fDoKaonRejectionLowP == kTRUE){ | |
1409 | if(fCurrentTrack->P()<fPIDMinPKaonRejectionLowP ){ | |
e5b6e8a6 | 1410 | if( abs(fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kKaon))<fPIDnSigmaAtLowPAroundKaonLine){ |
4a0aab28 | 1411 | |
1412 | if(hdEdxCuts)hdEdxCuts->Fill(cutIndex); | |
1413 | return kFALSE; | |
1414 | } | |
1415 | } | |
1416 | } | |
1417 | cutIndex++; | |
e5b6e8a6 | 1418 | |
4a0aab28 | 1419 | if(fDoProtonRejectionLowP == kTRUE){ |
1420 | if( fCurrentTrack->P()<fPIDMinPProtonRejectionLowP ){ | |
e5b6e8a6 | 1421 | if( abs(fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kProton))<fPIDnSigmaAtLowPAroundProtonLine){ |
4a0aab28 | 1422 | |
1423 | if(hdEdxCuts)hdEdxCuts->Fill(cutIndex); | |
1424 | return kFALSE; | |
1425 | } | |
1426 | } | |
1427 | } | |
3b77b2d1 | 1428 | cutIndex++; |
e5b6e8a6 | 1429 | |
4a0aab28 | 1430 | if(fDoPionRejectionLowP == kTRUE){ |
1431 | if( fCurrentTrack->P()<fPIDMinPPionRejectionLowP ){ | |
e5b6e8a6 | 1432 | if( abs(fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kPion))<fPIDnSigmaAtLowPAroundPionLine){ |
4a0aab28 | 1433 | |
1434 | if(hdEdxCuts)hdEdxCuts->Fill(cutIndex); | |
1435 | return kFALSE; | |
1436 | } | |
1437 | } | |
1438 | } | |
1439 | cutIndex++; | |
e5b6e8a6 | 1440 | |
1441 | ||
1442 | // cout<<"Start"<<endl; | |
1443 | // AliPIDResponse::EDetPidStatus status=fPIDResponse->CheckPIDStatus(AliPIDResponse::kTOF,fCurrentTrack); | |
a280ac15 | 1444 | |
e5b6e8a6 | 1445 | // if( ( (status & AliVTrack::kTOFout) == AliVTrack::kTOFout ) && ( (status & AliVTrack::kTIME) == AliVTrack::kTIME )) |
1446 | // {cout<<"TOF DA"<<endl;} | |
a280ac15 | 1447 | // if(status == AliPIDResponse::kDetPidOk){ |
e5b6e8a6 | 1448 | // Float_t probMis = fPIDResponse->GetTOFMismatchProbability(fCurrentTrack); |
1449 | // cout<<"--> "<<probMis<<endl; | |
1450 | // if(probMis > 0.01){ | |
a280ac15 | 1451 | |
e5b6e8a6 | 1452 | // } |
1453 | // } | |
a280ac15 | 1454 | |
4a0aab28 | 1455 | if((fCurrentTrack->GetStatus() & AliESDtrack::kTOFpid) && !(fCurrentTrack->GetStatus() & AliESDtrack::kTOFmismatch)){ |
e5b6e8a6 | 1456 | if(hTOFbefore){ |
1457 | Double_t t0 = fPIDResponse->GetTOFResponse().GetStartTime(fCurrentTrack->P()); | |
1458 | Double_t times[5]; | |
1459 | fCurrentTrack->GetIntegratedTimes(times); | |
fcc79cf5 | 1460 | Double_t TOFsignal = fCurrentTrack->GetTOFsignal(); |
e5b6e8a6 | 1461 | Double_t dT = TOFsignal - t0 - times[0]; |
1462 | hTOFbefore->Fill(fCurrentTrack->P(),dT); | |
1463 | } | |
1464 | if(hTOFSigbefore) hTOFSigbefore->Fill(fCurrentTrack->P(),fPIDResponse->NumberOfSigmasTOF(fCurrentTrack, AliPID::kElectron)); | |
4a0aab28 | 1465 | if(fUseTOFpid){ |
1466 | if(fPIDResponse->NumberOfSigmasTOF(fCurrentTrack, AliPID::kElectron)>fTofPIDnSigmaAboveElectronLine || | |
1467 | fPIDResponse->NumberOfSigmasTOF(fCurrentTrack, AliPID::kElectron)<fTofPIDnSigmaBelowElectronLine ){ | |
1468 | if(hdEdxCuts)hdEdxCuts->Fill(cutIndex); | |
1469 | return kFALSE; | |
1470 | } | |
1471 | } | |
e5b6e8a6 | 1472 | if(hTOFSigafter)hTOFSigafter->Fill(fCurrentTrack->P(),fPIDResponse->NumberOfSigmasTOF(fCurrentTrack, AliPID::kElectron)); |
4a0aab28 | 1473 | } |
1474 | cutIndex++; | |
e5b6e8a6 | 1475 | |
4a0aab28 | 1476 | // Apply TRD PID |
1477 | if(fDoTRDPID){ | |
1478 | if(!fPIDResponse->IdentifiedAsElectronTRD(fCurrentTrack,fPIDTRDEfficiency)){ | |
4a0aab28 | 1479 | if(hdEdxCuts)hdEdxCuts->Fill(cutIndex); |
1480 | return kFALSE; | |
1481 | } | |
1482 | } | |
1483 | cutIndex++; | |
3b77b2d1 | 1484 | |
4a0aab28 | 1485 | if(hdEdxCuts)hdEdxCuts->Fill(cutIndex); |
e5b6e8a6 | 1486 | if(hTPCdEdxSigafter)hTPCdEdxSigafter->Fill(fCurrentTrack->P(),fPIDResponse->NumberOfSigmasTPC(fCurrentTrack, AliPID::kElectron)); |
1487 | if(hTPCdEdxafter)hTPCdEdxafter->Fill(fCurrentTrack->P(),fCurrentTrack->GetTPCsignal()); | |
4a0aab28 | 1488 | return kTRUE; |
3b77b2d1 | 1489 | } |
1490 | ||
1491 | ///________________________________________________________________________ | |
1492 | Bool_t AliConversionCuts::AsymmetryCut(AliConversionPhotonBase * photon,AliVEvent *event) { | |
4a0aab28 | 1493 | // Cut on Energy Assymetry |
3b77b2d1 | 1494 | |
4a0aab28 | 1495 | for(Int_t ii=0;ii<2;ii++){ |
3b77b2d1 | 1496 | |
4a0aab28 | 1497 | AliVTrack *track=GetTrack(event,photon->GetTrackLabel(ii)); |
3b77b2d1 | 1498 | |
4a0aab28 | 1499 | if( track->P() > fMinPPhotonAsymmetryCut ){ |
1500 | Double_t trackNegAsy=0; | |
1501 | if (photon->GetPhotonP()!=0.){ | |
1502 | trackNegAsy= track->P()/photon->GetPhotonP(); | |
1503 | } | |
aff90284 | 1504 | |
4a0aab28 | 1505 | if( trackNegAsy<fMinPhotonAsymmetry ||trackNegAsy>(1.- fMinPhotonAsymmetry)){ |
1506 | return kFALSE; | |
1507 | } | |
1508 | } | |
3b77b2d1 | 1509 | |
4a0aab28 | 1510 | } |
1511 | return kTRUE; | |
3b77b2d1 | 1512 | } |
1513 | ||
1514 | ///________________________________________________________________________ | |
92efd725 | 1515 | AliVTrack *AliConversionCuts::GetTrack(AliVEvent * event, Int_t label){ |
4a0aab28 | 1516 | //Returns pointer to the track with given ESD label |
1517 | //(Important for AOD implementation, since Track array in AOD data is different | |
1518 | //from ESD array, but ESD tracklabels are stored in AOD Tracks) | |
1519 | ||
1520 | AliESDEvent * esdEvent = dynamic_cast<AliESDEvent*>(event); | |
1521 | if(esdEvent) { | |
1522 | if(label > event->GetNumberOfTracks() ) return NULL; | |
1523 | AliESDtrack * track = esdEvent->GetTrack(label); | |
1524 | return track; | |
e5b6e8a6 | 1525 | |
1526 | } else { | |
ae947965 | 1527 | AliVTrack * track = 0x0; |
1186afd2 | 1528 | if(((AliV0ReaderV1*)AliAnalysisManager::GetAnalysisManager()->GetTask("V0ReaderV1"))->AreAODsRelabeled()){ |
1529 | track = dynamic_cast<AliVTrack*>(event->GetTrack(label)); | |
1530 | return track; | |
1531 | } | |
aff90284 | 1532 | else{ |
1186afd2 | 1533 | for(Int_t ii=0; ii<event->GetNumberOfTracks(); ii++) { |
1534 | track = dynamic_cast<AliVTrack*>(event->GetTrack(ii)); | |
1535 | if(track){ | |
1536 | if(track->GetID() == label) { | |
ae947965 | 1537 | return track; |
1538 | } | |
1539 | } | |
1540 | } | |
1541 | } | |
4a0aab28 | 1542 | } |
e5b6e8a6 | 1543 | //AliDebug(5,(Form("track not found %d %d",label,event->GetNumberOfTracks())); |
1544 | return NULL; | |
1545 | } | |
1546 | ||
1547 | ///________________________________________________________________________ | |
1548 | AliESDtrack *AliConversionCuts::GetESDTrack(AliESDEvent * event, Int_t label){ | |
1549 | //Returns pointer to the track with given ESD label | |
1550 | //(Important for AOD implementation, since Track array in AOD data is different | |
1551 | //from ESD array, but ESD tracklabels are stored in AOD Tracks) | |
1552 | ||
1553 | if(event) { | |
1554 | if(label > event->GetNumberOfTracks() ) return NULL; | |
1555 | AliESDtrack * track = event->GetTrack(label); | |
1556 | return track; | |
1557 | } | |
4a0aab28 | 1558 | //AliDebug(5,(Form("track not found %d %d",label,event->GetNumberOfTracks())); |
1559 | return NULL; | |
3b77b2d1 | 1560 | } |
1561 | ||
1562 | ||
e5b6e8a6 | 1563 | |
3b77b2d1 | 1564 | ///________________________________________________________________________ |
1565 | Bool_t AliConversionCuts::PIDProbabilityCut(AliConversionPhotonBase *photon, AliVEvent * event){ | |
4a0aab28 | 1566 | // Cut on Electron Probability for Photon Reconstruction |
3b77b2d1 | 1567 | |
4a0aab28 | 1568 | AliESDEvent * esdEvent = dynamic_cast<AliESDEvent*>(event); |
3b77b2d1 | 1569 | |
4a0aab28 | 1570 | if(esdEvent){ |
e5b6e8a6 | 1571 | |
4a0aab28 | 1572 | Bool_t iResult=kFALSE; |
e5b6e8a6 | 1573 | |
4a0aab28 | 1574 | Double_t *posProbArray = new Double_t[AliPID::kSPECIES]; |
1575 | Double_t *negProbArray = new Double_t[AliPID::kSPECIES]; | |
e5b6e8a6 | 1576 | |
fcc79cf5 | 1577 | AliESDtrack* negTrack = esdEvent->GetTrack(photon->GetTrackLabelNegative()); |
1578 | AliESDtrack* posTrack = esdEvent->GetTrack(photon->GetTrackLabelPositive()); | |
e5b6e8a6 | 1579 | |
4a0aab28 | 1580 | if(negProbArray && posProbArray){ |
e5b6e8a6 | 1581 | |
4a0aab28 | 1582 | negTrack->GetTPCpid(negProbArray); |
1583 | posTrack->GetTPCpid(posProbArray); | |
3b77b2d1 | 1584 | |
4a0aab28 | 1585 | if(negProbArray[AliPID::kElectron]>=fPIDProbabilityCutNegativeParticle && posProbArray[AliPID::kElectron]>=fPIDProbabilityCutPositiveParticle){ |
1586 | iResult=kTRUE; | |
1587 | } | |
1588 | } | |
e5b6e8a6 | 1589 | |
4a0aab28 | 1590 | delete [] posProbArray; |
1591 | delete [] negProbArray; | |
1592 | return iResult; | |
3b77b2d1 | 1593 | |
4a0aab28 | 1594 | } else { |
3b77b2d1 | 1595 | ///Not possible for AODs |
1596 | return kTRUE; | |
4a0aab28 | 1597 | } |
3b77b2d1 | 1598 | |
1599 | ||
1600 | ||
e5b6e8a6 | 1601 | |
3b77b2d1 | 1602 | } |
1603 | ||
1604 | ||
1605 | ///________________________________________________________________________ | |
1606 | Bool_t AliConversionCuts::AcceptanceCut(TParticle *particle, TParticle * ePos,TParticle* eNeg){ | |
4a0aab28 | 1607 | // MC Acceptance Cuts |
1608 | //(Certain areas were excluded for photon reconstruction) | |
3b77b2d1 | 1609 | |
4a0aab28 | 1610 | if(particle->R()>fMaxR){ |
1611 | return kFALSE;} | |
3b77b2d1 | 1612 | |
4a0aab28 | 1613 | if(ePos->R()>fMaxR){ |
1614 | return kFALSE; | |
1615 | } | |
3b77b2d1 | 1616 | |
4a0aab28 | 1617 | if(ePos->R()<fMinR){ |
1618 | return kFALSE; | |
1619 | } | |
3b77b2d1 | 1620 | |
e5b6e8a6 | 1621 | if( ePos->R() <= ((abs(ePos->Vz())*fLineCutZRSlope)-fLineCutZValue)){ |
4a0aab28 | 1622 | return kFALSE; |
1623 | } | |
e5b6e8a6 | 1624 | else if (fUseEtaMinCut && ePos->R() >= ((abs(ePos->Vz())*fLineCutZRSlopeMin)-fLineCutZValueMin )){ |
3b77b2d1 | 1625 | return kFALSE; |
4a0aab28 | 1626 | } |
3b77b2d1 | 1627 | |
e5b6e8a6 | 1628 | if(abs(eNeg->Vz()) > fMaxZ ){ // cuts out regions where we do not reconstruct |
4a0aab28 | 1629 | return kFALSE; |
1630 | } | |
3b77b2d1 | 1631 | |
4a0aab28 | 1632 | if(eNeg->Vz()!=ePos->Vz()||eNeg->R()!=ePos->R()){ |
1633 | return kFALSE; | |
1634 | } | |
3b77b2d1 | 1635 | |
e5b6e8a6 | 1636 | if(abs(ePos->Vz()) > fMaxZ ){ // cuts out regions where we do not reconstruct |
4a0aab28 | 1637 | return kFALSE; |
1638 | } | |
3b77b2d1 | 1639 | |
ccfa8c0d | 1640 | |
11c1e680 | 1641 | if( particle->Eta() > (fEtaCut + fEtaShift) || particle->Eta() < (-fEtaCut + fEtaShift) ){ |
4a0aab28 | 1642 | return kFALSE; |
1643 | } | |
11c1e680 | 1644 | if( ePos->Eta() > (fEtaCut + fEtaShift) || ePos->Eta() < (-fEtaCut + fEtaShift) ){ |
4a0aab28 | 1645 | return kFALSE; |
1646 | } | |
11c1e680 | 1647 | if( eNeg->Eta() > (fEtaCut + fEtaShift) || eNeg->Eta() < (-fEtaCut + fEtaShift) ){ |
4a0aab28 | 1648 | return kFALSE; |
1649 | } | |
11c1e680 | 1650 | if(fEtaCutMin>-0.1){ |
1651 | if( particle->Eta() < (fEtaCutMin + fEtaShift) && particle->Eta() > (-fEtaCutMin + fEtaShift) ){ | |
1652 | return kFALSE; | |
1653 | } | |
1654 | if( ePos->Eta() < (fEtaCutMin + fEtaShift) && ePos->Eta() > (-fEtaCutMin + fEtaShift) ){ | |
1655 | return kFALSE; | |
1656 | } | |
1657 | if( eNeg->Eta() < (fEtaCutMin + fEtaShift) && eNeg->Eta() > (-fEtaCutMin + fEtaShift) ){ | |
1658 | return kFALSE; | |
1659 | } | |
1660 | } | |
ccfa8c0d | 1661 | |
4a0aab28 | 1662 | if( ePos->Pt()< fSinglePtCut || eNeg->Pt()< fSinglePtCut){ |
1663 | return kFALSE; | |
1664 | } | |
3b77b2d1 | 1665 | |
4a0aab28 | 1666 | if(particle->Pt()<fPtCut){ |
1667 | return kFALSE; | |
1668 | } | |
3b77b2d1 | 1669 | |
4a0aab28 | 1670 | return kTRUE; |
3b77b2d1 | 1671 | } |
1672 | ///________________________________________________________________________ | |
e5b6e8a6 | 1673 | Bool_t AliConversionCuts::UpdateCutString() { |
4a0aab28 | 1674 | ///Update the cut string (if it has been created yet) |
3b77b2d1 | 1675 | |
4a0aab28 | 1676 | if(fCutString && fCutString->GetString().Length() == kNCuts) { |
1677 | fCutString->SetString(GetCutNumber()); | |
1678 | } else { | |
1679 | return kFALSE; | |
1680 | } | |
1681 | return kTRUE; | |
3b77b2d1 | 1682 | } |
aff90284 | 1683 | ///________________________________________________________________________ |
ae947965 | 1684 | void AliConversionCuts::LoadReweightingHistosMCFromFile() { |
1685 | ||
1686 | AliInfo("Entering loading of histograms for weighting"); | |
1687 | TFile *f = TFile::Open(fPathTrFReweighting.Data()); | |
1688 | if(!f){ | |
1689 | AliError(Form("file for weighting %s not found",fPathTrFReweighting.Data())); | |
1690 | return; | |
aff90284 | 1691 | } |
ae947965 | 1692 | if (fNameHistoReweightingPi0.CompareTo("") != 0 && fDoReweightHistoMCPi0 ){ |
aff90284 | 1693 | TH1D *hReweightMCHistPi0temp = (TH1D*)f->Get(fNameHistoReweightingPi0.Data()); |
1694 | hReweightMCHistPi0 = new TH1D(*hReweightMCHistPi0temp); | |
6feb1680 | 1695 | hReweightMCHistPi0->SetDirectory(0); |
ae947965 | 1696 | if (hReweightMCHistPi0) AliInfo(Form("%s has been loaded from %s", fNameHistoReweightingPi0.Data(),fPathTrFReweighting.Data() )); |
aff90284 | 1697 | else AliWarning(Form("%s not found in %s", fNameHistoReweightingPi0.Data() ,fPathTrFReweighting.Data())); |
fcc79cf5 | 1698 | } |
1699 | if (fNameFitDataPi0.CompareTo("") != 0 && fDoReweightHistoMCPi0 ){ | |
aff90284 | 1700 | TF1 *fFitDataPi0temp = (TF1*)f->Get(fNameFitDataPi0.Data()); |
1701 | fFitDataPi0 = new TF1(*fFitDataPi0temp); | |
fcc79cf5 | 1702 | if (fFitDataPi0) AliInfo(Form("%s has been loaded from %s", fNameFitDataPi0.Data(),fPathTrFReweighting.Data() )); |
aff90284 | 1703 | else AliWarning(Form("%s not found in %s",fPathTrFReweighting.Data(), fNameFitDataPi0.Data() )); |
ae947965 | 1704 | } |
aff90284 | 1705 | |
ae947965 | 1706 | if (fNameHistoReweightingEta.CompareTo("") != 0 && fDoReweightHistoMCEta){ |
aff90284 | 1707 | TH1D *hReweightMCHistEtatemp = (TH1D*)f->Get(fNameHistoReweightingEta.Data()); |
1708 | hReweightMCHistEta = new TH1D(*hReweightMCHistEtatemp); | |
6feb1680 | 1709 | hReweightMCHistEta->SetDirectory(0); |
ae947965 | 1710 | if (hReweightMCHistEta) AliInfo(Form("%s has been loaded from %s", fNameHistoReweightingEta.Data(),fPathTrFReweighting.Data() )); |
aff90284 | 1711 | else AliWarning(Form("%s not found in %s", fNameHistoReweightingEta.Data(),fPathTrFReweighting.Data() )); |
fcc79cf5 | 1712 | } |
aff90284 | 1713 | |
fcc79cf5 | 1714 | if (fNameFitDataEta.CompareTo("") != 0 && fDoReweightHistoMCEta){ |
aff90284 | 1715 | TF1 *fFitDataEtatemp = (TF1*)f->Get(fNameFitDataEta.Data()); |
1716 | fFitDataEta = new TF1(*fFitDataEtatemp); | |
fcc79cf5 | 1717 | if (fFitDataEta) AliInfo(Form("%s has been loaded from %s", fNameFitDataEta.Data(),fPathTrFReweighting.Data() )); |
aff90284 | 1718 | else AliWarning(Form("%s not found in %s", fNameFitDataEta.Data(),fPathTrFReweighting.Data() )); |
ae947965 | 1719 | |
1720 | } | |
1721 | if (fNameHistoReweightingK0s.CompareTo("") != 0 && fDoReweightHistoMCK0s){ | |
aff90284 | 1722 | TH1D *hReweightMCHistK0stemp = (TH1D*)f->Get(fNameHistoReweightingK0s.Data()); |
1723 | hReweightMCHistK0s = new TH1D(*hReweightMCHistK0stemp); | |
6feb1680 | 1724 | hReweightMCHistK0s->SetDirectory(0); |
ae947965 | 1725 | if (hReweightMCHistK0s) AliInfo(Form("%s has been loaded from %s", fNameHistoReweightingK0s.Data(),fPathTrFReweighting.Data() )); |
aff90284 | 1726 | else AliWarning(Form("%s not found in %s", fNameHistoReweightingK0s.Data(),fPathTrFReweighting.Data() )); |
ae947965 | 1727 | } |
1728 | ||
fcc79cf5 | 1729 | if (fNameFitDataK0s.CompareTo("") != 0 && fDoReweightHistoMCK0s){ |
aff90284 | 1730 | TF1 *fFitDataK0stemp = (TF1*)f->Get(fNameFitDataK0s.Data()); |
1731 | fFitDataK0s = new TF1(*fFitDataK0stemp); | |
fcc79cf5 | 1732 | if (fFitDataK0s) AliInfo(Form("%s has been loaded from %s", fNameFitDataK0s.Data(),fPathTrFReweighting.Data() )); |
aff90284 | 1733 | else AliWarning(Form("%s not found in %s", fNameFitDataK0s.Data(),fPathTrFReweighting.Data() )); |
fcc79cf5 | 1734 | } |
6feb1680 | 1735 | f->Close(); |
1736 | delete f; | |
1737 | ||
ae947965 | 1738 | } |
1739 | ||
1740 | ||
3b77b2d1 | 1741 | ///________________________________________________________________________ |
1742 | Bool_t AliConversionCuts::InitializeCutsFromCutString(const TString analysisCutSelection ) { | |
1743 | // Initialize Cuts from a given Cut string | |
fcc79cf5 | 1744 | if(fDoReweightHistoMCPi0 || fDoReweightHistoMCEta || fDoReweightHistoMCK0s) { |
1745 | AliInfo("Weighting was enabled"); | |
1746 | LoadReweightingHistosMCFromFile(); | |
fcc79cf5 | 1747 | } |
aff90284 | 1748 | |
4a0aab28 | 1749 | AliInfo(Form("Set Photoncut Number: %s",analysisCutSelection.Data())); |
1750 | if(analysisCutSelection.Length()!=kNCuts) { | |
1751 | AliError(Form("Cut selection has the wrong length! size is %d, number of cuts is %d", analysisCutSelection.Length(), kNCuts)); | |
1752 | return kFALSE; | |
1753 | } | |
1754 | if(!analysisCutSelection.IsDigit()){ | |
1755 | AliError("Cut selection contains characters"); | |
1756 | return kFALSE; | |
1757 | } | |
e5b6e8a6 | 1758 | |
4a0aab28 | 1759 | const char *cutSelection = analysisCutSelection.Data(); |
fcc79cf5 | 1760 | #define ASSIGNARRAY(i) fCuts[i] = cutSelection[i] - '0' |
4a0aab28 | 1761 | for(Int_t ii=0;ii<kNCuts;ii++){ |
3b77b2d1 | 1762 | ASSIGNARRAY(ii); |
4a0aab28 | 1763 | } |
3b77b2d1 | 1764 | |
4a0aab28 | 1765 | // Set Individual Cuts |
1766 | for(Int_t ii=0;ii<kNCuts;ii++){ | |
3b77b2d1 | 1767 | if(!SetCut(cutIds(ii),fCuts[ii]))return kFALSE; |
4a0aab28 | 1768 | } |
3b77b2d1 | 1769 | |
4a0aab28 | 1770 | //PrintCuts(); |
92efd725 | 1771 | |
4a0aab28 | 1772 | return kTRUE; |
3b77b2d1 | 1773 | } |
1774 | ///________________________________________________________________________ | |
1775 | Bool_t AliConversionCuts::SetCut(cutIds cutID, const Int_t value) { | |
4a0aab28 | 1776 | ///Set individual cut ID |
3b77b2d1 | 1777 | |
4a0aab28 | 1778 | switch (cutID) { |
e5b6e8a6 | 1779 | |
4a0aab28 | 1780 | case kv0FinderType: |
1781 | if( SetV0Finder(value)) { | |
1782 | fCuts[kv0FinderType] = value; | |
e5b6e8a6 | 1783 | UpdateCutString(); |
4a0aab28 | 1784 | return kTRUE; |
1785 | } else return kFALSE; | |
1786 | ||
1787 | case kededxSigmaCut: | |
1788 | if( SetTPCdEdxCutElectronLine(value)) { | |
1789 | fCuts[kededxSigmaCut] = value; | |
e5b6e8a6 | 1790 | UpdateCutString(); |
4a0aab28 | 1791 | return kTRUE; |
1792 | } else return kFALSE; | |
1793 | ||
1794 | case kpidedxSigmaCut: | |
1795 | if( SetTPCdEdxCutPionLine(value)) { | |
1796 | fCuts[kpidedxSigmaCut] = value; | |
e5b6e8a6 | 1797 | UpdateCutString(); |
4a0aab28 | 1798 | return kTRUE; |
1799 | } else return kFALSE; | |
1800 | ||
1801 | case kpiMomdedxSigmaCut: | |
1802 | if( SetMinMomPiondEdxCut(value)) { | |
1803 | fCuts[kpiMomdedxSigmaCut] = value; | |
e5b6e8a6 | 1804 | UpdateCutString(); |
4a0aab28 | 1805 | return kTRUE; |
1806 | } else return kFALSE; | |
1807 | ||
1808 | case kchi2GammaCut: | |
1809 | if( SetChi2GammaCut(value)) { | |
1810 | fCuts[kchi2GammaCut] = value; | |
e5b6e8a6 | 1811 | UpdateCutString(); |
4a0aab28 | 1812 | return kTRUE; |
1813 | } else return kFALSE; | |
1814 | ||
1815 | case ksinglePtCut: | |
1816 | if( SetSinglePtCut(value)) { | |
1817 | fCuts[ksinglePtCut] = value; | |
e5b6e8a6 | 1818 | UpdateCutString(); |
4a0aab28 | 1819 | return kTRUE; |
1820 | } else return kFALSE; | |
1821 | ||
1822 | case kclsTPCCut: | |
1823 | if( SetTPCClusterCut(value)) { | |
1824 | fCuts[kclsTPCCut] = value; | |
e5b6e8a6 | 1825 | UpdateCutString(); |
4a0aab28 | 1826 | return kTRUE; |
1827 | } else return kFALSE; | |
1828 | ||
1829 | case ketaCut: | |
1830 | if( SetEtaCut(value)) { | |
1831 | fCuts[ketaCut] = value; | |
e5b6e8a6 | 1832 | UpdateCutString(); |
4a0aab28 | 1833 | return kTRUE; |
1834 | } else return kFALSE; | |
1835 | ||
1836 | case kLowPRejectionSigmaCut: | |
1837 | if( SetLowPRejectionCuts(value)) { | |
1838 | fCuts[kLowPRejectionSigmaCut] = value; | |
e5b6e8a6 | 1839 | UpdateCutString(); |
4a0aab28 | 1840 | return kTRUE; |
1841 | } else return kFALSE; | |
1842 | ||
1843 | case kQtMaxCut: | |
1844 | if( SetQtMaxCut(value)) { | |
1845 | fCuts[kQtMaxCut] = value; | |
e5b6e8a6 | 1846 | UpdateCutString(); |
4a0aab28 | 1847 | return kTRUE; |
1848 | } else return kFALSE; | |
1849 | ||
1850 | case kpiMaxMomdedxSigmaCut: | |
1851 | if( SetMaxMomPiondEdxCut(value)) { | |
1852 | fCuts[kpiMaxMomdedxSigmaCut] = value; | |
e5b6e8a6 | 1853 | UpdateCutString(); |
4a0aab28 | 1854 | return kTRUE; |
1855 | } else return kFALSE; | |
1856 | ||
1857 | case kRCut: | |
1858 | if( SetRCut(value)) { | |
1859 | fCuts[kRCut] = value; | |
e5b6e8a6 | 1860 | UpdateCutString(); |
4a0aab28 | 1861 | return kTRUE; |
1862 | } else return kFALSE; | |
1863 | ||
1864 | case kremovePileUp: | |
1865 | if( SetRemovePileUp(value)) { | |
1866 | fCuts[kremovePileUp] = value; | |
e5b6e8a6 | 1867 | UpdateCutString(); |
4a0aab28 | 1868 | return kTRUE; |
1869 | } else return kFALSE; | |
1870 | ||
1871 | case kselectV0AND: | |
e5b6e8a6 | 1872 | if( SetSelectSpecialTrigger(value)) { |
4a0aab28 | 1873 | fCuts[kselectV0AND] = value; |
e5b6e8a6 | 1874 | UpdateCutString(); |
4a0aab28 | 1875 | return kTRUE; |
1876 | } else return kFALSE; | |
1877 | ||
1878 | case kmultiplicityMethod: | |
1879 | if( SetMultiplicityMethod(value)) { | |
1880 | fCuts[kmultiplicityMethod] = value; | |
e5b6e8a6 | 1881 | UpdateCutString(); |
4a0aab28 | 1882 | return kTRUE; |
1883 | } else return kFALSE; | |
1884 | ||
1885 | case kisHeavyIon: | |
1886 | if( SetIsHeavyIon(value)) { | |
1887 | fCuts[kisHeavyIon] = value; | |
e5b6e8a6 | 1888 | UpdateCutString(); |
4a0aab28 | 1889 | return kTRUE; |
1890 | } else return kFALSE; | |
1891 | ||
1892 | case kCentralityMin: | |
1893 | if( SetCentralityMin(value)) { | |
1894 | fCuts[kCentralityMin] = value; | |
e5b6e8a6 | 1895 | UpdateCutString(); |
4a0aab28 | 1896 | return kTRUE; |
1897 | } else return kFALSE; | |
1898 | ||
1899 | case kCentralityMax: | |
1900 | if( SetCentralityMax(value)) { | |
1901 | fCuts[kCentralityMax] = value; | |
e5b6e8a6 | 1902 | UpdateCutString(); |
4a0aab28 | 1903 | return kTRUE; |
1904 | } else return kFALSE; | |
1905 | ||
1906 | case kTOFelectronPID: | |
1907 | if( SetTOFElectronPIDCut(value)) { | |
1908 | fCuts[kTOFelectronPID] = value; | |
e5b6e8a6 | 1909 | UpdateCutString(); |
4a0aab28 | 1910 | return kTRUE; |
1911 | } else return kFALSE; | |
1912 | ||
1913 | case kdoPhotonAsymmetryCut: | |
1914 | if( SetPhotonAsymmetryCut(value)) { | |
1915 | fCuts[kdoPhotonAsymmetryCut] = value; | |
e5b6e8a6 | 1916 | UpdateCutString(); |
4a0aab28 | 1917 | return kTRUE; |
1918 | } else return kFALSE; | |
1919 | ||
1920 | case kPsiPair: | |
1921 | if( SetPsiPairCut(value)) { | |
1922 | fCuts[kPsiPair] = value; | |
e5b6e8a6 | 1923 | UpdateCutString(); |
4a0aab28 | 1924 | return kTRUE; |
1925 | } else return kFALSE; | |
1926 | ||
1927 | case kCosPAngle: | |
1928 | if( SetCosPAngleCut(value)) { | |
1929 | fCuts[kCosPAngle] = value; | |
e5b6e8a6 | 1930 | UpdateCutString(); |
4a0aab28 | 1931 | return kTRUE; |
1932 | } else return kFALSE; | |
1933 | ||
1934 | ||
1935 | case kElecShare: | |
1936 | if( SetSharedElectronCut(value)) { | |
1937 | fCuts[kElecShare] = value; | |
e5b6e8a6 | 1938 | UpdateCutString(); |
4a0aab28 | 1939 | return kTRUE; |
1940 | } else return kFALSE; | |
1941 | ||
4a0aab28 | 1942 | case kToCloseV0s: |
1943 | if( SetToCloseV0sCut(value)) { | |
1944 | fCuts[kToCloseV0s] = value; | |
e5b6e8a6 | 1945 | UpdateCutString(); |
4a0aab28 | 1946 | return kTRUE; |
1947 | } else return kFALSE; | |
1948 | ||
1949 | case kExtraSignals: | |
1950 | if( SetRejectExtraSignalsCut(value)) { | |
1951 | fCuts[kExtraSignals] = value; | |
e5b6e8a6 | 1952 | UpdateCutString(); |
4a0aab28 | 1953 | return kTRUE; |
1954 | } else return kFALSE; | |
1955 | ||
4803eb1f | 1956 | case kDcaRPrimVtx: |
1957 | if( SetDCARPhotonPrimVtxCut(value)) { | |
1958 | fCuts[kDcaRPrimVtx] = value; | |
1959 | UpdateCutString(); | |
1960 | return kTRUE; | |
1961 | } else return kFALSE; | |
1962 | ||
1963 | case kDcaZPrimVtx: | |
1964 | if( SetDCAZPhotonPrimVtxCut(value)) { | |
1965 | fCuts[kDcaZPrimVtx] = value; | |
1966 | UpdateCutString(); | |
1967 | return kTRUE; | |
1968 | } else return kFALSE; | |
1969 | ||
aff90284 | 1970 | |
4a0aab28 | 1971 | case kNCuts: |
92efd725 | 1972 | AliError("Cut id out of range"); |
4a0aab28 | 1973 | return kFALSE; |
1974 | } | |
d008165e | 1975 | |
4a0aab28 | 1976 | AliError("Cut id %d not recognized"); |
1977 | return kFALSE; | |
3b77b2d1 | 1978 | |
e5b6e8a6 | 1979 | |
3b77b2d1 | 1980 | } |
1981 | ///________________________________________________________________________ | |
e5b6e8a6 | 1982 | void AliConversionCuts::PrintCuts() { |
1983 | // Print out current Cut Selection | |
1984 | for(Int_t ic = 0; ic < kNCuts; ic++) { | |
1985 | printf("%-30s : %d \n", fgkCutNames[ic], fCuts[ic]); | |
1986 | } | |
1987 | } | |
1988 | ///________________________________________________________________________ | |
1989 | Bool_t AliConversionCuts::SetIsHeavyIon(Int_t isHeavyIon) | |
1990 | { // Set Cut | |
1991 | switch(isHeavyIon){ | |
4a0aab28 | 1992 | case 0: |
e5b6e8a6 | 1993 | fIsHeavyIon=0; |
4a0aab28 | 1994 | break; |
1995 | case 1: | |
e5b6e8a6 | 1996 | fIsHeavyIon=1; |
1997 | fDetectorCentrality=0; | |
1998 | break; | |
1999 | case 2: | |
2000 | fIsHeavyIon=1; | |
2001 | fDetectorCentrality=1; | |
2002 | break; | |
2003 | case 3: //allows to select centrality 0-45% in steps of 5% for V0 Multiplicity | |
2004 | fIsHeavyIon=1; | |
2005 | fDetectorCentrality=0; | |
2006 | fModCentralityClass=1; | |
2007 | break; | |
2008 | case 4: //allows to select centrality 45-90% in steps of 5% for V0 Multiplicity | |
2009 | fIsHeavyIon=1; | |
2010 | fDetectorCentrality=0; | |
2011 | fModCentralityClass=2; | |
2012 | break; | |
2013 | case 5: //strict cut on v0 tracks for MC | |
2014 | fIsHeavyIon=1; | |
2015 | fDetectorCentrality=0; | |
2016 | fModCentralityClass=3; | |
2017 | break; | |
4803eb1f | 2018 | case 6: //allows to select centrality 0-45% in steps of 5% for track mult |
e5b6e8a6 | 2019 | //strict cut on v0 tracks for MC |
2020 | fIsHeavyIon=1; | |
2021 | fDetectorCentrality=0; | |
2022 | fModCentralityClass=4; | |
2023 | break; | |
2024 | case 7: //allows to select centrality 45-90% in steps of 5% for V0 Multiplicity | |
2025 | //strict cut on v0 tracks for MC | |
2026 | fIsHeavyIon=1; | |
2027 | fDetectorCentrality=0; | |
2028 | fModCentralityClass=5; | |
4a0aab28 | 2029 | break; |
0a2b2b4b | 2030 | case 8: |
2031 | fIsHeavyIon=2; | |
2032 | fDetectorCentrality=0; | |
2033 | break; | |
2034 | case 9: | |
2035 | fIsHeavyIon=2; | |
2036 | fDetectorCentrality=1; | |
11c1e680 | 2037 | break; |
4a0aab28 | 2038 | default: |
e5b6e8a6 | 2039 | AliError(Form("SetHeavyIon not defined %d",isHeavyIon)); |
4a0aab28 | 2040 | return kFALSE; |
2041 | } | |
2042 | return kTRUE; | |
3b77b2d1 | 2043 | } |
0a2b2b4b | 2044 | |
e5b6e8a6 | 2045 | //___________________________________________________________________ |
2046 | Bool_t AliConversionCuts::SetCentralityMin(Int_t minCentrality) | |
2047 | { | |
2048 | // Set Cut | |
2049 | if(minCentrality<0||minCentrality>9){ | |
2050 | AliError(Form("minCentrality not defined %d",minCentrality)); | |
2051 | return kFALSE; | |
2052 | } | |
3b77b2d1 | 2053 | |
e5b6e8a6 | 2054 | fCentralityMin=minCentrality; |
2055 | return kTRUE; | |
2056 | } | |
2057 | //___________________________________________________________________ | |
2058 | Bool_t AliConversionCuts::SetCentralityMax(Int_t maxCentrality) | |
2059 | { | |
2060 | // Set Cut | |
2061 | if(maxCentrality<0||maxCentrality>9){ | |
2062 | AliError(Form("maxCentrality not defined %d",maxCentrality)); | |
2063 | return kFALSE; | |
2064 | } | |
2065 | fCentralityMax=maxCentrality; | |
2066 | return kTRUE; | |
2067 | } | |
3b77b2d1 | 2068 | ///________________________________________________________________________ |
e5b6e8a6 | 2069 | Int_t AliConversionCuts::SetSelectSpecialTrigger(Int_t selectSpecialTrigger) |
3b77b2d1 | 2070 | {// Set Cut |
e5b6e8a6 | 2071 | |
2072 | switch(selectSpecialTrigger){ | |
4a0aab28 | 2073 | case 0: |
e5b6e8a6 | 2074 | fSpecialTrigger=0; // dont care |
3b77b2d1 | 2075 | break; |
4a0aab28 | 2076 | case 1: |
e5b6e8a6 | 2077 | fSpecialTrigger=1; // V0AND |
2078 | break; | |
2079 | case 2: | |
2080 | fSpecialTrigger=2; // with SDD requested | |
2081 | break; | |
2082 | case 3: | |
2083 | fSpecialTrigger=3; // V0AND plus with SDD requested | |
3b77b2d1 | 2084 | break; |
aff90284 | 2085 | // allows to run MB & 6 other different trigger classes in parallel with the same photon cut |
2086 | case 4: | |
ae947965 | 2087 | fSpecialTrigger=4; // different trigger class as MB |
2088 | fTriggerSelectedManually = kTRUE; | |
2089 | break; | |
aff90284 | 2090 | case 5: |
ae947965 | 2091 | fSpecialTrigger=4; // different trigger class as MB |
2092 | fTriggerSelectedManually = kTRUE; | |
2093 | break; | |
aff90284 | 2094 | case 6: |
ae947965 | 2095 | fSpecialTrigger=4; // different trigger class as MB |
2096 | fTriggerSelectedManually = kTRUE; | |
2097 | break; | |
aff90284 | 2098 | case 7: |
ae947965 | 2099 | fSpecialTrigger=4; // different trigger class as MB |
2100 | fTriggerSelectedManually = kTRUE; | |
2101 | break; | |
aff90284 | 2102 | case 8: |
ae947965 | 2103 | fSpecialTrigger=4; // different trigger class as MB |
2104 | fTriggerSelectedManually = kTRUE; | |
aff90284 | 2105 | break; |
2106 | case 9: | |
ae947965 | 2107 | fSpecialTrigger=4; // different trigger class as MB |
2108 | fTriggerSelectedManually = kTRUE; | |
aff90284 | 2109 | break; |
4a0aab28 | 2110 | default: |
e5b6e8a6 | 2111 | AliError("Warning: Special Trigger Not known"); |
3b77b2d1 | 2112 | return kFALSE; |
4a0aab28 | 2113 | } |
2114 | return kTRUE; | |
3b77b2d1 | 2115 | } |
3b77b2d1 | 2116 | ///________________________________________________________________________ |
92efd725 | 2117 | Bool_t AliConversionCuts::SetMultiplicityMethod(Int_t multiplicityMethod) |
2118 | { | |
4a0aab28 | 2119 | // Set Cut |
2120 | fMultiplicityMethod=multiplicityMethod; | |
92efd725 | 2121 | |
4a0aab28 | 2122 | // 0 Photon Multiplicity |
2123 | // 1 TPC Track multiplicity | |
2124 | // 2 V0 Mult | |
2125 | // 3 SPD Mult | |
92efd725 | 2126 | |
4a0aab28 | 2127 | return kTRUE; |
3b77b2d1 | 2128 | } |
3b77b2d1 | 2129 | ///________________________________________________________________________ |
e5b6e8a6 | 2130 | Bool_t AliConversionCuts::SetRemovePileUp(Int_t removePileUp) |
2131 | {// Set Cut | |
2132 | switch(removePileUp){ | |
2133 | case 0: | |
2134 | fRemovePileUp=kFALSE; | |
2135 | break; | |
2136 | case 1: | |
2137 | fRemovePileUp=kTRUE; | |
2138 | break; | |
2139 | default: | |
2140 | AliError("RemovePileUpCut not defined"); | |
2141 | return kFALSE; | |
4a0aab28 | 2142 | } |
e5b6e8a6 | 2143 | return kTRUE; |
3b77b2d1 | 2144 | } |
3b77b2d1 | 2145 | ///________________________________________________________________________ |
e5b6e8a6 | 2146 | Bool_t AliConversionCuts::SetRejectExtraSignalsCut(Int_t extraSignal) { |
2147 | ||
2148 | switch(extraSignal){ | |
4a0aab28 | 2149 | case 0: |
e5b6e8a6 | 2150 | fRejectExtraSignals = 0; |
2151 | break; // No Rejection | |
4a0aab28 | 2152 | case 1: |
e5b6e8a6 | 2153 | fRejectExtraSignals = 1; |
2154 | break; // MinBias Header | |
4a0aab28 | 2155 | case 2: |
e5b6e8a6 | 2156 | fRejectExtraSignals = 2; |
2157 | break; // User String Array | |
4a0aab28 | 2158 | case 3: |
e5b6e8a6 | 2159 | fRejectExtraSignals = 3; |
2160 | break; // Rejection for Gamma Correction only | |
2161 | default: | |
2162 | AliError(Form("Extra Signal Rejection not defined %d",extraSignal)); | |
2163 | return kFALSE; | |
2164 | } | |
2165 | return kTRUE; | |
2166 | } | |
2167 | ///________________________________________________________________________ | |
2168 | Bool_t AliConversionCuts::SetV0Finder(Int_t v0FinderType) | |
2169 | { // Set Cut | |
2170 | switch (v0FinderType){ | |
2171 | case 0: // on fly V0 finder | |
ccfa8c0d | 2172 | cout << "have chosen onfly V0" << endl; |
e5b6e8a6 | 2173 | fUseOnFlyV0Finder=kTRUE; |
4a0aab28 | 2174 | break; |
e5b6e8a6 | 2175 | case 1: // offline V0 finder |
ccfa8c0d | 2176 | cout << "have chosen offline V0" << endl; |
e5b6e8a6 | 2177 | fUseOnFlyV0Finder=kFALSE; |
4a0aab28 | 2178 | break; |
4a0aab28 | 2179 | default: |
e5b6e8a6 | 2180 | AliError(Form(" v0FinderType not defined %d",v0FinderType)); |
4a0aab28 | 2181 | return kFALSE; |
2182 | } | |
2183 | return kTRUE; | |
3b77b2d1 | 2184 | } |
3b77b2d1 | 2185 | ///________________________________________________________________________ |
e5b6e8a6 | 2186 | Bool_t AliConversionCuts::SetEtaCut(Int_t etaCut) |
3b77b2d1 | 2187 | { // Set Cut |
e5b6e8a6 | 2188 | |
2189 | //Set Standard LineCutZValues | |
2190 | fLineCutZValueMin = -2; | |
2191 | fLineCutZValue = 7.; | |
2192 | ||
2193 | switch(etaCut){ | |
2194 | case 0: // 0.9 | |
fcc79cf5 | 2195 | fEtaCut = 0.9; |
e5b6e8a6 | 2196 | fLineCutZRSlope = tan(2*atan(exp(-fEtaCut))); |
fcc79cf5 | 2197 | fEtaCutMin = -0.1; |
e5b6e8a6 | 2198 | fLineCutZRSlopeMin = 0.; |
4a0aab28 | 2199 | break; |
fcc79cf5 | 2200 | case 1: // 1.2 // changed from 1.2 to 0.6 on 2013.06.10 |
2201 | fEtaCut = 0.6; | |
e5b6e8a6 | 2202 | fLineCutZRSlope = tan(2*atan(exp(-fEtaCut))); |
fcc79cf5 | 2203 | fEtaCutMin = -0.1; |
e5b6e8a6 | 2204 | fLineCutZRSlopeMin = 0.; |
4a0aab28 | 2205 | break; |
fcc79cf5 | 2206 | case 2: // 1.4 |
2207 | fEtaCut = 1.4; | |
e5b6e8a6 | 2208 | fLineCutZRSlope = tan(2*atan(exp(-fEtaCut))); |
fcc79cf5 | 2209 | fEtaCutMin = -0.1; |
e5b6e8a6 | 2210 | fLineCutZRSlopeMin = 0.; |
4a0aab28 | 2211 | break; |
e5b6e8a6 | 2212 | case 3: // 0.8 |
fcc79cf5 | 2213 | fEtaCut = 0.8; |
e5b6e8a6 | 2214 | fLineCutZRSlope = tan(2*atan(exp(-fEtaCut))); |
fcc79cf5 | 2215 | fEtaCutMin = -0.1; |
e5b6e8a6 | 2216 | fLineCutZRSlopeMin = 0.; |
4a0aab28 | 2217 | break; |
a280ac15 | 2218 | case 4: // 0.75 |
fcc79cf5 | 2219 | fEtaCut = 0.75; |
e5b6e8a6 | 2220 | fLineCutZRSlope = tan(2*atan(exp(-fEtaCut))); |
fcc79cf5 | 2221 | fEtaCutMin = -0.1; |
e5b6e8a6 | 2222 | fLineCutZRSlopeMin = 0.; |
4a0aab28 | 2223 | break; |
11c1e680 | 2224 | case 5: // 0.5 |
fcc79cf5 | 2225 | fEtaCut = 0.5; |
e5b6e8a6 | 2226 | fLineCutZRSlope = tan(2*atan(exp(-fEtaCut))); |
fcc79cf5 | 2227 | fEtaCutMin = -0.1; |
11c1e680 | 2228 | fLineCutZRSlopeMin = 0.; |
4a0aab28 | 2229 | break; |
e5b6e8a6 | 2230 | case 6: // 5. |
fcc79cf5 | 2231 | fEtaCut = 5.; |
e5b6e8a6 | 2232 | fLineCutZRSlope = tan(2*atan(exp(-fEtaCut))); |
fcc79cf5 | 2233 | fEtaCutMin = -0.1; |
e5b6e8a6 | 2234 | fLineCutZRSlopeMin = 0.; |
4a0aab28 | 2235 | break; |
ccfa8c0d | 2236 | case 7: |
fcc79cf5 | 2237 | fEtaCut = 0.3; |
e5b6e8a6 | 2238 | fLineCutZRSlope = tan(2*atan(exp(-fEtaCut))); |
fcc79cf5 | 2239 | fEtaCutMin = -0.1; |
11c1e680 | 2240 | fLineCutZRSlopeMin = 0.; |
e5b6e8a6 | 2241 | break; |
11c1e680 | 2242 | // case 8: // 0.1 - 0.8 |
fcc79cf5 | 2243 | // fEtaCut = 0.9; |
11c1e680 | 2244 | // fLineCutZRSlope = tan(2*atan(exp(-fEtaCut))); |
fcc79cf5 | 2245 | // fEtaCutMin = 0.1; |
11c1e680 | 2246 | // fLineCutZRSlopeMin = tan(2*atan(exp(-fEtaCutMin))); |
2247 | // break; | |
2248 | case 8: // 0.4 | |
fcc79cf5 | 2249 | fEtaCut = 0.4; |
e5b6e8a6 | 2250 | fLineCutZRSlope = tan(2*atan(exp(-fEtaCut))); |
fcc79cf5 | 2251 | fEtaCutMin = -0.1; |
11c1e680 | 2252 | fLineCutZRSlopeMin = 0.; |
e5b6e8a6 | 2253 | break; |
2254 | case 9: // 10 | |
fcc79cf5 | 2255 | fEtaCut = 10; |
e5b6e8a6 | 2256 | fLineCutZRSlope = tan(2*atan(exp(-fEtaCut))); |
fcc79cf5 | 2257 | fEtaCutMin = -0.1; |
e5b6e8a6 | 2258 | fLineCutZRSlopeMin = 0.; |
4a0aab28 | 2259 | break; |
2260 | default: | |
e5b6e8a6 | 2261 | AliError(Form(" EtaCut not defined %d",etaCut)); |
4a0aab28 | 2262 | return kFALSE; |
4a0aab28 | 2263 | } |
2264 | return kTRUE; | |
3b77b2d1 | 2265 | } |
3b77b2d1 | 2266 | ///________________________________________________________________________ |
e5b6e8a6 | 2267 | Bool_t AliConversionCuts::SetRCut(Int_t RCut){ |
2268 | // Set Cut | |
2269 | switch(RCut){ | |
2270 | case 0: | |
2271 | fMinR=0; | |
2272 | fMaxR = 180.; | |
4a0aab28 | 2273 | break; |
e5b6e8a6 | 2274 | case 1: |
2275 | fMinR=2.8; | |
2276 | fMaxR = 180.; | |
4a0aab28 | 2277 | break; |
e5b6e8a6 | 2278 | case 2: |
2279 | fMinR=5.; | |
2280 | fMaxR = 180.; | |
4a0aab28 | 2281 | break; |
e5b6e8a6 | 2282 | case 3: |
2283 | fMaxR = 70.; | |
2284 | fMinR = 10.; | |
4a0aab28 | 2285 | break; |
e5b6e8a6 | 2286 | case 4: |
2287 | fMaxR = 70.; | |
2288 | fMinR = 5.; | |
4a0aab28 | 2289 | break; |
e5b6e8a6 | 2290 | // High purity cuts for PbPb (remove first layers of material) |
2291 | case 5: | |
2292 | fMaxR = 180.; | |
2293 | fMinR = 10.; | |
4a0aab28 | 2294 | break; |
e5b6e8a6 | 2295 | case 6: |
2296 | fMaxR = 180.; | |
2297 | fMinR = 20.; | |
4a0aab28 | 2298 | break; |
e5b6e8a6 | 2299 | case 7: |
2300 | fMaxR = 180.; | |
2301 | fMinR = 26.; | |
4a0aab28 | 2302 | break; |
e5b6e8a6 | 2303 | case 8: |
2304 | fMaxR = 180.; | |
2305 | fMinR = 35.; | |
4a0aab28 | 2306 | break; |
2307 | case 9: | |
e5b6e8a6 | 2308 | fMaxR = 35.; |
2309 | fMinR = 5.; | |
4a0aab28 | 2310 | break; |
e5b6e8a6 | 2311 | |
4a0aab28 | 2312 | default: |
e5b6e8a6 | 2313 | AliError("RCut not defined"); |
4a0aab28 | 2314 | return kFALSE; |
2315 | } | |
2316 | return kTRUE; | |
92efd725 | 2317 | } |
92efd725 | 2318 | ///________________________________________________________________________ |
e5b6e8a6 | 2319 | Bool_t AliConversionCuts::SetSinglePtCut(Int_t singlePtCut) |
92efd725 | 2320 | { // Set Cut |
e5b6e8a6 | 2321 | switch(singlePtCut){ |
2322 | case 0: // 0.050 GeV | |
2323 | fSinglePtCut = 0.050; | |
4a0aab28 | 2324 | break; |
e5b6e8a6 | 2325 | case 1: // 0.100 GeV |
2326 | fSinglePtCut = 0.100; | |
4a0aab28 | 2327 | break; |
e5b6e8a6 | 2328 | case 2: // 0.150 GeV |
2329 | fSinglePtCut = 0.150; | |
4a0aab28 | 2330 | break; |
e5b6e8a6 | 2331 | case 3: // 0.200 GeV |
2332 | fSinglePtCut = 0.200; | |
4a0aab28 | 2333 | break; |
e5b6e8a6 | 2334 | case 4: // 0.075 GeV |
2335 | fSinglePtCut = 0.075; | |
4a0aab28 | 2336 | break; |
e5b6e8a6 | 2337 | case 5: // 0.125 GeV |
2338 | fSinglePtCut = 0.125; | |
4a0aab28 | 2339 | break; |
e5b6e8a6 | 2340 | case 6: // 0.04 GeV |
2341 | fSinglePtCut = 0.040; | |
4a0aab28 | 2342 | break; |
e5b6e8a6 | 2343 | case 7: // 0.0 GeV |
2344 | fSinglePtCut = 0.0; | |
4a0aab28 | 2345 | break; |
2346 | default: | |
e5b6e8a6 | 2347 | AliError(Form("singlePtCut not defined %d",singlePtCut)); |
4a0aab28 | 2348 | return kFALSE; |
2349 | } | |
2350 | return kTRUE; | |
3b77b2d1 | 2351 | } |
3b77b2d1 | 2352 | ///________________________________________________________________________ |
e5b6e8a6 | 2353 | Bool_t AliConversionCuts::SetTPCClusterCut(Int_t clsTPCCut) |
3b77b2d1 | 2354 | { // Set Cut |
e5b6e8a6 | 2355 | switch(clsTPCCut){ |
2356 | case 0: // 0 | |
2357 | fMinClsTPC= 0.; | |
4a0aab28 | 2358 | break; |
ccfa8c0d | 2359 | case 1: // 60 |
2360 | fMinClsTPC= 60.; | |
4a0aab28 | 2361 | break; |
e5b6e8a6 | 2362 | case 2: // 80 |
2363 | fMinClsTPC= 80.; | |
4a0aab28 | 2364 | break; |
e5b6e8a6 | 2365 | case 3: // 100 |
2366 | fMinClsTPC= 100.; | |
4a0aab28 | 2367 | break; |
ccfa8c0d | 2368 | case 4: // 95% of findable clusters |
2369 | fMinClsTPCToF= 0.95; | |
2370 | fUseCorrectedTPCClsInfo=1; | |
4a0aab28 | 2371 | break; |
e5b6e8a6 | 2372 | case 5: // 0% of findable clusters |
2373 | fMinClsTPCToF= 0.0; | |
2374 | fUseCorrectedTPCClsInfo=1; | |
4a0aab28 | 2375 | break; |
e5b6e8a6 | 2376 | case 6: // 70% of findable clusters |
2377 | fMinClsTPCToF= 0.7; | |
2378 | fUseCorrectedTPCClsInfo=1; | |
4a0aab28 | 2379 | break; |
e5b6e8a6 | 2380 | case 7: // 0% of findable clusters |
2381 | fMinClsTPCToF= 0.35; | |
2382 | fUseCorrectedTPCClsInfo=0; | |
4a0aab28 | 2383 | break; |
2384 | case 8: | |
e5b6e8a6 | 2385 | fMinClsTPCToF= 0.35; |
2386 | fUseCorrectedTPCClsInfo=1; | |
4a0aab28 | 2387 | break; |
2388 | case 9: | |
e5b6e8a6 | 2389 | fMinClsTPCToF= 0.6; |
2390 | fUseCorrectedTPCClsInfo=1; | |
4a0aab28 | 2391 | break; |
2392 | default: | |
e5b6e8a6 | 2393 | AliError(Form("Warning: clsTPCCut not defined %d",clsTPCCut)); |
4a0aab28 | 2394 | return kFALSE; |
2395 | } | |
2396 | return kTRUE; | |
3b77b2d1 | 2397 | } |
3b77b2d1 | 2398 | ///________________________________________________________________________ |
e5b6e8a6 | 2399 | Bool_t AliConversionCuts::SetTPCdEdxCutElectronLine(Int_t ededxSigmaCut) |
3b77b2d1 | 2400 | { // Set Cut |
e5b6e8a6 | 2401 | switch(ededxSigmaCut){ |
2402 | case 0: // -10,10 | |
2403 | fPIDnSigmaBelowElectronLine=-10; | |
2404 | fPIDnSigmaAboveElectronLine=10; | |
4a0aab28 | 2405 | break; |
e5b6e8a6 | 2406 | case 1: // -5,5 |
2407 | fPIDnSigmaBelowElectronLine=-5; | |
2408 | fPIDnSigmaAboveElectronLine=5; | |
4a0aab28 | 2409 | break; |
e5b6e8a6 | 2410 | case 2: // -3,5 |
2411 | fPIDnSigmaBelowElectronLine=-3; | |
2412 | fPIDnSigmaAboveElectronLine=5; | |
4a0aab28 | 2413 | break; |
e5b6e8a6 | 2414 | case 3: // -4,5 |
2415 | fPIDnSigmaBelowElectronLine=-4; | |
2416 | fPIDnSigmaAboveElectronLine=5; | |
4a0aab28 | 2417 | break; |
e5b6e8a6 | 2418 | case 4: // -6,7 |
2419 | fPIDnSigmaBelowElectronLine=-6; | |
2420 | fPIDnSigmaAboveElectronLine=7; | |
4a0aab28 | 2421 | break; |
e5b6e8a6 | 2422 | case 5: // -4,4 |
2423 | fPIDnSigmaBelowElectronLine=-4; | |
2424 | fPIDnSigmaAboveElectronLine=4; | |
4a0aab28 | 2425 | break; |
e5b6e8a6 | 2426 | case 6: // -2.5,4 |
2427 | fPIDnSigmaBelowElectronLine=-2.5; | |
2428 | fPIDnSigmaAboveElectronLine=4; | |
4a0aab28 | 2429 | break; |
e5b6e8a6 | 2430 | case 7: // -2,3.5 |
2431 | fPIDnSigmaBelowElectronLine=-2; | |
2432 | fPIDnSigmaAboveElectronLine=3.5; | |
4a0aab28 | 2433 | break; |
2434 | default: | |
e5b6e8a6 | 2435 | AliError("TPCdEdxCutElectronLine not defined"); |
4a0aab28 | 2436 | return kFALSE; |
e5b6e8a6 | 2437 | |
4a0aab28 | 2438 | } |
2439 | return kTRUE; | |
3b77b2d1 | 2440 | } |
2441 | ///________________________________________________________________________ | |
e5b6e8a6 | 2442 | Bool_t AliConversionCuts::SetTPCdEdxCutPionLine(Int_t pidedxSigmaCut) |
3b77b2d1 | 2443 | { // Set Cut |
e5b6e8a6 | 2444 | |
2445 | switch(pidedxSigmaCut){ | |
2446 | case 0: // -10 | |
2447 | fPIDnSigmaAbovePionLine=-10; | |
2448 | fPIDnSigmaAbovePionLineHighPt=-10; | |
4a0aab28 | 2449 | break; |
e5b6e8a6 | 2450 | case 1: // 0 |
2451 | fPIDnSigmaAbovePionLine=0; | |
2452 | fPIDnSigmaAbovePionLineHighPt=-10; | |
4a0aab28 | 2453 | break; |
e5b6e8a6 | 2454 | case 2: // 1 |
2455 | fPIDnSigmaAbovePionLine=1; | |
2456 | fPIDnSigmaAbovePionLineHighPt=-10; | |
4a0aab28 | 2457 | break; |
e5b6e8a6 | 2458 | case 3: // 1 |
2459 | fPIDnSigmaAbovePionLine=2.5; | |
2460 | fPIDnSigmaAbovePionLineHighPt=-10; | |
4a0aab28 | 2461 | break; |
e5b6e8a6 | 2462 | case 4: // 1 |
2463 | fPIDnSigmaAbovePionLine=0.5; | |
2464 | fPIDnSigmaAbovePionLineHighPt=-10; | |
4a0aab28 | 2465 | break; |
e5b6e8a6 | 2466 | case 5: // 1 |
2467 | fPIDnSigmaAbovePionLine=2.; | |
2468 | fPIDnSigmaAbovePionLineHighPt=-10; | |
4a0aab28 | 2469 | break; |
e5b6e8a6 | 2470 | case 6: // 1 |
2471 | fPIDnSigmaAbovePionLine=2.; | |
2472 | fPIDnSigmaAbovePionLineHighPt=0.5; | |
4a0aab28 | 2473 | break; |
e5b6e8a6 | 2474 | case 7: // 1 |
2475 | fPIDnSigmaAbovePionLine=3.5; | |
2476 | fPIDnSigmaAbovePionLineHighPt=-10; | |
4a0aab28 | 2477 | break; |
e5b6e8a6 | 2478 | case 8: // 1 |
2479 | fPIDnSigmaAbovePionLine=2.; | |
2480 | fPIDnSigmaAbovePionLineHighPt=1.; | |
4a0aab28 | 2481 | break; |
2482 | case 9: | |
e5b6e8a6 | 2483 | fPIDnSigmaAbovePionLine=3.0; // We need a bit less tight cut on dE/dx |
2484 | fPIDnSigmaAbovePionLineHighPt=-10; | |
4a0aab28 | 2485 | break; |
2486 | default: | |
e5b6e8a6 | 2487 | AliError(Form("Warning: pidedxSigmaCut not defined %d",pidedxSigmaCut)); |
4a0aab28 | 2488 | return kFALSE; |
2489 | } | |
2490 | return kTRUE; | |
3b77b2d1 | 2491 | } |
3b77b2d1 | 2492 | ///________________________________________________________________________ |
e5b6e8a6 | 2493 | Bool_t AliConversionCuts::SetMinMomPiondEdxCut(Int_t piMomdedxSigmaCut) |
3b77b2d1 | 2494 | { // Set Cut |
e5b6e8a6 | 2495 | switch(piMomdedxSigmaCut){ |
2496 | case 0: // 0.5 GeV | |
2497 | fPIDMinPnSigmaAbovePionLine=0.5; | |
4a0aab28 | 2498 | break; |
e5b6e8a6 | 2499 | case 1: // 1. GeV |
2500 | fPIDMinPnSigmaAbovePionLine=1.; | |
4a0aab28 | 2501 | break; |
e5b6e8a6 | 2502 | case 2: // 1.5 GeV |
2503 | fPIDMinPnSigmaAbovePionLine=1.5; | |
4a0aab28 | 2504 | break; |
e5b6e8a6 | 2505 | case 3: // 20.0 GeV |
2506 | fPIDMinPnSigmaAbovePionLine=20.; | |
4a0aab28 | 2507 | break; |
e5b6e8a6 | 2508 | case 4: // 50.0 GeV |
2509 | fPIDMinPnSigmaAbovePionLine=50.; | |
4a0aab28 | 2510 | break; |
e5b6e8a6 | 2511 | case 5: // 0.3 GeV |
2512 | fPIDMinPnSigmaAbovePionLine=0.3; | |
4a0aab28 | 2513 | break; |
e5b6e8a6 | 2514 | case 6: // 0.25 GeV |
2515 | fPIDMinPnSigmaAbovePionLine=0.25; | |
4a0aab28 | 2516 | break; |
e5b6e8a6 | 2517 | case 7: // 0.4 GeV |
2518 | fPIDMinPnSigmaAbovePionLine=0.4; | |
4a0aab28 | 2519 | break; |
e5b6e8a6 | 2520 | case 8: // 0.2 GeV |
2521 | fPIDMinPnSigmaAbovePionLine=0.2; | |
4a0aab28 | 2522 | break; |
2523 | default: | |
e5b6e8a6 | 2524 | AliError(Form("piMomdedxSigmaCut not defined %d",piMomdedxSigmaCut)); |
4a0aab28 | 2525 | return kFALSE; |
2526 | } | |
2527 | return kTRUE; | |
3b77b2d1 | 2528 | } |
3b77b2d1 | 2529 | ///________________________________________________________________________ |
2530 | Bool_t AliConversionCuts::SetMaxMomPiondEdxCut(Int_t piMaxMomdedxSigmaCut) | |
2531 | { // Set Cut | |
4a0aab28 | 2532 | switch(piMaxMomdedxSigmaCut){ |
2533 | case 0: // 100. GeV | |
2534 | fPIDMaxPnSigmaAbovePionLine=100.; | |
2535 | break; | |
2536 | case 1: // 5. GeV | |
2537 | fPIDMaxPnSigmaAbovePionLine=5.; | |
2538 | break; | |
2539 | case 2: // 4. GeV | |
2540 | fPIDMaxPnSigmaAbovePionLine=4.; | |
2541 | break; | |
2542 | case 3: // 3.5 GeV | |
2543 | fPIDMaxPnSigmaAbovePionLine=3.5; | |
2544 | break; | |
2545 | case 4: // 3. GeV | |
2546 | fPIDMaxPnSigmaAbovePionLine=3.; | |
2547 | break; | |
e5b6e8a6 | 2548 | case 5: // 7. GeV |
2549 | fPIDMaxPnSigmaAbovePionLine=7.; | |
4a0aab28 | 2550 | break; |
2551 | default: | |
e5b6e8a6 | 2552 | AliError(Form("piMaxMomdedxSigmaCut not defined %d",piMaxMomdedxSigmaCut)); |
4a0aab28 | 2553 | return kFALSE; |
92efd725 | 2554 | } |
2555 | return kTRUE; | |
3b77b2d1 | 2556 | } |
3b77b2d1 | 2557 | ///________________________________________________________________________ |
2558 | Bool_t AliConversionCuts::SetLowPRejectionCuts(Int_t LowPRejectionSigmaCut) | |
2559 | { // Set Cut | |
4a0aab28 | 2560 | switch(LowPRejectionSigmaCut){ |
2561 | case 0: // | |
2562 | fPIDnSigmaAtLowPAroundKaonLine=0; | |
2563 | fPIDnSigmaAtLowPAroundProtonLine=0; | |
2564 | fPIDnSigmaAtLowPAroundPionLine=0; | |
e5b6e8a6 | 2565 | fDoKaonRejectionLowP = kFALSE; |
2566 | fDoProtonRejectionLowP = kFALSE; | |
2567 | fDoPionRejectionLowP = kFALSE; | |
2568 | fPIDMinPPionRejectionLowP = fPIDMinPnSigmaAbovePionLine; | |
4a0aab28 | 2569 | break; |
2570 | case 1: // | |
2571 | fPIDnSigmaAtLowPAroundKaonLine=0.5; | |
2572 | fPIDnSigmaAtLowPAroundProtonLine=0.5; | |
2573 | fPIDnSigmaAtLowPAroundPionLine=0.5; | |
e5b6e8a6 | 2574 | fDoKaonRejectionLowP = kTRUE; |
2575 | fDoProtonRejectionLowP = kTRUE; | |
2576 | fDoPionRejectionLowP = kTRUE; | |
2577 | fPIDMinPPionRejectionLowP = fPIDMinPnSigmaAbovePionLine; | |
4a0aab28 | 2578 | break; |
2579 | case 2: // | |
2580 | fPIDnSigmaAtLowPAroundKaonLine=1; | |
2581 | fPIDnSigmaAtLowPAroundProtonLine=1; | |
2582 | fPIDnSigmaAtLowPAroundPionLine=1; | |
e5b6e8a6 | 2583 | fDoKaonRejectionLowP = kTRUE; |
2584 | fDoProtonRejectionLowP = kTRUE; | |
2585 | fDoPionRejectionLowP = kTRUE; | |
2586 | fPIDMinPPionRejectionLowP = fPIDMinPnSigmaAbovePionLine; | |
4a0aab28 | 2587 | break; |
2588 | case 3: // | |
2589 | fPIDnSigmaAtLowPAroundKaonLine=2.; | |
2590 | fPIDnSigmaAtLowPAroundProtonLine=2.; | |
2591 | fPIDnSigmaAtLowPAroundPionLine=2.; | |
e5b6e8a6 | 2592 | fDoKaonRejectionLowP = kTRUE; |
2593 | fDoProtonRejectionLowP = kTRUE; | |
2594 | fDoPionRejectionLowP = kTRUE; | |
2595 | fPIDMinPPionRejectionLowP = fPIDMinPnSigmaAbovePionLine; | |
4a0aab28 | 2596 | break; |
2597 | case 4: // | |
2598 | fPIDnSigmaAtLowPAroundKaonLine=0.; | |
2599 | fPIDnSigmaAtLowPAroundProtonLine=0.; | |
2600 | fPIDnSigmaAtLowPAroundPionLine=1; | |
e5b6e8a6 | 2601 | fDoKaonRejectionLowP = kFALSE; |
2602 | fDoProtonRejectionLowP = kFALSE; | |
2603 | fDoPionRejectionLowP = kTRUE; | |
2604 | fPIDMinPPionRejectionLowP = fPIDMinPnSigmaAbovePionLine; | |
4a0aab28 | 2605 | break; |
2606 | case 5: // | |
2607 | fPIDnSigmaAtLowPAroundKaonLine=0.; | |
2608 | fPIDnSigmaAtLowPAroundProtonLine=0.; | |
2609 | fPIDnSigmaAtLowPAroundPionLine=1.5; | |
e5b6e8a6 | 2610 | fDoKaonRejectionLowP = kFALSE; |
2611 | fDoProtonRejectionLowP = kFALSE; | |
2612 | fDoPionRejectionLowP = kTRUE; | |
2613 | fPIDMinPPionRejectionLowP = fPIDMinPnSigmaAbovePionLine; | |
4a0aab28 | 2614 | break; |
2615 | case 6: // | |
2616 | fPIDnSigmaAtLowPAroundKaonLine=0.; | |
2617 | fPIDnSigmaAtLowPAroundProtonLine=0.; | |
2618 | fPIDnSigmaAtLowPAroundPionLine=2.; | |
e5b6e8a6 | 2619 | fDoKaonRejectionLowP = kFALSE; |
2620 | fDoProtonRejectionLowP = kFALSE; | |
2621 | fDoPionRejectionLowP = kTRUE; | |
2622 | fPIDMinPPionRejectionLowP = fPIDMinPnSigmaAbovePionLine; | |
2623 | break; | |
2624 | case 7: // | |
2625 | fPIDnSigmaAtLowPAroundKaonLine=0.; | |
2626 | fPIDnSigmaAtLowPAroundProtonLine=0.; | |
2627 | fPIDnSigmaAtLowPAroundPionLine=0.5; | |
2628 | fDoKaonRejectionLowP = kFALSE; | |
2629 | fDoProtonRejectionLowP = kFALSE; | |
2630 | fDoPionRejectionLowP = kTRUE; | |
2631 | fPIDMinPPionRejectionLowP = fPIDMinPnSigmaAbovePionLine; | |
4a0aab28 | 2632 | break; |
2633 | default: | |
2634 | AliError(Form("LowPRejectionSigmaCut not defined %d",LowPRejectionSigmaCut)); | |
2635 | return kFALSE; | |
2636 | } | |
2637 | return kTRUE; | |
3b77b2d1 | 2638 | } |
3b77b2d1 | 2639 | ///________________________________________________________________________ |
2640 | Bool_t AliConversionCuts::SetTOFElectronPIDCut(Int_t TOFelectronPID){ | |
4a0aab28 | 2641 | // Set Cut |
e5b6e8a6 | 2642 | switch(TOFelectronPID){ |
4a0aab28 | 2643 | case 0: // no cut |
2644 | fUseTOFpid = kFALSE; | |
2645 | fTofPIDnSigmaBelowElectronLine=-100; | |
2646 | fTofPIDnSigmaAboveElectronLine=100; | |
2647 | break; | |
2648 | case 1: // -7,7 | |
2649 | fUseTOFpid = kTRUE; | |
2650 | fTofPIDnSigmaBelowElectronLine=-7; | |
2651 | fTofPIDnSigmaAboveElectronLine=7; | |
2652 | break; | |
2653 | case 2: // -5,5 | |
2654 | fUseTOFpid = kTRUE; | |
2655 | fTofPIDnSigmaBelowElectronLine=-5; | |
2656 | fTofPIDnSigmaAboveElectronLine=5; | |
2657 | break; | |
2658 | case 3: // -3,5 | |
2659 | fUseTOFpid = kTRUE; | |
2660 | fTofPIDnSigmaBelowElectronLine=-3; | |
2661 | fTofPIDnSigmaAboveElectronLine=5; | |
2662 | break; | |
2663 | case 4: // -2,3 | |
2664 | fUseTOFpid = kTRUE; | |
2665 | fTofPIDnSigmaBelowElectronLine=-2; | |
2666 | fTofPIDnSigmaAboveElectronLine=3; | |
2667 | break; | |
e5b6e8a6 | 2668 | case 5: // -3,3 |
2669 | fUseTOFpid = kTRUE; | |
2670 | fTofPIDnSigmaBelowElectronLine=-3; | |
2671 | fTofPIDnSigmaAboveElectronLine=3; | |
4a0aab28 | 2672 | break; |
2673 | default: | |
e5b6e8a6 | 2674 | AliError(Form("TOFElectronCut not defined %d",TOFelectronPID)); |
4a0aab28 | 2675 | return kFALSE; |
2676 | } | |
4a0aab28 | 2677 | return kTRUE; |
3b77b2d1 | 2678 | } |
2679 | ///________________________________________________________________________ | |
2680 | Bool_t AliConversionCuts::SetQtMaxCut(Int_t QtMaxCut) | |
2681 | { // Set Cut | |
4a0aab28 | 2682 | switch(QtMaxCut){ |
2683 | case 0: // | |
2684 | fQtMax=1.; | |
e5b6e8a6 | 2685 | fDoQtGammaSelection=kFALSE; |
2686 | fDoHighPtQtGammaSelection=kFALSE; | |
2687 | fHighPtQtMax=100.; | |
2688 | fPtBorderForQt=100.; | |
4a0aab28 | 2689 | break; |
2690 | case 1: | |
2691 | fQtMax=0.1; | |
e5b6e8a6 | 2692 | fDoHighPtQtGammaSelection=kFALSE; |
2693 | fHighPtQtMax=100.; | |
2694 | fPtBorderForQt=100.; | |
4a0aab28 | 2695 | break; |
2696 | case 2: | |
2697 | fQtMax=0.07; | |
e5b6e8a6 | 2698 | fDoHighPtQtGammaSelection=kFALSE; |
2699 | fHighPtQtMax=100.; | |
2700 | fPtBorderForQt=100.; | |
4a0aab28 | 2701 | break; |
2702 | case 3: | |
2703 | fQtMax=0.05; | |
e5b6e8a6 | 2704 | fDoHighPtQtGammaSelection=kFALSE; |
2705 | fHighPtQtMax=100.; | |
2706 | fPtBorderForQt=100.; | |
4a0aab28 | 2707 | break; |
2708 | case 4: | |
2709 | fQtMax=0.03; | |
e5b6e8a6 | 2710 | fDoHighPtQtGammaSelection=kFALSE; |
2711 | fHighPtQtMax=100.; | |
2712 | fPtBorderForQt=100.; | |
4a0aab28 | 2713 | break; |
e5b6e8a6 | 2714 | case 5: |
4a0aab28 | 2715 | fQtMax=0.02; |
e5b6e8a6 | 2716 | fDoHighPtQtGammaSelection=kFALSE; |
2717 | fHighPtQtMax=100.; | |
2718 | fPtBorderForQt=100.; | |
2719 | break; | |
2720 | case 6: | |
4a0aab28 | 2721 | fQtMax=0.02; |
2722 | fDoHighPtQtGammaSelection=kTRUE; | |
2723 | fHighPtQtMax=0.06; | |
2724 | fPtBorderForQt=2.5; | |
e5b6e8a6 | 2725 | break; |
4a0aab28 | 2726 | case 7: |
2727 | fQtMax=0.15; | |
e5b6e8a6 | 2728 | fDoHighPtQtGammaSelection=kFALSE; |
2729 | fHighPtQtMax=100.; | |
2730 | fPtBorderForQt=100.; | |
4a0aab28 | 2731 | break; |
2732 | default: | |
2733 | AliError(Form("Warning: QtMaxCut not defined %d",QtMaxCut)); | |
2734 | return kFALSE; | |
2735 | } | |
2736 | return kTRUE; | |
3b77b2d1 | 2737 | } |
3b77b2d1 | 2738 | ///________________________________________________________________________ |
e5b6e8a6 | 2739 | Bool_t AliConversionCuts::SetChi2GammaCut(Int_t chi2GammaCut) |
2740 | { // Set Cut | |
2741 | ||
2742 | switch(chi2GammaCut){ | |
2743 | case 0: // 100 | |
2744 | fChi2CutConversion = 100.; | |
4a0aab28 | 2745 | break; |
e5b6e8a6 | 2746 | case 1: // 50 |
2747 | fChi2CutConversion = 50.; | |
4a0aab28 | 2748 | break; |
e5b6e8a6 | 2749 | case 2: // 30 |
2750 | fChi2CutConversion = 30.; | |
2751 | break; | |
2752 | case 3: | |
2753 | fChi2CutConversion = 200.; | |
2754 | break; | |
2755 | case 4: | |
2756 | fChi2CutConversion = 500.; | |
2757 | break; | |
2758 | case 5: | |
2759 | fChi2CutConversion = 100000.; | |
2760 | break; | |
2761 | case 6: | |
2762 | fChi2CutConversion = 5.; | |
2763 | break; | |
2764 | case 7: | |
2765 | fChi2CutConversion = 10.; | |
2766 | break; | |
2767 | case 8: | |
2768 | fChi2CutConversion = 20.; | |
2769 | break; | |
2770 | case 9: | |
2771 | fChi2CutConversion = 15.; | |
4a0aab28 | 2772 | break; |
2773 | default: | |
e5b6e8a6 | 2774 | AliError(Form("Warning: Chi2GammaCut not defined %d",chi2GammaCut)); |
4a0aab28 | 2775 | return kFALSE; |
2776 | } | |
4a0aab28 | 2777 | return kTRUE; |
3b77b2d1 | 2778 | } |
3b77b2d1 | 2779 | ///________________________________________________________________________ |
2780 | Bool_t AliConversionCuts::SetPsiPairCut(Int_t psiCut) { | |
3b77b2d1 | 2781 | |
4a0aab28 | 2782 | switch(psiCut) { |
2783 | case 0: | |
e5b6e8a6 | 2784 | fPsiPairCut = 10000; // |
4a0aab28 | 2785 | break; |
2786 | case 1: | |
e5b6e8a6 | 2787 | fPsiPairCut = 0.1; // |
4a0aab28 | 2788 | break; |
2789 | case 2: | |
2790 | fPsiPairCut = 0.05; // Standard | |
2791 | break; | |
2792 | case 3: | |
e5b6e8a6 | 2793 | fPsiPairCut = 0.035; // |
4a0aab28 | 2794 | break; |
2795 | case 4: | |
e5b6e8a6 | 2796 | fPsiPairCut = 0.15; // |
4a0aab28 | 2797 | break; |
2798 | case 5: | |
e5b6e8a6 | 2799 | fPsiPairCut = 0.2; // |
4a0aab28 | 2800 | break; |
2801 | case 6: | |
e5b6e8a6 | 2802 | fPsiPairCut = 0.03; // |
4a0aab28 | 2803 | break; |
2804 | case 7: | |
e5b6e8a6 | 2805 | fPsiPairCut = 0.025; // |
4a0aab28 | 2806 | break; |
2807 | case 8: | |
e5b6e8a6 | 2808 | fPsiPairCut = 0.01; // |
2809 | break; | |
2810 | case 9: | |
2811 | fPsiPairCut = 0.5; // | |
4a0aab28 | 2812 | break; |
2813 | default: | |
92efd725 | 2814 | AliError(Form("PsiPairCut not defined %d",psiCut)); |
3b77b2d1 | 2815 | return kFALSE; |
4a0aab28 | 2816 | } |
3b77b2d1 | 2817 | |
4a0aab28 | 2818 | return kTRUE; |
3b77b2d1 | 2819 | } |
e5b6e8a6 | 2820 | ///________________________________________________________________________ |
2821 | Bool_t AliConversionCuts::SetPhotonAsymmetryCut(Int_t doPhotonAsymmetryCut){ | |
2822 | // Set Cut | |
2823 | switch(doPhotonAsymmetryCut){ | |
2824 | case 0: | |
2825 | fDoPhotonAsymmetryCut=0; | |
2826 | fMinPPhotonAsymmetryCut=100.; | |
2827 | fMinPhotonAsymmetry=0.; | |
2828 | break; | |
2829 | case 1: | |
2830 | fDoPhotonAsymmetryCut=1; | |
2831 | fMinPPhotonAsymmetryCut=3.5; | |
2832 | fMinPhotonAsymmetry=0.04; | |
2833 | break; | |
2834 | case 2: | |
2835 | fDoPhotonAsymmetryCut=1; | |
2836 | fMinPPhotonAsymmetryCut=3.5; | |
2837 | fMinPhotonAsymmetry=0.06; | |
2838 | break; | |
2839 | default: | |
2840 | AliError(Form("PhotonAsymmetryCut not defined %d",doPhotonAsymmetryCut)); | |
2841 | return kFALSE; | |
2842 | } | |
2843 | fCuts[kdoPhotonAsymmetryCut]=doPhotonAsymmetryCut; | |
2844 | return kTRUE; | |
2845 | } | |
3b77b2d1 | 2846 | ///________________________________________________________________________ |
2847 | Bool_t AliConversionCuts::SetCosPAngleCut(Int_t cosCut) { | |
2848 | ||
4a0aab28 | 2849 | switch(cosCut){ |
2850 | case 0: | |
e5b6e8a6 | 2851 | fCosPAngleCut = TMath::Pi(); // -1 |
4a0aab28 | 2852 | break; |
2853 | case 1: | |
e5b6e8a6 | 2854 | fCosPAngleCut = 0.1; // 0.99500 |
4a0aab28 | 2855 | break; |
2856 | case 2: | |
e5b6e8a6 | 2857 | fCosPAngleCut = 0.05; // 0.99875 |
4a0aab28 | 2858 | break; |
2859 | case 3: | |
e5b6e8a6 | 2860 | fCosPAngleCut = 0.025; // 0.99969 |
4a0aab28 | 2861 | break; |
2862 | case 4: | |
e5b6e8a6 | 2863 | fCosPAngleCut = 0.01; // 0.99995 |
2864 | break; | |
2865 | case 5: | |
2866 | fCosPAngleCut = 0.2; // 0.98007 | |
2867 | break; | |
2868 | case 6: | |
2869 | fCosPAngleCut = 0.5; // 0.87758 | |
2870 | break; | |
2871 | case 7: | |
2872 | fCosPAngleCut = 0.075; // 0.73169 | |
4a0aab28 | 2873 | break; |
2874 | default: | |
2875 | AliError(Form("Cosine Pointing Angle cut not defined %d",cosCut)); | |
2876 | return kFALSE; | |
2877 | } | |
3b77b2d1 | 2878 | |
4a0aab28 | 2879 | return kTRUE; |
3b77b2d1 | 2880 | } |
92efd725 | 2881 | ///________________________________________________________________________ |
2882 | Bool_t AliConversionCuts::SetSharedElectronCut(Int_t sharedElec) { | |
2883 | ||
2884 | switch(sharedElec){ | |
4a0aab28 | 2885 | case 0: |
2886 | fDoSharedElecCut = kFALSE; | |
2887 | break; | |
2888 | case 1: | |
2889 | fDoSharedElecCut = kTRUE; | |
2890 | break; | |
2891 | default: | |
2892 | AliError(Form("Shared Electron Cut not defined %d",sharedElec)); | |
2893 | return kFALSE; | |
2894 | } | |
e5b6e8a6 | 2895 | |
4a0aab28 | 2896 | return kTRUE; |
92efd725 | 2897 | } |
92efd725 | 2898 | ///________________________________________________________________________ |
2899 | Bool_t AliConversionCuts::SetToCloseV0sCut(Int_t toClose) { | |
2900 | ||
2901 | switch(toClose){ | |
2902 | case 0: | |
2903 | fDoToCloseV0sCut = kFALSE; | |
2904 | fminV0Dist = 250; | |
2905 | break; | |
2906 | case 1: | |
2907 | fDoToCloseV0sCut = kTRUE; | |
2908 | fminV0Dist = 1; | |
2909 | break; | |
2910 | case 2: | |
2911 | fDoToCloseV0sCut = kTRUE; | |
2912 | fminV0Dist = 2; | |
2913 | break; | |
2914 | case 3: | |
2915 | fDoToCloseV0sCut = kTRUE; | |
2916 | fminV0Dist = 3; | |
2917 | break; | |
2918 | default: | |
4a0aab28 | 2919 | AliError(Form("Shared Electron Cut not defined %d",toClose)); |
2920 | return kFALSE; | |
92efd725 | 2921 | } |
2922 | return kTRUE; | |
2923 | } | |
ca91a3e1 | 2924 | ///________________________________________________________________________ |
e5b6e8a6 | 2925 | Bool_t AliConversionCuts::SetTRDElectronCut(Int_t TRDElectronCut) |
2926 | { // Set Cut | |
2927 | switch(TRDElectronCut){ | |
ca91a3e1 | 2928 | case 0: |
e5b6e8a6 | 2929 | fDoTRDPID=kFALSE; |
2930 | break; | |
ca91a3e1 | 2931 | case 1: |
e5b6e8a6 | 2932 | fDoTRDPID=kTRUE; |
2933 | fPIDTRDEfficiency=0.1; | |
2934 | break; | |
2935 | case 8: | |
2936 | fDoTRDPID=kTRUE; | |
2937 | fPIDTRDEfficiency=0.8; | |
2938 | break; | |
2939 | case 9: | |
2940 | fDoTRDPID=kTRUE; | |
2941 | fPIDTRDEfficiency=0.9; | |
2942 | break; | |
ca91a3e1 | 2943 | default: |
e5b6e8a6 | 2944 | AliError(Form("TRDElectronCut not defined %d",TRDElectronCut)); |
ca91a3e1 | 2945 | return kFALSE; |
2946 | } | |
e5b6e8a6 | 2947 | |
ca91a3e1 | 2948 | return kTRUE; |
2949 | } | |
4803eb1f | 2950 | |
2951 | ///________________________________________________________________________ | |
aff90284 | 2952 | Bool_t AliConversionCuts::SetDCAZPhotonPrimVtxCut(Int_t DCAZPhotonPrimVtx){ |
4803eb1f | 2953 | // Set Cut |
2954 | switch(DCAZPhotonPrimVtx){ | |
2955 | case 0: // | |
aff90284 | 2956 | fDCAZPrimVtxCut = 1000; |
4803eb1f | 2957 | break; |
2958 | case 1: // | |
2959 | fDCAZPrimVtxCut = 10; | |
2960 | break; | |
2961 | case 2: // | |
2962 | fDCAZPrimVtxCut = 5; | |
2963 | break; | |
2964 | case 3: // | |
2965 | fDCAZPrimVtxCut = 4; | |
2966 | break; | |
2967 | case 4: // | |
2968 | fDCAZPrimVtxCut = 3; | |
2969 | break; | |
2970 | case 5: // | |
2971 | fDCAZPrimVtxCut = 2.5; | |
2972 | break; | |
2973 | case 6: // | |
2974 | fDCAZPrimVtxCut = 2; | |
2975 | break; | |
2976 | case 7: // | |
2977 | fDCAZPrimVtxCut = 1.5; | |
2978 | break; | |
2979 | case 8: // | |
2980 | fDCAZPrimVtxCut = 1; | |
2981 | break; | |
2982 | case 9: // | |
2983 | fDCAZPrimVtxCut = 0.5; | |
2984 | break; | |
2985 | default: | |
2986 | cout<<"Warning: DCAZPhotonPrimVtx not defined "<<DCAZPhotonPrimVtx<<endl; | |
2987 | return kFALSE; | |
2988 | } | |
2989 | return kTRUE; | |
2990 | } | |
2991 | ||
2992 | ///________________________________________________________________________ | |
aff90284 | 2993 | Bool_t AliConversionCuts::SetDCARPhotonPrimVtxCut(Int_t DCARPhotonPrimVtx){ |
4803eb1f | 2994 | // Set Cut |
2995 | switch(DCARPhotonPrimVtx){ | |
2996 | case 0: // | |
aff90284 | 2997 | fDCARPrimVtxCut = 1000; |
4803eb1f | 2998 | break; |
2999 | case 1: // | |
3000 | fDCARPrimVtxCut = 10; | |
3001 | break; | |
3002 | case 2: // | |
3003 | fDCARPrimVtxCut = 5; | |
3004 | break; | |
3005 | case 3: // | |
3006 | fDCARPrimVtxCut = 4; | |
3007 | break; | |
3008 | case 4: // | |
3009 | fDCARPrimVtxCut = 3; | |
3010 | break; | |
3011 | case 5: // | |
3012 | fDCARPrimVtxCut = 2.5; | |
3013 | break; | |
3014 | case 6: // | |
3015 | fDCARPrimVtxCut = 2; | |
3016 | break; | |
3017 | case 7: // | |
3018 | fDCARPrimVtxCut = 1.5; | |
3019 | break; | |
3020 | case 8: // | |
3021 | fDCARPrimVtxCut = 1; | |
3022 | break; | |
3023 | case 9: // | |
3024 | fDCARPrimVtxCut = 0.5; | |
3025 | break; | |
3026 | default: | |
3027 | cout<<"Warning: DCARPhotonPrimVtx not defined "<<DCARPhotonPrimVtx<<endl; | |
3028 | return kFALSE; | |
3029 | } | |
3030 | return kTRUE; | |
3031 | } | |
3032 | ||
3033 | ||
e5b6e8a6 | 3034 | //------------------------------------------------------------- |
3035 | Double_t AliConversionCuts::GetCentrality(AliVEvent *event) | |
3036 | { // Get Event Centrality | |
3037 | ||
3038 | AliESDEvent *esdEvent=dynamic_cast<AliESDEvent*>(event); | |
3039 | if(esdEvent){ | |
3040 | AliCentrality *fESDCentrality=(AliCentrality*)esdEvent->GetCentrality(); | |
3041 | ||
3042 | if(fDetectorCentrality==0){ | |
ae947965 | 3043 | if (fIsHeavyIon==2){ |
3044 | return fESDCentrality->GetCentralityPercentile("V0A"); // default for pPb | |
3045 | } else{ | |
3046 | return fESDCentrality->GetCentralityPercentile("V0M"); // default | |
3047 | } | |
e5b6e8a6 | 3048 | } |
3049 | if(fDetectorCentrality==1){ | |
3050 | return fESDCentrality->GetCentralityPercentile("CL1"); | |
3051 | } | |
3052 | } | |
3053 | ||
3054 | AliAODEvent *aodEvent=dynamic_cast<AliAODEvent*>(event); | |
3055 | if(aodEvent){ | |
3056 | if(aodEvent->GetHeader()){return aodEvent->GetHeader()->GetCentrality();} | |
3057 | } | |
3058 | ||
3059 | return -1; | |
3060 | } | |
3061 | //------------------------------------------------------------- | |
3062 | Bool_t AliConversionCuts::IsCentralitySelected(AliVEvent *event, AliVEvent *fMCEvent) | |
3063 | { // Centrality Selection | |
3064 | if(!fIsHeavyIon)return kTRUE; | |
3065 | ||
4803eb1f | 3066 | if(fCentralityMin == fCentralityMax ) return kTRUE;//0-100% |
3067 | else if(fCentralityMax==0) fCentralityMax=10; //CentralityRange = fCentralityMin-100% | |
aff90284 | 3068 | |
e5b6e8a6 | 3069 | Double_t centrality=GetCentrality(event); |
3070 | if(centrality<0)return kFALSE; | |
3071 | ||
3072 | Int_t centralityC=0; | |
3073 | if (fModCentralityClass == 0){ | |
3074 | centralityC= Int_t(centrality/10); | |
3075 | if(centralityC >= fCentralityMin && centralityC < fCentralityMax) | |
3076 | return kTRUE; | |
3077 | else return kFALSE; | |
3078 | } | |
3079 | else if (fModCentralityClass ==1){ | |
3080 | centralityC= Int_t(centrality); | |
3081 | if(centralityC >= fCentralityMin*5 && centralityC < fCentralityMax*5){ | |
3082 | return kTRUE; | |
3083 | } else return kFALSE; | |
3084 | } | |
3085 | else if (fModCentralityClass ==2){ | |
3086 | centralityC= Int_t(centrality); | |
3087 | if(centralityC >= ((fCentralityMin*5)+45) && centralityC < ((fCentralityMax*5)+45)) | |
3088 | return kTRUE; | |
3089 | else return kFALSE; | |
3090 | } | |
aff90284 | 3091 | |
4803eb1f | 3092 | Int_t nprimaryTracks = ((AliV0ReaderV1*)AliAnalysisManager::GetAnalysisManager()->GetTask("V0ReaderV1"))->GetNumberOfPrimaryTracks(); |
aff90284 | 3093 | Int_t PrimaryTracks10[10][2] = |
4803eb1f | 3094 | { |
3095 | {9999,9999}, // 0 | |
46ec68c9 | 3096 | {1210,2150}, // 10 |
3097 | { 817,1435}, // 20 | |
3098 | { 536, 930}, // 30 | |
3099 | { 337, 570}, // 40 | |
3100 | { 197, 327}, // 50 | |
3101 | { 106, 173}, // 60 | |
3102 | { 51, 81}, // 70 | |
3103 | { 21, 34}, // 80 | |
4803eb1f | 3104 | { 0, 0} // 90 |
3105 | }; | |
aff90284 | 3106 | Int_t PrimaryTracks5a[10][2] = |
4803eb1f | 3107 | { |
3108 | {9999,9999}, // 0 | |
46ec68c9 | 3109 | {1485,2640}, // 5 |
3110 | {1210,2150}, // 10 | |
3111 | { 995,1760}, // 15 | |
3112 | { 817,1435}, // 20 | |
3113 | { 666,1160}, // 25 | |
3114 | { 536, 930}, // 30 | |
3115 | { 428, 731}, // 35 | |
3116 | { 337, 570}, // 40 | |
3117 | { 260, 436} // 45 | |
4803eb1f | 3118 | }; |
aff90284 | 3119 | Int_t PrimaryTracks5b[10][2] = |
4803eb1f | 3120 | { |
46ec68c9 | 3121 | { 260, 436}, // 45 |
3122 | { 197, 327}, // 50 | |
3123 | { 147, 239}, // 55 | |
3124 | { 106, 173}, // 60 | |
3125 | { 75, 120}, // 65 | |
3126 | { 51, 81}, // 70 | |
3127 | { 34, 53}, // 75 | |
3128 | { 21, 34}, // 80 | |
3129 | { 13, 19}, // 85 | |
4803eb1f | 3130 | { 0, 0} // 90 |
3131 | }; | |
3132 | ||
3133 | Int_t column = -1; | |
3134 | if(event->IsA()==AliESDEvent::Class()) column = 0; | |
3135 | if(event->IsA()==AliAODEvent::Class()) column = 1; | |
aff90284 | 3136 | |
e5b6e8a6 | 3137 | if (fModCentralityClass == 3){ |
3138 | if(fMCEvent){ | |
4803eb1f | 3139 | if(nprimaryTracks > PrimaryTracks10[fCentralityMax][column] && nprimaryTracks <= PrimaryTracks10[fCentralityMin][column]) |
e5b6e8a6 | 3140 | return kTRUE; |
3141 | else return kFALSE; | |
3142 | } | |
3143 | else{ | |
3144 | centralityC= Int_t(centrality/10); | |
3145 | if(centralityC >= fCentralityMin && centralityC < fCentralityMax) | |
3146 | return kTRUE; | |
3147 | else return kFALSE; | |
3148 | } | |
3149 | } | |
3150 | else if (fModCentralityClass ==4){ | |
3151 | if(fMCEvent){ | |
4803eb1f | 3152 | if(nprimaryTracks > PrimaryTracks5a[fCentralityMax][column] && nprimaryTracks <= PrimaryTracks5a[fCentralityMin][column]) |
e5b6e8a6 | 3153 | return kTRUE; |
3154 | else return kFALSE; | |
3155 | } | |
3156 | else{ | |
3157 | centralityC= Int_t(centrality); | |
3158 | if(centralityC >= fCentralityMin*5 && centralityC < fCentralityMax*5){ | |
3159 | return kTRUE; | |
3160 | } else return kFALSE; | |
3161 | } | |
3162 | } | |
3163 | else if (fModCentralityClass ==5){ | |
3164 | if(fMCEvent){ | |
4803eb1f | 3165 | if(nprimaryTracks > PrimaryTracks5b[fCentralityMax][column] && nprimaryTracks <= PrimaryTracks5b[fCentralityMin][column]) |
e5b6e8a6 | 3166 | return kTRUE; |
3167 | else return kFALSE; | |
3168 | } | |
3169 | else{ | |
3170 | centralityC= Int_t(centrality); | |
3171 | if(centralityC >= ((fCentralityMin*5)+45) && centralityC < ((fCentralityMax*5)+45)) | |
3172 | return kTRUE; | |
3173 | else return kFALSE; | |
3174 | } | |
3175 | } | |
3176 | ||
3177 | return kFALSE; | |
3178 | } | |
3179 | ///________________________________________________________________________ | |
3180 | Bool_t AliConversionCuts::VertexZCut(AliVEvent *event){ | |
3181 | // Cut on z position of primary vertex | |
3182 | Double_t fVertexZ=event->GetPrimaryVertex()->GetZ(); | |
3b77b2d1 | 3183 | |
e5b6e8a6 | 3184 | if(abs(fVertexZ)>fMaxVertexZ)return kFALSE; |
11c1e680 | 3185 | |
0a2b2b4b | 3186 | if (fIsHeavyIon == 2){ |
3187 | if(fUtils->IsFirstEventInChunk(event)) return kFALSE; | |
3188 | if(!fUtils->IsVertexSelected2013pA(event)) return kFALSE; | |
3189 | ||
3190 | } | |
11c1e680 | 3191 | |
e5b6e8a6 | 3192 | return kTRUE; |
3193 | } | |
3b77b2d1 | 3194 | ///________________________________________________________________________ |
3195 | ||
3196 | Int_t AliConversionCuts::GetNumberOfContributorsVtx(AliVEvent *event){ | |
4a0aab28 | 3197 | // returns number of contributors to the vertex |
e5b6e8a6 | 3198 | |
4a0aab28 | 3199 | AliESDEvent *fESDEvent=dynamic_cast<AliESDEvent*>(event); |
3200 | if(fESDEvent){ | |
e5b6e8a6 | 3201 | if (fESDEvent->GetPrimaryVertex() != NULL){ |
3202 | if(fESDEvent->GetPrimaryVertex()->GetNContributors()>0) { | |
fcc79cf5 | 3203 | // cout << "accepted global" << fESDEvent->GetEventNumberInFile() << " with NCont: " << fESDEvent->GetPrimaryVertex()->GetNContributors() << endl; |
e5b6e8a6 | 3204 | return fESDEvent->GetPrimaryVertex()->GetNContributors(); |
3205 | } | |
4a0aab28 | 3206 | } |
a280ac15 | 3207 | |
e5b6e8a6 | 3208 | if(fESDEvent->GetPrimaryVertexSPD() !=NULL){ |
4a0aab28 | 3209 | if(fESDEvent->GetPrimaryVertexSPD()->GetNContributors()>0) { |
fcc79cf5 | 3210 | // cout << "accepted SPD" << fESDEvent->GetEventNumberInFile() << " with NCont: " << fESDEvent->GetPrimaryVertexSPD()->GetNContributors() << endl; |
4a0aab28 | 3211 | return fESDEvent->GetPrimaryVertexSPD()->GetNContributors(); |
e5b6e8a6 | 3212 | } else { |
3213 | AliWarning(Form("Number of contributors from bad vertex type:: %s",fESDEvent->GetPrimaryVertex()->GetName())); | |
ccfa8c0d | 3214 | // cout << "rejected " << fESDEvent->GetEventNumberInFile() << endl; |
4a0aab28 | 3215 | return 0; |
3216 | } | |
3217 | } | |
3218 | } | |
3219 | ||
3220 | AliAODEvent *fAODEvent=dynamic_cast<AliAODEvent*>(event); | |
3221 | if(fAODEvent){ | |
e5b6e8a6 | 3222 | if (fAODEvent->GetPrimaryVertex() != NULL){ |
3223 | if(fAODEvent->GetPrimaryVertex()->GetNContributors()>0) { | |
3224 | return fAODEvent->GetPrimaryVertex()->GetNContributors(); | |
3225 | } | |
a280ac15 | 3226 | } |
e5b6e8a6 | 3227 | if(fAODEvent->GetPrimaryVertexSPD() !=NULL){ |
4a0aab28 | 3228 | if(fAODEvent->GetPrimaryVertexSPD()->GetNContributors()>0) { |
3229 | return fAODEvent->GetPrimaryVertexSPD()->GetNContributors(); | |
e5b6e8a6 | 3230 | } else { |
4a0aab28 | 3231 | AliWarning(Form("Number of contributors from bad vertex type:: %s",fAODEvent->GetPrimaryVertex()->GetName())); |
3232 | return 0; | |
3233 | } | |
3234 | } | |
3235 | } | |
ccfa8c0d | 3236 | // cout << "rejected " << fESDEvent->GetEventNumberInFile() << endl; |
4a0aab28 | 3237 | return 0; |
3b77b2d1 | 3238 | } |
3239 | ||
92efd725 | 3240 | ///________________________________________________________________________ |
3b77b2d1 | 3241 | |
1186afd2 | 3242 | Bool_t AliConversionCuts::IsTriggerSelected(AliVEvent *fInputEvent) |
92efd725 | 3243 | { |
e5b6e8a6 | 3244 | |
4a0aab28 | 3245 | AliInputEventHandler *fInputHandler=(AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()); |
3246 | ||
3247 | UInt_t isSelected = AliVEvent::kAny; | |
0a2b2b4b | 3248 | if (fInputHandler==NULL) return kFALSE; |
1186afd2 | 3249 | if( fInputHandler->GetEventSelection() || fInputEvent->IsA()==AliAODEvent::Class()) { |
ae947965 | 3250 | if (!fTriggerSelectedManually){ |
3251 | if (fPreSelCut) fOfflineTriggerMask = AliVEvent::kAny; | |
3252 | else { | |
3253 | if (fIsHeavyIon == 1) fOfflineTriggerMask = AliVEvent::kMB | AliVEvent::kCentral | AliVEvent::kSemiCentral; | |
3254 | else if (fIsHeavyIon == 2) fOfflineTriggerMask = AliVEvent::kINT7; | |
3255 | else fOfflineTriggerMask = AliVEvent::kMB; | |
aff90284 | 3256 | } |
ae947965 | 3257 | } |
4a0aab28 | 3258 | // Get the actual offline trigger mask for the event and AND it with the |
3259 | // requested mask. If no mask requested select by default the event. | |
ae947965 | 3260 | // if (fPreSelCut) cout << "Trigger selected from outside: "<< fTriggerSelectedManually <<"\t Offline Trigger mask for Precut: " << fOfflineTriggerMask << endl; |
3261 | // else cout << "Trigger selected from outside: "<< fTriggerSelectedManually <<"\t Offline Trigger mask: " << fOfflineTriggerMask << endl; | |
aff90284 | 3262 | |
4a0aab28 | 3263 | if (fOfflineTriggerMask) |
3264 | isSelected = fOfflineTriggerMask & fInputHandler->IsEventSelected(); | |
3265 | } | |
e5b6e8a6 | 3266 | fIsSDDFired = !(fInputHandler->IsEventSelected() & AliVEvent::kFastOnly); |
4a0aab28 | 3267 | |
3268 | // Fill Histogram | |
3269 | if(hTriggerClass){ | |
11c1e680 | 3270 | if (fIsSDDFired) hTriggerClass->Fill(33); |
e5b6e8a6 | 3271 | if (fInputHandler->IsEventSelected() & AliVEvent::kMB)hTriggerClass->Fill(0); |
3272 | if (fInputHandler->IsEventSelected() & AliVEvent::kINT7)hTriggerClass->Fill(1); | |
3273 | if (fInputHandler->IsEventSelected() & AliVEvent::kMUON)hTriggerClass->Fill(2); | |
3274 | if (fInputHandler->IsEventSelected() & AliVEvent::kHighMult)hTriggerClass->Fill(3); | |
3275 | if (fInputHandler->IsEventSelected() & AliVEvent::kEMC1)hTriggerClass->Fill(4); | |
4a0aab28 | 3276 | if (fInputHandler->IsEventSelected() & AliVEvent::kCINT5)hTriggerClass->Fill(5); |
e5b6e8a6 | 3277 | if (fInputHandler->IsEventSelected() & AliVEvent::kCMUS5)hTriggerClass->Fill(6); |
3278 | if (fInputHandler->IsEventSelected() & AliVEvent::kMUSPB)hTriggerClass->Fill(6); | |
e5b6e8a6 | 3279 | if (fInputHandler->IsEventSelected() & AliVEvent::kMUSH7)hTriggerClass->Fill(7); |
3280 | if (fInputHandler->IsEventSelected() & AliVEvent::kMUSHPB)hTriggerClass->Fill(7); | |
3281 | if (fInputHandler->IsEventSelected() & AliVEvent::kMUL7)hTriggerClass->Fill(8); | |
3282 | if (fInputHandler->IsEventSelected() & AliVEvent::kMuonLikePB)hTriggerClass->Fill(8); | |
3283 | if (fInputHandler->IsEventSelected() & AliVEvent::kMUU7)hTriggerClass->Fill(9); | |
3284 | if (fInputHandler->IsEventSelected() & AliVEvent::kMuonUnlikePB)hTriggerClass->Fill(9); | |
3285 | if (fInputHandler->IsEventSelected() & AliVEvent::kEMC7)hTriggerClass->Fill(10); | |
3286 | if (fInputHandler->IsEventSelected() & AliVEvent::kEMC8)hTriggerClass->Fill(10); | |
3287 | if (fInputHandler->IsEventSelected() & AliVEvent::kMUS7)hTriggerClass->Fill(11); | |
3288 | if (fInputHandler->IsEventSelected() & AliVEvent::kPHI1)hTriggerClass->Fill(12); | |
3289 | if (fInputHandler->IsEventSelected() & AliVEvent::kPHI7)hTriggerClass->Fill(13); | |
3290 | if (fInputHandler->IsEventSelected() & AliVEvent::kPHI8)hTriggerClass->Fill(13); | |
3291 | if (fInputHandler->IsEventSelected() & AliVEvent::kPHOSPb)hTriggerClass->Fill(13); | |
3292 | if (fInputHandler->IsEventSelected() & AliVEvent::kEMCEJE)hTriggerClass->Fill(14); | |
3293 | if (fInputHandler->IsEventSelected() & AliVEvent::kEMCEGA)hTriggerClass->Fill(15); | |
3294 | if (fInputHandler->IsEventSelected() & AliVEvent::kCentral)hTriggerClass->Fill(16); | |
3295 | if (fInputHandler->IsEventSelected() & AliVEvent::kSemiCentral)hTriggerClass->Fill(17); | |
3296 | if (fInputHandler->IsEventSelected() & AliVEvent::kDG5)hTriggerClass->Fill(18); | |
3297 | if (fInputHandler->IsEventSelected() & AliVEvent::kZED)hTriggerClass->Fill(19); | |
3298 | if (fInputHandler->IsEventSelected() & AliVEvent::kSPI7)hTriggerClass->Fill(20); | |
3299 | if (fInputHandler->IsEventSelected() & AliVEvent::kSPI)hTriggerClass->Fill(20); | |
3300 | if (fInputHandler->IsEventSelected() & AliVEvent::kINT8)hTriggerClass->Fill(21); | |
3301 | if (fInputHandler->IsEventSelected() & AliVEvent::kMuonSingleLowPt8)hTriggerClass->Fill(22); | |
3302 | if (fInputHandler->IsEventSelected() & AliVEvent::kMuonSingleHighPt8)hTriggerClass->Fill(23); | |
3303 | if (fInputHandler->IsEventSelected() & AliVEvent::kMuonLikeLowPt8)hTriggerClass->Fill(24); | |
3304 | if (fInputHandler->IsEventSelected() & AliVEvent::kMuonUnlikeLowPt8)hTriggerClass->Fill(25); | |
3305 | if (fInputHandler->IsEventSelected() & AliVEvent::kMuonUnlikeLowPt0)hTriggerClass->Fill(26); | |
3306 | if (fInputHandler->IsEventSelected() & AliVEvent::kUserDefined)hTriggerClass->Fill(27); | |
11c1e680 | 3307 | if (fInputHandler->IsEventSelected() & AliVEvent::kTRD)hTriggerClass->Fill(28); |
3308 | if (fInputHandler->IsEventSelected() & AliVEvent::kFastOnly)hTriggerClass->Fill(29); | |
3309 | if (fInputHandler->IsEventSelected() & AliVEvent::kAnyINT)hTriggerClass->Fill(30); | |
3310 | if (fInputHandler->IsEventSelected() & AliVEvent::kAny)hTriggerClass->Fill(31); | |
3311 | if (!fInputHandler->IsEventSelected()) hTriggerClass->Fill(34); | |
a280ac15 | 3312 | } |
3313 | ||
3314 | if(hTriggerClassSelected && isSelected){ | |
11c1e680 | 3315 | if (!fIsSDDFired) hTriggerClassSelected->Fill(33); |
a280ac15 | 3316 | if (fInputHandler->IsEventSelected() & AliVEvent::kMB)hTriggerClassSelected->Fill(0); |
3317 | if (fInputHandler->IsEventSelected() & AliVEvent::kINT7)hTriggerClassSelected->Fill(1); | |
3318 | if (fInputHandler->IsEventSelected() & AliVEvent::kMUON)hTriggerClassSelected->Fill(2); | |
3319 | if (fInputHandler->IsEventSelected() & AliVEvent::kHighMult)hTriggerClassSelected->Fill(3); | |
3320 | if (fInputHandler->IsEventSelected() & AliVEvent::kEMC1)hTriggerClassSelected->Fill(4); | |
3321 | if (fInputHandler->IsEventSelected() & AliVEvent::kCINT5)hTriggerClassSelected->Fill(5); | |
3322 | if (fInputHandler->IsEventSelected() & AliVEvent::kCMUS5)hTriggerClassSelected->Fill(6); | |
3323 | if (fInputHandler->IsEventSelected() & AliVEvent::kMUSPB)hTriggerClassSelected->Fill(6); | |
3324 | if (fInputHandler->IsEventSelected() & AliVEvent::kMUSH7)hTriggerClassSelected->Fill(7); | |
3325 | if (fInputHandler->IsEventSelected() & AliVEvent::kMUSHPB)hTriggerClassSelected->Fill(7); | |
3326 | if (fInputHandler->IsEventSelected() & AliVEvent::kMUL7)hTriggerClassSelected->Fill(8); | |
3327 | if (fInputHandler->IsEventSelected() & AliVEvent::kMuonLikePB)hTriggerClassSelected->Fill(8); | |
3328 | if (fInputHandler->IsEventSelected() & AliVEvent::kMUU7)hTriggerClassSelected->Fill(9); | |
3329 | if (fInputHandler->IsEventSelected() & AliVEvent::kMuonUnlikePB)hTriggerClassSelected->Fill(9); | |
3330 | if (fInputHandler->IsEventSelected() & AliVEvent::kEMC7)hTriggerClassSelected->Fill(10); | |
3331 | if (fInputHandler->IsEventSelected() & AliVEvent::kEMC8)hTriggerClassSelected->Fill(10); | |
3332 | if (fInputHandler->IsEventSelected() & AliVEvent::kMUS7)hTriggerClassSelected->Fill(11); | |
3333 | if (fInputHandler->IsEventSelected() & AliVEvent::kPHI1)hTriggerClassSelected->Fill(12); | |
3334 | if (fInputHandler->IsEventSelected() & AliVEvent::kPHI7)hTriggerClassSelected->Fill(13); | |
3335 | if (fInputHandler->IsEventSelected() & AliVEvent::kPHI8)hTriggerClassSelected->Fill(13); | |
3336 | if (fInputHandler->IsEventSelected() & AliVEvent::kPHOSPb)hTriggerClassSelected->Fill(13); | |
3337 | if (fInputHandler->IsEventSelected() & AliVEvent::kEMCEJE)hTriggerClassSelected->Fill(14); | |
3338 | if (fInputHandler->IsEventSelected() & AliVEvent::kEMCEGA)hTriggerClassSelected->Fill(15); | |
3339 | if (fInputHandler->IsEventSelected() & AliVEvent::kCentral)hTriggerClassSelected->Fill(16); | |
3340 | if (fInputHandler->IsEventSelected() & AliVEvent::kSemiCentral)hTriggerClassSelected->Fill(17); | |
3341 | if (fInputHandler->IsEventSelected() & AliVEvent::kDG5)hTriggerClassSelected->Fill(18); | |
3342 | if (fInputHandler->IsEventSelected() & AliVEvent::kZED)hTriggerClassSelected->Fill(19); | |
3343 | if (fInputHandler->IsEventSelected() & AliVEvent::kSPI7)hTriggerClassSelected->Fill(20); | |
3344 | if (fInputHandler->IsEventSelected() & AliVEvent::kSPI)hTriggerClassSelected->Fill(20); | |
3345 | if (fInputHandler->IsEventSelected() & AliVEvent::kINT8)hTriggerClassSelected->Fill(21); | |
3346 | if (fInputHandler->IsEventSelected() & AliVEvent::kMuonSingleLowPt8)hTriggerClassSelected->Fill(22); | |
3347 | if (fInputHandler->IsEventSelected() & AliVEvent::kMuonSingleHighPt8)hTriggerClassSelected->Fill(23); | |
3348 | if (fInputHandler->IsEventSelected() & AliVEvent::kMuonLikeLowPt8)hTriggerClassSelected->Fill(24); | |
3349 | if (fInputHandler->IsEventSelected() & AliVEvent::kMuonUnlikeLowPt8)hTriggerClassSelected->Fill(25); | |
3350 | if (fInputHandler->IsEventSelected() & AliVEvent::kMuonUnlikeLowPt0)hTriggerClassSelected->Fill(26); | |
3351 | if (fInputHandler->IsEventSelected() & AliVEvent::kUserDefined)hTriggerClassSelected->Fill(27); | |
11c1e680 | 3352 | if (fInputHandler->IsEventSelected() & AliVEvent::kTRD)hTriggerClassSelected->Fill(28); |
3353 | if (fInputHandler->IsEventSelected() & AliVEvent::kFastOnly)hTriggerClassSelected->Fill(29); | |
3354 | if (fInputHandler->IsEventSelected() & AliVEvent::kAnyINT)hTriggerClassSelected->Fill(30); | |
3355 | if (fInputHandler->IsEventSelected() & AliVEvent::kAny)hTriggerClassSelected->Fill(31); | |
4a0aab28 | 3356 | } |
3b77b2d1 | 3357 | |
e5b6e8a6 | 3358 | if(!isSelected)return kFALSE; |
a280ac15 | 3359 | |
4a0aab28 | 3360 | return kTRUE; |
3b77b2d1 | 3361 | |
92efd725 | 3362 | } |
3b77b2d1 | 3363 | |
3364 | ///________________________________________________________________________ | |
3365 | Int_t AliConversionCuts::GetFirstTPCRow(Double_t radius){ | |
4a0aab28 | 3366 | // Get first TPC row |
e5b6e8a6 | 3367 | Int_t firstTPCRow = 0; |
3368 | Double_t radiusI = 84.8; | |
3369 | Double_t radiusO = 134.6; | |
4a0aab28 | 3370 | Double_t radiusOB = 198.; |
e5b6e8a6 | 3371 | Double_t rSizeI = 0.75; |
3372 | Double_t rSizeO = 1.; | |
3373 | Double_t rSizeOB = 1.5; | |
3374 | Int_t nClsI = 63; | |
3375 | Int_t nClsIO = 127; | |
4a0aab28 | 3376 | |
3377 | if(radius <= radiusI){ | |
3378 | return firstTPCRow; | |
3379 | } | |
3380 | if(radius>radiusI && radius<=radiusO){ | |
3381 | firstTPCRow = (Int_t)((radius-radiusI)/rSizeI); | |
3382 | } | |
3383 | if(radius>radiusO && radius<=radiusOB){ | |
3384 | firstTPCRow = (Int_t)(nClsI+(radius-radiusO)/rSizeO); | |
3385 | } | |
3386 | ||
3387 | if(radius>radiusOB){ | |
3388 | firstTPCRow =(Int_t)(nClsIO+(radius-radiusOB)/rSizeOB); | |
3389 | } | |
3390 | ||
3391 | return firstTPCRow; | |
3b77b2d1 | 3392 | } |
3393 | ||
92efd725 | 3394 | Bool_t AliConversionCuts::CosinePAngleCut(const AliConversionPhotonBase * photon, AliVEvent * event) const { |
4a0aab28 | 3395 | ///Check if passes cosine of pointing angle cut |
92efd725 | 3396 | if(GetCosineOfPointingAngle(photon, event) < (TMath::Cos(fCosPAngleCut))){ |
3397 | return kFALSE; | |
3398 | } | |
3399 | return kTRUE; | |
3b77b2d1 | 3400 | } |
3401 | ||
92efd725 | 3402 | Double_t AliConversionCuts::GetCosineOfPointingAngle( const AliConversionPhotonBase * photon, AliVEvent * event) const{ |
e5b6e8a6 | 3403 | // calculates the pointing angle of the recalculated V0 |
3b77b2d1 | 3404 | |
92efd725 | 3405 | Double_t momV0[3] = {0,0,0}; |
3406 | if(event->IsA()==AliESDEvent::Class()){ | |
3407 | AliESDEvent *esdEvent = dynamic_cast<AliESDEvent*>(event); | |
e5b6e8a6 | 3408 | if(!esdEvent) return -999; |
92efd725 | 3409 | AliESDv0 *v0 = esdEvent->GetV0(photon->GetV0Index()); |
e5b6e8a6 | 3410 | if(!v0) return -999; |
92efd725 | 3411 | v0->GetPxPyPz(momV0[0],momV0[1],momV0[2]); |
3412 | } | |
3413 | if(event->IsA()==AliAODEvent::Class()){ | |
3414 | momV0[0] = photon->GetPx(); | |
3415 | momV0[1] = photon->GetPy(); | |
3416 | momV0[2] = photon->GetPz(); | |
3417 | } | |
e5b6e8a6 | 3418 | |
92efd725 | 3419 | //Double_t momV0[3] = { photon->GetPx(), photon->GetPy(), photon->GetPz() }; //momentum of the V0 |
e5b6e8a6 | 3420 | Double_t PosV0[3] = { photon->GetConversionX() - event->GetPrimaryVertex()->GetX(), |
3421 | photon->GetConversionY() - event->GetPrimaryVertex()->GetY(), | |
92efd725 | 3422 | photon->GetConversionZ() - event->GetPrimaryVertex()->GetZ() }; //Recalculated V0 Position vector |
e5b6e8a6 | 3423 | |
3b77b2d1 | 3424 | Double_t momV02 = momV0[0]*momV0[0] + momV0[1]*momV0[1] + momV0[2]*momV0[2]; |
3425 | Double_t PosV02 = PosV0[0]*PosV0[0] + PosV0[1]*PosV0[1] + PosV0[2]*PosV0[2]; | |
3426 | ||
e5b6e8a6 | 3427 | |
3428 | Double_t cosinePointingAngle = -999; | |
3429 | if(momV02*PosV02 > 0.0) | |
3430 | cosinePointingAngle = (PosV0[0]*momV0[0] + PosV0[1]*momV0[1] + PosV0[2]*momV0[2] ) / TMath::Sqrt(momV02 * PosV02); | |
3431 | ||
3b77b2d1 | 3432 | return cosinePointingAngle; |
3433 | } | |
3434 | ||
e5b6e8a6 | 3435 | ///________________________________________________________________________ |
92efd725 | 3436 | Bool_t AliConversionCuts::PsiPairCut(const AliConversionPhotonBase * photon) const { |
3b77b2d1 | 3437 | |
4a0aab28 | 3438 | if(photon->GetPsiPair() > fPsiPairCut){ |
3439 | return kFALSE;} | |
3440 | else{return kTRUE;} | |
3b77b2d1 | 3441 | |
3b77b2d1 | 3442 | } |
3443 | ||
3444 | ///________________________________________________________________________ | |
3445 | TString AliConversionCuts::GetCutNumber(){ | |
4a0aab28 | 3446 | // returns TString with current cut number |
3447 | TString a(kNCuts); | |
3448 | for(Int_t ii=0;ii<kNCuts;ii++){ | |
92efd725 | 3449 | a.Append(Form("%d",fCuts[ii])); |
4a0aab28 | 3450 | } |
3451 | return a; | |
3b77b2d1 | 3452 | } |
3453 | ||
92efd725 | 3454 | ///________________________________________________________________________ |
3455 | void AliConversionCuts::FillElectonLabelArray(AliAODConversionPhoton* photon, Int_t nV0){ | |
e5b6e8a6 | 3456 | |
92efd725 | 3457 | Int_t posLabel = photon->GetTrackLabelPositive(); |
3458 | Int_t negLabel = photon->GetTrackLabelNegative(); | |
e5b6e8a6 | 3459 | |
92efd725 | 3460 | fElectronLabelArray[nV0*2] = posLabel; |
3461 | fElectronLabelArray[(nV0*2)+1] = negLabel; | |
3462 | } | |
3463 | ///________________________________________________________________________ | |
3464 | Bool_t AliConversionCuts::RejectSharedElectronV0s(AliAODConversionPhoton* photon, Int_t nV0, Int_t nV0s){ | |
3b77b2d1 | 3465 | |
92efd725 | 3466 | Int_t posLabel = photon->GetTrackLabelPositive(); |
3467 | Int_t negLabel = photon->GetTrackLabelNegative(); | |
e5b6e8a6 | 3468 | |
92efd725 | 3469 | for(Int_t i = 0; i<nV0s*2;i++){ |
3470 | if(i==nV0*2) continue; | |
3471 | if(i==(nV0*2)+1) continue; | |
3472 | if(fElectronLabelArray[i] == posLabel){ | |
3473 | return kFALSE;} | |
3474 | if(fElectronLabelArray[i] == negLabel){ | |
3475 | return kFALSE;} | |
3476 | } | |
3b77b2d1 | 3477 | |
92efd725 | 3478 | return kTRUE; |
3479 | } | |
3b77b2d1 | 3480 | ///________________________________________________________________________ |
92efd725 | 3481 | Bool_t AliConversionCuts::RejectToCloseV0s(AliAODConversionPhoton* photon, TList *photons, Int_t nV0){ |
3482 | ||
3483 | ||
3484 | Double_t posX = photon->GetConversionX(); | |
3485 | Double_t posY = photon->GetConversionY(); | |
3486 | Double_t posZ = photon->GetConversionZ(); | |
3487 | ||
3488 | for(Int_t i = 0;i<photons->GetEntries();i++){ | |
3489 | if(nV0 == i) continue; | |
3490 | AliAODConversionPhoton *photonComp = (AliAODConversionPhoton*) photons->At(i); | |
3491 | Double_t posCompX = photonComp->GetConversionX(); | |
3492 | Double_t posCompY = photonComp->GetConversionY(); | |
3493 | Double_t posCompZ = photonComp->GetConversionZ(); | |
e5b6e8a6 | 3494 | |
92efd725 | 3495 | Double_t dist = pow((posX - posCompX),2)+pow((posY - posCompY),2)+pow((posZ - posCompZ),2); |
3496 | ||
3497 | if(dist < fminV0Dist*fminV0Dist){ | |
3498 | if(photon->GetChi2perNDF() < photonComp->GetChi2perNDF()) return kTRUE; | |
3499 | else { | |
3500 | return kFALSE;} | |
3501 | } | |
e5b6e8a6 | 3502 | |
92efd725 | 3503 | } |
3504 | return kTRUE; | |
3b77b2d1 | 3505 | } |
ca91a3e1 | 3506 | ///________________________________________________________________________ |
ae947965 | 3507 | void AliConversionCuts::GetNotRejectedParticles(Int_t rejection, TList *HeaderList, AliVEvent *MCEvent){ |
e5b6e8a6 | 3508 | |
4803eb1f | 3509 | |
3510 | ||
ca91a3e1 | 3511 | if(fNotRejectedStart){ |
3512 | delete[] fNotRejectedStart; | |
3513 | fNotRejectedStart = NULL; | |
3514 | } | |
3515 | if(fNotRejectedEnd){ | |
3516 | delete[] fNotRejectedEnd; | |
3517 | fNotRejectedEnd = NULL; | |
3518 | } | |
3519 | if(fGeneratorNames){ | |
3520 | delete[] fGeneratorNames; | |
3521 | fGeneratorNames = NULL; | |
3522 | } | |
e5b6e8a6 | 3523 | |
ca91a3e1 | 3524 | if(rejection == 0) return; // No Rejection |
ae947965 | 3525 | |
3526 | AliGenCocktailEventHeader *cHeader = 0x0; | |
3527 | AliAODMCHeader *cHeaderAOD = 0x0; | |
3528 | Bool_t headerFound = kFALSE; | |
3529 | ||
3530 | if(MCEvent->IsA()==AliMCEvent::Class()){ | |
3531 | cHeader = dynamic_cast<AliGenCocktailEventHeader*>(dynamic_cast<AliMCEvent*>(MCEvent)->GenEventHeader()); | |
3532 | if(cHeader) headerFound = kTRUE; | |
3533 | } | |
4803eb1f | 3534 | if(MCEvent->IsA()==AliAODEvent::Class()){ // MCEvent is a AODEvent in case of AOD |
ae947965 | 3535 | cHeaderAOD = dynamic_cast<AliAODMCHeader*>(MCEvent->FindListObject(AliAODMCHeader::StdBranchName())); |
3536 | if(cHeaderAOD) headerFound = kTRUE; | |
3537 | } | |
aff90284 | 3538 | |
ae947965 | 3539 | if(headerFound){ |
3540 | TList *genHeaders = 0x0; | |
3541 | if(cHeader) genHeaders = cHeader->GetHeaders(); | |
3542 | if(cHeaderAOD){ | |
3543 | genHeaders = cHeaderAOD->GetCocktailHeaders(); | |
3544 | if(genHeaders->GetEntries()==1){ | |
3545 | SetRejectExtraSignalsCut(0); | |
3546 | return; | |
3547 | } | |
3548 | } | |
ca91a3e1 | 3549 | AliGenEventHeader* gh = 0; |
3550 | fnHeaders = 0; | |
e5b6e8a6 | 3551 | if(rejection == 1 || rejection == 3) fnHeaders = 1; // MinBiasHeader |
ca91a3e1 | 3552 | if(rejection == 2){ // TList of Headers Names |
3553 | for(Int_t i = 0; i<genHeaders->GetEntries();i++){ | |
3554 | gh = (AliGenEventHeader*)genHeaders->At(i); | |
3555 | TString GeneratorName = gh->GetName(); | |
3556 | for(Int_t j = 0; j<HeaderList->GetEntries();j++){ | |
3557 | TString GeneratorInList = ((TObjString*)HeaderList->At(j))->GetString(); | |
3558 | if(GeneratorName.CompareTo(GeneratorInList) == 0){ | |
3559 | fnHeaders++; | |
3560 | continue; | |
3561 | } | |
3562 | } | |
3563 | } | |
3564 | } | |
3565 | ||
3566 | fNotRejectedStart = new Int_t[fnHeaders]; | |
3567 | fNotRejectedEnd = new Int_t[fnHeaders]; | |
3568 | fGeneratorNames = new TString[fnHeaders]; | |
3569 | ||
e5b6e8a6 | 3570 | if(rejection == 1 || rejection == 3){ |
ca91a3e1 | 3571 | fNotRejectedStart[0] = 0; |
e5b6e8a6 | 3572 | fNotRejectedEnd[0] = ((AliGenEventHeader*)genHeaders->At(0))->NProduced()-1; |
ca91a3e1 | 3573 | fGeneratorNames[0] = ((AliGenEventHeader*)genHeaders->At(0))->GetName(); |
ca91a3e1 | 3574 | return; |
3575 | } | |
e5b6e8a6 | 3576 | |
ca91a3e1 | 3577 | Int_t firstindex = 0; |
e5b6e8a6 | 3578 | Int_t lastindex = -1; |
ca91a3e1 | 3579 | Int_t nummer = 0; |
3580 | for(Int_t i = 0; i<genHeaders->GetEntries();i++){ | |
3581 | gh = (AliGenEventHeader*)genHeaders->At(i); | |
3582 | TString GeneratorName = gh->GetName(); | |
3583 | lastindex = lastindex + gh->NProduced(); | |
3584 | for(Int_t j = 0; j<HeaderList->GetEntries();j++){ | |
3585 | TString GeneratorInList = ((TObjString*)HeaderList->At(j))->GetString(); | |
3586 | if(GeneratorName.CompareTo(GeneratorInList) == 0){ | |
3587 | fNotRejectedStart[nummer] = firstindex; | |
3588 | fNotRejectedEnd[nummer] = lastindex; | |
3589 | fGeneratorNames[nummer] = GeneratorName; | |
4803eb1f | 3590 | //cout << "Number of particles produced for: " << i << "\t" << GeneratorName.Data() << "\t" << lastindex-firstindex+1 << endl; |
ca91a3e1 | 3591 | nummer++; |
3592 | continue; | |
3593 | } | |
3594 | } | |
3595 | firstindex = firstindex + gh->NProduced(); | |
3596 | } | |
a280ac15 | 3597 | } else { // No Cocktail Header Found |
ca91a3e1 | 3598 | fNotRejectedStart = new Int_t[1]; |
3599 | fNotRejectedEnd = new Int_t[1]; | |
e5b6e8a6 | 3600 | |
3601 | fnHeaders = 1; | |
ca91a3e1 | 3602 | fNotRejectedStart[0] = 0; |
ae947965 | 3603 | fNotRejectedEnd[0] = static_cast<AliMCEvent*>(MCEvent)->Stack()->GetNprimary()-1; |
a280ac15 | 3604 | fGeneratorNames = new TString[1]; |
3605 | fGeneratorNames[0] = "NoCocktailGeneratorFound"; | |
11c1e680 | 3606 | |
ae947965 | 3607 | AliGenPythiaEventHeader *mcHeaderPythia = dynamic_cast<AliGenPythiaEventHeader*>(static_cast<AliMCEvent*>(MCEvent)->GenEventHeader()); |
a280ac15 | 3608 | if (mcHeaderPythia) fGeneratorNames[0] = "NoCocktailGeneratorFound_Pythia"; |
ae947965 | 3609 | AliGenDPMjetEventHeader *mcHeaderPhojet = dynamic_cast<AliGenDPMjetEventHeader*>(static_cast<AliMCEvent*>(MCEvent)->GenEventHeader()); |
a280ac15 | 3610 | if (mcHeaderPhojet) fGeneratorNames[0] = "NoCocktailGeneratorFound_Phojet"; |
ae947965 | 3611 | AliGenHijingEventHeader *mcHeaderHijing = dynamic_cast<AliGenHijingEventHeader*>(static_cast<AliMCEvent*>(MCEvent)->GenEventHeader()); |
a280ac15 | 3612 | if (mcHeaderHijing) fGeneratorNames[0] = "NoCocktailGeneratorFound_Hijing"; |
3613 | ||
e5b6e8a6 | 3614 | SetRejectExtraSignalsCut(0); |
ca91a3e1 | 3615 | } |
e5b6e8a6 | 3616 | |
ca91a3e1 | 3617 | } |
3618 | //_________________________________________________________________________ | |
ae947965 | 3619 | Int_t AliConversionCuts::IsParticleFromBGEvent(Int_t index, AliStack *MCStack, AliVEvent *InputEvent){ |
a280ac15 | 3620 | |
3621 | // Not Accepted == kFALSE == 0 | |
3622 | // Accepted == kTRUE == 1 | |
3623 | // FirstHeader == kTRUE == 3 | |
a280ac15 | 3624 | if(index < 0) return 0; // No Particle |
e5b6e8a6 | 3625 | |
a280ac15 | 3626 | Int_t accepted = 0; |
ae947965 | 3627 | if(!InputEvent || InputEvent->IsA()==AliESDEvent::Class()){ |
3628 | if( index >= MCStack->GetNprimary()){ // Secondary Particle | |
3629 | if( ((TParticle*)MCStack->Particle(index))->GetMother(0) < 0) return 1; // Secondary Particle without Mother?? | |
3630 | return IsParticleFromBGEvent(((TParticle*)MCStack->Particle(index))->GetMother(0),MCStack,InputEvent); | |
3631 | } | |
3632 | for(Int_t i = 0;i<fnHeaders;i++){ | |
3633 | if(index >= fNotRejectedStart[i] && index <= fNotRejectedEnd[i]){ | |
3634 | accepted = 1; | |
3635 | if(i == 0) accepted = 2; // MB Header | |
3636 | } | |
3637 | } | |
ca91a3e1 | 3638 | } |
ae947965 | 3639 | else if(InputEvent->IsA()==AliAODEvent::Class()){ |
3640 | TClonesArray *AODMCTrackArray = dynamic_cast<TClonesArray*>(InputEvent->FindListObject(AliAODMCParticle::StdBranchName())); | |
3641 | AliAODMCParticle *aodMCParticle = static_cast<AliAODMCParticle*>(AODMCTrackArray->At(index)); | |
4803eb1f | 3642 | if(!aodMCParticle) return 1; // Photon Without a Mother ? --> Accepted |
ae947965 | 3643 | if(!aodMCParticle->IsPrimary()){ |
3644 | if( aodMCParticle->GetMother() < 0) return 1;// Secondary Particle without Mother?? | |
3645 | return IsParticleFromBGEvent(aodMCParticle->GetMother(),MCStack,InputEvent); | |
3646 | } | |
3647 | index = abs(static_cast<AliAODMCParticle*>(AODMCTrackArray->At(index))->GetLabel()); | |
3648 | for(Int_t i = 0;i<fnHeaders;i++){ | |
3649 | if(index >= fNotRejectedStart[i] && index <= fNotRejectedEnd[i]){ | |
3650 | accepted = 1; | |
3651 | if(i == 0) accepted = 2; // MB Header | |
3652 | } | |
e5b6e8a6 | 3653 | } |
ca91a3e1 | 3654 | } |
e5b6e8a6 | 3655 | |
ca91a3e1 | 3656 | return accepted; |
3657 | } | |
e5b6e8a6 | 3658 | //_________________________________________________________________________ |
3659 | Int_t AliConversionCuts::IsEventAcceptedByConversionCut(AliConversionCuts *ReaderCuts, AliVEvent *InputEvent, AliMCEvent *MCEvent, Bool_t isHeavyIon){ | |
3660 | ||
1186afd2 | 3661 | if ( !IsTriggerSelected(InputEvent) ) |
ae947965 | 3662 | return 3; |
aff90284 | 3663 | |
e5b6e8a6 | 3664 | if(isHeavyIon && !(IsCentralitySelected(InputEvent,MCEvent))) |
3665 | return 1; // Check Centrality --> Not Accepted => eventQuality = 1 | |
a280ac15 | 3666 | |
e5b6e8a6 | 3667 | if(!isHeavyIon && GetIsFromPileup()){ |
3668 | if(InputEvent->IsPileupFromSPD(3,0.8,3.,2.,5.)){ | |
ccfa8c0d | 3669 | |
e5b6e8a6 | 3670 | return 6; // Check Pileup --> Not Accepted => eventQuality = 6 |
3671 | } | |
3672 | } | |
aff90284 | 3673 | |
e5b6e8a6 | 3674 | Bool_t hasV0And = ReaderCuts->HasV0AND(); |
3675 | Bool_t isSDDFired = ReaderCuts->IsSDDFired(); | |
3676 | if( (IsSpecialTrigger() == 2 || IsSpecialTrigger() == 3) && !isSDDFired && !MCEvent) | |
3677 | return 7; // With SDD requested but no fired | |
a280ac15 | 3678 | |
e5b6e8a6 | 3679 | if( (IsSpecialTrigger() == 1 || IsSpecialTrigger() == 3) && !hasV0And) |
3680 | return 8; // V0AND requested but no fired | |
aff90284 | 3681 | |
e5b6e8a6 | 3682 | |
3683 | return 0; | |
3684 | } | |
ccfa8c0d | 3685 | //_________________________________________________________________________ |
ae947965 | 3686 | Float_t AliConversionCuts::GetWeightForMeson(TString period, Int_t index, AliStack *MCStack, AliVEvent *InputEvent){ |
34a75862 | 3687 | if (!(period.CompareTo("LHC12f1a") == 0 || period.CompareTo("LHC12f1b") == 0 || period.CompareTo("LHC12i3") == 0 || period.CompareTo("LHC11a10a") == 0 || period.CompareTo("LHC11a10b") == 0 || period.CompareTo("LHC11a10b_bis") == 0 || period.CompareTo("LHC11a10a_bis") == 0 || period.CompareTo("LHC11a10b_plus") == 0 || period.Contains("LHC13d2"))) return 1.; |
aff90284 | 3688 | |
a280ac15 | 3689 | Int_t kCaseGen = 0; |
3690 | for (Int_t i = 0; i < fnHeaders; i++){ | |
3691 | if (index >= fNotRejectedStart[i] && index < fNotRejectedEnd[i]+1){ | |
a280ac15 | 3692 | if (fGeneratorNames[i].CompareTo("Pythia") == 0){ |
3693 | kCaseGen = 1; | |
3694 | } else if (fGeneratorNames[i].CompareTo("DPMJET") == 0){ | |
3695 | kCaseGen = 2; | |
aff90284 | 3696 | } else if (fGeneratorNames[i].CompareTo("HIJING") == 0 || |
3697 | fGeneratorNames[i].CompareTo("Hijing") == 0 || | |
ae947965 | 3698 | fGeneratorNames[i].Contains("hijing")){ |
a280ac15 | 3699 | kCaseGen = 3; |
3700 | } else if (fGeneratorNames[i].CompareTo("BOX") == 0){ | |
fcc79cf5 | 3701 | kCaseGen = 4; |
a280ac15 | 3702 | } else if (fGeneratorNames[i].CompareTo("PARAM") == 0){ |
3703 | kCaseGen = 5; | |
3704 | } else if (fGeneratorNames[i].CompareTo("NoCocktailGeneratorFound") == 0){ | |
3705 | kCaseGen = 6; | |
3706 | } else if (fGeneratorNames[i].CompareTo("NoCocktailGeneratorFound_Pythia") == 0){ | |
3707 | kCaseGen = 1; | |
3708 | } else if (fGeneratorNames[i].CompareTo("NoCocktailGeneratorFound_Phojet") == 0){ | |
3709 | kCaseGen = 2; | |
3710 | } else if (fGeneratorNames[i].CompareTo("NoCocktailGeneratorFound_Hijing") == 0){ | |
3711 | kCaseGen = 3; | |
11c1e680 | 3712 | } |
34a75862 | 3713 | if (period.Contains("LHC13d2")){ |
aff90284 | 3714 | kCaseGen = 3; |
fcc79cf5 | 3715 | } |
a280ac15 | 3716 | } |
3717 | } | |
ae947965 | 3718 | if (kCaseGen == 0) return 1; |
aff90284 | 3719 | |
11c1e680 | 3720 | |
ae947965 | 3721 | Double_t mesonPt = 0; |
3722 | Double_t mesonMass = 0; | |
3723 | Int_t PDGCode = 0; | |
3724 | if(!InputEvent || InputEvent->IsA()==AliESDEvent::Class()){ | |
3725 | mesonPt = ((TParticle*)MCStack->Particle(index))->Pt(); | |
3726 | mesonMass = ((TParticle*)MCStack->Particle(index))->GetCalcMass(); | |
3727 | PDGCode = ((TParticle*)MCStack->Particle(index))->GetPdgCode(); | |
3728 | } | |
3729 | else if(InputEvent->IsA()==AliAODEvent::Class()){ | |
3730 | TClonesArray *AODMCTrackArray = dynamic_cast<TClonesArray*>(InputEvent->FindListObject(AliAODMCParticle::StdBranchName())); | |
3731 | AliAODMCParticle *aodMCParticle = static_cast<AliAODMCParticle*>(AODMCTrackArray->At(index)); | |
3732 | mesonPt = aodMCParticle->Pt(); | |
3733 | mesonMass = aodMCParticle->GetCalcMass(); | |
3734 | PDGCode = aodMCParticle->GetPdgCode(); | |
aff90284 | 3735 | } |
ae947965 | 3736 | |
3737 | Float_t functionResultMC = 1.; | |
3738 | if (kCaseGen == 1){ // Pythia 6 | |
a280ac15 | 3739 | Float_t dNdyMC = 2.1462; |
3740 | Float_t nMC = 7.06055; | |
3741 | Float_t tMC = 0.12533; | |
ae947965 | 3742 | if ( PDGCode == 111){ |
a280ac15 | 3743 | dNdyMC = 2.1462; |
3744 | nMC = 7.06055; | |
3745 | tMC = 0.12533; | |
ae947965 | 3746 | } else if ( PDGCode == 221){ |
a280ac15 | 3747 | dNdyMC = 0.2357; |
3748 | nMC = 5.9105; | |
3749 | tMC = 0.1525; | |
3750 | } | |
ae947965 | 3751 | functionResultMC = dNdyMC / ( 2 * TMath::Pi())*(nMC-1.)*(nMC-2.) / (nMC*tMC*(nMC*tMC+mesonMass*(nMC-2.))) * TMath::Power(1.+(TMath::Sqrt(mesonPt*mesonPt+mesonMass*mesonMass)-mesonMass)/(nMC*tMC), -nMC); |
3752 | } else if (kCaseGen == 2){ // Phojet | |
a280ac15 | 3753 | Float_t dNdyMC = 2.35978; |
3754 | Float_t nMC = 6.81795; | |
3755 | Float_t tMC = 0.11492; | |
ae947965 | 3756 | if ( PDGCode == 111){ |
a280ac15 | 3757 | dNdyMC = 2.35978; |
3758 | nMC = 6.81795; | |
3759 | tMC = 0.11492; | |
ae947965 | 3760 | } else if ( PDGCode == 221){ |
a280ac15 | 3761 | dNdyMC = 0.3690; |
3762 | nMC = 5.55809; | |
3763 | tMC = 0.13387; | |
3764 | } | |
ae947965 | 3765 | functionResultMC = dNdyMC / ( 2 * TMath::Pi())*(nMC-1.)*(nMC-2.) / (nMC*tMC*(nMC*tMC+mesonMass*(nMC-2.))) * TMath::Power(1.+(TMath::Sqrt(mesonPt*mesonPt+mesonMass*mesonMass)-mesonMass)/(nMC*tMC), -nMC); |
3766 | } else if (kCaseGen == 4){ // BOX generators pp | |
3767 | // functionResultMC = 1./sqrt(1.-mesonMass*mesonMass/((mesonMass*mesonMass+mesonPt*mesonPt)*cosh(mesonY)*cosh(mesonY))); | |
a280ac15 | 3768 | Float_t a = 0.23437; |
3769 | Float_t b = 5.6661; | |
3770 | Float_t c = -1430.5863; | |
3771 | Float_t d = -0.6966624; | |
3772 | Float_t e = 252.3742; | |
ae947965 | 3773 | if ( PDGCode == 111){ |
a280ac15 | 3774 | a = 0.23437; |
3775 | b = 5.6661; | |
3776 | c = -1430.5863; | |
3777 | d = -0.6966624; | |
3778 | e = 252.3742; | |
ae947965 | 3779 | } else if ( PDGCode == 221){ |
a280ac15 | 3780 | a = 0.10399; |
3781 | b = 4.35311; | |
3782 | c = -12.17723; | |
3783 | d = -0.01172; | |
3784 | e =1.85140; | |
3785 | } | |
ae947965 | 3786 | functionResultMC = a*TMath::Power(mesonPt,-1.*(b+c/(TMath::Power(mesonPt,d)+e)))*1./mesonPt *1./1.6 *1./(2.* TMath::Pi()); |
4803eb1f | 3787 | // cout << functionResultMC << endl; |
ae947965 | 3788 | } else if (kCaseGen == 3 ){ // HIJING |
3789 | if ( PDGCode == 111 && fDoReweightHistoMCPi0 && hReweightMCHistPi0!= 0x0){ | |
3790 | functionResultMC = hReweightMCHistPi0->Interpolate(mesonPt); | |
fcc79cf5 | 3791 | } |
3792 | if ( PDGCode == 221 && fDoReweightHistoMCEta && hReweightMCHistEta!= 0x0){ | |
3793 | functionResultMC = hReweightMCHistEta->Interpolate(mesonPt); | |
3794 | } | |
ae947965 | 3795 | if ( PDGCode == 310 && fDoReweightHistoMCK0s && hReweightMCHistK0s!= 0x0){ |
3796 | functionResultMC = hReweightMCHistK0s->Interpolate(mesonPt); | |
3797 | } | |
a280ac15 | 3798 | } |
11c1e680 | 3799 | |
ae947965 | 3800 | Float_t functionResultData = 1; |
3801 | if (kCaseGen == 1 || kCaseGen == 2 || kCaseGen == 4 ){ | |
3802 | Float_t dNdyData = 2.2328; | |
3803 | Float_t nData = 7.1473; | |
3804 | Float_t tData = 0.1346; | |
3805 | if ( PDGCode == 111){ | |
a280ac15 | 3806 | dNdyData = 2.2328; |
3807 | nData = 7.1473; | |
3808 | tData = 0.1346; | |
ae947965 | 3809 | } else if ( PDGCode == 221){ |
a280ac15 | 3810 | dNdyData = 0.38992; //be careful this fit is not optimal, eta in data still has problems |
3811 | nData = 5.72778; | |
3812 | tData = 0.13835; | |
3813 | } | |
ae947965 | 3814 | functionResultData = dNdyData / ( 2 * TMath::Pi())*(nData-1.)*(nData-2.) / (nData*tData*(nData*tData+mesonMass*(nData-2.))) * TMath::Power(1.+(TMath::Sqrt(mesonPt*mesonPt+mesonMass*mesonMass)-mesonMass)/(nData*tData), -nData); |
4803eb1f | 3815 | // cout << functionResultData << endl; |
ae947965 | 3816 | } else { |
fcc79cf5 | 3817 | if ( PDGCode == 111 && fDoReweightHistoMCPi0 && fFitDataPi0!= 0x0){ |
3818 | functionResultData = fFitDataPi0->Eval(mesonPt); | |
3819 | } | |
3820 | if ( PDGCode == 221 && fDoReweightHistoMCEta && fFitDataEta!= 0x0){ | |
3821 | functionResultData = fFitDataEta->Eval(mesonPt); | |
3822 | } | |
3823 | if ( PDGCode == 310 && fDoReweightHistoMCK0s && fFitDataK0s!= 0x0){ | |
3824 | functionResultData = fFitDataK0s->Eval(mesonPt); | |
3825 | } | |
aff90284 | 3826 | |
fcc79cf5 | 3827 | // Float_t a = 0.; |
3828 | // Float_t b = 0.; | |
3829 | // Float_t c = 0.; | |
3830 | // Float_t d = 0.; | |
3831 | // Float_t e = 0.; | |
3832 | // if ( PDGCode == 111 ){ | |
3833 | // if (fModCentralityClass == 1 && fCentralityMin == 0 && fCentralityMax == 1 ){ // 0-5 % PbPb | |
3834 | // a = 25.8747458223; | |
3835 | // b = 5.8761820045; | |
3836 | // c = -33.9928191673; | |
3837 | // d = 3.0731850142; | |
3838 | // e = 13.2500447620; | |
3839 | // } else if (fModCentralityClass == 1 && fCentralityMin == 1 && fCentralityMax == 2){ // 5-10% PbPb | |
3840 | // a = 21.7518148922; | |
3841 | // b = 5.8441200081; | |
3842 | // c = -17.1497051691; | |
3843 | // d = 2.3799090842; | |
3844 | // e = 5.4346404718; | |
3845 | // } else if (fModCentralityClass == 0 && fCentralityMin == 0 && fCentralityMax == 1){ // 0-10% PbPb | |
3846 | // a = 22.9852133622; | |
3847 | // b = 5.8602063916; | |
3848 | // c = -17.0992478654; | |
3849 | // d = 2.4426218039; | |
3850 | // e = 5.1194526345; | |
3851 | // } else if (fModCentralityClass == 0 && fCentralityMin == 1 && fCentralityMax == 2){ // 10-20% PbPb | |
3852 | // a = 19.3237333776; | |
3853 | // b = 5.8145906958; | |
3854 | // c = -13.8316665424; | |
3855 | // d = 2.3737630637; | |
3856 | // e = 4.7690300693; | |
3857 | // } else if (fModCentralityClass == 0 && fCentralityMin == 2 && fCentralityMax == 4){ // 20-40% PbPb | |
3858 | // a = 11.2656032751; | |
3859 | // b = 5.8003194354; | |
3860 | // c = -13.3936105929; | |
3861 | // d = 2.3371452334; | |
3862 | // e = 4.4726244958; | |
aff90284 | 3863 | // } else if (fModCentralityClass == 0 && fCentralityMin == 4 && fCentralityMax == 6){ // 40-60% PbPb |
fcc79cf5 | 3864 | // a = 4.1578154081; |
3865 | // b = 5.6450005163; | |
3866 | // c = -8.4309375240; | |
3867 | // d = 1.8918308704; | |
3868 | // e = 2.9429194709; | |
aff90284 | 3869 | // } else if (fModCentralityClass == 0 && fCentralityMin == 6 && fCentralityMax == 8){ // 60-80% PbPb |
fcc79cf5 | 3870 | // a = 1.0635443810; |
3871 | // b = 5.1337469970; | |
3872 | // c = -8.5906997238; | |
3873 | // d = 2.9794995997; | |
3874 | // e = 3.9294980048; | |
aff90284 | 3875 | // } else if (fModCentralityClass == 0 && fCentralityMin == 0 && fCentralityMax == 2){ // 0-20% PbPb |
fcc79cf5 | 3876 | // a = 21.7018745556; |
3877 | // b = 5.9019352094; | |
3878 | // c = -14.2295510326; | |
3879 | // d = 2.2104490688; | |
3880 | // e = 4.2969671500; | |
aff90284 | 3881 | // } else if (fModCentralityClass == 0 && fCentralityMin == 0 && fCentralityMax == 4){ // 0-40% PbPb |
fcc79cf5 | 3882 | // a = 16.8227412106; |
3883 | // b = 5.8660502207; | |
3884 | // c = -12.0978551215; | |
3885 | // d = 2.1695068981; | |
3886 | // e = 3.5349621182; | |
aff90284 | 3887 | // } else if (fModCentralityClass == 0 && fCentralityMin == 0 && fCentralityMax == 8){ // 0-80% PbPb |
fcc79cf5 | 3888 | // a = 9.4675681080; |
3889 | // b = 5.8114944205; | |
3890 | // c = -10.4901523616; | |
3891 | // d = 2.0607982712; | |
3892 | // e = 2.9262259130; | |
aff90284 | 3893 | // } else if (fModCentralityClass == 0 && fCentralityMin == 4 && fCentralityMax == 8){ // 60-80% PbPb |
fcc79cf5 | 3894 | // a = 2.5985551785; |
3895 | // b = 5.4118895738; | |
3896 | // c = -8.2510958428; | |
3897 | // d = 2.2551249190; | |
3898 | // e = 3.0700919491; | |
3899 | // } | |
aff90284 | 3900 | // |
fcc79cf5 | 3901 | // functionResultData = a*TMath::Power(mesonPt,-1*(b+c/(TMath::Power(mesonPt,d)+e))); |
aff90284 | 3902 | // } |
3903 | ||
ae947965 | 3904 | } |
aff90284 | 3905 | |
ae947965 | 3906 | Double_t weight = 1; |
3907 | if (PDGCode == 111 || PDGCode == 221){ | |
3908 | if (functionResultData != 0. && functionResultMC != 0. && isfinite(functionResultData) && isfinite(functionResultMC)){ | |
3909 | weight = functionResultData/functionResultMC; | |
4803eb1f | 3910 | if ( kCaseGen == 3){ |
3911 | if (!(fDoReweightHistoMCPi0 && hReweightMCHistPi0!= 0x0 && PDGCode == 111)){ | |
aff90284 | 3912 | weight = 1.; |
4803eb1f | 3913 | } |
ae947965 | 3914 | } |
aff90284 | 3915 | if (!isfinite(functionResultData)) weight = 1.; |
3916 | if (!isfinite(weight)) weight = 1.; | |
ae947965 | 3917 | } |
3918 | } else if (PDGCode == 310 && functionResultMC != 0 && isfinite(functionResultMC)){ | |
3919 | weight = functionResultMC; | |
3920 | } | |
aff90284 | 3921 | |
ae947965 | 3922 | // if (fModCentralityClass == 0 && fCentralityMin == 4 && fCentralityMax == 6 && PDGCode == 111){ |
4803eb1f | 3923 | // cout << period.Data() << "\t" << kCaseGen << "\t" <<fModCentralityClass<< "\t" <<fCentralityMin<< "\t" <<fCentralityMax << "\t" << mesonPt << "\t" <<mesonMass<< "\t"<<functionResultData << "\t"<< functionResultMC << "\t" << weight <<endl; |
ae947965 | 3924 | // } |
3925 | return weight; | |
a280ac15 | 3926 | } |
a280ac15 | 3927 | ///________________________________________________________________________ |
3928 | AliConversionCuts* AliConversionCuts::GetStandardCuts2010PbPb(){ | |
3929 | //Create and return standard 2010 PbPb cuts | |
3930 | AliConversionCuts *cuts=new AliConversionCuts("StandardCuts2010PbPb","StandardCuts2010PbPb"); | |
430b9c94 | 3931 | if(!cuts->InitializeCutsFromCutString("100000204209297002322000000")){ |
fcc79cf5 | 3932 | cout<<"Warning: Initialization of Standardcuts2010PbPb failed"<<endl;} |
a280ac15 | 3933 | return cuts; |
3934 | } | |
3935 | ||
3936 | ///________________________________________________________________________ | |
3937 | AliConversionCuts* AliConversionCuts::GetStandardCuts2010pp(){ | |
3938 | //Create and return standard 2010 PbPb cuts | |
3939 | AliConversionCuts *cuts=new AliConversionCuts("StandardCuts2010pp","StandardCuts2010pp"); | |
430b9c94 | 3940 | if(!cuts->InitializeCutsFromCutString("000001100209366300380000000")){ |
fcc79cf5 | 3941 | cout<<"Warning: Initialization of Standardcuts2010pp failed"<<endl;} |
a280ac15 | 3942 | return cuts; |
3943 | } | |
ccfa8c0d | 3944 | ///________________________________________________________________________ |
3945 | void AliConversionCuts::GetCorrectEtaShiftFromPeriod(TString periodName){ | |
3946 | ||
3947 | if(periodName.CompareTo("LHC12g") == 0 || //pilot run 2012 | |
3948 | periodName.CompareTo("LHC13b") == 0 || //mainly minimum bias | |
3949 | periodName.CompareTo("LHC13c") == 0 || //mainly minimum bias | |
3950 | periodName.CompareTo("LHC13d") == 0 || //mainly triggered | |
3951 | periodName.CompareTo("LHC13e") == 0 || //mainly triggered | |
3952 | periodName.CompareTo("LHC13c3") == 0 || //MC Starlight, anchor LHC13d+e | |
3953 | periodName.CompareTo("LHC13c2") == 0 || //MC Starlight, coherent J/Psi, UPC muon anchor LHC13d+e | |
3954 | periodName.CompareTo("LHC13b4") == 0 || //MC Pythia 6 (Jet-Jet), anchor LHC13b | |
3955 | periodName.CompareTo("LHC13b2_fix_1") == 0 || //MC DPMJET, anchr LHC13b+c | |
3956 | periodName.CompareTo("LHC13b3") == 0 || //MC HIJING, weighted to number of events per run, anchor LHC13b | |
3957 | periodName.CompareTo("LHC13b2") == 0 || // MC DPMJET, wrong energy, anchor LHC13b | |
3958 | periodName.CompareTo("LHC13b2_plus") == 0 || // MC DPMJET, weighted to number event per run, anchor LHC13b | |
3959 | periodName.CompareTo("LHC13c1_bis") == 0 || // MC AMPT fast generation, pT hardbin, anchor ? | |
3960 | periodName.CompareTo("LHC13c1") == 0 || // MC AMPT fast generation, anchor ? | |
3961 | periodName.CompareTo("LHC13b1") == 0 || // MC DPMJET, fragments, with fixed label 0, anchor LHC12g | |
3962 | periodName.CompareTo("LHC12g4b_fix") == 0 || // MC DPMJET, with fixed label 0, anchor LHC12g | |
3963 | periodName.CompareTo("LHC12g1_fix") == 0 || // MC ?, with fixed label 0, anchor LHC12g | |
3964 | periodName.CompareTo("LHC12g4c") == 0 || // MC DPMJET, shifted vertex runs, anchor LHC12g | |
3965 | periodName.CompareTo("LHC12h6") == 0 || // MC muon cocktail, anchor LHC12g | |
3966 | periodName.CompareTo("LHC12g4b") == 0 || // MC DPMJET 3rd iteration, anchor LHC12g | |
3967 | periodName.CompareTo("LHC12g4a") == 0 || // MC DPMJET improved, anchor LHC12g | |
3968 | periodName.CompareTo("LHC12g4") == 0 || // MC DPMJET, anchor LHC12g | |
3969 | periodName.CompareTo("LHC12g5") == 0 || // MC PHOJET, anchor LHC12g | |
3970 | periodName.CompareTo("LHC12g2") == 0 || // MC Starlight background, anchor LHC12g | |
3971 | periodName.CompareTo("LHC12g1") == 0 ) // MC ?, anchor LHC12g | |
3972 | { | |
3973 | printf(" Gamma Conversion Cuts %s :: pPb Run doing Eta Shift of %f \n\n",(GetCutNumber()).Data(),-0.465); | |
3974 | SetEtaShift(-0.465); | |
3975 | } | |
3976 | else if(periodName.CompareTo("LHC13f") == 0 || | |
3977 | periodName.CompareTo("LHC13c6b") == 0 ||// MC Jpsi -> mumu, anchor LHC13f | |
3978 | periodName.CompareTo("LHC13c5") == 0 || //MC Starlight, gamma gamma UPC muon, anchor LHC13f | |
3979 | periodName.CompareTo("LHC13c4") == 0 )//MC Starlight, coherent JPsi, UPC muon, anchor LHC13f | |
3980 | { | |
3981 | printf(" Gamma Conversion Cuts %s :: Pbp Run doing Eta Shift of %f \n\n",(GetCutNumber()).Data(),0.465); | |
3982 | SetEtaShift(+0.465); | |
3983 | } | |
3984 | else printf(" Gamma Conversion Cuts %s :: Automatic Eta Shift requested but Period is not known -> No Shift \n\n",(GetCutNumber()).Data()); | |
3985 | } |