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