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