ATLAS Offline Software
|
Data object containing bin descriptions. More...
#include <CaloBinDescriptor.h>
Public Member Functions | |
CaloBinDescriptor () | |
Default constructor generates empty bin descriptor. More... | |
CaloBinDescriptor (const CaloBinDescriptor &theBins) | |
Explicit copy constructor. More... | |
CaloBinDescriptor & | operator= (const CaloBinDescriptor &theBins) |
Assignment. More... | |
CaloBinDescriptor (const std::vector< T > &theBins) | |
Construct with variable sized bins. More... | |
CaloBinDescriptor (size_t nBins, const T &lowerLimit, const T &upperLimit) | |
Construct with regular bins. More... | |
~CaloBinDescriptor () | |
Default constructor. More... | |
size_t | getNumberOfBins () const |
Retrieve the number of bins. More... | |
T | lowerBound () const |
Retrieve the lower value range boundary. More... | |
T | upperBound () const |
Retrieve the upper value range boundary. More... | |
T | lowerBinEdge (size_t theIndex) const |
Retrieve the lower bin edge of a given bin. More... | |
T | upperBinEdge (size_t theIndex) const |
Retrieve the upper bin edge of a given bin. More... | |
T | binWidth (size_t theIndex) const |
Retrieve the bin width of a given bin. More... | |
const std::vector< T > & | getBinning () const |
Direct Access to the vector describing the binning. More... | |
size_t | getIndex (const T &theData) const |
Get the index for a iven value. More... | |
bool | outOfRange (size_t theIndex) const |
Tests if given index is out of valid range. More... | |
size_t | outOfRangeMarker () const |
Returns the value of the out-of-range marker. More... | |
Private Attributes | |
std::vector< T > | m_bins |
Bin store. More... | |
Static Private Attributes | |
static const size_t | m_outOfRange = size_t(-1) |
Out-of-range marker (convention) More... | |
Data object containing bin descriptions.
This data object stores the description of bins for any data type T with support for simple arithmatic (operators +
,-
,*
,/
) and valid comparators (operators >
,=>
,<
,<=
). The bins can be equidistant or variable.
Definition at line 11 of file CaloBinDescriptor.h.
|
inline |
Default constructor generates empty bin descriptor.
Definition at line 16 of file CaloBinDescriptor.h.
|
explicit |
Explicit copy constructor.
Definition at line 122 of file CaloBinDescriptor.h.
CaloBinDescriptor< T >::CaloBinDescriptor | ( | const std::vector< T > & | theBins | ) |
Construct with variable sized bins.
theBins | reference to vector of bin boundaries with n+1 entries for n bins; |
Definition at line 140 of file CaloBinDescriptor.h.
CaloBinDescriptor< T >::CaloBinDescriptor | ( | size_t | nBins, |
const T & | lowerLimit, | ||
const T & | upperLimit | ||
) |
Construct with regular bins.
nBins | number of bins |
lowerLimit | lower limit of value range |
upperLimit | upper limit of value range |
The input parameters are internally converted into a vector of lower bin boundaries (first n entries) and the upper limit of the value range (n+1 entry).
Definition at line 146 of file CaloBinDescriptor.h.
|
inline |
|
inline |
Retrieve the bin width of a given bin.
theIndex | bin index \( i \in [1,n] \) for \( n \) bins. |
Returns 0 if theIndex out of range. A valid return is positive definit.
Definition at line 196 of file CaloBinDescriptor.h.
|
inline |
Direct Access to the vector describing the binning.
Definition at line 204 of file CaloBinDescriptor.h.
size_t CaloBinDescriptor< T >::getIndex | ( | const T & | theData | ) | const |
Get the index for a iven value.
theData | input value to be tested |
Returns 0 if theData is smaller than the lower value range boundary, and outOfRangeMarker if theData is bigger than the upper value range boundary.
Definition at line 210 of file CaloBinDescriptor.h.
|
inline |
Retrieve the number of bins.
Returns 0 for empty bin descriptor.
Definition at line 166 of file CaloBinDescriptor.h.
|
inline |
Retrieve the lower bin edge of a given bin.
theIndex | bin index \( i \in [1,n] \) for \( n \) bins. |
Returns 0 if theIndex out of range.
Definition at line 184 of file CaloBinDescriptor.h.
|
inline |
Retrieve the lower value range boundary.
Definition at line 172 of file CaloBinDescriptor.h.
CaloBinDescriptor< T > & CaloBinDescriptor< T >::operator= | ( | const CaloBinDescriptor< T > & | theBins | ) |
Assignment.
Definition at line 129 of file CaloBinDescriptor.h.
|
inline |
Tests if given index is out of valid range.
theIndex | input index to be tested |
Returns true
if theIndex within range.
Definition at line 221 of file CaloBinDescriptor.h.
|
inline |
Returns the value of the out-of-range marker.
Definition at line 229 of file CaloBinDescriptor.h.
|
inline |
Retrieve the upper bin edge of a given bin.
theIndex | bin index \( i \in [1,n] \) for \( n \) bins. |
Returns 0 if theIndex out of range.
Definition at line 190 of file CaloBinDescriptor.h.
|
inline |
Retrieve the upper value range boundary.
Definition at line 178 of file CaloBinDescriptor.h.
|
private |
|
staticprivate |
Out-of-range marker (convention)
Definition at line 118 of file CaloBinDescriptor.h.