10 throw std::invalid_argument(
11 "MartyWilson requires an explicit runtime-resolved MARTY model path"
18 std::string csv_path = config.
csv_path;
24 std::string marty_model_path = config.
model_path;
26 std::shared_ptr<IMartyWilsonProxy<InterpretedParam>> marty_proxy = config.
marty_proxy;
29 matching_info[
QCDOrder::LO].compute = [name, csv_path, marty_model, marty_generation_model, marty_sm_like_filter, marty_bsm_split_generation, marty_full_target_generation, marty_model_path, marty_proxy, contribution_type] (
const ParamSrc& src) ->
scalar_t {
34 throw std::runtime_error(
35 "MartyWilson cannot evaluate '" + name +
"': no MARTY proxy was configured"
40 bool found_matching_scale =
false;
45 const std::string isolated_csv = marty_proxy->calculate_isolated(
48 marty_generation_model,
52 marty_bsm_split_generation,
53 marty_full_target_generation
55 const std::filesystem::path csv_to_read = isolated_csv.empty()
56 ? std::filesystem::path(csv_path)
57 : std::filesystem::path(isolated_csv);
59 struct InvocationCsvCleanup {
60 std::filesystem::path directory;
61 ~InvocationCsvCleanup() {
62 if (directory.empty()) {
66 std::filesystem::remove_all(directory, ec);
68 } cleanup {isolated_csv.empty() ? std::filesystem::path{} : csv_to_read.parent_path()};
70 df = csv_reader.
read_csv(csv_to_read.string());
73 std::string csv_column_base = name;
74 if (marty_bsm_split_generation && name ==
"CP10") {
76 csv_column_base = name +
"_SM_SPLIT";
78 csv_column_base = name +
"_BSM_SPLIT";
80 csv_column_base = name +
"_TOTAL_SPLIT";
85 double Q_match = df.
iat<
double>(i,
"Q_match");
86 if (fabs(Q_match - ew_scale) < epsi) {
87 result = {df.
iat<
double>(i, csv_column_base+
"_real"), df.
iat<
double>(i, csv_column_base+
"_img")};
88 found_matching_scale =
true;
93 if (!found_matching_scale) {
94 throw std::runtime_error(
95 "MartyWilson CSV for '" + name +
"' contains no row at Q_match="
96 + std::to_string(ew_scale)
104 std::unordered_map<ParamId, std::shared_ptr<Parameter>> dummy {{pid, std::make_shared<Parameter>(pid, 1, 0, 0)}};
107 std::unordered_set<ParamId> sources;
108 const std::set<std::string> special = marty_proxy->get_special_blocks();
109 for (
const auto& par : marty_proxy->get_dependencies(name)) {
110 if (special.contains(par.block)) {
#define LOG_DEBUG(...)
Macro for logging debug messages.
WilsonCoefficient implementation whose matching is produced by a MARTY backend.
CSV → DataFrame loader with basic type handling.
DataFrame read_csv(const std::string &filename, CSVOptions options=CSVOptions())
Read a CSV file and construct a DataFrame.
Simple column-oriented data structure with basic analysis utilities.
Series< T > getColumn(const std::string &colName) const
Returns a copy of a column as a Series<T>.
size_t getRowCount() const
Returns the number of rows in the DataFrame.
void setIndex(const std::vector< std::string > &newIndex)
Sets the index labels for all rows.
T iat(size_t row, const std::string &colName) const
Positional access to a cell (row index, column name).
void set_model(std::string model)
Sets the MARTY model name used by this coefficient.
MartyWilson(MartyWilsonConfig config)
Constructs a Marty-backed Wilson coefficient.
Lightweight view over a set of source parameters keyed by ParamId.
High-level mapper for WCoef <-> text <-> FLHA base indices.
static LhaID flha_full(WCoef e, QCDOrder q, ContributionType c)
static WCoef from_flha(int a, int b)
Returns the WCoef associated with a given FLHA base key (a,b).
Abstract base class representing a Wilson coefficient and its matching information.
std::string get_name() const
Returns the current full name (may include suffixes).
std::map< QCDOrder, MatchingInfo > matching_info
Matching metadata indexed by QCD order.
ContributionType type
Contribution type for this coefficient (SM by default, inferred in constructors).
std::vector< long > get_parts() const
Returns the underlying vector of sub-ids.
std::vector< long > parts
Configuration bundle for constructing a MartyWilson coefficient.
std::string model_name
Output model label used for generated libraries/CSV files (e.g. "SM", "THDM").
LhaID coeff_id
Full coefficient id used to store the matching value (including order/type parts).
bool full_target_generation
fs::path model_path
Path to the MARTY model header file.
std::string csv_path
Absolute path to the CSV output produced by MARTY for this model.
std::shared_ptr< IMartyWilsonProxy< InterpretedParam > > marty_proxy
Proxy used to run MARTY and retrieve dependencies/special blocks.
std::string generation_model_name
bool bsm_split_generation
Composite identifier for a single parameter.
BlockName block
Name of the block where the parameter is stored.