1 /**************************************************************************
2 * Copyright(c) 2007-2009, 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 class to store parameters of ITS //
21 // response funcions for dE/dx based PID //
22 // Origin: F.Prino, Torino, prino@to.infn.it //
24 ///////////////////////////////////////////////////////////////////
29 #include "AliITSPidParams.h"
32 ClassImp(AliITSPidParams)
34 //______________________________________________________________________
35 AliITSPidParams::AliITSPidParams(Bool_t isMC):
38 fSDDPionLandauWidth(0),
39 fSDDPionGaussWidth(0),
41 fSSDPionLandauWidth(0),
42 fSSDPionGaussWidth(0),
44 fSDDKaonLandauWidth(0),
45 fSDDKaonGaussWidth(0),
47 fSSDKaonLandauWidth(0),
48 fSSDKaonGaussWidth(0),
50 fSDDProtLandauWidth(0),
51 fSDDProtGaussWidth(0),
53 fSSDProtLandauWidth(0),
56 // default constructor
60 //______________________________________________________________________
61 AliITSPidParams::AliITSPidParams(Char_t * name, Bool_t isMC):
64 fSDDPionLandauWidth(0),
65 fSDDPionGaussWidth(0),
67 fSSDPionLandauWidth(0),
68 fSSDPionGaussWidth(0),
70 fSDDKaonLandauWidth(0),
71 fSDDKaonGaussWidth(0),
73 fSSDKaonLandauWidth(0),
74 fSSDKaonGaussWidth(0),
76 fSDDProtLandauWidth(0),
77 fSDDProtGaussWidth(0),
79 fSSDProtLandauWidth(0),
82 // standard constructor
86 //______________________________________________________________________
87 AliITSPidParams::~AliITSPidParams(){
89 if(fSDDPionMPV) delete fSDDPionMPV;
90 if(fSDDPionLandauWidth) delete fSDDPionLandauWidth;
91 if(fSDDPionGaussWidth) delete fSDDPionGaussWidth;
93 if(fSSDPionMPV) delete fSSDPionMPV;
94 if(fSSDPionLandauWidth) delete fSSDPionLandauWidth;
95 if(fSSDPionGaussWidth) delete fSSDPionGaussWidth;
97 if(fSDDKaonMPV) delete fSDDKaonMPV;
98 if(fSDDKaonLandauWidth) delete fSDDKaonLandauWidth;
99 if(fSDDKaonGaussWidth) delete fSDDKaonGaussWidth;
101 if(fSSDKaonMPV) delete fSSDKaonMPV;
102 if(fSSDKaonLandauWidth) delete fSSDKaonLandauWidth;
103 if(fSSDKaonGaussWidth) delete fSSDKaonGaussWidth;
105 if(fSDDProtMPV) delete fSDDProtMPV;
106 if(fSDDProtLandauWidth) delete fSDDProtLandauWidth;
107 if(fSDDProtGaussWidth) delete fSDDProtGaussWidth;
109 if(fSSDProtMPV) delete fSSDProtMPV;
110 if(fSSDProtLandauWidth) delete fSSDProtLandauWidth;
111 if(fSSDProtGaussWidth) delete fSSDProtGaussWidth;
114 //______________________________________________________________________
115 void AliITSPidParams::InitMC(){
116 // initialize TFormulas to Monte Carlo values (=p-p simulations PYTHIA+GEANT)
117 // parameter values from LHC10d1
120 if(fSDDPionMPV) delete fSDDPionMPV;
121 fSDDPionMPV=new TFormula("fSDDPionMPV","[0]/(x*x)*TMath::Log(x)+[1]/(x*x*x*x)*TMath::Log(x)+[2]*TMath::Log(x)+[3]");
122 fSDDPionMPV->SetParameters(-0.892291, 0.003630, 1.866484, 78.378179);
124 if(fSDDPionLandauWidth) delete fSDDPionLandauWidth;
125 fSDDPionLandauWidth=new TFormula("fSDDPionLandauWidth","[0]/(x*x)+[1]");
126 fSDDPionLandauWidth->SetParameters(0.080999, 5.917715);
128 if(fSDDPionGaussWidth) delete fSDDPionGaussWidth;
129 fSDDPionGaussWidth=new TFormula("fSDDPionGaussWidth","[0]/(x*x)*TMath::Log(x)+[1]");
130 fSDDPionGaussWidth->SetParameters(-0.092822, 7.839729);
132 if(fSSDPionMPV) delete fSSDPionMPV;
133 fSSDPionMPV=new TFormula("fSSDPionMPV","[0]/(x*x)*TMath::Log(x)+[1]/(x*x*x*x)*TMath::Log(x)+[2]*TMath::Log(x)+[3]");
134 fSSDPionMPV->SetParameters(-0.896507, 0.003173, 2.017155, 80.682567);
136 if(fSSDPionLandauWidth) delete fSSDPionLandauWidth;
137 fSSDPionLandauWidth=new TFormula("fSSDPionLandauWidth","[0]/(x*x)+[1]");
138 fSSDPionLandauWidth->SetParameters(0.087182, 5.843610);
140 if(fSSDPionGaussWidth) delete fSSDPionGaussWidth;
141 fSSDPionGaussWidth=new TFormula("fSSDPionGaussWidth","[0]/(x*x)*TMath::Log(x)+[1]");
142 fSSDPionGaussWidth->SetParameters(-0.110444, 5.837737);
145 if(fSDDKaonMPV) delete fSDDKaonMPV;
146 fSDDKaonMPV=new TFormula("fSDDKaonMPV","[0]/(x*x)+[1]/(x*x*x*x)+[2]");
147 fSDDKaonMPV->SetParameters(17.581590, -0.120134, 72.550701);
149 if(fSDDKaonLandauWidth) delete fSDDKaonLandauWidth;
150 fSDDKaonLandauWidth=new TFormula("fSDDKaonLandauWidth","[0]/(x*x)+[1]");
151 fSDDKaonLandauWidth->SetParameters(1.271756, 5.778888);
153 if(fSDDKaonGaussWidth) delete fSDDKaonGaussWidth;
154 fSDDKaonGaussWidth=new TFormula("fSDDKaonGaussWidth","[0]/(x*x)*TMath::Log(x)+[1]");
155 fSDDKaonGaussWidth->SetParameters(-1.650298, 8.322084);
157 if(fSSDKaonMPV) delete fSSDKaonMPV;
158 fSSDKaonMPV=new TFormula("fSSDKaonMPV","[0]/(x*x)+[1]/(x*x*x*x)+[2]");
159 fSSDKaonMPV->SetParameters(16.238778, 0.039318, 75.863719);
161 if(fSSDKaonLandauWidth) delete fSSDKaonLandauWidth;
162 fSSDKaonLandauWidth=new TFormula("fSSDKaonLandauWidth","[0]/(x*x)+[1]");
163 fSSDKaonLandauWidth->SetParameters(1.179541, 5.961353);
165 if(fSSDKaonGaussWidth) delete fSSDKaonGaussWidth;
166 fSSDKaonGaussWidth=new TFormula("fSSDKaonGaussWidth","[0]/(x*x)*TMath::Log(x)+[1]");
167 fSSDKaonGaussWidth->SetParameters(-2.019126, 6.155977);
170 if(fSDDProtMPV) delete fSDDProtMPV;
171 fSDDProtMPV=new TFormula("fSDDProtMPV","[0]/(x*x)+[1]/(x*x*x*x)+[2]");
172 fSDDProtMPV->SetParameters(64.482762, -1.667823, 71.850731);
174 if(fSDDProtLandauWidth) delete fSDDProtLandauWidth;
175 fSDDProtLandauWidth=new TFormula("fSDDProtLandauWidth","[0]/(x*x)+[1]");
176 fSDDProtLandauWidth->SetParameters(6.948997, 3.928018);
178 if(fSDDProtGaussWidth) delete fSDDProtGaussWidth;
179 fSDDProtGaussWidth=new TFormula("fSDDProtGaussWidth","[0]/(x*x)*TMath::Log(x)+[1]");
180 fSDDProtGaussWidth->SetParameters(-6.522760, 12.673959);
182 if(fSSDProtMPV) delete fSSDProtMPV;
183 fSSDProtMPV=new TFormula("fSSDProtMPV","[0]/(x*x)+[1]/(x*x*x*x)+[2]");
184 fSSDProtMPV->SetParameters(63.817375, -1.221779, 73.233644);
186 if(fSSDProtLandauWidth) delete fSSDProtLandauWidth;
187 fSSDProtLandauWidth=new TFormula("fSSDProtLandauWidth","[0]/(x*x)+[1]");
188 fSSDProtLandauWidth->SetParameters(7.286942, 3.581451);
190 if(fSSDProtGaussWidth) delete fSSDProtGaussWidth;
191 fSSDProtGaussWidth=new TFormula("fSSDProtGaussWidth","[0]/(x*x)*TMath::Log(x)+[1]");
192 fSSDProtGaussWidth->SetParameters(-8.327867, 9.723422);
195 //______________________________________________________________________
196 void AliITSPidParams::InitData(){
197 // initialize TFormulas to Real Data values (=p-p simulations PYTHIA+GEANT)
198 // parameter values from LHC10b
201 if(fSDDPionMPV) delete fSDDPionMPV;
202 fSDDPionMPV=new TFormula("fSDDPionMPV","[0]/(x*x)*TMath::Log(x)+[1]/(x*x*x*x)*TMath::Log(x)+[2]*TMath::Log(x)+[3]");
203 fSDDPionMPV->SetParameters(-0.907609, 0.006521, 3.340347, 81.297942);
205 if(fSDDPionLandauWidth) delete fSDDPionLandauWidth;
206 fSDDPionLandauWidth=new TFormula("fSDDPionLandauWidth","[0]/(x*x)+[1]");
207 fSDDPionLandauWidth->SetParameters(0.077272, 5.478557);
209 if(fSDDPionGaussWidth) delete fSDDPionGaussWidth;
210 fSDDPionGaussWidth=new TFormula("fSDDPionGaussWidth","[0]/(x*x)*TMath::Log(x)+[1]");
211 fSDDPionGaussWidth->SetParameters(-0.098529, 10.265711);
213 if(fSSDPionMPV) delete fSSDPionMPV;
214 fSSDPionMPV=new TFormula("fSSDPionMPV","[0]/(x*x)*TMath::Log(x)+[1]/(x*x*x*x)*TMath::Log(x)+[2]*TMath::Log(x)+[3]");
215 fSSDPionMPV->SetParameters(-0.920046, 0.006061, 3.428578, 81.401816);
217 if(fSSDPionLandauWidth) delete fSSDPionLandauWidth;
218 fSSDPionLandauWidth=new TFormula("fSSDPionLandauWidth","[0]/(x*x)+[1]");
219 fSSDPionLandauWidth->SetParameters(0.071243, 5.388830);
221 if(fSSDPionGaussWidth) delete fSSDPionGaussWidth;
222 fSSDPionGaussWidth=new TFormula("fSSDPionGaussWidth","[0]/(x*x)*TMath::Log(x)+[1]");
223 fSSDPionGaussWidth->SetParameters(-0.099189, 7.412309);
226 if(fSDDKaonMPV) delete fSDDKaonMPV;
227 fSDDKaonMPV=new TFormula("fSDDKaonMPV","[0]/(x*x)+[1]/(x*x*x*x)+[2]");
228 fSDDKaonMPV->SetParameters(15.429146, 0.178251, 74.640293);
230 if(fSDDKaonLandauWidth) delete fSDDKaonLandauWidth;
231 fSDDKaonLandauWidth=new TFormula("fSDDKaonLandauWidth","[0]/(x*x)+[1]");
232 fSDDKaonLandauWidth->SetParameters(0.975202, 5.699311);
234 if(fSDDKaonGaussWidth) delete fSDDKaonGaussWidth;
235 fSDDKaonGaussWidth=new TFormula("fSDDKaonGaussWidth","[0]/(x*x)+[1]");
236 fSDDKaonGaussWidth->SetParameters(1.660840, 9.389192);
238 if(fSSDKaonMPV) delete fSSDKaonMPV;
239 fSSDKaonMPV=new TFormula("fSSDKaonMPV","[0]/(x*x)+[1]/(x*x*x*x)+[2]");
240 fSSDKaonMPV->SetParameters(15.170715, 0.181379, 74.951884);
242 if(fSSDKaonLandauWidth) delete fSSDKaonLandauWidth;
243 fSSDKaonLandauWidth=new TFormula("fSSDKaonLandauWidth","[0]/(x*x)+[1]");
244 fSSDKaonLandauWidth->SetParameters(0.756466, 5.818274);
246 if(fSSDKaonGaussWidth) delete fSSDKaonGaussWidth;
247 fSSDKaonGaussWidth=new TFormula("fSSDKaonGaussWidth","[0]/(x*x)+[1]");
248 fSSDKaonGaussWidth->SetParameters(1.546693, 6.389872);
251 if(fSDDProtMPV) delete fSDDProtMPV;
252 fSDDProtMPV=new TFormula("fSDDProtMPV","[0]/(x*x)+[1]/(x*x*x*x)+[2]");
253 fSDDProtMPV->SetParameters(61.452534, 0.372908, 71.668352);
255 if(fSDDProtLandauWidth) delete fSDDProtLandauWidth;
256 fSDDProtLandauWidth=new TFormula("fSDDProtLandauWidth","[0]/(x*x)+[1]");
257 fSDDProtLandauWidth->SetParameters(3.667023, 5.430721);
259 if(fSDDProtGaussWidth) delete fSDDProtGaussWidth;
260 fSDDProtGaussWidth=new TFormula("fSDDProtGaussWidth","[0]/(x*x)+[1]");
261 fSDDProtGaussWidth->SetParameters(5.503814, 9.657439);
263 if(fSSDProtMPV) delete fSSDProtMPV;
264 fSSDProtMPV=new TFormula("fSSDProtMPV","[0]/(x*x)+[1]/(x*x*x*x)+[2]");
265 fSSDProtMPV->SetParameters(60.246538, 0.000323, 71.992031);
267 if(fSSDProtLandauWidth) delete fSSDProtLandauWidth;
268 fSSDProtLandauWidth=new TFormula("fSSDProtLandauWidth","[0]/(x*x)+[1]");
269 fSSDProtLandauWidth->SetParameters(2.568323, 5.939774);
271 if(fSSDProtGaussWidth) delete fSSDProtGaussWidth;
272 fSSDProtGaussWidth=new TFormula("fSSDProtGaussWidth","[0]/(x*x)+[1]");
273 fSSDProtGaussWidth->SetParameters(5.050541, 6.290964);
276 //_______________________________________________________________________
277 Double_t AliITSPidParams::GetLandauGausNormPdgCode(Double_t dedx, Int_t pdgCode, Double_t mom, Int_t lay) const {
278 // Computes Landau Gauss convolution for given particle specie and given momentum in a given ITS layer
279 if(TMath::Abs(pdgCode)==211) return GetLandauGausNorm(dedx,AliPID::kPion,mom,lay);
280 else if(TMath::Abs(pdgCode)==321) return GetLandauGausNorm(dedx,AliPID::kKaon,mom,lay);
281 else if(TMath::Abs(pdgCode)==2212) return GetLandauGausNorm(dedx,AliPID::kProton,mom,lay);
284 //_______________________________________________________________________
285 Double_t AliITSPidParams::GetLandauGausNorm(Double_t dedx, Int_t partType, Double_t mom, Int_t lay) const{
286 // Computes Landau Gauss convolution for given particle specie and given momentum in a given ITS layer
290 if(partType==AliPID::kPion){
291 if(lay==3 || lay==4){
292 par[0]=GetSDDPionLandauWidth(mom);
293 par[1]=GetSDDPionMPV(mom);
294 par[2]=GetSDDPionGaussWidth(mom);
297 else if(lay==5 || lay==6){
298 par[0]=GetSSDPionLandauWidth(mom);
299 par[1]=GetSSDPionMPV(mom);
300 par[2]=GetSSDPionGaussWidth(mom);
303 }else if(partType==AliPID::kKaon){
304 if(lay==3 || lay==4){
305 par[0]=GetSDDKaonLandauWidth(mom);
306 par[1]=GetSDDKaonMPV(mom);
307 par[2]=GetSDDKaonGaussWidth(mom);
310 else if(lay==5 || lay==6){
311 par[0]=GetSSDKaonLandauWidth(mom);
312 par[1]=GetSSDKaonMPV(mom);
313 par[2]=GetSSDKaonGaussWidth(mom);
316 }else if(partType==AliPID::kProton){
317 if(lay==3 || lay==4){
318 par[0]=GetSDDProtLandauWidth(mom);
319 par[1]=GetSDDProtMPV(mom);
320 par[2]=GetSDDProtGaussWidth(mom);
323 else if(lay==5 || lay==6){
324 par[0]=GetSSDProtLandauWidth(mom);
325 par[1]=GetSSDProtMPV(mom);
326 par[2]=GetSSDProtGaussWidth(mom);
330 if(!isSet) return 0.;
332 Double_t invsq2pi = 0.3989422804014; // (2 pi)^(-1/2)
333 Double_t mpshift = -0.22278298; // Landau maximum location
335 Double_t np = 100.0; // number of convolution steps
336 Double_t sc = 5.0; // convolution extends to +-sc Gaussian sigmas
346 // MP shift correction
347 mpc = par[1] - mpshift * par[0];
348 // Range of convolution integral
349 xlow = dedx - sc * par[2];
350 xupp = dedx + sc * par[2];
351 if(np!=0) step = (xupp-xlow) / np;
353 // Convolution integral of Landau and Gaussian by sum
354 for(i=1.0; i<=np/2; i++) {
355 xx = xlow + (i-.5) * step;
357 fland = TMath::Landau(xx,mpc,par[0]) / par[0];
358 sum += fland * TMath::Gaus(dedx,xx,par[2]);
360 xx = xupp - (i-.5) * step;
361 fland = TMath::Landau(xx,mpc,par[0]) / par[0];
362 sum += fland * TMath::Gaus(dedx,xx,par[2]);
365 return (step * sum * invsq2pi / par[2]);