14 #include "msdevstudio/MSconfig.h"
34 using namespace hippodraw;
38 #ifdef ITERATOR_MEMBER_DEFECT
57 BinnerAxis * binner = binner_factory -> create (
"BinnerLinear" );
60 m_binner = factory -> create (
"Bins1DProfile" );
105 bool have_weight = w_col < UINT_MAX;
112 for (
unsigned int i = 0; i <
size; i++ )
116 double x =
m_ntuple -> valueAt ( i, x_col );
117 double y =
m_ntuple -> valueAt ( i, y_col );
120 w =
m_ntuple -> valueAt ( i, w_col );
131 namespace dp = hippodraw::DataPoint2DTuple;
148 return Range ( 0.0, 0.0 );
150 double max = DBL_MIN;
151 double min = DBL_MAX;
155 for (
unsigned int i = 0; i < values.size(); i++ ) {
156 double hi = values[i] + errors[i];
157 double lo = values[i] - errors[i];
158 max = std::max ( max, hi );
159 min = std::min ( min, lo );
162 return Range ( min, max );
180 double pos = DBL_MAX;
184 for (
unsigned int i = 0; i < values.size (); i++ ) {
185 double lo = values[i] - errors[i];
217 if( range.
low() < 0.0 )
return;
246 = dynamic_cast <
const DataSource * > ( object );
248 if ( datasource != 0 ) {
261 = dynamic_cast <
const DataSource * > ( object );
263 if ( datasource != 0 ) {
virtual void willDelete(const Observable *object)
If object is the target of normalization, removes the target and sets normalization off...
static BinnerAxisFactory * instance()
Returns a pointer to the singleton instance.
virtual void accumulate(double x, double w_or_y=1.0, double z=1.0, double w=1.0)=0
Accumulates the data point with weight w.
The base class for the Projector hierarchy.
hippodraw::AxisModelBase class interface
bool isNull() const
Returns true if the receiving objects is a null object.
virtual void setBinnerOn(BinnerAxis *, hippodraw::Axes::Type axis)=0
Sets the bin calculator on specified axis.
double high() const
Returns the maximum of the range object.
An NTupleProjector is a projector that projects data from an DataSource object.
ProjectorBase * clone()
The clone function returns an object of its own kind which is a copy of this object at this moment...
Expresses a range of values.
hippodraw::DataPointTuple namespace interface
Base class for DataSource.
Part of an implementation of the Observable-Observer pattern based on the example in the GOF Patterns...
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.
const Range & getRange(bool scaled) const
Returns the range represented by this AxisModel.
hippodraw::BinnerAxis class interface
virtual bool isAxisBinned(const std::string &axis) const
Returns true if specified axis is binned.
virtual void checkScaling()
Checks and sets if an AxisModelBase object on an axis should be scaled.
virtual void setRange(hippodraw::Axes::Type axis, bool const_width)
Sets the range of the selected axis.
A derived class of BinningProjector which projects to a profile display.
virtual void willDelete(const Observable *object)
Implements Observer pattern.
virtual void changedNTuple()
This function is called when the DataSource has been changed to a new one.
virtual double getPosOn(hippodraw::Axes::Type axis) const
Returns the minimum positive value of the data on a specified axis.
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.
ProfileProjector class interface.
The BinningProjector is an abstract class provides most of the functionality for a projector that doe...
std::vector< std::string > m_pointreps
Vector of acceptable PointReps.
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.
virtual Range dataRangeOn(hippodraw::Axes::Type) const
Returns the range of the data on the specified axis.
A Factory singleton class for creating objects whose class derives from BinnerAxis.
BinsBase * m_binner
The binner object.
CutList_t m_cut_list
A list of cuts that filter the projection.
ProfileProjector()
The default constructor.
A Factory singleton class for creating objects whose class derives from BinsBase. ...
void setDirty()
Sets a flag to indicate that re-binning needs to be done.
intp size(numeric::array arr)
void setRange(double low, double high, double pos)
Sets the Range to the low and high values.
virtual void update(const Observable *object)
Updates the receiving projector.
hippodraw::BinsBase class interface
virtual void addPointReps()
Function to add the acceptable point reps.
The base class for the BinnerAxis hierarchy.
virtual void setBinnerRange(hippodraw::Axes::Type axis, const Range &range, bool const_width)
Sets the Range of the binner.
Range dataRange(int column) const
Returns the range of data on the specified column.
virtual bool isLog() const =0
Returns a boolean describing the type of the scale of the axis.
virtual void prepareValues()
Prepares the projector for plotting by executing, if needed, the binning procedure.
hippodraw::NTuple class interface.
double low() const
Returns the minimum of the range object.
virtual void willDelete(const Observable *)
Responds to willDelete message from the observed data source.
virtual void reset()=0
Resets the accumulation to zero.
virtual void execute()
Provides the all the data to the binner.
virtual Range valueRange() const
Finds the range of the projected values.
const DataSource * m_ntuple
The pointer to the data source being projected.
virtual void update(const Observable *)
Responds to update message from the data source.
std::vector< std::string > m_binding_options
The list of binding options for the Projector.
virtual void update(const Observable *object)
Implements Observer pattern.
unsigned int m_min_bindings
The minimum number of columns that must be bound.
static BinsFactory * instance()
Returns a pointer to the singleton instance.