|
Hyperiso 1.0.3
Modular flavour-physics calculations, Wilson coefficients and statistical inference
|
High-level mapper for observable names, FLHA ids and parent decays. More...
#include <observable_ids.hpp>


Public Types | |
| using | Base = GenericMapperWithExt< ObservableTag, Observables, LhaID, std::hash< LhaID >, observable_mapping, observable_flha_mapping > |
Static Public Member Functions | |
| static Observables | enum_elt_legacy (std::string_view s) |
| Legacy builtin-only lookup from string to enum. | |
| static Observables | enum_elt (const LhaID &ext) |
| Legacy builtin-only lookup from FLHA id to enum. | |
| 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 std::optional< BinnedObservableId > | from_binned_flha (const LhaID &ext) |
| Decode a binned FLHA id into a binned observable id. | |
| static std::optional< LhaID > | binned_flha_of (const BinnedObservableId &id) |
| Encode a binned observable id into its FLHA representation. | |
| static BinnedObservableId | binned_from_flha (const LhaID &ext) |
Throwing variant of from_binned_flha(). | |
| static LhaID | flha (const Observables &id) |
| Return the FLHA id associated with a builtin enum value. | |
| 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. | |
| static bool | register_custom (const std::string &canonical, std::vector< std::string > aliases, std::optional< LhaID > ext, Decays parent_decay_enum) |
| Register a custom observable under a builtin parent decay. | |
| static bool | register_custom (const std::string &canonical, std::vector< std::string > aliases, std::optional< LhaID > ext, std::string_view parent_decay_str) |
| Register a custom observable under a parent decay resolved by name. | |
| static LhaID | flha (const ObservableId &id) |
| Return the FLHA id associated with an observable id. | |
| static LhaID | flha (const BinnedObservableId &id) |
| Return the binned FLHA id associated with a binned observable id. | |
Static Public Member Functions inherited from GenericMapperWithExt< ObservableTag, Observables, LhaID, std::hash< LhaID >, observable_mapping, observable_flha_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< Observables > | get_enum () |
| Returns the list of builtin enum values. | |
| static std::vector< std::string > | get_str_all () |
| Returns all known names (builtin + custom). | |
| static Observables | enum_elt_legacy (std::string_view s) |
| Legacy enum lookup using only the static MapFn() table. | |
| static IdOf< ObservableTag > | id_of (std::string_view s) |
| Resolves a string into an IdOf<Tag> via the registry. | |
| static IdOf< ObservableTag > | enum_elt (std::string_view s) |
| Alias for id_of(), kept for compatibility. | |
| static std::optional< IdOf< ObservableTag > > | from_external (const LhaID &k) |
| Resolves an external key into an identifier. | |
| static std::optional< LhaID > | external_of (const IdOf< ObservableTag > &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< ObservableTag > &id, const LhaID &k) |
| Sets or updates the external key of an existing identifier. | |
| static std::vector< IdOf< ObservableTag > > | list_all () |
| Lists all distinct identifiers currently registered. | |
| static std::string | str (const IdOf< ObservableTag > &id) |
| Returns the string representation of an identifier. | |
| static std::string | str (Observables e) |
| Returns the builtin string name of an enum value. | |
| static IdOf< ObservableTag > | to_id (Observables e) |
| Converts an enum value to an IdOf<Tag>. | |
| static std::optional< Observables > | enum_of (const IdOf< ObservableTag > &id) |
| Attempts to recover the enum value associated with an identifier. | |
High-level mapper for observable names, FLHA ids and parent decays.
ObservableMapper combines:
observable_mapping(),observable_flha_mapping(),DynamicRegistry,DecayGraph.@important A custom observable must always be registered with a parent decay. This is enforced by the public register_custom() overloads below.
Definition at line 50 of file observable_ids.hpp.
| using ObservableMapper::Base = GenericMapperWithExt< ObservableTag, Observables, LhaID, std::hash<LhaID>, observable_mapping, observable_flha_mapping > |
Definition at line 61 of file observable_ids.hpp.
|
static |
Encode a binned observable id into its FLHA representation.
| id | Binned observable identifier. |
Definition at line 85 of file observable_ids.cpp.
|
static |
Throwing variant of from_binned_flha().
| ext | Binned FLHA identifier. |
| std::runtime_error | if ext cannot be decoded. |
Definition at line 93 of file observable_ids.cpp.
|
static |
Legacy builtin-only lookup from FLHA id to enum.
This first resolves the FLHA id to an ObservableId, then attempts to recover the corresponding builtin enum. Custom observables with a FLHA id can be resolved through from_flha() but cannot necessarily be converted to Observables.
| ext | FLHA identifier. |
| std::out_of_range | if ext is unknown or points to a custom id. |
Definition at line 47 of file observable_ids.cpp.
|
static |
Legacy builtin-only lookup from string to enum.
This function deliberately ignores custom observables because a custom observable cannot be represented by the static Observables enum. Use id_of() for all dynamic/user-facing lookup.
| s | Builtin observable name or alias present in observable_mapping(). |
| std::out_of_range | if s is not a builtin observable. |
Definition at line 35 of file observable_ids.cpp.
|
static |
Return the binned FLHA id associated with a binned observable id.
| id | Binned observable id. |
| std::runtime_error | if encoding fails. |
Definition at line 163 of file observable_ids.cpp.
|
static |
Return the FLHA id associated with an observable id.
| id | Observable id. |
| std::runtime_error | if id has no FLHA id. |
Definition at line 155 of file observable_ids.cpp.
|
static |
Return the FLHA id associated with a builtin enum value.
| id | Builtin observable enum. |
observable_flha_mapping().| std::out_of_range | if id has no static FLHA entry. |
Definition at line 101 of file observable_ids.cpp.
|
static |
Return the FLHA id attached to an observable id, if any.
| id | Observable identifier. |
id has one. Definition at line 73 of file observable_ids.cpp.
|
static |
Decode a binned FLHA id into a binned observable id.
Binned FLHA ids are normal observable FLHA ids where six integer fields encoding the two bin boundaries are inserted after the first two fields.
| ext | Binned FLHA identifier. |
Definition at line 77 of file observable_ids.cpp.
|
static |
Resolve a FLHA id to a dynamic observable id.
The canonical v1.0.2 polarization pattern is 92ij. For input compatibility, the unambiguous v1.0.0–v1.0.1 polarization identifiers 92015 and 921423 are accepted and translated to 9212 and 9221, respectively. Output always uses the canonical identifiers.
| ext | FLHA identifier. |
Definition at line 61 of file observable_ids.cpp.
|
static |
Register a custom observable and attach it to a parent decay.
| canonical | Canonical observable name. |
| aliases | Case-insensitive aliases for lookup. |
| ext | Optional FLHA id. |
| parent_decay | Parent decay id. It must already be registered, either as builtin or custom. |
| std::runtime_error | if parent_decay is unknown. |
| std::runtime_error | if the observable is already linked to another decay. |
Definition at line 105 of file observable_ids.cpp.
|
static |
Register a custom observable under a builtin parent decay.
Definition at line 129 of file observable_ids.cpp.
|
static |
Register a custom observable under a parent decay resolved by name.
Definition at line 142 of file observable_ids.cpp.