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. | |
double | fraction (double value) const |
Returns the fraction of the range that value represents. | |
double | high () const |
Returns the maximum of the range object. | |
bool | includes (double value) const |
Returns true if the argument value is inside the range. | |
double | length () const |
Returns the length of the range object. | |
double | low () const |
Returns the minimum of the range object. | |
int | numberOfBins (double width) const |
Returns the number of bins of width width required to fill the range. | |
double | pos () const |
Returns the first positive element in range. | |
Range () | |
The following constructors sets the range to {0.0, 0.0} but sets m_empty to true. | |
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. | |
Range (const std::vector< double > &array) | |
A constructor taking its range from the range of data in the vector array. | |
void | setEmpty (bool yes=true) |
Sets the range to empty. | |
void | setHigh (double x) |
Sets the maximum of the range object. | |
void | setIntersect (const Range &range) |
Forms the intersect with the range in the argument. | |
void | setLength (double val, bool high_hold=false) |
Sets the length of the range. | |
void | setLow (double x) |
Sets the minimum of the range object. | |
void | setPos (double x) |
Sets the first positive element in range. | |
void | setRange (double low, double high, double pos) |
Changes the current Range. | |
template<class Iterator > | |
void | setRange (Iterator first, Iterator end) |
Sets the range from the data sequence. | |
void | setUnion (const Range &range) |
Forms the union with the range range. | |
Private Attributes | |
bool | m_empty |
A flag indicating that the range is empty. | |
double | m_max |
The maximum in the range. | |
double | m_min |
The minimum in the range. | |
double | m_pos |
The minimum positive value in the range, for log scale. |
Range | ( | ) |
The following constructors sets the range to {0.0, 0.0} but sets m_empty to true.
Definition at line 36 of file Range.cxx.
Referenced by CanvasView::contentsMouseMoveEvent().
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 44 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 80 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 152 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 159 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 99 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 145 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().
double length | ( | ) | const [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 86 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(), Range::setRange(), BinnerAxisLog::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 198 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 112 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 164 of file Range.cxx.
References Range::m_empty.
Referenced by AxisModelBase::setUnionRange().
void setHigh | ( | double | x | ) |
Sets the maximum of the range object.
Definition at line 105 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 187 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 134 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 92 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 118 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 125 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.
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 169 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().
bool m_empty [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().
double m_max [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().
double m_min [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().
double m_pos [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().