|
Hyperiso 1.0.3
Modular flavour-physics calculations, Wilson coefficients and statistical inference
|
High-level interface to MARTY-based code generation and execution. More...
#include <MartyInterface.h>
Public Member Functions | |
| MartyInterface (std::shared_ptr< ICoreAPI< Model > > core_api, std::shared_ptr< IMartyParameterProxy< std::string, LhaID > > sm_proxy, std::shared_ptr< IInterpreterPortsFactory > ports, std::shared_ptr< IMartyParameterProxy< std::string, LhaID > > bsm_proxy=nullptr) | |
| Constructs a MartyInterface with explicit dependencies. | |
| MartyInterface () | |
| Default constructor wiring default implementations. | |
| void | generate (std::string wilson, std::string model, std::string model_path) |
| Generates a non-numeric MARTY-powered C++ template. | |
| void | generate (std::string wilson, std::string output_model, std::string target_model, std::string model_path, bool sm_like_filter, bool bsm_split_generation=false, bool full_target_generation=false) |
| Generates code with a separate output label and target model. | |
| void | compile_run (std::string wilson, std::string model) |
| Compiles and runs the non-numeric generated code. | |
| void | generate_numlib (std::string wilson, std::string model) |
| Generates the numeric library wrapper for a given (Wilson, model) pair. | |
| void | generate_numlib (std::string wilson, std::string output_model, std::string target_model, bool bsm_split_generation=false, bool full_target_generation=false) |
| Generates the numeric wrapper while resolving parameters against a target model that may differ from the output/cache label. | |
| void | compile_run_libs (std::string wilson, std::string model, double Q_match) |
| Compiles and runs the numeric libraries. | |
| void | calculate (std::string wilson, std::string model, double Q_match, std::string model_path) |
| Convenience shortcut to generate, compile, and run the full pipeline. | |
| void | calculate (std::string wilson, std::string output_model, std::string target_model, double Q_match, std::string model_path, bool sm_like_filter, bool bsm_split_generation=false, bool full_target_generation=false) |
| Full pipeline with a separate output label and target model. | |
| std::string | calculate_isolated (std::string wilson, std::string output_model, std::string target_model, double Q_match, std::string model_path, bool sm_like_filter, bool bsm_split_generation=false, bool full_target_generation=false) |
| Thread-safe calculation using invocation-local parameter and CSV files. | |
| std::unordered_set< InterpretedParam > | get_dependencies (std::string wilson) |
| Retrieves the set of parameter dependencies for a given Wilson basis. | |
| std::set< std::string > | get_special_blocks () |
| Returns the special blocks handled with custom logic. | |
High-level interface to MARTY-based code generation and execution.
MartyInterface orchestrates the following steps:
It can be constructed either with explicit dependencies (core API, parameter proxies, interpreter ports) or using the default constructor, which wires default implementations together.
Definition at line 58 of file MartyInterface.h.
|
inline |
Constructs a MartyInterface with explicit dependencies.
| core_api | Shared pointer to the core API exposing the active Model. |
| sm_proxy | Proxy used to access SM parameters (blocks, LHA IDs). |
| ports | Factory used to build interpreter ports (resolvers, mapping adapters). |
| bsm_proxy | Optional proxy for BSM parameters; may be null if not needed. |
Definition at line 68 of file MartyInterface.h.
| MartyInterface::MartyInterface | ( | ) |
Default constructor wiring default implementations.
Internally:
Definition at line 244 of file MartyInterface.cpp.
| void MartyInterface::calculate | ( | std::string | wilson, |
| std::string | model, | ||
| double | Q_match, | ||
| std::string | model_path | ||
| ) |
Convenience shortcut to generate, compile, and run the full pipeline.
Orchestrates:
| wilson | Wilson basis name. |
| model | Model name. |
| Q_match | Matching scale for numeric libraries. |
| model_path | Path to the C++ model header. |
Definition at line 367 of file MartyInterface.cpp.
| void MartyInterface::calculate | ( | std::string | wilson, |
| std::string | output_model, | ||
| std::string | target_model, | ||
| double | Q_match, | ||
| std::string | model_path, | ||
| bool | sm_like_filter, | ||
| bool | bsm_split_generation = false, |
||
| bool | full_target_generation = false |
||
| ) |
Full pipeline with a separate output label and target model.
Definition at line 371 of file MartyInterface.cpp.
| std::string MartyInterface::calculate_isolated | ( | std::string | wilson, |
| std::string | output_model, | ||
| std::string | target_model, | ||
| double | Q_match, | ||
| std::string | model_path, | ||
| bool | sm_like_filter, | ||
| bool | bsm_split_generation = false, |
||
| bool | full_target_generation = false |
||
| ) |
Thread-safe calculation using invocation-local parameter and CSV files.
Generated analytical/numeric artifacts remain shared and read-only after construction, while each evaluation receives its own run directory. The returned CSV path is owned by the caller and may be removed after reading.
Definition at line 539 of file MartyInterface.cpp.
| void MartyInterface::compile_run | ( | std::string | wilson, |
| std::string | model | ||
| ) |
Compiles and runs the non-numeric generated code.
Uses GppCompilerStrategy to:
| wilson | Name of the Wilson basis. |
| model | Model name. |
Definition at line 252 of file MartyInterface.cpp.
| void MartyInterface::compile_run_libs | ( | std::string | wilson, |
| std::string | model, | ||
| double | Q_match | ||
| ) |
Compiles and runs the numeric libraries.
Uses MakeCompilerStrategy to:
Q_match.| wilson | Wilson basis name. |
| model | Model name. |
| Q_match | Matching scale passed to the numeric executable. |
Definition at line 357 of file MartyInterface.cpp.
| void MartyInterface::generate | ( | std::string | wilson, |
| std::string | model, | ||
| std::string | model_path | ||
| ) |
Generates a non-numeric MARTY-powered C++ template.
This creates a C++ file (e.g. for calling a Wilson calculator) by:
| wilson | Name of the Wilson basis. |
| model | Target model name (e.g. "SM", "THDM"). |
| model_path | Filesystem path to the model header used in the template. |
Definition at line 264 of file MartyInterface.cpp.
| void MartyInterface::generate | ( | std::string | wilson, |
| std::string | output_model, | ||
| std::string | target_model, | ||
| std::string | model_path, | ||
| bool | sm_like_filter, | ||
| bool | bsm_split_generation = false, |
||
| bool | full_target_generation = false |
||
| ) |
Generates code with a separate output label and target model.
This is used for SM-like contributions in an extended model: output files and libraries keep the SM label, but the generated code instantiates the target BSM model and may filter out non-SM particles.
Definition at line 268 of file MartyInterface.cpp.
| void MartyInterface::generate_numlib | ( | std::string | wilson, |
| std::string | model | ||
| ) |
Generates the numeric library wrapper for a given (Wilson, model) pair.
This step:
| wilson | Wilson basis name. |
| model | Model name. |
| Q_match | Matching scale (GeV) used later by libraries (currently forwarded to compilation stage). |
Definition at line 309 of file MartyInterface.cpp.
| void MartyInterface::generate_numlib | ( | std::string | wilson, |
| std::string | output_model, | ||
| std::string | target_model, | ||
| bool | bsm_split_generation = false, |
||
| bool | full_target_generation = false |
||
| ) |
Generates the numeric wrapper while resolving parameters against a target model that may differ from the output/cache label.
This is needed for SM-like calculations inside a BSM model: generated files keep the SM label, but the analytic expression may still depend on target-model parameters such as THDM beta.
Definition at line 313 of file MartyInterface.cpp.
| std::unordered_set< InterpretedParam > MartyInterface::get_dependencies | ( | std::string | wilson | ) |
Retrieves the set of parameter dependencies for a given Wilson basis.
The dependencies are discovered via numeric template generation, and correspond to the set of InterpretedParam used in the numeric code.
| wilson | Wilson basis name. |
| If | the wilson key is unknown in the internal cache, a logged error is emitted and the behavior is undefined. |
Definition at line 877 of file MartyInterface.cpp.
| std::set< std::string > MartyInterface::get_special_blocks | ( | ) |
Returns the special blocks handled with custom logic.
These are the block names for which SMParamSetter applies special formulas instead of simply reading values from the parameter proxies.
Typical examples include:
"KIN" : kinetic terms,"WEIN" : Weinberg angle,"Finite", "REGPROP", "BETA", etc.Definition at line 902 of file MartyInterface.cpp.