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_
std::vector< double > binEdges_
NUHistoAxis rebin(unsigned newBins) const
unsigned overflowIndex(const double x, unsigned *binNum) const
unsigned closestValidBin(double x) const
void setLabel(const char *newlabel)
double binCenter(const int binNum) const
double fltBinNumber(double x, bool mapLeftEdgeTo0=true) const
gs::ClassId classId() const
double rightBinEdge(const int binNum) const
bool write(std::ostream &of) const
bool operator==(const NUHistoAxis &) const
Interval< double > binInterval(const int binNum) const
Interval< double > interval() const
static unsigned version()
int binNumber(double x) const
static NUHistoAxis * read(const gs::ClassId &id, std::istream &in)
bool operator!=(const NUHistoAxis &) const
const std::string & label() const
static const char * classname()
double binWidth(const int binNum) const
double leftBinEdge(const int binNum) const
Template to represent intervals in one dimension.
bool isClose(const NUHistoAxis &, double tol) const