Hyperiso 1.0.3
Modular flavour-physics calculations, Wilson coefficients and statistical inference
Loading...
Searching...
No Matches
main_scan.cpp
Go to the documentation of this file.
1#include "Logger.h"
2#include <iostream>
3#include <fstream>
4#include <iomanip>
5#include <cmath>
6#include <filesystem>
7#include <cassert>
8
10#include "HyperisoMaster.h"
11#include "config.hpp"
12
13int main() {
15 namespace fs = std::filesystem;
16
17 std::string lha_dir = project_assets_root.data() + std::string("scan");
18 std::ofstream ofs("B_s_gamma_SI_scan_LO.csv");
19 ofs << "lha_file,M_Hp,BR,u(BR)\n";
20
21 // Prépare HyperIso
22 HyperisoConfig config;
23 config.model = Model::THDM;
24 // config.flags[ExternalFlag::USE_MARTY] = false;
25 config.mty_model_name = "THDM";
26 config.mty_model_path = project_assets_root.data() + std::string("input_files/marty_model/thdm.h");
28 hyp.init("lha/testinput_thdm.lha", config);
29
30 // Parcours tous les fichiers LHA
31 for (const auto& entry : fs::directory_iterator(lha_dir)) {
32 if (entry.path().extension() != ".lha") continue;
33
34 std::string lha_path = entry.path().string();
35 std::string lha_name = entry.path().filename().string();
36
37 LOG_INFO("Processing " + lha_name);
38
39
40 hyp.init(lha_path, config);
41 MemoryManager::GetInstance()->switch_lha(lha_path, config);
42 auto sm = SMModelStrategy();
43 std::cout << "aah" << std::endl;
44 sm.add_absent_block(SMModelStrategy().initializeParameters(*Parameters::GetInstance(ParameterType::SM)));
45 sm.postInitialization(*Parameters::GetInstance(ParameterType::SM));
47 // Parameters::GetInstance(ParameterType::SM)->init_blocks(ParameterType::SM);
48 // SMModelStrategy().postInitialization(*Parameters::GetInstance(ParameterType::SM));
49 // Parameters::GetInstance(ParameterType::BSM)->init_blocks(ParameterType::BSM);
50 std::cout << "zh" << std::endl;
52 // ParameterSetter ps;
53 std::cout << "ah" << std::endl;
54 // WilsonInterface wi;
55 std::cout << "ch" << std::endl;
56 WilsonBuildConfig wilson_config;
57 std::cout << "dh" << std::endl;
58 // wilson_config.groups = {WGroup::B, WGroup::BPrime};
59 // wilson_config.matching_scale = 81;
60 // wilson_config.hadronic_scale = pp({ParameterType::SM, "QCD", {5, 3}}) / 2;
61 wilson_config.order = QCDOrder::LO;
62 std::cout << "eh" << std::endl;
63 // wi.build(wilson_config);
64 std::cout << "hh" << std::endl;
65 ObsWilsonHelper(true);
67 std::cout << "bh" << std::endl;
68 // ObservableInterface oi;
69 oi.add_observable(Observables::BR_B_XS_GAMMA, wilson_config.order, true);
70
71 // Extraire M_H+ depuis la LHA (paramètre avec PDG 37)
72 double mhp = pp({ParameterType::BSM, "MASS", 37});
73 // ps.mutate({ParameterType::BSM, "MASS", 37}, mhp); // Assure la mise à jour
74
76 double ubr = oi.compute_uncertainty(Observables::BR_B_XS_GAMMA).real();
77
78 ofs << lha_name << "," << std::setprecision(8) << mhp << "," << br << "," << ubr << "\n";
79
80 }
81
82 return 0;
83}
High-level helpers for initializing and monitoring the Hyperiso framework.
#define LOG_INFO(...)
Macro for logging informational messages.
Definition Logger.h:39
High-level, user-facing entry point to compute flavor observables.
Strategy responsible for BSM parameters.
Definition Parameters.h:174
std::unordered_set< BlockName > initializeParameters(class Parameters &params) override
Initializes the block set for the target parameter repository.
High-level interface to initialize and monitor the main framework configuration.
void init(const std::string &lhaFile, HyperisoConfig config)
Initializes Hyperiso using a LHA file and a full Config object.
void setLevel(LogLevel level)
Sets the logging level.
Definition Logger.cpp:38
static Logger * getInstance()
Retrieves the singleton instance of the Logger.
Definition Logger.cpp:5
void switch_lha(const std::string &lhaFile, HyperisoConfig config)
Registers several additional LHA block prototypes.
static MemoryManager * GetInstance()
Retrieves the singleton instance of MemoryManager.
std::vector< ObservableValue > compute_observable(Observables obs) const
Compute a theory prediction for an observable (enum API).
ObservableInterface & add_observable(Observables obs, QCDOrder order, bool add_dependencies=false)
Add an observable to the manager (enum API).
Provides access to parameter values, errors, and existence checks.
static std::shared_ptr< Parameters > GetInstance(ParameterType id=ParameterType::SM)
Returns the singleton-like repository for a given parameter type.
Strategy responsible for Standard Model parameters.
Definition Parameters.h:149
int main()
Definition main_scan.cpp:13
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
Configuration for building sets of Wilson coefficients.
Definition Configs.h:32
QCDOrder order
Perturbative QCD order used for the evolution and matching of Wilson coefficients....
Definition Configs.h:54