|
|
Go to the documentation of this file.
7 #include "Alignment/Geners/interface/binaryIO.hh"
8 #include "Alignment/Geners/interface/IOException.hh"
16 : binEdges_(binEdges), nBins_(binEdges.
size() - 1
U), uniform_(
false) {
19 "In npstat::NUHistoAxis constructor: "
20 "number of bin edges is out of range");
32 "In npstat::NUHistoAxis constructor: "
33 "number of bins is out of range");
69 const int binnum =
delta - 1;
74 double bval = (x - left) / (right - left);
80 }
else if (static_cast<unsigned>(binnum) >=
nBins_) {
83 double bval =
nBins_ - 1
U + (x - left) / (right - left);
86 if (bval > static_cast<double>(
nBins_))
93 return binnum + (x - left) / (right - left);
100 return binnum + (x - left) / (right - left) - 0.5;
126 int binnum =
delta - 1;
129 else if (static_cast<unsigned>(binnum) >=
nBins_)
136 gs::write_pod(of,
label_);
138 gs::write_pod(of,
c);
143 static const gs::ClassId current(gs::ClassId::makeId<NUHistoAxis>());
144 current.ensureSameId(
id);
146 std::vector<double> binEdges;
149 gs::read_pod_vector(
in, &binEdges);
151 gs::read_pod(
in, &unif);
153 throw gs::IOReadFailure(
154 "In npstat::UHistoAxis::read: "
155 "input stream failure");
bool operator!=(const NUHistoAxis &) const
int binNumber(double x) const
Equidistant sequences of points in either linear or log space.
Determine if two doubles are within requested relative tolerance of each other.
std::vector< double > binEdges_
static NUHistoAxis * read(const gs::ClassId &id, std::istream &in)
Histogram axis with non-uniform bin spacing.
bool write(std::ostream &of) const
void swap(edm::DataFrameContainer &lhs, edm::DataFrameContainer &rhs)
__host__ constexpr __device__ RandomIt upper_bound(RandomIt first, RandomIt last, const T &value, Compare comp={})
NUHistoAxis rebin(unsigned newBins) const
const std::string & label() const
unsigned closestValidBin(double x) const
bool isClose(const NUHistoAxis &, double tol) const
double fltBinNumber(double x, bool mapLeftEdgeTo0=true) const
bool operator==(const NUHistoAxis &) const
bool closeWithinTolerance(const double &a, const double &b, const double &tol)
Exceptions for the npstat namespace.