Hyperiso 1.0.3
Modular flavour-physics calculations, Wilson coefficients and statistical inference
Loading...
Searching...
No Matches
BVFFCalculator.cpp
Go to the documentation of this file.
1#include "BVFFCalculator.h"
2
4 if (!this->allowed_decays.contains({B_id, V_id})) {
5 LOG_ERROR("ValueError", "Wrong meson PDG code in BVFFCalculator constructor:", B_id, ",", V_id);
6 }
7
8 if (V_id == 333 && (src == BV_FF_Src::GKvD_SR || src == BV_FF_Src::GKvD_SR_LAT)) {
9 LOG_WARN("GKvD formfactors are not available for Bs > phi decays. Defaulting to BFS formfactors.");
11 }
12
13 this->m_B = (*p)({ParameterType::FLAVOR, "FMASS", B_id}, DataType::VALUE);
14 this->m_B2 = std::pow(this->m_B, 2);
15 this->m_B4 = std::pow(this->m_B2, 2);
16 this->m_V = (*p)({ParameterType::FLAVOR, "FMASS", V_id}, DataType::VALUE);
17 this->m_V2 = std::pow(this->m_V, 2);
18 this->m_V4 = std::pow(this->m_V2, 2);
19 this->t_p = std::pow(this->m_B + this->m_V, 2);
20 this->t_m = std::pow(this->m_B - this->m_V, 2);
21 this->t_0 = src == BV_FF_Src::HLMW ? 12. : this->t_p * (1. - std::sqrt(1 - this->t_m / this->t_p));
22 this->z_0 = std::real(z(0.0, this->t_p, this->t_0));
23 this->src_block = allowed_decays.at({B_id, V_id});
24 this->load_FF_params(src);
25 this->syst_err = src == BV_FF_Src::HLMW ? std::real((*p)({ParameterType::FLAVOR, this->src_block, 6}, DataType::VALUE)) : 0.0;
26}
27
28complex_t BVFFCalculator::z(double t, double t_p, double t_0) {
29 double a = std::sqrt(t_p - t);
30 double b = std::sqrt(t_p - t_0);
31 return (a - b) / (a + b);
32}
33
34double BVFFCalculator::get(BV_FF a, double q2) {
35 switch (a) {
36 case BV_FF::A2:
37 return this->A_2(q2);
38 case BV_FF::T3:
39 return this->T_3(q2);
40 case BV_FF::XI_PERP:
41 return this->xi_perp(q2);
42 case BV_FF::XI_PAR:
43 return this->xi_par(q2);
44 case BV_FF::F_PERP:
45 return this->f_perp(q2);
46 case BV_FF::F_PAR:
47 return this->f_par(q2);
48 case BV_FF::F_0:
49 return this->f_0(q2);
50 default:
51 return this->F_a(a, q2);
52 }
53}
54
55void BVFFCalculator::load_FF_params(BV_FF_Src src) {
56 int ff_id = (int)(src) + 1;
57 int sse_order = src == BV_FF_Src::HLMW ? 1 : 2;
58 std::string src_block = this->src_block;
59
60 auto get_m = [this, ff_id, src_block] (int i) { return (*iobspp_sm)(ParamId{ParameterType::DECAY, src_block, {ff_id, 0, i}}, DataType::VALUE); };
61 this->m_R[BV_FF::A0] = get_m(1);
62 this->m_R[BV_FF::V] = this->m_R[BV_FF::T1] = get_m(2);
63 this->m_R[BV_FF::A1] = this->m_R[BV_FF::A12] = this->m_R[BV_FF::T2] = this->m_R[BV_FF::T23] = get_m(3);
64
65 for (int i = 1; i <= 7; i++) {
66 for (int j = 0; j <= sse_order; j++) {
67 ParamId PId;
68 if (src == BV_FF_Src::GRvDV || src == BV_FF_Src::GKvD_SR || src == BV_FF_Src::GKvD_SR_LAT) {
69 if (i == 3 && j == 0) {
70 PId = {ParameterType::DECAY, src_block, {ff_id, 1, j}};
71 this->alpha_ai[(BV_FF)(i - 1)][j] = (*iobspp_sm)(PId, DataType::VALUE) * (m_B2 - m_V2) / (8 * m_B * m_V);
72 continue;
73 } else if (i == 6 && j == 0) {
74 PId = {ParameterType::DECAY, src_block, {ff_id, 5, j}};
75 this->alpha_ai[(BV_FF)(i - 1)][j] = (*iobspp_sm)(PId, DataType::VALUE);
76 continue;
77 }
78 }
79
80 PId = {ParameterType::DECAY, src_block, {ff_id, i, j}};
81 this->alpha_ai[(BV_FF)(i - 1)][j] = (*iobspp_sm)(PId, DataType::VALUE);
82 }
83 }
84}
85
86double BVFFCalculator::pole(double q2, double m_R) {
87 return 1. / (1 - q2 / std::pow(m_R, 2));
88}
89
90double BVFFCalculator::E(double q2) {
91 return (this->m_B2 + this->m_V2 - q2) / (2 * this->m_B);
92}
93
94double BVFFCalculator::F_a(BV_FF a, double q2) {
95 auto ai = this->alpha_ai.at(a);
96 double P = pole(q2, this->m_R.at(a));
97 double Z = std::real(z(q2, this->t_p, this->t_0)) - this->z_0;
98
99 // NF : Here all FFs have the same syst_err : correlation = 1 between every FF. I think it would be more accurate to generate a random gaussian number with 0 mean and syst_err standard dev so that each FF error is independent.
100 return P * (ai[0] + Z * (ai[1] + Z * ai[2])) * (1 + this->syst_err);
101}
102
103double BVFFCalculator::A_2(double q2) {
104 double A_1 = F_a(BV_FF::A1, q2);
105 double A_12 = F_a(BV_FF::A12, q2);
106 return (this->t_p * (this->m_B2 - this->m_V2 - q2) * A_1 - 16. * this->m_B * this->m_V2 * (this->m_B + this->m_V) * A_12) / ((this->t_p - q2) * (this->t_m - q2));
107}
108
109double BVFFCalculator::T_3(double q2) {
110 double T_2 = F_a(BV_FF::T2, q2);
111 double T_23 = F_a(BV_FF::T23, q2);
112 return ((this->m_B2 - this->m_V2) * (this->m_B2 + 3. * this->m_V2 - q2) * T_2 - 8. * this->m_B * this->m_V2 * (this->m_B - this->m_V) * T_23) / ((this->t_p - q2) * (this->t_m - q2));
113}
114
115double BVFFCalculator::xi_perp(double q2) {
116 // Defining xi_perp(0) in terms of T_1(0) to ensure self-consistency in B > V gamma
117 if (fpeq(q2, 0.0)) {
118 return F_a(BV_FF::T1, 0.0); // At LO (should NLO alpha_s corrections [0412400] be taken into account ?)
119 }
120
121 return this->m_B * F_a(BV_FF::V, q2) / (this->m_B + this->m_V);
122}
123
124double BVFFCalculator::xi_par(double q2) {
125 return (this->m_B + this->m_V) * F_a(BV_FF::A1, q2) / (2. * E(q2)) - (this->m_B - this->m_V) * A_2(q2) / this->m_B;
126}
127
128double BVFFCalculator::f_perp(double q2) {
129 double lambda = this->m_B4 + this->m_V4 + q2 * q2 - 2 * (this->m_B2 * this->m_V2 + q2 * (this->m_B2 + this->m_V2));
130 return std::sqrt(2. * lambda) / (this->m_B + this->m_V) * F_a(BV_FF::V, q2);
131}
132
133double BVFFCalculator::f_par(double q2) {
134 return RT2 * (this->m_B + this->m_V) * F_a(BV_FF::A1, q2);
135}
136
137double BVFFCalculator::f_0(double q2) {
138 double lambda = this->m_B4 + this->m_V4 + q2 * q2 - 2 * (this->m_B2 * this->m_V2 + q2 * (this->m_B2 + this->m_V2));
139 return ((this->m_B * this->m_B - q2 - this->m_V * this->m_V) * this->t_p * F_a(BV_FF::A1, q2) - lambda * A_2(q2)) / (2. * this->m_V * (this->m_B + this->m_V) * sqrt(q2));
140}
BV_FF_Src
BV_FF
#define LOG_ERROR(type,...)
Macro for logging error messages and terminating the application.
Definition Logger.h:41
#define LOG_WARN(...)
Macro for logging warning messages.
Definition Logger.h:40
std::complex< double > complex_t
Convenience alias for std::complex<double>.
Definition Utils.h:35
BVFFCalculator()=default
double get(BV_FF a, double q2) override
complex_t z(double t, double t_p, double t_0)
double E(double q2)
constexpr double E
Definition constants.h:13
constexpr double RT2
Definition constants.h:15
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.
Definition ParamID.h:57