#include <BinningProjector.h>
Inheritance diagram for BinningProjector:


Paul F. Kunz <Paul_Kunz@slac.stanford.edu>
Matan Shacham <matan@slac.stanford.edu>
Oded Wurman <owurman@stanford.edu>
Definition at line 32 of file BinningProjector.h.
Public Types | |
| typedef void(hippodraw::Observer::* | Action )(const Observable *) |
| The member function of the Observer that is called. | |
| typedef std::list< hippodraw::Observer * > | ObserverList_t |
| The type of STL container to maintain list of Observer objects. | |
Public Member Functions | |
| void | addObserver (hippodraw::Observer *) |
| Adds an Observer to the Observer list. | |
| virtual void | addValues (const std::vector< double > &v) |
| Add values to the projection. | |
| virtual ProjectorBase * | clone ()=0 |
| The clone function returns an object of its own kind which is a copy of this object at this moment. | |
| virtual DataSource * | createNTuple () const |
| Returns an NTuple representing the binned values. | |
| virtual const DataSource * | createOldStyleNTuple () const |
| Creates and returns NTuple object. | |
| virtual Range | dataRangeOn (hippodraw::Axes::Type) const =0 |
| Returns the range of the raw data. | |
| virtual double | getAverage (hippodraw::Axes::Type axis) const |
| Get the Average of all projected values on the specified axis. | |
| virtual const std::vector< std::string > & | getAxisBindings () const |
| Returns the axis bindings. | |
| virtual AxisModelBase * | getAxisModel (hippodraw::Axes::Type axis) const |
| Get the AxisModel for axis axis. | |
| const BinsBase * | getBinner () const |
| Returns reference to BinsBase object used by this projector. | |
| double | getBinWidth (hippodraw::Axes::Type axis) const |
| Returns the bin width of the axis. | |
| virtual NTuple * | getNTupleAfterCuts () const |
| Template for projectors that can return subsets of the NTuple used by the DataRep. | |
| virtual int | getNumberOfBins (hippodraw::Axes::Type axis) const |
| Returns the number of bins. | |
| virtual int | getNumberOfEntries () const =0 |
| Returns the total number of entries that went into creating the projected values. | |
| const ObserverList_t & | getObservers () const |
| Returns the list of observers. | |
| double | getOffset (hippodraw::Axes::Type axis) const |
| Returns the offset of the axis. | |
| const std::vector< std::string > & | getPointReps () const |
| Return the vector of Point Reps. | |
| virtual double | getPosOn (hippodraw::Axes::Type) const =0 |
| Returns the minimum positive value. | |
| const DataSource * | getProjectedValues () const |
| Returns ntuple representation of projected values. | |
| virtual const Range & | getRange (hippodraw::Axes::Type) const |
| Returns the Range along the specified axis. | |
| virtual double | getRMS (hippodraw::Axes::Type axis) |
| Returns the RMS. | |
| virtual const std::string & | getTitle () const =0 |
| Finds the title of the plot. | |
| virtual const std::string & | getXLabel () const =0 |
| Finds the X axis label of the plot. | |
| virtual const std::string & | getYLabel (bool flag=false) const =0 |
| Finds the Y axis label of the plot. | |
| virtual const std::string & | getZLabel () const |
| Finds the Z axis label of the plot. | |
| virtual double | getZValue (double x, double y) const |
| Get the z value at the specified point (x,y). | |
| virtual bool | isAxisBinned (const std::string &axis) const |
Returns true if specified axis is binned. | |
| bool | isDirty () const |
Returns true if the projector has been marked dirty. | |
| virtual bool | isEmpty () const =0 |
Returns true if the data source used by this projector is empty. | |
| virtual bool | isValueBinned () const |
Returns true if the projected values are the result of binning. | |
| virtual void | matrixTranspose (bool yes) |
| Transposes the X and Y axis. | |
| virtual void | normalize () |
| Normalizes the projector to its target. | |
| virtual void | normalizeTo (const ProjectorBase *target) |
| Normalize the output of the receiving object's projected values to that of target. | |
| virtual void | normalizeTo (double number) |
| Sets a scale factor on the output so that the number of entries appears to be number. | |
| virtual void | notifyObservers () const |
| Notifies Observer objects of a change. | |
| virtual Range | preferredRange (hippodraw::Axes::Type) const |
| Returns the preferred Range. | |
| virtual void | prepareValues () |
| Prepares the projector for plotting by executing, if needed, the binning procedure. | |
| void | removeObserver (hippodraw::Observer *) |
| Removes an Observer from the Observer list. | |
| virtual void | reset () |
| Resets the bins. | |
| virtual void | setAxisBinding (const std::string &axis, const std::string &label) |
| Sets the axis binding. | |
| virtual void | setAxisBindings (const std::vector< std::string > &bindings) |
| Sets the axis binding. | |
| virtual void | setAxisModel (hippodraw::Axes::Type, AxisModelBase *) |
| Sets the AxisModel for axis axis. | |
| void | setBinContents (const DataSource *source) |
| Sets the contents of the bins from the data source. | |
| void | setBinner (BinsBase *bins) |
| Sets the BinsBase object to be used by this projector. | |
| virtual void | setBinnerOn (BinnerAxis *binner, hippodraw::Axes::Type axis) |
| Sets the bin edge calculator to binner on axis axis. | |
| virtual void | setBinnerRange (hippodraw::Axes::Type axis, const Range &range, bool const_width)=0 |
| Sets the Range of the binner. | |
| virtual void | setBinWidth (const std::string &axis, int parm, bool dragging) |
| Sets the bin width. | |
| virtual void | setBinWidth (hippodraw::Axes::Type axis, double width) |
| virtual void | setDirty (bool value=true) |
| Sets the dirty flag to value. | |
| virtual void | setNormalizing (bool on) |
Sets the scaling number of entries on if on is true, otherwise turns if off. | |
| virtual void | setNumberOfBins (hippodraw::Axes::Type axis, unsigned int number) |
| Sets the number of bins. | |
| virtual void | setOffset (hippodraw::Axes::Type axis, double offset) |
| Sets the bin offset. | |
| virtual void | setOffset (const std::string &axis, int parm, bool dragging) |
| Sets the bin offset. | |
| virtual void | setRange (hippodraw::Axes::Type axis, bool const_width=true) |
| Sets the range of the selected axis. | |
| virtual void | setRange (hippodraw::Axes::Type, const Range &range, bool) |
| Sets the range of the binner. | |
| virtual void | update (const Observable *object) |
| Updates the receiving projector. | |
| virtual Range | valueRange () const =0 |
| Finds the range of the projected values. | |
| virtual bool | wantsScaleFactor (const std::string &axis) const |
| Returns whether the projector wants scale factor. | |
| virtual void | willDelete (const Observable *object) |
| If object is the target of normalization, removes the target and sets normalization off. | |
| ~BinningProjector () | |
| The destructor. | |
Protected Member Functions | |
| virtual void | addPointReps ()=0 |
| Function to add the acceptable point reps. | |
| BinningProjector (const BinningProjector &projector) | |
| The copy constructor. | |
| BinningProjector (unsigned int axes) | |
| The following constructor takes the number of axes used by the BinsBase object. | |
| virtual void | checkScaling () |
| Checks and sets if an AxisModelBase object on an axis should be scaled. | |
| virtual void | execute () |
| Provides the all the data to the binner. | |
| virtual void | fillDataSource (DataSource *ntuple, bool in_range=false) const |
| Fills the DataSource source with the projected values. | |
| virtual void | fillProjectedValues (DataSource *ntuple, bool in_range=false) const |
| Fills the NTuple ntuple with the projected values. | |
| void | notifyObservers (Action action) const |
| An internal method to iterate over all observers and to send the message action. | |
Protected Attributes | |
| BinsBase * | m_binner |
| The binner object. | |
| std::vector< std::string > | m_pointreps |
| Vector of acceptable PointReps. | |
| DataSource * | m_proj_values |
| The NTuple representing the result of the projection. | |
| const ProjectorBase * | m_target |
| The target projector. | |
| AxisModelBase * | m_x_axis |
The AxisModel along the X axis. | |
| AxisModelBase * | m_y_axis |
The AxisModel along the Y axis. | |
| AxisModelBase * | m_z_axis |
The AxisModel along the Z axis. | |
| std::string | m_z_label |
| Dummy member so that getZLabel can return a reference. | |
Private Attributes | |
| unsigned int | m_binner_dim |
| The number of AxesType accepted by the binner. | |
|
|
The member function of the Observer that is called.
Definition at line 83 of file Observable.h. |
|
|
The type of STL container to maintain list of Observer objects.
Definition at line 46 of file Observable.h. |
|
|
The following constructor takes the number of axes used by the BinsBase object.
Definition at line 38 of file BinningProjector.cxx. |
|
|
The copy constructor.
Definition at line 44 of file BinningProjector.cxx. References BinsBase::clone(), createNTuple(), fillDataSource(), m_binner, and ProjectorBase::m_proj_values. |
|
|
The destructor.
Definition at line 57 of file BinningProjector.cxx. References m_binner. |
|
|
Adds an Observer to the Observer list.
Definition at line 49 of file Observable.cxx. References Observable::m_list. Referenced by CutPlotter::addCutTarget(), XyPlotter::addDataRep(), FunctionRep::FunctionRep(), normalizeTo(), DataRepController::setAxisBindings(), DisplayController::setNTuple(), CutPlotter::setNTuple(), and TextPlotter::setParentDataRep(). |
|
|
Function to add the acceptable point reps.
Implemented in FunctionProjector, Hist1DProjImp, Hist2DProjImp, LineProjector, Map1Projector, Map2Projector, Map3Projector, MapMatrixProjector, Profile2DProjector, ProfileProjector, and StripChartProjector. |
|
|
Add values to the projection. This method is provided as convenience for derived classes that respond to it. The implementation in this class does nothing. Reimplemented in StHist1DProjector, and StHist2DProjector. Definition at line 312 of file ProjectorBase.cxx. |
|
|
Checks and sets if an AxisModelBase object on an axis should be scaled. This method maybe overridden by derived classes such as those that do histogramming. Reimplemented in Hist1DProjImp, and Hist2DProjImp. Definition at line 258 of file BinningProjector.cxx. Referenced by setAxisModel(), setBinnerOn(), ProfileProjector::setBinnerRange(), Profile2DProjector::setBinnerRange(), and setBinWidth(). |
|
|
The clone function returns an object of its own kind which is a copy of this object at this moment.
Implemented in DyHist1DProjector, DyHist2DProjector, FunctionProjector, LineProjector, Map1Projector, Map2Projector, Map3Projector, MapMatrixProjector, Profile2DProjector, ProfileProjector, StHist1DProjector, StHist2DProjector, and StripChartProjector. Referenced by DataRep::DataRep(). |
|
|
Returns an NTuple representing the binned values.
Implements ProjectorBase. Definition at line 272 of file BinningProjector.cxx. References BinsBase::createNTuple(), and m_binner. Referenced by BinningProjector(), createOldStyleNTuple(), and setBinner(). |
|
|
Creates and returns NTuple object. Creates an old style NTuple representation of the projected values, i.e. one in which the NTuple contains the bin width as the XERR instead of the half width. This member function exists for backward compatibility of deprecated functions. Reimplemented from ProjectorBase. Definition at line 84 of file BinningProjector.cxx. References createNTuple(), execute(), fillProjectedValues(), ProjectorBase::isDirty(), and m_binner. |
|
|
Returns the range of the raw data.
Implemented in DyHist1DProjector, DyHist2DProjector, FunctionProjector, LineProjector, Map1Projector, Map2Projector, Map3Projector, MapMatrixProjector, NTupleProjector, Profile2DProjector, ProfileProjector, StHist1DProjector, and StHist2DProjector. Referenced by ProjectorBase::preferredRange(), Hist2DProjImp::preferredRange(), Hist1DProjImp::preferredRange(), Hist2DProjImp::valueRange(), and Hist1DProjImp::valueRange(). |
|
|
Provides the all the data to the binner.
Reimplemented in DyHist1DProjector, DyHist2DProjector, Profile2DProjector, and ProfileProjector. Definition at line 253 of file BinningProjector.cxx. Referenced by createOldStyleNTuple(), and prepareValues(). |
|
||||||||||||
|
Fills the DataSource source with the projected values.
Fills the DataSource source with the results of projecting the data source to projected values. Derived classes must implement this method. Clients, such as plotters or fitters, can then use getProjectedValues method to access the projected value data. The default behavior is to fill the DataSource with all values that are accepted by the TupleCut objects, if any. If in_range is equal to Implements ProjectorBase. Definition at line 286 of file BinningProjector.cxx. References m_binner. Referenced by BinningProjector(), and prepareValues(). |
|
||||||||||||
|
Fills the NTuple ntuple with the projected values.
Fills the NTuple !ntuple with the results of projecting the data source to projected values. Derived classes must implement this method. Clients, such as plotters or fitters, can then use getProjectedValues method to access the projected value data. The default behavior is to fill the NTuple with all values that are accepted by the TupleCut objects, if any. If in_range is equal to Implements ProjectorBase. Definition at line 279 of file BinningProjector.cxx. References m_binner. Referenced by createOldStyleNTuple(). |
|
|
Get the Average of all projected values on the specified axis.
Reimplemented in DyHist1DProjector, Map1Projector, MapMatrixProjector, NTupleProjector, StHist1DProjector, and StHist2DProjector. Definition at line 268 of file ProjectorBase.cxx. Referenced by AverageTextRep::drawProjectedValues(). |
|
|
Returns the axis bindings. Returns the name associated with each axis. This member function should only be called with a derived class which can process it in a meaningful way. thus if this method is called on this base class, an assertion is raised. Reimplemented in NTupleProjector. Definition at line 99 of file ProjectorBase.cxx. Referenced by XYPlot::setAxisBindings(). |
|
|
Get the AxisModel for axis axis.
Definition at line 204 of file ProjectorBase.cxx. References ProjectorBase::m_x_axis, ProjectorBase::m_y_axis, ProjectorBase::m_z_axis, hippodraw::Axes::X, hippodraw::Axes::Y, and hippodraw::Axes::Z. Referenced by CompositePlotter::processReturnValue(), and ContourPointRep::setContourValues(). |
|
|
Returns reference to BinsBase object used by this projector.
Definition at line 99 of file BinningProjector.cxx. References m_binner. Referenced by BinningProjectorXML::createChildren(). |
|
|
Returns the bin width of the axis. Not all projectors has a notation of a bin width. This interface is declared for those that do. The implementation in this base class is to does nothing. Reimplemented from ProjectorBase. Definition at line 238 of file BinningProjector.cxx. References BinsBase::binWidth(), m_binner, m_binner_dim, hippodraw::Axes::X, hippodraw::Axes::Y, and hippodraw::Axes::Z. |
|
|
Template for projectors that can return subsets of the NTuple used by the DataRep.
Reimplemented in NTupleProjector. Definition at line 324 of file ProjectorBase.cxx. Referenced by DataRep::getNTupleAfterCuts(). |
|
|
Returns the number of bins. Returns number of bins if axis is binned, otherwise returns 0. Reimplemented from ProjectorBase. Definition at line 137 of file BinningProjector.cxx. References ProjectorBase::getNumberOfBins(), m_binner, m_binner_dim, BinsBase::numberOfBins(), hippodraw::Axes::X, and hippodraw::Axes::Y. |
|
|
Returns the total number of entries that went into creating the projected values. It is up to derived classes to interpret what this means. Some may find it meaningless and raise an exception and/or assertion. Implemented in FunctionProjector, LineProjector, NTupleProjector, StHist1DProjector, and StHist2DProjector. Referenced by TotalTextRep::drawProjectedValues(), normalize(), and QtDisplay::numberOfEntries(). |
|
|
Returns the list of observers.
Definition at line 57 of file Observable.cxx. References Observable::m_list. |
|
|
Returns the offset of the axis. Not all projectors has a notation of a bin width. This interface is declared for those that do. The implementation in this base class is to does nothing. Reimplemented from ProjectorBase. Definition at line 223 of file BinningProjector.cxx. References BinsBase::getOffset(), m_binner, m_binner_dim, hippodraw::Axes::X, hippodraw::Axes::Y, and hippodraw::Axes::Z. |
|
|
Return the vector of Point Reps.
Definition at line 317 of file ProjectorBase.cxx. References ProjectorBase::m_pointreps. |
|
|
Returns the minimum positive value.
Implemented in DyHist1DProjector, DyHist2DProjector, FunctionProjector, LineProjector, Map1Projector, Map2Projector, Map3Projector, MapMatrixProjector, Profile2DProjector, ProfileProjector, StHist1DProjector, and StHist2DProjector. Referenced by DataRep::getPosRange(), Hist2DProjImp::setRange(), and Hist1DProjImp::setRange(). |
|
|
Returns ntuple representation of projected values.
Definition at line 338 of file ProjectorBase.cxx. References ProjectorBase::m_proj_values. Referenced by BinningProjectorXML::createChildren(), ProjectorBase::createOldStyleNTuple(), StHist2DProjector::getAverage(), StHist1DProjector::getAverage(), MapMatrixProjector::getAverage(), Map1Projector::getAverage(), ProjectorBase::getRMS(), and FunctionProjector::initializeFunction(). |
|
|
Returns the Range along the specified axis. The behavior implemented here is to return the range of the AxisModelBase owned by the PlotterBase. However, derived classes may override this function, such as projectors that have binners, if this behavior is incorrect. Definition at line 145 of file ProjectorBase.cxx. References AxisModelBase::getRange(), ProjectorBase::m_x_axis, ProjectorBase::m_y_axis, ProjectorBase::m_z_axis, hippodraw::Axes::X, hippodraw::Axes::Y, and hippodraw::Axes::Z. Referenced by LineProjector::dataRangeOn(), LineProjector::fillDataSource(), LineProjector::fillProjectedValues(), NTupleProjector::getAverage(), DyHist1DProjector::getAverage(), LineProjector::getPosOn(), and LineProjector::valueRange(). |
|
|
Returns the RMS. Returns the root mean square of the data points along the axis axis. Definition at line 279 of file ProjectorBase.cxx. References ProjectorBase::getProjectedValues(), ProjectorHelper::stdCoord(), and hippodraw::Axes::X. |
|
|
Finds the title of the plot.
Implemented in FunctionProjector, LineProjector, NTupleProjector, StHist1DProjector, and StHist2DProjector. |
|
|
Finds the X axis label of the plot. A plotter may ask the projector for the default label. Implemented in FunctionProjector, LineProjector, Map1Projector, MapMatrixProjector, NTupleProjector, StHist1DProjector, and StHist2DProjector. Referenced by CompositePlotter::getLabel(). |
|
|
Finds the Y axis label of the plot. Derived classes should return a label for the Y axis that is meaningful for the kind of projection. The argument flag can be used to distinguish between two possible labels, depending on some state of the projector. Implemented in DyHist1DProjector, FunctionProjector, LineProjector, Map1Projector, MapMatrixProjector, NTupleProjector, StHist1DProjector, and StHist2DProjector. Referenced by CompositePlotter::getLabel(). |
|
|
Finds the Z axis label of the plot. A plotter may ask the projector for the default label. Reimplemented in FunctionProjector, Hist2DProjImp, Map3Projector, MapMatrixProjector, and Profile2DProjector. Definition at line 292 of file ProjectorBase.cxx. References ProjectorBase::m_z_label. Referenced by NTupleProjector::getAverage(), and CompositePlotter::getLabel(). |
|
||||||||||||
|
Get the z value at the specified point (x,y).
Reimplemented from ProjectorBase. Definition at line 263 of file BinningProjector.cxx. References BinsBase::getZValue(), and m_binner. |
|
|
Returns An axis that is binned responds to the width and offset controls. This base class implementation returns false. Reimplemented in DyHist1DProjector, DyHist2DProjector, Profile2DProjector, ProfileProjector, StHist1DProjector, and StHist2DProjector. Definition at line 121 of file ProjectorBase.cxx. Referenced by CompositePlotter::getBinWidth(), CompositePlotter::getOffset(), DisplayController::isAxisBinned(), DisplayController::setBinner(), and setBinnerOn(). |
|
|
Returns A dirty projector is one whose projected values are invalid because of some change (e.g., an axis range has changed.) Definition at line 70 of file ProjectorBase.cxx. References ProjectorBase::m_isDirty. Referenced by createOldStyleNTuple(), Profile2DProjector::dataRangeOn(), DataRep::isDirty(), MapMatrixProjector::prepareValues(), Map2Projector::prepareValues(), FunctionProjector::prepareValues(), prepareValues(), and Profile2DProjector::valueRange(). |
|
|
Returns
Returns Implemented in FunctionProjector, LineProjector, NTupleProjector, StHist1DProjector, and StHist2DProjector. Referenced by DataRep::hasZeroRows(). |
|
|
Returns
The implementation in this base class returns Reimplemented in Hist1DProjImp, and Hist2DProjImp. Definition at line 126 of file ProjectorBase.cxx. Referenced by normalizeTo(). |
|
|
Transposes the X and Y axis. The implementation in this base class does nothing. Reimplemented in MapMatrixProjector. Definition at line 109 of file ProjectorBase.cxx. |
|
|
Normalizes the projector to its target.
Definition at line 332 of file BinningProjector.cxx. References ProjectorBase::getNumberOfEntries(), ProjectorBase::m_target, norm, normalizeTo(), and ProjectorBase::setDirty(). Referenced by normalizeTo(), and update(). |
|
|
Normalize the output of the receiving object's projected values to that of target.
Reimplemented from ProjectorBase. Definition at line 309 of file BinningProjector.cxx. References Observable::addObserver(), ProjectorBase::isValueBinned(), ProjectorBase::m_target, normalize(), Observable::removeObserver(), and setNormalizing(). |
|
|
Sets a scale factor on the output so that the number of entries appears to be number. This feature might be used, for example, to compare two histograms that have different number of entires by normalizing one to the other. Reimplemented from ProjectorBase. Definition at line 293 of file BinningProjector.cxx. References m_binner. Referenced by normalize(). |
|
|
An internal method to iterate over all observers and to send the message action.
Definition at line 69 of file Observable.cxx. References std::bind2nd(), std::for_each(), Observable::m_list, and std::mem_fun(). |
|
|
|
Returns the preferred Range. Returns the Range preferred by the projector. The default implementation in |