]>
Commit | Line | Data |
---|---|---|
10d100d4 | 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 | ||
10d100d4 | 29 | ClassImp(AliITSPIDResponse) |
30 | ||
15e979c9 | 31 | AliITSPIDResponse::AliITSPIDResponse(Bool_t isMC): |
10d100d4 | 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 | { | |
15e979c9 | 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]=5.33458E4; | |
46 | fBBsa[1]=16.5303; | |
47 | fBBsa[2]=2.60065E-3; | |
48 | fBBsa[3]=3.59533E-4; | |
49 | fBBsa[4]=7.51168E-5; | |
8abeb05b | 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 | |
15e979c9 | 55 | for(Int_t i=0; i<5;i++) fResolTPCITS[i]=0.13; |
56 | }else{ | |
99daa709 | 57 | fBBtpcits[0]=1.04; |
58 | fBBtpcits[1]=27.14; | |
59 | fBBtpcits[2]=1.00; | |
60 | fBBtpcits[3]=0.964; | |
61 | fBBtpcits[4]=2.59; | |
646e694f | 62 | fBBsa[0]=-2.48; |
63 | fBBsa[1]=23.13; | |
64 | fBBsa[2]=1.161; | |
65 | fBBsa[3]=0.93; | |
66 | fBBsa[4]=-1.2973; | |
8abeb05b | 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 | |
15e979c9 | 72 | for(Int_t i=0; i<5;i++) fResolTPCITS[i]=0.13; |
73 | } | |
10d100d4 | 74 | } |
75 | ||
76 | //_________________________________________________________________________ | |
77 | AliITSPIDResponse::AliITSPIDResponse(Double_t *param): | |
9ebbddd4 | 78 | fRes(param[0]), |
10d100d4 | 79 | fKp1(15.77), |
80 | fKp2(4.95), | |
81 | fKp3(0.312), | |
82 | fKp4(2.14), | |
83 | fKp5(0.82) | |
84 | { | |
85 | // | |
86 | // The main constructor | |
87 | // | |
6b4634a4 | 88 | for (Int_t i=0; i<5;i++) { |
89 | fBBsa[i]=0.; | |
90 | fBBtpcits[i]=0.; | |
91 | fResolSA[i]=0.; | |
92 | fResolTPCITS[i]=0.; | |
93 | } | |
10d100d4 | 94 | } |
95 | ||
96 | ||
8abeb05b | 97 | //_________________________________________________________________________ |
15e979c9 | 98 | Double_t AliITSPIDResponse::BetheAleph(Double_t p, Double_t mass) const { |
10d100d4 | 99 | // |
100 | // returns AliExternalTrackParam::BetheBloch normalized to | |
101 | // fgMIP at the minimum | |
102 | // | |
15e979c9 | 103 | |
10d100d4 | 104 | Double_t bb= |
105 | AliExternalTrackParam::BetheBlochAleph(p/mass,fKp1,fKp2,fKp3,fKp4,fKp5); | |
9ebbddd4 | 106 | return bb; |
10d100d4 | 107 | } |
108 | ||
8abeb05b | 109 | //_________________________________________________________________________ |
15e979c9 | 110 | Double_t AliITSPIDResponse::Bethe(Double_t p, Double_t mass, Bool_t isSA) const { |
111 | // | |
112 | // returns AliExternalTrackParam::BetheBloch normalized to | |
113 | // fgMIP at the minimum | |
114 | // | |
115 | ||
116 | Double_t bg=p/mass; | |
117 | Double_t beta = bg/TMath::Sqrt(1.+ bg*bg); | |
118 | Double_t gamma=bg/beta; | |
119 | Double_t par[5]; | |
120 | if(isSA){ | |
121 | for(Int_t ip=0; ip<5;ip++) par[ip]=fBBsa[ip]; | |
122 | }else{ | |
123 | for(Int_t ip=0; ip<5;ip++) par[ip]=fBBtpcits[ip]; | |
124 | } | |
125 | Double_t eff=1.0; | |
126 | if(bg<par[2]) | |
127 | eff=(bg-par[3])*(bg-par[3])+par[4]; | |
128 | else | |
129 | eff=(par[2]-par[3])*(par[2]-par[3])+par[4]; | |
130 | ||
131 | Double_t bb=0.; | |
132 | if(gamma>=0. && beta>0.){ | |
133 | bb=(par[1]+2.0*TMath::Log(gamma)-beta*beta)*(par[0]/(beta*beta))*eff; | |
134 | } | |
135 | return bb; | |
136 | } | |
137 | ||
8abeb05b | 138 | //_________________________________________________________________________ |
15e979c9 | 139 | Double_t AliITSPIDResponse::GetResolution(Double_t bethe, |
140 | Int_t nPtsForPid, | |
141 | Bool_t isSA) const { | |
10d100d4 | 142 | // |
143 | // Calculate expected resolution for truncated mean | |
144 | // | |
15e979c9 | 145 | Float_t r; |
146 | if(isSA) r=fResolSA[nPtsForPid]; | |
147 | else r=fResolTPCITS[nPtsForPid]; | |
148 | return r*bethe; | |
10d100d4 | 149 | } |
150 | ||
15e979c9 | 151 | |
152 | ||
153 | ||
8abeb05b | 154 | //_________________________________________________________________________ |
10d100d4 | 155 | void AliITSPIDResponse::GetITSProbabilities(Float_t mom, Double_t qclu[4], Double_t condprobfun[AliPID::kSPECIES]) const { |
156 | // | |
157 | // Method to calculate PID probabilities for a single track | |
158 | // using the likelihood method | |
159 | // | |
160 | const Int_t nLay = 4; | |
161 | const Int_t nPart = 3; | |
162 | ||
163 | static AliITSPidParams pars; // Pid parametrisation parameters | |
164 | ||
165 | Double_t itsProb[nPart] = {1,1,1}; // p, K, pi | |
166 | ||
167 | for (Int_t iLay = 0; iLay < nLay; iLay++) { | |
168 | if (qclu[iLay] <= 0) | |
169 | continue; | |
170 | ||
171 | Float_t dedx = qclu[iLay]; | |
172 | Float_t layProb = pars.GetLandauGausNorm(dedx,AliPID::kProton,mom,iLay+3); | |
173 | itsProb[0] *= layProb; | |
174 | ||
175 | layProb = pars.GetLandauGausNorm(dedx,AliPID::kKaon,mom,iLay+3); | |
176 | if (mom < 0.16) layProb=0.00001; | |
177 | itsProb[1] *= layProb; | |
178 | ||
179 | layProb = pars.GetLandauGausNorm(dedx,AliPID::kPion,mom,iLay+3); | |
180 | itsProb[2] *= layProb; | |
181 | } | |
182 | ||
183 | // Normalise probabilities | |
184 | Double_t sumProb = 0; | |
185 | for (Int_t iPart = 0; iPart < nPart; iPart++) { | |
186 | sumProb += itsProb[iPart]; | |
187 | } | |
897a0e31 | 188 | sumProb += 2*itsProb[2]; // muon and electron cannot be distinguished from pions |
10d100d4 | 189 | |
190 | for (Int_t iPart = 0; iPart < nPart; iPart++) { | |
191 | itsProb[iPart]/=sumProb; | |
192 | } | |
193 | ||
897a0e31 | 194 | condprobfun[AliPID::kElectron] = itsProb[2]; |
195 | condprobfun[AliPID::kMuon] = itsProb[2]; | |
196 | condprobfun[AliPID::kPion] = itsProb[2]; | |
10d100d4 | 197 | condprobfun[AliPID::kKaon] = itsProb[1]; |
198 | condprobfun[AliPID::kProton] = itsProb[0]; | |
199 | return; | |
200 | } | |
15e979c9 | 201 | |
8abeb05b | 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 | |
205 | ||
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; | |
215 | ||
216 | } |