| # Gaudi Framework, version v21r8 |

Home |  | Generated: 17 Mar 2010

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

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

`#include <GaudiPI/Generic3D.h>`

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

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

[legend]

List of all members.

## Public Types
typedef Generic3D< INTERFACE, IMPLEMENTATION > | Base
## Public Member Functions
| Generic3D ()
| Default constructor.
virtual | ~Generic3D ()
| Destructor.
TObject * | representation () const
| ROOT object implementation.
virtual void | adoptRepresentation (TObject *rep)
| Adopt ROOT histogram representation.
virtual int | dimension () const
| Get the Histogram's dimension.
virtual std::string | title () const
| Get the title of the object.
virtual bool | setTitle (const std::string &title)
| Set the title of the object.
virtual std::string | name () const
| object name
bool | setName (const std::string &newName)
| Sets the name of the object.
virtual AIDA::IAnnotation & | annotation ()
| Access annotation object.
virtual const AIDA::IAnnotation & | annotation () const
| Access annotation object (cons).
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 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.
int | rIndexX (int index) const
int | rIndexY (int index) const
int | rIndexZ (int index) const
double | binMeanX (int indexX, int, int) const
| The weighted mean along the x axis of a given bin.
double | binMeanY (int, int indexY, int) const
| The weighted mean along the y axis of a given bin.
double | binMeanZ (int, int, int indexZ) const
| The weighted mean along the z axis of a given bin.
int | binEntries (int indexX, int indexY, int indexZ) const
| Number of entries in the corresponding bin (ie the number of times fill was calle d for this bin).
virtual int | binEntriesX (int index) const
| Sum of all the entries of the bins along a given x bin.
virtual int | binEntriesY (int index) const
| Sum of all the entries of the bins along a given y bin.
virtual int | binEntriesZ (int index) const
| Sum of all the entries of the bins along a given z bin.
double | binHeight (int indexX, int indexY, int indexZ) const
| Total height of the corresponding bin (ie the sum of the weights in this bin).
virtual double | binHeightX (int index) const
| Sum of all the heights of the bins along a given x bin.
virtual double | binHeightY (int index) const
| Sum of all the heights of the bins along a given y bin.
virtual double | binHeightZ (int index) const
| Sum of all the heights of the bins along a given z bin.
virtual double | binError (int indexX, int indexY, int indexZ) const
| The error of a given bin.
virtual double | meanX () const
| The mean of the IHistogram3D along the x axis.
virtual double | meanY () const
| The mean of the IHistogram3D along the y axis.
virtual double | meanZ () const
| The mean of the IHistogram3D along the z axis.
virtual double | rmsX () const
| The RMS of the IHistogram3D along the x axis.
virtual double | rmsY () const
| The RMS of the IHistogram3D along the y axis.
virtual double | rmsZ () const
| The RMS of the IHistogram3D along the z axis.
virtual const AIDA::IAxis & | xAxis () const
| Get the x axis of the IHistogram3D.
virtual const AIDA::IAxis & | yAxis () const
| Get the y axis of the IHistogram3D.
virtual const AIDA::IAxis & | zAxis () const
| Get the z axis of the IHistogram3D.
virtual int | coordToIndexX (double coord) const
| Get the bin number corresponding to a given coordinate along the x axis.
virtual int | coordToIndexY (double coord) const
| Get the bin number corresponding to a given coordinate along the y axis.
virtual int | coordToIndexZ (double coord) const
| Get the bin number corresponding to a given coordinate along the z axis.
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 &hist)
| Add to this Histogram3D the contents of another IHistogram3D.
int | extraEntries () const
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
Gaudi::Axis | m_xAxis
Gaudi::Axis | m_yAxis
Gaudi::Axis | m_zAxis
AIDA::Annotation | m_annotation
| Object annotations.
IMPLEMENTATION * | m_rep
| Reference to underlying implementation.
std::string | m_classType
int | m_sumEntries

## Detailed Description

### template<typename INTERFACE, typename IMPLEMENTATION>
class Gaudi::Generic3D< 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 29 of file Generic3D.h.

## Member Typedef Documentation

template<typename INTERFACE, typename IMPLEMENTATION>

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

Definition at line 31 of file Generic3D.h.

## Constructor & Destructor Documentation

template<typename INTERFACE, typename IMPLEMENTATION>

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

Default constructor.

Definition at line 33 of file Generic3D.h.

    00033 : m_rep(0)  {}

template<typename INTERFACE, typename IMPLEMENTATION>

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

Destructor.

Definition at line 35 of file Generic3D.h.

    00035 { delete m_rep; }

## Member Function Documentation

template<typename INTERFACE, typename IMPLEMENTATION>

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

ROOT object implementation.

Implements Gaudi::HistogramBase.

Definition at line 37 of file Generic3D.h.

    00037 { return m_rep;                       }

template<typename INTERFACE, typename IMPLEMENTATION>

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

Adopt ROOT histogram representation.

Implements Gaudi::HistogramBase.

template<typename INTERFACE, typename IMPLEMENTATION>

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

Get the Histogram's dimension.

Definition at line 42 of file Generic3D.h.

    00042 { return 3; }

template<typename INTERFACE, typename IMPLEMENTATION>

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

Get the title of the object.

Definition at line 44 of file Generic3D.h.

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

template<class INTERFACE, class IMPLEMENTATION>

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

Set the title of the object.

Definition at line 221 of file Generic3D.h.

    00221                                                                              {
    00222     m_rep->SetTitle(title.c_str());
    00223     if ( !annotation().addItem( "Title", title ) )
    00224       m_annotation.setValue( "Title" , title );
    00225     if ( !annotation().addItem( "title", title ) )
    00226       annotation().setValue( "title", title );
    00227     return true;
    00228   }

template<typename INTERFACE, typename IMPLEMENTATION>

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

object name

Definition at line 48 of file Generic3D.h.

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

template<class INTERFACE, class IMPLEMENTATION>

bool Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::setName | ( | const std::string & | newName | ) | `[inline]`

Sets the name of the object.

Definition at line 231 of file Generic3D.h.

    00231                                                                               {
    00232     m_rep->SetName(newName.c_str());
    00233     m_annotation.setValue( "Name", newName );
    00234     return true;
    00235   }

template<typename INTERFACE, typename IMPLEMENTATION>

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

Access annotation object.

Definition at line 52 of file Generic3D.h.

    00052 { return m_annotation;               }

template<typename INTERFACE, typename IMPLEMENTATION>

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

Access annotation object (cons).

Definition at line 54 of file Generic3D.h.

    00054 { return m_annotation;               }

template<class INTERFACE, class IMPLEMENTATION>

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

Get the number or all the entries.

Definition at line 237 of file Generic3D.h.

    00237                                                                                {
    00238     return (int)m_rep->GetEntries();
    00239   }

template<class INTERFACE, class IMPLEMENTATION>

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

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

Definition at line 242 of file Generic3D.h.

    00242                                                                 {
    00243     return int(m_rep->GetEntries());
    00244   }

template<class INTERFACE, class IMPLEMENTATION>

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

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

Definition at line 257 of file Generic3D.h.

    00257                                                                     {
    00258     return m_rep->GetSumOfWeights();
    00259   }

template<class INTERFACE, class IMPLEMENTATION>

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

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

Definition at line 262 of file Generic3D.h.

    00262                                                                        {
    00263     return m_rep->GetSum();
    00264   }

template<typename INTERFACE, typename IMPLEMENTATION>

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

Get the sum of the underflow and overflow bin height.

Definition at line 65 of file Generic3D.h.

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

template<class INTERFACE, class IMPLEMENTATION>

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

Get the minimum height of the in-range bins.

Definition at line 247 of file Generic3D.h.

    00247                                                                    {
    00248     return m_rep->GetMinimum();
    00249   }

template<class INTERFACE, class IMPLEMENTATION>

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

Get the maximum height of the in-range bins.

Definition at line 252 of file Generic3D.h.

    00252                                                                    {
    00253     return m_rep->GetMaximum();
    00254   }

template<typename INTERFACE, typename IMPLEMENTATION>

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

Definition at line 71 of file Generic3D.h.

    00071 { return m_xAxis.rIndex(index);}

template<typename INTERFACE, typename IMPLEMENTATION>

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

Definition at line 72 of file Generic3D.h.

    00072 { return m_yAxis.rIndex(index);}

template<typename INTERFACE, typename IMPLEMENTATION>

int Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::rIndexZ | ( | int | index | ) | const`[inline]`

Definition at line 73 of file Generic3D.h.

    00073 { return m_zAxis.rIndex(index);}

template<typename INTERFACE, typename IMPLEMENTATION>

double Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::binMeanX | ( | int | indexX,
|  | int | ,
|  | int |  |
| ) |  |  | const`[inline]`

The weighted mean along the x axis of a given bin.

Definition at line 76 of file Generic3D.h.

    00077     { return (m_rep->GetXaxis())->GetBinCenter( rIndexX(indexX) ); }

template<typename INTERFACE, typename IMPLEMENTATION>

double Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::binMeanY | ( | int | ,
|  | int | indexY,
|  | int |  |
| ) |  |  | const`[inline]`

The weighted mean along the y axis of a given bin.

Definition at line 79 of file Generic3D.h.

    00080     { return (m_rep->GetYaxis())->GetBinCenter( rIndexY(indexY) ); }

template<typename INTERFACE, typename IMPLEMENTATION>

double Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::binMeanZ | ( | int | ,
|  | int | ,
|  | int | indexZ |
| ) |  |  | const`[inline]`

The weighted mean along the z axis of a given bin.

Definition at line 82 of file Generic3D.h.

    00083     { return (m_rep->GetYaxis())->GetBinCenter( rIndexY(indexZ) ); }

template<typename INTERFACE, typename IMPLEMENTATION>

int Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::binEntries | ( | int | indexX,
|  | int | indexY,
|  | int | indexZ |
| ) |  |  | const`[inline]`

Number of entries in the corresponding bin (ie the number of times fill was calle d for this bin).

Definition at line 85 of file Generic3D.h.

    00085                                                               {
    00086       if (binHeight(indexX, indexY, indexZ)<=0) return 0;
    00087       double xx =  binHeight(indexX, indexY, indexZ)/binError(indexX, indexY, indexZ);
    00088       return int(xx*xx+0.5);
    00089     }

template<typename INTERFACE, typename IMPLEMENTATION>

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

Sum of all the entries of the bins along a given x bin.

Definition at line 91 of file Generic3D.h.

    00091                                                 {
    00092       int n = 0;
    00093       for (int i = -2; i < yAxis().bins(); ++i)
    00094         for (int j = -2; j < zAxis().bins(); ++j)
    00095           n += binEntries(index,i,j);
    00096       return n;
    00097
    00098     }

template<typename INTERFACE, typename IMPLEMENTATION>

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

Sum of all the entries of the bins along a given y bin.

Definition at line 100 of file Generic3D.h.

    00100                                                 {
    00101       int n = 0;
    00102       for (int i = -2; i < xAxis().bins(); ++i)
    00103         for (int j = -2; j < zAxis().bins(); ++j)
    00104           n += binEntries(i,index,j);
    00105       return n;
    00106     }

template<typename INTERFACE, typename IMPLEMENTATION>

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

Sum of all the entries of the bins along a given z bin.

Definition at line 109 of file Generic3D.h.

    00109                                                 {
    00110       int n = 0;
    00111       for (int i = -2; i < xAxis().bins(); ++i)
    00112         for (int j = -2; j < yAxis().bins(); ++j)
    00113           n += binEntries(i,j,index);
    00114       return n;
    00115     }

template<typename INTERFACE, typename IMPLEMENTATION>

double Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::binHeight | ( | int | indexX,
|  | int | indexY,
|  | int | indexZ |
| ) |  |  | const`[inline]`

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

Definition at line 118 of file Generic3D.h.

    00119     { return m_rep->GetBinContent ( rIndexX(indexX), rIndexY(indexY), rIndexZ(indexZ) ); }

template<typename INTERFACE, typename IMPLEMENTATION>

virtual double Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::binHeightX | ( | int | index | ) | const`[inline, virtual]`

Sum of all the heights of the bins along a given x bin.

Definition at line 122 of file Generic3D.h.

    00122                                                   {
    00123       double s = 0;
    00124       for (int i = -2; i < yAxis().bins(); ++i)
    00125         for (int j = -2; j < zAxis().bins(); ++j)
    00126           s += binHeight(index,i,j);
    00127       return s;
    00128     }

template<typename INTERFACE, typename IMPLEMENTATION>

virtual double Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::binHeightY | ( | int | index | ) | const`[inline, virtual]`

Sum of all the heights of the bins along a given y bin.

Definition at line 130 of file Generic3D.h.

    00130                                                   {
    00131       double s = 0;
    00132       for (int i = -2; i < xAxis().bins(); ++i)
    00133         for (int j = -2; j < zAxis().bins(); ++j)
    00134           s += binHeight(i,index,j);
    00135       return s;
    00136     }

template<typename INTERFACE, typename IMPLEMENTATION>

virtual double Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::binHeightZ | ( | int | index | ) | const`[inline, virtual]`

Sum of all the heights of the bins along a given z bin.

Definition at line 138 of file Generic3D.h.

    00138                                                   {
    00139       double s = 0;
    00140       for (int i = -2; i < xAxis().bins(); ++i)
    00141         for (int j = -2; j < yAxis().bins(); ++j)
    00142           s += binHeight(i,j,index);
    00143       return s;
    00144     }

template<typename INTERFACE, typename IMPLEMENTATION>

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

The error of a given bin.

Definition at line 146 of file Generic3D.h.

    00147     { return m_rep->GetBinError ( rIndexX(indexX), rIndexY(indexY ), rIndexZ(indexZ ) ); }

template<typename INTERFACE, typename IMPLEMENTATION>

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

The mean of the IHistogram3D along the x axis.

Definition at line 149 of file Generic3D.h.

    00149 { return m_rep->GetMean ( 1); }

template<typename INTERFACE, typename IMPLEMENTATION>

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

The mean of the IHistogram3D along the y axis.

Definition at line 152 of file Generic3D.h.

    00152 { return m_rep->GetMean ( 2 ); }

template<typename INTERFACE, typename IMPLEMENTATION>

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

The mean of the IHistogram3D along the z axis.

Definition at line 154 of file Generic3D.h.

    00154 { return m_rep->GetMean ( 3 ); }

template<typename INTERFACE, typename IMPLEMENTATION>

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

The RMS of the IHistogram3D along the x axis.

Definition at line 156 of file Generic3D.h.

    00156 { return m_rep->GetRMS( 1 ); }

template<typename INTERFACE, typename IMPLEMENTATION>

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

The RMS of the IHistogram3D along the y axis.

Definition at line 158 of file Generic3D.h.

    00158 { return m_rep->GetRMS( 2 ); }

template<typename INTERFACE, typename IMPLEMENTATION>

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

The RMS of the IHistogram3D along the z axis.

Definition at line 160 of file Generic3D.h.

    00160 { return m_rep->GetRMS( 3 ); }

template<typename INTERFACE, typename IMPLEMENTATION>

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

Get the x axis of the IHistogram3D.

Definition at line 162 of file Generic3D.h.

    00162 { return m_xAxis; }

template<typename INTERFACE, typename IMPLEMENTATION>

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

Get the y axis of the IHistogram3D.

Definition at line 164 of file Generic3D.h.

    00164 { return m_yAxis; }

template<typename INTERFACE, typename IMPLEMENTATION>

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

Get the z axis of the IHistogram3D.

Definition at line 166 of file Generic3D.h.

    00166 { return m_zAxis; }

template<typename INTERFACE, typename IMPLEMENTATION>

virtual int Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::coordToIndexX | ( | double | coord | ) | const`[inline, virtual]`

Get the bin number corresponding to a given coordinate along the x axis.

Definition at line 168 of file Generic3D.h.

    00168 { return xAxis().coordToIndex(coord);}

template<typename INTERFACE, typename IMPLEMENTATION>

virtual int Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::coordToIndexY | ( | double | coord | ) | const`[inline, virtual]`

Get the bin number corresponding to a given coordinate along the y axis.

Definition at line 170 of file Generic3D.h.

    00170 { return yAxis().coordToIndex(coord);}

template<typename INTERFACE, typename IMPLEMENTATION>

virtual int Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::coordToIndexZ | ( | double | coord | ) | const`[inline, virtual]`

Get the bin number corresponding to a given coordinate along the z axis.

Definition at line 172 of file Generic3D.h.

    00172 { return zAxis().coordToIndex(coord);}

template<class INTERFACE, class IMPLEMENTATION>

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

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

Definition at line 267 of file Generic3D.h.

    00267                                                                           {
    00268     if (sumBinHeights() <= 0) return 0;
    00269     Stat_t stats[11];   // cover up to 3D...
    00270     m_rep->GetStats(stats);
    00271     return stats[0]*stats[0]/stats[1];
    00272   }

template<class INTERFACE, class IMPLEMENTATION>

bool Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::scale | ( | double | scaleFactor | ) | `[inline, 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 275 of file Generic3D.h.

    00275                                                                       {
    00276     m_rep->Scale ( scaleFactor );
    00277     return true;
    00278   }

template<typename INTERFACE, typename IMPLEMENTATION>

virtual bool Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::add | ( | const INTERFACE & | hist | ) | `[inline, virtual]`

Add to this Histogram3D the contents of another IHistogram3D.

Definition at line 179 of file Generic3D.h.

    00179                                                  {
    00180       const Base* p = dynamic_cast<const Base*>(&hist);
    00181       if ( p )  {
    00182         m_rep->Add(p->m_rep);
    00183         return true;
    00184       }
    00185       throw std::runtime_error("Cannot add profile histograms of different implementations.");
    00186     }

template<typename INTERFACE, typename IMPLEMENTATION>

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

Definition at line 189 of file Generic3D.h.

    00189                              {
    00190       return
    00191         binEntries(AIDA::IAxis::UNDERFLOW_BIN,AIDA::IAxis::UNDERFLOW_BIN,AIDA::IAxis::UNDERFLOW_BIN) +
    00192         binEntries(AIDA::IAxis::UNDERFLOW_BIN,AIDA::IAxis::UNDERFLOW_BIN,AIDA::IAxis::OVERFLOW_BIN)  +
    00193         binEntries(AIDA::IAxis::UNDERFLOW_BIN, AIDA::IAxis::OVERFLOW_BIN,AIDA::IAxis::UNDERFLOW_BIN)  +
    00194         binEntries(AIDA::IAxis::OVERFLOW_BIN,AIDA::IAxis::UNDERFLOW_BIN,AIDA::IAxis::UNDERFLOW_BIN) +
    00195         binEntries(AIDA::IAxis::OVERFLOW_BIN,AIDA::IAxis::UNDERFLOW_BIN,AIDA::IAxis::OVERFLOW_BIN) +
    00196         binEntries(AIDA::IAxis::OVERFLOW_BIN,AIDA::IAxis::OVERFLOW_BIN,AIDA::IAxis::UNDERFLOW_BIN)  +
    00197         binEntries(AIDA::IAxis::OVERFLOW_BIN, AIDA::IAxis::OVERFLOW_BIN,AIDA::IAxis::OVERFLOW_BIN);
    00198     }

template<class INTERFACE, class IMPLEMENTATION>

std::ostream & Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::print | ( | std::ostream & | s | ) | const`[inline, 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 281 of file Generic3D.h.

    00282   {
    00284     m_rep->Print("all");
    00285     return s;
    00286   }

template<class INTERFACE, class IMPLEMENTATION>

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

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

Implements Gaudi::HistogramBase.

Definition at line 291 of file Generic3D.h.

    00292   {
    00293     s << "\n3D Histogram Table: " << std::endl;
    00294     s << "BinX, BinY, BinZ, Height, Error " << std::endl;
    00295     for ( int i = 0; i < xAxis().bins(); ++i )
    00296       for ( int j = 0; j < yAxis().bins(); ++j )
    00297         for ( int k = 0; k < zAxis().bins(); ++k )
    00298         s << binMeanX( i, j, k )    << ", "
    00299           << binMeanY( i, j, k )    << ", "
    00300           << binMeanZ( i, j, k )    << ", "
    00301           << binHeight( i, j, k ) << ", "
    00302           << binError ( i, j, k ) << std::endl;
    00303     s << std::endl;
    00304     return s;
    00305   }

template<class INTERFACE, class IMPLEMENTATION>

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

Write (ASCII) the histogram table into a file.

Implements Gaudi::HistogramBase.

Definition at line 309 of file Generic3D.h.

    00310   {
    00311     TFile *f = TFile::Open(file_name,"RECREATE");
    00312     Int_t nbytes = m_rep->Write();
    00313     f->Close();
    00314     return nbytes;
    00315   }

template<>

void Gaudi::Generic3D< AIDA::IHistogram3D, TH3D >::adoptRepresentation | ( | TObject * | rep | ) | `[inline, virtual]`

Adopt ROOT histogram representation.

Implements Gaudi::HistogramBase.

Definition at line 51 of file H3D.cpp.

    00051                                                                           {
    00052     TH3D* imp = dynamic_cast<TH3D*>(rep);
    00053     if ( imp )  {
    00054       if ( m_rep ) delete m_rep;
    00055       m_rep = imp;
    00056       m_xAxis.initialize(m_rep->GetXaxis(),true);
    00057       m_yAxis.initialize(m_rep->GetYaxis(),true);
    00058       m_zAxis.initialize(m_rep->GetZaxis(),true);
    00059       const TArrayD* a = m_rep->GetSumw2();
    00060       if ( 0 == a || (a && a->GetSize()==0) ) m_rep->Sumw2();
    00061       setTitle(m_rep->GetTitle());
    00062       return;
    00063     }
    00064     throw std::runtime_error("Cannot adopt native histogram representation.");
    00065   }

## Member Data Documentation

template<typename INTERFACE, typename IMPLEMENTATION>

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

Definition at line 207 of file Generic3D.h.

template<typename INTERFACE, typename IMPLEMENTATION>

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

Definition at line 208 of file Generic3D.h.

template<typename INTERFACE, typename IMPLEMENTATION>

Gaudi::Axis Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::m_zAxis`[protected]`

Definition at line 209 of file Generic3D.h.

template<typename INTERFACE, typename IMPLEMENTATION>

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

Object annotations.

Definition at line 211 of file Generic3D.h.

template<typename INTERFACE, typename IMPLEMENTATION>

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

Reference to underlying implementation.

Definition at line 213 of file Generic3D.h.

template<typename INTERFACE, typename IMPLEMENTATION>

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

Definition at line 215 of file Generic3D.h.

template<typename INTERFACE, typename IMPLEMENTATION>

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

Definition at line 217 of file Generic3D.h.

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

- /afs/cern.ch/sw/Gaudi/releases/GAUDI/GAUDI_v21r8/GaudiSvc/src/HistogramSvc/Generic3D.h