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