29namespace Experimental {
42 friend class ::ROOT::Experimental::RHistEngine;
44 std::vector<RAxisVariant>
fAxes;
51 throw std::invalid_argument(
"must have at least 1 axis object");
56 const std::vector<RAxisVariant> &
Get()
const {
return fAxes; }
69 for (
auto &&axis :
fAxes) {
76 template <std::size_t
I, std::size_t
N,
typename... A>
79 using ArgumentType = std::tuple_element_t<
I, std::tuple<A...>>;
80 const auto &axis =
fAxes[
I];
82 if (
auto *
regular = axis.GetRegularAxis()) {
83 if constexpr (std::is_convertible_v<ArgumentType, RRegularAxis::ArgumentType>) {
87 throw std::invalid_argument(
"invalid type of argument");
89 }
else if (
auto *variable = axis.GetVariableBinAxis()) {
90 if constexpr (std::is_convertible_v<ArgumentType, RVariableBinAxis::ArgumentType>) {
91 index *= variable->GetTotalNBins();
92 linIndex = variable->ComputeLinearizedIndex(std::get<I>(args));
94 throw std::invalid_argument(
"invalid type of argument");
96 }
else if (
auto *
categorical = axis.GetCategoricalAxis()) {
97 if constexpr (std::is_convertible_v<ArgumentType, RCategoricalAxis::ArgumentType>) {
101 throw std::invalid_argument(
"invalid type of argument");
104 throw std::logic_error(
"unimplemented axis type");
110 if constexpr (
I + 1 <
N) {
113 return {
index,
true};
116 template <std::size_t
N,
typename... A>
130 template <
typename... A>
133 if (
sizeof...(A) !=
fAxes.size()) {
134 throw std::invalid_argument(
"invalid number of arguments to ComputeGlobalIndex");
140 template <
typename Container>
145 throw std::invalid_argument(
"invalid number of indices passed to ComputeGlobalIndex");
148 for (std::size_t i = 0; i <
N; i++) {
150 const auto &axis =
fAxes[i];
152 if (
auto *
regular = axis.GetRegularAxis()) {
155 }
else if (
auto *variable = axis.GetVariableBinAxis()) {
158 }
else if (
auto *
categorical = axis.GetCategoricalAxis()) {
162 throw std::logic_error(
"unimplemented axis type");
177 template <std::
size_t N>
197 std::vector<RBinIndexRange> ranges;
198 for (
auto &&axis :
fAxes) {
199 ranges.push_back(axis.GetFullRange());
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t index
Bin configurations for all dimensions of a histogram.
friend bool operator==(const RAxes &lhs, const RAxes &rhs)
std::size_t GetNDimensions() const
friend bool operator!=(const RAxes &lhs, const RAxes &rhs)
RLinearizedIndex ComputeGlobalIndexImpl(std::size_t index, const std::tuple< A... > &args) const
RLinearizedIndex ComputeGlobalIndex(const std::tuple< A... > &args) const
Compute the global index for all axes.
RBinIndexMultiDimRange GetFullMultiDimRange() const
Get the multidimensional range of all bins.
RLinearizedIndex ComputeGlobalIndexImpl(const std::tuple< A... > &args) const
std::uint64_t ComputeTotalNBins() const
Compute the total number of bins for all axes.
RAxes(std::vector< RAxisVariant > axes)
RLinearizedIndex ComputeGlobalIndexImpl(const Container &indices) const
RLinearizedIndex ComputeGlobalIndex(const std::vector< RBinIndex > &indices) const
Compute the global index for all axes.
void Streamer(TBuffer &)
ROOT Streamer function to throw when trying to store an object of this class.
RLinearizedIndex ComputeGlobalIndex(const std::array< RBinIndex, N > &indices) const
Compute the global index for all axes.
std::vector< RAxisVariant > fAxes
const std::vector< RAxisVariant > & Get() const
A multidimensional range of bin indices.
Buffer base class used for serializing objects.
A linearized index that can be invalid.