35 #include "CLHEP/Random/RandGauss.h" 74 while (j < s.size() && s[j] !=
',' && !isdigit (s[j]) && s[j] !=
'.')
76 if (j < s.size() && (isdigit (s[j]) || s[j] ==
'.')) {
77 x = atof (s.c_str() + j);
98 :_resolution_exponent(0)
108 while (i < s.size() && isspace (s[i]))
116 else if (s[i] ==
'+') {
125 if (i != string::npos) {
131 if (i != string::npos) {
242 CLHEP::RandGauss
gen (engine);
244 return 1 / gen.fire (1 / x,
sigma (
p));
246 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.
friend std::ostream & operator<<(std::ostream &s, const Resolution &r)
Output stream operator, print the content of this Resolution to an output stream. ...
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
T x() const
Cartesian x coordinate.
double sigma(double p) const
Return the uncertainty for a variable with magnitude p.
def gen(fragment, howMuch)
Production test section ####.
Resolution(std::string s="")
Constructor, initialize from a string.
double N() const
Return the N term (noise term)
Calculate and represent resolution for a physical quantity.
double C() const
Return the C term (constant term)