20 #include "msdevstudio/MSconfig.h"
32 #ifdef ITERATOR_MEMBER_DEFECT
41 using namespace hippodraw;
43 Bins2DProfile::Bins2DProfile ( )
50 m_sumZ( binner.m_sumZ ),
51 m_variance( binner.m_variance ),
52 m_z_range ( binner.m_z_range )
76 m_data.resize( number + 2 );
77 m_sumZ.resize( number + 2 );
83 for ( ; i <
m_data.size(); i++ ) {
84 m_data[i].resize( number_y + 2 );
85 m_sumZ[i].resize( number_y + 2 );
100 for ( ; i <
m_data.size(); i++ ) {
134 if (
m_data[i][j] == 0)
return 0.0;
152 namespace dp = hippodraw::DataPoint3DTuple;
165 vector<double>::const_iterator vity;
171 for (
int x_inc = 1; x_inc <= num_x; x_inc++ ) {
174 double half_widthX = 0.5 * widthX;
175 double x = next_x + half_widthX;
179 for (
int y_inc = 1; y_inc <= num_y; y_inc++ ) {
181 double half_widthY = 0.5 * widthY;
186 double var2 = *vity++;
189 if (
m_data[x_inc][y_inc] != 0 ) {
190 double num =
m_data[x_inc][y_inc];
191 v =
m_sumZ[x_inc][y_inc] / num;
192 verr = sqrt ( ( var2 / ( num - 1. ) - v * v ) );
201 ntuple -> addRow ( row );
204 vector < unsigned int >
shape ( 3 );
209 ntuple -> setShape ( shape );
virtual void accumulate(double x, double y, double z, double w=1.0)
Accumulates the data point (x,y, z) with weight w.
double binWidthX(int i) const
Gets the bin width of the X bin for the i bin.
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.
BinsBase * clone() const
The clone function returns an object of its own kind which is a copy of this object at this moment...
The base class for the binner hierarchy.
hippodraw::DataPointTuple namespace interface
Base class for DataSource.
virtual void setBinContents(const DataSource *ntuple)
std::vector< intptr_t > shape(numeric::array arr)
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.
std::vector< std::vector< double > > m_variance
The accumulated square of the weights.
hippodraw::Bins2DProfile class interface
A DataSource class implemented with std::vector<double> to store the column data. ...
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.
The class for the 2D profile binner hierarchy.
virtual void reset()
Resets the accumulation to zero.
int m_num_bins
Total number of bins not including overflow and underflow.
intp size(numeric::array arr)
virtual NTuple * prepareNTuple(unsigned int rows) const
Prepares the NTuple.
std::vector< std::vector< double > > m_sumZ
The accumulated sum of the z variable in each bin.
virtual void fillDataSource(DataSource *ntuple) const
int binNumberY(double y) const
Returns the number of the bin in which the y value is situated.
virtual double getZValue(double x, double y) const
Get the z value at the specified point (x,y).
virtual void setNumberOfBins(hippodraw::Axes::Type axis, int nb)
Sets the number of bins on the the specified axis.
hippodraw::NTuple class interface.
virtual NTuple * createNTuple() const
Creates an NTuple.
error on X or half bin width
Bins2DProfile()
The default constructor.
virtual ~Bins2DProfile()
The destructor.
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.