55 JParser<> zap(
"Program to determine the energy loss due to visible delta-rays.");
58 zap[
'T'] =
make_field(T_GeV,
"kinetic energy range of electron [GeV]") = JRange_t();
60 zap[
'L'] =
make_field(lepton) = muon, tau, positron, electron;
67 catch(
const exception &error) {
68 FATAL(error.what() << endl);
77 else if (lepton == tau)
79 else if (lepton == positron)
81 else if (lepton == electron)
84 FATAL(
"Invalid lepton " << lepton << endl);
98 NOTICE(
"Tmin [GeV] " <<
FIXED(8,6) << Tmin <<
' ' <<
FIXED(8,6) << T_GeV.getLowerLimit() << endl);
100 if (T_GeV.is_valid()) {
101 if (Tmin < T_GeV.getLowerLimit()) {
102 Tmin = T_GeV.getLowerLimit();
109 TH1D h0(
"h0", NULL, 80, log10(MASS_LEPTON), +9.25);
111 for (
int i = 1; i <= h0.GetNbinsX(); ++i) {
113 const double x = h0.GetBinCenter(i);
114 const double E = pow(10.0,x);
116 const double gamma = E / MASS_LEPTON;
117 const double beta = sqrt(1.0 - 1.0/(gamma*gamma));
122 double Tmax = (lepton == electron ?
124 (2.0*
MASS_ELECTRON*beta*beta*gamma*gamma) / (1.0 + 2.0*gamma*RATIO + RATIO*RATIO));
126 if (T_GeV.is_valid()) {
127 if (Tmax > T_GeV.getUpperLimit()) {
128 Tmax = T_GeV.getUpperLimit();
137 const double a = 1.0;
138 const double b = -beta*beta/Tmax;
139 const double c = 0.5/(E*E);
141 const double xmin = log(Tmin);
142 const double xmax = log(Tmax);
145 const double W = dx * 0.5 *
K * (Z/A) * (1.0/(beta*beta));
147 for (
double x = xmin; x <= xmax; x += dx) {
149 const double T = exp(x);
151 const double F = a + T*(b + T*(c));
152 const double y = W * F;
161 DEBUG(
"dE/dx [MeV g^-1 cm^2] " <<
FIXED(5,4) << value << endl);
163 h0.SetBinContent(i, value);
167 TF1 f1(
"f1",
"[0] + [1]*x + [2]*x*x + [3]*x*x*x");
169 if (option.find(
'W') == string::npos) {
173 f1.SetParameter(0, h0.GetMinimum());
174 f1.SetParameter(1, (h0.GetMaximum() - h0.GetMinimum()) / (h0.GetXaxis()->GetXmax() - h0.GetXaxis()->GetXmin()));
175 f1.SetParameter(2, 0.0);
176 f1.SetParameter(3, 0.0);
178 f1.SetLineColor(kRed);
182 h0.Fit(&f1, option.c_str(),
"same");
185 cout <<
"\t// " << lepton << endl;
186 cout <<
"\t// dE/dX = a + bx + cx^2 + dx^3; // [MeV g^-1 cm^2]; x = log10(E/GeV);" << endl;
188 for (
int i = 0; i != 4; ++i) {
189 cout <<
"\tstatic const double " << (char) (
'a' + i) <<
" = " <<
SCIENTIFIC(10,3) << f1.GetParameter(i) <<
";" << endl;
195 double Emin = 1 * MASS_LEPTON;
196 double Emax = 5 * MASS_LEPTON;
198 for (
double E = 0.5 * (Emin + Emax); ; E = 0.5 * (Emin + Emax)) {
200 const double gamma = E / MASS_LEPTON;
201 const double beta = sqrt(1.0 - 1.0/(gamma*gamma));
203 const double Tmax = (lepton == electron ?
205 (2.0*
MASS_ELECTRON*beta*beta*gamma*gamma) / (1.0 + 2.0*gamma*RATIO + RATIO*RATIO));
207 if (fabs(Tmax - Tmin) < precision) {
208 cout <<
"\tstatic const double Emin = " <<
FIXED(7,5) << E <<
"; // [GeV]" << endl;