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 "AliITSPIDResponse.h"
26 #include "AliITSPidParams.h"
27 #include "AliExternalTrackParam.h"
29 ClassImp(AliITSPIDResponse)
31 AliITSPIDResponse::AliITSPIDResponse(Bool_t isMC):
50 fBBsaElectron[0]=4.05799E6;
51 fBBsaElectron[1]=38.5713;
52 fBBsaElectron[2]=1.46462E-7;
53 fBBsaElectron[3]=1.46462E-7;
54 fBBsaElectron[4]=4.40284E-7;
55 fResolSA[0]=1.; // 0 cluster tracks should not be used
56 fResolSA[1]=0.25; // rough values for tracks with 1
57 fResolSA[2]=0.131; // value from pp 2010 run (L. Milano, 16-Jun-11)
58 fResolSA[3]=0.113; // value from pp 2010 run
59 fResolSA[4]=0.104; // value from pp 2010 run
60 for(Int_t i=0; i<5;i++) fResolTPCITS[i]=0.13;
72 fBBsaElectron[0]=2.26807E6;
73 fBBsaElectron[1]=99.985;
74 fBBsaElectron[2]=0.000714841;
75 fBBsaElectron[3]=0.000259585;
76 fBBsaElectron[4]=1.39412E-7;
77 fResolSA[0]=1.; // 0 cluster tracks should not be used
78 fResolSA[1]=0.25; // rough values for tracks with 1
79 fResolSA[2]=0.126; // value from pp 2010 simulations (L. Milano, 16-Jun-11)
80 fResolSA[3]=0.109; // value from pp 2010 simulations
81 fResolSA[4]=0.097; // value from pp 2010 simulations
82 for(Int_t i=0; i<5;i++) fResolTPCITS[i]=0.13;
87 //_________________________________________________________________________
88 AliITSPIDResponse::AliITSPIDResponse(Double_t *param):
97 // The main constructor
99 for (Int_t i=0; i<5;i++) {
108 //_________________________________________________________________________
109 Double_t AliITSPIDResponse::BetheAleph(Double_t p, Double_t mass) const {
111 // returns AliExternalTrackParam::BetheBloch normalized to
112 // fgMIP at the minimum
116 AliExternalTrackParam::BetheBlochAleph(p/mass,fKp1,fKp2,fKp3,fKp4,fKp5);
120 //_________________________________________________________________________
121 Double_t AliITSPIDResponse::Bethe(Double_t p, Double_t mass, Bool_t isSA) const {
123 // returns AliExternalTrackParam::BetheBloch normalized to
124 // fgMIP at the minimum
128 Double_t beta = bg/TMath::Sqrt(1.+ bg*bg);
129 Double_t gamma=bg/beta;
132 if(mass>0.0005 && mass<0.00052){
133 //if is an electron use a specific BB parameterization
134 //To be used only between 100 and 160 MeV/c
135 for(Int_t ip=0; ip<5;ip++) par[ip]=fBBsaElectron[ip];
137 for(Int_t ip=0; ip<5;ip++) par[ip]=fBBsa[ip];
140 for(Int_t ip=0; ip<5;ip++) par[ip]=fBBtpcits[ip];
144 eff=(bg-par[3])*(bg-par[3])+par[4];
146 eff=(par[2]-par[3])*(par[2]-par[3])+par[4];
149 if(gamma>=0. && beta>0.){
150 bb=(par[1]+2.0*TMath::Log(gamma)-beta*beta)*(par[0]/(beta*beta))*eff;
155 //_________________________________________________________________________
156 Double_t AliITSPIDResponse::GetResolution(Double_t bethe,
160 // Calculate expected resolution for truncated mean
163 if(isSA) r=fResolSA[nPtsForPid];
164 else r=fResolTPCITS[nPtsForPid];
171 //_________________________________________________________________________
172 void AliITSPIDResponse::GetITSProbabilities(Float_t mom, Double_t qclu[4], Double_t condprobfun[AliPID::kSPECIES], Bool_t isMC) const {
174 // Method to calculate PID probabilities for a single track
175 // using the likelihood method
177 const Int_t nLay = 4;
178 const Int_t nPart = 3;
180 static AliITSPidParams pars(isMC); // Pid parametrisation parameters
182 Double_t itsProb[nPart] = {1,1,1}; // p, K, pi
184 for (Int_t iLay = 0; iLay < nLay; iLay++) {
188 Float_t dedx = qclu[iLay];
189 Float_t layProb = pars.GetLandauGausNorm(dedx,AliPID::kProton,mom,iLay+3);
190 itsProb[0] *= layProb;
192 layProb = pars.GetLandauGausNorm(dedx,AliPID::kKaon,mom,iLay+3);
193 if (mom < 0.16) layProb=0.00001;
194 itsProb[1] *= layProb;
196 layProb = pars.GetLandauGausNorm(dedx,AliPID::kPion,mom,iLay+3);
197 itsProb[2] *= layProb;
200 // Normalise probabilities
201 Double_t sumProb = 0;
202 for (Int_t iPart = 0; iPart < nPart; iPart++) {
203 sumProb += itsProb[iPart];
205 sumProb += 2*itsProb[2]; // muon and electron cannot be distinguished from pions
207 for (Int_t iPart = 0; iPart < nPart; iPart++) {
208 itsProb[iPart]/=sumProb;
211 condprobfun[AliPID::kElectron] = itsProb[2];
212 condprobfun[AliPID::kMuon] = itsProb[2];
213 condprobfun[AliPID::kPion] = itsProb[2];
214 condprobfun[AliPID::kKaon] = itsProb[1];
215 condprobfun[AliPID::kProton] = itsProb[0];
219 //_________________________________________________________________________
220 Int_t AliITSPIDResponse::GetParticleIdFromdEdxVsP(Float_t mom, Float_t signal, Bool_t isSA) const{
221 // method to get particle identity with simple cuts on dE/dx vs. momentum
223 Double_t massp=AliPID::ParticleMass(AliPID::kProton);
224 Double_t massk=AliPID::ParticleMass(AliPID::kKaon);
225 Double_t bethep=Bethe(mom,massp,isSA);
226 Double_t bethek=Bethe(mom,massk,isSA);
227 if(signal>(0.5*(bethep+bethek))) return AliPID::kProton;
228 Double_t masspi=AliPID::ParticleMass(AliPID::kPion);
229 Double_t bethepi=Bethe(mom,masspi,isSA);
230 if(signal>(0.5*(bethepi+bethek))) return AliPID::kKaon;
231 return AliPID::kPion;