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

Protected Member Functions

 Generic3D (IMPLEMENTATION *p)
 constructor More...
 

Protected Attributes

Gaudi::Axis m_xAxis
 
Gaudi::Axis m_yAxis
 
Gaudi::Axis m_zAxis
 
AIDA::Annotation m_annotation
 Object annotations. More...
 
std::unique_ptr< IMPLEMENTATION > m_rep
 Reference to underlying implementation. More...
 
std::string m_classType
 
int m_sumEntries = 0
 

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

Member Typedef Documentation

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

Definition at line 32 of file Generic3D.h.

Constructor & Destructor Documentation

template<typename INTERFACE, typename IMPLEMENTATION>
Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::Generic3D ( )
default

Default constructor.

template<typename INTERFACE, typename IMPLEMENTATION>
Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::Generic3D ( IMPLEMENTATION *  p)
inlineprotected

constructor

Definition at line 37 of file Generic3D.h.

37 : m_rep(p) { }
std::unique_ptr< IMPLEMENTATION > m_rep
Reference to underlying implementation.
Definition: Generic3D.h:216
template<typename INTERFACE, typename IMPLEMENTATION>
Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::~Generic3D ( )
overridedefault

Destructor.

Member Function Documentation

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

Add to this Histogram3D the contents of another IHistogram3D.

Definition at line 184 of file Generic3D.h.

184  {
185  const Base* p = dynamic_cast<const Base*>(&hist);
186  if ( !p ) throw std::runtime_error("Cannot add profile histograms of different implementations.");
187  m_rep->Add(p->m_rep.get());
188  return true;
189  }
Generic3D< INTERFACE, IMPLEMENTATION > Base
Definition: Generic3D.h:32
std::unique_ptr< IMPLEMENTATION > m_rep
Reference to underlying implementation.
Definition: Generic3D.h:216
template<typename INTERFACE, typename IMPLEMENTATION>
void Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::adoptRepresentation ( TObject *  rep)
overridevirtual

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 ) throw std::runtime_error("Cannot adopt native histogram representation.");
64  m_rep.reset( imp );
65  m_xAxis.initialize(m_rep->GetXaxis(),true);
66  m_yAxis.initialize(m_rep->GetYaxis(),true);
67  m_zAxis.initialize(m_rep->GetZaxis(),true);
68  const TArrayD* a = m_rep->GetSumw2();
69  if ( !a || (a && a->GetSize()==0) ) m_rep->Sumw2();
70  setTitle(m_rep->GetTitle());
71  }
Gaudi::Axis m_xAxis
Definition: Generic3D.h:210
Gaudi::Axis m_yAxis
Definition: Generic3D.h:211
Gaudi::Axis m_zAxis
Definition: Generic3D.h:212
bool setTitle(const std::string &title) override
Set the title of the object.
Definition: Generic3D.h:224
std::unique_ptr< IMPLEMENTATION > m_rep
Reference to underlying implementation.
Definition: Generic3D.h:216
void initialize(TAxis *itaxi, bool)
Definition: Axis.h:71
template<class INTERFACE , class IMPLEMENTATION >
int Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::allEntries ( ) const
override

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

Definition at line 245 of file Generic3D.h.

245  {
246  return int(m_rep->GetEntries());
247  }
std::unique_ptr< IMPLEMENTATION > m_rep
Reference to underlying implementation.
Definition: Generic3D.h:216
template<typename INTERFACE, typename IMPLEMENTATION>
AIDA::IAnnotation& Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::annotation ( )
inlineoverride

Access annotation object.

Definition at line 57 of file Generic3D.h.

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

Access annotation object (cons)

Definition at line 59 of file Generic3D.h.

59 { return m_annotation; }
AIDA::Annotation m_annotation
Object annotations.
Definition: Generic3D.h:214
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 90 of file Generic3D.h.

90  {
91  if (binHeight(indexX, indexY, indexZ)<=0) return 0;
92  double xx = binHeight(indexX, indexY, indexZ)/binError(indexX, indexY, indexZ);
93  return int(xx*xx+0.5);
94  }
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:123
double binError(int indexX, int indexY, int indexZ) const override
The error of a given bin.
Definition: Generic3D.h:151
template<typename INTERFACE, typename IMPLEMENTATION>
int Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::binEntriesX ( int  index) const
inlineoverride

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

Definition at line 96 of file Generic3D.h.

96  {
97  int n = 0;
98  for (int i = -2; i < yAxis().bins(); ++i)
99  for (int j = -2; j < zAxis().bins(); ++j)
100  n += binEntries(index,i,j);
101  return n;
102 
103  }
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:90
const AIDA::IAxis & zAxis() const override
Get the z axis of the IHistogram3D.
Definition: Generic3D.h:171
list i
Definition: ana.py:128
const AIDA::IAxis & yAxis() const override
Get the y axis of the IHistogram3D.
Definition: Generic3D.h:169
template<typename INTERFACE, typename IMPLEMENTATION>
int Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::binEntriesY ( int  index) const
inlineoverride

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

Definition at line 105 of file Generic3D.h.

105  {
106  int n = 0;
107  for (int i = -2; i < xAxis().bins(); ++i)
108  for (int j = -2; j < zAxis().bins(); ++j)
109  n += binEntries(i,index,j);
110  return n;
111  }
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:90
const AIDA::IAxis & xAxis() const override
Get the x axis of the IHistogram3D.
Definition: Generic3D.h:167
const AIDA::IAxis & zAxis() const override
Get the z axis of the IHistogram3D.
Definition: Generic3D.h:171
list i
Definition: ana.py:128
template<typename INTERFACE, typename IMPLEMENTATION>
int Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::binEntriesZ ( int  index) const
inlineoverride

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

Definition at line 114 of file Generic3D.h.

114  {
115  int n = 0;
116  for (int i = -2; i < xAxis().bins(); ++i)
117  for (int j = -2; j < yAxis().bins(); ++j)
118  n += binEntries(i,j,index);
119  return n;
120  }
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:90
const AIDA::IAxis & xAxis() const override
Get the x axis of the IHistogram3D.
Definition: Generic3D.h:167
list i
Definition: ana.py:128
const AIDA::IAxis & yAxis() const override
Get the y axis of the IHistogram3D.
Definition: Generic3D.h:169
template<typename INTERFACE, typename IMPLEMENTATION>
double Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::binError ( int  indexX,
int  indexY,
int  indexZ 
) const
inlineoverride

The error of a given bin.

Definition at line 151 of file Generic3D.h.

152  { return m_rep->GetBinError ( rIndexX(indexX), rIndexY(indexY ), rIndexZ(indexZ ) ); }
int rIndexZ(int index) const
Definition: Generic3D.h:78
int rIndexX(int index) const
Definition: Generic3D.h:76
int rIndexY(int index) const
Definition: Generic3D.h:77
std::unique_ptr< IMPLEMENTATION > m_rep
Reference to underlying implementation.
Definition: Generic3D.h:216
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 123 of file Generic3D.h.

124  { return m_rep->GetBinContent ( rIndexX(indexX), rIndexY(indexY), rIndexZ(indexZ) ); }
int rIndexZ(int index) const
Definition: Generic3D.h:78
int rIndexX(int index) const
Definition: Generic3D.h:76
int rIndexY(int index) const
Definition: Generic3D.h:77
std::unique_ptr< IMPLEMENTATION > m_rep
Reference to underlying implementation.
Definition: Generic3D.h:216
template<typename INTERFACE, typename IMPLEMENTATION>
double Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::binHeightX ( int  index) const
inlineoverride

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

Definition at line 127 of file Generic3D.h.

127  {
128  double s = 0;
129  for (int i = -2; i < yAxis().bins(); ++i)
130  for (int j = -2; j < zAxis().bins(); ++j)
131  s += binHeight(index,i,j);
132  return s;
133  }
const AIDA::IAxis & zAxis() const override
Get the z axis of the IHistogram3D.
Definition: Generic3D.h:171
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:123
string s
Definition: gaudirun.py:246
list i
Definition: ana.py:128
const AIDA::IAxis & yAxis() const override
Get the y axis of the IHistogram3D.
Definition: Generic3D.h:169
template<typename INTERFACE, typename IMPLEMENTATION>
double Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::binHeightY ( int  index) const
inlineoverride

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

Definition at line 135 of file Generic3D.h.

135  {
136  double s = 0;
137  for (int i = -2; i < xAxis().bins(); ++i)
138  for (int j = -2; j < zAxis().bins(); ++j)
139  s += binHeight(i,index,j);
140  return s;
141  }
const AIDA::IAxis & xAxis() const override
Get the x axis of the IHistogram3D.
Definition: Generic3D.h:167
const AIDA::IAxis & zAxis() const override
Get the z axis of the IHistogram3D.
Definition: Generic3D.h:171
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:123
string s
Definition: gaudirun.py:246
list i
Definition: ana.py:128
template<typename INTERFACE, typename IMPLEMENTATION>
double Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::binHeightZ ( int  index) const
inlineoverride

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

Definition at line 143 of file Generic3D.h.

143  {
144  double s = 0;
145  for (int i = -2; i < xAxis().bins(); ++i)
146  for (int j = -2; j < yAxis().bins(); ++j)
147  s += binHeight(i,j,index);
148  return s;
149  }
const AIDA::IAxis & xAxis() const override
Get the x axis of the IHistogram3D.
Definition: Generic3D.h:167
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:123
string s
Definition: gaudirun.py:246
list i
Definition: ana.py:128
const AIDA::IAxis & yAxis() const override
Get the y axis of the IHistogram3D.
Definition: Generic3D.h:169
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 81 of file Generic3D.h.

82  { return m_rep->GetXaxis()->GetBinCenter( rIndexX(indexX) ); }
int rIndexX(int index) const
Definition: Generic3D.h:76
std::unique_ptr< IMPLEMENTATION > m_rep
Reference to underlying implementation.
Definition: Generic3D.h:216
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 84 of file Generic3D.h.

85  { return m_rep->GetYaxis()->GetBinCenter( rIndexY(indexY) ); }
int rIndexY(int index) const
Definition: Generic3D.h:77
std::unique_ptr< IMPLEMENTATION > m_rep
Reference to underlying implementation.
Definition: Generic3D.h:216
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 87 of file Generic3D.h.

88  { return m_rep->GetYaxis()->GetBinCenter( rIndexY(indexZ) ); }
int rIndexY(int index) const
Definition: Generic3D.h:77
std::unique_ptr< IMPLEMENTATION > m_rep
Reference to underlying implementation.
Definition: Generic3D.h:216
template<typename INTERFACE, typename IMPLEMENTATION>
int Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::coordToIndexX ( double  coord) const
inlineoverride

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

Definition at line 173 of file Generic3D.h.

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

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

Definition at line 175 of file Generic3D.h.

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

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

Definition at line 177 of file Generic3D.h.

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

Get the Histogram's dimension.

Definition at line 47 of file Generic3D.h.

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

Get the number or all the entries.

Definition at line 240 of file Generic3D.h.

240  {
241  return m_rep->GetEntries();
242  }
std::unique_ptr< IMPLEMENTATION > m_rep
Reference to underlying implementation.
Definition: Generic3D.h:216
template<class INTERFACE , class IMPLEMENTATION >
double Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::equivalentBinEntries ( ) const
override

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

Definition at line 270 of file Generic3D.h.

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

Definition at line 192 of file Generic3D.h.

192  {
193  return
194  binEntries(AIDA::IAxis::UNDERFLOW_BIN,AIDA::IAxis::UNDERFLOW_BIN,AIDA::IAxis::UNDERFLOW_BIN) +
195  binEntries(AIDA::IAxis::UNDERFLOW_BIN,AIDA::IAxis::UNDERFLOW_BIN,AIDA::IAxis::OVERFLOW_BIN) +
196  binEntries(AIDA::IAxis::UNDERFLOW_BIN, AIDA::IAxis::OVERFLOW_BIN,AIDA::IAxis::UNDERFLOW_BIN) +
197  binEntries(AIDA::IAxis::OVERFLOW_BIN,AIDA::IAxis::UNDERFLOW_BIN,AIDA::IAxis::UNDERFLOW_BIN) +
198  binEntries(AIDA::IAxis::OVERFLOW_BIN,AIDA::IAxis::UNDERFLOW_BIN,AIDA::IAxis::OVERFLOW_BIN) +
199  binEntries(AIDA::IAxis::OVERFLOW_BIN,AIDA::IAxis::OVERFLOW_BIN,AIDA::IAxis::UNDERFLOW_BIN) +
200  binEntries(AIDA::IAxis::OVERFLOW_BIN, AIDA::IAxis::OVERFLOW_BIN,AIDA::IAxis::OVERFLOW_BIN);
201  }
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:90
template<class INTERFACE , class IMPLEMENTATION >
double Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::maxBinHeight ( ) const
override

Get the maximum height of the in-range bins.

Definition at line 255 of file Generic3D.h.

255  {
256  return m_rep->GetMaximum();
257  }
std::unique_ptr< IMPLEMENTATION > m_rep
Reference to underlying implementation.
Definition: Generic3D.h:216
template<typename INTERFACE, typename IMPLEMENTATION>
double Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::meanX ( ) const
inlineoverride

The mean of the IHistogram3D along the x axis.

Definition at line 154 of file Generic3D.h.

154 { return m_rep->GetMean ( 1); }
std::unique_ptr< IMPLEMENTATION > m_rep
Reference to underlying implementation.
Definition: Generic3D.h:216
template<typename INTERFACE, typename IMPLEMENTATION>
double Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::meanY ( ) const
inlineoverride

The mean of the IHistogram3D along the y axis.

Definition at line 157 of file Generic3D.h.

157 { return m_rep->GetMean ( 2 ); }
std::unique_ptr< IMPLEMENTATION > m_rep
Reference to underlying implementation.
Definition: Generic3D.h:216
template<typename INTERFACE, typename IMPLEMENTATION>
double Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::meanZ ( ) const
inlineoverride

The mean of the IHistogram3D along the z axis.

Definition at line 159 of file Generic3D.h.

159 { return m_rep->GetMean ( 3 ); }
std::unique_ptr< IMPLEMENTATION > m_rep
Reference to underlying implementation.
Definition: Generic3D.h:216
template<class INTERFACE , class IMPLEMENTATION >
double Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::minBinHeight ( ) const
override

Get the minimum height of the in-range bins.

Definition at line 250 of file Generic3D.h.

250  {
251  return m_rep->GetMinimum();
252  }
std::unique_ptr< IMPLEMENTATION > m_rep
Reference to underlying implementation.
Definition: Generic3D.h:216
template<typename INTERFACE, typename IMPLEMENTATION>
std::string Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::name ( ) const
inline

object name

Definition at line 53 of file Generic3D.h.

53 { return m_annotation.value("Name"); }
std::string value(const std::string &key) const
Retrieve the value for a given key.
Definition: Annotation.h:114
AIDA::Annotation m_annotation
Object annotations.
Definition: Generic3D.h:214
template<class INTERFACE , class IMPLEMENTATION >
std::ostream & Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::print ( std::ostream &  s) const
overridevirtual

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

285  {
287  m_rep->Print("all");
288  return s;
289  }
std::unique_ptr< IMPLEMENTATION > m_rep
Reference to underlying implementation.
Definition: Generic3D.h:216
string s
Definition: gaudirun.py:246
template<typename INTERFACE, typename IMPLEMENTATION>
TObject* Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::representation ( ) const
inlineoverridevirtual

ROOT object implementation.

Implements Gaudi::HistogramBase.

Definition at line 42 of file Generic3D.h.

42 { return m_rep.get(); }
std::unique_ptr< IMPLEMENTATION > m_rep
Reference to underlying implementation.
Definition: Generic3D.h:216
template<typename INTERFACE, typename IMPLEMENTATION>
int Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::rIndexX ( int  index) const
inline

Definition at line 76 of file Generic3D.h.

76 { return m_xAxis.rIndex(index);}
Gaudi::Axis m_xAxis
Definition: Generic3D.h:210
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 77 of file Generic3D.h.

77 { return m_yAxis.rIndex(index);}
Gaudi::Axis m_yAxis
Definition: Generic3D.h:211
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 78 of file Generic3D.h.

78 { return m_zAxis.rIndex(index);}
Gaudi::Axis m_zAxis
Definition: Generic3D.h:212
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>
double Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::rmsX ( ) const
inlineoverride

The RMS of the IHistogram3D along the x axis.

Definition at line 161 of file Generic3D.h.

161 { return m_rep->GetRMS( 1 ); }
std::unique_ptr< IMPLEMENTATION > m_rep
Reference to underlying implementation.
Definition: Generic3D.h:216
template<typename INTERFACE, typename IMPLEMENTATION>
double Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::rmsY ( ) const
inlineoverride

The RMS of the IHistogram3D along the y axis.

Definition at line 163 of file Generic3D.h.

163 { return m_rep->GetRMS( 2 ); }
std::unique_ptr< IMPLEMENTATION > m_rep
Reference to underlying implementation.
Definition: Generic3D.h:216
template<typename INTERFACE, typename IMPLEMENTATION>
double Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::rmsZ ( ) const
inlineoverride

The RMS of the IHistogram3D along the z axis.

Definition at line 165 of file Generic3D.h.

165 { return m_rep->GetRMS( 3 ); }
std::unique_ptr< IMPLEMENTATION > m_rep
Reference to underlying implementation.
Definition: Generic3D.h:216
template<class INTERFACE , class IMPLEMENTATION >
bool Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::scale ( double  scaleFactor)
override

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

278  {
279  m_rep->Scale ( scaleFactor );
280  return true;
281  }
std::unique_ptr< IMPLEMENTATION > m_rep
Reference to underlying implementation.
Definition: Generic3D.h:216
template<class INTERFACE , class IMPLEMENTATION >
bool Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::setName ( const std::string &  newName)

Sets the name of the object.

Definition at line 234 of file Generic3D.h.

234  {
235  m_rep->SetName(newName.c_str());
236  m_annotation.setValue( "Name", newName );
237  return true;
238  }
std::unique_ptr< IMPLEMENTATION > m_rep
Reference to underlying implementation.
Definition: Generic3D.h:216
AIDA::Annotation m_annotation
Object annotations.
Definition: Generic3D.h:214
void setValue(const std::string &key, const std::string &value)
Set value for a given key.
Definition: Annotation.h:121
template<class INTERFACE , class IMPLEMENTATION >
bool Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::setTitle ( const std::string &  title)
override

Set the title of the object.

Definition at line 224 of file Generic3D.h.

224  {
225  m_rep->SetTitle(title.c_str());
226  if ( !annotation().addItem( "Title", title ) )
227  m_annotation.setValue( "Title" , title );
228  if ( !annotation().addItem( "title", title ) )
229  annotation().setValue( "title", title );
230  return true;
231  }
AIDA::IAnnotation & annotation() override
Access annotation object.
Definition: Generic3D.h:57
std::string title() const override
Get the title of the object.
Definition: Generic3D.h:49
std::unique_ptr< IMPLEMENTATION > m_rep
Reference to underlying implementation.
Definition: Generic3D.h:216
AIDA::Annotation m_annotation
Object annotations.
Definition: Generic3D.h:214
void setValue(const std::string &key, const std::string &value)
Set value for a given key.
Definition: Annotation.h:121
template<class INTERFACE , class IMPLEMENTATION >
double Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::sumAllBinHeights ( ) const
override

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

Definition at line 265 of file Generic3D.h.

265  {
266  return m_rep->GetSum();
267  }
std::unique_ptr< IMPLEMENTATION > m_rep
Reference to underlying implementation.
Definition: Generic3D.h:216
template<class INTERFACE , class IMPLEMENTATION >
double Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::sumBinHeights ( ) const
override

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

Definition at line 260 of file Generic3D.h.

260  {
261  return m_rep->GetSumOfWeights();
262  }
std::unique_ptr< IMPLEMENTATION > m_rep
Reference to underlying implementation.
Definition: Generic3D.h:216
template<typename INTERFACE, typename IMPLEMENTATION>
double Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::sumExtraBinHeights ( ) const
inlineoverride

Get the sum of the underflow and overflow bin height.

Definition at line 70 of file Generic3D.h.

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

Get the title of the object.

Definition at line 49 of file Generic3D.h.

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

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

Implements Gaudi::HistogramBase.

Definition at line 294 of file Generic3D.h.

295  {
296  s << "\n3D Histogram Table: " << std::endl;
297  s << "BinX, BinY, BinZ, Height, Error " << std::endl;
298  for ( int i = 0; i < xAxis().bins(); ++i )
299  for ( int j = 0; j < yAxis().bins(); ++j )
300  for ( int k = 0; k < zAxis().bins(); ++k )
301  s << binMeanX( i, j, k ) << ", "
302  << binMeanY( i, j, k ) << ", "
303  << binMeanZ( i, j, k ) << ", "
304  << binHeight( i, j, k ) << ", "
305  << binError ( i, j, k ) << std::endl;
306  s << std::endl;
307  return s;
308  }
double binMeanX(int indexX, int, int) const
The weighted mean along the x axis of a given bin.
Definition: Generic3D.h:81
const AIDA::IAxis & xAxis() const override
Get the x axis of the IHistogram3D.
Definition: Generic3D.h:167
double binMeanZ(int, int, int indexZ) const
The weighted mean along the z axis of a given bin.
Definition: Generic3D.h:87
const AIDA::IAxis & zAxis() const override
Get the z axis of the IHistogram3D.
Definition: Generic3D.h:171
double binMeanY(int, int indexY, int) const
The weighted mean along the y axis of a given bin.
Definition: Generic3D.h:84
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:123
string s
Definition: gaudirun.py:246
double binError(int indexX, int indexY, int indexZ) const override
The error of a given bin.
Definition: Generic3D.h:151
list i
Definition: ana.py:128
const AIDA::IAxis & yAxis() const override
Get the y axis of the IHistogram3D.
Definition: Generic3D.h:169
template<class INTERFACE , class IMPLEMENTATION >
int Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::write ( const char *  file_name) const
overridevirtual

Write (ASCII) the histogram table into a file.

Implements Gaudi::HistogramBase.

Definition at line 312 of file Generic3D.h.

313  {
314  TFile *f = TFile::Open(file_name,"RECREATE");
315  Int_t nbytes = m_rep->Write();
316  f->Close();
317  return nbytes;
318  }
std::unique_ptr< IMPLEMENTATION > m_rep
Reference to underlying implementation.
Definition: Generic3D.h:216
template<typename INTERFACE, typename IMPLEMENTATION>
const AIDA::IAxis& Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::xAxis ( ) const
inlineoverride

Get the x axis of the IHistogram3D.

Definition at line 167 of file Generic3D.h.

167 { return m_xAxis; }
Gaudi::Axis m_xAxis
Definition: Generic3D.h:210
template<typename INTERFACE, typename IMPLEMENTATION>
const AIDA::IAxis& Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::yAxis ( ) const
inlineoverride

Get the y axis of the IHistogram3D.

Definition at line 169 of file Generic3D.h.

169 { return m_yAxis; }
Gaudi::Axis m_yAxis
Definition: Generic3D.h:211
template<typename INTERFACE, typename IMPLEMENTATION>
const AIDA::IAxis& Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::zAxis ( ) const
inlineoverride

Get the z axis of the IHistogram3D.

Definition at line 171 of file Generic3D.h.

171 { return m_zAxis; }
Gaudi::Axis m_zAxis
Definition: Generic3D.h:212

Member Data Documentation

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

Object annotations.

Definition at line 214 of file Generic3D.h.

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

Definition at line 218 of file Generic3D.h.

template<typename INTERFACE, typename IMPLEMENTATION>
std::unique_ptr<IMPLEMENTATION> Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::m_rep
protected

Reference to underlying implementation.

Definition at line 216 of file Generic3D.h.

template<typename INTERFACE, typename IMPLEMENTATION>
int Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::m_sumEntries = 0
protected

Definition at line 220 of file Generic3D.h.

template<typename INTERFACE, typename IMPLEMENTATION>
Gaudi::Axis Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::m_xAxis
protected

Definition at line 210 of file Generic3D.h.

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

Definition at line 211 of file Generic3D.h.

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

Definition at line 212 of file Generic3D.h.


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