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

Samples nuisance parameters and propagates them through a model. More...

#include <MCEngine.h>

Public Member Functions

 MonteCarloEngine (const std::shared_ptr< IModel > &model, const INuisanceSampler &sampler, MCConfig cfg)
 Constructs the Monte Carlo engine.
 
MCRealization sample_predictions (const std::map< ParamId, double > &p) const
 Generates accepted model predictions for a fixed fit-parameter point.
 
MCRealization sample_predictions_serial (const std::map< ParamId, double > &p) const
 
MCRealization sample_predictions_parallel (const std::map< ParamId, double > &p) const
 
MCResult summarize (const std::map< ParamId, double > &p) const
 Runs Monte Carlo propagation and computes summary statistics.
 

Detailed Description

Samples nuisance parameters and propagates them through a model.

The engine repeatedly draws nuisance values from an INuisanceSampler, calls IModel::predict_optimized, rejects failed or non-finite predictions when configured to do so, and returns both raw and summarized Monte Carlo outputs.

Definition at line 171 of file MCEngine.h.

Constructor & Destructor Documentation

◆ MonteCarloEngine()

MonteCarloEngine::MonteCarloEngine ( const std::shared_ptr< IModel > &  model,
const INuisanceSampler sampler,
MCConfig  cfg 
)
inline

Constructs the Monte Carlo engine.

Parameters
modelModel used to compute predictions for each nuisance draw.
samplerNuisance sampler used to generate random parameter maps.
cfgMonte Carlo configuration.

Definition at line 180 of file MCEngine.h.

Member Function Documentation

◆ sample_predictions()

MCRealization MonteCarloEngine::sample_predictions ( const std::map< ParamId, double > &  p) const

Generates accepted model predictions for a fixed fit-parameter point.

Parameters
pFit-parameter values held fixed during the Monte Carlo run.
Returns
Raw accepted observable and nuisance samples.
Exceptions
std::exceptionRe-throws model or sampler failures once the retry policy is exhausted.

Definition at line 287 of file MCEngine.cpp.

◆ sample_predictions_parallel()

MCRealization MonteCarloEngine::sample_predictions_parallel ( const std::map< ParamId, double > &  p) const

Definition at line 304 of file MCEngine.cpp.

◆ sample_predictions_serial()

MCRealization MonteCarloEngine::sample_predictions_serial ( const std::map< ParamId, double > &  p) const

Definition at line 179 of file MCEngine.cpp.

◆ summarize()

MCResult MonteCarloEngine::summarize ( const std::map< ParamId, double > &  p) const

Runs Monte Carlo propagation and computes summary statistics.

In addition to returning the result, the current implementation writes the accepted observable samples to obs_samples.csv.

Parameters
pFit-parameter values held fixed during the Monte Carlo run.
Returns
Raw samples, Gaussian summaries and empirical covariance.

Definition at line 504 of file MCEngine.cpp.


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