StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
myBetheBloch.cxx
1 //
2 // $Id myBetheBloch.cc $
3 //
4 // Description
5 // Using values of the dedx vs. kinetic energy curve.
6 // taken from GEANT.
7 //
8 // curve was generated using geometry from geant.
9 // need to transform to dedx vs. beta gamma
10 // this is done by
11 // 1) reading the kinetic energy and dedx value
12 // 2) obtain energy by energy = kinetic energy + mass
13 // 3) calculate beta*gamma = p/m where p = ::sqrt(e^2 - m^2)
14 // 4) insert into the map of beta gamma - dedx values
15 //
16 // The function returns a linear interpolation between
17 // the 2 closest bins.
18 
19 // If betagamma < 2.5, the function returns a value proportional
20 // to 1/ beta^2
21 // There is an overall normalization factor obtained from a fit
22 // and there is a relative normalization factor between the simple
23 // 1/beta^2 region and the values from the table.
24 
25 #include <vector>
26 #include "myBetheBloch.h"
27 
28 #ifndef ST_NO_NAMESPACES
29 using std::vector;
30 #endif
31 
32 ClassImp(myBetheBloch)
33 
35  // it's more elegant to read the values from a file, but to put it
36  // in the StarClassLibrary without extra files, we have to dump the numbers
37  // here
38  // could also fill them directly in the map, or transform the numbers directly
39  // to beta gamma.
40 
41  vector<double> kinVec;
42  vector<double> ionizVec; // Protons
43  kinVec.push_back(0.216355);ionizVec.push_back(2.38171e-05);
44  kinVec.push_back(0.22275 );ionizVec.push_back(2.25295e-05);
45  kinVec.push_back(0.229145);ionizVec.push_back(2.13482e-05);
46  kinVec.push_back(0.235539);ionizVec.push_back(2.02618e-05);
47  kinVec.push_back(0.241934);ionizVec.push_back(1.92604e-05);
48  kinVec.push_back(0.248329);ionizVec.push_back(1.83354e-05);
49  kinVec.push_back(0.254723);ionizVec.push_back(1.74791e-05);
50  kinVec.push_back(0.261118);ionizVec.push_back(1.6685e-05 );
51  kinVec.push_back(0.267513);ionizVec.push_back(1.63046e-05);
52  kinVec.push_back(0.273908);ionizVec.push_back(1.56024e-05);
53  kinVec.push_back(0.280302);ionizVec.push_back(1.49478e-05);
54  kinVec.push_back(0.286697);ionizVec.push_back(1.43364e-05);
55  kinVec.push_back(0.293092);ionizVec.push_back(1.37647e-05);
56  kinVec.push_back(0.299487);ionizVec.push_back(1.32291e-05);
57  kinVec.push_back(0.305881);ionizVec.push_back(1.27268e-05);
58  kinVec.push_back(0.312276);ionizVec.push_back(1.2255e-05 );
59  kinVec.push_back(0.318671);ionizVec.push_back(1.18114e-05);
60  kinVec.push_back(0.325066);ionizVec.push_back(1.13592e-05);
61  kinVec.push_back(0.33146 );ionizVec.push_back(1.09666e-05);
62  kinVec.push_back(0.337855);ionizVec.push_back(1.05961e-05);
63  kinVec.push_back(0.34425 );ionizVec.push_back(1.02462e-05);
64  kinVec.push_back(0.350644);ionizVec.push_back(9.91509e-06);
65  kinVec.push_back(0.357039);ionizVec.push_back(9.6016e-06 );
66  kinVec.push_back(0.363434);ionizVec.push_back(9.30456e-06);
67  kinVec.push_back(0.369829);ionizVec.push_back(9.02278e-06);
68  kinVec.push_back(0.376223);ionizVec.push_back(8.81998e-06);
69  kinVec.push_back(0.382618);ionizVec.push_back(8.56388e-06);
70  kinVec.push_back(0.389013);ionizVec.push_back(8.32029e-06);
71  kinVec.push_back(0.395408);ionizVec.push_back(8.08844e-06);
72  kinVec.push_back(0.401802);ionizVec.push_back(7.86756e-06);
73  kinVec.push_back(0.408197);ionizVec.push_back(7.65699e-06);
74  kinVec.push_back(0.414592);ionizVec.push_back(7.45608e-06);
75  kinVec.push_back(0.420987);ionizVec.push_back(7.26426e-06);
76  kinVec.push_back(0.427381);ionizVec.push_back(7.12715e-06);
77  kinVec.push_back(0.433776);ionizVec.push_back(6.95077e-06);
78  kinVec.push_back(0.440171);ionizVec.push_back(6.78204e-06);
79  kinVec.push_back(0.446565);ionizVec.push_back(6.62049e-06);
80  kinVec.push_back(0.45296 );ionizVec.push_back(6.46574e-06);
81  kinVec.push_back(0.459355);ionizVec.push_back(6.3174e-06 );
82  kinVec.push_back(0.46575 );ionizVec.push_back(6.17514e-06);
83  kinVec.push_back(0.472144);ionizVec.push_back(6.03861e-06);
84  kinVec.push_back(0.478539);ionizVec.push_back(5.90753e-06);
85  kinVec.push_back(0.484934);ionizVec.push_back(5.82937e-06);
86  kinVec.push_back(0.491329);ionizVec.push_back(5.70733e-06);
87  kinVec.push_back(0.497723);ionizVec.push_back(5.58995e-06);
88  kinVec.push_back(0.504118);ionizVec.push_back(5.47701e-06);
89  kinVec.push_back(0.510513);ionizVec.push_back(5.36829e-06);
90  kinVec.push_back(0.516908);ionizVec.push_back(5.26358e-06);
91  kinVec.push_back(0.523302);ionizVec.push_back(5.16268e-06);
92  kinVec.push_back(0.529697);ionizVec.push_back(5.06542e-06);
93  kinVec.push_back(0.536092);ionizVec.push_back(4.95505e-06);
94  kinVec.push_back(0.542486);ionizVec.push_back(4.86486e-06);
95  kinVec.push_back(0.548881);ionizVec.push_back(4.77779e-06);
96  kinVec.push_back(0.555276);ionizVec.push_back(4.6937e-06 );
97  kinVec.push_back(0.561671);ionizVec.push_back(4.61248e-06);
98  kinVec.push_back(0.568065);ionizVec.push_back(4.53397e-06);
99  kinVec.push_back(0.57446 );ionizVec.push_back(4.45809e-06);
100  kinVec.push_back(0.580855);ionizVec.push_back(4.38469e-06);
101  kinVec.push_back(0.58725 );ionizVec.push_back(4.32523e-06);
102  kinVec.push_back(0.593644);ionizVec.push_back(4.25631e-06);
103  kinVec.push_back(0.600039);ionizVec.push_back(4.18958e-06);
104  kinVec.push_back(0.606434);ionizVec.push_back(4.12496e-06);
105  kinVec.push_back(0.612828);ionizVec.push_back(4.06236e-06);
106  kinVec.push_back(0.619223);ionizVec.push_back(4.00167e-06);
107  kinVec.push_back(0.625618);ionizVec.push_back(3.94284e-06);
108  kinVec.push_back(0.632013);ionizVec.push_back(3.88579e-06);
109  kinVec.push_back(0.638407);ionizVec.push_back(3.83045e-06);
110  kinVec.push_back(0.644802);ionizVec.push_back(3.78096e-06);
111  kinVec.push_back(0.651197);ionizVec.push_back(3.72878e-06);
112  kinVec.push_back(0.657592);ionizVec.push_back(3.6781e-06 );
113  kinVec.push_back(0.663986);ionizVec.push_back(3.62888e-06);
114  kinVec.push_back(0.670381);ionizVec.push_back(3.58106e-06);
115  kinVec.push_back(0.676776);ionizVec.push_back(3.53459e-06);
116  kinVec.push_back(0.683171);ionizVec.push_back(3.48941e-06);
117  kinVec.push_back(0.689565);ionizVec.push_back(3.4455e-06 );
118  kinVec.push_back(0.69596 );ionizVec.push_back(3.39852e-06);
119  kinVec.push_back(0.702355);ionizVec.push_back(3.35701e-06);
120  kinVec.push_back(0.708749);ionizVec.push_back(3.31663e-06);
121  kinVec.push_back(0.715144);ionizVec.push_back(3.27733e-06);
122  kinVec.push_back(0.721539);ionizVec.push_back(3.23906e-06);
123  kinVec.push_back(0.727934);ionizVec.push_back(3.20181e-06);
124  kinVec.push_back(0.734328);ionizVec.push_back(3.16551e-06);
125  kinVec.push_back(0.740723);ionizVec.push_back(3.13016e-06);
126  kinVec.push_back(0.747118);ionizVec.push_back(3.08976e-06);
127  kinVec.push_back(0.753513);ionizVec.push_back(3.05624e-06);
128  kinVec.push_back(0.759907);ionizVec.push_back(3.02358e-06);
129  kinVec.push_back(0.766302);ionizVec.push_back(2.99172e-06);
130  kinVec.push_back(0.772697);ionizVec.push_back(2.96065e-06);
131  kinVec.push_back(0.779092);ionizVec.push_back(2.93033e-06);
132  kinVec.push_back(0.785486);ionizVec.push_back(2.90077e-06);
133  kinVec.push_back(0.791881);ionizVec.push_back(2.87191e-06);
134  kinVec.push_back(0.798276);ionizVec.push_back(2.84375e-06);
135  kinVec.push_back(0.80467 );ionizVec.push_back(2.80652e-06);
136  kinVec.push_back(0.811065);ionizVec.push_back(2.77976e-06);
137  kinVec.push_back(0.81746 );ionizVec.push_back(2.75364e-06);
138  kinVec.push_back(0.823855);ionizVec.push_back(2.72812e-06);
139  kinVec.push_back(0.830249);ionizVec.push_back(2.70318e-06);
140  kinVec.push_back(0.836644);ionizVec.push_back(2.67881e-06);
141  kinVec.push_back(0.843039);ionizVec.push_back(2.65499e-06);
142  kinVec.push_back(0.849434);ionizVec.push_back(2.63171e-06);
143 
144  // Pions // Pions
145  kinVec.push_back(0.92068);ionizVec.push_back(2.44711e-06);//ionizVec.push_back(2.44711e-06);
146  kinVec.push_back(1.05682);ionizVec.push_back(2.12787e-06);//ionizVec.push_back(2.12787e-06);
147  kinVec.push_back(1.19295);ionizVec.push_back(1.91688e-06);//ionizVec.push_back(1.91688e-06);
148  kinVec.push_back(1.32908);ionizVec.push_back(1.76312e-06);//ionizVec.push_back(1.76312e-06);
149  kinVec.push_back(1.46522);ionizVec.push_back(1.65432e-06);//ionizVec.push_back(1.65432e-06);
150  kinVec.push_back(1.60135);ionizVec.push_back(1.56874e-06);//ionizVec.push_back(1.56874e-06);
151  kinVec.push_back(1.73748);ionizVec.push_back(1.50247e-06);//ionizVec.push_back(1.50247e-06);
152  kinVec.push_back(1.87361);ionizVec.push_back(1.46839e-06);//ionizVec.push_back(1.46839e-06);
153  kinVec.push_back(2.00974);ionizVec.push_back(1.42577e-06);//ionizVec.push_back(1.42577e-06);
154  kinVec.push_back(2.14588);ionizVec.push_back(1.39101e-06);//ionizVec.push_back(1.39101e-06);
155  kinVec.push_back(2.28201);ionizVec.push_back(1.38415e-06);//ionizVec.push_back(1.38415e-06);
156  kinVec.push_back(2.41814);ionizVec.push_back(1.35975e-06);//ionizVec.push_back(1.35975e-06
157  kinVec.push_back(2.55427);ionizVec.push_back(1.34999e-06);//ionizVec.push_back(1.34999e-06);
158  kinVec.push_back(2.69041);ionizVec.push_back(1.34375e-06);//ionizVec.push_back(1.34375e-06);
159  kinVec.push_back(2.82654);ionizVec.push_back(1.3375e-06 );//ionizVec.push_back(1.3375e-06 );
160  kinVec.push_back(2.96267);ionizVec.push_back(1.32839e-06);//ionizVec.push_back(1.32839e-06);
161  kinVec.push_back(3.0988 );ionizVec.push_back(1.32689e-06);//ionizVec.push_back(1.32689e-06);
162  kinVec.push_back(3.23494);ionizVec.push_back(1.32366e-06);//ionizVec.push_back(1.32366e-06);
163  kinVec.push_back(3.37107);ionizVec.push_back(1.32239e-06);//ionizVec.push_back(1.32239e-06);
164  kinVec.push_back(3.5072 );ionizVec.push_back(1.32112e-06);//ionizVec.push_back(1.32112e-06);
165  kinVec.push_back(3.64333);ionizVec.push_back(1.31949e-06);//ionizVec.push_back(1.31949e-06);
166  kinVec.push_back(3.77947);ionizVec.push_back(1.32095e-06);//ionizVec.push_back(1.32095e-06);
167  kinVec.push_back(3.9156 );ionizVec.push_back(1.32241e-06);//ionizVec.push_back(1.32241e-06);
168  kinVec.push_back(4.18786);ionizVec.push_back(1.3238e-06 );//ionizVec.push_back(1.3228e-06 );
169  kinVec.push_back(4.46013);ionizVec.push_back(1.32547e-06);//ionizVec.push_back(1.32547e-06);
170  kinVec.push_back(4.59626);ionizVec.push_back(1.32823e-06);//ionizVec.push_back(1.32823e-06);
171  kinVec.push_back(5.14079);ionizVec.push_back(1.3315e-06 );//ionizVec.push_back(1.3435e-06 );//ionizVec.push_back(1.3435e-06 );
172  kinVec.push_back(5.27692);ionizVec.push_back(1.33467e-06);//ionizVec.push_back(1.34667e-06);//ionizVec.push_back(1.34667e-06);
173  kinVec.push_back(5.41306);ionizVec.push_back(1.33871e-06);//ionizVec.push_back(1.36661e-06);//ionizVec.push_back(1.36617e-06);
174  kinVec.push_back(5.54919);ionizVec.push_back(1.34288e-06);//ionizVec.push_back(1.36988e-06);//ionizVec.push_back(1.36988e-06);
175  kinVec.push_back(5.68532);ionizVec.push_back(1.34616e-06);//ionizVec.push_back(1.37316e-06);//ionizVec.push_back(1.37316e-06);
176  kinVec.push_back(5.82145);ionizVec.push_back(1.35068e-06);//ionizVec.push_back(1.37468e-06);//ionizVec.push_back(1.37468e-06);
177  kinVec.push_back(5.95759);ionizVec.push_back(1.35494e-06);//ionizVec.push_back(1.37795e-06);//ionizVec.push_back(1.37795e-06);
178  kinVec.push_back(6.09372);ionizVec.push_back(1.36034e-06);//ionizVec.push_back(1.37614e-06);//ionizVec.push_back(1.37614e-06);
179  kinVec.push_back(6.22985);ionizVec.push_back(1.36459e-06);//ionizVec.push_back(1.37939e-06);//ionizVec.push_back(1.37939e-06);
180  kinVec.push_back(6.36598);ionizVec.push_back(1.36865e-06);//ionizVec.push_back(1.38265e-06);//ionizVec.push_back(1.38265e-06);
181  kinVec.push_back(6.50212);ionizVec.push_back(1.37391e-06);//ionizVec.push_back(1.38038e-06);//ionizVec.push_back(1.38038e-06);
182  kinVec.push_back(6.63825);ionizVec.push_back(1.37861e-06);//ionizVec.push_back(1.38361e-06);//ionizVec.push_back(1.38361e-06);
183  kinVec.push_back(6.77438);ionizVec.push_back(1.38285e-06);//ionizVec.push_back(1.38685e-06);//ionizVec.push_back(1.38685e-06);
184  kinVec.push_back(6.91051);ionizVec.push_back(1.38648e-06);//ionizVec.push_back(1.38748e-06);//ionizVec.push_back(1.38748e-06);
185  kinVec.push_back(7.04665);ionizVec.push_back(1.38971e-06);//ionizVec.push_back(1.39071e-06);
186  kinVec.push_back(7.31891);ionizVec.push_back(1.39186e-06);//ionizVec.push_back(1.39186e-06);
187  kinVec.push_back(7.45504);ionizVec.push_back(1.39507e-06);//ionizVec.push_back(1.39507e-06);
188  kinVec.push_back(7.72731);ionizVec.push_back(1.39519e-06);//ionizVec.push_back(1.39519e-06);
189  kinVec.push_back(7.86344);ionizVec.push_back(1.39713e-06);//ionizVec.push_back(1.39813e-06);
190  kinVec.push_back(8.13571);ionizVec.push_back(1.39835e-06);//ionizVec.push_back(1.39835e-06);
191  kinVec.push_back(8.27184);ionizVec.push_back(1.39978e-06);//ionizVec.push_back(1.39778e-06);
192  kinVec.push_back(8.40797);ionizVec.push_back(1.40071e-06);//ionizVec.push_back(1.40071e-06);
193  kinVec.push_back(8.5441 );ionizVec.push_back(1.40363e-06);//ionizVec.push_back(1.40363e-06);
194  kinVec.push_back(8.81637);ionizVec.push_back(1.40651e-06);//ionizVec.push_back(1.40651e-06);
195  kinVec.push_back(8.9525 );ionizVec.push_back(1.40943e-06);//ionizVec.push_back(1.40943e-06);
196  kinVec.push_back(9.08863);ionizVec.push_back(1.41462e-06);//ionizVec.push_back(1.41462e-06);
197  kinVec.push_back(9.22477);ionizVec.push_back(1.41753e-06);//ionizVec.push_back(1.41753e-06);
198  kinVec.push_back(9.76929);ionizVec.push_back(1.42957e-06);//ionizVec.push_back(1.42957e-06);
199  kinVec.push_back(9.90543);ionizVec.push_back(1.43212e-06);//ionizVec.push_back(1.43212e-06);
200  kinVec.push_back(10.0416);ionizVec.push_back(1.4451e-06 );//ionizVec.push_back(1.4451e-06 );
201  kinVec.push_back(10.1777);ionizVec.push_back(1.44767e-06);//ionizVec.push_back(1.44767e-06);
202  kinVec.push_back(10.3138);ionizVec.push_back(1.45024e-06);//ionizVec.push_back(1.45024e-06);
203  kinVec.push_back(10.7222);ionizVec.push_back(1.45164e-06);//ionizVec.push_back(1.45164e-06);
204  kinVec.push_back(10.8584);ionizVec.push_back(1.45502e-06);//ionizVec.push_back(1.45502e-06);
205  kinVec.push_back(10.9945);ionizVec.push_back(1.45758e-06);//ionizVec.push_back(1.45758e-06);
206  kinVec.push_back(12.0835);ionizVec.push_back(1.45772e-06);//ionizVec.push_back(1.45772e-06);
207 
208  // extrapolation
209 // kinVec.push_back(15.8304);
210 // kinVec.push_back(18.6956);
211 // kinVec.push_back(21.5609);
212 // kinVec.push_back(24.4261);
213 // kinVec.push_back(27.2913);
214 // kinVec.push_back(30.1566);
215 // kinVec.push_back(33.0218);
216 // kinVec.push_back(35.887 );
217 // kinVec.push_back(38.7523);
218 // kinVec.push_back(41.6175);
219 // kinVec.push_back(44.4827);
220 // kinVec.push_back(47.3479);
221 // kinVec.push_back(50.2132);
222 // kinVec.push_back(53.0784);
223 // kinVec.push_back(55.9436);
224 // kinVec.push_back(58.8089);
225 // kinVec.push_back(61.6741);
226 // kinVec.push_back(64.5393);
227 // kinVec.push_back(67.4046);
228 // kinVec.push_back(70.2698);
229 // kinVec.push_back(73.135 );
230 // kinVec.push_back(76.0002);
231 // kinVec.push_back(78.8655);
232 // kinVec.push_back(81.7307);
233 // kinVec.push_back(84.5959);
234 // kinVec.push_back(87.4612);
235 // kinVec.push_back(90.3264);
236 // kinVec.push_back(93.1916);
237 // kinVec.push_back(96.0569);
238 // kinVec.push_back(98.9221);
239 // kinVec.push_back(101.787);
240 // kinVec.push_back(104.653);
241 // kinVec.push_back(107.518);
242 // kinVec.push_back(110.383);
243 // kinVec.push_back(113.248);
244 // kinVec.push_back(116.113);
245 // kinVec.push_back(118.979);
246 // kinVec.push_back(121.844);
247 // kinVec.push_back(124.709);
248 // kinVec.push_back(127.574);
249 // kinVec.push_back(130.44 );
250 // kinVec.push_back(133.305);
251 // kinVec.push_back(136.17 );
252 // kinVec.push_back(139.035);
253 // kinVec.push_back(141.901);
254 // kinVec.push_back(144.766);
255 // kinVec.push_back(147.631);
256 // kinVec.push_back(150.496);
257 // kinVec.push_back(153.361);
258 // kinVec.push_back(156.227);
259 // kinVec.push_back(159.092);
260 // kinVec.push_back(161.957);
261 // kinVec.push_back(164.822);
262 // kinVec.push_back(167.688);
263 // kinVec.push_back(170.553);
264 // kinVec.push_back(173.418);
265 // kinVec.push_back(176.283);
266 // kinVec.push_back(179.149);
267 // kinVec.push_back(182.014);
268 // kinVec.push_back(184.879);
269 // kinVec.push_back(187.744);
270 // kinVec.push_back(190.609);
271 // kinVec.push_back(193.475);
272 // kinVec.push_back(196.34 );
273 // kinVec.push_back(199.205);
274 
275  // electrons // electrons
276  kinVec.push_back(214.286); ionizVec.push_back(1.84391e-06*1.0583);
277  kinVec.push_back(251.468); ionizVec.push_back(1.865e-06 *1.0583);
278  kinVec.push_back(288.65 ); ionizVec.push_back(1.88321e-06*1.0583);
279  kinVec.push_back(325.832); ionizVec.push_back(1.87983e-06*1.0583);
280  kinVec.push_back(363.014); ionizVec.push_back(1.89258e-06*1.0583);
281  kinVec.push_back(400.196); ionizVec.push_back(1.88496e-06*1.0583);
282  kinVec.push_back(437.378); ionizVec.push_back(1.8953e-06 *1.0583);
283  kinVec.push_back(474.56 ); ionizVec.push_back(1.90352e-06*1.0583);
284  kinVec.push_back(511.742); ionizVec.push_back(1.89112e-06*1.0583);
285  kinVec.push_back(548.924); ionizVec.push_back(1.89855e-06*1.0583);
286  kinVec.push_back(586.106); ionizVec.push_back(1.90452e-06*1.0583);
287  kinVec.push_back(623.288); ionizVec.push_back(1.90318e-06*1.0583);
288  kinVec.push_back(660.47 ); ionizVec.push_back(1.90914e-06*1.0583);
289  kinVec.push_back(697.652); ionizVec.push_back(1.91306e-06*1.0583);
290  kinVec.push_back(734.834); ionizVec.push_back(1.91746e-06*1.0583);
291  kinVec.push_back(772.016); ionizVec.push_back(1.92184e-06*1.0583);
292  kinVec.push_back(809.198); ionizVec.push_back(1.92571e-06*1.0583);
293  kinVec.push_back(846.38 ); ionizVec.push_back(1.93009e-06*1.0583);
294  kinVec.push_back(883.562); ionizVec.push_back(1.93345e-06*1.0583);
295  kinVec.push_back(920.744); ionizVec.push_back(1.93669e-06*1.0583);
296  kinVec.push_back(957.926); ionizVec.push_back(1.93992e-06*1.0583);
297  kinVec.push_back(995.108); ionizVec.push_back(1.94317e-06*1.0583);
298  kinVec.push_back(1032.29); ionizVec.push_back(1.94641e-06*1.0583);
299  kinVec.push_back(1069.47); ionizVec.push_back(1.94964e-06*1.0583);
300  kinVec.push_back(1106.65); ionizVec.push_back(1.95206e-06*1.0583);
301  kinVec.push_back(1143.84); ionizVec.push_back(1.95445e-06*1.0583);
302  kinVec.push_back(1181.02); ionizVec.push_back(1.95684e-06*1.0583);
303  kinVec.push_back(1218.2 ); ionizVec.push_back(1.95924e-06*1.0583);
304  kinVec.push_back(1255.38); ionizVec.push_back(1.96162e-06*1.0583);
305  kinVec.push_back(1292.56); ionizVec.push_back(1.96402e-06*1.0583);
306  kinVec.push_back(1329.75); ionizVec.push_back(1.96641e-06*1.0583);
307  kinVec.push_back(1366.93); ionizVec.push_back(1.96846e-06*1.0583);
308  kinVec.push_back(1404.11); ionizVec.push_back(1.97023e-06*1.0583);
309  kinVec.push_back(1441.29); ionizVec.push_back(1.972e-06 *1.0583);
310  kinVec.push_back(1478.47); ionizVec.push_back(1.97379e-06*1.0583);
311  kinVec.push_back(1515.66); ionizVec.push_back(1.97555e-06*1.0583);
312  kinVec.push_back(1552.84); ionizVec.push_back(1.97732e-06*1.0583);
313  kinVec.push_back(1590.02); ionizVec.push_back(1.9791e-06 *1.0583);
314  kinVec.push_back(1627.2 ); ionizVec.push_back(1.98087e-06*1.0583);
315  kinVec.push_back(1664.38); ionizVec.push_back(1.98265e-06*1.0583);
316  kinVec.push_back(1701.57); ionizVec.push_back(1.98434e-06*1.0583);
317  kinVec.push_back(1738.75); ionizVec.push_back(1.98567e-06*1.0583);
318  kinVec.push_back(1775.93); ionizVec.push_back(1.98699e-06*1.0583);
319  kinVec.push_back(1813.11); ionizVec.push_back(1.98832e-06*1.0583);
320  kinVec.push_back(1850.29); ionizVec.push_back(1.98964e-06*1.0583);
321  kinVec.push_back(1887.48); ionizVec.push_back(1.99098e-06*1.0583);
322  kinVec.push_back(1924.66); ionizVec.push_back(1.99229e-06*1.0583);
323  kinVec.push_back(1961.84); ionizVec.push_back(1.99361e-06*1.0583);
324  kinVec.push_back(1999.02); ionizVec.push_back(1.99493e-06*1.0583);
325  kinVec.push_back(2036.2 ); ionizVec.push_back(1.99625e-06*1.0583);
326  kinVec.push_back(2073.39); ionizVec.push_back(1.99759e-06*1.0583);
327  kinVec.push_back(2110.57); ionizVec.push_back(1.99891e-06*1.0583);
328  kinVec.push_back(2147.75); ionizVec.push_back(2.00012e-06*1.0583);
329  kinVec.push_back(2184.93); ionizVec.push_back(2.0011e-06 *1.0583);
330  kinVec.push_back(2222.11); ionizVec.push_back(2.00209e-06*1.0583);
331  kinVec.push_back(2259.3 ); ionizVec.push_back(2.00309e-06*1.0583);
332  kinVec.push_back(2296.48); ionizVec.push_back(2.00407e-06*1.0583);
333  kinVec.push_back(2333.66); ionizVec.push_back(2.00508e-06*1.0583);
334  kinVec.push_back(2370.84); ionizVec.push_back(2.00606e-06*1.0583);
335  kinVec.push_back(2408.02); ionizVec.push_back(2.00706e-06*1.0583);
336  kinVec.push_back(2445.21); ionizVec.push_back(2.00805e-06*1.0583);
337  kinVec.push_back(2482.39); ionizVec.push_back(2.00903e-06*1.0583);
338  kinVec.push_back(2519.57); ionizVec.push_back(2.01003e-06*1.0583);
339  kinVec.push_back(2556.75); ionizVec.push_back(2.01102e-06*1.0583);
340  kinVec.push_back(2593.93); ionizVec.push_back(2.01202e-06*1.0583);
341  kinVec.push_back(2631.12); ionizVec.push_back(2.01301e-06*1.0583);
342  kinVec.push_back(2668.3 ); ionizVec.push_back(2.014e-06 *1.0583);
343  kinVec.push_back(2705.48); ionizVec.push_back(2.01486e-06*1.0583);
344  kinVec.push_back(2742.66); ionizVec.push_back(2.01561e-06*1.0583);
345  kinVec.push_back(2779.84); ionizVec.push_back(2.01635e-06*1.0583);
346  kinVec.push_back(2817.03); ionizVec.push_back(2.0171e-06 *1.0583);
347  kinVec.push_back(2854.21); ionizVec.push_back(2.01784e-06*1.0583);
348  kinVec.push_back(2891.39); ionizVec.push_back(2.01859e-06*1.0583);
349  kinVec.push_back(2928.57); ionizVec.push_back(2.01933e-06*1.0583);
350  kinVec.push_back(2965.75); ionizVec.push_back(2.02008e-06*1.0583);
351  kinVec.push_back(3002.94); ionizVec.push_back(2.02081e-06*1.0583);
352  kinVec.push_back(3040.12); ionizVec.push_back(2.02156e-06*1.0583);
353  kinVec.push_back(3077.3 ); ionizVec.push_back(2.02231e-06*1.0583);
354  kinVec.push_back(3114.48); ionizVec.push_back(2.02306e-06*1.0583);
355  kinVec.push_back(3151.66); ionizVec.push_back(2.0238e-06 *1.0583);
356  kinVec.push_back(3188.85); ionizVec.push_back(2.02454e-06*1.0583);
357  kinVec.push_back(3226.03); ionizVec.push_back(2.02529e-06*1.0583);
358  kinVec.push_back(3263.21); ionizVec.push_back(2.02604e-06*1.0583);
359  kinVec.push_back(3300.39); ionizVec.push_back(2.02678e-06*1.0583);
360  kinVec.push_back(3337.57); ionizVec.push_back(2.02752e-06*1.0583);
361  kinVec.push_back(3374.76); ionizVec.push_back(2.02826e-06*1.0583);
362  kinVec.push_back(3411.94); ionizVec.push_back(2.02887e-06*1.0583);
363  kinVec.push_back(3449.12); ionizVec.push_back(2.02943e-06*1.0583);
364  kinVec.push_back(3486.3 ); ionizVec.push_back(2.03e-06 *1.0583);
365  kinVec.push_back(3523.48); ionizVec.push_back(2.03056e-06*1.0583);
366  kinVec.push_back(3560.67); ionizVec.push_back(2.03113e-06*1.0583);
367  kinVec.push_back(3597.85); ionizVec.push_back(2.03169e-06*1.0583);
368  kinVec.push_back(3635.03); ionizVec.push_back(2.03227e-06*1.0583);
369  kinVec.push_back(3672.21); ionizVec.push_back(2.03283e-06*1.0583);
370  kinVec.push_back(3709.39); ionizVec.push_back(2.03339e-06*1.0583);
371  kinVec.push_back(3746.58); ionizVec.push_back(2.03395e-06*1.0583);
372  kinVec.push_back(3783.76); ionizVec.push_back(2.03452e-06*1.0583);
373  kinVec.push_back(3820.94); ionizVec.push_back(2.03509e-06*1.0583);
374  kinVec.push_back(3858.12); ionizVec.push_back(2.03565e-06*1.0583);
375  kinVec.push_back(3895.3 ); ionizVec.push_back(2.03622e-06*1.0583);
376 
377 
378  // extrapolation
379 // ionizVec.push_back(1.47415e-06);
380 // ionizVec.push_back(1.51035e-06);
381 // ionizVec.push_back(1.54178e-06);
382 // ionizVec.push_back(1.569e-06 );
383 // ionizVec.push_back(1.59476e-06);
384 // ionizVec.push_back(1.61668e-06);
385 // ionizVec.push_back(1.63772e-06);
386 // ionizVec.push_back(1.65727e-06);
387 // ionizVec.push_back(1.67439e-06);
388 // ionizVec.push_back(1.69155e-06);
389 // ionizVec.push_back(1.70766e-06);
390 // ionizVec.push_back(1.72162e-06);
391 // ionizVec.push_back(1.73558e-06);
392 // ionizVec.push_back(1.74958e-06);
393 // ionizVec.push_back(1.76232e-06);
394 // ionizVec.push_back(1.77371e-06);
395 // ionizVec.push_back(1.78513e-06);
396 // ionizVec.push_back(1.79656e-06);
397 // ionizVec.push_back(1.80799e-06);
398 // ionizVec.push_back(1.81811e-06);
399 // ionizVec.push_back(1.82747e-06);
400 // ionizVec.push_back(1.83683e-06);
401 // ionizVec.push_back(1.8462e-06 );
402 // ionizVec.push_back(1.85558e-06);
403 // ionizVec.push_back(1.86498e-06);
404 // ionizVec.push_back(1.87347e-06);
405 // ionizVec.push_back(1.8812e-06 );
406 // ionizVec.push_back(1.88893e-06);
407 // ionizVec.push_back(1.89667e-06);
408 // ionizVec.push_back(1.90442e-06);
409 // ionizVec.push_back(1.91216e-06);
410 // ionizVec.push_back(1.91992e-06);
411 // ionizVec.push_back(1.92768e-06);
412 // ionizVec.push_back(1.93402e-06);
413 // ionizVec.push_back(1.94015e-06);
414 // ionizVec.push_back(1.94627e-06);
415 // ionizVec.push_back(1.9524e-06 );
416 // ionizVec.push_back(1.95853e-06);
417 // ionizVec.push_back(1.96466e-06);
418 // ionizVec.push_back(1.97079e-06);
419 // ionizVec.push_back(1.97692e-06);
420 // ionizVec.push_back(1.98305e-06);
421 // ionizVec.push_back(1.98894e-06);
422 // ionizVec.push_back(1.99384e-06);
423 // ionizVec.push_back(1.99875e-06);
424 // ionizVec.push_back(2.00366e-06);
425 // ionizVec.push_back(2.00857e-06);
426 // ionizVec.push_back(2.01347e-06);
427 // ionizVec.push_back(2.01837e-06);
428 // ionizVec.push_back(2.02328e-06);
429 // ionizVec.push_back(2.02817e-06);
430 // ionizVec.push_back(2.03307e-06);
431 // ionizVec.push_back(2.03797e-06);
432 // ionizVec.push_back(2.04287e-06);
433 // ionizVec.push_back(2.04772e-06);
434 // ionizVec.push_back(2.05173e-06);
435 // ionizVec.push_back(2.05575e-06);
436 // ionizVec.push_back(2.05975e-06);
437 // ionizVec.push_back(2.06375e-06);
438 // ionizVec.push_back(2.06775e-06);
439 // ionizVec.push_back(2.07175e-06);
440 // ionizVec.push_back(2.07574e-06);
441 // ionizVec.push_back(2.07973e-06);
442 // ionizVec.push_back(2.08371e-06);
443 // ionizVec.push_back(2.08771e-06);
444 
445 
446 
447  for(size_t i=0; i<ionizVec.size(); ++i) {
448 // double energy = kinVec[i];
449 // energy +=muonmass; // kinetic energy = energy - mass
450 // double betagamma = ::sqrt(energy*energy-muonmass*muonmass)/muonmass;
451 // mMap.insert(map<double,double>::value_type(betagamma,ionizVec[i]));
452  mMap.insert(map<double,double>::value_type(kinVec[i],ionizVec[i]));
453 
454  }
455  // ifs.close();
456 
457 }
458 myBetheBloch::~myBetheBloch(){
459  mMap.clear();
460 }
461 double myBetheBloch::operator() (double betagamma) {
462 
463  // if betagamma < 2.5, result should be proportional to
464  // 1/beta^2
465  double unnormalized = 0;
466  if (betagamma < .217) {
467  double bg2 = betagamma*betagamma;
468  // Absolute Normalization * relative normalization
469  unnormalized = (5.39e-4*2.0885e-3)*((1+bg2)/bg2);
470  }
471  else {
472  //
473  // betagamma > .8, use table
474  //
475  map<double,double>::iterator lowb = mMap.lower_bound(betagamma);
476  if (lowb == mMap.end())
477  unnormalized = (*(--lowb)).second; // If past the range, return last value
478 
479  else {
480  double bghigh = (*lowb).first;
481  double dedxhigh = (*lowb).second;
482  if (bghigh == betagamma || lowb==mMap.begin())
483  unnormalized = dedxhigh;
484  else {
485  --lowb;
486  double bglow = (*lowb).first; // These variables are not really needed, but
487  double dedxlow = (*lowb).second; // these steps make the code more readable.
488  double slope = (dedxhigh - dedxlow)/(bghigh - bglow);
489  unnormalized = (dedxlow + slope * (betagamma - bglow));
490  }
491  }
492  }
493 
494  // Normalization factor
495  // obtained from fit. 5.3e-4
496  //
497 // return 5.31e-4*unnormalized;
498 // return 5.39e-4*unnormalized;
499  // prod period scale factor from dedxfit.C normalization
500  // P00he 1.1257e-6 1.0000 (reference)
501  // P00hg 1.19346e-6 1.055
502 
503  return 1.055*unnormalized;
504 }
505 
506 // Double_t myBetheBloch::operator() (Double_t betagamma){
507 // return (Double_t) operator()((double) betagamma);
508 // }