1#ifndef OBSERVABLEMANAGER_H
2#define OBSERVABLEMANAGER_H
6#include <unordered_set>
7#include <unordered_map>
233 std::map<ObservableId, std::vector<ObservableValue>>
evaluate_all();
463 std::unordered_map<DecayId, std::shared_ptr<DecayParent>> decays;
466 std::map<ObservableId, std::shared_ptr<Observable>> obss;
499 std::optional<DecayId> active_decay;
Interface for read-only access to parameters used by observable computations.
std::unordered_map< DecayId, size_t > DecayThreadSnapshot
std::unordered_map< DecayId, std::any > DecayConfigSnapshot
High-level observable wrapper (user-facing) that connects experimental inputs to theory predictions.
bool is_decay_binned(Decays decay) const
Return whether this decay has at least one observable requiring q² bins.
ObsManager set_decay_threads(Decays dec, size_t n_threads)
Set the thread option for a decay that supports parallel cache filling.
std::map< ObservableId, std::vector< ObservableValue > > evaluate_all()
Evaluate all currently registered observables.
void restore_decay_configs(const DecayConfigSnapshot &snapshot)
Restore runtime decay configurations on matching decays.
void set_decay_config(Decays dec, std::any config)
Set a decay configuration object.
std::unordered_set< ParamId > get_all_ops_deps(ObservableId id)
Get the full allowed dependency set for a given observable.
std::vector< BinnedObservableId > get_current_obss()
Get the set of observable ids currently registered in the manager.
void add_custom_decay(DecayId id, std::shared_ptr< DecayParent > ptr)
Register a custom decay implementation.
void add_obs_deps(Observables id, std::unordered_set< ParamId > params)
Add a set of dependencies (parameters) to an observable (public enum).
ObsManager set_lblll_threads(size_t n_threads)
Set the thread option for the Lambda_b -> Lambda l+ l- decay.
void reload_params()
Reload cached parameters for all registered decays.
ObservablePortsConfig & get_ports()
Access manager ports (non-const reference).
ObsManager remove_obs(Observables id)
Remove an observable (public enum) from the manager.
void set_all_decay_threads(size_t n_threads)
Set all thread-configurable decays to the same thread count.
void add_obs_dep(Observables id, ParamId param)
Add a single dependency (parameter) to an observable (public enum).
ObsManager set_bkstarll_threads(size_t n_threads)
Set the thread option for the B -> K* l+ l- decay.
std::vector< ObservableValue > evaluate(Observables id)
Evaluate a single observable (public enum).
void add_all_obs_deps(Observables id)
Attach all allowed dependencies to an observable (public enum).
void select_decay(ObservableId id)
Enable the decay needed by an observable and disable all others.
DecayThreadSnapshot snapshot_decay_threads() const
Snapshot thread settings for all decays with thread configuration support.
bool is_observable_binned(Observables obs) const
Return whether a specific observable requires q² bins.
DecayConfigSnapshot snapshot_decay_configs() const
Snapshot runtime decay configurations that expose one.
ObsManager set_bsphi_threads(size_t n_threads)
Set the thread option for the Bs -> phi l+ l- decay.
void enable_obs()
Enable all observables' decays sequentially.
void restore_decay_threads(const DecayThreadSnapshot &snapshot)
Restore a previous decay thread snapshot.
std::shared_ptr< Observable > get_obs(Observables id)
Retrieve an observable (public enum).
ObsManager add_obs(Observables id, QCDOrder order, bool add_deps=false)
Add an observable (public enum) to the manager.
ObsManager set_bkll_threads(size_t n_threads)
Set the thread option for the B -> K l+ l- decay.
std::vector< ObservableSelectionSnapshot > snapshot_observable_selection() const
Capture selected observables, bins, orders and dependencies.
Identifies an observable together with a numerical bin.
Dependency container (“ports”) for observable computations.
std::unordered_set< ParamId > dependencies
Container for a computed observable value, optionally binned.
Composite identifier for a single parameter.