]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWG1/TRD/info/AliTRDv0Info.cxx
fix coverity
[u/mrichter/AliRoot.git] / PWG1 / TRD / info / AliTRDv0Info.cxx
CommitLineData
1ee39b3a 1/**************************************************************************
2* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3* *
4* Author: The ALICE Off-line Project. *
5* Contributors are mentioned in the code where appropriate. *
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/* $Id: AliTRDv0Info.cxx 27496 2008-07-22 08:35:45Z cblume $ */
17
18////////////////////////////////////////////////////////////////////////////
19// //
20// Reconstruction QA //
21// //
22// Gathers all information necessary for reference data selection about //
23// the track and (in case) its corresponding V0. //
24// Carries out the selection of electrons (from gamma conversions), //
25// pions (from K0s decays) and protons (from Lambda and Anti-Lambda //
26// decays) by cuts specific for the respective decay and particle //
27// species. //
28// (M.Heide, 2009/10/06) //
29// //
30// Authors: //
31// Alex Bercuci <A.Bercuci@gsi.de> //
32// Alex Wilk <wilka@uni-muenster.de> //
33// Markus Heide <mheide@uni-muenster.de> //
34// //
35////////////////////////////////////////////////////////////////////////////
0ed6f095 36
1ee39b3a 37#include "TMath.h"
0ed6f095 38#include "TDatabasePDG.h"
1ee39b3a 39
40#include "AliESDtrack.h"
41#include "AliESDv0.h"
1ee39b3a 42#include "AliLog.h"
0ed6f095 43#include "TVector3.h"
44#include "AliKFParticle.h"
45#include "AliKFVertex.h"
1ee39b3a 46
47#include "AliTRDv0Info.h"
48#include "AliTRDtrackInfo.h"
49#include "AliTRDtrackInfo.h"
50
51ClassImp(AliTRDv0Info)
52
53//_________________________________________________
54AliTRDv0Info::AliTRDv0Info()
55 : TObject()
3d19c1b0 56 ,fQuality(0)
1ee39b3a 57 ,fDCA(10)
58 ,fPointingAngle(10)
59 ,fOpenAngle(10)
60 ,fPsiPair(99)
61 ,fMagField(0)
62 ,fRadius(0)
1ee39b3a 63 ,fV0Momentum(0)
1ee39b3a 64 ,fNindex(0)
65 ,fPindex(0)
0ed6f095 66 ,fInputEvent(NULL)
67 ,fPrimaryVertex(NULL)
64d57299 68 ,fTrackP(NULL)
69 ,fTrackN(NULL)
1ee39b3a 70{
71 //
72 // Default constructor
73 //
74
1ee39b3a 75 memset(fDetPID, 0, 2*kNDaughters*kNDetectors*AliPID::kSPECIES*sizeof(Float_t));
8bc8ea55 76 memset(fComPID, 0, 2*kNDaughters*AliPID::kSPECIES*sizeof(Float_t));
61cfa442 77 memset(fInvMass, 0, kNDecays*sizeof(Double_t));
0ed6f095 78 memset(fArmenteros, 0, kNDecays*sizeof(Bool_t));
61cfa442 79 memset(fTPCdEdx, 0, kNDaughters*sizeof(Float_t));
0ed6f095 80 memset(fChi2ndf, 0, kNDecays*sizeof(Double_t));
7fe4e88b 81 memset(fDownOpenAngle, 0, kNDecays*sizeof(Float_t));
82 memset(fDownPsiPair, 0, kNDecays*sizeof(Float_t));
1ee39b3a 83 /////////////////////////////////////////////////////////////////////////////
84 //Set Cut values: First specify decay in brackets, then the actual cut value!
85 /////////////////////////////////////////////////////////////////////////////
86
87 //Upper limit for distance of closest approach of two daughter tracks :
8bc8ea55 88 fUpDCA[kGamma] = 1000.;
89 fUpDCA[kK0s] = 0.08;
90 fUpDCA[kLambda] = 0.2;
91 fUpDCA[kAntiLambda] = 0.2;
1ee39b3a 92
93 //Upper limit for pointing angle (= angle between between vector from primary to secondary vertex and reconstructed momentum of V0 mother particle) :
94 fUpPointingAngle[kGamma] = 0.03;
95 fUpPointingAngle[kK0s] = 0.03;
8bc8ea55 96 fUpPointingAngle[kLambda] = 0.04;
97 fUpPointingAngle[kAntiLambda] = 0.04;
1ee39b3a 98
99 //Upper limit for invariant mass of V0 mother :
8bc8ea55 100 fUpInvMass[kGamma][0] = 0.05;// second pair of brackets is for momentum bin: 0: below mother momentm of 2.5 GeV
1ee39b3a 101 fUpInvMass[kGamma][1] = 0.07;//1: above 2.5 GeV
8bc8ea55 102 fUpInvMass[kK0s][0] = fUpInvMass[kK0s][1] = 0.50265;
103 fUpInvMass[kLambda][0] = fUpInvMass[kLambda][1] = 1.1207;
104 fUpInvMass[kAntiLambda][0] = fUpInvMass[kAntiLambda][1] = 1.1207;
1ee39b3a 105
106 //Lower limit for invariant mass of V0 mother :
107 fDownInvMass[kGamma] = -1.;
8bc8ea55 108 fDownInvMass[kK0s] = 0.49265;
109 fDownInvMass[kLambda] = 1.107;
110 fDownInvMass[kAntiLambda] = 1.107;
1ee39b3a 111
0ed6f095 112 //Upper limit for KF Chi2/NDF value;
113 fUpChi2ndf[kGamma] = 10000.;//7.;
114 fUpChi2ndf[kK0s] = 10000.;//5.;
115 fUpChi2ndf[kLambda] = 10000.;//5.;
116 fUpChi2ndf[kAntiLambda] = 10000.;//5.;
117
1ee39b3a 118 //Lower limit for distance from secondary vertex to primary vertex in x-y plane :
8bc8ea55 119 fDownRadius[kGamma] = 6.;
1ee39b3a 120 fDownRadius[kK0s] = 0.;
8bc8ea55 121 fDownRadius[kLambda] = 0.;
122 fDownRadius[kAntiLambda] = 0.;
1ee39b3a 123
124 //Upper limit for distance from secondary vertex to primary vertex in x-y plane :
125 fUpRadius[kGamma] = 1000.;
8bc8ea55 126 fUpRadius[kK0s] = 20.;
1ee39b3a 127 fUpRadius[kLambda] = 1000.;
128 fUpRadius[kAntiLambda] = 1000.;
129
130 //Upper limit for opening angle between two daughter tracks (characteristically near zero for conversions) :
131 fUpOpenAngle[kGamma] = 0.1;
132 fUpOpenAngle[kK0s] = 3.15;
133 fUpOpenAngle[kLambda] = 3.15;
134 fUpOpenAngle[kAntiLambda] = 3.15;
135
136 //Upper limit for angle between daughter momentum plane and plane perpendicular to magnetic field (characteristically around zero for conversions) :
8bc8ea55 137 fUpPsiPair[kGamma] = 0.05;
1ee39b3a 138 fUpPsiPair[kK0s] = 1.6;
139 fUpPsiPair[kLambda] = 1.6;
140 fUpPsiPair[kAntiLambda] = 1.6;
141
142 //Lower limit for likelihood value of TPC PID :
0ed6f095 143 fDownTPCPIDneg[AliPID::kElectron] = 0.;
144 fDownTPCPIDpos[AliPID::kElectron] = 0.;
145
146 fDownTPCPIDneg[AliPID::kMuon] = 0.;
147 fDownTPCPIDpos[AliPID::kMuon] = 0.;
148
149 fDownTPCPIDneg[AliPID::kPion] = 0.;
150 fDownTPCPIDpos[AliPID::kPion] = 0.;
151
152 fDownTPCPIDneg[AliPID::kKaon] = 0.;
153 fDownTPCPIDpos[AliPID::kKaon] = 0.;
154
155 fDownTPCPIDneg[AliPID::kProton] = 0.;
156 fDownTPCPIDpos[AliPID::kProton] = 0.;
157
158 //Lower limit for likelihood value of combined PID :
159 fDownComPIDneg[AliPID::kElectron] = 0.;
160 fDownComPIDpos[AliPID::kElectron] = 0.;
161
162 fDownComPIDneg[AliPID::kMuon] = 0.;
163 fDownComPIDpos[AliPID::kMuon] = 0.;
164
165 fDownComPIDneg[AliPID::kPion] = 0.;
166 fDownComPIDpos[AliPID::kPion] = 0.;
167
168 fDownComPIDneg[AliPID::kKaon] = 0.;
169 fDownComPIDpos[AliPID::kKaon] = 0.;
170
171 fDownComPIDneg[AliPID::kProton] = 0.;
172 fDownComPIDpos[AliPID::kProton] = 0.;
173
174 //Lower limit for likelihood value of combined PID for daughter track which doesn't enter reference data (here: pion daughters from Lambda decays:
175 fDownComPIDnegPart[AliPID::kElectron] = 0.;
176 fDownComPIDposPart[AliPID::kElectron] = 0.;
177
178 fDownComPIDnegPart[AliPID::kMuon] = 0.;
179 fDownComPIDposPart[AliPID::kMuon] = 0.;
180
181 fDownComPIDnegPart[AliPID::kPion] = 0.;
182 fDownComPIDposPart[AliPID::kPion] = 0.;
183
184 fDownComPIDnegPart[AliPID::kKaon] = 0.;
185 fDownComPIDposPart[AliPID::kKaon] = 0.;
186
187 fDownComPIDnegPart[AliPID::kProton] = 0.;
188 fDownComPIDposPart[AliPID::kProton] = 0.;
189
190 //Parameters for data with well-calibrated PID (after usage of tender):
191 /* //Lower limit for likelihood value of TPC PID :
1ee39b3a 192 fDownTPCPIDneg[AliPID::kElectron] = 0.21;
193 fDownTPCPIDpos[AliPID::kElectron] = 0.21;
194
195 fDownTPCPIDneg[AliPID::kMuon] = 0.21;
196 fDownTPCPIDpos[AliPID::kMuon] = 0.21;
197
198 fDownTPCPIDneg[AliPID::kPion] = 0.21;
199 fDownTPCPIDpos[AliPID::kPion] = 0.21;
200
201 fDownTPCPIDneg[AliPID::kKaon] = 0.21;
202 fDownTPCPIDpos[AliPID::kKaon] = 0.21;
203
204 fDownTPCPIDneg[AliPID::kProton] = 0.21;
205 fDownTPCPIDpos[AliPID::kProton] = 0.21;
8bc8ea55 206
0ed6f095 207 //Lower limit for likelihood value of combined PID :
8bc8ea55 208 fDownComPIDneg[AliPID::kElectron] = 0.21;
209 fDownComPIDpos[AliPID::kElectron] = 0.21;
210
211 fDownComPIDneg[AliPID::kMuon] = 0.21;
212 fDownComPIDpos[AliPID::kMuon] = 0.21;
213
214 fDownComPIDneg[AliPID::kPion] = 0.9;
215 fDownComPIDpos[AliPID::kPion] = 0.9;
216
217 fDownComPIDneg[AliPID::kKaon] = 0.21;
218 fDownComPIDpos[AliPID::kKaon] = 0.21;
219
220 fDownComPIDneg[AliPID::kProton] = 0.9;
221 fDownComPIDpos[AliPID::kProton] = 0.9;
222
223 //Lower limit for likelihood value of combined PID for daughter track which doesn't enter reference data (here: pion daughters from Lambda decays:
224 fDownComPIDnegPart[AliPID::kElectron] = 0.05;
225 fDownComPIDposPart[AliPID::kElectron] = 0.05;
226
227 fDownComPIDnegPart[AliPID::kMuon] = 0.05;
228 fDownComPIDposPart[AliPID::kMuon] = 0.05;
229
230 fDownComPIDnegPart[AliPID::kPion] = 0.05;
231 fDownComPIDposPart[AliPID::kPion] = 0.05;
232
233 fDownComPIDnegPart[AliPID::kKaon] = 0.05;
234 fDownComPIDposPart[AliPID::kKaon] = 0.05;
235
236 fDownComPIDnegPart[AliPID::kProton] = 0.05;
0ed6f095 237 fDownComPIDposPart[AliPID::kProton] = 0.05;*/
3d19c1b0 238}
239
240//_________________________________________________
241AliTRDv0Info::AliTRDv0Info(const AliTRDv0Info &ref)
242 : TObject()
243 ,fQuality(ref.fQuality)
244 ,fDCA(ref.fDCA)
245 ,fPointingAngle(ref.fPointingAngle)
246 ,fOpenAngle(ref.fOpenAngle)
247 ,fPsiPair(ref.fPsiPair)
248 ,fMagField(ref.fMagField)
0ed6f095 249 ,fRadius(ref.fRadius)
3d19c1b0 250 ,fV0Momentum(ref.fV0Momentum)
3d19c1b0 251 ,fNindex(ref.fNindex)
252 ,fPindex(ref.fPindex)
0ed6f095 253 ,fInputEvent(ref.fInputEvent)
254 ,fPrimaryVertex(ref.fPrimaryVertex)
64d57299 255 ,fTrackP(ref.fTrackP)
256 ,fTrackN(ref.fTrackN)
3d19c1b0 257{
258 //
259 // Copy constructor
260 //
64d57299 261
3d19c1b0 262 memcpy(fDetPID, ref.fDetPID, 2*kNDaughters*kNDetectors*AliPID::kSPECIES*sizeof(Float_t));
263 memcpy(fComPID, ref.fComPID, 2*kNDaughters*AliPID::kSPECIES*sizeof(Float_t));
61cfa442 264 memcpy(fInvMass, ref.fInvMass, kNDecays*sizeof(Double_t));
0ed6f095 265 memcpy(fArmenteros, ref.fArmenteros, kNDecays*sizeof(Bool_t));
266 memcpy(fChi2ndf, ref.fChi2ndf, kNDecays*sizeof(Double_t));
267 memcpy(fTPCdEdx, ref.fTPCdEdx, kNDaughters*sizeof(Float_t));
1ee39b3a 268
3d19c1b0 269 //Upper limit for distance of closest approach of two daughter tracks :
270 memcpy(fUpDCA, ref.fUpDCA, kNDecays*sizeof(Float_t));
271 memcpy(fUpPointingAngle, ref.fUpPointingAngle, kNDecays*sizeof(Float_t));
272 memcpy(fUpOpenAngle, ref.fUpOpenAngle, kNDecays*sizeof(Float_t));
273 memcpy(fDownOpenAngle, ref.fDownOpenAngle, kNDecays*sizeof(Float_t));
274 memcpy(fUpPsiPair, ref.fUpPsiPair, kNDecays*sizeof(Float_t));
275 memcpy(fDownPsiPair, ref.fDownPsiPair, kNDecays*sizeof(Float_t));
276 memcpy(fUpInvMass, ref.fUpInvMass, kNDecays*kNMomBins*sizeof(Double_t));
277 memcpy(fDownInvMass, ref.fDownInvMass, kNDecays*sizeof(Double_t));
0ed6f095 278 memcpy(fUpChi2ndf, ref.fUpChi2ndf, kNDecays*sizeof(Double_t));
3d19c1b0 279 memcpy(fUpRadius, ref.fUpRadius, kNDecays*sizeof(Float_t));
280 memcpy(fDownRadius, ref.fDownRadius, kNDecays*sizeof(Float_t));
281 memcpy(fDownTPCPIDneg, ref.fDownTPCPIDneg, AliPID::kSPECIES*sizeof(Float_t));
282 memcpy(fDownTPCPIDpos, ref.fDownTPCPIDpos, AliPID::kSPECIES*sizeof(Float_t));
283 memcpy(fDownComPIDneg, ref.fDownComPIDneg, AliPID::kSPECIES*sizeof(Float_t));
284 memcpy(fDownComPIDpos, ref.fDownComPIDpos, AliPID::kSPECIES*sizeof(Float_t));
285 memcpy(fDownComPIDnegPart, ref.fDownComPIDnegPart, AliPID::kSPECIES*sizeof(Float_t));
286 memcpy(fDownComPIDposPart, ref.fDownComPIDposPart, AliPID::kSPECIES*sizeof(Float_t));
1ee39b3a 287}
288
289//_________________________________________________
b37d601d 290void AliTRDv0Info::SetV0Info(const AliESDv0 *esdv0)
64d57299 291{
292 //Gets values of ESDv0 and daughter track properties
1ee39b3a 293 //See header file for description of variables
294
1ee39b3a 295 fQuality = Quality(esdv0);//Attributes an Int_t to the V0 due to quality cuts (= 1 if V0 is accepted, other integers depending on cut which excludes the vertex)
296
297 fRadius = Radius(esdv0);//distance from secondary vertex to primary vertex in x-y plane
298
299 fDCA = esdv0->GetDcaV0Daughters();//distance of closest approach of two daughter tracks
300
301 fPointingAngle = TMath::ACos(esdv0->GetV0CosineOfPointingAngle());// pointing angle (= angle between between vector from primary to secondary vertex and reconstructed momentum of V0 mother particle)
302
303 fOpenAngle = OpenAngle(esdv0);//Opening angle between two daughter tracks
304
305 fPsiPair = PsiPair(esdv0);//Angle between daughter momentum plane and plane perpendicular to magnetic field
306
307 fV0Momentum = V0Momentum(esdv0);//Reconstructed momentum of the mother particle
308
3d19c1b0 309 //4 decay types : conversions, K0s, Lambda, Anti-Lambda
1ee39b3a 310 //five particle types: electrons, muons, pions, kaons, protons (muons and kaons not involved)
3d19c1b0 311 for(Int_t idecay(0), part1(-1), part2(-1); idecay < kNDecays; idecay++){
0ed6f095 312
313 fArmenteros[idecay]=Armenteros(esdv0, idecay);//Attribute the Armenteros yes/no decision for every decay type
3d19c1b0 314 if(idecay == kLambda){ //protons and pions from Lambda
315 part1 = AliPID::kProton;
316 part2 = AliPID::kPion;
317 } else if(idecay == kAntiLambda) { //antiprotons and pions from Anti-Lambda
318 part1 = AliPID::kPion;
319 part2 = AliPID::kProton;
320 } else if(idecay == kK0s) {//pions from K0s
321 part1 = part2 = AliPID::kPion;
322 } else if(idecay == kGamma) {//electrons from conversions
323 part1 = part2 = AliPID::kElectron;
324 }
325 fInvMass[idecay] = InvMass(part1, part2, esdv0);//Calculate invariant mass for all of our four supposed decays
24b3cfb9 326
327 // Comment out until bug fix is provided
328 // A.Bercuci 14. July 2010
329 //fChi2ndf[idecay] = KFChi2ndf(part1, part2,idecay);
0ed6f095 330
1ee39b3a 331 }
3d19c1b0 332 //Gets all likelihood values from TPC, TOF and ITS PID for the fDetPID[kNDaughters][kNDetectors][AliPID::kSPECIES] array
333 GetDetectorPID();
334 //Bayesian combination of likelihoods from TPC and TOF
335 CombinePID();
0ed6f095 336 //TPC dE/dx values for both tracks
337 GetTPCdEdx();
338
1ee39b3a 339}
340//_________________________________________________
b37d601d 341Float_t AliTRDv0Info::V0Momentum(const AliESDv0 *esdv0) const
1ee39b3a 342{
343 //
344 // Reconstructed momentum of V0 mother particle
345 //
346
347 Double_t mn[3] = {0,0,0};
348 Double_t mp[3] = {0,0,0};
349
350
351 esdv0->GetNPxPyPz(mn[0],mn[1],mn[2]);//reconstructed cartesian momentum components of negative daughter;
352 esdv0->GetPPxPyPz(mp[0],mp[1],mp[2]);//reconstructed cartesian momentum components of positive daughter;
353
354
355 return TMath::Sqrt((mn[0]+mp[0])*(mn[0]+mp[0]) + (mn[1]+mp[1])*(mn[1]+mp[1])+(mn[2]+mp[2])*(mn[2]+mp[2]));
356}
357
358//_________________________________________________
b37d601d 359Double_t AliTRDv0Info::InvMass(Int_t part1, Int_t part2, const AliESDv0 *esdv0) const
1ee39b3a 360{
361 //
362 // Invariant mass of reconstructed V0 mother
363 //
364
365 const Double_t kpmass[5] = {AliPID::ParticleMass(AliPID::kElectron),AliPID::ParticleMass(AliPID::kMuon),AliPID::ParticleMass(AliPID::kPion),AliPID::ParticleMass(AliPID::kKaon),AliPID::ParticleMass(AliPID::kProton)};
366 //Masses of electrons, muons, pions, kaons and protons, as implemented in ROOT
367
368
369 Double_t mn[3] = {0,0,0};
370 Double_t mp[3] = {0,0,0};
371
372 esdv0->GetNPxPyPz(mn[0],mn[1],mn[2]);//reconstructed cartesian momentum components of negative daughter;
373 esdv0->GetPPxPyPz(mp[0],mp[1],mp[2]);//reconstructed cartesian momentum components of positive daughter;
374
0ed6f095 375 Double_t mass1 = kpmass[part1];//sets supposed rest masses for both daughters: positive
376 Double_t mass2 = kpmass[part2];//negative
1ee39b3a 377
378 //Calculate daughters' energies :
379 Double_t e1 = TMath::Sqrt(mass1*mass1+
380 mp[0]*mp[0]+
381 mp[1]*mp[1]+
382 mp[2]*mp[2]);
383 Double_t e2 = TMath::Sqrt(mass2*mass2+
384 mn[0]*mn[0]+
385 mn[1]*mn[1]+
386 mn[2]*mn[2]);
387
388 //Sum of daughter momenta :
389 Double_t momsum =
390 (mn[0]+mp[0])*(mn[0]+mp[0])+
391 (mn[1]+mp[1])*(mn[1]+mp[1])+
392 (mn[2]+mp[2])*(mn[2]+mp[2]);
393
394 //invariant mass :
395 Double_t mInv = TMath::Sqrt((e1+e2)*(e1+e2)-momsum);
396
397 return mInv;
398
399}
400//_________________________________________________
b37d601d 401Float_t AliTRDv0Info::OpenAngle(const AliESDv0 *esdv0)
64d57299 402{
403 //Opening angle between two daughter tracks
1ee39b3a 404 Double_t mn[3] = {0,0,0};
405 Double_t mp[3] = {0,0,0};
406
407
408 esdv0->GetNPxPyPz(mn[0],mn[1],mn[2]);//reconstructed cartesian momentum components of negative daughter;
409 esdv0->GetPPxPyPz(mp[0],mp[1],mp[2]);//reconstructed cartesian momentum components of positive daughter;
410
411
412 fOpenAngle = TMath::ACos((mp[0]*mn[0] + mp[1]*mn[1] + mp[2]*mn[2])/(TMath::Sqrt(mp[0]*mp[0] + mp[1]*mp[1] + mp[2]*mp[2])*TMath::Sqrt(mn[0]*mn[0] + mn[1]*mn[1] + mn[2]*mn[2])));
413
414 return fOpenAngle;
415}
416
417//_________________________________________________
b37d601d 418Float_t AliTRDv0Info::PsiPair(const AliESDv0 *esdv0)
64d57299 419{
420 //Angle between daughter momentum plane and plane perpendicular to magnetic field
1ee39b3a 421 Double_t x, y, z;
422 esdv0->GetXYZ(x,y,z);//Reconstructed coordinates of V0; to be replaced by Markus Rammler's method in case of conversions!
423
424 Double_t mn[3] = {0,0,0};
425 Double_t mp[3] = {0,0,0};
426
427
428 esdv0->GetNPxPyPz(mn[0],mn[1],mn[2]);//reconstructed cartesian momentum components of negative daughter;
429 esdv0->GetPPxPyPz(mp[0],mp[1],mp[2]);//reconstructed cartesian momentum components of positive daughter;
430
431
432 Double_t deltat = 1.;
433 deltat = TMath::ATan(mp[2]/(TMath::Sqrt(mp[0]*mp[0] + mp[1]*mp[1])+1.e-13)) - TMath::ATan(mn[2]/(TMath::Sqrt(mn[0]*mn[0] + mn[1]*mn[1])+1.e-13));//difference of angles of the two daughter tracks with z-axis
434
435 Double_t radiussum = TMath::Sqrt(x*x + y*y) + 50;//radius to which tracks shall be propagated
436
437 Double_t momPosProp[3];
438 Double_t momNegProp[3];
439
440 AliExternalTrackParam nt(*fTrackN), pt(*fTrackP);
441
442 fPsiPair = 4.;
443
444 if(nt.PropagateTo(radiussum,fMagField) == 0)//propagate tracks to the outside
445 fPsiPair = -5.;
446 if(pt.PropagateTo(radiussum,fMagField) == 0)
447 fPsiPair = -5.;
448 pt.GetPxPyPz(momPosProp);//Get momentum vectors of tracks after propagation
449 nt.GetPxPyPz(momNegProp);
450
451 Double_t pEle =
452 TMath::Sqrt(momNegProp[0]*momNegProp[0]+momNegProp[1]*momNegProp[1]+momNegProp[2]*momNegProp[2]);//absolute momentum value of negative daughter
453 Double_t pPos =
454 TMath::Sqrt(momPosProp[0]*momPosProp[0]+momPosProp[1]*momPosProp[1]+momPosProp[2]*momPosProp[2]);//absolute momentum value of positive daughter
455
456 Double_t scalarproduct =
457 momPosProp[0]*momNegProp[0]+momPosProp[1]*momNegProp[1]+momPosProp[2]*momNegProp[2];//scalar product of propagated positive and negative daughters' momenta
458
459 Double_t chipair = TMath::ACos(scalarproduct/(pEle*pPos));//Angle between propagated daughter tracks
460
461 fPsiPair = TMath::Abs(TMath::ASin(deltat/chipair));
462
463 return fPsiPair;
464
465}
0ed6f095 466//_________________________________________________
467Double_t AliTRDv0Info::KFChi2ndf(Int_t part1, Int_t part2,Int_t decay){
468 //Calculates Kalman filter Chi2/NDF
469 Int_t mothers[4]={22,310,3122,3122};
470
471 const Double_t partMass=TDatabasePDG::Instance()->GetParticle(mothers[decay])->Mass();
472 const Double_t massWidth[4] = {0.001, 0., 0., 0.};
473
474 AliKFParticle *kfMother = CreateMotherParticle(fTrackP, fTrackN, part1, part2);
475
476 // Lambda
477 if(!kfMother) {
478 return kFALSE;
479 }
480
481 // production vertex is set in the 'CreateMotherParticle' function
482 kfMother->SetMassConstraint(partMass, massWidth[decay]);
483
484 Double_t chi2ndf = (kfMother->GetChi2()/kfMother->GetNDF());
485
486 if(kfMother)delete kfMother;
487 return chi2ndf;
488}
489//________________________________________________________________
64d57299 490AliKFParticle *AliTRDv0Info::CreateMotherParticle(const AliESDtrack *pdaughter, const AliESDtrack *ndaughter, Int_t pspec, Int_t nspec){
0ed6f095 491 //
492 // Creates a mother particle
493 //
494 AliKFParticle pkfdaughter(*pdaughter, pspec);
495 AliKFParticle nkfdaughter(*ndaughter, nspec);
496
497
498 // Create the mother particle
499 AliKFParticle *m = new AliKFParticle(pkfdaughter, nkfdaughter);
500
501 AliKFVertex improvedVertex = *fPrimaryVertex;
502 improvedVertex += *m;
503 m->SetProductionVertex(improvedVertex);
504
1ee39b3a 505
0ed6f095 506 return m;
507}
1ee39b3a 508//_________________________________________________
64d57299 509Int_t AliTRDv0Info::HasTrack(const AliTRDtrackInfo * const track) const
3d19c1b0 510{
64d57299 511 //Checks if track is a secondary vertex daughter (due to V0 finder)
1ee39b3a 512
d80a6a00 513 if(!track) return 0;
514 if(!fTrackP->GetID()) return 0;
515 if(!fTrackN->GetID()) return 0;
516
3d19c1b0 517 Int_t trackID(track->GetTrackId());//index of the track
b9ddd472 518 return HasTrack(trackID);
519}
1ee39b3a 520
b9ddd472 521//_________________________________________________
64d57299 522Int_t AliTRDv0Info::HasTrack(Int_t trackID) const
b9ddd472 523{
1ee39b3a 524 //comparing index of track with indices of pos./neg. V0 daughter :
b9ddd472 525 if(fNindex==trackID) return -1;
526 else if(fPindex==trackID) return 1;
527 else return 0;
1ee39b3a 528}
3d19c1b0 529
1ee39b3a 530//_________________________________________________
531void AliTRDv0Info::GetDetectorPID()
64d57299 532{
533 //PID likelihoods from TPC, TOF, and ITS, for all particle species
1ee39b3a 534
535 fTrackN->GetTPCpid(fDetPID[kNeg][kTPC]);
536 fTrackP->GetTPCpid(fDetPID[kPos][kTPC]);
537 fTrackN->GetTOFpid(fDetPID[kNeg][kTOF]);
538 fTrackP->GetTOFpid(fDetPID[kPos][kTOF]);
539 fTrackN->GetITSpid(fDetPID[kNeg][kITS]);
540 fTrackP->GetITSpid(fDetPID[kPos][kITS]);
541
8bc8ea55 542 Long_t statusN = fTrackN->GetStatus();
543 Long_t statusP = fTrackP->GetStatus();
544
545 if(!(statusN & AliESDtrack::kTPCpid)){
546 for(Int_t iPart = 0; iPart < AliPID::kSPECIES; iPart++){
547 fDetPID[kNeg][kTPC][iPart] = 0.2;
548 }
549 }
550 if(!(statusN & AliESDtrack::kTOFpid)){
551 for(Int_t iPart = 0; iPart < AliPID::kSPECIES; iPart++){
552 fDetPID[kNeg][kTOF][iPart] = 0.2;
553 }
554
555 }
556 if(!(statusN & AliESDtrack::kITSpid)){
557 for(Int_t iPart = 0; iPart < AliPID::kSPECIES; iPart++){
558 fDetPID[kNeg][kITS][iPart] = 0.2;
559 }
560 }
561 if(!(statusP & AliESDtrack::kTPCpid)){
562 for(Int_t iPart = 0; iPart < AliPID::kSPECIES; iPart++){
563 fDetPID[kPos][kTPC][iPart] = 0.2;
564 }
565 }
566 if(!(statusP & AliESDtrack::kTOFpid)){
567 for(Int_t iPart = 0; iPart < AliPID::kSPECIES; iPart++){
568 fDetPID[kPos][kTOF][iPart] = 0.2;
569 }
570
571 }
572 if(!(statusP & AliESDtrack::kITSpid)){
573 for(Int_t iPart = 0; iPart < AliPID::kSPECIES; iPart++){
574 fDetPID[kPos][kITS][iPart] = 0.2;
575 }
576 }
1ee39b3a 577
8bc8ea55 578}
579//____________________________________________________________________________________
580void AliTRDv0Info::CombinePID()
581{
64d57299 582 //combined bayesian PID from TPC and TOF
8bc8ea55 583 Double_t partrat[AliPID::kSPECIES] = {0.208, 0.010, 0.662, 0.019, 0.101};
584
585 for(Int_t iSign = 0; iSign < kNDaughters; iSign++)
586 {
587 for(Int_t iPart = 0; iPart < AliPID::kSPECIES; iPart++)
588 {
589 fComPID[iSign][iPart] = (partrat[iPart]*fDetPID[iSign][kTPC][iPart]*fDetPID[iSign][kTOF][iPart])/((partrat[0]*fDetPID[iSign][kTPC][0]*fDetPID[iSign][kTOF][0])+(partrat[1]*fDetPID[iSign][kTPC][1]*fDetPID[iSign][kTOF][1])+(partrat[2]*fDetPID[iSign][kTPC][2]*fDetPID[iSign][kTOF][2])+(partrat[3]*fDetPID[iSign][kTPC][3]*fDetPID[iSign][kTOF][3])+(partrat[4]*fDetPID[iSign][kTPC][4]*fDetPID[iSign][kTOF][4]));
590
591 }
592 }
593}
1ee39b3a 594//_________________________________________________
d80a6a00 595Bool_t AliTRDv0Info::GetTPCdEdx()
0ed6f095 596{
64d57299 597 //gets the TPC dE/dx for both daughter tracks
d80a6a00 598 if(!fTrackP->GetID()) return 0;
599 if(!fTrackN->GetID()) return 0;
600
0ed6f095 601 fTPCdEdx[kNeg] = fTrackN->GetTPCsignal();
602 fTPCdEdx[kPos] = fTrackP->GetTPCsignal();
d80a6a00 603 return 1;
0ed6f095 604
605}
606//_________________________________________________
b37d601d 607Bool_t AliTRDv0Info::TPCdEdxCuts(Int_t part, const AliTRDtrackInfo * const track)
0ed6f095 608{
64d57299 609 //applies cuts on TPC dE/dx according to particle species; cutting lines are drawn shifted to the Bethe-Bloch paremeterization
d80a6a00 610 if(!fTrackP->GetID()) return 0;
611 if(!fTrackN->GetID()) return 0;
612
0ed6f095 613 //Bethe-Bloch lines
614 Double_t alephParameters[5];
615
616 // data
617 alephParameters[0] = 0.0283086;
618 alephParameters[1] = 2.63394e+01;
619 alephParameters[2] = 5.04114e-11;
620 alephParameters[3] = 2.12543e+00;
621 alephParameters[4] = 4.88663e+00;
622
623
624 Double_t deposit = 0;
625 Float_t x = 0;
626 if(HasTrack(track) == 1){
627 x = fTrackP->P();
628 deposit = fTPCdEdx[kPos];
629 }
630 else if(HasTrack(track) == -1){
631 x = fTrackN->P();
632 deposit = fTPCdEdx[kNeg];
633 }
634 else{
635 printf("No track found");
636 return 0;
637 }
638 if(x < 0.2)return 0;
639
640 Float_t upLimits[5]={85,1000,50*AliExternalTrackParam::BetheBlochAleph(x/0.13957, alephParameters[0], alephParameters[1], alephParameters[2], alephParameters[3], alephParameters[4])+6,1000,50*AliExternalTrackParam::BetheBlochAleph(x/0.93827, alephParameters[0], alephParameters[1], alephParameters[2], alephParameters[3], alephParameters[4])+10};
641 Float_t downLimits[5]={62,40,50*AliExternalTrackParam::BetheBlochAleph(x/0.13957, alephParameters[0], alephParameters[1], alephParameters[2], alephParameters[3], alephParameters[4])-6,40,50*AliExternalTrackParam::BetheBlochAleph(x/0.93827, alephParameters[0], alephParameters[1], alephParameters[2], alephParameters[3], alephParameters[4])-11};
642
643
644 if(x < 0.7){
645 downLimits[4]=90;
646 }
647 if(x < 1.25){
648 upLimits[0] = 85;
649 }
650 else{
651 downLimits[0] = 64;
652 }
653
654
655 if(deposit < downLimits[part])
656 return 0;
657 if(deposit > upLimits[part])
658 return 0;
659
660
661 return 1;
662
663}
664//_________________________________________________
b37d601d 665Float_t AliTRDv0Info::Radius(const AliESDv0 *esdv0)
64d57299 666{
667 //distance from secondary vertex to primary vertex in x-y plane
1ee39b3a 668 Double_t x, y, z;
0ed6f095 669 esdv0->GetXYZ(x,y,z); //Reconstructed coordinates of V0
1ee39b3a 670 fRadius = TMath::Sqrt(x*x + y*y);
671 return fRadius;
672
673}
674
675//_________________________________________________
b37d601d 676Int_t AliTRDv0Info::Quality(const AliESDv0 *const esdv0)
1ee39b3a 677{
678 //
679 // Checking track and V0 quality status in order to exclude vertices based on poor information
680 //
681
682 Float_t nClsN;
683 nClsN = fTrackN->GetTPCNcls();//number of found clusters in TPC for negative track
684 Float_t nClsFN;
685 nClsFN = fTrackN->GetTPCNclsF();//number of findable clusters in TPC for negative track
686 Float_t nClsP;
687 nClsP = fTrackP->GetTPCNcls();//number of found clusters in TPC for positive track
688 Float_t nClsFP;
689 nClsFP = fTrackP->GetTPCNclsF();//number of findable clusters in TPC for positive track
690
691 fQuality = 0;
692
693
0ed6f095 694 if (!(esdv0->GetOnFlyStatus()))//accept only vertices from online V0 finder
695 return -1;
696
1ee39b3a 697 Float_t clsRatioN;
698 Float_t clsRatioP;
699
0ed6f095 700 if((nClsFN < 80) || (nClsFP < 80)) return -2;//reject all V0s where at least one track has less than 80 TPC clusters
701
702 // Chi2 per TPC cluster
703 Int_t nTPCclustersP = fTrackP->GetTPCclusters(0);
704 Int_t nTPCclustersN = fTrackN->GetTPCclusters(0);
705 Float_t chi2perTPCclusterP = fTrackP->GetTPCchi2()/Float_t(nTPCclustersP);
706 Float_t chi2perTPCclusterN = fTrackN->GetTPCchi2()/Float_t(nTPCclustersN);
707
708 if((chi2perTPCclusterN > 3.5)||(chi2perTPCclusterP > 3.5)) return -3;//reject all V0s where at least one track has a chi2 above 3.5
1ee39b3a 709
710 clsRatioN = nClsN/nClsFN; //ratios of found to findable clusters in TPC
711 clsRatioP = nClsP/nClsFP;
0ed6f095 712
713 if((clsRatioN < 0.6)||(clsRatioP < 0.6))//exclude tracks with low ratio of found to findable TPC clusters
714 return -4;
715
1ee39b3a 716 if (!((fTrackP->GetStatus() &
717 AliESDtrack::kTPCrefit)))//accept only vertices in which both tracks have TPC refit
0ed6f095 718 return -5;
1ee39b3a 719 if (!((fTrackN->GetStatus() &
720 AliESDtrack::kTPCrefit)))
0ed6f095 721 return -6;
1ee39b3a 722 if (fTrackP->GetKinkIndex(0)>0 ||
723 fTrackN->GetKinkIndex(0)>0 )//exclude tracks with kinks
e148d6e6 724 return -7;
0ed6f095 725
726 if(!(V0SignCheck()))
727 return -8;
1ee39b3a 728 fQuality = 1;
729 return fQuality;
730}
0ed6f095 731//________________________________________________________________
732Bool_t AliTRDv0Info::V0SignCheck(){
733 //
734 // Check if v0 daughters really carry opposite charges
735 //
736
737 Int_t qP = fTrackP->Charge();
738 Int_t qN = fTrackN->Charge();
739
740 if((qP*qN) != -1) return kFALSE;
741
742 return kTRUE;
743}
744//___________________________________________________________________
b37d601d 745Bool_t AliTRDv0Info::Armenteros(const AliESDv0 *esdv0, Int_t decay){
0ed6f095 746 //
747 // computes the Armenteros variables for given V0
748 //
749 Double_t mn[3] = {0,0,0};
750 Double_t mp[3] = {0,0,0};
751 Double_t mm[3] = {0,0,0};
752
753 if(V0SignCheck()){
754 esdv0->GetNPxPyPz(mn[0],mn[1],mn[2]); //reconstructed cartesian momentum components of negative daughter
755 esdv0->GetPPxPyPz(mp[0],mp[1],mp[2]); //reconstructed cartesian momentum components of positive daughter
756 }
757 else{
758 esdv0->GetPPxPyPz(mn[0],mn[1],mn[2]); //reconstructed cartesian momentum components of negative daughter
759 esdv0->GetNPxPyPz(mp[0],mp[1],mp[2]); //reconstructed cartesian momentum components of positive daughter
760 }
761 esdv0->GetPxPyPz(mm[0],mm[1],mm[2]); //reconstructed cartesian momentum components of mother
762
763 TVector3 vecN(mn[0],mn[1],mn[2]);
764 TVector3 vecP(mp[0],mp[1],mp[2]);
765 TVector3 vecM(mm[0],mm[1],mm[2]);
766
767 Double_t thetaP = acos((vecP * vecM)/(vecP.Mag() * vecM.Mag()));
768 Double_t thetaN = acos((vecN * vecM)/(vecN.Mag() * vecM.Mag()));
769
770 Double_t alfa = ((vecP.Mag())*cos(thetaP)-(vecN.Mag())*cos(thetaN))/
771 ((vecP.Mag())*cos(thetaP)+(vecN.Mag())*cos(thetaN)) ;
772 Double_t qt = vecP.Mag()*sin(thetaP);
773
774 Float_t ap[2];
775 ap[0] = alfa;
776 ap[1] = qt;
777
64d57299 778 Double_t lCutAP[2];//Lambda/Anti-Lambda cuts
0ed6f095 779 if(decay == 0){
780 // armenteros cuts
781 const Double_t cutAlpha[2] = {0.35, 0.45}; // [0.35, 0.45]
782 const Double_t cutQT = 0.015;
783 if(TMath::Abs(ap[0]) > cutAlpha[0] && TMath::Abs(ap[0]) < cutAlpha[1]) return kFALSE;
784
785 if(ap[1] > cutQT) return kFALSE;
786 }
787
788 else if(decay == 1){
789 const Double_t cutQT = 0.1075;
790 const Double_t cutAP = 0.22 * TMath::Sqrt( TMath::Abs( (1-ap[0]*ap[0]/(0.92*0.92)) ) );
791 if(ap[1] < cutQT) return kFALSE;
792 if(ap[1] > cutAP) return kFALSE;
793 }
794 else if(decay == 2){
795 const Double_t cutQT = 0.03;
796 const Double_t cutAlpha = 0.7; // VERY strong - should supress the overlap with K0
64d57299 797 lCutAP[0] = 1.0 - (ap[0]-0.7 * ap[0]-0.7)*1.1 - 0.87;
0ed6f095 798 if(TMath::Abs(ap[0]) > cutAlpha) return kFALSE;
799 if(ap[1] < cutQT) return kFALSE;
64d57299 800 if(ap[1] > lCutAP[0]) return kFALSE;
0ed6f095 801
802 }
803 else if(decay == 3){
804 const Double_t cutQT = 0.03;
805 const Double_t cutAlpha = 0.7; // VERY strong - should supress the overlap with K0
64d57299 806 lCutAP[1] = 1.0 - (ap[0]+0.7 * ap[0]+0.7)*1.1 - 0.87;
0ed6f095 807 if(TMath::Abs(ap[0]) > cutAlpha) return kFALSE;
808 if(ap[1] < cutQT) return kFALSE;
64d57299 809 if(ap[1] > lCutAP[1]) return kFALSE;
0ed6f095 810 }
811 return kTRUE;
812}
1ee39b3a 813//_________________________________________________
3d19c1b0 814Int_t AliTRDv0Info::GetPID(Int_t ipart, AliTRDtrackInfo *track)
815{
0ed6f095 816 // Decides if track is accepted for one of the reference data samples
817 Int_t cutCode = -99;
3d19c1b0 818 if(!(track)) {
819 AliError("No track info");
b9ddd472 820 return -1;
3d19c1b0 821 }
822 if(!HasTrack(track)){
823 AliDebug(2, "Track not attached to v0.");
0ed6f095 824 return -2;
3d19c1b0 825 }
3d19c1b0 826
827 //translate ipart to decay (Anti-Lambda will be treated separately)
1ee39b3a 828 Int_t iDecay = -1;
3d19c1b0 829 switch(ipart){
830 case AliPID::kElectron: iDecay = kGamma; break;
831 case AliPID::kPion: iDecay = kK0s; break;
832 case AliPID::kProton: iDecay = kLambda; break;
833 default:
b2f4ab8d 834 AliDebug(1, Form("Hypothesis \"ipart=%d\" not handled", ipart));
0ed6f095 835 return -3;
3d19c1b0 836 }
1ee39b3a 837
3d19c1b0 838 //... it fulfills our quality criteria
0ed6f095 839 if(!(fQuality == 1)) return -4;
3d19c1b0 840 //... distance of closest approach between daughters is reasonably small
0ed6f095 841 if((fDCA > fUpDCA[iDecay])) return -5;
3d19c1b0 842 //... pointing angle between momentum of mother particle and vector from prim. to sec. vertex is small
0ed6f095 843 if((fPointingAngle > fUpPointingAngle[iDecay])) return -6;
3d19c1b0 844 //... x-y plane distance of decay point to prim. vertex is bigger than a certain minimum value (for conversions)
0ed6f095 845 if((fRadius < fDownRadius[iDecay])) return -7;
3d19c1b0 846 //...or smaller than a maximum value (for K0s)
0ed6f095 847 if((fRadius > fUpRadius[iDecay])) return -8;
3d19c1b0 848 //... opening angle is close enough to zero (for conversions)
0ed6f095 849 if((fOpenAngle > fUpOpenAngle[iDecay])) return -9;
3d19c1b0 850 //... Psi-pair angle is close enough to zero(for conversions)
0ed6f095 851 if((TMath::Abs(fPsiPair) > fUpPsiPair[iDecay])) return -10;
852
3d19c1b0 853
854
855 //Mother momentum slots above/below 2.5 GeV
856 Int_t iPSlot(fV0Momentum > 2.5);
b9ddd472 857 Int_t trackID(track->GetTrackId());
3d19c1b0 858
859 //specific cut criteria :
860 if(ipart == AliPID::kProton) {
0ed6f095 861 if((fInvMass[kK0s] < fUpInvMass[kK0s][iPSlot]) && (fInvMass[kK0s] > fDownInvMass[kK0s])) return -11;//explicit exclusion of K0s decays
862
863 if(fOpenAngle < (0.3 - 0.2*fV0Momentum))return -9;
864
865
866
3d19c1b0 867 //for proton sample: separate treatment of Lamba and Anti-Lambda decays:
868 //for Anti-Lambda:
869 //Combined PID likelihoods high enough for pi+ and anti-proton ; invariant mass calculated postulating these two particle species...
0ed6f095 870 //if((fComPID[kNeg][AliPID::kProton] > fDownComPIDneg[AliPID::kProton]) && (fComPID[kPos][AliPID::kPion] > fDownComPIDposPart[AliPID::kPion])) {
871 //if((fDetPID[kNeg][kTPC][AliPID::kProton] > fDownTPCPIDneg[AliPID::kProton]) && (fDetPID[kPos][kTPC][AliPID::kPion] > fDownTPCPIDpos[AliPID::kPion])){
872 if((TPCdEdxCuts(ipart, track))){//momentary solution: direct cut on TPC dE/dx
873 if(fNindex == trackID) {//we're only interested in the anti-proton
874 if(fArmenteros[kAntiLambda]){//Armenteros condition has to be fulfilled
875 if(fChi2ndf[kAntiLambda] < fUpChi2ndf[kAntiLambda]){//Kalman filter Chi2/NDF not allowed to be too large
876 if((fInvMass[kAntiLambda] < fUpInvMass[kAntiLambda][iPSlot]) && (fInvMass[kAntiLambda] > fDownInvMass[kAntiLambda])){
877 return 1;
878 } else cutCode = -15;
879 }
880 else cutCode =-14;
881 }
882 else cutCode = -13;
3d19c1b0 883 }
884 }
0ed6f095 885 else cutCode = -12;
3d19c1b0 886 //for Lambda:
887 //TPC PID likelihoods high enough for pi- and proton ; invariant mass calculated accordingly
0ed6f095 888 //if((fComPID[kNeg][AliPID::kPion] > fDownComPIDnegPart[AliPID::kPion]) && (fComPID[kPos][AliPID::kProton] > fDownComPIDpos[AliPID::kProton])) {
889 //if((fDetPID[kNeg][kTPC][AliPID::kPion] > fDownTPCPIDneg[AliPID::kPion]) && (fDetPID[kPos][kTPC][AliPID::kProton] > fDownTPCPIDpos[AliPID::kProton])){
890 if((TPCdEdxCuts(ipart, track))){//momentary solution: direct TPC dE/dx cuts
3d19c1b0 891 if(fPindex == trackID) {
0ed6f095 892 if(fArmenteros[kLambda]){
893 if(fChi2ndf[kLambda] < fUpChi2ndf[kLambda]){
894 if((fInvMass[kLambda] < fUpInvMass[kLambda][iPSlot]) && (fInvMass[kLambda] > fDownInvMass[kLambda])){
895 return 1;
896 } else cutCode = -15;
897 }
898 else cutCode = -14;
899 }
900 else cutCode = -13;
3d19c1b0 901 }
902 }
0ed6f095 903 else cutCode = -12;
904 return cutCode;
3d19c1b0 905 }
0ed6f095 906
3d19c1b0 907 //for K0s decays: equal TPC PID likelihood criteria for both daughters ; invariant mass calculated postulating two pions
908 if(ipart == AliPID::kPion) {
0ed6f095 909
910 if(fOpenAngle < (1.0/(fV0Momentum + 0.3) - 0.1))
911 return -9;
912
3d19c1b0 913 //explicit exclusion of Lambda decays
0ed6f095 914 if((fInvMass[kLambda] < fUpInvMass[kLambda][iPSlot]) && (fInvMass[kLambda] > fDownInvMass[kLambda])) return -11;
3d19c1b0 915 //explicit exclusion of Anti-Lambda decays
0ed6f095 916 if((fInvMass[kAntiLambda] < fUpInvMass[kAntiLambda][iPSlot]) && (fInvMass[kAntiLambda] > fDownInvMass[kAntiLambda])) return -11;
917
918 //if((fDetPID[kNeg][kTPC][ipart] < fDownTPCPIDneg[ipart]) || (fDetPID[kPos][kTPC][ipart] < fDownTPCPIDpos[ipart])) return -12;
919 if(!(TPCdEdxCuts(ipart, track))){//momentary solution: direct TPC dE/dx cuts
920 return -12;
921 }
3d19c1b0 922 }
0ed6f095 923
924
3d19c1b0 925 //for photon conversions: equal combined PID likelihood criteria for both daughters ; invariant mass calculated postulating two electrons
926 //No Lambda/K0s exclusion is provided, since these contributions hardly ever interfere with gamma invariant mass!
0ed6f095 927 //Float_t momentum(track->GetESDinfo()->GetOuterParam()->P());
3d19c1b0 928 if(ipart == AliPID::kElectron) {
0ed6f095 929 //if(momentum > 1.75) {//since combined PID performs a little worse in simulations than TPC standalone for higher momenta, ONLY TPC PID is used here
930 //if((fDetPID[kNeg][kTPC][ipart] < fDownTPCPIDneg[ipart]) || (fDetPID[kPos][kTPC][ipart] < fDownTPCPIDpos[ipart])) return -12;
931 //} else {//for low momenta, combined PID from TOF and TPC is used to get rid of proton contamination
932 //if((fComPID[kNeg][ipart] > fDownComPIDneg[ipart]) && (fComPID[kPos][ipart] > fDownComPIDpos[ipart])) return 1;
933 //}
934 if(!(TPCdEdxCuts(ipart, track))){//momentary solution for direct TPC dE/dx cut
935 return -12;
1ee39b3a 936 }
0ed6f095 937
938 }
939
940
941 //Armenteros-Polanski cut
942 if(!(fArmenteros[iDecay])) return -13;
943
944 //Kalman filter Chi2/NDF cut
945 if(fChi2ndf[iDecay] > fUpChi2ndf[iDecay]) return -14;
946
947 //Invariant mass cut for K0s and photons, assuming two pions/two electrons as daughters:
948
949 if((fInvMass[iDecay] > fUpInvMass[iDecay][iPSlot]) || (fInvMass[iDecay] < fDownInvMass[iDecay])) {
950 return -15;
951
3d19c1b0 952 }
0ed6f095 953
954 return 1;
1ee39b3a 955}
3d19c1b0 956
957
1ee39b3a 958//_________________________________________________
b9ddd472 959void AliTRDv0Info::Print(Option_t *opt) const
1ee39b3a 960{
64d57299 961 //prints text for debugging etc.
b9ddd472 962 printf("V0 P[%d] N[%d]\n", fPindex, fNindex);
963 printf(" DCA[%5.3f] Radius[%5.3f]\n", fDCA, fRadius);
964 printf(" Angles : Pointing[%5.3f] Open[%5.3f] Psi[%5.3f]\n", fPointingAngle, fOpenAngle, fPsiPair);
965 if(strcmp(opt, "a")!=0) return;
966 printf(" Reconstructed PID\n"
967 " sgn spec ITS TPC TOF COM\n");
968 for(Int_t idt=0; idt<kNDaughters; idt++){
969 printf(" %c", idt?'-':'+');
970 for(Int_t is(0); is<AliPID::kSPECIES; is++){
971 printf("%s%s%s", is==0?" ":" ", AliPID::ParticleShortName(is), (is==1||is==2)?" ":" ");
972 for(Int_t id(0); id<kNDetectors; id++){
973 printf("%5.1f ", 1.e2*fDetPID[idt][id][is]);
974 }
975 printf("%5.1f\n", 1.e2*fComPID[idt][is]);
976 }
977 }
978}
1ee39b3a 979
b9ddd472 980//_________________________________________________
981void AliTRDv0Info::SetV0tracks(AliESDtrack *p, AliESDtrack *n)
982{
64d57299 983 //sets the two daughter trex and their indices
b9ddd472 984 fTrackP = p; fPindex = p->GetID();
985 fTrackN = n; fNindex = n->GetID();
1ee39b3a 986}
64d57299 987//_________________________________________________
b9ddd472 988
64d57299 989AliESDtrack *AliTRDv0Info::GetV0Daughter(Int_t sign)
990{
991 //Gets positive of negative daughter of decay
992 if(sign>0)
993 return fTrackP;
994 else if(sign < 0)
995 return fTrackN;
b9ddd472 996
64d57299 997 return 0;
998}