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

Mapper for WGroup <-> WGroupId <-> optional external string. More...

#include <wgroup_ids.hpp>

Inheritance diagram for GroupMapper:
Collaboration diagram for GroupMapper:

Public Types

using Base = GenericMapperWithExt< WGroupTag, WGroup, std::string, std::hash< std::string >, group_mapping, group_external_mapping >
 

Static Public Member Functions

static bool register_custom (std::string canonical, std::vector< std::string > aliases={}, std::optional< std::string > ext=std::nullopt)
 Registers a custom Wilson group with optional external label.
 
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::string str (WGroup g, ScaleType s, WilsonBasis b=WilsonBasis::B_STANDARD)
 Builds a composite block name using a WGroup enum, scale and basis.
 
- Static Public Member Functions inherited from GenericMapperWithExt< WGroupTag, WGroup, std::string, std::hash< std::string >, group_mapping, group_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< WGroupget_enum ()
 Returns the list of builtin enum values.
 
static std::vector< std::string > get_str_all ()
 Returns all known names (builtin + custom).
 
static WGroup enum_elt_legacy (std::string_view s)
 Legacy enum lookup using only the static MapFn() table.
 
static IdOf< WGroupTagid_of (std::string_view s)
 Resolves a string into an IdOf<Tag> via the registry.
 
static IdOf< WGroupTagenum_elt (std::string_view s)
 Alias for id_of(), kept for compatibility.
 
static std::optional< IdOf< WGroupTag > > from_external (const std::string &k)
 Resolves an external key into an identifier.
 
static std::optional< std::string > external_of (const IdOf< WGroupTag > &id)
 Returns the external key associated with a given identifier.
 
static bool register_custom (std::string canonical, std::vector< std::string > aliases={}, std::optional< std::string > ext=std::nullopt)
 Registers a custom entry with optional external key.
 
static bool set_external (const IdOf< WGroupTag > &id, const std::string &k)
 Sets or updates the external key of an existing identifier.
 
static std::vector< IdOf< WGroupTag > > list_all ()
 Lists all distinct identifiers currently registered.
 
static std::string str (const IdOf< WGroupTag > &id)
 Returns the string representation of an identifier.
 
static std::string str (WGroup e)
 Returns the builtin string name of an enum value.
 
static IdOf< WGroupTagto_id (WGroup e)
 Converts an enum value to an IdOf<Tag>.
 
static std::optional< WGroupenum_of (const IdOf< WGroupTag > &id)
 Attempts to recover the enum value associated with an identifier.
 

Detailed Description

Mapper for WGroup <-> WGroupId <-> optional external string.

This class specializes GenericMapperWithExt with:

  • Tag = WGroupTag
  • EnumT = WGroup
  • ExternalKey = std::string (optional external label)
  • Hash = std::hash<std::string>
  • MapFn = group_mapping
  • ExtFn = group_external_mapping

It exposes:

  • the usual enum/string/id mapping utilities from GenericMapperWithExt,
  • a convenience register_custom() with an optional external string,
  • domain-specific helpers to build group block names including scale and Wilson basis information.

Definition at line 56 of file wgroup_ids.hpp.

Member Typedef Documentation

◆ Base

using GroupMapper::Base = GenericMapperWithExt< WGroupTag, WGroup, std::string, std::hash<std::string>, group_mapping, group_external_mapping >

Definition at line 67 of file wgroup_ids.hpp.

Member Function Documentation

◆ register_custom()

static bool GroupMapper::register_custom ( std::string  canonical,
std::vector< std::string >  aliases = {},
std::optional< std::string >  ext = std::nullopt 
)
inlinestatic

Registers a custom Wilson group with optional external label.

The external string, if provided, is stored as an additional key that can be used with from_external() / external_of().

Parameters
canonicalCanonical name for the group.
aliasesOptional aliases used for case-insensitive lookup.
extOptional external string key.
Returns
true if registration succeeded, false if blocked by a builtin.

Definition at line 94 of file wgroup_ids.hpp.

◆ str() [1/2]

static std::string GroupMapper::str ( const WGroupId gid,
ScaleType  s,
WilsonBasis  b = WilsonBasis::B_STANDARD 
)
inlinestatic

Builds a composite block name using a WGroupId, scale and basis.

The format is: "<group>_<scale>[_<basis>]"

where the Wilson basis is appended only for hadronic scale.

Parameters
gidGroup identifier.
sScale type (matching / hadronic).
bWilson basis (used only if s == HADRONIC).
Returns
Composite block name.

Definition at line 114 of file wgroup_ids.hpp.

◆ str() [2/2]

static std::string GroupMapper::str ( WGroup  g,
ScaleType  s,
WilsonBasis  b = WilsonBasis::B_STANDARD 
)
inlinestatic

Builds a composite block name using a WGroup enum, scale and basis.

Same format as the overload taking WGroupId: "<group>_<scale>[_<basis>]"

Parameters
gWilson group enum.
sScale type (matching / hadronic).
bWilson basis (used only if s == HADRONIC).
Returns
Composite block name.

Definition at line 129 of file wgroup_ids.hpp.


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