|
|
Go to the documentation of this file.
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);
114 gs::write_pod(of,
min_);
115 gs::write_pod(of,
max_);
116 gs::write_pod(of,
label_);
117 gs::write_pod(of,
nBins_);
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");
Histogram axis with equidistant bins.
HistoAxis rebin(unsigned newBins) const
bool isClose(const HistoAxis &, double tol) const
bool operator==(const HistoAxis &) const
Determine if two doubles are within requested relative tolerance of each other.
bool operator!=(const HistoAxis &) const
bool write(std::ostream &of) const
void swap(edm::DataFrameContainer &lhs, edm::DataFrameContainer &rhs)
unsigned overflowIndexWeighted(double x, unsigned *binNumber, double *weight) const
const std::string & label() const
def binNumber(station, sl)
LinearMapper1d binNumberMapper(bool mapLeftEdgeTo0=true) const
static HistoAxis * read(const gs::ClassId &id, std::istream &in)
unsigned closestValidBin(double x) const
CircularMapper1d kernelScanMapper(bool doubleRange) const
bool closeWithinTolerance(const double &a, const double &b, const double &tol)
Exceptions for the npstat namespace.
int binNumber(double x) const