18 #include "msdevstudio/MSconfig.h"
32 #ifdef ITERATOR_MEMBER_DEFECT
41 using namespace hippodraw;
43 Bins2DHist::Bins2DHist ( )
50 m_variance( binner.m_variance )
54 for (
int i = 0; i < 3; i++ ) {
87 for( ; i <
m_data.size(); i++ ) {
88 m_data[i].resize( number_y + 2 );
102 for ( ; i <
m_data.size(); i++ ) {
142 double v =
m_data[i][j] / ( widthX * widthY );
158 namespace dp = hippodraw::DataPoint3DTuple;
176 for (
unsigned int i = 0; i < num_x; i++ ) {
179 double half_widthX = 0.5 * widthX;
184 for (
unsigned int j = 0; j < num_y; j++ ) {
186 double half_widthY = 0.5 * widthY;
189 double v = factor * (
m_data[i+1][j+1] / ( widthX * widthY ) );
190 double verr = factor * ( sqrt (
m_variance[i][j] ) );
199 ntuple -> addRow ( row );
206 vector < unsigned int >
shape ( 3 );
211 ntuple -> setShape ( shape );
221 for (
unsigned int i = 0; i < num_x; i++ ) {
223 for (
unsigned int j = 0; j < num_y; j++ ) {
225 const vector < double > & row = ntuple -> getRow ( r++ );
226 double value = row [
dp::Z ];
228 m_data[i+1][j+1] = value * ( widthX * widthY );
virtual void setBinContents(const DataSource *ntuple)
Sets the contents of the bins from the ntuple.
virtual double getZValue(double x, double y) const
Get the z value at the specified point (x,y).
double binWidthX(int i) const
Gets the bin width of the X bin for the i bin.
bool m_is_scaling
A flag which is set true to enable scaling the output.
The base class for the 2D binner hierarchy.
int binNumberX(double x) const
Returns the number of the bin in which the x value is situated.
The base class for the binner hierarchy.
hippodraw::DataPointTuple namespace interface
double m_x_moments[3]
The X moments.
Base class for DataSource.
~Bins2DHist()
The destructor.
std::vector< intptr_t > shape(numeric::array arr)
hippodraw::BinnerAxis class interface
virtual double getLow(hippodraw::Axes::Type axis) const
Returns the low value of the bins on the specified axis.
bool m_empty
A flag set to true, when no accumulation has yet occurred, otherwise is set false.
virtual void setNumberOfBins(hippodraw::Axes::Type axis, int number)
Sets the number of bins on the the specified axis.
BinsBase * clone() const
The clone function returns an object of its own kind which is a copy of this object at this moment...
A DataSource class implemented with std::vector<double> to store the column data. ...
virtual void fillDataSource(DataSource *ntuple) const
Fills the DataSource.
int numberOfBins() const
Returns the number of bins.
virtual void setNumberOfBins(hippodraw::Axes::Type axis, int number)
Sets the number of bins on the the specified axis.
std::vector< std::vector< double > > m_variance
The accumulated square of the weights.
virtual NTuple * createNTuple() const
Creates an NTuple.
int m_num_bins
Total number of bins not including overflow and underflow.
double m_y_moments[3]
The Y moments.
intp size(numeric::array arr)
virtual NTuple * prepareNTuple(unsigned int rows) const
Prepares the NTuple.
virtual int getNumberOfEntries() const
Returns the true number of entries.
The class for the 2D histogram binning.
int binNumberY(double y) const
Returns the number of the bin in which the y value is situated.
Bins2DHist()
The default constructor.
hippodraw::NTuple class interface.
error on X or half bin width
std::vector< std::vector< double > > m_data
The accumulated sum of weights.
double binWidthY(int i) const
Gets the bin width of the Y bin for the i bin.
double m_scale_factor
The scale factor.
virtual void accumulate(double x, double y, double w=1.0, double dummy=0.)
Accumulates the data point (x, y) with weight w.
virtual void reset()
Resets the accumulation to zero.
hippodraw::Bins2DHist class interface