#include <BinnerAxisLog.h>
Inheritance diagram for BinnerAxisLog:
Paul F. Kunz <Paul_Kunz@slac.stanford.edu>
Oded Wurman <owurman@stanford.edu>
Definition at line 27 of file BinnerAxisLog.h.
Public Member Functions | |
virtual int | axisBinNumber (double x) const |
Returns the number of the bin in which the x value and y value are situated. | |
virtual double | axisBinWidth (int bins_number) const |
Returns the width of the bin designated by its place number in the bins structure. | |
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 cordinates of the bin edges i.e returns the member m_edges. | |
BinnerAxisLog () | |
The default constructor. | |
virtual 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 if all the bins have the same width. | |
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 log binning, this is always 1.0. | |
virtual const Range & | setBinWidth (double width) |
Sets the bin width and adjusts the range and number of bins accordingly. | |
virtual const void | setOffset (double offset) |
Sets the offset and adjusts the range accordingly. | |
virtual const Range & | setRange (const Range &, bool hold_width=true) |
Sets the range. | |
void | setStartRange (bool dragging) const |
Sets the starting Range. | |
void | setStartWidth (bool dragging) const |
Sets the starting width parameter. | |
virtual | ~BinnerAxisLog () |
The destructor. | |
Protected Attributes | |
std::vector< double > | m_bin_edges |
The coordintes 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 | |
BinnerAxisLog (const BinnerAxisLog &binner) | |
The copy constructor. | |
double | calcWidthParm (int number) const |
Calculates the width parameter given number of bins and current Range. | |
virtual int | getNob (const Range &range) const |
Gets the number of bins from range. | |
virtual int | getNob (double wid) const |
Returns the number of bins given the width parameter width. | |
void | setBins () |
Sets the bins structure by calculating the lower edge of each bin. | |
virtual void | setConstWid () |
Sets the constant width parameter. | |
Private Attributes | |
std::vector< double > | bins |
Has the lower edge of each bin, starting with [0] = the first one. |
|
The copy constructor.
Definition at line 44 of file BinnerAxisLog.cxx. |
|
The default constructor.
Definition at line 39 of file BinnerAxisLog.cxx. Referenced by clone(). |
|
The destructor.
Definition at line 50 of file BinnerAxisLog.cxx. |
|
Returns the number of the bin in which the x value and y value are situated.
Implements BinnerAxis. Definition at line 67 of file BinnerAxisLog.cxx. References bins, BinnerAxis::m_num_bins, and std::upper_bound(). |
|
Returns the width of the bin designated by its place number in the bins structure.
Implements BinnerAxis. Definition at line 92 of file BinnerAxisLog.cxx. References bins, and BinnerAxis::m_num_bins. |
|
Returns the lower edge of the last + 1 bin.
Definition at line 69 of file BinnerAxis.cxx. References Range::high(), and BinnerAxis::m_range. Referenced by Bins1DBase::getHigh(). |
|
Returns the lower edge of the first bin.
Definition at line 63 of file BinnerAxis.cxx. References Range::low(), and BinnerAxis::m_range. Referenced by Bins2DBase::getLow(), and Bins1DBase::getLow(). |
|
Returns the number of bins.
Definition at line 82 of file BinnerAxis.cxx. References BinnerAxis::m_num_bins. Referenced by Bins2DBase::numberOfBins(), and Bins1DBase::numberOfBins(). |
|
Sets m_num_bins.
Implements BinnerAxis. Definition at line 61 of file BinnerAxisLog.cxx. References BinnerAxis::m_num_bins. |
|
Returns the vector of cordinates of the bin edges i.e returns the member m_edges. If m_edges is not set it sets it too Definition at line 108 of file BinnerAxis.cxx. References BinnerAxis::axisBinWidth(), Range::high(), Range::low(), BinnerAxis::m_bin_edges, BinnerAxis::m_num_bins, and BinnerAxis::m_range. |
|
Calculates the bin width parameter when dragging a slider control.
This member saves the current width parameter when first called with dragging is Implements BinnerAxis. Definition at line 208 of file BinnerAxisLog.cxx. References BinnerAxis::m_width_start, BinnerAxis::s_bin_factor, and BinnerAxis::setStartWidth(). |
|
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 Implements BinnerAxis. Definition at line 219 of file BinnerAxisLog.cxx. References BinnerAxis::setStartRange(). |
|
Calculates the width parameter given number of bins and current Range.
Definition at line 125 of file BinnerAxisLog.cxx. References Range::high(), std::log10(), Range::low(), and BinnerAxis::m_range. Referenced by setConstWid(), and setRange(). |
|
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 55 of file BinnerAxisLog.cxx. References BinnerAxisLog(). |
|
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 112 of file BinnerAxisLog.cxx. References BinnerAxis::m_width. |
|
Returns the constant width parameter.
Implements BinnerAxis. Definition at line 104 of file BinnerAxisLog.cxx. References BinnerAxis::m_width. |
|
Returns the coordinate. Returns the coordinate of the bin at index i. The coordinate of the bin is not the center of the bin. The calculation is such that doing a chi-square fit to power-law on log-log scale is correct. Also plotting individual points is correct. Implements BinnerAxis. Definition at line 80 of file BinnerAxisLog.cxx. References bins, BinnerAxis::m_num_bins, and std::sqrt(). |
|
Gets the number of bins from range.
Implements BinnerAxis. Definition at line 260 of file BinnerAxisLog.cxx. References Range::high(), std::log10(), Range::low(), and BinnerAxis::m_width. |
|
Returns the number of bins given the width parameter width.
Implements BinnerAxis. Definition at line 270 of file BinnerAxisLog.cxx. References Range::high(), std::log10(), Range::low(), and BinnerAxis::m_range. Referenced by setBinWidth(), and setRange(). |
|
Returns the offset.
Implements BinnerAxis. Definition at line 230 of file BinnerAxisLog.cxx. References BinnerAxis::m_offset. |
|
Returns the range.
Definition at line 76 of file BinnerAxis.cxx. References BinnerAxis::m_range. Referenced by Bins2DBase::getRange(), Bins1DBase::getRange(), and BinnerAxisXML::setAttributes(). |
|
Returns
The implementation in this base class is to return Reimplemented in BinnerAxisLinear. Definition at line 57 of file BinnerAxis.cxx. Referenced by Bins2DBase::hasEqualWidths(), Bins1DBase::hasEqualWidths(), and Bins2DBase::scaleFactor(). |
|
Returns the name of this binner.
Definition at line 51 of file BinnerAxis.cxx. References BinnerAxis::m_name. Referenced by BinnerAxisXML::setAttributes(). |
|
Returns the bin width associated with the scale factor - in the case of log binning, this is always 1.0.
Implements BinnerAxis. Definition at line 255 of file BinnerAxisLog.cxx. |
|
Sets the bins structure by calculating the lower edge of each bin.
Definition at line 138 of file BinnerAxisLog.cxx. References bins, Range::low(), BinnerAxis::m_range, BinnerAxis::m_width, and std::pow(). Referenced by setBinWidth(), and setRange(). |
|
Sets the bin width and adjusts the range and number of bins accordingly. Returns the adjusted range. Implements BinnerAxis. Definition at line 191 of file BinnerAxisLog.cxx. References bins, getNob(), Range::low(), BinnerAxis::m_num_bins, BinnerAxis::m_range, BinnerAxis::m_width, std::pow(), setBins(), and Range::setHigh(). |
|
Sets the constant width parameter.
Definition at line 119 of file BinnerAxisLog.cxx. References calcWidthParm(), BinnerAxis::m_num_bins, and BinnerAxis::m_width. |
|
Sets the offset and adjusts the range accordingly.
Implements BinnerAxis. Definition at line 236 of file BinnerAxisLog.cxx. References bins, Range::low(), BinnerAxis::m_offset, BinnerAxis::m_range_start, BinnerAxis::m_width, std::pow(), and setRange(). |
|
Sets the range.
Adjusts the number of bins if hold_width is Implements BinnerAxis. Definition at line 153 of file BinnerAxisLog.cxx. References bins, calcWidthParm(), getNob(), Range::high(), Range::low(), BinnerAxis::m_num_bins, BinnerAxis::m_range, BinnerAxis::m_width, std::pow(), setBins(), Range::setHigh(), and Range::setLow(). Referenced by setOffset(). |
|
Sets the starting Range.
Definition at line 88 of file BinnerAxis.cxx. References BinnerAxis::m_dragging, BinnerAxis::m_range, and BinnerAxis::m_range_start. Referenced by calcOffset(), and BinnerAxisLinear::calcOffset(). |
|
Sets the starting width parameter.
Definition at line 98 of file BinnerAxis.cxx. References BinnerAxis::m_dragging, BinnerAxis::m_width, and BinnerAxis::m_width_start. Referenced by calcBinWidth(), and BinnerAxisLinear::calcBinWidth(). |
|
Has the lower edge of each bin, starting with [0] = the first one.
Definition at line 36 of file BinnerAxisLog.h. Referenced by axisBinNumber(), axisBinWidth(), getCoordinate(), setBins(), setBinWidth(), setOffset(), and setRange(). |
|
The coordintes 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 78 of file BinnerAxis.h. Referenced by BinnerAxis::binEdges(). |
|
|
The offset.
Definition at line 69 of file BinnerAxis.h. Referenced by getOffset(), BinnerAxisLinear::getOffset(), setOffset(), and BinnerAxisLinear::setOffset(). |
|
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 66 of file BinnerAxis.h. Referenced by BinnerAxisLinear::axisBinNumber(), BinnerAxisLinear::axisBinWidth(), BinnerAxis::axisGetHigh(), BinnerAxis::axisGetLow(), BinnerAxisLinear::axisSetNumberOfBins(), BinnerAxis::binEdges(), BinnerAxisLinear::BinnerAxisLinear(), calcWidthParm(), BinnerAxisLinear::getCoordinate(), getNob(), BinnerAxisLinear::getNob(), BinnerAxis::getRange(), setBins(), setBinWidth(), BinnerAxisLinear::setBinWidth(), BinnerAxisLinear::setOffset(), setRange(), BinnerAxisLinear::setRange(), and BinnerAxis::setStartRange(). |
|
The Range at the start of dragging.
Definition at line 81 of file BinnerAxis.h. Referenced by setOffset(), and BinnerAxis::setStartRange(). |
|
The width parameter for the binning. A negative number indicates that no value has been set yet. Definition at line 73 of file BinnerAxis.h. Referenced by BinnerAxisLinear::axisSetNumberOfBins(), BinnerAxisLinear::BinnerAxisLinear(), getBinWidth(), getConstWid(), getNob(), setBins(), setBinWidth(), BinnerAxisLinear::setBinWidth(), setConstWid(), BinnerAxisLinear::setConstWid(), setOffset(), BinnerAxisLinear::setOffset(), setRange(), BinnerAxisLinear::setRange(), and BinnerAxis::setStartWidth(). |
|
The width parameter at the start of dragging.
Definition at line 84 of file BinnerAxis.h. Referenced by calcBinWidth(), BinnerAxisLinear::calcBinWidth(), and BinnerAxis::setStartWidth(). |
|
The scale factor used to calculate new bin width from slider.
Definition at line 23 of file BinnerAxis.cxx. Referenced by calcBinWidth(), and BinnerAxisLinear::calcBinWidth(). |
|
The default number of bins. The default number of bins used by the default constructor. Definition at line 22 of file BinnerAxis.cxx. |