6 LOG_DEBUG(
"Initializing WilsonParameterHelper core blocks");
7 init_scale_independent_block(gen);
12 if (initialized_running_groups.find(grp) != initialized_running_groups.end()) {
13 LOG_TRACE(
"WilsonParameterHelper already initialized for requested group");
17 init_running_block(grp);
18 initialized_running_groups.emplace(grp);
21void WilsonParameterHelper::init_scale_independent_block(
int gen) {
22 LOG_DEBUG(
"Init scale-independent wparam block");
23 std::unordered_map<ParameterType, std::vector<std::string>> src = {{
ParameterType::SM, {
"SMINPUTS",
"MASS"}}};
25 auto func = [gen] (
const BlockSrc& src, std::shared_ptr<DependentBlock> dep_block) {
26 double xh =
pow(src.get_val(
"MASS", 25) / src.get_val(
"MASS", 24), 2);
31 dep_block->store_or_assign(3, std::make_shared<Parameter>(
ParamId{
ParameterType::WILSON,
"WPARAM_SI_SM", 3}, src.get_val(
"MASS", 9 + 2 * gen), 0., 0.));
35 const int lepton_pdgs[3] = {11, 13, 15};
36 for (
int i = 0; i < 3; ++i) {
38 dep_block->store_or_assign(slot, std::make_shared<Parameter>(
ParamId{
ParameterType::WILSON,
"WPARAM_SI_SM", slot}, src.get_val(
"MASS", lepton_pdgs[i]), 0., 0.));
41 dep_block->store_or_assign(4, std::make_shared<Parameter>(
ParamId{
ParameterType::WILSON,
"WPARAM_SI_SM", 4}, src.get_val(
"SMINPUTS", {7, 1}), 0., 0.));
44 iblock_c->compose_block(
"WPARAM_SI_SM", src, func);
47void WilsonParameterHelper::init_matching_block() {
48 LOG_DEBUG(
"Init matching scale dependent wparam block");
51 auto func = [] (
const BlockSrc& src, std::shared_ptr<DependentBlock> dep_block) {
52 LOG_DEBUG(
"Update wilson matching block");
53 double mu_W = src.get_val(
"EW_SCALE", 1);
64 double m_W = src.get_val(
"MASS", 24);
65 double xt =
pow(mass_top_muW / m_W, 2);
66 double L =
log(std::pow(mu_W / m_W, 2));
68 double xtt =
pow(src.get_val(
"QCD", 6) / m_W, 2.);
88 iblock_c->compose_block(
"WPARAM_MATCH_SM", src, func);
93void WilsonParameterHelper::init_running_parameter_blocks_B() {
95 LOG_DEBUG(
"Init running matrices blocks of B Coefficient group");
96 std::unordered_map<ParameterType, std::vector<std::string>> eta_powers_src = {{
ParameterType::WILSON, {
"WPARAM_RUN_SM"}}};
98 auto eta_powers_func = [] (
const BlockSrc& src, std::shared_ptr<DependentBlock> dep_block) {
99 double eta = src.
get_val(
"WPARAM_RUN_SM", 2);
106 std::unordered_map<ParameterType, std::vector<std::string>> mtx_src = {{
ParameterType::WILSON, {
"WPARAM_RUN_SM",
"ETA_POWS"}}};
108 auto U_func = [] (
const BlockSrc& src, std::shared_ptr<DependentBlock> dep_block) {
109 double eta = src.
get_val(
"WPARAM_RUN_SM", 2);
110 auto pid = [] (
int n,
int k,
int l) {
123 U0 +=
BRP::m00[ke][le][ie] * eta_ai;
127 dep_block->store_or_assign(
LhaID(0, ke, le), std::make_shared<Parameter>(pid(0, ke, le), U0, 0., 0.));
128 dep_block->store_or_assign(
LhaID(1, ke, le), std::make_shared<Parameter>(pid(1, ke, le), U1, 0., 0.));
129 dep_block->store_or_assign(
LhaID(2, ke, le), std::make_shared<Parameter>(pid(2, ke, le), U2, 0., 0.));
134 auto V_func = [] (
const BlockSrc& src, std::shared_ptr<DependentBlock> dep_block) {
135 double eta = src.
get_val(
"WPARAM_RUN_SM", 2);
136 auto pid = [] (
int n,
int k,
int l) {
148 V0 +=
BRP::l00[ke][le][ie] * eta_ai;
151 dep_block->store_or_assign(
LhaID(0, ke, le), std::make_shared<Parameter>(pid(0, ke, le), V0, 0., 0.));
152 dep_block->store_or_assign(
LhaID(1, ke, le), std::make_shared<Parameter>(pid(1, ke, le), V1, 0., 0.));
157 iblock_c->compose_block(
"ETA_POWS", eta_powers_src, eta_powers_func);
158 iblock_c->compose_block(
"U_MATRIX", mtx_src, U_func);
159 iblock_c->compose_block(
"V_MATRIX", mtx_src, V_func);
164void WilsonParameterHelper::init_running_parameter_blocks_MM() {
170 LOG_DEBUG(
"Init running matrices blocks of Meson Mixing Coefficient group");
171 if (
iblock_c->has_composed_block(
"ETA_POWS_MIXING")
172 &&
iblock_c->has_composed_block(
"UM_MATRIX_5")
173 &&
iblock_c->has_composed_block(
"UM_MATRIX_4")) {
174 LOG_TRACE(
"Meson-mixing running matrices already composed");
178 std::unordered_map<ParameterType, std::vector<std::string>> eta_powers_src = {{
ParameterType::WILSON, {
"WPARAM_RUN_SM"}}};
180 auto eta_powers_func = [] (
const BlockSrc& src, std::shared_ptr<DependentBlock> dep_block) {
181 double eta5 = src.
get_val(
"WPARAM_RUN_SM", 2);
182 double eta4 = src.
get_val(
"WPARAM_RUN_SM", 3);
190 std::unordered_map<ParameterType, std::vector<std::string>> mtx_src = {{
ParameterType::WILSON, {
"WPARAM_RUN_SM",
"ETA_POWS_MIXING"}}};
192 auto U_5_func = [] (
const BlockSrc& src, std::shared_ptr<DependentBlock> dep_block) {
193 double eta_5 = src.
get_val(
"WPARAM_RUN_SM", 2);
194 auto pid = [] (
int n,
int k,
int l) {
202 double eta_V = src.
get_val(
"ETA_POWS_MIXING",
LhaID(1, 0));
205 dep_block->store_or_assign(
LhaID(0, 0, 0), std::make_shared<Parameter>(pid(0, 0, 0), U0, 0., 0.));
206 dep_block->store_or_assign(
LhaID(0, 5, 5), std::make_shared<Parameter>(pid(0, 5, 5), U0, 0., 0.));
207 dep_block->store_or_assign(
LhaID(1, 0, 0), std::make_shared<Parameter>(pid(1, 0, 0), U1, 0., 0.));
208 dep_block->store_or_assign(
LhaID(1, 5, 5), std::make_shared<Parameter>(pid(1, 5, 5), U1, 0., 0.));
210 std::array<double, 2> eta_LR {
215 for (
int i = 0; i < 2; ++i) {
216 for (
int j = 0; j < 2; ++j) {
218 for (
int k = 0; k < 2; ++k) {
222 dep_block->store_or_assign(
LhaID(0, 1+i, 1+j), std::make_shared<Parameter>(pid(0, 1+i, 1+j), U0, 0., 0.));
223 dep_block->store_or_assign(
LhaID(1, 1+i, 1+j), std::make_shared<Parameter>(pid(1, 1+i, 1+j), U1, 0., 0.));
227 std::array<double, 2> eta_S {
232 for (
int i = 0; i < 2; ++i) {
233 for (
int j = 0; j < 2; ++j) {
235 for (
int k = 0; k < 2; ++k) {
239 dep_block->store_or_assign(
LhaID(0, 3+i, 3+j), std::make_shared<Parameter>(pid(0, 3+i, 3+j), U0, 0., 0.));
240 dep_block->store_or_assign(
LhaID(1, 3+i, 3+j), std::make_shared<Parameter>(pid(1, 3+i, 3+j), U1, 0., 0.));
241 dep_block->store_or_assign(
LhaID(0, 6+i, 6+j), std::make_shared<Parameter>(pid(0, 6+i, 6+j), U0, 0., 0.));
242 dep_block->store_or_assign(
LhaID(1, 6+i, 6+j), std::make_shared<Parameter>(pid(1, 6+i, 6+j), U1, 0., 0.));
247 auto U_4_func = [] (
const BlockSrc& src, std::shared_ptr<DependentBlock> dep_block) {
248 double eta_5 = src.
get_val(
"WPARAM_RUN_SM", 2);
249 double eta_4 = src.
get_val(
"WPARAM_RUN_SM", 3);
250 auto pid = [] (
int n,
int k,
int l) {
258 double eta_5_V = src.
get_val(
"ETA_POWS_MIXING",
LhaID(1, 0));
259 double eta_4_V = src.
get_val(
"ETA_POWS_MIXING",
LhaID(2, 0));
262 dep_block->store_or_assign(
LhaID(0, 0, 0), std::make_shared<Parameter>(pid(0, 0, 0), U0, 0., 0.));
263 dep_block->store_or_assign(
LhaID(0, 5, 5), std::make_shared<Parameter>(pid(0, 5, 5), U0, 0., 0.));
264 dep_block->store_or_assign(
LhaID(1, 0, 0), std::make_shared<Parameter>(pid(1, 0, 0), U1, 0., 0.));
265 dep_block->store_or_assign(
LhaID(1, 5, 5), std::make_shared<Parameter>(pid(1, 5, 5), U1, 0., 0.));
267 std::array<double, 2> eta_5_LR {
272 std::array<double, 2> eta_4_LR {
277 for (
int i = 0; i < 2; ++i) {
278 for (
int j = 0; j < 2; ++j) {
280 for (
int k = 0; k < 2; ++k)
for (
int l = 0; l < 2; ++l) {
284 dep_block->store_or_assign(
LhaID(0, 1+i, 1+j), std::make_shared<Parameter>(pid(0, 1+i, 1+j), U0, 0., 0.));
285 dep_block->store_or_assign(
LhaID(1, 1+i, 1+j), std::make_shared<Parameter>(pid(1, 1+i, 1+j), U1, 0., 0.));
289 std::array<double, 2> eta_5_S {
294 std::array<double, 2> eta_4_S {
299 for (
int i = 0; i < 2; ++i) {
300 for (
int j = 0; j < 2; ++j) {
302 for (
int k = 0; k < 2; ++k)
for (
int l = 0; l < 2; ++l) {
303 U0 +=
MMRP::a0_S_4[i][j][k][l] * eta_4_S[k] * eta_5_S[l];
306 dep_block->store_or_assign(
LhaID(0, 3+i, 3+j), std::make_shared<Parameter>(pid(0, 3+i, 3+j), U0, 0., 0.));
307 dep_block->store_or_assign(
LhaID(1, 3+i, 3+j), std::make_shared<Parameter>(pid(1, 3+i, 3+j), U1, 0., 0.));
308 dep_block->store_or_assign(
LhaID(0, 6+i, 6+j), std::make_shared<Parameter>(pid(0, 6+i, 6+j), U0, 0., 0.));
309 dep_block->store_or_assign(
LhaID(1, 6+i, 6+j), std::make_shared<Parameter>(pid(1, 6+i, 6+j), U1, 0., 0.));
314 iblock_c->compose_block(
"ETA_POWS_MIXING", eta_powers_src, eta_powers_func);
315 iblock_c->compose_block(
"UM_MATRIX_5", mtx_src, U_5_func);
316 iblock_c->compose_block(
"UM_MATRIX_4", mtx_src, U_4_func);
319void WilsonParameterHelper::init_running_block(
WGroupId grp) {
320 if (!running_block_initialized) {
321 LOG_DEBUG(
"Init running scale dependent wparam block");
322 std::unordered_map<ParameterType, std::vector<std::string>> src = {
327 auto func = [] (
const BlockSrc& src, std::shared_ptr<DependentBlock> dep_block) {
333 double eta_5 = alphas_mu_W / alphas_mu_b;
334 double eta_4 = alphas_mu_b / alphas_mu_c;
335 double eta_3 = alphas_mu_c / alphas_mu_s;
343 iblock_c->compose_block(
"WPARAM_RUN_SM", src, func);
344 running_block_initialized =
true;
350 if (!b_running_matrices_initialized) {
351 init_running_parameter_blocks_B();
352 b_running_matrices_initialized =
true;
357 LOG_TRACE(
"No additional Wilson running-matrix blocks needed for requested group");
363 running_block_initialized =
false;
364 b_running_matrices_initialized =
false;
365 initialized_running_groups.clear();
#define LOG_TRACE(...)
Macro for logging trace messages.
#define LOG_DEBUG(...)
Macro for logging debug messages.
#define LOG_VERBOSE(...)
Macro for logging verbose messages.
BWilsonRunningParameters BRP
Lightweight view over a set of source blocks.
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.
static IdOf< WGroupTag > to_id(WGroup e)
Converts an enum value to an IdOf<Tag>.
bool initialized
Tracks whether the helper has already been initialized.
std::shared_ptr< IBlockComposer > iblock_c
Block composer (dependency engine) used to register dependent blocks.
static double alpha_s(double mu, MassType mass_b_type=MassType::POLE, MassType mass_t_type=MassType::POLE)
Computes the strong coupling constant α_s at scale μ.
static double msbar_mass(int pdg_code, double mu, MassType mass_b_type=MassType::POLE, MassType mass_t_type=MassType::POLE)
Computes the MS-bar running mass of a quark at scale μ.
Returns an uppercase copy of the input string.
static constexpr int lepton_mass_slot_from_index(int lepton_index)
void cleanup() override
Resets the helper internal state.
void init(int gen, WGroupId grp) override
Initializes all required SM Wilson helper blocks.
static void compose_meson_mixing_running_blocks(const std::shared_ptr< IBlockComposer > &iblock_c)
Composes the meson-mixing evolution matrices.
scalar_t pow(const scalar_t &base, const scalar_t &exp)
static const std::array< std::array< std::array< double, array_size >, array_size >, array_size > m21
static const std::array< std::array< std::array< double, array_size >, array_size >, array_size > l11
static const std::array< std::array< std::array< double, array_size >, array_size >, array_size > l10
static const std::array< std::array< std::array< double, array_size >, array_size >, array_size > m22
static const std::array< std::array< std::array< double, array_size >, array_size >, array_size > m10
static const std::array< std::array< std::array< double, array_size >, array_size >, array_size > m20
static const std::array< std::array< std::array< double, array_size >, array_size >, array_size > m11
static const std::array< std::array< std::array< double, array_size >, array_size >, array_size > m00
static constexpr std::array< double, array_size > ai
static constexpr std::array< double, array_size > ai2
static const std::array< std::array< std::array< double, array_size >, array_size >, array_size > l00
static constexpr int array_size
Represents an identifier of a LHA element, possibly containing several sub-ids.
static constexpr std::array< double, n_pows > bi
Exponents for nf=4 evolution (eta_4^bi).
static const std::array< std::array< std::array< std::array< double, 2 >, 2 >, 2 >, 2 > c_S_4
static const std::array< std::array< std::array< double, 2 >, 2 >, 2 > a1_LR_5
static const std::array< std::array< std::array< std::array< double, 2 >, 2 >, 2 >, 2 > a1_LR_4
static constexpr double b_V_5
static const std::array< std::array< std::array< std::array< double, 2 >, 2 >, 2 >, 2 > a0_S_4
static const std::array< std::array< std::array< double, 2 >, 2 >, 2 > a0_S_5
static constexpr double a0_V_4
static const std::array< std::array< std::array< std::array< double, 2 >, 2 >, 2 >, 2 > a0_LR_4
static const std::array< std::array< std::array< double, 2 >, 2 >, 2 > a1_S_5
static constexpr std::array< double, n_pows > ai
Exponents for nf=5 evolution (eta_5^ai).
static constexpr double a0_V_5
static const std::array< std::array< std::array< double, 2 >, 2 >, 2 > a0_LR_5
static const std::array< std::array< std::array< std::array< double, 2 >, 2 >, 2 >, 2 > a1_S_4
static constexpr double b_V_4
static const std::array< std::array< std::array< std::array< double, 2 >, 2 >, 2 >, 2 > b_LR_4
static constexpr double a1_V_4
static const std::array< std::array< std::array< std::array< double, 2 >, 2 >, 2 >, 2 > c_LR_4
static const std::array< std::array< std::array< double, 2 >, 2 >, 2 > b_LR_5
static const std::array< std::array< std::array< double, 2 >, 2 >, 2 > b_S_5
static constexpr double c_V_4
static constexpr double a1_V_5
static const std::array< std::array< std::array< std::array< double, 2 >, 2 >, 2 >, 2 > b_S_4
static constexpr int n_pows
Number of exponent entries stored in ai / bi (for eta power vectors).
Composite identifier for a single parameter.