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():
41 //_________________________________________________________________________
42 AliITSPIDResponse::AliITSPIDResponse(Double_t *param):
51 // The main constructor
56 Double_t AliITSPIDResponse::Bethe(Double_t p,Double_t mass) const {
58 // returns AliExternalTrackParam::BetheBloch normalized to
59 // fgMIP at the minimum
62 AliExternalTrackParam::BetheBlochAleph(p/mass,fKp1,fKp2,fKp3,fKp4,fKp5);
66 Double_t AliITSPIDResponse::GetResolution(Double_t bethe) const {
68 // Calculate expected resolution for truncated mean
73 void AliITSPIDResponse::GetITSProbabilities(Float_t mom, Double_t qclu[4], Double_t condprobfun[AliPID::kSPECIES]) const {
75 // Method to calculate PID probabilities for a single track
76 // using the likelihood method
79 const Int_t nPart = 3;
81 static AliITSPidParams pars; // Pid parametrisation parameters
83 Double_t itsProb[nPart] = {1,1,1}; // p, K, pi
85 for (Int_t iLay = 0; iLay < nLay; iLay++) {
89 Float_t dedx = qclu[iLay];
90 Float_t layProb = pars.GetLandauGausNorm(dedx,AliPID::kProton,mom,iLay+3);
91 itsProb[0] *= layProb;
93 layProb = pars.GetLandauGausNorm(dedx,AliPID::kKaon,mom,iLay+3);
94 if (mom < 0.16) layProb=0.00001;
95 itsProb[1] *= layProb;
97 layProb = pars.GetLandauGausNorm(dedx,AliPID::kPion,mom,iLay+3);
98 itsProb[2] *= layProb;
101 // Normalise probabilities
102 Double_t sumProb = 0;
103 for (Int_t iPart = 0; iPart < nPart; iPart++) {
104 sumProb += itsProb[iPart];
107 for (Int_t iPart = 0; iPart < nPart; iPart++) {
108 itsProb[iPart]/=sumProb;
111 condprobfun[AliPID::kElectron] = itsProb[2]/3.;
112 condprobfun[AliPID::kMuon] = itsProb[2]/3.;
113 condprobfun[AliPID::kPion] = itsProb[2]/3.;
114 condprobfun[AliPID::kKaon] = itsProb[1];
115 condprobfun[AliPID::kProton] = itsProb[0];