LWH::VariAxis Class Reference

An VariAxis represents a binned histogram axis. More...

#include <VariAxis.h>

List of all members.

Public Member Functions

 VariAxis (const std::vector< double > &edges)
 Standard constructor.
 VariAxis (const VariAxis &a)
 Copy constructor.
virtual ~VariAxis ()
 Destructor.
bool isFixedBinning () const
 Check if the IAxis has fixed binning, i.e.
double lowerEdge () const
 Get the lower edge of the IAxis.
double upperEdge () const
 Get the upper edge of the IAxis.
int bins () const
 The number of bins (excluding underflow and overflow) on the IAxis.
std::pair< double, double > binEdges (int index) const
 Get the lower edge of the specified bin.
double binLowerEdge (int index) const
 Get the lower edge of the specified bin.
double binUpperEdge (int index) const
 Get the upper edge of the specified bin.
double binWidth (int index) const
 Get the width of the specified bin.
int coordToIndex (double coord) const
 Convert a coordinate on the axis to a bin number.
double binMidPoint (int index) const
 Return the midpoint of the specified bin.

Private Attributes

std::map< double, int > binco
 A map relating the lower edge of a bin to the corresponding bin number.


Detailed Description

An VariAxis represents a binned histogram axis.

A 1D Histogram would have one VariAxis representing the X axis, while a 2D Histogram would have two axes representing the X and Y VariAxis.

Definition at line 31 of file VariAxis.h.


Member Function Documentation

bool LWH::VariAxis::isFixedBinning (  )  const [inline]

Check if the IAxis has fixed binning, i.e.

if all the bins have the same width.

Returns:
true if the binning is fixed, false otherwise.

Definition at line 59 of file VariAxis.h.

double LWH::VariAxis::lowerEdge (  )  const [inline]

Get the lower edge of the IAxis.

Returns:
The IAxis's lower edge.

Definition at line 66 of file VariAxis.h.

References binco.

double LWH::VariAxis::upperEdge (  )  const [inline]

Get the upper edge of the IAxis.

Returns:
The IAxis's upper edge.

Definition at line 76 of file VariAxis.h.

References binco.

int LWH::VariAxis::bins (  )  const [inline]

The number of bins (excluding underflow and overflow) on the IAxis.

Returns:
The IAxis's number of bins.

Definition at line 87 of file VariAxis.h.

References binco.

std::pair<double,double> LWH::VariAxis::binEdges ( int  index  )  const [inline]

Get the lower edge of the specified bin.

Parameters:
index The bin number: 0 to bins()-1 for the in-range bins or OVERFLOW or UNDERFLOW.
Returns:
The lower edge of the corresponding bin; for the underflow bin this is Double.NEGATIVE_INFINITY.

Definition at line 97 of file VariAxis.h.

References binco.

Referenced by binLowerEdge(), binMidPoint(), binUpperEdge(), and binWidth().

double LWH::VariAxis::binLowerEdge ( int  index  )  const [inline]

Get the lower edge of the specified bin.

Parameters:
index The bin number: 0 to bins()-1 for the in-range bins or OVERFLOW or UNDERFLOW.
Returns:
The lower edge of the corresponding bin; for the underflow bin this is Double.NEGATIVE_INFINITY.

Definition at line 118 of file VariAxis.h.

References binEdges().

double LWH::VariAxis::binUpperEdge ( int  index  )  const [inline]

Get the upper edge of the specified bin.

Parameters:
index The bin number: 0 to bins()-1 for the in-range bins or OVERFLOW or UNDERFLOW.
Returns:
The upper edge of the corresponding bin; for the overflow bin this is Double.POSITIVE_INFINITY.

Definition at line 130 of file VariAxis.h.

References binEdges().

double LWH::VariAxis::binWidth ( int  index  )  const [inline]

Get the width of the specified bin.

Parameters:
index The bin number: 0 to bins()-1) for the in-range bins or OVERFLOW or UNDERFLOW.
Returns:
The width of the corresponding bin.

Definition at line 141 of file VariAxis.h.

References binEdges().

int LWH::VariAxis::coordToIndex ( double  coord  )  const [inline]

Convert a coordinate on the axis to a bin number.

If the coordinate is less than the lowerEdge UNDERFLOW is returned; if the coordinate is greater or equal to the upperEdge OVERFLOW is returned.

Parameters:
coord The coordinate to be converted.
Returns:
The corresponding bin number.

Definition at line 155 of file VariAxis.h.

References binco.

double LWH::VariAxis::binMidPoint ( int  index  )  const [inline]

Return the midpoint of the specified bin.

No checking is performed to ensure the argument is a valid bin.

Definition at line 166 of file VariAxis.h.

References binEdges().

Referenced by LWH::Histogram1D::binMean().


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

Generated on Thu Apr 29 12:42:56 2010 for ThePEG by  doxygen 1.5.5