1#ifndef CUSTOM_WILSON_LAMBDA_H
2#define CUSTOM_WILSON_LAMBDA_H
7#include <unordered_map>
8#include <unordered_set>
71 std::unordered_set<ParamId> sources,
122 std::unordered_map<WilsonBasis, std::map<QCDOrder, CoefficientGroupSources>>
running;
148 std::unordered_map<
ParameterType, std::vector<std::string>> sources,
149 std::function<std::unordered_map<WCoefId, scalar_t>(
150 const std::unordered_map<
QCDOrder, std::unordered_map<WCoefId, scalar_t>>&,
155 s.sources = std::move(sources);
156 s.func = std::move(compute);
169 const std::unordered_map<
QCDOrder, std::unordered_map<WCoefId, scalar_t>>& matching,
172 if (
auto it = matching.find(
QCDOrder::NNLO); it != matching.end())
return it->second;
173 if (
auto it = matching.find(
QCDOrder::NLO); it != matching.end())
return it->second;
174 if (
auto it = matching.find(
QCDOrder::LO); it != matching.end())
return it->second;
190 auto group = std::make_shared<CustomCoefficientGroup>(adapters, cfg.
group, name, cfg.
contribution);
195 auto coef = std::make_shared<CustomWilson>(
202 auto it = coef_cfg.matching.find(order);
203 if (it != coef_cfg.matching.end()) {
204 coef->set_order_info(order, it->second.sources, it->second.compute, it->second.lhaid);
206 coef->set_order_info(
209 [](
const ParamSrc&) {
return 0.0; },
215 group->add_coefficient(coef_cfg.id, coef);
219 for (
const auto& [basis, per_order] : cfg.
running) {
220 group->add_sources(basis, per_order);
223 std::map<QCDOrder, CoefficientGroupSources> per_order;
228 per_order[order] = std::move(s);
User-assembled CoefficientGroup with explicit coefficients and running rules.
std::shared_ptr< CustomCoefficientGroup > make_custom_wilson_group(const CustomWilsonGroupConfig &cfg, WilsonGroupAdapterConfig adapters)
Build a CustomCoefficientGroup from a lambda config.
std::unordered_map< WCoefId, scalar_t > custom_identity_running(const std::unordered_map< QCDOrder, std::unordered_map< WCoefId, scalar_t > > &matching, const BlockSrc &)
Identity running rule used as a safe default for custom groups.
User-definable WilsonCoefficient with explicit per-order matching definitions.
Centralizes canonical SLHA/LHA block naming conventions for Wilson blocks.
Lightweight view over a set of source blocks.
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.
Lightweight view over a set of source parameters keyed by ParamId.
static LhaID flha_full(WCoef e, QCDOrder q, ContributionType c)
Hash specialization for SymbolId<Tag>.
Source specification and aggregation function for a coefficient group block.
Configuration of one user-defined Wilson coefficient.
std::map< QCDOrder, MatchingInfo > matching
Per-order matching rules.
WCoefId id
Dynamic coefficient id. It must be known by WCoefMapper and have an FLHA base key.
CustomWilsonCoefficientConfig & set_matching(QCDOrder order, std::unordered_set< ParamId > sources, std::function< scalar_t(const ParamSrc &)> compute, ContributionType contribution=ContributionType::SM)
Attach a matching lambda to a QCD order.
CustomWilsonCoefficientConfig()=default
CustomWilsonCoefficientConfig(WCoefId id)
Configuration of a user-defined Wilson group built from lambdas.
bool install_identity_running_if_empty
If true, install identity running for B_STANDARD when no running rules were provided.
CustomWilsonGroupConfig(WGroupId group)
std::string display_name
Optional display name used by CustomCoefficientGroup; the mapper name remains authoritative.
double hadronic_scale
Hadronic/running scale used when the group is added to the manager.
CustomWilsonGroupConfig()=default
ContributionType contribution
Contribution slot computed by the custom matching lambdas.
WGroupId group
Dynamic group id. Register it with GroupMapper before use if it is custom.
QCDOrder order
Highest QCD order to initialize.
double matching_scale
Matching scale used when the group is added to the manager.
std::vector< CustomWilsonCoefficientConfig > coefficients
Coefficients belonging to the group.
std::unordered_map< WilsonBasis, std::map< QCDOrder, CoefficientGroupSources > > running
Running rules keyed by basis and QCD order.
CustomWilsonGroupConfig & add_coefficient(CustomWilsonCoefficientConfig coef)
Add a coefficient config to the group.
CustomWilsonGroupConfig & set_running(WilsonBasis basis, QCDOrder order, std::unordered_map< ParameterType, std::vector< std::string > > sources, std::function< std::unordered_map< WCoefId, scalar_t >(const std::unordered_map< QCDOrder, std::unordered_map< WCoefId, scalar_t > > &, const BlockSrc &)> compute)
Attach a running lambda for a basis/order pair.
Matching metadata for a Wilson coefficient at a specific QCD order.
static std::string matching(WGroupId gid)
Returns the canonical matching block name for a Wilson group.
Dependency injection bundle for CoefficientGroup.