| The Gaudi Framework v28r2-patches (bc4ad17a)

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
Gaudi::Axis Class Reference

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

`#include <GaudiCommonSvc/Axis.h>`

Inheritance diagram for Gaudi::Axis:
[legend]
Collaboration diagram for Gaudi::Axis:
[legend]

## 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 ()=default
| Axis (TAxis *itaxi)
void | initialize (TAxis *itaxi, bool)
bool | isFixedBinning () const override
| Check if the IAxis has fixed binning, i.e. More...
double | lowerEdge () const override
| Get the lower edge of the IAxis. More...
double | upperEdge () const override
| Get the upper edge of the IAxis. More...
int | bins () const override
| The number of bins (excluding underflow and overflow) on the IAxis. More...
double | binLowerEdge (int index) const override
| Get the lower edge of the specified bin. More...
double | binUpperEdge (int index) const override
| Get the upper edge of the specified bin. More...
double | binWidth (int index) const override
| Get the width of the specified bin. More...
int | coordToIndex (double coord) const override
| 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
Axis & | me () const

## Private Attributes
TAxis * | taxis_ = nullptr

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

## Constructor & Destructor Documentation

Gaudi::Axis::Axis | ( |  | ) |
| default

Gaudi::Axis::Axis | ( | TAxis * | itaxi | ) |
| inline explicit

Definition at line 64 of file Axis.h.

64 : taxis_(itaxi) {}
Gaudi::Axis::taxis_
TAxis * taxis_
Definition: Axis.h:146

## 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

  index | The 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 59 of file Axis.h.

59 { return toAidaIndex(index, bins()); }
Gaudi::Axis::toAidaIndex
static int toAidaIndex(int index, int bins)
Definition: Axis.h:39
Gaudi::Axis::bins
int bins() const override
The number of bins (excluding underflow and overflow) on the IAxis.
Definition: Axis.h:97

double Gaudi::Axis::binLowerEdge | ( | int | index | ) | const
| inline override

Get the lower edge of the specified bin.

Parameters

  index | The 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 105 of file Axis.h.

105 { return taxis().GetBinLowEdge(rIndex(index));}
Gaudi::Axis::taxis
TAxis & taxis() const
Definition: Axis.h:139
Gaudi::Axis::rIndex
int rIndex(int index) const
Convert a AIDA bin number on the axis to the ROOT bin number.
Definition: Axis.h:51

int Gaudi::Axis::bins | ( |  | ) | const
| inline override

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

Returns
  The IAxis's number of bins.

Definition at line 97 of file Axis.h.

97 { return taxis().GetNbins();}
Gaudi::Axis::taxis
TAxis & taxis() const
Definition: Axis.h:139

double Gaudi::Axis::binUpperEdge | ( | int | index | ) | const
| inline override

Get the upper edge of the specified bin.

Parameters

  index | The 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 112 of file Axis.h.

112 { return taxis().GetBinUpEdge(rIndex(index));}
Gaudi::Axis::taxis
TAxis & taxis() const
Definition: Axis.h:139
Gaudi::Axis::rIndex
int rIndex(int index) const
Convert a AIDA bin number on the axis to the ROOT bin number.
Definition: Axis.h:51

double Gaudi::Axis::binWidth | ( | int | index | ) | const
| inline override

Get the width of the specified bin.

Parameters

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

120 { return taxis().GetBinWidth(rIndex(index));}
Gaudi::Axis::taxis
TAxis & taxis() const
Definition: Axis.h:139
Gaudi::Axis::rIndex
int rIndex(int index) const
Convert a AIDA bin number on the axis to the ROOT bin number.
Definition: Axis.h:51

int Gaudi::Axis::coordToIndex | ( | double | coord | ) | const
| inline override

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

  coord | The coordinate to be converted.

Returns
  The corresponding bin number.

Definition at line 131 of file Axis.h.

132 {
133 return aIndex( taxis().FindBin(coord) );
134 }
Gaudi::Axis::aIndex
int aIndex(int index) const
Convert a ROOT bin number on the axis to the AIDA bin number.
Definition: Axis.h:59
Gaudi::Axis::taxis
TAxis & taxis() const
Definition: Axis.h:139

void Gaudi::Axis::initialize | ( | TAxis * | itaxi,
|  | bool |
| ) |  |
| inline

Definition at line 66 of file Axis.h.

66 { taxis_ = itaxi; }
Gaudi::Axis::taxis_
TAxis * taxis_
Definition: Axis.h:146

bool Gaudi::Axis::isFixedBinning | ( |  | ) | const
| inline override

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

74 {
75 return 0 == taxis_ ? true : !taxis_->IsVariableBinSize() ;
76 }
Gaudi::Axis::taxis_
TAxis * taxis_
Definition: Axis.h:146

double Gaudi::Axis::lowerEdge | ( |  | ) | const
| inline override

Get the lower edge of the IAxis.

Returns
  The IAxis's lower edge.

Definition at line 83 of file Axis.h.

83 { return taxis().GetXmin();}
Gaudi::Axis::taxis
TAxis & taxis() const
Definition: Axis.h:139

Axis& Gaudi::Axis::me | ( |  | ) | const
| inline private

Definition at line 143 of file Axis.h.

143 { return const_cast<Axis&>(*this);}
Gaudi::Axis::Axis
Axis()=default

int Gaudi::Axis::rIndex | ( | int | index | ) | const
| inline

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

Parameters

  index | TheAIDA bin number

Returns
  The corresponding ROOT bin number.

Definition at line 51 of file Axis.h.

51 { return toRootIndex(index, bins());}
Gaudi::Axis::bins
int bins() const override
The number of bins (excluding underflow and overflow) on the IAxis.
Definition: Axis.h:97
Gaudi::Axis::toRootIndex
static int toRootIndex(int index, int nbins)
Definition: Axis.h:33

TAxis& Gaudi::Axis::taxis | ( |  | ) | const
| inline

Definition at line 139 of file Axis.h.

139 { return *me().taxis_;}
Gaudi::Axis::me
Axis & me() const
Definition: Axis.h:143
Gaudi::Axis::taxis_
TAxis * taxis_
Definition: Axis.h:146

static int Gaudi::Axis::toAidaIndex | ( | int | index,
|  | int | bins
| ) |  |
| inline static

Definition at line 39 of file Axis.h.

39 {
40 if ( index == bins + 1 ) return AIDA::IAxis::OVERFLOW_BIN ;
41 if ( index == 0 ) return AIDA::IAxis::UNDERFLOW_BIN ;
42 return index - 1 ;
43 }
Gaudi::Axis::bins
int bins() const override
The number of bins (excluding underflow and overflow) on the IAxis.
Definition: Axis.h:97

static int Gaudi::Axis::toRootIndex | ( | int | index,
|  | int | nbins
| ) |  |
| inline static

Definition at line 33 of file Axis.h.

33 {
34 if (index==AIDA::IAxis::OVERFLOW_BIN) return nbins+1;
35 if (index==AIDA::IAxis::UNDERFLOW_BIN) return 0;
36 return index+1;
37 }

double Gaudi::Axis::upperEdge | ( |  | ) | const
| inline override

Get the upper edge of the IAxis.

Returns
  The IAxis's upper edge.

Definition at line 90 of file Axis.h.

90 { return taxis().GetXmax();}
Gaudi::Axis::taxis
TAxis & taxis() const
Definition: Axis.h:139

## Member Data Documentation

TAxis* Gaudi::Axis::taxis_ = nullptr
| private

Definition at line 146 of file Axis.h.

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

- GaudiCommonSvc/GaudiCommonSvc/Axis.h