2#define _USE_MATH_DEFINES
18 mfunname(
"double cos_theta_two_part(...)");
20 const double Mp2 = Mp * Mp;
21 const double d0 = Ep0 * Ep0 - Mp2;
23 const double d1 = Ep1 * Ep1 - Mp2;
25 return (-Ep0 * Mt + Ep0 * Ep1 + Mt * Ep1 - Mp2) /
sqrt(d0 * d1);
29 const double Mt,
double& theta_p,
double& theta_t) {
30 mfunname(
"void theta_two_part(...)");
32 const double Mp2 = Mp * Mp;
33 const double d0 = Ep0 * Ep0 - Mp2;
35 const double d1 = Ep1 * Ep1 - Mp2;
37 double ctheta = (-Ep0 * Mt + Ep0 * Ep1 + Mt * Ep1 - Mp2) /
sqrt(d0 * d1);
38 if (ctheta < -1.0) ctheta = -1.0;
39 if (ctheta > 1.0) ctheta = 1.0;
40 theta_p =
acos(ctheta);
42 theta_t = CLHEP::halfpi;
45 double Pp1 = Ep1 * Ep1 - Mp2;
48 theta_t = CLHEP::halfpi;
52 const double d3 = Ep0 + Mt - Ep1;
53 const double dd1 = d3 * d3 - Mt * Mt;
55 const double dd2 =
sqrt(dd1);
57 double stheta_t = -Pp1 * (
sin(theta_p) / dd2);
58 if (stheta_t < -1.0) stheta_t = -1.0;
59 if (stheta_t > 1.0) stheta_t = 1.0;
60 theta_t =
asin(stheta_t);
#define check_econd11(a, signb, stream)
double cos_theta_two_part(const double Ep0, const double Ep1, const double Mp, const double Mt)
void theta_two_part(const double Ep0, const double Ep1, const double Mp, const double Mt, double &theta_p, double &theta_t)
Scattering angles as function of incident and final projectile energy.
DoubleAc acos(const DoubleAc &f)
DoubleAc sin(const DoubleAc &f)
DoubleAc asin(const DoubleAc &f)
DoubleAc sqrt(const DoubleAc &f)