15 #include "msdevstudio/MSconfig.h"
33 using namespace hippodraw;
35 #ifdef ITERATOR_MEMBER_DEFECT
38 using std::accumulate;
49 m_y_label (
"Density" ),
66 m_y_label ( projector.m_y_label ),
67 m_bin_num ( projector.m_bin_num ),
68 m_start_num ( projector.m_start_num )
124 namespace dp = hippodraw::DataPoint2DTuple;
155 unsigned int columns = 4;
158 vector < string > labels;
159 labels.push_back (
"X" );
160 labels.push_back (
"Value" );
183 vector < double > col =
m_ntuple -> getColumn ( x_col );
184 std::sort(col.begin(), col.end());
195 if (
i==m_bin_num-1) row[
dp::XERR] = col[size-1]-col[k];
198 while ((row[
dp::XERR]==0) && (
i!=m_bin_num-1)) {
202 if (
i==m_bin_num-1 ) row[
dp::XERR] = col[size-1]-col[k];
218 ntuple -> addRow (row);
276 return Range ( 0.0, 1.0, 0.5 );
280 return Range ( values );
virtual bool isAxisBinned(const std::string &axis) const
Returns true if specified axis is binned.
double getPos(int column) const
Returns the minimum positive value on the specified column.
void adjustNumberOfBins()
Make sure the number of bins between 1 and number of rows.
unsigned int m_bin_num
The number of bins.
std::string ERROR
YERR column label.
EqualEntriesHist1DProjector()
The default constructor.
virtual double getPosOn(hippodraw::Axes::Type axis) const
Returns the minimum positive value of the data on a specified axis.
virtual void fillProjectedValues(DataSource *ntuple, bool in_range=false) const
std::vector< unsigned int > m_columns
A vector containing indexes to the columns of the DataSource.
Range m_range
The range of the data source.
Range dataRange(int column) const
Returns the range of data on the specified column.
virtual void addPointReps()
Function to add the acceptable point reps.
Range dataRangeOnValue() const
unsigned int m_start_num
The number of bins when dragging starts.
void setLabels(const std::vector< std::string > &v)
Assigns the label to each column from the vector of strings.
An NTupleProjector is a projector that projects data from an DataSource object.
virtual const Range & setBinWidth(Axes::Type axis, int parm, bool dragging)
Sets the number of bins in this class.
NTupleSorter class interface.
virtual void prepareValues()
Informs the projector to prepare its projected values for plotting.
virtual void setDirty(bool value=true)
Sets the dirty flag to value.
virtual double getBinWidth(Axes::Type axis) const
Get the number of bins in this class.
hippodraw::NTuple class interface.
virtual int getOverflow() const
Returns overflow.
error on X or half bin width
intp size(numeric::array arr)
const DataSource * m_ntuple
The pointer to the data source being projected.
std::vector< std::string > m_binding_options
The list of binding options for the Projector.
ProjectorBase * clone()
The clone function returns an object of its own kind which is a copy of this object at this moment...
A derived class of NTupleProjector that projects a column of data into a one dimensional histogram...
virtual Range valueRange() const
Finds the range of the projected values.
A DataSource class implemented with std::vector<double> to store the column data. ...
The base class for the Projector hierarchy.
hippodraw;:EqualEntriesHist1Projector class interface
virtual Range dataRangeOn(hippodraw::Axes::Type axis) const
Returns the range of the data on a specified axis.
hippodraw::AxisModelBase class interface
DataSource * m_proj_values
The NTuple representing the result of the projection.
unsigned int columns() const
Returns the number of columns or data arrays available from this DataSource.
virtual int getUnderflow() const
Returns underflow.
virtual double getAverage(hippodraw::Axes::Type axis) const
Get the Average of all projected values on the specified axis.
virtual void changedNTuple()
This function is called when the NTuple has been changed to a new one.
Expresses a range of values.
std::vector< std::string > m_pointreps
Vector of acceptable PointReps.
hippodraw::DataPointTuple namespace interface
std::string m_y_label
The label for the y axis.
unsigned int m_min_bindings
The minimum number of columns that must be bound.
std::string WIDTH
XERR column label.
virtual DataSource * createNTuple() const
Creates an NTuple representation of the projected values.
virtual const std::string & getYLabel(bool density=false) const
Returns the label of the axis.
Base class for DataSource.