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

Provides access to parameter values, errors, and existence checks. More...

#include <ParameterProvider.h>

Inheritance diagram for ParameterProvider:
Collaboration diagram for ParameterProvider:

Public Member Functions

 ParameterProvider ()=default
 Default constructor (untyped provider).
 
 ParameterProvider (ParameterType p_type)
 Constructs a provider bound to a specific ParameterType.
 
scalar_t operator() (const ParamId &pid, DataType d_type=DataType::VALUE) const
 Retrieves a parameter value based on ParamId and requested data type.
 
scalar_t operator() (const std::string &block, const LhaID &id, DataType d_type=DataType::VALUE) const
 Retrieves a parameter value based on block name and LHA ID.
 
bool exists (const ParamId &pid) const
 Checks if a parameter identified by ParamId exists.
 
bool exists (const std::string &block, const LhaID &id) const
 Checks if a parameter identified by ParamId exists.
 
double get_scale (const std::string &block) const
 Checks if a parameter identified by block name and LHA ID exists.
 
ParameterType get_type () const
 Retrieves the renormalization scale associated with a given block.
 
std::shared_ptr< Parameterget_parameter (const ParamId &pid) const
 Retrieves the actual Parameter object corresponding to the given ParamId.
 
- Public Member Functions inherited from IDataProvider< ParameterProvider >
virtual ~IDataProvider ()=default
 
double operator() (Args &&... args)
 
bool exists (Args &&... args) const
 

Detailed Description

Provides access to parameter values, errors, and existence checks.

ParameterProvider wraps the Parameters subsystem and exposes a convenient callable interface:

  • operator()(ParamId, DataType) to fetch central value or uncertainties of a parameter identified by ParamId.
  • operator()(block, LhaID, DataType) to fetch the same information using the usual SLHA-style (block, index) access.

It can optionally be “bound” to a given ParameterType (e.g. SM, BSM) at construction time. In that case, calls using (block, LhaID, ...) will implicitly use that parameter type.

Typical usage:

ParamId pid{ParameterType::SM, "MASS", LhaID(25)};
double mh = p_sm(pid); // VALUE
double sigma_s = p_sm(pid, DataType::STD_STAT); // stat. error
double sigma_t = p_sm("MASS", LhaID(25), DataType::STD_COMBINED);
bool exists = p_sm.exists(pid);
Provides access to parameter values, errors, and existence checks.
bool exists(const ParamId &pid) const
Checks if a parameter identified by ParamId exists.
Represents an identifier of a LHA element, possibly containing several sub-ids.
Definition LhaID.h:56
Composite identifier for a single parameter.
Definition ParamID.h:57
Examples
data_provider_example.cpp.

Definition at line 53 of file ParameterProvider.h.

Constructor & Destructor Documentation

◆ ParameterProvider() [1/2]

ParameterProvider::ParameterProvider ( )
default

Default constructor (untyped provider).

When constructed without a ParameterType, the provider can still be used with ParamId-based access. Block-based access (block, LhaID, ...) requires an explicit type (see the other constructor).

◆ ParameterProvider() [2/2]

ParameterProvider::ParameterProvider ( ParameterType  p_type)
inline

Constructs a provider bound to a specific ParameterType.

Ensures that the corresponding Parameters instance exists, and stores the type internally for later block-based queries.

Parameters
p_typeParameterType handled by this provider (e.g. SM, BSM).

Definition at line 72 of file ParameterProvider.h.

Member Function Documentation

◆ exists() [1/2]

bool ParameterProvider::exists ( const ParamId pid) const

Checks if a parameter identified by ParamId exists.

Parameters
pidThe parameter ID.
Returns
True if the parameter exists, false otherwise.

Definition at line 20 of file ParameterProvider.cpp.

◆ exists() [2/2]

bool ParameterProvider::exists ( const std::string &  block,
const LhaID id 
) const

Checks if a parameter identified by ParamId exists.

Parameters
pidThe parameter ID.
Returns
True if the parameter exists, false otherwise.

Definition at line 24 of file ParameterProvider.cpp.

◆ get_parameter()

std::shared_ptr< Parameter > ParameterProvider::get_parameter ( const ParamId pid) const

Retrieves the actual Parameter object corresponding to the given ParamId.

Parameters
pidThe parameter ID.
Returns
A shared pointer to the Parameter object.

Definition at line 45 of file ParameterProvider.cpp.

◆ get_scale()

double ParameterProvider::get_scale ( const std::string &  block) const

Checks if a parameter identified by block name and LHA ID exists.

This call uses the internal ParameterType that was provided at construction time.

Parameters
blockThe name of the parameter block.
idThe LHA ID of the parameter.
Returns
True if the parameter exists, false otherwise.

Definition at line 36 of file ParameterProvider.cpp.

◆ get_type()

ParameterType ParameterProvider::get_type ( ) const

Retrieves the renormalization scale associated with a given block.

Delegates to Parameters::get_block_scale for the provider's ParameterType.

Parameters
blockThe name of the block.
Returns
The scale of the block.

Definition at line 28 of file ParameterProvider.cpp.

◆ operator()() [1/2]

scalar_t ParameterProvider::operator() ( const ParamId pid,
DataType  d_type = DataType::VALUE 
) const

Retrieves a parameter value based on ParamId and requested data type.

The ParamId fully encodes the parameter type, block, and LHA identifier.

Parameters
pidThe parameter ID.
d_typeType of data requested (central value, stat error, syst error, etc.).
Returns
The requested scalar value.

Definition at line 3 of file ParameterProvider.cpp.

◆ operator()() [2/2]

scalar_t ParameterProvider::operator() ( const std::string &  block,
const LhaID id,
DataType  d_type = DataType::VALUE 
) const

Retrieves a parameter value based on block name and LHA ID.

This overload requires the ParameterProvider to have been constructed with a specific ParameterType. The internal type is then combined with the (block, id) to build a temporary ParamId.

Parameters
blockThe name of the parameter block.
idThe LHA ID of the parameter.
d_typeType of data requested (central value, stat error, syst error, etc.).
Returns
The requested scalar value.

Definition at line 11 of file ParameterProvider.cpp.


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