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