1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
16 /* $Id: AliTRDv0Info.cxx 27496 2008-07-22 08:35:45Z cblume $ */
18 ////////////////////////////////////////////////////////////////////////////
20 // Reconstruction QA //
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 //
28 // (M.Heide, 2009/10/06) //
31 // Alex Bercuci <A.Bercuci@gsi.de> //
32 // Alex Wilk <wilka@uni-muenster.de> //
33 // Markus Heide <mheide@uni-muenster.de> //
35 ////////////////////////////////////////////////////////////////////////////
38 #include "AliESDtrack.h"
42 #include "AliTRDv0Info.h"
43 #include "AliTRDtrackInfo.h"
44 #include "AliTRDtrackInfo.h"
46 ClassImp(AliTRDv0Info)
48 //_________________________________________________
49 AliTRDv0Info::AliTRDv0Info()
65 // Default constructor
68 memset(fPplus, 0, 2*kNlayer*sizeof(Float_t));
69 memset(fPminus, 0, 2*kNlayer*sizeof(Float_t));
70 memset(fDetPID, 0, 2*kNDaughters*kNDetectors*AliPID::kSPECIES*sizeof(Float_t));
71 memset(fComPID, 0, 2*kNDaughters*AliPID::kSPECIES*sizeof(Float_t));
72 memset(fInvMass, 0, kNMomBins*kNDecays*sizeof(Double_t));
74 /////////////////////////////////////////////////////////////////////////////
75 //Set Cut values: First specify decay in brackets, then the actual cut value!
76 /////////////////////////////////////////////////////////////////////////////
78 //Upper limit for distance of closest approach of two daughter tracks :
79 fUpDCA[kGamma] = 1000.;
81 fUpDCA[kLambda] = 0.2;
82 fUpDCA[kAntiLambda] = 0.2;
84 //Upper limit for pointing angle (= angle between between vector from primary to secondary vertex and reconstructed momentum of V0 mother particle) :
85 fUpPointingAngle[kGamma] = 0.03;
86 fUpPointingAngle[kK0s] = 0.03;
87 fUpPointingAngle[kLambda] = 0.04;
88 fUpPointingAngle[kAntiLambda] = 0.04;
90 //Upper limit for invariant mass of V0 mother :
91 fUpInvMass[kGamma][0] = 0.05;// second pair of brackets is for momentum bin: 0: below mother momentm of 2.5 GeV
92 fUpInvMass[kGamma][1] = 0.07;//1: above 2.5 GeV
93 fUpInvMass[kK0s][0] = fUpInvMass[kK0s][1] = 0.50265;
94 fUpInvMass[kLambda][0] = fUpInvMass[kLambda][1] = 1.1207;
95 fUpInvMass[kAntiLambda][0] = fUpInvMass[kAntiLambda][1] = 1.1207;
97 //Lower limit for invariant mass of V0 mother :
98 fDownInvMass[kGamma] = -1.;
99 fDownInvMass[kK0s] = 0.49265;
100 fDownInvMass[kLambda] = 1.107;
101 fDownInvMass[kAntiLambda] = 1.107;
103 //Lower limit for distance from secondary vertex to primary vertex in x-y plane :
104 fDownRadius[kGamma] = 6.;
105 fDownRadius[kK0s] = 0.;
106 fDownRadius[kLambda] = 0.;
107 fDownRadius[kAntiLambda] = 0.;
109 //Upper limit for distance from secondary vertex to primary vertex in x-y plane :
110 fUpRadius[kGamma] = 1000.;
111 fUpRadius[kK0s] = 20.;
112 fUpRadius[kLambda] = 1000.;
113 fUpRadius[kAntiLambda] = 1000.;
115 //Upper limit for opening angle between two daughter tracks (characteristically near zero for conversions) :
116 fUpOpenAngle[kGamma] = 0.1;
117 fUpOpenAngle[kK0s] = 3.15;
118 fUpOpenAngle[kLambda] = 3.15;
119 fUpOpenAngle[kAntiLambda] = 3.15;
121 //Upper limit for angle between daughter momentum plane and plane perpendicular to magnetic field (characteristically around zero for conversions) :
122 fUpPsiPair[kGamma] = 0.05;
123 fUpPsiPair[kK0s] = 1.6;
124 fUpPsiPair[kLambda] = 1.6;
125 fUpPsiPair[kAntiLambda] = 1.6;
127 //Lower limit for likelihood value of TPC PID :
128 fDownTPCPIDneg[AliPID::kElectron] = 0.21;
129 fDownTPCPIDpos[AliPID::kElectron] = 0.21;
131 fDownTPCPIDneg[AliPID::kMuon] = 0.21;
132 fDownTPCPIDpos[AliPID::kMuon] = 0.21;
134 fDownTPCPIDneg[AliPID::kPion] = 0.21;
135 fDownTPCPIDpos[AliPID::kPion] = 0.21;
137 fDownTPCPIDneg[AliPID::kKaon] = 0.21;
138 fDownTPCPIDpos[AliPID::kKaon] = 0.21;
140 fDownTPCPIDneg[AliPID::kProton] = 0.21;
141 fDownTPCPIDpos[AliPID::kProton] = 0.21;
143 //Lower limit for likelihood value of combined PID :
144 fDownComPIDneg[AliPID::kElectron] = 0.21;
145 fDownComPIDpos[AliPID::kElectron] = 0.21;
147 fDownComPIDneg[AliPID::kMuon] = 0.21;
148 fDownComPIDpos[AliPID::kMuon] = 0.21;
150 fDownComPIDneg[AliPID::kPion] = 0.9;
151 fDownComPIDpos[AliPID::kPion] = 0.9;
153 fDownComPIDneg[AliPID::kKaon] = 0.21;
154 fDownComPIDpos[AliPID::kKaon] = 0.21;
156 fDownComPIDneg[AliPID::kProton] = 0.9;
157 fDownComPIDpos[AliPID::kProton] = 0.9;
159 //Lower limit for likelihood value of combined PID for daughter track which doesn't enter reference data (here: pion daughters from Lambda decays:
160 fDownComPIDnegPart[AliPID::kElectron] = 0.05;
161 fDownComPIDposPart[AliPID::kElectron] = 0.05;
163 fDownComPIDnegPart[AliPID::kMuon] = 0.05;
164 fDownComPIDposPart[AliPID::kMuon] = 0.05;
166 fDownComPIDnegPart[AliPID::kPion] = 0.05;
167 fDownComPIDposPart[AliPID::kPion] = 0.05;
169 fDownComPIDnegPart[AliPID::kKaon] = 0.05;
170 fDownComPIDposPart[AliPID::kKaon] = 0.05;
172 fDownComPIDnegPart[AliPID::kProton] = 0.05;
173 fDownComPIDposPart[AliPID::kProton] = 0.05;
176 //_________________________________________________
177 AliTRDv0Info::AliTRDv0Info(const AliTRDv0Info &ref)
179 ,fQuality(ref.fQuality)
181 ,fPointingAngle(ref.fPointingAngle)
182 ,fOpenAngle(ref.fOpenAngle)
183 ,fPsiPair(ref.fPsiPair)
184 ,fMagField(ref.fMagField)
185 ,fRadius(ref.fMagField)
186 ,fV0Momentum(ref.fV0Momentum)
187 ,fTrackP(ref.fTrackP)
188 ,fTrackN(ref.fTrackN)
189 ,fNindex(ref.fNindex)
190 ,fPindex(ref.fPindex)
196 memcpy(fPplus, ref.fPplus, 2*kNlayer*sizeof(Float_t));
197 memcpy(fPminus, ref.fPminus, 2*kNlayer*sizeof(Float_t));
198 memcpy(fDetPID, ref.fDetPID, 2*kNDaughters*kNDetectors*AliPID::kSPECIES*sizeof(Float_t));
199 memcpy(fComPID, ref.fComPID, 2*kNDaughters*AliPID::kSPECIES*sizeof(Float_t));
200 memcpy(fInvMass, ref.fInvMass, kNMomBins*kNDecays*sizeof(Double_t));
202 //Upper limit for distance of closest approach of two daughter tracks :
203 memcpy(fUpDCA, ref.fUpDCA, kNDecays*sizeof(Float_t));
204 memcpy(fUpPointingAngle, ref.fUpPointingAngle, kNDecays*sizeof(Float_t));
205 memcpy(fUpOpenAngle, ref.fUpOpenAngle, kNDecays*sizeof(Float_t));
206 memcpy(fDownOpenAngle, ref.fDownOpenAngle, kNDecays*sizeof(Float_t));
207 memcpy(fUpPsiPair, ref.fUpPsiPair, kNDecays*sizeof(Float_t));
208 memcpy(fDownPsiPair, ref.fDownPsiPair, kNDecays*sizeof(Float_t));
209 memcpy(fUpInvMass, ref.fUpInvMass, kNDecays*kNMomBins*sizeof(Double_t));
210 memcpy(fDownInvMass, ref.fDownInvMass, kNDecays*sizeof(Double_t));
211 memcpy(fUpRadius, ref.fUpRadius, kNDecays*sizeof(Float_t));
212 memcpy(fDownRadius, ref.fDownRadius, kNDecays*sizeof(Float_t));
213 memcpy(fDownTPCPIDneg, ref.fDownTPCPIDneg, AliPID::kSPECIES*sizeof(Float_t));
214 memcpy(fDownTPCPIDpos, ref.fDownTPCPIDpos, AliPID::kSPECIES*sizeof(Float_t));
215 memcpy(fDownComPIDneg, ref.fDownComPIDneg, AliPID::kSPECIES*sizeof(Float_t));
216 memcpy(fDownComPIDpos, ref.fDownComPIDpos, AliPID::kSPECIES*sizeof(Float_t));
217 memcpy(fDownComPIDnegPart, ref.fDownComPIDnegPart, AliPID::kSPECIES*sizeof(Float_t));
218 memcpy(fDownComPIDposPart, ref.fDownComPIDposPart, AliPID::kSPECIES*sizeof(Float_t));
221 //_________________________________________________
222 void AliTRDv0Info::SetV0Info(AliESDv0 *esdv0)
223 {//Gets values of ESDv0 and daughter track properties
224 //See header file for description of variables
226 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)
228 fRadius = Radius(esdv0);//distance from secondary vertex to primary vertex in x-y plane
230 fDCA = esdv0->GetDcaV0Daughters();//distance of closest approach of two daughter tracks
232 fPointingAngle = TMath::ACos(esdv0->GetV0CosineOfPointingAngle());// pointing angle (= angle between between vector from primary to secondary vertex and reconstructed momentum of V0 mother particle)
234 fOpenAngle = OpenAngle(esdv0);//Opening angle between two daughter tracks
236 fPsiPair = PsiPair(esdv0);//Angle between daughter momentum plane and plane perpendicular to magnetic field
238 fV0Momentum = V0Momentum(esdv0);//Reconstructed momentum of the mother particle
240 //4 decay types : conversions, K0s, Lambda, Anti-Lambda
241 //five particle types: electrons, muons, pions, kaons, protons (muons and kaons not involved)
242 for(Int_t idecay(0), part1(-1), part2(-1); idecay < kNDecays; idecay++){
243 if(idecay == kLambda){ //protons and pions from Lambda
244 part1 = AliPID::kProton;
245 part2 = AliPID::kPion;
246 } else if(idecay == kAntiLambda) { //antiprotons and pions from Anti-Lambda
247 part1 = AliPID::kPion;
248 part2 = AliPID::kProton;
249 } else if(idecay == kK0s) {//pions from K0s
250 part1 = part2 = AliPID::kPion;
251 } else if(idecay == kGamma) {//electrons from conversions
252 part1 = part2 = AliPID::kElectron;
254 fInvMass[idecay] = InvMass(part1, part2, esdv0);//Calculate invariant mass for all of our four supposed decays
256 //Gets all likelihood values from TPC, TOF and ITS PID for the fDetPID[kNDaughters][kNDetectors][AliPID::kSPECIES] array
258 //Bayesian combination of likelihoods from TPC and TOF
261 //_________________________________________________
262 Float_t AliTRDv0Info::V0Momentum(AliESDv0 *esdv0) const
265 // Reconstructed momentum of V0 mother particle
268 Double_t mn[3] = {0,0,0};
269 Double_t mp[3] = {0,0,0};
272 esdv0->GetNPxPyPz(mn[0],mn[1],mn[2]);//reconstructed cartesian momentum components of negative daughter;
273 esdv0->GetPPxPyPz(mp[0],mp[1],mp[2]);//reconstructed cartesian momentum components of positive daughter;
276 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]));
279 //_________________________________________________
280 Double_t AliTRDv0Info::InvMass(Int_t part1, Int_t part2, AliESDv0 *esdv0) const
283 // Invariant mass of reconstructed V0 mother
286 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)};
287 //Masses of electrons, muons, pions, kaons and protons, as implemented in ROOT
290 Double_t mn[3] = {0,0,0};
291 Double_t mp[3] = {0,0,0};
293 esdv0->GetNPxPyPz(mn[0],mn[1],mn[2]);//reconstructed cartesian momentum components of negative daughter;
294 esdv0->GetPPxPyPz(mp[0],mp[1],mp[2]);//reconstructed cartesian momentum components of positive daughter;
296 Double_t mass1 = kpmass[part1];//sets supposed rest masses for both daughters
297 Double_t mass2 = kpmass[part2];
299 //Calculate daughters' energies :
300 Double_t e1 = TMath::Sqrt(mass1*mass1+
304 Double_t e2 = TMath::Sqrt(mass2*mass2+
309 //Sum of daughter momenta :
311 (mn[0]+mp[0])*(mn[0]+mp[0])+
312 (mn[1]+mp[1])*(mn[1]+mp[1])+
313 (mn[2]+mp[2])*(mn[2]+mp[2]);
316 Double_t mInv = TMath::Sqrt((e1+e2)*(e1+e2)-momsum);
321 //_________________________________________________
322 Float_t AliTRDv0Info::OpenAngle(AliESDv0 *esdv0)
323 {//Opening angle between two daughter tracks
324 Double_t mn[3] = {0,0,0};
325 Double_t mp[3] = {0,0,0};
328 esdv0->GetNPxPyPz(mn[0],mn[1],mn[2]);//reconstructed cartesian momentum components of negative daughter;
329 esdv0->GetPPxPyPz(mp[0],mp[1],mp[2]);//reconstructed cartesian momentum components of positive daughter;
332 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])));
337 //_________________________________________________
338 Float_t AliTRDv0Info::PsiPair(AliESDv0 *esdv0)
339 {//Angle between daughter momentum plane and plane perpendicular to magnetic field
341 esdv0->GetXYZ(x,y,z);//Reconstructed coordinates of V0; to be replaced by Markus Rammler's method in case of conversions!
343 Double_t mn[3] = {0,0,0};
344 Double_t mp[3] = {0,0,0};
347 esdv0->GetNPxPyPz(mn[0],mn[1],mn[2]);//reconstructed cartesian momentum components of negative daughter;
348 esdv0->GetPPxPyPz(mp[0],mp[1],mp[2]);//reconstructed cartesian momentum components of positive daughter;
351 Double_t deltat = 1.;
352 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
354 Double_t radiussum = TMath::Sqrt(x*x + y*y) + 50;//radius to which tracks shall be propagated
356 Double_t momPosProp[3];
357 Double_t momNegProp[3];
359 AliExternalTrackParam nt(*fTrackN), pt(*fTrackP);
363 if(nt.PropagateTo(radiussum,fMagField) == 0)//propagate tracks to the outside
365 if(pt.PropagateTo(radiussum,fMagField) == 0)
367 pt.GetPxPyPz(momPosProp);//Get momentum vectors of tracks after propagation
368 nt.GetPxPyPz(momNegProp);
371 TMath::Sqrt(momNegProp[0]*momNegProp[0]+momNegProp[1]*momNegProp[1]+momNegProp[2]*momNegProp[2]);//absolute momentum value of negative daughter
373 TMath::Sqrt(momPosProp[0]*momPosProp[0]+momPosProp[1]*momPosProp[1]+momPosProp[2]*momPosProp[2]);//absolute momentum value of positive daughter
375 Double_t scalarproduct =
376 momPosProp[0]*momNegProp[0]+momPosProp[1]*momNegProp[1]+momPosProp[2]*momNegProp[2];//scalar product of propagated positive and negative daughters' momenta
378 Double_t chipair = TMath::ACos(scalarproduct/(pEle*pPos));//Angle between propagated daughter tracks
380 fPsiPair = TMath::Abs(TMath::ASin(deltat/chipair));
386 //_________________________________________________
387 Int_t AliTRDv0Info::HasTrack(AliTRDtrackInfo * const track)
389 //Checks if track is a secondary vertex daughter (due to V0 finder)
391 Int_t trackID(track->GetTrackId());//index of the track
392 return HasTrack(trackID);
395 //_________________________________________________
396 Int_t AliTRDv0Info::HasTrack(Int_t trackID)
398 //comparing index of track with indices of pos./neg. V0 daughter :
399 if(fNindex==trackID) return -1;
400 else if(fPindex==trackID) return 1;
404 //_________________________________________________
405 void AliTRDv0Info::GetDetectorPID()
406 {//PID likelihoods from TPC, TOF, and ITS, for all particle species
408 fTrackN->GetTPCpid(fDetPID[kNeg][kTPC]);
409 fTrackP->GetTPCpid(fDetPID[kPos][kTPC]);
410 fTrackN->GetTOFpid(fDetPID[kNeg][kTOF]);
411 fTrackP->GetTOFpid(fDetPID[kPos][kTOF]);
412 fTrackN->GetITSpid(fDetPID[kNeg][kITS]);
413 fTrackP->GetITSpid(fDetPID[kPos][kITS]);
415 Long_t statusN = fTrackN->GetStatus();
416 Long_t statusP = fTrackP->GetStatus();
418 if(!(statusN & AliESDtrack::kTPCpid)){
419 for(Int_t iPart = 0; iPart < AliPID::kSPECIES; iPart++){
420 fDetPID[kNeg][kTPC][iPart] = 0.2;
423 if(!(statusN & AliESDtrack::kTOFpid)){
424 for(Int_t iPart = 0; iPart < AliPID::kSPECIES; iPart++){
425 fDetPID[kNeg][kTOF][iPart] = 0.2;
429 if(!(statusN & AliESDtrack::kITSpid)){
430 for(Int_t iPart = 0; iPart < AliPID::kSPECIES; iPart++){
431 fDetPID[kNeg][kITS][iPart] = 0.2;
434 if(!(statusP & AliESDtrack::kTPCpid)){
435 for(Int_t iPart = 0; iPart < AliPID::kSPECIES; iPart++){
436 fDetPID[kPos][kTPC][iPart] = 0.2;
439 if(!(statusP & AliESDtrack::kTOFpid)){
440 for(Int_t iPart = 0; iPart < AliPID::kSPECIES; iPart++){
441 fDetPID[kPos][kTOF][iPart] = 0.2;
445 if(!(statusP & AliESDtrack::kITSpid)){
446 for(Int_t iPart = 0; iPart < AliPID::kSPECIES; iPart++){
447 fDetPID[kPos][kITS][iPart] = 0.2;
452 //____________________________________________________________________________________
453 void AliTRDv0Info::CombinePID()
455 Double_t partrat[AliPID::kSPECIES] = {0.208, 0.010, 0.662, 0.019, 0.101};
457 for(Int_t iSign = 0; iSign < kNDaughters; iSign++)
459 for(Int_t iPart = 0; iPart < AliPID::kSPECIES; iPart++)
461 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]));
466 //_________________________________________________
467 Float_t AliTRDv0Info::Radius(AliESDv0 *esdv0)
468 {//distance from secondary vertex to primary vertex in x-y plane
470 esdv0->GetXYZ(x,y,z); //Reconstructed coordinates of V0; to be replaced by Markus Rammler's method in case of conversions!
471 fRadius = TMath::Sqrt(x*x + y*y);
476 //_________________________________________________
477 Int_t AliTRDv0Info::Quality(AliESDv0 *const esdv0)
480 // Checking track and V0 quality status in order to exclude vertices based on poor information
484 nClsN = fTrackN->GetTPCNcls();//number of found clusters in TPC for negative track
486 nClsFN = fTrackN->GetTPCNclsF();//number of findable clusters in TPC for negative track
488 nClsP = fTrackP->GetTPCNcls();//number of found clusters in TPC for positive track
490 nClsFP = fTrackP->GetTPCNclsF();//number of findable clusters in TPC for positive track
498 if((nClsFN == 0) || (nClsFP == 0)) return -2;
500 clsRatioN = nClsN/nClsFN; //ratios of found to findable clusters in TPC
501 clsRatioP = nClsP/nClsFP;
503 if (!(esdv0->GetOnFlyStatus()))//accept only vertices from online V0 finder
505 if (!((fTrackP->GetStatus() &
506 AliESDtrack::kTPCrefit)))//accept only vertices in which both tracks have TPC refit
508 if (!((fTrackN->GetStatus() &
509 AliESDtrack::kTPCrefit)))
511 if (fTrackP->GetKinkIndex(0)>0 ||
512 fTrackN->GetKinkIndex(0)>0 )//exclude tracks with kinks
514 if((clsRatioN < 0.6)||(clsRatioP < 0.6))//exclude tracks with low ratio of found to findable TPC clusters
519 //_________________________________________________
520 Int_t AliTRDv0Info::GetPID(Int_t ipart, AliTRDtrackInfo *track)
522 // Decides if track is accepted for one of the reference data samples
525 AliError("No track info");
528 if(!HasTrack(track)){
529 AliDebug(2, "Track not attached to v0.");
533 //translate ipart to decay (Anti-Lambda will be treated separately)
536 case AliPID::kElectron: iDecay = kGamma; break;
537 case AliPID::kPion: iDecay = kK0s; break;
538 case AliPID::kProton: iDecay = kLambda; break;
540 AliWarning(Form("Hypothesis \"ipart=%d\" not handled", ipart));
544 //... it fulfills our quality criteria
545 if(!(fQuality == 1)) return 0;
546 //... distance of closest approach between daughters is reasonably small
547 if((fDCA > fUpDCA[iDecay])) return 0;
548 //... pointing angle between momentum of mother particle and vector from prim. to sec. vertex is small
549 if((fPointingAngle > fUpPointingAngle[iDecay])) return 0;
550 //... x-y plane distance of decay point to prim. vertex is bigger than a certain minimum value (for conversions)
551 if((fRadius < fDownRadius[iDecay])) return 0;
552 //...or smaller than a maximum value (for K0s)
553 if((fRadius > fUpRadius[iDecay])) return 0;
554 //... opening angle is close enough to zero (for conversions)
555 if((fOpenAngle > fUpOpenAngle[iDecay])) return 0;
556 //... Psi-pair angle is close enough to zero(for conversions)
557 if((TMath::Abs(fPsiPair) > fUpPsiPair[iDecay])) return 0;
560 //Mother momentum slots above/below 2.5 GeV
561 Int_t iPSlot(fV0Momentum > 2.5);
562 Int_t trackID(track->GetTrackId());
564 //specific cut criteria :
565 if(ipart == AliPID::kProton) {
566 if((fInvMass[kK0s] < fUpInvMass[kK0s][iPSlot]) && (fInvMass[kK0s] > fDownInvMass[kK0s])) return 0;//explicit exclusion of K0s decays
568 //for proton sample: separate treatment of Lamba and Anti-Lambda decays:
570 //Combined PID likelihoods high enough for pi+ and anti-proton ; invariant mass calculated postulating these two particle species...
571 if((fComPID[kNeg][AliPID::kProton] > fDownComPIDneg[AliPID::kProton]) && (fComPID[kPos][AliPID::kPion] > fDownComPIDposPart[AliPID::kPion])) {
572 if(fNindex == trackID) {
573 if((fInvMass[kAntiLambda] < fUpInvMass[kAntiLambda][iPSlot]) && (fInvMass[kAntiLambda] > fDownInvMass[kAntiLambda])) return 1;
577 //TPC PID likelihoods high enough for pi- and proton ; invariant mass calculated accordingly
578 if((fComPID[kNeg][AliPID::kPion] > fDownComPIDnegPart[AliPID::kPion]) && (fComPID[kPos][AliPID::kProton] > fDownComPIDpos[AliPID::kProton])) {
579 if(fPindex == trackID) {
580 if((fInvMass[kLambda] < fUpInvMass[kLambda][iPSlot]) && (fInvMass[kLambda] > fDownInvMass[kLambda])) return 1;
585 //Invariant mass cut for K0s and photons, assuming two pions/two electrons as daughters:
586 if((fInvMass[iDecay] > fUpInvMass[iDecay][iPSlot]) || (fInvMass[iDecay] < fDownInvMass[iDecay])) return 0;
588 //for K0s decays: equal TPC PID likelihood criteria for both daughters ; invariant mass calculated postulating two pions
589 if(ipart == AliPID::kPion) {
590 //explicit exclusion of Lambda decays
591 if((fInvMass[kLambda] < fUpInvMass[kLambda][iPSlot]) && (fInvMass[kLambda] > fDownInvMass[kLambda])) return 0;
592 //explicit exclusion of Anti-Lambda decays
593 if((fInvMass[kAntiLambda] < fUpInvMass[kAntiLambda][iPSlot]) && (fInvMass[kAntiLambda] > fDownInvMass[kAntiLambda])) return 0;
595 if((fDetPID[kNeg][kTPC][ipart] > fDownTPCPIDneg[ipart]) && (fDetPID[kPos][kTPC][ipart] > fDownTPCPIDpos[ipart])) return 1;
598 //for photon conversions: equal combined PID likelihood criteria for both daughters ; invariant mass calculated postulating two electrons
599 //No Lambda/K0s exclusion is provided, since these contributions hardly ever interfere with gamma invariant mass!
600 Float_t momentum(track->GetESDinfo()->GetOuterParam()->P());
601 if(ipart == AliPID::kElectron) {
602 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
603 if((fDetPID[kNeg][kTPC][ipart] > fDownTPCPIDneg[ipart]) && (fDetPID[kPos][kTPC][ipart] > fDownTPCPIDpos[ipart])) return 1;
604 } else {//for low momenta, combined PID from TOF and TPC is used to get rid of proton contamination
605 if((fComPID[kNeg][ipart] > fDownComPIDneg[ipart]) && (fComPID[kPos][ipart] > fDownComPIDpos[ipart])) return 1;
612 //_________________________________________________
613 void AliTRDv0Info::Print(Option_t *opt) const
615 printf("V0 P[%d] N[%d]\n", fPindex, fNindex);
616 printf(" DCA[%5.3f] Radius[%5.3f]\n", fDCA, fRadius);
617 printf(" Angles : Pointing[%5.3f] Open[%5.3f] Psi[%5.3f]\n", fPointingAngle, fOpenAngle, fPsiPair);
618 if(strcmp(opt, "a")!=0) return;
619 printf(" Reconstructed PID\n"
620 " sgn spec ITS TPC TOF COM\n");
621 for(Int_t idt=0; idt<kNDaughters; idt++){
622 printf(" %c", idt?'-':'+');
623 for(Int_t is(0); is<AliPID::kSPECIES; is++){
624 printf("%s%s%s", is==0?" ":" ", AliPID::ParticleShortName(is), (is==1||is==2)?" ":" ");
625 for(Int_t id(0); id<kNDetectors; id++){
626 printf("%5.1f ", 1.e2*fDetPID[idt][id][is]);
628 printf("%5.1f\n", 1.e2*fComPID[idt][is]);
633 //_________________________________________________
634 void AliTRDv0Info::SetV0tracks(AliESDtrack *p, AliESDtrack *n)
636 fTrackP = p; fPindex = p->GetID();
637 fTrackN = n; fNindex = n->GetID();