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

Block-based parameter repository for one ParameterType namespace. More...

#include <Parameters.h>

Public Member Functions

void CleanupInstance (ParameterType id=ParameterType::SM)
 Removes one repository instance from the factory cache.
 
bool exist (const BlockName &block, LhaID pdgCode)
 Checks whether a parameter exists in a given block.
 
scalar_t operator() (const BlockName &block, LhaID pdgCode) const
 Reads the current scalar value of a parameter.
 
std::shared_ptr< Parameterget_parameter (const BlockName &block, LhaID pdgCode)
 Returns the full Parameter object for one entry.
 
void setBlockValue (const BlockName &name, LhaID pdgCode, scalar_t value)
 Sets or creates a scalar value inside a block.
 
std::map< LhaID, scalar_tget_block_infos (BlockName blockName)
 Returns all scalar values stored in one block.
 
double get_block_scale (BlockName blockName) const
 Returns the scale attached to a block.
 
std::unordered_set< BlockNameget_blocks_list ()
 Returns the list of blocks currently held in this repository.
 
bool is_dependent_block (const BlockName &blockName) const
 Checks whether one block is a dependent block.
 
std::vector< std::string > get_source_blocks (const BlockName &blockName) const
 Returns the direct source blocks of one block.
 
std::vector< std::string > get_dependent_blocks (const BlockName &blockName) const
 Returns the direct blocks depending on one block.
 
std::vector< std::string > get_all_source_blocks (const BlockName &blockName) const
 Returns all transitive source blocks of one block.
 
std::vector< std::string > get_all_dependent_blocks (const BlockName &blockName) const
 Returns all transitive blocks depending on one block.
 
void changeParameterMode (const ParamId &param_id, ParameterMode new_mode)
 Changes the mode of one parameter.
 
void shiftParameter (const ParamId &param_id, scalar_t shift_value)
 Applies an additive shift to a parameter by rewriting its value.
 
std::unordered_set< BlockNameinit_blocks (ParameterType type)
 Loads the raw blocks for one parameter namespace from MemoryManager.
 
void freeze_block (const BlockName &blockName)
 Freezes one whole block.
 
void unfreeze_block (const BlockName &blockName)
 Freezes one whole block.
 
void freeze_param (const BlockName &blockName, const LhaID &id)
 Freezes one parameter inside a block.
 
void unfreeze_param (const BlockName &blockName, const LhaID &id)
 Unfreezes one parameter inside a block.
 
void detach_block (const BlockName &blockName)
 Detaches one dependent block from its upstream dependency graph.
 
void reattach_block (const BlockName &blockName)
 Reattaches one previously detached dependent block.
 
void detach_param (const BlockName &blockName, const LhaID &id)
 Detaches one dependent parameter from its upstream dependencies.
 
void reattach_param (const BlockName &blockName, const LhaID &id)
 Reattaches one previously detached dependent parameter.
 
std::shared_ptr< BlockAccessorget_block_accessor ()
 Returns the underlying block accessor.
 
void print_block (const std::string blockname)
 Prints one block to stdout.
 
 ~Parameters ()
 Destructor.
 

Static Public Member Functions

static std::shared_ptr< ParametersGetInstance (ParameterType id=ParameterType::SM)
 Returns the singleton-like repository for a given parameter type.
 

Friends

class ParametersFactory
 Underlying storage/access layer for all parameter blocks.
 
class DependentBlockManager
 Factory is allowed to construct/remove repositories.
 
std::ostream & operator<< (std::ostream &, std::shared_ptr< Parameters >)
 Stream output operator for the whole repository.
 

Detailed Description

Block-based parameter repository for one ParameterType namespace.

A Parameters instance owns the complete block set for one parameter domain (SM, BSM, FLAVOR, WILSON, ...), together with the strategy that initialized it.

Responsibilities include:

  • accessing scalar values and full Parameter objects,
  • mutating values,
  • freezing/unfreezing blocks and parameters,
  • detaching/reattaching dependencies,
  • listing blocks,
  • exposing the underlying BlockAccessor for advanced workflows.

Instances are obtained through GetInstance and are managed through ParametersFactory, effectively giving one repository per ParameterType.

Definition at line 351 of file Parameters.h.

Constructor & Destructor Documentation

◆ ~Parameters()

Parameters::~Parameters ( )
inline

Destructor.

Only logs destruction in the current implementation.

Definition at line 660 of file Parameters.h.

Member Function Documentation

◆ changeParameterMode()

void Parameters::changeParameterMode ( const ParamId param_id,
ParameterMode  new_mode 
)

Changes the mode of one parameter.

Warning
This is currently not implemented in the provided .cpp (the method body is effectively a no-op).
Parameters
param_idParameter identifier.
new_modeNew parameter mode.

Definition at line 513 of file Parameters.cpp.

◆ CleanupInstance()

void Parameters::CleanupInstance ( ParameterType  id = ParameterType::SM)

Removes one repository instance from the factory cache.

This is a thin wrapper around ParametersFactory::removeParameters.

Parameters
idParameter namespace to remove.

Definition at line 25 of file Parameters.cpp.

◆ detach_block()

void Parameters::detach_block ( const BlockName blockName)

Detaches one dependent block from its upstream dependency graph.

Delegates to BlockAccessor::detach_block(...).

Parameters
blockNameBlock to detach.

Definition at line 182 of file Parameters.cpp.

◆ detach_param()

void Parameters::detach_param ( const BlockName blockName,
const LhaID id 
)

Detaches one dependent parameter from its upstream dependencies.

Delegates to BlockAccessor::detach_parameter(...).

Parameters
blockNameBlock containing the parameter.
idParameter identifier.

Definition at line 190 of file Parameters.cpp.

◆ exist()

bool Parameters::exist ( const BlockName block,
LhaID  pdgCode 
)

Checks whether a parameter exists in a given block.

Current implementation:

  • returns false if the block does not exist,
  • otherwise delegates to Block::contains(id).
Parameters
blockBlock name.
pdgCodeParameter identifier inside the block.
Returns
True if the parameter exists, false otherwise.

Definition at line 52 of file Parameters.cpp.

◆ freeze_block()

void Parameters::freeze_block ( const BlockName blockName)

Freezes one whole block.

Delegates to Block::freeze() after checking existence.

Parameters
blockNameBlock to freeze.

Definition at line 153 of file Parameters.cpp.

◆ freeze_param()

void Parameters::freeze_param ( const BlockName blockName,
const LhaID id 
)

Freezes one parameter inside a block.

Parameters
blockNameBlock containing the parameter.
idParameter identifier.

Definition at line 166 of file Parameters.cpp.

◆ get_all_dependent_blocks()

std::vector< std::string > Parameters::get_all_dependent_blocks ( const BlockName blockName) const

Returns all transitive blocks depending on one block.

This recursively walks downstream through block observers.

Parameters
blockNameBlock name or alias to inspect.
Returns
Sorted list of all downstream/dependent block names.
Exceptions
std::invalid_argumentif the block cannot be resolved.

Definition at line 90 of file Parameters.cpp.

◆ get_all_source_blocks()

std::vector< std::string > Parameters::get_all_source_blocks ( const BlockName blockName) const

Returns all transitive source blocks of one block.

This recursively walks upstream through dependent-block source links.

Parameters
blockNameBlock name or alias to inspect.
Returns
Sorted list of all upstream/source block names.
Exceptions
std::invalid_argumentif the block cannot be resolved.

Definition at line 86 of file Parameters.cpp.

◆ get_block_accessor()

std::shared_ptr< BlockAccessor > Parameters::get_block_accessor ( )
inline

Returns the underlying block accessor.

This is mainly intended for advanced / optimization-oriented workflows.

Returns
Shared pointer to the block accessor.

Definition at line 632 of file Parameters.h.

◆ get_block_infos()

std::map< LhaID, scalar_t > Parameters::get_block_infos ( BlockName  blockName)

Returns all scalar values stored in one block.

Parameters
blockNameBlock name.
Returns
Map of LhaID -> scalar_t.

Definition at line 61 of file Parameters.cpp.

◆ get_block_scale()

double Parameters::get_block_scale ( BlockName  blockName) const

Returns the scale attached to a block.

This directly delegates to Block::get_scale().

Parameters
blockNameBlock name.
Returns
Block scale.
Exceptions
Ifthe block does not exist or the block has no scale set.

Definition at line 65 of file Parameters.cpp.

◆ get_blocks_list()

std::unordered_set< BlockName > Parameters::get_blocks_list ( )

Returns the list of blocks currently held in this repository.

Returns
Set of block names.

Definition at line 69 of file Parameters.cpp.

◆ get_dependent_blocks()

std::vector< std::string > Parameters::get_dependent_blocks ( const BlockName blockName) const

Returns the direct blocks depending on one block.

This follows direct block observers and is the downstream counterpart of get_source_blocks.

Parameters
blockNameBlock name or alias to inspect.
Returns
Sorted list of direct downstream/dependent block names.
Exceptions
std::invalid_argumentif the block cannot be resolved.

Definition at line 82 of file Parameters.cpp.

◆ get_parameter()

std::shared_ptr< Parameter > Parameters::get_parameter ( const BlockName block,
LhaID  pdgCode 
)

Returns the full Parameter object for one entry.

Parameters
blockBlock name.
pdgCodeParameter identifier.
Returns
Shared pointer to the stored parameter.

Definition at line 47 of file Parameters.cpp.

◆ get_source_blocks()

std::vector< std::string > Parameters::get_source_blocks ( const BlockName blockName) const

Returns the direct source blocks of one block.

Direct source blocks are the upstream blocks immediately used by the inspected block. Plain blocks return an empty list.

Parameters
blockNameBlock name or alias to inspect.
Returns
Sorted list of direct upstream/source block names.
Exceptions
std::invalid_argumentif the block cannot be resolved.

Definition at line 78 of file Parameters.cpp.

◆ GetInstance()

std::shared_ptr< Parameters > Parameters::GetInstance ( ParameterType  id = ParameterType::SM)
static

Returns the singleton-like repository for a given parameter type.

This first checks whether the requested parameter type is enabled in the current MemoryManager cache, then delegates creation/retrieval to ParametersFactory.

Parameters
idParameter namespace to retrieve (default: SM).
Returns
Shared pointer to the repository.
Exceptions
Vialogging/error handling if the parameter type is not allowed by the current memory cache.
Examples
examples/dependency_management_example.cpp.

Definition at line 11 of file Parameters.cpp.

◆ init_blocks()

std::unordered_set< BlockName > Parameters::init_blocks ( ParameterType  type)

Loads the raw blocks for one parameter namespace from MemoryManager.

This method:

  • compares the expected blocks from ParameterBlockRepartition::BLOCKS against the input cache,
  • separates present and missing blocks,
  • applies a few policy adjustments (e.g. FWCOEF handling),
  • extracts the present blocks through MemoryManager::extract_blocks(...),
  • tags all extracted parameters with the correct owner type.
Parameters
typeParameter namespace being initialized.
Returns
Set of missing blocks.

Definition at line 106 of file Parameters.cpp.

◆ is_dependent_block()

bool Parameters::is_dependent_block ( const BlockName blockName) const

Checks whether one block is a dependent block.

This delegates to BlockAccessor::is_dependent_block on the repository owned by this Parameters instance.

Parameters
blockNameBlock name or alias to inspect.
Returns
True if the block is a DependentBlock, false otherwise.
Exceptions
std::invalid_argumentif the block cannot be resolved.

Definition at line 74 of file Parameters.cpp.

◆ operator()()

scalar_t Parameters::operator() ( const BlockName block,
LhaID  pdgCode 
) const

Reads the current scalar value of a parameter.

This is a convenience wrapper over the underlying BlockAccessor.

Parameters
blockBlock name.
pdgCodeParameter identifier.
Returns
Current scalar value.

Definition at line 43 of file Parameters.cpp.

◆ print_block()

void Parameters::print_block ( const std::string  blockname)

Prints one block to stdout.

Internally streams the block object resolved by name through the block accessor.

Parameters
blocknameName of the block to print.

Definition at line 594 of file Parameters.cpp.

◆ reattach_block()

void Parameters::reattach_block ( const BlockName blockName)

Reattaches one previously detached dependent block.

Delegates to BlockAccessor::reattach_block(...).

Parameters
blockNameBlock to reattach.

Definition at line 186 of file Parameters.cpp.

◆ reattach_param()

void Parameters::reattach_param ( const BlockName blockName,
const LhaID id 
)

Reattaches one previously detached dependent parameter.

Delegates to BlockAccessor::reattach_parameter(...).

Parameters
blockNameBlock containing the parameter.
idParameter identifier.

Definition at line 194 of file Parameters.cpp.

◆ setBlockValue()

void Parameters::setBlockValue ( const BlockName name,
LhaID  pdgCode,
scalar_t  value 
)

Sets or creates a scalar value inside a block.

Delegates to BlockAccessor::setValue(...).

Parameters
nameBlock name.
pdgCodeParameter identifier.
valueValue to set.

Definition at line 57 of file Parameters.cpp.

◆ shiftParameter()

void Parameters::shiftParameter ( const ParamId param_id,
scalar_t  shift_value 
)

Applies an additive shift to a parameter by rewriting its value.

Current implementation simply does:

value <- current_value + shift_value

through the accessor, rather than using Parameter::set_shift().

Parameters
param_idParameter identifier.
shift_valueAdditive shift.

Definition at line 518 of file Parameters.cpp.

◆ unfreeze_block()

void Parameters::unfreeze_block ( const BlockName blockName)

Freezes one whole block.

Delegates to Block::freeze() after checking existence.

Parameters
blockNameBlock to freeze.

Definition at line 162 of file Parameters.cpp.

◆ unfreeze_param()

void Parameters::unfreeze_param ( const BlockName blockName,
const LhaID id 
)

Unfreezes one parameter inside a block.

Parameters
blockNameBlock containing the parameter.
idParameter identifier.

Definition at line 178 of file Parameters.cpp.

Friends And Related Symbol Documentation

◆ DependentBlockManager

friend class DependentBlockManager
friend

Factory is allowed to construct/remove repositories.

Definition at line 688 of file Parameters.h.

◆ operator<<

std::ostream & operator<< ( std::ostream &  os,
std::shared_ptr< Parameters instance 
)
friend

Stream output operator for the whole repository.

Prints the underlying BlockAccessor.

Parameters
osOutput stream.
instanceRepository instance to print.
Returns
Output stream.

Definition at line 198 of file Parameters.cpp.

◆ ParametersFactory

friend class ParametersFactory
friend

Underlying storage/access layer for all parameter blocks.

Factory friend.

Definition at line 687 of file Parameters.h.


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