16#ifndef ROOT7_RHistImpl
17#define ROOT7_RHistImpl
32namespace Experimental {
34template <
int DIMENSIONS,
class PRECISION,
template <
int D_,
class P_>
class...
STAT>
40using AxisIter_t = std::array<RAxisBase::const_iterator, NDIMS>;
55 return static_cast<int>(
a) &
static_cast<int>(
b);
70template <
int DIMENSIONS>
87 static constexpr int GetNDim() {
return DIMENSIONS; }
178 virtual std::unique_ptr<RHistImplBase>
Clone()
const = 0;
183 virtual void FillN(
const std::span<const CoordArray_t> xN,
const std::span<const Weight_t> weightN) = 0;
186 virtual void FillN(
const std::span<const CoordArray_t> xN) = 0;
270template <
int IDX,
class AXISTUPLE>
271struct RGetNBinsNoOverCount;
275 int operator()(
const AXES &axes)
const {
return std::get<0>(axes).GetNBinsNoOver(); }
278template <
int I,
class AXES>
284template <
class... AXISCONFIG>
287 using axesTuple = std::tuple<AXISCONFIG...>;
294template <
int IDX,
class AXISTUPLE>
295struct RGetNBinsCount;
299 int operator()(
const AXES &axes)
const {
return std::get<0>(axes).GetNBins(); }
302template <
int I,
class AXES>
308template <
class... AXISCONFIG>
311 using axesTuple = std::tuple<AXISCONFIG...>;
312 return RGetNBinsCount<
sizeof...(AXISCONFIG) - 1, axesTuple>()(axesTuple{axisArgs...});
316template <
class... AXISCONFIG>
319 using axesTuple = std::tuple<AXISCONFIG...>;
320 return RGetNBinsCount<
sizeof...(AXISCONFIG) - 1, axesTuple>()(axesTuple{axisArgs...}) -
RGetNBinsNoOverCount<
sizeof...(AXISCONFIG) - 1, axesTuple>()(axesTuple{axisArgs...});
326template <
int I,
class AXES>
327struct RFillIterRange;
335template <
int I,
class AXES>
339 range[0][
I] = std::get<I>(axes).begin();
340 range[1][
I] = std::get<I>(axes).end();
348template <
int I,
int NDIMS,
typename BINS,
class AXES>
349struct RGetNRegularBinsBefore;
351template <
int NDIMS,
typename BINS,
class AXES>
357template <
int I,
int NDIMS,
typename BINS,
class AXES>
361 constexpr const int thisAxis = NDIMS -
I - 1;
362 binSizes[thisAxis] = binSizes[thisAxis-1] * std::get<thisAxis-1>(axes).GetNBinsNoOver();
383template <
int I,
int NDIMS,
typename BINS,
class AXES>
384struct RComputeGlobalBin;
386template <
int NDIMS,
typename BINS,
class AXES>
388 int operator()(
int total_regular_bins_before,
const AXES &,
const BINS &,
const BINS &,
const BINS &)
const
390 return total_regular_bins_before;
394template <
int I,
int NDIMS,
typename BINS,
class AXES>
396 int operator()(
int total_regular_bins_before,
const AXES &axes,
const BINS &virtualBins,
const BINS &binSizes,
const BINS &localBins)
const
400 const int num_underflow_bins =
static_cast<int>(!std::get<I>(axes).CanGrow());
401 const int num_regular_bins_before =
402 std::max(virtualBins[
I] - num_underflow_bins, 0);
403 total_regular_bins_before += num_regular_bins_before * binSizes[
I];
410 if (localBins[
I] < 1)
411 return total_regular_bins_before;
413 return RComputeGlobalBin<
I - 1, NDIMS, BINS, AXES>()(total_regular_bins_before, axes, virtualBins, binSizes, localBins);
420template <
int I,
int NDIMS,
class AXES>
421struct RComputeLocalBinsInitialisation;
423template <
int NDIMS,
class AXES>
425 void operator()(std::array<int, NDIMS-1> , std::array<int, NDIMS-1> ,
const AXES & )
const
429template <
int I,
int NDIMS,
class AXES>
431 void operator()(std::array<int, NDIMS-1>& bins_per_hyperplane, std::array<int, NDIMS-1>& regular_bins_per_hyperplane,
const AXES &axes)
const
433 constexpr const int thisAxis = NDIMS -
I - 1;
449template <
int I,
int NDIMS,
class AXES>
450struct RComputeLocalBins;
452template <
int NDIMS,
class AXES>
455 int &, std::array<int, NDIMS-1> ,
456 std::array<int, NDIMS-1> ,
int ,
461template <
int I,
int NDIMS,
class AXES>
463 void operator()(
const AXES &axes,
int &unprocessed_previous_overflow_bin,
464 int &num_regular_bins_before, std::array<int, NDIMS-1> bins_per_hyperplane,
465 std::array<int, NDIMS-1> regular_bins_per_hyperplane,
int curr_bins_per_hyperplane,
466 int curr_regular_bins_per_hyperplane)
const
470 const int num_underflow_hyperplanes =
471 static_cast<int>(!std::get<I>(axes).CanGrow());
472 const int bins_in_underflow_hyperplane =
473 num_underflow_hyperplanes * bins_per_hyperplane[
I-1];
478 const int overflow_bins_per_regular_hyperplane =
479 bins_per_hyperplane[
I-1] - regular_bins_per_hyperplane[
I-1];
484 if (overflow_bins_per_regular_hyperplane != 0) {
487 const int overflow_bins_in_regular_hyperplanes =
490 unprocessed_previous_overflow_bin
491 - bins_in_underflow_hyperplane,
494 overflow_bins_per_regular_hyperplane
495 * std::get<I>(axes).GetNBinsNoOver()
500 const int num_regular_hyperplanes_before =
501 overflow_bins_in_regular_hyperplanes
502 / overflow_bins_per_regular_hyperplane;
503 num_regular_bins_before +=
504 num_regular_hyperplanes_before
505 * regular_bins_per_hyperplane[
I-1];
510 unprocessed_previous_overflow_bin =
511 overflow_bins_in_regular_hyperplanes
512 % overflow_bins_per_regular_hyperplane;
518 if (unprocessed_previous_overflow_bin >= bins_in_underflow_hyperplane) {
519 num_regular_bins_before +=
520 std::get<I>(axes).GetNBinsNoOver()
521 * regular_bins_per_hyperplane[
I-1];
528 unprocessed_previous_overflow_bin = 0;
533 if (unprocessed_previous_overflow_bin == 0)
537 (axes, unprocessed_previous_overflow_bin, num_regular_bins_before, bins_per_hyperplane,
538 regular_bins_per_hyperplane, curr_bins_per_hyperplane, curr_regular_bins_per_hyperplane);
548template <
int I,
int NDIMS,
typename BINS,
class AXES,
class BINTYPE>
549struct RComputeLocalBinsRaw;
551template <
int NDIMS,
typename BINS,
class AXES,
class BINTYPE>
553 void operator()(BINS & ,
const AXES & ,
int , BINTYPE )
const
557template <
int I,
int NDIMS,
typename BINS,
class AXES,
class BINTYPE>
559 void operator()(BINS &virtualBins,
const AXES &axes,
int zeroBasedGlobalBin, BINTYPE GetNBinType)
const
561 constexpr const int thisAxis = NDIMS -
I - 1;
562 virtualBins[thisAxis] = zeroBasedGlobalBin % (std::get<thisAxis>(axes).*GetNBinType)();
563 RComputeLocalBinsRaw<
I - 1, NDIMS, BINS, AXES, BINTYPE>()(virtualBins, axes, zeroBasedGlobalBin / (std::get<thisAxis>(axes).*GetNBinType)(), GetNBinType);
573template <
int I,
int NDIMS,
typename BINS,
class AXES,
class BINTYPE>
574struct RComputeGlobalBinRaw;
576template <
int NDIMS,
typename BINS,
class AXES,
class BINTYPE>
578 int operator()(
int globalVirtualBin,
const AXES & ,
const BINS & ,
int , BINTYPE )
const
580 return globalVirtualBin;
584template <
int I,
int NDIMS,
typename BINS,
class AXES,
class BINTYPE>
586 int operator()(
int globalVirtualBin,
const AXES &axes,
const BINS &zeroBasedLocalBins,
int binSize, BINTYPE GetNBinType)
const
588 constexpr const int thisAxis = NDIMS -
I - 1;
589 globalVirtualBin += zeroBasedLocalBins[thisAxis] * binSize;
590 binSize *= (std::get<thisAxis>(axes).*GetNBinType)();
602template <
int I,
int NDIMS,
typename BINS,
class AXES>
603struct RVirtualBinsToLocalBins;
605template <
int NDIMS,
typename BINS,
class AXES>
611template <
int I,
int NDIMS,
typename BINS,
class AXES>
613 void operator()(BINS &localBins,
const AXES &axes,
const BINS &virtualBins)
const
615 constexpr const int thisAxis = NDIMS -
I - 1;
616 if ((!std::get<thisAxis>(axes).CanGrow()) && (virtualBins[thisAxis] == 0)) {
618 }
else if ((!std::get<thisAxis>(axes).CanGrow()) && (virtualBins[thisAxis] == (std::get<thisAxis>(axes).GetNBins() - 1))) {
621 const int regular_bin_offset = -
static_cast<int>(std::get<thisAxis>(axes).CanGrow());
622 localBins[thisAxis] = virtualBins[thisAxis] - regular_bin_offset;
636template <
int I,
int NDIMS,
typename BINS,
class AXES>
637struct RLocalBinsToVirtualBins;
639template <
int NDIMS,
typename BINS,
class AXES>
645template <
int I,
int NDIMS,
typename BINS,
class AXES>
647 void operator()(BINS &virtualBins,
const AXES &axes,
const BINS &localBins)
const
649 constexpr const int thisAxis = NDIMS -
I - 1;
650 switch (localBins[thisAxis]) {
652 virtualBins[thisAxis] = 0;
break;
654 virtualBins[thisAxis] = std::get<thisAxis>(axes).GetNBins() - 1;
break;
656 virtualBins[thisAxis] = localBins[thisAxis] -
static_cast<int>(std::get<thisAxis>(axes).CanGrow());
663template <
int I,
int NDIMS,
typename BINS,
typename COORD,
class AXES>
664struct RFindLocalBins;
666template <
int NDIMS,
typename BINS,
typename COORD,
class AXES>
668 void operator()(BINS & ,
const AXES & ,
const COORD & )
const
672template <
int I,
int NDIMS,
typename BINS,
typename COORD,
class AXES>
674 void operator()(BINS &localBins,
const AXES &axes,
const COORD &coords)
const
676 constexpr const int thisAxis = NDIMS -
I - 1;
677 localBins[thisAxis] = std::get<thisAxis>(axes).FindBin(coords[thisAxis]);
678 RFindLocalBins<
I - 1, NDIMS, BINS, COORD, AXES>()(localBins, axes, coords);
684template <
int I,
int NDIMS,
typename BINS,
typename COORD,
class AXES>
685struct RLocalBinsToCoords;
687template <
int NDIMS,
typename BINS,
typename COORD,
class AXES>
693template <
int I,
int NDIMS,
typename BINS,
typename COORD,
class AXES>
697 constexpr const int thisAxis = NDIMS -
I - 1;
698 int axisbin = localBins[thisAxis];
700 case EBinCoord::kBinFrom: coords[thisAxis] = std::get<thisAxis>(axes).GetBinFrom(axisbin);
break;
701 case EBinCoord::kBinCenter: coords[thisAxis] = std::get<thisAxis>(axes).GetBinCenter(axisbin);
break;
702 case EBinCoord::kBinTo: coords[thisAxis] = std::get<thisAxis>(axes).GetBinTo(axisbin);
break;
708template <
class... AXISCONFIG>
711 std::array<
const RAxisBase *,
sizeof...(AXISCONFIG)> axisViews{{&axes...}};
720template <
class DATA,
class... AXISCONFIG>
722 static_assert(
sizeof...(AXISCONFIG) == DATA::GetNDim(),
"Number of axes must equal histogram dimension");
724 friend typename DATA::Hist_t;
732 template <
int NDIMS = DATA::GetNDim()>
743 std::unique_ptr<ImplBase_t>
Clone()
const override {
744 return std::unique_ptr<ImplBase_t>(
new RHistImpl(*
this));
757 const RAxisBase &
GetAxis(
int iAxis)
const final {
return *std::apply(Internal::GetAxisView<AXISCONFIG...>,
fAxes)[iAxis]; }
765 template <
int NDIMS,
typename BINTYPE>
778 template <
int NDIMS,
typename BINTYPE>
812 if (std::all_of(local_bins.cbegin(), local_bins.cend(),
813 [](
int bin) { return bin >= 1; })) {
814 for (
int bin = 0; bin < NDIMS; bin++)
815 local_bins[bin] -= 1;
822 BinArray_t virtual_bins = LocalBinsToVirtualBins<NDIMS>(local_bins);
829 const int neg_1based_virtual_bin = -global_virtual_bin - 1;
840 int total_regular_bins_before = 0;
855 (total_regular_bins_before,
fAxes, virtual_bins, bin_sizes, local_bins);
860 return neg_1based_virtual_bin + total_regular_bins_before;
868 if (global_bin >= 1) {
870 for (
int bin = 0; bin < NDIMS; ++bin)
871 computed_bins[bin] += 1;
872 return computed_bins;
879 const int corrected_virtual_overflow_bin = -global_bin - 1;
933 std::array<
int, NDIMS - 1> bins_per_hyperplane;
934 std::array<
int, NDIMS - 1> regular_bins_per_hyperplane;
941 int unprocessed_previous_overflow_bin = corrected_virtual_overflow_bin;
942 int num_regular_bins_before = 0;
944 (
fAxes, unprocessed_previous_overflow_bin, num_regular_bins_before, bins_per_hyperplane,
945 regular_bins_per_hyperplane, curr_bins_per_hyperplane, curr_regular_bins_per_hyperplane);
957 num_regular_bins_before +=
958 unprocessed_previous_overflow_bin * std::get<0>(
fAxes).GetNBinsNoOver();
964 const int global_virtual_bin =
965 corrected_virtual_overflow_bin + num_regular_bins_before;
971 return VirtualBinsToLocalBins<NDIMS>(virtual_bins);
981 int result = ComputeGlobalBin<DATA::GetNDim()>(localBins);
997 ret = ComputeGlobalBin<DATA::GetNDim()>(localBins);
1008 int result = ComputeGlobalBin<DATA::GetNDim()>(localBins);
1016 BinArray_t localBins = ComputeLocalBins<DATA::GetNDim()>(binidx);
1023 BinArray_t localBins = ComputeLocalBins<DATA::GetNDim()>(binidx);
1032 BinArray_t localBins = ComputeLocalBins<DATA::GetNDim()>(binidx);
1041 BinArray_t localBins = ComputeLocalBins<DATA::GetNDim()>(binidx);
1051 void FillN(
const std::span<const CoordArray_t> xN,
const std::span<const Weight_t> weightN)
final
1054 if (xN.size() != weightN.size()) {
1055 R__ERROR_HERE(
"HIST") <<
"Not the same number of points and weights!";
1060 for (
size_t i = 0; i < xN.size(); ++i) {
1061 Fill(xN[i], weightN[i]);
1068 void FillN(
const std::span<const CoordArray_t> xN)
final
1070 for (
auto &&
x: xN) {
1079 this->
GetStat().Fill(x, bin, w);
1133template <
class DATA,
class... AXISCONFIG>
1137template <
class DATA,
class... AXISCONFIG>
1142template <
class DATA,
class... AXISCONFIG>
1150template <
class DATA>
1153 RHistImplRuntime(std::array<
RAxisConfig, DATA::GetNDim()>&& axisCfg);
#define R__ERROR_HERE(GROUP)
typedef void((*Func_t)())
Iterates over the bins of a RHist or RHistImpl.
Interface class for RHistImpl.
Weight_t & GetBinContent(int binidx)
Get the bin content (sum of weights) for bin index binidx (non-const).
int GetNOverflowBins() const noexcept final
Get the number of under- and overflow bins of this histogram, excluding all regular bins.
RHistImplBase(const RHistImplBase &)=default
void(RHistImplBase::*)(const CoordArray_t &x, Weight_t w) FillFunc_t
Type of the Fill(x, w) function.
virtual double GetBinUncertainty(const CoordArray_t &x) const =0
Get the bin uncertainty for the bin at coordinate x.
void AddBinContent(int binidx, Weight_t w)
Add w to the bin at index bin.
int GetNBinsNoOver() const noexcept final
Get the number of bins in this histogram, excluding possible under- and overflow bins.
RHistImplBase(RHistImplBase &&)=default
Hist::CoordArray_t< DATA::GetNDim()> CoordArray_t
Type of the coordinates.
virtual std::unique_ptr< RHistImplBase > Clone() const =0
DATA Stat_t
Type of the statistics (bin content, uncertainties etc).
Stat_t & GetStat() noexcept
Non-const access to statistics.
virtual void FillN(const std::span< const CoordArray_t > xN)=0
Interface function to fill a vector or array of coordinates.
Weight_t GetBinContent(int binidx) const
Get the bin content (sum of weights) for bin index binidx.
const Stat_t & GetStat() const noexcept
Const access to statistics.
Stat_t fStatistics
The histogram's bin content, uncertainties etc.
virtual void FillN(const std::span< const CoordArray_t > xN, const std::span< const Weight_t > weightN)=0
Interface function to fill a vector or array of coordinates with corresponding weights.
virtual Weight_t GetBinContent(const CoordArray_t &x) const =0
Get the bin content (sum of weights) for the bin at coordinate x.
std::array< int, DATA::GetNDim()> BinArray_t
Type of the local per-axis bin indices.
RHistImplBase(std::string_view title, size_t numBins, size_t numOverflowBins)
double GetBinContentAsDouble(int binidx) const final
Get the bin content (sum of weights) for bin index binidx, cast to double.
int GetNBins() const noexcept final
Get the number of bins in this histogram, including possible under- and overflow bins.
typename DATA::Weight_t Weight_t
Type of the bin content (and thus weights).
RHistImplBase(size_t numBins, size_t numOverflowBins)
virtual FillFunc_t GetFillFunc() const =0
Retrieve the pointer to the overridden Fill(x, w) function.
Base class for RHistImplBase that abstracts out the histogram's PRECISION.
virtual int GetNOverflowBins() const noexcept=0
Number of under- and overflow bins of this histogram, excluding all regular bins.
virtual ~RHistImplPrecisionAgnosticBase()
virtual int GetBinIndex(const CoordArray_t &x) const =0
Given the coordinate x, determine the index of the bin.
RHistImplPrecisionAgnosticBase(std::string_view title)
std::array< int, DIMENSIONS > BinArray_t
Type of the local per-axis bin indices.
RHistImplPrecisionAgnosticBase(RHistImplPrecisionAgnosticBase &&)=default
virtual int GetNBins() const noexcept=0
Number of bins of this histogram, including all overflow and underflow bins.
virtual bool HasBinUncertainty() const =0
Whether this histogram's statistics provide storage for uncertainties, or whether uncertainties are d...
virtual int GetNBinsNoOver() const noexcept=0
Number of bins of this histogram, excluding all overflow and underflow bins.
virtual CoordArray_t GetBinTo(int binidx) const =0
Get the upper edge in all dimensions of the bin with index binidx.
virtual BinArray_t GetLocalBins(int binidx) const =0
Given the index of the bin, determine the local per-axis bins x.
std::string fTitle
The histogram's title.
RHistImplPrecisionAgnosticBase()=default
RHistImplPrecisionAgnosticBase(const RHistImplPrecisionAgnosticBase &)=default
const std::string & GetTitle() const
Get the histogram title.
Hist::AxisIterRange_t< DIMENSIONS > AxisIterRange_t
Range type.
static constexpr int GetNDim()
Number of dimensions of the coordinates.
virtual int GetBinIndexAndGrow(const CoordArray_t &x) const =0
Given the coordinate x, determine the index of the bin, possibly growing axes for which x is out of r...
virtual int GetBinIndexFromLocalBins(const BinArray_t &x) const =0
Given the local per-axis bins x, determine the index of the bin.
virtual double GetBinUncertainty(int binidx) const =0
Get the uncertainty of the bin with index binidx.
virtual double GetBinContentAsDouble(int binidx) const =0
The bin content, cast to double.
virtual const RAxisBase & GetAxis(int iAxis) const =0
Get a base-class view on axis with index iAxis.
virtual CoordArray_t GetBinCenter(int binidx) const =0
Get the center in all dimensions of the bin with index binidx.
virtual AxisIterRange_t GetRange() const =0
Get an AxisIterRange_t for the whole histogram, excluding under- and overflow.
virtual CoordArray_t GetBinFrom(int binidx) const =0
Get the lower edge in all dimensions of the bin with index binidx.
void Fill(const CoordArray_t &x, Weight_t w=1.)
Add a single weight w to the bin at coordinate x.
BinArray_t GetLocalBins(int binidx) const final
Get the local per-axis bin indices x for the given bin index, using ComputeLocalBins().
int GetBinIndexAndGrow(const CoordArray_t &x) const final
Get the bin index for the given coordinates x, growing the axes as needed.
int ComputeGlobalBinRaw(const BinArray_t &zeroBasedLocalBins, BINTYPE GetNBinType) const
Computes a zero-based global bin index, given...
const_iterator end() const noexcept
AxisIterRange_t< DATA::GetNDim()> GetRange() const final
Get the begin() and end() for each axis.
BinArray_t ComputeLocalBins(int global_bin) const
Computes the local per-axis bin indices of a certain bin on an NDIMS-dimensional histogram,...
double GetBinUncertainty(const CoordArray_t &x) const final
Get the bin uncertainty for the bin at coordinate x.
const_iterator begin() const noexcept
CoordArray_t GetBinCenter(int binidx) const final
Get the center coordinates of the bin with index binidx.
int GetBinIndexFromLocalBins(const BinArray_t &x) const final
Get the bin index for the given local per-axis bin indices x, using ComputeGlobalBin().
FillFunc_t GetFillFunc() const final
Retrieve the fill function for this histogram implementation, to prevent the virtual function call fo...
std::tuple< AXISCONFIG... > fAxes
The histogram's axes.
void GrowAxis(int, double)
Grow the axis number iAxis to fit the coordinate x.
Weight_t GetBinContent(const CoordArray_t &x) const final
Get the content of the bin at position x.
int GetBinIndex(const CoordArray_t &x) const final
Get the bin index for the given coordinates x.
BinArray_t VirtualBinsToLocalBins(const BinArray_t &virtualBins) const
Converts zero-based virtual bins where the underflow bin has index 0 and the overflow bin has index N...
const RAxisBase & GetAxis(int iAxis) const final
Normalized axes access, converting from actual axis type to base class.
typename Hist::AxisIterRange_t< NDIMS > AxisIterRange_t
int ComputeGlobalBin(BinArray_t &local_bins) const
Computes the global index of a certain bin on an NDIMS-dimensional histogram, knowing the local per-a...
typename ImplBase_t::BinArray_t BinArray_t
double GetBinUncertainty(int binidx) const final
Return the uncertainties for the given bin index.
bool HasBinUncertainty() const final
Whether this histogram's statistics provide storage for uncertainties, or whether uncertainties are d...
std::unique_ptr< ImplBase_t > Clone() const override
RHistBinIter< ImplBase_t > iterator
void FillN(const std::span< const CoordArray_t > xN, const std::span< const Weight_t > weightN) final
Fill an array of weightN to the bins specified by coordinates xN.
BinArray_t ComputeLocalBinsRaw(int zeroBasedGlobalBin, BINTYPE GetNBinType) const
Computes zero-based local bin indices, given...
const std::tuple< AXISCONFIG... > & GetAxes() const
Get the axes of this histogram.
CoordArray_t GetBinTo(int binidx) const final
Get the coordinates of the high limit of the bin with index binidx.
void FillN(const std::span< const CoordArray_t > xN) final
Fill an array of weightN to the bins specified by coordinates xN.
CoordArray_t GetBinFrom(int binidx) const final
Get the coordinates of the low limit of the bin with index binidx.
BinArray_t LocalBinsToVirtualBins(const BinArray_t &localBins) const
Converts local axis bins from the standard kUnderflowBin/kOverflowBin for under/overflow bin indexing...
iterator begin() noexcept
RHistBinIter< const ImplBase_t > const_iterator
typename ImplBase_t::CoordArray_t CoordArray_t
Random const_iterator through bins.
Histogram axis base class.
virtual int GetNBinsNoOver() const noexcept=0
Get the number of bins, excluding under- and overflow.
static constexpr const int kUnderflowBin
Index of the underflow bin, if any.
static constexpr const int kOverflowBin
Index of the overflow bin, if any.
int GetNBins() const noexcept
Get the number of bins, including under- and overflow.
Objects used to configure the different axis types.
basic_string_view< char > string_view
EOverflow
Kinds of under- and overflow handling.
@ kNoOverflow
Exclude under- and overflows.
@ kUnderOver
Include both under- and overflows.
std::array< AxisIter_t< NDIMS >, 2 > AxisIterRange_t
Range over n dimensional axes - a pair of arrays of n axis iterators.
bool operator&(EOverflow a, EOverflow b)
std::array< RAxisBase::const_iterator, NDIMS > AxisIter_t
Iterator over n dimensional axes - an array of n axis iterators.
EFindStatus
Status of FindBin(x) and FindAdjustedBin(x)
@ kValid
The returned bin index is valid.
@ kCanGrow
The coordinate could fit after growing the axis.
int GetNBinsFromAxes(AXISCONFIG... axisArgs)
Get the number of bins in whole hist, including under- and overflow.
EBinCoord
Specifies if the wanted result is the bin's lower edge, center or higher edge.
@ kBinTo
Get the bin high edge.
@ kBinFrom
Get the lower bin edge.
@ kBinCenter
Get the bin center.
int GetNOverflowBinsFromAxes(AXISCONFIG... axisArgs)
Get the number of under- and overflow bins in whole hist, excluding regular bins.
int GetNBinsNoOverFromAxes(AXISCONFIG... axisArgs)
Get the number of bins in whole hist, excluding under- and overflow.
static std::array< const RAxisBase *, sizeof...(AXISCONFIG)> GetAxisView(const AXISCONFIG &... axes) noexcept
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...
int operator()(int globalVirtualBin, const AXES &, const BINS &, int, BINTYPE) const
Recursively computes a zero-based global bin index, given...
int operator()(int globalVirtualBin, const AXES &axes, const BINS &zeroBasedLocalBins, int binSize, BINTYPE GetNBinType) const
int operator()(int total_regular_bins_before, const AXES &, const BINS &, const BINS &, const BINS &) const
Recursively gets the total number of regular bins before the current dimension, when computing a glob...
int operator()(int total_regular_bins_before, const AXES &axes, const BINS &virtualBins, const BINS &binSizes, const BINS &localBins) const
void operator()(std::array< int, NDIMS-1 >, std::array< int, NDIMS-1 >, const AXES &) const
Recursively compute some quantities needed for ComputeLocalBins, namely the total number of bins per ...
void operator()(std::array< int, NDIMS-1 > &bins_per_hyperplane, std::array< int, NDIMS-1 > ®ular_bins_per_hyperplane, const AXES &axes) const
void operator()(BINS &, const AXES &, int, BINTYPE) const
Recursively computes zero-based local bin indices, given...
void operator()(BINS &virtualBins, const AXES &axes, int zeroBasedGlobalBin, BINTYPE GetNBinType) const
void operator()(const AXES &, int &, int &, std::array< int, NDIMS-1 >, std::array< int, NDIMS-1 >, int, int) const
Recursively computes the number of regular bins before the current dimension, as well as the number o...
void operator()(const AXES &axes, int &unprocessed_previous_overflow_bin, int &num_regular_bins_before, std::array< int, NDIMS-1 > bins_per_hyperplane, std::array< int, NDIMS-1 > regular_bins_per_hyperplane, int curr_bins_per_hyperplane, int curr_regular_bins_per_hyperplane) const
void operator()(Hist::AxisIterRange_t< std::tuple_size< AXES >::value > &, const AXES &) const
Recursively fills the ranges of all axes, excluding under- and overflow.
void operator()(Hist::AxisIterRange_t< std::tuple_size< AXES >::value > &range, const AXES &axes) const
void operator()(BINS &, const AXES &, const COORD &) const
Find the per-axis local bin indices associated with a certain set of coordinates.
void operator()(BINS &localBins, const AXES &axes, const COORD &coords) const
int operator()(const AXES &axes) const
Recursively gets the total number of bins in whole hist, including under- and overflow.
int operator()(const AXES &axes) const
int operator()(const AXES &axes) const
Recursively gets the total number of bins in whole hist, excluding under- and overflow.
int operator()(const AXES &axes) const
void operator()(BINS &, const AXES &) const
Recursively gets the number of regular bins just before the current dimension.
void operator()(BINS &binSizes, const AXES &axes) const
void operator()(COORD &, const AXES &, const BINS &, EBinCoord) const
Recursively converts local axis bins from the standard kUnderflowBin/kOverflowBin for under/overflow ...
void operator()(COORD &coords, const AXES &axes, const BINS &localBins, EBinCoord kind) const
void operator()(BINS &, const AXES &, const BINS &) const
Recursively converts local axis bins from the standard kUnderflowBin/kOverflowBin for under/overflow ...
void operator()(BINS &virtualBins, const AXES &axes, const BINS &localBins) const
void operator()(BINS &, const AXES &, const BINS &) const
Recursively converts zero-based virtual bins where the underflow bin has index 0 and the overflow bin...
void operator()(BINS &localBins, const AXES &axes, const BINS &virtualBins) const