| # Gaudi Framework, version v22r4 |

Home |  | Generated: Fri Sep 2 2011

Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes

# Gaudi::Axis Class Reference

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

`#include <Axis.h>`

Collaboration diagram for Gaudi::Axis:
[legend]

List of all members.

## 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.
int | aIndex (int index) const
| Convert a ROOT bin number on the axis to the AIDA bin number.
| Axis ()
| Axis (TAxis *itaxi)
void | initialize (TAxis *itaxi, bool)
virtual | ~Axis ()
| Destructor.
virtual bool | isFixedBinning () const
| Check if the IAxis has fixed binning, i.e.
virtual double | lowerEdge () const
| Get the lower edge of the IAxis.
virtual double | upperEdge () const
| Get the upper edge of the IAxis.
virtual int | bins () const
| The number of bins (excluding underflow and overflow) on the IAxis.
virtual double | binLowerEdge (int index) const
| Get the lower edge of the specified bin.
virtual double | binUpperEdge (int index) const
| Get the upper edge of the specified bin.
virtual double | binWidth (int index) const
| Get the width of the specified bin.
virtual int | coordToIndex (double coord) const
| Convert a coordinate on the axis to a bin number.
TAxis & | taxis () const
## Static Public Member Functions
static int | toRootIndex (int index, int nbins)
static int | toAidaIndex (int index, int bins)
## Private Member Functions
self & | me () 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.

    : taxis_(0) {}

Gaudi::Axis::Axis | ( | TAxis * | itaxi ) | `[inline, explicit]`

Definition at line 69 of file Axis.h.

    : taxis_(itaxi) {}

virtual Gaudi::Axis::~Axis | ( | ) | `[inline, virtual]`

Destructor.

Definition at line 74 of file Axis.h.

    {}

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

    { return toAidaIndex(index, bins()); }

virtual double Gaudi::Axis::binLowerEdge | ( | int | index ) | const`[inline, virtual]`

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

    { return taxis().GetBinLowEdge(rIndex(index));}

virtual int Gaudi::Axis::bins | ( | ) | const`[inline, virtual]`

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.

    { return taxis().GetNbins();}

virtual double Gaudi::Axis::binUpperEdge | ( | int | index ) | const`[inline, virtual]`

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

    { return taxis().GetBinUpEdge(rIndex(index));}

virtual double Gaudi::Axis::binWidth | ( | int | index ) | const`[inline, virtual]`

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

    { return taxis().GetBinWidth(rIndex(index));}

virtual int Gaudi::Axis::coordToIndex | ( | double | coord ) | const`[inline, virtual]`

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

        {
          return aIndex( taxis().FindBin(coord) );
        }

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

Definition at line 71 of file Axis.h.

    { taxis_ = itaxi; }

virtual bool Gaudi::Axis::isFixedBinning | ( | ) | const`[inline, virtual]`

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.

        {
          return 0 == taxis_ ? true : !taxis_->IsVariableBinSize() ;
        }

virtual double Gaudi::Axis::lowerEdge | ( | ) | const`[inline, virtual]`

Get the lower edge of the IAxis.

Returns:
  The IAxis's lower edge.

Definition at line 91 of file Axis.h.

    { return taxis().GetXmin();}

self& Gaudi::Axis::me | ( | ) | const`[inline, private]`

Definition at line 153 of file Axis.h.

    { return const_cast<self&>(*this);}

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

    { return toRootIndex(index, bins());}

TAxis& Gaudi::Axis::taxis | ( | ) | const`[inline]`

Definition at line 147 of file Axis.h.

    { return *me().taxis_;}

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

Definition at line 43 of file Axis.h.

                                                    {
          if ( index == bins + 1 ) return AIDA::IAxis::OVERFLOW_BIN ;
          if ( index == 0 ) return AIDA::IAxis::UNDERFLOW_BIN ;
          return index - 1 ;
        }

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

Definition at line 37 of file Axis.h.

                                                     {
          if (index==AIDA::IAxis::OVERFLOW_BIN) return nbins+1;
          if (index==AIDA::IAxis::UNDERFLOW_BIN) return 0;
          return index+1;
        }

virtual double Gaudi::Axis::upperEdge | ( | ) | const`[inline, virtual]`

Get the upper edge of the IAxis.

Returns:
  The IAxis's upper edge.

Definition at line 98 of file Axis.h.

    { return taxis().GetXmax();}

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

- /afs/cern.ch/sw/Gaudi/releases/GAUDI/GAUDI_v22r4/GaudiSvc/src/HistogramSvc/Axis.h

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines