13 #include "msdevstudio/MSconfig.h" 29 #ifdef ITERATOR_MEMBER_DEFECT 37 using std::min_element;
38 using std::max_element;
43 Bins1DProfile::Bins1DProfile ( )
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] );
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 );
A namespace to set the standard for indexing into 2 dimension data point tuple.
bool m_empty
A flag set to true, when no accumulation has yet occurred, otherwise is set false.
virtual int getOverflow() const
Returns the overflow.
std::vector< double > m_sumsq
The sum of the data squared along the y axis.
virtual int getUnderflow() const
Returns the underflow.
virtual void reset()
Resets the accumulation to zero.
virtual void fillDataSource(DataSource *ntuple) const
Fills the DataSource.
The base class for the one-dimensional 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...
double binWidth(int i) const
Returns the width of each bin.
double maxBin()
Returns the value of the bin with the largest value.
The class for the 1D profile binner hierarchy.
double minBin()
Returns the value of the bin with the smallest value.
bool m_values_dirty
A flag to indicate that the objects in m_values are not correct.
hippodraw::NTuple class interface.
Base class for DataSource.
Bins1DProfile()
The default constructor.
intp size(numeric::array arr)
void resize()
Resizes the internal arrays.
std::vector< double > m_num
The total number of entries for each bin.
virtual int numberOfBins(hippodraw::Axes::Type axis) const
Returns the number of bins on specified axis.
A DataSource class implemented with std::vector<double> to store the column data. ...
std::vector< double > m_sum
The sum of the data along the y axis.
virtual double getLow(hippodraw::Axes::Type axis) const
Returns the low value of the bins on the specified axis.
hippodraw::Bins1DProfile class interface
virtual void accumulate(double x, double y, double wt=1.0, double dummy=0.0)
Accumulate a data point x, y into a bin.
hippodraw::DataPointTuple namespace interface
virtual NTuple * createNTuple() const
Creates an NTuple.
The base class for the binner hierarchy.
virtual ~Bins1DProfile()
The destructor.
error on X or half bin width
std::vector< double > m_sumwtsq
The sum of weight squared.
virtual int getNumberOfEntries() const
Returns the true number of entries.
int binNumber(double x)
Returns the number of the bin in which the x value is situated.
virtual NTuple * prepareNTuple(unsigned int rows) const
Prepares the NTuple.
virtual void setBinContents(const DataSource *ntuple)