thepeg is hosted by Hepforge, IPPP Durham
ThePEG  2.2.1
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. More...
 
double lowerEdge () const
 Get the lower edge of the IAxis. More...
 
double upperEdge () const
 Get the upper edge of the IAxis. More...
 
int bins () const
 The number of bins (excluding underflow and overflow) on the IAxis. More...
 
std::pair< double, double > binEdges (int index) const
 Get the lower edge of the specified bin. More...
 
double binLowerEdge (int index) const
 Get the lower edge of the specified bin. More...
 
double binUpperEdge (int index) const
 Get the upper edge of the specified bin. More...
 
double binWidth (int index) const
 Get the width of the specified bin. More...
 
int coordToIndex (double coord) const
 Convert a coordinate on the axis to a bin number. More...
 
double binMidPoint (int index) const
 Return the midpoint of the specified bin. More...
 

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

◆ 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.

◆ 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.

◆ 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.

◆ 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.

◆ 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.

◆ 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.

◆ 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.

◆ 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.

◆ 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.


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