6 if (!this->allowed_decays.contains({B_id, P_id})) {
7 LOG_ERROR(
"ValueError",
"Wrong meson PDG code in BPFFCalculator constructor:", B_id,
",", P_id);
12 this->t_p = std::pow(this->m_B + this->m_P, 2);
13 this->t_m = std::pow(this->m_B - this->m_P, 2);
14 this->t_0 = src ==
BP_FF_Src::HPQCD22 ? 0. : this->t_p * (1. - std::sqrt(1 - this->t_m / this->t_p));
19 this->z_0 = std::real(
z(0.0, this->t_p, this->t_0));
21 this->src_block = allowed_decays.at({B_id, P_id});
22 this->load_FF_params(src);
26 double a = std::sqrt(t_p - t);
27 double b = std::sqrt(t_p - t_0);
28 return (a - b) / (a + b);
36 return this->F_a(a, q2);
40void BPFFCalculator::load_FF_params(
BP_FF_Src src) {
41 int ff_id = (int)(src) + 1;
42 int order = this->sse_order.at(src);
43 std::string src_block = this->src_block;
50 for (
int i = 1; i <= 3; i++) {
51 for (
int j = 0; j <= order; j++) {
68 double z0 = std::real(this->
z(0, this->t_p, this->t_0));
83double BPFFCalculator::pole(
double q2,
double m_R) {
84 if (
fpeq(m_R, 0.0))
return 1.0;
86 return 1. / (1 - q2 / std::pow(m_R, 2));
90 return (this->m_B * this->m_B + this->m_P * this->m_P - q2) / (2 * this->m_B);
93double BPFFCalculator::F_a(
BP_FF a,
double q2) {
94 auto ai = this->alpha_ai.at(a);
95 double P = pole(q2, this->m_R.at(a));
96 double Z = std::real(
z(q2, this->t_p, this->t_0)) - this->z_0;
102 for (
int k = 0; k < 4; k++) {
104 res += ai[k] * std::pow(Z, k);
107 return this->L_chi * P * res;
#define LOG_ERROR(type,...)
Macro for logging error messages and terminating the application.
std::complex< double > complex_t
Convenience alias for std::complex<double>.
complex_t z(double t, double t_p, double t_0)
double get(BP_FF a, double q2) override
scalar_t pow(const scalar_t &base, const scalar_t &exp)
std::enable_if_t< not std::numeric_limits< T >::is_integer, bool > fpeq(T, T, std::size_t n=10)
Compares two floating point numbers with a given precision.
Composite identifier for a single parameter.