14 #include "msdevstudio/MSconfig.h"
32 using namespace hippodraw;
34 #ifdef ITERATOR_MEMBER_DEFECT
46 m_x_option (
"X error (optional)" ),
47 m_y_option (
"Y error (optional)" )
81 vector< string >:: iterator first
100 vector< string >:: iterator first
176 namespace dp = hippodraw::DataPoint2DTuple;
189 unsigned int columns = 4;
192 vector < string > labels;
193 labels.push_back (
m_ntuple -> getLabelAt ( x_col ) );
194 labels.push_back (
m_ntuple -> getLabelAt ( y_col ) );
196 if ( x_err < UINT_MAX ) {
197 labels.push_back (
m_ntuple -> getLabelAt ( x_err ) );
202 if ( y_err < UINT_MAX ) {
203 labels.push_back (
m_ntuple -> getLabelAt ( y_err ) );
210 ntuple -> reserve ( size );
236 const vector < string > & labels =
m_ntuple -> getLabels ();
237 unsigned int size = labels.size();
239 if ( x_err == UINT_MAX &&
242 if ( y_err == UINT_MAX &&
248 for (
unsigned int i = 0; i <
size; i++ ) {
250 ( in_range ==
true &&
inRange ( i ) ==
false ) )
continue;
257 = x_err < UINT_MAX ?
m_ntuple -> valueAt ( i, x_err ) : 0.0;
259 = y_err < UINT_MAX ?
m_ntuple -> valueAt( i, y_err ) : 0.0;
264 ntuple -> addRow ( row );
Range dataRangeWithError(int data, int error) const
Returns a range considering both data and error.
The base class for the Projector hierarchy.
hippodraw::AxisModelBase class interface
hippodraw::Range class interface
An NTupleProjector is a projector that projects data from an DataSource object.
virtual void setXErrorOption(bool enable)
Sets whether the X error options are to be enabled or not.
Expresses a range of values.
hippodraw::DataPointTuple namespace interface
Map2Projector()
This default constructor binds to the first two columns.
Base class for DataSource.
double getPos(int column) const
Returns the minimum positive value on the specified column.
std::vector< unsigned int > m_columns
A vector containing indexes to the columns of the DataSource.
std::string WIDTH
XERR column label.
double getPosWithError(int data, int error) const
Returns the minimum positive values considering both data and error.
std::string m_y_option
The label for the Y error binding option.
hippodraw::Map2Projector class interface
virtual Range valueRange() const
Finds the range of the projected values.
unsigned int columns() const
Returns the number of columns or data arrays available from this DataSource.
virtual double getPosOn(hippodraw::Axes::Type axis) const
Returns the minimum positive value of the data on a specified axis.
DataSource * m_proj_values
The NTuple representing the result of the projection.
std::vector< std::string > m_pointreps
Vector of acceptable PointReps.
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.
virtual void addPointReps()
Function to add the acceptable point reps.
A DataSource class implemented with std::vector<double> to store the column data. ...
CutList_t m_cut_list
A list of cuts that filter the projection.
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.
intp size(numeric::array arr)
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
Fills the NTuple with the projected values.
virtual DataSource * createNTuple() const
Creates an NTuple representation of the projected values.
virtual void changedNTuple()
This function is called when the ntuple has been changed to a new one.
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
virtual ~Map2Projector()
The destructor.
virtual Range dataRangeOn(hippodraw::Axes::Type) const
Returns the range of the data on the specified axis.
std::string ERROR
YERR column label.
const DataSource * m_ntuple
The pointer to the data source being projected.
virtual bool inRange(int row) const
Checks if the entries in a given row are within the range of the axis model.
std::vector< std::string > m_binding_options
The list of binding options for the Projector.
std::string m_x_option
The label for the X error binding option.
unsigned int m_min_bindings
The minimum number of columns that must be bound.
bool isDirty() const
Returns true if the projector has been marked dirty.
A derived class of NTupleProjector that maps 2 ntuple columns to a two dimensional projection...