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

Concrete WilsonCoefficient whose matching rules are provided by the user. More...

#include <CustomWilson.h>

Inheritance diagram for CustomWilson:
Collaboration diagram for CustomWilson:

Public Member Functions

 CustomWilson (const LhaID &name, const std::string &storage_block, ContributionType type=ContributionType::SM)
 Constructs a custom Wilson coefficient.
 
 CustomWilson (WCoefId id, const std::string &storage_block, ContributionType type=ContributionType::SM)
 Constructs a custom coefficient from a dynamic Wilson coefficient id.
 
CustomWilsonset_order_info (QCDOrder order, std::unordered_set< ParamId > sources, std::function< scalar_t(const ParamSrc &)> compute, LhaID lhaid)
 Defines sources and compute functor for a specific QCD order.
 
CustomWilsonwith_type (ContributionType t)
 Sets the contribution type (fluent API).
 
CustomWilsonwith_storage_block (std::string block)
 Sets the storage block name (fluent API).
 
std::shared_ptr< WilsonCoefficientclone () const override
 Polymorphic clone.
 
- Public Member Functions inherited from WilsonCoefficient
 WilsonCoefficient ()=default
 
 WilsonCoefficient (const std::string &name, const std::string &storage_block)
 Constructs a coefficient from a domain name and a storage block.
 
 WilsonCoefficient (const LhaID &name, const std::string &storage_block, ContributionType ct)
 Constructs a coefficient from an LHA base name and explicit contribution type.
 
std::function< scalar_t(const ParamSrc &)> get_func (QCDOrder order)
 Returns the compute function for a given QCD order.
 
std::unordered_set< ParamIdget_sources (QCDOrder order)
 Returns the source ParamIds required at a given QCD order.
 
LhaID get_lhaid (QCDOrder order)
 Returns the storage LhaID associated with a given QCD order.
 
LhaID get_lhaid_from_name (QCDOrder order)
 Computes the LhaID directly from the coefficient base name and mapping conventions.
 
std::string get_base_name () const
 Returns the base name of the coefficient without BSM suffixes.
 
void set_name (std::string name)
 Sets the domain name of the coefficient.
 
void set_owned (bool owned)
 Sets the ownership flag.
 
void set_storage_block (std::string block_name)
 Sets the storage block where the coefficient value is stored.
 
void set_contribution_type (ContributionType type)
 Sets the contribution type (SM/BSM/…).
 
void add_matching_patch (QCDOrder order, std::unordered_set< ParamId > extra_sources, std::function< scalar_t(const ParamSrc &)> patch)
 Add an extra additive term to the matching function of one QCD order.
 
complex_t get_matching_value (std::string order, ContributionType cont_type, std::shared_ptr< IParameterProxy< std::string, LhaID > > wilson_p) const
 Reads the coefficient value from the storage backend for a given order/type.
 
std::string get_name () const
 Returns the current full name (may include suffixes).
 
std::string get_storage_block () const
 Returns the storage block name.
 
ContributionType get_type ()
 Returns the current contribution type.
 
LhaID id (QCDOrder order, ContributionType typ) const
 Returns the LHA id for a given order and contribution type.
 
bool operator== (const WilsonCoefficient &other) const
 Equality compares name, contribution type, and ownership flag.
 
bool operator!= (const WilsonCoefficient &other) const
 Inequality convenience.
 
virtual ~WilsonCoefficient ()=default
 

Additional Inherited Members

- Protected Attributes inherited from WilsonCoefficient
std::string coeffName {}
 Domain name of the coefficient (may include suffixes like _THDM/_SUSY).
 
ContributionType type {ContributionType::SM}
 Contribution type for this coefficient (SM by default, inferred in constructors).
 
bool is_owned {false}
 Ownership flag (used by higher-level logic to track "produced" coefficients).
 
std::string storage_block
 Block name where this coefficient is stored in the Parameters system.
 
std::map< QCDOrder, MatchingInfomatching_info
 Matching metadata indexed by QCD order.
 

Detailed Description

Concrete WilsonCoefficient whose matching rules are provided by the user.

The constructor initializes the base WilsonCoefficient with an explicit LhaID, storage block and contribution type, then resets per-order matching_info entries. Users can then provide (sources, compute, lhaid) for each desired QCDOrder via set_order_info().

Definition at line 50 of file CustomWilson.h.

Constructor & Destructor Documentation

◆ CustomWilson() [1/2]

CustomWilson::CustomWilson ( const LhaID name,
const std::string &  storage_block,
ContributionType  type = ContributionType::SM 
)
inline

Constructs a custom Wilson coefficient.

Parameters
nameBase identifier for the coefficient (full LHA id).
storage_blockBlock where the coefficient is stored.
typeContribution type (SM/BSM/TOTAL).

Definition at line 59 of file CustomWilson.h.

◆ CustomWilson() [2/2]

CustomWilson::CustomWilson ( WCoefId  id,
const std::string &  storage_block,
ContributionType  type = ContributionType::SM 
)
inline

Constructs a custom coefficient from a dynamic Wilson coefficient id.

This overload is the preferred entry point for runtime/user-defined Wilson coefficients. The coefficient name is set to WCoefMapper::str(id), so it can be queried later through WCoefId without requiring a legacy WCoef enum value. Per-order LHA ids are initialized with WCoefMapper::flha_full(WCoefId,QCDOrder,ContributionType).

Parameters
idDynamic coefficient id. It must have an FLHA base key registered in WCoefMapper.
storage_blockBlock where matching values will be composed.
typeContribution slot computed by this coefficient.

Definition at line 87 of file CustomWilson.h.

Member Function Documentation

◆ clone()

std::shared_ptr< WilsonCoefficient > CustomWilson::clone ( ) const
inlineoverridevirtual

Polymorphic clone.

Returns
A heap-allocated deep copy of this coefficient.

Implements WilsonCoefficient.

Definition at line 135 of file CustomWilson.h.

◆ set_order_info()

CustomWilson & CustomWilson::set_order_info ( QCDOrder  order,
std::unordered_set< ParamId sources,
std::function< scalar_t(const ParamSrc &)>  compute,
LhaID  lhaid 
)
inline

Defines sources and compute functor for a specific QCD order.

Parameters
orderOrder to configure (LO/NLO/NNLO).
sourcesSet of ParamId dependencies required for this computation.
computeFunction mapping a ParamSrc to the coefficient value.
lhaidLhaID used to identify the stored parameter for this order.
Returns
Reference to *this (fluent API).

Definition at line 109 of file CustomWilson.h.

◆ with_storage_block()

CustomWilson & CustomWilson::with_storage_block ( std::string  block)
inline

Sets the storage block name (fluent API).

Definition at line 128 of file CustomWilson.h.

◆ with_type()

CustomWilson & CustomWilson::with_type ( ContributionType  t)
inline

Sets the contribution type (fluent API).

Definition at line 123 of file CustomWilson.h.


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