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

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

#include <VariAxis.h>

Inheritance diagram for LWH::VariAxis:

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.

Constructor & Destructor Documentation

◆ VariAxis() [1/2]

LWH::VariAxis::VariAxis ( const std::vector< double > &  edges)
inline

Standard constructor.

Definition at line 38 of file VariAxis.h.

References binco.

◆ VariAxis() [2/2]

LWH::VariAxis::VariAxis ( const VariAxis a)
inline

Copy constructor.

Definition at line 47 of file VariAxis.h.

◆ ~VariAxis()

virtual LWH::VariAxis::~VariAxis ( )
inlinevirtual

Destructor.

Definition at line 51 of file VariAxis.h.

Member Function Documentation

◆ binEdges()

std::pair< double, double > LWH::VariAxis::binEdges ( 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 97 of file VariAxis.h.

References binco.

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

◆ binLowerEdge()

double LWH::VariAxis::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 118 of file VariAxis.h.

References binEdges().

◆ binMidPoint()

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(), LWH::Histogram2D::binMeanX(), and LWH::Histogram2D::binMeanY().

◆ bins()

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.

◆ binUpperEdge()

double LWH::VariAxis::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 130 of file VariAxis.h.

References binEdges().

◆ binWidth()

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

Get the width of the specified bin.

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

◆ coordToIndex()

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

Definition at line 155 of file VariAxis.h.

References binco.

◆ isFixedBinning()

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.

◆ lowerEdge()

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.

◆ upperEdge()

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.

Member Data Documentation

◆ binco

std::map<double,int> LWH::VariAxis::binco
private

A map relating the lower edge of a bin to the corresponding bin number.

Definition at line 177 of file VariAxis.h.

Referenced by binEdges(), bins(), coordToIndex(), lowerEdge(), upperEdge(), and VariAxis().


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