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