Hyperiso 1.0.3
Modular flavour-physics calculations, Wilson coefficients and statistical inference
Loading...
Searching...
No Matches
main.cpp
Go to the documentation of this file.
1#include <iostream>
2#include <string>
3
4#include "Logger.h"
5#include "config.hpp"
6#include "WilsonHandler.h"
7#include "ObservableHandler.h"
8#include "StatisticHandler.h"
9
10namespace {
11
12void print_usage() {
13 std::cout
14 << "Hyperiso terminal interface\n\n"
15 << "Usage:\n"
16 << " hyperiso-ui <module> <command> [options]\n\n"
17 << "Modules:\n"
18 << " wilson Builtin Wilson-coefficient summaries\n"
19 << " observable Builtin observable summaries\n"
20 << " statistic Statistic/dependency/uncertainty summaries\n\n"
21 << "Common options:\n"
22 << " --model SM|THDM|MSSM|MARTY Model, default SM\n"
23 << " --lha <path> LHA/FLHA input, default lha/si_input.flha\n"
24 << " --order LO|NLO|NNLO QCD order, default NNLO\n"
25 << " --help Show help\n"
26 << " --version Show the HyperIso version\n\n"
27 << "Examples:\n"
28 << " hyperiso-ui wilson summary --groups BCoefficients --coeffs C7,C9,C10\n"
29 << " hyperiso-ui observable summary --observables BR_Bs__mu_mu,BR_B__Xs_gamma\n"
30 << " hyperiso-ui statistic summary --observables BR_Bs__mu_mu --draws 200 --progress\n";
31}
32
33} // namespace
34
35int main(int argc, char* argv[]) {
37
38 if (argc >= 2 && std::string(argv[1]) == "--version") {
39 std::cout << project_version << "\n";
40 return 0;
41 }
42
43 if (argc < 2 || std::string(argv[1]) == "--help" || std::string(argv[1]) == "help") {
44 print_usage();
45 return argc < 2 ? 1 : 0;
46 }
47
48 const std::string module = argv[1];
49 try {
50 if (module == "wilson") return handleWilsonOptions(argc - 1, argv + 1);
51 if (module == "observable") return handleObservableOptions(argc - 1, argv + 1);
52 if (module == "statistic") return handleStatisticOptions(argc - 1, argv + 1);
53
54 std::cerr << "Unknown module: " << module << "\n\n";
55 print_usage();
56 return 1;
57 } catch (const std::exception& e) {
58 std::cerr << "ERROR: " << e.what() << "\n";
59 return 1;
60 }
61}
int main()
Definition main.cpp:5
int handleObservableOptions(int argc, char *argv[])
int handleStatisticOptions(int argc, char *argv[])
int handleWilsonOptions(int argc, char *argv[])
void setEnabled(bool enabled)
Enables or disables the Logger.
Definition Logger.cpp:50
static Logger * getInstance()
Retrieves the singleton instance of the Logger.
Definition Logger.cpp:5