5#ifndef ROOT_RAxisVariant
6#define ROOT_RAxisVariant
20namespace Experimental {
32 using VariantType = std::variant<RRegularAxis, RVariableBinAxis, RCategoricalAxis>;
55 return regular->GetNNormalBins();
57 return variable->GetNNormalBins();
61 throw std::logic_error(
"unimplemented axis type");
68 return regular->GetTotalNBins();
70 return variable->GetTotalNBins();
74 throw std::logic_error(
"unimplemented axis type");
84 return regular->GetNormalRange();
86 return variable->GetNormalRange();
90 throw std::logic_error(
"unimplemented axis type");
102 return regular->GetNormalRange(begin, end);
104 return variable->GetNormalRange(begin, end);
108 throw std::logic_error(
"unimplemented axis type");
120 return regular->GetFullRange();
122 return variable->GetFullRange();
126 throw std::logic_error(
"unimplemented axis type");
133 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)
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 .
An axis with variable bins defined by their edges.
Buffer base class used for serializing objects.