15 #ifndef ROOT7_THistView 16 #define ROOT7_THistView 38 template <
class HISTVIEW>
41 bool operator()(
int idx) {
return fHistView.IsBinOutOfRange(idx); }
48 template <
int DIMENSIONS,
class PRECISION>
58 fHist(hist), fNBins(nbins), fRange(range) {}
64 void SetRange(
int axis,
double from,
double to) {
65 TAxisView axis = fHist.GetImpl()->GetAxis(axis);
66 fRange[axis] = axis.
FindBin(from);
67 fRange[axis] = axis.
FindBin(to);
72 size_t nbins = fHist.GetNBins();
73 while (IsBinOutOfRange(beginidx) && beginidx < nbins)
std::array< TAxisBase::const_iterator, NDIM > AxisIter_t
Iterator over n dimensional axes - an array of n axis iterators.
void SetRange(int axis, double from, double to)
Namespace for new ROOT classes and functions.
int FindBin(double x) const noexcept
Find the bin containing coordinate x. Forwards to the underlying axis.
Common view on a TAxis, no matter what its kind.
const_iterator end() const noexcept
Hist::AxisIter_t< DIMENSIONS > AxisIter_t
THistView(Hist_t &hist, int nbins, const AxisRange_t &range)
Hist::AxisIterRange_t< DIMENSIONS > AxisRange_t
const_iterator begin() const noexcept
A predicate for THistBinIterBase to accept all bins.
std::array< AxisIter_t< NDIM >, 2 > AxisIterRange_t
Range over n dimensional axes - a pair of arrays of n axis iterators.
bool IsBinOutOfRange(int idx) const noexcept
A view on a histogram, selecting a range on a subset of dimensions.
A bin iterator taking a predicate whether it should skip a bin.
Histogram class for histograms with DIMENSIONS dimensions, where each bin count is stored by a value ...