21int main(
int argc,
char* argv[])
31 JParser<> zap(
"Example program to histogram muon energy loss.");
38 catch(
const exception &error) {
45 TH1D h1(
"h1",
NULL, 900, -1.0, +8.0);
46 TH2D h2(
"h2",
NULL, 90, -1.0, +8.0, 100, 0.0, 5.0);
47 TH2D h3(
"h3",
NULL, 130, -1.0, +12.0, 90, -1.0, +8.0);
49 for(
int ix = 1;
ix <= h1.GetNbinsX(); ++
ix) {
51 const double x = h1.GetBinCenter(
ix);
52 const double E = pow(10.0, x);
54 h1.SetBinContent(
ix, gWater(E));
60 const double x = h2.GetXaxis()->GetBinCenter(
ix);
61 const double y = h2.GetYaxis()->GetBinCenter(
iy);
63 const double E = pow(10.0, x);
64 const double dx = pow(10.0, y);
66 h2.SetBinContent(
ix,
iy, gWater(E,
dx));
70 const double precision = 1.0e-3;
75 const double x =
h3.GetXaxis()->GetBinCenter(
ix);
76 const double y =
h3.GetYaxis()->GetBinCenter(
iy);
78 const double E1 = pow(10.0, x);
79 const double E2 = pow(10.0, y);
82 double Rmax = gWater(E1);
90 R = 0.5 * (Rmax +
Rmin);
92 const double E = gWater(E1, R);
94 if (fabs(E - E2) <= precision) {
104 h3.SetBinContent(
ix,
iy, R);