Expresses a range of values. More...
#include <Range.h>

Public Member Functions | |
| bool | excludes (double value) const |
Returns true if the argument value is outside the range. More... | |
| double | fraction (double value) const |
| Returns the fraction of the range that value represents. More... | |
| double | high () const |
| Returns the maximum of the range object. More... | |
| bool | includes (double value) const |
Returns true if the argument value is inside the range. More... | |
| double | length () const |
| Returns the length of the range object. More... | |
| double | low () const |
| Returns the minimum of the range object. More... | |
| int | numberOfBins (double width) const |
Returns the number of bins of width width required to fill the range. More... | |
| double | pos () const |
| Returns the first positive element in range. More... | |
| Range () | |
| The following constructors sets the range to {0.0, 0.0} but sets m_empty to true. More... | |
| Range (double x, double y, double p=DBL_MAX) | |
| A constructor that sets the range to {x, y}, with a pos argument of p if it is supplied, otherwise DBL_MAX. More... | |
| Range (const std::vector< double > &array) | |
| A constructor taking its range from the range of data in the vector array. More... | |
| void | setEmpty (bool yes=true) |
| Sets the range to empty. More... | |
| void | setHigh (double x) |
| Sets the maximum of the range object. More... | |
| void | setIntersect (const Range &range) |
| Forms the intersect with the range in the argument. More... | |
| void | setLength (double val, bool high_hold=false) |
| Sets the length of the range. More... | |
| void | setLow (double x) |
| Sets the minimum of the range object. More... | |
| void | setPos (double x) |
| Sets the first positive element in range. More... | |
| void | setRange (double low, double high, double pos) |
| Changes the current Range. More... | |
| template<class Iterator > | |
| void | setRange (Iterator first, Iterator end) |
| Sets the range from the data sequence. More... | |
| void | setUnion (const Range &range) |
| Forms the union with the range range. More... | |
Private Attributes | |
| bool | m_empty |
| A flag indicating that the range is empty. More... | |
| double | m_max |
| The maximum in the range. More... | |
| double | m_min |
| The minimum in the range. More... | |
| double | m_pos |
| The minimum positive value in the range, for log scale. More... | |
| Range | ( | ) |
| Range | ( | double | x, |
| double | y, | ||
| double | p = DBL_MAX |
||
| ) |
A constructor that sets the range to {x, y}, with a pos argument of p if it is supplied, otherwise DBL_MAX.
Definition at line 45 of file Range.cxx.
References Range::m_empty, Range::m_max, Range::m_min, and Range::m_pos.
| Range | ( | const std::vector< double > & | array | ) |
A constructor taking its range from the range of data in the vector array.
Definition at line 81 of file Range.cxx.
References Range::setRange().
| bool excludes | ( | double | value | ) | const |
Returns true if the argument value is outside the range.
Returns true if the value is strictly less than the lower bound or strictly greater than the upper bound.
Definition at line 153 of file Range.cxx.
References Range::m_max.
Referenced by ContourPointRep::createContours(), Map1Projector::inRange(), and NTupleProjector::inRange().
| double fraction | ( | double | value | ) | const |
Returns the fraction of the range that value represents.
Definition at line 160 of file Range.cxx.
References Range::m_max, and Range::m_min.
| double high | ( | ) | const |
Returns the maximum of the range object.
Definition at line 100 of file Range.cxx.
References Range::m_max.
Referenced by PyCanvas::addTextAtAbs(), LogTransform::adjustLogValues(), AxisModelLog::adjustLogValues(), AxisModelBase::adjustTicks(), AxisModelLinear::adjustValues(), AxisModelLog::adjustValues(), LinearTransform::adjustValues(), LogTransform::adjustValues(), CompositePlotter::autoScaleZ(), BinnerAxis::axisGetHigh(), BinnerAxis::binEdges(), AxisModelLinear::calcHigh(), AxisModelLog::calcHigh(), AxisModelLinear::calcLow(), AxisModelLog::calcLow(), CompositePlotter::calcRawRectangle(), XYTransform::calcRectangle(), PeriodicBinaryTransform::calcRectangle(), CompositePlotter::calcUserRectangle(), BinnerAxisLinear::calcWidthParm(), BinnerAxisLog::calcWidthParm(), CanvasView::contentsMouseMoveEvent(), TupleCutXML::createElement(), QtCut::cutRange(), AxisRepBase::drawAxesLines(), AxisRepBase::drawGridLines(), CutRangeRep::drawInvertedRange1D(), CutRangeRep::drawInvertedRange2D(), CutRangeRep::drawNormalRange(), ColorSymbolPointRep::drawProjectedValues(), ColorBoxPointRep::drawProjectedValues(), ErrorBarRep::drawXError(), AxisRepBase::drawXTickLabels(), AxisRepBase::drawXTickLines(), ErrorBarRep::drawYError(), AxisRepBase::drawYTickLabels(), AxisRepBase::drawYTickLines(), LineProjector::fillProjectedValues(), LogTransform::genTicks(), LinearTransform::genTicks(), PeriodicBinaryTransform::genTicks(), DyHist1DProjector::getAverage(), PlotterBase::getHighRangeOnX(), BinnerAxisLog::getNob(), AxisModelBase::getRange(), QtDisplay::getRange(), PeriodicBinaryTransform::moduloAddX(), PeriodicBinaryTransform::moduloAddY(), PeriodicBinaryTransform::moduloSubX(), PeriodicBinaryTransform::moduloSubY(), CompositePlotter::prepareToDraw(), AxisWidget::processHighSliderMoved(), AxisWidget::processLowSliderMoved(), CompositePlotter::processReturnValue(), AxisWidget::processTextBoxReturnPressed(), AxisWidget::processZoomPanCheckBoxClicked(), Inspector::rotateX(), Inspector::rotateY(), BinnerAxisXML::setAttributes(), AxisModelXML::setAttributes(), DisplayController::setAxisModel(), DisplayController::setAxisModelWithoutSetBin(), Inspector::setDragOn(), Inspector::setHighRange(), Inspector::setLowRange(), ContourPointRep::setMinMax(), BinnerAxisLinear::setOffset(), ProfileProjector::setRange(), Hist1DProjImp::setRange(), Hist2DProjImp::setRange(), Profile2DProjector::setRange(), Range::setRange(), BinnerAxisLog::setRange(), AxisModelBase::setRange(), AxisModelLog::setTickStep(), LogTransform::setTickStep(), LinearTransform::setTickStep(), PeriodicBinaryTransform::setTickStep(), Inspector::setXRotateText(), Inspector::setYRotateText(), LineFunctionRep::smoothCurve(), Inspector::updateAxisTab(), AxisWidget::updateCutControlValues(), CreateNTuple::updateCutList(), LogTransform::validate(), PeriodicBinaryTransform::validate(), and Inspector::validPeriodicTransformRange().
| bool includes | ( | double | value | ) | const |
Returns true if the argument value is inside the range.
Returns true if the value is greater than or equal to the lower bound and less than or equal to the upper bound.
Definition at line 146 of file Range.cxx.
References Range::m_max, and Range::m_min.
Referenced by TupleCut::acceptRow(), SymbolPointRep::drawProjectedValue(), ColorSymbolPointRep::drawProjectedValues(), DyHist1DProjector::getAverage(), NTupleProjector::getAverage(), MeshProjector::inRangeWithZ(), and MapMatrixProjector::inRangeWithZ().
|
inline |
Returns the length of the range object.
Definition at line 156 of file Range.h.
References Range::m_max, and Range::m_min.
Referenced by AxisModelLog::adjustValues(), LogTransform::adjustValues(), BinnerAxisLinear::axisBinWidth(), BinnerAxisLinear::axisSetNumberOfBins(), BinnerAxisLinear::BinnerAxisLinear(), AxisModelLinear::calcHigh(), AxisModelLinear::calcLow(), AxisRepColor::drawColorScale(), ContourFunctionRep::drawProjectedValues(), BinnerAxisLinear::getCoordinate(), AxisWidget::getHighFromSlider(), AxisWidget::getLowFromSlider(), BinnerAxisLinear::getNob(), AxisWidget::getPositionFromSlider(), AxisWidget::getWidthFromSlider(), Map3Projector::getZValue(), ProjectorBase::preferredRange(), AxisWidget::processHighSliderMoved(), AxisWidget::processLowSliderMoved(), Inspector::setHighRange(), BinToColor::setRange(), BinnerAxisLinear::setRange(), AxisWidget::setSlider(), AxisWidget::setSliderZero(), LinearTransform::setTickStep(), and PeriodicBinaryTransform::setTickStep().
| double low | ( | ) | const |
Returns the minimum of the range object.
Definition at line 87 of file Range.cxx.
References Range::m_min.
Referenced by PyCanvas::addTextAtAbs(), LogTransform::adjustLogValues(), AxisModelLog::adjustLogValues(), AxisModelBase::adjustTicks(), AxisModelLinear::adjustValues(), AxisModelLog::adjustValues(), LinearTransform::adjustValues(), LogTransform::adjustValues(), BinnerAxisLinear::axisBinNumber(), BinnerAxis::axisGetLow(), BinnerAxis::binEdges(), AxisModelLinear::calcHigh(), AxisModelLog::calcHigh(), AxisModelLinear::calcLow(), AxisModelLog::calcLow(), CompositePlotter::calcRawRectangle(), XYTransform::calcRectangle(), PeriodicBinaryTransform::calcRectangle(), CompositePlotter::calcUserRectangle(), BinnerAxisLinear::calcWidthParm(), BinnerAxisLog::calcWidthParm(), CanvasView::contentsMouseMoveEvent(), TupleCutXML::createElement(), QtCut::cutRange(), AxisRepBase::drawAxesLines(), AxisRepColor::drawColorScale(), AxisRepBase::drawGridLines(), CutRangeRep::drawInvertedRange1D(), CutRangeRep::drawInvertedRange2D(), CutRangeRep::drawNormalRange(), ContourFunctionRep::drawProjectedValues(), ColorSymbolPointRep::drawProjectedValues(), ColorBoxPointRep::drawProjectedValues(), FilledColumnPointRep::drawValues(), ErrorBarRep::drawXError(), AxisRepBase::drawXTickLabels(), AxisRepBase::drawXTickLines(), ErrorBarRep::drawYError(), AxisRepBase::drawYTickLabels(), AxisRepBase::drawYTickLines(), LineProjector::fillProjectedValues(), LogTransform::genTicks(), DyHist1DProjector::getAverage(), BinnerAxisLinear::getCoordinate(), AxisWidget::getHighFromSlider(), AxisWidget::getLowFromSlider(), PlotterBase::getLowRangeOnX(), BinnerAxisLog::getNob(), AxisWidget::getPositionFromSlider(), AxisModelBase::getRange(), QtDisplay::getRange(), PeriodicBinaryTransform::moduloAddX(), PeriodicBinaryTransform::moduloAddY(), PeriodicBinaryTransform::moduloSubX(), PeriodicBinaryTransform::moduloSubY(), ProjectorBase::preferredRange(), CompositePlotter::prepareToDraw(), AxisWidget::processHighSliderMoved(), AxisWidget::processLowSliderMoved(), CompositePlotter::processReturnValue(), AxisWidget::processTextBoxReturnPressed(), AxisWidget::processZoomPanCheckBoxClicked(), Inspector::rotateX(), Inspector::rotateY(), BinnerAxisXML::setAttributes(), AxisModelXML::setAttributes(), BinnerAxisLog::setBins(), BinnerAxisLog::setBinWidth(), Inspector::setDragOn(), LogTransform::setFirstTick(), LinearTransform::setFirstTick(), PeriodicBinaryTransform::setFirstTick(), Inspector::setHighRange(), Inspector::setLowRange(), ContourPointRep::setMinMax(), BinnerAxisLinear::setOffset(), BinnerAxisLog::setOffset(), ProfileProjector::setRange(), Hist1DProjImp::setRange(), BinToColor::setRange(), Hist2DProjImp::setRange(), Profile2DProjector::setRange(), BinnerAxisLog::setRange(), Range::setRange(), AxisModelBase::setRange(), AxisWidget::setSlider(), AxisModelLog::setTickStep(), LogTransform::setTickStep(), LinearTransform::setTickStep(), PeriodicBinaryTransform::setTickStep(), Inspector::setXRotateText(), Inspector::setYRotateText(), LineFunctionRep::smoothCurve(), Inspector::updateAxisTab(), AxisWidget::updateCutControlValues(), CreateNTuple::updateCutList(), LogTransform::validate(), PeriodicBinaryTransform::validate(), and Inspector::validPeriodicTransformRange().
| int numberOfBins | ( | double | width | ) | const |
Returns the number of bins of width width required to fill the range.
Definition at line 199 of file Range.cxx.
References Range::m_max, and Range::m_min.
Referenced by BinnerAxisLinear::getNob().
| double pos | ( | ) | const |
Returns the first positive element in range.
Definition at line 113 of file Range.cxx.
References Range::m_pos.
Referenced by LogTransform::adjustLogValues(), AxisModelLog::adjustLogValues(), AxisModelLinear::adjustValues(), AxisModelLog::adjustValues(), LinearTransform::adjustValues(), LogTransform::adjustValues(), CompositePlotter::autoScaleZ(), AxisModelLinear::calcHigh(), AxisModelLog::calcHigh(), AxisModelLinear::calcLow(), AxisModelLog::calcLow(), ColorSymbolPointRep::drawProjectedValues(), LineProjector::getPosOn(), DyHist2DProjector::getPosOn(), Hist1DProjImp::getPosOnValue(), Hist2DProjImp::getPosOnValue(), AxisWidget::processHighSliderMoved(), AxisWidget::processLowSliderMoved(), AxisWidget::processTextBoxReturnPressed(), Inspector::rotateX(), Inspector::rotateY(), Inspector::setDragOn(), Inspector::setHighRange(), Inspector::setLowRange(), ContourPointRep::setMinMax(), Range::setRange(), AxisModelBase::setRange(), Inspector::setXRotateText(), Inspector::setYRotateText(), and LogTransform::validate().
| void setEmpty | ( | bool | yes = true | ) |
Sets the range to empty.
Definition at line 165 of file Range.cxx.
References Range::m_empty, and yes.
Referenced by AxisModelBase::setUnionRange().
| void setHigh | ( | double | x | ) |
Sets the maximum of the range object.
Definition at line 106 of file Range.cxx.
References Range::m_max, and Range::m_min.
Referenced by ProjectorBase::preferredRange(), AxisWidget::processHighSliderMoved(), BinnerAxisLog::setBinWidth(), BinnerAxisLog::setRange(), LogTransform::validate(), and PeriodicBinaryTransform::validate().
| void setIntersect | ( | const Range & | range | ) |
Forms the intersect with the range in the argument.
Definition at line 188 of file Range.cxx.
References Range::m_max, Range::m_min, and Range::m_pos.
Referenced by AxisModelBase::setIntersectRange().
| void setLength | ( | double | val, |
| bool | high_hold = false |
||
| ) |
Sets the length of the range.
The boolean high_hold determines which end is held fixed and which one is modified.
Definition at line 135 of file Range.cxx.
References Range::m_max, and Range::m_min.
Referenced by FitsController::checkForImage(), BinnerAxisLinear::setBinWidth(), and BinnerAxisLinear::setRange().
| void setLow | ( | double | x | ) |
Sets the minimum of the range object.
Definition at line 93 of file Range.cxx.
References Range::m_max, and Range::m_min.
Referenced by FitsController::checkForImage(), Hist1DProjImp::preferredRange(), Hist2DProjImp::preferredRange(), ProjectorBase::preferredRange(), AxisWidget::processLowSliderMoved(), BinnerAxisLog::setRange(), LogTransform::validate(), and PeriodicBinaryTransform::validate().
| void setPos | ( | double | x | ) |
Sets the first positive element in range.
Definition at line 119 of file Range.cxx.
References Range::m_max, Range::m_min, and Range::m_pos.
Referenced by AxisModelBase::setRangePos().
| void setRange | ( | double | low, |
| double | high, | ||
| double | pos | ||
| ) |
Changes the current Range.
Definition at line 126 of file Range.cxx.
References Range::high(), Range::low(), Range::m_max, Range::m_min, Range::m_pos, and Range::pos().
Referenced by FitsController::checkForImage(), LineProjector::dataRangeOn(), MapMatrixProjector::dataRangeOn(), FitsNTuple::fillRange(), NTuple::fillRange(), DataSource::fillRange(), MeshProjector::preferredRange(), MapMatrixProjector::preferredRange(), AxisWidget::processHighSliderMoved(), AxisWidget::processLowSliderMoved(), AxisWidget::processTextBoxReturnPressed(), Range::Range(), Inspector::setDragOn(), and AxisModelBase::setRange().
| void setRange | ( | Iterator | first, |
| Iterator | end | ||
| ) |
Sets the range from the data sequence.
Definition at line 164 of file Range.h.
References Range::m_max, Range::m_min, and Range::m_pos.
| void setUnion | ( | const Range & | range | ) |
Forms the union with the range range.
The resulting range of the object extends from the lower range of the two objects to the upper range of the two. If the range was empty (
Definition at line 170 of file Range.cxx.
References Range::m_empty, Range::m_max, Range::m_min, and Range::m_pos.
Referenced by XyPlotter::setBinWidth(), and AxisModelBase::setUnionRange().
|
private |
A flag indicating that the range is empty.
An empty range is one that has not yet been set to a value.
Definition at line 52 of file Range.h.
Referenced by Range::Range(), Range::setEmpty(), and Range::setUnion().
|
private |
The maximum in the range.
Definition at line 43 of file Range.h.
Referenced by Range::excludes(), Range::fraction(), Range::high(), Range::includes(), Range::length(), Range::numberOfBins(), Range::Range(), Range::setHigh(), Range::setIntersect(), Range::setLength(), Range::setLow(), Range::setPos(), Range::setRange(), and Range::setUnion().
|
private |
The minimum in the range.
Definition at line 39 of file Range.h.
Referenced by Range::fraction(), Range::includes(), Range::length(), Range::low(), Range::numberOfBins(), Range::Range(), Range::setHigh(), Range::setIntersect(), Range::setLength(), Range::setLow(), Range::setPos(), Range::setRange(), and Range::setUnion().
|
private |
The minimum positive value in the range, for log scale.
Definition at line 47 of file Range.h.
Referenced by Range::pos(), Range::Range(), Range::setIntersect(), Range::setPos(), Range::setRange(), and Range::setUnion().