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] ) {
Range dataRangeOnValue() const
Returns the Range of the projected values.
double getPos(int column) const
Returns the minimum positive value on the specified column.
AxisModelBase * m_x_axis
The AxisModel along the X axis.
virtual void changedNTuple()
This function is called when the ntuple has been changed to a new one.
CutList_t m_cut_list
A list of cuts that filter the projection.
virtual void prepareValues()
Informs the projector to prepare its projected values for plotting.
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...
ProjectorBase * clone()
The clone function returns an object of its own kind which is a copy of this object at this moment...
virtual Range valueRange() const
Finds the range of the projected values.
virtual const Range & getRange(Axes::Type) const
Returns the Range along the specified axis.
std::vector< unsigned int > m_columns
A vector containing indexes to the columns of the DataSource.
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.
std::string XWIDTH
X width label.
double getPosWithError(int data, int error) const
Returns the minimum positive values considering both data and error.
Range dataRange(int column) const
Returns the range of data on the specified column.
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.
void setLabels(const std::vector< std::string > &v)
Assigns the label to each column from the vector of strings.
bool isDirty() const
Returns true if the projector has been marked dirty.
An NTupleProjector is a projector that projects data from an DataSource object.
virtual void addPointReps()
Function to add the acceptable point reps.
bool includes(double value) const
Returns true if the argument value is inside the range.
std::string YWIDTH
Y width label.
virtual void setDirty(bool value=true)
Sets the dirty flag to value.
virtual ~MeshProjector()
The destructor.
A derived class of NTupleProjector that maps 3 DataSource columns to a two dimensional mesh projectio...
AxisModelBase * m_z_axis
The AxisModel along the Z axis.
hippodraw::NTuple class interface.
virtual void setXErrorOption(bool enable)
Sets whether the X width options are to be enabled or not.
virtual double getZValue(double x, double y) const
Get the z value at the specified point (x,y).
error on X or half bin width
virtual Range preferredRange(Axes::Type) const
Returns the preferred Range.
hippodraw::MeshProjector class interface
intp size(numeric::array arr)
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.
The AxisModelBase class maintains the Range and scaling of an axis.
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.
void setRange(double low, double high, double pos)
Changes the current Range.
A DataSource class implemented with std::vector<double> to store the column data. ...
The base class for the Projector hierarchy.
virtual double getPosOn(hippodraw::Axes::Type axis) const
Returns the minimum positive value of the data on a specified axis.
hippodraw::AxisModelBase class interface
DataSource * m_proj_values
The NTuple representing the result of the projection.
hippodraw::Range class interface
unsigned int columns() const
Returns the number of columns or data arrays available from this DataSource.
Range dataRangeWithError(int data, int error) const
Returns a range considering both data and error.
virtual DataSource * createNTuple() const
Creates an NTuple representation of the projected values.
Expresses a range of values.
std::vector< std::string > m_pointreps
Vector of acceptable PointReps.
virtual Range dataRangeOn(hippodraw::Axes::Type) const
Returns the range of the data on the specified axis.
hippodraw::DataPointTuple namespace interface
AxisModelBase * m_y_axis
The AxisModel along the Y axis.
unsigned int m_min_bindings
The minimum number of columns that must be bound.
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.
std::string m_x_option
The label for the X width binding option.
virtual void fillProjectedValues(DataSource *ntuple, bool in_range=false) const
Fills the DataSource the projected values.
Base class for DataSource.