]> git.uio.no Git - u/mrichter/AliRoot.git/blob - STEER/AliITSPIDResponse.cxx
New BB parameterizations for low momentum electrons. Improved BB parameterization...
[u/mrichter/AliRoot.git] / STEER / AliITSPIDResponse.cxx
1 /**************************************************************************
2  * Copyright(c) 2005-2007, ALICE Experiment at CERN, All rights reserved. *
3  *                                                                        *
4  * Author: The ALICE Off-line Project.                                    *
5  * Contributors are mentioned in the code where appropriate.              *
6  *                                                                        *
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  **************************************************************************/
15
16 /* $Id$ */
17
18 //-----------------------------------------------------------------
19 // ITS PID method # 1
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 //-----------------------------------------------------------------
24 #include "TMath.h"
25 #include "AliITSPIDResponse.h"
26 #include "AliITSPidParams.h"
27 #include "AliExternalTrackParam.h"
28
29 ClassImp(AliITSPIDResponse)
30
31 AliITSPIDResponse::AliITSPIDResponse(Bool_t isMC): 
32   fRes(0.13),
33   fKp1(15.77),
34   fKp2(4.95),
35   fKp3(0.312),
36   fKp4(2.14),
37   fKp5(0.82)
38 {
39   if(!isMC){
40     fBBtpcits[0]=0.73;
41     fBBtpcits[1]=14.68;
42     fBBtpcits[2]=0.905;
43     fBBtpcits[3]=1.2;
44     fBBtpcits[4]=6.6;
45     fBBsa[0]=2.73198E7;
46     fBBsa[1]=6.92389;
47     fBBsa[2]=1.90088E-6;
48     fBBsa[3]=1.90088E-6;
49     fBBsa[4]=3.40644E-7;
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;
61   }else{
62     fBBtpcits[0]=1.04;
63     fBBtpcits[1]=27.14;
64     fBBtpcits[2]=1.00;
65     fBBtpcits[3]=0.964;
66     fBBtpcits[4]=2.59;
67     fBBsa[0]=2.02078E7;
68     fBBsa[1]=14.0724;
69     fBBsa[2]=3.84454E-7;
70     fBBsa[3]=3.84454E-7;
71     fBBsa[4]=2.43913E-7;
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;
83   }
84 }
85
86 //_________________________________________________________________________
87 AliITSPIDResponse::AliITSPIDResponse(Double_t *param): 
88   fRes(param[0]),
89   fKp1(15.77),
90   fKp2(4.95),
91   fKp3(0.312),
92   fKp4(2.14),
93   fKp5(0.82)
94 {
95   //
96   //  The main constructor
97   //
98   for (Int_t i=0; i<5;i++) {
99       fBBsa[i]=0.; 
100       fBBtpcits[i]=0.;
101       fResolSA[i]=0.; 
102       fResolTPCITS[i]=0.;
103   }
104 }
105
106
107 //_________________________________________________________________________
108 Double_t AliITSPIDResponse::BetheAleph(Double_t p, Double_t mass) const {
109   //
110   // returns AliExternalTrackParam::BetheBloch normalized to 
111   // fgMIP at the minimum
112   //
113   
114   Double_t bb=
115     AliExternalTrackParam::BetheBlochAleph(p/mass,fKp1,fKp2,fKp3,fKp4,fKp5);
116   return bb;
117 }
118
119 //_________________________________________________________________________
120 Double_t AliITSPIDResponse::Bethe(Double_t p, Double_t mass, Bool_t isSA) const {
121   //
122   // returns AliExternalTrackParam::BetheBloch normalized to 
123   // fgMIP at the minimum
124   //
125
126   Double_t bg=p/mass;
127   Double_t beta = bg/TMath::Sqrt(1.+ bg*bg);
128   Double_t gamma=bg/beta;
129   Double_t par[5];
130   if(isSA){
131     if(mass>0.0005 && mass<0.00052){
132       //if is an electron use a specific BB parameterization
133       //To be used only between 100 and 160 MeV/c
134       for(Int_t ip=0; ip<5;ip++) par[ip]=fBBsaElectron[ip];
135     }else{
136       for(Int_t ip=0; ip<5;ip++) par[ip]=fBBsa[ip];
137     }
138   }else{
139     for(Int_t ip=0; ip<5;ip++) par[ip]=fBBtpcits[ip];
140   }
141   Double_t eff=1.0;
142   if(bg<par[2])
143     eff=(bg-par[3])*(bg-par[3])+par[4];
144   else
145     eff=(par[2]-par[3])*(par[2]-par[3])+par[4];
146   
147   Double_t bb=0.;
148   if(gamma>=0. && beta>0.){
149     bb=(par[1]+2.0*TMath::Log(gamma)-beta*beta)*(par[0]/(beta*beta))*eff;
150   }
151   return bb;
152 }
153
154 //_________________________________________________________________________
155 Double_t AliITSPIDResponse::GetResolution(Double_t bethe, 
156                                           Int_t nPtsForPid, 
157                                           Bool_t isSA) const {
158   // 
159   // Calculate expected resolution for truncated mean
160   //
161   Float_t r;
162   if(isSA) r=fResolSA[nPtsForPid];
163   else r=fResolTPCITS[nPtsForPid];
164   return r*bethe;
165 }
166
167
168
169
170 //_________________________________________________________________________
171 void AliITSPIDResponse::GetITSProbabilities(Float_t mom, Double_t qclu[4], Double_t condprobfun[AliPID::kSPECIES], Bool_t isMC) const {
172   //
173   // Method to calculate PID probabilities for a single track
174   // using the likelihood method
175   //
176   const Int_t nLay = 4;
177   const Int_t nPart = 3;
178
179   static AliITSPidParams pars(isMC);  // Pid parametrisation parameters
180   
181   Double_t itsProb[nPart] = {1,1,1}; // p, K, pi
182
183   for (Int_t iLay = 0; iLay < nLay; iLay++) {
184     if (qclu[iLay] <= 0)
185       continue;
186
187     Float_t dedx = qclu[iLay];
188     Float_t layProb = pars.GetLandauGausNorm(dedx,AliPID::kProton,mom,iLay+3);
189     itsProb[0] *= layProb;
190     
191     layProb = pars.GetLandauGausNorm(dedx,AliPID::kKaon,mom,iLay+3);
192     if (mom < 0.16) layProb=0.00001;
193     itsProb[1] *= layProb;
194     
195     layProb = pars.GetLandauGausNorm(dedx,AliPID::kPion,mom,iLay+3);
196     itsProb[2] *= layProb;
197   }
198
199   // Normalise probabilities
200   Double_t sumProb = 0;
201   for (Int_t iPart = 0; iPart < nPart; iPart++) {
202     sumProb += itsProb[iPart];
203   }
204   sumProb += 2*itsProb[2]; // muon and electron cannot be distinguished from pions
205
206   for (Int_t iPart = 0; iPart < nPart; iPart++) {
207     itsProb[iPart]/=sumProb;
208   }
209   
210   condprobfun[AliPID::kElectron] = itsProb[2];
211   condprobfun[AliPID::kMuon] = itsProb[2];
212   condprobfun[AliPID::kPion] = itsProb[2];
213   condprobfun[AliPID::kKaon] = itsProb[1];
214   condprobfun[AliPID::kProton] = itsProb[0];
215   return;
216 }
217
218 //_________________________________________________________________________
219 Int_t AliITSPIDResponse::GetParticleIdFromdEdxVsP(Float_t mom, Float_t signal, Bool_t isSA) const{
220   // method to get particle identity with simple cuts on dE/dx vs. momentum
221
222   Double_t massp=AliPID::ParticleMass(AliPID::kProton);
223   Double_t massk=AliPID::ParticleMass(AliPID::kKaon);
224   Double_t bethep=Bethe(mom,massp,isSA);
225   Double_t bethek=Bethe(mom,massk,isSA);
226   if(signal>(0.5*(bethep+bethek))) return AliPID::kProton;
227   Double_t masspi=AliPID::ParticleMass(AliPID::kPion);
228   Double_t bethepi=Bethe(mom,masspi,isSA);
229   if(signal>(0.5*(bethepi+bethek))) return AliPID::kKaon;
230   return AliPID::kPion;
231     
232 }