20 #include "msdevstudio/MSconfig.h" 32 #ifdef ITERATOR_MEMBER_DEFECT 43 Bins2DProfile::Bins2DProfile ( )
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;
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 );
A namespace to set the standard for indexing into 2 dimension data point tuple.
virtual void setBinContents(const DataSource *ntuple)
bool m_empty
A flag set to true, when no accumulation has yet occurred, otherwise is set false.
Range m_z_range
The range of the z axis.
virtual double getZValue(double x, double y) const
Get the z value at the specified point (x,y).
std::vector< std::vector< double > > m_data
The accumulated sum of weights.
hippodraw::Bins2DProfile class interface
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 fillDataSource(DataSource *ntuple) const
The class for the 2D profile binner hierarchy.
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.
int m_num_bins
Total number of bins not including overflow and underflow.
intp size(numeric::array arr)
virtual NTuple * createNTuple() const
Creates an NTuple.
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.
virtual ~Bins2DProfile()
The destructor.
std::vector< std::vector< double > > m_sumZ
The accumulated sum of the z variable in each bin.
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.
virtual void setNumberOfBins(hippodraw::Axes::Type axis, int nb)
Sets the number of bins on the the specified axis.
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.
A namespace to set the standard for indexing into 3 dimension data point tuple.
error on X or half bin width
BinsBase * clone() const
The clone function returns an object of its own kind which is a copy of this object at this moment...
Bins2DProfile()
The default constructor.
virtual void reset()
Resets the accumulation to zero.
std::vector< std::vector< double > > m_variance
The accumulated square of the weights.
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)
int binNumberX(double x) const
Returns the number of the bin in which the x value is situated.