1 #ifndef NPSTAT_NUHISTOAXIS_HH_
2 #define NPSTAT_NUHISTOAXIS_HH_
17 #include "Alignment/Geners/interface/ClassId.hh"
21 template <
typename Numeric,
class Axis>
35 NUHistoAxis(
const std::vector<double>& binEdges,
const char*
label =
nullptr);
39 inline double min()
const {
return min_; }
40 inline double max()
const {
return max_; }
64 inline void setLabel(
const char* newlabel) {
label_ = newlabel ? newlabel :
""; }
76 double fltBinNumber(
double x,
bool mapLeftEdgeTo0 =
true)
const;
95 inline gs::ClassId
classId()
const {
return gs::ClassId(*
this); }
96 bool write(std::ostream&
of)
const;
99 static inline const char*
classname() {
return "npstat::NUHistoAxis"; }
100 static inline unsigned version() {
return 1; }
113 template <
typename Numeric,
class Axis>
132 #endif // NPSTAT_NUHISTOAXIS_HH_
unsigned closestValidBin(double x) const
std::vector< double > binEdges_
double rightBinEdge(const int binNum) const
int binNumber(double x) const
unsigned overflowIndex(const double x, unsigned *binNum) const
void setLabel(const char *newlabel)
bool write(std::ostream &of) const
bool operator!=(const NUHistoAxis &) const
NUHistoAxis rebin(unsigned newBins) const
double leftBinEdge(const int binNum) const
double binCenter(const int binNum) const
gs::ClassId classId() const
static unsigned version()
Interval< double > interval() const
static NUHistoAxis * read(const gs::ClassId &id, std::istream &in)
bool isClose(const NUHistoAxis &, double tol) const
double fltBinNumber(double x, bool mapLeftEdgeTo0=true) const
Interval< double > binInterval(const int binNum) const
static const char * classname()
bool operator==(const NUHistoAxis &) const
double binWidth(const int binNum) const
Template to represent intervals in one dimension.
const std::string & label() const