32 theta = 180 * theta / TMath::Pi();
33 double a = -0.8816 / 10000 / (1 / theta - 0.1117 / 1000 * theta) - 0.1096 -
34 0.01966 * TMath::Exp(-0.02040 * theta);
35 double b = 0.4169 / 100 / (1 / theta - 0.9891 / 10000 * theta) + 4.0395 -
36 4.3118 * TMath::Exp(0.9235 / 1000 * theta);
37 double btilde = b + 1.0 / TMath::Ln10();
38 double gamma = sqrt(-TMath::Ln10() * a);
39 double offset = 0.5 * btilde / a;
40 double norm = TMath::Erf(gamma * (TMath::Log(100) + offset)) -
41 TMath::Erf(gamma * (offset + TMath::Log(minE)));
44 double r3 =
rng->Uniform();
46 TMath::ErfInverse(r3 * norm +
47 TMath::Erf(gamma * (offset + TMath::Log(minE)))) /
51 double c = -0.3516 / 1000 * theta * theta + 0.8861 / 100 * theta - 2.5985 -
52 0.8745 / 100000 * TMath::Exp(0.1457 * theta);
53 double scale = 0.5 * TMath::Sqrt(TMath::Pi()) / gamma *
54 TMath::Power(10, (-0.25 / a * btilde * btilde + c));
94 TDatabasePDG* pdgBase = TDatabasePDG::Instance();
95 mass = pdgBase->GetParticle(13)->Mass();
96 cout <<
"--------------------------------------------------------------------"
99 cout <<
"configuration for the CMBG as defined in "
100 "$FAIRSHIP/python/CMBG_conf.py: "
102 cout <<
"x_dist: " <<
xdist << endl;
103 cout <<
"z_dist: " <<
zdist << endl;
104 cout <<
"x_box: " <<
xBox << endl;
105 cout <<
"y_box: " <<
yBox << endl;
106 cout <<
"z_box: " <<
zBox << endl;
107 cout <<
"n_EVENTS:" <<
n_EVENTS << endl;
108 cout <<
"minE: " <<
minE << endl << endl;
110 LOG(error) <<
"CosmicsGenerator: invalid configuration "
111 <<
"(xdist * zdist * n_EVENTS == 0). Stopping execution.";
117 cout <<
"Simulation for high momentum" << endl;
119 cout <<
"Simulation for low momentum" << endl;
127 double weight_flux, weight_DetectorBox;
132 <<
"CosmicsGenerator: invalid configuration, choose minE < 100";
135 constexpr int kIntegrationSteps = 100;
136 const double dt = TMath::Pi() / 2 / kIntegrationSteps;
137 for (
int i = 0; i < kIntegrationSteps; ++i) {
138 const double t = (i + 0.5) * dt;
146 2 * TMath::Pi() / 3 *
fRandomEngine->fSpectrumH->Integral(100, 1000);
147 cout <<
"High E CM flux: " <<
FluxIntegral <<
"m-2s-1" << endl;
158 weight = weight_flux / weight_DetectorBox;
159 cout <<
"weight_DetectorBox: " << weight_DetectorBox <<
", weight: " <<
weight
161 cout <<
"--------------------------------------------------------------------"