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

Polymorphic container of WilsonCoefficient objects representing a coefficient group. More...

#include <WilsonGroup.h>

Inheritance diagram for CoefficientGroup:
Collaboration diagram for CoefficientGroup:

Public Member Functions

 CoefficientGroup (WilsonGroupAdapterConfig adapters)
 Constructs an empty group with adapter configuration.
 
 CoefficientGroup (const CoefficientGroup &)
 Deep-copy constructor.
 
 CoefficientGroup (CoefficientGroup &&)=default
 Move construction (default).
 
 CoefficientGroup (std::map< std::string, std::shared_ptr< WilsonCoefficient > > &coeffs, WilsonGroupAdapterConfig adapters)
 Constructs from an existing map of coefficients and initializes up to NNLO.
 
void init (QCDOrder order)
 Registers dependent parameters for matching coefficients up to a maximum order.
 
void init_full_running_block (const std::unordered_map< ParameterType, std::vector< std::string > > &source_names, WilsonBasis basis, bool inter, std::vector< ContributionType > type)
 Initializes sources to build a full running block.
 
virtual std::shared_ptr< CoefficientGroupget_sm_group ()
 Returns the SM-only subgroup if the concrete group supports it.
 
complex_t get_matching_coefficient (std::string coeff, std::string order, ContributionType cont_type) const
 Reads a coefficient at the matching scale (mu_W).
 
complex_t get_running_coefficient (std::string coeff, std::string order, ContributionType cont_type, WilsonBasis basis=WilsonBasis::B_STANDARD) const
 Reads a coefficient at the hadronic scale (mu_h) in a given basis.
 
QCDOrder get_order ()
 Returns the maximum initialized QCD order for this group.
 
std::string get_matching_storage_block () const
 Returns the current matching storage block name.
 
void set_matching_storage_block (std::string)
 Sets the matching storage block name (used by claim_coefficients()).
 
ContributionType get_type ()
 Returns the contribution type associated with this group (SM/BSM/TOTAL...).
 
std::unordered_map< ParameterType, std::vector< std::string > > get_sources (QCDOrder ord, WilsonBasis id)
 Returns source blocks for a given basis and order.
 
std::unordered_set< WilsonBasisget_bases () const
 Returns the set of bases configured in sources.
 
std::function< std::unordered_map< WCoefId, scalar_t >(const std::unordered_map< QCDOrder, std::unordered_map< WCoefId, scalar_t > > &, const BlockSrc &)> get_func (QCDOrder ord, WilsonBasis id)
 Returns the computation function for a given basis and order.
 
WGroupId get_group_id () const
 Returns the group identifier.
 
const std::vector< WCoefId > & get_member_ids () const
 Returns the dynamic ids of coefficients owned by this group.
 
void set_member_ids (std::vector< WCoefId > ids)
 Replace the dynamic coefficient membership list.
 
void add_member_id (WCoefId id)
 Add one dynamic coefficient id to the membership list if absent.
 
void set_group_id (WGroupId gid)
 Sets the group identifier (caller must ensure consistency with block naming).
 
void set_wilson_type (ContributionType ct)
 Sets the group contribution type.
 
void add_sources (WilsonBasis basis, const std::map< QCDOrder, CoefficientGroupSources > &m)
 Adds running-block sources for a given basis.
 
virtual std::shared_ptr< CoefficientGroupclone () const =0
 Polymorphic clone.
 
virtual ~CoefficientGroup ()=default
 

Protected Member Functions

void claim_coefficients ()
 Claims coefficient objects as owned by this group and sets their storage/type.
 

Protected Attributes

ContributionType wilson_type {ContributionType::SM}
 Contribution type for this group (default SM).
 
QCDOrder current_order = QCDOrder::LO
 Max initialized order (default LO).
 
WGroupId id
 Identifier of this group (used by GroupMapper to build block names).
 
std::string block_name
 Block name for matching-scale storage.
 
std::vector< WCoefIdmember_ids
 Dynamic coefficient ids belonging to this group.
 
std::map< WilsonBasis, std::map< QCDOrder, CoefficientGroupSources > > sources
 Running-block source specification, keyed by (basis -> order).
 
WilsonGroupAdapterConfig adapters
 Adapter configuration bundle (proxies, composers, core APIs, MARTY hooks).
 

Detailed Description

Polymorphic container of WilsonCoefficient objects representing a coefficient group.

CoefficientGroup inherits from: std::map<std::string, std::shared_ptr<WilsonCoefficient>> mapping coefficient names (keys) to coefficient objects (values).

Core responsibilities:

  • Claiming coefficients: claim_coefficients() updates each coefficient so that:
    • it is marked owned,
    • its storage block matches the group matching block,
    • its contribution type matches the group type (SM/BSM/TOTAL...).
  • Initialization of matching coefficients: init(max_order) registers a dependent parameter for each coefficient and each order up to max_order through IBlockComposer.
  • Retrieval:

Adapters:

Notes on dependent parameter wiring:

  • init() registers, for each coefficient C and each order, a wrapper that calls the coefficient’s order-specific compute function:
    dep_param->set_expected( coeff.compute(src) );
  • If no compute function is set (null), expected value is set to 0.

Copy semantics:

  • The copy constructor deep-copies coefficients by calling WilsonCoefficient::clone().
  • Adapter configuration is copied by value (shared_ptr are copied).

Extensibility:

  • This is an abstract base class; derived groups must implement clone().

Definition at line 127 of file WilsonGroup.h.

Constructor & Destructor Documentation

◆ CoefficientGroup() [1/4]

CoefficientGroup::CoefficientGroup ( WilsonGroupAdapterConfig  adapters)
inline

Constructs an empty group with adapter configuration.

Parameters
adaptersBundle of adapters/proxies used by the group.

Definition at line 134 of file WilsonGroup.h.

◆ CoefficientGroup() [2/4]

CoefficientGroup::CoefficientGroup ( const CoefficientGroup other)

Deep-copy constructor.

Copies:

Definition at line 13 of file WilsonGroup.cpp.

◆ CoefficientGroup() [3/4]

CoefficientGroup::CoefficientGroup ( CoefficientGroup &&  )
default

Move construction (default).

◆ CoefficientGroup() [4/4]

CoefficientGroup::CoefficientGroup ( std::map< std::string, std::shared_ptr< WilsonCoefficient > > &  coeffs,
WilsonGroupAdapterConfig  adapters 
)

Constructs from an existing map of coefficients and initializes up to NNLO.

Inserts all coefficients from coeffs, then calls init() with max order NNLO (unless the order system defines NONE as a sentinel).

Parameters
coeffsMap of coefficient names to coefficient instances.
adaptersAdapter config bundle.

Definition at line 31 of file WilsonGroup.cpp.

◆ ~CoefficientGroup()

virtual CoefficientGroup::~CoefficientGroup ( )
virtualdefault

Member Function Documentation

◆ add_member_id()

void CoefficientGroup::add_member_id ( WCoefId  id)

Add one dynamic coefficient id to the membership list if absent.

Definition at line 62 of file WilsonGroup.cpp.

◆ add_sources()

void CoefficientGroup::add_sources ( WilsonBasis  basis,
const std::map< QCDOrder, CoefficientGroupSources > &  m 
)
inline

Adds running-block sources for a given basis.

Parameters
basisWilson basis.
mMap (QCDOrder -> CoefficientGroupSources) for that basis.

Definition at line 303 of file WilsonGroup.h.

◆ claim_coefficients()

void CoefficientGroup::claim_coefficients ( )
protected

Claims coefficient objects as owned by this group and sets their storage/type.

For each coefficient in the group:

Definition at line 5 of file WilsonGroup.cpp.

◆ clone()

virtual std::shared_ptr< CoefficientGroup > CoefficientGroup::clone ( ) const
pure virtual

◆ get_bases()

std::unordered_set< WilsonBasis > CoefficientGroup::get_bases ( ) const
inline

Returns the set of bases configured in sources.

Definition at line 253 of file WilsonGroup.h.

◆ get_func()

std::function< std::unordered_map< WCoefId, scalar_t >(const std::unordered_map< QCDOrder, std::unordered_map< WCoefId, scalar_t > > &, const BlockSrc &)> CoefficientGroup::get_func ( QCDOrder  ord,
WilsonBasis  id 
)
inline

Returns the computation function for a given basis and order.

Parameters
ordQCD order.
idWilson basis.

Definition at line 262 of file WilsonGroup.h.

◆ get_group_id()

WGroupId CoefficientGroup::get_group_id ( ) const
inline

Returns the group identifier.

Definition at line 265 of file WilsonGroup.h.

◆ get_matching_coefficient()

complex_t CoefficientGroup::get_matching_coefficient ( std::string  coeff,
std::string  order,
ContributionType  cont_type 
) const

Reads a coefficient at the matching scale (mu_W).

The coefficient is looked up by name in this map. The value is retrieved through the configured WILSON parameter proxy:

coeff->get_matching_value(order, cont_type, adapters.wilson_proxy)
WilsonGroupAdapterConfig adapters
Adapter configuration bundle (proxies, composers, core APIs, MARTY hooks).
std::shared_ptr< IParameterProxy< std::string, LhaID > > wilson_proxy
Proxy used to read/write Wilson coefficients from Parameters (WILSON scope).
Parameters
coeffCoefficient name (map key).
orderOrder string ("LO", "NLO", "NNLO", ...).
cont_typeContribution type to request (SM/BSM/TOTAL...).
Returns
Complex value (current implementation usually imag=0 unless stored otherwise).
Exceptions
std::out_of_rangeif coeff is not present in the group.

Definition at line 67 of file WilsonGroup.cpp.

◆ get_matching_storage_block()

std::string CoefficientGroup::get_matching_storage_block ( ) const
inline

Returns the current matching storage block name.

This corresponds to where matching-scale coefficients are stored.

Definition at line 234 of file WilsonGroup.h.

◆ get_member_ids()

const std::vector< WCoefId > & CoefficientGroup::get_member_ids ( ) const
inline

Returns the dynamic ids of coefficients owned by this group.

Builtin groups are populated by CoefficientGroupBuilder from their static WCoef members. Custom/lambda groups populate this list directly with WCoefId values, so downstream manager code can compose SM/BSM/TOTAL triplets and hadronic blocks without converting through the legacy enum.

Definition at line 275 of file WilsonGroup.h.

◆ get_order()

QCDOrder CoefficientGroup::get_order ( )

Returns the maximum initialized QCD order for this group.

Definition at line 93 of file WilsonGroup.cpp.

◆ get_running_coefficient()

complex_t CoefficientGroup::get_running_coefficient ( std::string  coeff,
std::string  order,
ContributionType  cont_type,
WilsonBasis  basis = WilsonBasis::B_STANDARD 
) const

Reads a coefficient at the hadronic scale (mu_h) in a given basis.

The value is read from the block: GroupMapper::str(id, ScaleType::HADRONIC, basis) using the configured WILSON proxy. If the entry does not exist, returns (0,0).

Parameters
coeffCoefficient name (map key).
orderOrder string ("LO"/"NLO"/"NNLO"...).
cont_typeContribution type to request.
basisWilson basis of the running block (default: B_STANDARD).
Returns
Complex coefficient value; returns (0,0) if missing.
Exceptions
std::out_of_rangeif coeff is not present in the group.

Definition at line 75 of file WilsonGroup.cpp.

◆ get_sm_group()

virtual std::shared_ptr< CoefficientGroup > CoefficientGroup::get_sm_group ( )
inlinevirtual

Returns the SM-only subgroup if the concrete group supports it.

Default implementation raises a LogicError and returns nullptr. Concrete derived groups may override.

Reimplemented in GenericCoefficientGroup, BPrimeCoefficientGroup, BScalarCoefficientGroup, BCoefficientGroup, BclnuCoefficientGroup, BulnuCoefficientGroup, DslnuCoefficientGroup, DdlnuCoefficientGroup, KulnuCoefficientGroup, KCoefficientGroup, MesonMixingCoefficientGroup, and PIulnuCoefficientGroup.

Definition at line 190 of file WilsonGroup.h.

◆ get_sources()

std::unordered_map< ParameterType, std::vector< std::string > > CoefficientGroup::get_sources ( QCDOrder  ord,
WilsonBasis  id 
)
inline

Returns source blocks for a given basis and order.

Parameters
ordQCD order.
idWilson basis.
Returns
Map (ParameterType -> list of block names).

Definition at line 248 of file WilsonGroup.h.

◆ get_type()

ContributionType CoefficientGroup::get_type ( )
inline

Returns the contribution type associated with this group (SM/BSM/TOTAL...).

Definition at line 240 of file WilsonGroup.h.

◆ init()

void CoefficientGroup::init ( QCDOrder  order)

Registers dependent parameters for matching coefficients up to a maximum order.

For each order in [LO..max_order] and for each coefficient:

  • builds a wrapper updating the DependentParameter expected value,
  • registers the dependency through adapters.iblock_c->compose_parameter(...).
Parameters
orderMaximum QCD order to initialize (LO/NLO/NNLO).

Definition at line 39 of file WilsonGroup.cpp.

◆ init_full_running_block()

void CoefficientGroup::init_full_running_block ( const std::unordered_map< ParameterType, std::vector< std::string > > &  source_names,
WilsonBasis  basis,
bool  inter,
std::vector< ContributionType type 
)

Initializes sources to build a full running block.

This method is intended to set up sources for running blocks, depending on:

  • the source blocks available,
  • a chosen Wilson basis,
  • optional intermediate/interaction controls,
  • which contribution types are handled.

(Implementation-dependent, declared here as part of the group API.)

◆ set_group_id()

void CoefficientGroup::set_group_id ( WGroupId  gid)
inline

Sets the group identifier (caller must ensure consistency with block naming).

Definition at line 292 of file WilsonGroup.h.

◆ set_matching_storage_block()

void CoefficientGroup::set_matching_storage_block ( std::string  name)

Sets the matching storage block name (used by claim_coefficients()).

Definition at line 58 of file WilsonGroup.cpp.

◆ set_member_ids()

void CoefficientGroup::set_member_ids ( std::vector< WCoefId ids)
inline

Replace the dynamic coefficient membership list.

Use this when constructing a group from configuration or from a runtime lambda definition. The order is preserved and reused when composing final matching/running blocks.

Definition at line 284 of file WilsonGroup.h.

◆ set_wilson_type()

void CoefficientGroup::set_wilson_type ( ContributionType  ct)
inline

Sets the group contribution type.

Definition at line 295 of file WilsonGroup.h.

Member Data Documentation

◆ adapters

WilsonGroupAdapterConfig CoefficientGroup::adapters
protected

Adapter configuration bundle (proxies, composers, core APIs, MARTY hooks).

Definition at line 355 of file WilsonGroup.h.

◆ block_name

std::string CoefficientGroup::block_name
protected

Block name for matching-scale storage.

Definition at line 337 of file WilsonGroup.h.

◆ current_order

QCDOrder CoefficientGroup::current_order = QCDOrder::LO
protected

Max initialized order (default LO).

Definition at line 331 of file WilsonGroup.h.

◆ id

WGroupId CoefficientGroup::id
protected

Identifier of this group (used by GroupMapper to build block names).

Definition at line 334 of file WilsonGroup.h.

◆ member_ids

std::vector<WCoefId> CoefficientGroup::member_ids
protected

Dynamic coefficient ids belonging to this group.

This mirrors the historical static group membership while also supporting user-defined coefficients that only exist as WCoefId values.

Definition at line 345 of file WilsonGroup.h.

◆ sources

std::map<WilsonBasis, std::map<QCDOrder, CoefficientGroupSources> > CoefficientGroup::sources
protected

Running-block source specification, keyed by (basis -> order).

Definition at line 350 of file WilsonGroup.h.

◆ wilson_type

ContributionType CoefficientGroup::wilson_type {ContributionType::SM}
protected

Contribution type for this group (default SM).

Definition at line 328 of file WilsonGroup.h.


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