13 #include "msdevstudio/MSconfig.h"
29 #ifdef ITERATOR_MEMBER_DEFECT
37 using std::min_element;
38 using std::max_element;
41 using namespace hippodraw;
43 Bins1DProfile::Bins1DProfile ( )
50 m_sum( binner.m_sum ),
51 m_sumsq( binner.m_sumsq ),
52 m_num( binner.m_num ),
53 m_sumwtsq (binner.m_sumwtsq )
69 return *min_element (
m_sum.begin() + 1,
m_sum.end ( ) - 1 );
74 return *max_element (
m_sum.begin () + 1,
m_sum.end () - 1 );
79 m_sum.resize( number + 2 );
80 m_num.resize( number + 2 );
101 return static_cast <
int > ( std::accumulate (
m_num.begin() + 1,
102 m_num.end() - 2, 0.0 ) );
108 return static_cast <
int > (
m_num [ i+1] );
148 namespace dp = hippodraw::DataPoint2DTuple;
160 for (
int i = 0;
i < x_number;
i++ ) {
162 double half_width = 0.5 * width;
165 double num =
m_num [
i+1 ];
187 yerr = sqrt ( (num/((num*num)-
m_sumwtsq[
i+1]))*
203 ntuple -> addRow ( row );
std::vector< double > m_sumsq
The sum of the data squared along the y axis.
virtual void accumulate(double x, double y, double wt=1.0, double dummy=0.0)
Accumulate a data point x, y into a bin.
The class for the 1D profile binner hierarchy.
virtual int numberOfBins(hippodraw::Axes::Type axis) const
Returns the number of bins on specified axis.
The base class for the one-dimensional binner hierarchy.
virtual double getLow(hippodraw::Axes::Type axis) const
Returns the low value of the bins on the specified axis.
virtual void reset()
Resets the accumulation to zero.
virtual NTuple * createNTuple() const
Creates an NTuple.
double minBin()
Returns the value of the bin with the smallest value.
virtual void fillDataSource(DataSource *ntuple) const
Fills the DataSource.
BinsBase * clone() const
The clone function returns an object of its own kind which is a copy of this object at this moment...
virtual NTuple * prepareNTuple(unsigned int rows) const
Prepares the NTuple.
void resize()
Resizes the internal arrays.
virtual void setBinContents(const DataSource *ntuple)
int binNumber(double x)
Returns the number of the bin in which the x value is situated.
hippodraw::NTuple class interface.
double binWidth(int i) const
Returns the width of each bin.
error on X or half bin width
bool m_values_dirty
A flag to indicate that the objects in m_values are not correct.
intp size(numeric::array arr)
double maxBin()
Returns the value of the bin with the largest value.
Bins1DProfile()
The default constructor.
A DataSource class implemented with std::vector<double> to store the column data. ...
virtual int getNumberOfEntries() const
Returns the true number of entries.
virtual int getUnderflow() const
Returns the underflow.
std::vector< double > m_sum
The sum of the data along the y axis.
virtual ~Bins1DProfile()
The destructor.
hippodraw::DataPointTuple namespace interface
bool m_empty
A flag set to true, when no accumulation has yet occurred, otherwise is set false.
std::vector< double > m_sumwtsq
The sum of weight squared.
hippodraw::Bins1DProfile class interface
virtual int getOverflow() const
Returns the overflow.
The base class for the binner hierarchy.
std::vector< double > m_num
The total number of entries for each bin.
Base class for DataSource.