The class for the constant width bins. More...
#include <BinnerAxisLinear.h>
Public Member Functions | |
virtual int | axisBinNumber (double x) const |
Returns the number of the bin in which the x value is situated. | |
virtual double | axisBinWidth (int i) const |
Returns the width of each bin. | |
double | axisGetHigh () const |
Returns the lower edge of the last + 1 bin. | |
double | axisGetLow () const |
Returns the lower edge of the first bin. | |
int | axisNumberOfBins () const |
Returns the number of bins. | |
virtual void | axisSetNumberOfBins (int nb) |
Sets m_num_bins. | |
virtual const std::vector < double > & | binEdges () |
Returns the vector of coordinates of the bin edges i.e returns the member m_edges. | |
BinnerAxisLinear () | |
The default constructor. | |
double | calcBinWidth (int parm, bool dragging) const |
Calculates the bin width parameter when dragging a slider control. | |
virtual double | calcOffset (int parm, bool dragging) const |
Calculates and returns a double corresponding to a bin offset when dragging a slider control. | |
BinnerAxis * | clone () |
The clone function returns an object of its own kind which is a copy of this object at this moment. | |
virtual double | getBinWidth () const |
Returns the bin width parameter. | |
virtual double | getConstWid () const |
Returns the constant width parameter. | |
virtual double | getCoordinate (int i) const |
Returns the coordinate. | |
virtual double | getOffset () const |
Returns the offset. | |
const Range & | getRange () const |
Returns the range. | |
virtual bool | hasEqualWidths () const |
Returns true. | |
const std::string & | name () const |
Returns the name of this binner. | |
virtual double | scaleFactorWid () |
Returns the bin width associated with the scale factor - in the case of linear binning, this is the const. | |
virtual const Range & | setBinWidth (double width) |
Sets the bin width and adjusts the range and number of bins accordingly. | |
virtual void | setConstWid () |
Sets the constant width parameter. | |
virtual const void | setOffset (double offset) |
Sets the offset and adjusts the range accordingly. | |
virtual const Range & | setRange (const Range &, bool hold_width=true) |
void | setStartRange (bool dragging) const |
Sets the starting Range. | |
void | setStartWidth (bool dragging) const |
Sets the starting width parameter. | |
virtual | ~BinnerAxisLinear () |
The destructor. |
Protected Member Functions | |
BinnerAxisLinear (const BinnerAxisLinear &binner) | |
The copy constructor. | |
virtual double | calcWidthParm (int number) const |
Calculates the bin width parameter given the number of bins. |
Protected Attributes | |
std::vector< double > | m_bin_edges |
The coordinates of the edges of bins. | |
int | m_num_bins |
The number of bins. | |
double | m_offset |
The offset. | |
Range | m_range |
The range of the bins. | |
Range | m_range_start |
The Range at the start of dragging. | |
double | m_width |
The width parameter for the binning. | |
double | m_width_start |
The width parameter at the start of dragging. |
Static Protected Attributes | |
static double | s_bin_factor = 0.75 |
The scale factor used to calculate new bin width from slider. | |
static int | s_num_bins = 50 |
The default number of bins. |
Private Member Functions | |
virtual int | getNob (double wid) const |
virtual int | getNob (const Range &range) const |
The class for the constant width bins.
Definition at line 30 of file BinnerAxisLinear.h.
|
protected |
The copy constructor.
Definition at line 34 of file BinnerAxisLinear.cxx.
BinnerAxisLinear | ( | ) |
The default constructor.
Definition at line 27 of file BinnerAxisLinear.cxx.
References Range::length(), BinnerAxis::m_num_bins, BinnerAxis::m_range, and BinnerAxis::m_width.
Referenced by BinnerAxisLinear::clone().
|
virtual |
The destructor.
Definition at line 39 of file BinnerAxisLinear.cxx.
|
virtual |
Returns the number of the bin in which the x value is situated.
Implements BinnerAxis.
Definition at line 67 of file BinnerAxisLinear.cxx.
References BinnerAxisLinear::axisBinWidth(), Range::low(), BinnerAxis::m_num_bins, and BinnerAxis::m_range.
|
virtual |
Returns the width of each bin.
Implements BinnerAxis.
Definition at line 87 of file BinnerAxisLinear.cxx.
References Range::length(), BinnerAxis::m_num_bins, and BinnerAxis::m_range.
Referenced by BinnerAxisLinear::axisBinNumber(), BinnerAxisLinear::getConstWid(), and BinnerAxisLinear::setConstWid().
|
inherited |
Returns the lower edge of the last + 1 bin.
Definition at line 71 of file BinnerAxis.cxx.
References Range::high(), and BinnerAxis::m_range.
Referenced by Bins1DBase::getHigh().
|
inherited |
Returns the lower edge of the first bin.
Definition at line 65 of file BinnerAxis.cxx.
References Range::low(), and BinnerAxis::m_range.
Referenced by Bins1DBase::getLow(), and Bins2DBase::getLow().
|
inherited |
Returns the number of bins.
Definition at line 84 of file BinnerAxis.cxx.
References BinnerAxis::m_num_bins.
Referenced by Bins1DBase::numberOfBins(), and Bins2DBase::numberOfBins().
|
virtual |
Sets m_num_bins.
Implements BinnerAxis.
Definition at line 56 of file BinnerAxisLinear.cxx.
References Range::length(), BinnerAxis::m_num_bins, BinnerAxis::m_range, and BinnerAxis::m_width.
|
virtualinherited |
Returns the vector of coordinates of the bin edges i.e returns the member m_edges.
If m_edges is not set it sets it too
Definition at line 110 of file BinnerAxis.cxx.
References BinnerAxis::axisBinWidth(), Range::high(), Range::low(), BinnerAxis::m_bin_edges, BinnerAxis::m_num_bins, and BinnerAxis::m_range.
|
inherited |
Calculates the bin width parameter when dragging a slider control.
This member saves the current width parameter when first called with dragging is true
. The width is then calculated with the parameter parm whose range is expected to be from 0 to 99. Returns the calculated width parameter, but does not change with current parameter.
Definition at line 130 of file BinnerAxis.cxx.
References BinnerAxis::calcWidthParm(), BinnerAxis::getNob(), BinnerAxis::m_num_bins, BinnerAxis::m_width_start, and BinnerAxis::setStartWidth().
Referenced by Bins1DBase::calcBinWidth(), and Bins2DBase::calcBinWidth().
|
virtual |
Calculates and returns a double corresponding to a bin offset when dragging a slider control.
The current range is saved when first called with dragging true
. The parm is expected to range from 0 to 50 and offsets are calculated with respect the the bin width parameter.
Implements BinnerAxis.
Definition at line 118 of file BinnerAxisLinear.cxx.
References BinnerAxis::setStartRange().
|
protectedvirtual |
Calculates the bin width parameter given the number of bins.
Implements BinnerAxis.
Definition at line 109 of file BinnerAxisLinear.cxx.
References Range::high(), Range::low(), and BinnerAxis::m_range.
|
virtual |
The clone function returns an object of its own kind which is a copy of this object at this moment.
Implements BinnerAxis.
Definition at line 44 of file BinnerAxisLinear.cxx.
References BinnerAxisLinear::BinnerAxisLinear().
|
virtual |
Returns the bin width parameter.
If the bin widths are not equal, then return a parameter used to calculate the bin widths.
Implements BinnerAxis.
Definition at line 183 of file BinnerAxisLinear.cxx.
References BinnerAxisLinear::getConstWid().
|
virtual |
Returns the constant width parameter.
Implements BinnerAxis.
Definition at line 173 of file BinnerAxisLinear.cxx.
References BinnerAxisLinear::axisBinWidth().
Referenced by BinnerAxisLinear::getBinWidth(), BinnerAxisLinear::getNob(), and BinnerAxisLinear::scaleFactorWid().
|
virtual |
Returns the coordinate.
Returns the coordinate of the bin at index i. The coordinate is midway between the bin edges.
Implements BinnerAxis.
Definition at line 81 of file BinnerAxisLinear.cxx.
References Range::length(), Range::low(), BinnerAxis::m_num_bins, and BinnerAxis::m_range.
|
privatevirtual |
Definition at line 214 of file BinnerAxisLinear.cxx.
References BinnerAxis::m_range, and Range::numberOfBins().
Referenced by BinnerAxisLinear::setBinWidth().
|
privatevirtual |
Definition at line 200 of file BinnerAxisLinear.cxx.
References BinnerAxisLinear::getConstWid(), and Range::length().
|
virtual |
Returns the offset.
Implements BinnerAxis.
Definition at line 126 of file BinnerAxisLinear.cxx.
References BinnerAxis::m_offset.
|
inherited |
Returns the range.
Definition at line 78 of file BinnerAxis.cxx.
References BinnerAxis::m_range.
Referenced by Bins1DBase::getRange(), Bins2DBase::getRange(), and BinnerAxisXML::setAttributes().
|
virtual |
Returns true.
This derived class is a special case in that it has bins of all the same width.
Reimplemented from BinnerAxis.
Definition at line 50 of file BinnerAxisLinear.cxx.
|
inherited |
Returns the name of this binner.
Definition at line 53 of file BinnerAxis.cxx.
References BinnerAxis::m_name.
Referenced by BinnerAxisXML::setAttributes().
|
virtual |
Returns the bin width associated with the scale factor - in the case of linear binning, this is the const.
bin width
Implements BinnerAxis.
Definition at line 195 of file BinnerAxisLinear.cxx.
References BinnerAxisLinear::getConstWid().
|
virtual |
Sets the bin width and adjusts the range and number of bins accordingly.
Returns the adjusted range.
Implements BinnerAxis.
Definition at line 96 of file BinnerAxisLinear.cxx.
References BinnerAxisLinear::getNob(), BinnerAxis::m_num_bins, BinnerAxis::m_range, BinnerAxis::m_width, and Range::setLength().
|
virtual |
Sets the constant width parameter.
Definition at line 189 of file BinnerAxisLinear.cxx.
References BinnerAxisLinear::axisBinWidth(), and BinnerAxis::m_width.
|
virtual |
Sets the offset and adjusts the range accordingly.
Implements BinnerAxis.
Definition at line 132 of file BinnerAxisLinear.cxx.
References Range::high(), Range::low(), BinnerAxis::m_offset, BinnerAxis::m_range, and BinnerAxis::m_width.
Implements BinnerAxis.
Definition at line 153 of file BinnerAxisLinear.cxx.
References Range::length(), BinnerAxis::m_num_bins, BinnerAxis::m_range, BinnerAxis::m_width, and Range::setLength().
|
inherited |
Sets the starting Range.
Definition at line 90 of file BinnerAxis.cxx.
References BinnerAxis::m_dragging, BinnerAxis::m_range, and BinnerAxis::m_range_start.
Referenced by BinnerAxisLinear::calcOffset(), and BinnerAxisLog::calcOffset().
|
inherited |
Sets the starting width parameter.
Definition at line 100 of file BinnerAxis.cxx.
References BinnerAxis::m_dragging, BinnerAxis::m_width, and BinnerAxis::m_width_start.
Referenced by BinnerAxis::calcBinWidth().
|
protectedinherited |
The coordinates of the edges of bins.
Since there are m_num_bins this is a vector of size 1 + m_num_bins. A size zero indicates that no value has been set yet.
Definition at line 80 of file BinnerAxis.h.
Referenced by BinnerAxis::binEdges().
|
mutableprotectedinherited |
The number of bins.
Definition at line 64 of file BinnerAxis.h.
Referenced by BinnerAxisLog::axisBinNumber(), BinnerAxisLinear::axisBinNumber(), BinnerAxisLinear::axisBinWidth(), BinnerAxisLog::axisBinWidth(), BinnerAxis::axisNumberOfBins(), BinnerAxisLinear::axisSetNumberOfBins(), BinnerAxisLog::axisSetNumberOfBins(), BinnerAxis::binEdges(), BinnerAxisLinear::BinnerAxisLinear(), BinnerAxis::calcBinWidth(), BinnerAxisLog::getCoordinate(), BinnerAxisLinear::getCoordinate(), BinnerAxisLinear::setBinWidth(), BinnerAxisLog::setBinWidth(), BinnerAxisLog::setConstWid(), BinnerAxisLinear::setRange(), and BinnerAxisLog::setRange().
|
protectedinherited |
The offset.
Definition at line 71 of file BinnerAxis.h.
Referenced by BinnerAxisLinear::getOffset(), BinnerAxisLog::getOffset(), BinnerAxisLinear::setOffset(), and BinnerAxisLog::setOffset().
|
protectedinherited |
The range of the bins.
The lower edge of the first bin and the upper edge of the last bin are represented by this range.
Definition at line 68 of file BinnerAxis.h.
Referenced by BinnerAxisLinear::axisBinNumber(), BinnerAxisLinear::axisBinWidth(), BinnerAxis::axisGetHigh(), BinnerAxis::axisGetLow(), BinnerAxisLinear::axisSetNumberOfBins(), BinnerAxis::binEdges(), BinnerAxisLinear::BinnerAxisLinear(), BinnerAxisLinear::calcWidthParm(), BinnerAxisLog::calcWidthParm(), BinnerAxisLinear::getCoordinate(), BinnerAxisLinear::getNob(), BinnerAxisLog::getNob(), BinnerAxis::getRange(), BinnerAxisLog::setBins(), BinnerAxisLinear::setBinWidth(), BinnerAxisLog::setBinWidth(), BinnerAxisLinear::setOffset(), BinnerAxisLinear::setRange(), BinnerAxisLog::setRange(), and BinnerAxis::setStartRange().
|
mutableprotectedinherited |
The Range at the start of dragging.
Definition at line 83 of file BinnerAxis.h.
Referenced by BinnerAxisLog::setOffset(), and BinnerAxis::setStartRange().
|
protectedinherited |
The width parameter for the binning.
A negative number indicates that no value has been set yet.
Definition at line 75 of file BinnerAxis.h.
Referenced by BinnerAxisLinear::axisSetNumberOfBins(), BinnerAxisLinear::BinnerAxisLinear(), BinnerAxisLog::getBinWidth(), BinnerAxisLog::getConstWid(), BinnerAxisLog::getNob(), BinnerAxisLog::setBins(), BinnerAxisLinear::setBinWidth(), BinnerAxisLog::setBinWidth(), BinnerAxisLinear::setConstWid(), BinnerAxisLog::setConstWid(), BinnerAxisLinear::setOffset(), BinnerAxisLog::setOffset(), BinnerAxisLinear::setRange(), BinnerAxisLog::setRange(), and BinnerAxis::setStartWidth().
|
mutableprotectedinherited |
The width parameter at the start of dragging.
Definition at line 86 of file BinnerAxis.h.
Referenced by BinnerAxis::calcBinWidth(), and BinnerAxis::setStartWidth().
|
staticprotectedinherited |
The scale factor used to calculate new bin width from slider.
Definition at line 61 of file BinnerAxis.h.
|
staticprotectedinherited |
The default number of bins.
The default number of bins used by the default constructor.
Definition at line 57 of file BinnerAxis.h.