Hyperiso 1.0.3
Modular flavour-physics calculations, Wilson coefficients and statistical inference
Loading...
Searching...
No Matches
GeneralNumModelModifier.cpp
Go to the documentation of this file.
2
3void GeneralNumModelModifier::modify(std::ifstream& inputFile, std::ofstream& outputFile) {
4 modelWriter.writeModel(inputFile, outputFile);
5}
6
7void GeneralNumModelModifier::createparamfile(std::ofstream& paramFile, const std::unordered_map<std::string, double> &params) {
8 modelWriter.writeParam(paramFile, params);
9}
10
11void GeneralNumModelModifier::initializeParams() {
12 std::string filename = FileNameManager::getInstance(wilson, model)->getNumParamFileName();
13
14 auto extractedParams = Extractor::extract(filename);
15 this->interpreted_params = interpreter.interpret(extractedParams);
16
17 for (const auto& [name, interpreted] : this->interpreted_params) {
18 auto map_param = paramSetter->setParam(name, interpreted);
19 for (const auto& [param_name, param_value] : map_param) {
20 params[param_name] = param_value;
21 }
22 }
23 }
Declares the helper used to prepare numeric MARTY models and parameter files.
std::string param_name(const ParamId &pid)
static std::vector< Parameter > extract(const std::string &filename)
Extracts all parameter declarations from a given C++ file.
Definition Extractor.cpp:3
static std::shared_ptr< FileNameManager > getInstance(const std::string &wilson="", const std::string &model="")
Retrieves a FileNameManager for a given (wilson, model) pair.
void createparamfile(std::ofstream &paramFile, const std::unordered_map< std::string, double > &params)
Writes the parameter CSV/param file.
void modify(std::ifstream &inputFile, std::ofstream &outputFile)
Applies the numeric model transformation to a template file.
std::unordered_map< std::string, InterpretedParam > interpret(std::vector< Extractor::Parameter > &params)
Interprets a set of extracted parameters.
void writeParam(std::ofstream &paramFile, const std::unordered_map< std::string, double > &params)
Writes parameters to the parameter file.
void writeModel(std::ifstream &inputFile, std::ofstream &outputFile)
Processes the model source and writes the transformed file.