Hyperiso 1.0.3
Modular flavour-physics calculations, Wilson coefficients and statistical inference
Loading...
Searching...
No Matches
UncertaintyTypeMapper Class Reference

Mapper for UncertaintyType <-> UncertaintyTypeId <-> string. More...

#include <uncertaintytype_ids.hpp>

Inheritance diagram for UncertaintyTypeMapper:
Collaboration diagram for UncertaintyTypeMapper:

Public Types

using Base = GenericMapperNoExt< UncTag, UncertaintyType, uncertaintytype_mapping >
 

Static Public Member Functions

static const std::map< UncertaintyType, DataType > & data_type_mapping ()
 Returns the builtin mapping UncertaintyType -> DataType.
 
static DataType d_type (UncertaintyType t)
 Returns the DataType corresponding to a given uncertainty type.
 
- Static Public Member Functions inherited from GenericMapperNoExt< UncTag, UncertaintyType, uncertaintytype_mapping >
static void init_builtins ()
 Explicitly initializes builtin entries.
 
static UncertaintyType enum_elt_legacy (std::string_view s)
 Legacy enum lookup using only the static MapFn() table.
 
static std::vector< std::string > get_str ()
 Returns the list of builtin string names from MapFn().
 
static std::vector< UncertaintyTypeget_enum ()
 Returns the list of builtin enum values from MapFn().
 
static std::vector< std::string > get_str_all ()
 Returns all known names: builtin and custom.
 
static IdOf< UncTagid_of (std::string_view s)
 Resolves a string into an IdOf<Tag> via the registry.
 
static IdOf< UncTagenum_elt (std::string_view s)
 Alias for id_of(), kept for compatibility.
 
static bool register_custom (std::string canonical, std::vector< std::string > aliases={})
 Registers a custom (non-builtin) entry in the registry.
 
static std::vector< IdOf< UncTag > > list_all ()
 Lists all distinct IdOf<Tag> entries in the registry.
 
static std::string str (const IdOf< UncTag > &id)
 Returns the string representation associated with an identifier.
 
static std::string str (UncertaintyType e)
 Returns the builtin string name corresponding to an enum value.
 
static IdOf< UncTagto_id (UncertaintyType e)
 Converts an enum value to an IdOf<Tag>.
 
static std::optional< UncertaintyTypeenum_of (const IdOf< UncTag > &id)
 Attempts to recover the enum value associated with an identifier.
 

Detailed Description

Mapper for UncertaintyType <-> UncertaintyTypeId <-> string.

This is a thin wrapper around GenericMapperNoExt with:

  • Tag = UncTag
  • EnumT = UncertaintyType
  • MapFn = uncertaintytype_mapping

It also exposes a separate mapping from UncertaintyType to DataType (e.g. STD_STAT, STD_SYST, ...).

Definition at line 54 of file uncertaintytype_ids.hpp.

Member Typedef Documentation

◆ Base

Member Function Documentation

◆ d_type()

static DataType UncertaintyTypeMapper::d_type ( UncertaintyType  t)
inlinestatic

Returns the DataType corresponding to a given uncertainty type.

Parameters
tUncertaintyType value.
Returns
Matching DataType.
Exceptions
std::out_of_rangeif t is not in the mapping.

Definition at line 84 of file uncertaintytype_ids.hpp.

◆ data_type_mapping()

static const std::map< UncertaintyType, DataType > & UncertaintyTypeMapper::data_type_mapping ( )
inlinestatic

Returns the builtin mapping UncertaintyType -> DataType.

This is typically used when interfacing to the internal data representation of uncertainties in datasets.

Definition at line 67 of file uncertaintytype_ids.hpp.


The documentation for this class was generated from the following file: