15void print_statistic_usage() {
18 <<
" hyperiso-ui statistic summary [options]\n\n"
20 <<
" --observables <csv> Observable names, default BR_Bs__mu_mu,BR_B__Xs_gamma\n"
21 <<
" --draws <n> MC draws for uncertainty mode, default 200\n"
22 <<
" --seed <n> RNG seed for reproducible MC runs, default 123456\n"
23 <<
" --uncertainties Also compute MC uncertainty summaries\n"
24 <<
" --chi2 Use CHI2_MC_COVARIANCE advanced likelihood mode\n"
25 <<
" --progress Show MC progress bar when MC is run\n"
26 <<
" --samples-csv <path> Write accepted MC observable samples to CSV\n"
27 <<
" --order <order> LO, NLO or NNLO, default NNLO\n"
28 <<
" --model <model> SM, THDM, MSSM or MARTY, default SM\n"
29 <<
" --lha <path> Input LHA/FLHA file\n";
32void print_predictions(
const std::map<
ObservableId, std::vector<ObservableValue>>& predictions) {
33 for (
const auto& [obs, values] : predictions) {
35 for (
const auto& value : values) {
36 std::cout <<
" prediction=" << value.value;
37 if (value.bin.has_value()) {
38 std::cout <<
" in [" << value.bin->first <<
", " << value.bin->second <<
"]";
48 CliOptions opts = CliOptions::parse(argc, argv, 1);
49 const std::string command = opts.positionals.empty() ?
"summary" : opts.positionals[0];
51 if (opts.flag(
"help",
false) || command ==
"help") {
52 print_statistic_usage();
55 if (command !=
"summary") {
56 throw std::invalid_argument(
"Unknown statistic command: " + command);
63 const auto obs_names = opts.list(
"observables", {
"BR_Bs__mu_mu",
"BR_B__Xs_gamma"});
65 auto oi = std::make_shared<ObservableInterface>();
66 for (
const auto& name : obs_names) {
72 cfg.
MC_draws =
static_cast<std::size_t
>(opts.get_int(
"draws", 200));
73 cfg.
MC_seed =
static_cast<unsigned int>(opts.get_int(
"seed", 123456));
75 if (opts.has(
"samples-csv")) {
88 std::cout <<
"observables=" << obs_names.size()
91 <<
", mode=" << (opts.flag(
"chi2",
false) ?
"CHI2_MC_COVARIANCE" :
"PROFILED_NUISANCE")
95 print_predictions(oi->compute_all());
100 std::cout <<
" <none>\n";
102 for (
const auto& [pid, value] : deps) {
103 std::cout <<
" " << pid <<
" = " << value <<
"\n";
107 if (opts.flag(
"uncertainties",
false)) {
110 for (
const auto& [obs, summary] : summaries) {
111 std::cout <<
" " << obs.str() <<
" -> " << summary <<
"\n";
void print_section(const std::string &title)
HyperisoMaster init_hyperiso_from_cli(const CliOptions &opts)
QCDOrder parse_qcd_order(const std::string &order)
High-level, user-facing entry point to compute flavor observables.
int handleStatisticOptions(int argc, char *argv[])
High-level facade for statistical computations.
@ PROFILED_NUISANCE
Full likelihood with explicit nuisance parameters profiled during the fit.
@ CHI2_MC_COVARIANCE
Fast chi-square likelihood using MC theory covariance plus experimental covariance.
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.
std::map< BinnedObservableId, GaussianSummary > compute_uncertainties()
Computes Gaussian uncertainty summaries for all active observables.
std::map< ParamId, double > get_active_observable_dependencies()
Returns the nuisance/input parameters currently seen by the statistical manager.
Non-templated façade over the project mapper families.
void init_all_builtins()
Initializes all builtin mapper registries and the decay graph.
StatisticLikelihoodMode likelihood_mode
Likelihood mode used by compute_MLE().
std::string mc_samples_csv_path
Output CSV path used when write_mc_samples_csv is true.
bool print_scan_summary
Print likelihood-scan summaries.
bool print_fit_summary
Print high-level fit backend summaries.
unsigned int MC_seed
RNG seed used for reproducible MC nuisance and experimental-data sampling.
bool write_mc_samples_csv
Write accepted MC observable samples to CSV.
AdvancedStatisticConfig advanced
Advanced fit/pruning/covariance configuration.
bool print_mc_progress
Print MC progress with ETA based on measured draw time.
std::size_t MC_draws
Number of accepted MC draws used for uncertainty propagation.