|
Hyperiso 1.0.3
Modular flavour-physics calculations, Wilson coefficients and statistical inference
|
Singleton class responsible for initializing and managing memory, input files, and parameter blocks. More...
#include <MemoryManager.h>
Public Member Functions | |
| void | set_paths_provider (std::shared_ptr< IPathsProvider > paths_provider_) |
| Replaces the filesystem path provider used by the manager. | |
| fs::path | get_path (APIPath path_name) |
| Retrieves a public API path from the runtime cache or path provider. | |
| void | init (const std::string &lhaFile, HyperisoConfig config) |
| Initializes the memory manager with the provided LHA file and configuration. | |
| void | add_lha_prototype (BlockName blockName, size_t itemCount=2, size_t valueIdx=1, int scaleIdx=-1, int rgIdx=-1, int binIdx=-1, bool globalScale=false) |
| Registers an additional LHA block prototype before LHA parsing. | |
| void | add_lha_prototypes (const std::vector< LhaPrototypeSpec > &prototypes) |
| Registers several additional LHA block prototypes through the injected port. | |
| void | switch_lha (const std::string &lhaFile, HyperisoConfig config) |
| Registers several additional LHA block prototypes. | |
| void | reload_user_input (HyperisoConfig config) |
| Reloads user-specific input files. | |
| void | reload_user_input (const std::string &lhaFile, HyperisoConfig config) |
| Reloads user-specific input files with a different LHA file. | |
| void | switch_model (Model model=Model::SM) |
| Switches the model used for spectrum and parameters. | |
| const MemoryCache & | getMemoryCache () |
| Retrieves the current memory cache. | |
| bool | is_ready () const |
| Returns whether MemoryManager has already completed init(). | |
| std::shared_ptr< BlockAccessor > | extract_blocks (std::unordered_set< BlockName > block_names) |
| Extracts specific blocks from the cached input. | |
| std::shared_ptr< BlockAccessor > | extract_block_accessor () |
| Extracts all blocks from the cached input. | |
| std::shared_ptr< BlockAccessor > | clone_input_cache_deep () const |
| Deep-clones the raw input cache as independent plain blocks. | |
| const CorrelationRepository & | get_correlation_repository () |
| Retrieves the current correlation repository. | |
| std::unordered_set< ParamId > | get_all_source_parameters (const std::unordered_set< ParamId > ¶m_ids) const |
| Computes all ultimate "source" parameters for a given set of parameter IDs. | |
| MemoryManager (const MemoryManager &)=delete | |
| MemoryManager & | operator= (const MemoryManager &)=delete |
| MemoryManager (MemoryManager &&) noexcept=default | |
| MemoryManager & | operator= (MemoryManager &&) noexcept=default |
Static Public Member Functions | |
| static MemoryManager * | GetInstance () |
| Retrieves the singleton instance of MemoryManager. | |
| static MemoryManager * | Create (std::shared_ptr< IDataLoader< BlockAccessor > > loader, std::shared_ptr< IDataLoader< CorrelationMatrixPair< ParamId > > > param_corr, std::shared_ptr< IDataLoader< CorrelationMatrixPair< ExperimentObs > > > obs_corr, std::shared_ptr< ISpectrumCalculator > spectrum_c, std::shared_ptr< IPathsProvider > paths_provider, std::shared_ptr< ILhaPrototypeRegistry > lha_prototype_registry=nullptr) |
| Retrieves/creates the singleton instance of MemoryManager with injected dependencies. | |
Friends | |
| class | Parameters |
Singleton class responsible for initializing and managing memory, input files, and parameter blocks.
MemoryManager must be initialized first in a script or application that uses parameters.
Definition at line 67 of file MemoryManager.h.
|
delete |
|
defaultnoexcept |
| void MemoryManager::add_lha_prototype | ( | BlockName | blockName, |
| size_t | itemCount = 2, |
||
| size_t | valueIdx = 1, |
||
| int | scaleIdx = -1, |
||
| int | rgIdx = -1, |
||
| int | binIdx = -1, |
||
| bool | globalScale = false |
||
| ) |
Registers an additional LHA block prototype before LHA parsing.
The prototype is stored by MemoryManager and also forwarded to the ParamBlockLoader when that concrete loader is available.
Definition at line 265 of file MemoryManager.cpp.
| void MemoryManager::add_lha_prototypes | ( | const std::vector< LhaPrototypeSpec > & | prototypes | ) |
Registers several additional LHA block prototypes through the injected port.
Definition at line 293 of file MemoryManager.cpp.
| std::shared_ptr< BlockAccessor > MemoryManager::clone_input_cache_deep | ( | ) | const |
Deep-clones the raw input cache as independent plain blocks.
This is used by per-thread runtime contexts so parameter mutations in one worker cannot affect the global cache or another worker.
Definition at line 54 of file MemoryManager.cpp.
|
static |
Retrieves/creates the singleton instance of MemoryManager with injected dependencies.
Intended to be used by adapters/factories that wire loaders, spectrum calculator and path providers.
Definition at line 183 of file MemoryManager.cpp.
| std::shared_ptr< BlockAccessor > MemoryManager::extract_block_accessor | ( | ) |
Extracts all blocks from the cached input.
Definition at line 22 of file MemoryManager.cpp.
| std::shared_ptr< BlockAccessor > MemoryManager::extract_blocks | ( | std::unordered_set< BlockName > | block_names | ) |
Extracts specific blocks from the cached input.
| block_names | Set of block names to extract. |
Definition at line 18 of file MemoryManager.cpp.
| std::unordered_set< ParamId > MemoryManager::get_all_source_parameters | ( | const std::unordered_set< ParamId > & | param_ids | ) | const |
Computes all ultimate "source" parameters for a given set of parameter IDs.
This walks through dependent parameters and dependent blocks to find leaf sources.
| param_ids | Set of parameter IDs to analyze. |
Definition at line 396 of file MemoryManager.cpp.
| const CorrelationRepository & MemoryManager::get_correlation_repository | ( | ) |
Retrieves the current correlation repository.
Definition at line 61 of file MemoryManager.cpp.
| fs::path MemoryManager::get_path | ( | APIPath | path_name | ) |
Retrieves a public API path from the runtime cache or path provider.
LHA_PATH comes from the current MemoryCache. All other paths are delegated to the active IPathsProvider.
| path_name | Public path identifier. |
Definition at line 211 of file MemoryManager.cpp.
|
static |
Retrieves the singleton instance of MemoryManager.
Definition at line 157 of file MemoryManager.cpp.
|
inline |
Retrieves the current memory cache.
Definition at line 276 of file MemoryManager.h.
| void MemoryManager::init | ( | const std::string & | lhaFile, |
| HyperisoConfig | config | ||
| ) |
Initializes the memory manager with the provided LHA file and configuration.
Must be called before using any Parameters instances.
| lhaFile | Path to the input LHA file. |
| config | Configuration settings to use. |
Definition at line 306 of file MemoryManager.cpp.
|
inline |
Returns whether MemoryManager has already completed init().
Definition at line 281 of file MemoryManager.h.
|
delete |
|
defaultnoexcept |
| void MemoryManager::reload_user_input | ( | const std::string & | lhaFile, |
| HyperisoConfig | config | ||
| ) |
Reloads user-specific input files with a different LHA file.
| lhaFile | Path to the LHA file. |
| config | New configuration to apply. |
Definition at line 356 of file MemoryManager.cpp.
| void MemoryManager::reload_user_input | ( | HyperisoConfig | config | ) |
Reloads user-specific input files.
Useful for reapplying user customizations without changing the LHA file.
| config | New configuration to apply. |
Definition at line 352 of file MemoryManager.cpp.
| void MemoryManager::set_paths_provider | ( | std::shared_ptr< IPathsProvider > | paths_provider_ | ) |
Replaces the filesystem path provider used by the manager.
Intended for pre-init customization through HyperisoMaster. If called after init(), it only affects future reload/switch operations that read paths again.
| paths_provider_ | New provider to use for all IPathsProvider-backed paths. |
Definition at line 198 of file MemoryManager.cpp.
| void MemoryManager::switch_lha | ( | const std::string & | lhaFile, |
| HyperisoConfig | config | ||
| ) |
Registers several additional LHA block prototypes.
Switches to a different LHA file, reloading associated parameters and spectrum.
| lhaFile | Path to the new LHA file. |
| config | New configuration to apply. |
Definition at line 339 of file MemoryManager.cpp.
Switches the model used for spectrum and parameters.
Must be compatible with the loaded LHA file.
| model | The new model to switch to (default is SM). |
Definition at line 389 of file MemoryManager.cpp.
|
friend |
Definition at line 327 of file MemoryManager.h.