]>
Commit | Line | Data |
---|---|---|
1 | #ifndef ALIITSPIDPARAMS_H | |
2 | #define ALIITSPIDPARAMS_H | |
3 | /* Copyright(c) 2007-2009, ALICE Experiment at CERN, All rights reserved. * | |
4 | * See cxx source for full Copyright notice */ | |
5 | ||
6 | /* $Id: $ */ | |
7 | ||
8 | /////////////////////////////////////////////////////////////////// | |
9 | // // | |
10 | // Class to store parameters of ITS response functions // | |
11 | // Origin: F.Prino, Torino, prino@to.infn.it // | |
12 | // // | |
13 | /////////////////////////////////////////////////////////////////// | |
14 | ||
15 | #include <TFormula.h> | |
16 | #include <TNamed.h> | |
17 | #include "AliPID.h" | |
18 | ||
19 | class AliITSPidParams : public TNamed { | |
20 | ||
21 | public: | |
22 | AliITSPidParams(Bool_t isMC = kFALSE); | |
23 | AliITSPidParams(Char_t * name, Bool_t isMC = kFALSE); | |
24 | ~AliITSPidParams(); | |
25 | ||
26 | void InitMC(); | |
27 | void InitData(); | |
28 | Double_t GetLandauGausNormPdgCode(Double_t dedx, Int_t pdgCode, Double_t mom, Int_t lay) const; | |
29 | Double_t GetLandauGausNorm(Double_t dedx, Int_t partType, Double_t mom, Int_t lay) const; | |
30 | ||
31 | // electron setters | |
32 | void SetSDDElecMPVparams(const Double_t* params){ | |
33 | for(Int_t ipar=0; ipar<5; ipar++) fSDDElecMPVBetheParams[ipar]=params[ipar]; | |
34 | } | |
35 | void SetSSDElecMPVparams(const Double_t* params){ | |
36 | for(Int_t ipar=0; ipar<5; ipar++) fSSDElecMPVBetheParams[ipar]=params[ipar]; | |
37 | } | |
38 | void SetSDDElecLandauWidth(const TFormula* form){ | |
39 | if(fSDDElecLandauWidth) delete fSDDElecLandauWidth; | |
40 | fSDDElecLandauWidth=new TFormula(*form); | |
41 | } | |
42 | void SetSDDElecGaussWidth(const TFormula* form){ | |
43 | if(fSDDElecGaussWidth) delete fSDDElecGaussWidth; | |
44 | fSDDElecGaussWidth=new TFormula(*form); | |
45 | } | |
46 | void SetSSDElecLandauWidth(const TFormula* form){ | |
47 | if(fSSDElecLandauWidth) delete fSSDElecLandauWidth; | |
48 | fSSDElecLandauWidth=new TFormula(*form); | |
49 | } | |
50 | void SetSSDElecGaussWidth(const TFormula* form){ | |
51 | if(fSSDElecGaussWidth) delete fSSDElecGaussWidth; | |
52 | fSSDElecGaussWidth=new TFormula(*form); | |
53 | } | |
54 | ||
55 | //Hadron setters | |
56 | void SetSDDHadronMPVparams(const Double_t* params){ | |
57 | for(Int_t ipar=0; ipar<5; ipar++) fSDDHadronMPVBetheParams[ipar]=params[ipar]; | |
58 | } | |
59 | void SetSSDHadronMPVparams(const Double_t* params){ | |
60 | for(Int_t ipar=0; ipar<5; ipar++) fSSDHadronMPVBetheParams[ipar]=params[ipar]; | |
61 | } | |
62 | ||
63 | //Pion setters | |
64 | void SetSDDPionLandauWidth(const TFormula* form){ | |
65 | if(fSDDPionLandauWidth) delete fSDDPionLandauWidth; | |
66 | fSDDPionLandauWidth=new TFormula(*form); | |
67 | } | |
68 | void SetSDDPionGaussWidth(const TFormula* form){ | |
69 | if(fSDDPionGaussWidth) delete fSDDPionGaussWidth; | |
70 | fSDDPionGaussWidth=new TFormula(*form); | |
71 | } | |
72 | void SetSSDPionLandauWidth(const TFormula* form){ | |
73 | if(fSSDPionLandauWidth) delete fSSDPionLandauWidth; | |
74 | fSSDPionLandauWidth=new TFormula(*form); | |
75 | } | |
76 | void SetSSDPionGaussWidth(const TFormula* form){ | |
77 | if(fSSDPionGaussWidth) delete fSSDPionGaussWidth; | |
78 | fSSDPionGaussWidth=new TFormula(*form); | |
79 | } | |
80 | ||
81 | // kaon setters | |
82 | void SetSDDKaonLandauWidth(const TFormula* form){ | |
83 | if(fSDDKaonLandauWidth) delete fSDDKaonLandauWidth; | |
84 | fSDDKaonLandauWidth=new TFormula(*form); | |
85 | } | |
86 | void SetSDDKaonGaussWidth(const TFormula* form){ | |
87 | if(fSDDKaonGaussWidth) delete fSDDKaonGaussWidth; | |
88 | fSDDKaonGaussWidth=new TFormula(*form); | |
89 | } | |
90 | void SetSSDKaonLandauWidth(const TFormula* form){ | |
91 | if(fSSDKaonLandauWidth) delete fSSDKaonLandauWidth; | |
92 | fSSDKaonLandauWidth=new TFormula(*form); | |
93 | } | |
94 | void SetSSDKaonGaussWidth(const TFormula* form){ | |
95 | if(fSSDKaonGaussWidth) delete fSSDKaonGaussWidth; | |
96 | fSSDKaonGaussWidth=new TFormula(*form); | |
97 | } | |
98 | ||
99 | // proton setters | |
100 | void SetSDDProtLandauWidth(const TFormula* form){ | |
101 | if(fSDDProtLandauWidth) delete fSDDProtLandauWidth; | |
102 | fSDDProtLandauWidth=new TFormula(*form); | |
103 | } | |
104 | void SetSDDProtGaussWidth(const TFormula* form){ | |
105 | if(fSDDProtGaussWidth) delete fSDDProtGaussWidth; | |
106 | fSDDProtGaussWidth=new TFormula(*form); | |
107 | } | |
108 | void SetSSDProtLandauWidth(const TFormula* form){ | |
109 | if(fSSDProtLandauWidth) delete fSSDProtLandauWidth; | |
110 | fSSDProtLandauWidth=new TFormula(*form); | |
111 | } | |
112 | void SetSSDProtGaussWidth(const TFormula* form){ | |
113 | if(fSSDProtGaussWidth) delete fSSDProtGaussWidth; | |
114 | fSSDProtGaussWidth=new TFormula(*form); | |
115 | } | |
116 | ||
117 | // electron getters | |
118 | Double_t GetSDDElecMPV(Double_t mom) const { | |
119 | Double_t mass = AliPID::ParticleMass(AliPID::kElectron); | |
120 | return BetheBloch(mom,mass,fSDDElecMPVBetheParams); | |
121 | } | |
122 | Double_t GetSDDElecLandauWidth(Double_t mom) const { | |
123 | return fSDDElecLandauWidth->Eval(mom); | |
124 | } | |
125 | Double_t GetSDDElecGaussWidth(Double_t mom) const { | |
126 | return fSDDElecGaussWidth->Eval(mom); | |
127 | } | |
128 | Double_t GetSSDElecMPV(Double_t mom) const { | |
129 | Double_t mass = AliPID::ParticleMass(AliPID::kElectron); | |
130 | return BetheBloch(mom,mass,fSSDElecMPVBetheParams); | |
131 | } | |
132 | Double_t GetSSDElecLandauWidth(Double_t mom) const { | |
133 | return fSSDElecLandauWidth->Eval(mom); | |
134 | } | |
135 | Double_t GetSSDElecGaussWidth(Double_t mom) const { | |
136 | return fSSDElecGaussWidth->Eval(mom); | |
137 | } | |
138 | ||
139 | // pion getters | |
140 | Double_t GetSDDPionMPV(Double_t mom) const { | |
141 | Double_t mass = AliPID::ParticleMass(AliPID::kPion); | |
142 | return BetheBloch(mom,mass,fSDDHadronMPVBetheParams); | |
143 | } | |
144 | Double_t GetSDDPionLandauWidth(Double_t mom) const { | |
145 | return fSDDPionLandauWidth->Eval(mom); | |
146 | } | |
147 | Double_t GetSDDPionGaussWidth(Double_t mom) const { | |
148 | return fSDDPionGaussWidth->Eval(mom); | |
149 | } | |
150 | Double_t GetSSDPionMPV(Double_t mom) const { | |
151 | Double_t mass = AliPID::ParticleMass(AliPID::kPion); | |
152 | return BetheBloch(mom,mass,fSSDHadronMPVBetheParams); | |
153 | } | |
154 | Double_t GetSSDPionLandauWidth(Double_t mom) const { | |
155 | return fSSDPionLandauWidth->Eval(mom); | |
156 | } | |
157 | Double_t GetSSDPionGaussWidth(Double_t mom) const { | |
158 | return fSSDPionGaussWidth->Eval(mom); | |
159 | } | |
160 | ||
161 | // kaon getters | |
162 | Double_t GetSDDKaonMPV(Double_t mom) const { | |
163 | Double_t mass = AliPID::ParticleMass(AliPID::kKaon); | |
164 | return BetheBloch(mom,mass,fSDDHadronMPVBetheParams); | |
165 | } | |
166 | Double_t GetSDDKaonLandauWidth(Double_t mom) const { | |
167 | Double_t xlw = 0.3; | |
168 | Double_t xup = 0.4; | |
169 | if (mom > xlw) return fSDDKaonLandauWidth->Eval(mom); | |
170 | else { | |
171 | Double_t ylw =fSDDKaonLandauWidth->Eval(xlw); | |
172 | Double_t yup =fSDDKaonLandauWidth->Eval(xup); | |
173 | return ExtrapolateWidth(mom,xlw,ylw,xup,yup); | |
174 | } | |
175 | } | |
176 | Double_t GetSDDKaonGaussWidth(Double_t mom) const { | |
177 | Double_t xlw = 0.3; | |
178 | Double_t xup = 0.4; | |
179 | if (mom > xlw) return fSDDKaonGaussWidth->Eval(mom); | |
180 | else { | |
181 | Double_t ylw =fSDDKaonGaussWidth->Eval(xlw); | |
182 | Double_t yup =fSDDKaonGaussWidth->Eval(xup); | |
183 | return ExtrapolateWidth(mom,xlw,ylw,xup,yup); | |
184 | } | |
185 | } | |
186 | Double_t GetSSDKaonMPV(Double_t mom) const { | |
187 | Double_t mass = AliPID::ParticleMass(AliPID::kKaon); | |
188 | return BetheBloch(mom,mass,fSSDHadronMPVBetheParams); | |
189 | } | |
190 | Double_t GetSSDKaonLandauWidth(Double_t mom) const { | |
191 | Double_t xlw = 0.3; | |
192 | Double_t xup = 0.4; | |
193 | if (mom > xlw) return fSSDKaonLandauWidth->Eval(mom); | |
194 | else { | |
195 | Double_t ylw =fSSDKaonLandauWidth->Eval(xlw); | |
196 | Double_t yup =fSSDKaonLandauWidth->Eval(xup); | |
197 | return ExtrapolateWidth(mom,xlw,ylw,xup,yup); | |
198 | } | |
199 | } | |
200 | Double_t GetSSDKaonGaussWidth(Double_t mom) const { | |
201 | Double_t xlw = 0.3; | |
202 | Double_t xup = 0.4; | |
203 | if (mom > xlw) return fSSDKaonGaussWidth->Eval(mom); | |
204 | else { | |
205 | Double_t ylw =fSSDKaonGaussWidth->Eval(xlw); | |
206 | Double_t yup =fSSDKaonGaussWidth->Eval(xup); | |
207 | return ExtrapolateWidth(mom,xlw,ylw,xup,yup); | |
208 | } | |
209 | } | |
210 | ||
211 | // proton getters | |
212 | Double_t GetSDDProtMPV(Double_t mom) const { | |
213 | Double_t mass = AliPID::ParticleMass(AliPID::kProton); | |
214 | return BetheBloch(mom,mass,fSDDHadronMPVBetheParams); | |
215 | } | |
216 | Double_t GetSDDProtLandauWidth(Double_t mom) const { | |
217 | Double_t xlw = 0.35; | |
218 | Double_t xup = 0.45; | |
219 | if (mom > xlw) return fSDDProtLandauWidth->Eval(mom); | |
220 | else { | |
221 | Double_t ylw =fSDDProtLandauWidth->Eval(xlw); | |
222 | Double_t yup =fSDDProtLandauWidth->Eval(xup); | |
223 | return ExtrapolateWidth(mom,xlw,ylw,xup,yup); | |
224 | } | |
225 | } | |
226 | Double_t GetSDDProtGaussWidth(Double_t mom) const { | |
227 | Double_t xlw = 0.35; | |
228 | Double_t xup = 0.45; | |
229 | if (mom > xlw) return fSDDProtGaussWidth->Eval(mom); | |
230 | else { | |
231 | Double_t ylw =fSDDProtGaussWidth->Eval(xlw); | |
232 | Double_t yup =fSDDProtGaussWidth->Eval(xup); | |
233 | return ExtrapolateWidth(mom,xlw,ylw,xup,yup); | |
234 | } | |
235 | } | |
236 | Double_t GetSSDProtMPV(Double_t mom) const { | |
237 | Double_t mass = AliPID::ParticleMass(AliPID::kProton); | |
238 | return BetheBloch(mom,mass,fSSDHadronMPVBetheParams); | |
239 | } | |
240 | Double_t GetSSDProtLandauWidth(Double_t mom) const { | |
241 | Double_t xlw = 0.35; | |
242 | Double_t xup = 0.45; | |
243 | if (mom > xlw) return fSSDProtLandauWidth->Eval(mom); | |
244 | else { | |
245 | Double_t ylw =fSSDProtLandauWidth->Eval(xlw); | |
246 | Double_t yup =fSSDProtLandauWidth->Eval(xup); | |
247 | return ExtrapolateWidth(mom,xlw,ylw,xup,yup); | |
248 | } | |
249 | } | |
250 | Double_t GetSSDProtGaussWidth(Double_t mom) const { | |
251 | Double_t xlw = 0.35; | |
252 | Double_t xup = 0.45; | |
253 | if (mom > xlw) return fSSDProtGaussWidth->Eval(mom); | |
254 | else { | |
255 | Double_t ylw =fSSDProtGaussWidth->Eval(xlw); | |
256 | Double_t yup =fSSDProtGaussWidth->Eval(xup); | |
257 | return ExtrapolateWidth(mom,xlw,ylw,xup,yup); | |
258 | } | |
259 | } | |
260 | ||
261 | private: | |
262 | ||
263 | AliITSPidParams(const AliITSPidParams& rec); | |
264 | AliITSPidParams& operator=(const AliITSPidParams &source); | |
265 | ||
266 | Double_t BetheBloch(Double_t mom, Double_t mass, const Double_t* p) const; | |
267 | Double_t ExtrapolateWidth(Double_t mom, Double_t x1, Double_t y1, Double_t x2, Double_t y2) const; | |
268 | ||
269 | // Electron parameterizations | |
270 | Double_t fSDDElecMPVBetheParams[5]; // Electron bethe block parameters in SDD | |
271 | Double_t fSSDElecMPVBetheParams[5]; // Electron bethe block parameters in SSD | |
272 | ||
273 | TFormula* fSDDElecLandauWidth; // Electron dE/dx Landau width vs. p in SDD | |
274 | TFormula* fSDDElecGaussWidth; // Electron dE/dx Gaussian width vs. p in SDD | |
275 | ||
276 | TFormula* fSSDElecLandauWidth; // Electron dE/dx Landau width vs. p in SSD | |
277 | TFormula* fSSDElecGaussWidth; // Electron dE/dx Gaussian width vs. p in SSD | |
278 | ||
279 | // Hadron parameterizations | |
280 | Double_t fSDDHadronMPVBetheParams[5]; // hadrons bethe block parameters in SDD | |
281 | Double_t fSSDHadronMPVBetheParams[5]; // hadrons bethe block parameters in SSD | |
282 | ||
283 | TFormula* fSDDPionLandauWidth; // pion dE/dx Landau width vs. p in SDD | |
284 | TFormula* fSDDPionGaussWidth; // pion dE/dx Gaussian width vs. p in SDD | |
285 | ||
286 | TFormula* fSSDPionLandauWidth; // pion dE/dx Landau width vs. p in SSD | |
287 | TFormula* fSSDPionGaussWidth; // pion dE/dx Gaussian width vs. p in SSD | |
288 | ||
289 | TFormula* fSDDKaonLandauWidth; // kaon dE/dx Landau width vs. p in SDD | |
290 | TFormula* fSDDKaonGaussWidth; // kaon dE/dx Gaussian width vs. p in SDD | |
291 | ||
292 | TFormula* fSSDKaonLandauWidth; // kaon dE/dx Landau width vs. p in SSD | |
293 | TFormula* fSSDKaonGaussWidth; // kaon dE/dx Gaussian width vs. p in SSD | |
294 | ||
295 | TFormula* fSDDProtLandauWidth; // Proton dE/dx Landau width vs. p in SDD | |
296 | TFormula* fSDDProtGaussWidth; // Proton dE/dx Gaussian width vs. p in SDD | |
297 | ||
298 | TFormula* fSSDProtLandauWidth; // Proton dE/dx Landau width vs. p in SSD | |
299 | TFormula* fSSDProtGaussWidth; // Proton dE/dx Gaussian width vs. p in SSD | |
300 | ||
301 | ||
302 | ||
303 | ClassDef(AliITSPidParams,2); | |
304 | }; | |
305 | #endif |