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

High-level orchestrator for numeric MARTY model generation. More...

#include <GeneralNumModelModifier.h>

Public Member Functions

 GeneralNumModelModifier (const std::string &wilson, const std::string &model, std::unique_ptr< SMParamSetter > param_setter, std::shared_ptr< ICoreAPI< Model > > api, std::shared_ptr< IInterpreterPortsFactory > ports, bool force=false)
 Constructs a numeric model modifier for a given (Wilson, model) pair.
 
 GeneralNumModelModifier (const std::string &wilson, const std::string &model, const std::string &mapping_model, std::unique_ptr< SMParamSetter > param_setter, std::shared_ptr< ICoreAPI< Model > > api, std::shared_ptr< IInterpreterPortsFactory > ports, bool force=false, bool bsm_split_generation=false, bool full_target_generation=false)
 Constructs a numeric model modifier with distinct output and parameter-resolution models.
 
 GeneralNumModelModifier (const GeneralNumModelModifier &other)
 Copy constructor used to duplicate the whole modification pipeline.
 
void modify (std::ifstream &inputFile, std::ofstream &outputFile)
 Applies the numeric model transformation to a template file.
 
void createparamfile (std::ofstream &paramFile, const std::unordered_map< std::string, double > &params)
 Writes the parameter CSV/param file.
 
std::unordered_map< std::string, InterpretedParamget_interpreted_param_map ()
 Returns the interpreted parameter mapping.
 
std::unordered_map< std::string, double > get_params ()
 Returns the map of numerical parameter values.
 

Detailed Description

High-level orchestrator for numeric MARTY model generation.

GeneralNumModelModifier coordinates:

  • extraction of symbolic parameters from a numeric template (Extractor),
  • interpretation against mapping databases (Interpreter),
  • conversion into actual SM/BSM numerical values (SMParamSetter),
  • writing of the modified numeric C++ example and parameter CSV (ModelWriter).

It is dedicated to "numeric" templates that require a parameter file and CSV output for Wilson coefficients.

Definition at line 46 of file GeneralNumModelModifier.h.

Constructor & Destructor Documentation

◆ GeneralNumModelModifier() [1/3]

GeneralNumModelModifier::GeneralNumModelModifier ( const std::string &  wilson,
const std::string &  model,
std::unique_ptr< SMParamSetter param_setter,
std::shared_ptr< ICoreAPI< Model > >  api,
std::shared_ptr< IInterpreterPortsFactory ports,
bool  force = false 
)
inline

Constructs a numeric model modifier for a given (Wilson, model) pair.

Parameters
wilsonName of the Wilson basis (e.g. "C1").
modelName of the model (e.g. "SM", "THDM").
param_setterPreconfigured SMParamSetter, moved into this object.
apiCore API giving access to the active Model.
portsFactory used to build an IParameterResolver for the interpreter.
forceIf true, forces regeneration even when the output file appears to be already processed (marker //42).

Definition at line 84 of file GeneralNumModelModifier.h.

◆ GeneralNumModelModifier() [2/3]

GeneralNumModelModifier::GeneralNumModelModifier ( const std::string &  wilson,
const std::string &  model,
const std::string &  mapping_model,
std::unique_ptr< SMParamSetter param_setter,
std::shared_ptr< ICoreAPI< Model > >  api,
std::shared_ptr< IInterpreterPortsFactory ports,
bool  force = false,
bool  bsm_split_generation = false,
bool  full_target_generation = false 
)
inline

Constructs a numeric model modifier with distinct output and parameter-resolution models.

Parameters
modelOutput/cache label used for generated numeric files.
mapping_modelModel whose MARTY mapping should be used to resolve symbolic parameters extracted from the generated code.

Definition at line 101 of file GeneralNumModelModifier.h.

◆ GeneralNumModelModifier() [3/3]

GeneralNumModelModifier::GeneralNumModelModifier ( const GeneralNumModelModifier other)
inline

Copy constructor used to duplicate the whole modification pipeline.

Definition at line 126 of file GeneralNumModelModifier.h.

Member Function Documentation

◆ createparamfile()

void GeneralNumModelModifier::createparamfile ( std::ofstream &  paramFile,
const std::unordered_map< std::string, double > &  params 
)

Writes the parameter CSV/param file.

The given params map is passed to ModelWriter, which uses ParamWriter under the hood.

Parameters
paramFileOutput stream where the parameter file is written.
paramsMap from parameter name to value.

Definition at line 7 of file GeneralNumModelModifier.cpp.

◆ get_interpreted_param_map()

std::unordered_map< std::string, InterpretedParam > GeneralNumModelModifier::get_interpreted_param_map ( )
inline

Returns the interpreted parameter mapping.

Returns
Map from parameter name to InterpretedParam.

Definition at line 171 of file GeneralNumModelModifier.h.

◆ get_params()

std::unordered_map< std::string, double > GeneralNumModelModifier::get_params ( )
inline

Returns the map of numerical parameter values.

Returns
Map from parameter name to double value.

Definition at line 177 of file GeneralNumModelModifier.h.

◆ modify()

void GeneralNumModelModifier::modify ( std::ifstream &  inputFile,
std::ofstream &  outputFile 
)

Applies the numeric model transformation to a template file.

The input numeric example is read from inputFile, processed by ModelWriter (and ultimately LineProcessor), and written to outputFile.

Parameters
inputFileOpen input stream for the numeric template.
outputFileOpen output stream for the generated C++ file.

Definition at line 3 of file GeneralNumModelModifier.cpp.


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