Hyperiso 1.0.3
Modular flavour-physics calculations, Wilson coefficients and statistical inference
Loading...
Searching...
No Matches
WilsonProvider.cpp
Go to the documentation of this file.
1#include "WilsonProvider.h"
2#include "WilsonBuilder.h"
3
4WilsonProvider::WilsonProvider(std::shared_ptr<WilsonBuilder> builder) : builder(builder), cm(builder->get_coefficient_manager()) {
5 if (!cm) {
6 LOG_ERROR("NullPointerError", "(WilsonProvider) CoefficientManager is null.");
7 }
8
9 if (cm->getGroups().empty()) {
10 LOG_DEBUG("(WilsonProvider) CoefficientManager does not contain any coefficient groups.");
11 }
12}
13
14scalar_t WilsonProvider::get(std::shared_ptr<AbstractConfig> config) {
15 WilsonRequest request = *static_cast<WilsonRequest*>(config.get());
16
17
18 ScaleType scale_type = request.scale_type;
19
20 if (scale_type == ScaleType::MATCHING) {
21 return request.sum_qcd_orders ?
22 cm->getFullMatchingCoefficient(
23 GroupMapper::str(request.group),
25 OrderMapper::str(request.order),
26 request.contribution) :
27 cm->getMatchingCoefficient(
28 GroupMapper::str(request.group),
30 OrderMapper::str(request.order),
31 request.contribution);
32 } else if (scale_type == ScaleType::HADRONIC) {
33 return request.sum_qcd_orders ?
34 cm->getFullRunCoefficient(
35 GroupMapper::str(request.group),
37 OrderMapper::str(request.order),
38 request.contribution,
39 request.basis.value_or(WilsonBasis::B_STANDARD)) :
40 cm->getRunCoefficient(
41 GroupMapper::str(request.group),
43 OrderMapper::str(request.order),
44 request.contribution,
45 request.basis.value_or(WilsonBasis::B_STANDARD));
46 } else {
47 LOG_ERROR("Invalid argument", "(WilsonProvider) Invalid scale type.");
48 }
49}
50
51std::shared_ptr<WilsonBuilder> WilsonProvider::get_builder() {
52 return builder;
53}
54
55std::unordered_set<WilsonBasis> WilsonProvider::get_bases(WGroupId group) {
56 return this->cm->getGroupBases(group);
57}
ScaleType
#define LOG_ERROR(type,...)
Macro for logging error messages and terminating the application.
Definition Logger.h:41
#define LOG_DEBUG(...)
Macro for logging debug messages.
Definition Logger.h:45
static std::string str(const IdOf< QCDOrderTag > &id)
Returns the string representation associated with an identifier.
static std::string str(const IdOf< WCoefTag > &id)
Returns the string representation of an identifier.
static std::string str(const WGroupId &gid, ScaleType s, WilsonBasis b=WilsonBasis::B_STANDARD)
Builds a composite block name using a WGroupId, scale and basis.
Returns an uppercase copy of the input string.
std::unordered_set< WilsonBasis > get_bases(WGroupId group) override
Returns the set of bases supported by a Wilson group.
std::shared_ptr< WilsonBuilder > get_builder() override
Returns the underlying builder.
scalar_t get(std::shared_ptr< AbstractConfig > config) override
Returns the requested Wilson coefficient as scalar_t (complex).
WilsonProvider(std::shared_ptr< WilsonBuilder > builder)
Constructs a provider from an existing builder.
Dynamic configuration for requesting a specific Wilson coefficient.
Definition Configs.h:122
WGroupId group
Wilson operator group identifier associated with the request.
Definition Configs.h:129
ContributionType contribution
Type of contribution requested, e.g. SM, BSM or TOTAL.
Definition Configs.h:147
std::optional< WilsonBasis > basis
Optional Wilson basis used for hadronic-scale coefficients.
Definition Configs.h:162
QCDOrder order
Perturbative QCD order at which the coefficient is evaluated.
Definition Configs.h:142
bool sum_qcd_orders
If true, contributions from different QCD orders are summed up to order.
Definition Configs.h:157
WCoefId coefficient
Wilson coefficient identifier associated with the request.
Definition Configs.h:137
ScaleType scale_type
Scale at which the Wilson coefficient is evaluated.
Definition Configs.h:152