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