22 if (biasFunctionName ==
"gaussian") {
25 if (biasFunctionName ==
"vonMises") {
28 if (biasFunctionName ==
"generalisedGaussian") {
31 throw MaCh3Exception(__FILE__, __LINE__,
"Unknown multicanonical bias function: " + biasFunctionName);
35 switch (biasFunction) {
41 return "generalisedGaussian";
43 throw MaCh3Exception(__FILE__, __LINE__,
"Unknown multicanonical bias function");
81 void setDebugStream(std::ostream* os,
bool enabled);
85 void FindOscCovParams(
const std::vector<ParameterHandlerBase*>& systematics);
183 std::ostream* debugStream =
nullptr;
184 bool debugEnabled =
false;
#define _MaCh3_Safe_Include_Start_
KS: Avoiding warning checking for headers.
#define _MaCh3_Safe_Include_End_
Custom exception class used throughout MaCh3.
The manager class is responsible for managing configurations and settings.
Helper class for configuring and evaluating multicanonical umbrella weights.
double vonMises_I0_kappa
Cached I0(kappa) value for the von Mises form.
void InitializeMulticanonicalParams(std::vector< ParameterHandlerBase * > &systematics)
Initialise the starting values used by the multicanonical parameter handling.
void InitializeMulticanonicalHandlerConfig(Manager *fitMan, std::vector< ParameterHandlerBase * > &systematics)
Read multicanonical configuration from the yaml via manager and initialise handler state.
double GetMulticanonicalWeightVonMises(double param_value) const
Compute a von Mises multicanonical penalty.
double GetMulticanonicalWeightGaussian(double param_value) const
Compute a Gaussian multicanonical penalty.
double umbrellaWidth
Umbrella width used for the current configuration.
TSpline3 * dcp_spline_IO
Spline for the IO branch, if spline mode is enabled.
void AdjustUmbrellaStepScale(const std::vector< ParameterHandlerBase * > &systematics)
Adjust the parameter-of-interest's step scale according to the width of the umbrella bias function.
int multicanonicalVar_dm23
Parameter index used for the multicanonical delm2_23 weight.
double GetMulticanonicalWeightSpline(double param_value, double delm23) const
Compute the multicanonical penalty using a spline.
M3::BiasFunction umbrellaBiasFunction
Selected bias function for multicanonical weights.
TSpline3 * dcp_spline_NO
Spline for the NO branch, if spline mode is enabled.
std::string multicanonicalVarName
Parameter name used for the multicanonical weight, most often delta_cp.
double GetMulticanonicalWeight() const
Compute the multicanonical penalty for the configured bias mode.
bool multicanonicalSpline
Toggle for spline-based multicanonical weights.
void FindOscCovParams(const std::vector< ParameterHandlerBase * > &systematics)
Locate the systematic object which contains the parameters used by the handler. Stores the parameter ...
double vonMises_kappa
Von Mises kappa parameter. Analogue of sigma for a gaussian.
double circularDistance(double x, double mean) const
Compute the circular distance between two angles.
MulticanonicalMCMCHandler()
Constructor.
std::string umbrellaBiasFunctionName
Configured bias function name for logging.
double GetMulticanonicalWeightTripleGaussian(double param_value) const
Compute a triple-Gaussian multicanonical penalty.
const M3::float_t * multicanonicalVarValue
Pointer to value of parameter vale used for multicanonical weight, most often delta_cp.
double generalisedGaussian2(double x, double mean, double width) const
Wraps the generalised gaussian function for a given x, mean, and width. Required to handle the wrappi...
double umbrellaMean
Umbrella centre used for the current configuration.
double GetMulticanonicalWeightGenGaussian(double param_value) const
Compute a generalised-Gaussian multicanonical penalty.
const M3::float_t * multicanonicalVar_dm23_value
Pointer to value of delm2_23 weight used for multicanonical weight.
virtual ~MulticanonicalMCMCHandler()
Destructor.
double umbrellaStepScaleFactor
Additional scale factor applied when rescaling the step size. This is for fine tuning.
int oscCovVar
Index of the oscillation-covariance systematic in the current fit.
int multicanonicalVar
Parameter index used for the multicanonical weight, most often delta_cp.
bool umbrellaAdjustStepScale
Toggle for rescaling the step size based on the umbrella width.
double multicanonicalBeta
Global scale factor applied to the multicanonical penalty. 1 is full strength, 0 is no penalty.
Main namespace for MaCh3 software.
M3::BiasFunction ParseBiasFunction(const std::string &biasFunctionName)
std::string BiasFunction_ToString(const M3::BiasFunction &biasFunction)
constexpr double UmbrellaGaussianNormFactor
@ kGaussian
Assumes gaussian prior.