14 #include "msdevstudio/MSconfig.h"
31 using namespace hippodraw;
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 )
123 namespace dp = hippodraw::DataPoint3DTuple;
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;
virtual Range dataRangeOn(hippodraw::Axes::Type axis) const
Returns the range 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.
virtual int getNumberOfEntries() const
Returns the total number of entries that went into creating the projected values. ...
virtual bool isAxisBinned(const std::string &axis) const
Returns true if the intended axis is "X", otherwise returns false.
virtual void notifyObservers() const
Notifies Observer objects of a change.
virtual const std::string & getTitle() const
Finds the title of the plot.
virtual int getUnderflow() const
Returns the number of underflow.
std::string m_x_label
The label of the x axis.
virtual int getOverflow() const =0
Returns the overflow.
StHist2DProjector()
The default constructor.
void * data(numeric::array arr)
virtual const Range & getRange(hippodraw::Axes::Type axis)=0
virtual double getAverage(hippodraw::Axes::Type axis) const
Get the Average of all projected values on the specified axis.
virtual int getUnderflow() const =0
Returns the underflow.
virtual void setDirty(bool value=true)
Sets the dirty flag to value.
const DataSource * getProjectedValues() const
Returns DataSource representation of projected values.
AxisModelBase * m_z_axis
The AxisModel along the Z axis.
hippodraw::DataSource class interface.
const std::string & getXLabel() const
Returns the label (title) of the X axis.
hippodraw::BinsBase class interface
BinsBase * m_binner
The binner object.
virtual int getOverflow() const
Returns the number of overflow.
virtual int getNumberOfEntries() const =0
Returns the true number of entries.
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.
bool isEmpty() const
Returns false as this class' data source is never empty even if no filling has occurred yet...
virtual void setRange(hippodraw::Axes::Type axis, bool)
Sets the range of the selected axis.
Range dataRangeOnValue() const
Returns the data range on the Z axis.
std::string m_y_label
The label of the y axis.
The base class for the Projector hierarchy.
virtual void checkScaling()
Checks the axis scaling.
hippodraw::AxisModelBase class interface
virtual void prepareValues()
Prepares the projector for plotting by executing, if needed, the binning procedure.
A derived class of BinningProjector projects to a two dimensional histogram.
std::string m_z_label
The label of the y axis.
virtual void addValues(const std::vector< double > &v)
Add the values to the histogram.
Expresses a range of values.
hippodraw::DataPointTuple namespace interface
A derived class of ProjectorBase that projects data accumulated by calls to its addValues function in...
double getPosOnValue() const
Returns the smallest positive value on the Y axis.
const std::string & getZLabel() const
Returns the label (title) of the z axis.
StHist2DProjector class interface.
const std::string & getYLabel(bool flag=false) const
Returns the label (title) of the Y axis.
std::string m_title
The title of the histogram.
Base class for DataSource.