1 #ifndef NPSTAT_BINSUMMARY_HH_
2 #define NPSTAT_BINSUMMARY_HH_
17 #include "geners/ClassId.hh"
20 class StatAccumulator;
21 class WeightedStatAccumulator;
42 double minValue,
double maxValue);
61 template<
class Accumulator>
65 template<
class Accumulator>
83 {
return operator=(
static_cast<double>(loc));}
84 inline BinSummary& operator=(
const unsigned char& loc)
85 {
return operator=(
static_cast<double>(loc));}
87 {
return operator=(
static_cast<double>(loc));}
89 {
return operator=(
static_cast<double>(loc));}
91 {
return operator=(
static_cast<double>(loc));}
96 inline double location()
const {
return location_;}
97 inline double rangeDown()
const {
return rangeDown_;}
98 inline double rangeUp()
const {
return rangeUp_;}
122 double noThrowMin(
double valueIfNoData=-DBL_MAX)
const;
123 double noThrowMax(
double valueIfNoData=DBL_MAX)
const;
131 bool hasLimits()
const;
141 void setStdev(
double newValue);
142 void setRangeDown(
double newValue);
143 void setRangeUp(
double newValue);
144 void setRanges(
double newRangeDown,
double newRangeUp);
145 void setMin(
double newValue);
146 void setMax(
double newValue);
147 void setLimits(
double newMin,
double newMax);
148 void setLocationAndLimits(
double newLocation,
149 double newMin,
double newMax);
173 if (denom == 0.0)
throw std::domain_error(
174 "In npstat::BinSummary::operator/=: division by zero");
240 {
return !(*
this == r);}
244 inline gs::ClassId classId()
const {
return gs::ClassId(*
this);}
245 bool write(std::ostream& of)
const;
248 static inline const char* classname() {
return "npstat::BinSummary";}
249 static inline unsigned version() {
return 1;}
250 static void restore(
const gs::ClassId&
id, std::istream& in,
253 static void validateBinSummary(
const char* where,
double location,
254 double down,
double up,
255 double min,
double max);
264 #include "npstat/stat/BinSummary.icc"
Definition: BinSummary.hh:28
BinSummary & operator/=(const double denom)
Definition: BinSummary.hh:171
BinSummary(const Accumulator &acc)
void scaleWidth(double scale)
BinSummary & operator+=(const BinSummary &r)
double location() const
Definition: BinSummary.hh:96
bool operator!=(const BinSummary &r) const
Definition: BinSummary.hh:239
bool operator==(const BinSummary &r) const
BinSummary operator*(const double r) const
Definition: BinSummary.hh:179
double noThrowStdev(double valueIfNoData=0.0) const
BinSummary & operator=(const Accumulator &acc)
Definition: BinSummary.hh:66
BinSummary operator-(const BinSummary &r) const
Definition: BinSummary.hh:228
BinSummary(double location, double rangeDown, double rangeUp, double minValue, double maxValue)
BinSummary(bool location)
void setLocation(double newValue)
BinSummary operator/(const double r) const
Definition: BinSummary.hh:187
BinSummary(double location, double rangeDown, double rangeUp)
BinSummary & operator=(const double &location)
BinSummary & operator*=(double scaleFactor)
BinSummary operator+(const BinSummary &r) const
Definition: BinSummary.hh:220
BinSummary(double location, double stdev)
BinSummary & operator-=(const BinSummary &r)
Definition: AbsArrayProjector.hh:14