19 auto parts = name.get_parts();
22 LhaID full(parts[0], parts[1], order_int, ct_int);
38 std::unordered_set<ParamId> extra_sources,
41 LOG_ERROR(
"ValueError",
"Cannot add an empty Wilson matching patch to", this->
get_name());
45 auto base_compute = info.compute;
47 info.sources.insert(extra_sources.begin(), extra_sources.end());
48 info.compute = [base_compute, patch = std::move(patch)](
const ParamSrc& src) ->
scalar_t {
51 base = base_compute(src);
53 return base + patch(src);
65 return LhaID(base_id.first, base_id.second, ord, cont);
72 name = name.substr(0, name.size() - 5);
74 name = name.substr(0, name.size() - 5);
#define LOG_ERROR(type,...)
Macro for logging error messages and terminating the application.
std::string to_string(const LhaID &id)
Convenience stringification for LhaID.
bool ends_with(const std::string &str, const std::string &suffix)
Tests whether a string ends with a given suffix.
std::complex< double > complex_t
Convenience alias for std::complex<double>.
Domain objects representing Wilson coefficients and their matching metadata.
static IdOf< WCoefTag > enum_elt(std::string_view s)
Alias for id_of(), kept for compatibility.
static IdOf< WCoefTag > id_of(std::string_view s)
Resolves a string into an IdOf<Tag> via the registry.
Abstract interface for reading parameters and basic metadata.
static QCDOrder enum_elt(std::string_view s)
Legacy lookup: converts a string into a QCDOrder enum. Performs a case-insensitive search over the bu...
Lightweight view over a set of source parameters keyed by ParamId.
static std::pair< int, int > flha_base(WCoef e)
Returns the base FLHA pair (a,b) for a given WCoef.
static LhaID flha_full(WCoef e, QCDOrder q, ContributionType c)
Abstract base class representing a Wilson coefficient and its matching information.
std::string get_name() const
Returns the current full name (may include suffixes).
std::string get_base_name() const
Returns the base name of the coefficient without BSM suffixes.
std::unordered_set< ParamId > get_sources(QCDOrder order)
Returns the source ParamIds required at a given QCD order.
void add_matching_patch(QCDOrder order, std::unordered_set< ParamId > extra_sources, std::function< scalar_t(const ParamSrc &)> patch)
Add an extra additive term to the matching function of one QCD order.
void set_contribution_type(ContributionType type)
Sets the contribution type (SM/BSM/…).
bool is_owned
Ownership flag (used by higher-level logic to track "produced" coefficients).
LhaID get_lhaid_from_name(QCDOrder order)
Computes the LhaID directly from the coefficient base name and mapping conventions.
std::function< scalar_t(const ParamSrc &)> get_func(QCDOrder order)
Returns the compute function for a given QCD order.
void set_storage_block(std::string block_name)
Sets the storage block where the coefficient value is stored.
LhaID id(QCDOrder order, ContributionType typ) const
Returns the LHA id for a given order and contribution type.
WilsonCoefficient()=default
bool operator==(const WilsonCoefficient &other) const
Equality compares name, contribution type, and ownership flag.
std::string coeffName
Domain name of the coefficient (may include suffixes like _THDM/_SUSY).
complex_t get_matching_value(std::string order, ContributionType cont_type, std::shared_ptr< IParameterProxy< std::string, LhaID > > wilson_p) const
Reads the coefficient value from the storage backend for a given order/type.
std::map< QCDOrder, MatchingInfo > matching_info
Matching metadata indexed by QCD order.
void set_owned(bool owned)
Sets the ownership flag.
ContributionType type
Contribution type for this coefficient (SM by default, inferred in constructors).
std::string storage_block
Block name where this coefficient is stored in the Parameters system.
LhaID get_lhaid(QCDOrder order)
Returns the storage LhaID associated with a given QCD order.
Represents an identifier of a LHA element, possibly containing several sub-ids.
Matching metadata for a Wilson coefficient at a specific QCD order.