14 #include "msdevstudio/MSconfig.h"
32 #ifdef ITERATOR_MEMBER_DEFECT
44 m_x_option (
"X width (optional)" ),
45 m_y_option (
"Y width (optional)" )
82 vector< string >:: iterator first
101 vector< string >:: iterator first
163 return Range ( 0.0, 1.0, 0.5 );
167 return Range ( values );
215 vector < string > labels;
216 labels.push_back (
m_ntuple -> getLabelAt ( x_col ) );
217 labels.push_back (
m_ntuple -> getLabelAt ( y_col ) );
218 labels.push_back (
m_ntuple -> getLabelAt ( z_col ) );
220 if ( x_err < UINT_MAX ) {
221 labels.push_back (
m_ntuple -> getLabelAt ( x_err ) );
226 if ( y_err < UINT_MAX ) {
227 labels.push_back (
m_ntuple -> getLabelAt ( y_err ) );
231 labels.push_back (
" z error" );
236 ntuple -> reserve ( size );
263 const vector < string > & labels =
m_ntuple -> getLabels ();
264 unsigned int size = labels.size();
266 if ( x_err == UINT_MAX &&
269 if ( y_err == UINT_MAX &&
275 for (
unsigned int i = 0; i <
size; i++ ) {
277 ( in_range ==
true &&
inRange ( i ) ==
false ) )
continue;
285 = x_err < UINT_MAX ?
m_ntuple -> valueAt ( i, x_err ) : 0.0;
287 = y_err < UINT_MAX ?
m_ntuple -> valueAt( i, y_err ) : 0.0;
292 ntuple -> addRow ( row );
316 for (
unsigned int i = 0; i < 2; i++ ) {
321 double value =
m_ntuple -> valueAt ( row, vcolumn );
322 double width =
m_ntuple -> valueAt ( row, wcolumn );
323 bool in = range.
includes ( value + width ) ||
349 double low = DBL_MAX;
350 double pos = DBL_MAX;
351 double high = -DBL_MIN;
353 std::size_t rows =
m_ntuple -> rows ();
354 for (
unsigned int row = 0; row < rows; row++ ) {
358 low = std::min ( low, value );
360 pos = std::min ( pos, value );
362 high = std::max ( high, value );
396 unsigned int size = xs.size();
397 for (
unsigned int i = 0; i <
size; i++ ) {
398 if ( x>xs[i]-xerr[i] && x<xs[i]+xerr[i] &&
399 y>ys[i]-yerr[i] && y<ys[i]+yerr[i] ) {
void setRange(double low, double high, double pos)
Changes the current Range.
std::vector< std::string > m_pointreps
Vector of acceptable PointReps.
AxisModelBase * m_x_axis
The AxisModel along the X axis.
AxisModelBase * m_z_axis
The AxisModel along the Z axis.
An NTupleProjector is a projector that projects data from an DataSource object.
virtual double getZValue(double x, double y) const
Get the z value at the specified point (x,y).
std::vector< std::string > m_binding_options
The list of binding options for the Projector.
hippodraw::MeshProjector class interface
void setLabels(const std::vector< std::string > &v)
Assigns the label to each column from the vector of strings.
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
virtual const Range & getRange(Axes::Type) const
Returns the Range along the specified axis.
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.
std::string m_x_option
The label for the X width binding option.
virtual double getPosOn(hippodraw::Axes::Type axis) const
Returns the minimum positive value of the data on a specified axis.
hippodraw::DataPointTuple namespace interface
virtual void fillProjectedValues(DataSource *ntuple, bool in_range=false) const
Fills the DataSource the projected values.
Range dataRangeOnValue() const
Returns the Range of the projected values.
virtual void setDirty(bool value=true)
Sets the dirty flag to value.
A DataSource class implemented with std::vector to store the column data. ...
hippodraw::Range class interface
intp size(numeric::array arr)
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.
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.
virtual void setYErrorOption(bool enable)
Sets whether the Y width options are to be enabled or not.
A derived class of NTupleProjector that maps 3 DataSource columns to a two dimensional mesh projectio...
Base class for DataSource.
std::string XWIDTH
X width label.
const std::string & getZLabel() const
Returns the label (title) of the z axis.
bool inRangeWithZ(int row, bool flag) const
Returns true if value at row is within range.
DataSource * m_proj_values
The NTuple representing the result of the projection.
virtual bool inRange(int row) const
Returns true if value at row is within range on all axis.
std::string m_y_option
The label for the Y width binding option.
virtual void addPointReps()
Function to add the acceptable point reps.
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.
std::string YWIDTH
Y width label.
CutList_t m_cut_list
A list of cuts that filter the projection.
virtual void changedNTuple()
This function is called when the ntuple has been changed to a new one.
bool includes(double value) const
Returns true if the argument value is inside the range.
A namespace to set the standard for indexing into 3 dimension data point tuple.
virtual Range preferredRange(Axes::Type) const
Returns the preferred Range.
virtual void prepareValues()
Informs the projector to prepare its projected values for plotting.
const DataSource * m_ntuple
The pointer to the data source being projected.
virtual ~MeshProjector()
The destructor.
virtual void setXErrorOption(bool enable)
Sets whether the X width options are to be enabled or not.
virtual Range valueRange() const
Finds the range of the projected values.
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.
The AxisModelBase class maintains the Range and scaling of an axis.
MeshProjector()
This default constructor binds to the first two columns.
bool isDirty() const
Returns true if the projector has been marked dirty.
Expresses a range of values.
A namespace to set the standard for indexing into 2 dimension data point tuple.
virtual Range preferredRange(hippodraw::Axes::Type axis) const
Returns the preferred Range on the given axis.
The base class for the Projector hierarchy.