|
Hyperiso 1.0.3
Modular flavour-physics calculations, Wilson coefficients and statistical inference
|
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< Parameter > | get_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_t > | get_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< BlockName > | get_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 ¶m_id, ParameterMode new_mode) |
| Changes the mode of one parameter. | |
| void | shiftParameter (const ParamId ¶m_id, scalar_t shift_value) |
| Applies an additive shift to a parameter by rewriting its value. | |
| std::unordered_set< BlockName > | init_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< BlockAccessor > | get_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< Parameters > | GetInstance (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. | |
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:
Instances are obtained through GetInstance and are managed through ParametersFactory, effectively giving one repository per ParameterType.
Definition at line 351 of file Parameters.h.
|
inline |
Destructor.
Only logs destruction in the current implementation.
Definition at line 660 of file Parameters.h.
| void Parameters::changeParameterMode | ( | const ParamId & | param_id, |
| ParameterMode | new_mode | ||
| ) |
Changes the mode of one parameter.
.cpp (the method body is effectively a no-op).| param_id | Parameter identifier. |
| new_mode | New parameter mode. |
Definition at line 513 of file Parameters.cpp.
| void Parameters::CleanupInstance | ( | ParameterType | id = ParameterType::SM | ) |
Removes one repository instance from the factory cache.
This is a thin wrapper around ParametersFactory::removeParameters.
| id | Parameter namespace to remove. |
Definition at line 25 of file Parameters.cpp.
| void Parameters::detach_block | ( | const BlockName & | blockName | ) |
Detaches one dependent block from its upstream dependency graph.
Delegates to BlockAccessor::detach_block(...).
| blockName | Block to detach. |
Definition at line 182 of file Parameters.cpp.
Detaches one dependent parameter from its upstream dependencies.
Delegates to BlockAccessor::detach_parameter(...).
Definition at line 190 of file Parameters.cpp.
Checks whether a parameter exists in a given block.
Current implementation:
Block::contains(id).Definition at line 52 of file Parameters.cpp.
| void Parameters::freeze_block | ( | const BlockName & | blockName | ) |
Freezes one whole block.
Delegates to Block::freeze() after checking existence.
| blockName | Block to freeze. |
Definition at line 153 of file Parameters.cpp.
Freezes one parameter inside a block.
Definition at line 166 of file Parameters.cpp.
| 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.
| blockName | Block name or alias to inspect. |
| std::invalid_argument | if the block cannot be resolved. |
Definition at line 90 of file Parameters.cpp.
| 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.
| blockName | Block name or alias to inspect. |
| std::invalid_argument | if the block cannot be resolved. |
Definition at line 86 of file Parameters.cpp.
|
inline |
Returns the underlying block accessor.
This is mainly intended for advanced / optimization-oriented workflows.
Definition at line 632 of file Parameters.h.
Returns all scalar values stored in one block.
| blockName | Block name. |
Definition at line 61 of file Parameters.cpp.
| double Parameters::get_block_scale | ( | BlockName | blockName | ) | const |
Returns the scale attached to a block.
This directly delegates to Block::get_scale().
| blockName | Block name. |
| If | the block does not exist or the block has no scale set. |
Definition at line 65 of file Parameters.cpp.
| std::unordered_set< BlockName > Parameters::get_blocks_list | ( | ) |
Returns the list of blocks currently held in this repository.
Definition at line 69 of file Parameters.cpp.
| 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.
| blockName | Block name or alias to inspect. |
| std::invalid_argument | if the block cannot be resolved. |
Definition at line 82 of file Parameters.cpp.
Returns the full Parameter object for one entry.
Definition at line 47 of file Parameters.cpp.
| 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.
| blockName | Block name or alias to inspect. |
| std::invalid_argument | if the block cannot be resolved. |
Definition at line 78 of file Parameters.cpp.
|
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.
| id | Parameter namespace to retrieve (default: SM). |
| Via | logging/error handling if the parameter type is not allowed by the current memory cache. |
Definition at line 11 of file Parameters.cpp.
| std::unordered_set< BlockName > Parameters::init_blocks | ( | ParameterType | type | ) |
Loads the raw blocks for one parameter namespace from MemoryManager.
This method:
ParameterBlockRepartition::BLOCKS against the input cache,MemoryManager::extract_blocks(...),| type | Parameter namespace being initialized. |
Definition at line 106 of file Parameters.cpp.
| 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.
| blockName | Block name or alias to inspect. |
| std::invalid_argument | if the block cannot be resolved. |
Definition at line 74 of file Parameters.cpp.
Reads the current scalar value of a parameter.
This is a convenience wrapper over the underlying BlockAccessor.
Definition at line 43 of file Parameters.cpp.
| 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.
| blockname | Name of the block to print. |
Definition at line 594 of file Parameters.cpp.
| void Parameters::reattach_block | ( | const BlockName & | blockName | ) |
Reattaches one previously detached dependent block.
Delegates to BlockAccessor::reattach_block(...).
| blockName | Block to reattach. |
Definition at line 186 of file Parameters.cpp.
Reattaches one previously detached dependent parameter.
Delegates to BlockAccessor::reattach_parameter(...).
Definition at line 194 of file Parameters.cpp.
Sets or creates a scalar value inside a block.
Delegates to BlockAccessor::setValue(...).
Definition at line 57 of file Parameters.cpp.
Applies an additive shift to a parameter by rewriting its value.
Current implementation simply does:
through the accessor, rather than using Parameter::set_shift().
| param_id | Parameter identifier. |
| shift_value | Additive shift. |
Definition at line 518 of file Parameters.cpp.
| void Parameters::unfreeze_block | ( | const BlockName & | blockName | ) |
Freezes one whole block.
Delegates to Block::freeze() after checking existence.
| blockName | Block to freeze. |
Definition at line 162 of file Parameters.cpp.
Unfreezes one parameter inside a block.
Definition at line 178 of file Parameters.cpp.
|
friend |
Factory is allowed to construct/remove repositories.
Definition at line 688 of file Parameters.h.
|
friend |
Stream output operator for the whole repository.
Prints the underlying BlockAccessor.
| os | Output stream. |
| instance | Repository instance to print. |
Definition at line 198 of file Parameters.cpp.
|
friend |
Underlying storage/access layer for all parameter blocks.
Factory friend.
Definition at line 687 of file Parameters.h.