simple-tof-analysis
 All Classes Namespaces Functions Variables Groups Pages
BetheBlochFunctions.h
1 /*
2  * BetheBlochFunctions.h
3  *
4  * Created on: Jun 13, 2014
5  * Author: Silvestro di Luise
6  * Silvestro.Di.Luise@cern.ch
7  *
8  *
9  * Name-spaced Folder of Bethe-Bloch parametrizations
10  *
11  * Functions must be declared static to avoid
12  * "Duplicate Symbol" error at compile time in the case
13  * the file is included multiple times
14  *
15  *
16  *
17  */
18 
19 #ifndef BETHEBLOCHFUNCTIONS_H_
20 #define BETHEBLOCHFUNCTIONS_H_
21 
22 
23 #include <cmath>
24 
25 
26 
27 namespace BETHE_BLOCH_FUNC{
28 
29  //
30  // some params for initialization
31  //
32  static const double PAR_INPUT[5]={0.0663945,9.04358,2.49409,0.164471,0.216649};
33 
34 
35  //==================================================
36 
37 
38  static double BetheBloch(double *x, double *par){
39 
46  const double bg = x[0];
47  //const double bg = pow(10,x[0]);
48  const double beta2 = bg*bg / (1.0 + bg*bg);
49  const double lnbg = log(bg);
50  const double X = log10(bg);
51  //const double X = x[0];
52 
53  double E0 = par[0];
54  double C = par[1];
55  double XA = par[2];
56  double a = par[3];
57 
58  //if(a==0) a=0.001;
59 
60  /*
61  E0=0.0693708;
62  C =11.7495;
63  XA=2.15453;
64  a =0.389196;
65  //if(a==0) a=0.001;
66  */
67 
68  /*
69  E0=0.0693708;
70  C =11.7495;
71  XA=2.15453;
72  a =0.389196;
73  */
74 
75  // density effect correction as parametrised in Sternhaimer PhysRevB 1971
76  const double common = sqrt(2.0*log(10)/(a*3.0)) / 3.0;
77  const double X0 = XA - common; // from continuity conditions
78  const double X1 = XA + 2.0*common; // from continuity conditions
79  double delta = 0; // the correction
80  if (X > X0) {
81  delta += 2.0 * log(10) * (X - XA);
82  if (X < X1)
83  delta += a * (X1-X)*(X1-X)*(X1-X);
84  }
85 
86  return E0/beta2 * (C + 2.0*lnbg - beta2 - delta) + par[4];
87 
88  }
89 
90  //==================================================
91 
92 
93 
94 }
95 
96 
97 
98 
99 #endif /* BETHEBLOCHFUNCTIONS_H_ */