Hyperiso 1.0.3
Modular flavour-physics calculations, Wilson coefficients and statistical inference
Loading...
Searching...
No Matches
GeneralModelModifier.h
Go to the documentation of this file.
1#ifndef GENERAL_MODEL_MODIFIER_H
2#define GENERAL_MODEL_MODIFIER_H
3
4#include <unordered_map>
5#include <cctype>
6#include <algorithm>
7#include <optional>
8#include <string>
9#include <utility>
10#include <vector>
11
12#include "ModelModifier.h"
13#include "ModelFileChecker.h"
14#include "config.hpp"
15
47public:
57 GeneralModelModifier(std::string wilson,
58 std::string model,
59 std::string model_path,
60 std::optional<int> model_template_index = std::nullopt);
61
73 GeneralModelModifier(std::string wilson,
74 std::string output_model,
75 std::string target_model,
76 std::string model_path,
77 std::optional<int> model_template_index,
78 bool disable_non_sm_particles,
79 bool bsm_split_generation = false,
80 bool full_target_generation = false,
81 bool tree_first_fallback = false);
82
84 void modifyLine(std::string& line) override;
85
87 void addLine(std::ofstream& outputFile, const std::string& currentLine) override;
88
94 static std::string resolveModelInstantiation(const std::string& model,
95 const std::string& model_path,
96 std::optional<int> model_template_index = std::nullopt);
97
101 static std::string modelSignature(const std::string& model,
102 const std::string& model_path,
103 std::optional<int> model_template_index = std::nullopt);
104
105private:
106 static std::string makeSmFilterHelper();
107 bool usesRegPropSplit() const;
108 bool usesGenericTreeFirst() const;
109 static void replaceWilsonOrderArgument(std::string& line);
110 bool consumeTreeSafeWilsonCall(std::ofstream& outputFile,
111 const std::string& currentLine,
112 bool pair_return,
113 bool count_graphs);
114 void emitTreeSafeWilsonCall(std::ofstream& outputFile,
115 bool pair_return,
116 bool count_graphs);
117
118 std::string output_model{};
119 std::string target_model{};
120 std::string model_path{};
121 std::string marty_path{};
122 std::optional<int> model_template_index{};
123 bool disable_non_sm_particles{false};
124 bool bsm_split_generation{false};
125 bool full_target_generation{false};
126 bool tree_first_fallback{false};
127 bool inside_calculate_function{false};
128 bool skip_old_main{false};
129 bool expression_returned{false};
130 std::string generic_builder_name{};
131 bool buffering_tree_safe_wilson_call{false};
132 std::vector<std::string> tree_safe_wilson_call_lines{};
133 ModelClassInfo model_class{};
134 std::string model_instantiation{};
135};
136
137#endif
Declares utilities to detect MARTY model classes in C++ files.
Declares the base interface for source-level model transformations.
ModelModifier that rewrites SM templates into a target model.
static std::string modelSignature(const std::string &model, const std::string &model_path, std::optional< int > model_template_index=std::nullopt)
Build the cache signature written in generated analytical files.
void addLine(std::ofstream &outputFile, const std::string &currentLine) override
Writes a (possibly modified) line to the output file.
void modifyLine(std::string &line) override
Modifies a single line of source code in place.
static std::string resolveModelInstantiation(const std::string &model, const std::string &model_path, std::optional< int > model_template_index=std::nullopt)
Resolve the C++ model instantiation used by generated MARTY code.
Abstract base class for model source modifiers.
std::string wilson
Name of the Wilson operator basis used in the model.