Gaudi Framework, version v20r4

Generated: 8 Jan 2009

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

#include <GaudiPI/Generic3D.h>

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

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

Collaboration graph
[legend]

List of all members.


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 27 of file Generic3D.h.


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

Member Typedef Documentation

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

Definition at line 29 of file Generic3D.h.


Constructor & Destructor Documentation

template<typename INTERFACE, typename IMPLEMENTATION>
Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::Generic3D (  )  [inline]

Default constructor.

Definition at line 31 of file Generic3D.h.

00031 : m_rep(0)  {}

template<typename INTERFACE, typename IMPLEMENTATION>
virtual Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::~Generic3D (  )  [inline, virtual]

Destructor.

Definition at line 33 of file Generic3D.h.

00033 { 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 35 of file Generic3D.h.

00035 { 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 40 of file Generic3D.h.

00040 { 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 42 of file Generic3D.h.

00042 {  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 219 of file Generic3D.h.

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

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

object name

Definition at line 46 of file Generic3D.h.

00046 { 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 229 of file Generic3D.h.

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

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

Access annotation object.

Definition at line 50 of file Generic3D.h.

00050 { 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 52 of file Generic3D.h.

00052 { 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 235 of file Generic3D.h.

00235                                                                                {
00236     return (int)m_rep->GetEntries(); 
00237   }

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 240 of file Generic3D.h.

00240                                                                 {
00241     return int(m_rep->GetEntries()); 
00242   }

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 255 of file Generic3D.h.

00255                                                                     { 
00256     return m_rep->GetSumOfWeights(); 
00257   }

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 260 of file Generic3D.h.

00260                                                                        { 
00261     return m_rep->GetSum(); 
00262   }

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

00063 { 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 245 of file Generic3D.h.

00245                                                                    { 
00246     return m_rep->GetMinimum(); 
00247   }

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 250 of file Generic3D.h.

00250                                                                    {
00251     return m_rep->GetMaximum(); 
00252   }

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

Definition at line 69 of file Generic3D.h.

00069 { return m_xAxis.rIndex(index);}

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

Definition at line 70 of file Generic3D.h.

00070 { return m_yAxis.rIndex(index);}

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

Definition at line 71 of file Generic3D.h.

00071 { 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 74 of file Generic3D.h.

00075     { 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 77 of file Generic3D.h.

00078     { 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 80 of file Generic3D.h.

00081     { 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 83 of file Generic3D.h.

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

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 89 of file Generic3D.h.

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

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 98 of file Generic3D.h.

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

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 107 of file Generic3D.h.

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

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 116 of file Generic3D.h.

00117     { 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 120 of file Generic3D.h.

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

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

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

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 136 of file Generic3D.h.

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

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 144 of file Generic3D.h.

00145     { 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 147 of file Generic3D.h.

00147 { 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 150 of file Generic3D.h.

00150 { 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 152 of file Generic3D.h.

00152 { 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 154 of file Generic3D.h.

00154 { 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 156 of file Generic3D.h.

00156 { 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 158 of file Generic3D.h.

00158 { 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 160 of file Generic3D.h.

00160 { 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 162 of file Generic3D.h.

00162 { 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 164 of file Generic3D.h.

00164 { 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 166 of file Generic3D.h.

00166 { 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 168 of file Generic3D.h.

00168 { 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 170 of file Generic3D.h.

00170 { 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 265 of file Generic3D.h.

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

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 273 of file Generic3D.h.

00273                                                                       {
00274     m_rep->Scale ( scaleFactor ); 
00275     return true; 
00276   }

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 177 of file Generic3D.h.

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

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

Definition at line 187 of file Generic3D.h.

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

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 279 of file Generic3D.h.

00280   {
00282     m_rep->Print("all");
00283     return s;
00284   }

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 289 of file Generic3D.h.

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

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 307 of file Generic3D.h.

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

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 205 of file Generic3D.h.

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

Definition at line 206 of file Generic3D.h.

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

Definition at line 207 of file Generic3D.h.

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

Object annotations.

Definition at line 209 of file Generic3D.h.

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

Reference to underlying implementation.

Definition at line 211 of file Generic3D.h.

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

Definition at line 213 of file Generic3D.h.

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

Definition at line 215 of file Generic3D.h.


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

Generated at Thu Jan 8 17:53:41 2009 for Gaudi Framework, version v20r4 by Doxygen version 1.5.6 written by Dimitri van Heesch, © 1997-2004