17 namespace ActsFatras {
41 template <
typename generator_t>
54 std::array<double, 4> scattering_params;
60 double beta2Inv = 1 + mOverP * mOverP;
61 double beta = 1 / std::sqrt(beta2Inv);
63 double tob2 = tInX0 * beta2Inv;
64 if (tob2 > 0.6 / std::pow(slab.
material().
Z(), 0.6)) {
75 theta =
gaussmix(generator, scattering_params);
78 auto scattering_params_sg =
82 theta =
semigauss(generator, scattering_params_sg);
88 slab, particle.
pdg(), particle.
mass(),
90 theta = std::normal_distribution<double>(0.0, theta0)(generator);
93 return M_SQRT2 *
theta;
98 std::array<double, 4>
getGaussian(
double beta,
double p,
double tInX0,
100 std::array<double, 4> scattering_params;
102 scattering_params[0] = 15. / beta / p * std::sqrt(tInX0) *
scale;
103 scattering_params[1] = 1.0;
104 scattering_params[2] = 1.0;
105 scattering_params[3] = 0.5;
106 return scattering_params;
110 double Z,
double scale)
const {
111 std::array<double, 4> scattering_params;
112 scattering_params[0] = 15. / beta / p * std::sqrt(tInX0) *
114 double d1 = std::log(tInX0 / (beta * beta));
115 double d2 = std::log(std::pow(Z, 2.0 / 3.0) * tInX0 / (beta * beta));
117 double var1 = (-1.843e-3 * d1 + 3.347e-2) * d1 + 8.471
e-1;
120 epsi = (6.096e-4 * d2 + 6.348e-3) * d2 + 4.841
e-2;
122 epsi = (-5.729e-3 * d2 + 1.106e-1) * d2 - 1.908
e-2;
123 scattering_params[1] = var1;
124 scattering_params[2] = (1 - (1 - epsi) * var1) / epsi;
125 scattering_params[3] = epsi;
126 return scattering_params;
130 double Z,
double scale)
const {
131 std::array<double, 6> scattering_params;
132 double N = tInX0 * 1.587E7 * std::pow(Z, 1.0 / 3.0) / (beta * beta) /
133 (Z + 1) / std::log(287 / std::sqrt(Z));
134 scattering_params[4] = 15. / beta / p * std::sqrt(tInX0) *
136 double rho = 41000 / std::pow(Z, 2.0 / 3.0);
137 double b = rho / std::sqrt(N * (std::log(rho) - 0.5));
138 double n = std::pow(Z, 0.1) * std::log(N);
139 double var1 = (5.783E-4 * n + 3.803E-2) * n + 1.827
E-1;
141 (((-4.590E-5 * n + 1.330E-3) * n - 1.355
E-2) * n + 9.828E-2) * n +
143 double epsi = (1 - var1) / (a * a * (std::log(b / a) - 0.5) - var1);
144 scattering_params[3] =
145 (epsi > 0) ? epsi : 0.0;
146 scattering_params[0] =
a;
147 scattering_params[1] =
b;
148 scattering_params[2] = var1;
149 scattering_params[5] =
N;
150 return scattering_params;
161 template <
typename generator_t>
163 const std::array<double, 4> &scattering_params)
const {
164 std::uniform_real_distribution<double> udist(0.0, 1.0);
165 double sigma_tot = scattering_params[0];
166 double var1 = scattering_params[1];
167 double var2 = scattering_params[2];
168 double epsi = scattering_params[3];
169 bool ind = udist(generator) > epsi;
170 double u = udist(generator);
172 return std::sqrt(var1) * std::sqrt(-2 * std::log(u)) * sigma_tot;
174 return std::sqrt(var2) * std::sqrt(-2 * std::log(u)) * sigma_tot;
185 template <
typename generator_t>
187 const std::array<double, 6> &scattering_params)
const {
188 std::uniform_real_distribution<double> udist(0.0, 1.0);
189 double a = scattering_params[0];
190 double b = scattering_params[1];
191 double var1 = scattering_params[2];
192 double epsi = scattering_params[3];
193 double sigma_tot = scattering_params[4];
194 bool ind = udist(generator) > epsi;
195 double u = udist(generator);
197 return std::sqrt(var1) * std::sqrt(-2 * std::log(u)) * sigma_tot;
199 return a * b * std::sqrt((1 - u) / (u * b * b + a * a)) * sigma_tot;