13void print_observable_usage() {
16 <<
" hyperiso-ui observable summary [options]\n\n"
18 <<
" --observables <csv> Observable names, default BR_Bs__mu_mu,BR_B__Xs_gamma\n"
19 <<
" --bins <specs> Binned specs OBS:min:max, comma-separated\n"
20 <<
" --order <order> LO, NLO or NNLO, default NNLO\n"
21 <<
" --model <model> SM, THDM, MSSM or MARTY, default SM\n"
22 <<
" --lha <path> Input LHA/FLHA file\n";
26 std::string observable;
31BinSpec parse_bin_spec(
const std::string& raw) {
32 std::stringstream ss(raw);
33 std::string obs, lo, hi;
34 if (!std::getline(ss, obs,
':') || !std::getline(ss, lo,
':') || !std::getline(ss, hi,
':')) {
35 throw std::invalid_argument(
"Invalid bin spec '" + raw +
"'. Expected OBS:min:max");
37 return {obs, std::stod(lo), std::stod(hi)};
40void print_values(
const std::vector<ObservableValue>& values) {
41 for (
const auto& value : values) {
42 std::cout <<
" " << value.id.str() <<
" = " << value.value;
43 if (value.bin.has_value()) {
44 std::cout <<
" in [" << value.bin->first <<
", " << value.bin->second <<
"]";
53 CliOptions opts = CliOptions::parse(argc, argv, 1);
54 const std::string command = opts.positionals.empty() ?
"summary" : opts.positionals[0];
56 if (opts.flag(
"help",
false) || command ==
"help") {
57 print_observable_usage();
60 if (command !=
"summary") {
61 throw std::invalid_argument(
"Unknown observable command: " + command);
68 const auto obs_names = opts.list(
"observables", {
"BR_Bs__mu_mu",
"BR_B__Xs_gamma"});
69 const auto bin_specs = opts.list(
"bins", {});
72 for (
const auto& name : obs_names) {
75 for (
const auto& raw : bin_specs) {
76 const BinSpec spec = parse_bin_spec(raw);
88 for (
const auto& [obs, values] : interface.
compute_all()) {
void print_section(const std::string &title)
HyperisoMaster init_hyperiso_from_cli(const CliOptions &opts)
QCDOrder parse_qcd_order(const std::string &order)
int handleObservableOptions(int argc, char *argv[])
High-level, user-facing entry point to compute flavor observables.
static std::string str(const IdOf< QCDOrderTag > &id)
Returns the string representation associated with an identifier.
static IdOf< ObservableTag > id_of(std::string_view s)
Resolves a string into an IdOf<Tag> via the registry.
static std::string str(const IdOf< ObservableTag > &id)
Returns the string representation of an identifier.
void enable_obs()
Force enabling/re-enabling currently registered observables.
std::map< ObservableId, std::vector< ObservableValue > > compute_all()
Compute all currently registered observables.
ObservableInterface & add_observable(Observables obs, QCDOrder order, bool add_dependencies=false)
Add an observable to the manager (enum API).
Non-templated façade over the project mapper families.
void init_all_builtins()
Initializes all builtin mapper registries and the decay graph.
Identifies an observable together with a numerical bin.