6 #include "Alignment/Geners/interface/binaryIO.hh" 7 #include "Alignment/Geners/interface/IOException.hh" 17 "In npstat::HistoAxis constructor: " 18 "number of bins is out of range");
39 int binnum =
static_cast<int>(floor((
x -
min_) /
bw_));
41 if (binnum < static_cast<int>(
nBins_))
44 if (binnum >= static_cast<int>(
nBins_))
60 const unsigned binnum =
static_cast<unsigned>(floor((
x -
min_) /
bw_));
70 "In npstat::HistoAxis::binNumberMapper: " 71 "bin width is zero. Mapper can not be constructed.");
79 "In npstat::HistoAxis::kernelScanMapper: " 80 "bin width is zero. Mapper can not be constructed.");
95 "In npstat::HistoAxis::overflowIndexWeighted: " 96 "must have more than one bin");
97 const double dbin = (
x -
min_) /
bw_;
101 }
else if (dbin >=
nBins_ - 0.5) {
105 const unsigned bin =
static_cast<unsigned>(dbin - 0.5);
122 static const gs::ClassId current(gs::ClassId::makeId<HistoAxis>());
123 current.ensureSameId(
id);
125 double min = 0.0,
max = 0.0;
129 gs::read_pod(
in, &
min);
130 gs::read_pod(
in, &
max);
137 throw gs::IOReadFailure(
138 "In npstat::HistoAxis::read: " 139 "input stream failure");
bool write(std::ostream &of) const
LinearMapper1d binNumberMapper(bool mapLeftEdgeTo0=true) const
unsigned overflowIndexWeighted(double x, unsigned *binNumber, double *weight) const
const std::string & label() const
bool closeWithinTolerance(const double &a, const double &b, const double &tol)
unsigned closestValidBin(double x) const
void swap(Association< C > &lhs, Association< C > &rhs)
Exceptions for the npstat namespace.
def binNumber(station, sl)
HistoAxis rebin(unsigned newBins) const
static HistoAxis * read(const gs::ClassId &id, std::istream &in)
Determine if two doubles are within requested relative tolerance of each other.
CircularMapper1d kernelScanMapper(bool doubleRange) const
bool operator==(const HistoAxis &) const
bool isClose(const HistoAxis &, double tol) const
Histogram axis with equidistant bins.
bool operator!=(const HistoAxis &) const
int binNumber(double x) const