29 double fracBinIdx = (
x - GetMinimum()) * fInvBinWidth;
32 int binIdx = std::round(fracBinIdx + 0.5);
33 double binOffset = fracBinIdx - binIdx;
39 if (IsUnderflowBin(binIdx))
43 if (IsOverflowBin(binIdx - 1))
54 return EAxisCompatibility::kIdentical;
56 int idxTargetLow = target.GetBinIndexForLowEdge(source.GetMinimum());
57 int idxTargetHigh = target.GetBinIndexForLowEdge(source.GetMaximum());
58 if (idxTargetLow < 0 || idxTargetHigh < 0)
59 return EAxisCompatibility::kIncompatible;
63 if (source.GetInverseBinWidth() == target.GetInverseBinWidth())
64 return EAxisCompatibility::kContains;
71 if (
std::fabs(target.GetInverseBinWidth() * source.GetNBinsNoOver() -
72 source.GetInverseBinWidth() * (idxTargetHigh - idxTargetLow)) > 1
E-6 * target.GetInverseBinWidth())
73 return EAxisCompatibility::kIncompatible;
76 return EAxisCompatibility::kSampling;
constexpr static const int kNOverflowBins[4]
Extra bins for each EAxisOverflow value.
Axis with equidistant bin borders.
int GetBinIndexForLowEdge(double x) const noexcept
If the coordinate x is a bin low edge (within 1E-6 of the coordinate), return the bin for which this ...
EAxisCompatibility CanMap(RAxisEquidistant &target, RAxisEquidistant &source) noexcept
Whether (and how) the source axis can be merged into the target axis.
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: