#include <LineProjector.h>
Inheritance diagram for LineProjector:
Definition at line 27 of file LineProjector.h.
Public Types | |
typedef void(Observer::*) | Action (const Observable *) |
The member function of the Observer that is called. | |
typedef std::list< Observer * > | ObserverList_t |
The type of STL container to maintain list of Observer objects. | |
Public Member Functions | |
void | addObserver (Observer *) |
Adds an Observer to the Observer list. | |
virtual void | addPointReps () |
Function to add the acceptable point reps. | |
virtual void | addValues (const std::vector< double > &v) |
Add values to the projection. | |
virtual void | checkScaling () |
Checks for scaling the display of the axis range. | |
virtual ProjectorBase * | clone () |
The clone function returns an object of its own kind which is a copy of this object at this moment. | |
virtual DataSource * | createNTuple () const |
Creates an NTuple representation of the projected values. | |
virtual NTuple * | createNTupleWith (const std::vector< TupleCut > &cut_list) const |
Creates a NTuple from the projector's DataSource object using cut_list for not including rows that do not pass the cuts. | |
virtual const DataSource * | createOldStyleNTuple () const |
virtual Range | dataRangeOn (hippodraw::Axes::Type) const |
Returns the range of the raw data. | |
virtual void | fillColumnAfterCuts (const std::string &column, std::vector< double > &columnData) const |
Fill the vector with values from named column with the present set of cuts applied. | |
virtual double | getAverage (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 (Axes::Type axis) const |
Get the AxisModel for axis axis. | |
virtual double | getBinWidth (Axes::Type axis) const |
Returns the bin width of the axis. | |
virtual int | getMinEntries () |
Get the minimum entries/bin. | |
virtual NTuple * | getNTupleAfterCuts () const |
Template for projectors that can return subsets of the NTuple used by the DataRep. | |
virtual int | getNumberOfBins (Axes::Type) const |
Returns the number of bins. | |
virtual int | getNumberOfEntries () const |
Returns the total number of entries that went into creating the projected values. | |
const ObserverList_t & | getObservers () const |
Returns the list of observers. | |
virtual double | getOffset (Axes::Type axis) const |
Returns the offset of the axis. | |
int | getOverflow () const |
Returns the number of overflow. | |
const std::vector< std::string > & | getPointReps () const |
Return the vector of Point Reps. | |
virtual double | getPosOn (hippodraw::Axes::Type) const |
Returns the minimum positive value. | |
const DataSource * | getProjectedValues () const |
Returns DataSource representation of projected values. | |
virtual const Range & | getRange (Axes::Type) const |
Returns the Range along the specified axis. | |
virtual double | getRMS (Axes::Type axis) |
Returns the RMS. | |
const std::vector< unsigned int > & | getShape () |
Get the shape of the projected values. | |
virtual const std::string & | getTitle () const |
Finds the title of the plot. | |
int | getUnderflow () const |
Returns the number of underflow. | |
virtual const std::string & | getXLabel () const |
Finds the X axis label of the plot. | |
virtual const std::string & | getYLabel (bool flag=false) const |
Finds the Y axis label of the plot. | |
const std::vector< double > & | getZAfterTransform (TransformBase *transform) |
Return Z values after binary transform. | |
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). | |
const std::vector< double > & | getZValues () |
Return all Z values. | |
virtual bool | hasDataSourceBindings () const |
Returns true if projector has binding to a DataSource. | |
virtual int | indexOf (const std::string &label) const |
Returns the index of the label. | |
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 |
Returns true if the data source used by this projector is empty. | |
virtual bool | isImageConvertable () const |
Returns true if the projected values can converted to an image. | |
virtual bool | isValueBinned () const |
Returns true if the projected values are the result of binning. | |
LineProjector (hippodraw::Axes::Type, double value) | |
The constructor taking the represented value as the argument. | |
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 (Axes::Type) const |
Returns the preferred Range. | |
virtual void | prepareValues () |
Informs the projector to prepare its projected values for plotting. | |
void | removeObserver (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 (Axes::Type axis, AxisModelBase *) |
Sets the AxisModel for axis axis. | |
virtual const Range & | setBinWidth (Axes::Type axis, int parm, bool dragging) |
Sets the bin width. | |
virtual const Range & | setBinWidth (Axes::Type axis, double width) |
Sets the bin width. | |
virtual void | setDirty (bool value=true) |
Sets the dirty flag to value. | |
virtual void | setMinEntries (int entries) |
Set the minimum entries/bin. | |
virtual void | setNormalizing (bool on) |
Sets the scaling number of entries on if on is true , otherwise turns if off. | |
virtual void | setNumberOfBins (Axes::Type axis, unsigned int number) |
Sets the number of bins. | |
virtual void | setOffset (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 (Axes::Type axis, bool const_width=true) |
Sets the range of the selected axis. | |
void | setValue (double value) |
Sets the value that will be projected. | |
virtual void | update (const Observable *) |
Implements the Observer pattern. | |
virtual Range | valueRange () const |
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 | ~LineProjector () |
The virtual destructor. | |
Protected Member Functions | |
virtual void | fillProjectedValues (DataSource *ntuple, bool in_range=false) const |
void | notifyObservers (Action action) const |
An internal method to iterate over all observers and to send the message action. | |
Protected Attributes | |
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. | |
std::vector< double > | m_zval |
Sorted Z values in this projector. | |
Private Member Functions | |
LineProjector (const LineProjector &) | |
The copy constructor. | |
Private Attributes | |
hippodraw::Axes::Type | m_axis |
The axis for the value. | |
std::string | m_title |
A label for the line. | |
double | m_value |
The value represented. |
typedef void( Observer::*) Action(const Observable *) [inherited] |
typedef std::list< Observer * > ObserverList_t [inherited] |
The type of STL container to maintain list of Observer objects.
Definition at line 45 of file Observable.h.
LineProjector | ( | const LineProjector & | ) | [private] |
The copy constructor.
Definition at line 30 of file LineProjector.cxx.
Referenced by LineProjector::clone().
LineProjector | ( | hippodraw::Axes::Type | , | |
double | value | |||
) |
The constructor taking the represented value as the argument.
Definition at line 23 of file LineProjector.cxx.
~LineProjector | ( | ) | [virtual] |
The virtual destructor.
It is responsible for deleting the Function
objects.
Definition at line 37 of file LineProjector.cxx.
void addObserver | ( | Observer * | ) | [inherited] |
Adds an Observer to the Observer list.
Definition at line 52 of file Observable.cxx.
References Observable::m_list.
Referenced by XyPlotter::addDataRep(), FunctionRep::FunctionRep(), BinningProjector::normalizeTo(), DataRepController::setAxisBindings(), DisplayController::setNTuple(), CutPlotter::setNTuple(), and TextPlotter::setParentDataRep().
void addPointReps | ( | ) | [virtual] |
Function to add the acceptable point reps.
Implements ProjectorBase.
Definition at line 49 of file LineProjector.cxx.
void addValues | ( | const std::vector< double > & | v | ) | [virtual, inherited] |
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 330 of file ProjectorBase.cxx.
void checkScaling | ( | ) | [virtual, inherited] |
Checks for scaling the display of the axis range.
This base class implementation does nothing. Derived classes should override this method if scaling of the axis is meaningful to them.
Reimplemented in BinningProjector, Hist1DProjImp, and Hist2DProjImp.
Definition at line 416 of file ProjectorBase.cxx.
ProjectorBase * clone | ( | ) | [virtual] |
The clone function returns an object of its own kind which is a copy of this object at this moment.
Implements ProjectorBase.
Definition at line 42 of file LineProjector.cxx.
References LineProjector::LineProjector().
DataSource * createNTuple | ( | ) | const [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.
Implements ProjectorBase.
Definition at line 181 of file LineProjector.cxx.
References LineProjector::fillProjectedValues(), and hippodraw::DataPoint3DTuple::SIZE.
Referenced by LineProjector::prepareValues().
Creates a NTuple from the projector's DataSource object using cut_list for not including rows that do not pass the cuts.
Reimplemented in NTupleProjector.
Definition at line 356 of file ProjectorBase.cxx.
const DataSource * createOldStyleNTuple | ( | ) | const [virtual, inherited] |
Definition at line 378 of file ProjectorBase.cxx.
References ProjectorBase::getProjectedValues(), and ProjectorBase::prepareValues().
Range dataRangeOn | ( | hippodraw::Axes::Type | ) | const [virtual] |
Returns the range of the raw data.
Implements ProjectorBase.
Definition at line 61 of file LineProjector.cxx.
References ProjectorBase::getRange(), LineProjector::m_axis, LineProjector::m_value, ProjectorBase::m_x_axis, ProjectorBase::m_y_axis, Range::setRange(), hippodraw::Axes::X, and hippodraw::Axes::Y.
void fillColumnAfterCuts | ( | const std::string & | column, | |
std::vector< double > & | columnData | |||
) | const [virtual, inherited] |
Fill the vector with values from named column with the present set of cuts applied.
This default implementation does nothing.
Reimplemented in NTupleProjector.
Definition at line 349 of file ProjectorBase.cxx.
Referenced by DataRep::fillColumnAfterCuts().
void fillProjectedValues | ( | DataSource * | ntuple, | |
bool | in_range = false | |||
) | const [protected, virtual] |
Definition at line 197 of file LineProjector.cxx.
References ProjectorBase::getRange(), Range::high(), Range::low(), LineProjector::m_axis, LineProjector::m_value, ProjectorBase::m_x_axis, ProjectorBase::m_y_axis, hippodraw::DataPoint3DTuple::SIZE, hippodraw::DataPoint3DTuple::X, hippodraw::Axes::X, hippodraw::DataPoint3DTuple::XERR, hippodraw::DataPoint3DTuple::Y, and hippodraw::DataPoint3DTuple::YERR.
Referenced by LineProjector::createNTuple(), and LineProjector::prepareValues().
double getAverage | ( | Axes::Type | axis | ) | const [virtual, inherited] |
Get the Average of all projected values on the specified axis.
Reimplemented in DyHist1DProjector, EqualEntriesHist1DProjector, Map1Projector, MapMatrixProjector, NTupleProjector, StHist1DProjector, and StHist2DProjector.
Definition at line 278 of file ProjectorBase.cxx.
Referenced by AverageTextRep::drawProjectedValues().
const vector< string > & getAxisBindings | ( | ) | const [virtual, inherited] |
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(), and VariableMesh::setAxisBindings().
AxisModelBase * getAxisModel | ( | Axes::Type | axis | ) | const [virtual, inherited] |
Get the AxisModel for axis axis.
Definition at line 211 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().
double getBinWidth | ( | Axes::Type | axis | ) | const [virtual, inherited] |
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, EqualEntriesHist1DProjector, and MapMatrixProjector.
Definition at line 316 of file ProjectorBase.cxx.
Referenced by PyDataRep::getBinWidth(), and CompositePlotter::getBinWidth().
int getMinEntries | ( | ) | [virtual, inherited] |
Get the minimum entries/bin.
Reimplemented in BinningProjector.
Definition at line 531 of file ProjectorBase.cxx.
Referenced by CompositePlotter::getMinEntries().
NTuple * getNTupleAfterCuts | ( | ) | const [virtual, inherited] |
Template for projectors that can return subsets of the NTuple used by the DataRep.
Reimplemented in NTupleProjector.
Definition at line 342 of file ProjectorBase.cxx.
Referenced by DataRep::getNTupleAfterCuts().
int getNumberOfBins | ( | Axes::Type | ) | const [virtual, inherited] |
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().
int getNumberOfEntries | ( | ) | const [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.
Implements ProjectorBase.
Definition at line 149 of file LineProjector.cxx.
const Observable::ObserverList_t & getObservers | ( | ) | const [inherited] |
Returns the list of observers.
Definition at line 60 of file Observable.cxx.
References Observable::m_list.
double getOffset | ( | Axes::Type | axis | ) | const [virtual, inherited] |
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 268 of file ProjectorBase.cxx.
Referenced by CompositePlotter::getOffset().
int getOverflow | ( | ) | const [virtual] |
Returns the number of overflow.
It is meaningless.
Implements ProjectorBase.
Definition at line 163 of file LineProjector.cxx.
const vector< string > & getPointReps | ( | ) | const [inherited] |
Return the vector of Point Reps.
Definition at line 335 of file ProjectorBase.cxx.
References ProjectorBase::m_pointreps.
double getPosOn | ( | hippodraw::Axes::Type | ) | const [virtual] |
Returns the minimum positive value.
Implements ProjectorBase.
Definition at line 108 of file LineProjector.cxx.
References ProjectorBase::getRange(), LineProjector::m_axis, LineProjector::m_value, ProjectorBase::m_x_axis, ProjectorBase::m_y_axis, Range::pos(), hippodraw::Axes::X, and hippodraw::Axes::Y.
const DataSource * getProjectedValues | ( | ) | const [inherited] |
Returns DataSource representation of projected values.
Definition at line 371 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(), ProjectorBase::getShape(), ProjectorBase::getZValues(), and FunctionProjector::initializeFunction().
const Range & getRange | ( | Axes::Type | ) | const [virtual, inherited] |
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(), FunctionProjector::dataRangeOn(), LineProjector::fillProjectedValues(), NTupleProjector::getAverage(), DyHist1DProjector::getAverage(), LineProjector::getPosOn(), MeshProjector::inRangeWithZ(), MapMatrixProjector::inRangeWithZ(), ProjectorBase::setBinWidth(), MapMatrixProjector::setBinWidth(), and LineProjector::valueRange().
double getRMS | ( | Axes::Type | axis | ) | [virtual, inherited] |
Returns the RMS.
Returns the root mean square of the data points along the axis axis.
Definition at line 289 of file ProjectorBase.cxx.
References ProjectorBase::getProjectedValues(), ProjectorHelper::stdCoord(), and hippodraw::Axes::X.
const std::vector< unsigned int > & getShape | ( | ) | [inherited] |
Get the shape of the projected values.
Used to export FITS file.
Definition at line 444 of file ProjectorBase.cxx.
References ProjectorBase::getProjectedValues(), and DataSource::getShape().
Referenced by ProjectorBase::getZValues().
const std::string & getTitle | ( | ) | const [virtual] |
Finds the title of the plot.
Implements ProjectorBase.
Definition at line 86 of file LineProjector.cxx.
References LineProjector::m_title.
int getUnderflow | ( | ) | const [virtual] |
Returns the number of underflow.
It is meaningless.
Implements ProjectorBase.
Definition at line 156 of file LineProjector.cxx.
const std::string & getXLabel | ( | ) | const [virtual] |
Finds the X axis label of the plot.
A plotter may ask the projector for the default label.
Implements ProjectorBase.
Definition at line 135 of file LineProjector.cxx.
References LineProjector::m_title.
const std::string & getYLabel | ( | bool | flag = false |
) | const [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.
Implements ProjectorBase.
Definition at line 142 of file LineProjector.cxx.
References LineProjector::m_title.
const std::vector< double > & getZAfterTransform | ( | TransformBase * | transform | ) | [inherited] |
Return Z values after binary transform.
Definition at line 456 of file ProjectorBase.cxx.
References ProjectorBase::getZValue(), BinaryTransform::inverseTransform(), and ProjectorBase::m_zval.
const std::string & getZLabel | ( | ) | const [virtual, inherited] |
Finds the Z axis label of the plot.
A plotter may ask the projector for the default label.
Reimplemented in FunctionProjector, Hist2DProjImp, Map3Projector, MapMatrixProjector, MeshProjector, and Profile2DProjector.
Definition at line 302 of file ProjectorBase.cxx.
References ProjectorBase::m_z_label.
Referenced by NTupleProjector::getAverage(), and CompositePlotter::getLabel().
double getZValue | ( | double | x, | |
double | y | |||
) | const [virtual, inherited] |
Get the z value at the specified point (x,y).
Reimplemented in BinningProjector, Map3Projector, MapMatrixProjector, and MeshProjector.
Definition at line 323 of file ProjectorBase.cxx.
Referenced by ProjectorBase::getZAfterTransform(), and CompositePlotter::getZValue().
const std::vector< double > & getZValues | ( | ) | [inherited] |
Return all Z values.
Definition at line 423 of file ProjectorBase.cxx.
References DataSource::getColumn(), ProjectorBase::getProjectedValues(), ProjectorBase::getShape(), ProjectorBase::m_zval, and num_util::shape().
bool hasDataSourceBindings | ( | ) | const [virtual, inherited] |
Returns true
if projector has binding to a DataSource.
This base class implementation returns false
. Derived classes that have DataSource binding should override this member function and return true
.
Reimplemented in NTupleProjector.
Definition at line 518 of file ProjectorBase.cxx.
Referenced by BinningProjectorXML::createChildren().
int indexOf | ( | const std::string & | label | ) | const [virtual, inherited] |
Returns the index of the label.
For example, the column index.
Reimplemented in NTupleProjector.
Definition at line 309 of file ProjectorBase.cxx.
bool isAxisBinned | ( | const std::string & | axis | ) | const [virtual, inherited] |
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, EqualEntriesHist1DProjector, Profile2DProjector, ProfileProjector, StHist1DProjector, and StHist2DProjector.
Definition at line 121 of file ProjectorBase.cxx.
Referenced by DisplayController::isAxisBinned(), DisplayController::setBinner(), and BinningProjector::setBinnerOn().
bool isDirty | ( | ) | const [inherited] |
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 ProjectorBase::m_isDirty.
Referenced by Profile2DProjector::dataRangeOn(), DataRep::isDirty(), MeshProjector::prepareValues(), MapMatrixProjector::prepareValues(), Map2Projector::prepareValues(), BinningProjector::prepareValues(), and Profile2DProjector::valueRange().
bool isEmpty | ( | ) | const [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.
Implements ProjectorBase.
Definition at line 54 of file LineProjector.cxx.
bool isImageConvertable | ( | ) | const [virtual, inherited] |
Returns true
if the projected values can converted to an image.
Returns true
if this projected values can be converted to an image. An image is defined as a regular grid of values. As a convenience to implementers of derived classes, this base class method returns false.
Reimplemented in BinningProjector, and MapMatrixProjector.
Definition at line 538 of file ProjectorBase.cxx.
bool isValueBinned | ( | ) | const [virtual, inherited] |
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 matrixTranspose | ( | bool | yes | ) | [virtual, inherited] |
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 normalizeTo | ( | double | norm | ) | [virtual, inherited] |
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 entries by normalizing one to the other.
Reimplemented in BinningProjector.
Definition at line 388 of file ProjectorBase.cxx.
void normalizeTo | ( | const ProjectorBase * | target | ) | [virtual, inherited] |
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 409 of file ProjectorBase.cxx.
void notifyObservers | ( | Action | action | ) | const [protected, inherited] |
An internal method to iterate over all observers and to send the message action.
Definition at line 72 of file Observable.cxx.
References Observable::m_list.
void 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, NumArrayTuple, ListTuple, and RootNTuple.
Definition at line 93 of file Observable.cxx.
References Observer::update().
Referenced by XyPlotter::addDataRep(), XyPlotter::addDataRepStacked(), FunctionController::addFunctionRep(), StHist2DProjector::addValues(), StHist1DProjector::addValues(), XyPlotter::autoScale(), Inspector::contourLevelsTextBox_returnPressed(), Inspector::contourSlider_valueChanged(), Inspector::contourTextBox_returnPressed(), FunctionRep::fitFunction(), RootNTuple::notifyObservers(), NumArrayTuple::notifyObservers(), NTuple::notifyObservers(), ListTuple::notifyObservers(), FitsNTuple::notifyObservers(), XyPlotter::removeDataRep(), FunctionRep::restoreParameters(), DataRep::set(), CutPlotter::setActive(), PlotterBase::setAspectRatio(), XyPlotter::setAutoRanging(), XyPlotter::setBoxEdge(), QtDisplay::setContourLevels(), CutPlotter::setCutColor(), XyPlotter::setCutEnabled(), XyPlotter::setCutInverted(), XyPlotter::setCutRangeAt(), ProjectorBase::setDirty(), DataRep::setErrorDisplay(), XyPlotter::setHighRange(), XyPlotter::setLabel(), PlotterBase::setLabel(), DataSource::setLabelAt(), DataSource::setLabels(), XyPlotter::setLowRange(), DataSource::setName(), DisplayController::setNTuple(), FunctionRep::setParameters(), DyHistogramEqualEntries::setPointRep(), DyHistogram::setPointRep(), DataRep::setPointRep(), TextPlotter::setRepColor(), DataRep::setRepColor(), DataRep::setRepSize(), DataRep::setRepStyle(), XyPlotter::setReverse(), XyPlotter::setScaling(), XyPlotter::setShowGrid(), 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(), PlotterBase::~PlotterBase(), RootNTuple::~RootNTuple(), and RTuple::~RTuple().
Range preferredRange | ( | Axes::Type | ) | const [virtual, inherited] |
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, Hist2DProjImp, MapMatrixProjector, and MeshProjector.
Definition at line 163 of file ProjectorBase.cxx.
References ProjectorBase::dataRangeOn(), Range::length(), Range::low(), Range::setHigh(), Range::setLow(), and hippodraw::Axes::Y.
Referenced by MeshProjector::preferredRange(), MapMatrixProjector::preferredRange(), and DataRep::preferredRange().
void 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 from ProjectorBase.
Definition at line 169 of file LineProjector.cxx.
References LineProjector::createNTuple(), LineProjector::fillProjectedValues(), ProjectorBase::m_proj_values, and ProjectorBase::setDirty().
void removeObserver | ( | Observer * | ) | [inherited] |
Removes an Observer from the Observer list.
Definition at line 66 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 reset | ( | ) | [virtual, inherited] |
Resets the bins.
This interface is for the StHist1DProjector
Reimplemented in BinningProjector, Hist1DProjImp, and StHist1DProjector.
Definition at line 262 of file ProjectorBase.cxx.
void setAxisBinding | ( | const std::string & | axis, | |
const std::string & | label | |||
) | [virtual, inherited] |
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 setAxisBindings | ( | const std::vector< std::string > & | bindings | ) | [virtual, inherited] |
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 setAxisModel | ( | Axes::Type | axis, | |
AxisModelBase * | ||||
) | [virtual, inherited] |
Sets the AxisModel for axis axis.
Reimplemented in BinningProjector.
Definition at line 192 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 DataRep::setAxisModel(), and BinningProjector::setAxisModel().
const Range & setBinWidth | ( | Axes::Type | axis, | |
int | parm, | |||
bool | dragging | |||
) | [virtual, inherited] |
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, EqualEntriesHist1DProjector, and Profile2DProjector.
Definition at line 242 of file ProjectorBase.cxx.
References ProjectorBase::getRange(), and ProjectorBase::m_x_axis.
const Range & setBinWidth | ( | Axes::Type | axis, | |
double | width | |||
) | [virtual, inherited] |
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, EqualEntriesHist1DProjector, Hist2DProjImp, MapMatrixProjector, and Profile2DProjector.
Definition at line 234 of file ProjectorBase.cxx.
void setDirty | ( | bool | value = true |
) | [virtual, inherited] |
Sets the dirty flag to value.
Definition at line 75 of file ProjectorBase.cxx.
References ProjectorBase::m_isDirty, and Observable::notifyObservers().
Referenced by StHist2DProjector::addValues(), StHist1DProjector::addValues(), Profile2DProjector::dataRangeOn(), FunctionProjector::fitFunction(), StHist2DProjector::getAverage(), StHist1DProjector::getAverage(), BinningProjector::normalize(), ProjectorBase::prepareValues(), MeshProjector::prepareValues(), MapMatrixProjector::prepareValues(), Map3Projector::prepareValues(), Map2Projector::prepareValues(), Map1Projector::prepareValues(), LineProjector::prepareValues(), EqualEntriesHist1DProjector::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(), EqualEntriesHist1DProjector::setBinWidth(), BinningProjector::setBinWidth(), DataRep::setDirty(), BinningProjector::setMinEntries(), NTupleProjector::setNTuple(), MapMatrixProjector::setNTuple(), Profile2DProjector::setOffset(), Hist2DProjImp::setOffset(), DyHist2DProjector::setOffset(), BinningProjector::setOffset(), FunctionProjector::setParameters(), ProjectorBase::setRange(), Profile2DProjector::setRange(), FunctionProjector::setRange(), NTupleProjector::update(), and BinningProjector::willDelete().
void setMinEntries | ( | int | entries | ) | [virtual, inherited] |
Set the minimum entries/bin.
Reimplemented in BinningProjector.
Definition at line 525 of file ProjectorBase.cxx.
void setNormalizing | ( | bool | on | ) | [virtual, inherited] |
Sets the scaling number of entries on if on is true
, otherwise turns if off.
Reimplemented in BinningProjector.
Definition at line 395 of file ProjectorBase.cxx.
void setNumberOfBins | ( | Axes::Type | axis, | |
unsigned int | number | |||
) | [virtual, inherited] |
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 228 of file ProjectorBase.cxx.
void setOffset | ( | Axes::Type | axis, | |
double | offset | |||
) | [virtual, inherited] |
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 256 of file ProjectorBase.cxx.
void setOffset | ( | const std::string & | axis, | |
int | parm, | |||
bool | dragging | |||
) | [virtual, inherited] |
Sets the bin offset.
Reimplemented in BinningProjector, DyHist2DProjector, and Profile2DProjector.
Definition at line 248 of file ProjectorBase.cxx.
Referenced by DisplayController::setOffset().
void setRange | ( | Axes::Type | axis, | |
bool | const_width = true | |||
) | [virtual, inherited] |
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 ProjectorBase::m_z_axis, ProjectorBase::setDirty(), hippodraw::Axes::X, hippodraw::Axes::Y, and hippodraw::Axes::Z.
Referenced by DataRep::setRange().
void setValue | ( | double | value | ) |
Sets the value that will be projected.
Definition at line 225 of file LineProjector.cxx.
References LineProjector::m_value.
void update | ( | const Observable * | ) | [virtual, inherited] |
Implements the Observer pattern.
The implementation in this abstract base class does nothing. Derived class may override this method if they are observers.
Implements Observer.
Reimplemented in BinningProjector, DyHist1DProjector, DyHist2DProjector, NTupleProjector, Profile2DProjector, and ProfileProjector.
Definition at line 402 of file ProjectorBase.cxx.
Range valueRange | ( | ) | const [virtual] |
Finds the range of the projected values.
It is up to derived classes to determine what this means.
Implements ProjectorBase.
Definition at line 93 of file LineProjector.cxx.
References ProjectorBase::getRange(), LineProjector::m_axis, ProjectorBase::m_x_axis, ProjectorBase::m_y_axis, and hippodraw::Axes::X.
bool wantsScaleFactor | ( | const std::string & | axis | ) | const [virtual, inherited] |
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 364 of file ProjectorBase.cxx.
Referenced by CompositePlotter::checkAxisScaling().
void 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, ViewBase, CutPlotter, TextPlotter, BinningProjector, DyHist1DProjector, DyHist2DProjector, NTupleProjector, Profile2DProjector, ProfileProjector, and RootController.
Definition at line 25 of file Observer.cxx.
Referenced by DataRep::~DataRep(), DataSource::~DataSource(), NTuple::~NTuple(), PlotterBase::~PlotterBase(), RootNTuple::~RootNTuple(), and RTuple::~RTuple().
hippodraw::Axes::Type m_axis [private] |
The axis for the value.
Definition at line 38 of file LineProjector.h.
Referenced by LineProjector::dataRangeOn(), LineProjector::fillProjectedValues(), LineProjector::getPosOn(), and LineProjector::valueRange().
std::vector< std::string > m_pointreps [protected, inherited] |
Vector of acceptable PointReps.
Definition at line 104 of file ProjectorBase.h.
Referenced by StripChartProjector::addPointReps(), ProfileProjector::addPointReps(), Profile2DProjector::addPointReps(), MeshProjector::addPointReps(), MapMatrixProjector::addPointReps(), Map3Projector::addPointReps(), Map2Projector::addPointReps(), Map1Projector::addPointReps(), Hist2DProjImp::addPointReps(), Hist1DProjImp::addPointReps(), EqualEntriesHist1DProjector::addPointReps(), and ProjectorBase::getPointReps().
DataSource* m_proj_values [protected, inherited] |
The NTuple representing the result of the projection.
Definition at line 80 of file ProjectorBase.h.
Referenced by BinningProjector::BinningProjector(), ProfileProjector::dataRangeOn(), Profile2DProjector::dataRangeOn(), MeshProjector::dataRangeOnValue(), MapMatrixProjector::dataRangeOnValue(), Hist2DProjImp::dataRangeOnValue(), Hist1DProjImp::dataRangeOnValue(), EqualEntriesHist1DProjector::dataRangeOnValue(), DyHist1DProjector::getAverage(), ProfileProjector::getPosOn(), ProjectorBase::getProjectedValues(), MeshProjector::getZLabel(), MeshProjector::getZValue(), Map3Projector::getZValue(), MeshProjector::prepareValues(), MapMatrixProjector::prepareValues(), Map3Projector::prepareValues(), Map2Projector::prepareValues(), Map1Projector::prepareValues(), LineProjector::prepareValues(), EqualEntriesHist1DProjector::prepareValues(), BinningProjector::prepareValues(), BinningProjector::setBinner(), and ProjectorBase::~ProjectorBase().
const ProjectorBase* m_target [protected, inherited] |
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 110 of file ProjectorBase.h.
Referenced by BinningProjector::normalize(), BinningProjector::normalizeTo(), BinningProjector::update(), and BinningProjector::willDelete().
std::string m_title [private] |
A label for the line.
Definition at line 42 of file LineProjector.h.
Referenced by LineProjector::getTitle(), LineProjector::getXLabel(), and LineProjector::getYLabel().
double m_value [private] |
The value represented.
Definition at line 34 of file LineProjector.h.
Referenced by LineProjector::dataRangeOn(), LineProjector::fillProjectedValues(), LineProjector::getPosOn(), and LineProjector::setValue().
AxisModelBase* m_x_axis [protected, inherited] |
The AxisModel
along the X axis.
All Projectors
have at least an X axis and maybe additional ones.
Definition at line 88 of file ProjectorBase.h.
Referenced by LineProjector::dataRangeOn(), FunctionProjector::dataRangeOn(), LineProjector::fillProjectedValues(), ProjectorBase::getAxisModel(), LineProjector::getPosOn(), ProjectorBase::getRange(), Map3Projector::getZValue(), NTupleProjector::inRange(), Map1Projector::inRange(), MeshProjector::inRangeWithZ(), MapMatrixProjector::inRangeWithZ(), ProjectorBase::setAxisModel(), ProjectorBase::setBinWidth(), Profile2DProjector::setOffset(), Hist2DProjImp::setOffset(), BinningProjector::setOffset(), ProfileProjector::setRange(), Profile2DProjector::setRange(), Hist2DProjImp::setRange(), Hist1DProjImp::setRange(), and LineProjector::valueRange().
AxisModelBase* m_y_axis [protected, inherited] |
The AxisModel
along the Y axis.
All Projectors
have at least a Y axis and maybe additional ones.
Definition at line 92 of file ProjectorBase.h.
Referenced by Hist1DProjImp::checkScaling(), LineProjector::dataRangeOn(), FunctionProjector::dataRangeOn(), LineProjector::fillProjectedValues(), StHist1DProjector::getAverage(), DyHist1DProjector::getAverage(), ProjectorBase::getAxisModel(), LineProjector::getPosOn(), ProjectorBase::getRange(), DyHist1DProjector::getYLabel(), Map3Projector::getZValue(), NTupleProjector::inRange(), Map1Projector::inRange(), MeshProjector::inRangeWithZ(), MapMatrixProjector::inRangeWithZ(), ProjectorBase::setAxisModel(), Profile2DProjector::setOffset(), Hist2DProjImp::setOffset(), Profile2DProjector::setRange(), Hist2DProjImp::setRange(), and LineProjector::valueRange().
AxisModelBase* m_z_axis [protected, inherited] |
The AxisModel
along the Z axis.
May not be used by all Projectors.
Definition at line 96 of file ProjectorBase.h.
Referenced by Hist2DProjImp::checkScaling(), FunctionProjector::dataRangeOn(), StHist2DProjector::getAverage(), ProjectorBase::getAxisModel(), ProjectorBase::getRange(), Hist2DProjImp::getZLabel(), NTupleProjector::inRange(), MeshProjector::inRangeWithZ(), MapMatrixProjector::inRangeWithZ(), ProjectorBase::setAxisModel(), and ProjectorBase::setRange().
std::string m_z_label [protected, inherited] |
Dummy member so that getZLabel can return a reference.
Reimplemented in FunctionProjector, and StHist2DProjector.
Definition at line 101 of file ProjectorBase.h.
Referenced by ProjectorBase::getZLabel().
std::vector< double > m_zval [mutable, protected, inherited] |
Sorted Z values in this projector.
Used to export FITS file.
Definition at line 119 of file ProjectorBase.h.
Referenced by ProjectorBase::getZAfterTransform(), and ProjectorBase::getZValues().