13 std::cout <<
"== Dynamic registry demo ==\n";
29 assert(ext.has_value());
32 std::cout <<
"[WCOEF] FLHA roundtrip ok\n";
43 assert(ext && ext->first == 999 && ext->second == 888);
44 std::cout <<
"[WCOEF] custom CNEW registered with FLHA (999,888)\n";
57 assert(lha.has_value());
72 LhaID custom_key(777, 1, 2, 13, -13);
89 assert(k && k->to_string() == custom_key.
to_string());
96 for (
const auto& x : os) {
97 if (x.str() ==
"MY_OBS") { found =
true;
break; }
100 std::cout <<
"[OBS] custom MY_OBS linked to decay B__l_l\n";
122 std::cout <<
"[GROUP] MATCHING=" << m <<
" HADRONIC(TRAD)=" << h <<
"\n";
133 std::cout <<
"[ORDER] string->id->enum OK (NLO)\n";
141 std::cout <<
"[HUB] canonical(WCoef, \"c7\") = "
147 std::cout <<
"[HUB] registered custom WCoef CNEW2 via hub helper\n";
151 std::cout <<
"[HUB] first observable = " << (obs_list.empty() ?
"<empty>" : obs_list.front()) <<
"\n";
154 std::cout <<
"✅ Demo OK\n";
Lightweight representation of LHAPDF / SLHA-style identifiers.
static DecayGraph & instance()
Return the unique global graph instance.
std::vector< ObservableId > observables_of(const DecayId &decay) const
Return all dynamically linked observables for a decay.
static IdOf< QCDOrderTag > id_of(std::string_view s)
Resolves a string into an IdOf<Tag> via the registry.
static std::optional< QCDOrder > enum_of(const IdOf< QCDOrderTag > &id)
Attempts to recover the enum value associated with an identifier.
static bool register_custom(std::string canonical, std::vector< std::string > aliases={}, std::optional< std::pair< int, int > > ext=std::nullopt)
Registers a custom entry with optional external key.
static std::optional< std::pair< int, int > > external_of(const IdOf< WCoefTag > &id)
Returns the external key associated with a given identifier.
static std::optional< IdOf< WCoefTag > > from_external(const std::pair< int, int > &k)
Resolves an external key into an identifier.
static IdOf< ObservableTag > to_id(Observables e)
Converts an enum value to an IdOf<Tag>.
static IdOf< WCoefTag > id_of(std::string_view s)
Resolves a string into an IdOf<Tag> via the registry.
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.
static std::optional< ObservableId > from_flha(const LhaID &ext)
Resolve a FLHA id to a dynamic observable id.
static std::optional< LhaID > flha_of(const ObservableId &id)
Return the FLHA id attached to an observable id, if any.
static Observables enum_elt(const LhaID &ext)
Legacy builtin-only lookup from FLHA id to enum.
static bool register_custom(const std::string &canonical, std::vector< std::string > aliases, std::optional< LhaID > ext, const DecayId &parent_decay)
Register a custom observable and attach it to a parent decay.
Runtime graph linking decay identifiers to observable identifiers.
Non-templated façade over the project mapper families.
std::vector< std::string > list_all(MapperKind k)
List all canonical names known to a mapper kind.
bool register_custom_wcoef(std::string canonical, std::vector< std::string > aliases, std::pair< int, int > flha)
Specialized registration helper for Wilson coefficients.
std::string canonical_of(MapperKind k, std::string_view s)
Resolve a name to its canonical representation for a mapper kind.
void init_all_builtins()
Initializes all builtin mapper registries and the decay graph.
Represents an identifier of a LHA element, possibly containing several sub-ids.
std::string to_string() const
Returns the canonical string representation of this LhaID.