|
YODA - Yet more Objects for Data Analysis 2.0.2
|
Bin base class consisting of mix of histogram bin content and space characteristics of this bin (widths, min, max, mid, etc...)
More...
#include <Bin.h>
|
|
using | isArithmetic = std::conditional_t< std::is_arithmetic< T >::value, std::true_type, std::false_type > |
|
using | BaseT = std::conditional_t< isArithmetic::value, ArithmeticWrapper< T >, T > |
|
template<size_t axisNum> |
using | axisEdgeT = typename BinningT::template getAxisT< axisNum >::EdgeT |
|
template<typename T, typename BinningT>
class YODA::BinBase< T, BinningT > Bin base class consisting of mix of histogram bin content and space characteristics of this bin (widths, min, max, mid, etc...)
- Note
- Since the BinBase class inherits from the content of the histogram bin (to emulate its behavior), an arithmetic wrapper is introduced to inherit from arithmetic types (it's not possible to inherit from fundamental types by default).
-
We use CRTP to introduce dimension-specific member functions like xWidth(), yMid() to avoid the user having to call e.g. bin(i).width<N>() or similar.
Definition at line 80 of file Bin.h.
◆ axisEdgeT
template<typename T , typename BinningT >
template<size_t axisNum>
using YODA::BinBase< T, BinningT >::axisEdgeT = typename BinningT::template getAxisT<axisNum>::EdgeT |
|
protected |
Definition at line 93 of file Bin.h.
◆ BaseT
template<typename T , typename BinningT >
Definition at line 89 of file Bin.h.
◆ isArithmetic
template<typename T , typename BinningT >
using YODA::BinBase< T, BinningT >::isArithmetic = std::conditional_t<std::is_arithmetic<T>::value, std::true_type, std::false_type> |
|
protected |
Definition at line 86 of file Bin.h.
◆ BinBase() [1/7]
template<typename T , typename BinningT >
◆ BinBase() [2/7]
template<typename T , typename BinningT >
◆ BinBase() [3/7]
template<typename T , typename BinningT >
◆ BinBase() [4/7]
template<typename T , typename BinningT >
YODA::BinBase< T, BinningT >::BinBase |
( |
size_t |
binIndex, |
|
|
const BinningT & |
binning |
|
) |
| |
|
inline |
Definition at line 112 of file Bin.h.
113 : _binIndex(binIndex), _binning(&binning) { }
◆ BinBase() [5/7]
template<typename T , typename BinningT >
YODA::BinBase< T, BinningT >::BinBase |
( |
const T & |
storedVal, |
|
|
size_t |
binIndex, |
|
|
const BinningT & |
binning |
|
) |
| |
|
inline |
Setting constructor.
Definition at line 116 of file Bin.h.
117 : BaseT(storedVal), _binIndex(binIndex), _binning(&binning) { }
std::conditional_t< isArithmetic::value, ArithmeticWrapper< T >, T > BaseT
◆ BinBase() [6/7]
template<typename T , typename BinningT >
YODA::BinBase< T, BinningT >::BinBase |
( |
T && |
storedVal, |
|
|
size_t |
binIndex, |
|
|
const BinningT & |
binning |
|
) |
| |
|
inline |
Definition at line 119 of file Bin.h.
120 : BaseT(std::move(storedVal)), _binIndex(binIndex), _binning(&binning) { }
◆ BinBase() [7/7]
template<typename T , typename BinningT >
YODA::BinBase< T, BinningT >::BinBase |
( |
const BinBase< T, BinningT > & |
other, |
|
|
const BinningT & |
binning |
|
) |
| |
|
inline |
Definition at line 122 of file Bin.h.
123 : BaseT(other), _binIndex(other._binIndex), _binning(&binning) { }
◆ dVol()
template<typename T , typename BinningT >
◆ edge()
template<typename T , typename BinningT >
template<size_t dimNum>
Edge of this bin.
- Note
- Only supported for discrete axes.
Definition at line 247 of file Bin.h.
247 {
248 const auto& axis = _binning->template axis<dimNum>();
249 size_t binIdx = _binning->globalToLocalIndices(_binIndex)[dimNum];
250 return axis.edge(binIdx);
251 }
◆ index()
template<typename T , typename BinningT >
return stored index
Definition at line 173 of file Bin.h.
173 {
174 return _binIndex;
175 }
◆ isMasked()
template<typename T , typename BinningT >
Definition at line 177 of file Bin.h.
177 {
178 return _binning->isMasked(_binIndex);
179 }
◆ isVisible()
template<typename T , typename BinningT >
Definition at line 181 of file Bin.h.
181 {
182 return _binning->isVisible(_binIndex);
183 }
◆ max()
template<typename T , typename BinningT >
template<size_t dimNum>
Maximum of this bin interval.
- Note
- Only supported for continuous axes.
Definition at line 217 of file Bin.h.
217 {
218 const auto& axis = _binning->template axis<dimNum>();
219 size_t binIdx = _binning->globalToLocalIndices(_binIndex)[dimNum];
220 return axis.max(binIdx);
221 }
◆ mid()
template<typename T , typename BinningT >
template<size_t dimNum>
Middle of this bin interval.
- Note
- Only supported for continuous axes.
Definition at line 237 of file Bin.h.
237 {
238 const auto& axis = _binning->template axis<dimNum>();
239 size_t binIdx = _binning->globalToLocalIndices(_binIndex)[dimNum];
240 return axis.mid(binIdx);
241 }
◆ min()
template<typename T , typename BinningT >
template<size_t dimNum>
Minimum of this bin interval.
- Note
- Only supported for continuous axes.
Definition at line 227 of file Bin.h.
227 {
228 const auto& axis = _binning->template axis<dimNum>();
229 size_t binIdx = _binning->globalToLocalIndices(_binIndex)[dimNum];
230 return axis.min(binIdx);
231 }
◆ operator=() [1/4]
template<typename T , typename BinningT >
Assignment operator of an rvalue content type.
- Note
- Cython is not a fan of perfect forwarding yet
Definition at line 128 of file Bin.h.
128 {
129
130 BaseT::operator=(std::move(rhs));
131 return *this;
132 }
◆ operator=() [2/4]
template<typename T , typename BinningT >
Move assignment operator.
- Note
- _binIdx is not altered to keep correct indices while using std::vector<...>().erase() on _bins (bins storage).
Definition at line 155 of file Bin.h.
155 {
156 if (this != &rhs) {
157 BaseT::operator=(std::move(rhs));
158 }
159 return *this;
160 }
◆ operator=() [3/4]
template<typename T , typename BinningT >
Assignment operator of a content type.
Definition at line 135 of file Bin.h.
135 {
136 BaseT::operator=(rhs);
137 return *this;
138 }
◆ operator=() [4/4]
template<typename T , typename BinningT >
Copy assignment operator.
- Note
- _binIdx is not altered to keep correct indices while using std::vector<...>().erase() on _bins (bins storage).
Definition at line 144 of file Bin.h.
144 {
145 if (this != &rhs) {
146 BaseT::operator=(rhs);
147 }
148 return *this;
149 }
◆ raw()
template<typename T , typename BinningT >
return stored content
Definition at line 168 of file Bin.h.
168 {
169 return *this;
170 }
◆ width()
template<typename T , typename BinningT >
template<size_t dimNum>
Width of this bin along a specific axis.
- Note
- Bin width is the projection of the bin surface (its area) along a specific axis. Therefore, "bin.width()" will not compile: it's not an intrinsic property of the bin. One should always specify along which axis. Convenient short-hands like bin.xWidth() etc. are being defined via CRTP Mixin, though.
-
Only supported for continuous axes.
Definition at line 207 of file Bin.h.
207 {
208 const auto& axis = _binning->template axis<dimNum>();
209 size_t binIdx = _binning->globalToLocalIndices(_binIndex)[dimNum];
210 return axis.width(binIdx);
211 }
The documentation for this class was generated from the following file:
|