14 #include "msdevstudio/MSconfig.h"
33 #ifdef ITERATOR_MEMBER_DEFECT
36 using std::accumulate;
37 using std::inner_product;
59 m_title ( projector.m_title ),
60 m_x_label ( projector.m_x_label ),
61 m_y_label ( projector.m_y_label ),
62 m_z_label ( projector.m_y_label )
132 unsigned int col = 3;
154 const vector < double > & value = ntuple -> getColumn (
dp::Z );
157 const vector < double > &
data = ntuple -> getColumn ( col );
161 sumXV = std::inner_product ( data.begin(), data.end(),
162 value.begin(), sumXV );
165 sumV = accumulate ( value.begin(), value.end(), sumV );
167 result = sumXV / sumV;
171 sumV = accumulate ( value.begin(), value.end (), sumV );
172 result = ( sumV / value.size () ) *
m_z_axis -> getScaleFactor ();
191 return static_cast <
int > ( sum );
214 double w = v.size() == 3 ? v[2] : 1.0;
void * data(numeric::array arr)
const std::string & getXLabel() const
Returns the label (title) of the X axis.
Range dataRangeOnValue() const
Returns the data range on the Z axis.
AxisModelBase * m_z_axis
The AxisModel along the Z axis.
virtual int getUnderflow() const =0
Returns the underflow.
bool isEmpty() const
Returns false as this class' data source is never empty even if no filling has occurred yet...
virtual bool isAxisBinned(const std::string &axis) const
Returns true if the intended axis is "X", otherwise returns false.
const DataSource * getProjectedValues() const
Returns DataSource representation of projected values.
BinsBase * m_binner
The binner object.
A derived class of ProjectorBase that projects data accumulated by calls to its addValues function in...
virtual void addValues(const std::vector< double > &v)
Add the values to the histogram.
virtual int getOverflow() const =0
Returns the overflow.
std::string m_y_label
The label of the y axis.
double getPosOnValue() const
Returns the smallest positive value on the Y axis.
hippodraw::AxisModelBase class interface
const std::string & getZLabel() const
Returns the label (title) of the z axis.
virtual int getNumberOfEntries() const =0
Returns the true number of entries.
virtual void setRange(hippodraw::Axes::Type axis, bool)
Sets the range of the selected axis.
A derived class of BinningProjector projects to a two dimensional histogram.
hippodraw::DataPointTuple namespace interface
virtual void notifyObservers() const
Notifies Observer objects of a change.
virtual void prepareValues()
Prepares the projector for plotting by executing, if needed, the binning procedure.
StHist2DProjector()
The default constructor.
virtual void setDirty(bool value=true)
Sets the dirty flag to value.
virtual Range dataRangeOn(hippodraw::Axes::Type axis) const
Returns the range of the data on a specified axis.
hippodraw::DataSource class interface.
ProjectorBase * clone()
The clone function returns an object of its own kind which is a copy of this object at this moment...
virtual double getPosOn(hippodraw::Axes::Type axis) const
Returns the minimum positive value of the data on a specified axis.
virtual void setBinnerRange(hippodraw::Axes::Type axis, const Range &range, bool const_width)
Sets the Range of the binner.
hippodraw::BinsBase class interface
Base class for DataSource.
StHist2DProjector class interface.
virtual void checkScaling()
Checks the axis scaling.
virtual const Range & getRange(hippodraw::Axes::Type axis)=0
virtual const std::string & getTitle() const
Finds the title of the plot.
A namespace to set the standard for indexing into 3 dimension data point tuple.
std::string m_x_label
The label of the x axis.
std::string m_title
The title of the histogram.
virtual double getAverage(hippodraw::Axes::Type axis) const
Get the Average of all projected values on the specified axis.
virtual int getOverflow() const
Returns the number of overflow.
virtual int getNumberOfEntries() const
Returns the total number of entries that went into creating the projected values. ...
Expresses a range of values.
std::string m_z_label
The label of the y axis.
A namespace to set the standard for indexing into 2 dimension data point tuple.
const std::string & getYLabel(bool flag=false) const
Returns the label (title) of the Y axis.
virtual int getUnderflow() const
Returns the number of underflow.
The base class for the Projector hierarchy.