]>
Commit | Line | Data |
---|---|---|
a0b94e5c | 1 | /************************************************************************** |
2 | * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * | |
3 | * * | |
4 | * Author: Ana Marin, Kathrin Koch, Kenneth Aamodt * | |
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 used to do analysis on conversion pairs | |
19 | //--------------------------------------------- | |
20 | //////////////////////////////////////////////// | |
21 | ||
22 | // --- ROOT system --- | |
23 | #include <TMath.h> | |
24 | ||
25 | //---- ANALYSIS system ---- | |
26 | #include "AliV0Reader.h" | |
27 | #include "AliAnalysisManager.h" | |
28 | #include "AliESDInputHandler.h" | |
67381a40 | 29 | #include "AliPID.h" |
a0b94e5c | 30 | #include "AliESDtrack.h" |
31 | #include "AliMCEvent.h" | |
32 | #include "AliKFVertex.h" | |
33 | ||
34 | #include "AliStack.h" | |
35 | #include "AliMCEventHandler.h" | |
10d100d4 | 36 | #include "AliESDpid.h" |
5e55d806 | 37 | #include "AliGammaConversionBGHandler.h" |
037dc2db | 38 | #include "AliESDtrackCuts.h" |
39 | ||
a0b94e5c | 40 | |
41 | class iostream; | |
42 | class AliESDv0; | |
43 | class TFormula; | |
44 | ||
45 | using namespace std; | |
46 | ||
47 | ClassImp(AliV0Reader) | |
48 | ||
49 | ||
9c1cb6f7 | 50 | AliESDpid* AliV0Reader::fgESDpid = 0x0; |
a0b94e5c | 51 | |
52 | AliV0Reader::AliV0Reader() : | |
53 | TObject(), | |
54 | fMCStack(NULL), | |
48682642 | 55 | // fMCTruth(NULL), |
a0b94e5c | 56 | fMCEvent(NULL), // for CF |
57 | fChain(NULL), | |
48682642 | 58 | // fESDHandler(NULL), |
a0b94e5c | 59 | fESDEvent(NULL), |
4a6157dc | 60 | fCFManager(NULL), |
9c1cb6f7 | 61 | //fESDpid(NULL), |
a0b94e5c | 62 | fHistograms(NULL), |
63 | fCurrentV0IndexNumber(0), | |
64 | fCurrentV0(NULL), | |
65 | fCurrentNegativeKFParticle(NULL), | |
66 | fCurrentPositiveKFParticle(NULL), | |
67 | fCurrentMotherKFCandidate(NULL), | |
68 | fCurrentNegativeESDTrack(NULL), | |
69 | fCurrentPositiveESDTrack(NULL), | |
70 | fNegativeTrackLorentzVector(NULL), | |
71 | fPositiveTrackLorentzVector(NULL), | |
72 | fMotherCandidateLorentzVector(NULL), | |
73 | fCurrentXValue(0), | |
74 | fCurrentYValue(0), | |
75 | fCurrentZValue(0), | |
76 | fPositiveTrackPID(0), | |
77 | fNegativeTrackPID(0), | |
78 | fNegativeMCParticle(NULL), | |
79 | fPositiveMCParticle(NULL), | |
80 | fMotherMCParticle(NULL), | |
81 | fMotherCandidateKFMass(0), | |
82 | fMotherCandidateKFWidth(0), | |
83 | fUseKFParticle(kTRUE), | |
84 | fUseESDTrack(kFALSE), | |
85 | fDoMC(kFALSE), | |
10e3319b | 86 | fMaxVertexZ(100.),// 100 cm(from the 0) |
a0b94e5c | 87 | fMaxR(10000),// 100 meter(outside of ALICE) |
bd6d9fa3 | 88 | fMinR(0),// 100 meter(outside of ALICE) |
a0b94e5c | 89 | fEtaCut(0.), |
dc2883e4 | 90 | fRapidityMesonCut(0.), |
a0b94e5c | 91 | fPtCut(0.), |
48682642 | 92 | fSinglePtCut(0.), |
a0b94e5c | 93 | fMaxZ(0.), |
48682642 | 94 | fMinClsTPC(0.), |
bd6d9fa3 | 95 | fMinClsTPCToF(0.), |
a0b94e5c | 96 | fLineCutZRSlope(0.), |
97 | fLineCutZValue(0.), | |
98 | fChi2CutConversion(0.), | |
99 | fChi2CutMeson(0.), | |
9c1cb6f7 | 100 | fAlphaCutMeson(1.), |
67381a40 | 101 | fAlphaMinCutMeson(0.), |
a0b94e5c | 102 | fPIDProbabilityCutNegativeParticle(0), |
103 | fPIDProbabilityCutPositiveParticle(0), | |
9640a3d1 | 104 | fDodEdxSigmaCut(kFALSE), |
e0155998 | 105 | fDoTOFsigmaCut(kFALSE), // RRnewTOF |
9640a3d1 | 106 | fPIDnSigmaAboveElectronLine(100), |
107 | fPIDnSigmaBelowElectronLine(-100), | |
e0155998 | 108 | fTofPIDnSigmaAboveElectronLine(100), // RRnewTOF |
109 | fTofPIDnSigmaBelowElectronLine(-100), // RRnewTOF | |
9640a3d1 | 110 | fPIDnSigmaAbovePionLine(-100), |
111 | fPIDMinPnSigmaAbovePionLine(100), | |
10e3319b | 112 | fPIDMaxPnSigmaAbovePionLine(100), |
9c1cb6f7 | 113 | fDoKaonRejectionLowP(kFALSE), |
114 | fDoProtonRejectionLowP(kFALSE), | |
115 | fDoPionRejectionLowP(kFALSE), | |
116 | fPIDnSigmaAtLowPAroundKaonLine(0), | |
117 | fPIDnSigmaAtLowPAroundProtonLine(0), | |
118 | fPIDnSigmaAtLowPAroundPionLine(0), | |
119 | fPIDMinPKaonRejectionLowP(0), | |
120 | fPIDMinPProtonRejectionLowP(0), | |
121 | fPIDMinPPionRejectionLowP(0), | |
70ef88b5 | 122 | fDoQtGammaSelection(kFALSE), |
14d7f2f9 | 123 | fDoHighPtQtGammaSelection(kFALSE), // RRnew |
70ef88b5 | 124 | fQtMax(100.), |
14d7f2f9 | 125 | fHighPtQtMax(100.), // RRnew |
126 | fPtBorderForQt(100.), // RRnew | |
a0b94e5c | 127 | fXVertexCut(0.), |
128 | fYVertexCut(0.), | |
129 | fZVertexCut(0.), | |
130 | fNSigmaMass(0.), | |
131 | fUseImprovedVertex(kFALSE), | |
132 | fUseOwnXYZCalculation(kFALSE), | |
5ce758b0 | 133 | fUseConstructGamma(kFALSE), |
1e7846f4 | 134 | fDoCF(kFALSE), |
77880bd8 | 135 | fUseOnFlyV0Finder(kTRUE), |
cb90a330 | 136 | fUpdateV0AlreadyCalled(kFALSE), |
5e55d806 | 137 | fCurrentEventGoodV0s(NULL), |
7f3c7cc6 | 138 | fV0Pindex(), |
139 | fV0Nindex(), | |
5e55d806 | 140 | // fPreviousEventGoodV0s(), |
87f6de3e | 141 | fCalculateBackground(kFALSE), |
5e55d806 | 142 | fBGEventHandler(NULL), |
037dc2db | 143 | fBGEventInitialized(kFALSE), |
144 | fEsdTrackCuts(NULL), | |
70ef88b5 | 145 | fNumberOfESDTracks(0), |
f14266e7 | 146 | fNEventsForBGCalculation(20), |
5ce758b0 | 147 | fUseChargedTrackMultiplicityForBG(kTRUE), |
64f4118c | 148 | fNumberOfGoodV0s(0), |
40051a3e | 149 | fIsHeavyIon(0), |
150 | fUseCorrectedTPCClsInfo(kFALSE) | |
a0b94e5c | 151 | { |
9c1cb6f7 | 152 | //fESDpid = new AliESDpid; |
a0b94e5c | 153 | } |
154 | ||
155 | ||
156 | AliV0Reader::AliV0Reader(const AliV0Reader & original) : | |
157 | TObject(original), | |
158 | fMCStack(original.fMCStack), | |
48682642 | 159 | // fMCTruth(original.fMCTruth), |
a0b94e5c | 160 | fMCEvent(original.fMCEvent), // for CF |
161 | fChain(original.fChain), | |
48682642 | 162 | // fESDHandler(original.fESDHandler), |
a0b94e5c | 163 | fESDEvent(original.fESDEvent), |
4a6157dc | 164 | fCFManager(original.fCFManager), |
9c1cb6f7 | 165 | // fESDpid(original.fESDpid), |
a0b94e5c | 166 | fHistograms(original.fHistograms), |
167 | fCurrentV0IndexNumber(original.fCurrentV0IndexNumber), | |
168 | fCurrentV0(original.fCurrentV0), | |
169 | fCurrentNegativeKFParticle(original.fCurrentNegativeKFParticle), | |
170 | fCurrentPositiveKFParticle(original.fCurrentPositiveKFParticle), | |
171 | fCurrentMotherKFCandidate(original.fCurrentMotherKFCandidate), | |
172 | fCurrentNegativeESDTrack(original.fCurrentNegativeESDTrack), | |
173 | fCurrentPositiveESDTrack(original.fCurrentPositiveESDTrack), | |
174 | fNegativeTrackLorentzVector(original.fNegativeTrackLorentzVector), | |
175 | fPositiveTrackLorentzVector(original.fPositiveTrackLorentzVector), | |
176 | fMotherCandidateLorentzVector(original.fMotherCandidateLorentzVector), | |
177 | fCurrentXValue(original.fCurrentXValue), | |
178 | fCurrentYValue(original.fCurrentYValue), | |
179 | fCurrentZValue(original.fCurrentZValue), | |
180 | fPositiveTrackPID(original.fPositiveTrackPID), | |
181 | fNegativeTrackPID(original.fNegativeTrackPID), | |
182 | fNegativeMCParticle(original.fNegativeMCParticle), | |
183 | fPositiveMCParticle(original.fPositiveMCParticle), | |
184 | fMotherMCParticle(original.fMotherMCParticle), | |
185 | fMotherCandidateKFMass(original.fMotherCandidateKFMass), | |
186 | fMotherCandidateKFWidth(original.fMotherCandidateKFWidth), | |
187 | fUseKFParticle(kTRUE), | |
188 | fUseESDTrack(kFALSE), | |
189 | fDoMC(kFALSE), | |
10e3319b | 190 | fMaxVertexZ(original.fMaxVertexZ), |
a0b94e5c | 191 | fMaxR(original.fMaxR), |
bd6d9fa3 | 192 | fMinR(original.fMinR), |
a0b94e5c | 193 | fEtaCut(original.fEtaCut), |
dc2883e4 | 194 | fRapidityMesonCut(original.fRapidityMesonCut), |
a0b94e5c | 195 | fPtCut(original.fPtCut), |
48682642 | 196 | fSinglePtCut(original.fSinglePtCut), |
a0b94e5c | 197 | fMaxZ(original.fMaxZ), |
48682642 | 198 | fMinClsTPC(original.fMinClsTPC), |
bd6d9fa3 | 199 | fMinClsTPCToF(original.fMinClsTPCToF), |
a0b94e5c | 200 | fLineCutZRSlope(original.fLineCutZRSlope), |
201 | fLineCutZValue(original.fLineCutZValue), | |
202 | fChi2CutConversion(original.fChi2CutConversion), | |
203 | fChi2CutMeson(original.fChi2CutMeson), | |
9c1cb6f7 | 204 | fAlphaCutMeson(original.fAlphaCutMeson), |
67381a40 | 205 | fAlphaMinCutMeson(original.fAlphaMinCutMeson), |
a0b94e5c | 206 | fPIDProbabilityCutNegativeParticle(original.fPIDProbabilityCutNegativeParticle), |
207 | fPIDProbabilityCutPositiveParticle(original.fPIDProbabilityCutPositiveParticle), | |
9640a3d1 | 208 | fDodEdxSigmaCut(original.fDodEdxSigmaCut), |
e0155998 | 209 | fDoTOFsigmaCut(original.fDoTOFsigmaCut), // RRnewTOF |
9640a3d1 | 210 | fPIDnSigmaAboveElectronLine(original.fPIDnSigmaAboveElectronLine), |
211 | fPIDnSigmaBelowElectronLine(original.fPIDnSigmaBelowElectronLine), | |
e0155998 | 212 | fTofPIDnSigmaAboveElectronLine(original.fTofPIDnSigmaAboveElectronLine), // RRnewTOF |
213 | fTofPIDnSigmaBelowElectronLine(original.fTofPIDnSigmaBelowElectronLine), // RRnewTOF | |
9640a3d1 | 214 | fPIDnSigmaAbovePionLine(original.fPIDnSigmaAbovePionLine), |
215 | fPIDMinPnSigmaAbovePionLine(original.fPIDMinPnSigmaAbovePionLine), | |
10e3319b | 216 | fPIDMaxPnSigmaAbovePionLine(original.fPIDMaxPnSigmaAbovePionLine), |
9c1cb6f7 | 217 | fDoKaonRejectionLowP(original.fDoKaonRejectionLowP), |
218 | fDoProtonRejectionLowP(original.fDoProtonRejectionLowP), | |
219 | fDoPionRejectionLowP(original.fDoPionRejectionLowP), | |
220 | fPIDnSigmaAtLowPAroundKaonLine(original.fPIDnSigmaAtLowPAroundKaonLine), | |
221 | fPIDnSigmaAtLowPAroundProtonLine(original.fPIDnSigmaAtLowPAroundProtonLine), | |
222 | fPIDnSigmaAtLowPAroundPionLine(original.fPIDnSigmaAtLowPAroundPionLine), | |
223 | fPIDMinPKaonRejectionLowP(original.fPIDMinPKaonRejectionLowP), | |
224 | fPIDMinPProtonRejectionLowP(original.fPIDMinPProtonRejectionLowP), | |
225 | fPIDMinPPionRejectionLowP(original.fPIDMinPPionRejectionLowP), | |
70ef88b5 | 226 | fDoQtGammaSelection(original.fDoQtGammaSelection), |
14d7f2f9 | 227 | fDoHighPtQtGammaSelection(original.fDoHighPtQtGammaSelection), // RRnew |
70ef88b5 | 228 | fQtMax(original.fQtMax), |
14d7f2f9 | 229 | fHighPtQtMax(original.fHighPtQtMax), // RRnew |
230 | fPtBorderForQt(original.fPtBorderForQt), // RRnew | |
a0b94e5c | 231 | fXVertexCut(original.fXVertexCut), |
232 | fYVertexCut(original.fYVertexCut), | |
233 | fZVertexCut(original.fZVertexCut), | |
234 | fNSigmaMass(original.fNSigmaMass), | |
235 | fUseImprovedVertex(original.fUseImprovedVertex), | |
236 | fUseOwnXYZCalculation(original.fUseOwnXYZCalculation), | |
5ce758b0 | 237 | fUseConstructGamma(original.fUseConstructGamma), |
1e7846f4 | 238 | fDoCF(original.fDoCF), |
77880bd8 | 239 | fUseOnFlyV0Finder(original.fUseOnFlyV0Finder), |
cb90a330 | 240 | fUpdateV0AlreadyCalled(original.fUpdateV0AlreadyCalled), |
a0b94e5c | 241 | fCurrentEventGoodV0s(original.fCurrentEventGoodV0s), |
7f3c7cc6 | 242 | fV0Pindex(original.fV0Pindex), |
243 | fV0Nindex(original.fV0Nindex), | |
5e55d806 | 244 | // fPreviousEventGoodV0s(original.fPreviousEventGoodV0s), |
87f6de3e | 245 | fCalculateBackground(original.fCalculateBackground), |
5e55d806 | 246 | fBGEventHandler(original.fBGEventHandler), |
037dc2db | 247 | fBGEventInitialized(original.fBGEventInitialized), |
248 | fEsdTrackCuts(original.fEsdTrackCuts), | |
70ef88b5 | 249 | fNumberOfESDTracks(original.fNumberOfESDTracks), |
f14266e7 | 250 | fNEventsForBGCalculation(original.fNEventsForBGCalculation), |
5ce758b0 | 251 | fUseChargedTrackMultiplicityForBG(original.fUseChargedTrackMultiplicityForBG), |
64f4118c | 252 | fNumberOfGoodV0s(original.fNumberOfGoodV0s), |
40051a3e | 253 | fIsHeavyIon(original.fIsHeavyIon), |
254 | fUseCorrectedTPCClsInfo(original.fUseCorrectedTPCClsInfo) | |
a0b94e5c | 255 | { |
256 | ||
257 | } | |
258 | ||
259 | ||
260 | AliV0Reader & AliV0Reader::operator = (const AliV0Reader & /*source*/) | |
261 | { | |
262 | // assignment operator | |
263 | return *this; | |
264 | } | |
9640a3d1 | 265 | AliV0Reader::~AliV0Reader() |
266 | { | |
9c1cb6f7 | 267 | // if(fESDpid){ |
268 | // delete fESDpid; | |
269 | //} | |
9640a3d1 | 270 | } |
a0b94e5c | 271 | |
48682642 | 272 | //____________________________________________________________________________ |
273 | void AliV0Reader::SetInputAndMCEvent(AliVEvent* esd, AliMCEvent* mc) { | |
274 | // Connect the data pointers | |
275 | ||
276 | SetInputEvent(esd); | |
277 | SetMC(mc); | |
278 | ||
279 | } | |
280 | ||
281 | ||
a0b94e5c | 282 | void AliV0Reader::Initialize(){ |
283 | //see header file for documentation | |
5e55d806 | 284 | |
cb90a330 | 285 | fUpdateV0AlreadyCalled = kFALSE; |
48682642 | 286 | |
287 | /* | |
a0b94e5c | 288 | // Get the input handler from the manager |
289 | fESDHandler = (AliESDInputHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()); | |
290 | if(fESDHandler == NULL){ | |
291 | //print warning here | |
292 | } | |
48682642 | 293 | |
a0b94e5c | 294 | // Get pointer to esd event from input handler |
295 | fESDEvent = fESDHandler->GetEvent(); | |
296 | if(fESDEvent == NULL){ | |
297 | //print warning here | |
298 | } | |
48682642 | 299 | |
a0b94e5c | 300 | //Get pointer to MCTruth |
301 | fMCTruth = (AliMCEventHandler*)((AliAnalysisManager::GetAnalysisManager())->GetMCtruthEventHandler()); | |
48682642 | 302 | */ |
303 | ||
304 | ||
305 | ||
306 | // fMCTruth = mcH->MCEvent(); | |
307 | // fMC = mcH->MCEvent(); | |
308 | // stack = fMC->Stack(); | |
309 | ||
310 | ||
311 | //if(fMCTruth == NULL){ | |
a0b94e5c | 312 | //print warning here |
48682642 | 313 | // fDoMC = kFALSE; |
314 | //} | |
315 | ||
316 | if(fMCEvent == NULL){ | |
317 | fDoMC = kFALSE; | |
a0b94e5c | 318 | } |
48682642 | 319 | |
a0b94e5c | 320 | //Get pointer to the mc stack |
48682642 | 321 | // if(fMCTruth){ |
322 | if(fMCEvent){ | |
323 | fMCStack = fMCEvent->Stack(); | |
61374d97 | 324 | if(fMCStack == NULL){ |
325 | //print warning here | |
326 | } | |
5e55d806 | 327 | // Better parameters for MonteCarlo from A. Kalweit 2010/01/8 |
9c1cb6f7 | 328 | // fESDpid->GetTPCResponse().SetBetheBlochParameters( 2.15898e+00/50., |
329 | // 1.75295e+01, | |
330 | // 3.40030e-09, | |
331 | // 1.96178e+00, | |
332 | // 3.91720e+00); | |
5e55d806 | 333 | } |
334 | else{ | |
335 | // Better parameters for data from A. Kalweit 2010/01/8 | |
9c1cb6f7 | 336 | // fESDpid->GetTPCResponse().SetBetheBlochParameters(0.0283086, |
337 | // 2.63394e+01, | |
338 | // 5.04114e-11, | |
339 | // 2.12543e+00, | |
340 | // 4.88663e+00); | |
a0b94e5c | 341 | } |
342 | ||
a0b94e5c | 343 | // for CF |
344 | //Get pointer to the mc event | |
b74269dc | 345 | if(fDoCF && fDoMC){ |
48682642 | 346 | //fMCEvent = fMCTruth->MCEvent(); |
1e7846f4 | 347 | if(fMCEvent == NULL){ |
348 | //print warning here | |
349 | fDoCF = kFALSE; | |
350 | } | |
351 | } | |
a0b94e5c | 352 | |
353 | AliKFParticle::SetField(fESDEvent->GetMagneticField()); | |
5e55d806 | 354 | |
355 | // fCurrentEventGoodV0s = new TClonesArray("TClonesArray", 0); | |
63e16c52 | 356 | if(fCurrentEventGoodV0s == NULL){ |
357 | fCurrentEventGoodV0s = new TClonesArray("AliKFParticle", 0); | |
358 | } | |
5e55d806 | 359 | |
7f3c7cc6 | 360 | fV0Pindex.clear(); |
361 | fV0Nindex.clear(); | |
362 | ||
87f6de3e | 363 | if(fCalculateBackground == kTRUE){ |
364 | if(fBGEventInitialized == kFALSE){ | |
037dc2db | 365 | |
87f6de3e | 366 | |
10e3319b | 367 | Double_t *zBinLimitsArray = new Double_t[9]; |
037dc2db | 368 | zBinLimitsArray[0] = -50.00; |
5ce758b0 | 369 | zBinLimitsArray[1] = -3.375; |
370 | zBinLimitsArray[2] = -1.605; | |
371 | zBinLimitsArray[3] = -0.225; | |
372 | zBinLimitsArray[4] = 1.065; | |
373 | zBinLimitsArray[5] = 2.445; | |
374 | zBinLimitsArray[6] = 4.245; | |
037dc2db | 375 | zBinLimitsArray[7] = 50.00; |
10e3319b | 376 | zBinLimitsArray[8] = 1000.00; |
87f6de3e | 377 | |
10e3319b | 378 | Double_t *multiplicityBinLimitsArray= new Double_t[6]; |
5ce758b0 | 379 | if(fUseChargedTrackMultiplicityForBG == kTRUE){ |
380 | multiplicityBinLimitsArray[0] = 0; | |
381 | multiplicityBinLimitsArray[1] = 8.5; | |
382 | multiplicityBinLimitsArray[2] = 16.5; | |
383 | multiplicityBinLimitsArray[3] = 27.5; | |
384 | multiplicityBinLimitsArray[4] = 41.5; | |
385 | multiplicityBinLimitsArray[5] = 100.; | |
64f4118c | 386 | if(fIsHeavyIon){ |
387 | multiplicityBinLimitsArray[0] = 0; | |
388 | multiplicityBinLimitsArray[1] = 200.; | |
389 | multiplicityBinLimitsArray[2] = 500.; | |
390 | multiplicityBinLimitsArray[3] = 1000.; | |
391 | multiplicityBinLimitsArray[4] = 1500.; | |
392 | multiplicityBinLimitsArray[5] = 3000.; | |
393 | } | |
f14266e7 | 394 | fBGEventHandler = new AliGammaConversionBGHandler(9,6,fNEventsForBGCalculation); |
5ce758b0 | 395 | } |
396 | else{ | |
397 | multiplicityBinLimitsArray[0] = 2; | |
398 | multiplicityBinLimitsArray[1] = 3; | |
399 | multiplicityBinLimitsArray[2] = 4; | |
400 | multiplicityBinLimitsArray[3] = 5; | |
401 | multiplicityBinLimitsArray[4] = 9999; | |
64f4118c | 402 | if(fIsHeavyIon){ |
403 | multiplicityBinLimitsArray[0] = 2; | |
404 | multiplicityBinLimitsArray[1] = 10; | |
405 | multiplicityBinLimitsArray[2] = 30; | |
406 | multiplicityBinLimitsArray[3] = 50; | |
407 | multiplicityBinLimitsArray[4] = 9999; | |
408 | } | |
5ce758b0 | 409 | |
f14266e7 | 410 | fBGEventHandler = new AliGammaConversionBGHandler(9,5,fNEventsForBGCalculation); |
5ce758b0 | 411 | } |
412 | ||
413 | ||
87f6de3e | 414 | |
037dc2db | 415 | /* |
416 | // --------------------------------- | |
417 | Double_t *zBinLimitsArray = new Double_t[1]; | |
418 | zBinLimitsArray[0] = 999999.00; | |
419 | ||
420 | Double_t *multiplicityBinLimitsArray= new Double_t[1]; | |
421 | multiplicityBinLimitsArray[0] = 99999999.00; | |
422 | fBGEventHandler = new AliGammaConversionBGHandler(1,1,10); | |
423 | // --------------------------------- | |
424 | */ | |
87f6de3e | 425 | fBGEventHandler->Initialize(zBinLimitsArray, multiplicityBinLimitsArray); |
426 | fBGEventInitialized = kTRUE; | |
427 | } | |
5e55d806 | 428 | } |
a0b94e5c | 429 | } |
430 | ||
431 | AliESDv0* AliV0Reader::GetV0(Int_t index){ | |
432 | //see header file for documentation | |
433 | fCurrentV0 = fESDEvent->GetV0(index); | |
434 | UpdateV0Information(); | |
435 | return fCurrentV0; | |
436 | } | |
437 | ||
c8206114 | 438 | Int_t AliV0Reader::GetNumberOfContributorsVtx(){ |
f14266e7 | 439 | // returns number of contributors to the vertex |
c8206114 | 440 | if(fESDEvent->GetPrimaryVertexTracks()->GetNContributors()>0) { |
441 | return fESDEvent->GetPrimaryVertexTracks()->GetNContributors(); | |
442 | } | |
443 | ||
444 | if(fESDEvent->GetPrimaryVertexTracks()->GetNContributors()<1) { | |
14d7f2f9 | 445 | // return 0; |
446 | //-AM test pi0s without SPD only vertex | |
c8206114 | 447 | if(fESDEvent->GetPrimaryVertexSPD()->GetNContributors()>0) { |
448 | return fESDEvent->GetPrimaryVertexSPD()->GetNContributors(); | |
449 | ||
450 | } | |
451 | if(fESDEvent->GetPrimaryVertexSPD()->GetNContributors()<1) { | |
452 | cout<<"number of contributors from bad vertex type::"<< fESDEvent->GetPrimaryVertex()->GetName() << endl; | |
453 | return 0; | |
454 | } | |
455 | } | |
456 | return 0; | |
457 | } | |
a0b94e5c | 458 | Bool_t AliV0Reader::CheckForPrimaryVertex(){ |
037dc2db | 459 | //see headerfile for documentation |
c8206114 | 460 | |
461 | if(fESDEvent->GetPrimaryVertexTracks()->GetNContributors()>0) { | |
462 | return 1; | |
463 | } | |
464 | ||
465 | if(fESDEvent->GetPrimaryVertexTracks()->GetNContributors()<1) { | |
466 | // SPD vertex | |
467 | if(fESDEvent->GetPrimaryVertexSPD()->GetNContributors()>0) { | |
14d7f2f9 | 468 | // return 0; |
469 | //-AM test pi0s without SPD only vertex | |
c8206114 | 470 | //cout<<"spd vertex type::"<< fESDEvent->GetPrimaryVertex()->GetName() << endl; |
471 | return 1; | |
472 | ||
473 | } | |
474 | if(fESDEvent->GetPrimaryVertexSPD()->GetNContributors()<1) { | |
475 | // cout<<"bad vertex type::"<< fESDEvent->GetPrimaryVertex()->GetName() << endl; | |
476 | return 0; | |
477 | } | |
478 | } | |
479 | return 0; | |
480 | // return fESDEvent->GetPrimaryVertex()->GetNContributors()>0; | |
a0b94e5c | 481 | } |
482 | ||
10e3319b | 483 | Bool_t AliV0Reader::CheckForPrimaryVertexZ(){ |
484 | //see headerfile for documentation | |
485 | ||
486 | if(TMath::Abs(fESDEvent->GetPrimaryVertex()->GetZ())<GetMaxVertexZ()){ | |
487 | return kTRUE; | |
488 | }else{ | |
489 | return kFALSE; | |
490 | } | |
491 | return kTRUE; | |
492 | } | |
77880bd8 | 493 | |
494 | Bool_t AliV0Reader::CheckV0FinderStatus(Int_t index){ | |
037dc2db | 495 | // see headerfile for documentation |
77880bd8 | 496 | if(fUseOnFlyV0Finder){ |
77880bd8 | 497 | if(!GetV0(index)->GetOnFlyStatus()){ |
498 | return kFALSE; | |
499 | } | |
500 | } | |
501 | if(!fUseOnFlyV0Finder){ | |
51b95cb0 | 502 | if(GetV0(index)->GetOnFlyStatus()){ |
77880bd8 | 503 | return kFALSE; |
504 | } | |
505 | } | |
77880bd8 | 506 | return kTRUE; |
507 | } | |
508 | ||
509 | ||
510 | ||
a0b94e5c | 511 | Bool_t AliV0Reader::NextV0(){ |
512 | //see header file for documentation | |
037dc2db | 513 | |
a0b94e5c | 514 | Bool_t iResult=kFALSE; |
515 | while(fCurrentV0IndexNumber<fESDEvent->GetNumberOfV0s()){ | |
516 | fCurrentV0 = fESDEvent->GetV0(fCurrentV0IndexNumber); | |
037dc2db | 517 | |
1b832bb9 | 518 | fUpdateV0AlreadyCalled=kFALSE; |
519 | ||
037dc2db | 520 | if(fHistograms != NULL){ |
521 | fHistograms->FillHistogram("ESD_AllV0s_InvMass",GetMotherCandidateMass()); | |
522 | } | |
a0b94e5c | 523 | |
524 | // moved it up here so that the correction framework can access pt and eta information | |
525 | if(UpdateV0Information() == kFALSE){ | |
526 | fCurrentV0IndexNumber++; | |
527 | continue; | |
528 | } | |
cb90a330 | 529 | |
a0b94e5c | 530 | Double_t containerInput[3]; |
1e7846f4 | 531 | if(fDoCF){ |
532 | containerInput[0] = GetMotherCandidatePt(); | |
533 | containerInput[1] = GetMotherCandidateEta(); | |
534 | containerInput[2] = GetMotherCandidateMass(); | |
535 | } | |
ebcfaa7e | 536 | /* |
537 | if(fDoCF){ | |
538 | containerInput[0] = GetMotherCandidatePt(); | |
539 | containerInput[1] = GetMotherCandidateEta(); | |
540 | containerInput[2] = GetMotherCandidateMass(); | |
541 | ||
542 | fCFManager->GetParticleContainer()->Fill(containerInput,kStepLikeSign); // for CF | |
543 | fCFManager->GetParticleContainer()->Fill(containerInput,kStepTPCRefit); // for CF | |
544 | fCFManager->GetParticleContainer()->Fill(containerInput,kStepKinks); // for CF | |
545 | } | |
546 | */ | |
547 | ||
a0b94e5c | 548 | //checks if on the fly mode is set |
48e7eac2 | 549 | if ( !CheckV0FinderStatus(fCurrentV0IndexNumber) ){ |
a0b94e5c | 550 | if(fHistograms != NULL){ |
551 | fHistograms->FillHistogram("ESD_CutGetOnFly_InvMass",GetMotherCandidateMass()); | |
552 | } | |
553 | fCurrentV0IndexNumber++; | |
554 | continue; | |
555 | } | |
1e7846f4 | 556 | if(fDoCF){ |
557 | fCFManager->GetParticleContainer()->Fill(containerInput,kStepGetOnFly); // for CF | |
558 | } | |
ebcfaa7e | 559 | |
560 | if(fHistograms != NULL){ | |
561 | fHistograms->FillHistogram("ESD_AllV0sCurrentFinder_InvMass",GetMotherCandidateMass()); | |
562 | } | |
48682642 | 563 | |
564 | Double_t armenterosQtAlfa[2]; | |
565 | GetArmenterosQtAlfa(GetNegativeKFParticle(), | |
566 | GetPositiveKFParticle(), | |
567 | GetMotherCandidateKFCombination(), | |
568 | armenterosQtAlfa); | |
569 | ||
570 | fHistograms->FillHistogram("ESD_AllV0sCurrentFinder_alfa_qt",armenterosQtAlfa[1],armenterosQtAlfa[0]); | |
571 | ||
572 | ||
f14266e7 | 573 | if(fCurrentNegativeESDTrack->Charge() == fCurrentPositiveESDTrack->Charge()){ // avoid like sign |
ebcfaa7e | 574 | // iResult=kFALSE; |
575 | if(fHistograms != NULL ){ | |
576 | fHistograms->FillHistogram("ESD_CutLikeSign_InvMass",GetMotherCandidateMass()); | |
577 | // to avoid filling the other cut histograms. So in this case fUpdateV0AlreadyCalled also serves as a flag for the histogram filling | |
578 | // it will anyway be set to true at the end of the UpdateV0Information function, and there are no return until the end | |
579 | // fUpdateV0AlreadyCalled = kTRUE; | |
580 | } | |
581 | fCurrentV0IndexNumber++; | |
582 | continue; | |
583 | } | |
584 | if(fDoCF){ | |
585 | fCFManager->GetParticleContainer()->Fill(containerInput,kStepLikeSign); // for CF | |
586 | } | |
587 | ||
588 | ||
589 | if( !(fCurrentNegativeESDTrack->GetStatus() & AliESDtrack::kTPCrefit) || | |
590 | !(fCurrentPositiveESDTrack->GetStatus() & AliESDtrack::kTPCrefit) ){ | |
591 | // if( !(fCurrentNegativeESDTrack->GetStatus() & AliESDtrack::kITSrefit) || | |
592 | // !(fCurrentPositiveESDTrack->GetStatus() & AliESDtrack::kITSrefit) ){ | |
593 | // iResult=kFALSE; | |
594 | if(fHistograms != NULL){ | |
595 | fHistograms->FillHistogram("ESD_CutRefit_InvMass",GetMotherCandidateMass()); | |
596 | // to avoid filling the other cut histograms. So in this case fUpdateV0AlreadyCalled also serves as a flag for the histogram filling | |
597 | // it will anyway be set to true at the end of the UpdateV0Information function, and there are no return until the end | |
598 | //fUpdateV0AlreadyCalled = kTRUE; | |
599 | } | |
600 | fCurrentV0IndexNumber++; | |
601 | continue; | |
602 | } | |
603 | if(fDoCF){ | |
604 | fCFManager->GetParticleContainer()->Fill(containerInput,kStepTPCRefit); // for CF | |
605 | } | |
606 | ||
607 | ||
608 | ||
609 | if( fCurrentNegativeESDTrack->GetKinkIndex(0) > 0 || | |
610 | fCurrentPositiveESDTrack->GetKinkIndex(0) > 0) { | |
611 | //iResult=kFALSE; | |
612 | if(fHistograms != NULL ){ | |
613 | fHistograms->FillHistogram("ESD_CutKink_InvMass",GetMotherCandidateMass()); | |
614 | // to avoid filling the other cut histograms. So in this case fUpdateV0AlreadyCalled also serves as a flag for the histogram filling | |
615 | // it will anyway be set to true at the end of the UpdateV0Information function, and there are no return until the end | |
616 | //fUpdateV0AlreadyCalled = kTRUE; | |
617 | } | |
618 | fCurrentV0IndexNumber++; | |
619 | continue; | |
620 | } | |
621 | ||
622 | if(fDoCF){ | |
623 | fCFManager->GetParticleContainer()->Fill(containerInput,kStepKinks); // for CF | |
624 | } | |
625 | ||
dc2883e4 | 626 | fHistograms->FillHistogram("ESD_AllV0sCurrentFinder_goodtracks_alfa_qt",armenterosQtAlfa[1],armenterosQtAlfa[0]); |
627 | ||
ebcfaa7e | 628 | if(fDodEdxSigmaCut == kTRUE){ |
9c1cb6f7 | 629 | if( fgESDpid->NumberOfSigmasTPC(fCurrentPositiveESDTrack,AliPID::kElectron)<fPIDnSigmaBelowElectronLine || |
630 | fgESDpid->NumberOfSigmasTPC(fCurrentPositiveESDTrack,AliPID::kElectron)>fPIDnSigmaAboveElectronLine || | |
631 | fgESDpid->NumberOfSigmasTPC(fCurrentNegativeESDTrack,AliPID::kElectron)<fPIDnSigmaBelowElectronLine || | |
632 | fgESDpid->NumberOfSigmasTPC(fCurrentNegativeESDTrack,AliPID::kElectron)>fPIDnSigmaAboveElectronLine ){ | |
ebcfaa7e | 633 | //iResult=kFALSE; |
634 | if(fHistograms != NULL ){ | |
635 | fHistograms->FillHistogram("ESD_CutdEdxSigmaElectronLine_InvMass",GetMotherCandidateMass()); | |
636 | // to avoid filling the other cut histograms. So in this case fUpdateV0AlreadyCalled also serves as a flag for the histogram filling | |
637 | // it will anyway be set to true at the end of the UpdateV0Information function, and there are no return until the end | |
638 | //fUpdateV0AlreadyCalled = kTRUE; | |
639 | } | |
640 | fCurrentV0IndexNumber++; | |
641 | continue; | |
642 | } | |
643 | if(fDoCF){ | |
f14266e7 | 644 | fCFManager->GetParticleContainer()->Fill(containerInput,kStepdEdxElectronselection); // for CF |
ebcfaa7e | 645 | } |
646 | ||
10e3319b | 647 | if( fCurrentPositiveESDTrack->P()>fPIDMinPnSigmaAbovePionLine && fCurrentPositiveESDTrack->P()<fPIDMaxPnSigmaAbovePionLine ){ |
9c1cb6f7 | 648 | if(fgESDpid->NumberOfSigmasTPC(fCurrentPositiveESDTrack,AliPID::kElectron)>fPIDnSigmaBelowElectronLine && |
649 | fgESDpid->NumberOfSigmasTPC(fCurrentPositiveESDTrack,AliPID::kElectron)<fPIDnSigmaAboveElectronLine&& | |
650 | fgESDpid->NumberOfSigmasTPC(fCurrentPositiveESDTrack,AliPID::kPion)<fPIDnSigmaAbovePionLine){ | |
ebcfaa7e | 651 | // iResult=kFALSE; |
652 | if(fHistograms != NULL){ | |
653 | fHistograms->FillHistogram("ESD_CutdEdxSigmaPionLine_InvMass",GetMotherCandidateMass()); | |
654 | // to avoid filling the other cut histograms. So in this case fUpdateV0AlreadyCalled also serves as a flag for the histogram filling | |
655 | // it will anyway be set to true at the end of the UpdateV0Information function, and there are no return until the end | |
656 | //fUpdateV0AlreadyCalled = kTRUE; | |
657 | } | |
658 | fCurrentV0IndexNumber++; | |
659 | continue; | |
660 | } | |
661 | } | |
662 | ||
10e3319b | 663 | if( fCurrentNegativeESDTrack->P()>fPIDMinPnSigmaAbovePionLine && fCurrentNegativeESDTrack->P()<fPIDMaxPnSigmaAbovePionLine){ |
9c1cb6f7 | 664 | if(fgESDpid->NumberOfSigmasTPC(fCurrentNegativeESDTrack,AliPID::kElectron)>fPIDnSigmaBelowElectronLine && |
665 | fgESDpid->NumberOfSigmasTPC(fCurrentNegativeESDTrack,AliPID::kElectron)<fPIDnSigmaAboveElectronLine&& | |
666 | fgESDpid->NumberOfSigmasTPC(fCurrentNegativeESDTrack,AliPID::kPion)<fPIDnSigmaAbovePionLine){ | |
ebcfaa7e | 667 | // iResult=kFALSE; |
668 | if(fHistograms != NULL){ | |
669 | fHistograms->FillHistogram("ESD_CutdEdxSigmaPionLine_InvMass",GetMotherCandidateMass()); | |
670 | // to avoid filling the other cut histograms. So in this case fUpdateV0AlreadyCalled also serves as a flag for the histogram filling | |
671 | // it will anyway be set to true at the end of the UpdateV0Information function, and there are no return until the end | |
672 | //fUpdateV0AlreadyCalled = kTRUE; | |
673 | } | |
674 | fCurrentV0IndexNumber++; | |
675 | continue; | |
676 | } | |
677 | } | |
678 | if(fDoCF){ | |
f14266e7 | 679 | fCFManager->GetParticleContainer()->Fill(containerInput,kStepdEdxPionrejection); // for CF |
ebcfaa7e | 680 | } |
681 | ||
682 | } | |
10e3319b | 683 | |
9c1cb6f7 | 684 | if(fDoKaonRejectionLowP == kTRUE){ |
685 | if( fCurrentNegativeESDTrack->P()<fPIDMinPKaonRejectionLowP ){ | |
686 | if( TMath::Abs(fgESDpid->NumberOfSigmasTPC(fCurrentNegativeESDTrack,AliPID::kKaon))<fPIDnSigmaAtLowPAroundKaonLine){ | |
687 | if(fHistograms != NULL){ | |
688 | fHistograms->FillHistogram("ESD_CutKaonRejectionLowP_InvMass",GetMotherCandidateMass()); | |
689 | // to avoid filling the other cut histograms. So in this case fUpdateV0AlreadyCalled also serves as a flag for the histogram filling | |
690 | // it will anyway be set to true at the end of the UpdateV0Information function, and there are no return until the end | |
691 | //fUpdateV0AlreadyCalled = kTRUE; | |
692 | } | |
693 | fCurrentV0IndexNumber++; | |
694 | continue; | |
695 | } | |
696 | } | |
697 | if( fCurrentPositiveESDTrack->P()<fPIDMinPKaonRejectionLowP ){ | |
698 | if( TMath::Abs(fgESDpid->NumberOfSigmasTPC(fCurrentPositiveESDTrack,AliPID::kKaon))<fPIDnSigmaAtLowPAroundKaonLine){ | |
699 | if(fHistograms != NULL){ | |
700 | fHistograms->FillHistogram("ESD_CutKaonRejectionLowP_InvMass",GetMotherCandidateMass()); | |
701 | // to avoid filling the other cut histograms. So in this case fUpdateV0AlreadyCalled also serves as a flag for the histogram filling | |
702 | // it will anyway be set to true at the end of the UpdateV0Information function, and there are no return until the end | |
703 | //fUpdateV0AlreadyCalled = kTRUE; | |
704 | } | |
705 | fCurrentV0IndexNumber++; | |
706 | continue; | |
707 | } | |
708 | } | |
709 | } | |
10e3319b | 710 | |
9c1cb6f7 | 711 | if(fDoProtonRejectionLowP == kTRUE){ |
712 | if( fCurrentNegativeESDTrack->P()<fPIDMinPProtonRejectionLowP){ | |
713 | if( TMath::Abs(fgESDpid->NumberOfSigmasTPC(fCurrentNegativeESDTrack,AliPID::kProton))<fPIDnSigmaAtLowPAroundProtonLine){ | |
714 | if(fHistograms != NULL){ | |
715 | fHistograms->FillHistogram("ESD_CutProtonRejectionLowP_InvMass",GetMotherCandidateMass()); | |
716 | // to avoid filling the other cut histograms. So in this case fUpdateV0AlreadyCalled also serves as a flag for the histogram filling | |
717 | // it will anyway be set to true at the end of the UpdateV0Information function, and there are no return until the end | |
718 | //fUpdateV0AlreadyCalled = kTRUE; | |
719 | } | |
720 | fCurrentV0IndexNumber++; | |
721 | continue; | |
722 | } | |
723 | } | |
724 | if( fCurrentPositiveESDTrack->P()<fPIDMinPProtonRejectionLowP ){ | |
725 | if( TMath::Abs(fgESDpid->NumberOfSigmasTPC(fCurrentPositiveESDTrack,AliPID::kProton))<fPIDnSigmaAtLowPAroundProtonLine){ | |
726 | if(fHistograms != NULL){ | |
727 | fHistograms->FillHistogram("ESD_CutProtonRejectionLowP_InvMass",GetMotherCandidateMass()); | |
728 | // to avoid filling the other cut histograms. So in this case fUpdateV0AlreadyCalled also serves as a flag for the histogram filling | |
729 | // it will anyway be set to true at the end of the UpdateV0Information function, and there are no return until the end | |
730 | //fUpdateV0AlreadyCalled = kTRUE; | |
731 | } | |
732 | fCurrentV0IndexNumber++; | |
733 | continue; | |
734 | } | |
735 | } | |
736 | ||
737 | } | |
10e3319b | 738 | |
9c1cb6f7 | 739 | if(fDoPionRejectionLowP == kTRUE){ |
740 | if( fCurrentNegativeESDTrack->P()<fPIDMinPPionRejectionLowP ){ | |
741 | if( TMath::Abs(fgESDpid->NumberOfSigmasTPC(fCurrentNegativeESDTrack,AliPID::kPion))<fPIDnSigmaAtLowPAroundPionLine){ | |
742 | if(fHistograms != NULL){ | |
743 | fHistograms->FillHistogram("ESD_CutPionRejectionLowP_InvMass",GetMotherCandidateMass()); | |
744 | // to avoid filling the other cut histograms. So in this case fUpdateV0AlreadyCalled also serves as a flag for the histogram filling | |
745 | // it will anyway be set to true at the end of the UpdateV0Information function, and there are no return until the end | |
746 | //fUpdateV0AlreadyCalled = kTRUE; | |
747 | } | |
748 | fCurrentV0IndexNumber++; | |
749 | continue; | |
750 | } | |
751 | } | |
752 | if( fCurrentPositiveESDTrack->P()<fPIDMinPPionRejectionLowP ){ | |
753 | if( TMath::Abs(fgESDpid->NumberOfSigmasTPC(fCurrentPositiveESDTrack,AliPID::kPion))<fPIDnSigmaAtLowPAroundPionLine){ | |
754 | if(fHistograms != NULL){ | |
755 | fHistograms->FillHistogram("ESD_CutPionRejectionLowP_InvMass",GetMotherCandidateMass()); | |
756 | // to avoid filling the other cut histograms. So in this case fUpdateV0AlreadyCalled also serves as a flag for the histogram filling | |
757 | // it will anyway be set to true at the end of the UpdateV0Information function, and there are no return until the end | |
758 | //fUpdateV0AlreadyCalled = kTRUE; | |
759 | } | |
760 | fCurrentV0IndexNumber++; | |
761 | continue; | |
762 | } | |
763 | } | |
764 | } | |
765 | ||
10e3319b | 766 | |
e0155998 | 767 | if( fDoTOFsigmaCut == kTRUE ){ // RRnewTOF start ///////////////////////////////////////////////////////////////////////////// |
768 | Bool_t PosTrackNotTOFelec = kFALSE; | |
769 | Bool_t NegTrackNotTOFelec = kFALSE; | |
770 | Double_t t0pos = fgESDpid->GetTOFResponse().GetStartTime(fCurrentPositiveESDTrack->P()); | |
771 | Double_t t0neg = fgESDpid->GetTOFResponse().GetStartTime(fCurrentNegativeESDTrack->P()); | |
772 | Double_t fnSigmaPos = fgESDpid->NumberOfSigmasTOF(fCurrentPositiveESDTrack, AliPID::kElectron, t0pos); | |
773 | Double_t fnSigmaNeg = fgESDpid->NumberOfSigmasTOF(fCurrentNegativeESDTrack, AliPID::kElectron, t0neg); | |
774 | if( fCurrentPositiveESDTrack->GetStatus() & AliESDtrack::kTOFpid ){ | |
775 | if( (fnSigmaPos>fTofPIDnSigmaAboveElectronLine) || (fnSigmaPos<fTofPIDnSigmaBelowElectronLine) ) PosTrackNotTOFelec = kTRUE; | |
776 | } | |
777 | if( fCurrentNegativeESDTrack->GetStatus() & AliESDtrack::kTOFpid ){ | |
778 | if( (fnSigmaNeg>fTofPIDnSigmaAboveElectronLine) || (fnSigmaNeg<fTofPIDnSigmaBelowElectronLine) ) NegTrackNotTOFelec = kTRUE; | |
779 | } | |
780 | if( (PosTrackNotTOFelec==kTRUE) || (NegTrackNotTOFelec==kTRUE) ){ | |
781 | if(fHistograms != NULL){ | |
782 | fHistograms->FillHistogram("ESD_CutTOFsigmaElec_InvMass",GetMotherCandidateMass()); | |
783 | } | |
784 | fCurrentV0IndexNumber++; | |
785 | continue; | |
786 | } | |
787 | } /////////////////////////////// RRnewTOF end /////////////////////////////////////////////////////////////////////////////// | |
788 | ||
789 | ||
70ef88b5 | 790 | // Gamma selection based on QT from Armenteros |
14d7f2f9 | 791 | if(fDoQtGammaSelection == kTRUE){ // RRnew start : apply different qT-cut above/below |
792 | if(fDoHighPtQtGammaSelection){ | |
793 | if(GetMotherCandidatePt() < fPtBorderForQt){ | |
794 | if(armenterosQtAlfa[0]>fQtMax){ | |
795 | if(fHistograms != NULL){ | |
796 | fHistograms->FillHistogram("ESD_CutQt_InvMass",GetMotherCandidateMass()); | |
797 | } | |
798 | fCurrentV0IndexNumber++; | |
799 | continue; | |
800 | } | |
801 | } | |
802 | else{ | |
803 | if(armenterosQtAlfa[0]>fHighPtQtMax) { | |
804 | if(fHistograms != NULL){ | |
805 | fHistograms->FillHistogram("ESD_CutQt_InvMass",GetMotherCandidateMass()); | |
806 | } | |
807 | fCurrentV0IndexNumber++; | |
808 | continue; | |
809 | } | |
810 | } | |
811 | ||
70ef88b5 | 812 | } |
14d7f2f9 | 813 | else{ |
814 | if(armenterosQtAlfa[0]>fQtMax){ | |
815 | if(fHistograms != NULL){ | |
816 | fHistograms->FillHistogram("ESD_CutQt_InvMass",GetMotherCandidateMass()); | |
817 | } | |
818 | fCurrentV0IndexNumber++; | |
819 | continue; | |
820 | } | |
821 | } | |
822 | } // RRnew end | |
70ef88b5 | 823 | |
a0b94e5c | 824 | //checks if we have a prim vertex |
c8206114 | 825 | //if(fESDEvent->GetPrimaryVertex()->GetNContributors()<=0) { |
826 | if(GetNumberOfContributorsVtx()<=0) { | |
a0b94e5c | 827 | if(fHistograms != NULL){ |
828 | fHistograms->FillHistogram("ESD_CutNContributors_InvMass",GetMotherCandidateMass()); | |
829 | } | |
830 | fCurrentV0IndexNumber++; | |
831 | continue; | |
832 | } | |
1e7846f4 | 833 | if(fDoCF){ |
834 | fCFManager->GetParticleContainer()->Fill(containerInput,kStepNContributors); // for CF | |
835 | } | |
a0b94e5c | 836 | |
837 | //Check the pid probability | |
838 | if(CheckPIDProbability(fPIDProbabilityCutNegativeParticle,fPIDProbabilityCutPositiveParticle)==kFALSE){ | |
839 | if(fHistograms != NULL){ | |
840 | fHistograms->FillHistogram("ESD_CutPIDProb_InvMass",GetMotherCandidateMass()); | |
841 | } | |
842 | fCurrentV0IndexNumber++; | |
843 | continue; | |
844 | } | |
1e7846f4 | 845 | if(fDoCF){ |
846 | fCFManager->GetParticleContainer()->Fill(containerInput,kStepTPCPID); // for CF | |
847 | } | |
a0b94e5c | 848 | |
a0b94e5c | 849 | if(GetXYRadius()>fMaxR){ // cuts on distance from collision point |
850 | if(fHistograms != NULL){ | |
851 | fHistograms->FillHistogram("ESD_CutR_InvMass",GetMotherCandidateMass()); | |
852 | } | |
853 | fCurrentV0IndexNumber++; | |
854 | continue; | |
1e7846f4 | 855 | } |
856 | if(fDoCF){ | |
857 | fCFManager->GetParticleContainer()->Fill(containerInput,kStepR); // for CF | |
858 | } | |
bd6d9fa3 | 859 | if(GetXYRadius()<fMinR){ // cuts on distance from collision point |
860 | if(fHistograms != NULL){ | |
861 | fHistograms->FillHistogram("ESD_CutMinR_InvMass",GetMotherCandidateMass()); | |
862 | } | |
863 | fCurrentV0IndexNumber++; | |
864 | continue; | |
865 | } | |
a0b94e5c | 866 | |
bd6d9fa3 | 867 | |
a0b94e5c | 868 | |
869 | if((TMath::Abs(fCurrentZValue)*fLineCutZRSlope)-fLineCutZValue > GetXYRadius() ){ // cuts out regions where we do not reconstruct | |
870 | if(fHistograms != NULL){ | |
871 | fHistograms->FillHistogram("ESD_CutLine_InvMass",GetMotherCandidateMass()); | |
872 | } | |
873 | fCurrentV0IndexNumber++; | |
874 | continue; | |
1e7846f4 | 875 | } |
876 | if(fDoCF){ | |
877 | fCFManager->GetParticleContainer()->Fill(containerInput,kStepLine); // for CF | |
878 | } | |
a0b94e5c | 879 | |
880 | if(TMath::Abs(fCurrentZValue) > fMaxZ ){ // cuts out regions where we do not reconstruct | |
881 | if(fHistograms != NULL){ | |
882 | fHistograms->FillHistogram("ESD_CutZ_InvMass",GetMotherCandidateMass()); | |
883 | } | |
884 | fCurrentV0IndexNumber++; | |
885 | continue; | |
1e7846f4 | 886 | } |
887 | if(fDoCF){ | |
888 | fCFManager->GetParticleContainer()->Fill(containerInput,kStepZ); // for CF | |
889 | } | |
a0b94e5c | 890 | |
891 | /* Moved further up so corr framework can work | |
892 | if(UpdateV0Information() == kFALSE){ | |
893 | fCurrentV0IndexNumber++; | |
894 | continue; | |
895 | } | |
896 | */ | |
48682642 | 897 | if(fCurrentNegativeESDTrack->GetNcls(1) < fMinClsTPC || fCurrentPositiveESDTrack->GetNcls(1) < fMinClsTPC ){ |
898 | if(fHistograms != NULL){ | |
899 | fHistograms->FillHistogram("ESD_CutMinNClsTPC_InvMass",GetMotherCandidateMass()); | |
900 | } | |
901 | fCurrentV0IndexNumber++; | |
902 | continue; | |
903 | } | |
904 | if(fDoCF){ | |
905 | fCFManager->GetParticleContainer()->Fill(containerInput,kStepMinClsTPC); // for CF | |
906 | } | |
f14266e7 | 907 | Double_t negclsToF = 0.; |
40051a3e | 908 | if (!fUseCorrectedTPCClsInfo ){ |
909 | if(fCurrentNegativeESDTrack->GetTPCNclsF()!=0 ){ | |
910 | negclsToF = (Double_t)fCurrentNegativeESDTrack->GetNcls(1)/(Double_t)fCurrentNegativeESDTrack->GetTPCNclsF(); | |
911 | } | |
912 | }else{ | |
913 | negclsToF = fCurrentNegativeESDTrack->GetTPCClusterInfo(2,0,GetFirstTPCRow(GetXYRadius())); | |
bd6d9fa3 | 914 | } |
915 | ||
f14266e7 | 916 | Double_t posclsToF = 0.; |
40051a3e | 917 | if (!fUseCorrectedTPCClsInfo ){ |
918 | if(fCurrentPositiveESDTrack->GetTPCNclsF()!=0 ){ | |
919 | posclsToF = (Double_t)fCurrentPositiveESDTrack->GetNcls(1)/(Double_t)fCurrentPositiveESDTrack->GetTPCNclsF(); | |
920 | } | |
921 | }else{ | |
922 | posclsToF = fCurrentPositiveESDTrack->GetTPCClusterInfo(2,0,GetFirstTPCRow(GetXYRadius())); | |
bd6d9fa3 | 923 | } |
924 | ||
f14266e7 | 925 | if( negclsToF < fMinClsTPCToF || posclsToF < fMinClsTPCToF ){ |
bd6d9fa3 | 926 | if(fHistograms != NULL){ |
927 | fHistograms->FillHistogram("ESD_CutMinNClsTPCToF_InvMass",GetMotherCandidateMass()); | |
928 | } | |
929 | fCurrentV0IndexNumber++; | |
930 | continue; | |
931 | } | |
932 | ||
933 | ||
9640a3d1 | 934 | |
a0b94e5c | 935 | |
936 | if(fUseKFParticle){ | |
48682642 | 937 | |
938 | ||
939 | if( fCurrentNegativeKFParticle->GetPt()< fSinglePtCut || fCurrentPositiveKFParticle->GetPt()< fSinglePtCut){ | |
940 | if(fHistograms != NULL){ | |
941 | fHistograms->FillHistogram("ESD_CutSinglePt_InvMass",GetMotherCandidateMass()); | |
942 | } | |
943 | fCurrentV0IndexNumber++; | |
944 | continue; | |
945 | } | |
946 | if(fDoCF){ | |
947 | fCFManager->GetParticleContainer()->Fill(containerInput,kStepSinglePt); // for CF | |
948 | } | |
949 | ||
950 | ||
a0b94e5c | 951 | if(fCurrentMotherKFCandidate->GetNDF()<=0){ |
952 | if(fHistograms != NULL){ | |
953 | fHistograms->FillHistogram("ESD_CutNDF_InvMass",GetMotherCandidateMass()); | |
954 | } | |
955 | fCurrentV0IndexNumber++; | |
956 | continue; | |
957 | } | |
1e7846f4 | 958 | if(fDoCF){ |
959 | fCFManager->GetParticleContainer()->Fill(containerInput,kStepNDF); // for CF | |
960 | } | |
a0b94e5c | 961 | |
962 | Double_t chi2V0 = fCurrentMotherKFCandidate->GetChi2()/fCurrentMotherKFCandidate->GetNDF(); | |
963 | if(chi2V0 > fChi2CutConversion || chi2V0 <=0){ | |
964 | if(fHistograms != NULL){ | |
965 | fHistograms->FillHistogram("ESD_CutChi2_InvMass",GetMotherCandidateMass()); | |
966 | } | |
967 | fCurrentV0IndexNumber++; | |
968 | continue; | |
969 | } | |
1e7846f4 | 970 | if(fDoCF){ |
971 | fCFManager->GetParticleContainer()->Fill(containerInput,kStepChi2); // for CF | |
972 | } | |
a0b94e5c | 973 | |
974 | if(TMath::Abs(fMotherCandidateLorentzVector->Eta())> fEtaCut){ | |
975 | if(fHistograms != NULL){ | |
976 | fHistograms->FillHistogram("ESD_CutEta_InvMass",GetMotherCandidateMass()); | |
977 | } | |
978 | fCurrentV0IndexNumber++; | |
979 | continue; | |
980 | } | |
10e3319b | 981 | |
982 | if(TMath::Abs(fCurrentNegativeKFParticle->GetEta())> fEtaCut){ | |
983 | if(fHistograms != NULL){ | |
984 | fHistograms->FillHistogram("ESD_CutEta_InvMass",GetMotherCandidateMass()); | |
985 | } | |
986 | fCurrentV0IndexNumber++; | |
987 | continue; | |
988 | } | |
989 | ||
990 | if(TMath::Abs(fCurrentPositiveKFParticle->GetEta())> fEtaCut){ | |
991 | if(fHistograms != NULL){ | |
992 | fHistograms->FillHistogram("ESD_CutEta_InvMass",GetMotherCandidateMass()); | |
993 | } | |
994 | fCurrentV0IndexNumber++; | |
995 | continue; | |
996 | } | |
997 | ||
1e7846f4 | 998 | if(fDoCF){ |
999 | fCFManager->GetParticleContainer()->Fill(containerInput,kStepEta); // for CF | |
1000 | } | |
a0b94e5c | 1001 | |
1002 | if(fMotherCandidateLorentzVector->Pt()<fPtCut){ | |
1003 | if(fHistograms != NULL){ | |
1004 | fHistograms->FillHistogram("ESD_CutPt_InvMass",GetMotherCandidateMass()); | |
1005 | } | |
1006 | fCurrentV0IndexNumber++; | |
1007 | continue; | |
1008 | } | |
1e7846f4 | 1009 | if(fDoCF){ |
1010 | fCFManager->GetParticleContainer()->Fill(containerInput,kStepPt); // for CF | |
1011 | } | |
a0b94e5c | 1012 | |
1013 | } | |
1014 | else if(fUseESDTrack){ | |
1015 | //TODO | |
1016 | } | |
9640a3d1 | 1017 | |
1018 | if(fHistograms != NULL){ | |
1019 | fHistograms->FillHistogram("ESD_GoodV0s_InvMass",GetMotherCandidateMass()); | |
1020 | } | |
1021 | ||
5e55d806 | 1022 | // fCurrentEventGoodV0s.push_back(*fCurrentMotherKFCandidate); |
1023 | ||
1024 | new((*fCurrentEventGoodV0s)[fCurrentEventGoodV0s->GetEntriesFast()]) AliKFParticle(*fCurrentMotherKFCandidate); | |
7f3c7cc6 | 1025 | fV0Pindex.push_back(fCurrentV0->GetPindex()); |
1026 | fV0Nindex.push_back(fCurrentV0->GetNindex()); | |
5e55d806 | 1027 | |
a0b94e5c | 1028 | iResult=kTRUE;//means we have a v0 who survived all the cuts applied |
1029 | ||
5ce758b0 | 1030 | fNumberOfGoodV0s++; |
1031 | ||
a0b94e5c | 1032 | fCurrentV0IndexNumber++; |
1033 | ||
1034 | break; | |
1035 | } | |
1036 | return iResult; | |
1037 | } | |
1038 | ||
1039 | Bool_t AliV0Reader::UpdateV0Information(){ | |
1040 | //see header file for documentation | |
1041 | ||
1042 | Bool_t iResult=kTRUE; // for taking out not refitted, kinks and like sign tracks | |
1043 | ||
1044 | Bool_t switchTracks = kFALSE; | |
1045 | ||
1046 | fCurrentNegativeESDTrack = fESDEvent->GetTrack(fCurrentV0->GetNindex()); | |
1047 | fCurrentPositiveESDTrack = fESDEvent->GetTrack(fCurrentV0->GetPindex()); | |
ebcfaa7e | 1048 | |
1049 | if(fCurrentPositiveESDTrack->GetSign() == -1 && fCurrentNegativeESDTrack->GetSign() == 1){ // switch wrong signed tracks | |
1050 | fCurrentNegativeESDTrack = fESDEvent->GetTrack(fCurrentV0->GetPindex()); | |
1051 | fCurrentPositiveESDTrack = fESDEvent->GetTrack(fCurrentV0->GetNindex()); | |
1052 | switchTracks = kTRUE; | |
1053 | } | |
a0b94e5c | 1054 | |
a0b94e5c | 1055 | if(fCurrentNegativeKFParticle != NULL){ |
1056 | delete fCurrentNegativeKFParticle; | |
1057 | } | |
1058 | if(switchTracks == kFALSE){ | |
1059 | fCurrentNegativeKFParticle = new AliKFParticle(*(fCurrentV0->GetParamN()),fNegativeTrackPID); | |
1060 | } | |
1061 | else{ | |
1062 | fCurrentNegativeKFParticle = new AliKFParticle(*(fCurrentV0->GetParamP()),fNegativeTrackPID); | |
1063 | } | |
1064 | ||
1065 | if(fCurrentPositiveKFParticle != NULL){ | |
1066 | delete fCurrentPositiveKFParticle; | |
1067 | } | |
1068 | if(switchTracks == kFALSE){ | |
1069 | fCurrentPositiveKFParticle = new AliKFParticle(*(fCurrentV0->GetParamP()),fPositiveTrackPID); | |
1070 | } | |
1071 | else{ | |
1072 | fCurrentPositiveKFParticle = new AliKFParticle(*(fCurrentV0->GetParamN()),fPositiveTrackPID); | |
1073 | } | |
1074 | ||
1075 | if(fCurrentMotherKFCandidate != NULL){ | |
1076 | delete fCurrentMotherKFCandidate; | |
1077 | } | |
5ce758b0 | 1078 | |
1079 | if(fUseConstructGamma==kTRUE){ | |
1080 | fCurrentMotherKFCandidate = new AliKFParticle;//(*fCurrentNegativeKFParticle,*fCurrentPositiveKFParticle); | |
1081 | fCurrentMotherKFCandidate->ConstructGamma(*fCurrentNegativeKFParticle,*fCurrentPositiveKFParticle); | |
1082 | }else{ | |
1083 | fCurrentMotherKFCandidate = new AliKFParticle(*fCurrentNegativeKFParticle,*fCurrentPositiveKFParticle); | |
1084 | if(fPositiveTrackPID==-11 && fNegativeTrackPID==11){ | |
1085 | fCurrentMotherKFCandidate->SetMassConstraint(0,fNSigmaMass); | |
1086 | } | |
a0b94e5c | 1087 | } |
a0b94e5c | 1088 | if(fUseImprovedVertex == kTRUE){ |
1089 | AliKFVertex primaryVertexImproved(*GetPrimaryVertex()); | |
1090 | primaryVertexImproved+=*fCurrentMotherKFCandidate; | |
1091 | fCurrentMotherKFCandidate->SetProductionVertex(primaryVertexImproved); | |
1092 | } | |
1093 | ||
1094 | fCurrentMotherKFCandidate->GetMass(fMotherCandidateKFMass,fMotherCandidateKFWidth); | |
ebcfaa7e | 1095 | |
a0b94e5c | 1096 | if(fNegativeTrackLorentzVector != NULL){ |
1097 | delete fNegativeTrackLorentzVector; | |
1098 | } | |
1099 | if(fUseKFParticle){ | |
1100 | fNegativeTrackLorentzVector = new TLorentzVector(fCurrentNegativeKFParticle->Px(),fCurrentNegativeKFParticle->Py(),fCurrentNegativeKFParticle->Pz()); | |
1101 | } | |
1102 | else if(fUseESDTrack){ | |
1103 | fNegativeTrackLorentzVector = new TLorentzVector(fCurrentNegativeESDTrack->Px(),fCurrentNegativeESDTrack->Py(),fCurrentNegativeESDTrack->Pz()); | |
1104 | } | |
1105 | ||
1106 | if(fPositiveTrackLorentzVector != NULL){ | |
1107 | delete fPositiveTrackLorentzVector; | |
1108 | } | |
1109 | if(fUseKFParticle){ | |
1110 | fPositiveTrackLorentzVector = new TLorentzVector(fCurrentPositiveKFParticle->Px(),fCurrentPositiveKFParticle->Py(),fCurrentPositiveKFParticle->Pz()); | |
1111 | } | |
1112 | else if(fUseESDTrack){ | |
1113 | fPositiveTrackLorentzVector = new TLorentzVector(fCurrentPositiveESDTrack->Px(),fCurrentPositiveESDTrack->Py(),fCurrentPositiveESDTrack->Pz()); | |
1114 | } | |
1115 | ||
1116 | if(fMotherCandidateLorentzVector != NULL){ | |
1117 | delete fMotherCandidateLorentzVector; | |
1118 | } | |
1119 | if(fUseKFParticle){ | |
1120 | fMotherCandidateLorentzVector = new TLorentzVector(*fNegativeTrackLorentzVector + *fPositiveTrackLorentzVector); | |
1121 | } | |
1122 | else if(fUseESDTrack){ | |
1123 | fMotherCandidateLorentzVector = new TLorentzVector(*fNegativeTrackLorentzVector + *fPositiveTrackLorentzVector); | |
1124 | } | |
1125 | ||
1126 | if(fPositiveTrackPID==-11 && fNegativeTrackPID==11){ | |
1127 | fMotherCandidateLorentzVector->SetXYZM(fMotherCandidateLorentzVector->Px() ,fMotherCandidateLorentzVector->Py(),fMotherCandidateLorentzVector->Pz(),0.); | |
1128 | } | |
1129 | ||
1130 | ||
1131 | if(fDoMC == kTRUE){ | |
1132 | fMotherMCParticle= NULL; | |
1133 | fNegativeMCParticle = fMCStack->Particle(TMath::Abs(fESDEvent->GetTrack(fCurrentV0->GetNindex())->GetLabel())); | |
1134 | fPositiveMCParticle = fMCStack->Particle(TMath::Abs(fESDEvent->GetTrack(fCurrentV0->GetPindex())->GetLabel())); | |
1135 | if(fPositiveMCParticle->GetMother(0)>-1){ | |
1136 | fMotherMCParticle = fMCStack->Particle(fPositiveMCParticle->GetMother(0)); | |
1137 | } | |
1138 | } | |
1139 | ||
a0b94e5c | 1140 | |
1141 | // for CF | |
ebcfaa7e | 1142 | // Double_t containerInput[3]; |
1143 | // if(fDoCF){ | |
1144 | // containerInput[0] = GetMotherCandidatePt(); | |
1145 | // containerInput[1] = GetMotherCandidateEta(); | |
1146 | // containerInput[2] = GetMotherCandidateMass(); | |
1e7846f4 | 1147 | |
ebcfaa7e | 1148 | // fCFManager->GetParticleContainer()->Fill(containerInput,kStepLikeSign); // for CF |
1149 | // fCFManager->GetParticleContainer()->Fill(containerInput,kStepTPCRefit); // for CF | |
1150 | // fCFManager->GetParticleContainer()->Fill(containerInput,kStepKinks); // for CF | |
1151 | // } | |
cb90a330 | 1152 | |
1153 | ||
1154 | if(fUseOwnXYZCalculation == kFALSE){ | |
5ce758b0 | 1155 | if(fUseConstructGamma == kFALSE){ |
1156 | fCurrentV0->GetXYZ(fCurrentXValue,fCurrentYValue,fCurrentZValue); | |
1157 | }else{ | |
1158 | fCurrentXValue=GetMotherCandidateKFCombination()->GetX(); | |
1159 | fCurrentYValue=GetMotherCandidateKFCombination()->GetY(); | |
1160 | fCurrentZValue=GetMotherCandidateKFCombination()->GetZ(); | |
1161 | } | |
cb90a330 | 1162 | } |
1163 | else{ | |
1164 | Double_t convpos[2]; | |
1165 | convpos[0]=0; | |
1166 | convpos[1]=0; | |
9c1cb6f7 | 1167 | |
cb90a330 | 1168 | GetConvPosXY(GetPositiveESDTrack(),GetNegativeESDTrack(),GetMagneticField(),convpos); |
1169 | fCurrentXValue = convpos[0]; | |
1170 | fCurrentYValue = convpos[1]; | |
1171 | fCurrentZValue = GetConvPosZ(GetPositiveESDTrack(),GetNegativeESDTrack(),GetMagneticField()); | |
1172 | } | |
ebcfaa7e | 1173 | /* |
51372c5d | 1174 | if(fCurrentNegativeESDTrack->GetSign() == fCurrentPositiveESDTrack->GetSign()){ // avoid like sign |
1175 | iResult=kFALSE; | |
ebcfaa7e | 1176 | if(fHistograms != NULL && fUpdateV0AlreadyCalled == kFALSE && doFillHistos == kTRUE){ |
51372c5d | 1177 | fHistograms->FillHistogram("ESD_CutLikeSign_InvMass",GetMotherCandidateMass()); |
1178 | // to avoid filling the other cut histograms. So in this case fUpdateV0AlreadyCalled also serves as a flag for the histogram filling | |
1179 | // it will anyway be set to true at the end of the UpdateV0Information function, and there are no return until the end | |
1180 | fUpdateV0AlreadyCalled = kTRUE; | |
1181 | } | |
1182 | } | |
1183 | ||
51372c5d | 1184 | if( !(fCurrentNegativeESDTrack->GetStatus() & AliESDtrack::kTPCrefit) || |
1185 | !(fCurrentPositiveESDTrack->GetStatus() & AliESDtrack::kTPCrefit) ){ | |
1186 | // if( !(fCurrentNegativeESDTrack->GetStatus() & AliESDtrack::kITSrefit) || | |
1187 | // !(fCurrentPositiveESDTrack->GetStatus() & AliESDtrack::kITSrefit) ){ | |
1188 | iResult=kFALSE; | |
ebcfaa7e | 1189 | if(fHistograms != NULL && fUpdateV0AlreadyCalled == kFALSE && doFillHistos == kTRUE){ |
51372c5d | 1190 | fHistograms->FillHistogram("ESD_CutRefit_InvMass",GetMotherCandidateMass()); |
1191 | // to avoid filling the other cut histograms. So in this case fUpdateV0AlreadyCalled also serves as a flag for the histogram filling | |
1192 | // it will anyway be set to true at the end of the UpdateV0Information function, and there are no return until the end | |
1193 | fUpdateV0AlreadyCalled = kTRUE; | |
1194 | } | |
1195 | } | |
1196 | ||
1197 | if( fCurrentNegativeESDTrack->GetKinkIndex(0) > 0 || | |
1198 | fCurrentPositiveESDTrack->GetKinkIndex(0) > 0) { | |
1199 | ||
1200 | iResult=kFALSE; | |
ebcfaa7e | 1201 | if(fHistograms != NULL && fUpdateV0AlreadyCalled == kFALSE && doFillHistos == kTRUE ){ |
51372c5d | 1202 | fHistograms->FillHistogram("ESD_CutKink_InvMass",GetMotherCandidateMass()); |
1203 | // to avoid filling the other cut histograms. So in this case fUpdateV0AlreadyCalled also serves as a flag for the histogram filling | |
1204 | // it will anyway be set to true at the end of the UpdateV0Information function, and there are no return until the end | |
1205 | fUpdateV0AlreadyCalled = kTRUE; | |
1206 | } | |
1207 | } | |
1208 | ||
1209 | if(fDodEdxSigmaCut == kTRUE){ | |
cb90a330 | 1210 | |
51372c5d | 1211 | if( fESDpid->NumberOfSigmasTPC(fCurrentPositiveESDTrack,AliPID::kElectron)<fPIDnSigmaBelowElectronLine || |
1212 | fESDpid->NumberOfSigmasTPC(fCurrentPositiveESDTrack,AliPID::kElectron)>fPIDnSigmaAboveElectronLine || | |
1213 | fESDpid->NumberOfSigmasTPC(fCurrentNegativeESDTrack,AliPID::kElectron)<fPIDnSigmaBelowElectronLine || | |
1214 | fESDpid->NumberOfSigmasTPC(fCurrentNegativeESDTrack,AliPID::kElectron)>fPIDnSigmaAboveElectronLine ){ | |
1215 | iResult=kFALSE; | |
ebcfaa7e | 1216 | if(fHistograms != NULL && fUpdateV0AlreadyCalled == kFALSE && doFillHistos == kTRUE){ |
51372c5d | 1217 | fHistograms->FillHistogram("ESD_CutdEdxSigmaElectronLine_InvMass",GetMotherCandidateMass()); |
1218 | // to avoid filling the other cut histograms. So in this case fUpdateV0AlreadyCalled also serves as a flag for the histogram filling | |
1219 | // it will anyway be set to true at the end of the UpdateV0Information function, and there are no return until the end | |
1220 | fUpdateV0AlreadyCalled = kTRUE; | |
1221 | } | |
1222 | } | |
1223 | if( fCurrentPositiveESDTrack->P()>fPIDMinPnSigmaAbovePionLine){ | |
1224 | if(fESDpid->NumberOfSigmasTPC(fCurrentPositiveESDTrack,AliPID::kElectron)>fPIDnSigmaBelowElectronLine && | |
1225 | fESDpid->NumberOfSigmasTPC(fCurrentPositiveESDTrack,AliPID::kElectron)<fPIDnSigmaAboveElectronLine&& | |
1226 | fESDpid->NumberOfSigmasTPC(fCurrentPositiveESDTrack,AliPID::kPion)<fPIDnSigmaAbovePionLine){ | |
1227 | iResult=kFALSE; | |
ebcfaa7e | 1228 | if(fHistograms != NULL && fUpdateV0AlreadyCalled == kFALSE && doFillHistos == kTRUE){ |
51372c5d | 1229 | fHistograms->FillHistogram("ESD_CutdEdxSigmaPionLine_InvMass",GetMotherCandidateMass()); |
1230 | // to avoid filling the other cut histograms. So in this case fUpdateV0AlreadyCalled also serves as a flag for the histogram filling | |
1231 | // it will anyway be set to true at the end of the UpdateV0Information function, and there are no return until the end | |
1232 | fUpdateV0AlreadyCalled = kTRUE; | |
1233 | } | |
1234 | } | |
1235 | } | |
1236 | ||
1237 | if( fCurrentNegativeESDTrack->P()>fPIDMinPnSigmaAbovePionLine){ | |
1238 | if(fESDpid->NumberOfSigmasTPC(fCurrentNegativeESDTrack,AliPID::kElectron)>fPIDnSigmaBelowElectronLine && | |
1239 | fESDpid->NumberOfSigmasTPC(fCurrentNegativeESDTrack,AliPID::kElectron)<fPIDnSigmaAboveElectronLine&& | |
1240 | fESDpid->NumberOfSigmasTPC(fCurrentNegativeESDTrack,AliPID::kPion)<fPIDnSigmaAbovePionLine){ | |
1241 | iResult=kFALSE; | |
ebcfaa7e | 1242 | if(fHistograms != NULL && fUpdateV0AlreadyCalled == kFALSE && doFillHistos == kTRUE ){ |
51372c5d | 1243 | fHistograms->FillHistogram("ESD_CutdEdxSigmaPionLine_InvMass",GetMotherCandidateMass()); |
1244 | // to avoid filling the other cut histograms. So in this case fUpdateV0AlreadyCalled also serves as a flag for the histogram filling | |
1245 | // it will anyway be set to true at the end of the UpdateV0Information function, and there are no return until the end | |
1246 | fUpdateV0AlreadyCalled = kTRUE; | |
1247 | } | |
1248 | } | |
1249 | } | |
1250 | } | |
ebcfaa7e | 1251 | */ |
cb90a330 | 1252 | fUpdateV0AlreadyCalled = kTRUE; |
1253 | ||
a0b94e5c | 1254 | return iResult; |
1255 | } | |
1256 | ||
1257 | ||
1258 | ||
1259 | Bool_t AliV0Reader::HasSameMCMother(){ | |
1260 | //see header file for documentation | |
1261 | ||
1262 | Bool_t iResult = kFALSE; | |
1263 | if(fDoMC == kTRUE){ | |
1264 | if(fNegativeMCParticle != NULL && fPositiveMCParticle != NULL){ | |
1265 | if(fNegativeMCParticle->GetMother(0) == fPositiveMCParticle->GetMother(0)) | |
1266 | if(fMotherMCParticle){ | |
1267 | iResult = kTRUE; | |
1268 | } | |
1269 | } | |
1270 | } | |
1271 | return iResult; | |
1272 | } | |
1273 | ||
1274 | Bool_t AliV0Reader::CheckPIDProbability(Double_t negProbCut, Double_t posProbCut){ | |
1275 | //see header file for documentation | |
1276 | ||
1277 | Bool_t iResult=kFALSE; | |
1278 | ||
9c1cb6f7 | 1279 | // Double_t *posProbArray = new Double_t[10]; |
1280 | // Double_t *negProbArray = new Double_t[10]; | |
1281 | //-AM The TPCpid method expects an array of length kSPECIES that is 5 not 10 | |
1282 | ||
1283 | Double_t *posProbArray = new Double_t[AliPID::kSPECIES]; | |
1284 | Double_t *negProbArray = new Double_t[AliPID::kSPECIES]; | |
1285 | ||
1286 | AliESDtrack* negTrack = GetNegativeESDTrack(); | |
1287 | AliESDtrack* posTrack = GetPositiveESDTrack(); | |
1288 | //fESDEvent->GetTrack(fCurrentV0->GetNindex()); | |
1289 | //fESDEvent->GetTrack(fCurrentV0->GetPindex()); | |
1290 | //-AM for switchtracks==true the above is a bug | |
1291 | ||
a0b94e5c | 1292 | negTrack->GetTPCpid(negProbArray); |
1293 | posTrack->GetTPCpid(posProbArray); | |
1294 | ||
4a6157dc | 1295 | // if(negProbArray != NULL && posProbArray != NULL){ // this is not allowed anymore for some reason(RC19) |
1296 | if(negProbArray && posProbArray){ | |
a0b94e5c | 1297 | if(negProbArray[GetSpeciesIndex(-1)]>=negProbCut && posProbArray[GetSpeciesIndex(1)]>=posProbCut){ |
1298 | iResult=kTRUE; | |
1299 | } | |
1300 | } | |
1301 | delete [] posProbArray; | |
1302 | delete [] negProbArray; | |
1303 | return iResult; | |
1304 | } | |
1305 | ||
1306 | void AliV0Reader::GetPIDProbability(Double_t &negPIDProb,Double_t & posPIDProb){ | |
4a6157dc | 1307 | // see header file for documentation |
1308 | ||
9c1cb6f7 | 1309 | //Double_t *posProbArray = new Double_t[10]; |
1310 | // Double_t *negProbArray = new Double_t[10]; | |
1311 | //-AM The TPCpid method expects an array of length kSPECIES that is 5 not 10 | |
1312 | Double_t *posProbArray = new Double_t[AliPID::kSPECIES]; | |
1313 | Double_t *negProbArray = new Double_t[AliPID::kSPECIES]; | |
1314 | ||
1315 | // AliESDtrack* negTrack = fESDEvent->GetTrack(fCurrentV0->GetNindex()); | |
1316 | // AliESDtrack* posTrack = fESDEvent->GetTrack(fCurrentV0->GetPindex()); | |
1317 | //-AM for switchtracks the above is a bug | |
1318 | AliESDtrack* negTrack = GetNegativeESDTrack(); | |
1319 | AliESDtrack* posTrack = GetPositiveESDTrack(); | |
1320 | ||
1321 | ||
a0b94e5c | 1322 | negTrack->GetTPCpid(negProbArray); |
1323 | posTrack->GetTPCpid(posProbArray); | |
1324 | ||
4a6157dc | 1325 | // if(negProbArray!=NULL && posProbArray!=NULL){ // this is not allowed anymore for some reason(RC19) |
1326 | if(negProbArray && posProbArray){ | |
a0b94e5c | 1327 | negPIDProb = negProbArray[GetSpeciesIndex(-1)]; |
1328 | posPIDProb = posProbArray[GetSpeciesIndex(1)]; | |
1329 | } | |
1330 | delete [] posProbArray; | |
1331 | delete [] negProbArray; | |
1332 | } | |
9c1cb6f7 | 1333 | void AliV0Reader::GetPIDProbabilityMuonPion(Double_t &negPIDProb,Double_t & posPIDProb){ |
1334 | // see header file for documentation | |
1335 | ||
1336 | ||
1337 | Double_t *posProbArray = new Double_t[AliPID::kSPECIES]; | |
1338 | Double_t *negProbArray = new Double_t[AliPID::kSPECIES]; | |
1339 | ||
1340 | // AliESDtrack* negTrack = fESDEvent->GetTrack(fCurrentV0->GetNindex()); | |
1341 | // AliESDtrack* posTrack = fESDEvent->GetTrack(fCurrentV0->GetPindex()); | |
1342 | //-AM for switchtracks the above is a bug | |
1343 | ||
1344 | AliESDtrack* negTrack = GetNegativeESDTrack(); | |
1345 | AliESDtrack* posTrack = GetPositiveESDTrack(); | |
1346 | ||
1347 | negTrack->GetTPCpid(negProbArray); | |
1348 | posTrack->GetTPCpid(posProbArray); | |
1349 | ||
1350 | // if(negProbArray!=NULL && posProbArray!=NULL){ // this is not allowed anymore for some reason(RC19) | |
1351 | if(negProbArray && posProbArray){ | |
1352 | negPIDProb = negProbArray[1]+negProbArray[2]; | |
1353 | posPIDProb = posProbArray[1]+posProbArray[2]; | |
1354 | } | |
1355 | delete [] posProbArray; | |
1356 | delete [] negProbArray; | |
1357 | } | |
a0b94e5c | 1358 | |
1359 | void AliV0Reader::UpdateEventByEventData(){ | |
1360 | //see header file for documentation | |
5e55d806 | 1361 | if(fCurrentEventGoodV0s->GetEntriesFast() >0 ){ |
87f6de3e | 1362 | if(fCalculateBackground){ |
5ce758b0 | 1363 | if(fUseChargedTrackMultiplicityForBG == kTRUE){ |
1364 | fBGEventHandler->AddEvent(fCurrentEventGoodV0s,fESDEvent->GetPrimaryVertex()->GetX(),fESDEvent->GetPrimaryVertex()->GetY(),fESDEvent->GetPrimaryVertex()->GetZ(),CountESDTracks()); | |
1365 | //filling z and multiplicity histograms | |
1366 | fHistograms->FillHistogram("ESD_Z_distribution",fESDEvent->GetPrimaryVertex()->GetZ()); | |
1367 | fHistograms->FillHistogram("ESD_multiplicity_distribution",CountESDTracks()); | |
1368 | fHistograms->FillHistogram("ESD_ZvsMultiplicity",fESDEvent->GetPrimaryVertex()->GetZ(),CountESDTracks()); | |
1369 | } | |
1370 | else{ // means we use #V0s for multiplicity | |
1371 | fBGEventHandler->AddEvent(fCurrentEventGoodV0s,fESDEvent->GetPrimaryVertex()->GetX(),fESDEvent->GetPrimaryVertex()->GetY(),fESDEvent->GetPrimaryVertex()->GetZ(),fNumberOfGoodV0s); | |
1372 | //filling z and multiplicity histograms | |
1373 | fHistograms->FillHistogram("ESD_Z_distribution",fESDEvent->GetPrimaryVertex()->GetZ()); | |
1374 | fHistograms->FillHistogram("ESD_multiplicity_distribution",fNumberOfGoodV0s); | |
1375 | fHistograms->FillHistogram("ESD_ZvsMultiplicity",fESDEvent->GetPrimaryVertex()->GetZ(),fNumberOfGoodV0s); | |
1376 | } | |
87f6de3e | 1377 | } |
a0b94e5c | 1378 | } |
5e55d806 | 1379 | fCurrentEventGoodV0s->Delete(); |
a0b94e5c | 1380 | fCurrentV0IndexNumber=0; |
037dc2db | 1381 | fNumberOfESDTracks=0; |
7f3c7cc6 | 1382 | |
1383 | fV0Pindex.clear(); | |
1384 | fV0Nindex.clear(); | |
1385 | ||
1386 | ||
1387 | ||
26923b22 | 1388 | // fBGEventHandler->PrintBGArray(); // for debugging |
a0b94e5c | 1389 | } |
1390 | ||
1391 | ||
1392 | Double_t AliV0Reader::GetNegativeTrackPhi() const{ | |
1393 | //see header file for documentation | |
1394 | ||
1395 | Double_t offset=0; | |
1396 | if(fNegativeTrackLorentzVector->Phi()> TMath::Pi()){ | |
1397 | offset = -2*TMath::Pi(); | |
1398 | } | |
1399 | return fNegativeTrackLorentzVector->Phi()+offset; | |
1400 | } | |
1401 | ||
1402 | Double_t AliV0Reader::GetPositiveTrackPhi() const{ | |
1403 | //see header file for documentation | |
1404 | ||
1405 | Double_t offset=0; | |
1406 | if(fPositiveTrackLorentzVector->Phi()> TMath::Pi()){ | |
1407 | offset = -2*TMath::Pi(); | |
1408 | } | |
1409 | return fPositiveTrackLorentzVector->Phi()+offset; | |
1410 | } | |
1411 | ||
1412 | Double_t AliV0Reader::GetMotherCandidatePhi() const{ | |
1413 | //see header file for documentation | |
1414 | ||
1415 | Double_t offset=0; | |
1416 | if(fMotherCandidateLorentzVector->Phi()> TMath::Pi()){ | |
1417 | offset = -2*TMath::Pi(); | |
1418 | } | |
1419 | return fMotherCandidateLorentzVector->Phi()+offset; | |
1420 | } | |
1421 | ||
1422 | ||
1423 | Double_t AliV0Reader::GetMotherCandidateRapidity() const{ | |
1424 | //see header file for documentation | |
1425 | ||
1426 | Double_t rapidity=0; | |
1427 | if(fMotherCandidateLorentzVector->Energy() - fMotherCandidateLorentzVector->Pz() == 0 || fMotherCandidateLorentzVector->Energy() + fMotherCandidateLorentzVector->Pz() == 0) rapidity=0; | |
1428 | else rapidity = 0.5*(TMath::Log((fMotherCandidateLorentzVector->Energy() + fMotherCandidateLorentzVector->Pz()) / (fMotherCandidateLorentzVector->Energy()-fMotherCandidateLorentzVector->Pz()))); | |
1429 | return rapidity; | |
1430 | ||
1431 | } | |
1432 | ||
1433 | ||
1434 | ||
1435 | ||
1436 | ||
1437 | Int_t AliV0Reader::GetSpeciesIndex(Int_t chargeOfTrack){ | |
1438 | //see header file for documentation | |
1439 | ||
1440 | Int_t iResult = 10; // Unknown particle | |
1441 | ||
1442 | if(chargeOfTrack==-1){ //negative track | |
1443 | switch(abs(fNegativeTrackPID)){ | |
1444 | case 11: //electron | |
1445 | iResult = 0; | |
1446 | break; | |
1447 | case 13: //muon | |
1448 | iResult = 1; | |
1449 | break; | |
1450 | case 211: //pion | |
1451 | iResult = 2; | |
1452 | break; | |
1453 | case 321: //kaon | |
1454 | iResult = 3; | |
1455 | break; | |
1456 | case 2212: //proton | |
1457 | iResult = 4; | |
1458 | break; | |
1459 | case 22: //photon | |
1460 | iResult = 5; | |
1461 | break; | |
1462 | case 111: //pi0 | |
1463 | iResult = 6; | |
1464 | break; | |
1465 | case 2112: //neutron | |
1466 | iResult = 7; | |
1467 | break; | |
1468 | case 311: //K0 | |
1469 | iResult = 8; | |
1470 | break; | |
1471 | ||
1472 | //Put in here for kSPECIES::kEleCon ???? | |
1473 | } | |
1474 | } | |
1475 | else if(chargeOfTrack==1){ //positive track | |
1476 | switch(abs(fPositiveTrackPID)){ | |
1477 | case 11: //electron | |
1478 | iResult = 0; | |
1479 | break; | |
1480 | case 13: //muon | |
1481 | iResult = 1; | |
1482 | break; | |
1483 | case 211: //pion | |
1484 | iResult = 2; | |
1485 | break; | |
1486 | case 321: //kaon | |
1487 | iResult = 3; | |
1488 | break; | |
1489 | case 2212: //proton | |
1490 | iResult = 4; | |
1491 | break; | |
1492 | case 22: //photon | |
1493 | iResult = 5; | |
1494 | break; | |
1495 | case 111: //pi0 | |
1496 | iResult = 6; | |
1497 | break; | |
1498 | case 2112: //neutron | |
1499 | iResult = 7; | |
1500 | break; | |
1501 | case 311: //K0 | |
1502 | iResult = 8; | |
1503 | break; | |
1504 | ||
1505 | //Put in here for kSPECIES::kEleCon ???? | |
1506 | } | |
1507 | } | |
1508 | else{ | |
1509 | //Wrong parameter.. Print warning | |
1510 | } | |
1511 | return iResult; | |
1512 | } | |
1513 | ||
4a6157dc | 1514 | Bool_t AliV0Reader::GetHelixCenter(AliESDtrack* track, Double_t b,Int_t charge, Double_t center[2]){ |
a0b94e5c | 1515 | // see header file for documentation |
1516 | ||
1517 | Double_t pi = 3.14159265358979323846; | |
1518 | ||
1519 | Double_t helix[6]; | |
1520 | track->GetHelixParameters(helix,b); | |
1521 | ||
1522 | Double_t xpos = helix[5]; | |
1523 | Double_t ypos = helix[0]; | |
1524 | Double_t radius = TMath::Abs(1./helix[4]); | |
1525 | Double_t phi = helix[2]; | |
1526 | ||
1527 | if(phi < 0){ | |
1528 | phi = phi + 2*pi; | |
1529 | } | |
1530 | ||
1531 | phi -= pi/2.; | |
1532 | Double_t xpoint = radius * TMath::Cos(phi); | |
1533 | Double_t ypoint = radius * TMath::Sin(phi); | |
1534 | ||
6272370b | 1535 | if(b<0){ |
1536 | if(charge > 0){ | |
1537 | xpoint = - xpoint; | |
1538 | ypoint = - ypoint; | |
1539 | } | |
1540 | ||
1541 | if(charge < 0){ | |
1542 | xpoint = xpoint; | |
1543 | ypoint = ypoint; | |
1544 | } | |
a0b94e5c | 1545 | } |
6272370b | 1546 | if(b>0){ |
1547 | if(charge > 0){ | |
1548 | xpoint = xpoint; | |
1549 | ypoint = ypoint; | |
1550 | } | |
a0b94e5c | 1551 | |
6272370b | 1552 | if(charge < 0){ |
1553 | xpoint = - xpoint; | |
1554 | ypoint = - ypoint; | |
1555 | } | |
a0b94e5c | 1556 | } |
1557 | center[0] = xpos + xpoint; | |
1558 | center[1] = ypos + ypoint; | |
1559 | ||
1560 | return 1; | |
1561 | } | |
1562 | ||
4a6157dc | 1563 | Bool_t AliV0Reader::GetConvPosXY(AliESDtrack* ptrack, AliESDtrack* ntrack, Double_t b, Double_t convpos[2]){ |
a0b94e5c | 1564 | //see header file for documentation |
1565 | ||
1566 | Double_t helixcenterpos[2]; | |
1567 | GetHelixCenter(ptrack,b,ptrack->Charge(),helixcenterpos); | |
1568 | ||
1569 | Double_t helixcenterneg[2]; | |
1570 | GetHelixCenter(ntrack,b,ntrack->Charge(),helixcenterneg); | |
1571 | ||
1572 | Double_t poshelix[6]; | |
1573 | ptrack->GetHelixParameters(poshelix,b); | |
1574 | Double_t posradius = TMath::Abs(1./poshelix[4]); | |
1575 | ||
1576 | Double_t neghelix[6]; | |
1577 | ntrack->GetHelixParameters(neghelix,b); | |
1578 | Double_t negradius = TMath::Abs(1./neghelix[4]); | |
1579 | ||
1580 | Double_t xpos = helixcenterpos[0]; | |
1581 | Double_t ypos = helixcenterpos[1]; | |
1582 | Double_t xneg = helixcenterneg[0]; | |
1583 | Double_t yneg = helixcenterneg[1]; | |
1584 | ||
1585 | convpos[0] = (xpos*negradius + xneg*posradius)/(negradius+posradius); | |
1586 | convpos[1] = (ypos*negradius+ yneg*posradius)/(negradius+posradius); | |
1587 | ||
1588 | return 1; | |
1589 | } | |
1590 | ||
1591 | ||
1592 | ||
4a6157dc | 1593 | Double_t AliV0Reader::GetConvPosZ(AliESDtrack* ptrack,AliESDtrack* ntrack, Double_t b){ |
a0b94e5c | 1594 | //see header file for documentation |
1595 | ||
1596 | Double_t helixpos[6]; | |
1597 | ptrack->GetHelixParameters(helixpos,b); | |
1598 | ||
1599 | Double_t helixneg[6]; | |
1600 | ntrack->GetHelixParameters(helixneg,b); | |
1601 | ||
1602 | Double_t negtrackradius = TMath::Abs(1./helixneg[4]); | |
1603 | Double_t postrackradius = TMath::Abs(1./helixpos[4]); | |
1604 | ||
1605 | Double_t pi = 3.14159265358979323846; | |
1606 | ||
1607 | Double_t convpos[2]; | |
1608 | GetConvPosXY(ptrack,ntrack,b,convpos); | |
1609 | ||
1610 | Double_t convposx = convpos[0]; | |
1611 | Double_t convposy = convpos[1]; | |
1612 | ||
1613 | Double_t helixcenterpos[2]; | |
1614 | GetHelixCenter(ptrack,b,ptrack->Charge(),helixcenterpos); | |
1615 | ||
1616 | Double_t helixcenterneg[2]; | |
1617 | GetHelixCenter(ntrack,b,ntrack->Charge(),helixcenterneg); | |
1618 | ||
1619 | Double_t xpos = helixcenterpos[0]; | |
1620 | Double_t ypos = helixcenterpos[1]; | |
1621 | Double_t xneg = helixcenterneg[0]; | |
1622 | Double_t yneg = helixcenterneg[1]; | |
1623 | ||
4a6157dc | 1624 | Double_t deltaXPos = convposx - xpos; |
1625 | Double_t deltaYPos = convposy - ypos; | |
a0b94e5c | 1626 | |
4a6157dc | 1627 | Double_t deltaXNeg = convposx - xneg; |
1628 | Double_t deltaYNeg = convposy - yneg; | |
a0b94e5c | 1629 | |
4a6157dc | 1630 | Double_t alphaPos = pi + TMath::ATan2(-deltaYPos,-deltaXPos); |
1631 | Double_t alphaNeg = pi + TMath::ATan2(-deltaYNeg,-deltaXNeg); | |
a0b94e5c | 1632 | |
4a6157dc | 1633 | Double_t vertexXNeg = xneg + TMath::Abs(negtrackradius)* |
1634 | TMath::Cos(alphaNeg); | |
1635 | Double_t vertexYNeg = yneg + TMath::Abs(negtrackradius)* | |
1636 | TMath::Sin(alphaNeg); | |
a0b94e5c | 1637 | |
4a6157dc | 1638 | Double_t vertexXPos = xpos + TMath::Abs(postrackradius)* |
1639 | TMath::Cos(alphaPos); | |
1640 | Double_t vertexYPos = ypos + TMath::Abs(postrackradius)* | |
1641 | TMath::Sin(alphaPos); | |
a0b94e5c | 1642 | |
1643 | Double_t x0neg = helixneg[5]; | |
1644 | Double_t y0neg = helixneg[0]; | |
1645 | ||
1646 | Double_t x0pos = helixpos[5]; | |
1647 | Double_t y0pos = helixpos[0]; | |
1648 | ||
4a6157dc | 1649 | Double_t dNeg = TMath::Sqrt((vertexXNeg - x0neg)*(vertexXNeg - x0neg) |
1650 | +(vertexYNeg - y0neg)*(vertexYNeg - y0neg)); | |
a0b94e5c | 1651 | |
4a6157dc | 1652 | Double_t dPos = TMath::Sqrt((vertexXPos - x0pos)*(vertexXPos - x0pos) |
1653 | +(vertexYPos - y0pos)*(vertexYPos - y0pos)); | |
a0b94e5c | 1654 | |
4a6157dc | 1655 | Double_t rNeg = TMath::Sqrt(negtrackradius*negtrackradius - |
1656 | dNeg*dNeg/4.); | |
a0b94e5c | 1657 | |
4a6157dc | 1658 | Double_t rPos = TMath::Sqrt(postrackradius*postrackradius - |
1659 | dPos*dPos/4.); | |
a0b94e5c | 1660 | |
4a6157dc | 1661 | Double_t deltabetaNeg = 2*(pi + TMath::ATan2(-dNeg/2.,-rNeg)); |
1662 | Double_t deltabetaPos = 2*(pi + TMath::ATan2(-dPos/2.,-rPos)); | |
a0b94e5c | 1663 | |
4a6157dc | 1664 | Double_t deltaUNeg = negtrackradius*deltabetaNeg; |
1665 | Double_t deltaUPos = postrackradius*deltabetaPos; | |
a0b94e5c | 1666 | |
4a6157dc | 1667 | Double_t zphaseNeg = ntrack->GetZ() + deltaUNeg * ntrack->GetTgl(); |
1668 | Double_t zphasePos = ptrack->GetZ() + deltaUPos * ptrack->GetTgl(); | |
a0b94e5c | 1669 | |
87f6de3e | 1670 | Double_t convposz = (zphasePos*negtrackradius+zphaseNeg*postrackradius)/(negtrackradius+postrackradius); |
a0b94e5c | 1671 | |
1672 | return convposz; | |
1673 | } | |
5e55d806 | 1674 | |
f14266e7 | 1675 | AliGammaConversionKFVector* AliV0Reader::GetBGGoodV0s(Int_t /*event*/) const{ |
5ce758b0 | 1676 | /* |
1677 | if(fUseChargedTrackMultiplicityForBG == kTRUE){ | |
1678 | return fBGEventHandler->GetBGGoodV0s(event,fESDEvent->GetPrimaryVertex()->GetZ(),CountESDTracks()); | |
1679 | } | |
1680 | else{ // means we use #v0s as multiplicity | |
1681 | return fBGEventHandler->GetBGGoodV0s(event,fESDEvent->GetPrimaryVertex()->GetZ(),fNumberOfGoodV0s); | |
1682 | } | |
1683 | */ | |
1684 | return NULL; | |
037dc2db | 1685 | } |
1686 | ||
1687 | Int_t AliV0Reader::CountESDTracks(){ | |
1688 | // see header file for documentation | |
1689 | if(fNumberOfESDTracks == 0){ // count the good esd tracks | |
1690 | for(Int_t iTracks = 0; iTracks < fESDEvent->GetNumberOfTracks(); iTracks++){ | |
1691 | AliESDtrack* curTrack = fESDEvent->GetTrack(iTracks); | |
1692 | if(!curTrack){ | |
1693 | continue; | |
1694 | } | |
1695 | if(fEsdTrackCuts->AcceptTrack(curTrack) ){ | |
1696 | fNumberOfESDTracks++; | |
1697 | } | |
1698 | } | |
1699 | } | |
1700 | ||
1701 | return fNumberOfESDTracks; | |
1702 | } | |
1703 | ||
1704 | Bool_t AliV0Reader::CheckIfPi0IsMother(Int_t label){ | |
1705 | // see headerfile for documentation | |
1706 | Bool_t iResult=kFALSE; | |
1707 | // cout<<"Checking particle label, particle is: "<<fMCStack->Particle(TMath::Abs(label))->GetName()<<endl; | |
1708 | if(fMCStack->Particle(TMath::Abs(label))->GetPdgCode() == 111){ | |
1709 | iResult=kTRUE; | |
1710 | } | |
1711 | return iResult; | |
5e55d806 | 1712 | } |
48682642 | 1713 | |
10e3319b | 1714 | Bool_t AliV0Reader::CheckIfEtaIsMother(Int_t label){ |
1715 | // see headerfile for documentation | |
1716 | Bool_t iResult=kFALSE; | |
1717 | // cout<<"Checking particle label, particle is: "<<fMCStack->Particle(TMath::Abs(label))->GetName()<<endl; | |
1718 | if(fMCStack->Particle(TMath::Abs(label))->GetPdgCode() == 221){ | |
1719 | iResult=kTRUE; | |
1720 | } | |
1721 | return iResult; | |
1722 | } | |
1723 | ||
48682642 | 1724 | |
f14266e7 | 1725 | Bool_t AliV0Reader::GetArmenterosQtAlfa(const AliKFParticle* positiveKFParticle, const AliKFParticle * negativeKFParticle, const AliKFParticle * gammaKFCandidate, Double_t armenterosQtAlfa[2] ){ |
48682642 | 1726 | //see header file for documentation |
1727 | ||
1728 | TVector3 momentumVectorPositiveKF(positiveKFParticle->GetPx(),positiveKFParticle->GetPy(),positiveKFParticle->GetPz()); | |
1729 | TVector3 momentumVectorNegativeKF(negativeKFParticle->GetPx(),negativeKFParticle->GetPy(),negativeKFParticle->GetPz()); | |
1730 | TVector3 vecV0(gammaKFCandidate->GetPx(),gammaKFCandidate->GetPy(),gammaKFCandidate->GetPz()); | |
1731 | ||
1732 | Float_t thetaV0pos=TMath::ACos(( momentumVectorPositiveKF* vecV0)/(momentumVectorPositiveKF.Mag() * vecV0.Mag())); | |
1733 | Float_t thetaV0neg=TMath::ACos(( momentumVectorNegativeKF* vecV0)/(momentumVectorNegativeKF.Mag() * vecV0.Mag())); | |
1734 | ||
1735 | Float_t alfa =((momentumVectorPositiveKF.Mag())*TMath::Cos(thetaV0pos)-(momentumVectorNegativeKF.Mag())*TMath::Cos(thetaV0neg))/ | |
1736 | ((momentumVectorPositiveKF.Mag())*TMath::Cos(thetaV0pos)+(momentumVectorNegativeKF.Mag())*TMath::Cos(thetaV0neg)) ; | |
1737 | ||
1738 | ||
1739 | Float_t qt = momentumVectorPositiveKF.Mag()*TMath::Sin(thetaV0pos); | |
1740 | ||
1741 | armenterosQtAlfa[0]=qt; | |
1742 | armenterosQtAlfa[1]=alfa; | |
1743 | ||
1744 | return 1; | |
1745 | ||
1746 | } | |
1747 | ||
40051a3e | 1748 | Int_t AliV0Reader::GetFirstTPCRow(Double_t radius){ |
1749 | ||
1750 | ||
1751 | Int_t firstTPCRow=0; | |
1752 | Double_t radiusI = 84.8; | |
1753 | Double_t radiusO = 134.6; | |
1754 | Double_t radiusOB = 198.; | |
1755 | Double_t rSizeI = 0.75; | |
1756 | Double_t rSizeO = 1.; | |
1757 | Double_t rSizeOB = 1.5; | |
1758 | Int_t nClsI=63; | |
1759 | Int_t nClsIO=127; | |
1760 | ||
1761 | if(radius <= radiusI){ | |
1762 | return firstTPCRow; | |
1763 | } | |
1764 | if(radius>radiusI && radius<=radiusO){ | |
1765 | firstTPCRow = (Int_t)((radius-radiusI)/rSizeI); | |
1766 | } | |
1767 | if(radius>radiusO && radius<=radiusOB){ | |
1768 | firstTPCRow = (Int_t)(nClsI+(radius-radiusO)/rSizeO); | |
1769 | } | |
48682642 | 1770 | |
40051a3e | 1771 | if(radius>radiusOB){ |
1772 | firstTPCRow =(Int_t)(nClsIO+(radius-radiusOB)/rSizeOB); | |
1773 | } | |
1774 | ||
1775 | ||
1776 | return firstTPCRow; | |
1777 | } |