Hyperiso 1.0.3
Modular flavour-physics calculations, Wilson coefficients and statistical inference
Loading...
Searching...
No Matches
StatisticInterface.h
Go to the documentation of this file.
1#ifndef STATISTIC_INTERFACE_H
2#define STATISTIC_INTERFACE_H
3
4#include "StatisticManager.h"
11#include "NuisanceReader.h"
12
30public:
41 StatisticInterface(StatisticConfig config, std::shared_ptr<ObservableInterface> oi_);
42
48 void select_experiment(const std::string& experiment);
49
55 void select_experiments(const std::vector<std::string>& experiments);
56
61
67 bool has_experiment_selection() const noexcept;
68
75 std::set<std::string> selected_experiments() const;
76
82 void select_experiment_observables(const std::vector<ExperimentObs>& observables);
83
88
94 bool has_experiment_observable_selection() const noexcept;
95
101 std::set<ExperimentObs> selected_experiment_observables() const;
102
108 std::map<BinnedObservableId, GaussianSummary> compute_uncertainties();
109
119 std::map<ParamId, double> get_active_observable_dependencies();
120
127
135 FitResultWithMaps compute_MLE(const std::vector<ParamId>& p_specs);
136
148 Contour compute_confidence_contour(ParamId p1, ParamId p2, double z, std::array<double, 4> bounds, ContourOptions options);
149
154
160 void set_nuisance_user_file(const std::string& user_yaml_path);
161
166
177 void prepare_likelihood_for_scan(const std::vector<ParamId>& p_specs);
178
185 void set_manual_scan_point(const std::map<ParamId, double>& p_hat,
186 const std::map<ParamId, double>& eta_hat);
187
201 ParamId p1,
202 ParamId p2,
203 double x_half_width,
204 double y_half_width,
205 std::size_t nx,
206 std::size_t ny
207 ) const;
208
215 void save_likelihood_scan_csv(const std::string& path,
216 const LikelihoodScanGrid& grid) const;
217
224 void update_cache(const std::vector<ParamId>& p_specs = std::vector<ParamId>());
225
229 std::map<ParamId, double> get_all_obss_deps();
230
234 std::map<ParamId, double> get_p_specs(const std::vector<ParamId>& p_specs);
235
239 std::map<ParamId, std::map<ParamId, double>> get_all_correlations();
240
244 std::map<ExperimentObs, std::map<ExperimentObs, double>> get_all_obs_correlations();
245
249 std::map<ExperimentObs, double> get_obs_exp();
250
254 void print_cache();
255
256private:
257 std::shared_ptr<StatisticManager> manager;
258};
259
260#endif
Concrete reader for nuisance-parameter definition files.
Adapter from ObservableInterface to the statistical model interface.
High-level, user-facing entry point to compute flavor observables.
Concrete statistical proxy forwarding correlation queries to CorrelationProvider.
Statistics-layer adapter over the core DependencyPruner service.
Statistics-layer adapter for retrieving leaf parameter sources.
Statistics-layer proxy for read-only access to parameters and observables.
High-level orchestration of statistical uncertainty propagation, likelihood construction and fit scan...
MCResult compute_uncertainties_and_sampling()
Runs uncertainty propagation and returns both samples and summaries.
std::map< ParamId, double > get_p_specs(const std::vector< ParamId > &p_specs)
std::map< BinnedObservableId, GaussianSummary > compute_uncertainties()
Computes Gaussian uncertainty summaries for all active observables.
void update_cache(const std::vector< ParamId > &p_specs=std::vector< ParamId >())
Refreshes the cached statistical inputs.
std::set< ExperimentObs > selected_experiment_observables() const
Returns the active exact experimental-observable selection.
void select_experiments_all()
Clears any experiment restriction and uses all experiments.
std::map< ParamId, std::map< ParamId, double > > get_all_correlations()
void print_cache()
Prints the current manager cache for diagnostics.
Contour compute_confidence_contour(ParamId p1, ParamId p2, double z, std::array< double, 4 > bounds, ContourOptions options)
Computes a two-dimensional confidence contour.
std::map< ExperimentObs, std::map< ExperimentObs, double > > get_all_obs_correlations()
void set_manual_scan_point(const std::map< ParamId, double > &p_hat, const std::map< ParamId, double > &eta_hat)
Manually sets the central point used by likelihood scans.
void reload_nuisance_specs()
Reloads default and user nuisance specifications.
std::map< ParamId, double > get_all_obss_deps()
Selects all nuisance dependencies relevant to the current observable set.
std::map< ExperimentObs, double > get_obs_exp()
bool has_experiment_observable_selection() const noexcept
Tests whether an exact experimental-observable selection is active.
void clear_nuisance_user_file()
Restores the default user nuisance file lookup.
void set_nuisance_user_file(const std::string &user_yaml_path)
Uses a specific user nuisance configuration file.
FitResultWithMaps compute_MLE(const std::vector< ParamId > &p_specs)
Runs a maximum-likelihood fit for the requested fit parameters.
void save_likelihood_scan_csv(const std::string &path, const LikelihoodScanGrid &grid) const
Saves a likelihood scan grid as a CSV file.
void prepare_likelihood_for_scan(const std::vector< ParamId > &p_specs)
Builds and stores the likelihood objects required for scan calls.
bool has_experiment_selection() const noexcept
Tests whether an experiment selection is active.
void select_experiment(const std::string &experiment)
Restricts the analysis to a single experiment.
void select_experiment_observables(const std::vector< ExperimentObs > &observables)
Restricts the analysis to exact experiment/observable/bin entries.
void select_experiment_observables_all()
Clears any exact experimental-observable restriction.
LikelihoodScanGrid scan_likelihood_around_current_point(ParamId p1, ParamId p2, double x_half_width, double y_half_width, std::size_t nx, std::size_t ny) const
Evaluates a rectangular likelihood scan around the current point.
std::set< std::string > selected_experiments() const
Returns the currently selected experiments.
std::map< ParamId, double > get_active_observable_dependencies()
Returns the nuisance/input parameters currently seen by the statistical manager.
void select_experiments(const std::vector< std::string > &experiments)
Restricts the analysis to a set of experiments.
Runtime options controlling 2D contour computation.
Definition Fit.h:93
Output of a contour extraction algorithm.
User-facing MLE result keyed by physics parameter identifiers.
Regular two-dimensional grid of likelihood-scan evaluations.
Composite identifier for a single parameter.
Definition ParamID.h:57