14 #include "msdevstudio/MSconfig.h"
30 using namespace hippodraw;
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
154 namespace dp = hippodraw::DataPoint3DTuple;
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] ) {
const std::string & getZLabel() const
Returns the label (title) of the z axis.
Range dataRangeWithError(int data, int error) const
Returns a range considering both data and error.
virtual bool inRange(int row) const
Returns true if value at row is within range on all axis.
The base class for the Projector hierarchy.
virtual Range dataRangeOn(hippodraw::Axes::Type) const
Returns the range of the data on the specified axis.
hippodraw::AxisModelBase class interface
hippodraw::Range class interface
AxisModelBase * m_y_axis
The AxisModel along the Y axis.
An NTupleProjector is a projector that projects data from an DataSource object.
virtual void setYErrorOption(bool enable)
Sets whether the Y width options are to be enabled or not.
virtual void prepareValues()
Informs the projector to prepare its projected values for plotting.
Expresses a range of values.
hippodraw::DataPointTuple namespace interface
bool inRangeWithZ(int row, bool flag) const
Returns true if value at row is within range.
Base class for DataSource.
std::string m_y_option
The label for the Y width binding option.
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.
virtual void addPointReps()
Function to add the acceptable point reps.
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.
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.
hippodraw::MeshProjector class interface
virtual ~MeshProjector()
The destructor.
unsigned int columns() const
Returns the number of columns or data arrays available from this DataSource.
MeshProjector()
This default constructor binds to the first two columns.
virtual Range preferredRange(hippodraw::Axes::Type axis) const
Returns the preferred Range on the given axis.
DataSource * m_proj_values
The NTuple representing the result of the projection.
virtual void setXErrorOption(bool enable)
Sets whether the X width options are to be enabled or not.
std::vector< std::string > m_pointreps
Vector of acceptable PointReps.
AxisModelBase * m_x_axis
The AxisModel along the X axis.
virtual Range valueRange() const
Finds the range of the projected values.
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.
A DataSource class implemented with std::vector<double> to store the column data. ...
std::string XWIDTH
X width label.
virtual Range preferredRange(Axes::Type) const
Returns the preferred Range.
CutList_t m_cut_list
A list of cuts that filter the projection.
void setRange(double low, double high, double pos)
Changes the current Range.
intp size(numeric::array arr)
AxisModelBase * m_z_axis
The AxisModel along the Z axis.
virtual const Range & getRange(Axes::Type) const
Returns the Range along the specified axis.
virtual double getZValue(double x, double y) const
Get the z value at the specified point (x,y).
std::string m_x_option
The label for the X width binding option.
Range dataRange(int column) const
Returns the range of data on the specified column.
A derived class of NTupleProjector that maps 3 DataSource columns to a two dimensional mesh projectio...
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 DataSource * createNTuple() const
Creates an NTuple representation of the projected values.
std::string YWIDTH
Y width 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.
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.
ProjectorBase * clone()
The clone function returns an object of its own kind which is a copy of this object at this moment...
virtual double getPosOn(hippodraw::Axes::Type axis) const
Returns the minimum positive value of the data on a specified axis.
virtual void fillProjectedValues(DataSource *ntuple, bool in_range=false) const
Fills the DataSource the projected values.
The AxisModelBase class maintains the Range and scaling of an axis.
Range dataRangeOnValue() const
Returns the Range of the projected values.