18 #include "msdevstudio/MSconfig.h" 32 #ifdef ITERATOR_MEMBER_DEFECT 43 Bins2DHist::Bins2DHist ( )
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 );
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 int getNumberOfEntries() const
Returns the true number of entries.
int m_num_bins
Total number of bins not including overflow and underflow.
BinsBase * clone() const
The clone function returns an object of its own kind which is a copy of this object at this moment...
Bins2DHist()
The default constructor.
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 setBinContents(const DataSource *ntuple)
Sets the contents of the bins from the ntuple.
hippodraw::BinnerAxis class interface
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.
hippodraw::NTuple class interface.
double m_y_moments[3]
The Y moments.
int binNumberX(double x) const
Returns the number of the bin in which the x value is situated.
double m_x_moments[3]
The X moments.
error on X or half bin width
A namespace to set the standard for indexing into 3 dimension data point tuple.
std::vector< std::vector< double > > m_data
The accumulated sum of weights.
std::vector< intptr_t > shape(numeric::array arr)
~Bins2DHist()
The destructor.
int numberOfBins() const
Returns the number of bins.
The class for the 2D histogram binning.
hippodraw::Bins2DHist class interface
virtual void reset()
Resets the accumulation to zero.
A DataSource class implemented with std::vector<double> to store the column data. ...
virtual double getLow(hippodraw::Axes::Type axis) const
Returns the low value of the bins on the specified axis.
virtual void fillDataSource(DataSource *ntuple) const
Fills the DataSource.
The base class for the 2D binner hierarchy.
virtual NTuple * prepareNTuple(unsigned int rows) const
Prepares the NTuple.
hippodraw::DataPointTuple namespace interface
virtual double getZValue(double x, double y) const
Get the z value at the specified point (x,y).
intp size(numeric::array arr)
double m_scale_factor
The scale factor.
A namespace to set the standard for indexing into 2 dimension data point tuple.
virtual NTuple * createNTuple() const
Creates an NTuple.
int binNumberY(double y) const
Returns the number of the bin in which the y value is situated.
bool m_is_scaling
A flag which is set true to enable scaling the output.
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.
The base class for the binner hierarchy.
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.
Base class for DataSource.