1 /**************************************************************************
2 * Copyright(c) 2005-2007, 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 **************************************************************************/
18 //-----------------------------------------------------------------
20 // Implementation of the ITS PID class
21 // Very naive one... Should be made better by the detector experts...
22 // Origin: Iouri Belikov, CERN, Jouri.Belikov@cern.ch
23 //-----------------------------------------------------------------
25 #include "AliVTrack.h"
26 #include "AliITSPIDResponse.h"
27 #include "AliITSPidParams.h"
28 #include "AliExternalTrackParam.h"
30 ClassImp(AliITSPIDResponse)
32 AliITSPIDResponse::AliITSPIDResponse(Bool_t isMC):
46 fBBsa[0]=2.73198E7; //pure PHOBOS parameterization
51 fBBsaHybrid[0]=1.43505E7; //PHOBOS+Polinomial parameterization
52 fBBsaHybrid[1]=49.3402;
53 fBBsaHybrid[2]=1.77741E-7;
54 fBBsaHybrid[3]=1.77741E-7;
55 fBBsaHybrid[4]=1.01311E-7;
56 fBBsaHybrid[5]=77.2777;
57 fBBsaHybrid[6]=33.4099;
58 fBBsaHybrid[7]=46.0089;
59 fBBsaHybrid[8]=-2.26583;
60 fBBsaElectron[0]=4.05799E6; //electrons in the ITS
61 fBBsaElectron[1]=38.5713;
62 fBBsaElectron[2]=1.46462E-7;
63 fBBsaElectron[3]=1.46462E-7;
64 fBBsaElectron[4]=4.40284E-7;
65 fResolSA[0]=1.; // 0 cluster tracks should not be used
66 fResolSA[1]=0.25; // rough values for tracks with 1
67 fResolSA[2]=0.131; // value from pp 2010 run (L. Milano, 16-Jun-11)
68 fResolSA[3]=0.113; // value from pp 2010 run
69 fResolSA[4]=0.104; // value from pp 2010 run
70 for(Int_t i=0; i<5;i++) fResolTPCITS[i]=0.13;
77 fBBsa[0]=2.02078E7; //pure PHOBOS parameterization
82 fBBsaHybrid[0]=1.05381E7; //PHOBOS+Polinomial parameterization
83 fBBsaHybrid[1]=89.3933;
84 fBBsaHybrid[2]=2.4831E-7;
85 fBBsaHybrid[3]=2.4831E-7;
86 fBBsaHybrid[4]=7.80591E-8;
87 fBBsaHybrid[5]=62.9214;
88 fBBsaHybrid[6]=32.347;
89 fBBsaHybrid[7]=58.7661;
90 fBBsaHybrid[8]=-3.39869;
91 fBBsaElectron[0]=2.26807E6; //electrons in the ITS
92 fBBsaElectron[1]=99.985;
93 fBBsaElectron[2]=0.000714841;
94 fBBsaElectron[3]=0.000259585;
95 fBBsaElectron[4]=1.39412E-7;
96 fResolSA[0]=1.; // 0 cluster tracks should not be used
97 fResolSA[1]=0.25; // rough values for tracks with 1
98 fResolSA[2]=0.126; // value from pp 2010 simulations (L. Milano, 16-Jun-11)
99 fResolSA[3]=0.109; // value from pp 2010 simulations
100 fResolSA[4]=0.097; // value from pp 2010 simulations
101 for(Int_t i=0; i<5;i++) fResolTPCITS[i]=0.13;
106 //_________________________________________________________________________
107 AliITSPIDResponse::AliITSPIDResponse(Double_t *param):
116 // The main constructor
118 for (Int_t i=0; i<5;i++) {
127 //_________________________________________________________________________
128 Double_t AliITSPIDResponse::BetheAleph(Double_t p, Double_t mass) const {
130 // returns AliExternalTrackParam::BetheBloch normalized to
131 // fgMIP at the minimum
135 AliExternalTrackParam::BetheBlochAleph(p/mass,fKp1,fKp2,fKp3,fKp4,fKp5);
139 //_________________________________________________________________________
140 Double_t AliITSPIDResponse::Bethe(Double_t p, Double_t mass, Bool_t isSA) const {
142 // returns AliExternalTrackParam::BetheBloch normalized to
143 // fgMIP at the minimum
147 Double_t beta = bg/TMath::Sqrt(1.+ bg*bg);
148 Double_t gamma=bg/beta;
153 if(mass>0.0005 && mass<0.00052){
154 //if is an electron use a specific BB parameterization
155 //To be used only between 100 and 160 MeV/c
156 for(Int_t ip=0; ip<5;ip++) par[ip]=fBBsaElectron[ip];
158 for(Int_t ip=0; ip<5;ip++) par[ip]=fBBsa[ip];
161 for(Int_t ip=0; ip<5;ip++) par[ip]=fBBtpcits[ip];
165 eff=(bg-par[3])*(bg-par[3])+par[4];
167 eff=(par[2]-par[3])*(par[2]-par[3])+par[4];
169 if(gamma>=0. && beta>0.){
170 bb=(par[1]+2.0*TMath::Log(gamma)-beta*beta)*(par[0]/(beta*beta))*eff;
175 //_________________________________________________________________________
176 Double_t AliITSPIDResponse::BetheITSsaHybrid(Double_t p, Double_t mass) const {
178 // returns AliExternalTrackParam::BetheBloch normalized to
179 // fgMIP at the minimum. The PHOBOS parameterization is used for beta*gamma>0.76.
180 // For beta*gamma<0.76 a polinomial function is used
183 Double_t beta = bg/TMath::Sqrt(1.+ bg*bg);
184 Double_t gamma=bg/beta;
188 //parameters for pi, K, p
189 for(Int_t ip=0; ip<9;ip++) par[ip]=fBBsaHybrid[ip];
190 //if it is an electron the PHOBOS part of the parameterization is tuned for e
191 //in the range used for identification beta*gamma is >0.76 for electrons
192 //To be used only between 100 and 160 MeV/c
193 if(mass>0.0005 && mass<0.00052)for(Int_t ip=0; ip<5;ip++) par[ip]=fBBsaElectron[ip];
195 if(gamma>=0. && beta>0. && bg>0.1){
199 eff=(bg-par[3])*(bg-par[3])+par[4];
201 eff=(par[2]-par[3])*(par[2]-par[3])+par[4];
203 bb=(par[1]+2.0*TMath::Log(gamma)-beta*beta)*(par[0]/(beta*beta))*eff;
205 bb=par[5] + par[6]/bg + par[7]/(bg*bg) + par[8]/(bg*bg*bg);
211 //_________________________________________________________________________
212 Double_t AliITSPIDResponse::GetResolution(Double_t bethe,
216 // Calculate expected resolution for truncated mean
219 if(isSA) r=fResolSA[nPtsForPid];
220 else r=fResolTPCITS[nPtsForPid];
227 //_________________________________________________________________________
228 void AliITSPIDResponse::GetITSProbabilities(Float_t mom, Double_t qclu[4], Double_t condprobfun[AliPID::kSPECIES], Bool_t isMC) const {
230 // Method to calculate PID probabilities for a single track
231 // using the likelihood method
233 const Int_t nLay = 4;
234 const Int_t nPart= 4;
236 static AliITSPidParams pars(isMC); // Pid parametrisation parameters
238 Double_t itsProb[nPart] = {1,1,1,1}; // e, p, K, pi
240 for (Int_t iLay = 0; iLay < nLay; iLay++) {
241 if (qclu[iLay] <= 50.)
244 Float_t dedx = qclu[iLay];
245 Float_t layProb = pars.GetLandauGausNorm(dedx,AliPID::kProton,mom,iLay+3);
246 itsProb[0] *= layProb;
248 layProb = pars.GetLandauGausNorm(dedx,AliPID::kKaon,mom,iLay+3);
249 itsProb[1] *= layProb;
251 layProb = pars.GetLandauGausNorm(dedx,AliPID::kPion,mom,iLay+3);
252 itsProb[2] *= layProb;
254 layProb = pars.GetLandauGausNorm(dedx,AliPID::kElectron,mom,iLay+3);
255 itsProb[3] *= layProb;
258 // Normalise probabilities
259 Double_t sumProb = 0;
260 for (Int_t iPart = 0; iPart < nPart; iPart++) {
261 sumProb += itsProb[iPart];
263 sumProb += itsProb[2]; // muon cannot be distinguished from pions
265 for (Int_t iPart = 0; iPart < nPart; iPart++) {
266 itsProb[iPart]/=sumProb;
268 condprobfun[AliPID::kElectron] = itsProb[3];
269 condprobfun[AliPID::kMuon] = itsProb[2];
270 condprobfun[AliPID::kPion] = itsProb[2];
271 condprobfun[AliPID::kKaon] = itsProb[1];
272 condprobfun[AliPID::kProton] = itsProb[0];
276 //_________________________________________________________________________
277 Double_t AliITSPIDResponse::GetNumberOfSigmas( const AliVTrack* track, AliPID::EParticleType type) const
282 UChar_t clumap=track->GetITSClusterMap();
283 Int_t nPointsForPid=0;
284 for(Int_t i=2; i<6; i++){
285 if(clumap&(1<<i)) ++nPointsForPid;
287 Float_t mom=track->P();
289 //check for ITS standalone tracks
291 if( track->GetStatus() & AliVTrack::kTPCin ) isSA=kFALSE;
293 const Float_t dEdx=track->GetITSsignal();
295 //TODO: in case of the electron, use the SA parametrisation,
296 // this needs to be changed if ITS provides a parametrisation
297 // for electrons also for ITS+TPC tracks
298 return GetNumberOfSigmas(mom,dEdx,type,nPointsForPid,isSA || (type==AliPID::kElectron));
301 //_________________________________________________________________________
302 Double_t AliITSPIDResponse::GetSignalDelta( const AliVTrack* track, AliPID::EParticleType type, Bool_t ratio/*=kFALSE*/) const
307 const Float_t mom=track->P();
308 const Double_t chargeFactor = TMath::Power(AliPID::ParticleCharge(type),2.);
310 if( track->GetStatus() & AliVTrack::kTPCin ) isSA=kFALSE;
312 const Float_t dEdx=track->GetITSsignal();
314 //TODO: in case of the electron, use the SA parametrisation,
315 // this needs to be changed if ITS provides a parametrisation
316 // for electrons also for ITS+TPC tracks
318 const Float_t bethe = Bethe(mom,AliPID::ParticleMassZ(type), isSA || (type==AliPID::kElectron))*chargeFactor;
320 Double_t delta=-9999.;
321 if (!ratio) delta=dEdx-bethe;
322 else if (bethe>1.e-20) delta=dEdx/bethe;
327 //_________________________________________________________________________
328 Int_t AliITSPIDResponse::GetParticleIdFromdEdxVsP(Float_t mom, Float_t signal, Bool_t isSA) const{
329 // method to get particle identity with simple cuts on dE/dx vs. momentum
331 Double_t massp=AliPID::ParticleMass(AliPID::kProton);
332 Double_t massk=AliPID::ParticleMass(AliPID::kKaon);
333 Double_t bethep=Bethe(mom,massp,isSA);
334 Double_t bethek=Bethe(mom,massk,isSA);
335 if(signal>(0.5*(bethep+bethek))) return AliPID::kProton;
336 Double_t masspi=AliPID::ParticleMass(AliPID::kPion);
337 Double_t bethepi=Bethe(mom,masspi,isSA);
338 if(signal>(0.5*(bethepi+bethek))) return AliPID::kKaon;
339 return AliPID::kPion;