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

Protected Member Functions

 Generic2D (IMPLEMENTATION *p)
 constructor More...
 

Protected Attributes

Axis m_xAxis
 X axis member. More...
 
Axis m_yAxis
 Y axis member. More...
 
AIDA::Annotation m_annotation
 Object annotations. More...
 
std::unique_ptr< IMPLEMENTATION > m_rep
 Reference to underlying implementation. More...
 
std::string m_classType
 class type More...
 
int m_sumEntries = 0
 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 37 of file Generic2D.h.

Member Typedef Documentation

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

Definition at line 39 of file Generic2D.h.

Constructor & Destructor Documentation

template<class INTERFACE, class IMPLEMENTATION>
Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::Generic2D ( )
default
template<class INTERFACE, class IMPLEMENTATION>
Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::Generic2D ( IMPLEMENTATION *  p)
inlineprotected

constructor

Definition at line 44 of file Generic2D.h.

44 : m_rep(p) { }
std::unique_ptr< IMPLEMENTATION > m_rep
Reference to underlying implementation.
Definition: Generic2D.h:152
template<class INTERFACE, class IMPLEMENTATION>
Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::~Generic2D ( )
overridedefault

Destructor.

Member Function Documentation

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

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

Definition at line 295 of file Generic2D.h.

295  {
296  const Base* p = dynamic_cast<const Base*>(&hist);
297  if ( !p ) throw std::runtime_error("Cannot add profile histograms of different implementations.");
298  m_rep->Add(p->m_rep.get());
299  return true;
300  }
Generic2D< INTERFACE, IMPLEMENTATION > Base
Definition: Generic2D.h:39
std::unique_ptr< IMPLEMENTATION > m_rep
Reference to underlying implementation.
Definition: Generic2D.h:152
template<class INTERFACE, class IMPLEMENTATION>
void Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::adoptRepresentation ( TObject *  rep)
overridevirtual

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 70 of file P2D.cpp.

70  {
71  TProfile2D* imp = dynamic_cast<TProfile2D*>(rep);
72  if ( !imp ) throw std::runtime_error("Cannot adopt native histogram representation.");
73  m_rep.reset( imp );
74  m_xAxis.initialize(m_rep->GetXaxis(),true);
75  m_yAxis.initialize(m_rep->GetYaxis(),true);
76  setTitle(m_rep->GetTitle());
77  }
Axis m_xAxis
X axis member.
Definition: Generic2D.h:146
T reset(T...args)
void initialize(TAxis *itaxi, bool)
Definition: Axis.h:71
bool setTitle(const std::string &title) override
Set the title of the object.
Definition: Generic2D.h:160
Axis m_yAxis
Y axis member.
Definition: Generic2D.h:148
std::unique_ptr< IMPLEMENTATION > m_rep
Reference to underlying implementation.
Definition: Generic2D.h:152
template<>
void Gaudi::Generic2D< AIDA::IHistogram2D, TH2D >::adoptRepresentation ( TObject *  rep)
virtual

Adopt ROOT histogram representation.

Implements Gaudi::HistogramBase.

Definition at line 105 of file H2D.cpp.

105  {
106  TH2D* imp = dynamic_cast<TH2D*>(rep);
107  if ( !imp ) throw std::runtime_error("Cannot adopt native histogram representation.");
108  m_rep.reset( 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 ( !a || (a && a->GetSize()==0) ) m_rep->Sumw2();
113  setTitle(m_rep->GetTitle());
114  }
Axis m_xAxis
X axis member.
Definition: Generic2D.h:146
T reset(T...args)
void initialize(TAxis *itaxi, bool)
Definition: Axis.h:71
bool setTitle(const std::string &title) override
Set the title of the object.
Definition: Generic2D.h:160
Axis m_yAxis
Y axis member.
Definition: Generic2D.h:148
std::unique_ptr< IMPLEMENTATION > m_rep
Reference to underlying implementation.
Definition: Generic2D.h:152
template<class INTERFACE , class IMPLEMENTATION >
int Gaudi::Generic2D< 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 182 of file Generic2D.h.

182  {
183  return m_rep->GetEntries();
184  }
std::unique_ptr< IMPLEMENTATION > m_rep
Reference to underlying implementation.
Definition: Generic2D.h:152
template<class INTERFACE, class IMPLEMENTATION>
AIDA::IAnnotation& Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::annotation ( )
inlineoverride

Access annotation object.

Definition at line 61 of file Generic2D.h.

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

Access annotation object (cons)

Definition at line 63 of file Generic2D.h.

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

Definition at line 64 of file P2D.cpp.

64  {
65  int rBin = m_rep->GetBin(rIndexX(idX),rIndexY(idY));
66  return int(m_rep->GetBinEntries(rBin)+0.5);
67  }
virtual int rIndexX(int index) const
operator methods
Definition: Generic2D.h:70
std::unique_ptr< IMPLEMENTATION > m_rep
Reference to underlying implementation.
Definition: Generic2D.h:152
virtual int rIndexY(int index) const
operator methods
Definition: Generic2D.h:72
template<class INTERFACE, class IMPLEMENTATION>
int Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::binEntries ( int  indexX,
int  indexY 
) const
override

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 98 of file H2D.cpp.

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

Equivalent to projectionX().binEntries(indexX).

Definition at line 222 of file Generic2D.h.

222  {
223  int n = 0;
224  for (int iY = -2; iY < yAxis().bins(); ++iY)
225  n += binEntries(index,iY);
226  return n;
227  }
int binEntries(int indexX, int indexY) const override
The number of entries (ie the number of times fill was called for this bin).
const AIDA::IAxis & yAxis() const override
Return the Y axis.
Definition: Generic2D.h:68
template<class INTERFACE , class IMPLEMENTATION >
int Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::binEntriesY ( int  indexY) const
override

Equivalent to projectionY().binEntries(indexY).

Definition at line 230 of file Generic2D.h.

230  {
231  int n = 0;
232  for (int iX = -2; iX < xAxis().bins(); ++iX)
233  n += binEntries(iX,index);
234  return n;
235  }
int binEntries(int indexX, int indexY) const override
The number of entries (ie the number of times fill was called for this bin).
const AIDA::IAxis & xAxis() const override
Return the X axis.
Definition: Generic2D.h:66
template<class INTERFACE , class IMPLEMENTATION >
double Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::binError ( int  indexX,
int  indexY 
) const
override

The error on this bin.

Definition at line 260 of file Generic2D.h.

260  {
261  return m_rep->GetBinError ( rIndexX(indexX), rIndexY(indexY ) );
262  }
virtual int rIndexX(int index) const
operator methods
Definition: Generic2D.h:70
std::unique_ptr< IMPLEMENTATION > m_rep
Reference to underlying implementation.
Definition: Generic2D.h:152
virtual int rIndexY(int index) const
operator methods
Definition: Generic2D.h:72
template<class INTERFACE , class IMPLEMENTATION >
double Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::binHeight ( int  indexX,
int  indexY 
) const
override

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

Definition at line 238 of file Generic2D.h.

238  {
239  return m_rep->GetBinContent ( rIndexX(indexX), rIndexY(indexY) );
240  }
virtual int rIndexX(int index) const
operator methods
Definition: Generic2D.h:70
std::unique_ptr< IMPLEMENTATION > m_rep
Reference to underlying implementation.
Definition: Generic2D.h:152
virtual int rIndexY(int index) const
operator methods
Definition: Generic2D.h:72
template<class INTERFACE , class IMPLEMENTATION >
double Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::binHeightX ( int  indexX) const
override

Equivalent to projectionX().binHeight(indexX).

Definition at line 243 of file Generic2D.h.

243  {
244  double s = 0;
245  for (int iY = -2; iY < yAxis().bins(); ++iY) {
246  s += binHeight(index,iY);
247  }
248  return s;
249  }
string s
Definition: gaudirun.py:245
const AIDA::IAxis & yAxis() const override
Return the Y axis.
Definition: Generic2D.h:68
double binHeight(int indexX, int indexY) const override
Total height of the corresponding bin (ie the sum of the weights in this bin).
Definition: Generic2D.h:238
template<class INTERFACE , class IMPLEMENTATION >
double Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::binHeightY ( int  indexY) const
override

Equivalent to projectionY().binHeight(indexY).

Definition at line 252 of file Generic2D.h.

252  {
253  double s = 0;
254  for (int iX = -2; iX < xAxis().bins(); ++iX)
255  s += binHeight(iX,index);
256  return s;
257  }
string s
Definition: gaudirun.py:245
const AIDA::IAxis & xAxis() const override
Return the X axis.
Definition: Generic2D.h:66
double binHeight(int indexX, int indexY) const override
Total height of the corresponding bin (ie the sum of the weights in this bin).
Definition: Generic2D.h:238
template<class INTERFACE , class IMPLEMENTATION >
double Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::binMeanX ( int  indexX,
int  indexY 
) const
override

The weighted mean along x of a given bin.

Definition at line 212 of file Generic2D.h.

212  {
213  return m_rep->GetXaxis()->GetBinCenter( rIndexX(indexX) );
214  }
virtual int rIndexX(int index) const
operator methods
Definition: Generic2D.h:70
std::unique_ptr< IMPLEMENTATION > m_rep
Reference to underlying implementation.
Definition: Generic2D.h:152
template<class INTERFACE , class IMPLEMENTATION >
double Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::binMeanY ( int  indexX,
int  indexY 
) const
override

The weighted mean along y of a given bin.

Definition at line 217 of file Generic2D.h.

217  {
218  return m_rep->GetYaxis()->GetBinCenter( rIndexY(indexY) );
219  }
std::unique_ptr< IMPLEMENTATION > m_rep
Reference to underlying implementation.
Definition: Generic2D.h:152
virtual int rIndexY(int index) const
operator methods
Definition: Generic2D.h:72
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 207 of file Generic2D.h.

207  {
208  return m_rep->GetBinError ( rIndexX(indexX), rIndexY(indexY) );
209  }
virtual int rIndexX(int index) const
operator methods
Definition: Generic2D.h:70
std::unique_ptr< IMPLEMENTATION > m_rep
Reference to underlying implementation.
Definition: Generic2D.h:152
virtual int rIndexY(int index) const
operator methods
Definition: Generic2D.h:72
template<>
void * Gaudi::Generic2D< AIDA::IProfile2D, TProfile2D >::cast ( const std::string className) const

Definition at line 53 of file P2D.cpp.

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

Definition at line 89 of file H2D.cpp.

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

Introspection method.

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

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

Definition at line 285 of file Generic2D.h.

285  {
286  return xAxis().coordToIndex(coord);
287  }
const AIDA::IAxis & xAxis() const override
Return the X axis.
Definition: Generic2D.h:66
template<class INTERFACE , class IMPLEMENTATION >
int Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::coordToIndexY ( double  coordY) const
override

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

Definition at line 290 of file Generic2D.h.

290  {
291  return yAxis().coordToIndex(coord);
292  }
const AIDA::IAxis & yAxis() const override
Return the Y axis.
Definition: Generic2D.h:68
template<class INTERFACE, class IMPLEMENTATION>
int Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::dimension ( ) const
inlineoverride

Get the Histogram's dimension.

Definition at line 136 of file Generic2D.h.

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

Get the number or all the entries.

Definition at line 177 of file Generic2D.h.

177  {
178  return m_rep->GetEntries();
179  }
std::unique_ptr< IMPLEMENTATION > m_rep
Reference to underlying implementation.
Definition: Generic2D.h:152
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 312 of file Generic2D.h.

312  {
313  if (sumBinHeights() <= 0) return 0;
314  Stat_t stats[11]; // cover up to 3D...
315  m_rep->GetStats(stats);
316  return stats[0]*stats[0]/stats[1];
317  }
double sumBinHeights() const override
Get the sum of in range bin heights in the IProfile.
Definition: Generic2D.h:197
std::unique_ptr< IMPLEMENTATION > m_rep
Reference to underlying implementation.
Definition: Generic2D.h:152
template<class INTERFACE , class IMPLEMENTATION >
int Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::extraEntries ( ) const
override

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

Definition at line 303 of file Generic2D.h.

303  {
304  return
305  binEntries(AIDA::IAxis::UNDERFLOW_BIN,AIDA::IAxis::UNDERFLOW_BIN) +
306  binEntries(AIDA::IAxis::UNDERFLOW_BIN,AIDA::IAxis::OVERFLOW_BIN) +
307  binEntries(AIDA::IAxis::OVERFLOW_BIN,AIDA::IAxis::UNDERFLOW_BIN) +
308  binEntries(AIDA::IAxis::OVERFLOW_BIN,AIDA::IAxis::OVERFLOW_BIN);
309  }
int binEntries(int indexX, int indexY) const override
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
override

Get the maximum height of the in-range bins.

Definition at line 192 of file Generic2D.h.

192  {
193  return m_rep->GetMaximum();
194  }
std::unique_ptr< IMPLEMENTATION > m_rep
Reference to underlying implementation.
Definition: Generic2D.h:152
template<class INTERFACE , class IMPLEMENTATION >
double Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::meanX ( ) const
override

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

Definition at line 265 of file Generic2D.h.

265  {
266  return m_rep->GetMean(1);
267  }
std::unique_ptr< IMPLEMENTATION > m_rep
Reference to underlying implementation.
Definition: Generic2D.h:152
template<class INTERFACE , class IMPLEMENTATION >
double Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::meanY ( ) const
override

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

Definition at line 270 of file Generic2D.h.

270  {
271  return m_rep->GetMean(2);
272  }
std::unique_ptr< IMPLEMENTATION > m_rep
Reference to underlying implementation.
Definition: Generic2D.h:152
template<class INTERFACE , class IMPLEMENTATION >
double Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::minBinHeight ( ) const
override

Get the minimum height of the in-range bins.

Definition at line 187 of file Generic2D.h.

187  {
188  return m_rep->GetMinimum();
189  }
std::unique_ptr< IMPLEMENTATION > m_rep
Reference to underlying implementation.
Definition: Generic2D.h:152
template<class INTERFACE, class IMPLEMENTATION>
std::string Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::name ( ) const
inline

object name

Definition at line 57 of file Generic2D.h.

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

334  {
336  m_rep->Print("all");
337  return s;
338  }
string s
Definition: gaudirun.py:245
std::unique_ptr< IMPLEMENTATION > m_rep
Reference to underlying implementation.
Definition: Generic2D.h:152
template<class INTERFACE, class IMPLEMENTATION>
TObject* Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::representation ( ) const
inlineoverridevirtual

ROOT object implementation.

Implements Gaudi::HistogramBase.

Definition at line 49 of file Generic2D.h.

49 { return m_rep.get(); }
T get(T...args)
std::unique_ptr< IMPLEMENTATION > m_rep
Reference to underlying implementation.
Definition: Generic2D.h:152
template<class INTERFACE , class IMPLEMENTATION >
bool Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::reset ( )
override

Definition at line 326 of file Generic2D.h.

326  {
327  m_sumEntries = 0;
328  m_rep->Reset ( );
329  return true;
330  }
int m_sumEntries
cache sumEntries (allEntries) when setting contents since Root can&#39;t compute by himself ...
Definition: Generic2D.h:156
std::unique_ptr< IMPLEMENTATION > m_rep
Reference to underlying implementation.
Definition: Generic2D.h:152
template<class INTERFACE, class IMPLEMENTATION>
virtual int Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::rIndexX ( int  index) const
inlinevirtual

operator methods

Definition at line 70 of file Generic2D.h.

70 { return m_xAxis.rIndex(index); }
Axis m_xAxis
X axis member.
Definition: Generic2D.h:146
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 72 of file Generic2D.h.

72 { return m_yAxis.rIndex(index); }
Axis m_yAxis
Y axis member.
Definition: Generic2D.h:148
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
override

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

Definition at line 275 of file Generic2D.h.

275  {
276  return m_rep->GetRMS(1);
277  }
std::unique_ptr< IMPLEMENTATION > m_rep
Reference to underlying implementation.
Definition: Generic2D.h:152
template<class INTERFACE , class IMPLEMENTATION >
double Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::rmsY ( ) const
override

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

Definition at line 280 of file Generic2D.h.

280  {
281  return m_rep->GetRMS(2);
282  }
std::unique_ptr< IMPLEMENTATION > m_rep
Reference to underlying implementation.
Definition: Generic2D.h:152
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 320 of file Generic2D.h.

320  {
321  m_rep->Scale ( scaleFactor );
322  return true;
323  }
std::unique_ptr< IMPLEMENTATION > m_rep
Reference to underlying implementation.
Definition: Generic2D.h:152
template<class INTERFACE , class IMPLEMENTATION >
bool Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::setName ( const std::string newName)

Set the name of the object.

Definition at line 170 of file Generic2D.h.

170  {
171  m_rep->SetName(newName.c_str());
172  m_annotation.setValue( "Name", newName );
173  return true;
174  }
void setValue(const std::string &key, const std::string &value) override
Set value for a given key.
Definition: Annotation.h:121
AIDA::Annotation m_annotation
Object annotations.
Definition: Generic2D.h:150
T c_str(T...args)
std::unique_ptr< IMPLEMENTATION > m_rep
Reference to underlying implementation.
Definition: Generic2D.h:152
template<class INTERFACE , class IMPLEMENTATION >
bool Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::setTitle ( const std::string title)
override

Set the title of the object.

Definition at line 160 of file Generic2D.h.

160  {
161  m_rep->SetTitle(title.c_str());
162  if ( !annotation().addItem( "Title", title ) )
163  m_annotation.setValue( "Title" , title );
164  if ( !annotation().addItem( "title", title ) )
165  annotation().setValue( "title", title );
166  return true;
167  }
void setValue(const std::string &key, const std::string &value) override
Set value for a given key.
Definition: Annotation.h:121
AIDA::IAnnotation & annotation() override
Access annotation object.
Definition: Generic2D.h:61
AIDA::Annotation m_annotation
Object annotations.
Definition: Generic2D.h:150
T c_str(T...args)
std::unique_ptr< IMPLEMENTATION > m_rep
Reference to underlying implementation.
Definition: Generic2D.h:152
template<class INTERFACE , class IMPLEMENTATION >
double Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::sumAllBinHeights ( ) const
override

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

Definition at line 202 of file Generic2D.h.

202  {
203  return m_rep->GetSum();
204  }
std::unique_ptr< IMPLEMENTATION > m_rep
Reference to underlying implementation.
Definition: Generic2D.h:152
template<class INTERFACE , class IMPLEMENTATION >
double Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::sumBinHeights ( ) const
override

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

Definition at line 197 of file Generic2D.h.

197  {
198  return m_rep->GetSumOfWeights();
199  }
std::unique_ptr< IMPLEMENTATION > m_rep
Reference to underlying implementation.
Definition: Generic2D.h:152
template<class INTERFACE, class IMPLEMENTATION>
double Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::sumExtraBinHeights ( ) const
inlineoverride

Get the sum of the underflow and overflow bin height.

Definition at line 85 of file Generic2D.h.

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

Get the title of the object.

Definition at line 53 of file Generic2D.h.

53 { return m_annotation.value( "Title" ); }
AIDA::Annotation m_annotation
Object annotations.
Definition: Generic2D.h:150
std::string value(const std::string &key) const override
Retrieve the value for a given key.
Definition: Annotation.h:114
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 134 of file Generic2D.h.

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

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

Implements Gaudi::HistogramBase.

Definition at line 342 of file Generic2D.h.

343  {
344  s << std::endl << "2D Histogram Table: " << std::endl;
345  s << "BinX, BinY, Height, Error " << std::endl;
346  for ( int i = 0; i < xAxis().bins(); ++i ) {
347  for ( int j = 0; j < yAxis().bins(); ++j ) {
348  s << binMeanX( i, j ) << ", "
349  << binMeanY( i, j ) << ", "
350  << binHeight( i, j ) << ", "
351  << binError ( i, j ) << std::endl;
352  }
353  }
354  s << std::endl;
355  return s;
356  }
T endl(T...args)
double binMeanY(int indexX, int indexY) const override
The weighted mean along y of a given bin.
Definition: Generic2D.h:217
double binError(int indexX, int indexY) const override
The error on this bin.
Definition: Generic2D.h:260
string s
Definition: gaudirun.py:245
double binMeanX(int indexX, int indexY) const override
The weighted mean along x of a given bin.
Definition: Generic2D.h:212
const AIDA::IAxis & yAxis() const override
Return the Y axis.
Definition: Generic2D.h:68
const AIDA::IAxis & xAxis() const override
Return the X axis.
Definition: Generic2D.h:66
double binHeight(int indexX, int indexY) const override
Total height of the corresponding bin (ie the sum of the weights in this bin).
Definition: Generic2D.h:238
template<class INTERFACE , class IMPLEMENTATION >
int Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::write ( const char *  file_name) const
overridevirtual

Write (ASCII) the histogram table into a file.

Implements Gaudi::HistogramBase.

Definition at line 360 of file Generic2D.h.

361  {
362  TFile *f = TFile::Open(file_name,"RECREATE");
363  Int_t nbytes = m_rep->Write();
364  f->Close();
365  return nbytes;
366  }
std::unique_ptr< IMPLEMENTATION > m_rep
Reference to underlying implementation.
Definition: Generic2D.h:152
template<class INTERFACE, class IMPLEMENTATION>
const AIDA::IAxis& Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::xAxis ( ) const
inlineoverride

Return the X axis.

Definition at line 66 of file Generic2D.h.

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

Return the Y axis.

Definition at line 68 of file Generic2D.h.

68 { return m_yAxis; }
Axis m_yAxis
Y axis member.
Definition: Generic2D.h:148

Member Data Documentation

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

Object annotations.

Definition at line 150 of file Generic2D.h.

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

class type

Definition at line 154 of file Generic2D.h.

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

Reference to underlying implementation.

Definition at line 152 of file Generic2D.h.

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

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

Definition at line 156 of file Generic2D.h.

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

X axis member.

Definition at line 146 of file Generic2D.h.

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

Y axis member.

Definition at line 148 of file Generic2D.h.


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