Hyperiso 1.0.3
Modular flavour-physics calculations, Wilson coefficients and statistical inference
Loading...
Searching...
No Matches
main_custom_obs.cpp
Go to the documentation of this file.
1#include "Logger.h"
2#include <iostream>
3#include <cassert>
5#include "HyperisoMaster.h"
6#include "config.hpp"
7#include "Wilson/WilsonObs.h"
8
9int main() {
12 HyperisoConfig config;
13 config.model = Model::SM;
14 hyp.init("lha/si_input.flha", config);
15 LOG_INFO("HyperisoMaster initialized");
16
19
20 // DecayMapper::register_custom("Wilson");
21
23 "Wilson",
24 {"Wilson2"},
25 {
27 .canonical = "C7",
28 .aliases = {"C_7"},
29 .ext = std::nullopt
30 }
31 }
32);
33
34 auto wilson_decay = std::make_shared<WilsonDecay>(DecayMapper::id_of("Wilson"), order, 81, 5, oi.get_ports());
35 oi.add_custom_decay(DecayMapper::id_of("Wilson"), wilson_decay);
37 oi.add_observable(o, order, false);
39 ParamId {ParameterType::SM, "SMINPUTS", 3},
40 ParamId {ParameterType::SM, "SMINPUTS", 4},
41 ParamId {ParameterType::SM, "SMINPUTS", 6},
42 ParamId {ParameterType::SM, "MASS", 24}
43 });
44
45 // LOG_INFO("C7 =", oi.compute_observable(o)[0].value, "+-", oi.compute_uncertainty(o));
46
47 // auto print_leading = [&oi] (ObservableId o, size_t n) {
48 // LOG_INFO("---------- Leading uncertainties for", ObservableMapper::str(o));
49 // for (const auto& [pid, u] : oi.compute_leading_uncertainties(o, n)) {
50 // LOG_INFO("\t-", pid, ":", u.real());
51 // }
52 // };
53
54 // print_leading(o, 4);
55
56 return 0;
57}
QCDOrder
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.
static bool register_custom_with_observables(std::string canonical, std::vector< std::string > aliases, std::vector< CustomObservableSpec > observables)
Register a custom decay and its custom observables in one call.
static IdOf< DecayTag > id_of(std::string_view s)
Resolves a string into an IdOf<Tag> via the registry.
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 add_custom_decay(DecayId id, std::shared_ptr< DecayParent > ptr)
Register a custom decay implementation.
ObservablePortsConfig & get_ports()
Access the underlying ports configuration (advanced use).
ObservableInterface & add_observable(Observables obs, QCDOrder order, bool add_dependencies=false)
Add an observable to the manager (enum API).
void add_observable_parameters(Observables obs, std::unordered_set< ParamId > pids)
Manually add multiple parameter dependences to an observable (enum API).
int main()
Small value object used to register a custom decay with observables.
Definition decay_ids.hpp:62
std::string canonical
Canonical observable name.
Definition decay_ids.hpp:63
Configuration object controlling model, input flags and optional MARTY resources.
Definition Config.h:24
Model model
Current model.
Definition Config.h:33
Composite identifier for a single parameter.
Definition ParamID.h:57