Hyperiso 1.0.3
Modular flavour-physics calculations, Wilson coefficients and statistical inference
Loading...
Searching...
No Matches
BlockProvider.cpp
Go to the documentation of this file.
1#include "BlockProvider.h"
2
3bool BlockProvider::exists(const std::string& blockname, ParameterType pt) {
4 auto blocks_list = Parameters::GetInstance(pt)->get_blocks_list();
5 for (auto& elem: blocks_list) {
6 if (elem == blockname) {
7 return true;
8 }
9 }
10 return false;
11}
12
16
17void BlockProvider::log_block(ParameterType type, const std::string& blockname) {
18 Parameters::GetInstance(type)->print_block(blockname);
19}
20
21std::map<LhaID, scalar_t> BlockProvider::get_block(ParameterType type, const std::string& blockname) {
22 return Parameters::GetInstance(type)->get_block_infos(blockname);
23}
24
25std::unordered_set<std::string> BlockProvider::get_all_blocks(ParameterType type) {
26 auto blocks_list = Parameters::GetInstance(type)->get_blocks_list();
27 std::unordered_set<std::string> out;
28 for (auto& elem: blocks_list) {
29 out.insert(elem.to_string());
30 }
31 return out;
32}
Concrete implementation of IBlockProvider for HyperISO parameter blocks.
ParameterType
#define LOG_INFO(...)
Macro for logging informational messages.
Definition Logger.h:39
bool exists(const std::string &blockname, ParameterType) override
Checks whether a block exists for the given ParameterType.
std::unordered_set< std::string > get_all_blocks(ParameterType type) override
return all blocks for a given ParameterType.
void log_all_blocks(ParameterType type) override
Logs all blocks for a given ParameterType.
void log_block(ParameterType type, const std::string &blockname) override
Logs the content of a single block for a given ParameterType.
std::map< LhaID, scalar_t > get_block(ParameterType type, const std::string &blockname) override
Retrieve the content of a single block for a given ParameterType.
static std::shared_ptr< Parameters > GetInstance(ParameterType id=ParameterType::SM)
Returns the singleton-like repository for a given parameter type.