]>
Commit | Line | Data |
---|---|---|
3b77b2d1 | 1 | /************************************************************************** |
2 | * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * | |
92efd725 | 3 | * * |
4 | * Authors: Svein Lindal, Daniel Lohner * | |
5 | * Version 1.0 * | |
6 | * * | |
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 * | |
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" | |
35 | #include "AliStack.h" | |
36 | #include "AliAODConversionMother.h" | |
37 | #include "TObjString.h" | |
38 | #include "AliAODEvent.h" | |
39 | #include "AliESDEvent.h" | |
40 | #include "AliCentrality.h" | |
41 | #include "TList.h" | |
92efd725 | 42 | #include "AliLog.h" |
ca91a3e1 | 43 | #include "AliGenCocktailEventHeader.h" |
e5b6e8a6 | 44 | #include "AliTriggerAnalysis.h" |
45 | #include "AliV0ReaderV1.h" | |
92efd725 | 46 | |
3b77b2d1 | 47 | class iostream; |
48 | ||
49 | using namespace std; | |
50 | ||
51 | ClassImp(AliConversionCuts) | |
52 | ||
53 | ||
54 | const char* AliConversionCuts::fgkCutNames[AliConversionCuts::kNCuts] = { | |
4a0aab28 | 55 | "HeavyIon", |
56 | "CentralityMin", | |
57 | "CentralityMax", | |
58 | "SelectV0AND", | |
59 | "MultiplicityMethod", | |
60 | "RemovePileUp", | |
61 | "RejectExtraSignals", | |
62 | "V0FinderType", | |
63 | "EtaCut", | |
64 | "MinRCut", | |
65 | "SinglePtCut", | |
66 | "ClsTPCCut", | |
67 | "ededxSigmaCut", | |
68 | "pidedxSigmaCut", | |
69 | "piMomdedxSigmaCut", | |
70 | "piMaxMomdedxSigmaCut", | |
71 | "LowPRejectionSigmaCut", | |
72 | "TOFelectronPID", | |
73 | "QtMaxCut", | |
74 | "Chi2GammaCut", | |
75 | "PsiPair", | |
76 | "DoPhotonAsymmetryCut", | |
77 | "CosinePointingAngle", | |
78 | "SharedElectronCuts", | |
e5b6e8a6 | 79 | "RejectToCloseV0s" |
3b77b2d1 | 80 | }; |
81 | ||
82 | ||
83 | //________________________________________________________________________ | |
4a0aab28 | 84 | AliConversionCuts::AliConversionCuts(const char *name,const char *title) : |
85 | AliAnalysisCuts(name,title), | |
86 | fHistograms(NULL), | |
e5b6e8a6 | 87 | fHeaderList(NULL), |
4a0aab28 | 88 | fPIDResponse(NULL), |
89 | fEventQuality(-1), | |
90 | fMaxR(200), | |
91 | fMinR(0), | |
92 | fEtaCut(0.9), | |
93 | fEtaCutMin(-0.1), | |
94 | fPtCut(0.02), | |
95 | fSinglePtCut(0), | |
96 | fMaxZ(1000), | |
97 | fMinClsTPC(0.), | |
98 | fMinClsTPCToF(0.), | |
99 | fLineCutZRSlope(0.), | |
100 | fLineCutZValue(0), | |
101 | fLineCutZRSlopeMin(0.), | |
102 | fLineCutZValueMin(0), | |
103 | fChi2CutConversion(1000), | |
104 | fPIDProbabilityCutNegativeParticle(0), | |
105 | fPIDProbabilityCutPositiveParticle(0), | |
106 | fDodEdxSigmaCut(kTRUE), | |
e5b6e8a6 | 107 | fDoTOFsigmaCut(kFALSE), |
4a0aab28 | 108 | fPIDTRDEfficiency(1), |
109 | fDoTRDPID(kFALSE), | |
110 | fPIDnSigmaAboveElectronLine(100), | |
111 | fPIDnSigmaBelowElectronLine(-100), | |
e5b6e8a6 | 112 | fTofPIDnSigmaAboveElectronLine(100), |
113 | fTofPIDnSigmaBelowElectronLine(-100), | |
4a0aab28 | 114 | fPIDnSigmaAbovePionLine(0), |
115 | fPIDnSigmaAbovePionLineHighPt(-100), | |
116 | fPIDMinPnSigmaAbovePionLine(0), | |
117 | fPIDMaxPnSigmaAbovePionLine(0), | |
118 | fDoKaonRejectionLowP(kFALSE), | |
119 | fDoProtonRejectionLowP(kFALSE), | |
120 | fDoPionRejectionLowP(kFALSE), | |
121 | fPIDnSigmaAtLowPAroundKaonLine(0), | |
122 | fPIDnSigmaAtLowPAroundProtonLine(0), | |
123 | fPIDnSigmaAtLowPAroundPionLine(0), | |
e5b6e8a6 | 124 | fPIDMinPKaonRejectionLowP(1.5), |
125 | fPIDMinPProtonRejectionLowP(2), | |
4a0aab28 | 126 | fPIDMinPPionRejectionLowP(0), |
127 | fDoQtGammaSelection(kTRUE), | |
e5b6e8a6 | 128 | fDoHighPtQtGammaSelection(kFALSE), |
4a0aab28 | 129 | fQtMax(100), |
e5b6e8a6 | 130 | fHighPtQtMax(0.), |
131 | fPtBorderForQt(0), | |
4a0aab28 | 132 | fXVertexCut(0.), |
133 | fYVertexCut(0.), | |
134 | fZVertexCut(0.), | |
135 | fNSigmaMass(0.), | |
136 | fUseEtaMinCut(kFALSE), | |
137 | fUseOnFlyV0Finder(kTRUE), | |
138 | fDoPhotonAsymmetryCut(kTRUE), | |
139 | fMinPPhotonAsymmetryCut(100.), | |
140 | fMinPhotonAsymmetry(0.), | |
141 | fIsHeavyIon(kFALSE), | |
142 | fDetectorCentrality(0), | |
143 | fModCentralityClass(0), | |
144 | fMaxVertexZ(10), | |
145 | fCentralityMin(0), | |
146 | fCentralityMax(0), | |
147 | fUseCorrectedTPCClsInfo(kFALSE), | |
148 | fUseTOFpid(kFALSE), | |
149 | fMultiplicityMethod(0), | |
e5b6e8a6 | 150 | fSpecialTrigger(0), |
4a0aab28 | 151 | fRemovePileUp(kFALSE), |
152 | fOpeningAngle(0.005), | |
153 | fPsiPairCut(10000), | |
154 | fCosPAngleCut(10000), | |
155 | fDoToCloseV0sCut(kFALSE), | |
156 | fRejectExtraSignals(0), | |
157 | fminV0Dist(200.), | |
158 | fDoSharedElecCut(kFALSE), | |
159 | fOfflineTriggerMask(0), | |
e5b6e8a6 | 160 | fHasV0AND(kTRUE), |
161 | fIsSDDFired(kTRUE), | |
4a0aab28 | 162 | fRandom(0), |
e5b6e8a6 | 163 | fElectronArraySize(500), |
4a0aab28 | 164 | fElectronLabelArray(NULL), |
e5b6e8a6 | 165 | fConversionPointXArray(0.0), |
166 | fConversionPointYArray(0.0), | |
167 | fConversionPointZArray(0.0), | |
168 | fnHeaders(0), | |
4a0aab28 | 169 | fNotRejectedStart(NULL), |
170 | fNotRejectedEnd(NULL), | |
171 | fGeneratorNames(NULL), | |
172 | fCutString(NULL), | |
173 | hdEdxCuts(NULL), | |
174 | hTPCdEdxbefore(NULL), | |
175 | hTPCdEdxafter(NULL), | |
e5b6e8a6 | 176 | hTPCdEdxSigbefore(NULL), |
177 | hTPCdEdxSigafter(NULL), | |
4a0aab28 | 178 | hTOFbefore(NULL), |
e5b6e8a6 | 179 | hTOFSigbefore(NULL), |
180 | hTOFSigafter(NULL), | |
4a0aab28 | 181 | hTrackCuts(NULL), |
182 | hPhotonCuts(NULL), | |
183 | hInvMassbefore(NULL), | |
184 | hArmenterosbefore(NULL), | |
185 | hInvMassafter(NULL), | |
186 | hArmenterosafter(NULL), | |
187 | hAcceptanceCuts(NULL), | |
188 | hCutIndex(NULL), | |
189 | hV0EventCuts(NULL), | |
190 | hCentrality(NULL), | |
191 | hVertexZ(NULL), | |
192 | hTriggerClass(NULL) | |
3b77b2d1 | 193 | { |
4a0aab28 | 194 | InitPIDResponse(); |
195 | for(Int_t jj=0;jj<kNCuts;jj++){fCuts[jj]=0;} | |
196 | fCutString=new TObjString((GetCutNumber()).Data()); | |
3b77b2d1 | 197 | |
e5b6e8a6 | 198 | fElectronLabelArray = new Int_t[fElectronArraySize]; |
ca91a3e1 | 199 | |
3b77b2d1 | 200 | } |
201 | ||
1d9e6011 | 202 | //________________________________________________________________________ |
203 | AliConversionCuts::AliConversionCuts(const AliConversionCuts &ref) : | |
204 | AliAnalysisCuts(ref), | |
205 | fHistograms(NULL), | |
206 | fHeaderList(ref.fHeaderList), | |
207 | fPIDResponse(NULL), | |
208 | fEventQuality(ref.fEventQuality), | |
209 | fMaxR(ref.fMaxR), | |
210 | fMinR(ref.fMinR), | |
211 | fEtaCut(ref.fEtaCut), | |
212 | fEtaCutMin(ref.fEtaCutMin), | |
213 | fPtCut(ref.fPtCut), | |
214 | fSinglePtCut(ref.fSinglePtCut), | |
215 | fMaxZ(ref.fMaxZ), | |
216 | fMinClsTPC(ref.fMinClsTPC), | |
217 | fMinClsTPCToF(ref.fMinClsTPCToF), | |
218 | fLineCutZRSlope(ref.fLineCutZRSlope), | |
219 | fLineCutZValue(ref.fLineCutZValue), | |
220 | fLineCutZRSlopeMin(ref.fLineCutZRSlopeMin), | |
221 | fLineCutZValueMin(ref.fLineCutZValueMin), | |
222 | fChi2CutConversion(ref.fChi2CutConversion), | |
223 | fPIDProbabilityCutNegativeParticle(ref.fPIDProbabilityCutNegativeParticle), | |
224 | fPIDProbabilityCutPositiveParticle(ref.fPIDProbabilityCutPositiveParticle), | |
225 | fDodEdxSigmaCut(ref. fDodEdxSigmaCut), | |
226 | fDoTOFsigmaCut(ref.fDoTOFsigmaCut), | |
227 | fPIDTRDEfficiency(ref.fPIDTRDEfficiency), | |
228 | fDoTRDPID(ref.fDoTRDPID), | |
229 | fPIDnSigmaAboveElectronLine(ref.fPIDnSigmaAboveElectronLine), | |
230 | fPIDnSigmaBelowElectronLine(ref.fPIDnSigmaBelowElectronLine), | |
231 | fTofPIDnSigmaAboveElectronLine(ref.fTofPIDnSigmaAboveElectronLine), | |
232 | fTofPIDnSigmaBelowElectronLine(ref.fTofPIDnSigmaBelowElectronLine), | |
233 | fPIDnSigmaAbovePionLine(ref.fPIDnSigmaAbovePionLine), | |
234 | fPIDnSigmaAbovePionLineHighPt(ref.fPIDnSigmaAbovePionLineHighPt), | |
235 | fPIDMinPnSigmaAbovePionLine(ref.fPIDMinPnSigmaAbovePionLine), | |
236 | fPIDMaxPnSigmaAbovePionLine(ref.fPIDMaxPnSigmaAbovePionLine), | |
237 | fDoKaonRejectionLowP(ref.fDoKaonRejectionLowP), | |
238 | fDoProtonRejectionLowP(ref.fDoProtonRejectionLowP), | |
239 | fDoPionRejectionLowP(ref.fDoPionRejectionLowP), | |
240 | fPIDnSigmaAtLowPAroundKaonLine(ref.fPIDnSigmaAtLowPAroundKaonLine), | |
241 | fPIDnSigmaAtLowPAroundProtonLine(ref.fPIDnSigmaAtLowPAroundProtonLine), | |
242 | fPIDnSigmaAtLowPAroundPionLine(ref.fPIDnSigmaAtLowPAroundPionLine), | |
243 | fPIDMinPKaonRejectionLowP(ref.fPIDMinPKaonRejectionLowP), | |
244 | fPIDMinPProtonRejectionLowP(ref.fPIDMinPProtonRejectionLowP), | |
245 | fPIDMinPPionRejectionLowP(ref.fPIDMinPPionRejectionLowP), | |
246 | fDoQtGammaSelection(ref.fDoQtGammaSelection), | |
247 | fDoHighPtQtGammaSelection(ref.fDoHighPtQtGammaSelection), | |
248 | fQtMax(ref.fQtMax), | |
249 | fHighPtQtMax(ref.fHighPtQtMax), | |
250 | fPtBorderForQt(ref.fPtBorderForQt), | |
251 | fXVertexCut(ref.fXVertexCut), | |
252 | fYVertexCut(ref.fYVertexCut), | |
253 | fZVertexCut(ref.fZVertexCut), | |
254 | fNSigmaMass(ref.fNSigmaMass), | |
255 | fUseEtaMinCut(ref.fUseEtaMinCut), | |
256 | fUseOnFlyV0Finder(ref.fUseOnFlyV0Finder), | |
257 | fDoPhotonAsymmetryCut(fDoPhotonAsymmetryCut), | |
258 | fMinPPhotonAsymmetryCut(ref.fMinPPhotonAsymmetryCut), | |
259 | fMinPhotonAsymmetry(ref.fMinPhotonAsymmetry), | |
260 | fIsHeavyIon(ref.fIsHeavyIon), | |
261 | fDetectorCentrality(ref.fDetectorCentrality), | |
262 | fModCentralityClass(ref.fModCentralityClass), | |
263 | fMaxVertexZ(ref.fMaxVertexZ), | |
264 | fCentralityMin(ref.fCentralityMin), | |
265 | fCentralityMax(ref.fCentralityMax), | |
266 | fUseCorrectedTPCClsInfo(ref.fUseCorrectedTPCClsInfo), | |
267 | fUseTOFpid(ref.fUseTOFpid), | |
268 | fMultiplicityMethod(ref.fMultiplicityMethod), | |
269 | fSpecialTrigger(ref.fSpecialTrigger), | |
270 | fRemovePileUp(ref.fRemovePileUp), | |
271 | fOpeningAngle(ref.fOpeningAngle), | |
272 | fPsiPairCut(ref.fPsiPairCut), | |
273 | fCosPAngleCut(ref.fCosPAngleCut), | |
274 | fDoToCloseV0sCut(ref.fDoToCloseV0sCut), | |
275 | fRejectExtraSignals(ref.fRejectExtraSignals), | |
276 | fminV0Dist(ref.fminV0Dist), | |
277 | fDoSharedElecCut(ref.fDoSharedElecCut), | |
278 | fOfflineTriggerMask(ref.fOfflineTriggerMask), | |
279 | fHasV0AND(ref.fHasV0AND), | |
280 | fIsSDDFired(ref.fIsSDDFired), | |
281 | fRandom(ref.fRandom), | |
282 | fElectronArraySize(ref.fElectronArraySize), | |
283 | fElectronLabelArray(NULL), | |
284 | fConversionPointXArray(ref.fConversionPointXArray), | |
285 | fConversionPointYArray(ref.fConversionPointYArray), | |
286 | fConversionPointZArray(ref.fConversionPointZArray), | |
287 | fnHeaders(ref.fnHeaders), | |
288 | fNotRejectedStart(NULL), | |
289 | fNotRejectedEnd(NULL), | |
290 | fGeneratorNames(ref.fGeneratorNames), | |
291 | fCutString(NULL), | |
292 | hdEdxCuts(NULL), | |
293 | hTPCdEdxbefore(NULL), | |
294 | hTPCdEdxafter(NULL), | |
295 | hTPCdEdxSigbefore(NULL), | |
296 | hTPCdEdxSigafter(NULL), | |
297 | hTOFbefore(NULL), | |
298 | hTOFSigbefore(NULL), | |
299 | hTOFSigafter(NULL), | |
300 | hTrackCuts(NULL), | |
301 | hPhotonCuts(NULL), | |
302 | hInvMassbefore(NULL), | |
303 | hArmenterosbefore(NULL), | |
304 | hInvMassafter(NULL), | |
305 | hArmenterosafter(NULL), | |
306 | hAcceptanceCuts(NULL), | |
307 | hCutIndex(NULL), | |
308 | hV0EventCuts(NULL), | |
309 | hCentrality(NULL), | |
310 | hVertexZ(NULL), | |
311 | hTriggerClass(NULL) | |
312 | { | |
313 | // Copy Constructor | |
314 | for(Int_t jj=0;jj<kNCuts;jj++){fCuts[jj]=ref.fCuts[jj];} | |
315 | fCutString=new TObjString((GetCutNumber()).Data()); | |
316 | fElectronLabelArray = new Int_t[fElectronArraySize]; | |
317 | // dont copy histograms (if you like histograms, call InitCutHistograms()) | |
318 | } | |
319 | ||
3b77b2d1 | 320 | //________________________________________________________________________ |
321 | AliConversionCuts::~AliConversionCuts() { | |
4a0aab28 | 322 | // Destructor |
323 | //Deleting fHistograms leads to seg fault it it's added to output collection of a task | |
324 | // if(fHistograms) | |
325 | // delete fHistograms; | |
326 | // fHistograms = NULL; | |
92efd725 | 327 | if(fCutString != NULL){ |
328 | delete fCutString; | |
329 | fCutString = NULL; | |
330 | } | |
92efd725 | 331 | if(fElectronLabelArray){ |
332 | delete fElectronLabelArray; | |
333 | fElectronLabelArray = NULL; | |
334 | } | |
ca91a3e1 | 335 | if(fNotRejectedStart){ |
336 | delete[] fNotRejectedStart; | |
337 | fNotRejectedStart = NULL; | |
338 | } | |
339 | if(fNotRejectedEnd){ | |
340 | delete[] fNotRejectedEnd; | |
341 | fNotRejectedEnd = NULL; | |
342 | } | |
343 | if(fGeneratorNames){ | |
344 | delete[] fGeneratorNames; | |
345 | fGeneratorNames = NULL; | |
346 | } | |
3b77b2d1 | 347 | } |
348 | ||
349 | //________________________________________________________________________ | |
92efd725 | 350 | void AliConversionCuts::InitCutHistograms(TString name, Bool_t preCut){ |
3b77b2d1 | 351 | |
4a0aab28 | 352 | // Initialize Cut Histograms for QA (only initialized and filled if function is called) |
353 | ||
354 | if(fHistograms != NULL){ | |
355 | delete fHistograms; | |
356 | fHistograms=NULL; | |
357 | } | |
358 | if(fHistograms==NULL){ | |
359 | fHistograms=new TList(); | |
360 | if(name=="")fHistograms->SetName(Form("ConvCuts_%s",GetCutNumber().Data())); | |
361 | else fHistograms->SetName(Form("%s_%s",name.Data(),GetCutNumber().Data())); | |
362 | } | |
363 | ||
364 | // IsPhotonSelected | |
365 | hCutIndex=new TH1F(Form("IsPhotonSelected %s",GetCutNumber().Data()),"IsPhotonSelected",10,-0.5,9.5); | |
366 | hCutIndex->GetXaxis()->SetBinLabel(kPhotonIn+1,"in"); | |
367 | hCutIndex->GetXaxis()->SetBinLabel(kOnFly+1,"onfly"); | |
368 | hCutIndex->GetXaxis()->SetBinLabel(kNoTracks+1,"no tracks"); | |
369 | hCutIndex->GetXaxis()->SetBinLabel(kdEdxCuts+1,"dEdx"); | |
370 | hCutIndex->GetXaxis()->SetBinLabel(kTrackCuts+1,"Track cuts"); | |
371 | hCutIndex->GetXaxis()->SetBinLabel(kConvPointFail+1,"ConvPoint fail"); | |
372 | hCutIndex->GetXaxis()->SetBinLabel(kPhotonCuts+1,"PhotonCuts"); | |
373 | hCutIndex->GetXaxis()->SetBinLabel(kPhotonOut+1,"out"); | |
374 | fHistograms->Add(hCutIndex); | |
375 | ||
376 | // Track Cuts | |
e5b6e8a6 | 377 | hTrackCuts=new TH1F(Form("TrackCuts %s",GetCutNumber().Data()),"TrackCuts",9,-0.5,8.5); |
4a0aab28 | 378 | hTrackCuts->GetXaxis()->SetBinLabel(1,"in"); |
379 | hTrackCuts->GetXaxis()->SetBinLabel(2,"likesign"); | |
380 | hTrackCuts->GetXaxis()->SetBinLabel(3,"ntpccl"); | |
381 | hTrackCuts->GetXaxis()->SetBinLabel(4,"acceptance"); | |
382 | hTrackCuts->GetXaxis()->SetBinLabel(5,"singlept"); | |
383 | hTrackCuts->GetXaxis()->SetBinLabel(6,"TPCrefit"); | |
384 | hTrackCuts->GetXaxis()->SetBinLabel(7,"kink"); | |
385 | hTrackCuts->GetXaxis()->SetBinLabel(8,"out"); | |
386 | fHistograms->Add(hTrackCuts); | |
387 | ||
388 | // Photon Cuts | |
389 | hPhotonCuts=new TH1F(Form("PhotonCuts %s",GetCutNumber().Data()),"PhotonCuts",12,-0.5,11.5); | |
390 | hPhotonCuts->GetXaxis()->SetBinLabel(1,"in"); | |
391 | hPhotonCuts->GetXaxis()->SetBinLabel(2,"qtcut"); | |
392 | hPhotonCuts->GetXaxis()->SetBinLabel(3,"chi2"); | |
393 | hPhotonCuts->GetXaxis()->SetBinLabel(4,"acceptance"); | |
394 | hPhotonCuts->GetXaxis()->SetBinLabel(5,"asymmetry"); | |
395 | hPhotonCuts->GetXaxis()->SetBinLabel(6,"pidprob"); | |
396 | hPhotonCuts->GetXaxis()->SetBinLabel(7,"cortpcclinfo"); | |
397 | hPhotonCuts->GetXaxis()->SetBinLabel(8,"PsiPair"); | |
398 | hPhotonCuts->GetXaxis()->SetBinLabel(9,"CosPAngle"); | |
399 | hPhotonCuts->GetXaxis()->SetBinLabel(10,"out"); | |
400 | fHistograms->Add(hPhotonCuts); | |
401 | ||
402 | if(preCut){ | |
e5b6e8a6 | 403 | hInvMassbefore=new TH1F(Form("InvMass_before %s",GetCutNumber().Data()),"InvMass_before",1000,0,0.3); |
4a0aab28 | 404 | fHistograms->Add(hInvMassbefore); |
e5b6e8a6 | 405 | hArmenterosbefore=new TH2F(Form("Armenteros_before %s",GetCutNumber().Data()),"Armenteros_before",200,-1,1,1000,0,1.); |
4a0aab28 | 406 | fHistograms->Add(hArmenterosbefore); |
407 | } | |
e5b6e8a6 | 408 | hInvMassafter=new TH1F(Form("InvMass_after %s",GetCutNumber().Data()),"InvMass_after",1000,0,0.3); |
4a0aab28 | 409 | fHistograms->Add(hInvMassafter); |
410 | hArmenterosafter=new TH2F(Form("Armenteros_after %s",GetCutNumber().Data()),"Armenteros_after",200,-1,1,250,0,0.25); | |
411 | fHistograms->Add(hArmenterosafter); | |
412 | ||
413 | hAcceptanceCuts=new TH1F(Form("PhotonAcceptanceCuts %s",GetCutNumber().Data()),"PhotonAcceptanceCuts",10,-0.5,9.5); | |
414 | hAcceptanceCuts->GetXaxis()->SetBinLabel(1,"in"); | |
415 | hAcceptanceCuts->GetXaxis()->SetBinLabel(2,"maxR"); | |
416 | hAcceptanceCuts->GetXaxis()->SetBinLabel(3,"minR"); | |
417 | hAcceptanceCuts->GetXaxis()->SetBinLabel(4,"line"); | |
418 | hAcceptanceCuts->GetXaxis()->SetBinLabel(5,"maxZ"); | |
419 | hAcceptanceCuts->GetXaxis()->SetBinLabel(6,"eta"); | |
420 | hAcceptanceCuts->GetXaxis()->SetBinLabel(7,"minpt"); | |
421 | hAcceptanceCuts->GetXaxis()->SetBinLabel(8,"out"); | |
422 | fHistograms->Add(hAcceptanceCuts); | |
423 | ||
424 | // dEdx Cuts | |
425 | hdEdxCuts=new TH1F(Form("dEdxCuts %s",GetCutNumber().Data()),"dEdxCuts",10,-0.5,9.5); | |
426 | hdEdxCuts->GetXaxis()->SetBinLabel(1,"in"); | |
427 | hdEdxCuts->GetXaxis()->SetBinLabel(2,"TPCelectron"); | |
428 | hdEdxCuts->GetXaxis()->SetBinLabel(3,"TPCpion"); | |
429 | hdEdxCuts->GetXaxis()->SetBinLabel(4,"TPCpionhighp"); | |
430 | hdEdxCuts->GetXaxis()->SetBinLabel(5,"TPCkaonlowprej"); | |
431 | hdEdxCuts->GetXaxis()->SetBinLabel(6,"TPCprotonlowprej"); | |
432 | hdEdxCuts->GetXaxis()->SetBinLabel(7,"TPCpionlowprej"); | |
433 | hdEdxCuts->GetXaxis()->SetBinLabel(8,"TOFelectron"); | |
434 | hdEdxCuts->GetXaxis()->SetBinLabel(9,"TRDelectron"); | |
435 | hdEdxCuts->GetXaxis()->SetBinLabel(10,"out"); | |
436 | fHistograms->Add(hdEdxCuts); | |
e5b6e8a6 | 437 | |
4a0aab28 | 438 | TAxis *AxisBeforedEdx = NULL; |
e5b6e8a6 | 439 | TAxis *AxisBeforedEdxSig = NULL; |
4a0aab28 | 440 | TAxis *AxisBeforeTOF = NULL; |
e5b6e8a6 | 441 | TAxis *AxisBeforeTOFSig = NULL; |
4a0aab28 | 442 | if(preCut){ |
e5b6e8a6 | 443 | hTPCdEdxbefore=new TH2F(Form("Gamma_dEdx_before %s",GetCutNumber().Data()),"dEdx Gamma before" ,150,0.03,20,800,0,200); |
4a0aab28 | 444 | fHistograms->Add(hTPCdEdxbefore); |
e5b6e8a6 | 445 | AxisBeforedEdx = hTPCdEdxbefore->GetXaxis(); |
446 | hTPCdEdxSigbefore=new TH2F(Form("Gamma_dEdxSig_before %s",GetCutNumber().Data()),"dEdx Sigma Gamma before" ,150,0.03,20,400,-10,10); | |
447 | fHistograms->Add(hTPCdEdxSigbefore); | |
448 | AxisBeforedEdxSig = hTPCdEdxSigbefore->GetXaxis(); | |
4a0aab28 | 449 | |
e5b6e8a6 | 450 | hTOFbefore=new TH2F(Form("Gamma_TOF_before %s",GetCutNumber().Data()),"TOF Gamma before" ,150,0.03,20,11000,-1000,10000); |
4a0aab28 | 451 | fHistograms->Add(hTOFbefore); |
e5b6e8a6 | 452 | AxisBeforeTOF = hTOFbefore->GetXaxis(); |
453 | hTOFSigbefore=new TH2F(Form("Gamma_TOFSig_before %s",GetCutNumber().Data()),"TOF Sigma Gamma before" ,150,0.03,20,400,-6,10); | |
454 | fHistograms->Add(hTOFSigbefore); | |
455 | AxisBeforeTOFSig = hTOFSigbefore->GetXaxis(); | |
456 | ||
4a0aab28 | 457 | } |
e5b6e8a6 | 458 | hTPCdEdxSigafter=new TH2F(Form("Gamma_dEdxSig_after %s",GetCutNumber().Data()),"dEdx Sigma Gamma after" ,150,0.03,20,400, -10,10); |
459 | fHistograms->Add(hTPCdEdxSigafter); | |
460 | ||
461 | hTPCdEdxafter=new TH2F(Form("Gamma_dEdx_after %s",GetCutNumber().Data()),"dEdx Gamma after" ,150,0.03,20,800,0,200); | |
4a0aab28 | 462 | fHistograms->Add(hTPCdEdxafter); |
463 | ||
e5b6e8a6 | 464 | hTOFSigafter=new TH2F(Form("Gamma_TOFSig_after %s",GetCutNumber().Data()),"TOF Sigma Gamma after" ,150,0.03,20,400,-6,10); |
465 | fHistograms->Add(hTOFSigafter); | |
4a0aab28 | 466 | |
e5b6e8a6 | 467 | TAxis *AxisAfter = hTPCdEdxSigafter->GetXaxis(); |
4a0aab28 | 468 | Int_t bins = AxisAfter->GetNbins(); |
469 | Double_t from = AxisAfter->GetXmin(); | |
470 | Double_t to = AxisAfter->GetXmax(); | |
471 | Double_t *newBins = new Double_t[bins+1]; | |
472 | newBins[0] = from; | |
473 | Double_t factor = TMath::Power(to/from, 1./bins); | |
474 | for(Int_t i=1; i<=bins; ++i) newBins[i] = factor * newBins[i-1]; | |
475 | AxisAfter->Set(bins, newBins); | |
e5b6e8a6 | 476 | AxisAfter = hTOFSigafter->GetXaxis(); |
477 | AxisAfter->Set(bins, newBins); | |
478 | AxisAfter = hTPCdEdxafter->GetXaxis(); | |
4a0aab28 | 479 | AxisAfter->Set(bins, newBins); |
480 | if(preCut){ | |
481 | AxisBeforedEdx->Set(bins, newBins); | |
482 | AxisBeforeTOF->Set(bins, newBins); | |
e5b6e8a6 | 483 | AxisBeforedEdxSig->Set(bins, newBins); |
484 | AxisBeforeTOFSig->Set(bins, newBins); | |
4a0aab28 | 485 | } |
486 | delete [] newBins; | |
e5b6e8a6 | 487 | |
4a0aab28 | 488 | // Event Cuts and Info |
489 | if(preCut){ | |
e5b6e8a6 | 490 | hV0EventCuts=new TH1F(Form("ESD_EventCuts %s",GetCutNumber().Data()),"Event Cuts",7,-0.5,6.5); |
4a0aab28 | 491 | hV0EventCuts->GetXaxis()->SetBinLabel(1,"in"); |
492 | hV0EventCuts->GetXaxis()->SetBinLabel(2,"OfflineTrigger"); | |
e5b6e8a6 | 493 | hV0EventCuts->GetXaxis()->SetBinLabel(3,"nvtxcontr"); |
494 | hV0EventCuts->GetXaxis()->SetBinLabel(4,"VertexZ"); | |
4a0aab28 | 495 | hV0EventCuts->GetXaxis()->SetBinLabel(5,"pileup"); |
496 | hV0EventCuts->GetXaxis()->SetBinLabel(6,"centrsel"); | |
497 | hV0EventCuts->GetXaxis()->SetBinLabel(7,"out"); | |
498 | fHistograms->Add(hV0EventCuts); | |
e5b6e8a6 | 499 | |
4a0aab28 | 500 | hCentrality=new TH1F(Form("Centrality %s",GetCutNumber().Data()),"Centrality",100,0,100); |
501 | fHistograms->Add(hCentrality); | |
502 | hVertexZ=new TH1F(Form("VertexZ %s",GetCutNumber().Data()),"VertexZ",1000,-50,50); | |
503 | fHistograms->Add(hVertexZ); | |
e5b6e8a6 | 504 | |
505 | hTriggerClass= new TH1F(Form("OfflineTrigger %s",GetCutNumber().Data()),"OfflineTrigger",33,-0.5,32.5); | |
506 | hTriggerClass->GetXaxis()->SetBinLabel( 1,"kMB"); | |
507 | hTriggerClass->GetXaxis()->SetBinLabel( 2,"kINT7"); | |
508 | hTriggerClass->GetXaxis()->SetBinLabel( 3,"kMUON"); | |
509 | hTriggerClass->GetXaxis()->SetBinLabel( 4,"kHighMult"); | |
510 | hTriggerClass->GetXaxis()->SetBinLabel( 5,"kKEMC1"); | |
511 | hTriggerClass->GetXaxis()->SetBinLabel( 6,"kCINT5"); | |
512 | hTriggerClass->GetXaxis()->SetBinLabel( 7,"kCMUS5/kMUSPB"); | |
513 | hTriggerClass->GetXaxis()->SetBinLabel( 8,"kMUSH7/kMUSHPB"); | |
514 | hTriggerClass->GetXaxis()->SetBinLabel( 9,"kMUL7/kMuonLikePB"); | |
515 | hTriggerClass->GetXaxis()->SetBinLabel(10,"kMUU7/kMuonUnlikePB"); | |
516 | hTriggerClass->GetXaxis()->SetBinLabel(11,"kEMC7/kEMC8"); | |
517 | hTriggerClass->GetXaxis()->SetBinLabel(12,"kMUS7"); | |
518 | hTriggerClass->GetXaxis()->SetBinLabel(13,"kPHI1"); | |
519 | hTriggerClass->GetXaxis()->SetBinLabel(14,"kPHI7/kPHI8/kPHOSPb"); | |
520 | hTriggerClass->GetXaxis()->SetBinLabel(15,"kEMCEJE"); | |
521 | hTriggerClass->GetXaxis()->SetBinLabel(16,"kEMCEGA"); | |
522 | hTriggerClass->GetXaxis()->SetBinLabel(17,"kCentral"); | |
523 | hTriggerClass->GetXaxis()->SetBinLabel(18,"kSemiCentral"); | |
524 | hTriggerClass->GetXaxis()->SetBinLabel(19,"kDG5"); | |
525 | hTriggerClass->GetXaxis()->SetBinLabel(20,"kZED"); | |
526 | hTriggerClass->GetXaxis()->SetBinLabel(21,"kSPI7/kSPI"); | |
527 | hTriggerClass->GetXaxis()->SetBinLabel(22,"kINT8"); | |
528 | hTriggerClass->GetXaxis()->SetBinLabel(23,"kMuonSingleLowPt8"); | |
529 | hTriggerClass->GetXaxis()->SetBinLabel(24,"kMuonSingleHighPt8"); | |
530 | hTriggerClass->GetXaxis()->SetBinLabel(25,"kMuonLikeLowPt8"); | |
531 | hTriggerClass->GetXaxis()->SetBinLabel(26,"kMuonUnlikeLowPt8"); | |
532 | hTriggerClass->GetXaxis()->SetBinLabel(27,"kMuonUnlikeLowPt0"); | |
533 | hTriggerClass->GetXaxis()->SetBinLabel(28,"kUserDefined"); | |
534 | hTriggerClass->GetXaxis()->SetBinLabel(29,"kFastOnly"); | |
535 | hTriggerClass->GetXaxis()->SetBinLabel(30,"kAnyINT"); | |
536 | hTriggerClass->GetXaxis()->SetBinLabel(31,"kAny"); | |
537 | hTriggerClass->GetXaxis()->SetBinLabel(32,"V0AND"); | |
538 | hTriggerClass->GetXaxis()->SetBinLabel(33,"NOT kFastOnly"); | |
4a0aab28 | 539 | fHistograms->Add(hTriggerClass); |
540 | } | |
3b77b2d1 | 541 | } |
542 | ||
543 | //________________________________________________________________________ | |
544 | Bool_t AliConversionCuts::InitPIDResponse(){ | |
4a0aab28 | 545 | // Set Pointer to AliPIDResponse |
3b77b2d1 | 546 | |
4a0aab28 | 547 | AliAnalysisManager *man=AliAnalysisManager::GetAnalysisManager(); |
e5b6e8a6 | 548 | if(man) { |
4a0aab28 | 549 | AliInputEventHandler* inputHandler = (AliInputEventHandler*) (man->GetInputEventHandler()); |
550 | fPIDResponse = (AliPIDResponse*)inputHandler->GetPIDResponse(); | |
551 | if(fPIDResponse)return kTRUE; | |
e5b6e8a6 | 552 | |
4a0aab28 | 553 | } |
e5b6e8a6 | 554 | |
ca91a3e1 | 555 | |
4a0aab28 | 556 | return kFALSE; |
3b77b2d1 | 557 | } |
558 | ///________________________________________________________________________ | |
92efd725 | 559 | Bool_t AliConversionCuts::EventIsSelected(AliVEvent *fInputEvent, AliVEvent *fMCEvent){ |
4a0aab28 | 560 | // Process Event Selection |
3b77b2d1 | 561 | |
4a0aab28 | 562 | Int_t cutindex=0; |
563 | if(hV0EventCuts)hV0EventCuts->Fill(cutindex); | |
564 | cutindex++; | |
e5b6e8a6 | 565 | |
4a0aab28 | 566 | // Check for MC event |
567 | if(fMCEvent){ | |
568 | // Check if MC event is correctly loaded | |
569 | AliMCEventHandler* mcHandler = dynamic_cast<AliMCEventHandler*> (AliAnalysisManager::GetAnalysisManager()->GetMCtruthEventHandler()); | |
570 | if (!mcHandler){ | |
571 | fEventQuality = 2; | |
572 | return kFALSE; | |
573 | } | |
574 | if (!mcHandler->InitOk() ){ | |
575 | fEventQuality = 2; | |
576 | return kFALSE; | |
577 | } | |
578 | if (!mcHandler->TreeK() ){ | |
579 | fEventQuality = 2; | |
580 | return kFALSE; | |
581 | } | |
582 | if (!mcHandler->TreeTR() ) { | |
583 | fEventQuality = 2; | |
584 | return kFALSE; | |
585 | } | |
586 | } | |
4a0aab28 | 587 | |
e5b6e8a6 | 588 | // Event Trigger |
4a0aab28 | 589 | if(!IsTriggerSelected()){ |
590 | if(hV0EventCuts)hV0EventCuts->Fill(cutindex); | |
591 | fEventQuality = 3; | |
592 | return kFALSE; | |
593 | } | |
594 | cutindex++; | |
e5b6e8a6 | 595 | |
596 | if(fInputEvent->IsA()==AliESDEvent::Class()){ | |
597 | AliTriggerAnalysis fTriggerAnalysis;// = new AliTriggerAnalysis; | |
598 | fHasV0AND = fTriggerAnalysis.IsOfflineTriggerFired((AliESDEvent*)fInputEvent, AliTriggerAnalysis::kV0AND); | |
599 | if(fHasV0AND&&hTriggerClass)hTriggerClass->Fill(31); | |
600 | } | |
4a0aab28 | 601 | |
e5b6e8a6 | 602 | // Number of Contributors Cut |
603 | if(GetNumberOfContributorsVtx(fInputEvent)<=0) { | |
4a0aab28 | 604 | if(hV0EventCuts)hV0EventCuts->Fill(cutindex); |
e5b6e8a6 | 605 | fEventQuality = 5; |
4a0aab28 | 606 | return kFALSE; |
607 | } | |
608 | cutindex++; | |
609 | ||
e5b6e8a6 | 610 | // Z Vertex Position Cut |
611 | if(!VertexZCut(fInputEvent)){ | |
4a0aab28 | 612 | if(hV0EventCuts)hV0EventCuts->Fill(cutindex); |
e5b6e8a6 | 613 | fEventQuality = 4; |
4a0aab28 | 614 | return kFALSE; |
615 | } | |
616 | cutindex++; | |
92efd725 | 617 | |
4a0aab28 | 618 | // Pile Up Rejection |
3b77b2d1 | 619 | |
4a0aab28 | 620 | if(fRemovePileUp){ |
621 | if(fInputEvent->IsPileupFromSPD(3,0.8,3.,2.,5.)){ | |
622 | if(hV0EventCuts)hV0EventCuts->Fill(cutindex); | |
623 | fEventQuality = 6; | |
624 | return kFALSE; | |
625 | } | |
626 | } | |
627 | cutindex++; | |
628 | ||
629 | // Centrality Selection | |
e5b6e8a6 | 630 | if(!IsCentralitySelected(fInputEvent,fMCEvent)){ |
4a0aab28 | 631 | if(hV0EventCuts)hV0EventCuts->Fill(cutindex); |
632 | fEventQuality = 1; | |
633 | return kFALSE; | |
634 | } | |
635 | cutindex++; | |
636 | ||
637 | // Fill Event Histograms | |
638 | if(hV0EventCuts)hV0EventCuts->Fill(cutindex); | |
639 | if(hVertexZ)hVertexZ->Fill(fInputEvent->GetPrimaryVertex()->GetZ()); | |
640 | if(hCentrality)hCentrality->Fill(GetCentrality(fInputEvent)); | |
3b77b2d1 | 641 | |
4a0aab28 | 642 | fEventQuality = 0; |
643 | return kTRUE; | |
3b77b2d1 | 644 | } |
645 | ||
646 | ///________________________________________________________________________ | |
92efd725 | 647 | Bool_t AliConversionCuts::PhotonIsSelectedMC(TParticle *particle,AliStack *fMCStack,Bool_t checkForConvertedGamma){ |
4a0aab28 | 648 | // MonteCarlo Photon Selection |
3b77b2d1 | 649 | |
4a0aab28 | 650 | if(!fMCStack)return kFALSE; |
3b77b2d1 | 651 | |
4a0aab28 | 652 | if (particle->GetPdgCode() == 22){ |
e5b6e8a6 | 653 | |
654 | if(particle->R() > fMaxR) return kFALSE; | |
655 | if(abs(particle->Eta())> fEtaCut || abs(particle->Eta())< fEtaCutMin) return kFALSE; | |
4a0aab28 | 656 | |
657 | if(particle->GetMother(0) >-1 && fMCStack->Particle(particle->GetMother(0))->GetPdgCode() == 22){ | |
658 | return kFALSE; // no photon as mothers! | |
659 | } | |
660 | ||
661 | if(particle->GetMother(0) >= fMCStack->GetNprimary()){ | |
662 | return kFALSE; // the gamma has a mother, and it is not a primary particle | |
663 | } | |
664 | ||
665 | if(!checkForConvertedGamma) return kTRUE; // return in case of accepted gamma | |
666 | ||
667 | // looking for conversion gammas (electron + positron from pairbuilding (= 5) ) | |
668 | TParticle* ePos = NULL; | |
669 | TParticle* eNeg = NULL; | |
670 | ||
671 | if(particle->GetNDaughters() >= 2){ | |
672 | for(Int_t daughterIndex=particle->GetFirstDaughter();daughterIndex<=particle->GetLastDaughter();daughterIndex++){ | |
673 | TParticle *tmpDaughter = fMCStack->Particle(daughterIndex); | |
674 | if(tmpDaughter->GetUniqueID() == 5){ | |
675 | if(tmpDaughter->GetPdgCode() == 11){ | |
676 | eNeg = tmpDaughter; | |
677 | } else if(tmpDaughter->GetPdgCode() == -11){ | |
678 | ePos = tmpDaughter; | |
679 | } | |
680 | } | |
681 | } | |
682 | } | |
683 | ||
684 | if(ePos == NULL || eNeg == NULL){ // means we do not have two daughters from pair production | |
685 | return kFALSE; | |
686 | } | |
e5b6e8a6 | 687 | |
4a0aab28 | 688 | if(ePos->Pt()<fSinglePtCut || eNeg->Pt()<fSinglePtCut){ |
689 | return kFALSE; // no reconstruction below the Pt cut | |
690 | } | |
e5b6e8a6 | 691 | |
692 | if( abs(ePos->Eta())> fEtaCut || abs(ePos->Eta())< fEtaCutMin || | |
693 | abs(eNeg->Eta())> fEtaCut || abs(eNeg->Eta())< fEtaCutMin ) { | |
4a0aab28 | 694 | return kFALSE; |
695 | } | |
e5b6e8a6 | 696 | |
4a0aab28 | 697 | if(ePos->R()>fMaxR){ |
698 | return kFALSE; // cuts on distance from collision point | |
699 | } | |
700 | ||
e5b6e8a6 | 701 | if(abs(ePos->Vz()) > fMaxZ){ |
4a0aab28 | 702 | return kFALSE; // outside material |
703 | } | |
e5b6e8a6 | 704 | if(abs(eNeg->Vz()) > fMaxZ){ |
4a0aab28 | 705 | return kFALSE; // outside material |
706 | } | |
707 | ||
e5b6e8a6 | 708 | if( ePos->R() <= ((abs(ePos->Vz()) * fLineCutZRSlope) - fLineCutZValue)){ |
4a0aab28 | 709 | return kFALSE; // line cut to exclude regions where we do not reconstruct |
e5b6e8a6 | 710 | } else if ( fEtaCutMin != -0.1 && ePos->R() >= ((abs(ePos->Vz()) * fLineCutZRSlopeMin) - fLineCutZValueMin)){ |
4a0aab28 | 711 | return kFALSE; |
712 | } | |
e5b6e8a6 | 713 | |
714 | if( eNeg->R() <= ((abs(eNeg->Vz()) * fLineCutZRSlope) - fLineCutZValue)){ | |
4a0aab28 | 715 | return kFALSE; // line cut to exclude regions where we do not reconstruct |
e5b6e8a6 | 716 | } else if ( fEtaCutMin != -0.1 && eNeg->R() >= ((abs(eNeg->Vz()) * fLineCutZRSlopeMin) - fLineCutZValueMin)){ |
4a0aab28 | 717 | return kFALSE; |
718 | } | |
e5b6e8a6 | 719 | |
4a0aab28 | 720 | return kTRUE; |
721 | //if(AcceptanceCut(particle,ePos,eNeg))return kTRUE; | |
722 | } | |
723 | return kFALSE; | |
3b77b2d1 | 724 | } |
725 | ||
2bb2434e | 726 | |
3b77b2d1 | 727 | ///________________________________________________________________________ |
728 | Bool_t AliConversionCuts::PhotonCuts(AliConversionPhotonBase *photon,AliVEvent *event) | |
729 | { // Specific Photon Cuts | |
730 | ||
4a0aab28 | 731 | Int_t cutIndex = 0; |
732 | if(hPhotonCuts)hPhotonCuts->Fill(cutIndex); | |
733 | cutIndex++; | |
734 | ||
735 | // Fill Histos before Cuts | |
736 | if(hInvMassbefore)hInvMassbefore->Fill(photon->GetMass()); | |
e5b6e8a6 | 737 | |
4a0aab28 | 738 | if(hArmenterosbefore)hArmenterosbefore->Fill(photon->GetArmenterosAlpha(),photon->GetArmenterosQt()); |
739 | ||
740 | // Gamma selection based on QT from Armenteros | |
741 | if(fDoQtGammaSelection == kTRUE){ | |
742 | if(!ArmenterosQtCut(photon)){ | |
743 | if(hPhotonCuts)hPhotonCuts->Fill(cutIndex); //1 | |
744 | return kFALSE; | |
745 | } | |
746 | } | |
747 | cutIndex++; //2 | |
748 | ||
749 | // Chi Cut | |
750 | if(photon->GetChi2perNDF() > fChi2CutConversion || photon->GetChi2perNDF() <=0){ | |
751 | { | |
752 | if(hPhotonCuts)hPhotonCuts->Fill(cutIndex); //2 | |
753 | return kFALSE; | |
754 | } | |
755 | } | |
756 | cutIndex++;//3 | |
757 | ||
758 | // Reconstruction Acceptance Cuts | |
759 | if(!AcceptanceCuts(photon)){ | |
760 | if(hPhotonCuts)hPhotonCuts->Fill(cutIndex); //3 | |
761 | return kFALSE; | |
762 | } | |
763 | ||
764 | cutIndex++; //4 | |
765 | // Asymmetry Cut | |
766 | if(fDoPhotonAsymmetryCut == kTRUE){ | |
767 | if(!AsymmetryCut(photon,event)){ | |
768 | if(hPhotonCuts)hPhotonCuts->Fill(cutIndex); //4 | |
769 | return kFALSE; | |
770 | } | |
771 | } | |
772 | ||
773 | //Check the pid probability | |
774 | cutIndex++; //5 | |
775 | if(!PIDProbabilityCut(photon, event)) { | |
776 | if(hPhotonCuts)hPhotonCuts->Fill(cutIndex); //5 | |
777 | return kFALSE; | |
778 | } | |
779 | ||
780 | cutIndex++; //6 | |
781 | if(!CorrectedTPCClusterCut(photon, event)) { | |
782 | if(hPhotonCuts)hPhotonCuts->Fill(cutIndex); //6 | |
783 | return kFALSE; | |
784 | } | |
785 | ||
786 | ||
787 | cutIndex++; //7 | |
788 | if(!PsiPairCut(photon)) { | |
789 | if(hPhotonCuts)hPhotonCuts->Fill(cutIndex); //7 | |
790 | return kFALSE; | |
791 | } | |
792 | ||
793 | cutIndex++; //8 | |
794 | if(!CosinePAngleCut(photon, event)) { | |
795 | if(hPhotonCuts)hPhotonCuts->Fill(cutIndex); //8 | |
796 | return kFALSE; | |
797 | } | |
798 | ||
799 | cutIndex++; //9 | |
800 | if(hPhotonCuts)hPhotonCuts->Fill(cutIndex); //9 | |
801 | ||
802 | // Histos after Cuts | |
803 | if(hInvMassafter)hInvMassafter->Fill(photon->GetMass()); | |
804 | if(hArmenterosafter)hArmenterosafter->Fill(photon->GetArmenterosAlpha(),photon->GetArmenterosQt()); | |
805 | ||
806 | ||
807 | return kTRUE; | |
3b77b2d1 | 808 | |
809 | } | |
810 | ||
811 | ///________________________________________________________________________ | |
812 | Bool_t AliConversionCuts::CorrectedTPCClusterCut(AliConversionPhotonBase *photon, AliVEvent * event) | |
813 | { //Cut on corrected TPC Cluster Info | |
814 | ||
4a0aab28 | 815 | AliVTrack * negTrack = GetTrack(event, photon->GetTrackLabelNegative()); |
816 | AliVTrack * posTrack = GetTrack(event, photon->GetTrackLabelPositive()); | |
3b77b2d1 | 817 | |
4a0aab28 | 818 | if(!negTrack||!posTrack)return kFALSE; |
3b77b2d1 | 819 | |
4a0aab28 | 820 | Double_t negclsToF=0; |
3b77b2d1 | 821 | |
4a0aab28 | 822 | if (!fUseCorrectedTPCClsInfo ){ |
823 | if(negTrack->GetTPCNclsF()!=0){ | |
824 | negclsToF = (Double_t)negTrack->GetNcls(1)/(Double_t)negTrack->GetTPCNclsF();}// Ncluster/Nfindablecluster | |
825 | } | |
826 | else { | |
827 | negclsToF = negTrack->GetTPCClusterInfo(2,0,GetFirstTPCRow(photon->GetConversionRadius())); | |
828 | } | |
3b77b2d1 | 829 | |
4a0aab28 | 830 | Double_t posclsToF = 0.; |
831 | if (!fUseCorrectedTPCClsInfo ){ | |
e5b6e8a6 | 832 | if(posTrack->GetTPCNclsF()!=0){ |
4a0aab28 | 833 | posclsToF = (Double_t)posTrack->GetNcls(1)/(Double_t)posTrack->GetTPCNclsF(); |
834 | } | |
835 | }else{ | |
836 | posclsToF = posTrack->GetTPCClusterInfo(2,0,GetFirstTPCRow(photon->GetConversionRadius())); | |
837 | } | |
3b77b2d1 | 838 | |
e5b6e8a6 | 839 | if( negclsToF < fMinClsTPCToF || posclsToF < fMinClsTPCToF ){ |
4a0aab28 | 840 | return kFALSE; |
841 | } | |
3b77b2d1 | 842 | |
4a0aab28 | 843 | return kTRUE; |
3b77b2d1 | 844 | } |
845 | ||
3b77b2d1 | 846 | ///________________________________________________________________________ |
d008165e | 847 | Bool_t AliConversionCuts::PhotonIsSelected(AliConversionPhotonBase *photon, AliVEvent * event) |
848 | { | |
4a0aab28 | 849 | //Selection of Reconstructed Photons |
3b77b2d1 | 850 | |
4a0aab28 | 851 | FillPhotonCutIndex(kPhotonIn); |
3b77b2d1 | 852 | |
4a0aab28 | 853 | // Get Tracks |
854 | AliVTrack * negTrack = GetTrack(event, photon->GetTrackLabelNegative()); | |
855 | AliVTrack * posTrack = GetTrack(event, photon->GetTrackLabelPositive()); | |
3b77b2d1 | 856 | |
4a0aab28 | 857 | if(!negTrack || !posTrack) { |
858 | FillPhotonCutIndex(kNoTracks); | |
859 | return kFALSE; | |
860 | } | |
3b77b2d1 | 861 | |
4a0aab28 | 862 | // dEdx Cuts |
863 | if(!dEdxCuts(negTrack) || !dEdxCuts(posTrack)) { | |
864 | FillPhotonCutIndex(kdEdxCuts); | |
865 | return kFALSE; | |
866 | } | |
3b77b2d1 | 867 | |
4a0aab28 | 868 | // Track Cuts |
869 | if(!TracksAreSelected(negTrack, posTrack)){ | |
870 | FillPhotonCutIndex(kTrackCuts); | |
871 | return kFALSE; | |
872 | } | |
3b77b2d1 | 873 | |
4a0aab28 | 874 | // Photon Cuts |
875 | if(!PhotonCuts(photon,event)){ | |
876 | FillPhotonCutIndex(kPhotonCuts); | |
877 | return kFALSE; | |
878 | } | |
3b77b2d1 | 879 | |
4a0aab28 | 880 | // Photon passed cuts |
881 | FillPhotonCutIndex(kPhotonOut); | |
882 | return kTRUE; | |
3b77b2d1 | 883 | } |
884 | ||
3b77b2d1 | 885 | ///________________________________________________________________________ |
886 | Bool_t AliConversionCuts::ArmenterosQtCut(AliConversionPhotonBase *photon) | |
887 | { // Armenteros Qt Cut | |
888 | ||
4a0aab28 | 889 | if(fDoHighPtQtGammaSelection){ |
890 | if(photon->GetPhotonPt() < fPtBorderForQt){ | |
891 | if(photon->GetArmenterosQt()>fQtMax){ | |
892 | return kFALSE; | |
893 | } | |
894 | } else { | |
895 | if(photon->GetArmenterosQt()>fHighPtQtMax){ | |
896 | return kFALSE; | |
897 | } | |
898 | } | |
899 | } else { | |
3b77b2d1 | 900 | |
4a0aab28 | 901 | if(photon->GetArmenterosQt()>fQtMax){ |
902 | return kFALSE; | |
903 | } | |
904 | } | |
905 | return kTRUE; | |
3b77b2d1 | 906 | } |
907 | ||
908 | ||
909 | ///________________________________________________________________________ | |
910 | Bool_t AliConversionCuts::AcceptanceCuts(AliConversionPhotonBase *photon) { | |
4a0aab28 | 911 | // Exclude certain areas for photon reconstruction |
3b77b2d1 | 912 | |
4a0aab28 | 913 | Int_t cutIndex=0; |
914 | if(hAcceptanceCuts)hAcceptanceCuts->Fill(cutIndex); | |
915 | cutIndex++; | |
3b77b2d1 | 916 | |
4a0aab28 | 917 | if(photon->GetConversionRadius()>fMaxR){ // cuts on distance from collision point |
918 | if(hAcceptanceCuts)hAcceptanceCuts->Fill(cutIndex); | |
919 | return kFALSE; | |
920 | } | |
921 | cutIndex++; | |
3b77b2d1 | 922 | |
4a0aab28 | 923 | if(photon->GetConversionRadius()<fMinR){ // cuts on distance from collision point |
924 | if(hAcceptanceCuts)hAcceptanceCuts->Fill(cutIndex); | |
925 | return kFALSE; | |
926 | } | |
927 | cutIndex++; | |
3b77b2d1 | 928 | |
e5b6e8a6 | 929 | if(photon->GetConversionRadius() <= ((abs(photon->GetConversionZ())*fLineCutZRSlope)-fLineCutZValue)){ |
3b77b2d1 | 930 | if(hAcceptanceCuts)hAcceptanceCuts->Fill(cutIndex); |
931 | return kFALSE; | |
4a0aab28 | 932 | } |
e5b6e8a6 | 933 | else if (fUseEtaMinCut && photon->GetConversionRadius() >= ((abs(photon->GetConversionZ())*fLineCutZRSlopeMin)-fLineCutZValueMin )){ |
4a0aab28 | 934 | if(hAcceptanceCuts)hAcceptanceCuts->Fill(cutIndex); |
935 | return kFALSE; | |
936 | } | |
937 | cutIndex++; | |
3b77b2d1 | 938 | |
e5b6e8a6 | 939 | if(abs(photon->GetConversionZ()) > fMaxZ ){ // cuts out regions where we do not reconstruct |
3b77b2d1 | 940 | if(hAcceptanceCuts)hAcceptanceCuts->Fill(cutIndex); |
941 | return kFALSE; | |
4a0aab28 | 942 | } |
943 | cutIndex++; | |
3b77b2d1 | 944 | |
945 | ||
e5b6e8a6 | 946 | if(abs(photon->GetPhotonEta())> fEtaCut || abs(photon->GetPhotonEta())< fEtaCutMin){ |
3b77b2d1 | 947 | if(hAcceptanceCuts)hAcceptanceCuts->Fill(cutIndex); |
948 | return kFALSE; | |
4a0aab28 | 949 | } |
950 | cutIndex++; | |
3b77b2d1 | 951 | |
952 | ||
4a0aab28 | 953 | if(photon->GetPhotonPt()<fPtCut){ |
3b77b2d1 | 954 | if(hAcceptanceCuts)hAcceptanceCuts->Fill(cutIndex); |
955 | return kFALSE; | |
4a0aab28 | 956 | } |
957 | cutIndex++; | |
3b77b2d1 | 958 | |
4a0aab28 | 959 | if(hAcceptanceCuts)hAcceptanceCuts->Fill(cutIndex); |
e5b6e8a6 | 960 | |
4a0aab28 | 961 | return kTRUE; |
3b77b2d1 | 962 | } |
963 | ||
964 | ||
965 | ///________________________________________________________________________ | |
966 | Bool_t AliConversionCuts::SpecificTrackCuts(AliAODTrack * negTrack, AliAODTrack * posTrack,Int_t &cutIndex) { | |
4a0aab28 | 967 | // Track Cuts which require AOD/ESD specific implementation |
3b77b2d1 | 968 | |
4a0aab28 | 969 | if( !negTrack->IsOn(AliESDtrack::kTPCrefit) || !posTrack->IsOn(AliESDtrack::kTPCrefit) ) { |
3b77b2d1 | 970 | if(hTrackCuts)hTrackCuts->Fill(cutIndex); |
971 | return kFALSE; | |
4a0aab28 | 972 | } |
973 | cutIndex++; | |
3b77b2d1 | 974 | |
4a0aab28 | 975 | AliAODVertex * NegVtxType=negTrack->GetProdVertex(); |
976 | AliAODVertex * PosVtxType=posTrack->GetProdVertex(); | |
977 | if((NegVtxType->GetType())==AliAODVertex::kKink || (PosVtxType->GetType())==AliAODVertex::kKink) { | |
3b77b2d1 | 978 | if(hTrackCuts)hTrackCuts->Fill(cutIndex); |
979 | return kFALSE; | |
4a0aab28 | 980 | } |
981 | return kTRUE; | |
3b77b2d1 | 982 | |
983 | } | |
984 | ||
985 | ||
986 | ///________________________________________________________________________ | |
987 | Bool_t AliConversionCuts::SpecificTrackCuts(AliESDtrack * negTrack, AliESDtrack * posTrack,Int_t &cutIndex) { | |
4a0aab28 | 988 | // Track Cuts which require AOD/ESD specific implementation |
3b77b2d1 | 989 | |
92efd725 | 990 | if( !negTrack->IsOn(AliESDtrack::kTPCrefit) || !posTrack->IsOn(AliESDtrack::kTPCrefit) ) { |
3b77b2d1 | 991 | if(hTrackCuts)hTrackCuts->Fill(cutIndex); |
992 | return kFALSE; | |
4a0aab28 | 993 | } |
994 | cutIndex++; | |
3b77b2d1 | 995 | |
4a0aab28 | 996 | if(negTrack->GetKinkIndex(0) > 0 || posTrack->GetKinkIndex(0) > 0 ) { |
3b77b2d1 | 997 | if(hTrackCuts)hTrackCuts->Fill(cutIndex); |
998 | return kFALSE; | |
4a0aab28 | 999 | } |
1000 | return kTRUE; | |
3b77b2d1 | 1001 | } |
1002 | ||
1003 | ||
1004 | ||
1005 | ///________________________________________________________________________ | |
1006 | Bool_t AliConversionCuts::TracksAreSelected(AliVTrack * negTrack, AliVTrack * posTrack) { | |
4a0aab28 | 1007 | // Track Selection for Photon Reconstruction |
3b77b2d1 | 1008 | |
4a0aab28 | 1009 | Int_t cutIndex=0; |
1010 | if(hTrackCuts)hTrackCuts->Fill(cutIndex); | |
1011 | cutIndex++; | |
3b77b2d1 | 1012 | |
4a0aab28 | 1013 | // avoid like sign |
1014 | if(negTrack->Charge() == posTrack->Charge()) { | |
1015 | if(hTrackCuts)hTrackCuts->Fill(cutIndex); | |
1016 | return kFALSE; | |
1017 | } | |
1018 | cutIndex++; | |
3b77b2d1 | 1019 | |
4a0aab28 | 1020 | // Number of TPC Clusters |
1021 | if( negTrack->GetNcls(1) < fMinClsTPC || posTrack->GetNcls(1) < fMinClsTPC ) { | |
3b77b2d1 | 1022 | if(hTrackCuts)hTrackCuts->Fill(cutIndex); |
4a0aab28 | 1023 | return kFALSE; |
1024 | } | |
1025 | cutIndex++; | |
3b77b2d1 | 1026 | |
4a0aab28 | 1027 | // Acceptance |
3b77b2d1 | 1028 | |
e5b6e8a6 | 1029 | if(abs(negTrack->Eta()) > fEtaCut || abs(negTrack->Eta()) < fEtaCutMin || |
1030 | abs(posTrack->Eta())> fEtaCut || abs(posTrack->Eta())< fEtaCutMin) { | |
4a0aab28 | 1031 | if(hTrackCuts)hTrackCuts->Fill(cutIndex); |
3b77b2d1 | 1032 | return kFALSE; |
4a0aab28 | 1033 | } |
1034 | cutIndex++; | |
3b77b2d1 | 1035 | |
4a0aab28 | 1036 | // Single Pt Cut |
1037 | if( negTrack->Pt()< fSinglePtCut || posTrack->Pt()< fSinglePtCut){ | |
3b77b2d1 | 1038 | if(hTrackCuts)hTrackCuts->Fill(cutIndex); |
1039 | return kFALSE; | |
4a0aab28 | 1040 | } |
1041 | cutIndex++; | |
3b77b2d1 | 1042 | |
4a0aab28 | 1043 | // AOD ESD specific cuts |
1044 | Bool_t passCuts = kTRUE; | |
3b77b2d1 | 1045 | |
4a0aab28 | 1046 | if(negTrack->IsA()==AliAODTrack::Class()) { |
1047 | passCuts = passCuts * SpecificTrackCuts(static_cast<AliAODTrack*>(negTrack), static_cast<AliAODTrack*>(posTrack),cutIndex); | |
e5b6e8a6 | 1048 | } else { |
4a0aab28 | 1049 | passCuts = passCuts * SpecificTrackCuts(static_cast<AliESDtrack*>(negTrack), static_cast<AliESDtrack*>(posTrack),cutIndex); |
e5b6e8a6 | 1050 | } |
3b77b2d1 | 1051 | |
4a0aab28 | 1052 | if(!passCuts){ |
3b77b2d1 | 1053 | if(hTrackCuts)hTrackCuts->Fill(cutIndex); |
1054 | return kFALSE; | |
4a0aab28 | 1055 | } |
1056 | cutIndex++; | |
3b77b2d1 | 1057 | |
4a0aab28 | 1058 | if(hTrackCuts)hTrackCuts->Fill(cutIndex); |
3b77b2d1 | 1059 | |
4a0aab28 | 1060 | return kTRUE; |
e5b6e8a6 | 1061 | |
3b77b2d1 | 1062 | } |
1063 | ||
1064 | ///________________________________________________________________________ | |
1065 | Bool_t AliConversionCuts::dEdxCuts(AliVTrack *fCurrentTrack){ | |
4a0aab28 | 1066 | // Electron Identification Cuts for Photon reconstruction |
3b77b2d1 | 1067 | |
4a0aab28 | 1068 | if(!fPIDResponse){InitPIDResponse();}// Try to reinitialize PID Response |
1069 | if(!fPIDResponse){AliError("No PID Response"); return kTRUE;}// if still missing fatal error | |
3b77b2d1 | 1070 | |
4a0aab28 | 1071 | Int_t cutIndex=0; |
1072 | if(hdEdxCuts)hdEdxCuts->Fill(cutIndex); | |
e5b6e8a6 | 1073 | if(hTPCdEdxSigbefore)hTPCdEdxSigbefore->Fill(fCurrentTrack->P(),fPIDResponse->NumberOfSigmasTPC(fCurrentTrack, AliPID::kElectron)); |
1074 | if(hTPCdEdxbefore)hTPCdEdxbefore->Fill(fCurrentTrack->P(),fCurrentTrack->GetTPCsignal()); | |
4a0aab28 | 1075 | cutIndex++; |
e5b6e8a6 | 1076 | |
3b77b2d1 | 1077 | |
4a0aab28 | 1078 | if(fDodEdxSigmaCut == kTRUE){ |
3b77b2d1 | 1079 | // TPC Electron Line |
1080 | if( fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kElectron)<fPIDnSigmaBelowElectronLine || | |
4a0aab28 | 1081 | fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kElectron)>fPIDnSigmaAboveElectronLine){ |
3b77b2d1 | 1082 | |
4a0aab28 | 1083 | if(hdEdxCuts)hdEdxCuts->Fill(cutIndex); |
1084 | return kFALSE; | |
3b77b2d1 | 1085 | } |
1086 | cutIndex++; | |
1087 | ||
1088 | // TPC Pion Line | |
4a0aab28 | 1089 | if( fCurrentTrack->P()>fPIDMinPnSigmaAbovePionLine && fCurrentTrack->P()<fPIDMaxPnSigmaAbovePionLine ){ |
1090 | if(fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kElectron)>fPIDnSigmaBelowElectronLine && | |
1091 | fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kElectron)<fPIDnSigmaAboveElectronLine&& | |
1092 | fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kPion)<fPIDnSigmaAbovePionLine){ | |
1093 | ||
1094 | if(hdEdxCuts)hdEdxCuts->Fill(cutIndex); | |
1095 | return kFALSE; | |
1096 | } | |
1097 | } | |
1098 | cutIndex++; | |
e5b6e8a6 | 1099 | |
4a0aab28 | 1100 | // High Pt Pion rej |
1101 | if( fCurrentTrack->P()>fPIDMaxPnSigmaAbovePionLine ){ | |
1102 | if(fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kElectron)>fPIDnSigmaBelowElectronLine && | |
e5b6e8a6 | 1103 | fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kElectron)<fPIDnSigmaAboveElectronLine && |
4a0aab28 | 1104 | fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kPion)<fPIDnSigmaAbovePionLineHighPt){ |
1105 | ||
1106 | if(hdEdxCuts)hdEdxCuts->Fill(cutIndex); | |
1107 | return kFALSE; | |
1108 | } | |
1109 | } | |
1110 | cutIndex++; | |
1111 | } | |
1112 | else{cutIndex+=3;} | |
1113 | ||
1114 | if(fDoKaonRejectionLowP == kTRUE){ | |
1115 | if(fCurrentTrack->P()<fPIDMinPKaonRejectionLowP ){ | |
e5b6e8a6 | 1116 | if( abs(fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kKaon))<fPIDnSigmaAtLowPAroundKaonLine){ |
4a0aab28 | 1117 | |
1118 | if(hdEdxCuts)hdEdxCuts->Fill(cutIndex); | |
1119 | return kFALSE; | |
1120 | } | |
1121 | } | |
1122 | } | |
1123 | cutIndex++; | |
e5b6e8a6 | 1124 | |
4a0aab28 | 1125 | if(fDoProtonRejectionLowP == kTRUE){ |
1126 | if( fCurrentTrack->P()<fPIDMinPProtonRejectionLowP ){ | |
e5b6e8a6 | 1127 | if( abs(fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kProton))<fPIDnSigmaAtLowPAroundProtonLine){ |
4a0aab28 | 1128 | |
1129 | if(hdEdxCuts)hdEdxCuts->Fill(cutIndex); | |
1130 | return kFALSE; | |
1131 | } | |
1132 | } | |
1133 | } | |
3b77b2d1 | 1134 | cutIndex++; |
e5b6e8a6 | 1135 | |
4a0aab28 | 1136 | if(fDoPionRejectionLowP == kTRUE){ |
1137 | if( fCurrentTrack->P()<fPIDMinPPionRejectionLowP ){ | |
e5b6e8a6 | 1138 | if( abs(fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kPion))<fPIDnSigmaAtLowPAroundPionLine){ |
4a0aab28 | 1139 | |
1140 | if(hdEdxCuts)hdEdxCuts->Fill(cutIndex); | |
1141 | return kFALSE; | |
1142 | } | |
1143 | } | |
1144 | } | |
1145 | cutIndex++; | |
e5b6e8a6 | 1146 | |
1147 | ||
1148 | // cout<<"Start"<<endl; | |
1149 | // AliPIDResponse::EDetPidStatus status=fPIDResponse->CheckPIDStatus(AliPIDResponse::kTOF,fCurrentTrack); | |
1150 | ||
1151 | // if( ( (status & AliVTrack::kTOFout) == AliVTrack::kTOFout ) && ( (status & AliVTrack::kTIME) == AliVTrack::kTIME )) | |
1152 | // {cout<<"TOF DA"<<endl;} | |
1153 | // if(status == AliPIDResponse::kDetPidOk){ | |
1154 | // Float_t probMis = fPIDResponse->GetTOFMismatchProbability(fCurrentTrack); | |
1155 | // cout<<"--> "<<probMis<<endl; | |
1156 | // if(probMis > 0.01){ | |
1157 | ||
1158 | // } | |
1159 | // } | |
3b77b2d1 | 1160 | |
4a0aab28 | 1161 | if((fCurrentTrack->GetStatus() & AliESDtrack::kTOFpid) && !(fCurrentTrack->GetStatus() & AliESDtrack::kTOFmismatch)){ |
e5b6e8a6 | 1162 | if(hTOFbefore){ |
1163 | Double_t t0 = fPIDResponse->GetTOFResponse().GetStartTime(fCurrentTrack->P()); | |
1164 | Double_t times[5]; | |
1165 | fCurrentTrack->GetIntegratedTimes(times); | |
1166 | Double_t TOFsignal = fCurrentTrack->GetTOFsignal(); | |
1167 | Double_t dT = TOFsignal - t0 - times[0]; | |
1168 | hTOFbefore->Fill(fCurrentTrack->P(),dT); | |
1169 | } | |
1170 | if(hTOFSigbefore) hTOFSigbefore->Fill(fCurrentTrack->P(),fPIDResponse->NumberOfSigmasTOF(fCurrentTrack, AliPID::kElectron)); | |
4a0aab28 | 1171 | if(fUseTOFpid){ |
1172 | if(fPIDResponse->NumberOfSigmasTOF(fCurrentTrack, AliPID::kElectron)>fTofPIDnSigmaAboveElectronLine || | |
1173 | fPIDResponse->NumberOfSigmasTOF(fCurrentTrack, AliPID::kElectron)<fTofPIDnSigmaBelowElectronLine ){ | |
1174 | if(hdEdxCuts)hdEdxCuts->Fill(cutIndex); | |
1175 | return kFALSE; | |
1176 | } | |
1177 | } | |
e5b6e8a6 | 1178 | if(hTOFSigafter)hTOFSigafter->Fill(fCurrentTrack->P(),fPIDResponse->NumberOfSigmasTOF(fCurrentTrack, AliPID::kElectron)); |
4a0aab28 | 1179 | } |
1180 | cutIndex++; | |
e5b6e8a6 | 1181 | |
4a0aab28 | 1182 | // Apply TRD PID |
1183 | if(fDoTRDPID){ | |
1184 | if(!fPIDResponse->IdentifiedAsElectronTRD(fCurrentTrack,fPIDTRDEfficiency)){ | |
4a0aab28 | 1185 | if(hdEdxCuts)hdEdxCuts->Fill(cutIndex); |
1186 | return kFALSE; | |
1187 | } | |
1188 | } | |
1189 | cutIndex++; | |
3b77b2d1 | 1190 | |
4a0aab28 | 1191 | if(hdEdxCuts)hdEdxCuts->Fill(cutIndex); |
e5b6e8a6 | 1192 | if(hTPCdEdxSigafter)hTPCdEdxSigafter->Fill(fCurrentTrack->P(),fPIDResponse->NumberOfSigmasTPC(fCurrentTrack, AliPID::kElectron)); |
1193 | if(hTPCdEdxafter)hTPCdEdxafter->Fill(fCurrentTrack->P(),fCurrentTrack->GetTPCsignal()); | |
4a0aab28 | 1194 | return kTRUE; |
3b77b2d1 | 1195 | } |
1196 | ||
1197 | ///________________________________________________________________________ | |
1198 | Bool_t AliConversionCuts::AsymmetryCut(AliConversionPhotonBase * photon,AliVEvent *event) { | |
4a0aab28 | 1199 | // Cut on Energy Assymetry |
3b77b2d1 | 1200 | |
4a0aab28 | 1201 | for(Int_t ii=0;ii<2;ii++){ |
3b77b2d1 | 1202 | |
4a0aab28 | 1203 | AliVTrack *track=GetTrack(event,photon->GetTrackLabel(ii)); |
3b77b2d1 | 1204 | |
4a0aab28 | 1205 | if( track->P() > fMinPPhotonAsymmetryCut ){ |
1206 | Double_t trackNegAsy=0; | |
1207 | if (photon->GetPhotonP()!=0.){ | |
1208 | trackNegAsy= track->P()/photon->GetPhotonP(); | |
1209 | } | |
3b77b2d1 | 1210 | |
4a0aab28 | 1211 | if( trackNegAsy<fMinPhotonAsymmetry ||trackNegAsy>(1.- fMinPhotonAsymmetry)){ |
1212 | return kFALSE; | |
1213 | } | |
1214 | } | |
3b77b2d1 | 1215 | |
4a0aab28 | 1216 | } |
1217 | return kTRUE; | |
3b77b2d1 | 1218 | } |
1219 | ||
1220 | ///________________________________________________________________________ | |
92efd725 | 1221 | AliVTrack *AliConversionCuts::GetTrack(AliVEvent * event, Int_t label){ |
4a0aab28 | 1222 | //Returns pointer to the track with given ESD label |
1223 | //(Important for AOD implementation, since Track array in AOD data is different | |
1224 | //from ESD array, but ESD tracklabels are stored in AOD Tracks) | |
1225 | ||
1226 | AliESDEvent * esdEvent = dynamic_cast<AliESDEvent*>(event); | |
1227 | if(esdEvent) { | |
1228 | if(label > event->GetNumberOfTracks() ) return NULL; | |
1229 | AliESDtrack * track = esdEvent->GetTrack(label); | |
1230 | return track; | |
e5b6e8a6 | 1231 | |
1232 | } else { | |
4a0aab28 | 1233 | for(Int_t ii=0; ii<event->GetNumberOfTracks(); ii++) { |
1234 | AliVTrack * track = dynamic_cast<AliVTrack*>(event->GetTrack(ii)); | |
e5b6e8a6 | 1235 | |
1236 | if(track) { | |
4a0aab28 | 1237 | if(track->GetID() == label) { |
1238 | return track; | |
1239 | } | |
1240 | } | |
1241 | } | |
1242 | } | |
e5b6e8a6 | 1243 | |
1244 | //AliDebug(5,(Form("track not found %d %d",label,event->GetNumberOfTracks())); | |
1245 | return NULL; | |
1246 | } | |
1247 | ||
1248 | ///________________________________________________________________________ | |
1249 | AliESDtrack *AliConversionCuts::GetESDTrack(AliESDEvent * event, Int_t label){ | |
1250 | //Returns pointer to the track with given ESD label | |
1251 | //(Important for AOD implementation, since Track array in AOD data is different | |
1252 | //from ESD array, but ESD tracklabels are stored in AOD Tracks) | |
1253 | ||
1254 | if(event) { | |
1255 | if(label > event->GetNumberOfTracks() ) return NULL; | |
1256 | AliESDtrack * track = event->GetTrack(label); | |
1257 | return track; | |
1258 | } | |
4a0aab28 | 1259 | //AliDebug(5,(Form("track not found %d %d",label,event->GetNumberOfTracks())); |
1260 | return NULL; | |
3b77b2d1 | 1261 | } |
1262 | ||
1263 | ||
e5b6e8a6 | 1264 | |
3b77b2d1 | 1265 | ///________________________________________________________________________ |
1266 | Bool_t AliConversionCuts::PIDProbabilityCut(AliConversionPhotonBase *photon, AliVEvent * event){ | |
4a0aab28 | 1267 | // Cut on Electron Probability for Photon Reconstruction |
3b77b2d1 | 1268 | |
4a0aab28 | 1269 | AliESDEvent * esdEvent = dynamic_cast<AliESDEvent*>(event); |
3b77b2d1 | 1270 | |
4a0aab28 | 1271 | if(esdEvent){ |
e5b6e8a6 | 1272 | |
4a0aab28 | 1273 | Bool_t iResult=kFALSE; |
e5b6e8a6 | 1274 | |
4a0aab28 | 1275 | Double_t *posProbArray = new Double_t[AliPID::kSPECIES]; |
1276 | Double_t *negProbArray = new Double_t[AliPID::kSPECIES]; | |
e5b6e8a6 | 1277 | |
4a0aab28 | 1278 | AliESDtrack* negTrack = esdEvent->GetTrack(photon->GetTrackLabelNegative()); |
1279 | AliESDtrack* posTrack = esdEvent->GetTrack(photon->GetTrackLabelPositive()); | |
e5b6e8a6 | 1280 | |
4a0aab28 | 1281 | if(negProbArray && posProbArray){ |
e5b6e8a6 | 1282 | |
4a0aab28 | 1283 | negTrack->GetTPCpid(negProbArray); |
1284 | posTrack->GetTPCpid(posProbArray); | |
3b77b2d1 | 1285 | |
4a0aab28 | 1286 | if(negProbArray[AliPID::kElectron]>=fPIDProbabilityCutNegativeParticle && posProbArray[AliPID::kElectron]>=fPIDProbabilityCutPositiveParticle){ |
1287 | iResult=kTRUE; | |
1288 | } | |
1289 | } | |
e5b6e8a6 | 1290 | |
4a0aab28 | 1291 | delete [] posProbArray; |
1292 | delete [] negProbArray; | |
1293 | return iResult; | |
3b77b2d1 | 1294 | |
4a0aab28 | 1295 | } else { |
3b77b2d1 | 1296 | ///Not possible for AODs |
1297 | return kTRUE; | |
4a0aab28 | 1298 | } |
3b77b2d1 | 1299 | |
1300 | ||
1301 | ||
e5b6e8a6 | 1302 | |
3b77b2d1 | 1303 | } |
1304 | ||
1305 | ||
1306 | ///________________________________________________________________________ | |
1307 | Bool_t AliConversionCuts::AcceptanceCut(TParticle *particle, TParticle * ePos,TParticle* eNeg){ | |
4a0aab28 | 1308 | // MC Acceptance Cuts |
1309 | //(Certain areas were excluded for photon reconstruction) | |
3b77b2d1 | 1310 | |
4a0aab28 | 1311 | if(particle->R()>fMaxR){ |
1312 | return kFALSE;} | |
3b77b2d1 | 1313 | |
4a0aab28 | 1314 | if(ePos->R()>fMaxR){ |
1315 | return kFALSE; | |
1316 | } | |
3b77b2d1 | 1317 | |
4a0aab28 | 1318 | if(ePos->R()<fMinR){ |
1319 | return kFALSE; | |
1320 | } | |
3b77b2d1 | 1321 | |
e5b6e8a6 | 1322 | if( ePos->R() <= ((abs(ePos->Vz())*fLineCutZRSlope)-fLineCutZValue)){ |
4a0aab28 | 1323 | return kFALSE; |
1324 | } | |
e5b6e8a6 | 1325 | else if (fUseEtaMinCut && ePos->R() >= ((abs(ePos->Vz())*fLineCutZRSlopeMin)-fLineCutZValueMin )){ |
3b77b2d1 | 1326 | return kFALSE; |
4a0aab28 | 1327 | } |
3b77b2d1 | 1328 | |
e5b6e8a6 | 1329 | if(abs(eNeg->Vz()) > fMaxZ ){ // cuts out regions where we do not reconstruct |
4a0aab28 | 1330 | return kFALSE; |
1331 | } | |
3b77b2d1 | 1332 | |
4a0aab28 | 1333 | if(eNeg->Vz()!=ePos->Vz()||eNeg->R()!=ePos->R()){ |
1334 | return kFALSE; | |
1335 | } | |
3b77b2d1 | 1336 | |
e5b6e8a6 | 1337 | if(abs(ePos->Vz()) > fMaxZ ){ // cuts out regions where we do not reconstruct |
4a0aab28 | 1338 | return kFALSE; |
1339 | } | |
3b77b2d1 | 1340 | |
e5b6e8a6 | 1341 | if(abs(particle->Eta())> fEtaCut || abs(particle->Eta())< fEtaCutMin){ |
4a0aab28 | 1342 | return kFALSE; |
1343 | } | |
3b77b2d1 | 1344 | |
e5b6e8a6 | 1345 | if(abs(ePos->Eta())> fEtaCut || abs(ePos->Eta())< fEtaCutMin){ |
4a0aab28 | 1346 | return kFALSE; |
1347 | } | |
3b77b2d1 | 1348 | |
e5b6e8a6 | 1349 | if(abs(eNeg->Eta())> fEtaCut || abs(eNeg->Eta())< fEtaCutMin){ |
4a0aab28 | 1350 | return kFALSE; |
1351 | } | |
3b77b2d1 | 1352 | |
4a0aab28 | 1353 | if( ePos->Pt()< fSinglePtCut || eNeg->Pt()< fSinglePtCut){ |
1354 | return kFALSE; | |
1355 | } | |
3b77b2d1 | 1356 | |
4a0aab28 | 1357 | if(particle->Pt()<fPtCut){ |
1358 | return kFALSE; | |
1359 | } | |
3b77b2d1 | 1360 | |
4a0aab28 | 1361 | return kTRUE; |
3b77b2d1 | 1362 | } |
1363 | ///________________________________________________________________________ | |
e5b6e8a6 | 1364 | Bool_t AliConversionCuts::UpdateCutString() { |
4a0aab28 | 1365 | ///Update the cut string (if it has been created yet) |
3b77b2d1 | 1366 | |
4a0aab28 | 1367 | if(fCutString && fCutString->GetString().Length() == kNCuts) { |
1368 | fCutString->SetString(GetCutNumber()); | |
1369 | } else { | |
1370 | return kFALSE; | |
1371 | } | |
1372 | return kTRUE; | |
3b77b2d1 | 1373 | } |
1374 | ||
1375 | ///________________________________________________________________________ | |
1376 | Bool_t AliConversionCuts::InitializeCutsFromCutString(const TString analysisCutSelection ) { | |
1377 | // Initialize Cuts from a given Cut string | |
1378 | ||
4a0aab28 | 1379 | AliInfo(Form("Set Photoncut Number: %s",analysisCutSelection.Data())); |
1380 | if(analysisCutSelection.Length()!=kNCuts) { | |
1381 | AliError(Form("Cut selection has the wrong length! size is %d, number of cuts is %d", analysisCutSelection.Length(), kNCuts)); | |
1382 | return kFALSE; | |
1383 | } | |
1384 | if(!analysisCutSelection.IsDigit()){ | |
1385 | AliError("Cut selection contains characters"); | |
1386 | return kFALSE; | |
1387 | } | |
e5b6e8a6 | 1388 | |
4a0aab28 | 1389 | const char *cutSelection = analysisCutSelection.Data(); |
1390 | #define ASSIGNARRAY(i) fCuts[i] = cutSelection[i] - '0' | |
1391 | for(Int_t ii=0;ii<kNCuts;ii++){ | |
3b77b2d1 | 1392 | ASSIGNARRAY(ii); |
4a0aab28 | 1393 | } |
3b77b2d1 | 1394 | |
4a0aab28 | 1395 | // Set Individual Cuts |
1396 | for(Int_t ii=0;ii<kNCuts;ii++){ | |
3b77b2d1 | 1397 | if(!SetCut(cutIds(ii),fCuts[ii]))return kFALSE; |
4a0aab28 | 1398 | } |
3b77b2d1 | 1399 | |
4a0aab28 | 1400 | //PrintCuts(); |
92efd725 | 1401 | |
4a0aab28 | 1402 | // Set StandardTriggers |
92efd725 | 1403 | |
4a0aab28 | 1404 | if(fIsHeavyIon)SelectCollisionCandidates(AliVEvent::kMB | AliVEvent::kCentral | AliVEvent::kSemiCentral); |
1405 | else SelectCollisionCandidates(AliVEvent::kMB); | |
3b77b2d1 | 1406 | |
4a0aab28 | 1407 | return kTRUE; |
3b77b2d1 | 1408 | } |
1409 | ///________________________________________________________________________ | |
1410 | Bool_t AliConversionCuts::SetCut(cutIds cutID, const Int_t value) { | |
4a0aab28 | 1411 | ///Set individual cut ID |
3b77b2d1 | 1412 | |
4a0aab28 | 1413 | switch (cutID) { |
e5b6e8a6 | 1414 | |
4a0aab28 | 1415 | case kv0FinderType: |
1416 | if( SetV0Finder(value)) { | |
1417 | fCuts[kv0FinderType] = value; | |
e5b6e8a6 | 1418 | UpdateCutString(); |
4a0aab28 | 1419 | return kTRUE; |
1420 | } else return kFALSE; | |
1421 | ||
1422 | case kededxSigmaCut: | |
1423 | if( SetTPCdEdxCutElectronLine(value)) { | |
1424 | fCuts[kededxSigmaCut] = value; | |
e5b6e8a6 | 1425 | UpdateCutString(); |
4a0aab28 | 1426 | return kTRUE; |
1427 | } else return kFALSE; | |
1428 | ||
1429 | case kpidedxSigmaCut: | |
1430 | if( SetTPCdEdxCutPionLine(value)) { | |
1431 | fCuts[kpidedxSigmaCut] = value; | |
e5b6e8a6 | 1432 | UpdateCutString(); |
4a0aab28 | 1433 | return kTRUE; |
1434 | } else return kFALSE; | |
1435 | ||
1436 | case kpiMomdedxSigmaCut: | |
1437 | if( SetMinMomPiondEdxCut(value)) { | |
1438 | fCuts[kpiMomdedxSigmaCut] = value; | |
e5b6e8a6 | 1439 | UpdateCutString(); |
4a0aab28 | 1440 | return kTRUE; |
1441 | } else return kFALSE; | |
1442 | ||
1443 | case kchi2GammaCut: | |
1444 | if( SetChi2GammaCut(value)) { | |
1445 | fCuts[kchi2GammaCut] = value; | |
e5b6e8a6 | 1446 | UpdateCutString(); |
4a0aab28 | 1447 | return kTRUE; |
1448 | } else return kFALSE; | |
1449 | ||
1450 | case ksinglePtCut: | |
1451 | if( SetSinglePtCut(value)) { | |
1452 | fCuts[ksinglePtCut] = value; | |
e5b6e8a6 | 1453 | UpdateCutString(); |
4a0aab28 | 1454 | return kTRUE; |
1455 | } else return kFALSE; | |
1456 | ||
1457 | case kclsTPCCut: | |
1458 | if( SetTPCClusterCut(value)) { | |
1459 | fCuts[kclsTPCCut] = value; | |
e5b6e8a6 | 1460 | UpdateCutString(); |
4a0aab28 | 1461 | return kTRUE; |
1462 | } else return kFALSE; | |
1463 | ||
1464 | case ketaCut: | |
1465 | if( SetEtaCut(value)) { | |
1466 | fCuts[ketaCut] = value; | |
e5b6e8a6 | 1467 | UpdateCutString(); |
4a0aab28 | 1468 | return kTRUE; |
1469 | } else return kFALSE; | |
1470 | ||
1471 | case kLowPRejectionSigmaCut: | |
1472 | if( SetLowPRejectionCuts(value)) { | |
1473 | fCuts[kLowPRejectionSigmaCut] = value; | |
e5b6e8a6 | 1474 | UpdateCutString(); |
4a0aab28 | 1475 | return kTRUE; |
1476 | } else return kFALSE; | |
1477 | ||
1478 | case kQtMaxCut: | |
1479 | if( SetQtMaxCut(value)) { | |
1480 | fCuts[kQtMaxCut] = value; | |
e5b6e8a6 | 1481 | UpdateCutString(); |
4a0aab28 | 1482 | return kTRUE; |
1483 | } else return kFALSE; | |
1484 | ||
1485 | case kpiMaxMomdedxSigmaCut: | |
1486 | if( SetMaxMomPiondEdxCut(value)) { | |
1487 | fCuts[kpiMaxMomdedxSigmaCut] = value; | |
e5b6e8a6 | 1488 | UpdateCutString(); |
4a0aab28 | 1489 | return kTRUE; |
1490 | } else return kFALSE; | |
1491 | ||
1492 | case kRCut: | |
1493 | if( SetRCut(value)) { | |
1494 | fCuts[kRCut] = value; | |
e5b6e8a6 | 1495 | UpdateCutString(); |
4a0aab28 | 1496 | return kTRUE; |
1497 | } else return kFALSE; | |
1498 | ||
1499 | case kremovePileUp: | |
1500 | if( SetRemovePileUp(value)) { | |
1501 | fCuts[kremovePileUp] = value; | |
e5b6e8a6 | 1502 | UpdateCutString(); |
4a0aab28 | 1503 | return kTRUE; |
1504 | } else return kFALSE; | |
1505 | ||
1506 | case kselectV0AND: | |
e5b6e8a6 | 1507 | if( SetSelectSpecialTrigger(value)) { |
4a0aab28 | 1508 | fCuts[kselectV0AND] = value; |
e5b6e8a6 | 1509 | UpdateCutString(); |
4a0aab28 | 1510 | return kTRUE; |
1511 | } else return kFALSE; | |
1512 | ||
1513 | case kmultiplicityMethod: | |
1514 | if( SetMultiplicityMethod(value)) { | |
1515 | fCuts[kmultiplicityMethod] = value; | |
e5b6e8a6 | 1516 | UpdateCutString(); |
4a0aab28 | 1517 | return kTRUE; |
1518 | } else return kFALSE; | |
1519 | ||
1520 | case kisHeavyIon: | |
1521 | if( SetIsHeavyIon(value)) { | |
1522 | fCuts[kisHeavyIon] = value; | |
e5b6e8a6 | 1523 | UpdateCutString(); |
4a0aab28 | 1524 | return kTRUE; |
1525 | } else return kFALSE; | |
1526 | ||
1527 | case kCentralityMin: | |
1528 | if( SetCentralityMin(value)) { | |
1529 | fCuts[kCentralityMin] = value; | |
e5b6e8a6 | 1530 | UpdateCutString(); |
4a0aab28 | 1531 | return kTRUE; |
1532 | } else return kFALSE; | |
1533 | ||
1534 | case kCentralityMax: | |
1535 | if( SetCentralityMax(value)) { | |
1536 | fCuts[kCentralityMax] = value; | |
e5b6e8a6 | 1537 | UpdateCutString(); |
4a0aab28 | 1538 | return kTRUE; |
1539 | } else return kFALSE; | |
1540 | ||
1541 | case kTOFelectronPID: | |
1542 | if( SetTOFElectronPIDCut(value)) { | |
1543 | fCuts[kTOFelectronPID] = value; | |
e5b6e8a6 | 1544 | UpdateCutString(); |
4a0aab28 | 1545 | return kTRUE; |
1546 | } else return kFALSE; | |
1547 | ||
1548 | case kdoPhotonAsymmetryCut: | |
1549 | if( SetPhotonAsymmetryCut(value)) { | |
1550 | fCuts[kdoPhotonAsymmetryCut] = value; | |
e5b6e8a6 | 1551 | UpdateCutString(); |
4a0aab28 | 1552 | return kTRUE; |
1553 | } else return kFALSE; | |
1554 | ||
1555 | case kPsiPair: | |
1556 | if( SetPsiPairCut(value)) { | |
1557 | fCuts[kPsiPair] = value; | |
e5b6e8a6 | 1558 | UpdateCutString(); |
4a0aab28 | 1559 | return kTRUE; |
1560 | } else return kFALSE; | |
1561 | ||
1562 | case kCosPAngle: | |
1563 | if( SetCosPAngleCut(value)) { | |
1564 | fCuts[kCosPAngle] = value; | |
e5b6e8a6 | 1565 | UpdateCutString(); |
4a0aab28 | 1566 | return kTRUE; |
1567 | } else return kFALSE; | |
1568 | ||
1569 | ||
1570 | case kElecShare: | |
1571 | if( SetSharedElectronCut(value)) { | |
1572 | fCuts[kElecShare] = value; | |
e5b6e8a6 | 1573 | UpdateCutString(); |
4a0aab28 | 1574 | return kTRUE; |
1575 | } else return kFALSE; | |
1576 | ||
4a0aab28 | 1577 | case kToCloseV0s: |
1578 | if( SetToCloseV0sCut(value)) { | |
1579 | fCuts[kToCloseV0s] = value; | |
e5b6e8a6 | 1580 | UpdateCutString(); |
4a0aab28 | 1581 | return kTRUE; |
1582 | } else return kFALSE; | |
1583 | ||
1584 | case kExtraSignals: | |
1585 | if( SetRejectExtraSignalsCut(value)) { | |
1586 | fCuts[kExtraSignals] = value; | |
e5b6e8a6 | 1587 | UpdateCutString(); |
4a0aab28 | 1588 | return kTRUE; |
1589 | } else return kFALSE; | |
1590 | ||
4a0aab28 | 1591 | case kNCuts: |
92efd725 | 1592 | AliError("Cut id out of range"); |
4a0aab28 | 1593 | return kFALSE; |
1594 | } | |
d008165e | 1595 | |
4a0aab28 | 1596 | AliError("Cut id %d not recognized"); |
1597 | return kFALSE; | |
3b77b2d1 | 1598 | |
e5b6e8a6 | 1599 | |
3b77b2d1 | 1600 | } |
1601 | ///________________________________________________________________________ | |
e5b6e8a6 | 1602 | void AliConversionCuts::PrintCuts() { |
1603 | // Print out current Cut Selection | |
1604 | for(Int_t ic = 0; ic < kNCuts; ic++) { | |
1605 | printf("%-30s : %d \n", fgkCutNames[ic], fCuts[ic]); | |
1606 | } | |
1607 | } | |
1608 | ///________________________________________________________________________ | |
1609 | Bool_t AliConversionCuts::SetIsHeavyIon(Int_t isHeavyIon) | |
1610 | { // Set Cut | |
1611 | switch(isHeavyIon){ | |
4a0aab28 | 1612 | case 0: |
e5b6e8a6 | 1613 | fIsHeavyIon=0; |
4a0aab28 | 1614 | break; |
1615 | case 1: | |
e5b6e8a6 | 1616 | fIsHeavyIon=1; |
1617 | fDetectorCentrality=0; | |
1618 | break; | |
1619 | case 2: | |
1620 | fIsHeavyIon=1; | |
1621 | fDetectorCentrality=1; | |
1622 | break; | |
1623 | case 3: //allows to select centrality 0-45% in steps of 5% for V0 Multiplicity | |
1624 | fIsHeavyIon=1; | |
1625 | fDetectorCentrality=0; | |
1626 | fModCentralityClass=1; | |
1627 | break; | |
1628 | case 4: //allows to select centrality 45-90% in steps of 5% for V0 Multiplicity | |
1629 | fIsHeavyIon=1; | |
1630 | fDetectorCentrality=0; | |
1631 | fModCentralityClass=2; | |
1632 | break; | |
1633 | case 5: //strict cut on v0 tracks for MC | |
1634 | fIsHeavyIon=1; | |
1635 | fDetectorCentrality=0; | |
1636 | fModCentralityClass=3; | |
1637 | break; | |
1638 | case 6: //allows to select centrality 0-45% in steps of 5% for V0 Multiplicity | |
1639 | //strict cut on v0 tracks for MC | |
1640 | fIsHeavyIon=1; | |
1641 | fDetectorCentrality=0; | |
1642 | fModCentralityClass=4; | |
1643 | break; | |
1644 | case 7: //allows to select centrality 45-90% in steps of 5% for V0 Multiplicity | |
1645 | //strict cut on v0 tracks for MC | |
1646 | fIsHeavyIon=1; | |
1647 | fDetectorCentrality=0; | |
1648 | fModCentralityClass=5; | |
4a0aab28 | 1649 | break; |
1650 | default: | |
e5b6e8a6 | 1651 | AliError(Form("SetHeavyIon not defined %d",isHeavyIon)); |
4a0aab28 | 1652 | return kFALSE; |
1653 | } | |
1654 | return kTRUE; | |
3b77b2d1 | 1655 | } |
e5b6e8a6 | 1656 | //___________________________________________________________________ |
1657 | Bool_t AliConversionCuts::SetCentralityMin(Int_t minCentrality) | |
1658 | { | |
1659 | // Set Cut | |
1660 | if(minCentrality<0||minCentrality>9){ | |
1661 | AliError(Form("minCentrality not defined %d",minCentrality)); | |
1662 | return kFALSE; | |
1663 | } | |
3b77b2d1 | 1664 | |
e5b6e8a6 | 1665 | fCentralityMin=minCentrality; |
1666 | return kTRUE; | |
1667 | } | |
1668 | //___________________________________________________________________ | |
1669 | Bool_t AliConversionCuts::SetCentralityMax(Int_t maxCentrality) | |
1670 | { | |
1671 | // Set Cut | |
1672 | if(maxCentrality<0||maxCentrality>9){ | |
1673 | AliError(Form("maxCentrality not defined %d",maxCentrality)); | |
1674 | return kFALSE; | |
1675 | } | |
1676 | fCentralityMax=maxCentrality; | |
1677 | return kTRUE; | |
1678 | } | |
3b77b2d1 | 1679 | ///________________________________________________________________________ |
e5b6e8a6 | 1680 | Int_t AliConversionCuts::SetSelectSpecialTrigger(Int_t selectSpecialTrigger) |
3b77b2d1 | 1681 | {// Set Cut |
e5b6e8a6 | 1682 | |
1683 | switch(selectSpecialTrigger){ | |
4a0aab28 | 1684 | case 0: |
e5b6e8a6 | 1685 | fSpecialTrigger=0; // dont care |
3b77b2d1 | 1686 | break; |
4a0aab28 | 1687 | case 1: |
e5b6e8a6 | 1688 | fSpecialTrigger=1; // V0AND |
1689 | break; | |
1690 | case 2: | |
1691 | fSpecialTrigger=2; // with SDD requested | |
1692 | break; | |
1693 | case 3: | |
1694 | fSpecialTrigger=3; // V0AND plus with SDD requested | |
3b77b2d1 | 1695 | break; |
e5b6e8a6 | 1696 | |
4a0aab28 | 1697 | default: |
e5b6e8a6 | 1698 | AliError("Warning: Special Trigger Not known"); |
3b77b2d1 | 1699 | return kFALSE; |
4a0aab28 | 1700 | } |
1701 | return kTRUE; | |
3b77b2d1 | 1702 | } |
3b77b2d1 | 1703 | ///________________________________________________________________________ |
92efd725 | 1704 | Bool_t AliConversionCuts::SetMultiplicityMethod(Int_t multiplicityMethod) |
1705 | { | |
4a0aab28 | 1706 | // Set Cut |
1707 | fMultiplicityMethod=multiplicityMethod; | |
92efd725 | 1708 | |
4a0aab28 | 1709 | // 0 Photon Multiplicity |
1710 | // 1 TPC Track multiplicity | |
1711 | // 2 V0 Mult | |
1712 | // 3 SPD Mult | |
92efd725 | 1713 | |
4a0aab28 | 1714 | return kTRUE; |
3b77b2d1 | 1715 | } |
3b77b2d1 | 1716 | ///________________________________________________________________________ |
e5b6e8a6 | 1717 | Bool_t AliConversionCuts::SetRemovePileUp(Int_t removePileUp) |
1718 | {// Set Cut | |
1719 | switch(removePileUp){ | |
1720 | case 0: | |
1721 | fRemovePileUp=kFALSE; | |
1722 | break; | |
1723 | case 1: | |
1724 | fRemovePileUp=kTRUE; | |
1725 | break; | |
1726 | default: | |
1727 | AliError("RemovePileUpCut not defined"); | |
1728 | return kFALSE; | |
4a0aab28 | 1729 | } |
e5b6e8a6 | 1730 | return kTRUE; |
3b77b2d1 | 1731 | } |
3b77b2d1 | 1732 | ///________________________________________________________________________ |
e5b6e8a6 | 1733 | Bool_t AliConversionCuts::SetRejectExtraSignalsCut(Int_t extraSignal) { |
1734 | ||
1735 | switch(extraSignal){ | |
4a0aab28 | 1736 | case 0: |
e5b6e8a6 | 1737 | fRejectExtraSignals = 0; |
1738 | break; // No Rejection | |
4a0aab28 | 1739 | case 1: |
e5b6e8a6 | 1740 | fRejectExtraSignals = 1; |
1741 | break; // MinBias Header | |
4a0aab28 | 1742 | case 2: |
e5b6e8a6 | 1743 | fRejectExtraSignals = 2; |
1744 | break; // User String Array | |
4a0aab28 | 1745 | case 3: |
e5b6e8a6 | 1746 | fRejectExtraSignals = 3; |
1747 | break; // Rejection for Gamma Correction only | |
1748 | default: | |
1749 | AliError(Form("Extra Signal Rejection not defined %d",extraSignal)); | |
1750 | return kFALSE; | |
1751 | } | |
1752 | return kTRUE; | |
1753 | } | |
1754 | ///________________________________________________________________________ | |
1755 | Bool_t AliConversionCuts::SetV0Finder(Int_t v0FinderType) | |
1756 | { // Set Cut | |
1757 | switch (v0FinderType){ | |
1758 | case 0: // on fly V0 finder | |
1759 | fUseOnFlyV0Finder=kTRUE; | |
4a0aab28 | 1760 | break; |
e5b6e8a6 | 1761 | case 1: // offline V0 finder |
1762 | fUseOnFlyV0Finder=kFALSE; | |
4a0aab28 | 1763 | break; |
4a0aab28 | 1764 | default: |
e5b6e8a6 | 1765 | AliError(Form(" v0FinderType not defined %d",v0FinderType)); |
4a0aab28 | 1766 | return kFALSE; |
1767 | } | |
1768 | return kTRUE; | |
3b77b2d1 | 1769 | } |
3b77b2d1 | 1770 | ///________________________________________________________________________ |
e5b6e8a6 | 1771 | Bool_t AliConversionCuts::SetEtaCut(Int_t etaCut) |
3b77b2d1 | 1772 | { // Set Cut |
e5b6e8a6 | 1773 | |
1774 | //Set Standard LineCutZValues | |
1775 | fLineCutZValueMin = -2; | |
1776 | fLineCutZValue = 7.; | |
1777 | ||
1778 | switch(etaCut){ | |
1779 | case 0: // 0.9 | |
1780 | fEtaCut = 0.9; | |
1781 | fLineCutZRSlope = tan(2*atan(exp(-fEtaCut))); | |
1782 | fEtaCutMin = -0.1; | |
1783 | fLineCutZRSlopeMin = 0.; | |
4a0aab28 | 1784 | break; |
e5b6e8a6 | 1785 | case 1: // 1.2 |
1786 | fEtaCut = 1.2; | |
1787 | fLineCutZRSlope = tan(2*atan(exp(-fEtaCut))); | |
1788 | fEtaCutMin = -0.1; | |
1789 | fLineCutZRSlopeMin = 0.; | |
4a0aab28 | 1790 | break; |
e5b6e8a6 | 1791 | case 2: // 1.4 |
1792 | fEtaCut = 1.4; | |
1793 | fLineCutZRSlope = tan(2*atan(exp(-fEtaCut))); | |
1794 | fEtaCutMin = -0.1; | |
1795 | fLineCutZRSlopeMin = 0.; | |
4a0aab28 | 1796 | break; |
e5b6e8a6 | 1797 | case 3: // 0.8 |
1798 | fEtaCut = 0.8; | |
1799 | fLineCutZRSlope = tan(2*atan(exp(-fEtaCut))); | |
1800 | fEtaCutMin = -0.1; | |
1801 | fLineCutZRSlopeMin = 0.; | |
4a0aab28 | 1802 | break; |
e5b6e8a6 | 1803 | case 4: // 1. |
1804 | fEtaCut = 1.0; | |
1805 | fLineCutZRSlope = tan(2*atan(exp(-fEtaCut))); | |
1806 | fEtaCutMin = -0.1; | |
1807 | fLineCutZRSlopeMin = 0.; | |
4a0aab28 | 1808 | break; |
e5b6e8a6 | 1809 | case 5: // 0.9 - 1.4 |
1810 | fEtaCut = 1.4; | |
1811 | fLineCutZRSlope = tan(2*atan(exp(-fEtaCut))); | |
1812 | fEtaCutMin = 0.9; | |
1813 | fLineCutZRSlopeMin = tan(2*atan(exp(-fEtaCutMin))); | |
4a0aab28 | 1814 | break; |
e5b6e8a6 | 1815 | case 6: // 5. |
1816 | fEtaCut = 5.; | |
1817 | fLineCutZRSlope = tan(2*atan(exp(-fEtaCut))); | |
1818 | fEtaCutMin = -0.1; | |
1819 | fLineCutZRSlopeMin = 0.; | |
4a0aab28 | 1820 | break; |
e5b6e8a6 | 1821 | case 7: // 0.1 - 0.8 |
1822 | fEtaCut = 0.8; | |
1823 | fLineCutZRSlope = tan(2*atan(exp(-fEtaCut))); | |
1824 | fEtaCutMin = 0.1; | |
1825 | fLineCutZRSlopeMin = tan(2*atan(exp(-fEtaCutMin))); | |
1826 | break; | |
1827 | case 8: // 0.1 - 0.8 | |
1828 | fEtaCut = 0.9; | |
1829 | fLineCutZRSlope = tan(2*atan(exp(-fEtaCut))); | |
1830 | fEtaCutMin = 0.1; | |
1831 | fLineCutZRSlopeMin = tan(2*atan(exp(-fEtaCutMin))); | |
1832 | break; | |
1833 | case 9: // 10 | |
1834 | fEtaCut = 10; | |
1835 | fLineCutZRSlope = tan(2*atan(exp(-fEtaCut))); | |
1836 | fEtaCutMin = -0.1; | |
1837 | fLineCutZRSlopeMin = 0.; | |
4a0aab28 | 1838 | break; |
1839 | default: | |
e5b6e8a6 | 1840 | AliError(Form(" EtaCut not defined %d",etaCut)); |
4a0aab28 | 1841 | return kFALSE; |
4a0aab28 | 1842 | } |
1843 | return kTRUE; | |
3b77b2d1 | 1844 | } |
3b77b2d1 | 1845 | ///________________________________________________________________________ |
e5b6e8a6 | 1846 | Bool_t AliConversionCuts::SetRCut(Int_t RCut){ |
1847 | // Set Cut | |
1848 | switch(RCut){ | |
1849 | case 0: | |
1850 | fMinR=0; | |
1851 | fMaxR = 180.; | |
4a0aab28 | 1852 | break; |
e5b6e8a6 | 1853 | case 1: |
1854 | fMinR=2.8; | |
1855 | fMaxR = 180.; | |
4a0aab28 | 1856 | break; |
e5b6e8a6 | 1857 | case 2: |
1858 | fMinR=5.; | |
1859 | fMaxR = 180.; | |
4a0aab28 | 1860 | break; |
e5b6e8a6 | 1861 | case 3: |
1862 | fMaxR = 70.; | |
1863 | fMinR = 10.; | |
4a0aab28 | 1864 | break; |
e5b6e8a6 | 1865 | case 4: |
1866 | fMaxR = 70.; | |
1867 | fMinR = 5.; | |
4a0aab28 | 1868 | break; |
e5b6e8a6 | 1869 | // High purity cuts for PbPb (remove first layers of material) |
1870 | case 5: | |
1871 | fMaxR = 180.; | |
1872 | fMinR = 10.; | |
4a0aab28 | 1873 | break; |
e5b6e8a6 | 1874 | case 6: |
1875 | fMaxR = 180.; | |
1876 | fMinR = 20.; | |
4a0aab28 | 1877 | break; |
e5b6e8a6 | 1878 | case 7: |
1879 | fMaxR = 180.; | |
1880 | fMinR = 26.; | |
4a0aab28 | 1881 | break; |
e5b6e8a6 | 1882 | case 8: |
1883 | fMaxR = 180.; | |
1884 | fMinR = 35.; | |
4a0aab28 | 1885 | break; |
1886 | case 9: | |
e5b6e8a6 | 1887 | fMaxR = 35.; |
1888 | fMinR = 5.; | |
4a0aab28 | 1889 | break; |
e5b6e8a6 | 1890 | |
4a0aab28 | 1891 | default: |
e5b6e8a6 | 1892 | AliError("RCut not defined"); |
4a0aab28 | 1893 | return kFALSE; |
1894 | } | |
1895 | return kTRUE; | |
92efd725 | 1896 | } |
92efd725 | 1897 | ///________________________________________________________________________ |
e5b6e8a6 | 1898 | Bool_t AliConversionCuts::SetSinglePtCut(Int_t singlePtCut) |
92efd725 | 1899 | { // Set Cut |
e5b6e8a6 | 1900 | switch(singlePtCut){ |
1901 | case 0: // 0.050 GeV | |
1902 | fSinglePtCut = 0.050; | |
4a0aab28 | 1903 | break; |
e5b6e8a6 | 1904 | case 1: // 0.100 GeV |
1905 | fSinglePtCut = 0.100; | |
4a0aab28 | 1906 | break; |
e5b6e8a6 | 1907 | case 2: // 0.150 GeV |
1908 | fSinglePtCut = 0.150; | |
4a0aab28 | 1909 | break; |
e5b6e8a6 | 1910 | case 3: // 0.200 GeV |
1911 | fSinglePtCut = 0.200; | |
4a0aab28 | 1912 | break; |
e5b6e8a6 | 1913 | case 4: // 0.075 GeV |
1914 | fSinglePtCut = 0.075; | |
4a0aab28 | 1915 | break; |
e5b6e8a6 | 1916 | case 5: // 0.125 GeV |
1917 | fSinglePtCut = 0.125; | |
4a0aab28 | 1918 | break; |
e5b6e8a6 | 1919 | case 6: // 0.04 GeV |
1920 | fSinglePtCut = 0.040; | |
4a0aab28 | 1921 | break; |
e5b6e8a6 | 1922 | case 7: // 0.0 GeV |
1923 | fSinglePtCut = 0.0; | |
4a0aab28 | 1924 | break; |
1925 | default: | |
e5b6e8a6 | 1926 | AliError(Form("singlePtCut not defined %d",singlePtCut)); |
4a0aab28 | 1927 | return kFALSE; |
1928 | } | |
1929 | return kTRUE; | |
3b77b2d1 | 1930 | } |
3b77b2d1 | 1931 | ///________________________________________________________________________ |
e5b6e8a6 | 1932 | Bool_t AliConversionCuts::SetTPCClusterCut(Int_t clsTPCCut) |
3b77b2d1 | 1933 | { // Set Cut |
e5b6e8a6 | 1934 | switch(clsTPCCut){ |
1935 | case 0: // 0 | |
1936 | fMinClsTPC= 0.; | |
4a0aab28 | 1937 | break; |
e5b6e8a6 | 1938 | case 1: // 70 |
1939 | fMinClsTPC= 70.; | |
4a0aab28 | 1940 | break; |
e5b6e8a6 | 1941 | case 2: // 80 |
1942 | fMinClsTPC= 80.; | |
4a0aab28 | 1943 | break; |
e5b6e8a6 | 1944 | case 3: // 100 |
1945 | fMinClsTPC= 100.; | |
4a0aab28 | 1946 | break; |
e5b6e8a6 | 1947 | case 4: // 60% of findable clusters |
1948 | fMinClsTPCToF= 0.6; | |
1949 | fUseCorrectedTPCClsInfo=0; | |
4a0aab28 | 1950 | break; |
e5b6e8a6 | 1951 | case 5: // 0% of findable clusters |
1952 | fMinClsTPCToF= 0.0; | |
1953 | fUseCorrectedTPCClsInfo=1; | |
4a0aab28 | 1954 | break; |
e5b6e8a6 | 1955 | case 6: // 70% of findable clusters |
1956 | fMinClsTPCToF= 0.7; | |
1957 | fUseCorrectedTPCClsInfo=1; | |
4a0aab28 | 1958 | break; |
e5b6e8a6 | 1959 | case 7: // 0% of findable clusters |
1960 | fMinClsTPCToF= 0.35; | |
1961 | fUseCorrectedTPCClsInfo=0; | |
4a0aab28 | 1962 | break; |
1963 | case 8: | |
e5b6e8a6 | 1964 | fMinClsTPCToF= 0.35; |
1965 | fUseCorrectedTPCClsInfo=1; | |
4a0aab28 | 1966 | break; |
1967 | case 9: | |
e5b6e8a6 | 1968 | fMinClsTPCToF= 0.6; |
1969 | fUseCorrectedTPCClsInfo=1; | |
4a0aab28 | 1970 | break; |
1971 | default: | |
e5b6e8a6 | 1972 | AliError(Form("Warning: clsTPCCut not defined %d",clsTPCCut)); |
4a0aab28 | 1973 | return kFALSE; |
1974 | } | |
1975 | return kTRUE; | |
3b77b2d1 | 1976 | } |
3b77b2d1 | 1977 | ///________________________________________________________________________ |
e5b6e8a6 | 1978 | Bool_t AliConversionCuts::SetTPCdEdxCutElectronLine(Int_t ededxSigmaCut) |
3b77b2d1 | 1979 | { // Set Cut |
e5b6e8a6 | 1980 | switch(ededxSigmaCut){ |
1981 | case 0: // -10,10 | |
1982 | fPIDnSigmaBelowElectronLine=-10; | |
1983 | fPIDnSigmaAboveElectronLine=10; | |
4a0aab28 | 1984 | break; |
e5b6e8a6 | 1985 | case 1: // -5,5 |
1986 | fPIDnSigmaBelowElectronLine=-5; | |
1987 | fPIDnSigmaAboveElectronLine=5; | |
4a0aab28 | 1988 | break; |
e5b6e8a6 | 1989 | case 2: // -3,5 |
1990 | fPIDnSigmaBelowElectronLine=-3; | |
1991 | fPIDnSigmaAboveElectronLine=5; | |
4a0aab28 | 1992 | break; |
e5b6e8a6 | 1993 | case 3: // -4,5 |
1994 | fPIDnSigmaBelowElectronLine=-4; | |
1995 | fPIDnSigmaAboveElectronLine=5; | |
4a0aab28 | 1996 | break; |
e5b6e8a6 | 1997 | case 4: // -6,7 |
1998 | fPIDnSigmaBelowElectronLine=-6; | |
1999 | fPIDnSigmaAboveElectronLine=7; | |
4a0aab28 | 2000 | break; |
e5b6e8a6 | 2001 | case 5: // -4,4 |
2002 | fPIDnSigmaBelowElectronLine=-4; | |
2003 | fPIDnSigmaAboveElectronLine=4; | |
4a0aab28 | 2004 | break; |
e5b6e8a6 | 2005 | case 6: // -2.5,4 |
2006 | fPIDnSigmaBelowElectronLine=-2.5; | |
2007 | fPIDnSigmaAboveElectronLine=4; | |
4a0aab28 | 2008 | break; |
e5b6e8a6 | 2009 | case 7: // -2,3.5 |
2010 | fPIDnSigmaBelowElectronLine=-2; | |
2011 | fPIDnSigmaAboveElectronLine=3.5; | |
4a0aab28 | 2012 | break; |
2013 | default: | |
e5b6e8a6 | 2014 | AliError("TPCdEdxCutElectronLine not defined"); |
4a0aab28 | 2015 | return kFALSE; |
e5b6e8a6 | 2016 | |
4a0aab28 | 2017 | } |
2018 | return kTRUE; | |
3b77b2d1 | 2019 | } |
2020 | ///________________________________________________________________________ | |
e5b6e8a6 | 2021 | Bool_t AliConversionCuts::SetTPCdEdxCutPionLine(Int_t pidedxSigmaCut) |
3b77b2d1 | 2022 | { // Set Cut |
e5b6e8a6 | 2023 | |
2024 | switch(pidedxSigmaCut){ | |
2025 | case 0: // -10 | |
2026 | fPIDnSigmaAbovePionLine=-10; | |
2027 | fPIDnSigmaAbovePionLineHighPt=-10; | |
4a0aab28 | 2028 | break; |
e5b6e8a6 | 2029 | case 1: // 0 |
2030 | fPIDnSigmaAbovePionLine=0; | |
2031 | fPIDnSigmaAbovePionLineHighPt=-10; | |
4a0aab28 | 2032 | break; |
e5b6e8a6 | 2033 | case 2: // 1 |
2034 | fPIDnSigmaAbovePionLine=1; | |
2035 | fPIDnSigmaAbovePionLineHighPt=-10; | |
4a0aab28 | 2036 | break; |
e5b6e8a6 | 2037 | case 3: // 1 |
2038 | fPIDnSigmaAbovePionLine=2.5; | |
2039 | fPIDnSigmaAbovePionLineHighPt=-10; | |
4a0aab28 | 2040 | break; |
e5b6e8a6 | 2041 | case 4: // 1 |
2042 | fPIDnSigmaAbovePionLine=0.5; | |
2043 | fPIDnSigmaAbovePionLineHighPt=-10; | |
4a0aab28 | 2044 | break; |
e5b6e8a6 | 2045 | case 5: // 1 |
2046 | fPIDnSigmaAbovePionLine=2.; | |
2047 | fPIDnSigmaAbovePionLineHighPt=-10; | |
4a0aab28 | 2048 | break; |
e5b6e8a6 | 2049 | case 6: // 1 |
2050 | fPIDnSigmaAbovePionLine=2.; | |
2051 | fPIDnSigmaAbovePionLineHighPt=0.5; | |
4a0aab28 | 2052 | break; |
e5b6e8a6 | 2053 | case 7: // 1 |
2054 | fPIDnSigmaAbovePionLine=3.5; | |
2055 | fPIDnSigmaAbovePionLineHighPt=-10; | |
4a0aab28 | 2056 | break; |
e5b6e8a6 | 2057 | case 8: // 1 |
2058 | fPIDnSigmaAbovePionLine=2.; | |
2059 | fPIDnSigmaAbovePionLineHighPt=1.; | |
4a0aab28 | 2060 | break; |
2061 | case 9: | |
e5b6e8a6 | 2062 | fPIDnSigmaAbovePionLine=3.0; // We need a bit less tight cut on dE/dx |
2063 | fPIDnSigmaAbovePionLineHighPt=-10; | |
4a0aab28 | 2064 | break; |
2065 | default: | |
e5b6e8a6 | 2066 | AliError(Form("Warning: pidedxSigmaCut not defined %d",pidedxSigmaCut)); |
4a0aab28 | 2067 | return kFALSE; |
2068 | } | |
2069 | return kTRUE; | |
3b77b2d1 | 2070 | } |
3b77b2d1 | 2071 | ///________________________________________________________________________ |
e5b6e8a6 | 2072 | Bool_t AliConversionCuts::SetMinMomPiondEdxCut(Int_t piMomdedxSigmaCut) |
3b77b2d1 | 2073 | { // Set Cut |
e5b6e8a6 | 2074 | switch(piMomdedxSigmaCut){ |
2075 | case 0: // 0.5 GeV | |
2076 | fPIDMinPnSigmaAbovePionLine=0.5; | |
4a0aab28 | 2077 | break; |
e5b6e8a6 | 2078 | case 1: // 1. GeV |
2079 | fPIDMinPnSigmaAbovePionLine=1.; | |
4a0aab28 | 2080 | break; |
e5b6e8a6 | 2081 | case 2: // 1.5 GeV |
2082 | fPIDMinPnSigmaAbovePionLine=1.5; | |
4a0aab28 | 2083 | break; |
e5b6e8a6 | 2084 | case 3: // 20.0 GeV |
2085 | fPIDMinPnSigmaAbovePionLine=20.; | |
4a0aab28 | 2086 | break; |
e5b6e8a6 | 2087 | case 4: // 50.0 GeV |
2088 | fPIDMinPnSigmaAbovePionLine=50.; | |
4a0aab28 | 2089 | break; |
e5b6e8a6 | 2090 | case 5: // 0.3 GeV |
2091 | fPIDMinPnSigmaAbovePionLine=0.3; | |
4a0aab28 | 2092 | break; |
e5b6e8a6 | 2093 | case 6: // 0.25 GeV |
2094 | fPIDMinPnSigmaAbovePionLine=0.25; | |
4a0aab28 | 2095 | break; |
e5b6e8a6 | 2096 | case 7: // 0.4 GeV |
2097 | fPIDMinPnSigmaAbovePionLine=0.4; | |
4a0aab28 | 2098 | break; |
e5b6e8a6 | 2099 | case 8: // 0.2 GeV |
2100 | fPIDMinPnSigmaAbovePionLine=0.2; | |
4a0aab28 | 2101 | break; |
2102 | default: | |
e5b6e8a6 | 2103 | AliError(Form("piMomdedxSigmaCut not defined %d",piMomdedxSigmaCut)); |
4a0aab28 | 2104 | return kFALSE; |
2105 | } | |
2106 | return kTRUE; | |
3b77b2d1 | 2107 | } |
3b77b2d1 | 2108 | ///________________________________________________________________________ |
2109 | Bool_t AliConversionCuts::SetMaxMomPiondEdxCut(Int_t piMaxMomdedxSigmaCut) | |
2110 | { // Set Cut | |
4a0aab28 | 2111 | switch(piMaxMomdedxSigmaCut){ |
2112 | case 0: // 100. GeV | |
2113 | fPIDMaxPnSigmaAbovePionLine=100.; | |
2114 | break; | |
2115 | case 1: // 5. GeV | |
2116 | fPIDMaxPnSigmaAbovePionLine=5.; | |
2117 | break; | |
2118 | case 2: // 4. GeV | |
2119 | fPIDMaxPnSigmaAbovePionLine=4.; | |
2120 | break; | |
2121 | case 3: // 3.5 GeV | |
2122 | fPIDMaxPnSigmaAbovePionLine=3.5; | |
2123 | break; | |
2124 | case 4: // 3. GeV | |
2125 | fPIDMaxPnSigmaAbovePionLine=3.; | |
2126 | break; | |
e5b6e8a6 | 2127 | case 5: // 7. GeV |
2128 | fPIDMaxPnSigmaAbovePionLine=7.; | |
4a0aab28 | 2129 | break; |
2130 | default: | |
e5b6e8a6 | 2131 | AliError(Form("piMaxMomdedxSigmaCut not defined %d",piMaxMomdedxSigmaCut)); |
4a0aab28 | 2132 | return kFALSE; |
92efd725 | 2133 | } |
2134 | return kTRUE; | |
3b77b2d1 | 2135 | } |
3b77b2d1 | 2136 | ///________________________________________________________________________ |
2137 | Bool_t AliConversionCuts::SetLowPRejectionCuts(Int_t LowPRejectionSigmaCut) | |
2138 | { // Set Cut | |
4a0aab28 | 2139 | switch(LowPRejectionSigmaCut){ |
2140 | case 0: // | |
2141 | fPIDnSigmaAtLowPAroundKaonLine=0; | |
2142 | fPIDnSigmaAtLowPAroundProtonLine=0; | |
2143 | fPIDnSigmaAtLowPAroundPionLine=0; | |
e5b6e8a6 | 2144 | fDoKaonRejectionLowP = kFALSE; |
2145 | fDoProtonRejectionLowP = kFALSE; | |
2146 | fDoPionRejectionLowP = kFALSE; | |
2147 | fPIDMinPPionRejectionLowP = fPIDMinPnSigmaAbovePionLine; | |
4a0aab28 | 2148 | break; |
2149 | case 1: // | |
2150 | fPIDnSigmaAtLowPAroundKaonLine=0.5; | |
2151 | fPIDnSigmaAtLowPAroundProtonLine=0.5; | |
2152 | fPIDnSigmaAtLowPAroundPionLine=0.5; | |
e5b6e8a6 | 2153 | fDoKaonRejectionLowP = kTRUE; |
2154 | fDoProtonRejectionLowP = kTRUE; | |
2155 | fDoPionRejectionLowP = kTRUE; | |
2156 | fPIDMinPPionRejectionLowP = fPIDMinPnSigmaAbovePionLine; | |
4a0aab28 | 2157 | break; |
2158 | case 2: // | |
2159 | fPIDnSigmaAtLowPAroundKaonLine=1; | |
2160 | fPIDnSigmaAtLowPAroundProtonLine=1; | |
2161 | fPIDnSigmaAtLowPAroundPionLine=1; | |
e5b6e8a6 | 2162 | fDoKaonRejectionLowP = kTRUE; |
2163 | fDoProtonRejectionLowP = kTRUE; | |
2164 | fDoPionRejectionLowP = kTRUE; | |
2165 | fPIDMinPPionRejectionLowP = fPIDMinPnSigmaAbovePionLine; | |
4a0aab28 | 2166 | break; |
2167 | case 3: // | |
2168 | fPIDnSigmaAtLowPAroundKaonLine=2.; | |
2169 | fPIDnSigmaAtLowPAroundProtonLine=2.; | |
2170 | fPIDnSigmaAtLowPAroundPionLine=2.; | |
e5b6e8a6 | 2171 | fDoKaonRejectionLowP = kTRUE; |
2172 | fDoProtonRejectionLowP = kTRUE; | |
2173 | fDoPionRejectionLowP = kTRUE; | |
2174 | fPIDMinPPionRejectionLowP = fPIDMinPnSigmaAbovePionLine; | |
4a0aab28 | 2175 | break; |
2176 | case 4: // | |
2177 | fPIDnSigmaAtLowPAroundKaonLine=0.; | |
2178 | fPIDnSigmaAtLowPAroundProtonLine=0.; | |
2179 | fPIDnSigmaAtLowPAroundPionLine=1; | |
e5b6e8a6 | 2180 | fDoKaonRejectionLowP = kFALSE; |
2181 | fDoProtonRejectionLowP = kFALSE; | |
2182 | fDoPionRejectionLowP = kTRUE; | |
2183 | fPIDMinPPionRejectionLowP = fPIDMinPnSigmaAbovePionLine; | |
4a0aab28 | 2184 | break; |
2185 | case 5: // | |
2186 | fPIDnSigmaAtLowPAroundKaonLine=0.; | |
2187 | fPIDnSigmaAtLowPAroundProtonLine=0.; | |
2188 | fPIDnSigmaAtLowPAroundPionLine=1.5; | |
e5b6e8a6 | 2189 | fDoKaonRejectionLowP = kFALSE; |
2190 | fDoProtonRejectionLowP = kFALSE; | |
2191 | fDoPionRejectionLowP = kTRUE; | |
2192 | fPIDMinPPionRejectionLowP = fPIDMinPnSigmaAbovePionLine; | |
4a0aab28 | 2193 | break; |
2194 | case 6: // | |
2195 | fPIDnSigmaAtLowPAroundKaonLine=0.; | |
2196 | fPIDnSigmaAtLowPAroundProtonLine=0.; | |
2197 | fPIDnSigmaAtLowPAroundPionLine=2.; | |
e5b6e8a6 | 2198 | fDoKaonRejectionLowP = kFALSE; |
2199 | fDoProtonRejectionLowP = kFALSE; | |
2200 | fDoPionRejectionLowP = kTRUE; | |
2201 | fPIDMinPPionRejectionLowP = fPIDMinPnSigmaAbovePionLine; | |
2202 | break; | |
2203 | case 7: // | |
2204 | fPIDnSigmaAtLowPAroundKaonLine=0.; | |
2205 | fPIDnSigmaAtLowPAroundProtonLine=0.; | |
2206 | fPIDnSigmaAtLowPAroundPionLine=0.5; | |
2207 | fDoKaonRejectionLowP = kFALSE; | |
2208 | fDoProtonRejectionLowP = kFALSE; | |
2209 | fDoPionRejectionLowP = kTRUE; | |
2210 | fPIDMinPPionRejectionLowP = fPIDMinPnSigmaAbovePionLine; | |
4a0aab28 | 2211 | break; |
2212 | default: | |
2213 | AliError(Form("LowPRejectionSigmaCut not defined %d",LowPRejectionSigmaCut)); | |
2214 | return kFALSE; | |
2215 | } | |
2216 | return kTRUE; | |
3b77b2d1 | 2217 | } |
3b77b2d1 | 2218 | ///________________________________________________________________________ |
2219 | Bool_t AliConversionCuts::SetTOFElectronPIDCut(Int_t TOFelectronPID){ | |
4a0aab28 | 2220 | // Set Cut |
e5b6e8a6 | 2221 | switch(TOFelectronPID){ |
4a0aab28 | 2222 | case 0: // no cut |
2223 | fUseTOFpid = kFALSE; | |
2224 | fTofPIDnSigmaBelowElectronLine=-100; | |
2225 | fTofPIDnSigmaAboveElectronLine=100; | |
2226 | break; | |
2227 | case 1: // -7,7 | |
2228 | fUseTOFpid = kTRUE; | |
2229 | fTofPIDnSigmaBelowElectronLine=-7; | |
2230 | fTofPIDnSigmaAboveElectronLine=7; | |
2231 | break; | |
2232 | case 2: // -5,5 | |
2233 | fUseTOFpid = kTRUE; | |
2234 | fTofPIDnSigmaBelowElectronLine=-5; | |
2235 | fTofPIDnSigmaAboveElectronLine=5; | |
2236 | break; | |
2237 | case 3: // -3,5 | |
2238 | fUseTOFpid = kTRUE; | |
2239 | fTofPIDnSigmaBelowElectronLine=-3; | |
2240 | fTofPIDnSigmaAboveElectronLine=5; | |
2241 | break; | |
2242 | case 4: // -2,3 | |
2243 | fUseTOFpid = kTRUE; | |
2244 | fTofPIDnSigmaBelowElectronLine=-2; | |
2245 | fTofPIDnSigmaAboveElectronLine=3; | |
2246 | break; | |
e5b6e8a6 | 2247 | case 5: // -3,3 |
2248 | fUseTOFpid = kTRUE; | |
2249 | fTofPIDnSigmaBelowElectronLine=-3; | |
2250 | fTofPIDnSigmaAboveElectronLine=3; | |
4a0aab28 | 2251 | break; |
2252 | default: | |
e5b6e8a6 | 2253 | AliError(Form("TOFElectronCut not defined %d",TOFelectronPID)); |
4a0aab28 | 2254 | return kFALSE; |
2255 | } | |
4a0aab28 | 2256 | return kTRUE; |
3b77b2d1 | 2257 | } |
2258 | ///________________________________________________________________________ | |
2259 | Bool_t AliConversionCuts::SetQtMaxCut(Int_t QtMaxCut) | |
2260 | { // Set Cut | |
4a0aab28 | 2261 | switch(QtMaxCut){ |
2262 | case 0: // | |
2263 | fQtMax=1.; | |
e5b6e8a6 | 2264 | fDoQtGammaSelection=kFALSE; |
2265 | fDoHighPtQtGammaSelection=kFALSE; | |
2266 | fHighPtQtMax=100.; | |
2267 | fPtBorderForQt=100.; | |
4a0aab28 | 2268 | break; |
2269 | case 1: | |
2270 | fQtMax=0.1; | |
e5b6e8a6 | 2271 | fDoHighPtQtGammaSelection=kFALSE; |
2272 | fHighPtQtMax=100.; | |
2273 | fPtBorderForQt=100.; | |
4a0aab28 | 2274 | break; |
2275 | case 2: | |
2276 | fQtMax=0.07; | |
e5b6e8a6 | 2277 | fDoHighPtQtGammaSelection=kFALSE; |
2278 | fHighPtQtMax=100.; | |
2279 | fPtBorderForQt=100.; | |
4a0aab28 | 2280 | break; |
2281 | case 3: | |
2282 | fQtMax=0.05; | |
e5b6e8a6 | 2283 | fDoHighPtQtGammaSelection=kFALSE; |
2284 | fHighPtQtMax=100.; | |
2285 | fPtBorderForQt=100.; | |
4a0aab28 | 2286 | break; |
2287 | case 4: | |
2288 | fQtMax=0.03; | |
e5b6e8a6 | 2289 | fDoHighPtQtGammaSelection=kFALSE; |
2290 | fHighPtQtMax=100.; | |
2291 | fPtBorderForQt=100.; | |
4a0aab28 | 2292 | break; |
e5b6e8a6 | 2293 | case 5: |
4a0aab28 | 2294 | fQtMax=0.02; |
e5b6e8a6 | 2295 | fDoHighPtQtGammaSelection=kFALSE; |
2296 | fHighPtQtMax=100.; | |
2297 | fPtBorderForQt=100.; | |
2298 | break; | |
2299 | case 6: | |
4a0aab28 | 2300 | fQtMax=0.02; |
2301 | fDoHighPtQtGammaSelection=kTRUE; | |
2302 | fHighPtQtMax=0.06; | |
2303 | fPtBorderForQt=2.5; | |
e5b6e8a6 | 2304 | break; |
4a0aab28 | 2305 | case 7: |
2306 | fQtMax=0.15; | |
e5b6e8a6 | 2307 | fDoHighPtQtGammaSelection=kFALSE; |
2308 | fHighPtQtMax=100.; | |
2309 | fPtBorderForQt=100.; | |
4a0aab28 | 2310 | break; |
2311 | default: | |
2312 | AliError(Form("Warning: QtMaxCut not defined %d",QtMaxCut)); | |
2313 | return kFALSE; | |
2314 | } | |
2315 | return kTRUE; | |
3b77b2d1 | 2316 | } |
3b77b2d1 | 2317 | ///________________________________________________________________________ |
e5b6e8a6 | 2318 | Bool_t AliConversionCuts::SetChi2GammaCut(Int_t chi2GammaCut) |
2319 | { // Set Cut | |
2320 | ||
2321 | switch(chi2GammaCut){ | |
2322 | case 0: // 100 | |
2323 | fChi2CutConversion = 100.; | |
4a0aab28 | 2324 | break; |
e5b6e8a6 | 2325 | case 1: // 50 |
2326 | fChi2CutConversion = 50.; | |
4a0aab28 | 2327 | break; |
e5b6e8a6 | 2328 | case 2: // 30 |
2329 | fChi2CutConversion = 30.; | |
2330 | break; | |
2331 | case 3: | |
2332 | fChi2CutConversion = 200.; | |
2333 | break; | |
2334 | case 4: | |
2335 | fChi2CutConversion = 500.; | |
2336 | break; | |
2337 | case 5: | |
2338 | fChi2CutConversion = 100000.; | |
2339 | break; | |
2340 | case 6: | |
2341 | fChi2CutConversion = 5.; | |
2342 | break; | |
2343 | case 7: | |
2344 | fChi2CutConversion = 10.; | |
2345 | break; | |
2346 | case 8: | |
2347 | fChi2CutConversion = 20.; | |
2348 | break; | |
2349 | case 9: | |
2350 | fChi2CutConversion = 15.; | |
4a0aab28 | 2351 | break; |
2352 | default: | |
e5b6e8a6 | 2353 | AliError(Form("Warning: Chi2GammaCut not defined %d",chi2GammaCut)); |
4a0aab28 | 2354 | return kFALSE; |
2355 | } | |
4a0aab28 | 2356 | return kTRUE; |
3b77b2d1 | 2357 | } |
3b77b2d1 | 2358 | ///________________________________________________________________________ |
2359 | Bool_t AliConversionCuts::SetPsiPairCut(Int_t psiCut) { | |
3b77b2d1 | 2360 | |
4a0aab28 | 2361 | switch(psiCut) { |
2362 | case 0: | |
e5b6e8a6 | 2363 | fPsiPairCut = 10000; // |
4a0aab28 | 2364 | break; |
2365 | case 1: | |
e5b6e8a6 | 2366 | fPsiPairCut = 0.1; // |
4a0aab28 | 2367 | break; |
2368 | case 2: | |
2369 | fPsiPairCut = 0.05; // Standard | |
2370 | break; | |
2371 | case 3: | |
e5b6e8a6 | 2372 | fPsiPairCut = 0.035; // |
4a0aab28 | 2373 | break; |
2374 | case 4: | |
e5b6e8a6 | 2375 | fPsiPairCut = 0.15; // |
4a0aab28 | 2376 | break; |
2377 | case 5: | |
e5b6e8a6 | 2378 | fPsiPairCut = 0.2; // |
4a0aab28 | 2379 | break; |
2380 | case 6: | |
e5b6e8a6 | 2381 | fPsiPairCut = 0.03; // |
4a0aab28 | 2382 | break; |
2383 | case 7: | |
e5b6e8a6 | 2384 | fPsiPairCut = 0.025; // |
4a0aab28 | 2385 | break; |
2386 | case 8: | |
e5b6e8a6 | 2387 | fPsiPairCut = 0.01; // |
2388 | break; | |
2389 | case 9: | |
2390 | fPsiPairCut = 0.5; // | |
4a0aab28 | 2391 | break; |
2392 | default: | |
92efd725 | 2393 | AliError(Form("PsiPairCut not defined %d",psiCut)); |
3b77b2d1 | 2394 | return kFALSE; |
4a0aab28 | 2395 | } |
3b77b2d1 | 2396 | |
4a0aab28 | 2397 | return kTRUE; |
3b77b2d1 | 2398 | } |
e5b6e8a6 | 2399 | ///________________________________________________________________________ |
2400 | Bool_t AliConversionCuts::SetPhotonAsymmetryCut(Int_t doPhotonAsymmetryCut){ | |
2401 | // Set Cut | |
2402 | switch(doPhotonAsymmetryCut){ | |
2403 | case 0: | |
2404 | fDoPhotonAsymmetryCut=0; | |
2405 | fMinPPhotonAsymmetryCut=100.; | |
2406 | fMinPhotonAsymmetry=0.; | |
2407 | break; | |
2408 | case 1: | |
2409 | fDoPhotonAsymmetryCut=1; | |
2410 | fMinPPhotonAsymmetryCut=3.5; | |
2411 | fMinPhotonAsymmetry=0.04; | |
2412 | break; | |
2413 | case 2: | |
2414 | fDoPhotonAsymmetryCut=1; | |
2415 | fMinPPhotonAsymmetryCut=3.5; | |
2416 | fMinPhotonAsymmetry=0.06; | |
2417 | break; | |
2418 | default: | |
2419 | AliError(Form("PhotonAsymmetryCut not defined %d",doPhotonAsymmetryCut)); | |
2420 | return kFALSE; | |
2421 | } | |
2422 | fCuts[kdoPhotonAsymmetryCut]=doPhotonAsymmetryCut; | |
2423 | return kTRUE; | |
2424 | } | |
3b77b2d1 | 2425 | ///________________________________________________________________________ |
2426 | Bool_t AliConversionCuts::SetCosPAngleCut(Int_t cosCut) { | |
2427 | ||
4a0aab28 | 2428 | switch(cosCut){ |
2429 | case 0: | |
e5b6e8a6 | 2430 | fCosPAngleCut = TMath::Pi(); // -1 |
4a0aab28 | 2431 | break; |
2432 | case 1: | |
e5b6e8a6 | 2433 | fCosPAngleCut = 0.1; // 0.99500 |
4a0aab28 | 2434 | break; |
2435 | case 2: | |
e5b6e8a6 | 2436 | fCosPAngleCut = 0.05; // 0.99875 |
4a0aab28 | 2437 | break; |
2438 | case 3: | |
e5b6e8a6 | 2439 | fCosPAngleCut = 0.025; // 0.99969 |
4a0aab28 | 2440 | break; |
2441 | case 4: | |
e5b6e8a6 | 2442 | fCosPAngleCut = 0.01; // 0.99995 |
2443 | break; | |
2444 | case 5: | |
2445 | fCosPAngleCut = 0.2; // 0.98007 | |
2446 | break; | |
2447 | case 6: | |
2448 | fCosPAngleCut = 0.5; // 0.87758 | |
2449 | break; | |
2450 | case 7: | |
2451 | fCosPAngleCut = 0.075; // 0.73169 | |
4a0aab28 | 2452 | break; |
2453 | default: | |
2454 | AliError(Form("Cosine Pointing Angle cut not defined %d",cosCut)); | |
2455 | return kFALSE; | |
2456 | } | |
3b77b2d1 | 2457 | |
4a0aab28 | 2458 | return kTRUE; |
3b77b2d1 | 2459 | } |
92efd725 | 2460 | ///________________________________________________________________________ |
2461 | Bool_t AliConversionCuts::SetSharedElectronCut(Int_t sharedElec) { | |
2462 | ||
2463 | switch(sharedElec){ | |
4a0aab28 | 2464 | case 0: |
2465 | fDoSharedElecCut = kFALSE; | |
2466 | break; | |
2467 | case 1: | |
2468 | fDoSharedElecCut = kTRUE; | |
2469 | break; | |
2470 | default: | |
2471 | AliError(Form("Shared Electron Cut not defined %d",sharedElec)); | |
2472 | return kFALSE; | |
2473 | } | |
e5b6e8a6 | 2474 | |
4a0aab28 | 2475 | return kTRUE; |
92efd725 | 2476 | } |
92efd725 | 2477 | ///________________________________________________________________________ |
2478 | Bool_t AliConversionCuts::SetToCloseV0sCut(Int_t toClose) { | |
2479 | ||
2480 | switch(toClose){ | |
2481 | case 0: | |
2482 | fDoToCloseV0sCut = kFALSE; | |
2483 | fminV0Dist = 250; | |
2484 | break; | |
2485 | case 1: | |
2486 | fDoToCloseV0sCut = kTRUE; | |
2487 | fminV0Dist = 1; | |
2488 | break; | |
2489 | case 2: | |
2490 | fDoToCloseV0sCut = kTRUE; | |
2491 | fminV0Dist = 2; | |
2492 | break; | |
2493 | case 3: | |
2494 | fDoToCloseV0sCut = kTRUE; | |
2495 | fminV0Dist = 3; | |
2496 | break; | |
2497 | default: | |
4a0aab28 | 2498 | AliError(Form("Shared Electron Cut not defined %d",toClose)); |
2499 | return kFALSE; | |
92efd725 | 2500 | } |
2501 | return kTRUE; | |
2502 | } | |
ca91a3e1 | 2503 | ///________________________________________________________________________ |
e5b6e8a6 | 2504 | Bool_t AliConversionCuts::SetTRDElectronCut(Int_t TRDElectronCut) |
2505 | { // Set Cut | |
2506 | switch(TRDElectronCut){ | |
ca91a3e1 | 2507 | case 0: |
e5b6e8a6 | 2508 | fDoTRDPID=kFALSE; |
2509 | break; | |
ca91a3e1 | 2510 | case 1: |
e5b6e8a6 | 2511 | fDoTRDPID=kTRUE; |
2512 | fPIDTRDEfficiency=0.1; | |
2513 | break; | |
2514 | case 8: | |
2515 | fDoTRDPID=kTRUE; | |
2516 | fPIDTRDEfficiency=0.8; | |
2517 | break; | |
2518 | case 9: | |
2519 | fDoTRDPID=kTRUE; | |
2520 | fPIDTRDEfficiency=0.9; | |
2521 | break; | |
ca91a3e1 | 2522 | default: |
e5b6e8a6 | 2523 | AliError(Form("TRDElectronCut not defined %d",TRDElectronCut)); |
ca91a3e1 | 2524 | return kFALSE; |
2525 | } | |
e5b6e8a6 | 2526 | |
ca91a3e1 | 2527 | return kTRUE; |
2528 | } | |
e5b6e8a6 | 2529 | //------------------------------------------------------------- |
2530 | Double_t AliConversionCuts::GetCentrality(AliVEvent *event) | |
2531 | { // Get Event Centrality | |
2532 | ||
2533 | AliESDEvent *esdEvent=dynamic_cast<AliESDEvent*>(event); | |
2534 | if(esdEvent){ | |
2535 | AliCentrality *fESDCentrality=(AliCentrality*)esdEvent->GetCentrality(); | |
2536 | ||
2537 | if(fDetectorCentrality==0){ | |
2538 | return fESDCentrality->GetCentralityPercentile("V0M"); // default | |
2539 | } | |
2540 | if(fDetectorCentrality==1){ | |
2541 | return fESDCentrality->GetCentralityPercentile("CL1"); | |
2542 | } | |
2543 | } | |
2544 | ||
2545 | AliAODEvent *aodEvent=dynamic_cast<AliAODEvent*>(event); | |
2546 | if(aodEvent){ | |
2547 | if(aodEvent->GetHeader()){return aodEvent->GetHeader()->GetCentrality();} | |
2548 | } | |
2549 | ||
2550 | return -1; | |
2551 | } | |
2552 | //------------------------------------------------------------- | |
2553 | Bool_t AliConversionCuts::IsCentralitySelected(AliVEvent *event, AliVEvent *fMCEvent) | |
2554 | { // Centrality Selection | |
2555 | if(!fIsHeavyIon)return kTRUE; | |
2556 | ||
2557 | if(fCentralityMin == 0 && fCentralityMax == 0) return kTRUE;//0-100% | |
2558 | if(fCentralityMin >= fCentralityMax) return kTRUE;//0-100% | |
2559 | ||
2560 | Double_t centrality=GetCentrality(event); | |
2561 | if(centrality<0)return kFALSE; | |
2562 | ||
2563 | Int_t centralityC=0; | |
2564 | if (fModCentralityClass == 0){ | |
2565 | centralityC= Int_t(centrality/10); | |
2566 | if(centralityC >= fCentralityMin && centralityC < fCentralityMax) | |
2567 | return kTRUE; | |
2568 | else return kFALSE; | |
2569 | } | |
2570 | else if (fModCentralityClass ==1){ | |
2571 | centralityC= Int_t(centrality); | |
2572 | if(centralityC >= fCentralityMin*5 && centralityC < fCentralityMax*5){ | |
2573 | return kTRUE; | |
2574 | } else return kFALSE; | |
2575 | } | |
2576 | else if (fModCentralityClass ==2){ | |
2577 | centralityC= Int_t(centrality); | |
2578 | if(centralityC >= ((fCentralityMin*5)+45) && centralityC < ((fCentralityMax*5)+45)) | |
2579 | return kTRUE; | |
2580 | else return kFALSE; | |
2581 | } | |
2582 | ||
2583 | // Use strict V0 amplitude cut for MC centrality | |
2584 | Float_t nv0amplitude = event->GetVZEROData()->GetMTotV0A()+event->GetVZEROData()->GetMTotV0C(); | |
2585 | Float_t V0Amplitude10[10] = {9999999.0,13670,9345,6209,3944,2352,1272,611,255, 83}; | |
2586 | // 0 10 20 30 40 50 60 70 80 90% | |
2587 | Float_t V0Amplitude5a[10] = {9999999.0,16612,13670,11290,9345,7650,6209,4984,3944,3074}; | |
2588 | // 0 5 10 15 20 25 30 35 40 45% | |
2589 | Float_t V0Amplitude5b[10] = {3074,2352,1725,1272,899,611,402,255,152,83}; | |
2590 | // 45 50 55 60 65 70 75 80 85 90% | |
2591 | ||
2592 | if (fModCentralityClass == 3){ | |
2593 | if(fMCEvent){ | |
2594 | if(nv0amplitude > V0Amplitude10[fCentralityMax] && nv0amplitude <= V0Amplitude10[fCentralityMin]) | |
2595 | return kTRUE; | |
2596 | else return kFALSE; | |
2597 | } | |
2598 | else{ | |
2599 | centralityC= Int_t(centrality/10); | |
2600 | if(centralityC >= fCentralityMin && centralityC < fCentralityMax) | |
2601 | return kTRUE; | |
2602 | else return kFALSE; | |
2603 | } | |
2604 | } | |
2605 | else if (fModCentralityClass ==4){ | |
2606 | if(fMCEvent){ | |
2607 | if(nv0amplitude > V0Amplitude5a[fCentralityMax] && nv0amplitude <= V0Amplitude5a[fCentralityMin]) | |
2608 | return kTRUE; | |
2609 | else return kFALSE; | |
2610 | } | |
2611 | else{ | |
2612 | centralityC= Int_t(centrality); | |
2613 | if(centralityC >= fCentralityMin*5 && centralityC < fCentralityMax*5){ | |
2614 | return kTRUE; | |
2615 | } else return kFALSE; | |
2616 | } | |
2617 | } | |
2618 | else if (fModCentralityClass ==5){ | |
2619 | if(fMCEvent){ | |
2620 | if(nv0amplitude > V0Amplitude5b[fCentralityMax] && nv0amplitude <= V0Amplitude5b[fCentralityMin]) | |
2621 | return kTRUE; | |
2622 | else return kFALSE; | |
2623 | } | |
2624 | else{ | |
2625 | centralityC= Int_t(centrality); | |
2626 | if(centralityC >= ((fCentralityMin*5)+45) && centralityC < ((fCentralityMax*5)+45)) | |
2627 | return kTRUE; | |
2628 | else return kFALSE; | |
2629 | } | |
2630 | } | |
2631 | ||
2632 | return kFALSE; | |
2633 | } | |
2634 | ///________________________________________________________________________ | |
2635 | Bool_t AliConversionCuts::VertexZCut(AliVEvent *event){ | |
2636 | // Cut on z position of primary vertex | |
2637 | Double_t fVertexZ=event->GetPrimaryVertex()->GetZ(); | |
3b77b2d1 | 2638 | |
e5b6e8a6 | 2639 | if(abs(fVertexZ)>fMaxVertexZ)return kFALSE; |
2640 | return kTRUE; | |
2641 | } | |
3b77b2d1 | 2642 | ///________________________________________________________________________ |
2643 | ||
2644 | Int_t AliConversionCuts::GetNumberOfContributorsVtx(AliVEvent *event){ | |
4a0aab28 | 2645 | // returns number of contributors to the vertex |
e5b6e8a6 | 2646 | |
4a0aab28 | 2647 | AliESDEvent *fESDEvent=dynamic_cast<AliESDEvent*>(event); |
2648 | if(fESDEvent){ | |
e5b6e8a6 | 2649 | if (fESDEvent->GetPrimaryVertex() != NULL){ |
2650 | if(fESDEvent->GetPrimaryVertex()->GetNContributors()>0) { | |
2651 | return fESDEvent->GetPrimaryVertex()->GetNContributors(); | |
2652 | } | |
4a0aab28 | 2653 | } |
e5b6e8a6 | 2654 | |
2655 | if(fESDEvent->GetPrimaryVertexSPD() !=NULL){ | |
4a0aab28 | 2656 | if(fESDEvent->GetPrimaryVertexSPD()->GetNContributors()>0) { |
2657 | return fESDEvent->GetPrimaryVertexSPD()->GetNContributors(); | |
e5b6e8a6 | 2658 | } else { |
2659 | AliWarning(Form("Number of contributors from bad vertex type:: %s",fESDEvent->GetPrimaryVertex()->GetName())); | |
4a0aab28 | 2660 | return 0; |
2661 | } | |
2662 | } | |
2663 | } | |
2664 | ||
2665 | AliAODEvent *fAODEvent=dynamic_cast<AliAODEvent*>(event); | |
2666 | if(fAODEvent){ | |
e5b6e8a6 | 2667 | if (fAODEvent->GetPrimaryVertex() != NULL){ |
2668 | if(fAODEvent->GetPrimaryVertex()->GetNContributors()>0) { | |
2669 | return fAODEvent->GetPrimaryVertex()->GetNContributors(); | |
2670 | } | |
2671 | } | |
2672 | if(fAODEvent->GetPrimaryVertexSPD() !=NULL){ | |
4a0aab28 | 2673 | if(fAODEvent->GetPrimaryVertexSPD()->GetNContributors()>0) { |
2674 | return fAODEvent->GetPrimaryVertexSPD()->GetNContributors(); | |
e5b6e8a6 | 2675 | } else { |
4a0aab28 | 2676 | AliWarning(Form("Number of contributors from bad vertex type:: %s",fAODEvent->GetPrimaryVertex()->GetName())); |
2677 | return 0; | |
2678 | } | |
2679 | } | |
2680 | } | |
e5b6e8a6 | 2681 | |
4a0aab28 | 2682 | return 0; |
3b77b2d1 | 2683 | } |
2684 | ||
92efd725 | 2685 | ///________________________________________________________________________ |
3b77b2d1 | 2686 | |
92efd725 | 2687 | Bool_t AliConversionCuts::IsTriggerSelected() |
2688 | { | |
e5b6e8a6 | 2689 | |
4a0aab28 | 2690 | AliInputEventHandler *fInputHandler=(AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()); |
2691 | ||
2692 | UInt_t isSelected = AliVEvent::kAny; | |
2693 | if( fInputHandler && fInputHandler->GetEventSelection()) { | |
2694 | // Get the actual offline trigger mask for the event and AND it with the | |
2695 | // requested mask. If no mask requested select by default the event. | |
2696 | if (fOfflineTriggerMask) | |
2697 | isSelected = fOfflineTriggerMask & fInputHandler->IsEventSelected(); | |
2698 | } | |
e5b6e8a6 | 2699 | fIsSDDFired = !(fInputHandler->IsEventSelected() & AliVEvent::kFastOnly); |
4a0aab28 | 2700 | |
2701 | // Fill Histogram | |
2702 | if(hTriggerClass){ | |
e5b6e8a6 | 2703 | if (!fIsSDDFired) hTriggerClass->Fill(32); |
2704 | if (fInputHandler->IsEventSelected() & AliVEvent::kMB)hTriggerClass->Fill(0); | |
2705 | if (fInputHandler->IsEventSelected() & AliVEvent::kINT7)hTriggerClass->Fill(1); | |
2706 | if (fInputHandler->IsEventSelected() & AliVEvent::kMUON)hTriggerClass->Fill(2); | |
2707 | if (fInputHandler->IsEventSelected() & AliVEvent::kHighMult)hTriggerClass->Fill(3); | |
2708 | if (fInputHandler->IsEventSelected() & AliVEvent::kEMC1)hTriggerClass->Fill(4); | |
4a0aab28 | 2709 | if (fInputHandler->IsEventSelected() & AliVEvent::kCINT5)hTriggerClass->Fill(5); |
e5b6e8a6 | 2710 | if (fInputHandler->IsEventSelected() & AliVEvent::kCMUS5)hTriggerClass->Fill(6); |
2711 | if (fInputHandler->IsEventSelected() & AliVEvent::kMUSPB)hTriggerClass->Fill(6); | |
2712 | if (fInputHandler->IsEventSelected() & AliVEvent::kCMUS5)hTriggerClass->Fill(6); | |
2713 | if (fInputHandler->IsEventSelected() & AliVEvent::kMUSPB)hTriggerClass->Fill(6); | |
2714 | if (fInputHandler->IsEventSelected() & AliVEvent::kMUSH7)hTriggerClass->Fill(7); | |
2715 | if (fInputHandler->IsEventSelected() & AliVEvent::kMUSHPB)hTriggerClass->Fill(7); | |
2716 | if (fInputHandler->IsEventSelected() & AliVEvent::kMUL7)hTriggerClass->Fill(8); | |
2717 | if (fInputHandler->IsEventSelected() & AliVEvent::kMuonLikePB)hTriggerClass->Fill(8); | |
2718 | if (fInputHandler->IsEventSelected() & AliVEvent::kMUU7)hTriggerClass->Fill(9); | |
2719 | if (fInputHandler->IsEventSelected() & AliVEvent::kMuonUnlikePB)hTriggerClass->Fill(9); | |
2720 | if (fInputHandler->IsEventSelected() & AliVEvent::kEMC7)hTriggerClass->Fill(10); | |
2721 | if (fInputHandler->IsEventSelected() & AliVEvent::kEMC8)hTriggerClass->Fill(10); | |
2722 | if (fInputHandler->IsEventSelected() & AliVEvent::kMUS7)hTriggerClass->Fill(11); | |
2723 | if (fInputHandler->IsEventSelected() & AliVEvent::kPHI1)hTriggerClass->Fill(12); | |
2724 | if (fInputHandler->IsEventSelected() & AliVEvent::kPHI7)hTriggerClass->Fill(13); | |
2725 | if (fInputHandler->IsEventSelected() & AliVEvent::kPHI8)hTriggerClass->Fill(13); | |
2726 | if (fInputHandler->IsEventSelected() & AliVEvent::kPHOSPb)hTriggerClass->Fill(13); | |
2727 | if (fInputHandler->IsEventSelected() & AliVEvent::kEMCEJE)hTriggerClass->Fill(14); | |
2728 | if (fInputHandler->IsEventSelected() & AliVEvent::kEMCEGA)hTriggerClass->Fill(15); | |
2729 | if (fInputHandler->IsEventSelected() & AliVEvent::kCentral)hTriggerClass->Fill(16); | |
2730 | if (fInputHandler->IsEventSelected() & AliVEvent::kSemiCentral)hTriggerClass->Fill(17); | |
2731 | if (fInputHandler->IsEventSelected() & AliVEvent::kDG5)hTriggerClass->Fill(18); | |
2732 | if (fInputHandler->IsEventSelected() & AliVEvent::kZED)hTriggerClass->Fill(19); | |
2733 | if (fInputHandler->IsEventSelected() & AliVEvent::kSPI7)hTriggerClass->Fill(20); | |
2734 | if (fInputHandler->IsEventSelected() & AliVEvent::kSPI)hTriggerClass->Fill(20); | |
2735 | if (fInputHandler->IsEventSelected() & AliVEvent::kINT8)hTriggerClass->Fill(21); | |
2736 | if (fInputHandler->IsEventSelected() & AliVEvent::kMuonSingleLowPt8)hTriggerClass->Fill(22); | |
2737 | if (fInputHandler->IsEventSelected() & AliVEvent::kMuonSingleHighPt8)hTriggerClass->Fill(23); | |
2738 | if (fInputHandler->IsEventSelected() & AliVEvent::kMuonLikeLowPt8)hTriggerClass->Fill(24); | |
2739 | if (fInputHandler->IsEventSelected() & AliVEvent::kMuonUnlikeLowPt8)hTriggerClass->Fill(25); | |
2740 | if (fInputHandler->IsEventSelected() & AliVEvent::kMuonUnlikeLowPt0)hTriggerClass->Fill(26); | |
2741 | if (fInputHandler->IsEventSelected() & AliVEvent::kUserDefined)hTriggerClass->Fill(27); | |
2742 | if (fInputHandler->IsEventSelected() & AliVEvent::kFastOnly)hTriggerClass->Fill(28); | |
2743 | if (fInputHandler->IsEventSelected() & AliVEvent::kAnyINT)hTriggerClass->Fill(29); | |
2744 | if (fInputHandler->IsEventSelected() & AliVEvent::kAny)hTriggerClass->Fill(30); | |
4a0aab28 | 2745 | } |
3b77b2d1 | 2746 | |
e5b6e8a6 | 2747 | if(!isSelected)return kFALSE; |
2748 | ||
4a0aab28 | 2749 | return kTRUE; |
3b77b2d1 | 2750 | |
92efd725 | 2751 | } |
3b77b2d1 | 2752 | |
2753 | ///________________________________________________________________________ | |
2754 | Int_t AliConversionCuts::GetFirstTPCRow(Double_t radius){ | |
4a0aab28 | 2755 | // Get first TPC row |
e5b6e8a6 | 2756 | Int_t firstTPCRow = 0; |
2757 | Double_t radiusI = 84.8; | |
2758 | Double_t radiusO = 134.6; | |
4a0aab28 | 2759 | Double_t radiusOB = 198.; |
e5b6e8a6 | 2760 | Double_t rSizeI = 0.75; |
2761 | Double_t rSizeO = 1.; | |
2762 | Double_t rSizeOB = 1.5; | |
2763 | Int_t nClsI = 63; | |
2764 | Int_t nClsIO = 127; | |
4a0aab28 | 2765 | |
2766 | if(radius <= radiusI){ | |
2767 | return firstTPCRow; | |
2768 | } | |
2769 | if(radius>radiusI && radius<=radiusO){ | |
2770 | firstTPCRow = (Int_t)((radius-radiusI)/rSizeI); | |
2771 | } | |
2772 | if(radius>radiusO && radius<=radiusOB){ | |
2773 | firstTPCRow = (Int_t)(nClsI+(radius-radiusO)/rSizeO); | |
2774 | } | |
2775 | ||
2776 | if(radius>radiusOB){ | |
2777 | firstTPCRow =(Int_t)(nClsIO+(radius-radiusOB)/rSizeOB); | |
2778 | } | |
2779 | ||
2780 | return firstTPCRow; | |
3b77b2d1 | 2781 | } |
2782 | ||
92efd725 | 2783 | Bool_t AliConversionCuts::CosinePAngleCut(const AliConversionPhotonBase * photon, AliVEvent * event) const { |
4a0aab28 | 2784 | ///Check if passes cosine of pointing angle cut |
92efd725 | 2785 | if(GetCosineOfPointingAngle(photon, event) < (TMath::Cos(fCosPAngleCut))){ |
2786 | return kFALSE; | |
2787 | } | |
2788 | return kTRUE; | |
3b77b2d1 | 2789 | } |
2790 | ||
92efd725 | 2791 | Double_t AliConversionCuts::GetCosineOfPointingAngle( const AliConversionPhotonBase * photon, AliVEvent * event) const{ |
e5b6e8a6 | 2792 | // calculates the pointing angle of the recalculated V0 |
3b77b2d1 | 2793 | |
92efd725 | 2794 | Double_t momV0[3] = {0,0,0}; |
2795 | if(event->IsA()==AliESDEvent::Class()){ | |
2796 | AliESDEvent *esdEvent = dynamic_cast<AliESDEvent*>(event); | |
e5b6e8a6 | 2797 | if(!esdEvent) return -999; |
92efd725 | 2798 | AliESDv0 *v0 = esdEvent->GetV0(photon->GetV0Index()); |
e5b6e8a6 | 2799 | if(!v0) return -999; |
92efd725 | 2800 | v0->GetPxPyPz(momV0[0],momV0[1],momV0[2]); |
2801 | } | |
2802 | if(event->IsA()==AliAODEvent::Class()){ | |
2803 | momV0[0] = photon->GetPx(); | |
2804 | momV0[1] = photon->GetPy(); | |
2805 | momV0[2] = photon->GetPz(); | |
2806 | } | |
e5b6e8a6 | 2807 | |
92efd725 | 2808 | //Double_t momV0[3] = { photon->GetPx(), photon->GetPy(), photon->GetPz() }; //momentum of the V0 |
e5b6e8a6 | 2809 | Double_t PosV0[3] = { photon->GetConversionX() - event->GetPrimaryVertex()->GetX(), |
2810 | photon->GetConversionY() - event->GetPrimaryVertex()->GetY(), | |
92efd725 | 2811 | photon->GetConversionZ() - event->GetPrimaryVertex()->GetZ() }; //Recalculated V0 Position vector |
e5b6e8a6 | 2812 | |
3b77b2d1 | 2813 | Double_t momV02 = momV0[0]*momV0[0] + momV0[1]*momV0[1] + momV0[2]*momV0[2]; |
2814 | Double_t PosV02 = PosV0[0]*PosV0[0] + PosV0[1]*PosV0[1] + PosV0[2]*PosV0[2]; | |
2815 | ||
e5b6e8a6 | 2816 | |
2817 | Double_t cosinePointingAngle = -999; | |
2818 | if(momV02*PosV02 > 0.0) | |
2819 | cosinePointingAngle = (PosV0[0]*momV0[0] + PosV0[1]*momV0[1] + PosV0[2]*momV0[2] ) / TMath::Sqrt(momV02 * PosV02); | |
2820 | ||
3b77b2d1 | 2821 | return cosinePointingAngle; |
2822 | } | |
2823 | ||
e5b6e8a6 | 2824 | ///________________________________________________________________________ |
92efd725 | 2825 | Bool_t AliConversionCuts::PsiPairCut(const AliConversionPhotonBase * photon) const { |
3b77b2d1 | 2826 | |
4a0aab28 | 2827 | if(photon->GetPsiPair() > fPsiPairCut){ |
2828 | return kFALSE;} | |
2829 | else{return kTRUE;} | |
3b77b2d1 | 2830 | |
3b77b2d1 | 2831 | } |
2832 | ||
2833 | ///________________________________________________________________________ | |
2834 | TString AliConversionCuts::GetCutNumber(){ | |
4a0aab28 | 2835 | // returns TString with current cut number |
2836 | TString a(kNCuts); | |
2837 | for(Int_t ii=0;ii<kNCuts;ii++){ | |
92efd725 | 2838 | a.Append(Form("%d",fCuts[ii])); |
4a0aab28 | 2839 | } |
2840 | return a; | |
3b77b2d1 | 2841 | } |
2842 | ||
92efd725 | 2843 | ///________________________________________________________________________ |
2844 | void AliConversionCuts::FillElectonLabelArray(AliAODConversionPhoton* photon, Int_t nV0){ | |
e5b6e8a6 | 2845 | |
92efd725 | 2846 | Int_t posLabel = photon->GetTrackLabelPositive(); |
2847 | Int_t negLabel = photon->GetTrackLabelNegative(); | |
e5b6e8a6 | 2848 | |
92efd725 | 2849 | fElectronLabelArray[nV0*2] = posLabel; |
2850 | fElectronLabelArray[(nV0*2)+1] = negLabel; | |
2851 | } | |
2852 | ///________________________________________________________________________ | |
2853 | Bool_t AliConversionCuts::RejectSharedElectronV0s(AliAODConversionPhoton* photon, Int_t nV0, Int_t nV0s){ | |
3b77b2d1 | 2854 | |
92efd725 | 2855 | Int_t posLabel = photon->GetTrackLabelPositive(); |
2856 | Int_t negLabel = photon->GetTrackLabelNegative(); | |
e5b6e8a6 | 2857 | |
92efd725 | 2858 | for(Int_t i = 0; i<nV0s*2;i++){ |
2859 | if(i==nV0*2) continue; | |
2860 | if(i==(nV0*2)+1) continue; | |
2861 | if(fElectronLabelArray[i] == posLabel){ | |
2862 | return kFALSE;} | |
2863 | if(fElectronLabelArray[i] == negLabel){ | |
2864 | return kFALSE;} | |
2865 | } | |
3b77b2d1 | 2866 | |
92efd725 | 2867 | return kTRUE; |
2868 | } | |
3b77b2d1 | 2869 | ///________________________________________________________________________ |
92efd725 | 2870 | Bool_t AliConversionCuts::RejectToCloseV0s(AliAODConversionPhoton* photon, TList *photons, Int_t nV0){ |
2871 | ||
2872 | ||
2873 | Double_t posX = photon->GetConversionX(); | |
2874 | Double_t posY = photon->GetConversionY(); | |
2875 | Double_t posZ = photon->GetConversionZ(); | |
2876 | ||
2877 | for(Int_t i = 0;i<photons->GetEntries();i++){ | |
2878 | if(nV0 == i) continue; | |
2879 | AliAODConversionPhoton *photonComp = (AliAODConversionPhoton*) photons->At(i); | |
2880 | Double_t posCompX = photonComp->GetConversionX(); | |
2881 | Double_t posCompY = photonComp->GetConversionY(); | |
2882 | Double_t posCompZ = photonComp->GetConversionZ(); | |
e5b6e8a6 | 2883 | |
92efd725 | 2884 | Double_t dist = pow((posX - posCompX),2)+pow((posY - posCompY),2)+pow((posZ - posCompZ),2); |
2885 | ||
2886 | if(dist < fminV0Dist*fminV0Dist){ | |
2887 | if(photon->GetChi2perNDF() < photonComp->GetChi2perNDF()) return kTRUE; | |
2888 | else { | |
2889 | return kFALSE;} | |
2890 | } | |
e5b6e8a6 | 2891 | |
92efd725 | 2892 | } |
2893 | return kTRUE; | |
3b77b2d1 | 2894 | } |
ca91a3e1 | 2895 | ///________________________________________________________________________ |
2896 | void AliConversionCuts::GetNotRejectedParticles(Int_t rejection, TList *HeaderList, AliMCEvent *MCEvent){ | |
e5b6e8a6 | 2897 | |
ca91a3e1 | 2898 | if(fNotRejectedStart){ |
2899 | delete[] fNotRejectedStart; | |
2900 | fNotRejectedStart = NULL; | |
2901 | } | |
2902 | if(fNotRejectedEnd){ | |
2903 | delete[] fNotRejectedEnd; | |
2904 | fNotRejectedEnd = NULL; | |
2905 | } | |
2906 | if(fGeneratorNames){ | |
2907 | delete[] fGeneratorNames; | |
2908 | fGeneratorNames = NULL; | |
2909 | } | |
e5b6e8a6 | 2910 | |
ca91a3e1 | 2911 | if(rejection == 0) return; // No Rejection |
2912 | AliGenCocktailEventHeader *cHeader = dynamic_cast<AliGenCocktailEventHeader*>(MCEvent->GenEventHeader()); | |
2913 | if(cHeader){ | |
2914 | TList *genHeaders = cHeader->GetHeaders(); | |
2915 | AliGenEventHeader* gh = 0; | |
2916 | fnHeaders = 0; | |
e5b6e8a6 | 2917 | if(rejection == 1 || rejection == 3) fnHeaders = 1; // MinBiasHeader |
ca91a3e1 | 2918 | if(rejection == 2){ // TList of Headers Names |
2919 | for(Int_t i = 0; i<genHeaders->GetEntries();i++){ | |
2920 | gh = (AliGenEventHeader*)genHeaders->At(i); | |
2921 | TString GeneratorName = gh->GetName(); | |
2922 | for(Int_t j = 0; j<HeaderList->GetEntries();j++){ | |
2923 | TString GeneratorInList = ((TObjString*)HeaderList->At(j))->GetString(); | |
2924 | if(GeneratorName.CompareTo(GeneratorInList) == 0){ | |
2925 | fnHeaders++; | |
2926 | continue; | |
2927 | } | |
2928 | } | |
2929 | } | |
2930 | } | |
2931 | ||
2932 | fNotRejectedStart = new Int_t[fnHeaders]; | |
2933 | fNotRejectedEnd = new Int_t[fnHeaders]; | |
2934 | fGeneratorNames = new TString[fnHeaders]; | |
2935 | ||
e5b6e8a6 | 2936 | if(rejection == 1 || rejection == 3){ |
ca91a3e1 | 2937 | fNotRejectedStart[0] = 0; |
e5b6e8a6 | 2938 | fNotRejectedEnd[0] = ((AliGenEventHeader*)genHeaders->At(0))->NProduced()-1; |
ca91a3e1 | 2939 | fGeneratorNames[0] = ((AliGenEventHeader*)genHeaders->At(0))->GetName(); |
ca91a3e1 | 2940 | return; |
2941 | } | |
e5b6e8a6 | 2942 | |
ca91a3e1 | 2943 | Int_t firstindex = 0; |
e5b6e8a6 | 2944 | Int_t lastindex = -1; |
ca91a3e1 | 2945 | Int_t nummer = 0; |
2946 | for(Int_t i = 0; i<genHeaders->GetEntries();i++){ | |
2947 | gh = (AliGenEventHeader*)genHeaders->At(i); | |
2948 | TString GeneratorName = gh->GetName(); | |
2949 | lastindex = lastindex + gh->NProduced(); | |
2950 | for(Int_t j = 0; j<HeaderList->GetEntries();j++){ | |
2951 | TString GeneratorInList = ((TObjString*)HeaderList->At(j))->GetString(); | |
2952 | if(GeneratorName.CompareTo(GeneratorInList) == 0){ | |
2953 | fNotRejectedStart[nummer] = firstindex; | |
2954 | fNotRejectedEnd[nummer] = lastindex; | |
2955 | fGeneratorNames[nummer] = GeneratorName; | |
2956 | nummer++; | |
2957 | continue; | |
2958 | } | |
2959 | } | |
2960 | firstindex = firstindex + gh->NProduced(); | |
2961 | } | |
2962 | } | |
e5b6e8a6 | 2963 | else{ // No Cocktail Header Found |
ca91a3e1 | 2964 | fNotRejectedStart = new Int_t[1]; |
2965 | fNotRejectedEnd = new Int_t[1]; | |
e5b6e8a6 | 2966 | |
2967 | fnHeaders = 1; | |
ca91a3e1 | 2968 | fNotRejectedStart[0] = 0; |
e5b6e8a6 | 2969 | fNotRejectedEnd[0] = MCEvent->Stack()->GetNprimary()-1; |
2970 | if(rejection == 2){ | |
2971 | fGeneratorNames = new TString[1]; | |
2972 | fGeneratorNames[0] = "NoCocktailGeneratorFound"; | |
2973 | } | |
2974 | SetRejectExtraSignalsCut(0); | |
ca91a3e1 | 2975 | } |
e5b6e8a6 | 2976 | |
ca91a3e1 | 2977 | } |
2978 | //_________________________________________________________________________ | |
2979 | Bool_t AliConversionCuts::IsParticleFromBGEvent(Int_t index, AliStack *MCStack){ | |
e5b6e8a6 | 2980 | |
ca91a3e1 | 2981 | if(index < 0) return kFALSE; // No Particle |
e5b6e8a6 | 2982 | |
2983 | Bool_t accepted = kFALSE; | |
ca91a3e1 | 2984 | if( index >= MCStack->GetNprimary()){ // Secondary Particle |
2985 | if( ((TParticle*)MCStack->Particle(index))->GetMother(0) < 0) return kTRUE; // Secondary Particle without Mother?? | |
ca91a3e1 | 2986 | return IsParticleFromBGEvent(((TParticle*)MCStack->Particle(index))->GetMother(0),MCStack); |
2987 | } | |
ca91a3e1 | 2988 | for(Int_t i = 0;i<fnHeaders;i++){ |
e5b6e8a6 | 2989 | if(index >= fNotRejectedStart[i] && index <= fNotRejectedEnd[i]){ |
ca91a3e1 | 2990 | accepted = kTRUE; |
e5b6e8a6 | 2991 | } |
ca91a3e1 | 2992 | } |
e5b6e8a6 | 2993 | |
ca91a3e1 | 2994 | return accepted; |
2995 | } | |
e5b6e8a6 | 2996 | //_________________________________________________________________________ |
2997 | Int_t AliConversionCuts::IsEventAcceptedByConversionCut(AliConversionCuts *ReaderCuts, AliVEvent *InputEvent, AliMCEvent *MCEvent, Bool_t isHeavyIon){ | |
2998 | ||
2999 | if(isHeavyIon && !(IsCentralitySelected(InputEvent,MCEvent))) | |
3000 | return 1; // Check Centrality --> Not Accepted => eventQuality = 1 | |
3001 | ||
3002 | if(!isHeavyIon && GetIsFromPileup()){ | |
3003 | if(InputEvent->IsPileupFromSPD(3,0.8,3.,2.,5.)){ | |
3004 | return 6; // Check Pileup --> Not Accepted => eventQuality = 6 | |
3005 | } | |
3006 | } | |
3007 | ||
3008 | Bool_t hasV0And = ReaderCuts->HasV0AND(); | |
3009 | Bool_t isSDDFired = ReaderCuts->IsSDDFired(); | |
3010 | if( (IsSpecialTrigger() == 2 || IsSpecialTrigger() == 3) && !isSDDFired && !MCEvent) | |
3011 | return 7; // With SDD requested but no fired | |
3012 | ||
3013 | if( (IsSpecialTrigger() == 1 || IsSpecialTrigger() == 3) && !hasV0And) | |
3014 | return 8; // V0AND requested but no fired | |
3015 | ||
3016 | ||
3017 | return 0; | |
3018 | } |