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

High-level mapper for WCoef <-> text <-> FLHA base indices. More...

#include <wcoef_ids.hpp>

Inheritance diagram for WCoefMapper:
Collaboration diagram for WCoefMapper:

Public Types

using Base = GenericMapperWithExt< WCoefTag, WCoef, std::pair< int, int >, PairHash, wcoef_mapping, wcoef_flha_mapping >
 

Static Public Member Functions

static WCoef from_flha (int a, int b)
 Returns the WCoef associated with a given FLHA base key (a,b).
 
static std::optional< WCoefIdfrom_flha_key (int a, int b)
 Registry-based lookup of WCoefId from a FLHA base key (a,b).
 
static std::pair< int, int > flha_base (WCoef e)
 Returns the base FLHA pair (a,b) for a given WCoef.
 
static std::pair< int, int > flha_base (const WCoefId &id)
 Returns the base FLHA pair (a,b) for a given WCoefId.
 
static WCoef canonical_flha_coef (WCoef e)
 Builds a full FLHA LhaID for a given WCoef, order and contribution.
 
static LhaID flha_full (WCoef e, QCDOrder q, ContributionType c)
 
static std::pair< WCoefId, std::pair< QCDOrder, ContributionType > > lha_wilson_deserialize (LhaID id)
 Deserialize the id of a Wilson coefficient into (WCoefId, QCDOrder, ContributionType) using lha convention.
 
static LhaID flha_full (const WCoefId &id, QCDOrder q, ContributionType c)
 Builds a full FLHA LhaID for a given WCoefId, order and contribution.
 
static size_t n_wilsons ()
 Returns the total number of Wilson coefficients in the mapping.
 
static const std::map< std::pair< int, int >, WCoef > & inverse_flha_mapping ()
 Returns a static inverse mapping FLHA base pair -> WCoef.
 
static const std::vector< WCoef > & B_group ()
 B-group (C1–C10) Wilson coefficients.
 
static constexpr int lepton_mass_slot_from_index (int lepton_index)
 
static constexpr int thdm_lepton_yukawa_slot_from_index (int lepton_index)
 
static constexpr int lepton_index_from_pdg (int pdg)
 
static int lepton_index_from_cq1 (WCoef coef)
 
static int lepton_index_from_cq2 (WCoef coef)
 
static int lepton_index_from_cpq1 (WCoef coef)
 
static int lepton_index_from_cpq2 (WCoef coef)
 
static WCoef cq1_for_lepton_index (int lepton_index)
 
static WCoef cq2_for_lepton_index (int lepton_index)
 
static WCoef cpq1_for_lepton_index (int lepton_index)
 
static WCoef cpq2_for_lepton_index (int lepton_index)
 
static bool is_cpq (WCoef c)
 
static const std::vector< WCoef > & B_prime_group ()
 B'-group coefficients (primed + lepton-specific scalar primed).
 
static const std::vector< WCoef > & B_scalar_group ()
 Scalar B-group coefficients, split by charged-lepton generation.
 
static const std::vector< WCoef > & b_clnu_group ()
 Charged-current Wilsons for b -> c l ν.
 
static const std::vector< WCoef > & b_ulnu_group ()
 Charged-current Wilsons for b -> u l ν.
 
static const std::vector< WCoef > & c_slnu_group ()
 Charged-current Wilsons for c -> s l ν.
 
static const std::vector< WCoef > & c_dlnu_group ()
 Charged-current Wilsons for c -> d l ν.
 
static const std::vector< WCoef > & s_ulnu_group ()
 Charged-current Wilsons for s -> u l ν.
 
static const std::vector< WCoef > & d_ulnu_group ()
 Charged-current Wilsons for d -> u l ν.
 
static const std::vector< WCoef > & k_group ()
 Kaon-sector Wilsons (K group).
 
static const std::vector< WCoef > & meson_mixing_group ()
 Wilsons relevant for neutral meson mixing (B, K, D sectors).
 
static std::vector< WCoefget_group (WGroup g)
 Returns the list of Wilson coefficients belonging to a WGroup.
 
static WGroup group_of (WCoef c)
 Returns the WGroup to which a given Wilson coefficient belongs.
 
static std::optional< WGroupgroup_of_opt (WCoef c)
 Optional version: returns std::nullopt if not in any group.
 
static WGroup group_of (const WCoefId &id)
 Convenience overload for identifiers.
 
- Static Public Member Functions inherited from GenericMapperWithExt< WCoefTag, WCoef, std::pair< int, int >, PairHash, wcoef_mapping, wcoef_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< WCoefget_enum ()
 Returns the list of builtin enum values.
 
static std::vector< std::string > get_str_all ()
 Returns all known names (builtin + custom).
 
static WCoef enum_elt_legacy (std::string_view s)
 Legacy enum lookup using only the static MapFn() table.
 
static IdOf< WCoefTagid_of (std::string_view s)
 Resolves a string into an IdOf<Tag> via the registry.
 
static IdOf< WCoefTagenum_elt (std::string_view s)
 Alias for id_of(), kept for compatibility.
 
static std::optional< IdOf< WCoefTag > > from_external (const std::pair< int, int > &k)
 Resolves an external key into an identifier.
 
static std::optional< std::pair< int, int > > external_of (const IdOf< WCoefTag > &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::pair< int, int > > ext=std::nullopt)
 Registers a custom entry with optional external key.
 
static bool set_external (const IdOf< WCoefTag > &id, const std::pair< int, int > &k)
 Sets or updates the external key of an existing identifier.
 
static std::vector< IdOf< WCoefTag > > list_all ()
 Lists all distinct identifiers currently registered.
 
static std::string str (const IdOf< WCoefTag > &id)
 Returns the string representation of an identifier.
 
static std::string str (WCoef e)
 Returns the builtin string name of an enum value.
 
static IdOf< WCoefTagto_id (WCoef e)
 Converts an enum value to an IdOf<Tag>.
 
static std::optional< WCoefenum_of (const IdOf< WCoefTag > &id)
 Attempts to recover the enum value associated with an identifier.
 

Detailed Description

High-level mapper for WCoef <-> text <-> FLHA base indices.

Specialization of GenericMapperWithExt with:

  • Tag = WCoefTag
  • EnumT = WCoef
  • ExternalKey = std::pair<int,int> (base FLHA indices)
  • Hash = PairHash
  • MapFn = wcoef_mapping
  • ExtFn = wcoef_flha_mapping

In addition to the generic mapping interface, it provides:

  • utilities to convert to/from FLHA base keys (int,int),
  • utilities to build full FLHA LhaID (including QCD order & contribution),
  • convenient accessors for specific Wilson groups (B, BPrime, CC_bc, ...),
  • an inverse FLHA mapping cache.

Definition at line 51 of file wcoef_ids.hpp.

Member Typedef Documentation

◆ Base

Member Function Documentation

◆ b_clnu_group()

static const std::vector< WCoef > & WCoefMapper::b_clnu_group ( )
inlinestatic

Charged-current Wilsons for b -> c l ν.

Definition at line 360 of file wcoef_ids.hpp.

◆ B_group()

static const std::vector< WCoef > & WCoefMapper::B_group ( )
inlinestatic

B-group (C1–C10) Wilson coefficients.

Definition at line 239 of file wcoef_ids.hpp.

◆ B_prime_group()

static const std::vector< WCoef > & WCoefMapper::B_prime_group ( )
inlinestatic

B'-group coefficients (primed + lepton-specific scalar primed).

Definition at line 342 of file wcoef_ids.hpp.

◆ B_scalar_group()

static const std::vector< WCoef > & WCoefMapper::B_scalar_group ( )
inlinestatic

Scalar B-group coefficients, split by charged-lepton generation.

Definition at line 352 of file wcoef_ids.hpp.

◆ b_ulnu_group()

static const std::vector< WCoef > & WCoefMapper::b_ulnu_group ( )
inlinestatic

Charged-current Wilsons for b -> u l ν.

Definition at line 365 of file wcoef_ids.hpp.

◆ c_dlnu_group()

static const std::vector< WCoef > & WCoefMapper::c_dlnu_group ( )
inlinestatic

Charged-current Wilsons for c -> d l ν.

Definition at line 375 of file wcoef_ids.hpp.

◆ c_slnu_group()

static const std::vector< WCoef > & WCoefMapper::c_slnu_group ( )
inlinestatic

Charged-current Wilsons for c -> s l ν.

Definition at line 370 of file wcoef_ids.hpp.

◆ canonical_flha_coef()

static WCoef WCoefMapper::canonical_flha_coef ( WCoef  e)
inlinestatic

Builds a full FLHA LhaID for a given WCoef, order and contribution.

The resulting LhaID has components: { base_a, base_b, qcd_order_index, contribution_type } where:

  • (base_a, base_b) is from wcoef_flha_mapping(),
  • qcd_order_index = int(q) - 1,
  • contribution_type = int(c).
Parameters
eWCoef enum.
qQCD order.
cContribution type (SM / BSM / TOTAL).
Returns
Corresponding LhaID.

Definition at line 146 of file wcoef_ids.hpp.

◆ cpq1_for_lepton_index()

static WCoef WCoefMapper::cpq1_for_lepton_index ( int  lepton_index)
inlinestatic

Definition at line 317 of file wcoef_ids.hpp.

◆ cpq2_for_lepton_index()

static WCoef WCoefMapper::cpq2_for_lepton_index ( int  lepton_index)
inlinestatic

Definition at line 326 of file wcoef_ids.hpp.

◆ cq1_for_lepton_index()

static WCoef WCoefMapper::cq1_for_lepton_index ( int  lepton_index)
inlinestatic

Definition at line 299 of file wcoef_ids.hpp.

◆ cq2_for_lepton_index()

static WCoef WCoefMapper::cq2_for_lepton_index ( int  lepton_index)
inlinestatic

Definition at line 308 of file wcoef_ids.hpp.

◆ d_ulnu_group()

static const std::vector< WCoef > & WCoefMapper::d_ulnu_group ( )
inlinestatic

Charged-current Wilsons for d -> u l ν.

Definition at line 385 of file wcoef_ids.hpp.

◆ flha_base() [1/2]

static std::pair< int, int > WCoefMapper::flha_base ( const WCoefId id)
inlinestatic

Returns the base FLHA pair (a,b) for a given WCoefId.

This uses the registry's external_of() mapping. If no external key is known for this id, an exception is thrown.

Parameters
idWilson coefficient identifier.
Returns
Base FLHA indices (a,b).
Exceptions
std::runtime_errorif id has no associated FLHA key.

Definition at line 119 of file wcoef_ids.hpp.

◆ flha_base() [2/2]

static std::pair< int, int > WCoefMapper::flha_base ( WCoef  e)
inlinestatic

Returns the base FLHA pair (a,b) for a given WCoef.

This uses the static mapping wcoef_flha_mapping().

Parameters
eWCoef enum value.
Returns
Pair of FLHA base indices.

Definition at line 104 of file wcoef_ids.hpp.

◆ flha_full() [1/2]

static LhaID WCoefMapper::flha_full ( const WCoefId id,
QCDOrder  q,
ContributionType  c 
)
inlinestatic

Builds a full FLHA LhaID for a given WCoefId, order and contribution.

Uses the external base key attached to the id. If none is found, an exception is thrown.

Parameters
idWCoef identifier.
qQCD order.
cContribution type.
Returns
Corresponding LhaID.
Exceptions
std::runtime_errorif id has no FLHA key.

Definition at line 203 of file wcoef_ids.hpp.

◆ flha_full() [2/2]

static LhaID WCoefMapper::flha_full ( WCoef  e,
QCDOrder  q,
ContributionType  c 
)
inlinestatic

Definition at line 156 of file wcoef_ids.hpp.

◆ from_flha()

static WCoef WCoefMapper::from_flha ( int  a,
int  b 
)
inlinestatic

Returns the WCoef associated with a given FLHA base key (a,b).

Uses a static inverse map built once from wcoef_flha_mapping().

Parameters
aFirst FLHA index.
bSecond FLHA index.
Returns
Corresponding WCoef enum.
Exceptions
std::out_of_rangeif the pair (a,b) is not supported.

Definition at line 74 of file wcoef_ids.hpp.

◆ from_flha_key()

static std::optional< WCoefId > WCoefMapper::from_flha_key ( int  a,
int  b 
)
inlinestatic

Registry-based lookup of WCoefId from a FLHA base key (a,b).

Uses the external-key mapping in the GenericMapperWithExt registry.

Parameters
aFirst FLHA index.
bSecond FLHA index.
Returns
Optional WCoefId if registered.

Definition at line 94 of file wcoef_ids.hpp.

◆ get_group()

static std::vector< WCoef > WCoefMapper::get_group ( WGroup  g)
inlinestatic

Returns the list of Wilson coefficients belonging to a WGroup.

This is a convenience function on top of the various *_group() helpers.

Parameters
gWilson group.
Returns
Vector of WCoef belonging to group g.
Exceptions
(viaLOG_ERROR) if g is invalid.

Definition at line 418 of file wcoef_ids.hpp.

◆ group_of() [1/2]

static WGroup WCoefMapper::group_of ( const WCoefId id)
inlinestatic

Convenience overload for identifiers.

Exceptions
std::runtime_errorif id cannot be converted to an enum.

Definition at line 494 of file wcoef_ids.hpp.

◆ group_of() [2/2]

static WGroup WCoefMapper::group_of ( WCoef  c)
inlinestatic

Returns the WGroup to which a given Wilson coefficient belongs.

Uses a static inverse map built once from the group definitions.

Parameters
cWilson coefficient.
Returns
The corresponding WGroup.
Exceptions
std::out_of_rangeif the coefficient is not assigned to any group.

Definition at line 445 of file wcoef_ids.hpp.

◆ group_of_opt()

static std::optional< WGroup > WCoefMapper::group_of_opt ( WCoef  c)
inlinestatic

Optional version: returns std::nullopt if not in any group.

Definition at line 484 of file wcoef_ids.hpp.

◆ inverse_flha_mapping()

static const std::map< std::pair< int, int >, WCoef > & WCoefMapper::inverse_flha_mapping ( )
inlinestatic

Returns a static inverse mapping FLHA base pair -> WCoef.

This is built once from wcoef_flha_mapping() and reused for all calls.

Returns
Const reference to the inverse map.

Definition at line 229 of file wcoef_ids.hpp.

◆ is_cpq()

static bool WCoefMapper::is_cpq ( WCoef  c)
inlinestatic

Definition at line 335 of file wcoef_ids.hpp.

◆ k_group()

static const std::vector< WCoef > & WCoefMapper::k_group ( )
inlinestatic

Kaon-sector Wilsons (K group).

Definition at line 390 of file wcoef_ids.hpp.

◆ lepton_index_from_cpq1()

static int WCoefMapper::lepton_index_from_cpq1 ( WCoef  coef)
inlinestatic

Definition at line 279 of file wcoef_ids.hpp.

◆ lepton_index_from_cpq2()

static int WCoefMapper::lepton_index_from_cpq2 ( WCoef  coef)
inlinestatic

Definition at line 289 of file wcoef_ids.hpp.

◆ lepton_index_from_cq1()

static int WCoefMapper::lepton_index_from_cq1 ( WCoef  coef)
inlinestatic

Definition at line 259 of file wcoef_ids.hpp.

◆ lepton_index_from_cq2()

static int WCoefMapper::lepton_index_from_cq2 ( WCoef  coef)
inlinestatic

Definition at line 269 of file wcoef_ids.hpp.

◆ lepton_index_from_pdg()

static constexpr int WCoefMapper::lepton_index_from_pdg ( int  pdg)
inlinestaticconstexpr

Definition at line 254 of file wcoef_ids.hpp.

◆ lepton_mass_slot_from_index()

static constexpr int WCoefMapper::lepton_mass_slot_from_index ( int  lepton_index)
inlinestaticconstexpr

Definition at line 246 of file wcoef_ids.hpp.

◆ lha_wilson_deserialize()

static std::pair< WCoefId, std::pair< QCDOrder, ContributionType > > WCoefMapper::lha_wilson_deserialize ( LhaID  id)
inlinestatic

Deserialize the id of a Wilson coefficient into (WCoefId, QCDOrder, ContributionType) using lha convention.

The resulting object has components: std::pair<WCoefId, std::pair<QCDOrder, ContributionType>> where:

  • WCoefId is the base id of the Wilson Coefficient (int,int)
  • QCDOrder the order of the coefficient (LO, NLO, NNLO)
  • ContributionType = SM, BSM or TOT (SM+BSM).
Parameters
idLhaID of the coefficient.

Definition at line 173 of file wcoef_ids.hpp.

◆ meson_mixing_group()

static const std::vector< WCoef > & WCoefMapper::meson_mixing_group ( )
inlinestatic

Wilsons relevant for neutral meson mixing (B, K, D sectors).

Definition at line 395 of file wcoef_ids.hpp.

◆ n_wilsons()

static size_t WCoefMapper::n_wilsons ( )
inlinestatic

Returns the total number of Wilson coefficients in the mapping.

Definition at line 220 of file wcoef_ids.hpp.

◆ s_ulnu_group()

static const std::vector< WCoef > & WCoefMapper::s_ulnu_group ( )
inlinestatic

Charged-current Wilsons for s -> u l ν.

Definition at line 380 of file wcoef_ids.hpp.

◆ thdm_lepton_yukawa_slot_from_index()

static constexpr int WCoefMapper::thdm_lepton_yukawa_slot_from_index ( int  lepton_index)
inlinestaticconstexpr

Definition at line 250 of file wcoef_ids.hpp.


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