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