Gaudi Framework, version v21r6

Home   Generated: 11 Nov 2009

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

#include <GaudiPI/Generic2D.h>

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

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

Collaboration graph
[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 30 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::stringuserLevelClassType () const
 The AIDA user-level unterface leaf class type.
virtual int dimension () const
 Get the Histogram's dimension.
virtual std::ostreamprint (std::ostream &s) const
 Print (ASCII) the histogram into the output stream.
virtual std::ostreamwrite (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 * cast (const std::string &className) const
template<>
int binEntries (int indexX, int indexY) const
template<>
void adoptRepresentation (TObject *rep)
 Adopt ROOT histogram representation.
template<>
void * cast (const std::string &className) const
template<>
int binEntries (int idX, int idY) const
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 32 of file Generic2D.h.


Constructor & Destructor Documentation

template<class INTERFACE, class IMPLEMENTATION>
Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::Generic2D (  )  [inline]

Definition at line 34 of file Generic2D.h.

00034 : m_rep(0) {}

template<class INTERFACE, class IMPLEMENTATION>
virtual Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::~Generic2D (  )  [inline, virtual]

Destructor.

Definition at line 37 of file Generic2D.h.

00037 {  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 40 of file Generic2D.h.

00040 { 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 44 of file Generic2D.h.

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

template<class INTERFACE, class IMPLEMENTATION>
bool Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::setTitle ( const std::string title  )  [inline, virtual]

Set the title of the object.

Definition at line 151 of file Generic2D.h.

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

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

object name

Definition at line 48 of file Generic2D.h.

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

template<class INTERFACE, class IMPLEMENTATION>
bool Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::setName ( const std::string newName  )  [inline]

Set the name of the object.

Definition at line 161 of file Generic2D.h.

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

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

Access annotation object.

Definition at line 52 of file Generic2D.h.

00052 { 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 54 of file Generic2D.h.

00054 { 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 57 of file Generic2D.h.

00057 { 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 59 of file Generic2D.h.

00059 { 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 61 of file Generic2D.h.

00061 { 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 63 of file Generic2D.h.

00063 { return m_yAxis.rIndex(index);  }

template<class INTERFACE, class IMPLEMENTATION>
int Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::entries (  )  const [inline, virtual]

Get the number or all the entries.

Definition at line 168 of file Generic2D.h.

00168                                                                                {
00169     return (int)m_rep->GetEntries();
00170   }

template<class INTERFACE, class IMPLEMENTATION>
int Gaudi::Generic2D< 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 173 of file Generic2D.h.

00173                                                                 {
00174     return int(m_rep->GetEntries());
00175   }

template<class INTERFACE, class IMPLEMENTATION>
int Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::extraEntries (  )  const [inline, virtual]

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

Definition at line 296 of file Generic2D.h.

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

template<class INTERFACE, class IMPLEMENTATION>
double Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::sumBinHeights (  )  const [inline, virtual]

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

Definition at line 188 of file Generic2D.h.

00188                                                                     {
00189     return m_rep->GetSumOfWeights();
00190   }

template<class INTERFACE, class IMPLEMENTATION>
double Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::sumAllBinHeights (  )  const [inline, virtual]

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

Definition at line 193 of file Generic2D.h.

00193                                                                        {
00194     return m_rep->GetSum();
00195   }

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 76 of file Generic2D.h.

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

template<class INTERFACE, class IMPLEMENTATION>
double Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::minBinHeight (  )  const [inline, virtual]

Get the minimum height of the in-range bins.

Definition at line 178 of file Generic2D.h.

00178                                                                    {
00179     return m_rep->GetMinimum();
00180   }

template<class INTERFACE, class IMPLEMENTATION>
double Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::maxBinHeight (  )  const [inline, virtual]

Get the maximum height of the in-range bins.

Definition at line 183 of file Generic2D.h.

00183                                                                    {
00184     return m_rep->GetMaximum();
00185   }

template<class INTERFACE, class IMPLEMENTATION>
double Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::binMeanX ( int  indexX,
int  indexY 
) const [inline, virtual]

The weighted mean along x of a given bin.

Definition at line 203 of file Generic2D.h.

00203                                                                             {
00204     return (m_rep->GetXaxis())->GetBinCenter( rIndexX(indexX) );
00205   }

template<class INTERFACE, class IMPLEMENTATION>
double Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::binMeanY ( int  indexX,
int  indexY 
) const [inline, virtual]

The weighted mean along y of a given bin.

Definition at line 208 of file Generic2D.h.

00208                                                                             {
00209     return (m_rep->GetYaxis())->GetBinCenter( rIndexY(indexY) );
00210   }

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).

template<class INTERFACE, class IMPLEMENTATION>
int Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::binEntriesX ( int  indexX  )  const [inline, virtual]

Equivalent to projectionX().binEntries(indexX).

Definition at line 213 of file Generic2D.h.

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

template<class INTERFACE, class IMPLEMENTATION>
int Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::binEntriesY ( int  indexY  )  const [inline, virtual]

Equivalent to projectionY().binEntries(indexY).

Definition at line 221 of file Generic2D.h.

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

template<class INTERFACE, class IMPLEMENTATION>
double Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::binHeight ( int  indexX,
int  indexY 
) const [inline, virtual]

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

Definition at line 229 of file Generic2D.h.

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

template<class INTERFACE, class IMPLEMENTATION>
double Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::binHeightX ( int  indexX  )  const [inline, virtual]

Equivalent to projectionX().binHeight(indexX).

Definition at line 234 of file Generic2D.h.

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

template<class INTERFACE, class IMPLEMENTATION>
double Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::binHeightY ( int  indexY  )  const [inline, virtual]

Equivalent to projectionY().binHeight(indexY).

Definition at line 243 of file Generic2D.h.

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

template<class INTERFACE, class IMPLEMENTATION>
double Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::binError ( int  indexX,
int  indexY 
) const [inline, virtual]

The error on this bin.

Definition at line 251 of file Generic2D.h.

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

template<class INTERFACE, class IMPLEMENTATION>
double Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::binRms ( int  indexX,
int  indexY 
) const [inline, virtual]

The spread (RMS) of this bin.

Definition at line 198 of file Generic2D.h.

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

template<class INTERFACE, class IMPLEMENTATION>
double Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::meanX (  )  const [inline, virtual]

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

Definition at line 256 of file Generic2D.h.

00256                                                            {
00257     return m_rep->GetMean(1);
00258   }

template<class INTERFACE, class IMPLEMENTATION>
double Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::meanY (  )  const [inline, virtual]

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

Definition at line 261 of file Generic2D.h.

00261                                                            {
00262     return m_rep->GetMean(2);
00263   }

template<class INTERFACE, class IMPLEMENTATION>
double Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::rmsX (  )  const [inline, virtual]

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

Definition at line 266 of file Generic2D.h.

00266                                                           {
00267     return m_rep->GetRMS(1);
00268   }

template<class INTERFACE, class IMPLEMENTATION>
double Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::rmsY (  )  const [inline, virtual]

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

Definition at line 271 of file Generic2D.h.

00271                                                           {
00272     return m_rep->GetRMS(2);
00273   }

template<class INTERFACE, class IMPLEMENTATION>
int Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::coordToIndexX ( double  coordX  )  const [inline, virtual]

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

Definition at line 276 of file Generic2D.h.

00276                                                                               {
00277     return xAxis().coordToIndex(coord);
00278   }

template<class INTERFACE, class IMPLEMENTATION>
int Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::coordToIndexY ( double  coordY  )  const [inline, virtual]

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

Definition at line 281 of file Generic2D.h.

00281                                                                               {
00282     return yAxis().coordToIndex(coord);
00283   }

template<class INTERFACE, class IMPLEMENTATION>
double Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::equivalentBinEntries (  )  const [inline, virtual]

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

Definition at line 305 of file Generic2D.h.

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

template<class INTERFACE, class IMPLEMENTATION>
bool Gaudi::Generic2D< 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 313 of file Generic2D.h.

00313                                                                       {
00314     m_rep->Scale ( scaleFactor );
00315     return true;
00316   }

template<class INTERFACE, class IMPLEMENTATION>
bool Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::add ( const INTERFACE &  h  )  [inline, virtual]

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

Definition at line 286 of file Generic2D.h.

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

template<class INTERFACE, class IMPLEMENTATION>
bool Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::reset (  )  [inline]

Reimplemented in Gaudi::Histogram2D.

Definition at line 319 of file Generic2D.h.

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

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 125 of file Generic2D.h.

00125 { 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 127 of file Generic2D.h.

00127 { return 2; }

template<class INTERFACE, class IMPLEMENTATION>
std::ostream & Gaudi::Generic2D< 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 326 of file Generic2D.h.

00327   {
00329     m_rep->Print("all");
00330     return s;
00331   }

template<class INTERFACE, class IMPLEMENTATION>
std::ostream & Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::write ( std::ostream s  )  const [inline, virtual]

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

Implements Gaudi::HistogramBase.

Definition at line 335 of file Generic2D.h.

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

template<class INTERFACE, class IMPLEMENTATION>
int Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::write ( const char *  file_name  )  const [inline, virtual]

Write (ASCII) the histogram table into a file.

Implements Gaudi::HistogramBase.

Definition at line 353 of file Generic2D.h.

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

template<>
void * Gaudi::Generic2D< IHistogram2D, TH2D >::cast ( const std::string className  )  const [inline]

Definition at line 80 of file H2D.cpp.

00080                                                                              {
00081     if (className == "AIDA::IHistogram2D") 
00082       return (IHistogram2D*)this; 
00083     else if (className == "AIDA::IHistogram") 
00084       return (IHistogram*)this;
00085     return 0;
00086   }

template<>
int Gaudi::Generic2D< IHistogram2D, TH2D >::binEntries ( int  indexX,
int  indexY 
) const [inline]

Definition at line 89 of file H2D.cpp.

00089                                                                           {
00090     if (binHeight(indexX, indexY)<=0) return 0;
00091     double xx =  binHeight(indexX, indexY)/binError(indexX, indexY);
00092     return int(xx*xx+0.5);
00093   }

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

Adopt ROOT histogram representation.

Implements Gaudi::HistogramBase.

Definition at line 96 of file H2D.cpp.

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   }

template<>
void * Gaudi::Generic2D< AIDA::IProfile2D, TProfile2D >::cast ( const std::string className  )  const [inline]

Definition at line 45 of file P2D.cpp.

00045                                                                                     {
00046     if (className == "AIDA::IProfile2D")
00047       return const_cast<AIDA::IProfile2D*>((AIDA::IProfile2D*)this);
00048     else if (className == "AIDA::IProfile")
00049       return const_cast<AIDA::IProfile*>((AIDA::IProfile*)this);
00050     else if (className == "AIDA::IBaseHistogram")
00051       return const_cast<AIDA::IBaseHistogram*>((AIDA::IBaseHistogram*)this);
00052     return 0;
00053   }

template<>
int Gaudi::Generic2D< AIDA::IProfile2D, TProfile2D >::binEntries ( int  idX,
int  idY 
) const [inline]

Definition at line 56 of file P2D.cpp.

00056                                                                                {
00057     int rBin = m_rep->GetBin(rIndexX(idX),rIndexY(idY));
00058     return int(m_rep->GetBinEntries(rBin)+0.5);
00059   }

template<>
void Gaudi::Generic2D< AIDA::IProfile2D, TProfile2D >::adoptRepresentation ( TObject *  rep  )  [inline, virtual]

Adopt ROOT histogram representation.

Implements Gaudi::HistogramBase.

Definition at line 62 of file P2D.cpp.

00062                                                                              {
00063     TProfile2D* imp = dynamic_cast<TProfile2D*>(rep);
00064     if ( imp )  {
00065       if ( m_rep ) delete m_rep;
00066       m_rep = imp;
00067       m_xAxis.initialize(m_rep->GetXaxis(),true);
00068       m_yAxis.initialize(m_rep->GetYaxis(),true);
00069       setTitle(m_rep->GetTitle());
00070       return;
00071     }
00072     throw std::runtime_error("Cannot adopt native histogram representation.");
00073   }


Member Data Documentation

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

X axis member.

Definition at line 137 of file Generic2D.h.

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

Y axis member.

Definition at line 139 of file Generic2D.h.

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

Object annotations.

Definition at line 141 of file Generic2D.h.

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

Reference to underlying implementation.

Definition at line 143 of file Generic2D.h.

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

class type

Definition at line 145 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 147 of file Generic2D.h.


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

Generated at Wed Nov 11 16:36:36 2009 for Gaudi Framework, version v21r6 by Doxygen version 1.5.6 written by Dimitri van Heesch, © 1997-2004