15 #include "msdevstudio/MSconfig.h"
32 using namespace hippodraw;
45 m_data ( binner.m_data )
212 return width_x * width_y;
220 assert ( width > 0.0 );
238 double new_width = -1.0;
253 bool dragging )
const
300 const Range & new_range = binner->
setRange ( range, hold_width );
344 for (
unsigned int i = 1;
i <
m_data.size () -1;
i++ ) {
345 sum += std::accumulate (
m_data[
i].begin()+1,
m_data[
i].end()-1, 0.0 );
348 return static_cast <
int > ( sum );
366 unsigned int columns = 6;
368 ntuple -> reserve ( rows );
371 ntuple -> setLabelAt (
"X", 0 );
372 ntuple -> setLabelAt (
"Y", 0 );
373 ntuple -> setLabelAt (
"Value", 0 );
374 ntuple -> setLabelAt (
"Width", 0 );
375 ntuple -> setLabelAt (
"Height", 0 );
376 ntuple -> setLabelAt (
"Error", 0 );
virtual bool hasEqualWidths() const
Returns true if all the bins have the same width.
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.
int m_num_bins
Total number of bins not including overflow and underflow.
const Range & getRange() const
Returns the range.
virtual const Range & setBinWidth(hippodraw::Axes::Type axis, double value)
Sets the bin width parameter on the specified axis.
virtual double scaleFactor() const
Returns the scale factor.
void resize()
Resizes the internal arrays.
void setBinnerOn(BinnerAxis *, hippodraw::Axes::Type axis)
Sets a new BinnerAxis on the axis axis for the binner to use.
virtual double getOffset() const =0
Returns the offset.
virtual double axisBinWidth(int i) const =0
Returns the width of each bin.
virtual void setNumberOfBins(hippodraw::Axes::Type axis, int number)
Sets the number of bins on the 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 class interface.
virtual const Range & setBinWidth(double width)=0
Sets the bin width and adjusts the range and number of bins accordingly.
virtual BinnerAxis * clone()=0
The clone function returns an object of its own kind which is a copy of this object at this moment...
int axisNumberOfBins() const
Returns the number of bins.
virtual const Range & getRange(hippodraw::Axes::Type axis)
Returns range from binner axis.
virtual int axisBinNumber(double x) const =0
Returns the number of the bin in which the x value is situated.
int binNumberX(double x) const
Returns the number of the bin in which the x value is situated.
virtual const Range & setRange(const Range &, bool hold_width=true)=0
Sets the range.
double axisGetLow() const
Returns the lower edge of the first bin.
hippodraw::NTuple class interface.
std::vector< std::vector< double > > m_data
The accumulated sum of weights.
int numberOfBins() const
Returns the number of bins.
bool m_values_dirty
A flag to indicate that the objects in m_values are not correct.
virtual double getOffset(hippodraw::Axes::Type axis) const
Returns the offset parameter on specific axis.
The base class for the BinnerAxis hierarchy.
Bins2DBase(const char *name)
A constructor that takes bins container name as argument.
virtual const BinnerAxis * getBinnerOn(hippodraw::Axes::Type axis) const
Returns the BinnerAxis object used by this object.
virtual double calcOffset(const std::string &, int parm, bool dragging) const
Calculates and returns a new range from dragging slider.
double calcBinWidth(hippodraw::Axes::Type axis, int parm, bool dragging) const
Calculates the bin width parameter from dragging slider.
virtual void axisSetNumberOfBins(int nb)=0
Sets m_num_bins.
A DataSource class implemented with std::vector<double> to store the column data. ...
virtual bool hasEqualWidths() const
Returns true if all bins have the same width.
virtual double getLow(hippodraw::Axes::Type axis) const
Returns the low value of the bins on the specified axis.
The base class for the 2D binner hierarchy.
virtual NTuple * prepareNTuple(unsigned int rows) const
Prepares the NTuple.
virtual void setOffset(hippodraw::Axes::Type axis, double value)
Sets the offset parameter on the specified axis.
virtual int getOverflow() const
Returns the overflow.
BinnerAxis * binner_axisY
The binner axis object for the Y axis.
virtual const void setOffset(double offset)=0
Sets the offset and adjusts the range accordingly.
BinnerAxis * binner_axisX
The binner axis object for the X axis.
Expresses a range of values.
int binNumberY(double y) const
Returns the number of the bin in which the y value is situated.
virtual double calcOffset(int parm, bool dragging) const =0
Calculates and returns a double corresponding to a bin offset when dragging a slider control...
virtual double getConstWid() const =0
Returns the constant width parameter.
virtual double binWidth(hippodraw::Axes::Type axis) const
Returns the bin width parameter on the specified axis.
~Bins2DBase()
The destructor.
virtual int getUnderflow() const
Returns the underflow.
hippodraw::BinnerAxis class interface
The base class for the binner hierarchy.
double calcBinWidth(int parm, bool dragging) const
Calculates the bin width parameter when dragging a slider control.
double binWidthY(int i) const
Gets the bin width of the Y bin for the i bin.
double binWidthX(int i) const
Gets the bin width of the X bin for the i bin.