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

Composite identifier for a single parameter. More...

#include <ParamID.h>

Collaboration diagram for ParamId:

Public Member Functions

 ParamId ()
 Default constructor.
 
 ParamId (const BlockName &block, const LhaID &code)
 Constructs a ParamId from a block name and an index.
 
 ParamId (ParameterType type, const BlockName &block, const LhaID &code)
 Constructs a ParamId from a type, block name and index.
 
void set_parameter_type (ParameterType type)
 Sets or overwrites the parameter type.
 
bool friend operator== (const ParamId &lhs, const ParamId &rhs)
 Equality comparison between two ParamId objects.
 
bool operator< (const ParamId &other) const
 Strict ordering operator for ParamId.
 

Public Attributes

std::optional< ParameterTypetype
 Optional high-level parameter category.
 
BlockName block
 Name of the block where the parameter is stored.
 
LhaID code
 Index or multi-index of the parameter inside the block.
 

Detailed Description

Composite identifier for a single parameter.

ParamId ties together three pieces of information:

  • type : semantic category of the parameter (SM, FLAVOR, DECAY, ...),
  • block : SLHA/LHA block name (with alias support),
  • code : index or multi-index inside the block (e.g. PDG code, (i,j), ...).

This allows one to uniquely reference a given entry in a parameter file or internal parameter store. The type field is optional; for some use cases only the (block, code) pair is relevant.

Comparison operators (== and <) are defined so that ParamId can be used as a key in ordered containers. A hash specialization is also provided to enable its use in unordered containers.

Examples
data_provider_example.cpp, examples/dependency_management_example.cpp, examples/freezer_example.cpp, and param_mutation_example.cpp.

Definition at line 57 of file ParamID.h.

Constructor & Destructor Documentation

◆ ParamId() [1/3]

ParamId::ParamId ( )

Default constructor.

Initializes a "null" parameter identifier with:

  • type unset,
  • block set to "NULL",
  • code set to 0.

This can be used as a sentinel value.

Definition at line 4 of file ParamID.cpp.

◆ ParamId() [2/3]

ParamId::ParamId ( const BlockName block,
const LhaID code 
)

Constructs a ParamId from a block name and an index.

The parameter type remains unset (std::nullopt). This is useful when the (block, code) pair is sufficient to identify the parameter.

Parameters
blockBlock to which the parameter belongs.
codeIndex or multi-index within the block.

Definition at line 5 of file ParamID.cpp.

◆ ParamId() [3/3]

ParamId::ParamId ( ParameterType  type,
const BlockName block,
const LhaID code 
)

Constructs a ParamId from a type, block name and index.

This constructor sets all three fields explicitly, providing the most detailed identification of the parameter.

Parameters
typeHigh-level parameter category.
blockBlock to which the parameter belongs.
codeIndex or multi-index within the block.

Definition at line 6 of file ParamID.cpp.

Member Function Documentation

◆ operator<()

bool ParamId::operator< ( const ParamId other) const

Strict ordering operator for ParamId.

The ordering is defined lexicographically on (type, block, code):

This allows ParamId to be used as a key in ordered containers such as std::map or std::set.

Parameters
otherRight-hand side.
Returns
true if *this is lexicographically smaller than other.

Definition at line 14 of file ParamID.cpp.

◆ operator==()

bool friend ParamId::operator== ( const ParamId lhs,
const ParamId rhs 
)

Equality comparison between two ParamId objects.

Two ParamId objects are equal if and only if all three components (type, block, code) are equal. For the type field, equality of std::optional<ParameterType> is used, so both must either be unset or hold the same value.

Parameters
lhsLeft-hand side.
rhsRight-hand side.
Returns
true if the identifiers are identical, false otherwise.

◆ set_parameter_type()

void ParamId::set_parameter_type ( ParameterType  type)

Sets or overwrites the parameter type.

This can be useful when constructing a ParamId in several steps or when inferring the parameter type after the fact.

Parameters
typeNew parameter type to assign.

Definition at line 8 of file ParamID.cpp.

Member Data Documentation

◆ block

BlockName ParamId::block

Name of the block where the parameter is stored.

This is typically an SLHA/LHA block name, possibly with aliases (e.g. "SMINPUTS", "MASS", "DECAY", "FMASS", ...).

Definition at line 73 of file ParamID.h.

◆ code

LhaID ParamId::code

Index or multi-index of the parameter inside the block.

This is represented by an LhaID, allowing both simple indices (e.g. PDG codes) and multi-dimensional indices (i,j,...) to be encoded in a uniform way.

Definition at line 82 of file ParamID.h.

◆ type

std::optional<ParameterType> ParamId::type

Optional high-level parameter category.

This can be used to distinguish between, e.g. SM, flavor, decay or Wilson parameter types (see ParameterType enum). If not set, only the block and code fields are considered.

Definition at line 65 of file ParamID.h.


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