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 fResolSA[0]=1.; // 0 cluster tracks should not be used
51 fResolSA[1]=0.25; // rough values for tracks with 1 or 2
52 fResolSA[2]=0.2; // clusters (not to be used)
53 fResolSA[3]=0.116; // value from pp 2010 run (L. Milano, 18-Jan-11)
54 fResolSA[4]=0.104; // value from pp 2010 run
55 for(Int_t i=0; i<5;i++) fResolTPCITS[i]=0.13;
67 fResolSA[0]=1.; // 0 cluster tracks should not be used
68 fResolSA[1]=0.25; // rough values for tracks with 1 or 2
69 fResolSA[2]=0.2; // clusters (not to be used)
70 fResolSA[3]=0.110; // value from pp 2010 simulations (L. Milano, 18-Jan-11)
71 fResolSA[4]=0.096; // value from pp 2010 simulations
72 for(Int_t i=0; i<5;i++) fResolTPCITS[i]=0.13;
76 //_________________________________________________________________________
77 AliITSPIDResponse::AliITSPIDResponse(Double_t *param):
86 // The main constructor
88 for (Int_t i=0; i<5;i++) {
97 //_________________________________________________________________________
98 Double_t AliITSPIDResponse::BetheAleph(Double_t p, Double_t mass) const {
100 // returns AliExternalTrackParam::BetheBloch normalized to
101 // fgMIP at the minimum
105 AliExternalTrackParam::BetheBlochAleph(p/mass,fKp1,fKp2,fKp3,fKp4,fKp5);
109 //_________________________________________________________________________
110 Double_t AliITSPIDResponse::Bethe(Double_t p, Double_t mass, Bool_t isSA) const {
112 // returns AliExternalTrackParam::BetheBloch normalized to
113 // fgMIP at the minimum
117 Double_t beta = bg/TMath::Sqrt(1.+ bg*bg);
118 Double_t gamma=bg/beta;
121 for(Int_t ip=0; ip<5;ip++) par[ip]=fBBsa[ip];
123 for(Int_t ip=0; ip<5;ip++) par[ip]=fBBtpcits[ip];
127 eff=(bg-par[3])*(bg-par[3])+par[4];
129 eff=(par[2]-par[3])*(par[2]-par[3])+par[4];
132 if(gamma>=0. && beta>0.){
133 bb=(par[1]+2.0*TMath::Log(gamma)-beta*beta)*(par[0]/(beta*beta))*eff;
138 //_________________________________________________________________________
139 Double_t AliITSPIDResponse::GetResolution(Double_t bethe,
143 // Calculate expected resolution for truncated mean
146 if(isSA) r=fResolSA[nPtsForPid];
147 else r=fResolTPCITS[nPtsForPid];
154 //_________________________________________________________________________
155 void AliITSPIDResponse::GetITSProbabilities(Float_t mom, Double_t qclu[4], Double_t condprobfun[AliPID::kSPECIES]) const {
157 // Method to calculate PID probabilities for a single track
158 // using the likelihood method
160 const Int_t nLay = 4;
161 const Int_t nPart = 3;
163 static AliITSPidParams pars; // Pid parametrisation parameters
165 Double_t itsProb[nPart] = {1,1,1}; // p, K, pi
167 for (Int_t iLay = 0; iLay < nLay; iLay++) {
171 Float_t dedx = qclu[iLay];
172 Float_t layProb = pars.GetLandauGausNorm(dedx,AliPID::kProton,mom,iLay+3);
173 itsProb[0] *= layProb;
175 layProb = pars.GetLandauGausNorm(dedx,AliPID::kKaon,mom,iLay+3);
176 if (mom < 0.16) layProb=0.00001;
177 itsProb[1] *= layProb;
179 layProb = pars.GetLandauGausNorm(dedx,AliPID::kPion,mom,iLay+3);
180 itsProb[2] *= layProb;
183 // Normalise probabilities
184 Double_t sumProb = 0;
185 for (Int_t iPart = 0; iPart < nPart; iPart++) {
186 sumProb += itsProb[iPart];
188 sumProb += 2*itsProb[2]; // muon and electron cannot be distinguished from pions
190 for (Int_t iPart = 0; iPart < nPart; iPart++) {
191 itsProb[iPart]/=sumProb;
194 condprobfun[AliPID::kElectron] = itsProb[2];
195 condprobfun[AliPID::kMuon] = itsProb[2];
196 condprobfun[AliPID::kPion] = itsProb[2];
197 condprobfun[AliPID::kKaon] = itsProb[1];
198 condprobfun[AliPID::kProton] = itsProb[0];
202 //_________________________________________________________________________
203 Int_t AliITSPIDResponse::GetParticleIdFromdEdxVsP(Float_t mom, Float_t signal, Bool_t isSA) const{
204 // method to get particle identity with simple cuts on dE/dx vs. momentum
206 Double_t massp=AliPID::ParticleMass(AliPID::kProton);
207 Double_t massk=AliPID::ParticleMass(AliPID::kKaon);
208 Double_t bethep=Bethe(mom,massp,isSA);
209 Double_t bethek=Bethe(mom,massk,isSA);
210 if(signal>(0.5*(bethep+bethek))) return AliPID::kProton;
211 Double_t masspi=AliPID::ParticleMass(AliPID::kPion);
212 Double_t bethepi=Bethe(mom,masspi,isSA);
213 if(signal>(0.5*(bethepi+bethek))) return AliPID::kKaon;
214 return AliPID::kPion;