thepeg is hosted by Hepforge, IPPP Durham
ThePEG 2.3.0
LWH::Axis Class Reference

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

#include <Axis.h>

Inheritance diagram for LWH::Axis:

Public Member Functions

 Axis (int n, double lo, double up)
 Standard constructor.
 
 Axis (const Axis &a)
 Copy constructor.
 
virtual ~Axis ()
 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.
 
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) 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

double lower
 The lower edge.
 
double upper
 The upper edge.
 
int nbins
 The number of bins.
 

Detailed Description

An Axis represents a binned histogram axis.

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

Definition at line 30 of file Axis.h.

Constructor & Destructor Documentation

◆ Axis() [1/2]

LWH::Axis::Axis ( int  n,
double  lo,
double  up 
)
inline

Standard constructor.

Definition at line 37 of file Axis.h.

◆ Axis() [2/2]

LWH::Axis::Axis ( const Axis a)
inline

Copy constructor.

Definition at line 43 of file Axis.h.

◆ ~Axis()

virtual LWH::Axis::~Axis ( )
inlinevirtual

Destructor.

Definition at line 47 of file Axis.h.

Member Function Documentation

◆ binLowerEdge()

double LWH::Axis::binLowerEdge ( int  index) const
inline

Get the lower edge of the specified bin.

Parameters
indexThe 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 86 of file Axis.h.

References binWidth(), lower, and nbins.

◆ binMidPoint()

double LWH::Axis::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 134 of file Axis.h.

References binWidth(), and lower.

Referenced by LWH::Histogram1D::binMean(), LWH::Histogram2D::binMeanX(), and LWH::Histogram2D::binMeanY().

◆ bins()

int LWH::Axis::bins ( ) const
inline

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

Returns
The IAxis's number of bins.

Definition at line 76 of file Axis.h.

References nbins.

Referenced by LWH::HistogramFactory::sliceX().

◆ binUpperEdge()

double LWH::Axis::binUpperEdge ( int  index) const
inline

Get the upper edge of the specified bin.

Parameters
indexThe 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 99 of file Axis.h.

References binWidth(), lower, and nbins.

◆ binWidth()

double LWH::Axis::binWidth ( int  ) const
inline

Get the width of the specified bin.

The argument gives 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 111 of file Axis.h.

References lower, nbins, and upper.

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

◆ coordToIndex()

int LWH::Axis::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
coordThe coordinate to be converted.
Returns
The corresponding bin number.

Definition at line 124 of file Axis.h.

References binWidth(), lower, and upper.

◆ isFixedBinning()

bool LWH::Axis::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 55 of file Axis.h.

◆ lowerEdge()

double LWH::Axis::lowerEdge ( ) const
inline

Get the lower edge of the IAxis.

Returns
The IAxis's lower edge.

Definition at line 62 of file Axis.h.

References lower.

Referenced by LWH::HistogramFactory::sliceX().

◆ upperEdge()

double LWH::Axis::upperEdge ( ) const
inline

Get the upper edge of the IAxis.

Returns
The IAxis's upper edge.

Definition at line 69 of file Axis.h.

References upper.

Referenced by LWH::HistogramFactory::sliceX().

Member Data Documentation

◆ lower

double LWH::Axis::lower
private

The lower edge.

Definition at line 141 of file Axis.h.

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

◆ nbins

int LWH::Axis::nbins
private

The number of bins.

Definition at line 147 of file Axis.h.

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

◆ upper

double LWH::Axis::upper
private

The upper edge.

Definition at line 144 of file Axis.h.

Referenced by binWidth(), coordToIndex(), and upperEdge().


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