#include <Range.h>
Collaboration diagram for Range:
Definition at line 33 of file 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 (const std::vector< double > &array) | |
A constructor taking its range from the range of data in the vector array. | |
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 () | |
The following constructors sets the range to {0.0, 0.0} but sets m_empty to true. | |
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. | |
template<class Iterator> | |
void | setRange (Iterator first, Iterator end) |
Sets the range from the data sequence. | |
void | setRange (double low, double high, double pos) |
Changes the current Range. | |
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 35 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 43 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 79 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 151 of file Range.cxx.
References Range::m_max.
Referenced by ContourPointRep::createContours(), NTupleProjector::inRange(), and Map1Projector::inRange().
double fraction | ( | double | value | ) | const |
Returns the fraction of the range that value represents.
Definition at line 158 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 98 of file Range.cxx.
References Range::m_max.
Referenced by PyCanvas::addTextAtAbs(), LogTransform::adjustLogValues(), AxisModelLog::adjustLogValues(), AxisModelBase::adjustTicks(), LogTransform::adjustValues(), LinearTransform::adjustValues(), AxisModelLog::adjustValues(), AxisModelLinear::adjustValues(), CompositePlotter::autoScaleZ(), BinnerAxis::axisGetHigh(), BinnerAxis::binEdges(), AxisModelLog::calcHigh(), AxisModelLinear::calcHigh(), AxisModelLog::calcLow(), AxisModelLinear::calcLow(), CompositePlotter::calcRawRectangle(), XYTransform::calcRectangle(), PeriodicBinaryTransform::calcRectangle(), CompositePlotter::calcUserRectangle(), BinnerAxisLog::calcWidthParm(), BinnerAxisLinear::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(), PeriodicBinaryTransform::genTicks(), LogTransform::genTicks(), LinearTransform::genTicks(), DyHist1DProjector::getAverage(), PlotterBase::getHighRangeOnX(), BinnerAxisLog::getNob(), QtDisplay::getRange(), AxisModelBase::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(), Profile2DProjector::setRange(), Hist2DProjImp::setRange(), Hist1DProjImp::setRange(), BinnerAxisLog::setRange(), AxisModelBase::setRange(), PeriodicBinaryTransform::setTickStep(), LogTransform::setTickStep(), LinearTransform::setTickStep(), AxisModelLog::setTickStep(), Inspector::setXRotateText(), Inspector::setYRotateText(), LineFunctionRep::smoothCurve(), Inspector::updateAxisTab(), AxisWidget::updateCutControlValues(), CreateNTuple::updateCutList(), PeriodicBinaryTransform::validate(), LogTransform::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 144 of file Range.cxx.
References Range::m_max, and Range::m_min.
Referenced by TupleCut::acceptRow(), SymbolPointRep::drawProjectedValue(), ColorSymbolPointRep::drawProjectedValues(), NTupleProjector::getAverage(), DyHist1DProjector::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 LogTransform::adjustValues(), AxisModelLog::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(), PeriodicBinaryTransform::setTickStep(), and LinearTransform::setTickStep().
double low | ( | ) | const |
Returns the minimum of the range object.
Definition at line 85 of file Range.cxx.
References Range::m_min.
Referenced by PyCanvas::addTextAtAbs(), LogTransform::adjustLogValues(), AxisModelLog::adjustLogValues(), AxisModelBase::adjustTicks(), LogTransform::adjustValues(), LinearTransform::adjustValues(), AxisModelLog::adjustValues(), AxisModelLinear::adjustValues(), BinnerAxisLinear::axisBinNumber(), BinnerAxis::axisGetLow(), BinnerAxis::binEdges(), AxisModelLog::calcHigh(), AxisModelLinear::calcHigh(), AxisModelLog::calcLow(), AxisModelLinear::calcLow(), CompositePlotter::calcRawRectangle(), XYTransform::calcRectangle(), PeriodicBinaryTransform::calcRectangle(), CompositePlotter::calcUserRectangle(), BinnerAxisLog::calcWidthParm(), BinnerAxisLinear::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(), QtDisplay::getRange(), AxisModelBase::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(), PeriodicBinaryTransform::setFirstTick(), LogTransform::setFirstTick(), LinearTransform::setFirstTick(), Inspector::setHighRange(), Inspector::setLowRange(), ContourPointRep::setMinMax(), BinnerAxisLog::setOffset(), BinnerAxisLinear::setOffset(), ProfileProjector::setRange(), Profile2DProjector::setRange(), Hist2DProjImp::setRange(), Hist1DProjImp::setRange(), BinToColor::setRange(), BinnerAxisLog::setRange(), AxisModelBase::setRange(), AxisWidget::setSlider(), PeriodicBinaryTransform::setTickStep(), LogTransform::setTickStep(), LinearTransform::setTickStep(), AxisModelLog::setTickStep(), Inspector::setXRotateText(), Inspector::setYRotateText(), LineFunctionRep::smoothCurve(), Inspector::updateAxisTab(), AxisWidget::updateCutControlValues(), CreateNTuple::updateCutList(), PeriodicBinaryTransform::validate(), LogTransform::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 197 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 111 of file Range.cxx.
References Range::m_pos.
Referenced by LogTransform::adjustLogValues(), AxisModelLog::adjustLogValues(), LogTransform::adjustValues(), LinearTransform::adjustValues(), AxisModelLog::adjustValues(), AxisModelLinear::adjustValues(), CompositePlotter::autoScaleZ(), AxisModelLog::calcHigh(), AxisModelLinear::calcHigh(), AxisModelLog::calcLow(), AxisModelLinear::calcLow(), ColorSymbolPointRep::drawProjectedValues(), LineProjector::getPosOn(), DyHist2DProjector::getPosOn(), Hist2DProjImp::getPosOnValue(), Hist1DProjImp::getPosOnValue(), AxisWidget::processHighSliderMoved(), AxisWidget::processLowSliderMoved(), AxisWidget::processTextBoxReturnPressed(), Inspector::rotateX(), Inspector::rotateY(), Inspector::setDragOn(), Inspector::setHighRange(), Inspector::setLowRange(), ContourPointRep::setMinMax(), AxisModelBase::setRange(), Inspector::setXRotateText(), Inspector::setYRotateText(), and LogTransform::validate().
void setEmpty | ( | bool | yes = true |
) |
Sets the range to empty.
Definition at line 163 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 104 of file Range.cxx.
References Range::m_max, and Range::m_min.
Referenced by ProjectorBase::preferredRange(), AxisWidget::processHighSliderMoved(), BinnerAxisLog::setBinWidth(), BinnerAxisLog::setRange(), PeriodicBinaryTransform::validate(), and LogTransform::validate().
void setIntersect | ( | const Range & | range | ) |
Forms the intersect with the range in the argument.
Definition at line 186 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 133 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 91 of file Range.cxx.
References Range::m_max, and Range::m_min.
Referenced by FitsController::checkForImage(), ProjectorBase::preferredRange(), Hist2DProjImp::preferredRange(), Hist1DProjImp::preferredRange(), AxisWidget::processLowSliderMoved(), BinnerAxisLog::setRange(), PeriodicBinaryTransform::validate(), and LogTransform::validate().
void setPos | ( | double | x | ) |
Sets the first positive element in range.
Definition at line 117 of file Range.cxx.
References Range::m_max, Range::m_min, and Range::m_pos.
Referenced by AxisModelBase::setRangePos().
void setRange | ( | Iterator | first, | |
Iterator | end | |||
) | [inline] |
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 setRange | ( | double | low, | |
double | high, | |||
double | pos | |||
) |
Changes the current Range.
Definition at line 124 of file Range.cxx.
References Range::m_max, Range::m_min, and Range::m_pos.
Referenced by FitsController::checkForImage(), MapMatrixProjector::dataRangeOn(), LineProjector::dataRangeOn(), NTuple::fillRange(), FitsNTuple::fillRange(), DataSource::fillRange(), MeshProjector::preferredRange(), MapMatrixProjector::preferredRange(), AxisWidget::processHighSliderMoved(), AxisWidget::processLowSliderMoved(), AxisWidget::processTextBoxReturnPressed(), Range::Range(), Inspector::setDragOn(), and AxisModelBase::setRange().
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 168 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().