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