Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

ProjectorBase Class Reference

#include <ProjectorBase.h>

Inheritance diagram for ProjectorBase:

Inheritance graph
[legend]
Collaboration diagram for ProjectorBase:

Collaboration graph
[legend]
List of all members.

Detailed Description

The base class for the Projector hierarchy.

Derived classes create NTuple of projected values. The format of the NTuple is either DataPoint2DTuple or DataPoint3DTuple. There are multiple clients of NTuple including a derived class RepBase, the the function fitters.

This base class also declares the virtual interface to inquiring about the range of the projected values which must be implemented in the derived classes. The Projectors can find the range much more efficiently than clients using iterators to projected values.

Author:
Stephane Bonneaud <gandalf@slac.stanford.edu>

Paul F. Kunz <Paul_Kunz@slac.stanford.edu>

Matan Shacham <matan@slac.stanford.edu>

Oded Wurman <owurman@stanford.edu>

Definition at line 51 of file ProjectorBase.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 ProjectorBaseclone ()=0
 The clone function returns an object of its own kind which is a copy of this object at this moment.
virtual DataSourcecreateNTuple () const =0
 Creates an NTuple representation of the projected values.
virtual const DataSourcecreateOldStyleNTuple () const
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 AxisModelBasegetAxisModel (hippodraw::Axes::Type axis) const
 Get the AxisModel for axis axis.
virtual double getBinWidth (hippodraw::Axes::Type axis) const
 Returns the bin width of the axis.
virtual NTuplegetNTupleAfterCuts () const
 Template for projectors that can return subsets of the NTuple used by the DataRep.
virtual int getNumberOfBins (hippodraw::Axes::Type) 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_tgetObservers () const
 Returns the list of observers.
virtual 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 DataSourcegetProjectedValues () const
 Returns ntuple representation of projected values.
virtual const RangegetRange (hippodraw::Axes::Type) const
 Returns the Range along the specified axis.
virtual double getRMS (hippodraw::Axes::Type axis)
 Returns the RMS.
virtual const std::stringgetTitle () const =0
 Finds the title of the plot.
virtual const std::stringgetXLabel () const =0
 Finds the X axis label of the plot.
virtual const std::stringgetYLabel (bool flag=false) const =0
 Finds the Y axis label of the plot.
virtual const std::stringgetZLabel () 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 normalizeTo (double norm)
 Sets a scale factor on the output so that the number of entries appears to be number.
virtual void normalizeTo (const ProjectorBase *target)
 Sets the target of normalization.
virtual void notifyObservers () const
 Notifies Observer objects of a change.
virtual Range preferredRange (hippodraw::Axes::Type) const
 Returns the preferred Range.
virtual void prepareValues ()
 Informs the projector to prepare its projected values for plotting.
 ProjectorBase ()
 The default constructor.
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 axis, AxisModelBase *)
 Sets the AxisModel for axis axis.
virtual void setBinWidth (const std::string &axis, int parm, bool dragging)
 Sets the bin width.
virtual void setBinWidth (hippodraw::Axes::Type axis, double width)
 Sets the bin 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 update (const Observable *)
 Implements the Observer pattern.
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 *)
 Notifies this Observer object that one of its Observable objects is about to be deleted.
virtual ~ProjectorBase ()
 The virtual destructor.

Protected Member Functions

virtual void addPointReps ()=0
 Function to add the acceptable point reps.
virtual void fillDataSource (DataSource *source, bool in_range=false) const =0
 Fills the DataSource source with the projected values.
virtual void fillProjectedValues (DataSource *ntuple, bool in_range=false) const =0
 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.
 ProjectorBase (const ProjectorBase &projector)
 The copy constructor.

Protected Attributes

std::vector< std::stringm_pointreps
 Vector of acceptable PointReps.
DataSourcem_proj_values
 The NTuple representing the result of the projection.
const ProjectorBasem_target
 The target projector.
AxisModelBasem_x_axis
 The AxisModel along the X axis.
AxisModelBasem_y_axis
 The AxisModel along the Y axis.
AxisModelBasem_z_axis
 The AxisModel along the Z axis.
std::string m_z_label
 Dummy member so that getZLabel can return a reference.

Private Attributes

bool m_isDirty
 Marks the object as dirty.


Member Typedef Documentation

typedef void( hippodraw::Observer::* Observable::Action)(const Observable *) [inherited]
 

The member function of the Observer that is called.

Definition at line 83 of file Observable.h.

typedef std::list< hippodraw::Observer * > Observable::ObserverList_t [inherited]
 

The type of STL container to maintain list of Observer objects.

Definition at line 46 of file Observable.h.


Constructor & Destructor Documentation

ProjectorBase::ProjectorBase const ProjectorBase projector  )  [protected]
 

The copy constructor.

Definition at line 50 of file ProjectorBase.cxx.

ProjectorBase::ProjectorBase  ) 
 

The default constructor.

Definition at line 41 of file ProjectorBase.cxx.

ProjectorBase::~ProjectorBase  )  [virtual]
 

The virtual destructor.

Definition at line 59 of file ProjectorBase.cxx.

References m_proj_values.


Member Function Documentation

void Observable::addObserver hippodraw::Observer  )  [inherited]
 

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(), BinningProjector::normalizeTo(), DataRepController::setAxisBindings(), DisplayController::setNTuple(), CutPlotter::setNTuple(), and TextPlotter::setParentDataRep().

virtual void ProjectorBase::addPointReps  )  [protected, pure virtual]
 

Function to add the acceptable point reps.

Todo:
Why is this in the ProjectorBase and not DataRep ?

Implemented in FunctionProjector, Hist1DProjImp, Hist2DProjImp, LineProjector, Map1Projector, Map2Projector, Map3Projector, MapMatrixProjector, Profile2DProjector, ProfileProjector, and StripChartProjector.

void ProjectorBase::addValues const std::vector< double > &  v  )  [virtual]
 

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.

virtual ProjectorBase* ProjectorBase::clone  )  [pure virtual]
 

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().

virtual DataSource* ProjectorBase::createNTuple  )  const [pure virtual]
 

Creates an NTuple representation of the projected values.

Derived classes should create a representation appropriate for their projection. They should at least include the coordinates, the width of the coordinates, the value and the error on the value.

Implemented in BinningProjector, FunctionProjector, LineProjector, Map1Projector, Map2Projector, Map3Projector, and MapMatrixProjector.

const DataSource * ProjectorBase::createOldStyleNTuple  )  const [virtual]
 

Reimplemented in BinningProjector.

Definition at line 345 of file ProjectorBase.cxx.

References getProjectedValues(), and prepareValues().

virtual Range ProjectorBase::dataRangeOn hippodraw::Axes::Type   )  const [pure virtual]
 

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 preferredRange(), Hist2DProjImp::preferredRange(), Hist1DProjImp::preferredRange(), Hist2DProjImp::valueRange(), and Hist1DProjImp::valueRange().

virtual void ProjectorBase::fillDataSource DataSource source,
bool  in_range = false
const [protected, pure virtual]
 

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 true, then the values used to fill the DataSource are further restricted to be within the axes ranges. Some derived classes may always use the default behavior.

Implemented in BinningProjector, FunctionProjector, LineProjector, Map1Projector, Map2Projector, Map3Projector, and MapMatrixProjector.

virtual void ProjectorBase::fillProjectedValues DataSource ntuple,
bool  in_range = false
const [protected, pure virtual]
 

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 true, then the values used to fill the NTuple are further restricted to be within the axes ranges. Some derived classes may always use the default behavior.

Implemented in BinningProjector, FunctionProjector, LineProjector, Map1Projector, Map2Projector, Map3Projector, MapMatrixProjector, and StripChartProjector.

double ProjectorBase::getAverage hippodraw::Axes::Type  axis  )  const [virtual]
 

Get the Average of all projected values on the specified axis.

Todo:
this should be computed externally with the iterators

Reimplemented in DyHist1DProjector, Map1Projector, MapMatrixProjector, NTupleProjector, StHist1DProjector, and StHist2DProjector.

Definition at line 268 of file ProjectorBase.cxx.

Referenced by AverageTextRep::drawProjectedValues().

const vector< string > & ProjectorBase::getAxisBindings  )  const [virtual]
 

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().

AxisModelBase * ProjectorBase::getAxisModel hippodraw::Axes::Type  axis  )  const [virtual]
 

Get the AxisModel for axis axis.

Definition at line 204 of file ProjectorBase.cxx.

References m_x_axis, m_y_axis, m_z_axis, hippodraw::Axes::X, hippodraw::Axes::Y, and hippodraw::Axes::Z.

Referenced by CompositePlotter::processReturnValue(), and ContourPointRep::setContourValues().

double ProjectorBase::getBinWidth hippodraw::Axes::Type  axis  )  const [virtual]
 

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 in BinningProjector, and MapMatrixProjector.

Definition at line 299 of file ProjectorBase.cxx.

Referenced by PyDataRep::getBinWidth(), and CompositePlotter::getBinWidth().

NTuple * ProjectorBase::getNTupleAfterCuts  )  const [virtual]
 

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().

int ProjectorBase::getNumberOfBins hippodraw::Axes::Type   )  const [virtual]
 

Returns the number of bins.

Returns the number of bins on the specified axis. The result is 0 if the axis is not binned.

Reimplemented in BinningProjector, and MapMatrixProjector.

Definition at line 116 of file ProjectorBase.cxx.

Referenced by BinningProjector::getNumberOfBins().

virtual int ProjectorBase::getNumberOfEntries  )  const [pure virtual]
 

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(), BinningProjector::normalize(), and QtDisplay::numberOfEntries().

const Observable::ObserverList_t & Observable::getObservers  )  const [inherited]
 

Returns the list of observers.

Definition at line 57 of file Observable.cxx.

References Observable::m_list.

double ProjectorBase::getOffset hippodraw::Axes::Type  axis  )  const [virtual]
 

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 in BinningProjector, and MapMatrixProjector.

Definition at line 258 of file ProjectorBase.cxx.

Referenced by CompositePlotter::getOffset().

const vector< string > & ProjectorBase::getPointReps  )  const
 

Return the vector of Point Reps.

Definition at line 317 of file ProjectorBase.cxx.

References m_pointreps.

virtual double ProjectorBase::getPosOn hippodraw::Axes::Type   )  const [pure virtual]
 

Returns the minimum positive value.

Todo:
Resolve if this method should be here.

Implemented in DyHist1DProjector, DyHist2DProjector, FunctionProjector, LineProjector, Map1Projector, Map2Projector, Map3Projector, MapMatrixProjector, Profile2DProjector, ProfileProjector, StHist1DProjector, and StHist2DProjector.

Referenced by DataRep::getPosRange(), Hist2DProjImp::setRange(), and Hist1DProjImp::setRange().

const DataSource * ProjectorBase::getProjectedValues  )  const
 

Returns ntuple representation of projected values.

Definition at line 338 of file ProjectorBase.cxx.

References m_proj_values.

Referenced by BinningProjectorXML::createChildren(), createOldStyleNTuple(), StHist2DProjector::getAverage(), StHist1DProjector::getAverage(), MapMatrixProjector::getAverage(), Map1Projector::getAverage(), getRMS(), and FunctionProjector::initializeFunction().

const Range & ProjectorBase::getRange hippodraw::Axes::Type   )  const [virtual]
 

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(), m_x_axis, m_y_axis, 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().

double ProjectorBase::getRMS hippodraw::Axes::Type  axis  )  [virtual]
 

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 getProjectedValues(), ProjectorHelper::stdCoord(), and hippodraw::Axes::X.

virtual const std::string& ProjectorBase::getTitle  )  const [pure virtual]
 

Finds the title of the plot.

Implemented in FunctionProjector, LineProjector, NTupleProjector, StHist1DProjector, and StHist2DProjector.

virtual const std::string& ProjectorBase::getXLabel  )  const [pure virtual]
 

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().

virtual const std::string& ProjectorBase::getYLabel bool  flag = false  )  const [pure virtual]
 

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().

const std::string & ProjectorBase::getZLabel  )  const [virtual]
 

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 m_z_label.

Referenced by NTupleProjector::getAverage(), and CompositePlotter::getLabel().

double ProjectorBase::getZValue double  x,
double  y
const [virtual]
 

Get the z value at the specified point (x,y).

Reimplemented in BinningProjector, Map3Projector, and MapMatrixProjector.

Definition at line 305 of file ProjectorBase.cxx.

Referenced by CompositePlotter::getZValue().

bool ProjectorBase::isAxisBinned const std::string axis  )  const [virtual]
 

Returns true if specified axis is binned.

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 BinningProjector::setBinnerOn().

bool ProjectorBase::isDirty  )  const
 

Returns true if the projector has been marked dirty.

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 m_isDirty.

Referenced by BinningProjector::createOldStyleNTuple(), Profile2DProjector::dataRangeOn(), DataRep::isDirty(), MapMatrixProjector::prepareValues(), Map2Projector::prepareValues(), FunctionProjector::prepareValues(), BinningProjector::prepareValues(), and Profile2DProjector::valueRange().

virtual bool ProjectorBase::isEmpty  )  const [pure virtual]
 

Returns true if the data source used by this projector is empty.

Returns true if the data source used by this projector is empty, otherwise returns true. The data source is empty, i.e. has no data, then many member functions of this class can not respond with meaning full results.

Implemented in FunctionProjector, LineProjector, NTupleProjector, StHist1DProjector, and StHist2DProjector.

Referenced by DataRep::hasZeroRows().

bool ProjectorBase::isValueBinned  )  const [virtual]
 

Returns true if the projected values are the result of binning.

The implementation in this base class returns false. It maybe overridden in derived classes that do binning.

Reimplemented in Hist1DProjImp, and Hist2DProjImp.

Definition at line 126 of file ProjectorBase.cxx.

Referenced by BinningProjector::normalizeTo().

void ProjectorBase::matrixTranspose bool  yes  )  [virtual]
 

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.

void ProjectorBase::normalizeTo double  norm  )  [virtual]
 

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 in BinningProjector.

Definition at line 355 of file ProjectorBase.cxx.

void ProjectorBase::normalizeTo const ProjectorBase target  )  [virtual]
 

Sets the target of normalization.

The meaning of normalizing the projected values of one projector to another one depends on the derived class. This implementation in this base does nothing.

Reimplemented in BinningProjector.

Definition at line 376 of file ProjectorBase.cxx.

void Observable::notifyObservers Action  action  )  const [protected, inherited]
 

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().

void Observable::notifyObservers  )  const [virtual, inherited]
 

Notifies Observer objects of a change.

If interval counting is disabled, then Observer::Update is sent immediately. If interval counting is enabled, then the current count is incremented. If the current count is equal to the interval count, then the Observer::update message is sent and the current count reset to 0.

Reimplemented in NTuple, FitsNTuple, RootNTuple, NumArrayTuple, ListTuple, and RootNTuple.

Definition at line 90 of file Observable.cxx.

References hippodraw::Observer::update().

Referenced by XyPlotter::addDataRep(), XyPlotter::addDataRepStacked(), FunctionController::addFunctionRep(), RTuple::addRow(), StHist2DProjector::addValues(), StHist1DProjector::addValues(), XyPlotter::autoScale(), Inspector::contourLevelsTextBox_returnPressed(), Inspector::contourSlider_valueChanged(), Inspector::contourTextBox_returnPressed(), FunctionRep::fitFunction(), NumArrayTuple::notifyObservers(), NTuple::notifyObservers(), ListTuple::notifyObservers(), RootNTuple::notifyObservers(), FitsNTuple::notifyObservers(), XyPlotter::removeDataRep(), FunctionRep::restoreParameters(), CutPlotter::setActive(), XyPlotter::setAutoRanging(), QtDisplay::setContourLevels(), CutPlotter::setCutColor(), XyPlotter::setCutEnabled(), XyPlotter::setCutInverted(), XyPlotter::setCutRangeAt(), setDirty(), DataRep::setErrorDisplay(), XyPlotter::setHighRange(), XyPlotter::setLabel(), PlotterBase::setLabel(), DataSource::setLabelAt(), DataSource::setLabels(), XyPlotter::setLowRange(), DataSource::setName(), DisplayController::setNTuple(), FunctionRep::setParameters(), DataRep::setRepColor(), DyHistogram::setRepresentation(), DataRep::setRepresentation(), DataRep::setRepSize(), DataRep::setRepStyle(), XyPlotter::setScaling(), PlotterBase::setTitle(), DataSource::setTitle(), XyPlotter::setTransform(), XyPlotter::setValueRep(), PlotterBase::update(), NTupleProjector::update(), DataRep::update(), CutPlotter::update(), BinningProjector::update(), CutPlotter::updateTargets(), DataRep::~DataRep(), DataSource::~DataSource(), NTuple::~NTuple(), and RTuple::~RTuple().

Range ProjectorBase::preferredRange hippodraw::Axes::Type   )  const [virtual]
 

Returns the preferred Range.

Returns the Range preferred by the projector. The default implementation in this base class is to return full range of the data on the axis. Derived classes, may need to override this implementation.

Reimplemented in Hist1DProjImp, and Hist2DProjImp.

Definition at line 163 of file ProjectorBase.cxx.

References dataRangeOn(), Range::length(), Range::low(), Range::setHigh(), Range::setLow(), and hippodraw::Axes::Y.

Referenced by DataRep::preferredRange().

void ProjectorBase::prepareValues  )  [virtual]
 

Informs the projector to prepare its projected values for plotting.

This base class implementation sets the dirty flag to false indicating that the values are already prepared. Projectors that need to calculate the projected values should override this method and also set the dirty flag to false. For example, a projector might accumulate data into bins, and the position of the bin and its number of entries are used for the projected values.

Reimplemented in BinningProjector, FunctionProjector, LineProjector, Map1Projector, Map2Projector, Map3Projector, and MapMatrixProjector.

Definition at line 65 of file ProjectorBase.cxx.

References setDirty().

Referenced by DataRep::createNTuple(), createOldStyleNTuple(), DataRep::getProjectedValues(), and FunctionProjector::initializeFunction().

void Observable::removeObserver hippodraw::Observer  )  [inherited]
 

Removes an Observer from the Observer list.

Definition at line 63 of file Observable.cxx.

References Observable::m_list.

Referenced by BinningProjector::normalizeTo(), CutPlotter::removeFromTarget(), DisplayController::removeTextObservers(), NTupleProjector::setNTuple(), FunctionRep::willDelete(), FunctionRep::~FunctionRep(), and NTupleProjector::~NTupleProjector().

void ProjectorBase::reset  )  [virtual]
 

Resets the bins.

This interface is for the StHist1DProjector

Reimplemented in BinningProjector, Hist1DProjImp, and StHist1DProjector.

Definition at line 252 of file ProjectorBase.cxx.

Referenced by CompositePlotter::reset().

void ProjectorBase::setAxisBinding const std::string axis,
const std::string label
[virtual]
 

Sets the axis binding.

Sets binding of the axis with name axis to entity with name label. It is expected that this member function will only be called on a derived class which can process it in a meaningful way. Thus if this method is called on this base class, an assertion is thrown.

Reimplemented in NTupleProjector.

Definition at line 84 of file ProjectorBase.cxx.

void ProjectorBase::setAxisBindings const std::vector< std::string > &  bindings  )  [virtual]
 

Sets the axis binding.

Sets binding of all axis entities with name in the vector. 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 thrown.

Reimplemented in NTupleProjector.

Definition at line 92 of file ProjectorBase.cxx.

void ProjectorBase::setAxisModel hippodraw::Axes::Type  axis,
AxisModelBase
[virtual]
 

Sets the AxisModel for axis axis.

Reimplemented in BinningProjector, and FunctionProjector.

Definition at line 185 of file ProjectorBase.cxx.

References m_x_axis, m_y_axis, m_z_axis, hippodraw::Axes::X, hippodraw::Axes::Y, and hippodraw::Axes::Z.

Referenced by DataRep::setAxisModel(), and BinningProjector::setAxisModel().

void ProjectorBase::setBinWidth const std::string axis,
int  parm,
bool  dragging
[virtual]
 

Sets the bin width.

This method is intended to be used in conjunction with a slider widget in a graphical user interface. The slider range is assumed to be 0 to 100 with the current value at parm. If the slider is still being dragged, then dragging is true, otherwise it is false. A derived class determines withs own bin width based on the width it had when slider dragging first started. and the current position of the slider. The implementation in this base class does nothing.

Reimplemented in BinningProjector, DyHist2DProjector, and Profile2DProjector.

Definition at line 232 of file ProjectorBase.cxx.

void ProjectorBase::setBinWidth hippodraw::Axes::Type  axis,
double  width
[virtual]
 

Sets the bin width.

Sets the bin width to width along the axis 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 in BinningProjector, Hist2DProjImp, MapMatrixProjector, and Profile2DProjector.

Definition at line 227 of file ProjectorBase.cxx.

Referenced by DisplayController::setBinWidth(), and CompositePlotter::setBinWidth().

void ProjectorBase::setDirty bool  value = true  )  [virtual]
 

Sets the dirty flag to value.

Definition at line 75 of file ProjectorBase.cxx.

References m_isDirty, and Observable::notifyObservers().

Referenced by StHist2DProjector::addValues(), StHist1DProjector::addValues(), Profile2DProjector::dataRangeOn(), FunctionProjector::fitFunction(), StHist2DProjector::getAverage(), StHist1DProjector::getAverage(), BinningProjector::normalize(), FunctionProjector::prepareAxis(), prepareValues(), MapMatrixProjector::prepareValues(), Map3Projector::prepareValues(), Map2Projector::prepareValues(), Map1Projector::prepareValues(), LineProjector::prepareValues(), FunctionProjector::prepareValues(), BinningProjector::prepareValues(), StHist1DProjector::reset(), FunctionProjector::restoreParameters(), NTupleProjector::setAxisBinding(), BinningProjector::setBinnerOn(), StHist2DProjector::setBinnerRange(), StHist1DProjector::setBinnerRange(), ProfileProjector::setBinnerRange(), Profile2DProjector::setBinnerRange(), DyHist2DProjector::setBinnerRange(), DyHist1DProjector::setBinnerRange(), Profile2DProjector::setBinWidth(), Hist2DProjImp::setBinWidth(), BinningProjector::setBinWidth(), DataRep::setDirty(), NTupleProjector::setNTuple(), MapMatrixProjector::setNTuple(), Profile2DProjector::setOffset(), Hist2DProjImp::setOffset(), DyHist2DProjector::setOffset(), BinningProjector::setOffset(), FunctionProjector::setParameters(), setRange(), Profile2DProjector::setRange(), FunctionProjector::setRange(), NTupleProjector::update(), and BinningProjector::willDelete().

void ProjectorBase::setNormalizing bool  on  )  [virtual]
 

Sets the scaling number of entries on if on is true, otherwise turns if off.

Reimplemented in BinningProjector.

Definition at line 362 of file ProjectorBase.cxx.

void ProjectorBase::setNumberOfBins hippodraw::Axes::Type  axis,
unsigned int  number
[virtual]
 

Sets the number of bins.

Sets the number of bins along the axis axis to number.

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 in MapMatrixProjector.

Definition at line 221 of file ProjectorBase.cxx.

Referenced by CompositePlotter::setNumberOfBins().

void ProjectorBase::setOffset hippodraw::Axes::Type  axis,
double  offset
[virtual]
 

Sets the bin offset.

Sets the offset of bins by fraction offset of the bin width.

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 in BinningProjector, Hist2DProjImp, MapMatrixProjector, and Profile2DProjector.

Definition at line 246 of file ProjectorBase.cxx.

void ProjectorBase::setOffset const std::string axis,
int  parm,
bool  dragging
[virtual]
 

Sets the bin offset.

See also:
setBinWidth ( const std::string &, int, bool )

Reimplemented in BinningProjector, DyHist2DProjector, and Profile2DProjector.

Definition at line 238 of file ProjectorBase.cxx.

Referenced by DisplayController::setOffset(), and CompositePlotter::setOffset().

void ProjectorBase::setRange hippodraw::Axes::Type  axis,
bool  const_width = true
[virtual]
 

Sets the range of the selected axis.

The base class implementation only sets the dirty flag. Derived classes may need to do more. The option bool parameter if true indicates a binning projector should hold the bin width parameter constant.

Reimplemented in FunctionProjector, Hist1DProjImp, Hist2DProjImp, Profile2DProjector, and ProfileProjector.

Definition at line 133 of file ProjectorBase.cxx.

References m_z_axis, setDirty(), hippodraw::Axes::X, hippodraw::Axes::Y, and hippodraw::Axes::Z.

Referenced by DataRep::setRange().

void ProjectorBase::update const Observable  )  [virtual]
 

Implements the Observer pattern.

The implementation in this abstract base class does nothing. Derived class may override this method if they are observers.

Implements hippodraw::Observer.

Reimplemented in BinningProjector, DyHist1DProjector, DyHist2DProjector, NTupleProjector, Profile2DProjector, and ProfileProjector.

Definition at line 369 of file ProjectorBase.cxx.

virtual Range ProjectorBase::valueRange  )  const [pure virtual]
 

Finds the range of the projected values.

It is up to derived classes to determine what this means.

Todo:
Resolve if this method should be here.

Implemented in FunctionProjector, Hist1DProjImp, Hist2DProjImp, LineProjector, Map1Projector, Map2Projector, Map3Projector, MapMatrixProjector, Profile2DProjector, and ProfileProjector.

bool ProjectorBase::wantsScaleFactor const std::string axis  )  const [virtual]
 

Returns whether the projector wants scale factor.

Returns true if the projector wants to scale the axis, otherwise returns false. A projector supporting a histogram, for example, would want to scale the Y axis by the bin width in order to show entries per bin instead of density. This base class implementation always returns false.

Reimplemented in Hist1DProjImp, and Hist2DProjImp.

Definition at line 331 of file ProjectorBase.cxx.

Referenced by CompositePlotter::checkAxisScaling().

void hippodraw::Observer::willDelete const Observable  )  [virtual, inherited]
 

Notifies this Observer object that one of its Observable objects is about to be deleted.

Since most Observable objects are owned by its Observer, it is the Observer that issued the delete. Thus the default implementation here does nothing. Derived classes that observe objects owned by another should implement this method to remove the Observable from the list they are observing.

Reimplemented in FunctionRep, DataSourceController, CutPlotter, TextPlotter, BinningProjector, DyHist1DProjector, DyHist2DProjector, NTupleProjector, Profile2DProjector, and ProfileProjector.

Definition at line 25 of file Observer.cxx.

Referenced by DataRep::~DataRep(), DataSource::~DataSource(), NTuple::~NTuple(), and RTuple::~RTuple().


Member Data Documentation

bool ProjectorBase::m_isDirty [private]
 

Marks the object as dirty.

A projection is marked dirty if some change was made that requires re-calculating the projection.

Definition at line 58 of file ProjectorBase.h.

Referenced by isDirty(), and setDirty().

std::vector< std::string > ProjectorBase::m_pointreps [protected]
 

Vector of acceptable PointReps.

Definition at line 98 of file ProjectorBase.h.

Referenced by StripChartProjector::addPointReps(), ProfileProjector::addPointReps(), Profile2DProjector::addPointReps(), MapMatrixProjector::addPointReps(), Map3Projector::addPointReps(), Map2Projector::addPointReps(), Map1Projector::addPointReps(), Hist2DProjImp::addPointReps(), Hist1DProjImp::addPointReps(), and getPointReps().

DataSource* ProjectorBase::m_proj_values [protected]
 

The NTuple representing the result of the projection.

Note:
An NTuple object is probably too heavy for non-binning projectors. In the future, we'll create a class which behaves like one, but maps the data from the data source NTuple to required getRow().

Definition at line 73 of file ProjectorBase.h.

Referenced by BinningProjector::BinningProjector(), ProfileProjector::dataRangeOn(), Profile2DProjector::dataRangeOn(), Hist2DProjImp::dataRangeOnValue(), Hist1DProjImp::dataRangeOnValue(), DyHist1DProjector::getAverage(), ProfileProjector::getPosOn(), getProjectedValues(), Map3Projector::getZValue(), MapMatrixProjector::prepareValues(), Map3Projector::prepareValues(), Map2Projector::prepareValues(), Map1Projector::prepareValues(), LineProjector::prepareValues(), FunctionProjector::prepareValues(), BinningProjector::prepareValues(), BinningProjector::setBinner(), and ~ProjectorBase().

const ProjectorBase* ProjectorBase::m_target [protected]
 

The target projector.

Use of the target depends on derived classes. Target projector are observed, thus some of the implement is define in this base class.

Reimplemented in FunctionProjector.

Definition at line 104 of file ProjectorBase.h.

Referenced by BinningProjector::normalize(), BinningProjector::normalizeTo(), BinningProjector::update(), and BinningProjector::willDelete().

AxisModelBase* ProjectorBase::m_x_axis [protected]
 

The AxisModel along the X axis.

All Projectors have at least an X axis and maybe additional ones.

Todo:
Should be generalized to n-dimensions by having having a vector of AxisModelBase objects.

Definition at line 82 of file ProjectorBase.h.

Referenced by LineProjector::dataRangeOn(), FunctionProjector::dataRangeOn(), LineProjector::fillDataSource(), LineProjector::fillProjectedValues(), getAxisModel(), LineProjector::getPosOn(), getRange(), Map3Projector::getZValue(), NTupleProjector::inRange(), MapMatrixProjector::inRange(), Map1Projector::inRange(), FunctionProjector::prepareAxis(), setAxisModel(), FunctionProjector::setAxisModel(), Profile2DProjector::setOffset(), Hist2DProjImp::setOffset(), BinningProjector::setOffset(), ProfileProjector::setRange(), Profile2DProjector::setRange(), Hist2DProjImp::setRange(), Hist1DProjImp::setRange(), FunctionProjector::setRange(), and LineProjector::valueRange().

AxisModelBase* ProjectorBase::m_y_axis [protected]
 

The AxisModel along the Y axis.

All Projectors have at least a Y axis and maybe additional ones.

Definition at line 86 of file ProjectorBase.h.

Referenced by Hist1DProjImp::checkScaling(), LineProjector::dataRangeOn(), FunctionProjector::dataRangeOn(), LineProjector::fillDataSource(), LineProjector::fillProjectedValues(), StHist1DProjector::getAverage(), DyHist1DProjector::getAverage(), getAxisModel(), LineProjector::getPosOn(), getRange(), DyHist1DProjector::getYLabel(), Map3Projector::getZValue(), NTupleProjector::inRange(), MapMatrixProjector::inRange(), Map1Projector::inRange(), FunctionProjector::prepareAxis(), setAxisModel(), FunctionProjector::setAxisModel(), Profile2DProjector::setOffset(), Hist2DProjImp::setOffset(), Profile2DProjector::setRange(), Hist2DProjImp::setRange(), FunctionProjector::setRange(), and LineProjector::valueRange().

AxisModelBase* ProjectorBase::m_z_axis [protected]
 

The AxisModel along the Z axis.

May not be used by all Projectors.

Definition at line 90 of file ProjectorBase.h.

Referenced by Hist2DProjImp::checkScaling(), StHist2DProjector::getAverage(), getAxisModel(), getRange(), Hist2DProjImp::getZLabel(), NTupleProjector::inRange(), MapMatrixProjector::inRange(), setAxisModel(), and setRange().

std::string ProjectorBase::m_z_label [protected]
 

Dummy member so that getZLabel can return a reference.

Todo:
Remove when getLabel takes axis argument

Reimplemented in FunctionProjector, and StHist2DProjector.

Definition at line 95 of file ProjectorBase.h.

Referenced by getZLabel().


The documentation for this class was generated from the following files:
Generated for HippoDraw-1.14.8.5 by doxygen 1.4.3