#include <Bins1DProfile.h>
Inheritance diagram for Bins1DProfile:
Calculates the mean and the standard deviation of data along the y axis in slices along the x axis.
Matan Shacham <matan@slac.stanford.edu>
Oded Wurman <owurman@stanford.edu>
Definition at line 29 of file Bins1DProfile.h.
Public Member Functions | |
virtual void | accumulate (double x, double y, double w=1.0, double dummy=0.0) |
Accumulate a data point x, y into a bin. | |
int | binNumber (double x) |
Returns the number of the bin in which the x value is situated. | |
Bins1DProfile (const Bins1DProfile &binner) | |
The copy constructor. | |
Bins1DProfile () | |
The default constructor. | |
virtual double | binWidth (hippodraw::Axes::Type axis) const |
Returns the bin width parameter on the specified axis. | |
double | binWidth (int i) const |
Returns the width of each bin. | |
double | calcBinWidth (const std::string &axis, int parm, bool dragging) const |
Calculates the bin width from dragging slider. | |
virtual double | calcOffset (const std::string &, int parm, bool dragging) const |
Calculates and returns a new range from dragging slider. | |
BinsBase * | clone () const |
The clone function returns an object of its own kind which is a copy of this object at this moment. | |
virtual NTuple * | createNTuple () const |
Creates an NTuple. | |
virtual void | fillDataSource (DataSource *ntuple) const |
Fills the DataSource. | |
virtual void | fillProjectedValues (DataSource *ntuple) const |
virtual const BinnerAxis * | getBinnerOn (hippodraw::Axes::Type axis) const |
Returns the BinnerAxis object used by this object. | |
double | getHigh () const |
Returns the lower edge of the last + 1 bin through binner_axis. | |
virtual int | getNumberOfAxes () const |
Returns the number of axes handled by the BinsBase derived class. | |
virtual int | getNumberOfEntries (int i) const |
Returns the number of entries in ith bin. | |
virtual int | getNumberOfEntries () const |
Returns the true number of entries. | |
virtual double | getOffset (hippodraw::Axes::Type axis) const |
Returns the offset parameter on specific axis. | |
virtual const Range & | getRange (hippodraw::Axes::Type axis) |
Returns range from binner axis. | |
virtual double | getZValue (double x, double y) const |
Get the z value at the specified point (x,y). | |
virtual bool | hasEqualWidths () const |
Returns true if all bins have the same width. | |
bool | isDirty () |
Returns true if the re-accumulation is needed. | |
bool | isEmpty () const |
Returns true if no accumulation has yet occurred, otherwise returns false . | |
double | maxBin () |
Returns the value of the bin with the largest value. | |
double | minBin () |
Returns the value of the bin with the smallest value. | |
const std::string & | name () const |
Returns the name of the Bins container object. | |
virtual int | numberOfBins (hippodraw::Axes::Type axis) const |
Returns the number of bins on specified axis. | |
virtual void | reset () |
Resets the accumulation to zero. | |
virtual double | scaleFactor () const |
Returns the scale factor. | |
virtual void | scaleNumberOfEntries (double number) |
Sets a scale factor on the output so that the number of entries appears to be number. | |
virtual void | setBinContents (const DataSource *ntuple) |
virtual void | setBinnerOn (BinnerAxis *, hippodraw::Axes::Type axis) |
Sets a new BinnerAxis for the binner to use. | |
virtual const Range & | setBinWidth (hippodraw::Axes::Type axis, double value) |
Sets the bin width parameter on the specified axis. | |
void | setDirty () |
Sets a flag to indicate that re-binning needs to be done. | |
virtual void | setEntriesScaling (bool on) |
Sets the scaling number of entries on if on is true , otherwise turns if off. | |
virtual void | setNumberOfBins (hippodraw::Axes::Type axis, int num_bins) |
Sets the number of bins on the the specified axis. | |
virtual void | setOffset (hippodraw::Axes::Type axis, double value) |
Sets the offset parameter on the specified axis. | |
virtual const Range & | setRange (hippodraw::Axes::Type axis, const Range &, bool hold_width=true) |
Sets the Range on the specified axis. | |
virtual | ~Bins1DProfile () |
The destructor. | |
Protected Member Functions | |
virtual double | getLow (hippodraw::Axes::Type axis) const |
Returns the low value of the bins on the specified axis. | |
virtual NTuple * | prepareNTuple (unsigned int rows) const |
Prepares the NTuple. | |
Protected Attributes | |
BinnerAxis * | binner_axis |
The binner axis object. | |
bool | m_empty |
A flag set to true , when no accumulation has yet occurred, otherwise is set false . | |
bool | m_is_scaling |
A flag which is set true to enable scaling the output. | |
double | m_scale_factor |
The scale factor. | |
bool | m_values_dirty |
A flag to indicate that the objects in m_values are not correct. | |
Private Member Functions | |
virtual void | resize (int number) |
Resizes the internal arrays for number bins. | |
Private Attributes | |
double | m_high |
The higher edge of the last bin (the lower edge of the last + 1). | |
std::vector< int > | m_num |
The total number of entries for each bin. | |
std::vector< double > | m_sum |
The sum of the data along the y axis. | |
std::vector< double > | m_sumsq |
The sum of the data squared along the y axis. |
|
The default constructor.
Definition at line 46 of file Bins1DProfile.cxx. Referenced by clone(). |
|
The copy constructor.
Definition at line 51 of file Bins1DProfile.cxx. |
|
The destructor.
Definition at line 65 of file Bins1DProfile.cxx. |
|
Accumulate a data point x, y into a bin. The remaining arguments are ignored.
Implements BinsBase. Definition at line 110 of file Bins1DProfile.cxx. References Bins1DBase::binNumber(), BinsBase::m_empty, m_num, m_sum, and m_sumsq. |
|
Returns the number of the bin in which the x value is situated.
Definition at line 140 of file Bins1DBase.h. References BinnerAxis::axisBinNumber(), and Bins1DBase::binner_axis. Referenced by accumulate(), and Bins1DHist::accumulate(). |
|
Returns the bin width parameter on the specified axis. If the bins have all the same width, then returns the bin width. If the bin width are determined by some algorithm, then returns a parameter used to calculate the bin widths. Implements BinsBase. Definition at line 133 of file Bins1DBase.cxx. References Bins1DBase::binner_axis, BinnerAxis::getConstWid(), and hippodraw::Axes::X. |
|
Returns the width of each bin. Returns the width of the bin with index i. The first bin has index 0 and the last bin has index of number of bins minus 1. Definition at line 120 of file Bins1DBase.cxx. References BinnerAxis::axisBinWidth(), and Bins1DBase::binner_axis. Referenced by fillDataSource(), Bins1DHist::fillDataSource(), fillProjectedValues(), and Bins1DHist::fillProjectedValues(). |
|
Calculates the bin width from dragging slider.
Implements BinsBase. Definition at line 153 of file Bins1DBase.cxx. References Bins1DBase::binner_axis, and BinnerAxis::calcBinWidth(). |
|
Calculates and returns a new range from dragging slider.
Implements BinsBase. Definition at line 166 of file Bins1DBase.cxx. References Bins1DBase::binner_axis, and BinnerAxis::calcOffset(). |
|
The clone function returns an object of its own kind which is a copy of this object at this moment.
Implements BinsBase. Definition at line 60 of file Bins1DProfile.cxx. References Bins1DProfile(). |
|
Creates an NTuple. Derived classes will return an NTuple appropriate to their binned data. They should at least contain the coordinates, error on the coordinates, the value, and error on the value. Implements BinsBase. Definition at line 124 of file Bins1DProfile.cxx. References fillProjectedValues(), m_sum, Bins1DBase::prepareNTuple(), and num_util::size(). |
|
Fills the DataSource. Clears and fills the DataSource based on the contents of the bins. The resulting DataSource is follows the standard defined in hippodraw::DataPoint2DTuple or hippodraw::DataPoint3DTuple. Implements BinsBase. Definition at line 192 of file Bins1DProfile.cxx. References Bins1DBase::binWidth(), Bins1DBase::getLow(), m_num, m_sum, m_sumsq, Bins1DBase::numberOfBins(), hippodraw::DataPoint2DTuple::SIZE, std::sqrt(), hippodraw::Axes::X, hippodraw::DataPoint2DTuple::XERR, hippodraw::Axes::Y, and hippodraw::DataPoint2DTuple::YERR. |
|
Implements BinsBase. Definition at line 140 of file Bins1DProfile.cxx. References Bins1DBase::binWidth(), Bins1DBase::getLow(), m_num, m_sum, m_sumsq, Bins1DBase::numberOfBins(), hippodraw::DataPoint2DTuple::SIZE, std::sqrt(), hippodraw::Axes::X, hippodraw::DataPoint2DTuple::XERR, hippodraw::Axes::Y, and hippodraw::DataPoint2DTuple::YERR. Referenced by createNTuple(). |
|
Returns the BinnerAxis object used by this object.
Implements BinsBase. Definition at line 65 of file Bins1DBase.cxx. References Bins1DBase::binner_axis, and hippodraw::Axes::X. |
|
Returns the lower edge of the last + 1 bin through binner_axis.
Definition at line 92 of file Bins1DBase.cxx. References BinnerAxis::axisGetHigh(), and Bins1DBase::binner_axis. |
|
Returns the low value of the bins on the specified axis.
Implements BinsBase. Definition at line 85 of file Bins1DBase.cxx. References BinnerAxis::axisGetLow(), Bins1DBase::binner_axis, and hippodraw::Axes::X. Referenced by fillDataSource(), Bins1DHist::fillDataSource(), fillProjectedValues(), and Bins1DHist::fillProjectedValues(). |
|
Returns the number of axes handled by the BinsBase derived class.
Implements BinsBase. Definition at line 59 of file Bins1DBase.cxx. |
|
Returns the number of entries in ith bin. Returns the sum of the weight parameter of the accumulate member function. Indexing is such that first proper bin (i.e. one which is NOT underflow ) is numbered 0. Implements Bins1DBase. Definition at line 105 of file Bins1DProfile.cxx. References m_num. |
|
Returns the true number of entries. Returns the sum of the weight parameter of the accumulate member function. Implements BinsBase. Definition at line 99 of file Bins1DProfile.cxx. References std::accumulate(), and m_num. |
|
Returns the offset parameter on specific axis.
Implements BinsBase. Definition at line 177 of file Bins1DBase.cxx. References Bins1DBase::binner_axis, BinnerAxis::getOffset(), and hippodraw::Axes::X. |
|
Returns range from binner axis.
Implements BinsBase. Definition at line 209 of file Bins1DBase.cxx. References Bins1DBase::binner_axis, BinnerAxis::getRange(), and hippodraw::Axes::X. |
|
Get the z value at the specified point (x,y).
Reimplemented in Bins2DHist, and Bins2DProfile. Definition at line 72 of file BinsBase.cxx. Referenced by BinningProjector::getZValue(). |
|
Returns
Implements BinsBase. Definition at line 114 of file Bins1DBase.cxx. References Bins1DBase::binner_axis, and BinnerAxis::hasEqualWidths(). |
|
Returns
Definition at line 57 of file BinsBase.cxx. References BinsBase::m_values_dirty. |
|
Returns
Definition at line 79 of file BinsBase.cxx. References BinsBase::m_empty. |
|
Returns the value of the bin with the largest value.
Definition at line 74 of file Bins1DProfile.cxx. References m_sum, and std::max_element(). |
|
Returns the value of the bin with the smallest value.
Definition at line 69 of file Bins1DProfile.cxx. References m_sum, and std::min_element(). |
|
Returns the name of the Bins container object.
Definition at line 52 of file BinsBase.cxx. References BinsBase::m_name. Referenced by BinsBaseXML::createElement(). |
|
Returns the number of bins on specified axis. If a BinnerAxis object does not exist, returns 0. Implements BinsBase. Definition at line 97 of file Bins1DBase.cxx. References BinnerAxis::axisNumberOfBins(), Bins1DBase::binner_axis, and hippodraw::Axes::X. Referenced by fillDataSource(), fillProjectedValues(), and Bins1DBase::resize(). |
|
Prepares the NTuple. Creates and returns the NTuple that will be filled from the binner's values. The NTuple will have rows rows and 4 columns. Implements BinsBase. Definition at line 226 of file Bins1DBase.cxx. References hippodraw::DataPoint2DTuple::ERROR, NTuple::setLabels(), and hippodraw::DataPoint2DTuple::WIDTH. Referenced by createNTuple(), and Bins1DHist::createNTuple(). |
|
Resets the accumulation to zero.
Implements BinsBase. Definition at line 90 of file Bins1DProfile.cxx. References std::fill(), BinsBase::m_empty, m_num, m_sum, and m_sumsq. Referenced by resize(). |
|
Resizes the internal arrays for number bins.
Implements Bins1DBase. Definition at line 79 of file Bins1DProfile.cxx. References m_num, m_sum, m_sumsq, BinsBase::m_values_dirty, and reset(). |
|
Returns the scale factor. Used to convert the projected values to number of entries in a bin. Reimplemented from BinsBase. Definition at line 127 of file Bins1DBase.cxx. References Bins1DBase::binner_axis, and BinnerAxis::scaleFactorWid(). |
|
Sets a scale factor on the output so that the number of entries appears to be number. This feature might be used, for example, to compare two histograms that have different number of entires by normalizing one to the other. Definition at line 86 of file BinsBase.cxx. References BinsBase::m_scale_factor. |
|
Implements BinsBase. Definition at line 252 of file Bins1DProfile.cxx. |
|
Sets a new BinnerAxis for the binner to use. The old one, if any, will be destroyed. Implements BinsBase. Definition at line 72 of file Bins1DBase.cxx. References Bins1DBase::binner_axis, BinsBase::m_values_dirty, Bins1DBase::resize(), and hippodraw::Axes::X. |
|
Sets the bin width parameter on the specified axis.
Implements BinsBase. Definition at line 141 of file Bins1DBase.cxx. References Bins1DBase::binner_axis, Bins1DBase::resize(), BinnerAxis::setBinWidth(), and hippodraw::Axes::X. |
|
Sets a flag to indicate that re-binning needs to be done.
Definition at line 62 of file BinsBase.cxx. References BinsBase::m_values_dirty. Referenced by ProfileProjector::changedNTuple(), Profile2DProjector::changedNTuple(), DyHist2DProjector::changedNTuple(), and DyHist1DProjector::changedNTuple(). |
|
Sets the scaling number of entries on if on is
Definition at line 93 of file BinsBase.cxx. References BinsBase::m_is_scaling. |
|
Sets the number of bins on the the specified axis.
Implements BinsBase. Definition at line 104 of file Bins1DBase.cxx. References BinnerAxis::axisSetNumberOfBins(), Bins1DBase::binner_axis, Bins1DBase::resize(), and hippodraw::Axes::X. |
|
Sets the offset parameter on the specified axis.
Implements BinsBase. Definition at line 186 of file Bins1DBase.cxx. References Bins1DBase::binner_axis, BinnerAxis::setOffset(), and hippodraw::Axes::X. |
|
Sets the Range on the specified axis.
If hold_width is Implements BinsBase. Definition at line 196 of file Bins1DBase.cxx. References Bins1DBase::binner_axis, Bins1DBase::resize(), BinnerAxis::setRange(), and hippodraw::Axes::X. |
|
|
A flag set to
Definition at line 57 of file BinsBase.h. Referenced by Bins2DProfile::accumulate(), Bins2DHist::accumulate(), accumulate(), Bins1DHist::accumulate(), BinsBase::isEmpty(), Bins2DProfile::reset(), Bins2DHist::reset(), reset(), and Bins1DHist::reset(). |
|
The higher edge of the last bin (the lower edge of the last + 1).
Definition at line 48 of file Bins1DProfile.h. |
|
A flag which is set
Definition at line 49 of file BinsBase.h. Referenced by Bins2DHist::fillDataSource(), Bins1DHist::fillDataSource(), Bins2DHist::fillProjectedValues(), Bins1DHist::fillProjectedValues(), and BinsBase::setEntriesScaling(). |
|
The total number of entries for each bin.
Definition at line 45 of file Bins1DProfile.h. Referenced by accumulate(), fillDataSource(), fillProjectedValues(), getNumberOfEntries(), reset(), and resize(). |
|
The scale factor. This data member is used to scale the output so that the total number of entries has this value. Definition at line 45 of file BinsBase.h. Referenced by Bins2DHist::fillDataSource(), Bins1DHist::fillDataSource(), Bins2DHist::fillProjectedValues(), Bins1DHist::fillProjectedValues(), and BinsBase::scaleNumberOfEntries(). |
|
The sum of the data along the y axis. Range of index is 1 to m_num_bins. 0 refers to underflow while m_num_bins+1 refers to overflow Definition at line 36 of file Bins1DProfile.h. Referenced by accumulate(), createNTuple(), fillDataSource(), fillProjectedValues(), maxBin(), minBin(), reset(), and resize(). |
|
The sum of the data squared along the y axis. This quantity is used to calculate the variance with only one pass through the data. Range of index is 1 to m_num_bins. Definition at line 41 of file Bins1DProfile.h. Referenced by accumulate(), fillDataSource(), fillProjectedValues(), reset(), and resize(). |
|
A flag to indicate that the objects in m_values are not correct.
Definition at line 52 of file BinsBase.h. Referenced by Bins1DBase::Bins1DBase(), Bins2DBase::Bins2DBase(), BinsBase::isDirty(), Bins1DHist::reset(), Bins2DBase::resize(), resize(), Bins1DHist::resize(), Bins2DBase::setBinnerOn(), Bins1DBase::setBinnerOn(), Bins2DBase::setBinWidth(), BinsBase::setDirty(), and Bins2DBase::setOffset(). |