| # Gaudi Framework, version v20r2
Generated: 18 Jul 2008

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

- Search for |

- Alphabetical List
- Class List
- Class Hierarchy
- Class Members

# Gaudi::Generic2D< INTERFACE, IMPLEMENTATION > Class Template Reference

`#include <GaudiPI/Generic2D.h>`

Inheritance diagram for Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >:

[legend]
Collaboration diagram for Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >:

[legend]
List of all members.

## Detailed Description

### template<class INTERFACE, class IMPLEMENTATION>
class Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >

Common AIDA implementation stuff for histograms and profiles using ROOT implementations.

Credits: This code is the result of some stripdown implementation of LCG/PI. Credits to them!

Author:
  M.Frank

Definition at line 28 of file Generic2D.h.

## Public Types
typedef Generic2D< INTERFACE, IMPLEMENTATION > | Base
## Public Member Functions
| Generic2D ()
virtual | ~Generic2D ()
| Destructor.
TObject * | representation () const
| ROOT object implementation.
virtual void | adoptRepresentation (TObject *rep)
| Adopt ROOT histogram representation.
virtual std::string | title () const
| Get the title of the object.
virtual bool | setTitle (const std::string &title)
| Set the title of the object.
std::string | name () const
| object name
bool | setName (const std::string &newName)
| Set the name of the object.
virtual AIDA::IAnnotation & | annotation ()
| Access annotation object.
virtual const AIDA::IAnnotation & | annotation () const
| Access annotation object (cons).
virtual const AIDA::IAxis & | xAxis () const
| Return the X axis.
virtual const AIDA::IAxis & | yAxis () const
| Return the Y axis.
virtual int | rIndexX (int index) const
| operator methods
virtual int | rIndexY (int index) const
| operator methods
virtual int | entries () const
| Get the number or all the entries.
virtual int | allEntries () const
| Get the number or all the entries, both in range and underflow/overflow bins of the IProfile.
virtual int | extraEntries () const
| Get the number of entries in the underflow and overflow bins.
virtual double | sumBinHeights () const
| Get the sum of in range bin heights in the IProfile.
virtual double | sumAllBinHeights () const
| Get the sum of all the bins heights (including underflow and overflow bin).
virtual double | sumExtraBinHeights () const
| Get the sum of the underflow and overflow bin height.
virtual double | minBinHeight () const
| Get the minimum height of the in-range bins.
virtual double | maxBinHeight () const
| Get the maximum height of the in-range bins.
virtual double | binMeanX (int indexX, int indexY) const
| The weighted mean along x of a given bin.
virtual double | binMeanY (int indexX, int indexY) const
| The weighted mean along y of a given bin.
virtual int | binEntries (int indexX, int indexY) const
| The number of entries (ie the number of times fill was called for this bin).
virtual int | binEntriesX (int indexX) const
| Equivalent to `projectionX().binEntries(indexX)`.
virtual int | binEntriesY (int indexY) const
| Equivalent to `projectionY().binEntries(indexY)`.
virtual double | binHeight (int indexX, int indexY) const
| Total height of the corresponding bin (ie the sum of the weights in this bin).
virtual double | binHeightX (int indexX) const
| Equivalent to `projectionX().binHeight(indexX)`.
virtual double | binHeightY (int indexY) const
| Equivalent to `projectionY().binHeight(indexY)`.
virtual double | binError (int indexX, int indexY) const
| The error on this bin.
virtual double | binRms (int indexX, int indexY) const
| The spread (RMS) of this bin.
virtual double | meanX () const
| Returns the mean of the profile, as calculated on filling-time projected on the X axis.
virtual double | meanY () const
| Returns the mean of the profile, as calculated on filling-time projected on the Y axis.
virtual double | rmsX () const
| Returns the rms of the profile as calculated on filling-time projected on the X axis.
virtual double | rmsY () const
| Returns the rms of the profile as calculated on filling-time projected on the Y axis.
virtual int | coordToIndexX (double coordX) const
| Convenience method, equivalent to `xAxis().coordToIndex(coord)`.
virtual int | coordToIndexY (double coordY) const
| Convenience method, equivalent to `yAxis().coordToIndex(coord)`.
virtual double | equivalentBinEntries () const
| Number of equivalent entries, i.e. `SUM[ weight ] ^ 2 / SUM[ weight^2 ]`.
virtual bool | scale (double scaleFactor)
| Scale the weights and the errors of all the IHistogram's bins (in-range and out-of-range ones) by a given scale factor.
virtual bool | add (const INTERFACE &h)
| Modifies this profile by adding the contents of profile to it.
bool | reset ()
void * | cast (const std::string &className) const
| Introspection method.
const std::string & | userLevelClassType () const
| The AIDA user-level unterface leaf class type.
virtual int | dimension () const
| Get the Histogram's dimension.
virtual std::ostream & | print (std::ostream &s) const
| Print (ASCII) the histogram into the output stream.
virtual std::ostream & | write (std::ostream &s) const
| Write (ASCII) the histogram table into the output stream.
virtual int | write (const char *file_name) const
| Write (ASCII) the histogram table into a file.
template<>
void | adoptRepresentation (TObject *rep)
| Adopt ROOT histogram representation.
## Protected Attributes
Axis | m_xAxis
| X axis member.
Axis | m_yAxis
| Y axis member.
AIDA::Annotation | m_annotation
| Object annotations.
IMPLEMENTATION * | m_rep
| Reference to underlying implementation.
std::string | m_classType
| class type
int | m_sumEntries
| cache sumEntries (allEntries) when setting contents since Root can't compute by himself

## Member Typedef Documentation

template<class INTERFACE, class IMPLEMENTATION>

typedef Generic2D<INTERFACE,IMPLEMENTATION> Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::Base

Definition at line 30 of file Generic2D.h.

## Constructor & Destructor Documentation

template<class INTERFACE, class IMPLEMENTATION>

Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::Generic2D | ( |  | ) | `[inline]`

Definition at line 32 of file Generic2D.h.

    00032 : m_rep(0) {}

template<class INTERFACE, class IMPLEMENTATION>

virtual Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::~Generic2D | ( |  | ) | `[inline, virtual]`

Destructor.

Definition at line 35 of file Generic2D.h.

    00035 {  delete m_rep;    }

## Member Function Documentation

template<class INTERFACE, class IMPLEMENTATION>

TObject* Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::representation | ( |  | ) | const`[inline, virtual]`

ROOT object implementation.

Implements Gaudi::HistogramBase.

Definition at line 38 of file Generic2D.h.

    00038 { return m_rep;                       }

template<class INTERFACE, class IMPLEMENTATION>

virtual void Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::adoptRepresentation | ( | TObject * | rep | ) | `[virtual]`

Adopt ROOT histogram representation.

Implements Gaudi::HistogramBase.

template<class INTERFACE, class IMPLEMENTATION>

virtual std::string Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::title | ( |  | ) | const`[inline, virtual]`

Get the title of the object.

Definition at line 42 of file Generic2D.h.

    00042 {  return m_annotation.value( "Title" );    }

template<class INTERFACE, class IMPLEMENTATION>

bool Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::setTitle | ( | const std::string & | title | ) | `[virtual]`

Set the title of the object.

Definition at line 149 of file Generic2D.h.

References Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::annotation(), std::basic_string< _CharT, _Traits, _Alloc >::c_str(), Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::m_annotation, Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::m_rep, and AIDA::Annotation::setValue().

Referenced by Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::adoptRepresentation().

    00149                                                                              {
    00150     m_rep->SetTitle(title.c_str());
    00151     if ( !annotation().addItem( "Title", title ) )
    00152       m_annotation.setValue( "Title" , title );
    00153     if ( !annotation().addItem( "title", title ) )
    00154       annotation().setValue( "title", title );
    00155     return true;
    00156   }

template<class INTERFACE, class IMPLEMENTATION>

std::string Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::name | ( |  | ) | const`[inline]`

object name

Definition at line 46 of file Generic2D.h.

    00046 { return m_annotation.value("Name"); }

template<class INTERFACE, class IMPLEMENTATION>

bool Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::setName | ( | const std::string & | newName | ) |

Set the name of the object.

Definition at line 159 of file Generic2D.h.

References std::basic_string< _CharT, _Traits, _Alloc >::c_str(), Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::m_annotation, Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::m_rep, and AIDA::Annotation::setValue().

    00159                                                                               {
    00160     m_rep->SetName(newName.c_str());
    00161     m_annotation.setValue( "Name", newName );
    00162     return true;
    00163   }

template<class INTERFACE, class IMPLEMENTATION>

virtual AIDA::IAnnotation& Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::annotation | ( |  | ) | `[inline, virtual]`

Access annotation object.

Definition at line 50 of file Generic2D.h.

Referenced by Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::setTitle().

    00050 { return m_annotation;           }

template<class INTERFACE, class IMPLEMENTATION>

virtual const AIDA::IAnnotation& Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::annotation | ( |  | ) | const`[inline, virtual]`

Access annotation object (cons).

Definition at line 52 of file Generic2D.h.

    00052 { return m_annotation;           }

template<class INTERFACE, class IMPLEMENTATION>

virtual const AIDA::IAxis& Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::xAxis | ( |  | ) | const`[inline, virtual]`

Return the X axis.

Definition at line 55 of file Generic2D.h.

Referenced by Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::binEntriesY(), Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::binHeightY(), Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::coordToIndexX(), and Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::write().

    00055 { return m_xAxis;                }

template<class INTERFACE, class IMPLEMENTATION>

virtual const AIDA::IAxis& Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::yAxis | ( |  | ) | const`[inline, virtual]`

Return the Y axis.

Definition at line 57 of file Generic2D.h.

Referenced by Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::binEntriesX(), Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::binHeightX(), Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::coordToIndexY(), and Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::write().

    00057 { return m_yAxis;                }

template<class INTERFACE, class IMPLEMENTATION>

virtual int Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::rIndexX | ( | int | index | ) | const`[inline, virtual]`

operator methods

Definition at line 59 of file Generic2D.h.

Referenced by Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::binError(), Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::binHeight(), Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::binMeanX(), and Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::binRms().

    00059 { return m_xAxis.rIndex(index);  }

template<class INTERFACE, class IMPLEMENTATION>

virtual int Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::rIndexY | ( | int | index | ) | const`[inline, virtual]`

operator methods

Definition at line 61 of file Generic2D.h.

Referenced by Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::binError(), Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::binHeight(), Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::binMeanY(), and Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::binRms().

    00061 { return m_yAxis.rIndex(index);  }

template<class INTERFACE, class IMPLEMENTATION>

int Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::entries | ( |  | ) | const`[virtual]`

Get the number or all the entries.

Definition at line 166 of file Generic2D.h.

References Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::m_rep.

    00166                                                                                {
    00167     return (int)m_rep->GetEntries();
    00168   }

template<class INTERFACE, class IMPLEMENTATION>

int Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::allEntries | ( |  | ) | const`[virtual]`

Get the number or all the entries, both in range and underflow/overflow bins of the IProfile.

Definition at line 171 of file Generic2D.h.

References int(), and Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::m_rep.

    00171                                                                 {
    00172     return int(m_rep->GetEntries());
    00173   }

template<class INTERFACE, class IMPLEMENTATION>

int Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::extraEntries | ( |  | ) | const`[virtual]`

Get the number of entries in the underflow and overflow bins.

Definition at line 294 of file Generic2D.h.

References Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::binEntries().

    00294                                                               {
    00295     return
    00296       binEntries(AIDA::IAxis::UNDERFLOW_BIN,AIDA::IAxis::UNDERFLOW_BIN) +
    00297       binEntries(AIDA::IAxis::UNDERFLOW_BIN,AIDA::IAxis::OVERFLOW_BIN)  +
    00298       binEntries(AIDA::IAxis::OVERFLOW_BIN,AIDA::IAxis::UNDERFLOW_BIN)  +
    00299       binEntries(AIDA::IAxis::OVERFLOW_BIN,AIDA::IAxis::OVERFLOW_BIN);
    00300   }

template<class INTERFACE, class IMPLEMENTATION>

double Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::sumBinHeights | ( |  | ) | const`[virtual]`

Get the sum of in range bin heights in the IProfile.

Definition at line 186 of file Generic2D.h.

References Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::m_rep.

Referenced by Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::equivalentBinEntries().

    00186                                                                     {
    00187     return m_rep->GetSumOfWeights();
    00188   }

template<class INTERFACE, class IMPLEMENTATION>

double Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::sumAllBinHeights | ( |  | ) | const`[virtual]`

Get the sum of all the bins heights (including underflow and overflow bin).

Definition at line 191 of file Generic2D.h.

References Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::m_rep.

    00191                                                                        {
    00192     return m_rep->GetSum();
    00193   }

template<class INTERFACE, class IMPLEMENTATION>

virtual double Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::sumExtraBinHeights | ( |  | ) | const`[inline, virtual]`

Get the sum of the underflow and overflow bin height.

Definition at line 74 of file Generic2D.h.

    00074 { return  sumAllBinHeights()-sumBinHeights(); }

template<class INTERFACE, class IMPLEMENTATION>

double Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::minBinHeight | ( |  | ) | const`[virtual]`

Get the minimum height of the in-range bins.

Definition at line 176 of file Generic2D.h.

References Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::m_rep.

    00176                                                                    {
    00177     return m_rep->GetMinimum();
    00178   }

template<class INTERFACE, class IMPLEMENTATION>

double Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::maxBinHeight | ( |  | ) | const`[virtual]`

Get the maximum height of the in-range bins.

Definition at line 181 of file Generic2D.h.

References Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::m_rep.

    00181                                                                    {
    00182     return m_rep->GetMaximum();
    00183   }

template<class INTERFACE, class IMPLEMENTATION>

double Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::binMeanX | ( | int | indexX,
|  | int | indexY |
| ) |  |  | const`[virtual]`

The weighted mean along x of a given bin.

Definition at line 201 of file Generic2D.h.

References Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::m_rep, and Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::rIndexX().

Referenced by Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::write().

    00201                                                                             {
    00202     return (m_rep->GetXaxis())->GetBinCenter( rIndexX(indexX) );
    00203   }

template<class INTERFACE, class IMPLEMENTATION>

double Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::binMeanY | ( | int | indexX,
|  | int | indexY |
| ) |  |  | const`[virtual]`

The weighted mean along y of a given bin.

Definition at line 206 of file Generic2D.h.

References Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::m_rep, and Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::rIndexY().

Referenced by Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::write().

    00206                                                                             {
    00207     return (m_rep->GetYaxis())->GetBinCenter( rIndexY(indexY) );
    00208   }

template<class INTERFACE, class IMPLEMENTATION>

virtual int Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::binEntries | ( | int | indexX,
|  | int | indexY |
| ) |  |  | const`[virtual]`

The number of entries (ie the number of times fill was called for this bin).

Referenced by Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::binEntriesX(), Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::binEntriesY(), and Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::extraEntries().

template<class INTERFACE, class IMPLEMENTATION>

int Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::binEntriesX | ( | int | indexX | ) | const`[virtual]`

Equivalent to `projectionX().binEntries(indexX)`.

Definition at line 211 of file Generic2D.h.

References Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::binEntries(), and Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::yAxis().

    00211                                                                         {
    00212     int n = 0;
    00213     for (int iY = -2; iY < yAxis().bins(); ++iY)
    00214       n += binEntries(index,iY);
    00215     return n;
    00216   }

template<class INTERFACE, class IMPLEMENTATION>

int Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::binEntriesY | ( | int | indexY | ) | const`[virtual]`

Equivalent to `projectionY().binEntries(indexY)`.

Definition at line 219 of file Generic2D.h.

References Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::binEntries(), and Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::xAxis().

    00219                                                                          {
    00220     int n = 0;
    00221     for (int iX = -2; iX < xAxis().bins(); ++iX)
    00222       n += binEntries(iX,index);
    00223     return n;
    00224   }

template<class INTERFACE, class IMPLEMENTATION>

double Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::binHeight | ( | int | indexX,
|  | int | indexY |
| ) |  |  | const`[virtual]`

Total height of the corresponding bin (ie the sum of the weights in this bin).

Definition at line 227 of file Generic2D.h.

References Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::m_rep, Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::rIndexX(), and Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::rIndexY().

Referenced by Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::binHeightX(), Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::binHeightY(), and Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::write().

    00227                                                                                        {
    00228     return m_rep->GetBinContent ( rIndexX(indexX), rIndexY(indexY) );
    00229   }

template<class INTERFACE, class IMPLEMENTATION>

double Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::binHeightX | ( | int | indexX | ) | const`[virtual]`

Equivalent to `projectionX().binHeight(indexX)`.

Definition at line 232 of file Generic2D.h.

References Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::binHeight(), Gaudi::Units::s, and Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::yAxis().

    00232                                                                          {
    00233     double s = 0;
    00234     for (int iY = -2; iY < yAxis().bins(); ++iY) {
    00235       s += binHeight(index,iY);
    00236     }
    00237     return s;
    00238   }

template<class INTERFACE, class IMPLEMENTATION>

double Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::binHeightY | ( | int | indexY | ) | const`[virtual]`

Equivalent to `projectionY().binHeight(indexY)`.

Definition at line 241 of file Generic2D.h.

References Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::binHeight(), Gaudi::Units::s, and Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::xAxis().

    00241                                                                          {
    00242     double s = 0;
    00243     for (int iX = -2; iX < xAxis().bins(); ++iX)
    00244       s += binHeight(iX,index);
    00245     return s;
    00246   }

template<class INTERFACE, class IMPLEMENTATION>

double Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::binError | ( | int | indexX,
|  | int | indexY |
| ) |  |  | const`[virtual]`

The error on this bin.

Definition at line 249 of file Generic2D.h.

References Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::m_rep, Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::rIndexX(), and Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::rIndexY().

Referenced by Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::write().

    00249                                                                                    {
    00250     return m_rep->GetBinError ( rIndexX(indexX), rIndexY(indexY ) );
    00251   }

template<class INTERFACE, class IMPLEMENTATION>

double Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::binRms | ( | int | indexX,
|  | int | indexY |
| ) |  |  | const`[virtual]`

The spread (RMS) of this bin.

Definition at line 196 of file Generic2D.h.

References Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::m_rep, Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::rIndexX(), and Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::rIndexY().

    00196                                                                                 {
    00197     return m_rep->GetBinError ( rIndexX(indexX), rIndexY(indexY) );
    00198   }

template<class INTERFACE, class IMPLEMENTATION>

double Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::meanX | ( |  | ) | const`[virtual]`

Returns the mean of the profile, as calculated on filling-time projected on the X axis.

Definition at line 254 of file Generic2D.h.

References Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::m_rep.

    00254                                                            {
    00255     return m_rep->GetMean(1);
    00256   }

template<class INTERFACE, class IMPLEMENTATION>

double Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::meanY | ( |  | ) | const`[virtual]`

Returns the mean of the profile, as calculated on filling-time projected on the Y axis.

Definition at line 259 of file Generic2D.h.

References Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::m_rep.

    00259                                                            {
    00260     return m_rep->GetMean(2);
    00261   }

template<class INTERFACE, class IMPLEMENTATION>

double Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::rmsX | ( |  | ) | const`[virtual]`

Returns the rms of the profile as calculated on filling-time projected on the X axis.

Definition at line 264 of file Generic2D.h.

References Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::m_rep.

    00264                                                           {
    00265     return m_rep->GetRMS(1);
    00266   }

template<class INTERFACE, class IMPLEMENTATION>

double Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::rmsY | ( |  | ) | const`[virtual]`

Returns the rms of the profile as calculated on filling-time projected on the Y axis.

Definition at line 269 of file Generic2D.h.

References Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::m_rep.

    00269                                                           {
    00270     return m_rep->GetRMS(2);
    00271   }

template<class INTERFACE, class IMPLEMENTATION>

int Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::coordToIndexX | ( | double | coordX | ) | const`[virtual]`

Convenience method, equivalent to `xAxis().coordToIndex(coord)`.

Definition at line 274 of file Generic2D.h.

References Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::xAxis().

    00274                                                                               {
    00275     return xAxis().coordToIndex(coord);
    00276   }

template<class INTERFACE, class IMPLEMENTATION>

int Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::coordToIndexY | ( | double | coordY | ) | const`[virtual]`

Convenience method, equivalent to `yAxis().coordToIndex(coord)`.

Definition at line 279 of file Generic2D.h.

References Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::yAxis().

    00279                                                                               {
    00280     return yAxis().coordToIndex(coord);
    00281   }

template<class INTERFACE, class IMPLEMENTATION>

double Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::equivalentBinEntries | ( |  | ) | const`[virtual]`

Number of equivalent entries, i.e. `SUM[ weight ] ^ 2 / SUM[ weight^2 ]`.

Definition at line 303 of file Generic2D.h.

References Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::m_rep, and Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::sumBinHeights().

    00303                                                                           {
    00304     if (sumBinHeights() <= 0) return 0;
    00305     Stat_t stats[11];   // cover up to 3D...
    00306     m_rep->GetStats(stats);
    00307     return stats[0]*stats[0]/stats[1];
    00308   }

template<class INTERFACE, class IMPLEMENTATION>

bool Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::scale | ( | double | scaleFactor | ) | `[virtual]`

Scale the weights and the errors of all the IHistogram's bins (in-range and out-of-range ones) by a given scale factor.

Definition at line 311 of file Generic2D.h.

References Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::m_rep.

    00311                                                                       {
    00312     m_rep->Scale ( scaleFactor );
    00313     return true;
    00314   }

template<class INTERFACE, class IMPLEMENTATION>

bool Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::add | ( | const INTERFACE & | h | ) | `[virtual]`

Modifies this profile by adding the contents of profile to it.

Definition at line 284 of file Generic2D.h.

References Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::m_rep.

    00284                                                                          {
    00285     const Base* p = dynamic_cast<const Base*>(&hist);
    00286     if ( p )  {
    00287       m_rep->Add(p->m_rep);
    00288       return true;
    00289     }
    00290     throw std::runtime_error("Cannot add profile histograms of different implementations.");
    00291   }

template<class INTERFACE, class IMPLEMENTATION>

bool Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::reset | ( |  | ) |

Reimplemented in Gaudi::Histogram2D.

Definition at line 317 of file Generic2D.h.

References Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::m_rep, and Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::m_sumEntries.

    00317                                                        {
    00318     m_sumEntries = 0;
    00319     m_rep->Reset ( );
    00320     return true;
    00321   }

template<class INTERFACE, class IMPLEMENTATION>

void* Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::cast | ( | const std::string & | className | ) | const

Introspection method.

template<class INTERFACE, class IMPLEMENTATION>

const std::string& Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::userLevelClassType | ( |  | ) | const`[inline]`

The AIDA user-level unterface leaf class type.

Definition at line 123 of file Generic2D.h.

    00123 { return m_classType; }

template<class INTERFACE, class IMPLEMENTATION>

virtual int Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::dimension | ( |  | ) | const`[inline, virtual]`

Get the Histogram's dimension.

Definition at line 125 of file Generic2D.h.

    00125 { return 2; }

template<class INTERFACE, class IMPLEMENTATION>

std::ostream & Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::print | ( | std::ostream & | s | ) | const`[virtual]`

Print (ASCII) the histogram into the output stream.

bin contents and errors are printed for all bins including under and overflows

Implements Gaudi::HistogramBase.

Definition at line 324 of file Generic2D.h.

References Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::m_rep, and Gaudi::Units::s.

    00325   {
    00327     m_rep->Print("all");
    00328     return s;
    00329   }

template<class INTERFACE, class IMPLEMENTATION>

std::ostream & Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::write | ( | std::ostream & | s | ) | const`[virtual]`

Write (ASCII) the histogram table into the output stream.

Implements Gaudi::HistogramBase.

Definition at line 333 of file Generic2D.h.

References Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::binError(), Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::binHeight(), Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::binMeanX(), Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::binMeanY(), std::endl(), Gaudi::Units::s, Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::xAxis(), and Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::yAxis().

    00334   {
    00335     s << std::endl << "2D Histogram Table: " << std::endl;
    00336     s << "BinX, BinY, Height, Error " << std::endl;
    00337     for ( int i = 0; i < xAxis().bins(); ++i )  {
    00338       for ( int j = 0; j < yAxis().bins(); ++j )  {
    00339         s << binMeanX( i, j )    << ", "
    00340                 << binMeanY( i, j )    << ", "
    00341                 << binHeight( i, j ) << ", "
    00342                 << binError ( i, j ) << std::endl;
    00343       }
    00344     }
    00345     s << std::endl;
    00346     return s;
    00347   }

template<class INTERFACE, class IMPLEMENTATION>

int Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::write | ( | const char * | file_name | ) | const`[virtual]`

Write (ASCII) the histogram table into a file.

Implements Gaudi::HistogramBase.

Definition at line 351 of file Generic2D.h.

References Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::m_rep.

    00352   {
    00353     TFile *f = TFile::Open(file_name,"RECREATE");
    00354     Int_t nbytes = m_rep->Write();
    00355     f->Close();
    00356     return nbytes;
    00357   }

template<>

void Gaudi::Generic2D< AIDA::IHistogram2D, TH2D >::adoptRepresentation | ( | TObject * | rep | ) | `[virtual]`

Adopt ROOT histogram representation.

Implements Gaudi::HistogramBase.

Definition at line 96 of file H2D.cpp.

References Gaudi::Axis::initialize(), Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::m_rep, Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::m_xAxis, Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::m_yAxis, and Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::setTitle().

    00096                                                                           {
    00097     TH2D* imp = dynamic_cast<TH2D*>(rep);
    00098     if ( imp )  {
    00099       if ( m_rep ) delete m_rep;
    00100       m_rep = imp;
    00101       m_xAxis.initialize(m_rep->GetXaxis(),true);
    00102       m_yAxis.initialize(m_rep->GetYaxis(),true);
    00103       const TArrayD* a = m_rep->GetSumw2();
    00104       if ( 0 == a || (a && a->GetSize()==0) ) m_rep->Sumw2();
    00105       setTitle(m_rep->GetTitle());
    00106       return;
    00107     }
    00108     throw std::runtime_error("Cannot adopt native histogram representation.");
    00109   }

## Member Data Documentation

template<class INTERFACE, class IMPLEMENTATION>

Axis Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::m_xAxis`[protected]`

X axis member.

Definition at line 135 of file Generic2D.h.

Referenced by Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::adoptRepresentation().

template<class INTERFACE, class IMPLEMENTATION>

Axis Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::m_yAxis`[protected]`

Y axis member.

Definition at line 137 of file Generic2D.h.

Referenced by Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::adoptRepresentation().

template<class INTERFACE, class IMPLEMENTATION>

AIDA::Annotation Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::m_annotation`[mutable, protected]`

Object annotations.

Definition at line 139 of file Generic2D.h.

Referenced by Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::setName(), and Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::setTitle().

template<class INTERFACE, class IMPLEMENTATION>

IMPLEMENTATION* Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::m_rep`[protected]`

Reference to underlying implementation.

Definition at line 141 of file Generic2D.h.

Referenced by Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::add(), Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::adoptRepresentation(), Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::allEntries(), Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::binError(), Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::binHeight(), Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::binMeanX(), Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::binMeanY(), Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::binRms(), Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::entries(), Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::equivalentBinEntries(), Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::maxBinHeight(), Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::meanX(), Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::meanY(), Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::minBinHeight(), Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::print(), Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::reset(), Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::rmsX(), Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::rmsY(), Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::scale(), Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::setName(), Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::setTitle(), Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::sumAllBinHeights(), Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::sumBinHeights(), and Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::write().

template<class INTERFACE, class IMPLEMENTATION>

std::string Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::m_classType`[protected]`

class type

Definition at line 143 of file Generic2D.h.

template<class INTERFACE, class IMPLEMENTATION>

int Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::m_sumEntries`[protected]`

cache sumEntries (allEntries) when setting contents since Root can't compute by himself

Definition at line 145 of file Generic2D.h.

Referenced by Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::reset().

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

- /afs/cern.ch/sw/Gaudi/releases/GAUDI/GAUDI_v20r2/GaudiSvc/v17r1/src/HistogramSvc/Generic2D.h