All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Gaudi::Axis Class Reference

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

#include <src/HistogramSvc/Axis.h>

Inheritance diagram for Gaudi::Axis:
Collaboration diagram for Gaudi::Axis:

Public Types

typedef Axis self
 

Public Member Functions

int rIndex (int index) const
 Convert a AIDA bin number on the axis to the ROOT bin number. More...
 
int aIndex (int index) const
 Convert a ROOT bin number on the axis to the AIDA bin number. More...
 
 Axis ()
 
 Axis (TAxis *itaxi)
 
void initialize (TAxis *itaxi, bool)
 
virtual ~Axis ()
 Destructor. More...
 
virtual bool isFixedBinning () const
 Check if the IAxis has fixed binning, i.e. More...
 
virtual double lowerEdge () const
 Get the lower edge of the IAxis. More...
 
virtual double upperEdge () const
 Get the upper edge of the IAxis. More...
 
virtual int bins () const
 The number of bins (excluding underflow and overflow) on the IAxis. More...
 
virtual double binLowerEdge (int index) const
 Get the lower edge of the specified bin. More...
 
virtual double binUpperEdge (int index) const
 Get the upper edge of the specified bin. More...
 
virtual double binWidth (int index) const
 Get the width of the specified bin. More...
 
virtual int coordToIndex (double coord) const
 Convert a coordinate on the axis to a bin number. More...
 
TAxis & taxis () const
 

Static Public Member Functions

static int toRootIndex (int index, int nbins)
 
static int toAidaIndex (int index, int bins)
 

Private Member Functions

selfme () const
 

Private Attributes

TAxis * taxis_
 

Detailed Description

An IAxis 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.

Author
The AIDA team (http://aida.freehep.org/)

Definition at line 31 of file Axis.h.

Member Typedef Documentation

typedef Axis Gaudi::Axis::self

Definition at line 35 of file Axis.h.

Constructor & Destructor Documentation

Gaudi::Axis::Axis ( )
inline

Definition at line 67 of file Axis.h.

67 : taxis_(0) {}
TAxis * taxis_
Definition: Axis.h:156
Gaudi::Axis::Axis ( TAxis *  itaxi)
inlineexplicit

Definition at line 69 of file Axis.h.

69 : taxis_(itaxi) {}
TAxis * taxis_
Definition: Axis.h:156
virtual Gaudi::Axis::~Axis ( )
inlinevirtual

Destructor.

Definition at line 74 of file Axis.h.

74 {}

Member Function Documentation

int Gaudi::Axis::aIndex ( int  index) const
inline

Convert a ROOT bin number on the axis to the AIDA bin number.

Parameters
indexThe ROOT bin number: 1 to bins() for the in-range bins or bins()+1 for OVERFLOW or 0 for UNDERFLOW.
Returns
The corresponding AIDA bin number.

Definition at line 63 of file Axis.h.

63 { return toAidaIndex(index, bins()); }
static int toAidaIndex(int index, int bins)
Definition: Axis.h:43
virtual int bins() const
The number of bins (excluding underflow and overflow) on the IAxis.
Definition: Axis.h:105
virtual double Gaudi::Axis::binLowerEdge ( int  index) const
inlinevirtual

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 113 of file Axis.h.

113 { return taxis().GetBinLowEdge(rIndex(index));}
TAxis & taxis() const
Definition: Axis.h:147
int rIndex(int index) const
Convert a AIDA bin number on the axis to the ROOT bin number.
Definition: Axis.h:55
virtual int Gaudi::Axis::bins ( ) const
inlinevirtual

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

Returns
The IAxis's number of bins.

Definition at line 105 of file Axis.h.

105 { return taxis().GetNbins();}
TAxis & taxis() const
Definition: Axis.h:147
virtual double Gaudi::Axis::binUpperEdge ( int  index) const
inlinevirtual

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 120 of file Axis.h.

120 { return taxis().GetBinUpEdge(rIndex(index));}
TAxis & taxis() const
Definition: Axis.h:147
int rIndex(int index) const
Convert a AIDA bin number on the axis to the ROOT bin number.
Definition: Axis.h:55
virtual double Gaudi::Axis::binWidth ( int  index) const
inlinevirtual

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 128 of file Axis.h.

128 { return taxis().GetBinWidth(rIndex(index));}
TAxis & taxis() const
Definition: Axis.h:147
int rIndex(int index) const
Convert a AIDA bin number on the axis to the ROOT bin number.
Definition: Axis.h:55
virtual int Gaudi::Axis::coordToIndex ( double  coord) const
inlinevirtual

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 139 of file Axis.h.

140  {
141  return aIndex( taxis().FindBin(coord) );
142  }
int aIndex(int index) const
Convert a ROOT bin number on the axis to the AIDA bin number.
Definition: Axis.h:63
TAxis & taxis() const
Definition: Axis.h:147
void Gaudi::Axis::initialize ( TAxis *  itaxi,
bool   
)
inline

Definition at line 71 of file Axis.h.

71 { taxis_ = itaxi; }
TAxis * taxis_
Definition: Axis.h:156
virtual bool Gaudi::Axis::isFixedBinning ( ) const
inlinevirtual

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 81 of file Axis.h.

82  {
83  return 0 == taxis_ ? true : !taxis_->IsVariableBinSize() ;
84  }
TAxis * taxis_
Definition: Axis.h:156
virtual double Gaudi::Axis::lowerEdge ( ) const
inlinevirtual

Get the lower edge of the IAxis.

Returns
The IAxis's lower edge.

Definition at line 91 of file Axis.h.

91 { return taxis().GetXmin();}
TAxis & taxis() const
Definition: Axis.h:147
self& Gaudi::Axis::me ( ) const
inlineprivate

Definition at line 153 of file Axis.h.

153 { return const_cast<self&>(*this);}
Axis self
Definition: Axis.h:35
int Gaudi::Axis::rIndex ( int  index) const
inline

Convert a AIDA bin number on the axis to the ROOT bin number.

Parameters
indexTheAIDA bin number
Returns
The corresponding ROOT bin number.

Definition at line 55 of file Axis.h.

55 { return toRootIndex(index, bins());}
virtual int bins() const
The number of bins (excluding underflow and overflow) on the IAxis.
Definition: Axis.h:105
static int toRootIndex(int index, int nbins)
Definition: Axis.h:37
TAxis& Gaudi::Axis::taxis ( ) const
inline

Definition at line 147 of file Axis.h.

147 { return *me().taxis_;}
self & me() const
Definition: Axis.h:153
TAxis * taxis_
Definition: Axis.h:156
static int Gaudi::Axis::toAidaIndex ( int  index,
int  bins 
)
inlinestatic

Definition at line 43 of file Axis.h.

43  {
44  if ( index == bins + 1 ) return AIDA::IAxis::OVERFLOW_BIN ;
45  if ( index == 0 ) return AIDA::IAxis::UNDERFLOW_BIN ;
46  return index - 1 ;
47  }
virtual int bins() const
The number of bins (excluding underflow and overflow) on the IAxis.
Definition: Axis.h:105
static int Gaudi::Axis::toRootIndex ( int  index,
int  nbins 
)
inlinestatic

Definition at line 37 of file Axis.h.

37  {
38  if (index==AIDA::IAxis::OVERFLOW_BIN) return nbins+1;
39  if (index==AIDA::IAxis::UNDERFLOW_BIN) return 0;
40  return index+1;
41  }
virtual double Gaudi::Axis::upperEdge ( ) const
inlinevirtual

Get the upper edge of the IAxis.

Returns
The IAxis's upper edge.

Definition at line 98 of file Axis.h.

98 { return taxis().GetXmax();}
TAxis & taxis() const
Definition: Axis.h:147

Member Data Documentation

TAxis* Gaudi::Axis::taxis_
private

Definition at line 156 of file Axis.h.


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