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
91 //_________________________________________________________________________
92 Double_t AliITSPIDResponse::BetheAleph(Double_t p, Double_t mass) const {
94 // returns AliExternalTrackParam::BetheBloch normalized to
95 // fgMIP at the minimum
99 AliExternalTrackParam::BetheBlochAleph(p/mass,fKp1,fKp2,fKp3,fKp4,fKp5);
103 //_________________________________________________________________________
104 Double_t AliITSPIDResponse::Bethe(Double_t p, Double_t mass, Bool_t isSA) const {
106 // returns AliExternalTrackParam::BetheBloch normalized to
107 // fgMIP at the minimum
111 Double_t beta = bg/TMath::Sqrt(1.+ bg*bg);
112 Double_t gamma=bg/beta;
115 for(Int_t ip=0; ip<5;ip++) par[ip]=fBBsa[ip];
117 for(Int_t ip=0; ip<5;ip++) par[ip]=fBBtpcits[ip];
121 eff=(bg-par[3])*(bg-par[3])+par[4];
123 eff=(par[2]-par[3])*(par[2]-par[3])+par[4];
126 if(gamma>=0. && beta>0.){
127 bb=(par[1]+2.0*TMath::Log(gamma)-beta*beta)*(par[0]/(beta*beta))*eff;
132 //_________________________________________________________________________
133 Double_t AliITSPIDResponse::GetResolution(Double_t bethe,
137 // Calculate expected resolution for truncated mean
140 if(isSA) r=fResolSA[nPtsForPid];
141 else r=fResolTPCITS[nPtsForPid];
148 //_________________________________________________________________________
149 void AliITSPIDResponse::GetITSProbabilities(Float_t mom, Double_t qclu[4], Double_t condprobfun[AliPID::kSPECIES]) const {
151 // Method to calculate PID probabilities for a single track
152 // using the likelihood method
154 const Int_t nLay = 4;
155 const Int_t nPart = 3;
157 static AliITSPidParams pars; // Pid parametrisation parameters
159 Double_t itsProb[nPart] = {1,1,1}; // p, K, pi
161 for (Int_t iLay = 0; iLay < nLay; iLay++) {
165 Float_t dedx = qclu[iLay];
166 Float_t layProb = pars.GetLandauGausNorm(dedx,AliPID::kProton,mom,iLay+3);
167 itsProb[0] *= layProb;
169 layProb = pars.GetLandauGausNorm(dedx,AliPID::kKaon,mom,iLay+3);
170 if (mom < 0.16) layProb=0.00001;
171 itsProb[1] *= layProb;
173 layProb = pars.GetLandauGausNorm(dedx,AliPID::kPion,mom,iLay+3);
174 itsProb[2] *= layProb;
177 // Normalise probabilities
178 Double_t sumProb = 0;
179 for (Int_t iPart = 0; iPart < nPart; iPart++) {
180 sumProb += itsProb[iPart];
182 sumProb += 2*itsProb[2]; // muon and electron cannot be distinguished from pions
184 for (Int_t iPart = 0; iPart < nPart; iPart++) {
185 itsProb[iPart]/=sumProb;
188 condprobfun[AliPID::kElectron] = itsProb[2];
189 condprobfun[AliPID::kMuon] = itsProb[2];
190 condprobfun[AliPID::kPion] = itsProb[2];
191 condprobfun[AliPID::kKaon] = itsProb[1];
192 condprobfun[AliPID::kProton] = itsProb[0];
196 //_________________________________________________________________________
197 Int_t AliITSPIDResponse::GetParticleIdFromdEdxVsP(Float_t mom, Float_t signal, Bool_t isSA) const{
198 // method to get particle identity with simple cuts on dE/dx vs. momentum
200 Double_t massp=AliPID::ParticleMass(AliPID::kProton);
201 Double_t massk=AliPID::ParticleMass(AliPID::kKaon);
202 Double_t bethep=Bethe(mom,massp,isSA);
203 Double_t bethek=Bethe(mom,massk,isSA);
204 if(signal>(0.5*(bethep+bethek))) return AliPID::kProton;
205 Double_t masspi=AliPID::ParticleMass(AliPID::kPion);
206 Double_t bethepi=Bethe(mom,masspi,isSA);
207 if(signal>(0.5*(bethepi+bethek))) return AliPID::kKaon;
208 return AliPID::kPion;