]> git.uio.no Git - u/mrichter/AliRoot.git/blob - STEER/STEERBase/AliITSPidParams.h
Fix for IsTriggerInputFired,GetFiredTriggerInputs
[u/mrichter/AliRoot.git] / STEER / STEERBase / AliITSPidParams.h
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 xmin = 0.2;
168     mom = (mom > xmin) ? mom : xmin;
169     return fSDDKaonLandauWidth->Eval(mom);
170   }
171   Double_t GetSDDKaonGaussWidth(Double_t mom) const {
172     Double_t xmin = 0.2;
173     mom = (mom > xmin) ? mom : xmin;
174     return fSDDKaonGaussWidth->Eval(mom);
175   }
176   Double_t GetSSDKaonMPV(Double_t mom) const {
177     Double_t mass = AliPID::ParticleMass(AliPID::kKaon);
178     return BetheBloch(mom,mass,fSSDHadronMPVBetheParams);
179   }
180   Double_t GetSSDKaonLandauWidth(Double_t mom) const {
181     Double_t xmin = 0.2;
182     mom = (mom > xmin) ? mom : xmin;
183     return fSSDKaonLandauWidth->Eval(mom);
184   }
185   Double_t GetSSDKaonGaussWidth(Double_t mom) const {
186     Double_t xmin = 0.2;
187     mom = (mom > xmin) ? mom : xmin;
188     return fSSDKaonGaussWidth->Eval(mom);
189   }
190
191   // proton getters
192   Double_t GetSDDProtMPV(Double_t mom) const {
193     Double_t mass = AliPID::ParticleMass(AliPID::kProton);
194     return BetheBloch(mom,mass,fSDDHadronMPVBetheParams);
195   }
196   Double_t GetSDDProtLandauWidth(Double_t mom) const {
197     Double_t xmin = 0.4;
198     mom = (mom > xmin) ? mom : xmin;
199     return fSDDProtLandauWidth->Eval(mom);
200   }
201   Double_t GetSDDProtGaussWidth(Double_t mom) const {
202     Double_t xmin = 0.4;
203     mom = (mom > xmin) ? mom : xmin;
204     return fSDDProtGaussWidth->Eval(mom);
205   }
206   Double_t GetSSDProtMPV(Double_t mom) const {
207     Double_t mass = AliPID::ParticleMass(AliPID::kProton);
208     return BetheBloch(mom,mass,fSSDHadronMPVBetheParams);
209   }
210   Double_t GetSSDProtLandauWidth(Double_t mom) const {
211     Double_t xmin = 0.4;
212     mom = (mom > xmin) ? mom : xmin;
213     return fSSDProtLandauWidth->Eval(mom);
214   }
215   Double_t GetSSDProtGaussWidth(Double_t mom) const {
216     Double_t xmin = 0.4;
217     mom = (mom > xmin) ? mom : xmin;
218     return fSSDProtGaussWidth->Eval(mom);
219   }
220
221  private:
222   
223   AliITSPidParams(const AliITSPidParams& rec);
224   AliITSPidParams& operator=(const AliITSPidParams &source);
225
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  
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
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
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
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
255   TFormula* fSDDProtLandauWidth; // Proton dE/dx Landau width vs. p in SDD
256   TFormula* fSDDProtGaussWidth;  // Proton dE/dx Gaussian width vs. p in SDD
257
258   TFormula* fSSDProtLandauWidth; // Proton dE/dx Landau width vs. p in SSD
259   TFormula* fSSDProtGaussWidth;  // Proton dE/dx Gaussian width vs. p in SSD
260
261
262   
263   ClassDef(AliITSPidParams,2);
264 };
265 #endif
266