#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. |
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.
bool LWH::VariAxis::isFixedBinning | ( | ) | const [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.
double LWH::VariAxis::lowerEdge | ( | ) | const [inline] |
Get the lower edge of the IAxis.
Definition at line 66 of file VariAxis.h.
References binco.
double LWH::VariAxis::upperEdge | ( | ) | const [inline] |
Get the upper edge of the IAxis.
Definition at line 76 of file VariAxis.h.
References binco.
int LWH::VariAxis::bins | ( | ) | const [inline] |
The number of bins (excluding underflow and overflow) on the IAxis.
Definition at line 87 of file VariAxis.h.
References binco.
std::pair<double,double> LWH::VariAxis::binEdges | ( | int | index | ) | const [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().
double LWH::VariAxis::binLowerEdge | ( | int | index | ) | const [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().
double LWH::VariAxis::binUpperEdge | ( | int | index | ) | const [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().
double LWH::VariAxis::binWidth | ( | int | index | ) | const [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().
int LWH::VariAxis::coordToIndex | ( | double | coord | ) | const [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.
double LWH::VariAxis::binMidPoint | ( | int | index | ) | const [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().