Hyperiso 1.0.3
Modular flavour-physics calculations, Wilson coefficients and statistical inference
Loading...
Searching...
No Matches
main_custom_wilson.cpp
Go to the documentation of this file.
1// main.cpp
2#include <iostream>
3#include <memory>
4
5#include "CustomWilson.h"
6#include "CustomWilsonGroup.h"
7
8#include "GroupMapper.h"
9#include "qcdorder_ids.hpp"
10#include "wcoef_ids.hpp"
11#include "WilsonParamComposer.h"
12#include "ScaleSetter.h"
13#include "ModelAPI.h"
14#include "MartyModelNameAPI.h"
15#include "MartyModelPathAPI.h"
16#include "ParameterProxy.h"
17#include "UseMarty.h"
18
19// Optionnel: si tu as des logs
20// #include "Utils.h"
21
22int main(int argc, char** argv) {
23
24 auto hyp = HyperisoMaster();
25 HyperisoConfig config_hyp;
26 // config_hyp.flags[ExternalFlag::USE_MARTY] = false;
27 config_hyp.model = Model::SM;
28 config_hyp.mty_model_name = "ZPrime";
29 config_hyp.mty_model_path = argc > 2 ? argv[2] : "Assets/input_files/marty_model/ZPrime.h";
30
31 hyp.init(argc > 1 ? argv[1] : "Assets/lha/camilia.flha", config_hyp); // Initialize program manager with LHA file
32
33
34 // try {
35 // LhaID a = {42,42};
36
37 // std::cout << "=== Custom Wilson Coefficient Test ===" << std::endl;
38 // auto Cfoo = std::make_shared<CustomWilson>(
39 // a,
40 // GroupMapper::str(WGroup::B) + std::string("_MATCH"),
41 // QCDOrder::NLO,
42 // ContributionType::SM
43 // );
44 // std::cout << "=== Creation done ===" << std::endl;
45
46 // Cfoo->set_order_info(
47 // QCDOrder::LO,
48 // std::unordered_set<ParamId>{
49 // },
50 // [](const auto& src)->scalar_t {
51 // double xt = 1;
52 // double Q = 4.18;
53 // return 0.123 + 0.5*std::log(Q) - 0.1*xt;
54 // },
55 // LhaID(999, 1001, 0, 0)
56 // );
57
58 // Cfoo->set_order_info(
59 // QCDOrder::NLO,
60 // std::unordered_set<ParamId>{
61 // },
62 // [](const auto& src)->scalar_t {
63
64 // double L = 2;
65 // double xt = 1;
66 // return 0.456 + 0.25*L - 0.02*xt*xt;
67 // },
68 // LhaID(999, 1001, 1, 0)
69 // );
70
71 // std::shared_ptr<IBlockComposer> iblock_c = std::make_shared<WilsonParamComposer>();
72 // std::shared_ptr<IParameterProxy<std::string, LhaID>> wilson_proxy = std::make_shared<ParameterProxy>(ParameterType::WILSON);
73 // std::shared_ptr<IParameterProxy<std::string, LhaID>> sm_proxy = std::make_shared<ParameterProxy>(ParameterType::SM);
74 // std::shared_ptr<ICoreAPI<bool>> use_marty = std::make_shared<UseMarty>();
75 // std::shared_ptr<ICoreAPI<Model>> model_api = std::make_shared<ModelAPI>();
76 // std::shared_ptr<IParamSetter<ScaleType>> scale_setter_api = std::make_shared<ScaleSetter>(ScaleType::MATCHING);
77 // std::shared_ptr<ICoreAPI<std::string>> marty_model_name = std::make_shared<MartyModelNameAPI>();
78 // std::shared_ptr<ICoreAPI<fs::path>> marty_model_path = std::make_shared<MartyModelPathAPI>();
79 // WilsonGroupAdapterConfig adapters(wilson_proxy, iblock_c, use_marty, marty_model_name, marty_model_path);
80
81 // auto Gcustom = std::make_shared<CustomCoefficientGroup>(adapters,"B", ContributionType::SM);
82 // Gcustom->add_coefficient(Cfoo);
83
84 // Gcustom->set_basis_order_sources_and_running(
85 // WilsonBasis::B_STANDARD,
86 // QCDOrder::LO,
87 // std::unordered_map<ParameterType, std::vector<std::string>>{
88 // {ParameterType::WILSON, {"U_MATRIX", "WPARAM_MATCH_SM", "WPARAM_RUN_SM"}},
89 // {ParameterType::SM, {"MASS"}}
90 // },
91 // CustomCoefficientGroup::identity_running
92 // );
93
94 // Gcustom->finalize(QCDOrder::NLO);
95
96
97 // auto cfoo_lo_match = Gcustom->get_matching_coefficient("Cfoo", "LO", ContributionType::TOTAL);
98 // auto cfoo_nlo_match = Gcustom->get_matching_coefficient("Cfoo", "NLO", ContributionType::TOTAL);
99
100 // auto cfoo_lo_run = Gcustom->get_running_coefficient("Cfoo", "LO", ContributionType::TOTAL, WilsonBasis::B_STANDARD);
101 // auto cfoo_nlo_run = Gcustom->get_running_coefficient("Cfoo", "NLO", ContributionType::TOTAL, WilsonBasis::B_STANDARD);
102
103 // std::cout << "=== Custom test ===\n";
104 // std::cout << "Cfoo (matching, LO) = " << cfoo_lo_match << "\n";
105 // std::cout << "Cfoo (matching, NLO) = " << cfoo_nlo_match << "\n";
106 // std::cout << "Cfoo (running, LO) = " << cfoo_lo_run << "\n";
107 // std::cout << "Cfoo (running, NLO) = " << cfoo_nlo_run << "\n";
108
109 // std::cout << "\n--- Dump du groupe ---\n";
110 // std::cout << Gcustom << std::endl;
111
112 // return 0;
113 // } catch (const std::exception& e) {
114 // std::cerr << "Exception: " << e.what() << std::endl;
115 // return 1;
116 // }
117}
User-assembled CoefficientGroup with explicit coefficients and running rules.
User-definable WilsonCoefficient with explicit per-order matching definitions.
Core API exposing the active MARTY model name.
Core API exposing the filesystem path to the MARTY model file.
Concrete IParameterProxy backed by ParameterProvider / Parameters.
Concrete setter for Wilson scale parameters.
Core API indicating whether the MARTY backend is active.
Block composer specialized for the Wilson parameter scope.
High-level interface to initialize and monitor the main framework configuration.
Configuration object controlling model, input flags and optional MARTY resources.
Definition Config.h:24
std::optional< fs::path > mty_model_path
Path to the MARTY model file, if needed.
Definition Config.h:35
std::optional< std::string > mty_model_name
MARTY model class name, if needed.
Definition Config.h:34
Model model
Current model.
Definition Config.h:33