Hyperiso 1.0.3
Modular flavour-physics calculations, Wilson coefficients and statistical inference
Loading...
Searching...
No Matches
main_susy.cpp
Go to the documentation of this file.
1#include <cstdlib>
2#include <exception>
3#include <iomanip>
4#include <iostream>
5#include <string>
6#include <unordered_set>
7
8#include "MemoryManager.h"
9#include "ParameterProvider.h"
10#include "Parameters.h"
11#include "WilsonInterface.h"
12
13namespace {
14
15double real_value(const scalar_t& value) {
16 return static_cast<complex_t>(value).real();
17}
18
19void print_complex(const std::string& label, const scalar_t& value) {
20 const auto z = static_cast<complex_t>(value);
21 std::cout << std::left << std::setw(28) << label << std::scientific
22 << std::setprecision(16) << z.real()
23 << (z.imag() >= 0.0 ? " +" : " ") << z.imag() << "i\n";
24}
25
26double optional_value(const ParameterProvider& p, const std::string& block, int id) {
27 return p.exists(block, LhaID(id)) ? real_value(p(block, LhaID(id))) : 0.0;
28}
29
30} // namespace
31
32int main(int argc, char** argv) {
33 const std::string input = argc > 1 ? argv[1] : "lha/nmssm_smoke.slha";
34 const double q_match = argc > 2 ? std::atof(argv[2]) : 81.0;
35 const double q_low = argc > 3 ? std::atof(argv[3]) : q_match;
36
37 try {
38 auto hyp = HyperisoMaster();
39 HyperisoConfig config_hyp;
40 config_hyp.model = Model::SUSY;
41 config_hyp.flags[ExternalFlag::IS_LHA_SPECTRUM] = true;
42 hyp.init(input, config_hyp);
43
46 const auto nm = [&](int run_id, int ext_id) {
47 if (bsm.exists("NMSSMRUN", LhaID(run_id))) return real_value(bsm("NMSSMRUN", LhaID(run_id)));
48 if (pass.exists("EXTPAR", LhaID(ext_id))) return real_value(pass("EXTPAR", LhaID(ext_id)));
49 return 0.0;
50 };
51
52 std::cout << std::scientific << std::setprecision(16)
53 << "HYPERISO_NMSSM_INPUT lambda=" << nm(1, 61)
54 << " kappa=" << nm(2, 62)
55 << " A_lambda=" << nm(3, 63)
56 << " mu_eff=" << nm(5, 65) << '\n'
57 << "HYPERISO_NMSSM_MASSES h3=" << optional_value(bsm, "MASS", 45)
58 << " a1=" << optional_value(bsm, "MASS", 36)
59 << " a2=" << optional_value(bsm, "MASS", 46) << '\n'
60 << "HYPERISO_YUKAWA_BLOCKS YU33="
61 << (bsm.exists("YU", LhaID(3, 3)) ? "present" : "derived")
62 << " YD33=" << (bsm.exists("YD", LhaID(3, 3)) ? "present" : "derived") << '\n'
63 << "HYPERISO_NEUTRALINO5 mass=" << optional_value(bsm, "MASS", 1000045)
64 << " matrix=" << (bsm.exists("NMNMIX", LhaID(1, 1)) ? "NMNMIX" : "NMIX")
65 << " row5="
66 << ((bsm.exists("NMNMIX", LhaID(5, 3)) && bsm.exists("NMNMIX", LhaID(5, 4))) ||
67 (bsm.exists("NMIX", LhaID(5, 3)) && bsm.exists("NMIX", LhaID(5, 4)))
68 ? "complete" : "incomplete") << '\n'
69 << "HYPERISO_SCALES q_match=" << q_match << " q_low=" << q_low << '\n';
70
72 WilsonBuildConfig config(std::unordered_set<WGroup>{WGroup::BScalar, WGroup::B},
73 q_match, q_low, QCDOrder::NLO);
74 wi.build(config);
75
77 std::cout << "HYPERISO_EPSILON_SUSY eps0="
78 << real_value(wilson("EPSILON_SUSY", LhaID(0, 1)))
79 << " eps0p=" << real_value(wilson("EPSILON_SUSY", LhaID(0, 2)))
80 << " eps1p=" << real_value(wilson("EPSILON_SUSY", LhaID(1)))
81 << " eps2=" << real_value(wilson("EPSILON_SUSY", LhaID(2)))
82 << " epsb=" << real_value(wilson("EPSILON_SUSY", LhaID(3)))
83 << " epsbp=" << real_value(wilson("EPSILON_SUSY", LhaID(4))) << '\n';
84
85 print_complex("HYPERISO_CQ1_LO_MATCH", wi.getM(WGroup::BScalar, WCoef::CQ1_MU, QCDOrder::LO, ContributionType::BSM));
86 print_complex("HYPERISO_CQ1_NLO_MATCH", wi.getM(WGroup::BScalar, WCoef::CQ1_MU, QCDOrder::NLO, ContributionType::BSM));
87 print_complex("HYPERISO_CQ2_LO_MATCH", wi.getM(WGroup::BScalar, WCoef::CQ2_MU, QCDOrder::LO, ContributionType::BSM));
88 print_complex("HYPERISO_CQ2_NLO_MATCH", wi.getM(WGroup::BScalar, WCoef::CQ2_MU, QCDOrder::NLO, ContributionType::BSM));
89 print_complex("HYPERISO_C7_LO_MATCH", wi.getM(WGroup::B, WCoef::C7, QCDOrder::LO, ContributionType::BSM));
90 print_complex("HYPERISO_C7_NLO_MATCH", wi.getM(WGroup::B, WCoef::C7, QCDOrder::NLO, ContributionType::BSM));
91 print_complex("HYPERISO_C8_LO_MATCH", wi.getM(WGroup::B, WCoef::C8, QCDOrder::LO, ContributionType::BSM));
92 print_complex("HYPERISO_C8_NLO_MATCH", wi.getM(WGroup::B, WCoef::C8, QCDOrder::NLO, ContributionType::BSM));
93 return 0;
94 } catch (const std::exception& e) {
95 std::cerr << "HyperIso NMSSM test failed: " << e.what() << '\n';
96 return 1;
97 }
98}
@ IS_LHA_SPECTRUM
Input LHA file already contains a spectrum.
Manages memory caching, parameter blocks, and LHA reader instances.
High-level access to parameter values and uncertainties.
Model-dependent parameter repository and initialization strategies.
std::complex< double > complex_t
Convenience alias for std::complex<double>.
Definition Utils.h:35
High-level interface to initialize and monitor the main framework configuration.
Provides access to parameter values, errors, and existence checks.
bool exists(const ParamId &pid) const
Checks if a parameter identified by ParamId exists.
User-facing API to build and query Wilson coefficients at matching and hadronic scales.
double real(const scalar_t &z)
Definition scalar.cpp:83
Configuration object controlling model, input flags and optional MARTY resources.
Definition Config.h:24
std::map< ExternalFlag, bool > flags
External flags describing the nature of the inputs.
Definition Config.h:26
Model model
Current model.
Definition Config.h:33
Represents an identifier of a LHA element, possibly containing several sub-ids.
Definition LhaID.h:56
Configuration for building sets of Wilson coefficients.
Definition Configs.h:32