An VariAxis represents a binned histogram axis. More...
#include <VariAxis.h>
Public Member Functions | |
VariAxis (const std::vector< double > &edges) | |
Standard constructor. | |
VariAxis (const VariAxis &a) | |
Copy constructor. | |
virtual | ~VariAxis () |
Destructor. | |
bool | isFixedBinning () const |
Check if the IAxis has fixed binning, i.e. | |
double | lowerEdge () const |
Get the lower edge of the IAxis. | |
double | upperEdge () const |
Get the upper edge of the IAxis. | |
int | bins () const |
The number of bins (excluding underflow and overflow) on the IAxis. | |
std::pair< double, double > | binEdges (int index) const |
Get the lower edge of the specified bin. | |
double | binLowerEdge (int index) const |
Get the lower edge of the specified bin. | |
double | binUpperEdge (int index) const |
Get the upper edge of the specified bin. | |
double | binWidth (int index) const |
Get the width of the specified bin. | |
int | coordToIndex (double coord) const |
Convert a coordinate on the axis to a bin number. | |
double | binMidPoint (int index) const |
Return the midpoint of the specified bin. | |
Private Attributes | |
std::map< double, int > | binco |
A map relating the lower edge of a bin to the corresponding bin number. | |
An VariAxis represents a binned histogram axis.
A 1D Histogram would have one VariAxis representing the X axis, while a 2D Histogram would have two axes representing the X and Y VariAxis.
Definition at line 31 of file VariAxis.h.
|
inline |
|
inline |
Copy constructor.
Definition at line 47 of file VariAxis.h.
|
inlinevirtual |
Destructor.
Definition at line 51 of file VariAxis.h.
|
inline |
Get the lower edge of the specified bin.
index | The bin number: 0 to bins()-1 for the in-range bins or OVERFLOW or UNDERFLOW. |
Double.NEGATIVE_INFINITY
. Definition at line 97 of file VariAxis.h.
References binco.
Referenced by binLowerEdge(), binMidPoint(), binUpperEdge(), and binWidth().
|
inline |
Get the lower edge of the specified bin.
index | The bin number: 0 to bins()-1 for the in-range bins or OVERFLOW or UNDERFLOW. |
Double.NEGATIVE_INFINITY
. Definition at line 118 of file VariAxis.h.
References binEdges().
|
inline |
Return the midpoint of the specified bin.
No checking is performed to ensure the argument is a valid bin.
Definition at line 166 of file VariAxis.h.
References binEdges().
Referenced by LWH::Histogram1D::binMean(), LWH::Histogram2D::binMeanX(), and LWH::Histogram2D::binMeanY().
|
inline |
The number of bins (excluding underflow and overflow) on the IAxis.
Definition at line 87 of file VariAxis.h.
References binco.
|
inline |
Get the upper edge of the specified bin.
index | The bin number: 0 to bins()-1 for the in-range bins or OVERFLOW or UNDERFLOW. |
Double.POSITIVE_INFINITY
. Definition at line 130 of file VariAxis.h.
References binEdges().
|
inline |
Get the width of the specified bin.
index | The bin number: 0 to bins()-1) for the in-range bins or OVERFLOW or UNDERFLOW. |
Definition at line 141 of file VariAxis.h.
References binEdges().
|
inline |
Convert a coordinate on the axis to a bin number.
If the coordinate is less than the lowerEdge UNDERFLOW is returned; if the coordinate is greater or equal to the upperEdge OVERFLOW is returned.
coord | The coordinate to be converted. |
Definition at line 155 of file VariAxis.h.
References binco.
|
inline |
Check if the IAxis has fixed binning, i.e.
if all the bins have the same width.
true
if the binning is fixed, false
otherwise. Definition at line 59 of file VariAxis.h.
|
inline |
Get the lower edge of the IAxis.
Definition at line 66 of file VariAxis.h.
References binco.
|
inline |
Get the upper edge of the IAxis.
Definition at line 76 of file VariAxis.h.
References binco.
|
private |
A map relating the lower edge of a bin to the corresponding bin number.
Definition at line 177 of file VariAxis.h.
Referenced by binEdges(), bins(), coordToIndex(), lowerEdge(), upperEdge(), and VariAxis().