36 #include "CLHEP/Random/RandGauss.h"
75 while (j < s.size() && s[
j] !=
',' && !isdigit (s[j]) && s[
j] !=
'.')
77 if (j < s.size() && (isdigit (s[j]) || s[
j] ==
'.')) {
78 x = atof (s.c_str() +
j);
99 :_resolution_exponent(0)
109 while (i < s.size() && isspace (s[i]))
117 else if (s[i] ==
'+') {
126 if (i != string::npos) {
132 if (i != string::npos) {
144 : _constant_sigma (C),
145 _resolution_sigma (R),
146 _resolution_exponent(m),
163 : _constant_sigma (0),
164 _resolution_sigma (0),
165 _resolution_exponent(0),
222 return sqrt ((_constant_sigma*_constant_sigma*
p +
223 _resolution_sigma*_resolution_sigma)*
p +
224 _noise_sigma*_noise_sigma);
243 CLHEP::RandGauss
gen (engine);
245 return 1 / gen.fire (1 / x, sigma (
p));
247 return gen.fire (x, sigma (
p));
double R() const
Return the R term (resolution term)
Calculate and represent resolution for a physical quantity.
double m() const
Return the exponent factor in the resolution term.
bool inverse() const
Return the setting of the inverse flag.
double pick(double x, double p, CLHEP::HepRandomEngine &engine) const
Generate random value from a Gaussian distribution described by this resolution. Given a value ...
double _resolution_exponent
double sigma(double p) const
Return the uncertainty for a variable with magnitude p.
Resolution(std::string s="")
Constructor, initialize from a string.
double N() const
Return the N term (noise term)
std::ostream & operator<<(std::ostream &s, const Constraint_Intermed &ci)
Output stream operator, print the content of this Constraint_Intermed to an output stream...
Calculate and represent resolution for a physical quantity.
double C() const
Return the C term (constant term)