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 setNumberOfBins(hippodraw::Axes::Type axis, int nb)
Sets the number of bins on the the specified axis.
hippodraw::Bins2DProfile class interface
Bins2DProfile()
The default constructor.
int m_num_bins
Total number of bins not including overflow and underflow.
The class for the 2D profile binner hierarchy.
BinsBase * clone() const
The clone function returns an object of its own kind which is a copy of this object at this moment...
virtual void accumulate(double x, double y, double z, double w=1.0)
Accumulates the data point (x,y, z) with weight w.
virtual void setNumberOfBins(hippodraw::Axes::Type axis, int number)
Sets the number of bins on the the specified axis.
std::vector< intptr_t > shape(numeric::array arr)
std::vector< std::vector< double > > m_variance
The accumulated square of the weights.
int binNumberX(double x) const
Returns the number of the bin in which the x value is situated.
hippodraw::NTuple class interface.
virtual void setBinContents(const DataSource *ntuple)
std::vector< std::vector< double > > m_data
The accumulated sum of weights.
error on X or half bin width
int numberOfBins() const
Returns the number of bins.
virtual void reset()
Resets the accumulation to zero.
virtual double getZValue(double x, double y) const
Get the z value at the specified point (x,y).
intp size(numeric::array arr)
A DataSource class implemented with std::vector<double> to store the column data. ...
virtual void fillDataSource(DataSource *ntuple) const
virtual double getLow(hippodraw::Axes::Type axis) const
Returns the low value of the bins on the specified axis.
The base class for the 2D binner hierarchy.
virtual NTuple * prepareNTuple(unsigned int rows) const
Prepares the NTuple.
virtual NTuple * createNTuple() const
Creates an NTuple.
hippodraw::DataPointTuple namespace interface
int binNumberY(double y) const
Returns the number of the bin in which the y value is situated.
bool m_empty
A flag set to true, when no accumulation has yet occurred, otherwise is set false.
virtual ~Bins2DProfile()
The destructor.
std::vector< std::vector< double > > m_sumZ
The accumulated sum of the z variable in each bin.
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.