StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
BetheBloch.cxx
1 //
2 // $Id BetheBloch.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 #include <Stiostream.h>
25 #include <vector>
26 #include "BetheBloch.h"
27 #include "TMath.h"
28 #ifndef ST_NO_NAMESPACES
29 using std::vector;
30 #endif
31 int BetheBloch::noWarn = 0;
32 
33 BetheBloch::BetheBloch(){
34  // it's more elegant to read the values from a file, but to put it
35  // in the StarClassLibrary without extra files, we have to dump the numbers
36  // here
37  // could also fill them directly in the map, or transform the numbers directly
38  // to beta gamma.
39  if (! noWarn) {
40  cout << "BetheBloch::BetheBloch =================================================================" << endl;
41  cout << "Warning: please don't use BetheBloch::BetheBloch for any analysis after P00hm production" << endl;
42  cout << "but use instead : " << endl;
43  cout << "for production before P03h static function 1.e-6*BetheBloch::Sirrf(Poverm) " << endl;
44  cout << "for production after P03h (including P03h) " << endl;
45  cout << "gSystem->Load(\"StBichsel\"); I70 = 1.e-6*mBichsel::Instance()->GetI70(TMath::Log10(poverm),1.)" << endl;
46  cout << "see an example in $STAR/StRoot/macros/analysis/bichsel.C " << endl;
47  cout << "BetheBloch::BetheBloch =================================================================" << endl;
48  noWarn = 1;
49  }
50  vector<double> kinVec;
51  vector<double> ionizVec; // Protons
52  kinVec.push_back(0.216355);ionizVec.push_back(2.38171e-05);
53  kinVec.push_back(0.22275 );ionizVec.push_back(2.25295e-05);
54  kinVec.push_back(0.229145);ionizVec.push_back(2.13482e-05);
55  kinVec.push_back(0.235539);ionizVec.push_back(2.02618e-05);
56  kinVec.push_back(0.241934);ionizVec.push_back(1.92604e-05);
57  kinVec.push_back(0.248329);ionizVec.push_back(1.83354e-05);
58  kinVec.push_back(0.254723);ionizVec.push_back(1.74791e-05);
59  kinVec.push_back(0.261118);ionizVec.push_back(1.6685e-05 );
60  kinVec.push_back(0.267513);ionizVec.push_back(1.63046e-05);
61  kinVec.push_back(0.273908);ionizVec.push_back(1.56024e-05);
62  kinVec.push_back(0.280302);ionizVec.push_back(1.49478e-05);
63  kinVec.push_back(0.286697);ionizVec.push_back(1.43364e-05);
64  kinVec.push_back(0.293092);ionizVec.push_back(1.37647e-05);
65  kinVec.push_back(0.299487);ionizVec.push_back(1.32291e-05);
66  kinVec.push_back(0.305881);ionizVec.push_back(1.27268e-05);
67  kinVec.push_back(0.312276);ionizVec.push_back(1.2255e-05 );
68  kinVec.push_back(0.318671);ionizVec.push_back(1.18114e-05);
69  kinVec.push_back(0.325066);ionizVec.push_back(1.13592e-05);
70  kinVec.push_back(0.33146 );ionizVec.push_back(1.09666e-05);
71  kinVec.push_back(0.337855);ionizVec.push_back(1.05961e-05);
72  kinVec.push_back(0.34425 );ionizVec.push_back(1.02462e-05);
73  kinVec.push_back(0.350644);ionizVec.push_back(9.91509e-06);
74  kinVec.push_back(0.357039);ionizVec.push_back(9.6016e-06 );
75  kinVec.push_back(0.363434);ionizVec.push_back(9.30456e-06);
76  kinVec.push_back(0.369829);ionizVec.push_back(9.02278e-06);
77  kinVec.push_back(0.376223);ionizVec.push_back(8.81998e-06);
78  kinVec.push_back(0.382618);ionizVec.push_back(8.56388e-06);
79  kinVec.push_back(0.389013);ionizVec.push_back(8.32029e-06);
80  kinVec.push_back(0.395408);ionizVec.push_back(8.08844e-06);
81  kinVec.push_back(0.401802);ionizVec.push_back(7.86756e-06);
82  kinVec.push_back(0.408197);ionizVec.push_back(7.65699e-06);
83  kinVec.push_back(0.414592);ionizVec.push_back(7.45608e-06);
84  kinVec.push_back(0.420987);ionizVec.push_back(7.26426e-06);
85  kinVec.push_back(0.427381);ionizVec.push_back(7.12715e-06);
86  kinVec.push_back(0.433776);ionizVec.push_back(6.95077e-06);
87  kinVec.push_back(0.440171);ionizVec.push_back(6.78204e-06);
88  kinVec.push_back(0.446565);ionizVec.push_back(6.62049e-06);
89  kinVec.push_back(0.45296 );ionizVec.push_back(6.46574e-06);
90  kinVec.push_back(0.459355);ionizVec.push_back(6.3174e-06 );
91  kinVec.push_back(0.46575 );ionizVec.push_back(6.17514e-06);
92  kinVec.push_back(0.472144);ionizVec.push_back(6.03861e-06);
93  kinVec.push_back(0.478539);ionizVec.push_back(5.90753e-06);
94  kinVec.push_back(0.484934);ionizVec.push_back(5.82937e-06);
95  kinVec.push_back(0.491329);ionizVec.push_back(5.70733e-06);
96  kinVec.push_back(0.497723);ionizVec.push_back(5.58995e-06);
97  kinVec.push_back(0.504118);ionizVec.push_back(5.47701e-06);
98  kinVec.push_back(0.510513);ionizVec.push_back(5.36829e-06);
99  kinVec.push_back(0.516908);ionizVec.push_back(5.26358e-06);
100  kinVec.push_back(0.523302);ionizVec.push_back(5.16268e-06);
101  kinVec.push_back(0.529697);ionizVec.push_back(5.06542e-06);
102  kinVec.push_back(0.536092);ionizVec.push_back(4.95505e-06);
103  kinVec.push_back(0.542486);ionizVec.push_back(4.86486e-06);
104  kinVec.push_back(0.548881);ionizVec.push_back(4.77779e-06);
105  kinVec.push_back(0.555276);ionizVec.push_back(4.6937e-06 );
106  kinVec.push_back(0.561671);ionizVec.push_back(4.61248e-06);
107  kinVec.push_back(0.568065);ionizVec.push_back(4.53397e-06);
108  kinVec.push_back(0.57446 );ionizVec.push_back(4.45809e-06);
109  kinVec.push_back(0.580855);ionizVec.push_back(4.38469e-06);
110  kinVec.push_back(0.58725 );ionizVec.push_back(4.32523e-06);
111  kinVec.push_back(0.593644);ionizVec.push_back(4.25631e-06);
112  kinVec.push_back(0.600039);ionizVec.push_back(4.18958e-06);
113  kinVec.push_back(0.606434);ionizVec.push_back(4.12496e-06);
114  kinVec.push_back(0.612828);ionizVec.push_back(4.06236e-06);
115  kinVec.push_back(0.619223);ionizVec.push_back(4.00167e-06);
116  kinVec.push_back(0.625618);ionizVec.push_back(3.94284e-06);
117  kinVec.push_back(0.632013);ionizVec.push_back(3.88579e-06);
118  kinVec.push_back(0.638407);ionizVec.push_back(3.83045e-06);
119  kinVec.push_back(0.644802);ionizVec.push_back(3.78096e-06);
120  kinVec.push_back(0.651197);ionizVec.push_back(3.72878e-06);
121  kinVec.push_back(0.657592);ionizVec.push_back(3.6781e-06 );
122  kinVec.push_back(0.663986);ionizVec.push_back(3.62888e-06);
123  kinVec.push_back(0.670381);ionizVec.push_back(3.58106e-06);
124  kinVec.push_back(0.676776);ionizVec.push_back(3.53459e-06);
125  kinVec.push_back(0.683171);ionizVec.push_back(3.48941e-06);
126  kinVec.push_back(0.689565);ionizVec.push_back(3.4455e-06 );
127  kinVec.push_back(0.69596 );ionizVec.push_back(3.39852e-06);
128  kinVec.push_back(0.702355);ionizVec.push_back(3.35701e-06);
129  kinVec.push_back(0.708749);ionizVec.push_back(3.31663e-06);
130  kinVec.push_back(0.715144);ionizVec.push_back(3.27733e-06);
131  kinVec.push_back(0.721539);ionizVec.push_back(3.23906e-06);
132  kinVec.push_back(0.727934);ionizVec.push_back(3.20181e-06);
133  kinVec.push_back(0.734328);ionizVec.push_back(3.16551e-06);
134  kinVec.push_back(0.740723);ionizVec.push_back(3.13016e-06);
135  kinVec.push_back(0.747118);ionizVec.push_back(3.08976e-06);
136  kinVec.push_back(0.753513);ionizVec.push_back(3.05624e-06);
137  kinVec.push_back(0.759907);ionizVec.push_back(3.02358e-06);
138  kinVec.push_back(0.766302);ionizVec.push_back(2.99172e-06);
139  kinVec.push_back(0.772697);ionizVec.push_back(2.96065e-06);
140  kinVec.push_back(0.779092);ionizVec.push_back(2.93033e-06);
141  kinVec.push_back(0.785486);ionizVec.push_back(2.90077e-06);
142  kinVec.push_back(0.791881);ionizVec.push_back(2.87191e-06);
143  kinVec.push_back(0.798276);ionizVec.push_back(2.84375e-06);
144  kinVec.push_back(0.80467 );ionizVec.push_back(2.80652e-06);
145  kinVec.push_back(0.811065);ionizVec.push_back(2.77976e-06);
146  kinVec.push_back(0.81746 );ionizVec.push_back(2.75364e-06);
147  kinVec.push_back(0.823855);ionizVec.push_back(2.72812e-06);
148  kinVec.push_back(0.830249);ionizVec.push_back(2.70318e-06);
149  kinVec.push_back(0.836644);ionizVec.push_back(2.67881e-06);
150  kinVec.push_back(0.843039);ionizVec.push_back(2.65499e-06);
151  kinVec.push_back(0.849434);ionizVec.push_back(2.63171e-06);
152 
153  // Pions // Pions
154  kinVec.push_back(0.92068);ionizVec.push_back(2.44711e-06);//ionizVec.push_back(2.44711e-06);
155  kinVec.push_back(1.05682);ionizVec.push_back(2.12787e-06);//ionizVec.push_back(2.12787e-06);
156  kinVec.push_back(1.19295);ionizVec.push_back(1.91688e-06);//ionizVec.push_back(1.91688e-06);
157  kinVec.push_back(1.32908);ionizVec.push_back(1.76312e-06);//ionizVec.push_back(1.76312e-06);
158  kinVec.push_back(1.46522);ionizVec.push_back(1.65432e-06);//ionizVec.push_back(1.65432e-06);
159  kinVec.push_back(1.60135);ionizVec.push_back(1.56874e-06);//ionizVec.push_back(1.56874e-06);
160  kinVec.push_back(1.73748);ionizVec.push_back(1.50247e-06);//ionizVec.push_back(1.50247e-06);
161  kinVec.push_back(1.87361);ionizVec.push_back(1.46839e-06);//ionizVec.push_back(1.46839e-06);
162  kinVec.push_back(2.00974);ionizVec.push_back(1.42577e-06);//ionizVec.push_back(1.42577e-06);
163  kinVec.push_back(2.14588);ionizVec.push_back(1.39101e-06);//ionizVec.push_back(1.39101e-06);
164  kinVec.push_back(2.28201);ionizVec.push_back(1.38415e-06);//ionizVec.push_back(1.38415e-06);
165  kinVec.push_back(2.41814);ionizVec.push_back(1.35975e-06);//ionizVec.push_back(1.35975e-06
166  kinVec.push_back(2.55427);ionizVec.push_back(1.34999e-06);//ionizVec.push_back(1.34999e-06);
167  kinVec.push_back(2.69041);ionizVec.push_back(1.34375e-06);//ionizVec.push_back(1.34375e-06);
168  kinVec.push_back(2.82654);ionizVec.push_back(1.3375e-06 );//ionizVec.push_back(1.3375e-06 );
169  kinVec.push_back(2.96267);ionizVec.push_back(1.32839e-06);//ionizVec.push_back(1.32839e-06);
170  kinVec.push_back(3.0988 );ionizVec.push_back(1.32689e-06);//ionizVec.push_back(1.32689e-06);
171  kinVec.push_back(3.23494);ionizVec.push_back(1.32366e-06);//ionizVec.push_back(1.32366e-06);
172  kinVec.push_back(3.37107);ionizVec.push_back(1.32239e-06);//ionizVec.push_back(1.32239e-06);
173  kinVec.push_back(3.5072 );ionizVec.push_back(1.32112e-06);//ionizVec.push_back(1.32112e-06);
174  kinVec.push_back(3.64333);ionizVec.push_back(1.31949e-06);//ionizVec.push_back(1.31949e-06);
175  kinVec.push_back(3.77947);ionizVec.push_back(1.32095e-06);//ionizVec.push_back(1.32095e-06);
176  kinVec.push_back(3.9156 );ionizVec.push_back(1.32241e-06);//ionizVec.push_back(1.32241e-06);
177  kinVec.push_back(4.18786);ionizVec.push_back(1.3238e-06 );//ionizVec.push_back(1.3228e-06 );
178  kinVec.push_back(4.46013);ionizVec.push_back(1.32547e-06);//ionizVec.push_back(1.32547e-06);
179  kinVec.push_back(4.59626);ionizVec.push_back(1.32823e-06);//ionizVec.push_back(1.32823e-06);
180  kinVec.push_back(5.14079);ionizVec.push_back(1.3315e-06 );//ionizVec.push_back(1.3435e-06 );//ionizVec.push_back(1.3435e-06 );
181  kinVec.push_back(5.27692);ionizVec.push_back(1.33467e-06);//ionizVec.push_back(1.34667e-06);//ionizVec.push_back(1.34667e-06);
182  kinVec.push_back(5.41306);ionizVec.push_back(1.33871e-06);//ionizVec.push_back(1.36661e-06);//ionizVec.push_back(1.36617e-06);
183  kinVec.push_back(5.54919);ionizVec.push_back(1.34288e-06);//ionizVec.push_back(1.36988e-06);//ionizVec.push_back(1.36988e-06);
184  kinVec.push_back(5.68532);ionizVec.push_back(1.34616e-06);//ionizVec.push_back(1.37316e-06);//ionizVec.push_back(1.37316e-06);
185  kinVec.push_back(5.82145);ionizVec.push_back(1.35068e-06);//ionizVec.push_back(1.37468e-06);//ionizVec.push_back(1.37468e-06);
186  kinVec.push_back(5.95759);ionizVec.push_back(1.35494e-06);//ionizVec.push_back(1.37795e-06);//ionizVec.push_back(1.37795e-06);
187  kinVec.push_back(6.09372);ionizVec.push_back(1.36034e-06);//ionizVec.push_back(1.37614e-06);//ionizVec.push_back(1.37614e-06);
188  kinVec.push_back(6.22985);ionizVec.push_back(1.36459e-06);//ionizVec.push_back(1.37939e-06);//ionizVec.push_back(1.37939e-06);
189  kinVec.push_back(6.36598);ionizVec.push_back(1.36865e-06);//ionizVec.push_back(1.38265e-06);//ionizVec.push_back(1.38265e-06);
190  kinVec.push_back(6.50212);ionizVec.push_back(1.37391e-06);//ionizVec.push_back(1.38038e-06);//ionizVec.push_back(1.38038e-06);
191  kinVec.push_back(6.63825);ionizVec.push_back(1.37861e-06);//ionizVec.push_back(1.38361e-06);//ionizVec.push_back(1.38361e-06);
192  kinVec.push_back(6.77438);ionizVec.push_back(1.38285e-06);//ionizVec.push_back(1.38685e-06);//ionizVec.push_back(1.38685e-06);
193  kinVec.push_back(6.91051);ionizVec.push_back(1.38648e-06);//ionizVec.push_back(1.38748e-06);//ionizVec.push_back(1.38748e-06);
194  kinVec.push_back(7.04665);ionizVec.push_back(1.38971e-06);//ionizVec.push_back(1.39071e-06);
195  kinVec.push_back(7.31891);ionizVec.push_back(1.39186e-06);//ionizVec.push_back(1.39186e-06);
196  kinVec.push_back(7.45504);ionizVec.push_back(1.39507e-06);//ionizVec.push_back(1.39507e-06);
197  kinVec.push_back(7.72731);ionizVec.push_back(1.39519e-06);//ionizVec.push_back(1.39519e-06);
198  kinVec.push_back(7.86344);ionizVec.push_back(1.39713e-06);//ionizVec.push_back(1.39813e-06);
199  kinVec.push_back(8.13571);ionizVec.push_back(1.39835e-06);//ionizVec.push_back(1.39835e-06);
200  kinVec.push_back(8.27184);ionizVec.push_back(1.39978e-06);//ionizVec.push_back(1.39778e-06);
201  kinVec.push_back(8.40797);ionizVec.push_back(1.40071e-06);//ionizVec.push_back(1.40071e-06);
202  kinVec.push_back(8.5441 );ionizVec.push_back(1.40363e-06);//ionizVec.push_back(1.40363e-06);
203  kinVec.push_back(8.81637);ionizVec.push_back(1.40651e-06);//ionizVec.push_back(1.40651e-06);
204  kinVec.push_back(8.9525 );ionizVec.push_back(1.40943e-06);//ionizVec.push_back(1.40943e-06);
205  kinVec.push_back(9.08863);ionizVec.push_back(1.41462e-06);//ionizVec.push_back(1.41462e-06);
206  kinVec.push_back(9.22477);ionizVec.push_back(1.41753e-06);//ionizVec.push_back(1.41753e-06);
207  kinVec.push_back(9.76929);ionizVec.push_back(1.42957e-06);//ionizVec.push_back(1.42957e-06);
208  kinVec.push_back(9.90543);ionizVec.push_back(1.43212e-06);//ionizVec.push_back(1.43212e-06);
209  kinVec.push_back(10.0416);ionizVec.push_back(1.4451e-06 );//ionizVec.push_back(1.4451e-06 );
210  kinVec.push_back(10.1777);ionizVec.push_back(1.44767e-06);//ionizVec.push_back(1.44767e-06);
211  kinVec.push_back(10.3138);ionizVec.push_back(1.45024e-06);//ionizVec.push_back(1.45024e-06);
212  kinVec.push_back(10.7222);ionizVec.push_back(1.45164e-06);//ionizVec.push_back(1.45164e-06);
213  kinVec.push_back(10.8584);ionizVec.push_back(1.45502e-06);//ionizVec.push_back(1.45502e-06);
214  kinVec.push_back(10.9945);ionizVec.push_back(1.45758e-06);//ionizVec.push_back(1.45758e-06);
215  kinVec.push_back(12.0835);ionizVec.push_back(1.45772e-06);//ionizVec.push_back(1.45772e-06);
216 
217  // extrapolation
218 // kinVec.push_back(15.8304);
219 // kinVec.push_back(18.6956);
220 // kinVec.push_back(21.5609);
221 // kinVec.push_back(24.4261);
222 // kinVec.push_back(27.2913);
223 // kinVec.push_back(30.1566);
224 // kinVec.push_back(33.0218);
225 // kinVec.push_back(35.887 );
226 // kinVec.push_back(38.7523);
227 // kinVec.push_back(41.6175);
228 // kinVec.push_back(44.4827);
229 // kinVec.push_back(47.3479);
230 // kinVec.push_back(50.2132);
231 // kinVec.push_back(53.0784);
232 // kinVec.push_back(55.9436);
233 // kinVec.push_back(58.8089);
234 // kinVec.push_back(61.6741);
235 // kinVec.push_back(64.5393);
236 // kinVec.push_back(67.4046);
237 // kinVec.push_back(70.2698);
238 // kinVec.push_back(73.135 );
239 // kinVec.push_back(76.0002);
240 // kinVec.push_back(78.8655);
241 // kinVec.push_back(81.7307);
242 // kinVec.push_back(84.5959);
243 // kinVec.push_back(87.4612);
244 // kinVec.push_back(90.3264);
245 // kinVec.push_back(93.1916);
246 // kinVec.push_back(96.0569);
247 // kinVec.push_back(98.9221);
248 // kinVec.push_back(101.787);
249 // kinVec.push_back(104.653);
250 // kinVec.push_back(107.518);
251 // kinVec.push_back(110.383);
252 // kinVec.push_back(113.248);
253 // kinVec.push_back(116.113);
254 // kinVec.push_back(118.979);
255 // kinVec.push_back(121.844);
256 // kinVec.push_back(124.709);
257 // kinVec.push_back(127.574);
258 // kinVec.push_back(130.44 );
259 // kinVec.push_back(133.305);
260 // kinVec.push_back(136.17 );
261 // kinVec.push_back(139.035);
262 // kinVec.push_back(141.901);
263 // kinVec.push_back(144.766);
264 // kinVec.push_back(147.631);
265 // kinVec.push_back(150.496);
266 // kinVec.push_back(153.361);
267 // kinVec.push_back(156.227);
268 // kinVec.push_back(159.092);
269 // kinVec.push_back(161.957);
270 // kinVec.push_back(164.822);
271 // kinVec.push_back(167.688);
272 // kinVec.push_back(170.553);
273 // kinVec.push_back(173.418);
274 // kinVec.push_back(176.283);
275 // kinVec.push_back(179.149);
276 // kinVec.push_back(182.014);
277 // kinVec.push_back(184.879);
278 // kinVec.push_back(187.744);
279 // kinVec.push_back(190.609);
280 // kinVec.push_back(193.475);
281 // kinVec.push_back(196.34 );
282 // kinVec.push_back(199.205);
283 
284  // electrons // electrons
285  kinVec.push_back(214.286); ionizVec.push_back(1.84391e-06*1.0583);
286  kinVec.push_back(251.468); ionizVec.push_back(1.865e-06 *1.0583);
287  kinVec.push_back(288.65 ); ionizVec.push_back(1.88321e-06*1.0583);
288  kinVec.push_back(325.832); ionizVec.push_back(1.87983e-06*1.0583);
289  kinVec.push_back(363.014); ionizVec.push_back(1.89258e-06*1.0583);
290  kinVec.push_back(400.196); ionizVec.push_back(1.88496e-06*1.0583);
291  kinVec.push_back(437.378); ionizVec.push_back(1.8953e-06 *1.0583);
292  kinVec.push_back(474.56 ); ionizVec.push_back(1.90352e-06*1.0583);
293  kinVec.push_back(511.742); ionizVec.push_back(1.89112e-06*1.0583);
294  kinVec.push_back(548.924); ionizVec.push_back(1.89855e-06*1.0583);
295  kinVec.push_back(586.106); ionizVec.push_back(1.90452e-06*1.0583);
296  kinVec.push_back(623.288); ionizVec.push_back(1.90318e-06*1.0583);
297  kinVec.push_back(660.47 ); ionizVec.push_back(1.90914e-06*1.0583);
298  kinVec.push_back(697.652); ionizVec.push_back(1.91306e-06*1.0583);
299  kinVec.push_back(734.834); ionizVec.push_back(1.91746e-06*1.0583);
300  kinVec.push_back(772.016); ionizVec.push_back(1.92184e-06*1.0583);
301  kinVec.push_back(809.198); ionizVec.push_back(1.92571e-06*1.0583);
302  kinVec.push_back(846.38 ); ionizVec.push_back(1.93009e-06*1.0583);
303  kinVec.push_back(883.562); ionizVec.push_back(1.93345e-06*1.0583);
304  kinVec.push_back(920.744); ionizVec.push_back(1.93669e-06*1.0583);
305  kinVec.push_back(957.926); ionizVec.push_back(1.93992e-06*1.0583);
306  kinVec.push_back(995.108); ionizVec.push_back(1.94317e-06*1.0583);
307  kinVec.push_back(1032.29); ionizVec.push_back(1.94641e-06*1.0583);
308  kinVec.push_back(1069.47); ionizVec.push_back(1.94964e-06*1.0583);
309  kinVec.push_back(1106.65); ionizVec.push_back(1.95206e-06*1.0583);
310  kinVec.push_back(1143.84); ionizVec.push_back(1.95445e-06*1.0583);
311  kinVec.push_back(1181.02); ionizVec.push_back(1.95684e-06*1.0583);
312  kinVec.push_back(1218.2 ); ionizVec.push_back(1.95924e-06*1.0583);
313  kinVec.push_back(1255.38); ionizVec.push_back(1.96162e-06*1.0583);
314  kinVec.push_back(1292.56); ionizVec.push_back(1.96402e-06*1.0583);
315  kinVec.push_back(1329.75); ionizVec.push_back(1.96641e-06*1.0583);
316  kinVec.push_back(1366.93); ionizVec.push_back(1.96846e-06*1.0583);
317  kinVec.push_back(1404.11); ionizVec.push_back(1.97023e-06*1.0583);
318  kinVec.push_back(1441.29); ionizVec.push_back(1.972e-06 *1.0583);
319  kinVec.push_back(1478.47); ionizVec.push_back(1.97379e-06*1.0583);
320  kinVec.push_back(1515.66); ionizVec.push_back(1.97555e-06*1.0583);
321  kinVec.push_back(1552.84); ionizVec.push_back(1.97732e-06*1.0583);
322  kinVec.push_back(1590.02); ionizVec.push_back(1.9791e-06 *1.0583);
323  kinVec.push_back(1627.2 ); ionizVec.push_back(1.98087e-06*1.0583);
324  kinVec.push_back(1664.38); ionizVec.push_back(1.98265e-06*1.0583);
325  kinVec.push_back(1701.57); ionizVec.push_back(1.98434e-06*1.0583);
326  kinVec.push_back(1738.75); ionizVec.push_back(1.98567e-06*1.0583);
327  kinVec.push_back(1775.93); ionizVec.push_back(1.98699e-06*1.0583);
328  kinVec.push_back(1813.11); ionizVec.push_back(1.98832e-06*1.0583);
329  kinVec.push_back(1850.29); ionizVec.push_back(1.98964e-06*1.0583);
330  kinVec.push_back(1887.48); ionizVec.push_back(1.99098e-06*1.0583);
331  kinVec.push_back(1924.66); ionizVec.push_back(1.99229e-06*1.0583);
332  kinVec.push_back(1961.84); ionizVec.push_back(1.99361e-06*1.0583);
333  kinVec.push_back(1999.02); ionizVec.push_back(1.99493e-06*1.0583);
334  kinVec.push_back(2036.2 ); ionizVec.push_back(1.99625e-06*1.0583);
335  kinVec.push_back(2073.39); ionizVec.push_back(1.99759e-06*1.0583);
336  kinVec.push_back(2110.57); ionizVec.push_back(1.99891e-06*1.0583);
337  kinVec.push_back(2147.75); ionizVec.push_back(2.00012e-06*1.0583);
338  kinVec.push_back(2184.93); ionizVec.push_back(2.0011e-06 *1.0583);
339  kinVec.push_back(2222.11); ionizVec.push_back(2.00209e-06*1.0583);
340  kinVec.push_back(2259.3 ); ionizVec.push_back(2.00309e-06*1.0583);
341  kinVec.push_back(2296.48); ionizVec.push_back(2.00407e-06*1.0583);
342  kinVec.push_back(2333.66); ionizVec.push_back(2.00508e-06*1.0583);
343  kinVec.push_back(2370.84); ionizVec.push_back(2.00606e-06*1.0583);
344  kinVec.push_back(2408.02); ionizVec.push_back(2.00706e-06*1.0583);
345  kinVec.push_back(2445.21); ionizVec.push_back(2.00805e-06*1.0583);
346  kinVec.push_back(2482.39); ionizVec.push_back(2.00903e-06*1.0583);
347  kinVec.push_back(2519.57); ionizVec.push_back(2.01003e-06*1.0583);
348  kinVec.push_back(2556.75); ionizVec.push_back(2.01102e-06*1.0583);
349  kinVec.push_back(2593.93); ionizVec.push_back(2.01202e-06*1.0583);
350  kinVec.push_back(2631.12); ionizVec.push_back(2.01301e-06*1.0583);
351  kinVec.push_back(2668.3 ); ionizVec.push_back(2.014e-06 *1.0583);
352  kinVec.push_back(2705.48); ionizVec.push_back(2.01486e-06*1.0583);
353  kinVec.push_back(2742.66); ionizVec.push_back(2.01561e-06*1.0583);
354  kinVec.push_back(2779.84); ionizVec.push_back(2.01635e-06*1.0583);
355  kinVec.push_back(2817.03); ionizVec.push_back(2.0171e-06 *1.0583);
356  kinVec.push_back(2854.21); ionizVec.push_back(2.01784e-06*1.0583);
357  kinVec.push_back(2891.39); ionizVec.push_back(2.01859e-06*1.0583);
358  kinVec.push_back(2928.57); ionizVec.push_back(2.01933e-06*1.0583);
359  kinVec.push_back(2965.75); ionizVec.push_back(2.02008e-06*1.0583);
360  kinVec.push_back(3002.94); ionizVec.push_back(2.02081e-06*1.0583);
361  kinVec.push_back(3040.12); ionizVec.push_back(2.02156e-06*1.0583);
362  kinVec.push_back(3077.3 ); ionizVec.push_back(2.02231e-06*1.0583);
363  kinVec.push_back(3114.48); ionizVec.push_back(2.02306e-06*1.0583);
364  kinVec.push_back(3151.66); ionizVec.push_back(2.0238e-06 *1.0583);
365  kinVec.push_back(3188.85); ionizVec.push_back(2.02454e-06*1.0583);
366  kinVec.push_back(3226.03); ionizVec.push_back(2.02529e-06*1.0583);
367  kinVec.push_back(3263.21); ionizVec.push_back(2.02604e-06*1.0583);
368  kinVec.push_back(3300.39); ionizVec.push_back(2.02678e-06*1.0583);
369  kinVec.push_back(3337.57); ionizVec.push_back(2.02752e-06*1.0583);
370  kinVec.push_back(3374.76); ionizVec.push_back(2.02826e-06*1.0583);
371  kinVec.push_back(3411.94); ionizVec.push_back(2.02887e-06*1.0583);
372  kinVec.push_back(3449.12); ionizVec.push_back(2.02943e-06*1.0583);
373  kinVec.push_back(3486.3 ); ionizVec.push_back(2.03e-06 *1.0583);
374  kinVec.push_back(3523.48); ionizVec.push_back(2.03056e-06*1.0583);
375  kinVec.push_back(3560.67); ionizVec.push_back(2.03113e-06*1.0583);
376  kinVec.push_back(3597.85); ionizVec.push_back(2.03169e-06*1.0583);
377  kinVec.push_back(3635.03); ionizVec.push_back(2.03227e-06*1.0583);
378  kinVec.push_back(3672.21); ionizVec.push_back(2.03283e-06*1.0583);
379  kinVec.push_back(3709.39); ionizVec.push_back(2.03339e-06*1.0583);
380  kinVec.push_back(3746.58); ionizVec.push_back(2.03395e-06*1.0583);
381  kinVec.push_back(3783.76); ionizVec.push_back(2.03452e-06*1.0583);
382  kinVec.push_back(3820.94); ionizVec.push_back(2.03509e-06*1.0583);
383  kinVec.push_back(3858.12); ionizVec.push_back(2.03565e-06*1.0583);
384  kinVec.push_back(3895.3 ); ionizVec.push_back(2.03622e-06*1.0583);
385 
386 
387  // extrapolation
388 // ionizVec.push_back(1.47415e-06);
389 // ionizVec.push_back(1.51035e-06);
390 // ionizVec.push_back(1.54178e-06);
391 // ionizVec.push_back(1.569e-06 );
392 // ionizVec.push_back(1.59476e-06);
393 // ionizVec.push_back(1.61668e-06);
394 // ionizVec.push_back(1.63772e-06);
395 // ionizVec.push_back(1.65727e-06);
396 // ionizVec.push_back(1.67439e-06);
397 // ionizVec.push_back(1.69155e-06);
398 // ionizVec.push_back(1.70766e-06);
399 // ionizVec.push_back(1.72162e-06);
400 // ionizVec.push_back(1.73558e-06);
401 // ionizVec.push_back(1.74958e-06);
402 // ionizVec.push_back(1.76232e-06);
403 // ionizVec.push_back(1.77371e-06);
404 // ionizVec.push_back(1.78513e-06);
405 // ionizVec.push_back(1.79656e-06);
406 // ionizVec.push_back(1.80799e-06);
407 // ionizVec.push_back(1.81811e-06);
408 // ionizVec.push_back(1.82747e-06);
409 // ionizVec.push_back(1.83683e-06);
410 // ionizVec.push_back(1.8462e-06 );
411 // ionizVec.push_back(1.85558e-06);
412 // ionizVec.push_back(1.86498e-06);
413 // ionizVec.push_back(1.87347e-06);
414 // ionizVec.push_back(1.8812e-06 );
415 // ionizVec.push_back(1.88893e-06);
416 // ionizVec.push_back(1.89667e-06);
417 // ionizVec.push_back(1.90442e-06);
418 // ionizVec.push_back(1.91216e-06);
419 // ionizVec.push_back(1.91992e-06);
420 // ionizVec.push_back(1.92768e-06);
421 // ionizVec.push_back(1.93402e-06);
422 // ionizVec.push_back(1.94015e-06);
423 // ionizVec.push_back(1.94627e-06);
424 // ionizVec.push_back(1.9524e-06 );
425 // ionizVec.push_back(1.95853e-06);
426 // ionizVec.push_back(1.96466e-06);
427 // ionizVec.push_back(1.97079e-06);
428 // ionizVec.push_back(1.97692e-06);
429 // ionizVec.push_back(1.98305e-06);
430 // ionizVec.push_back(1.98894e-06);
431 // ionizVec.push_back(1.99384e-06);
432 // ionizVec.push_back(1.99875e-06);
433 // ionizVec.push_back(2.00366e-06);
434 // ionizVec.push_back(2.00857e-06);
435 // ionizVec.push_back(2.01347e-06);
436 // ionizVec.push_back(2.01837e-06);
437 // ionizVec.push_back(2.02328e-06);
438 // ionizVec.push_back(2.02817e-06);
439 // ionizVec.push_back(2.03307e-06);
440 // ionizVec.push_back(2.03797e-06);
441 // ionizVec.push_back(2.04287e-06);
442 // ionizVec.push_back(2.04772e-06);
443 // ionizVec.push_back(2.05173e-06);
444 // ionizVec.push_back(2.05575e-06);
445 // ionizVec.push_back(2.05975e-06);
446 // ionizVec.push_back(2.06375e-06);
447 // ionizVec.push_back(2.06775e-06);
448 // ionizVec.push_back(2.07175e-06);
449 // ionizVec.push_back(2.07574e-06);
450 // ionizVec.push_back(2.07973e-06);
451 // ionizVec.push_back(2.08371e-06);
452 // ionizVec.push_back(2.08771e-06);
453 
454 
455 
456  for(size_t i=0; i<ionizVec.size(); ++i) {
457 // double energy = kinVec[i];
458 // energy +=muonmass; // kinetic energy = energy - mass
459 // double betagamma = ::sqrt(energy*energy-muonmass*muonmass)/muonmass;
460 // mMap.insert(map<double,double>::value_type(betagamma,ionizVec[i]));
461  mMap.insert(map<double,double>::value_type(kinVec[i],ionizVec[i]));
462 
463  }
464  // ifs.close();
465 
466 }
467 BetheBloch::~BetheBloch(){
468  mMap.clear();
469 }
470 double BetheBloch::operator() (double betagamma) {
471 
472  // if betagamma < 2.5, result should be proportional to
473  // 1/beta^2
474  double unnormalized = 0;
475  if (betagamma < .217) {
476  double bg2 = betagamma*betagamma;
477  // Absolute Normalization * relative normalization
478  unnormalized = (5.39e-4*2.0885e-3)*((1+bg2)/bg2);
479  }
480  else {
481  //
482  // betagamma > .8, use table
483  //
484  map<double,double>::iterator lowb = mMap.lower_bound(betagamma);
485  if (lowb == mMap.end())
486  unnormalized = (*(--lowb)).second; // If past the range, return last value
487 
488  else {
489  double bghigh = (*lowb).first;
490  double dedxhigh = (*lowb).second;
491  if (bghigh == betagamma || lowb==mMap.begin())
492  unnormalized = dedxhigh;
493  else {
494  --lowb;
495  double bglow = (*lowb).first; // These variables are not really needed, but
496  double dedxlow = (*lowb).second; // these steps make the code more readable.
497  double slope = (dedxhigh - dedxlow)/(bghigh - bglow);
498  unnormalized = (dedxlow + slope * (betagamma - bglow));
499  }
500  }
501  }
502 
503  // Normalization factor
504  // obtained from fit. 5.3e-4
505  //
506 // return 5.31e-4*unnormalized;
507 // return 5.39e-4*unnormalized;
508  // prod period scale factor from dedxfit.C normalization
509  // P00he 1.1257e-6 1.0000 (reference)
510  // P00hg 1.19346e-6 1.055
511 
512  return 1.055*unnormalized;
513 }
514 
515 // Double_t BetheBloch::operator() (Double_t betagamma){
516 // return (Double_t) operator()((double) betagamma);
517 // }
518 Double_t BetheBloch::Sirrf(Double_t Poverm, Double_t Length, Int_t k) {
519  Double_t Scale2keV = 1.67180; // scale to get 2.40 keV/cm at b*g = 4
520  Double_t par[7] = {
521  2.12188e-01,//2.33912e-01, // Scale
522  1.83678e-05, // I
523  1.17380e+01, // Delta
524  -3.52538e-01, // a0
525  9.38373e-02, // a1
526  -7.95122e-03, // a2
527  1.13168e+01 // Delta_e
528  };
529  Double_t poverm = Poverm;
530  if (poverm > 527.5) poverm = 527.5;
531  Double_t beta2inv = 1. + 1./(poverm*poverm);
532  Double_t gamma = TMath::Sqrt(poverm*poverm + 1);
533  Double_t Lpoverm = TMath::Log(poverm);
534  Double_t K = 0.307075e+3;// keV/g cm^2
535  Double_t A = 38.691;
536  Double_t Z = 17.436;
537  Double_t rho = 1.5607e-03;// 0.9*0.00166+0.1*0.000667
538  Double_t I = par[1]; //15.8e-6; //15.8; // MeV for Ar, 13.1e-6 MeV for CH4
539  Double_t m = 0.510998902;// MeV electron Mass
540  Double_t pim = 139.570180;// MeV pion Mass
541  Double_t Delta;
542  Double_t M = pim;
543  if (k) {M = m; Delta = par[6];}
544  else {M = pim; Delta = par[2];}
545  Double_t r = m/M;
546  Double_t Tmax = 2*m*poverm*poverm/(1. + r*(2*gamma + r));
547  Double_t Tupper = Tmax;
548  Double_t si = K*Z/A*rho/2*beta2inv*
549  (TMath::Log(2*m*poverm*poverm*Tupper/(I*I))
550  - (1 + Tupper/Tmax)/beta2inv - Delta);
551  if (si <= 0) si = 1.e-12;
552  Double_t value = par[0] + TMath::Log(si) +
553  Lpoverm*(par[3] + Lpoverm*(par[4] + Lpoverm*par[5]));
554  Double_t sirrf = TMath::Exp(value)*Scale2keV;
555  const Int_t Nm = 12;
556  Double_t coeff[Nm] = {
557  -3.16420e-01, 6.54653e-02,-4.01169e-03, 1.10047e-04,-1.18392e-06,-7.18814e-09, //hist112
558  3.06893e-10,-2.33023e-12,-7.70897e-15, 2.13252e-16,-1.18276e-18, 2.24178e-21
559  };
560  Double_t X = Length;
561  if (X > 130) X = 130;
562  Double_t FPARAM = 0;
563  for (int i = Nm-1; i >= 0; i--) FPARAM = coeff[i] + X*FPARAM;
564  sirrf *= TMath::Exp(FPARAM);
565  return sirrf;
566 }
567 //________________________________________________________________________________
568 Double_t BetheBloch::Girrf(Double_t poverm, Double_t Tmin, Int_t k) {
569  // returns value of relative ionisation normalised to value
570  // at p/m=4 poverm p/m (=beta gamma) (input)
571  // k = 0 (default) pi+/-,K+/-,P/pbar, deuteron, ..
572  // k != 0 e+-
573  const Int_t NPart = 2;
574  const Int_t NTmin = 7;
575  const Int_t Nbg = 51;
576  Double_t si[NPart][NTmin][Nbg] = {
577  {
578 {// PROTON Tmin = 1.e-8 GeV
579  0.101943, 0.131933, 0.164116, 0.193259, 0.216897,
580  0.235737, 0.250576, 0.261979, 0.270347, 0.276080,
581  0.281042, 0.286340, 0.290173, 0.295568, 0.300482,
582  0.306566, 0.312465, 0.318372, 0.324223, 0.329744,
583  0.335023, 0.340058, 0.344848, 0.349393, 0.353700,
584  0.357779, 0.361643, 0.365304, 0.368776, 0.372072,
585  0.374913, 0.376389, 0.376593, 0.375846, 0.374266,
586  0.371957, 0.369016, 0.365532, 0.361584, 0.357247,
587  0.352590, 0.347674, 0.342559, 0.337297, 0.331938,
588  0.326529, 0.321112, 0.315727, 0.310410, 0.305197,
589  0.300120 },
590 {// PROTON Tmin = 1.e-7 GeV
591  0.347994, 0.357454, 0.371919, 0.385717, 0.395994,
592  0.403121, 0.407599, 0.409719, 0.409620, 0.407459,
593  0.405736, 0.405501, 0.403439, 0.404088, 0.404118,
594  0.406217, 0.408238, 0.410514, 0.413032, 0.415505,
595  0.417925, 0.420282, 0.422560, 0.424747, 0.426835,
596  0.428824, 0.430713, 0.432507, 0.434210, 0.435828,
597  0.437075, 0.437035, 0.435794, 0.433671, 0.430777,
598  0.427212, 0.423070, 0.418436, 0.413386, 0.407992,
599  0.402319, 0.396428, 0.390375, 0.384211, 0.377984,
600  0.371738, 0.365513, 0.359349, 0.353280, 0.347341,
601  0.341561 },
602 {// PROTON Tmin = 1.e-6 GeV
603  0.593960, 0.582899, 0.579653, 0.578112, 0.575033,
604  0.570452, 0.564575, 0.557418, 0.548858, 0.538810,
605  0.530407, 0.524646, 0.516695, 0.512600, 0.507748,
606  0.505866, 0.504008, 0.502654, 0.501840, 0.501266,
607  0.500827, 0.500505, 0.500272, 0.500101, 0.499971,
608  0.499868, 0.499783, 0.499710, 0.499644, 0.499584,
609  0.499237, 0.497681, 0.494996, 0.491496, 0.487287,
610  0.482467, 0.477124, 0.471339, 0.465187, 0.458736,
611  0.452049, 0.445183, 0.438192, 0.431126, 0.424030,
612  0.416946, 0.409914, 0.402971, 0.396151, 0.389484,
613  0.383002 },
614 {// PROTON Tmin = 1.e-5 GeV
615  0.833507, 0.807579, 0.786688, 0.769868, 0.753491,
616  0.737259, 0.721083, 0.704710, 0.687752, 0.669883,
617  0.654863, 0.643630, 0.629838, 0.621036, 0.611330,
618  0.605482, 0.599758, 0.594782, 0.590641, 0.587023,
619  0.583726, 0.580727, 0.577983, 0.575454, 0.573106,
620  0.570912, 0.568853, 0.566912, 0.565078, 0.563340,
621  0.561399, 0.558327, 0.554198, 0.549321, 0.543798,
622  0.537722, 0.531178, 0.524243, 0.516989, 0.509480,
623  0.501778, 0.493937, 0.486009, 0.478040, 0.470076,
624  0.462155, 0.454316, 0.446594, 0.439021, 0.431628,
625  0.424443 },
626 {// PROTON Tmin = 1.e-4 GeV
627  0.839440, 0.852428, 0.868749, 0.883187, 0.893099,
628  0.894966, 0.872911, 0.847920, 0.823201, 0.798172,
629  0.777163, 0.761008, 0.741863, 0.728709, 0.714420,
630  0.704779, 0.695307, 0.686786, 0.679366, 0.672732,
631  0.666596, 0.660931, 0.655683, 0.650801, 0.646237,
632  0.641954, 0.637921, 0.634114, 0.630511, 0.627096,
633  0.623560, 0.618972, 0.613400, 0.607146, 0.600309,
634  0.592977, 0.585231, 0.577147, 0.568790, 0.560225,
635  0.551508, 0.542692, 0.533826, 0.524955, 0.516121,
636  0.507363, 0.498717, 0.490216, 0.481891, 0.473772,
637  0.465884 },
638 {// PROTON Tmin = 1.e-3 GeV
639  0.839440, 0.852428, 0.868749, 0.883187, 0.893099,
640  0.898899, 0.900993, 0.899481, 0.894283, 0.885457,
641  0.877116, 0.862326, 0.842699, 0.828748, 0.812605,
642  0.800885, 0.788845, 0.777552, 0.767334, 0.757968,
643  0.749173, 0.740953, 0.733272, 0.726078, 0.719325,
644  0.712969, 0.706973, 0.701306, 0.695938, 0.690847,
645  0.685720, 0.679616, 0.672600, 0.664970, 0.656819,
646  0.648232, 0.639285, 0.630050, 0.620592, 0.610969,
647  0.601237, 0.591446, 0.581643, 0.571870, 0.562167,
648  0.552572, 0.543118, 0.533838, 0.524761, 0.515915,
649  0.507326 },
650 {// PROTON Tmin = 1.e1 GeV
651  0.839440, 0.852428, 0.868749, 0.883187, 0.893099,
652  0.898899, 0.900993, 0.899481, 0.894283, 0.885457,
653  0.878268, 0.874738, 0.867393, 0.866105, 0.863513,
654  0.865548, 0.867478, 0.870049, 0.873256, 0.876516,
655  0.879759, 0.882956, 0.886067, 0.889055, 0.891893,
656  0.894564, 0.897060, 0.899372, 0.901496, 0.903427,
657  0.904867, 0.904887, 0.903560, 0.901187, 0.897863,
658  0.893675, 0.888699, 0.883011, 0.876680, 0.869776,
659  0.862371, 0.854537, 0.846347, 0.837877, 0.829201,
660  0.820390, 0.811514, 0.802638, 0.793821, 0.785117,
661  0.776576 }},
662 {
663 {// ELECTRON Tmin = 1.e-8 GeV
664  0.061287, 0.087795, 0.126397, 0.181703, 0.202595,
665  0.220138, 0.234761, 0.246683, 0.256100, 0.263201,
666  0.268300, 0.272757, 0.278553, 0.283217, 0.289664,
667  0.295870, 0.302224, 0.308683, 0.314918, 0.320935,
668  0.326709, 0.332211, 0.337422, 0.342334, 0.346949,
669  0.351274, 0.355322, 0.359110, 0.362619, 0.365927,
670  0.369046, 0.371274, 0.372309, 0.372300, 0.371368,
671  0.369625, 0.367170, 0.364099, 0.360497, 0.356446,
672  0.352020, 0.347288, 0.342316, 0.337162, 0.331881,
673  0.326526, 0.321143, 0.315777, 0.310469, 0.305257,
674  0.300178 },
675 {// ELECTRON Tmin = 1.e-7 GeV
676  0.125786, 0.180191, 0.259418, 0.372493, 0.379818,
677  0.385913, 0.390665, 0.393878, 0.395446, 0.395244,
678  0.393315, 0.391397, 0.392162, 0.391340, 0.393547,
679  0.395422, 0.397651, 0.400503, 0.403317, 0.406129,
680  0.408914, 0.411632, 0.414253, 0.416758, 0.419139,
681  0.421530, 0.423843, 0.426048, 0.428093, 0.430022,
682  0.431810, 0.432729, 0.432457, 0.431133, 0.428882,
683  0.425818, 0.422050, 0.417685, 0.412824, 0.407566,
684  0.401998, 0.396197, 0.390223, 0.384127, 0.377956,
685  0.371751, 0.365554, 0.359406, 0.353343, 0.347404,
686  0.341621 },
687 {// ELECTRON Tmin = 1.e-6 GeV
688  0.188065, 0.269407, 0.387860, 0.556745, 0.553215,
689  0.549427, 0.545222, 0.540270, 0.534318, 0.527012,
690  0.518178, 0.509957, 0.505733, 0.499451, 0.497444,
691  0.495072, 0.493300, 0.492673, 0.492196, 0.491928,
692  0.491837, 0.491870, 0.491977, 0.492123, 0.492286,
693  0.492451, 0.492611, 0.492762, 0.492848, 0.492941,
694  0.493006, 0.492318, 0.490554, 0.487856, 0.484391,
695  0.480299, 0.475593, 0.470347, 0.464633, 0.458521,
696  0.452078, 0.445373, 0.438474, 0.431444, 0.424347,
697  0.417240, 0.410176, 0.403202, 0.396356, 0.389668,
698  0.383168 },
699 {// ELECTRON Tmin = 1.e-5 GeV
700  0.225341, 0.322804, 0.464735, 0.667397, 0.688362,
701  0.693097, 0.686526, 0.678489, 0.668279, 0.655910,
702  0.641449, 0.627702, 0.618939, 0.607496, 0.601436,
703  0.594923, 0.589212, 0.585138, 0.581386, 0.578045,
704  0.575080, 0.572423, 0.570010, 0.567790, 0.565726,
705  0.563791, 0.561968, 0.560244, 0.558563, 0.556967,
706  0.555428, 0.553212, 0.549991, 0.545900, 0.541051,
707  0.535547, 0.529485, 0.522951, 0.516028, 0.508790,
708  0.501306, 0.493641, 0.485852, 0.477989, 0.470100,
709  0.462227, 0.454414, 0.446703, 0.439133, 0.431741,
710  0.424562 },
711 {// ELECTRON Tmin = 1.e-4 GeV
712  0.225341, 0.322804, 0.464735, 0.667399, 0.688502,
713  0.707020, 0.722967, 0.736155, 0.746477, 0.753312,
714  0.754001, 0.738000, 0.728293, 0.714387, 0.705829,
715  0.696189, 0.687171, 0.679993, 0.673170, 0.666869,
716  0.661084, 0.655754, 0.650813, 0.646201, 0.641872,
717  0.637792, 0.633933, 0.630274, 0.626755, 0.623409,
718  0.620202, 0.616395, 0.611656, 0.606113, 0.599875,
719  0.593041, 0.585702, 0.577942, 0.569838, 0.561459,
720  0.552871, 0.544134, 0.535304, 0.526432, 0.517565,
721  0.508750, 0.500027, 0.491434, 0.483015, 0.474795,
722  0.466821 },
723 {// ELECTRON Tmin = 1.e-3 GeV
724  0.225341, 0.322804, 0.464735, 0.667399, 0.688502,
725  0.707020, 0.722967, 0.736155, 0.746477, 0.753660,
726  0.757573, 0.761068, 0.768750, 0.772628, 0.781271,
727  0.788131, 0.793997, 0.796536, 0.785481, 0.776785,
728  0.769068, 0.761861, 0.754986, 0.748371, 0.741985,
729  0.735813, 0.729846, 0.724079, 0.718458, 0.713030,
730  0.707767, 0.701933, 0.695202, 0.687704, 0.679552,
731  0.670848, 0.661690, 0.652161, 0.642342, 0.632307,
732  0.622124, 0.611854, 0.601555, 0.591279, 0.581077,
733  0.570992, 0.561067, 0.551338, 0.541840, 0.532602,
734  0.523648 },
735 {// ELECTRON Tmin = 1.e1 GeV
736  0.225341, 0.322804, 0.464735, 0.667399, 0.688502,
737  0.707020, 0.722967, 0.736155, 0.746477, 0.753660,
738  0.757573, 0.761068, 0.768750, 0.772628, 0.781271,
739  0.788131, 0.793997, 0.799402, 0.803492, 0.806548,
740  0.808743, 0.810210, 0.811067, 0.811423, 0.811374,
741  0.811006, 0.810387, 0.809573, 0.808541, 0.807405,
742  0.806174, 0.804141, 0.801002, 0.796909, 0.791990,
743  0.786363, 0.780137, 0.773409, 0.766268, 0.758796,
744  0.751070, 0.743158, 0.735125, 0.727027, 0.718920,
745  0.710854, 0.702875, 0.695023, 0.687337, 0.679848,
746  0.672586 }}
747  };
748 
749  Double_t beta2inv = 1. + 1./(poverm*poverm);
750  Double_t bgL = TMath::Log10 (poverm);
751  Double_t X = 10*(bgL+1);
752  if (X < 0) X = 0;
753  if (X > Nbg) X = Nbg;
754  Int_t iX = (int) X;
755  if (iX < 0) iX = 0;
756  if (iX > Nbg - 2) iX = Nbg - 2;
757  Double_t dX = X - iX;
758  Int_t l = 0;
759  if (k != 0) l = 1; // e+/-
760  Double_t Y = 8;
761  if (Tmin > 0) Y = 8 + TMath::Log10(Tmin);
762  if (Y < 0) Y = 0;
763  if (Y > 6) Y = 6;
764  Int_t iY = (int) Y;
765  if (iY < 0) iY = 0;
766  if (iY > NTmin-2) iY = NTmin-2;
767  Double_t dY = Y - iY;
768  Double_t Dx = 1 - dX;
769  Double_t Dy = 1 - dY;
770  Double_t sirrf =
771  Dx*Dy*si[l][iY][iX] + dX*Dy*si[l][iY][iX+1] +
772  Dx*dY*si[l][iY+1][iX] + dX*dY*si[l][iY+1][iX+1];
773  sirrf *= beta2inv*(bgL + 2.);
774 #if 0
775 printf("poverm : %f l : %i iY : %i iX : %i dX = %f dY = %f sirrf = %f Tmin: %f\n",
776  poverm,l,iY,iX,dX,dY,sirrf, Tmin);
777 printf("Dx:%f Dy:%f si[l][iY][iX]:%f\n",Dx,Dy,si[l][iY][iX]);
778 #endif
779  return sirrf;
780 }
781