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 ];
170 if (
m_sum[i+1] != 0 ) {
177 if (
m_num[i+1] > 1. ) {
178 double num =
m_num[i+1];
187 yerr = sqrt ( (num/((num*num)-
m_sumwtsq[i+1]))*
203 ntuple -> addRow ( row );
virtual NTuple * prepareNTuple(unsigned int rows) const
Prepares the NTuple.
hippodraw::Bins1DProfile class interface
std::vector< double > m_num
The total number of entries for each bin.
virtual void reset()
Resets the accumulation to zero.
The base class for the binner hierarchy.
hippodraw::DataPointTuple namespace interface
int binNumber(double x)
Returns the number of the bin in which the x value is situated.
Base class for DataSource.
double maxBin()
Returns the value of the bin with the largest value.
double minBin()
Returns the value of the bin with the smallest value.
bool m_empty
A flag set to true, when no accumulation has yet occurred, otherwise is set false.
The class for the 1D profile binner hierarchy.
bool m_values_dirty
A flag to indicate that the objects in m_values are not correct.
Bins1DProfile()
The default constructor.
virtual void fillDataSource(DataSource *ntuple) const
Fills the DataSource.
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 accumulate(double x, double y, double wt=1.0, double dummy=0.0)
Accumulate a data point x, y into a bin.
virtual NTuple * createNTuple() const
Creates an NTuple.
A DataSource class implemented with std::vector<double> to store the column data. ...
virtual int numberOfBins(hippodraw::Axes::Type axis) const
Returns the number of bins on specified axis.
BinsBase * clone() const
The clone function returns an object of its own kind which is a copy of this object at this moment...
void resize()
Resizes the internal arrays.
intp size(numeric::array arr)
double binWidth(int i) const
Returns the width of each bin.
std::vector< double > m_sum
The sum of the data along the y axis.
virtual int getUnderflow() const
Returns the underflow.
std::vector< double > m_sumsq
The sum of the data squared along the y axis.
std::vector< double > m_sumwtsq
The sum of weight squared.
hippodraw::NTuple class interface.
virtual ~Bins1DProfile()
The destructor.
virtual void setBinContents(const DataSource *ntuple)
error on X or half bin width
virtual int getNumberOfEntries() const
Returns the true number of entries.
virtual int getOverflow() const
Returns the overflow.