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