All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 >:
Collaboration diagram for Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >:

Public Types

typedef Generic3D< INTERFACE,
IMPLEMENTATION > 
Base
 

Public Member Functions

 Generic3D ()
 Default constructor. More...
 
virtual ~Generic3D ()
 Destructor. More...
 
TObject * representation () const
 ROOT object implementation. More...
 
virtual void adoptRepresentation (TObject *rep)
 Adopt ROOT histogram representation. More...
 
virtual int dimension () const
 Get the Histogram's dimension. More...
 
virtual std::string title () const
 Get the title of the object. More...
 
virtual bool setTitle (const std::string &title)
 Set the title of the object. More...
 
virtual std::string name () const
 object name More...
 
bool setName (const std::string &newName)
 Sets the name of the object. More...
 
virtual AIDA::IAnnotation & annotation ()
 Access annotation object. More...
 
virtual const AIDA::IAnnotation & annotation () const
 Access annotation object (cons) More...
 
virtual int entries () const
 Get the number or all the entries. More...
 
virtual int allEntries () const
 Get the number or all the entries, both in range and underflow/overflow bins of the IProfile. More...
 
virtual double sumBinHeights () const
 Get the sum of in range bin heights in the IProfile. More...
 
virtual double sumAllBinHeights () const
 Get the sum of all the bins heights (including underflow and overflow bin). More...
 
virtual double sumExtraBinHeights () const
 Get the sum of the underflow and overflow bin height. More...
 
virtual double minBinHeight () const
 Get the minimum height of the in-range bins. More...
 
virtual double maxBinHeight () const
 Get the maximum height of the in-range bins. More...
 
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. More...
 
double binMeanY (int, int indexY, int) const
 The weighted mean along the y axis of a given bin. More...
 
double binMeanZ (int, int, int indexZ) const
 The weighted mean along the z axis of a given bin. More...
 
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). More...
 
virtual int binEntriesX (int index) const
 Sum of all the entries of the bins along a given x bin. More...
 
virtual int binEntriesY (int index) const
 Sum of all the entries of the bins along a given y bin. More...
 
virtual int binEntriesZ (int index) const
 Sum of all the entries of the bins along a given z bin. More...
 
double binHeight (int indexX, int indexY, int indexZ) const
 Total height of the corresponding bin (ie the sum of the weights in this bin). More...
 
virtual double binHeightX (int index) const
 Sum of all the heights of the bins along a given x bin. More...
 
virtual double binHeightY (int index) const
 Sum of all the heights of the bins along a given y bin. More...
 
virtual double binHeightZ (int index) const
 Sum of all the heights of the bins along a given z bin. More...
 
virtual double binError (int indexX, int indexY, int indexZ) const
 The error of a given bin. More...
 
virtual double meanX () const
 The mean of the IHistogram3D along the x axis. More...
 
virtual double meanY () const
 The mean of the IHistogram3D along the y axis. More...
 
virtual double meanZ () const
 The mean of the IHistogram3D along the z axis. More...
 
virtual double rmsX () const
 The RMS of the IHistogram3D along the x axis. More...
 
virtual double rmsY () const
 The RMS of the IHistogram3D along the y axis. More...
 
virtual double rmsZ () const
 The RMS of the IHistogram3D along the z axis. More...
 
virtual const AIDA::IAxis & xAxis () const
 Get the x axis of the IHistogram3D. More...
 
virtual const AIDA::IAxis & yAxis () const
 Get the y axis of the IHistogram3D. More...
 
virtual const AIDA::IAxis & zAxis () const
 Get the z axis of the IHistogram3D. More...
 
virtual int coordToIndexX (double coord) const
 Get the bin number corresponding to a given coordinate along the x axis. More...
 
virtual int coordToIndexY (double coord) const
 Get the bin number corresponding to a given coordinate along the y axis. More...
 
virtual int coordToIndexZ (double coord) const
 Get the bin number corresponding to a given coordinate along the z axis. More...
 
virtual double equivalentBinEntries () const
 Number of equivalent entries, i.e. SUM[ weight ] ^ 2 / SUM[ weight^2 ] More...
 
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. More...
 
virtual bool add (const INTERFACE &hist)
 Add to this Histogram3D the contents of another IHistogram3D. More...
 
int extraEntries () const
 
virtual std::ostream & print (std::ostream &s) const
 Print (ASCII) the histogram into the output stream. More...
 
virtual std::ostream & write (std::ostream &s) const
 Write (ASCII) the histogram table into the output stream. More...
 
virtual int write (const char *file_name) const
 Write (ASCII) the histogram table into a file. More...
 
template<>
void adoptRepresentation (TObject *rep)
 Adopt ROOT histogram representation. More...
 
- Public Member Functions inherited from Gaudi::HistogramBase
virtual ~HistogramBase ()
 

Protected Attributes

Gaudi::Axis m_xAxis
 
Gaudi::Axis m_yAxis
 
Gaudi::Axis m_zAxis
 
AIDA::Annotation m_annotation
 Object annotations. More...
 
IMPLEMENTATION * m_rep
 Reference to underlying implementation. More...
 
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.

33 : m_rep(0) {}
IMPLEMENTATION * m_rep
Reference to underlying implementation.
Definition: Generic3D.h:213
template<typename INTERFACE, typename IMPLEMENTATION>
virtual Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::~Generic3D ( )
inlinevirtual

Destructor.

Definition at line 35 of file Generic3D.h.

35 { delete m_rep; }
IMPLEMENTATION * m_rep
Reference to underlying implementation.
Definition: Generic3D.h:213

Member Function Documentation

template<typename INTERFACE, typename IMPLEMENTATION>
virtual bool Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::add ( const INTERFACE &  hist)
inlinevirtual

Add to this Histogram3D the contents of another IHistogram3D.

Definition at line 179 of file Generic3D.h.

179  {
180  const Base* p = dynamic_cast<const Base*>(&hist);
181  if ( p ) {
182  m_rep->Add(p->m_rep);
183  return true;
184  }
185  throw std::runtime_error("Cannot add profile histograms of different implementations.");
186  }
IMPLEMENTATION * m_rep
Reference to underlying implementation.
Definition: Generic3D.h:213
Generic3D< INTERFACE, IMPLEMENTATION > Base
Definition: Generic3D.h:31
template<typename INTERFACE, typename IMPLEMENTATION>
virtual void Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::adoptRepresentation ( TObject *  rep)
virtual

Adopt ROOT histogram representation.

Implements Gaudi::HistogramBase.

template<>
void Gaudi::Generic3D< AIDA::IHistogram3D, TH3D >::adoptRepresentation ( TObject *  rep)
virtual

Adopt ROOT histogram representation.

Implements Gaudi::HistogramBase.

Definition at line 61 of file H3D.cpp.

61  {
62  TH3D* imp = dynamic_cast<TH3D*>(rep);
63  if ( imp ) {
64  if ( m_rep ) delete m_rep;
65  m_rep = imp;
66  m_xAxis.initialize(m_rep->GetXaxis(),true);
67  m_yAxis.initialize(m_rep->GetYaxis(),true);
68  m_zAxis.initialize(m_rep->GetZaxis(),true);
69  const TArrayD* a = m_rep->GetSumw2();
70  if ( 0 == a || (a && a->GetSize()==0) ) m_rep->Sumw2();
71  setTitle(m_rep->GetTitle());
72  return;
73  }
74  throw std::runtime_error("Cannot adopt native histogram representation.");
75  }
Gaudi::Axis m_xAxis
Definition: Generic3D.h:207
Gaudi::Axis m_yAxis
Definition: Generic3D.h:208
IMPLEMENTATION * m_rep
Reference to underlying implementation.
Definition: Generic3D.h:213
Gaudi::Axis m_zAxis
Definition: Generic3D.h:209
void initialize(TAxis *itaxi, bool)
Definition: Axis.h:71
virtual bool setTitle(const std::string &title)
Set the title of the object.
Definition: Generic3D.h:221
template<class INTERFACE , class IMPLEMENTATION >
int Gaudi::Generic3D< 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 242 of file Generic3D.h.

242  {
243  return int(m_rep->GetEntries());
244  }
IMPLEMENTATION * m_rep
Reference to underlying implementation.
Definition: Generic3D.h:213
template<typename INTERFACE, typename IMPLEMENTATION>
virtual AIDA::IAnnotation& Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::annotation ( )
inlinevirtual

Access annotation object.

Definition at line 52 of file Generic3D.h.

52 { return m_annotation; }
AIDA::Annotation m_annotation
Object annotations.
Definition: Generic3D.h:211
template<typename INTERFACE, typename IMPLEMENTATION>
virtual const AIDA::IAnnotation& Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::annotation ( ) const
inlinevirtual

Access annotation object (cons)

Definition at line 54 of file Generic3D.h.

54 { return m_annotation; }
AIDA::Annotation m_annotation
Object annotations.
Definition: Generic3D.h:211
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.

85  {
86  if (binHeight(indexX, indexY, indexZ)<=0) return 0;
87  double xx = binHeight(indexX, indexY, indexZ)/binError(indexX, indexY, indexZ);
88  return int(xx*xx+0.5);
89  }
double binHeight(int indexX, int indexY, int indexZ) const
Total height of the corresponding bin (ie the sum of the weights in this bin).
Definition: Generic3D.h:118
virtual double binError(int indexX, int indexY, int indexZ) const
The error of a given bin.
Definition: Generic3D.h:146
template<typename INTERFACE, typename IMPLEMENTATION>
virtual int Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::binEntriesX ( int  index) const
inlinevirtual

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

Definition at line 91 of file Generic3D.h.

91  {
92  int n = 0;
93  for (int i = -2; i < yAxis().bins(); ++i)
94  for (int j = -2; j < zAxis().bins(); ++j)
95  n += binEntries(index,i,j);
96  return n;
97 
98  }
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)...
Definition: Generic3D.h:85
virtual const AIDA::IAxis & zAxis() const
Get the z axis of the IHistogram3D.
Definition: Generic3D.h:166
list i
Definition: ana.py:128
virtual const AIDA::IAxis & yAxis() const
Get the y axis of the IHistogram3D.
Definition: Generic3D.h:164
template<typename INTERFACE, typename IMPLEMENTATION>
virtual int Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::binEntriesY ( int  index) const
inlinevirtual

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

Definition at line 100 of file Generic3D.h.

100  {
101  int n = 0;
102  for (int i = -2; i < xAxis().bins(); ++i)
103  for (int j = -2; j < zAxis().bins(); ++j)
104  n += binEntries(i,index,j);
105  return n;
106  }
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)...
Definition: Generic3D.h:85
virtual const AIDA::IAxis & zAxis() const
Get the z axis of the IHistogram3D.
Definition: Generic3D.h:166
virtual const AIDA::IAxis & xAxis() const
Get the x axis of the IHistogram3D.
Definition: Generic3D.h:162
list i
Definition: ana.py:128
template<typename INTERFACE, typename IMPLEMENTATION>
virtual int Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::binEntriesZ ( int  index) const
inlinevirtual

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

Definition at line 109 of file Generic3D.h.

109  {
110  int n = 0;
111  for (int i = -2; i < xAxis().bins(); ++i)
112  for (int j = -2; j < yAxis().bins(); ++j)
113  n += binEntries(i,j,index);
114  return n;
115  }
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)...
Definition: Generic3D.h:85
virtual const AIDA::IAxis & xAxis() const
Get the x axis of the IHistogram3D.
Definition: Generic3D.h:162
list i
Definition: ana.py:128
virtual const AIDA::IAxis & yAxis() const
Get the y axis of the IHistogram3D.
Definition: Generic3D.h:164
template<typename INTERFACE, typename IMPLEMENTATION>
virtual double Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::binError ( int  indexX,
int  indexY,
int  indexZ 
) const
inlinevirtual

The error of a given bin.

Definition at line 146 of file Generic3D.h.

147  { return m_rep->GetBinError ( rIndexX(indexX), rIndexY(indexY ), rIndexZ(indexZ ) ); }
int rIndexZ(int index) const
Definition: Generic3D.h:73
int rIndexX(int index) const
Definition: Generic3D.h:71
IMPLEMENTATION * m_rep
Reference to underlying implementation.
Definition: Generic3D.h:213
int rIndexY(int index) const
Definition: Generic3D.h:72
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.

119  { return m_rep->GetBinContent ( rIndexX(indexX), rIndexY(indexY), rIndexZ(indexZ) ); }
int rIndexZ(int index) const
Definition: Generic3D.h:73
int rIndexX(int index) const
Definition: Generic3D.h:71
IMPLEMENTATION * m_rep
Reference to underlying implementation.
Definition: Generic3D.h:213
int rIndexY(int index) const
Definition: Generic3D.h:72
template<typename INTERFACE, typename IMPLEMENTATION>
virtual double Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::binHeightX ( int  index) const
inlinevirtual

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

Definition at line 122 of file Generic3D.h.

122  {
123  double s = 0;
124  for (int i = -2; i < yAxis().bins(); ++i)
125  for (int j = -2; j < zAxis().bins(); ++j)
126  s += binHeight(index,i,j);
127  return s;
128  }
virtual const AIDA::IAxis & zAxis() const
Get the z axis of the IHistogram3D.
Definition: Generic3D.h:166
double binHeight(int indexX, int indexY, int indexZ) const
Total height of the corresponding bin (ie the sum of the weights in this bin).
Definition: Generic3D.h:118
string s
Definition: gaudirun.py:210
list i
Definition: ana.py:128
virtual const AIDA::IAxis & yAxis() const
Get the y axis of the IHistogram3D.
Definition: Generic3D.h:164
template<typename INTERFACE, typename IMPLEMENTATION>
virtual double Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::binHeightY ( int  index) const
inlinevirtual

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

Definition at line 130 of file Generic3D.h.

130  {
131  double s = 0;
132  for (int i = -2; i < xAxis().bins(); ++i)
133  for (int j = -2; j < zAxis().bins(); ++j)
134  s += binHeight(i,index,j);
135  return s;
136  }
virtual const AIDA::IAxis & zAxis() const
Get the z axis of the IHistogram3D.
Definition: Generic3D.h:166
double binHeight(int indexX, int indexY, int indexZ) const
Total height of the corresponding bin (ie the sum of the weights in this bin).
Definition: Generic3D.h:118
virtual const AIDA::IAxis & xAxis() const
Get the x axis of the IHistogram3D.
Definition: Generic3D.h:162
string s
Definition: gaudirun.py:210
list i
Definition: ana.py:128
template<typename INTERFACE, typename IMPLEMENTATION>
virtual double Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::binHeightZ ( int  index) const
inlinevirtual

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

Definition at line 138 of file Generic3D.h.

138  {
139  double s = 0;
140  for (int i = -2; i < xAxis().bins(); ++i)
141  for (int j = -2; j < yAxis().bins(); ++j)
142  s += binHeight(i,j,index);
143  return s;
144  }
double binHeight(int indexX, int indexY, int indexZ) const
Total height of the corresponding bin (ie the sum of the weights in this bin).
Definition: Generic3D.h:118
virtual const AIDA::IAxis & xAxis() const
Get the x axis of the IHistogram3D.
Definition: Generic3D.h:162
string s
Definition: gaudirun.py:210
list i
Definition: ana.py:128
virtual const AIDA::IAxis & yAxis() const
Get the y axis of the IHistogram3D.
Definition: Generic3D.h:164
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.

77  { return (m_rep->GetXaxis())->GetBinCenter( rIndexX(indexX) ); }
int rIndexX(int index) const
Definition: Generic3D.h:71
IMPLEMENTATION * m_rep
Reference to underlying implementation.
Definition: Generic3D.h:213
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.

80  { return (m_rep->GetYaxis())->GetBinCenter( rIndexY(indexY) ); }
IMPLEMENTATION * m_rep
Reference to underlying implementation.
Definition: Generic3D.h:213
int rIndexY(int index) const
Definition: Generic3D.h:72
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.

83  { return (m_rep->GetYaxis())->GetBinCenter( rIndexY(indexZ) ); }
IMPLEMENTATION * m_rep
Reference to underlying implementation.
Definition: Generic3D.h:213
int rIndexY(int index) const
Definition: Generic3D.h:72
template<typename INTERFACE, typename IMPLEMENTATION>
virtual int Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::coordToIndexX ( double  coord) const
inlinevirtual

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

Definition at line 168 of file Generic3D.h.

168 { return xAxis().coordToIndex(coord);}
virtual const AIDA::IAxis & xAxis() const
Get the x axis of the IHistogram3D.
Definition: Generic3D.h:162
template<typename INTERFACE, typename IMPLEMENTATION>
virtual int Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::coordToIndexY ( double  coord) const
inlinevirtual

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

Definition at line 170 of file Generic3D.h.

170 { return yAxis().coordToIndex(coord);}
virtual const AIDA::IAxis & yAxis() const
Get the y axis of the IHistogram3D.
Definition: Generic3D.h:164
template<typename INTERFACE, typename IMPLEMENTATION>
virtual int Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::coordToIndexZ ( double  coord) const
inlinevirtual

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

Definition at line 172 of file Generic3D.h.

172 { return zAxis().coordToIndex(coord);}
virtual const AIDA::IAxis & zAxis() const
Get the z axis of the IHistogram3D.
Definition: Generic3D.h:166
template<typename INTERFACE, typename IMPLEMENTATION>
virtual int Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::dimension ( ) const
inlinevirtual

Get the Histogram's dimension.

Definition at line 42 of file Generic3D.h.

42 { return 3; }
template<class INTERFACE , class IMPLEMENTATION >
int Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::entries ( ) const
virtual

Get the number or all the entries.

Definition at line 237 of file Generic3D.h.

237  {
238  return (int)m_rep->GetEntries();
239  }
IMPLEMENTATION * m_rep
Reference to underlying implementation.
Definition: Generic3D.h:213
template<class INTERFACE , class IMPLEMENTATION >
double Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::equivalentBinEntries ( ) const
virtual

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

Definition at line 267 of file Generic3D.h.

267  {
268  if (sumBinHeights() <= 0) return 0;
269  Stat_t stats[11]; // cover up to 3D...
270  m_rep->GetStats(stats);
271  return stats[0]*stats[0]/stats[1];
272  }
virtual double sumBinHeights() const
Get the sum of in range bin heights in the IProfile.
Definition: Generic3D.h:257
IMPLEMENTATION * m_rep
Reference to underlying implementation.
Definition: Generic3D.h:213
template<typename INTERFACE, typename IMPLEMENTATION>
int Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::extraEntries ( ) const
inline

Definition at line 189 of file Generic3D.h.

189  {
190  return
191  binEntries(AIDA::IAxis::UNDERFLOW_BIN,AIDA::IAxis::UNDERFLOW_BIN,AIDA::IAxis::UNDERFLOW_BIN) +
192  binEntries(AIDA::IAxis::UNDERFLOW_BIN,AIDA::IAxis::UNDERFLOW_BIN,AIDA::IAxis::OVERFLOW_BIN) +
193  binEntries(AIDA::IAxis::UNDERFLOW_BIN, AIDA::IAxis::OVERFLOW_BIN,AIDA::IAxis::UNDERFLOW_BIN) +
194  binEntries(AIDA::IAxis::OVERFLOW_BIN,AIDA::IAxis::UNDERFLOW_BIN,AIDA::IAxis::UNDERFLOW_BIN) +
195  binEntries(AIDA::IAxis::OVERFLOW_BIN,AIDA::IAxis::UNDERFLOW_BIN,AIDA::IAxis::OVERFLOW_BIN) +
196  binEntries(AIDA::IAxis::OVERFLOW_BIN,AIDA::IAxis::OVERFLOW_BIN,AIDA::IAxis::UNDERFLOW_BIN) +
197  binEntries(AIDA::IAxis::OVERFLOW_BIN, AIDA::IAxis::OVERFLOW_BIN,AIDA::IAxis::OVERFLOW_BIN);
198  }
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)...
Definition: Generic3D.h:85
template<class INTERFACE , class IMPLEMENTATION >
double Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::maxBinHeight ( ) const
virtual

Get the maximum height of the in-range bins.

Definition at line 252 of file Generic3D.h.

252  {
253  return m_rep->GetMaximum();
254  }
IMPLEMENTATION * m_rep
Reference to underlying implementation.
Definition: Generic3D.h:213
template<typename INTERFACE, typename IMPLEMENTATION>
virtual double Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::meanX ( ) const
inlinevirtual

The mean of the IHistogram3D along the x axis.

Definition at line 149 of file Generic3D.h.

149 { return m_rep->GetMean ( 1); }
IMPLEMENTATION * m_rep
Reference to underlying implementation.
Definition: Generic3D.h:213
template<typename INTERFACE, typename IMPLEMENTATION>
virtual double Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::meanY ( ) const
inlinevirtual

The mean of the IHistogram3D along the y axis.

Definition at line 152 of file Generic3D.h.

152 { return m_rep->GetMean ( 2 ); }
IMPLEMENTATION * m_rep
Reference to underlying implementation.
Definition: Generic3D.h:213
template<typename INTERFACE, typename IMPLEMENTATION>
virtual double Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::meanZ ( ) const
inlinevirtual

The mean of the IHistogram3D along the z axis.

Definition at line 154 of file Generic3D.h.

154 { return m_rep->GetMean ( 3 ); }
IMPLEMENTATION * m_rep
Reference to underlying implementation.
Definition: Generic3D.h:213
template<class INTERFACE , class IMPLEMENTATION >
double Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::minBinHeight ( ) const
virtual

Get the minimum height of the in-range bins.

Definition at line 247 of file Generic3D.h.

247  {
248  return m_rep->GetMinimum();
249  }
IMPLEMENTATION * m_rep
Reference to underlying implementation.
Definition: Generic3D.h:213
template<typename INTERFACE, typename IMPLEMENTATION>
virtual std::string Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::name ( ) const
inlinevirtual

object name

Definition at line 48 of file Generic3D.h.

48 { return m_annotation.value("Name"); }
std::string value(const std::string &key) const
Retrieve the value for a given key.
Definition: Annotation.h:117
AIDA::Annotation m_annotation
Object annotations.
Definition: Generic3D.h:211
template<class INTERFACE , class IMPLEMENTATION >
std::ostream & Gaudi::Generic3D< 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 281 of file Generic3D.h.

282  {
284  m_rep->Print("all");
285  return s;
286  }
IMPLEMENTATION * m_rep
Reference to underlying implementation.
Definition: Generic3D.h:213
string s
Definition: gaudirun.py:210
template<typename INTERFACE, typename IMPLEMENTATION>
TObject* Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::representation ( ) const
inlinevirtual

ROOT object implementation.

Implements Gaudi::HistogramBase.

Definition at line 37 of file Generic3D.h.

37 { return m_rep; }
IMPLEMENTATION * m_rep
Reference to underlying implementation.
Definition: Generic3D.h:213
template<typename INTERFACE, typename IMPLEMENTATION>
int Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::rIndexX ( int  index) const
inline

Definition at line 71 of file Generic3D.h.

71 { return m_xAxis.rIndex(index);}
Gaudi::Axis m_xAxis
Definition: Generic3D.h:207
int rIndex(int index) const
Convert a AIDA bin number on the axis to the ROOT bin number.
Definition: Axis.h:55
template<typename INTERFACE, typename IMPLEMENTATION>
int Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::rIndexY ( int  index) const
inline

Definition at line 72 of file Generic3D.h.

72 { return m_yAxis.rIndex(index);}
Gaudi::Axis m_yAxis
Definition: Generic3D.h:208
int rIndex(int index) const
Convert a AIDA bin number on the axis to the ROOT bin number.
Definition: Axis.h:55
template<typename INTERFACE, typename IMPLEMENTATION>
int Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::rIndexZ ( int  index) const
inline

Definition at line 73 of file Generic3D.h.

73 { return m_zAxis.rIndex(index);}
Gaudi::Axis m_zAxis
Definition: Generic3D.h:209
int rIndex(int index) const
Convert a AIDA bin number on the axis to the ROOT bin number.
Definition: Axis.h:55
template<typename INTERFACE, typename IMPLEMENTATION>
virtual double Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::rmsX ( ) const
inlinevirtual

The RMS of the IHistogram3D along the x axis.

Definition at line 156 of file Generic3D.h.

156 { return m_rep->GetRMS( 1 ); }
IMPLEMENTATION * m_rep
Reference to underlying implementation.
Definition: Generic3D.h:213
template<typename INTERFACE, typename IMPLEMENTATION>
virtual double Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::rmsY ( ) const
inlinevirtual

The RMS of the IHistogram3D along the y axis.

Definition at line 158 of file Generic3D.h.

158 { return m_rep->GetRMS( 2 ); }
IMPLEMENTATION * m_rep
Reference to underlying implementation.
Definition: Generic3D.h:213
template<typename INTERFACE, typename IMPLEMENTATION>
virtual double Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::rmsZ ( ) const
inlinevirtual

The RMS of the IHistogram3D along the z axis.

Definition at line 160 of file Generic3D.h.

160 { return m_rep->GetRMS( 3 ); }
IMPLEMENTATION * m_rep
Reference to underlying implementation.
Definition: Generic3D.h:213
template<class INTERFACE , class IMPLEMENTATION >
bool Gaudi::Generic3D< 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 275 of file Generic3D.h.

275  {
276  m_rep->Scale ( scaleFactor );
277  return true;
278  }
IMPLEMENTATION * m_rep
Reference to underlying implementation.
Definition: Generic3D.h:213
template<class INTERFACE , class IMPLEMENTATION >
bool Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::setName ( const std::string &  newName)

Sets the name of the object.

Definition at line 231 of file Generic3D.h.

231  {
232  m_rep->SetName(newName.c_str());
233  m_annotation.setValue( "Name", newName );
234  return true;
235  }
IMPLEMENTATION * m_rep
Reference to underlying implementation.
Definition: Generic3D.h:213
AIDA::Annotation m_annotation
Object annotations.
Definition: Generic3D.h:211
void setValue(const std::string &key, const std::string &value)
Set value for a given key.
Definition: Annotation.h:124
template<class INTERFACE , class IMPLEMENTATION >
bool Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::setTitle ( const std::string &  title)
virtual

Set the title of the object.

Definition at line 221 of file Generic3D.h.

221  {
222  m_rep->SetTitle(title.c_str());
223  if ( !annotation().addItem( "Title", title ) )
224  m_annotation.setValue( "Title" , title );
225  if ( !annotation().addItem( "title", title ) )
226  annotation().setValue( "title", title );
227  return true;
228  }
IMPLEMENTATION * m_rep
Reference to underlying implementation.
Definition: Generic3D.h:213
virtual AIDA::IAnnotation & annotation()
Access annotation object.
Definition: Generic3D.h:52
virtual std::string title() const
Get the title of the object.
Definition: Generic3D.h:44
AIDA::Annotation m_annotation
Object annotations.
Definition: Generic3D.h:211
void setValue(const std::string &key, const std::string &value)
Set value for a given key.
Definition: Annotation.h:124
template<class INTERFACE , class IMPLEMENTATION >
double Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::sumAllBinHeights ( ) const
virtual

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

Definition at line 262 of file Generic3D.h.

262  {
263  return m_rep->GetSum();
264  }
IMPLEMENTATION * m_rep
Reference to underlying implementation.
Definition: Generic3D.h:213
template<class INTERFACE , class IMPLEMENTATION >
double Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::sumBinHeights ( ) const
virtual

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

Definition at line 257 of file Generic3D.h.

257  {
258  return m_rep->GetSumOfWeights();
259  }
IMPLEMENTATION * m_rep
Reference to underlying implementation.
Definition: Generic3D.h:213
template<typename INTERFACE, typename IMPLEMENTATION>
virtual double Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::sumExtraBinHeights ( ) const
inlinevirtual

Get the sum of the underflow and overflow bin height.

Definition at line 65 of file Generic3D.h.

65 { return sumAllBinHeights()-sumBinHeights(); }
virtual double sumBinHeights() const
Get the sum of in range bin heights in the IProfile.
Definition: Generic3D.h:257
virtual double sumAllBinHeights() const
Get the sum of all the bins heights (including underflow and overflow bin).
Definition: Generic3D.h:262
template<typename INTERFACE, typename IMPLEMENTATION>
virtual std::string Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::title ( ) const
inlinevirtual

Get the title of the object.

Definition at line 44 of file Generic3D.h.

44 { return m_annotation.value("Title");}
std::string value(const std::string &key) const
Retrieve the value for a given key.
Definition: Annotation.h:117
AIDA::Annotation m_annotation
Object annotations.
Definition: Generic3D.h:211
template<class INTERFACE , class IMPLEMENTATION >
std::ostream & Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::write ( std::ostream &  s) const
virtual

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

Implements Gaudi::HistogramBase.

Definition at line 291 of file Generic3D.h.

292  {
293  s << "\n3D Histogram Table: " << std::endl;
294  s << "BinX, BinY, BinZ, Height, Error " << std::endl;
295  for ( int i = 0; i < xAxis().bins(); ++i )
296  for ( int j = 0; j < yAxis().bins(); ++j )
297  for ( int k = 0; k < zAxis().bins(); ++k )
298  s << binMeanX( i, j, k ) << ", "
299  << binMeanY( i, j, k ) << ", "
300  << binMeanZ( i, j, k ) << ", "
301  << binHeight( i, j, k ) << ", "
302  << binError ( i, j, k ) << std::endl;
303  s << std::endl;
304  return s;
305  }
double binMeanX(int indexX, int, int) const
The weighted mean along the x axis of a given bin.
Definition: Generic3D.h:76
double binMeanZ(int, int, int indexZ) const
The weighted mean along the z axis of a given bin.
Definition: Generic3D.h:82
virtual const AIDA::IAxis & zAxis() const
Get the z axis of the IHistogram3D.
Definition: Generic3D.h:166
double binMeanY(int, int indexY, int) const
The weighted mean along the y axis of a given bin.
Definition: Generic3D.h:79
double binHeight(int indexX, int indexY, int indexZ) const
Total height of the corresponding bin (ie the sum of the weights in this bin).
Definition: Generic3D.h:118
virtual double binError(int indexX, int indexY, int indexZ) const
The error of a given bin.
Definition: Generic3D.h:146
virtual const AIDA::IAxis & xAxis() const
Get the x axis of the IHistogram3D.
Definition: Generic3D.h:162
string s
Definition: gaudirun.py:210
list i
Definition: ana.py:128
virtual const AIDA::IAxis & yAxis() const
Get the y axis of the IHistogram3D.
Definition: Generic3D.h:164
template<class INTERFACE , class IMPLEMENTATION >
int Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::write ( const char *  file_name) const
virtual

Write (ASCII) the histogram table into a file.

Implements Gaudi::HistogramBase.

Definition at line 309 of file Generic3D.h.

310  {
311  TFile *f = TFile::Open(file_name,"RECREATE");
312  Int_t nbytes = m_rep->Write();
313  f->Close();
314  return nbytes;
315  }
IMPLEMENTATION * m_rep
Reference to underlying implementation.
Definition: Generic3D.h:213
template<typename INTERFACE, typename IMPLEMENTATION>
virtual const AIDA::IAxis& Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::xAxis ( ) const
inlinevirtual

Get the x axis of the IHistogram3D.

Definition at line 162 of file Generic3D.h.

162 { return m_xAxis; }
Gaudi::Axis m_xAxis
Definition: Generic3D.h:207
template<typename INTERFACE, typename IMPLEMENTATION>
virtual const AIDA::IAxis& Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::yAxis ( ) const
inlinevirtual

Get the y axis of the IHistogram3D.

Definition at line 164 of file Generic3D.h.

164 { return m_yAxis; }
Gaudi::Axis m_yAxis
Definition: Generic3D.h:208
template<typename INTERFACE, typename IMPLEMENTATION>
virtual const AIDA::IAxis& Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::zAxis ( ) const
inlinevirtual

Get the z axis of the IHistogram3D.

Definition at line 166 of file Generic3D.h.

166 { return m_zAxis; }
Gaudi::Axis m_zAxis
Definition: Generic3D.h:209

Member Data Documentation

template<typename INTERFACE, typename IMPLEMENTATION>
AIDA::Annotation Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::m_annotation
mutableprotected

Object annotations.

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 215 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>
int Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::m_sumEntries
protected

Definition at line 217 of file Generic3D.h.

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.


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