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)) {
44 auto lbl_cmp = lbl_ptr->CompareBinLabels(*other_lbl_ptr);
59 int binIdx = std::round(fracBinIdx);
60 double binOffset = fracBinIdx - binIdx;
61 if (std::fabs(binOffset) > 10 * std::numeric_limits<double>::epsilon())
95 const int binIdx = fracBinIdx;
98 constexpr double tol = 10 * std::numeric_limits<double>::epsilon();
101 if (std::fabs(
x - lowBound) < tol * std::fabs(lowBound))
105 const double upBound =
GetBinTo(binIdx);
106 if (std::fabs(
x - upBound) < tol * std::fabs(upBound))
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)) > 1E-6 *
target.GetInverseBinWidth())
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t target
int GetFirstBin() const noexcept
Get the bin index for the first bin of the axis.
RAxisBase(const RAxisBase &)=default
int GetLastBin() const noexcept
Get the bin index for the last bin of the axis.
double GetBinTo(int bin) const
Get the high bin border ("right edge") for the given bin index.
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.
double FindBinRaw(double x) const noexcept
Find the raw bin index (not adjusted) for the given coordinate.
RAxisEquidistant()=default
int GetBinIndexForLowEdge(double x) const noexcept final
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.
bool HasSameBinBordersAs(const RAxisBase &other) const override
See RAxisBase::HasSameBinBordersAs.
std::vector< double > fBinBorders
Bin borders, one more than the number of regular bins.
int GetBinIndexForLowEdge(double x) const noexcept final
If the coordinate x is within 10 ULPs of a bin low edge coordinate, return the bin for which this is ...
double GetBinFrom(int bin) const final
Get the lower bin border for a given bin index.
double FindBinRaw(double x) const noexcept
Find the raw bin index (not adjusted) for the given coordinate x.
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.
A log configuration for a channel, e.g.
EAxisCompatibility CanMap(const RAxisEquidistant &target, const RAxisEquidistant &source) noexcept
Whether (and how) the source axis can be merged into the target axis.
RLogChannel & HistLog()
Log channel for Hist diagnostics.
@ 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.