14 #include "msdevstudio/MSconfig.h"
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;
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++ ) {
241 inRange ( i ) ==
false )
continue;
246 = y_err < UINT_MAX ? (
m_ntuple -> valueAt ( i, y_err ) ) : 0.0;
249 ntuple -> addRow ( row );
void * data(numeric::array arr)
std::vector< std::string > m_pointreps
Vector of acceptable PointReps.
AxisModelBase * m_x_axis
The AxisModel along the X axis.
virtual void fillProjectedValues(DataSource *ntuple, bool in_range=false) const
An NTupleProjector is a projector that projects data from an DataSource object.
const std::string & getXLabel() const
Returns the label (title) of the x axis.
const DataSource * getProjectedValues() const
Returns DataSource representation of projected values.
virtual DataSource * createNTuple() const
Creates an NTuple representation of the projected values.
std::vector< std::string > m_binding_options
The list of binding options for the Projector.
std::string ERROR
YERR column label.
virtual void changedNTuple()
This function is called when the NTuple has been changed to a new one.
void setLabels(const std::vector< std::string > &v)
Assigns the label to each column from the vector of strings.
hippodraw::Map1Projector class interface
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...
hippodraw::AxisModelBase class interface
error on X or half bin width
AxisModelBase * m_y_axis
The AxisModel along the Y axis.
double getPos(int column) const
Returns the minimum positive value on the specified column.
Range dataRangeWithError(int data, int error) const
Returns a range considering both data and error.
unsigned int m_min_bindings
The minimum number of columns that must be bound.
virtual bool inRange(int row) const
Checks if the entries in a given row are within the range of the axis model.
bool excludes(double value) const
Returns true if the argument value is outside the range.
virtual Range dataRangeOn(hippodraw::Axes::Type) const
Returns the range of the data on the specified axis.
std::string m_x_label
The label for the generated x axis.
hippodraw::DataPointTuple namespace interface
const std::string & getYLabel(bool density=false) const
Returns the label for the Y axis.
virtual void addPointReps()
Function to add the acceptable point reps.
virtual void setDirty(bool value=true)
Sets the dirty flag to value.
virtual double getPosOn(hippodraw::Axes::Type axis) const
Returns the minimum positive value of the data on a specified axis.
A DataSource class implemented with std::vector to store the column data. ...
intp size(numeric::array arr)
hippodraw::NTuple 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 const std::string & getLabelAt(unsigned int index) const
Returns the label for the column at index index.
Base class for DataSource.
Map1Projector()
This default constructor binds to the first two columns.
virtual void prepareValues()
Informs the projector to prepare its projected values for plotting.
DataSource * m_proj_values
The NTuple representing the result of the projection.
virtual void setYErrorOption(bool enable)
Sets whether the Y error options are to be enabled or not.
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.
std::vector< unsigned int > m_columns
A vector containing indexes to the columns of the DataSource.
A derived class of NTupleProjector that maps 1 DataSource column to a Y axis of two dimensional proje...
virtual double getAverage(hippodraw::Axes::Type axis) const
Get the Average of all projected values on the specified axis.
virtual Range valueRange() const
Finds the range of the projected values.
CutList_t m_cut_list
A list of cuts that filter the projection.
const DataSource * m_ntuple
The pointer to the data source being projected.
virtual unsigned int rows() const =0
Returns the number of rows.
std::string WIDTH
XERR column label.
Range dataRange(int column) const
Returns the range of data on the specified column.
double getPosWithError(int data, int error) const
Returns the minimum positive values considering both data and error.
Expresses a range of values.
A namespace to set the standard for indexing into 2 dimension data point tuple.
The base class for the Projector hierarchy.