13 #include "msdevstudio/MSconfig.h"
29 namespace dp = hippodraw::DataPoint2DTuple;
57 const vector< double >& colCoord =
m_ntuple -> getColumn(
dp::X );
59 return *std::min_element( colCoord.begin(), colCoord.end() );
66 const vector< double >& colCoord =
m_ntuple -> getColumn(
dp::X );
68 return *std::max_element( colCoord.begin(), colCoord.end() );
75 const vector< double >& colValue =
m_ntuple -> getColumn(
dp::Y );
77 return *std::min_element( colValue.begin(), colValue.end() );
84 const vector< double >& colValue =
m_ntuple -> getColumn(
dp::Y );
86 return *std::max_element( colValue.begin(), colValue.end() );
93 const vector< double >& colValue =
m_ntuple -> getColumn(
dp::Y );
95 sum = std::accumulate( colValue.begin(), colValue.end(), sum );
97 return sum / colValue.size();
105 const vector<double>& colCoord =
m_ntuple -> getColumn(
dp::X );
106 const vector<double>& colValue =
m_ntuple -> getColumn(
dp::Y );
109 sumXY = std::inner_product( colCoord.begin(), colCoord.end(),
110 colValue.begin(), sumXY );
112 sumY = std::accumulate( colValue.begin(), colValue.end(), sumY );
128 for(
unsigned int i = 0;
i < x.size();
i++)
129 sumXXY += ( x[
i] * x[
i] * y[
i] );
131 return sqrt ( sumXXY / sumY - mean * mean );
138 const vector<double>& colValue =
m_ntuple -> getColumn(
dp::Y );
139 const vector<double>& colCoord =
m_ntuple -> getColumn(
dp::X );
144 for (
unsigned int i = 1;
i < colValue.size();
i++) {
145 if ( colCoord[
i-1] <= x && x <= colCoord[
i] ) {
146 value = colValue[i-1];
150 if ( is_set ==
false ) {
151 throw std::string(
"valueAt: x lies outside valid range.");
virtual double meanValue() const
Returns the mean of the values in the data set.
const DataSource * m_ntuple
The pointer to the ntuple (of the appropriate data set) for which it is called to help...
virtual int size() const
Returns the number of points in the data set.
virtual double stdCoord() const
Returns the standard deviation of the coordinates along the X axis in the data set.
virtual double meanCoord() const
Returns the mean of the coordinates along the X axis in the data set.
hippodraw::DataSource class interface.
virtual double minCoord() const
Returns the smallest coordinate value along the X axis in the data set.
virtual double maxValue() const
Returns the largest value in the data set.
virtual double minValue() const
Returns the smallest value in the data set.
hippodraw::DataPointTuple namespace interface
virtual double maxCoord() const
Returns the largest coordinate value along the X axis in the data set.
ProjectorHelper class interface.
virtual double getTotal() const
Returns the sum of the values of the data set.
ProjectorHelper(const DataSource *ntuple)
The constructor taking ntuple pointer as arguments.
virtual double valueAt(double x) const
Returns the value at a given coordinate.
Base class for DataSource.