14 ports(ports), use_marty(ports.iobs_use_marty), p(ports.iobspp_sm), iobs_qcdp(ports.iobs_qcdp), iobs_wfreezer(ports.iobs_wfreezer), w_helper(ports.iobs_whelper) {
32 w_helper = std::make_shared<ObsWilsonHelper>();
47 LOG_WARN(
"Using MARTY defaults all calculations to LO in QCD.");
58 "Changing QCD order for enabled decay",
64 ": cached parameters are invalidated."
74 "Thread configuration is not implemented for decay",
91 for (
auto& [qmin, qmax] : new_bins)
93 LOG_WARN(
"Found inverted bin [", qmin,
",", qmax,
"].");
95 this->
bins = new_bins;
99 if (new_bin.first > new_bin.second)
100 LOG_WARN(
"Found inverted bin [", new_bin.first,
",", new_bin.second,
"].");
102 if (!this->
bins.has_value()) {
103 this->
bins = std::vector<std::pair<double, double>>{};
106 auto& current_bins = this->
bins.value();
107 if (std::find(current_bins.begin(), current_bins.end(), new_bin) == current_bins.end()) {
108 current_bins.emplace_back(new_bin);
Base class for observable/decay computation modules.
#define LOG_WARN(...)
Macro for logging warning messages.
DecayId id
Unique decay identifier.
bool enabled
Whether the decay is enabled (i.e. Wilson groups built and parameters loaded).
virtual void load_params()=0
Load and cache parameters needed by this decay.
WilsonBuildConfig w_config
Wilson build configuration used when enabling this decay (scales, order, groups).
std::shared_ptr< IWilsonFreezer< WGroupId > > iobs_wfreezer
Freezer to freeze/unfreeze Wilson blocks when they are not needed by active decays.
ObservablePortsConfig & ports
Reference to the ports/configuration wiring this decay to the framework.
virtual void set_n_threads(size_t n_threads)
Set the number of worker threads used by decays that support parallel cache filling.
std::optional< std::vector< std::pair< double, double > > > bins
Optional q^2 bins.
std::shared_ptr< IObsCoreAPI< bool > > use_marty
Port exposing whether the MARTY backend is active.
void add_bin(std::pair< double, double > new_bin)
Adds a bin to the observables related to this decay.
void enable()
Enable the decay module (build Wilson groups and load parameters).
QCDOrder max_order
Maximum QCD order supported by this decay module (default: LO).
void set_bins(std::vector< std::pair< double, double > > new_bins)
Set the binning for the observables related to this decay.
virtual size_t get_n_threads() const
Return the currently configured worker-thread count.
void disable()
Disable the decay module.
void bind_wilson_builder(std::shared_ptr< IObsWilsonBuilder > &wilson_builder)
Bind a Wilson builder to this decay.
void set_order(QCDOrder new_order)
Set the QCD order for this decay (one-shot policy).
DecayParent(DecayId custom_id, double matching_scale, double hadronic_scale, QCDOrder order, ObservablePortsConfig &ports)
Construct a decay module and bind it to the observable ports.
virtual bool supports_thread_config() const
Whether this decay supports runtime thread configuration.
std::shared_ptr< IObsWilsonProxy > w_proxy
Wilson proxy used at compute-time to query coefficients (matching/run).
std::shared_ptr< ObsWilsonHelper > w_helper
Per-manager Wilson lifecycle helper.
std::optional< std::vector< std::pair< double, double > > > get_bins()
Returns the current binning of the decay.
QCDOrder check_max_order(QCDOrder order) const
Clamp a requested QCD order to this decay's supported maximum.
std::shared_ptr< IObsWilsonBuilder > w_builder
Wilson builder used to build/add Wilson groups for this decay.
static std::string str(const IdOf< QCDOrderTag > &id)
Returns the string representation associated with an identifier.
static std::string str(const IdOf< DecayTag > &id)
Returns the string representation of an identifier.
Dependency container (“ports”) for observable computations.
std::shared_ptr< IObsWilsonBuilder > iobswb
Builder used to (re)build Wilson coefficient groups on demand.
double hadronic_scale
Hadronic scale (in GeV) at which the Wilson coefficients are evaluated in the effective theory.
QCDOrder order
Perturbative QCD order used for the evolution and matching of Wilson coefficients....
double matching_scale
Matching scale (in GeV) at which the high-energy theory is matched to the effective theory.