#include <Bins2DBase.h>
Inheritance diagram for Bins2DBase:
Oded Wurman <oded@slac.stanford.edu>
Matan Shacham <matan@slac.stanford.edu>
Paul F. Kunz <Paul_Kunz@slac.stanford.edu>
Definition at line 28 of file Bins2DBase.h.
Public Member Functions | |
virtual void | accumulate (double x, double w_or_y=1.0, double z=1.0, double w=1.0)=0 |
Accumulates the data point with weight w. | |
Bins2DBase (const Bins2DBase &binner) | |
The copy constructor. | |
virtual double | binWidth (hippodraw::Axes::Type axis) const |
Returns the bin width parameter on the specified axis. | |
double | binWidthX (int i) const |
Gets the bin width of the X bin for the i bin. | |
double | binWidthY (int i) const |
Gets the bin width of the Y bin for the i bin. | |
double | calcBinWidth (const std::string &axis, int parm, bool dragging) const |
Calculates the bin width parameter from dragging slider. | |
virtual double | calcOffset (const std::string &, int parm, bool dragging) const |
Calculates and returns a new range from dragging slider. | |
virtual BinsBase * | clone () const =0 |
The virtual function to make copy of concrete derived class. | |
virtual NTuple * | createNTuple () const =0 |
Creates an NTuple. | |
virtual void | fillDataSource (DataSource *ntuple) const =0 |
Fills the DataSource. | |
virtual void | fillProjectedValues (DataSource *ntuple) const =0 |
Fills the NTuple. | |
virtual const BinnerAxis * | getBinnerOn (hippodraw::Axes::Type axis) const |
Returns the BinnerAxis object used by this object. | |
virtual int | getNumberOfAxes () const |
Returns the number of axes handled by the BinsBase derived class. | |
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 . | |
const std::string & | name () const |
Returns the name of the Bins container object. | |
int | numberOfBins () const |
Returns the number of bins. | |
virtual int | numberOfBins (hippodraw::Axes::Type axis) const |
Returns the number of bins on specified axis. | |
virtual void | reset ()=0 |
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)=0 |
Sets the contents of the bins from the ntuple. | |
void | setBinnerOn (BinnerAxis *, hippodraw::Axes::Type axis) |
Sets a new BinnerAxis on the axis axis 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 | 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. | |
~Bins2DBase () | |
The destructor. | |
Protected Member Functions | |
int | binNumberX (double x) const |
Returns the number of the bin in which the x value is situated. | |
int | binNumberY (double y) const |
Returns the number of the bin in which the y value is situated. | |
Bins2DBase (const char *name) | |
A constructor that takes bins container name as argument. | |
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. | |
virtual void | resize (int nx, int ny) |
Resizes the two dimensional arrays. | |
void | resize () |
Resizes the internal arrays. | |
virtual void | setNumberOfBins (hippodraw::Axes::Type axis, int number) |
Sets the number of bins on the the specified axis. | |
Protected Attributes | |
std::vector< std::vector< double > > | m_data |
The accumulated sum of weights. | |
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. | |
int | m_num_bins |
Total number of bins not including overflow and underflow. | |
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 Attributes | |
BinnerAxis * | binner_axisX |
The binner axis object for the X axis. | |
BinnerAxis * | binner_axisY |
The binner axis object for the Y axis. |
|
A constructor that takes bins container name as argument.
Definition at line 38 of file Bins2DBase.cxx. |
|
The copy constructor.
Definition at line 45 of file Bins2DBase.cxx. References binner_axisX, binner_axisY, BinnerAxis::clone(), and BinsBase::m_values_dirty. |
|
The destructor.
Definition at line 62 of file Bins2DBase.cxx. References binner_axisX, and binner_axisY. |
|
Accumulates the data point with weight w. Some derived class implementations make take second argument as the weight and ignore the remaining. Similarly for the third and fourth arguments. Implemented in Bins1DHist, Bins1DProfile, Bins2DHist, and Bins2DProfile. Referenced by ProfileProjector::execute(), Profile2DProjector::execute(), DyHist2DProjector::execute(), and DyHist1DProjector::execute(). |
|
Returns the number of the bin in which the x value is situated.
Definition at line 168 of file Bins2DBase.cxx. References BinnerAxis::axisBinNumber(), and binner_axisX. Referenced by Bins2DProfile::accumulate(), Bins2DHist::accumulate(), Bins2DProfile::getZValue(), and Bins2DHist::getZValue(). |
|
Returns the number of the bin in which the y value is situated.
Definition at line 173 of file Bins2DBase.cxx. References BinnerAxis::axisBinNumber(), and binner_axisY. Referenced by Bins2DProfile::accumulate(), Bins2DHist::accumulate(), Bins2DProfile::getZValue(), and Bins2DHist::getZValue(). |
|
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 180 of file Bins2DBase.cxx. References binner_axisX, binner_axisY, BinnerAxis::getConstWid(), hippodraw::Axes::X, and hippodraw::Axes::Y. |
|
Gets the bin width of the X bin for the i bin.
Definition at line 189 of file Bins2DBase.cxx. References BinnerAxis::axisBinWidth(), and binner_axisX. Referenced by Bins2DProfile::fillDataSource(), Bins2DHist::fillDataSource(), Bins2DProfile::fillProjectedValues(), Bins2DHist::fillProjectedValues(), Bins2DHist::getZValue(), and Bins2DHist::setBinContents(). |
|
Gets the bin width of the Y bin for the i bin.
Definition at line 194 of file Bins2DBase.cxx. References BinnerAxis::axisBinWidth(), and binner_axisY. Referenced by Bins2DProfile::fillDataSource(), Bins2DHist::fillDataSource(), Bins2DProfile::fillProjectedValues(), Bins2DHist::fillProjectedValues(), Bins2DHist::getZValue(), and Bins2DHist::setBinContents(). |
|
Calculates the bin width parameter from dragging slider.
Implements BinsBase. Definition at line 239 of file Bins2DBase.cxx. References binner_axisX, binner_axisY, and BinnerAxis::calcBinWidth(). |
|
Calculates and returns a new range from dragging slider.
Implements BinsBase. Definition at line 257 of file Bins2DBase.cxx. References binner_axisX, binner_axisY, and BinnerAxis::calcOffset(). |
|
The virtual function to make copy of concrete derived class.
Implemented in Bins1DHist, Bins1DProfile, Bins2DHist, and Bins2DProfile. Referenced by BinningProjector::BinningProjector(). |
|
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. Implemented in Bins1DHist, Bins1DProfile, Bins2DHist, and Bins2DProfile. Referenced by BinningProjector::createNTuple(). |
|
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. Implemented in Bins1DHist, Bins1DProfile, Bins2DHist, and Bins2DProfile. |
|
Fills the NTuple. Clears and fills the ntuple from the contents of the bins. Implemented in Bins1DHist, Bins1DProfile, Bins2DHist, and Bins2DProfile. |
|
Returns the BinnerAxis object used by this object.
Implements BinsBase. Definition at line 88 of file Bins2DBase.cxx. References binner_axisX, binner_axisY, hippodraw::Axes::X, and hippodraw::Axes::Y. |
|
Returns the low value of the bins on the specified axis.
Implements BinsBase. Definition at line 120 of file Bins2DBase.cxx. References BinnerAxis::axisGetLow(), binner_axisX, binner_axisY, hippodraw::Axes::X, and hippodraw::Axes::Y. Referenced by Bins2DProfile::fillDataSource(), Bins2DHist::fillDataSource(), Bins2DProfile::fillProjectedValues(), and Bins2DHist::fillProjectedValues(). |
|
Returns the number of axes handled by the BinsBase derived class.
Implements BinsBase. Definition at line 70 of file Bins2DBase.cxx. |
|
Returns the true number of entries. Returns the sum of the weight parameter of the accumulate member function. Implements BinsBase. Definition at line 347 of file Bins2DBase.cxx. References std::accumulate(), and m_data. Referenced by Bins2DHist::fillDataSource(), and Bins2DHist::fillProjectedValues(). |
|
Returns the offset parameter on specific axis.
Implements BinsBase. Definition at line 270 of file Bins2DBase.cxx. References binner_axisX, binner_axisY, BinnerAxis::getOffset(), hippodraw::Axes::X, and hippodraw::Axes::Y. |
|
Returns range from binner axis.
Implements BinsBase. Definition at line 315 of file Bins2DBase.cxx. References binner_axisX, binner_axisY, BinnerAxis::getRange(), hippodraw::Axes::X, and hippodraw::Axes::Y. |
|
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 200 of file Bins2DBase.cxx. References binner_axisX, binner_axisY, 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 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.
Definition at line 149 of file Bins2DBase.cxx. References m_num_bins. Referenced by Bins2DProfile::accumulate(), Bins2DHist::accumulate(), Bins2DProfile::createNTuple(), Bins2DHist::createNTuple(), Bins2DProfile::fillDataSource(), Bins2DHist::fillDataSource(), Bins2DProfile::fillProjectedValues(), Bins2DHist::fillProjectedValues(), resize(), Bins2DHist::setBinContents(), Bins2DProfile::setNumberOfBins(), Bins2DHist::setNumberOfBins(), and setNumberOfBins(). |
|
Returns the number of bins on specified axis. If a BinnerAxis object does not exist, returns 0. Implements BinsBase. Definition at line 156 of file Bins2DBase.cxx. References BinnerAxis::axisNumberOfBins(), binner_axisX, binner_axisY, hippodraw::Axes::X, and hippodraw::Axes::Y. |
|
Prepares the NTuple. Creates and returns the NTuple that will be filled from the binner's values. The NTuple will have rows rows and 6 columns. Implements BinsBase. Definition at line 359 of file Bins2DBase.cxx. References NTuple::setLabels(). Referenced by Bins2DProfile::createNTuple(), and Bins2DHist::createNTuple(). |
|
Resets the accumulation to zero.
Implemented in Bins1DHist, Bins1DProfile, Bins2DHist, and Bins2DProfile. Referenced by ProfileProjector::execute(), Profile2DProjector::execute(), DyHist2DProjector::execute(), and DyHist1DProjector::execute(). |
|
Resizes the two dimensional arrays.
Definition at line 336 of file Bins2DBase.cxx. References BinsBase::m_values_dirty, setNumberOfBins(), hippodraw::Axes::X, and hippodraw::Axes::Y. |
|
Resizes the internal arrays.
Takes the size in each dimension from the BinnerAxis objects. If either size is Definition at line 75 of file Bins2DBase.cxx. References numberOfBins(), hippodraw::Axes::X, and hippodraw::Axes::Y. Referenced by setBinnerOn(), setBinWidth(), and setRange(). |
|
Returns the scale factor. Used to convert the ProjValue value to number of entries in a bin. The default, implemented here, is to return 1.0. Derived class, such as those that do binning, may return a value to reflect their binning algorithm. Reimplemented from BinsBase. Definition at line 206 of file Bins2DBase.cxx. References BinnerAxis::axisBinWidth(), binner_axisX, binner_axisY, and BinnerAxis::hasEqualWidths(). |
|
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. |
|
Sets the contents of the bins from the ntuple. Sets the contents of the bins from the ntuple. The purpose of this method is to restore a histogram from archived file. The ntuple should be cone filled by the fillProjectedValues method. Implemented in Bins1DHist, Bins1DProfile, Bins2DHist, and Bins2DProfile. |
|
Sets a new BinnerAxis on the axis axis for the binner to use.
The old one, if any, will be destroyed. Raises an assertion if axis is not Implements BinsBase. Definition at line 101 of file Bins2DBase.cxx. References binner_axisX, binner_axisY, BinsBase::m_values_dirty, resize(), hippodraw::Axes::X, and hippodraw::Axes::Y. |
|
Sets the bin width parameter on the specified axis.
Implements BinsBase. Definition at line 221 of file Bins2DBase.cxx. References binner_axisX, binner_axisY, BinsBase::m_values_dirty, resize(), BinnerAxis::setBinWidth(), hippodraw::Axes::X, and hippodraw::Axes::Y. |
|
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. Reimplemented in Bins2DHist, and Bins2DProfile. Definition at line 131 of file Bins2DBase.cxx. References BinnerAxis::axisSetNumberOfBins(), binner_axisX, binner_axisY, m_num_bins, numberOfBins(), hippodraw::Axes::X, and hippodraw::Axes::Y. Referenced by resize(), Bins2DProfile::setNumberOfBins(), and Bins2DHist::setNumberOfBins(). |
|
Sets the offset parameter on the specified axis.
Implements BinsBase. Definition at line 281 of file Bins2DBase.cxx. References binner_axisX, binner_axisY, BinsBase::m_values_dirty, BinnerAxis::setOffset(), hippodraw::Axes::X, and hippodraw::Axes::Y. |
|
Sets the Range on the specified axis.
If hold_width is Implements BinsBase. Definition at line 296 of file Bins2DBase.cxx. References binner_axisX, binner_axisY, resize(), BinnerAxis::setRange(), hippodraw::Axes::X, and hippodraw::Axes::Y. |
|
The binner axis object for the X axis.
Definition at line 34 of file Bins2DBase.h. Referenced by binNumberX(), Bins2DBase(), binWidth(), binWidthX(), calcBinWidth(), calcOffset(), getBinnerOn(), getLow(), getOffset(), getRange(), hasEqualWidths(), numberOfBins(), scaleFactor(), setBinnerOn(), setBinWidth(), setNumberOfBins(), setOffset(), setRange(), and ~Bins2DBase(). |
|
The binner axis object for the Y axis.
Definition at line 37 of file Bins2DBase.h. Referenced by binNumberY(), Bins2DBase(), binWidth(), binWidthY(), calcBinWidth(), calcOffset(), getBinnerOn(), getLow(), getOffset(), getRange(), hasEqualWidths(), numberOfBins(), scaleFactor(), setBinnerOn(), setBinWidth(), setNumberOfBins(), setOffset(), setRange(), and ~Bins2DBase(). |
|
The accumulated sum of weights.
If all calls to accumulate have weight of 1.0, the default, then will be number of entries. For each vector, index Definition at line 46 of file Bins2DBase.h. Referenced by Bins2DProfile::accumulate(), Bins2DHist::accumulate(), Bins2DProfile::fillDataSource(), Bins2DHist::fillDataSource(), Bins2DProfile::fillProjectedValues(), Bins2DHist::fillProjectedValues(), getNumberOfEntries(), Bins2DProfile::getZValue(), Bins2DHist::getZValue(), Bins2DProfile::reset(), Bins2DHist::reset(), Bins2DHist::setBinContents(), Bins2DProfile::setNumberOfBins(), and Bins2DHist::setNumberOfBins(). |
|
A flag set to
Definition at line 57 of file BinsBase.h. Referenced by Bins2DProfile::accumulate(), Bins2DHist::accumulate(), Bins1DProfile::accumulate(), Bins1DHist::accumulate(), BinsBase::isEmpty(), Bins2DProfile::reset(), Bins2DHist::reset(), Bins1DProfile::reset(), and Bins1DHist::reset(). |
|
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(). |
|
Total number of bins not including overflow and underflow.
Definition at line 55 of file Bins2DBase.h. Referenced by Bins2DHist::Bins2DHist(), Bins2DProfile::Bins2DProfile(), numberOfBins(), Bins2DProfile::setNumberOfBins(), and setNumberOfBins(). |
|
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(). |
|
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(), BinsBase::isDirty(), Bins1DHist::reset(), resize(), Bins1DProfile::resize(), Bins1DHist::resize(), setBinnerOn(), Bins1DBase::setBinnerOn(), setBinWidth(), BinsBase::setDirty(), and setOffset(). |