25 if (!HasSameBinBordersAs(other))
29 auto lbl_ptr =
dynamic_cast<const RAxisLabels*
>(
this);
30 auto other_lbl_ptr =
dynamic_cast<const RAxisLabels*
>(&other);
31 if (
bool(lbl_ptr) !=
bool(other_lbl_ptr)) {
45 double fracBinIdx = GetFirstBin() + FindBinRaw(
x);
49 int binIdx = std::round(fracBinIdx);
50 double binOffset = fracBinIdx - binIdx;
56 if (binIdx < GetFirstBin())
60 if (binIdx > GetLastBin() + 1)
76 fLow == other_eq.
fLow &&
78 CanGrow() == other_eq.
CanGrow();
84 double fracBinIdx = FindBinRaw(
x);
85 const int binIdx = fracBinIdx;
89 if (binIdx >= GetFirstBin()) {
90 const double lowBound = GetBinFrom(binIdx);
94 if (binIdx <= GetLastBin()) {
95 const double upBound = GetBinTo(binIdx);
120 if (source.HasSameBinningAs(target))
124 int idxTargetLow = target.GetBinIndexForLowEdge(source.GetMinimum());
125 int idxTargetHigh = target.GetBinIndexForLowEdge(source.GetMaximum());
126 if (idxTargetLow < 0 || idxTargetHigh < 0)
133 if (source.GetInverseBinWidth() == target.GetInverseBinWidth())
141 if (
std::fabs(target.GetInverseBinWidth() * source.GetNBinsNoOver() -
142 source.GetInverseBinWidth() * (idxTargetHigh - idxTargetLow)) > 1
E-6 * target.GetInverseBinWidth())
Histogram axis base class.
virtual bool HasSameBinBordersAs(const RAxisBase &other) const
Check if two axis have the same bin borders.
static constexpr const int kInvalidBin
Special bin index returned to signify that no bin matches a request.
bool HasSameBinningAs(const RAxisBase &other) const
Check if two axes use the same binning convention, i.e.
virtual ~RAxisBase()
Virtual destructor needed in this inheritance-based design.
Axis with equidistant bin borders.
int GetBinIndexForLowEdge(double x) const noexcept final override
If the coordinate x is within 10 ULPs of a bin low edge coordinate, return the bin for which this is ...
bool HasSameBinBordersAs(const RAxisBase &other) const override
See RAxisBase::HasSameBinBordersAs.
double fInvBinWidth
The inverse of the bin width.
bool CanGrow() const noexcept override
This axis cannot grow.
unsigned int fNBinsNoOver
Number of bins excluding under- and overflow.
double fLow
The lower limit of the axis.
An axis with non-equidistant bins (also known as "variable binning").
bool HasSameBinBordersAs(const RAxisBase &other) const override
See RAxisBase::HasSameBinBordersAs.
int GetBinIndexForLowEdge(double x) const noexcept final override
If the coordinate x is within 10 ULPs of a bin low edge coordinate, return the bin for which this is ...
std::vector< double > fBinBorders
Bin borders, one more than the number of regular bins.
A RAxisGrow that has a label assigned to each bin and a bin width of 1.
@ kLabelsCmpSame
Both axes have the same labels, mapping to the same bins.
LabelsCmpFlags CompareBinLabels(const RAxisLabels &other) const noexcept
Compare the labels of this axis with those of another axis.
EAxisCompatibility CanMap(const RAxisEquidistant &target, const RAxisEquidistant &source) noexcept
Whether (and how) the source axis can be merged into the target axis.
@ kContains
The source is a subset of bins of the target axis.
@ kIdentical
Source and target axes are identical.
@ kIncompatible
The source axis and target axis have different binning.
@ kSampling
The bins of the source axis have finer granularity, but the bin borders are compatible.
VecExpr< UnaryOp< Fabs< T >, VecExpr< A, T, D >, T >, T, D > fabs(const VecExpr< A, T, D > &rhs)
constexpr Double_t E()
Base of natural log: