8 #ifndef SRC_INCLUDE_SMASH_KINEMATICS_H_
9 #define SRC_INCLUDE_SMASH_KINEMATICS_H_
27 const double m_sum = ma + mb;
28 const double m_dif = ma - mb;
29 return std::sqrt((s - m_sum * m_sum) / (s - m_dif * m_dif));
40 const double inv_gamma = 2 * ma * mb / (s - ma * ma - mb * mb);
41 return std::sqrt(1.0 - inv_gamma * inv_gamma);
53 const auto mass_a_sqr = mass_a * mass_a;
54 const auto x = s + mass_a_sqr - mass_b * mass_b;
55 return x * x * (T(0.25) / s) - mass_a_sqr;
66 T
pCM_from_s(
const T s,
const T mass_a,
const T mass_b) noexcept {
68 return psqr > T(0.) ? std::sqrt(psqr) : T(0.);
79 T
pCM(
const T sqrts,
const T mass_a,
const T mass_b) noexcept {
80 return pCM_from_s(sqrts * sqrts, mass_a, mass_b);
91 T
pCM_sqr(
const T sqrts,
const T mass_a,
const T mass_b) noexcept {
108 template <
typename T>
109 std::array<T, 2>
get_t_range(
const T sqrts,
const T m1,
const T m2,
const T m3,
111 const T p_i =
pCM(sqrts, m1, m2);
112 const T p_f =
pCM(sqrts, m3, m4);
113 const T sqrt_t0 = (m1 * m1 - m2 * m2 - m3 * m3 + m4 * m4) / (2. * sqrts);
114 const T t0 = sqrt_t0 * sqrt_t0;
115 const T t_min = t0 - (p_i - p_f) * (p_i - p_f);
116 const T t_max = t0 - (p_i + p_f) * (p_i + p_f);
117 assert(t_min >= t_max);
118 return {t_min, t_max};
128 if (mandelstam_s < m_sum * m_sum) {
129 std::stringstream err;
130 err <<
"plab_from_s: s too small: " << mandelstam_s <<
" < "
132 throw std::runtime_error(err.str());
144 std::stringstream err;
145 err <<
"plab_from_s: negative radicand: " << mandelstam_s;
146 throw std::runtime_error(err.str());
158 const double radicand = mandelstam_s * (mandelstam_s - 4 * mass * mass);
160 const double m_sum = 2 * mass;
164 return std::sqrt(radicand) / (2 * mass);
185 inline double plab_from_s(
double mandelstam_s,
double m_projectile,
187 const double m_sum = m_projectile + m_target;
188 const double m_diff = m_projectile - m_target;
189 const double radicand =
190 (mandelstam_s - m_sum * m_sum) * (mandelstam_s - m_diff * m_diff);
199 return std::sqrt(radicand) / (2 * m_target);
212 return m_P * m_P + m_T * m_T + 2 * m_T * e_tot;
224 inline double s_from_Etot(
double e_tot_p,
double e_tot_t,
double m_p,
226 double pz_p = std::sqrt(e_tot_p * e_tot_p - m_p * m_p);
227 double pz_t = std::sqrt(e_tot_t * e_tot_t - m_t * m_t);
228 return std::pow(e_tot_p + e_tot_t, 2) - std::pow(pz_p - pz_t, 2);
252 inline double s_from_Ekin(
double e_kin_p,
double e_kin_t,
double m_p,
254 return s_from_Etot(e_kin_p + m_t, e_kin_t + m_t, m_p, m_t);
266 return m_P * m_P + m_T * m_T + 2 * m_T * std::sqrt(m_P * m_P + plab * plab);
278 inline double s_from_plab(
double plab_p,
double plab_t,
double m_p,
280 return s_from_Etot(std::sqrt(m_p * m_p + plab_p * plab_p),
281 std::sqrt(m_t * m_t + plab_t * plab_t), plab_p, plab_t);
Collection of useful constants that are known at compile time.
double plab_from_s(double mandelstam_s, double mass)
Convert Mandelstam-s to p_lab in a fixed-target collision.
T pCM(const T sqrts, const T mass_a, const T mass_b) noexcept
T pCM_sqr(const T sqrts, const T mass_a, const T mass_b) noexcept
double fixed_target_projectile_v(double s, double ma, double mb)
double s_from_Ekin(double e_kin, double m_P, double m_T)
Convert E_kin to Mandelstam-s for a fixed-target setup, with a projectile of mass m_P and a kinetic e...
T pCM_sqr_from_s(const T s, const T mass_a, const T mass_b) noexcept
static void check_radicand(double mandelstam_s, double radicand)
Helper function for plab_from_s.
std::array< T, 2 > get_t_range(const T sqrts, const T m1, const T m2, const T m3, const T m4)
Get the range of Mandelstam-t values allowed in a particular 2->2 process, see PDG 2014 booklet,...
static void check_energy(double mandelstam_s, double m_sum)
Helper function for plab_from_s.
constexpr double nucleon_mass
Nucleon mass in GeV.
double center_of_velocity_v(double s, double ma, double mb)
T pCM_from_s(const T s, const T mass_a, const T mass_b) noexcept
double s_from_Etot(double e_tot, double m_P, double m_T)
Convert E_tot to Mandelstam-s for a fixed-target setup, with a projectile of mass m_P and a total ene...
double s_from_plab(double plab, double m_P, double m_T)
Convert p_lab to Mandelstam-s for a fixed-target setup, with a projectile of mass m_P and momentum pl...