8 std::shared_ptr<IStatParameterProxy> parameter_proxy
10 : parameter_proxy_(
std::move(parameter_proxy))
12 if (!parameter_proxy_) {
13 throw std::invalid_argument(
14 "MarginalConfigFactory: parameter_proxy is null"
31 return FlatMarginalCfg {mu - sigma * std::sqrt(3), mu + sigma * std::sqrt(3)};
33 throw std::logic_error(
34 "MarginalConfigFactory: HALF_GAUSSIAN parameter marginals are not implemented"
37 throw std::logic_error(
38 "MarginalConfigFactory: LIKELIHOOD parameter marginals are not implemented"
41 throw std::invalid_argument(
"Unknown marginal type");
50 throw std::invalid_argument(
51 "MarginalConfigFactory: nuisance specification does not match parameter block/code"
56 const auto [lower, upper] = spec.
bounds;
57 if (!std::isfinite(lower) || !std::isfinite(upper) || !(lower < upper)) {
58 throw std::invalid_argument(
59 "MarginalConfigFactory: flat nuisance bounds must be finite and strictly ordered"
65 return create(pid, marginal);
70 std::map<ExperimentObs, double> sigma =
74 for (
const auto& [experiment, uncertainty] : sigma) {
75 if (experiment == oid) {
79 throw std::out_of_range(
80 "MarginalConfigFactory: no combined uncertainty found for the requested observable"
83 for (
const auto& [experiment, uncertainty] : sigma) {
84 if (experiment == oid) {
86 -uncertainty * std::sqrt(3),
87 uncertainty * std::sqrt(3)
91 throw std::out_of_range(
92 "MarginalConfigFactory: no combined uncertainty found for the requested observable"
95 throw std::logic_error(
96 "MarginalConfigFactory: HALF_GAUSSIAN observable marginals are not implemented"
99 throw std::logic_error(
100 "MarginalConfigFactory: LIKELIHOOD observable marginals are not implemented"
103 throw std::invalid_argument(
"Unknown marginal type");
Factory for building marginal-distribution configuration objects.
MarginalType
Supported marginal-distribution families.
@ GAUSSIAN
Symmetric Gaussian marginal.
@ HALF_GAUSSIAN
Asymmetric / half-Gaussian-like marginal (currently mapped to split Gaussian logic).
@ LIKELIHOOD
Discrete likelihood-based marginal built from weighted support points.
@ FLAT
Uniform (flat) marginal on a finite interval.
MarginalConfigFactory(std::shared_ptr< IStatParameterProxy > parameter_proxy)
Constructs the factory with its parameter-access port.
MarginalConfig create(ParamId pid, MarginalType marginal) const
Builds a marginal configuration from a parameter identifier.
Hash specialization for SymbolId<Tag>.
Configuration object for FlatMarginal.
Configuration object for GaussianMarginal.
Specification of one nuisance parameter.
std::pair< double, double > bounds
Inclusive lower and upper bounds for the nuisance value.
ParamId param_id
Parameter identifier, usually an LHA block/code pair.
Composite identifier for a single parameter.
BlockName block
Name of the block where the parameter is stored.
LhaID code
Index or multi-index of the parameter inside the block.