14 #include "msdevstudio/MSconfig.h"
25 #ifdef ITERATOR_MEMBER_DEFECT
33 using namespace hippodraw;
35 BinningProjector::BinningProjector (
unsigned int axes )
36 : m_binner_dim ( axes ),
43 m_binner_dim ( projector.m_binner_dim ),
101 if ( type ==
Axes::X ) axis =
"X";
102 else if ( type ==
Axes::Y ) axis =
"Y";
136 assert ( axis ==
Axes::X && width > 0. );
161 if ( axis !=
"X" )
return;
249 m_binner -> scaleNumberOfEntries ( number );
256 m_binner -> setEntriesScaling ( on );
289 double norm = number;
virtual void willDelete(const Observable *object)
If object is the target of normalization, removes the target and sets normalization off...
virtual bool isAxisBinned(const std::string &axis) const
Returns true if specified axis is binned.
virtual int numberOfBins(hippodraw::Axes::Type axis) const =0
Returns the number of bins on specified axis.
virtual void setMinEntries(int entries)
Set the minimum entries/bin.
virtual const Range & getRange(hippodraw::Axes::Type axis)=0
The base class for the Projector hierarchy.
hippodraw::AxisModelBase class interface
virtual void setBinnerOn(BinnerAxis *, hippodraw::Axes::Type axis)=0
Sets the bin calculator on specified axis.
virtual void setAxisModel(Axes::Type axis, AxisModelBase *)
Sets the AxisModel for axis axis.
virtual double calcBinWidth(hippodraw::Axes::Type axis, int parm, bool dragging) const =0
Calculates a new bin width base on dragging slider value.
virtual BinsBase * clone() const =0
The virtual function to make copy of concrete derived class.
The base class for the binner hierarchy.
Expresses a range of values.
Base class for DataSource.
Part of an implementation of the Observable-Observer pattern based on the example in the GOF Patterns...
virtual void notifyObservers() const
Notifies Observer objects of a change.
double getBinWidth(hippodraw::Axes::Type axis) const
Returns the bin width of the axis.
virtual void execute()
Provides the all the data to the binner.
virtual int getMinEntries()
Get the minimum entries/bin.
double getOffset(hippodraw::Axes::Type axis) const
Returns the offset of the axis.
virtual bool isValueBinned() const
Returns true if the projected values are the result of binning.
virtual const Range & setBinWidth(hippodraw::Axes::Type axis, double width)
virtual double calcOffset(const std::string &, int parm, bool dragging) const =0
Calculates and returns a new range from dragging slider.
double norm(const std::vector< double > &a)
Computes the two norm of the vector.
virtual bool isImageConvertable() const
Returns true if projected values are convertable to image.
virtual void checkScaling()
Checks and sets if an AxisModelBase object on an axis should be scaled.
PyArray_TYPES type(numeric::array arr)
virtual DataSource * createNTuple() const
Returns an data source representing the binned values.
DataSource * m_proj_values
The NTuple representing the result of the projection.
The BinningProjector is an abstract class provides most of the functionality for a projector that doe...
virtual void reset()
Resets the bins.
AxisModelBase * m_x_axis
The AxisModel along the X axis.
virtual void setDirty(bool value=true)
Sets the dirty flag to value.
virtual double getZValue(double x, double y) const
Get the z value at the specified point (x,y).
hippodraw::BinningProjector class interface
virtual int getNumberOfEntries() const =0
Returns the total number of entries that went into creating the projected values. ...
const BinsBase * getBinner() const
Returns reference to BinsBase object used by this projector.
BinsBase * m_binner
The binner object.
virtual double getZValue(double x, double y) const
Get the z value at the specified point (x,y).
virtual void normalize()
Normalizes the projector to its target.
const ProjectorBase * m_target
The target projector.
virtual void normalizeTo(double number)
Sets a scale factor on the output so that the number of entries appears to be number.
virtual double binWidth(hippodraw::Axes::Type axis) const =0
Returns the bin width parameter on the specified axis.
virtual const Range & setBinWidth(hippodraw::Axes::Type axis, double value)=0
Sets the bin width parameter on the specified axis.
void setRange(double low, double high, double pos)
Sets the Range to the low and high values.
virtual int getNumberOfBins(Axes::Type) const
Returns the number of bins.
virtual void update(const Observable *object)
Updates the receiving projector.
virtual NTuple * createNTuple() const =0
Creates an NTuple.
hippodraw::BinsBase class interface
void setBinContents(const DataSource *source)
Sets the contents of the bins from the data source.
virtual void setNormalizing(bool on)
Sets the scaling number of entries on if on is true, otherwise turns if off.
The base class for the BinnerAxis hierarchy.
virtual double getOffset(hippodraw::Axes::Type axis) const =0
Returns the offset parameter on specific axis.
unsigned int m_binner_dim
The number of AxesType accepted by the binner.
virtual void prepareValues()
Prepares the projector for plotting by executing, if needed, the binning procedure.
hippodraw::NTuple class interface.
virtual void setOffset(const std::string &axis, int parm, bool dragging)
Sets the bin offset.
void addObserver(Observer *)
Adds an Observer to the Observer list.
virtual void setBinnerOn(BinnerAxis *binner, hippodraw::Axes::Type axis)
Sets the bin edge calculator to binner on axis axis.
virtual void setOffset(hippodraw::Axes::Type axis, double value)=0
Sets the offset parameter on the specified axis.
virtual void fillDataSource(DataSource *ntuple, bool in_range=false) const
void setBinner(BinsBase *bins)
Sets the BinsBase object to be used by this projector.
virtual ~BinningProjector()
The destructor.
bool isDirty() const
Returns true if the projector has been marked dirty.
virtual void setAxisModel(hippodraw::Axes::Type, AxisModelBase *)
Sets the AxisModel for axis axis.
BinningProjector(unsigned int axes)
The following constructor takes the number of axes used by the BinsBase object.
The AxisModelBase class maintains the Range and scaling of an axis.
virtual int getNumberOfBins(hippodraw::Axes::Type axis) const
Returns the number of bins.
void removeObserver(Observer *)
Removes an Observer from the Observer list.