File indexing completed on 2026-09-12 09:31:05
0001
0002
0003
0004
0005
0006 #ifndef YODA_BinUtils_h
0007 #define YODA_BinUtils_h
0008
0009 #include "YODA/Utils/BinningUtils.h"
0010
0011 namespace YODA {
0012
0013
0014
0015
0016
0017
0018 template <class Derived, typename EdgeT = double>
0019 struct XBinMixin {
0020
0021
0022
0023
0024
0025
0026
0027 template<typename T = EdgeT>
0028 enable_if_CAxisT<T> xMax() const noexcept {
0029 return static_cast<const Derived*>(this)->template max<0>();
0030 }
0031
0032
0033
0034
0035 template<typename T = EdgeT>
0036 enable_if_CAxisT<T> xMin() const noexcept {
0037 return static_cast<const Derived*>(this)->template min<0>();
0038 }
0039
0040
0041
0042
0043 template<typename T = EdgeT>
0044 enable_if_CAxisT<T> xMid() const noexcept {
0045 return static_cast<const Derived*>(this)->template mid<0>();
0046 }
0047
0048
0049
0050
0051 template<typename T = EdgeT>
0052 enable_if_CAxisT<T> xWidth() const noexcept {
0053 return static_cast<const Derived*>(this)->template width<0>();
0054 }
0055
0056
0057
0058
0059 template<typename T = EdgeT>
0060 enable_if_DAxisT<T> xEdge() const noexcept {
0061 return static_cast<const Derived*>(this)->template edge<0>();
0062 }
0063
0064
0065
0066 };
0067
0068
0069
0070 template <class Derived, typename EdgeT = double>
0071 struct YBinMixin {
0072
0073
0074
0075
0076
0077
0078
0079 template<typename T = EdgeT>
0080 enable_if_CAxisT<T> yMax() const noexcept {
0081 return static_cast<const Derived*>(this)->template max<1>();
0082 }
0083
0084
0085
0086
0087 template<typename T = EdgeT>
0088 enable_if_CAxisT<T> yMin() const noexcept {
0089 return static_cast<const Derived*>(this)->template min<1>();
0090 }
0091
0092
0093
0094
0095 template<typename T = EdgeT>
0096 enable_if_CAxisT<T> yMid() const noexcept {
0097 return static_cast<const Derived*>(this)->template mid<1>();
0098 }
0099
0100
0101
0102
0103 template<typename T = EdgeT>
0104 enable_if_CAxisT<T> yWidth() const noexcept {
0105 return static_cast<const Derived*>(this)->template width<1>();
0106 }
0107
0108
0109
0110
0111 template<typename T = EdgeT>
0112 enable_if_DAxisT<T> yEdge() const noexcept {
0113 return static_cast<const Derived*>(this)->template edge<1>();
0114 }
0115
0116
0117
0118 };
0119
0120
0121
0122 template <class Derived, typename EdgeT = double>
0123 struct ZBinMixin {
0124
0125
0126
0127
0128
0129 template<typename T = EdgeT>
0130 enable_if_CAxisT<T> zMax() const noexcept {
0131 return static_cast<const Derived*>(this)->template max<2>();
0132 }
0133
0134
0135
0136
0137 template<typename T = EdgeT>
0138 enable_if_CAxisT<T> zMin() const noexcept {
0139 return static_cast<const Derived*>(this)->template min<2>();
0140 }
0141
0142
0143
0144
0145 template<typename T = EdgeT>
0146 enable_if_CAxisT<T> zMid() const noexcept {
0147 return static_cast<const Derived*>(this)->template mid<2>();
0148 }
0149
0150
0151
0152
0153 template<typename T = EdgeT>
0154 enable_if_CAxisT<T> zWidth() const noexcept {
0155 return static_cast<const Derived*>(this)->template width<2>();
0156 }
0157
0158
0159
0160
0161 template<typename T = EdgeT>
0162 enable_if_DAxisT<T> zEdge() const noexcept {
0163 return static_cast<const Derived*>(this)->template edge<2>();
0164 }
0165
0166
0167
0168 };
0169
0170
0171
0172 }
0173
0174 #endif