All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Gaudi::Generic2D< INTERFACE, IMPLEMENTATION > Class Template Reference

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

#include <GaudiPI/Generic2D.h>

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

Public Types

typedef Generic2D< INTERFACE,
IMPLEMENTATION > 
Base
 

Public Member Functions

 Generic2D ()
 
virtual ~Generic2D ()
 Destructor. More...
 
TObject * representation () const
 ROOT object implementation. More...
 
virtual void adoptRepresentation (TObject *rep)
 Adopt ROOT histogram representation. 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...
 
std::string name () const
 object name More...
 
bool setName (const std::string &newName)
 Set 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 const AIDA::IAxis & xAxis () const
 Return the X axis. More...
 
virtual const AIDA::IAxis & yAxis () const
 Return the Y axis. More...
 
virtual int rIndexX (int index) const
 operator methods More...
 
virtual int rIndexY (int index) const
 operator methods 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 int extraEntries () const
 Get the number of entries in the underflow and overflow bins. 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...
 
virtual double binMeanX (int indexX, int indexY) const
 The weighted mean along x of a given bin. More...
 
virtual double binMeanY (int indexX, int indexY) const
 The weighted mean along y of a given bin. More...
 
virtual int binEntries (int indexX, int indexY) const
 The number of entries (ie the number of times fill was called for this bin). More...
 
virtual int binEntriesX (int indexX) const
 Equivalent to projectionX().binEntries(indexX). More...
 
virtual int binEntriesY (int indexY) const
 Equivalent to projectionY().binEntries(indexY). More...
 
virtual double binHeight (int indexX, int indexY) const
 Total height of the corresponding bin (ie the sum of the weights in this bin). More...
 
virtual double binHeightX (int indexX) const
 Equivalent to projectionX().binHeight(indexX). More...
 
virtual double binHeightY (int indexY) const
 Equivalent to projectionY().binHeight(indexY). More...
 
virtual double binError (int indexX, int indexY) const
 The error on this bin. More...
 
virtual double binRms (int indexX, int indexY) const
 The spread (RMS) of this bin. More...
 
virtual double meanX () const
 Returns the mean of the profile, as calculated on filling-time projected on the X axis. More...
 
virtual double meanY () const
 Returns the mean of the profile, as calculated on filling-time projected on the Y axis. More...
 
virtual double rmsX () const
 Returns the rms of the profile as calculated on filling-time projected on the X axis. More...
 
virtual double rmsY () const
 Returns the rms of the profile as calculated on filling-time projected on the Y axis. More...
 
virtual int coordToIndexX (double coordX) const
 Convenience method, equivalent to xAxis().coordToIndex(coord). More...
 
virtual int coordToIndexY (double coordY) const
 Convenience method, equivalent to yAxis().coordToIndex(coord). 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 &h)
 Modifies this profile by adding the contents of profile to it. More...
 
bool reset ()
 
void * cast (const std::string &className) const
 Introspection method. More...
 
const std::string & userLevelClassType () const
 The AIDA user-level unterface leaf class type. More...
 
virtual int dimension () const
 Get the Histogram's dimension. More...
 
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 * cast (const std::string &className) const
 
template<>
int binEntries (int indexX, int indexY) const
 
template<>
void adoptRepresentation (TObject *rep)
 Adopt ROOT histogram representation. More...
 
template<>
void * cast (const std::string &className) const
 
template<>
int binEntries (int idX, int idY) const
 
template<>
void adoptRepresentation (TObject *rep)
 Adopt ROOT histogram representation. More...
 
- Public Member Functions inherited from Gaudi::HistogramBase
virtual ~HistogramBase ()
 

Protected Attributes

Axis m_xAxis
 X axis member. More...
 
Axis m_yAxis
 Y axis member. More...
 
AIDA::Annotation m_annotation
 Object annotations. More...
 
IMPLEMENTATION * m_rep
 Reference to underlying implementation. More...
 
std::string m_classType
 class type More...
 
int m_sumEntries
 cache sumEntries (allEntries) when setting contents since Root can't compute by himself More...
 

Detailed Description

template<class INTERFACE, class IMPLEMENTATION>
class Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >

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

Credits: This code is the result of some stripdown implementation of LCG/PI. Credits to them!

Author
M.Frank

Definition at line 30 of file Generic2D.h.

Member Typedef Documentation

template<class INTERFACE, class IMPLEMENTATION>
typedef Generic2D<INTERFACE,IMPLEMENTATION> Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::Base

Definition at line 32 of file Generic2D.h.

Constructor & Destructor Documentation

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

Definition at line 34 of file Generic2D.h.

34 : m_rep(0) {}
IMPLEMENTATION * m_rep
Reference to underlying implementation.
Definition: Generic2D.h:143
template<class INTERFACE, class IMPLEMENTATION>
virtual Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::~Generic2D ( )
inlinevirtual

Destructor.

Definition at line 37 of file Generic2D.h.

37 { delete m_rep; }
IMPLEMENTATION * m_rep
Reference to underlying implementation.
Definition: Generic2D.h:143

Member Function Documentation

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

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

Definition at line 286 of file Generic2D.h.

286  {
287  const Base* p = dynamic_cast<const Base*>(&hist);
288  if ( p ) {
289  m_rep->Add(p->m_rep);
290  return true;
291  }
292  throw std::runtime_error("Cannot add profile histograms of different implementations.");
293  }
Generic2D< INTERFACE, IMPLEMENTATION > Base
Definition: Generic2D.h:32
IMPLEMENTATION * m_rep
Reference to underlying implementation.
Definition: Generic2D.h:143
template<class INTERFACE, class IMPLEMENTATION>
virtual void Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::adoptRepresentation ( TObject *  rep)
virtual

Adopt ROOT histogram representation.

Implements Gaudi::HistogramBase.

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

Adopt ROOT histogram representation.

Implements Gaudi::HistogramBase.

Definition at line 71 of file P2D.cpp.

71  {
72  TProfile2D* imp = dynamic_cast<TProfile2D*>(rep);
73  if ( imp ) {
74  if ( m_rep ) delete m_rep;
75  m_rep = imp;
76  m_xAxis.initialize(m_rep->GetXaxis(),true);
77  m_yAxis.initialize(m_rep->GetYaxis(),true);
78  setTitle(m_rep->GetTitle());
79  return;
80  }
81  throw std::runtime_error("Cannot adopt native histogram representation.");
82  }
virtual bool setTitle(const std::string &title)
Set the title of the object.
Definition: Generic2D.h:151
Axis m_xAxis
X axis member.
Definition: Generic2D.h:137
void initialize(TAxis *itaxi, bool)
Definition: Axis.h:71
Axis m_yAxis
Y axis member.
Definition: Generic2D.h:139
IMPLEMENTATION * m_rep
Reference to underlying implementation.
Definition: Generic2D.h:143
template<>
void Gaudi::Generic2D< AIDA::IHistogram2D, TH2D >::adoptRepresentation ( TObject *  rep)
virtual

Adopt ROOT histogram representation.

Implements Gaudi::HistogramBase.

Definition at line 104 of file H2D.cpp.

104  {
105  TH2D* imp = dynamic_cast<TH2D*>(rep);
106  if ( imp ) {
107  if ( m_rep ) delete m_rep;
108  m_rep = imp;
109  m_xAxis.initialize(m_rep->GetXaxis(),true);
110  m_yAxis.initialize(m_rep->GetYaxis(),true);
111  const TArrayD* a = m_rep->GetSumw2();
112  if ( 0 == a || (a && a->GetSize()==0) ) m_rep->Sumw2();
113  setTitle(m_rep->GetTitle());
114  return;
115  }
116  throw std::runtime_error("Cannot adopt native histogram representation.");
117  }
virtual bool setTitle(const std::string &title)
Set the title of the object.
Definition: Generic2D.h:151
Axis m_xAxis
X axis member.
Definition: Generic2D.h:137
void initialize(TAxis *itaxi, bool)
Definition: Axis.h:71
Axis m_yAxis
Y axis member.
Definition: Generic2D.h:139
IMPLEMENTATION * m_rep
Reference to underlying implementation.
Definition: Generic2D.h:143
template<class INTERFACE , class IMPLEMENTATION >
int Gaudi::Generic2D< 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 173 of file Generic2D.h.

173  {
174  return int(m_rep->GetEntries());
175  }
IMPLEMENTATION * m_rep
Reference to underlying implementation.
Definition: Generic2D.h:143
template<class INTERFACE, class IMPLEMENTATION>
virtual AIDA::IAnnotation& Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::annotation ( )
inlinevirtual

Access annotation object.

Definition at line 52 of file Generic2D.h.

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

Access annotation object (cons)

Definition at line 54 of file Generic2D.h.

54 { return m_annotation; }
AIDA::Annotation m_annotation
Object annotations.
Definition: Generic2D.h:141
template<>
int Gaudi::Generic2D< AIDA::IProfile2D, TProfile2D >::binEntries ( int  idX,
int  idY 
) const

Definition at line 65 of file P2D.cpp.

65  {
66  int rBin = m_rep->GetBin(rIndexX(idX),rIndexY(idY));
67  return int(m_rep->GetBinEntries(rBin)+0.5);
68  }
virtual int rIndexX(int index) const
operator methods
Definition: Generic2D.h:61
virtual int rIndexY(int index) const
operator methods
Definition: Generic2D.h:63
IMPLEMENTATION * m_rep
Reference to underlying implementation.
Definition: Generic2D.h:143
template<class INTERFACE, class IMPLEMENTATION>
virtual int Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::binEntries ( int  indexX,
int  indexY 
) const
virtual

The number of entries (ie the number of times fill was called for this bin).

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

Definition at line 97 of file H2D.cpp.

97  {
98  if (binHeight(indexX, indexY)<=0) return 0;
99  double xx = binHeight(indexX, indexY)/binError(indexX, indexY);
100  return int(xx*xx+0.5);
101  }
virtual double binError(int indexX, int indexY) const
The error on this bin.
Definition: Generic2D.h:251
virtual double binHeight(int indexX, int indexY) const
Total height of the corresponding bin (ie the sum of the weights in this bin).
Definition: Generic2D.h:229
template<class INTERFACE , class IMPLEMENTATION >
int Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::binEntriesX ( int  indexX) const
virtual

Equivalent to projectionX().binEntries(indexX).

Definition at line 213 of file Generic2D.h.

213  {
214  int n = 0;
215  for (int iY = -2; iY < yAxis().bins(); ++iY)
216  n += binEntries(index,iY);
217  return n;
218  }
virtual int binEntries(int indexX, int indexY) const
The number of entries (ie the number of times fill was called for this bin).
virtual const AIDA::IAxis & yAxis() const
Return the Y axis.
Definition: Generic2D.h:59
template<class INTERFACE , class IMPLEMENTATION >
int Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::binEntriesY ( int  indexY) const
virtual

Equivalent to projectionY().binEntries(indexY).

Definition at line 221 of file Generic2D.h.

221  {
222  int n = 0;
223  for (int iX = -2; iX < xAxis().bins(); ++iX)
224  n += binEntries(iX,index);
225  return n;
226  }
virtual int binEntries(int indexX, int indexY) const
The number of entries (ie the number of times fill was called for this bin).
virtual const AIDA::IAxis & xAxis() const
Return the X axis.
Definition: Generic2D.h:57
template<class INTERFACE , class IMPLEMENTATION >
double Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::binError ( int  indexX,
int  indexY 
) const
virtual

The error on this bin.

Definition at line 251 of file Generic2D.h.

251  {
252  return m_rep->GetBinError ( rIndexX(indexX), rIndexY(indexY ) );
253  }
virtual int rIndexX(int index) const
operator methods
Definition: Generic2D.h:61
virtual int rIndexY(int index) const
operator methods
Definition: Generic2D.h:63
IMPLEMENTATION * m_rep
Reference to underlying implementation.
Definition: Generic2D.h:143
template<class INTERFACE , class IMPLEMENTATION >
double Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::binHeight ( int  indexX,
int  indexY 
) const
virtual

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

Definition at line 229 of file Generic2D.h.

229  {
230  return m_rep->GetBinContent ( rIndexX(indexX), rIndexY(indexY) );
231  }
virtual int rIndexX(int index) const
operator methods
Definition: Generic2D.h:61
virtual int rIndexY(int index) const
operator methods
Definition: Generic2D.h:63
IMPLEMENTATION * m_rep
Reference to underlying implementation.
Definition: Generic2D.h:143
template<class INTERFACE , class IMPLEMENTATION >
double Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::binHeightX ( int  indexX) const
virtual

Equivalent to projectionX().binHeight(indexX).

Definition at line 234 of file Generic2D.h.

234  {
235  double s = 0;
236  for (int iY = -2; iY < yAxis().bins(); ++iY) {
237  s += binHeight(index,iY);
238  }
239  return s;
240  }
virtual double binHeight(int indexX, int indexY) const
Total height of the corresponding bin (ie the sum of the weights in this bin).
Definition: Generic2D.h:229
string s
Definition: gaudirun.py:210
virtual const AIDA::IAxis & yAxis() const
Return the Y axis.
Definition: Generic2D.h:59
template<class INTERFACE , class IMPLEMENTATION >
double Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::binHeightY ( int  indexY) const
virtual

Equivalent to projectionY().binHeight(indexY).

Definition at line 243 of file Generic2D.h.

243  {
244  double s = 0;
245  for (int iX = -2; iX < xAxis().bins(); ++iX)
246  s += binHeight(iX,index);
247  return s;
248  }
virtual double binHeight(int indexX, int indexY) const
Total height of the corresponding bin (ie the sum of the weights in this bin).
Definition: Generic2D.h:229
string s
Definition: gaudirun.py:210
virtual const AIDA::IAxis & xAxis() const
Return the X axis.
Definition: Generic2D.h:57
template<class INTERFACE , class IMPLEMENTATION >
double Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::binMeanX ( int  indexX,
int  indexY 
) const
virtual

The weighted mean along x of a given bin.

Definition at line 203 of file Generic2D.h.

203  {
204  return (m_rep->GetXaxis())->GetBinCenter( rIndexX(indexX) );
205  }
virtual int rIndexX(int index) const
operator methods
Definition: Generic2D.h:61
IMPLEMENTATION * m_rep
Reference to underlying implementation.
Definition: Generic2D.h:143
template<class INTERFACE , class IMPLEMENTATION >
double Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::binMeanY ( int  indexX,
int  indexY 
) const
virtual

The weighted mean along y of a given bin.

Definition at line 208 of file Generic2D.h.

208  {
209  return (m_rep->GetYaxis())->GetBinCenter( rIndexY(indexY) );
210  }
virtual int rIndexY(int index) const
operator methods
Definition: Generic2D.h:63
IMPLEMENTATION * m_rep
Reference to underlying implementation.
Definition: Generic2D.h:143
template<class INTERFACE , class IMPLEMENTATION >
double Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::binRms ( int  indexX,
int  indexY 
) const
virtual

The spread (RMS) of this bin.

Definition at line 198 of file Generic2D.h.

198  {
199  return m_rep->GetBinError ( rIndexX(indexX), rIndexY(indexY) );
200  }
virtual int rIndexX(int index) const
operator methods
Definition: Generic2D.h:61
virtual int rIndexY(int index) const
operator methods
Definition: Generic2D.h:63
IMPLEMENTATION * m_rep
Reference to underlying implementation.
Definition: Generic2D.h:143
template<>
void * Gaudi::Generic2D< AIDA::IProfile2D, TProfile2D >::cast ( const std::string &  className) const

Definition at line 54 of file P2D.cpp.

54  {
55  if (className == "AIDA::IProfile2D")
56  return const_cast<AIDA::IProfile2D*>((AIDA::IProfile2D*)this);
57  else if (className == "AIDA::IProfile")
58  return const_cast<AIDA::IProfile*>((AIDA::IProfile*)this);
59  else if (className == "AIDA::IBaseHistogram")
60  return const_cast<AIDA::IBaseHistogram*>((AIDA::IBaseHistogram*)this);
61  return 0;
62  }
template<>
void * Gaudi::Generic2D< IHistogram2D, TH2D >::cast ( const std::string &  className) const

Definition at line 88 of file H2D.cpp.

88  {
89  if (className == "AIDA::IHistogram2D")
90  return (IHistogram2D*)this;
91  else if (className == "AIDA::IHistogram")
92  return (IHistogram*)this;
93  return 0;
94  }
template<class INTERFACE, class IMPLEMENTATION>
void* Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::cast ( const std::string &  className) const

Introspection method.

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

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

Definition at line 276 of file Generic2D.h.

276  {
277  return xAxis().coordToIndex(coord);
278  }
virtual const AIDA::IAxis & xAxis() const
Return the X axis.
Definition: Generic2D.h:57
template<class INTERFACE , class IMPLEMENTATION >
int Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::coordToIndexY ( double  coordY) const
virtual

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

Definition at line 281 of file Generic2D.h.

281  {
282  return yAxis().coordToIndex(coord);
283  }
virtual const AIDA::IAxis & yAxis() const
Return the Y axis.
Definition: Generic2D.h:59
template<class INTERFACE, class IMPLEMENTATION>
virtual int Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::dimension ( ) const
inlinevirtual

Get the Histogram's dimension.

Definition at line 127 of file Generic2D.h.

127 { return 2; }
template<class INTERFACE , class IMPLEMENTATION >
int Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::entries ( ) const
virtual

Get the number or all the entries.

Definition at line 168 of file Generic2D.h.

168  {
169  return (int)m_rep->GetEntries();
170  }
IMPLEMENTATION * m_rep
Reference to underlying implementation.
Definition: Generic2D.h:143
template<class INTERFACE , class IMPLEMENTATION >
double Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::equivalentBinEntries ( ) const
virtual

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

Definition at line 305 of file Generic2D.h.

305  {
306  if (sumBinHeights() <= 0) return 0;
307  Stat_t stats[11]; // cover up to 3D...
308  m_rep->GetStats(stats);
309  return stats[0]*stats[0]/stats[1];
310  }
virtual double sumBinHeights() const
Get the sum of in range bin heights in the IProfile.
Definition: Generic2D.h:188
IMPLEMENTATION * m_rep
Reference to underlying implementation.
Definition: Generic2D.h:143
template<class INTERFACE , class IMPLEMENTATION >
int Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::extraEntries ( ) const
virtual

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

Definition at line 296 of file Generic2D.h.

296  {
297  return
298  binEntries(AIDA::IAxis::UNDERFLOW_BIN,AIDA::IAxis::UNDERFLOW_BIN) +
299  binEntries(AIDA::IAxis::UNDERFLOW_BIN,AIDA::IAxis::OVERFLOW_BIN) +
300  binEntries(AIDA::IAxis::OVERFLOW_BIN,AIDA::IAxis::UNDERFLOW_BIN) +
301  binEntries(AIDA::IAxis::OVERFLOW_BIN,AIDA::IAxis::OVERFLOW_BIN);
302  }
virtual int binEntries(int indexX, int indexY) const
The number of entries (ie the number of times fill was called for this bin).
template<class INTERFACE , class IMPLEMENTATION >
double Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::maxBinHeight ( ) const
virtual

Get the maximum height of the in-range bins.

Definition at line 183 of file Generic2D.h.

183  {
184  return m_rep->GetMaximum();
185  }
IMPLEMENTATION * m_rep
Reference to underlying implementation.
Definition: Generic2D.h:143
template<class INTERFACE , class IMPLEMENTATION >
double Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::meanX ( ) const
virtual

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

Definition at line 256 of file Generic2D.h.

256  {
257  return m_rep->GetMean(1);
258  }
IMPLEMENTATION * m_rep
Reference to underlying implementation.
Definition: Generic2D.h:143
template<class INTERFACE , class IMPLEMENTATION >
double Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::meanY ( ) const
virtual

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

Definition at line 261 of file Generic2D.h.

261  {
262  return m_rep->GetMean(2);
263  }
IMPLEMENTATION * m_rep
Reference to underlying implementation.
Definition: Generic2D.h:143
template<class INTERFACE , class IMPLEMENTATION >
double Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::minBinHeight ( ) const
virtual

Get the minimum height of the in-range bins.

Definition at line 178 of file Generic2D.h.

178  {
179  return m_rep->GetMinimum();
180  }
IMPLEMENTATION * m_rep
Reference to underlying implementation.
Definition: Generic2D.h:143
template<class INTERFACE, class IMPLEMENTATION>
std::string Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::name ( ) const
inline

object name

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

327  {
329  m_rep->Print("all");
330  return s;
331  }
string s
Definition: gaudirun.py:210
IMPLEMENTATION * m_rep
Reference to underlying implementation.
Definition: Generic2D.h:143
template<class INTERFACE, class IMPLEMENTATION>
TObject* Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::representation ( ) const
inlinevirtual

ROOT object implementation.

Implements Gaudi::HistogramBase.

Definition at line 40 of file Generic2D.h.

40 { return m_rep; }
IMPLEMENTATION * m_rep
Reference to underlying implementation.
Definition: Generic2D.h:143
template<class INTERFACE , class IMPLEMENTATION >
bool Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::reset ( )

Definition at line 319 of file Generic2D.h.

319  {
320  m_sumEntries = 0;
321  m_rep->Reset ( );
322  return true;
323  }
int m_sumEntries
cache sumEntries (allEntries) when setting contents since Root can't compute by himself ...
Definition: Generic2D.h:147
IMPLEMENTATION * m_rep
Reference to underlying implementation.
Definition: Generic2D.h:143
template<class INTERFACE, class IMPLEMENTATION>
virtual int Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::rIndexX ( int  index) const
inlinevirtual

operator methods

Definition at line 61 of file Generic2D.h.

61 { return m_xAxis.rIndex(index); }
Axis m_xAxis
X axis member.
Definition: Generic2D.h:137
int rIndex(int index) const
Convert a AIDA bin number on the axis to the ROOT bin number.
Definition: Axis.h:55
template<class INTERFACE, class IMPLEMENTATION>
virtual int Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::rIndexY ( int  index) const
inlinevirtual

operator methods

Definition at line 63 of file Generic2D.h.

63 { return m_yAxis.rIndex(index); }
Axis m_yAxis
Y axis member.
Definition: Generic2D.h:139
int rIndex(int index) const
Convert a AIDA bin number on the axis to the ROOT bin number.
Definition: Axis.h:55
template<class INTERFACE , class IMPLEMENTATION >
double Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::rmsX ( ) const
virtual

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

Definition at line 266 of file Generic2D.h.

266  {
267  return m_rep->GetRMS(1);
268  }
IMPLEMENTATION * m_rep
Reference to underlying implementation.
Definition: Generic2D.h:143
template<class INTERFACE , class IMPLEMENTATION >
double Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::rmsY ( ) const
virtual

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

Definition at line 271 of file Generic2D.h.

271  {
272  return m_rep->GetRMS(2);
273  }
IMPLEMENTATION * m_rep
Reference to underlying implementation.
Definition: Generic2D.h:143
template<class INTERFACE , class IMPLEMENTATION >
bool Gaudi::Generic2D< 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 313 of file Generic2D.h.

313  {
314  m_rep->Scale ( scaleFactor );
315  return true;
316  }
IMPLEMENTATION * m_rep
Reference to underlying implementation.
Definition: Generic2D.h:143
template<class INTERFACE , class IMPLEMENTATION >
bool Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::setName ( const std::string &  newName)

Set the name of the object.

Definition at line 161 of file Generic2D.h.

161  {
162  m_rep->SetName(newName.c_str());
163  m_annotation.setValue( "Name", newName );
164  return true;
165  }
AIDA::Annotation m_annotation
Object annotations.
Definition: Generic2D.h:141
void setValue(const std::string &key, const std::string &value)
Set value for a given key.
Definition: Annotation.h:124
IMPLEMENTATION * m_rep
Reference to underlying implementation.
Definition: Generic2D.h:143
template<class INTERFACE , class IMPLEMENTATION >
bool Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::setTitle ( const std::string &  title)
virtual

Set the title of the object.

Definition at line 151 of file Generic2D.h.

151  {
152  m_rep->SetTitle(title.c_str());
153  if ( !annotation().addItem( "Title", title ) )
154  m_annotation.setValue( "Title" , title );
155  if ( !annotation().addItem( "title", title ) )
156  annotation().setValue( "title", title );
157  return true;
158  }
virtual AIDA::IAnnotation & annotation()
Access annotation object.
Definition: Generic2D.h:52
virtual std::string title() const
Get the title of the object.
Definition: Generic2D.h:44
AIDA::Annotation m_annotation
Object annotations.
Definition: Generic2D.h:141
void setValue(const std::string &key, const std::string &value)
Set value for a given key.
Definition: Annotation.h:124
IMPLEMENTATION * m_rep
Reference to underlying implementation.
Definition: Generic2D.h:143
template<class INTERFACE , class IMPLEMENTATION >
double Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::sumAllBinHeights ( ) const
virtual

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

Definition at line 193 of file Generic2D.h.

193  {
194  return m_rep->GetSum();
195  }
IMPLEMENTATION * m_rep
Reference to underlying implementation.
Definition: Generic2D.h:143
template<class INTERFACE , class IMPLEMENTATION >
double Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::sumBinHeights ( ) const
virtual

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

Definition at line 188 of file Generic2D.h.

188  {
189  return m_rep->GetSumOfWeights();
190  }
IMPLEMENTATION * m_rep
Reference to underlying implementation.
Definition: Generic2D.h:143
template<class INTERFACE, class IMPLEMENTATION>
virtual double Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::sumExtraBinHeights ( ) const
inlinevirtual

Get the sum of the underflow and overflow bin height.

Definition at line 76 of file Generic2D.h.

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

Get the title of the object.

Definition at line 44 of file Generic2D.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: Generic2D.h:141
template<class INTERFACE, class IMPLEMENTATION>
const std::string& Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::userLevelClassType ( ) const
inline

The AIDA user-level unterface leaf class type.

Definition at line 125 of file Generic2D.h.

125 { return m_classType; }
std::string m_classType
class type
Definition: Generic2D.h:145
template<class INTERFACE , class IMPLEMENTATION >
std::ostream & Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::write ( std::ostream &  s) const
virtual

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

Implements Gaudi::HistogramBase.

Definition at line 335 of file Generic2D.h.

336  {
337  s << std::endl << "2D Histogram Table: " << std::endl;
338  s << "BinX, BinY, Height, Error " << std::endl;
339  for ( int i = 0; i < xAxis().bins(); ++i ) {
340  for ( int j = 0; j < yAxis().bins(); ++j ) {
341  s << binMeanX( i, j ) << ", "
342  << binMeanY( i, j ) << ", "
343  << binHeight( i, j ) << ", "
344  << binError ( i, j ) << std::endl;
345  }
346  }
347  s << std::endl;
348  return s;
349  }
virtual double binMeanX(int indexX, int indexY) const
The weighted mean along x of a given bin.
Definition: Generic2D.h:203
virtual double binError(int indexX, int indexY) const
The error on this bin.
Definition: Generic2D.h:251
virtual double binHeight(int indexX, int indexY) const
Total height of the corresponding bin (ie the sum of the weights in this bin).
Definition: Generic2D.h:229
string s
Definition: gaudirun.py:210
virtual const AIDA::IAxis & yAxis() const
Return the Y axis.
Definition: Generic2D.h:59
virtual double binMeanY(int indexX, int indexY) const
The weighted mean along y of a given bin.
Definition: Generic2D.h:208
list i
Definition: ana.py:128
virtual const AIDA::IAxis & xAxis() const
Return the X axis.
Definition: Generic2D.h:57
template<class INTERFACE , class IMPLEMENTATION >
int Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::write ( const char *  file_name) const
virtual

Write (ASCII) the histogram table into a file.

Implements Gaudi::HistogramBase.

Definition at line 353 of file Generic2D.h.

354  {
355  TFile *f = TFile::Open(file_name,"RECREATE");
356  Int_t nbytes = m_rep->Write();
357  f->Close();
358  return nbytes;
359  }
IMPLEMENTATION * m_rep
Reference to underlying implementation.
Definition: Generic2D.h:143
template<class INTERFACE, class IMPLEMENTATION>
virtual const AIDA::IAxis& Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::xAxis ( ) const
inlinevirtual

Return the X axis.

Definition at line 57 of file Generic2D.h.

57 { return m_xAxis; }
Axis m_xAxis
X axis member.
Definition: Generic2D.h:137
template<class INTERFACE, class IMPLEMENTATION>
virtual const AIDA::IAxis& Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::yAxis ( ) const
inlinevirtual

Return the Y axis.

Definition at line 59 of file Generic2D.h.

59 { return m_yAxis; }
Axis m_yAxis
Y axis member.
Definition: Generic2D.h:139

Member Data Documentation

template<class INTERFACE, class IMPLEMENTATION>
AIDA::Annotation Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::m_annotation
mutableprotected

Object annotations.

Definition at line 141 of file Generic2D.h.

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

class type

Definition at line 145 of file Generic2D.h.

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

Reference to underlying implementation.

Definition at line 143 of file Generic2D.h.

template<class INTERFACE, class IMPLEMENTATION>
int Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::m_sumEntries
protected

cache sumEntries (allEntries) when setting contents since Root can't compute by himself

Definition at line 147 of file Generic2D.h.

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

X axis member.

Definition at line 137 of file Generic2D.h.

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

Y axis member.

Definition at line 139 of file Generic2D.h.


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