15 #include "msdevstudio/MSconfig.h"
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 );
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.
The base class for the binner hierarchy.
virtual double axisBinWidth(int i) const =0
Returns the width of each bin.
std::vector< std::vector< double > > m_data
The accumulated sum of weights.
virtual NTuple * prepareNTuple(unsigned int rows) const
Prepares the NTuple.
virtual int getNumberOfAxes() const
Returns the number of axes handled by the BinsBase derived class.
The base class for the BinnerAxis hierarchy.
int numberOfBins() const
Returns the number of bins.
int binNumberY(double y) const
Returns the number of the bin in which the y value is situated.
virtual void setNumberOfBins(hippodraw::Axes::Type axis, int number)
Sets the number of bins on the the specified axis.
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.
~Bins2DBase()
The destructor.
virtual const Range & getRange(hippodraw::Axes::Type axis)
Returns range from binner axis.
void setBinnerOn(BinnerAxis *, hippodraw::Axes::Type axis)
Sets a new BinnerAxis on the axis axis for the binner to use.
The base class for the 2D binner hierarchy.
virtual bool hasEqualWidths() const
Returns true if all the bins have the same width.
Bins2DBase class interface.
virtual double getLow(hippodraw::Axes::Type axis) const
Returns the low value of the bins on the specified axis.
A DataSource class implemented with std::vector to store the column data. ...
virtual const Range & setRange(hippodraw::Axes::Type axis, const Range &, bool hold_width=true)
Sets the Range on the specified axis.
double axisGetLow() const
Returns the lower edge of the first bin.
int m_num_bins
Total number of bins not including overflow and underflow.
int binNumberX(double x) const
Returns the number of the bin in which the x value is situated.
virtual const void setOffset(double offset)=0
Sets the offset and adjusts the range accordingly.
hippodraw::NTuple class interface.
virtual double binWidth(hippodraw::Axes::Type axis) const
Returns the bin width parameter on the specified axis.
virtual double scaleFactor() const
Returns the scale factor.
virtual int getUnderflow() const
Returns the underflow.
void resize()
Resizes the internal arrays.
virtual double getOffset() const =0
Returns the offset.
int axisNumberOfBins() const
Returns the number of bins.
hippodraw::BinnerAxis class interface
double binWidthX(int i) const
Gets the bin width of the X bin for the i bin.
virtual bool hasEqualWidths() const
Returns true if all bins have the same width.
virtual const Range & setRange(const Range &, bool hold_width=true)=0
Sets the range.
const Range & getRange() const
Returns the range.
Bins2DBase(const char *name)
A constructor that takes bins container name as argument.
virtual BinnerAxis * clone()=0
The clone function returns an object of its own kind which is a copy of this object at this moment...
virtual void setOffset(hippodraw::Axes::Type axis, double value)
Sets the offset parameter on the specified axis.
virtual const BinnerAxis * getBinnerOn(hippodraw::Axes::Type axis) const
Returns the BinnerAxis object used by this object.
virtual int getOverflow() const
Returns the overflow.
BinnerAxis * binner_axisY
The binner axis object for the Y axis.
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 const Range & setBinWidth(hippodraw::Axes::Type axis, double value)
Sets the bin width parameter on the specified axis.
virtual const Range & setBinWidth(double width)=0
Sets the bin width and adjusts the range and number of bins accordingly.
virtual double getConstWid() const =0
Returns the constant width parameter.
bool m_values_dirty
A flag to indicate that the objects in m_values are not correct.
BinnerAxis * binner_axisX
The binner axis object for the X axis.
virtual double getOffset(hippodraw::Axes::Type axis) const
Returns the offset parameter on specific axis.
virtual int axisBinNumber(double x) const =0
Returns the number of the bin in which the x value is situated.
virtual void axisSetNumberOfBins(int nb)=0
Sets m_num_bins.
virtual int getNumberOfEntries() const
Returns the true number of entries.
Expresses a range of values.