HIPO  4.3.0
High Performance Output data format for experimental physics
twig::axis Class Reference

Uniform binning axis for histograms. More...

#include <twig.h>

Public Member Functions

 axis ()
 Default constructor. More...
 
 axis (int n, double min, double max)
 Construct an axis with uniform bins. More...
 
virtual ~axis ()
 
void init (int n, double min, double max)
 Initialize the axis with uniform bins. More...
 
int find (double value)
 Find the bin index for a given value. More...
 
int nbins ()
 
double center (int bin)
 
double min ()
 
double max ()
 

Detailed Description

Uniform binning axis for histograms.

Defines equally-spaced bins between a minimum and maximum value.

Definition at line 45 of file twig.h.

Constructor & Destructor Documentation

◆ axis() [1/2]

twig::axis::axis ( )
inline

Default constructor.

Definition at line 50 of file twig.h.

◆ axis() [2/2]

twig::axis::axis ( int  n,
double  min,
double  max 
)
inline

Construct an axis with uniform bins.

Parameters
nNumber of bins
minLower edge
maxUpper edge

Definition at line 55 of file twig.h.

◆ ~axis()

virtual twig::axis::~axis ( )
inlinevirtual

Definition at line 56 of file twig.h.

Member Function Documentation

◆ center()

double twig::axis::center ( int  bin)
inline
Returns
Center value of the given bin.

Definition at line 75 of file twig.h.

◆ find()

int twig::axis::find ( double  value)
inline

Find the bin index for a given value.

Parameters
valueThe value to locate
Returns
Bin index (may be -1 for underflow)

Definition at line 68 of file twig.h.

◆ init()

void twig::axis::init ( int  n,
double  min,
double  max 
)
inline

Initialize the axis with uniform bins.

Parameters
nNumber of bins
minLower edge
maxUpper edge

Definition at line 61 of file twig.h.

◆ max()

double twig::axis::max ( )
inline
Returns
Upper edge of the axis.

Definition at line 79 of file twig.h.

◆ min()

double twig::axis::min ( )
inline
Returns
Lower edge of the axis.

Definition at line 77 of file twig.h.

◆ nbins()

int twig::axis::nbins ( )
inline
Returns
Number of bins.

Definition at line 73 of file twig.h.


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