Hyperiso 1.0.3
Modular flavour-physics calculations, Wilson coefficients and statistical inference
Loading...
Searching...
No Matches
ObservableInterfaceProxy Class Referencefinal

Concrete IModel implementation backed by ObservableInterface. More...

#include <ObservableInterfaceProxy.h>

Inheritance diagram for ObservableInterfaceProxy:
Collaboration diagram for ObservableInterfaceProxy:

Public Member Functions

 ObservableInterfaceProxy (std::shared_ptr< ObservableInterface > obs, std::vector< ParamId > p_specs, std::vector< ParamId > eta_specs)
 Constructs the proxy with explicit fit and nuisance parameter lists.
 
 ObservableInterfaceProxy (std::shared_ptr< ObservableInterface > obs, std::shared_ptr< IStatParamOptimizerProxy > spop)
 Constructs the proxy with a parameter optimizer backend.
 
std::shared_ptr< IModelclone_for_worker () const override
 Returns the number of currently active binned observables.
 
bool can_clone_for_worker () const override
 Whether clone_for_worker is implemented.
 
std::unique_ptr< IModelThreadGuardforce_decay_threads (size_t n_threads) override
 Temporarily force internal model/decay thread counts.
 
std::size_t n_observables () const override
 Returns the number of currently active binned observables.
 
void prepare_for_prediction () override
 Materialize model-side runtime state before repeated predictions.
 
std::unordered_set< ParamIdget_obs_deps (ObservableId id) override
 Returns the model parameters required by an observable.
 
std::vector< BinnedObservableIdget_obs_ids () override
 Returns the identifiers of the currently active observable bins.
 
std::map< ObservableId, std::vector< ObservableValue > > predict_optimized (const std::map< ParamId, double > &p, const std::map< ParamId, double > &eta) override
 Computes model predictions for a given parameter point.
 
void compute_observables () const
 Forces computation of the currently configured observables.
 
- Public Member Functions inherited from IModel
virtual ~IModel ()=default
 Default virtual destructor.
 

Detailed Description

Concrete IModel implementation backed by ObservableInterface.

The proxy translates statistical fit/nuisance parameter maps into updates of the underlying parameter optimizer proxy, commits those updates, then delegates prediction computation to ObservableInterface.

Note
The constructor taking explicit fit and nuisance lists stores those lists for compatibility with older call sites. The active prediction path requires an optimizer proxy to apply parameter values.

Definition at line 34 of file ObservableInterfaceProxy.h.

Constructor & Destructor Documentation

◆ ObservableInterfaceProxy() [1/2]

ObservableInterfaceProxy::ObservableInterfaceProxy ( std::shared_ptr< ObservableInterface obs,
std::vector< ParamId p_specs,
std::vector< ParamId eta_specs 
)

Constructs the proxy with explicit fit and nuisance parameter lists.

Parameters
obsObservable interface to wrap.
p_specsFit-parameter identifiers handled by the statistical layer.
eta_specsNuisance-parameter identifiers handled by the statistical layer.

Definition at line 30 of file ObservableInterfaceProxy.cpp.

◆ ObservableInterfaceProxy() [2/2]

ObservableInterfaceProxy::ObservableInterfaceProxy ( std::shared_ptr< ObservableInterface obs,
std::shared_ptr< IStatParamOptimizerProxy spop 
)

Constructs the proxy with a parameter optimizer backend.

Parameters
obsObservable interface to wrap.
spopOptimizer proxy used to set and commit parameter values.

Definition at line 38 of file ObservableInterfaceProxy.cpp.

Member Function Documentation

◆ can_clone_for_worker()

bool ObservableInterfaceProxy::can_clone_for_worker ( ) const
inlineoverridevirtual

Whether clone_for_worker is implemented.

Reimplemented from IModel.

Definition at line 61 of file ObservableInterfaceProxy.h.

◆ clone_for_worker()

std::shared_ptr< IModel > ObservableInterfaceProxy::clone_for_worker ( ) const
overridevirtual

Returns the number of currently active binned observables.

Returns
Number of observable bins exposed by the model.

Reimplemented from IModel.

Definition at line 40 of file ObservableInterfaceProxy.cpp.

◆ compute_observables()

void ObservableInterfaceProxy::compute_observables ( ) const
virtual

Forces computation of the currently configured observables.

This method is primarily used to initialize or refresh model-side caches before the statistical manager builds likelihood inputs.

Implements IModel.

Definition at line 109 of file ObservableInterfaceProxy.cpp.

◆ force_decay_threads()

std::unique_ptr< IModelThreadGuard > ObservableInterfaceProxy::force_decay_threads ( size_t  )
overridevirtual

Temporarily force internal model/decay thread counts.

The returned guard restores the previous state on destruction. Implementations that do not support runtime thread control may return nullptr.

Reimplemented from IModel.

Definition at line 50 of file ObservableInterfaceProxy.cpp.

◆ get_obs_deps()

std::unordered_set< ParamId > ObservableInterfaceProxy::get_obs_deps ( ObservableId  id)
overridevirtual

Returns the model parameters required by an observable.

Parameters
idObservable identifier.
Returns
Set of parameter identifiers on which the observable depends.

Implements IModel.

Definition at line 73 of file ObservableInterfaceProxy.cpp.

◆ get_obs_ids()

std::vector< BinnedObservableId > ObservableInterfaceProxy::get_obs_ids ( )
overridevirtual

Returns the identifiers of the currently active observable bins.

Returns
Ordered list of binned observable identifiers.

Implements IModel.

Definition at line 77 of file ObservableInterfaceProxy.cpp.

◆ n_observables()

std::size_t ObservableInterfaceProxy::n_observables ( ) const
overridevirtual

Returns the number of currently active binned observables.

Returns
Number of observable bins exposed by the model.

Implements IModel.

Definition at line 57 of file ObservableInterfaceProxy.cpp.

◆ predict_optimized()

std::map< ObservableId, std::vector< ObservableValue > > ObservableInterfaceProxy::predict_optimized ( const std::map< ParamId, double > &  p,
const std::map< ParamId, double > &  eta 
)
overridevirtual

Computes model predictions for a given parameter point.

Parameters
pMap of fit-parameter identifiers to values.
etaMap of nuisance-parameter identifiers to values.
Returns
Predicted observable values grouped by observable identifier.
Exceptions
std::runtime_errorif no optimizer proxy is available.

Implements IModel.

Definition at line 81 of file ObservableInterfaceProxy.cpp.

◆ prepare_for_prediction()

void ObservableInterfaceProxy::prepare_for_prediction ( )
overridevirtual

Materialize model-side runtime state before repeated predictions.

Implementations may use this hook to lazily build dependent parameter blocks, Wilson groups, decay caches, or other mutable runtime structures that must exist before the first parameter update is committed. The default implementation is a no-op so existing non-cloneable models keep their previous behavior.

Reimplemented from IModel.

Definition at line 59 of file ObservableInterfaceProxy.cpp.


The documentation for this class was generated from the following files: