8 const double xmin = gridAxis.
min();
9 const double xmax = gridAxis.
max();
10 const double hbw = 0.5 * (xmax -
xmin) / (nBins - 1
U);
11 HistoAxis ax(nBins, xmin - hbw, xmax + hbw, gridAxis.
label().c_str());
24 const unsigned nCoords = gridAxis.
nCoords();
25 std::vector<double> binEdges;
26 binEdges.reserve(nCoords + 1
U);
27 binEdges.push_back(xMin);
28 for (
unsigned i = 0;
i < nCoords; ++
i) {
32 "In npstat::convertToHistoAxis: " 33 "conversion is impossible");
34 const double halfbin = x -
xMin;
36 binEdges.push_back(xMin);
44 std::vector<double> coords;
45 coords.reserve(nBins);
const std::string & label() const
const std::string & label() const
Functions for converting between grid and histogram axes.
double coordinate(const unsigned i) const
Exceptions for the npstat namespace.
double binCenter(const int binNum) const
UniformAxis convertToGridAxis(const HistoAxis &histoAxis)
double binCenter(const int binNum) const
HistoAxis convertToHistoAxis(const UniformAxis &gridAxis)
const std::string & label() const