5#ifndef ROOT_RAxisVariant
6#define ROOT_RAxisVariant
23namespace Experimental {
35 using VariantType = std::variant<RRegularAxis, RVariableBinAxis, RCategoricalAxis>;
58 return regular->GetNNormalBins();
60 return variable->GetNNormalBins();
64 throw std::logic_error(
"unimplemented axis type");
71 return regular->GetTotalNBins();
73 return variable->GetTotalNBins();
77 throw std::logic_error(
"unimplemented axis type");
87 return regular->GetNormalRange();
89 return variable->GetNormalRange();
93 throw std::logic_error(
"unimplemented axis type");
105 return regular->GetNormalRange(begin, end);
107 return variable->GetNormalRange(begin, end);
111 throw std::logic_error(
"unimplemented axis type");
123 return regular->GetFullRange();
125 return variable->GetFullRange();
129 throw std::logic_error(
"unimplemented axis type");
149 throw std::logic_error(
"unimplemented axis type");
156 void Streamer(
TBuffer &) {
throw std::runtime_error(
"unable to store RAxisVariant"); }
A variant of all supported axis types.
RAxisVariant(RCategoricalAxis axis)
friend bool operator==(const RAxisVariant &lhs, const RAxisVariant &rhs)
RAxisVariant(VariantType axis)
RBinIndexRange GetNormalRange(RBinIndex begin, RBinIndex end) const
Get a range of normal bins.
RBinIndexRange GetFullRange() const
Get the full range of all bins.
std::uint64_t GetNNormalBins() const
RAxisVariant(RVariableBinAxis axis)
void Streamer(TBuffer &)
ROOT Streamer function to throw when trying to store an object of this class.
const VariantType & GetVariant() const
const RRegularAxis * GetRegularAxis() const
const RVariableBinAxis * GetVariableBinAxis() const
std::uint64_t GetTotalNBins() const
std::variant< RRegularAxis, RVariableBinAxis, RCategoricalAxis > VariantType
RBinIndexRange GetNormalRange() const
Get the range of all normal bins.
RAxisVariant(RRegularAxis axis)
RAxisVariant Slice(const RSliceSpec &sliceSpec) const
Slice this axis according to the specification.
const RCategoricalAxis * GetCategoricalAxis() const
A bin index with special values for underflow and overflow bins.
An axis with categorical bins.
A regular axis with equidistant bins in the interval .
Specification of a slice operation along one dimension.
An axis with variable bins defined by their edges.
Buffer base class used for serializing objects.