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