#include <Axis.h>
Public Member Functions | |
Axis (unsigned nbins, double amin, double amax) | |
Create axis with fixed bin sizes. | |
Axis (unsigned nbins, const double *edges) | |
Create axis with variable bin sizes. | |
double | amin () const |
Get low edge of range, makes sense to call only for fixed-width bins. | |
double | amax () const |
Get high edge of range, makes sense to call only for fixed-width bins. | |
unsigned | nbins () const |
Get number of bins. | |
const double * | edges () const |
Get array of edges, will return zero pointer for fixed-width bins. | |
void | print (std::ostream &out) const |
This class can be used to define both same-width and variable-width binnings for histograms. Type of the binning is defined by the constructor used to instantiate Axis object.
This software was developed for the LCLS project. If you use all or part of it, please give an appropriate acknowledgment.
Definition at line 44 of file Axis.h.
PSHist::Axis::Axis | ( | unsigned | nbins, | |
double | amin, | |||
double | amax | |||
) |
Create axis with fixed bin sizes.
[in] | nbins | Number of bins. |
[in] | amin | Low edge of the first bin. |
[in] | amax | High edge of the last bin. |
ExceptionBins | thrown when number of bins is 0 | |
ExceptionAxisRange | thrown when amin is equal or higher that amax |
PSHist::Axis::Axis | ( | unsigned | nbins, | |
const double * | edges | |||
) |
Create axis with variable bin sizes.
[in] | nbins | Number of bins. |
[in] | edges | Array of the histogram edges, size of the array is nbins+1 , it should contain ordered values for low edges of all bins plus high edge of last bin. |
ExceptionBins | thrown when number of bins is 0 | |
ExceptionAxisEdgeOrder | thrown when edges are not ordered |
double PSHist::Axis::amax | ( | ) | const [inline] |
double PSHist::Axis::amin | ( | ) | const [inline] |
const double * PSHist::Axis::edges | ( | ) | const |
unsigned PSHist::Axis::nbins | ( | ) | const [inline] |