8 #ifndef SRC_INCLUDE_SMASH_TABULATION_H_
9 #define SRC_INCLUDE_SMASH_TABULATION_H_
48 Tabulation(
double x_min,
double range,
size_t num,
49 std::function<
double(
double)> f);
124 std::min(
static_cast<size_t>(index_double),
values_.size() - 2);
125 const double r = index_double -
n;
147 if (sqrts <= stable_mass + resonance_mass) {
154 pCM(sqrts, stable_mass, resonance_mass);
177 if (sqrts <= res_mass_1 + res_mass_2) {
185 pCM(sqrts, res_mass_1, res_mass_2);
203 const double m_stable = stable.
mass();
204 return Tabulation(m_min + m_stable, range, 100, [&](
double srts) {
205 return integrate(m_min, srts - m_stable, [&](
double m) {
226 return Tabulation(m1_min + m2_min, range, 125, [&](
double srts) {
227 const double m1_max = srts - m2_min;
228 const double m2_max = srts - m1_min;
230 m1_min, m1_max, m2_min, m2_max, [&](
double m1,
double m2) {
A C++ interface for numerical integration in two dimensions with the Cuba Cuhre integration function.
A C++ interface for numerical integration in one dimension with the GSL CQUAD integration functions.
Particle type contains the static properties of a particle species.
double min_mass_kinematic() const
The minimum mass of the resonance that is kinematically allowed.
double full_spectral_function(double m) const
Full spectral function of the resonance (relativistic Breit-Wigner distribution with mass-dependent ...
A class for storing a one-dimensional lookup table of floating-point values.
double x_min_
lower bound for tabulation
double inv_dx_
inverse step size 1/dx
double x_max_
upper bound for tabulation
double get_value_linear(double x, ExtrapolationType extrapolation=ExtrapolationType::Linear) const
Look up a value from the tabulation using linear interpolation.
std::vector< double > values_
vector for storing tabulated values
static Tabulation from_file(std::ifstream &stream, sha256::Hash hash)
Construct a tabulation object by reading binary data from a stream.
Tabulation()
Construct an empty tabulation object.
void write(std::ofstream &stream, sha256::Hash hash) const
Write a binary representation of the tabulation to a stream.
double linear_approximation_(double x) const
Linear approximation to interpolate and extrapolate tabulations.
double get_value_step(double x) const
Look up a value from the tabulation (without any interpolation, simply using the closest tabulated va...
Collection of useful constants that are known at compile time.
ExtrapolationType
Allows to specify the desired extrapolation type.
@ Linear
Extrapolate using a linear approach.
std::array< uint8_t, HASH_SIZE > Hash
A SHA256 hash.
T pCM(const T sqrts, const T mass_a, const T mass_b) noexcept
static Integrator integrate
Tabulation spectral_integral_semistable(Integrator &integrate, const ParticleType &resonance, const ParticleType &stable, double range)
Create a table for the spectral integral of a resonance and a stable particle.
static Integrator2d integrate2d(1E7)
double spec_func_integrand_2res(double sqrts, double res_mass_1, double res_mass_2, const ParticleType &t1, const ParticleType &t2)
Spectral function integrand for GSL integration, with two resonances in the final state.
Tabulation spectral_integral_unstable(Integrator2d &integrate2d, const ParticleType &res1, const ParticleType &res2, double range)
Create a table for the spectral integral of two resonances.
double spec_func_integrand_1res(double resonance_mass, double sqrts, double stable_mass, const ParticleType &type)
Spectral function integrand for GSL integration, with one resonance in the final state (the second pa...