Hyperiso 1.0.3
Modular flavour-physics calculations, Wilson coefficients and statistical inference
Loading...
Searching...
No Matches
NuisanceSpec.h
Go to the documentation of this file.
1#ifndef NUISANCESPEC_H
2#define NUISANCESPEC_H
3
4#include <ostream>
5#include <utility>
6#include <unordered_map>
7
8#include "ParamID.h"
9#include "MarginalType.h"
10
32
36using NuisanceRegistry = std::unordered_map<ParamId, NuisanceSpec>;
37
46inline const char* to_string(MarginalType type) {
47 switch (type) {
48 case MarginalType::GAUSSIAN: return "GAUSSIAN";
49 case MarginalType::HALF_GAUSSIAN: return "HALF_GAUSSIAN";
50 case MarginalType::FLAT: return "FLAT";
51 case MarginalType::LIKELIHOOD: return "LIKELIHOOD";
52 default: return "UNKNOWN";
53 }
54}
55
64inline std::ostream& operator<<(std::ostream& os, const NuisanceSpec& spec) {
65 os << "NuisanceSpec{"
66 << "param_id=" << spec.param_id
67 << ", bounds=(" << spec.bounds.first << ", " << spec.bounds.second << ")"
68 << ", marginal=" << to_string(spec.marginal)
69 << "}";
70
71 return os;
72}
73
83
92 return NuisanceRegistryPrintable{registry};
93}
94
103inline std::ostream& operator<<(std::ostream& os, const NuisanceRegistryPrintable& printable) {
104 const auto& registry = printable.registry;
105
106 os << "NuisanceRegistry{\n";
107 for (const auto& [param_id, spec] : registry) {
108 os << " [" << param_id << "] -> " << spec << "\n";
109 }
110 os << "}";
111
112 return os;
113}
114
115#endif // NUISANCESPEC_H
Enumeration of supported one-dimensional marginal distribution types.
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.
NuisanceRegistryPrintable as_printable(const NuisanceRegistry &registry)
Wraps a registry for formatted stream output.
std::unordered_map< ParamId, NuisanceSpec > NuisanceRegistry
Registry of nuisance specifications indexed by parameter id.
const char * to_string(MarginalType type)
Converts a marginal type to a stable diagnostic string.
std::ostream & operator<<(std::ostream &os, const NuisanceSpec &spec)
Streams a compact representation of one nuisance specification.
Lightweight wrapper enabling pretty-printing of a nuisance registry.
const NuisanceRegistry & registry
Registry referenced for formatted output.
Specification of one nuisance parameter.
MarginalType marginal
Marginal model used for the nuisance constraint.
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.
Definition ParamID.h:57