An axis with categorical bins.
For example, the following creates an axis with 3 categories:
std::vector<std::string>
categories = {
"a",
"b",
"c"};
An axis with categorical bins.
It is possible to disable the overflow bin by passing enableOverflowBin = false. In that case, arguments outside the axis will be silently discarded.
- Warning
- This is part of the ROOT 7 prototype! It will change without notice. It might trigger earthquakes. Feedback is welcome!
Definition at line 41 of file RCategoricalAxis.hxx.
#include <ROOT/RCategoricalAxis.hxx>
◆ ArgumentType
◆ RCategoricalAxis()
| ROOT::Experimental::RCategoricalAxis::RCategoricalAxis |
( |
std::vector< std::string > | categories, |
|
|
bool | enableOverflowBin = true ) |
|
inlineexplicit |
Construct an axis object with categories.
- Parameters
-
| [in] | categories | the categories without duplicates, must define at least one bin (i.e. size >= 1) |
| [in] | enableOverflowBin | whether to enable the overflow bin |
Definition at line 56 of file RCategoricalAxis.hxx.
◆ ComputeLinearizedIndex()
| RLinearizedIndex ROOT::Experimental::RCategoricalAxis::ComputeLinearizedIndex |
( |
std::string_view | x | ) |
const |
|
inline |
Compute the linarized index for a single argument.
The normal bins have indices \(0\) to \(fCategories.size() - 1\) and the overflow bin has index \(fCategories.size()\). If the argument is not a recognized category and the overflow bin is disabled, the return value is invalid.
- Parameters
-
- Returns
- the linearized index that may be invalid
Definition at line 90 of file RCategoricalAxis.hxx.
◆ GetCategories()
| const std::vector< std::string > & ROOT::Experimental::RCategoricalAxis::GetCategories |
( |
| ) |
const |
|
inline |
◆ GetFullRange()
| RBinIndexRange ROOT::Experimental::RCategoricalAxis::GetFullRange |
( |
| ) |
const |
|
inline |
Get the full range of all bins.
This includes the overflow bin, if enabled.
- Returns
- the bin index range of all bins
Definition at line 163 of file RCategoricalAxis.hxx.
◆ GetLinearizedIndex()
Get the linearized index for an RBinIndex.
The normal bins have indices \(0\) to \(fCategories.size() - 1\) and the overflow bin has index \(fCategories.size()\).
- Parameters
-
- Returns
- the linearized index that may be invalid
Definition at line 110 of file RCategoricalAxis.hxx.
◆ GetNNormalBins()
| std::size_t ROOT::Experimental::RCategoricalAxis::GetNNormalBins |
( |
| ) |
const |
|
inline |
◆ GetNormalRange() [1/2]
| RBinIndexRange ROOT::Experimental::RCategoricalAxis::GetNormalRange |
( |
| ) |
const |
|
inline |
Get the range of all normal bins.
- Returns
- the bin index range from the first to the last normal bin, inclusive
Definition at line 128 of file RCategoricalAxis.hxx.
◆ GetNormalRange() [2/2]
Get a range of normal bins.
- Parameters
-
| [in] | begin | the begin of the bin index range (inclusive), must be normal |
| [in] | end | the end of the bin index range (exclusive), must be normal and >= begin |
- Returns
- a bin index range \([begin, end)\)
Definition at line 138 of file RCategoricalAxis.hxx.
◆ GetTotalNBins()
| std::size_t ROOT::Experimental::RCategoricalAxis::GetTotalNBins |
( |
| ) |
const |
|
inline |
◆ HasOverflowBin()
| bool ROOT::Experimental::RCategoricalAxis::HasOverflowBin |
( |
| ) |
const |
|
inline |
◆ Streamer()
| void ROOT::Experimental::RCategoricalAxis::Streamer |
( |
TBuffer & | | ) |
|
|
inline |
ROOT Streamer function to throw when trying to store an object of this class.
Definition at line 170 of file RCategoricalAxis.hxx.
◆ operator==
◆ fCategories
| std::vector<std::string> ROOT::Experimental::RCategoricalAxis::fCategories |
|
private |
◆ fEnableOverflowBin
| bool ROOT::Experimental::RCategoricalAxis::fEnableOverflowBin |
|
private |
The documentation for this class was generated from the following file: