Hyperiso 1.0.3
Modular flavour-physics calculations, Wilson coefficients and statistical inference
Loading...
Searching...
No Matches
BWilsonGroup.cpp
Go to the documentation of this file.
1#include "BWilsonGroup.h"
2
4 LOG_TRACE("In BCoefficientGroup constructor");
6}
7
8std::shared_ptr<CoefficientGroup> BCoefficientGroup::clone() const {
9 return std::make_shared<BCoefficientGroup>(*this);
10}
11
12
13std::unordered_map<WCoefId, scalar_t> BCoefficientGroup::base_1_LO_calculation (
14 const std::unordered_map<QCDOrder, std::unordered_map<WCoefId, scalar_t>>& coef_matching,
15 const BlockSrc& src
16)
17{
18 LOG_DEBUG("Init LO running of BCoefficientGroup in standard basis");
19
20 auto U0 = [src] (int k, int l) -> double {
21 return src.get_val("U_MATRIX",LhaID(0, k, l));
22 };
23
24 std::array<complex_t, 10> Ci_match = {};
26 for (size_t k = 0; k < 10; k++) {
27 Ci_match[k] = coef_matching.at(QCDOrder::LO).at(WCoefMapper::to_id(ids[k]));
28 }
29
30 std::array<complex_t, 10> Ci_run {};
31
32 Ci_match[6] = BRP::C7_eff_std(Ci_match);
33 Ci_match[7] = BRP::C8_eff_std(Ci_match);
34 Ci_match[8] *= src.get_val("WPARAM_MATCH_SM", 1)/ (4. * PI);
35
36
37 for (size_t k = 0; k < 8; k++) {
38 for (size_t l = 0; l < 8; l++) {
39 Ci_run[k] += U0(k, l) * Ci_match[l];
40 }
41 }
42
43 for (size_t l = 0; l < 9; l++) {
44 Ci_run[8] += 4 * PI / src.get_val("WPARAM_RUN_SM",1) * U0(8, l) * Ci_match[l];
45 }
46
47 // C10
48 // Ask Nazila : // Review why NLO and NNLO terms enter the C10 running initialized at LO rather than separate orders.
49 // Answer : Ask Siavash, need to understand if pb comes from litt or implementation.
50
51 Ci_run[9] = Ci_match[9];
52
53 std::unordered_map<WCoefId, scalar_t> Ci_run_map {};
54 for (size_t k = 0; k < 10; k++) {
55 Ci_run_map[WCoefMapper::to_id(ids[k])] = Ci_run[k];
56 }
57
58 return Ci_run_map;
59}
60
61std::unordered_map<WCoefId, scalar_t> BCoefficientGroup::base_2_LO_calculation (
62 const std::unordered_map<QCDOrder, std::unordered_map<WCoefId, scalar_t>>& coef_matching,
63 const BlockSrc& src
64)
65{
66 LOG_DEBUG("Init LO running of BCoefficientGroup in traditional basis");
67
68 auto V0 = [src] (int k, int l) -> double {
69 return src.get_val("V_MATRIX",LhaID(0, k, l));
70 };
71
72 std::array<complex_t, 10> Ci_match_trad = {};
74 for (size_t k = 0; k < 8; k++) {
75 for (size_t j = 0; j < 8; j++) {
76 Ci_match_trad[k] += BRP::std_to_trad_LO[k][j] * coef_matching.at(QCDOrder::LO).at(WCoefMapper::to_id(ids[j]));
77
78 }
79 }
80 Ci_match_trad[8] = src.get_val("WPARAM_MATCH_SM",1)/ (4. * PI) * coef_matching.at(QCDOrder::LO).at(WCoefMapper::to_id(WCoef::C9));
81
82 std::array<complex_t, 10> Ci_run {};
83
84 for (size_t k = 0; k < 8; k++) {
85 for (size_t l = 0; l < 8; l++) {
86 Ci_run[k] += V0(k, l) * Ci_match_trad[l];
87 }
88 LOG_VERBOSE("C_run_", k + 1, "=", Ci_run[k]);
89 }
90
91 for (size_t l = 0; l < 9; l++) {
92 Ci_run[8] += 4 * PI / src.get_val("WPARAM_RUN_SM",1)* V0(8, l) * Ci_match_trad[l];
93 }
94
95 Ci_run[9] = coef_matching.at(QCDOrder::LO).at(WCoefMapper::to_id(WCoef::C10));
96
97 std::unordered_map<WCoefId, scalar_t> Ci_run_map {};
98 for (size_t k = 0; k < 10; k++) {
99 Ci_run_map[WCoefMapper::to_id(ids[k])] = Ci_run[k];
100 }
101
102 return Ci_run_map;
103}
104
105std::unordered_map<WCoefId, scalar_t> BCoefficientGroup::base_1_NLO_calculation(
106 const std::unordered_map<QCDOrder, std::unordered_map<WCoefId, scalar_t>>& coef_matching,
107 const BlockSrc& src
108)
109{
110 LOG_DEBUG("Init NLO running of BCoefficientGroup in standard basis");
111
112 auto U0 = [src] (int k, int l) -> double {
113 return src.get_val("U_MATRIX",LhaID(0, k, l));
114 };
115
116 auto U1 = [src] (int k, int l) -> double {
117 return src.get_val("U_MATRIX",LhaID(1, k, l));
118 };
119
120 auto C_eff = [] (const std::array<complex_t, 10>& Ci, const double* vec) -> complex_t {
121 complex_t C {0};
122 for (size_t k = 0; k < 8; k++) {
123 C += Ci[k] * vec[k];
124 }
125 return C;
126 };
127
128 double eta = src.get_val("WPARAM_RUN_SM",2);
129
130 std::array<complex_t, 10> Ci_0_match = {};
131 std::array<complex_t, 10> Ci_1_match = {};
133 for (size_t k = 0; k < 10; k++) {
134 Ci_0_match[k] = coef_matching.at(QCDOrder::LO).at(WCoefMapper::to_id(ids[k]));
135 Ci_1_match[k] = coef_matching.at(QCDOrder::NLO).at(WCoefMapper::to_id(ids[k]));
136 }
137
138 std::array<complex_t, 10> Ci_run {};
139
140 Ci_0_match[6] = C_eff(Ci_0_match, BRP::y_std);
141 Ci_0_match[7] = C_eff(Ci_0_match, BRP::z_std);
142 Ci_1_match[6] = C_eff(Ci_1_match, BRP::y_std);
143 Ci_1_match[7] = C_eff(Ci_1_match, BRP::z_std);
144 Ci_0_match[8] *= src.get_val("WPARAM_MATCH_SM",1) / (4 * PI);
145 Ci_1_match[8] *= src.get_val("WPARAM_MATCH_SM",1) / (4 * PI);
146
147 for (size_t k = 0; k < 8; k++) {
148 for (size_t l = 0; l < 8; l++) {
149 Ci_run[k] += U0(k, l) * Ci_1_match[l] + U1(k, l) * Ci_0_match[l];
150 }
151 }
152
153 for (size_t l = 0; l < 9; l++) {
154 Ci_run[8] += 4 * PI / src.get_val("WPARAM_RUN_SM",1) * (U0(8, l) * Ci_1_match[l] + U1(8, l) * Ci_0_match[l]);
155 }
156
157 Ci_run[9] = coef_matching.at(QCDOrder::NLO).at(WCoefMapper::to_id(WCoef::C10));
158
159 std::unordered_map<WCoefId, scalar_t> Ci_run_map {};
160 for (size_t k = 0; k < 10; k++) {
161 Ci_run_map[WCoefMapper::to_id(ids[k])] = eta * Ci_run[k];
162 }
163
164 return Ci_run_map;
165}
166
167std::unordered_map<WCoefId, scalar_t> BCoefficientGroup::base_2_NLO_calculation(
168 const std::unordered_map<QCDOrder, std::unordered_map<WCoefId, scalar_t>>& coef_matching,
169 const BlockSrc& src
170)
171{
172 LOG_DEBUG("Init NLO running of BCoefficientGroup in traditional basis");
173
174 auto V0 = [src] (int k, int l) -> double {
175 return src.get_val("V_MATRIX",LhaID(0, k, l));
176 };
177
178 auto V1 = [src] (int k, int l) -> double {
179 return src.get_val("V_MATRIX",LhaID(1, k, l));
180 };
181
182 std::array<complex_t, 10> Ci_0_match_trad = {};
183 std::array<complex_t, 10> Ci_1_match_trad = {};
185 for (size_t k = 0; k < 8; k++) {
186 for (size_t j = 0; j < 8; j++) {
187 complex_t Cj_0_match_std = coef_matching.at(QCDOrder::LO).at(WCoefMapper::to_id(ids[j]));
188 complex_t Cj_1_match_std = coef_matching.at(QCDOrder::NLO).at(WCoefMapper::to_id(ids[j]));
189 Ci_0_match_trad[k] += BRP::std_to_trad_LO[k][j] * Cj_0_match_std;
190 Ci_1_match_trad[k] += BRP::std_to_trad_LO[k][j] * Cj_1_match_std + BRP::std_to_trad_NLO[k][j] * Cj_0_match_std;
191 }
192 }
193 Ci_0_match_trad[8] = src.get_val("WPARAM_MATCH_SM",1) / (4 * PI) * coef_matching.at(QCDOrder::LO).at(WCoefMapper::to_id(WCoef::C9));
194 Ci_1_match_trad[8] = src.get_val("WPARAM_MATCH_SM",1) / (4 * PI) * coef_matching.at(QCDOrder::NLO).at(WCoefMapper::to_id(WCoef::C9));
195
196 std::array<complex_t, 10> Ci_run {};
197 for (size_t k = 0; k < 8; k++) {
198 for (size_t l = 0; l < 8; l++) {
199 Ci_run[k] += V0(k, l) * Ci_1_match_trad[l] + V1(k, l) * Ci_0_match_trad[l];
200 }
201 }
202
203 for (size_t l = 0; l < 9; l++) {
204 Ci_run[8] += 4 * PI / src.get_val("WPARAM_RUN_SM",1) * (V0(8, l) * Ci_1_match_trad[l] + V1(8, l) * Ci_0_match_trad[l]);
205 }
206
207 Ci_run[9] = coef_matching.at(QCDOrder::NLO).at(WCoefMapper::to_id(WCoef::C10));
208
209 double eta = src.get_val("WPARAM_RUN_SM",2);
210 std::unordered_map<WCoefId, scalar_t> Ci_run_map {};
211 for (size_t k = 0; k < 10; k++) {
212 Ci_run_map[WCoefMapper::to_id(ids[k])] = eta * Ci_run[k];
213 }
214
215 return Ci_run_map;
216}
217
218std::unordered_map<WCoefId, scalar_t> BCoefficientGroup::base_1_NNLO_calculation(
219 const std::unordered_map<QCDOrder, std::unordered_map<WCoefId, scalar_t>>& coef_matching,
220 const BlockSrc& src
221)
222{
223 LOG_DEBUG("Init NNLO running of BCoefficientGroup in standard basis");
224
225 auto U = [src] (int order, int k, int l) -> double {
226 return src.get_val("U_MATRIX",LhaID(order, k, l));
227 };
228
229 std::array<complex_t, 10> Ci_0_match = {};
230 std::array<complex_t, 10> Ci_1_match = {};
231 std::array<complex_t, 10> Ci_2_match = {};
233 for (size_t k = 0; k < 10; k++) {
234 Ci_0_match[k] = coef_matching.at(QCDOrder::LO).at(WCoefMapper::to_id(ids[k]));
235 Ci_1_match[k] = coef_matching.at(QCDOrder::NLO).at(WCoefMapper::to_id(ids[k]));
236 Ci_2_match[k] = coef_matching.at(QCDOrder::NNLO).at(WCoefMapper::to_id(ids[k]));
237 }
238
239 Ci_0_match[6] = BRP::C7_eff_std(Ci_0_match);
240 Ci_0_match[7] = BRP::C8_eff_std(Ci_0_match);
241 Ci_1_match[6] = BRP::C7_eff_std(Ci_1_match);
242 Ci_1_match[7] = BRP::C8_eff_std(Ci_1_match);
243 Ci_2_match[6] = BRP::C7_eff_std(Ci_2_match);
244 Ci_2_match[7] = BRP::C8_eff_std(Ci_2_match);
245 Ci_0_match[8] *= src.get_val("WPARAM_MATCH_SM",1) / (4 * PI);
246 Ci_1_match[8] *= src.get_val("WPARAM_MATCH_SM",1) / (4 * PI);
247 Ci_2_match[8] *= src.get_val("WPARAM_MATCH_SM",1) / (4 * PI);
248
249 std::array<complex_t, 10> Ci_run {};
250
251 for (size_t k = 0; k < 8; k++) {
252 for (size_t l = 0; l < 8; l++) {
253 Ci_run[k] += U(2, k, l) * Ci_0_match[l] + U(1, k, l) * Ci_1_match[l] + U(0, k, l) * Ci_2_match[l];
254 }
255 }
256
257 for (size_t l = 0; l < 9; l++) {
258 Ci_run[8] += 4 * PI / src.get_val("WPARAM_RUN_SM",1) * (U(2, 8, l) * Ci_0_match[l] + U(1, 8, l) * Ci_1_match[l] + U(0, 8, l) * Ci_2_match[l]);
259 }
260
261 Ci_run[9] = coef_matching.at(QCDOrder::NNLO).at(WCoefMapper::to_id(WCoef::C10));
262
263 double eta_sq = pow(src.get_val("WPARAM_RUN_SM",2), 2);
264 std::unordered_map<WCoefId, scalar_t> Ci_run_map {};
265 for (size_t k = 0; k < 10; k++) {
266 Ci_run_map[WCoefMapper::to_id(ids[k])] = eta_sq * Ci_run[k];
267 }
268
269 return Ci_run_map;
270}
271
QCDOrder
#define LOG_TRACE(...)
Macro for logging trace messages.
Definition Logger.h:46
#define LOG_DEBUG(...)
Macro for logging debug messages.
Definition Logger.h:45
#define LOG_VERBOSE(...)
Macro for logging verbose messages.
Definition Logger.h:47
std::complex< double > complex_t
Convenience alias for std::complex<double>.
Definition Utils.h:35
static std::unordered_map< WCoefId, scalar_t > base_1_NNLO_calculation(const std::unordered_map< QCDOrder, std::unordered_map< WCoefId, scalar_t > > &coef_matching, const BlockSrc &src)
static std::unordered_map< WCoefId, scalar_t > base_1_LO_calculation(const std::unordered_map< QCDOrder, std::unordered_map< WCoefId, scalar_t > > &coef_matching, const BlockSrc &src)
std::shared_ptr< CoefficientGroup > clone() const override
Polymorphic clone.
static std::unordered_map< WCoefId, scalar_t > base_2_NLO_calculation(const std::unordered_map< QCDOrder, std::unordered_map< WCoefId, scalar_t > > &coef_matching, const BlockSrc &src)
BCoefficientGroup(WilsonGroupAdapterConfig adapters)
static std::unordered_map< WCoefId, scalar_t > base_1_NLO_calculation(const std::unordered_map< QCDOrder, std::unordered_map< WCoefId, scalar_t > > &coef_matching, const BlockSrc &src)
static std::unordered_map< WCoefId, scalar_t > base_2_LO_calculation(const std::unordered_map< QCDOrder, std::unordered_map< WCoefId, scalar_t > > &coef_matching, const BlockSrc &src)
Lightweight view over a set of source blocks.
Definition SourcesView.h:71
scalar_t get_val(std::string_view blk, std::initializer_list< long > code) const
Retrieves the value of a parameter given as an initializer_list.
Polymorphic container of WilsonCoefficient objects representing a coefficient group.
static std::vector< WCoef > get_group(WGroup g)
Returns the list of Wilson coefficients belonging to a WGroup.
constexpr double PI
Definition constants.h:7
scalar_t pow(const scalar_t &base, const scalar_t &exp)
Definition scalar.cpp:75
static constexpr double z_std[8]
static complex_t C8_eff_std(const std::array< complex_t, 10 > &Ci)
static complex_t C7_eff_std(const std::array< complex_t, 10 > &Ci)
static constexpr double y_std[8]
static const std::array< std::array< double, 8 >, 8 > std_to_trad_NLO
static const std::array< std::array< double, 8 >, 8 > std_to_trad_LO
Represents an identifier of a LHA element, possibly containing several sub-ids.
Definition LhaID.h:56
Dependency injection bundle for CoefficientGroup.