14 #include "msdevstudio/MSconfig.h"
32 using namespace hippodraw;
34 #ifdef ITERATOR_MEMBER_DEFECT
37 using std::accumulate;
48 m_y_option (
"Y error (optional)" )
63 m_x_label ( projector.m_x_label )
86 valueAt ( row,
m_columns[0] ) ) ) yes =
false;
95 const string name (
"Y error" );
96 vector< string >:: iterator first
146 return m_ntuple -> empty () ? DBL_MAX : 1.0;
166 namespace dp = hippodraw::DataPoint2DTuple;
176 unsigned int col = 2;
193 const vector < double > &
data = ntuple -> getColumn ( col );
195 unsigned int size = ntuple -> rows ();
197 sum = accumulate ( data.begin(), data.end(), sum );
211 unsigned int columns = 4;
214 vector < string > labels;
215 labels.push_back (
"X" );
216 labels.push_back (
"Value" );
236 ntuple -> reserve ( size );
239 for (
unsigned int i = 0;
i <
size;
i++ ) {
246 = y_err < UINT_MAX ? (
m_ntuple -> valueAt (
i, y_err ) ) : 0.0;
249 ntuple -> addRow ( row );
double getPos(int column) const
Returns the minimum positive value on the specified column.
AxisModelBase * m_x_axis
The AxisModel along the X axis.
CutList_t m_cut_list
A list of cuts that filter the projection.
std::string ERROR
YERR column label.
bool acceptRow(unsigned int i, const CutList_t &cut_list) const
For row i of the column in the DataSource, returns true if all the cuts accept the row...
std::vector< unsigned int > m_columns
A vector containing indexes to the columns of the DataSource.
std::string m_x_label
The label for the generated x axis.
void * data(numeric::array arr)
double getPosWithError(int data, int error) const
Returns the minimum positive values considering both data and error.
Range dataRange(int column) const
Returns the range of data on the specified column.
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 Range valueRange() const
Finds the range of the projected values.
const std::string & getYLabel(bool density=false) const
Returns the label for the Y axis.
virtual double getPosOn(hippodraw::Axes::Type axis) const
Returns the minimum positive value of the data on a specified axis.
virtual void setDirty(bool value=true)
Sets the dirty flag to value.
const DataSource * getProjectedValues() const
Returns DataSource representation of projected values.
hippodraw::NTuple class interface.
virtual void addPointReps()
Function to add the acceptable point reps.
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.
const std::string & getXLabel() const
Returns the label (title) of the x axis.
virtual bool inRange(int row) const
Checks if the entries in a given row are within the range of the axis model.
virtual void setYErrorOption(bool enable)
Sets whether the Y error options are to be enabled or not.
virtual void prepareValues()
Informs the projector to prepare its projected values for plotting.
ProjectorBase * clone()
The clone function returns an object of its own kind which is a copy of this object at this moment...
virtual void fillProjectedValues(DataSource *ntuple, bool in_range=false) const
A DataSource class implemented with std::vector<double> to store the column data. ...
bool excludes(double value) const
Returns true if the argument value is outside the range.
The base class for the Projector hierarchy.
virtual double getAverage(hippodraw::Axes::Type axis) const
Get the Average of all projected values on the specified axis.
virtual DataSource * createNTuple() const
Creates an NTuple representation of the projected values.
Map1Projector()
This default constructor binds to the first two columns.
hippodraw::Map1Projector class interface
hippodraw::AxisModelBase class interface
virtual unsigned int rows() const =0
Returns the number of rows.
DataSource * m_proj_values
The NTuple representing the result of the projection.
virtual void changedNTuple()
This function is called when the NTuple has been changed to a new one.
const Range & getRange(bool scaled) const
Returns the range represented by this AxisModel.
unsigned int columns() const
Returns the number of columns or data arrays available from this DataSource.
Range dataRangeWithError(int data, int error) const
Returns a range considering both data and error.
Expresses a range of values.
std::vector< std::string > m_pointreps
Vector of acceptable PointReps.
hippodraw::DataPointTuple namespace interface
AxisModelBase * m_y_axis
The AxisModel along the Y axis.
unsigned int m_min_bindings
The minimum number of columns that must be bound.
virtual Range dataRangeOn(hippodraw::Axes::Type) const
Returns the range of the data on the specified axis.
std::string WIDTH
XERR column label.
virtual const std::string & getLabelAt(unsigned int index) const
Returns the label for the column at index index.
A derived class of NTupleProjector that maps 1 DataSource column to a Y axis of two dimensional proje...
Base class for DataSource.