|
ROOT
Reference Guide |
|
Go to the documentation of this file.
35 if (!HasSameBinBordersAs(other))
39 auto lbl_ptr =
dynamic_cast<const RAxisLabels*
>(
this);
40 auto other_lbl_ptr =
dynamic_cast<const RAxisLabels*
>(&other);
41 if (
bool(lbl_ptr) !=
bool(other_lbl_ptr)) {
55 double fracBinIdx = GetFirstBin() + FindBinRaw(
x);
59 int binIdx = std::round(fracBinIdx);
60 double binOffset = fracBinIdx - binIdx;
66 if (binIdx < GetFirstBin())
70 if (binIdx > GetLastBin() + 1)
86 fLow == other_eq.
fLow &&
88 CanGrow() == other_eq.
CanGrow();
94 double fracBinIdx = FindBinRaw(
x);
95 const int binIdx = fracBinIdx;
99 if (binIdx >= GetFirstBin()) {
100 const double lowBound = GetBinFrom(binIdx);
104 if (binIdx <= GetLastBin()) {
105 const double upBound = GetBinTo(binIdx);
130 if (source.HasSameBinningAs(target))
134 int idxTargetLow = target.GetBinIndexForLowEdge(source.GetMinimum());
135 int idxTargetHigh = target.GetBinIndexForLowEdge(source.GetMaximum());
136 if (idxTargetLow < 0 || idxTargetHigh < 0)
143 if (source.GetInverseBinWidth() == target.GetInverseBinWidth())
151 if (
std::fabs(target.GetInverseBinWidth() * source.GetNBinsNoOver() -
152 source.GetInverseBinWidth() * (idxTargetHigh - idxTargetLow)) > 1
E-6 * target.GetInverseBinWidth())
virtual bool HasSameBinBordersAs(const RAxisBase &other) const
Check if two axis have the same bin borders.
EAxisCompatibility CanMap(const RAxisEquidistant &target, const RAxisEquidistant &source) noexcept
Whether (and how) the source axis can be merged into the target axis.
std::vector< double > fBinBorders
Bin borders, one more than the number of regular bins.
@ kIncompatible
The source axis and target axis have different binning.
An axis with non-equidistant bins (also known as "variable binning").
A log configuration for a channel, e.g.
RLogChannel & HistLog()
Log channel for Hist diagnostics.
double fLow
The lower limit of the axis.
@ kSampling
The bins of the source axis have finer granularity, but the bin borders are compatible.
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 ...
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 ...
VecExpr< UnaryOp< Fabs< T >, VecExpr< A, T, D >, T >, T, D > fabs(const VecExpr< A, T, D > &rhs)
@ kLabelsCmpSame
Both axes have the same labels, mapping to the same bins.
Axis with equidistant bin borders.
constexpr static const int kInvalidBin
Special bin index returned to signify that no bin matches a request.
A RAxisGrow that has a label assigned to each bin and a bin width of 1.
@ kIdentical
Source and target axes are identical.
virtual ~RAxisBase()
Virtual destructor needed in this inheritance-based design.
bool HasSameBinBordersAs(const RAxisBase &other) const override
See RAxisBase::HasSameBinBordersAs.
bool HasSameBinBordersAs(const RAxisBase &other) const override
See RAxisBase::HasSameBinBordersAs.
bool CanGrow() const noexcept override
This axis cannot grow.
Histogram axis base class.
bool HasSameBinningAs(const RAxisBase &other) const
Check if two axes use the same binning convention, i.e.
LabelsCmpFlags CompareBinLabels(const RAxisLabels &other) const noexcept
Compare the labels of this axis with those of another axis.
unsigned int fNBinsNoOver
Number of bins excluding under- and overflow.
double fInvBinWidth
The inverse of the bin width.
@ kContains
The source is a subset of bins of the target axis.
constexpr Double_t E()
Base of natural log: