]> git.uio.no Git - u/mrichter/AliRoot.git/blame - STEER/STEERBase/AliITSPidParams.h
speed up with binary search
[u/mrichter/AliRoot.git] / STEER / STEERBase / AliITSPidParams.h
CommitLineData
b536a002 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// //
2ca1f4ee 10// Class to store parameters of ITS response functions //
b536a002 11// Origin: F.Prino, Torino, prino@to.infn.it //
12// //
13///////////////////////////////////////////////////////////////////
14
15#include <TFormula.h>
16#include <TNamed.h>
2ca1f4ee 17#include "AliPID.h"
b536a002 18
19class AliITSPidParams : public TNamed {
20
21 public:
b52bfc67 22 AliITSPidParams(Bool_t isMC = kFALSE);
23 AliITSPidParams(Char_t * name, Bool_t isMC = kFALSE);
b536a002 24 ~AliITSPidParams();
b52bfc67 25
8abeb05b 26 void InitMC();
b52bfc67 27 void InitData();
b536a002 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;
b52bfc67 30
2ca1f4ee 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);
b536a002 53 }
2ca1f4ee 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
09e17991 64 void SetSDDPionLandauWidth(const TFormula* form){
b536a002 65 if(fSDDPionLandauWidth) delete fSDDPionLandauWidth;
66 fSDDPionLandauWidth=new TFormula(*form);
67 }
09e17991 68 void SetSDDPionGaussWidth(const TFormula* form){
b536a002 69 if(fSDDPionGaussWidth) delete fSDDPionGaussWidth;
70 fSDDPionGaussWidth=new TFormula(*form);
2ca1f4ee 71 }
09e17991 72 void SetSSDPionLandauWidth(const TFormula* form){
b536a002 73 if(fSSDPionLandauWidth) delete fSSDPionLandauWidth;
74 fSSDPionLandauWidth=new TFormula(*form);
75 }
09e17991 76 void SetSSDPionGaussWidth(const TFormula* form){
b536a002 77 if(fSSDPionGaussWidth) delete fSSDPionGaussWidth;
78 fSSDPionGaussWidth=new TFormula(*form);
79 }
80
81 // kaon setters
09e17991 82 void SetSDDKaonLandauWidth(const TFormula* form){
b536a002 83 if(fSDDKaonLandauWidth) delete fSDDKaonLandauWidth;
84 fSDDKaonLandauWidth=new TFormula(*form);
85 }
09e17991 86 void SetSDDKaonGaussWidth(const TFormula* form){
b536a002 87 if(fSDDKaonGaussWidth) delete fSDDKaonGaussWidth;
88 fSDDKaonGaussWidth=new TFormula(*form);
89 }
09e17991 90 void SetSSDKaonLandauWidth(const TFormula* form){
b536a002 91 if(fSSDKaonLandauWidth) delete fSSDKaonLandauWidth;
92 fSSDKaonLandauWidth=new TFormula(*form);
93 }
09e17991 94 void SetSSDKaonGaussWidth(const TFormula* form){
b536a002 95 if(fSSDKaonGaussWidth) delete fSSDKaonGaussWidth;
96 fSSDKaonGaussWidth=new TFormula(*form);
97 }
98
b536a002 99 // proton setters
09e17991 100 void SetSDDProtLandauWidth(const TFormula* form){
b536a002 101 if(fSDDProtLandauWidth) delete fSDDProtLandauWidth;
102 fSDDProtLandauWidth=new TFormula(*form);
103 }
09e17991 104 void SetSDDProtGaussWidth(const TFormula* form){
b536a002 105 if(fSDDProtGaussWidth) delete fSDDProtGaussWidth;
106 fSDDProtGaussWidth=new TFormula(*form);
107 }
09e17991 108 void SetSSDProtLandauWidth(const TFormula* form){
b536a002 109 if(fSSDProtLandauWidth) delete fSSDProtLandauWidth;
110 fSSDProtLandauWidth=new TFormula(*form);
111 }
09e17991 112 void SetSSDProtGaussWidth(const TFormula* form){
b536a002 113 if(fSSDProtGaussWidth) delete fSSDProtGaussWidth;
114 fSSDProtGaussWidth=new TFormula(*form);
115 }
116
2ca1f4ee 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 }
b536a002 138
139 // pion getters
140 Double_t GetSDDPionMPV(Double_t mom) const {
2ca1f4ee 141 Double_t mass = AliPID::ParticleMass(AliPID::kPion);
142 return BetheBloch(mom,mass,fSDDHadronMPVBetheParams);
b536a002 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 {
2ca1f4ee 151 Double_t mass = AliPID::ParticleMass(AliPID::kPion);
152 return BetheBloch(mom,mass,fSSDHadronMPVBetheParams);
b536a002 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 {
2ca1f4ee 163 Double_t mass = AliPID::ParticleMass(AliPID::kKaon);
164 return BetheBloch(mom,mass,fSDDHadronMPVBetheParams);
b536a002 165 }
166 Double_t GetSDDKaonLandauWidth(Double_t mom) const {
d0330596 167 Double_t xmin = 0.2;
168 mom = (mom > xmin) ? mom : xmin;
169 return fSDDKaonLandauWidth->Eval(mom);
b536a002 170 }
171 Double_t GetSDDKaonGaussWidth(Double_t mom) const {
d0330596 172 Double_t xmin = 0.2;
173 mom = (mom > xmin) ? mom : xmin;
174 return fSDDKaonGaussWidth->Eval(mom);
b536a002 175 }
176 Double_t GetSSDKaonMPV(Double_t mom) const {
2ca1f4ee 177 Double_t mass = AliPID::ParticleMass(AliPID::kKaon);
178 return BetheBloch(mom,mass,fSSDHadronMPVBetheParams);
b536a002 179 }
180 Double_t GetSSDKaonLandauWidth(Double_t mom) const {
d0330596 181 Double_t xmin = 0.2;
182 mom = (mom > xmin) ? mom : xmin;
183 return fSSDKaonLandauWidth->Eval(mom);
b536a002 184 }
185 Double_t GetSSDKaonGaussWidth(Double_t mom) const {
d0330596 186 Double_t xmin = 0.2;
187 mom = (mom > xmin) ? mom : xmin;
188 return fSSDKaonGaussWidth->Eval(mom);
b536a002 189 }
190
191 // proton getters
192 Double_t GetSDDProtMPV(Double_t mom) const {
2ca1f4ee 193 Double_t mass = AliPID::ParticleMass(AliPID::kProton);
194 return BetheBloch(mom,mass,fSDDHadronMPVBetheParams);
b536a002 195 }
196 Double_t GetSDDProtLandauWidth(Double_t mom) const {
d0330596 197 Double_t xmin = 0.4;
198 mom = (mom > xmin) ? mom : xmin;
199 return fSDDProtLandauWidth->Eval(mom);
b536a002 200 }
201 Double_t GetSDDProtGaussWidth(Double_t mom) const {
d0330596 202 Double_t xmin = 0.4;
203 mom = (mom > xmin) ? mom : xmin;
204 return fSDDProtGaussWidth->Eval(mom);
b536a002 205 }
206 Double_t GetSSDProtMPV(Double_t mom) const {
2ca1f4ee 207 Double_t mass = AliPID::ParticleMass(AliPID::kProton);
208 return BetheBloch(mom,mass,fSSDHadronMPVBetheParams);
b536a002 209 }
210 Double_t GetSSDProtLandauWidth(Double_t mom) const {
d0330596 211 Double_t xmin = 0.4;
212 mom = (mom > xmin) ? mom : xmin;
213 return fSSDProtLandauWidth->Eval(mom);
b536a002 214 }
215 Double_t GetSSDProtGaussWidth(Double_t mom) const {
d0330596 216 Double_t xmin = 0.4;
217 mom = (mom > xmin) ? mom : xmin;
218 return fSSDProtGaussWidth->Eval(mom);
b536a002 219 }
220
221 private:
b52bfc67 222
b536a002 223 AliITSPidParams(const AliITSPidParams& rec);
224 AliITSPidParams& operator=(const AliITSPidParams &source);
225
2ca1f4ee 226 Double_t BetheBloch(Double_t mom, Double_t mass, const Double_t* p) const;
227 Double_t ExtrapolateWidth(Double_t mom, Double_t x1, Double_t y1, Double_t x2, Double_t y2) const;
228
229 // Electron parameterizations
230 Double_t fSDDElecMPVBetheParams[5]; // Electron bethe block parameters in SDD
231 Double_t fSSDElecMPVBetheParams[5]; // Electron bethe block parameters in SSD
232
233 TFormula* fSDDElecLandauWidth; // Electron dE/dx Landau width vs. p in SDD
234 TFormula* fSDDElecGaussWidth; // Electron dE/dx Gaussian width vs. p in SDD
235
236 TFormula* fSSDElecLandauWidth; // Electron dE/dx Landau width vs. p in SSD
237 TFormula* fSSDElecGaussWidth; // Electron dE/dx Gaussian width vs. p in SSD
238
239 // Hadron parameterizations
240 Double_t fSDDHadronMPVBetheParams[5]; // hadrons bethe block parameters in SDD
241 Double_t fSSDHadronMPVBetheParams[5]; // hadrons bethe block parameters in SSD
242
b536a002 243 TFormula* fSDDPionLandauWidth; // pion dE/dx Landau width vs. p in SDD
244 TFormula* fSDDPionGaussWidth; // pion dE/dx Gaussian width vs. p in SDD
245
b536a002 246 TFormula* fSSDPionLandauWidth; // pion dE/dx Landau width vs. p in SSD
247 TFormula* fSSDPionGaussWidth; // pion dE/dx Gaussian width vs. p in SSD
248
b536a002 249 TFormula* fSDDKaonLandauWidth; // kaon dE/dx Landau width vs. p in SDD
250 TFormula* fSDDKaonGaussWidth; // kaon dE/dx Gaussian width vs. p in SDD
251
b536a002 252 TFormula* fSSDKaonLandauWidth; // kaon dE/dx Landau width vs. p in SSD
253 TFormula* fSSDKaonGaussWidth; // kaon dE/dx Gaussian width vs. p in SSD
254
2ca1f4ee 255 TFormula* fSDDProtLandauWidth; // Proton dE/dx Landau width vs. p in SDD
256 TFormula* fSDDProtGaussWidth; // Proton dE/dx Gaussian width vs. p in SDD
b536a002 257
2ca1f4ee 258 TFormula* fSSDProtLandauWidth; // Proton dE/dx Landau width vs. p in SSD
259 TFormula* fSSDProtGaussWidth; // Proton dE/dx Gaussian width vs. p in SSD
b536a002 260
2ca1f4ee 261
262
263 ClassDef(AliITSPidParams,2);
b536a002 264};
265#endif
d0330596 266