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 for(Int_t i=0; i<5;i++) fResolSA[i]=0.15;
51 for(Int_t i=0; i<5;i++) fResolTPCITS[i]=0.13;
63 for(Int_t i=0; i<5;i++) fResolSA[i]=0.15;
64 for(Int_t i=0; i<5;i++) fResolTPCITS[i]=0.13;
68 //_________________________________________________________________________
69 AliITSPIDResponse::AliITSPIDResponse(Double_t *param):
78 // The main constructor
83 Double_t AliITSPIDResponse::BetheAleph(Double_t p, Double_t mass) const {
85 // returns AliExternalTrackParam::BetheBloch normalized to
86 // fgMIP at the minimum
90 AliExternalTrackParam::BetheBlochAleph(p/mass,fKp1,fKp2,fKp3,fKp4,fKp5);
94 Double_t AliITSPIDResponse::Bethe(Double_t p, Double_t mass, Bool_t isSA) const {
96 // returns AliExternalTrackParam::BetheBloch normalized to
97 // fgMIP at the minimum
101 Double_t beta = bg/TMath::Sqrt(1.+ bg*bg);
102 Double_t gamma=bg/beta;
105 for(Int_t ip=0; ip<5;ip++) par[ip]=fBBsa[ip];
107 for(Int_t ip=0; ip<5;ip++) par[ip]=fBBtpcits[ip];
111 eff=(bg-par[3])*(bg-par[3])+par[4];
113 eff=(par[2]-par[3])*(par[2]-par[3])+par[4];
116 if(gamma>=0. && beta>0.){
117 bb=(par[1]+2.0*TMath::Log(gamma)-beta*beta)*(par[0]/(beta*beta))*eff;
122 Double_t AliITSPIDResponse::GetResolution(Double_t bethe,
126 // Calculate expected resolution for truncated mean
129 if(isSA) r=fResolSA[nPtsForPid];
130 else r=fResolTPCITS[nPtsForPid];
137 void AliITSPIDResponse::GetITSProbabilities(Float_t mom, Double_t qclu[4], Double_t condprobfun[AliPID::kSPECIES]) const {
139 // Method to calculate PID probabilities for a single track
140 // using the likelihood method
142 const Int_t nLay = 4;
143 const Int_t nPart = 3;
145 static AliITSPidParams pars; // Pid parametrisation parameters
147 Double_t itsProb[nPart] = {1,1,1}; // p, K, pi
149 for (Int_t iLay = 0; iLay < nLay; iLay++) {
153 Float_t dedx = qclu[iLay];
154 Float_t layProb = pars.GetLandauGausNorm(dedx,AliPID::kProton,mom,iLay+3);
155 itsProb[0] *= layProb;
157 layProb = pars.GetLandauGausNorm(dedx,AliPID::kKaon,mom,iLay+3);
158 if (mom < 0.16) layProb=0.00001;
159 itsProb[1] *= layProb;
161 layProb = pars.GetLandauGausNorm(dedx,AliPID::kPion,mom,iLay+3);
162 itsProb[2] *= layProb;
165 // Normalise probabilities
166 Double_t sumProb = 0;
167 for (Int_t iPart = 0; iPart < nPart; iPart++) {
168 sumProb += itsProb[iPart];
171 for (Int_t iPart = 0; iPart < nPart; iPart++) {
172 itsProb[iPart]/=sumProb;
175 condprobfun[AliPID::kElectron] = itsProb[2]/3.;
176 condprobfun[AliPID::kMuon] = itsProb[2]/3.;
177 condprobfun[AliPID::kPion] = itsProb[2]/3.;
178 condprobfun[AliPID::kKaon] = itsProb[1];
179 condprobfun[AliPID::kProton] = itsProb[0];