19 ParameterDistribution::ParameterDistribution(
const std::string& par_name,
21 size_t nbr_samples,
double sigma_factor,
23 :
IParameterized(
"ParameterDistribution"), m_name(par_name), m_nbr_samples(nbr_samples),
24 m_sigma_factor(sigma_factor), m_limits(limits), m_xmin(1.0), m_xmax(-1.0)
26 mP_distribution.reset(distribution.clone());
27 if (m_sigma_factor < 0.0)
29 "ParameterDistribution::ParameterDistribution() -> Error."
30 "sigma factor cannot be negative");
33 "ParameterDistribution::ParameterDistribution() -> Error."
34 "Number of samples can't be zero.");
37 ParameterDistribution::ParameterDistribution(
const std::string& par_name,
39 size_t nbr_samples,
double xmin,
double xmax)
40 :
IParameterized(
"ParameterDistribution"), m_name(par_name), m_nbr_samples(nbr_samples),
41 m_sigma_factor(0.0), m_xmin(xmin), m_xmax(xmax)
43 mP_distribution.reset(distribution.clone());
44 if (m_sigma_factor < 0.0) {
46 "ParameterDistribution::ParameterDistribution() -> Error."
47 "sigma factor cannot be negative");
49 if (nbr_samples == 0) {
51 "ParameterDistribution::ParameterDistribution() -> Error."
52 "Number of samples can't be zero.");
56 "ParameterDistribution::ParameterDistribution() -> Error."
63 m_nbr_samples(other.m_nbr_samples), m_sigma_factor(other.m_sigma_factor),
64 m_linked_par_names(other.m_linked_par_names), m_limits(other.m_limits), m_xmin(other.m_xmin),
67 mP_distribution.reset(other.mP_distribution->clone());
70 ParameterDistribution::~ParameterDistribution() =
default;
75 this->m_name = other.m_name;
76 m_nbr_samples = other.m_nbr_samples;
77 m_sigma_factor = other.m_sigma_factor;
78 mP_distribution.reset(other.mP_distribution->clone());
79 m_linked_par_names = other.m_linked_par_names;
80 m_limits = other.m_limits;
81 m_xmin = other.m_xmin;
82 m_xmax = other.m_xmax;
89 m_linked_par_names.push_back(par_name);
95 if (mP_distribution && mP_distribution->isDelta())
103 return mP_distribution->equidistantSamplesInRange(m_nbr_samples, m_xmin, m_xmax);
105 return mP_distribution->equidistantSamples(m_nbr_samples, m_sigma_factor, m_limits);
110 return mP_distribution.get();
115 return mP_distribution.get();
Defines classes representing one-dimensional distributions.
Defines many exception classes in namespace Exceptionss.
Defines class ParameterDistribution.
Interface for one-dimensional distributions.
Manages a local parameter pool, and a tree of child pools.
A parametric distribution function, for use with any model parameter.
ParameterDistribution & operator=(const ParameterDistribution &other)
Overload assignment operator.
size_t getNbrSamples() const
get number of samples for this distribution
std::vector< ParameterSample > generateSamples() const
generate list of sampled values with their weight
Limits for a real fit parameter.