|
Hyperiso 1.0.3
Modular flavour-physics calculations, Wilson coefficients and statistical inference
|
Mapper for decay names, dynamic ids and observable membership. More...
#include <decay_ids.hpp>


Public Types | |
| using | Base = GenericMapperWithExt< DecayTag, Decays, LhaID, std::hash< LhaID >, decays_mapping, decay_external_mapping > |
Static Public Member Functions | |
| static bool | register_custom (std::string canonical, std::vector< std::string > aliases={}, std::optional< LhaID > ext=std::nullopt)=delete |
| Disabled low-level decay registration. | |
| static std::vector< Observables > | get_observables (Decays d) |
| Legacy static lookup of builtin observables for a builtin decay. | |
| static std::vector< ObservableId > | get_observable_ids (Decays d) |
| Convert builtin observables of a builtin decay to dynamic ids. | |
| static std::vector< ObservableId > | get_observables (const DecayId &d) |
| Dynamic lookup of observables attached to a decay id. | |
| static std::vector< ObservableId > | get_observables (std::string_view d) |
| Dynamic lookup of observables attached to a decay resolved by name. | |
| static bool | has_observables (const DecayId &d) |
| Test whether a decay has at least one observable. | |
| static void | require_observables (const DecayId &d) |
| Throw if a decay has no observable. | |
| static bool | register_custom_with_observables (std::string canonical, std::vector< std::string > aliases, std::vector< CustomObservableSpec > observables) |
| Register a custom decay and its custom observables in one call. | |
| static Decays | get_decay (Observables obs) |
| Legacy static lookup of the builtin decay owning a builtin observable. | |
| static const std::unordered_map< ObservableId, DecayId > & | observable_to_decay () |
| Static cache mapping builtin observable ids to builtin decay ids. | |
| static std::optional< DecayId > | get_decay_id (const ObservableId &obs) |
| Return the parent decay id of an observable id. | |
| static std::optional< DecayId > | get_decay_id (Observables obs) |
| Return the parent decay id of a builtin observable enum. | |
| static DecayId | get_decay_id_or_throw (const ObservableId &obs) |
Throwing variant of get_decay_id(). | |
Static Public Member Functions inherited from GenericMapperWithExt< DecayTag, Decays, LhaID, std::hash< LhaID >, decays_mapping, decay_external_mapping > | |
| static void | init_builtins () |
| Explicitly initializes builtin entries. | |
| static std::vector< std::string > | get_str () |
| Returns the list of builtin string names from MapFn(). | |
| static std::vector< Decays > | get_enum () |
| Returns the list of builtin enum values. | |
| static std::vector< std::string > | get_str_all () |
| Returns all known names (builtin + custom). | |
| static Decays | enum_elt_legacy (std::string_view s) |
| Legacy enum lookup using only the static MapFn() table. | |
| static IdOf< DecayTag > | id_of (std::string_view s) |
| Resolves a string into an IdOf<Tag> via the registry. | |
| static IdOf< DecayTag > | enum_elt (std::string_view s) |
| Alias for id_of(), kept for compatibility. | |
| static std::optional< IdOf< DecayTag > > | from_external (const LhaID &k) |
| Resolves an external key into an identifier. | |
| static std::optional< LhaID > | external_of (const IdOf< DecayTag > &id) |
| Returns the external key associated with a given identifier. | |
| static bool | register_custom (std::string canonical, std::vector< std::string > aliases={}, std::optional< LhaID > ext=std::nullopt) |
| Registers a custom entry with optional external key. | |
| static bool | set_external (const IdOf< DecayTag > &id, const LhaID &k) |
| Sets or updates the external key of an existing identifier. | |
| static std::vector< IdOf< DecayTag > > | list_all () |
| Lists all distinct identifiers currently registered. | |
| static std::string | str (const IdOf< DecayTag > &id) |
| Returns the string representation of an identifier. | |
| static std::string | str (Decays e) |
| Returns the builtin string name of an enum value. | |
| static IdOf< DecayTag > | to_id (Decays e) |
| Converts an enum value to an IdOf<Tag>. | |
| static std::optional< Decays > | enum_of (const IdOf< DecayTag > &id) |
| Attempts to recover the enum value associated with an identifier. | |
Mapper for decay names, dynamic ids and observable membership.
DecayMapper resolves names to DecayId through the dynamic registry and provides both legacy static accessors and dynamic DecayId-based accessors.
@important For dynamic/user-facing code, prefer DecayId and ObservableId. Use Decays/Observables only when a builtin enum value is explicitly required.
Definition at line 79 of file decay_ids.hpp.
| using DecayMapper::Base = GenericMapperWithExt< DecayTag, Decays, LhaID, std::hash<LhaID>, decays_mapping, decay_external_mapping > |
Definition at line 90 of file decay_ids.hpp.
|
inlinestatic |
Legacy static lookup of the builtin decay owning a builtin observable.
| obs | Builtin observable enum. |
| std::runtime_error | if obs is not mapped statically. |
Definition at line 293 of file decay_ids.hpp.
|
inlinestatic |
Return the parent decay id of an observable id.
Resolution order:
DecayGraph) for custom links,| obs | Observable identifier. |
Definition at line 333 of file decay_ids.hpp.
|
inlinestatic |
Return the parent decay id of a builtin observable enum.
Definition at line 349 of file decay_ids.hpp.
|
inlinestatic |
Throwing variant of get_decay_id().
| obs | Observable identifier. |
| std::runtime_error | if obs has no parent decay. |
Definition at line 361 of file decay_ids.hpp.
|
inlinestatic |
Convert builtin observables of a builtin decay to dynamic ids.
| d | Builtin decay enum value. |
Definition at line 139 of file decay_ids.hpp.
|
inlinestatic |
Dynamic lookup of observables attached to a decay id.
This merges:
DecayGraph,d corresponds to a builtin Decays enum.Duplicates are removed while preserving insertion order.
| d | Dynamic decay identifier. |
d.| std::runtime_error | if d has no observable. |
Definition at line 165 of file decay_ids.hpp.
|
inlinestatic |
Legacy static lookup of builtin observables for a builtin decay.
| d | Builtin decay enum value. |
d.| std::out_of_range | if d is not present in the static map. |
Definition at line 129 of file decay_ids.hpp.
|
inlinestatic |
Dynamic lookup of observables attached to a decay resolved by name.
| d | Decay name or alias. |
Definition at line 198 of file decay_ids.hpp.
|
inlinestatic |
Test whether a decay has at least one observable.
This checks both the runtime graph and the builtin static mapping.
| d | Dynamic decay identifier. |
d has at least one observable. Definition at line 210 of file decay_ids.hpp.
|
inlinestatic |
Static cache mapping builtin observable ids to builtin decay ids.
decay_observable_mapping(). Definition at line 307 of file decay_ids.hpp.
|
staticdelete |
Disabled low-level decay registration.
A decay without observables violates the public invariant of the dynamic mapper layer. Use register_custom_with_observables() to create a custom decay together with at least one custom observable.
|
inlinestatic |
Register a custom decay and its custom observables in one call.
This helper enforces the invariant that a custom decay must have at least one observable. It first registers the decay, then registers every custom observable under that decay through ObservableMapper::register_custom().
| canonical | Canonical decay name. |
| aliases | Optional decay aliases. |
| observables | Custom observable definitions to attach. |
| std::invalid_argument | if observables is empty. |
| std::runtime_error | if one observable cannot be linked. |
Definition at line 256 of file decay_ids.hpp.
|
inlinestatic |
Throw if a decay has no observable.
| d | Dynamic decay identifier. |
| std::runtime_error | if d has no observable. |
Definition at line 230 of file decay_ids.hpp.