npstat is hosted by Hepforge, IPPP Durham
NPStat  5.10.0

#include <HistoAxis.hh>

Public Member Functions

 HistoAxis (unsigned nBins, double min, double max, const char *label=0)
 
double min () const
 
double max () const
 
Interval< double > interval () const
 
double length () const
 
unsigned nBins () const
 
double binWidth (const int=0) const
 
const std::string & label () const
 
bool isUniform () const
 
double binCenter (const int binNum) const
 
double leftBinEdge (const int binNum) const
 
double rightBinEdge (const int binNum) const
 
Interval< double > binInterval (const int binNum) const
 
void setLabel (const char *newlabel)
 
int binNumber (double x) const
 
unsigned closestValidBin (double x) const
 
LinearMapper1d binNumberMapper (bool mapLeftEdgeTo0=true) const
 
double fltBinNumber (const double x, const bool mapLeftEdgeTo0=true) const
 
CircularMapper1d kernelScanMapper (bool doubleRange) const
 
bool operator== (const HistoAxis &) const
 
bool operator!= (const HistoAxis &) const
 
bool isClose (const HistoAxis &, double tol) const
 
HistoAxis rebin (unsigned newBins) const
 
gs::ClassId classId () const
 
bool write (std::ostream &of) const
 

Static Public Member Functions

static const char * classname ()
 
static unsigned version ()
 
static HistoAxisread (const gs::ClassId &id, std::istream &in)
 

Friends

template<typename Numeric , class Axis >
class HistoND
 
class DualHistoAxis
 

Detailed Description

Class which contain the information needed to define a histogram axis. All bins will have the same width. See NUHistoAxis and DualHistoAxis classes for non-uniform binning.

Constructor & Destructor Documentation

◆ HistoAxis()

npstat::HistoAxis::HistoAxis ( unsigned  nBins,
double  min,
double  max,
const char *  label = 0 
)

Minimum and maximum will be internally swapped if the minimum parameter is larger than the maximum

Member Function Documentation

◆ binCenter()

double npstat::HistoAxis::binCenter ( const int  binNum) const
inline

Return the coordinate of the given bin center

◆ binInterval()

Interval<double> npstat::HistoAxis::binInterval ( const int  binNum) const
inline

Return the coordinate interval occupied by the given bin

◆ binNumber()

int npstat::HistoAxis::binNumber ( double  x) const

This method returns arbitrary integer bin number, including negative numbers and numbers which can exceed nBins()-1

◆ binNumberMapper()

LinearMapper1d npstat::HistoAxis::binNumberMapper ( bool  mapLeftEdgeTo0 = true) const

Return the mapper which calculates floating point bin number given the coordinate. The resulting bin number can go above and below the axis range. If "mapLeftEdgeTo0" is specified as "false", it is the center of the first bin which gets mapped to 0.

◆ classId()

gs::ClassId npstat::HistoAxis::classId ( ) const
inline

Method related to "geners" I/O

◆ closestValidBin()

unsigned npstat::HistoAxis::closestValidBin ( double  x) const

This method returns the closest valid bin number (>= 0 and below nBins() )

◆ fltBinNumber()

double npstat::HistoAxis::fltBinNumber ( const double  x,
const bool  mapLeftEdgeTo0 = true 
) const
inline

Floating point bin number given the coordinate (no bin number truncation of any kind is performed). Works in exactly the same way as the mapper returned by the previous method.

◆ isClose()

bool npstat::HistoAxis::isClose ( const HistoAxis ,
double  tol 
) const

Comparison of axis coordinates within given tolerance

◆ kernelScanMapper()

CircularMapper1d npstat::HistoAxis::kernelScanMapper ( bool  doubleRange) const

The following function returns a mapper that can be helpful in scanning a kernel (a density function) for subsequent convolution with the histogram which contains this axis.

◆ leftBinEdge()

double npstat::HistoAxis::leftBinEdge ( const int  binNum) const
inline

Return the coordinate of the given bin left edge

◆ min()

double npstat::HistoAxis::min ( ) const
inline

Examine axis properties

◆ rebin()

HistoAxis npstat::HistoAxis::rebin ( unsigned  newBins) const

Return rebinned axis

◆ rightBinEdge()

double npstat::HistoAxis::rightBinEdge ( const int  binNum) const
inline

Return the coordinate of the given bin right edge

◆ setLabel()

void npstat::HistoAxis::setLabel ( const char *  newlabel)
inline

Change the axis label


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