#include <Bins2DProfile.h>
Inheritance diagram for Bins2DProfile:
Oded Wurman <oded@slac.stanford.edu>
Definition at line 28 of file Bins2DProfile.h.
Public Member Functions | |
virtual void | accumulate (double x, double y, double z, double w=1.0) |
Accumulates the data point (x,y, z) with weight w. | |
Bins2DProfile (const Bins2DProfile &binner) | |
The copy constructor. | |
Bins2DProfile () | |
The default 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. | |
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 |
virtual void | fillProjectedValues (DataSource *ntuple) const |
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 () |
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) |
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 | setNumberOfBins (hippodraw::Axes::Type axis, int nb) |
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 | ~Bins2DProfile () |
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. | |
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. | |
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. | |
std::vector< std::vector< double > > | m_sumZ |
The accumulated sum of the z variable in each bin. | |
bool | m_values_dirty |
A flag to indicate that the objects in m_values are not correct. | |
std::vector< std::vector< double > > | m_variance |
The accumulated square of the weights. | |
Range | m_z_range |
The range of the z axis. |
|
The default constructor.
Definition at line 48 of file Bins2DProfile.cxx. Referenced by clone(). |
|
The copy constructor.
Definition at line 53 of file Bins2DProfile.cxx. References Bins2DBase::m_num_bins. |
|
The destructor.
Definition at line 62 of file Bins2DProfile.cxx. |
|
Accumulates the data point (x,y, z) with weight w.
Implements BinsBase. Definition at line 117 of file Bins2DProfile.cxx. References Bins2DBase::binNumberX(), Bins2DBase::binNumberY(), Bins2DBase::m_data, BinsBase::m_empty, m_sumZ, m_variance, Bins2DBase::numberOfBins(), hippodraw::Axes::X, and hippodraw::Axes::Y. |
|
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 Bins2DBase::binner_axisX. Referenced by accumulate(), Bins2DHist::accumulate(), 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 Bins2DBase::binner_axisY. Referenced by accumulate(), Bins2DHist::accumulate(), 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 Bins2DBase::binner_axisX, Bins2DBase::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 Bins2DBase::binner_axisX. Referenced by fillDataSource(), Bins2DHist::fillDataSource(), 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 Bins2DBase::binner_axisY. Referenced by fillDataSource(), Bins2DHist::fillDataSource(), 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 Bins2DBase::binner_axisX, Bins2DBase::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 Bins2DBase::binner_axisX, Bins2DBase::binner_axisY, 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 67 of file Bins2DProfile.cxx. References Bins2DProfile(). |
|
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 144 of file Bins2DProfile.cxx. References fillProjectedValues(), Bins2DBase::numberOfBins(), Bins2DBase::prepareNTuple(), num_util::size(), hippodraw::Axes::X, and hippodraw::Axes::Y. |
|
Implements BinsBase. Definition at line 226 of file Bins2DProfile.cxx. References Bins2DBase::binWidthX(), Bins2DBase::binWidthY(), Bins2DBase::getLow(), Bins2DBase::m_data, m_sumZ, m_variance, Bins2DBase::numberOfBins(), num_util::shape(), hippodraw::DataPoint2DTuple::SIZE, std::sqrt(), hippodraw::Axes::X, hippodraw::DataPoint2DTuple::XERR, hippodraw::Axes::Y, hippodraw::DataPoint2DTuple::YERR, hippodraw::Axes::Z, and hippodraw::DataPoint3DTuple::ZERR. |
|
Implements BinsBase. Definition at line 161 of file Bins2DProfile.cxx. References Bins2DBase::binWidthX(), Bins2DBase::binWidthY(), Bins2DBase::getLow(), Bins2DBase::m_data, m_sumZ, m_variance, Bins2DBase::numberOfBins(), num_util::shape(), hippodraw::DataPoint2DTuple::SIZE, std::sqrt(), hippodraw::Axes::X, hippodraw::DataPoint2DTuple::XERR, hippodraw::Axes::Y, hippodraw::DataPoint2DTuple::YERR, hippodraw::Axes::Z, and hippodraw::DataPoint3DTuple::ZERR. Referenced by createNTuple(). |
|
Returns the BinnerAxis object used by this object.
Implements BinsBase. Definition at line 88 of file Bins2DBase.cxx. References Bins2DBase::binner_axisX, Bins2DBase::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(), Bins2DBase::binner_axisX, Bins2DBase::binner_axisY, hippodraw::Axes::X, and hippodraw::Axes::Y. Referenced by fillDataSource(), Bins2DHist::fillDataSource(), 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 Bins2DBase::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 Bins2DBase::binner_axisX, Bins2DBase::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 Bins2DBase::binner_axisX, Bins2DBase::binner_axisY, BinnerAxis::getRange(), hippodraw::Axes::X, and hippodraw::Axes::Y. |
|
Get the z value at the specified point (x,y).
Reimplemented from BinsBase. Definition at line 132 of file Bins2DProfile.cxx. References Bins2DBase::binNumberX(), Bins2DBase::binNumberY(), Bins2DBase::m_data, and m_sumZ. |
|
Returns
Implements BinsBase. Definition at line 200 of file Bins2DBase.cxx. References Bins2DBase::binner_axisX, Bins2DBase::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 Bins2DBase::m_num_bins. Referenced by accumulate(), Bins2DHist::accumulate(), createNTuple(), Bins2DHist::createNTuple(), fillDataSource(), Bins2DHist::fillDataSource(), fillProjectedValues(), Bins2DHist::fillProjectedValues(), Bins2DBase::resize(), Bins2DHist::setBinContents(), setNumberOfBins(), Bins2DHist::setNumberOfBins(), and Bins2DBase::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(), Bins2DBase::binner_axisX, Bins2DBase::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 createNTuple(), and Bins2DHist::createNTuple(). |
|
Resets the accumulation to zero.
Implements BinsBase. Definition at line 102 of file Bins2DProfile.cxx. References std::fill(), Bins2DBase::m_data, BinsBase::m_empty, m_sumZ, and m_variance. Referenced by setNumberOfBins(). |
|
Resizes the two dimensional arrays.
Definition at line 336 of file Bins2DBase.cxx. References BinsBase::m_values_dirty, Bins2DBase::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 Bins2DBase::numberOfBins(), hippodraw::Axes::X, and hippodraw::Axes::Y. Referenced by Bins2DBase::setBinnerOn(), Bins2DBase::setBinWidth(), and Bins2DBase::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(), Bins2DBase::binner_axisX, Bins2DBase::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. |
|
Implements BinsBase. Definition at line 297 of file Bins2DProfile.cxx. |
|
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 Bins2DBase::binner_axisX, Bins2DBase::binner_axisY, BinsBase::m_values_dirty, Bins2DBase::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 Bins2DBase::binner_axisX, Bins2DBase::binner_axisY, BinsBase::m_values_dirty, Bins2DBase::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.
Reimplemented from Bins2DBase. Definition at line 74 of file Bins2DProfile.cxx. References Bins2DBase::m_data, Bins2DBase::m_num_bins, m_sumZ, m_variance, Bins2DBase::numberOfBins(), reset(), Bins2DBase::setNumberOfBins(), hippodraw::Axes::X, and hippodraw::Axes::Y. |
|
Sets the offset parameter on the specified axis.
Implements BinsBase. Definition at line 281 of file Bins2DBase.cxx. References Bins2DBase::binner_axisX, Bins2DBase::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 Bins2DBase::binner_axisX, Bins2DBase::binner_axisY, Bins2DBase::resize(), BinnerAxis::setRange(), hippodraw::Axes::X, and hippodraw::Axes::Y. |
|
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 accumulate(), Bins2DHist::accumulate(), fillDataSource(), Bins2DHist::fillDataSource(), fillProjectedValues(), Bins2DHist::fillProjectedValues(), Bins2DBase::getNumberOfEntries(), getZValue(), Bins2DHist::getZValue(), reset(), Bins2DHist::reset(), Bins2DHist::setBinContents(), setNumberOfBins(), and Bins2DHist::setNumberOfBins(). |
|
A flag set to
Definition at line 57 of file BinsBase.h. Referenced by accumulate(), Bins2DHist::accumulate(), Bins1DProfile::accumulate(), Bins1DHist::accumulate(), BinsBase::isEmpty(), 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(), Bins2DBase::numberOfBins(), setNumberOfBins(), and Bins2DBase::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(). |
|
The accumulated sum of the z variable in each bin. The matrix structure is identical to m_data. Definition at line 35 of file Bins2DProfile.h. Referenced by accumulate(), fillDataSource(), fillProjectedValues(), getZValue(), reset(), and setNumberOfBins(). |
|
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(), Bins1DProfile::resize(), Bins1DHist::resize(), Bins2DBase::setBinnerOn(), Bins1DBase::setBinnerOn(), Bins2DBase::setBinWidth(), BinsBase::setDirty(), and Bins2DBase::setOffset(). |
|
The accumulated square of the weights. Use [X][Y]. Definition at line 38 of file Bins2DProfile.h. Referenced by accumulate(), fillDataSource(), fillProjectedValues(), reset(), and setNumberOfBins(). |
|
The range of the z axis. Note that the z axis does not need a binner axis object because it is not binned. Definition at line 42 of file Bins2DProfile.h. |