Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Private Attributes | List of all members
StHist2DProjector Class Reference

A derived class of ProjectorBase that projects data accumulated by calls to its addValues function into a two dimensional histogram. More...

#include <StHist2DProjector.h>

Inheritance diagram for StHist2DProjector:
Inheritance graph
[legend]
Collaboration diagram for StHist2DProjector:
Collaboration graph
[legend]

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 addValues (const std::vector< double > &v)
 Add the values to the histogram.
ProjectorBaseclone ()
 The clone function returns an object of its own kind which is a copy of this object at this moment.
virtual DataSourcecreateNTuple () const
 Returns an data source representing the binned values.
virtual NTuplecreateNTupleWith (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 DataSourcecreateOldStyleNTuple () const
virtual Range dataRangeOn (hippodraw::Axes::Type axis) const
 Returns the range of the data on a specified axis.
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 (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 (Axes::Type axis) const
 Get the AxisModel for axis axis.
const BinsBasegetBinner () 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 int getMinEntries ()
 Get the minimum entries/bin.
virtual NTuplegetNTupleAfterCuts () 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
 Returns the total number of entries that went into creating the projected values.
const ObserverList_tgetObservers () const
 Returns the list of observers.
double getOffset (hippodraw::Axes::Type axis) const
 Returns the offset of the axis.
virtual 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 axis) const
 Returns the minimum positive value of the data on a specified axis.
const DataSourcegetProjectedValues () const
 Returns DataSource representation of projected values.
virtual const RangegetRange (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.
virtual int getUnderflow () const
 Returns the number of underflow.
const std::string & getXLabel () const
 Returns the label (title) of the X axis.
const std::string & getYLabel (bool flag=false) const
 Returns the label (title) of the Y axis.
const std::vector< double > & getZAfterTransform (TransformBase *transform)
 Return Z values after binary transform.
const std::string & getZLabel (bool flag=false) const
 Returns the label for the Z axis.
const std::string & getZLabel () const
 Returns the label (title) of the z axis.
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 bool hasZAxis () const
 A test function.
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 the intended axis is "X", otherwise returns false.
bool isDirty () const
 Returns true if the projector has been marked dirty.
bool isEmpty () const
 Returns false as this class' data source is never empty even if no filling has occurred yet.
virtual bool isImageConvertable () const
 Returns true if projected values are convertable to image.
virtual bool isValueBinned () const
 Returns true as the projected value is the result of accumulation into bins.
virtual void matrixTranspose (bool yes)
 Transposes the X and Y axis.
virtual void normalize ()
 Normalizes the projector to its target.
virtual void normalizeTo (double number)
 Sets a scale factor on the output so that the number of entries appears to be number.
virtual void normalizeTo (const ProjectorBase *target)
 Normalize the output of the receiving object's projected values to that of target.
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 (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)
 Sets the Range of the binner.
virtual const RangesetBinWidth (hippodraw::Axes::Type axis, int parm, bool dragging)
 Sets the bin width.
virtual const RangesetBinWidth (hippodraw::Axes::Type axis, double v)
 This function sets the binWidth.
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 (const std::string &axis, int parm, bool dragging)
 Sets the bin offset.
virtual void setOffset (hippodraw::Axes::Type axis, double v)
 Sets the bin offset.
virtual void setRange (hippodraw::Axes::Type axis, bool)
 Sets the range of the selected axis.
void setYLabel ()
 Sets the Y axis label.
 StHist2DProjector ()
 The default constructor.
 StHist2DProjector (const StHist2DProjector &projector)
 The copy constructor.
virtual void update (const Observable *object)
 Updates the receiving projector.
virtual Range valueRange () const
 Finds the range of the projected values.
virtual bool wantsScaleFactor (const std::string &axis) const
 Returns true if axis is the Z axis.
virtual void willDelete (const Observable *object)
 If object is the target of normalization, removes the target and sets normalization off.

Protected Member Functions

virtual void addPointReps ()
 Function to add the acceptable point reps.
virtual void checkScaling ()
 Checks the axis scaling.
Range dataRangeOnValue () const
 Returns the data range on the Z axis.
virtual void execute ()
 Provides the all the data to the binner.
virtual void fillDataSource (DataSource *ntuple, bool in_range=false) const
double getPosOnValue () const
 Returns the smallest positive value on the Y axis.
void notifyObservers (Action action) const
 An internal method to iterate over all observers and to send the message action.
void setZLabel ()
 Sets the variable so that it can be modified.

Protected Attributes

BinsBasem_binner
 The binner object.
std::vector< std::string > m_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::vector< double > m_zval
 Sorted Z values in this projector.

Private Attributes

std::string m_title
 The title of the histogram.
std::string m_x_label
 The label of the x axis.
std::string m_y_label
 The label of the y axis.
std::string m_z_label
 The label of the y axis.

Detailed Description

A derived class of ProjectorBase that projects data accumulated by calls to its addValues function into a two dimensional histogram.

A DataSource is created and presented to a clients. The binning parameters are fixed hence it is called static 2D histogram.

Author
Paul_.nosp@m.Kunz.nosp@m.@slac.nosp@m..sta.nosp@m.nford.nosp@m..edu>

Definition at line 29 of file StHist2DProjector.h.

Member Typedef Documentation

typedef void( Observer::* Action)(const Observable *)
inherited

The member function of the Observer that is called.

Definition at line 86 of file Observable.h.

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.

Constructor & Destructor Documentation

The default constructor.

Definition at line 44 of file StHist2DProjector.cxx.

References StHist2DProjector::m_z_label.

Referenced by StHist2DProjector::clone().

StHist2DProjector ( const StHist2DProjector projector)

The copy constructor.

Todo:
Extra data members need to be copied.
Note
Must initialize with the copy constructor of ProjectorBase here, otherise the default constructor will be used. This is because it is a virtual base class of the inherited classes.

Definition at line 56 of file StHist2DProjector.cxx.

Member Function Documentation

void addObserver ( hippodraw::Observer observer)
inherited
void addPointReps ( )
protectedvirtualinherited

Function to add the acceptable point reps.

Implements ProjectorBase.

Definition at line 218 of file Hist2DProjImp.cxx.

References ProjectorBase::m_pointreps.

Referenced by Hist2DProjImp::Hist2DProjImp().

void addValues ( const std::vector< double > &  v)
virtual

Add the values to the histogram.

The first two elements of the vector is the value to be accumulated into the histogram. If the size of the vector is 3, then the third element is the weight, otherwise the weight is 1.0.

Reimplemented from ProjectorBase.

Definition at line 210 of file StHist2DProjector.cxx.

References BinningProjector::m_binner, Observable::notifyObservers(), and ProjectorBase::setDirty().

void checkScaling ( )
protectedvirtualinherited

Checks the axis scaling.

If bins are all same width, then sets the Z axis scale factor. Otherwise, turns off the scale factor on the Z axis.

Reimplemented from BinningProjector.

Definition at line 202 of file Hist2DProjImp.cxx.

References BinsBase::hasEqualWidths(), BinningProjector::m_binner, ProjectorBase::m_z_axis, BinsBase::scaleFactor(), AxisModelBase::setScaleFactor(), and AxisModelBase::setScaling().

Referenced by DyHist2DProjector::setBinnerRange(), StHist2DProjector::setBinnerRange(), and Hist2DProjImp::setBinWidth().

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 66 of file StHist2DProjector.cxx.

References StHist2DProjector::StHist2DProjector().

DataSource * createNTuple ( ) const
virtualinherited

Returns an data source representing the binned values.

Implements ProjectorBase.

Definition at line 233 of file BinningProjector.cxx.

References BinsBase::createNTuple(), and BinningProjector::m_binner.

Referenced by BinningProjector::BinningProjector(), and BinningProjector::setBinner().

NTuple * createNTupleWith ( const std::vector< TupleCut > &  cut_list) const
virtualinherited

Creates a NTuple from the projector's DataSource object using cut_list for not including rows that do not pass the cuts.

Note
This base class implementation returns a null pointer.

Reimplemented in NTupleProjector.

Definition at line 356 of file ProjectorBase.cxx.

const DataSource * createOldStyleNTuple ( ) const
virtualinherited
Range dataRangeOn ( hippodraw::Axes::Type  axis) const
virtual

Returns the range of the data on a specified axis.

For the X axis, it returns the range of the data. For the Y axis, it returns the range of the binned data.

Todo:
Implement special handling if histogram is empty.

Implements ProjectorBase.

Definition at line 94 of file StHist2DProjector.cxx.

References Hist2DProjImp::dataRangeOnValue(), BinsBase::getRange(), BinningProjector::m_binner, hippodraw::Axes::X, hippodraw::Axes::Y, and hippodraw::Axes::Z.

Range dataRangeOnValue ( ) const
protectedinherited
void execute ( )
protectedvirtualinherited

Provides the all the data to the binner.

Todo:
Is there away to avoid implementing this empty method.

Reimplemented in DyHist2DProjector, Profile2DProjector, DyHist1DProjector, and ProfileProjector.

Definition at line 217 of file BinningProjector.cxx.

Referenced by BinningProjector::prepareValues().

void fillColumnAfterCuts ( const std::string &  column,
std::vector< double > &  columnData 
) const
virtualinherited

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 fillDataSource ( DataSource ntuple,
bool  in_range = false 
) const
protectedvirtualinherited
double getAverage ( hippodraw::Axes::Type  axis) const
virtual
const vector< string > & getAxisBindings ( ) const
virtualinherited

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 VariableMesh::setAxisBindings(), and XYPlot::setAxisBindings().

AxisModelBase * getAxisModel ( Axes::Type  axis) const
virtualinherited
const BinsBase * getBinner ( ) const
inherited

Returns reference to BinsBase object used by this projector.

Definition at line 80 of file BinningProjector.cxx.

References BinningProjector::m_binner.

Referenced by BinningProjectorXML::createChildren().

double getBinWidth ( hippodraw::Axes::Type  axis) const
virtualinherited

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 203 of file BinningProjector.cxx.

References BinsBase::binWidth(), BinningProjector::m_binner, BinningProjector::m_binner_dim, hippodraw::Axes::X, hippodraw::Axes::Y, and hippodraw::Axes::Z.

int getMinEntries ( )
virtualinherited

Get the minimum entries/bin.

Reimplemented from ProjectorBase.

Definition at line 334 of file BinningProjector.cxx.

References BinningProjector::m_binner.

NTuple * getNTupleAfterCuts ( ) const
virtualinherited

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 ( hippodraw::Axes::Type  axis) const
virtualinherited

Returns the number of bins.

Returns number of bins if axis is binned, otherwise returns 0.

Reimplemented from ProjectorBase.

Definition at line 116 of file BinningProjector.cxx.

References BinningProjector::m_binner, BinningProjector::m_binner_dim, BinsBase::numberOfBins(), hippodraw::Axes::X, and hippodraw::Axes::Y.

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 187 of file StHist2DProjector.cxx.

References BinsBase::getNumberOfEntries(), and BinningProjector::m_binner.

const Observable::ObserverList_t & getObservers ( ) const
inherited

Returns the list of observers.

Definition at line 60 of file Observable.cxx.

double getOffset ( hippodraw::Axes::Type  axis) const
virtualinherited

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 188 of file BinningProjector.cxx.

References BinsBase::getOffset(), BinningProjector::m_binner, BinningProjector::m_binner_dim, hippodraw::Axes::X, hippodraw::Axes::Y, and hippodraw::Axes::Z.

int getOverflow ( ) const
virtual

Returns the number of overflow.

Implements ProjectorBase.

Definition at line 203 of file StHist2DProjector.cxx.

References BinsBase::getOverflow(), and BinningProjector::m_binner.

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  axis) const
virtual

Returns the minimum positive value of the data on a specified axis.

Implements ProjectorBase.

Definition at line 85 of file StHist2DProjector.cxx.

References Hist2DProjImp::getPosOnValue(), hippodraw::Axes::X, hippodraw::Axes::Y, and hippodraw::Axes::Z.

double getPosOnValue ( ) const
protectedinherited

Returns the smallest positive value on the Y axis.

Definition at line 86 of file Hist2DProjImp.cxx.

References Hist2DProjImp::dataRangeOnValue(), and Range::pos().

Referenced by StHist2DProjector::getPosOn().

const DataSource * getProjectedValues ( ) const
inherited
const Range & getRange ( Axes::Type  axis) const
virtualinherited
double getRMS ( Axes::Type  axis)
virtualinherited

Returns the RMS.

Returns the root mean square of the data points along the axis axis.

Requests:
Can do better than use only the projected values in some derived classes.

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 180 of file StHist2DProjector.cxx.

References StHist2DProjector::m_title.

int getUnderflow ( ) const
virtual

Returns the number of underflow.

Implements ProjectorBase.

Definition at line 196 of file StHist2DProjector.cxx.

References BinsBase::getUnderflow(), and BinningProjector::m_binner.

const string & getXLabel ( ) const
virtual

Returns the label (title) of the X axis.

Implements ProjectorBase.

Definition at line 108 of file StHist2DProjector.cxx.

References StHist2DProjector::m_x_label.

const string & getYLabel ( bool  flag = false) const
virtual

Returns the label (title) of the Y axis.

The argument flag is ignored.

Implements ProjectorBase.

Definition at line 113 of file StHist2DProjector.cxx.

References StHist2DProjector::m_y_label.

const std::vector< double > & getZAfterTransform ( TransformBase transform)
inherited

Return Z values after binary transform.

Todo:
This is the only method in all the classes of this directory that needs a heder file from transform directory. Is there a better way?

Definition at line 456 of file ProjectorBase.cxx.

References ProjectorBase::getZValue(), BinaryTransform::inverseTransform(), and ProjectorBase::m_zval.

const string & getZLabel ( bool  flag = false) const

Returns the label for the Z axis.

Returns the label for the Z axis. The argument @ flag is ignored.

Definition at line 118 of file StHist2DProjector.cxx.

References StHist2DProjector::m_z_label.

const string & getZLabel ( ) const
virtualinherited

Returns the label (title) of the z axis.

Reimplemented from ProjectorBase.

Definition at line 189 of file Hist2DProjImp.cxx.

References AxisModelBase::isScaling(), ProjectorBase::m_z_axis, Hist2DProjImp::m_z_label_density, and Hist2DProjImp::m_z_label_entries.

double getZValue ( double  x,
double  y 
) const
virtualinherited

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

Reimplemented from ProjectorBase.

Definition at line 226 of file BinningProjector.cxx.

References BinsBase::getZValue(), and BinningProjector::m_binner.

const std::vector< double > & getZValues ( )
inherited
bool hasDataSourceBindings ( ) const
virtualinherited

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

bool hasZAxis ( ) const
virtualinherited

A test function.

Definition at line 197 of file Hist2DProjImp.cxx.

int indexOf ( const std::string &  label) const
virtualinherited

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

Returns true if the intended axis is "X", otherwise returns false.

Todo:
This method could have common implementation with DyHist2DProjector if the static projector initialized it binding options even thought they do not bind to NTuple.

Reimplemented from ProjectorBase.

Definition at line 75 of file StHist2DProjector.cxx.

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(), Map2Projector::prepareValues(), MeshProjector::prepareValues(), BinningProjector::prepareValues(), MapMatrixProjector::prepareValues(), and Profile2DProjector::valueRange().

bool isEmpty ( ) const
virtual

Returns false as this class' data source is never empty even if no filling has occurred yet.

Implements ProjectorBase.

Definition at line 224 of file StHist2DProjector.cxx.

Referenced by StHist2DProjector::setBinnerRange().

bool isImageConvertable ( ) const
virtualinherited

Returns true if projected values are convertable to image.

Returns true if number of binned axis is equal to two and if bins have equal widths on both axes, otherwise returns false.

Requests:
Allow axis to be on log scale, but this will require generating the X and Y coordinates for the image.

Reimplemented from ProjectorBase.

Definition at line 341 of file BinningProjector.cxx.

References BinningProjector::m_binner, and BinningProjector::m_binner_dim.

bool isValueBinned ( ) const
virtualinherited

Returns true as the projected value is the result of accumulation into bins.

Reimplemented from ProjectorBase.

Definition at line 79 of file Hist2DProjImp.cxx.

void matrixTranspose ( bool  yes)
virtualinherited

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 normalize ( )
virtualinherited
void normalizeTo ( double  number)
virtualinherited

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 from ProjectorBase.

Definition at line 247 of file BinningProjector.cxx.

References BinningProjector::m_binner.

Referenced by BinningProjector::normalize().

void normalizeTo ( const ProjectorBase target)
virtualinherited

Normalize the output of the receiving object's projected values to that of target.

Bug:
Only works if target projector is binning projector

Reimplemented from ProjectorBase.

Definition at line 263 of file BinningProjector.cxx.

References Observable::addObserver(), ProjectorBase::isValueBinned(), ProjectorBase::m_target, BinningProjector::normalize(), Observable::removeObserver(), and BinningProjector::setNormalizing().

void notifyObservers ( ) const
virtualinherited

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, RootNTuple, NumArrayTuple, ListTuple, and FitsNTuple.

Definition at line 93 of file Observable.cxx.

References Observer::update().

Referenced by XyPlotter::addDataRep(), XyPlotter::addDataRepStacked(), FunctionController::addFunctionRep(), StHist1DProjector::addValues(), StHist2DProjector::addValues(), XyPlotter::autoScale(), Inspector::contourLevelsTextBox_returnPressed(), Inspector::contourSlider_valueChanged(), Inspector::contourTextBox_returnPressed(), FunctionRep::fitFunction(), 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(), PlotterBase::setLabel(), XyPlotter::setLabel(), DataSource::setLabelAt(), DataSource::setLabels(), XyPlotter::setLowRange(), DataSource::setName(), DisplayController::setNTuple(), FunctionRep::setParameters(), DyHistogram::setPointRep(), DyHistogramEqualEntries::setPointRep(), DataRep::setPointRep(), TextPlotter::setRepColor(), DataRep::setRepColor(), DataRep::setRepSize(), DataRep::setRepStyle(), XyPlotter::setReverse(), XyPlotter::setScaling(), XyPlotter::setShowGrid(), DataSource::setTitle(), PlotterBase::setTitle(), XyPlotter::setTransform(), XyPlotter::setValueRep(), NTupleProjector::update(), BinningProjector::update(), DataRep::update(), PlotterBase::update(), CutPlotter::update(), CutPlotter::updateTargets(), DataRep::~DataRep(), DataSource::~DataSource(), PlotterBase::~PlotterBase(), and RTuple::~RTuple().

void notifyObservers ( Action  action) const
protectedinherited

An internal method to iterate over all observers and to send the message action.

Definition at line 72 of file Observable.cxx.

Range preferredRange ( hippodraw::Axes::Type  axis) const
virtualinherited

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 from ProjectorBase.

Definition at line 96 of file Hist2DProjImp.cxx.

References ProjectorBase::dataRangeOn(), Range::setLow(), and hippodraw::Axes::Z.

void prepareValues ( )
virtualinherited
void removeObserver ( hippodraw::Observer observer)
inherited
void reset ( )
virtualinherited

Resets the bins.

This interface is for the StHist1DProjector

Reimplemented from ProjectorBase.

Reimplemented in StHist1DProjector, and Hist1DProjImp.

Definition at line 182 of file BinningProjector.cxx.

void setAxisBinding ( const std::string &  axis,
const std::string &  label 
)
virtualinherited

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)
virtualinherited

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 ( hippodraw::Axes::Type  axis,
AxisModelBase axis_model 
)
virtualinherited

Sets the AxisModel for axis axis.

Reimplemented from ProjectorBase.

Definition at line 62 of file BinningProjector.cxx.

References BinningProjector::checkScaling().

void setBinContents ( const DataSource source)
inherited

Sets the contents of the bins from the data source.

Note
This method should be called for derived classes which are static version of projection. If called on a dynamic version, the contents of the bins will be refreshed from the data source with which it is bound.

Definition at line 319 of file BinningProjector.cxx.

References BinningProjector::m_binner.

void setBinner ( BinsBase bins)
inherited

Sets the BinsBase object to be used by this projector.

Definition at line 87 of file BinningProjector.cxx.

References BinningProjector::createNTuple(), BinningProjector::m_binner, and ProjectorBase::m_proj_values.

Referenced by BinningProjectorXML::getObject().

void setBinnerOn ( BinnerAxis binner,
hippodraw::Axes::Type  axis 
)
virtualinherited
void setBinnerRange ( hippodraw::Axes::Type  axis,
const Range range,
bool  const_width 
)
virtual

Sets the Range of the binner.

If the BinsBase object is empty, the sets the Range of the BinsBase object for axes axis to range. If const_width is true, the bin width is not changed, otherwise it changes to keep the same number of bins. If the BinsBase object is not empty, does nothing.

Implements BinningProjector.

Definition at line 231 of file StHist2DProjector.cxx.

References Hist2DProjImp::checkScaling(), StHist2DProjector::isEmpty(), BinningProjector::m_binner, ProjectorBase::setDirty(), and Hist2DProjImp::setRange().

const Range & setBinWidth ( hippodraw::Axes::Type  axis,
int  parm,
bool  dragging 
)
virtualinherited

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 from ProjectorBase.

Reimplemented in Profile2DProjector, and DyHist2DProjector.

Definition at line 148 of file BinningProjector.cxx.

References BinsBase::calcBinWidth(), BinningProjector::m_binner, and BinningProjector::setBinWidth().

const Range & setBinWidth ( hippodraw::Axes::Type  axis,
double  v 
)
virtualinherited

This function sets the binWidth.

It is needed when the HippoDraw user wants to manually change the bin size.

Todo:
Protect against an excessive number of bins, which will undoubtedly lead to an excessive drawing time.

Reimplemented from BinningProjector.

Definition at line 155 of file Hist2DProjImp.cxx.

References Hist2DProjImp::checkScaling(), BinningProjector::m_binner, BinsBase::setBinWidth(), ProjectorBase::setDirty(), hippodraw::Axes::X, and hippodraw::Axes::Y.

void setDirty ( bool  value = true)
virtualinherited

Sets the dirty flag to value.

Definition at line 75 of file ProjectorBase.cxx.

References ProjectorBase::m_isDirty, and Observable::notifyObservers().

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

void setMinEntries ( int  entries)
virtualinherited

Set the minimum entries/bin.

Reimplemented from ProjectorBase.

Definition at line 326 of file BinningProjector.cxx.

References BinningProjector::m_binner, and ProjectorBase::setDirty().

void setNormalizing ( bool  on)
virtualinherited

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

Reimplemented from ProjectorBase.

Definition at line 254 of file BinningProjector.cxx.

References BinningProjector::m_binner.

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

void setNumberOfBins ( Axes::Type  axis,
unsigned int  number 
)
virtualinherited

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.

Referenced by CompositePlotter::setNumberOfBins().

void setOffset ( const std::string &  axis,
int  parm,
bool  dragging 
)
virtualinherited

Sets the bin offset.

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

Reimplemented from ProjectorBase.

Reimplemented in Profile2DProjector, and DyHist2DProjector.

Definition at line 157 of file BinningProjector.cxx.

References BinsBase::calcOffset(), BinningProjector::m_binner, ProjectorBase::setDirty(), and hippodraw::Axes::X.

void setOffset ( hippodraw::Axes::Type  axis,
double  offset 
)
virtualinherited

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

Definition at line 169 of file Hist2DProjImp.cxx.

References BinsBase::getRange(), BinningProjector::m_binner, ProjectorBase::m_x_axis, ProjectorBase::m_y_axis, ProjectorBase::setDirty(), BinsBase::setOffset(), AxisModelBase::setRange(), hippodraw::Axes::X, hippodraw::Axes::Y, and hippodraw::Axes::Z.

void setRange ( hippodraw::Axes::Type  axis,
bool  const_width 
)
virtualinherited
void setYLabel ( )

Sets the Y axis label.

void setZLabel ( )
protectedinherited

Sets the variable so that it can be modified.

Definition at line 184 of file Hist2DProjImp.cxx.

References Hist2DProjImp::m_z_label_entries.

void update ( const Observable object)
virtualinherited

Updates the receiving projector.

If the projector is normalizing to a target projector and object is the target, then re-normalizes itself. If not, then notifies its observers.

Reimplemented from ProjectorBase.

Reimplemented in Profile2DProjector, DyHist1DProjector, DyHist2DProjector, and ProfileProjector.

Definition at line 297 of file BinningProjector.cxx.

References ProjectorBase::m_target, BinningProjector::normalize(), and Observable::notifyObservers().

Range valueRange ( ) const
virtualinherited

Finds the range of the projected values.

The range of the accumulated bins is returned.

Implements ProjectorBase.

Definition at line 122 of file Hist2DProjImp.cxx.

References ProjectorBase::dataRangeOn(), and hippodraw::Axes::Z.

Referenced by DyHist2DProjector::getPosOn().

bool wantsScaleFactor ( const std::string &  axis) const
virtualinherited

Returns true if axis is the Z axis.

Reimplemented from ProjectorBase.

Definition at line 227 of file Hist2DProjImp.cxx.

void willDelete ( const Observable object)
virtualinherited

If object is the target of normalization, removes the target and sets normalization off.

Reimplemented from Observer.

Reimplemented in Profile2DProjector, DyHist1DProjector, DyHist2DProjector, and ProfileProjector.

Definition at line 308 of file BinningProjector.cxx.

References ProjectorBase::m_target, ProjectorBase::setDirty(), and BinningProjector::setNormalizing().

Member Data Documentation

BinsBase* m_binner
protectedinherited

The binner object.

Some derived classes need a BinsBase object to accumulate data before the projection can be accomplished. Such classes should create the appropriate type of binner and store a pointer to it here. A null pointer value signals that the derived class projector does not need a binner.

Definition at line 51 of file BinningProjector.h.

Referenced by StHist1DProjector::addValues(), StHist2DProjector::addValues(), BinningProjector::BinningProjector(), ProfileProjector::changedNTuple(), Profile2DProjector::changedNTuple(), DyHist2DProjector::changedNTuple(), DyHist1DProjector::changedNTuple(), Hist2DProjImp::checkScaling(), Hist1DProjImp::checkScaling(), BinningProjector::createNTuple(), StHist1DProjector::dataRangeOn(), StHist2DProjector::dataRangeOn(), ProfileProjector::execute(), DyHist1DProjector::execute(), Profile2DProjector::execute(), DyHist2DProjector::execute(), BinningProjector::fillDataSource(), BinningProjector::getBinner(), BinningProjector::getBinWidth(), BinningProjector::getMinEntries(), BinningProjector::getNumberOfBins(), StHist1DProjector::getNumberOfEntries(), StHist2DProjector::getNumberOfEntries(), BinningProjector::getOffset(), StHist1DProjector::getOverflow(), StHist2DProjector::getOverflow(), DyHist1DProjector::getOverflow(), StHist1DProjector::getUnderflow(), StHist2DProjector::getUnderflow(), DyHist1DProjector::getUnderflow(), BinningProjector::getZValue(), Hist1DProjImp::Hist1DProjImp(), Hist2DProjImp::Hist2DProjImp(), BinningProjector::isImageConvertable(), BinningProjector::normalizeTo(), Profile2DProjector::Profile2DProjector(), ProfileProjector::ProfileProjector(), StHist1DProjector::reset(), BinningProjector::setBinContents(), BinningProjector::setBinner(), BinningProjector::setBinnerOn(), ProfileProjector::setBinnerRange(), DyHist2DProjector::setBinnerRange(), DyHist1DProjector::setBinnerRange(), StHist1DProjector::setBinnerRange(), StHist2DProjector::setBinnerRange(), Profile2DProjector::setBinnerRange(), BinningProjector::setBinWidth(), DyHist2DProjector::setBinWidth(), Hist2DProjImp::setBinWidth(), Profile2DProjector::setBinWidth(), BinningProjector::setMinEntries(), BinningProjector::setNormalizing(), DyHist2DProjector::setOffset(), BinningProjector::setOffset(), Hist2DProjImp::setOffset(), Profile2DProjector::setOffset(), ProfileProjector::setRange(), Hist1DProjImp::setRange(), and BinningProjector::~BinningProjector().

std::vector< std::string > m_pointreps
protectedinherited
DataSource* m_proj_values
protectedinherited
const ProjectorBase* m_target
protectedinherited

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.

Definition at line 110 of file ProjectorBase.h.

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

std::string m_title
private

The title of the histogram.

Definition at line 35 of file StHist2DProjector.h.

Referenced by StHist2DProjector::getTitle().

AxisModelBase* m_x_axis
protectedinherited
std::string m_x_label
private

The label of the x axis.

Definition at line 39 of file StHist2DProjector.h.

Referenced by StHist2DProjector::getXLabel().

AxisModelBase* m_y_axis
protectedinherited
std::string m_y_label
private

The label of the y axis.

Definition at line 43 of file StHist2DProjector.h.

Referenced by StHist2DProjector::getYLabel().

AxisModelBase* m_z_axis
protectedinherited
std::string m_z_label
private

The label of the y axis.

It depends on whether the bin widths are equal or not.

Definition at line 48 of file StHist2DProjector.h.

Referenced by StHist2DProjector::getZLabel(), and StHist2DProjector::StHist2DProjector().

std::vector< double > m_zval
mutableprotectedinherited

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


The documentation for this class was generated from the following files:

Generated for HippoDraw Class Library by doxygen