| The Gaudi Framework v29r0 (ff2e7097)

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
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 >:
[legend]
Collaboration diagram for Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >:
[legend]

## 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 override
| The weighted mean along the x axis of a given bin. More...
double | binMeanY (int, int indexY, int) const override
| The weighted mean along the y axis of a given bin. More...
double | binMeanZ (int, int, int indexZ) const override
| The weighted mean along the z axis of a given bin. More...
int | binEntries (int indexX, int indexY, int indexZ) const override
| 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 override
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

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

## Member Typedef Documentation

template<typename INTERFACE, typename IMPLEMENTATION>

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

Definition at line 39 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 | ) |
| inline protected

constructor

Definition at line 45 of file Generic3D.h.

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

Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::~Generic3D | ( |  | ) |
| override default

Destructor.

## Member Function Documentation

template<typename INTERFACE, typename IMPLEMENTATION>

bool Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::add | ( | const INTERFACE & | hist | ) |
| inline override

Add to this Histogram3D the contents of another IHistogram3D.

Definition at line 204 of file Generic3D.h.

205 {
206 const Base* p = dynamic_cast<const Base*>( &hist );
207 if ( !p ) throw std::runtime_error( "Cannot add profile histograms of different implementations." );
208 m_rep->Add( p->m_rep.get() );
209 return true;
210 }
Gaudi::Generic3D::Base
Generic3D< INTERFACE, IMPLEMENTATION > Base
Definition: Generic3D.h:39
std::runtime_error
STL class.
Gaudi::Generic3D::m_rep
std::unique_ptr< IMPLEMENTATION > m_rep
Reference to underlying implementation.
Definition: Generic3D.h:237
template<>

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

Adopt ROOT histogram representation.

Implements Gaudi::HistogramBase.

Definition at line 25 of file H3D.cpp.

26 {
27 TH3D* imp = dynamic_cast<TH3D*>( rep );
28 if ( !imp ) throw std::runtime_error( "Cannot adopt native histogram representation." );
29 m_rep.reset( imp );
30 m_xAxis.initialize( m_rep->GetXaxis(), true );
31 m_yAxis.initialize( m_rep->GetYaxis(), true );
32 m_zAxis.initialize( m_rep->GetZaxis(), true );
33 const TArrayD* a = m_rep->GetSumw2();
34 if ( !a || ( a && a->GetSize() == 0 ) ) m_rep->Sumw2();
35 setTitle( m_rep->GetTitle() );
36 }
Gaudi::Generic3D::m_xAxis
Gaudi::Axis m_xAxis
Definition: Generic3D.h:231
Gaudi::Generic3D::m_yAxis
Gaudi::Axis m_yAxis
Definition: Generic3D.h:232
std::runtime_error
STL class.
std::unique_ptr::reset
T reset(T...args)
Gaudi::Generic3D::m_zAxis
Gaudi::Axis m_zAxis
Definition: Generic3D.h:233
Gaudi::Generic3D::setTitle
bool setTitle(const std::string &title) override
Set the title of the object.
Definition: Generic3D.h:245
Gaudi::Generic3D::m_rep
std::unique_ptr< IMPLEMENTATION > m_rep
Reference to underlying implementation.
Definition: Generic3D.h:237
Gaudi::Axis::initialize
void initialize(TAxis *itaxi, bool)
Definition: Axis.h:67
template<typename INTERFACE, typename IMPLEMENTATION>

void Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::adoptRepresentation | ( | TObject * | rep | ) |
| override virtual

Adopt ROOT histogram representation.

Implements Gaudi::HistogramBase.

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

268 {
269 return int( m_rep->GetEntries() );
270 }
Gaudi::Generic3D::m_rep
std::unique_ptr< IMPLEMENTATION > m_rep
Reference to underlying implementation.
Definition: Generic3D.h:237
template<typename INTERFACE, typename IMPLEMENTATION>

AIDA::IAnnotation& Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::annotation | ( |  | ) |
| inline override

Access annotation object.

Definition at line 66 of file Generic3D.h.

66 { return m_annotation; }
Gaudi::Generic3D::m_annotation
AIDA::Annotation m_annotation
Object annotations.
Definition: Generic3D.h:235
template<typename INTERFACE, typename IMPLEMENTATION>

const AIDA::IAnnotation& Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::annotation | ( |  | ) | const
| inline override

Access annotation object (cons)

Definition at line 68 of file Generic3D.h.

68 { return m_annotation; }
Gaudi::Generic3D::m_annotation
AIDA::Annotation m_annotation
Object annotations.
Definition: Generic3D.h:235
template<typename INTERFACE, typename IMPLEMENTATION>

int Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::binEntries | ( | int | indexX,
|  | int | indexY,
|  | int | indexZ
| ) |  | const
| inline override

Number of entries in the corresponding bin (ie the number of times fill was calle d for this bin).

Definition at line 105 of file Generic3D.h.

106 {
107 if ( binHeight( indexX, indexY, indexZ ) <= 0 ) return 0;
108 double xx = binHeight( indexX, indexY, indexZ ) / binError( indexX, indexY, indexZ );
109 return int( xx * xx + 0.5 );
110 }
Gaudi::Generic3D::binHeight
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:138
Gaudi::Generic3D::binError
double binError(int indexX, int indexY, int indexZ) const override
The error of a given bin.
Definition: Generic3D.h:168
template<typename INTERFACE, typename IMPLEMENTATION>

int Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::binEntriesX | ( | int | index | ) | const
| inline override

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

Definition at line 112 of file Generic3D.h.

113 {
114 int n = 0;
115 for ( int i = -2; i < yAxis().bins(); ++i )
116 for ( int j = -2; j < zAxis().bins(); ++j ) n += binEntries( index, i, j );
117 return n;
118 }
Gaudi::Generic3D::yAxis
const AIDA::IAxis & yAxis() const override
Get the y axis of the IHistogram3D.
Definition: Generic3D.h:188
Gaudi::Generic3D::zAxis
const AIDA::IAxis & zAxis() const override
Get the z axis of the IHistogram3D.
Definition: Generic3D.h:190
GaudiPluginService.cpluginsvc.n
n
Definition: cpluginsvc.py:228
Gaudi::Generic3D::binEntries
int binEntries(int indexX, int indexY, int indexZ) const override
Number of entries in the corresponding bin (ie the number of times fill was calle d for this bin)...
Definition: Generic3D.h:105
template<typename INTERFACE, typename IMPLEMENTATION>

int Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::binEntriesY | ( | int | index | ) | const
| inline override

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

Definition at line 120 of file Generic3D.h.

121 {
122 int n = 0;
123 for ( int i = -2; i < xAxis().bins(); ++i )
124 for ( int j = -2; j < zAxis().bins(); ++j ) n += binEntries( i, index, j );
125 return n;
126 }
Gaudi::Generic3D::zAxis
const AIDA::IAxis & zAxis() const override
Get the z axis of the IHistogram3D.
Definition: Generic3D.h:190
GaudiPluginService.cpluginsvc.n
n
Definition: cpluginsvc.py:228
Gaudi::Generic3D::binEntries
int binEntries(int indexX, int indexY, int indexZ) const override
Number of entries in the corresponding bin (ie the number of times fill was calle d for this bin)...
Definition: Generic3D.h:105
Gaudi::Generic3D::xAxis
const AIDA::IAxis & xAxis() const override
Get the x axis of the IHistogram3D.
Definition: Generic3D.h:186
template<typename INTERFACE, typename IMPLEMENTATION>

int Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::binEntriesZ | ( | int | index | ) | const
| inline override

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

Definition at line 129 of file Generic3D.h.

130 {
131 int n = 0;
132 for ( int i = -2; i < xAxis().bins(); ++i )
133 for ( int j = -2; j < yAxis().bins(); ++j ) n += binEntries( i, j, index );
134 return n;
135 }
Gaudi::Generic3D::yAxis
const AIDA::IAxis & yAxis() const override
Get the y axis of the IHistogram3D.
Definition: Generic3D.h:188
GaudiPluginService.cpluginsvc.n
n
Definition: cpluginsvc.py:228
Gaudi::Generic3D::binEntries
int binEntries(int indexX, int indexY, int indexZ) const override
Number of entries in the corresponding bin (ie the number of times fill was calle d for this bin)...
Definition: Generic3D.h:105
Gaudi::Generic3D::xAxis
const AIDA::IAxis & xAxis() const override
Get the x axis of the IHistogram3D.
Definition: Generic3D.h:186
template<typename INTERFACE, typename IMPLEMENTATION>

double Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::binError | ( | int | indexX,
|  | int | indexY,
|  | int | indexZ
| ) |  | const
| inline override

The error of a given bin.

Definition at line 168 of file Generic3D.h.

169 {
170 return m_rep->GetBinError( rIndexX( indexX ), rIndexY( indexY ), rIndexZ( indexZ ) );
171 }
Gaudi::Generic3D::rIndexZ
int rIndexZ(int index) const
Definition: Generic3D.h:87
Gaudi::Generic3D::rIndexX
int rIndexX(int index) const
Definition: Generic3D.h:85
Gaudi::Generic3D::rIndexY
int rIndexY(int index) const
Definition: Generic3D.h:86
Gaudi::Generic3D::m_rep
std::unique_ptr< IMPLEMENTATION > m_rep
Reference to underlying implementation.
Definition: Generic3D.h:237
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 138 of file Generic3D.h.

139 {
140 return m_rep->GetBinContent( rIndexX( indexX ), rIndexY( indexY ), rIndexZ( indexZ ) );
141 }
Gaudi::Generic3D::rIndexZ
int rIndexZ(int index) const
Definition: Generic3D.h:87
Gaudi::Generic3D::rIndexX
int rIndexX(int index) const
Definition: Generic3D.h:85
Gaudi::Generic3D::rIndexY
int rIndexY(int index) const
Definition: Generic3D.h:86
Gaudi::Generic3D::m_rep
std::unique_ptr< IMPLEMENTATION > m_rep
Reference to underlying implementation.
Definition: Generic3D.h:237
template<typename INTERFACE, typename IMPLEMENTATION>

double Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::binHeightX | ( | int | index | ) | const
| inline override

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

Definition at line 144 of file Generic3D.h.

145 {
146 double s = 0;
147 for ( int i = -2; i < yAxis().bins(); ++i )
148 for ( int j = -2; j < zAxis().bins(); ++j ) s += binHeight( index, i, j );
149 return s;
150 }
Gaudi::Generic3D::yAxis
const AIDA::IAxis & yAxis() const override
Get the y axis of the IHistogram3D.
Definition: Generic3D.h:188
Gaudi::Generic3D::zAxis
const AIDA::IAxis & zAxis() const override
Get the z axis of the IHistogram3D.
Definition: Generic3D.h:190
Gaudi::Generic3D::binHeight
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:138
gaudirun.s
string s
Definition: gaudirun.py:253
template<typename INTERFACE, typename IMPLEMENTATION>

double Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::binHeightY | ( | int | index | ) | const
| inline override

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

Definition at line 152 of file Generic3D.h.

153 {
154 double s = 0;
155 for ( int i = -2; i < xAxis().bins(); ++i )
156 for ( int j = -2; j < zAxis().bins(); ++j ) s += binHeight( i, index, j );
157 return s;
158 }
Gaudi::Generic3D::zAxis
const AIDA::IAxis & zAxis() const override
Get the z axis of the IHistogram3D.
Definition: Generic3D.h:190
Gaudi::Generic3D::binHeight
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:138
Gaudi::Generic3D::xAxis
const AIDA::IAxis & xAxis() const override
Get the x axis of the IHistogram3D.
Definition: Generic3D.h:186
gaudirun.s
string s
Definition: gaudirun.py:253
template<typename INTERFACE, typename IMPLEMENTATION>

double Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::binHeightZ | ( | int | index | ) | const
| inline override

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

Definition at line 160 of file Generic3D.h.

161 {
162 double s = 0;
163 for ( int i = -2; i < xAxis().bins(); ++i )
164 for ( int j = -2; j < yAxis().bins(); ++j ) s += binHeight( i, j, index );
165 return s;
166 }
Gaudi::Generic3D::yAxis
const AIDA::IAxis & yAxis() const override
Get the y axis of the IHistogram3D.
Definition: Generic3D.h:188
Gaudi::Generic3D::binHeight
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:138
Gaudi::Generic3D::xAxis
const AIDA::IAxis & xAxis() const override
Get the x axis of the IHistogram3D.
Definition: Generic3D.h:186
gaudirun.s
string s
Definition: gaudirun.py:253
template<typename INTERFACE, typename IMPLEMENTATION>

double Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::binMeanX | ( | int | indexX,
|  | int | ,
|  | int |
| ) |  | const
| inline override

The weighted mean along the x axis of a given bin.

Definition at line 90 of file Generic3D.h.

91 {
92 return m_rep->GetXaxis()->GetBinCenter( rIndexX( indexX ) );
93 }
Gaudi::Generic3D::rIndexX
int rIndexX(int index) const
Definition: Generic3D.h:85
Gaudi::Generic3D::m_rep
std::unique_ptr< IMPLEMENTATION > m_rep
Reference to underlying implementation.
Definition: Generic3D.h:237
template<typename INTERFACE, typename IMPLEMENTATION>

double Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::binMeanY | ( | int | ,
|  | int | indexY,
|  | int |
| ) |  | const
| inline override

The weighted mean along the y axis of a given bin.

Definition at line 95 of file Generic3D.h.

96 {
97 return m_rep->GetYaxis()->GetBinCenter( rIndexY( indexY ) );
98 }
Gaudi::Generic3D::rIndexY
int rIndexY(int index) const
Definition: Generic3D.h:86
Gaudi::Generic3D::m_rep
std::unique_ptr< IMPLEMENTATION > m_rep
Reference to underlying implementation.
Definition: Generic3D.h:237
template<typename INTERFACE, typename IMPLEMENTATION>

double Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::binMeanZ | ( | int | ,
|  | int | ,
|  | int | indexZ
| ) |  | const
| inline override

The weighted mean along the z axis of a given bin.

Definition at line 100 of file Generic3D.h.

101 {
102 return m_rep->GetYaxis()->GetBinCenter( rIndexY( indexZ ) );
103 }
Gaudi::Generic3D::rIndexY
int rIndexY(int index) const
Definition: Generic3D.h:86
Gaudi::Generic3D::m_rep
std::unique_ptr< IMPLEMENTATION > m_rep
Reference to underlying implementation.
Definition: Generic3D.h:237
template<typename INTERFACE, typename IMPLEMENTATION>

int Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::coordToIndexX | ( | double | coord | ) | const
| inline override

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

Definition at line 192 of file Generic3D.h.

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

int Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::coordToIndexY | ( | double | coord | ) | const
| inline override

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

Definition at line 194 of file Generic3D.h.

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

int Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::coordToIndexZ | ( | double | coord | ) | const
| inline override

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

Definition at line 196 of file Generic3D.h.

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

int Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::dimension | ( |  | ) | const
| inline override

Get the Histogram's dimension.

Definition at line 56 of file Generic3D.h.

56 { 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 261 of file Generic3D.h.

262 {
263 return m_rep->GetEntries();
264 }
Gaudi::Generic3D::m_rep
std::unique_ptr< IMPLEMENTATION > m_rep
Reference to underlying implementation.
Definition: Generic3D.h:237
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 297 of file Generic3D.h.

298 {
299 if ( sumBinHeights() <= 0 ) return 0;
300 Stat_t stats[11]; // cover up to 3D...
301 m_rep->GetStats( stats );
302 return stats[0] * stats[0] / stats[1];
303 }
Gaudi::Generic3D::sumBinHeights
double sumBinHeights() const override
Get the sum of in range bin heights in the IProfile.
Definition: Generic3D.h:285
Gaudi::Generic3D::m_rep
std::unique_ptr< IMPLEMENTATION > m_rep
Reference to underlying implementation.
Definition: Generic3D.h:237
template<typename INTERFACE, typename IMPLEMENTATION>

int Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::extraEntries | ( |  | ) | const
| inline override

Definition at line 213 of file Generic3D.h.

214 {
215 return binEntries( AIDA::IAxis::UNDERFLOW_BIN, AIDA::IAxis::UNDERFLOW_BIN, AIDA::IAxis::UNDERFLOW_BIN ) +
216 binEntries( AIDA::IAxis::UNDERFLOW_BIN, AIDA::IAxis::UNDERFLOW_BIN, AIDA::IAxis::OVERFLOW_BIN ) +
217 binEntries( AIDA::IAxis::UNDERFLOW_BIN, AIDA::IAxis::OVERFLOW_BIN, AIDA::IAxis::UNDERFLOW_BIN ) +
218 binEntries( AIDA::IAxis::OVERFLOW_BIN, AIDA::IAxis::UNDERFLOW_BIN, AIDA::IAxis::UNDERFLOW_BIN ) +
219 binEntries( AIDA::IAxis::OVERFLOW_BIN, AIDA::IAxis::UNDERFLOW_BIN, AIDA::IAxis::OVERFLOW_BIN ) +
220 binEntries( AIDA::IAxis::OVERFLOW_BIN, AIDA::IAxis::OVERFLOW_BIN, AIDA::IAxis::UNDERFLOW_BIN ) +
221 binEntries( AIDA::IAxis::OVERFLOW_BIN, AIDA::IAxis::OVERFLOW_BIN, AIDA::IAxis::OVERFLOW_BIN );
222 }
Gaudi::Generic3D::binEntries
int binEntries(int indexX, int indexY, int indexZ) const override
Number of entries in the corresponding bin (ie the number of times fill was calle d for this bin)...
Definition: Generic3D.h:105
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 279 of file Generic3D.h.

280 {
281 return m_rep->GetMaximum();
282 }
Gaudi::Generic3D::m_rep
std::unique_ptr< IMPLEMENTATION > m_rep
Reference to underlying implementation.
Definition: Generic3D.h:237
template<typename INTERFACE, typename IMPLEMENTATION>

double Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::meanX | ( |  | ) | const
| inline override

The mean of the IHistogram3D along the x axis.

Definition at line 173 of file Generic3D.h.

173 { return m_rep->GetMean( 1 ); }
Gaudi::Generic3D::m_rep
std::unique_ptr< IMPLEMENTATION > m_rep
Reference to underlying implementation.
Definition: Generic3D.h:237
template<typename INTERFACE, typename IMPLEMENTATION>

double Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::meanY | ( |  | ) | const
| inline override

The mean of the IHistogram3D along the y axis.

Definition at line 176 of file Generic3D.h.

176 { return m_rep->GetMean( 2 ); }
Gaudi::Generic3D::m_rep
std::unique_ptr< IMPLEMENTATION > m_rep
Reference to underlying implementation.
Definition: Generic3D.h:237
template<typename INTERFACE, typename IMPLEMENTATION>

double Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::meanZ | ( |  | ) | const
| inline override

The mean of the IHistogram3D along the z axis.

Definition at line 178 of file Generic3D.h.

178 { return m_rep->GetMean( 3 ); }
Gaudi::Generic3D::m_rep
std::unique_ptr< IMPLEMENTATION > m_rep
Reference to underlying implementation.
Definition: Generic3D.h:237
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 273 of file Generic3D.h.

274 {
275 return m_rep->GetMinimum();
276 }
Gaudi::Generic3D::m_rep
std::unique_ptr< IMPLEMENTATION > m_rep
Reference to underlying implementation.
Definition: Generic3D.h:237
template<typename INTERFACE, typename IMPLEMENTATION>

std::string Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::name | ( |  | ) | const
| inline

object name

Definition at line 62 of file Generic3D.h.

62 { return m_annotation.value( "Name" ); }
Gaudi::Generic3D::m_annotation
AIDA::Annotation m_annotation
Object annotations.
Definition: Generic3D.h:235
AIDA::Annotation::value
std::string value(const std::string &key) const override
Retrieve the value for a given key.
Definition: Annotation.h:102
template<class INTERFACE , class IMPLEMENTATION >

std::ostream & Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::print | ( | std::ostream & | s | ) | const
| override 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 313 of file Generic3D.h.

314 {
316 m_rep->Print( "all" );
317 return s;
318 }
Gaudi::Generic3D::m_rep
std::unique_ptr< IMPLEMENTATION > m_rep
Reference to underlying implementation.
Definition: Generic3D.h:237
gaudirun.s
string s
Definition: gaudirun.py:253
template<typename INTERFACE, typename IMPLEMENTATION>

TObject* Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::representation | ( |  | ) | const
| inline override virtual

ROOT object implementation.

Implements Gaudi::HistogramBase.

Definition at line 51 of file Generic3D.h.

51 { return m_rep.get(); }
Gaudi::Generic3D::m_rep
std::unique_ptr< IMPLEMENTATION > m_rep
Reference to underlying implementation.
Definition: Generic3D.h:237
std::unique_ptr::get
T get(T...args)
template<typename INTERFACE, typename IMPLEMENTATION>

int Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::rIndexX | ( | int | index | ) | const
| inline

Definition at line 85 of file Generic3D.h.

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

int Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::rIndexY | ( | int | index | ) | const
| inline

Definition at line 86 of file Generic3D.h.

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

int Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::rIndexZ | ( | int | index | ) | const
| inline

Definition at line 87 of file Generic3D.h.

87 { return m_zAxis.rIndex( index ); }
Gaudi::Generic3D::m_zAxis
Gaudi::Axis m_zAxis
Definition: Generic3D.h:233
Gaudi::Axis::rIndex
int rIndex(int index) const
Convert a AIDA bin number on the axis to the ROOT bin number.
Definition: Axis.h:53
template<typename INTERFACE, typename IMPLEMENTATION>

double Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::rmsX | ( |  | ) | const
| inline override

The RMS of the IHistogram3D along the x axis.

Definition at line 180 of file Generic3D.h.

180 { return m_rep->GetRMS( 1 ); }
Gaudi::Generic3D::m_rep
std::unique_ptr< IMPLEMENTATION > m_rep
Reference to underlying implementation.
Definition: Generic3D.h:237
template<typename INTERFACE, typename IMPLEMENTATION>

double Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::rmsY | ( |  | ) | const
| inline override

The RMS of the IHistogram3D along the y axis.

Definition at line 182 of file Generic3D.h.

182 { return m_rep->GetRMS( 2 ); }
Gaudi::Generic3D::m_rep
std::unique_ptr< IMPLEMENTATION > m_rep
Reference to underlying implementation.
Definition: Generic3D.h:237
template<typename INTERFACE, typename IMPLEMENTATION>

double Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::rmsZ | ( |  | ) | const
| inline override

The RMS of the IHistogram3D along the z axis.

Definition at line 184 of file Generic3D.h.

184 { return m_rep->GetRMS( 3 ); }
Gaudi::Generic3D::m_rep
std::unique_ptr< IMPLEMENTATION > m_rep
Reference to underlying implementation.
Definition: Generic3D.h:237
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 306 of file Generic3D.h.

307 {
308 m_rep->Scale( scaleFactor );
309 return true;
310 }
Gaudi::Generic3D::m_rep
std::unique_ptr< IMPLEMENTATION > m_rep
Reference to underlying implementation.
Definition: Generic3D.h:237
template<class INTERFACE , class IMPLEMENTATION >

bool Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::setName | ( | const std::string & | newName | ) |

Sets the name of the object.

Definition at line 254 of file Generic3D.h.

255 {
256 m_rep->SetName( newName.c_str() );
257 m_annotation.setValue( "Name", newName );
258 return true;
259 }
AIDA::Annotation::setValue
void setValue(const std::string &key, const std::string &value) override
Set value for a given key.
Definition: Annotation.h:108
Gaudi::Generic3D::m_rep
std::unique_ptr< IMPLEMENTATION > m_rep
Reference to underlying implementation.
Definition: Generic3D.h:237
Gaudi::Generic3D::m_annotation
AIDA::Annotation m_annotation
Object annotations.
Definition: Generic3D.h:235
std::string::c_str
T c_str(T...args)
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 245 of file Generic3D.h.

246 {
247 m_rep->SetTitle( title.c_str() );
248 if ( !annotation().addItem( "Title", title ) ) m_annotation.setValue( "Title", title );
249 if ( !annotation().addItem( "title", title ) ) annotation().setValue( "title", title );
250 return true;
251 }
Gaudi::Generic3D::annotation
AIDA::IAnnotation & annotation() override
Access annotation object.
Definition: Generic3D.h:66
AIDA::Annotation::setValue
void setValue(const std::string &key, const std::string &value) override
Set value for a given key.
Definition: Annotation.h:108
Gaudi::Generic3D::m_rep
std::unique_ptr< IMPLEMENTATION > m_rep
Reference to underlying implementation.
Definition: Generic3D.h:237
Gaudi::Generic3D::m_annotation
AIDA::Annotation m_annotation
Object annotations.
Definition: Generic3D.h:235
std::string::c_str
T c_str(T...args)
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 291 of file Generic3D.h.

292 {
293 return m_rep->GetSum();
294 }
Gaudi::Generic3D::m_rep
std::unique_ptr< IMPLEMENTATION > m_rep
Reference to underlying implementation.
Definition: Generic3D.h:237
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 285 of file Generic3D.h.

286 {
287 return m_rep->GetSumOfWeights();
288 }
Gaudi::Generic3D::m_rep
std::unique_ptr< IMPLEMENTATION > m_rep
Reference to underlying implementation.
Definition: Generic3D.h:237
template<typename INTERFACE, typename IMPLEMENTATION>

double Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::sumExtraBinHeights | ( |  | ) | const
| inline override

Get the sum of the underflow and overflow bin height.

Definition at line 79 of file Generic3D.h.

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

std::string Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::title | ( |  | ) | const
| inline override

Get the title of the object.

Definition at line 58 of file Generic3D.h.

58 { return m_annotation.value( "Title" ); }
Gaudi::Generic3D::m_annotation
AIDA::Annotation m_annotation
Object annotations.
Definition: Generic3D.h:235
AIDA::Annotation::value
std::string value(const std::string &key) const override
Retrieve the value for a given key.
Definition: Annotation.h:102
template<class INTERFACE , class IMPLEMENTATION >

std::ostream & Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::write | ( | std::ostream & | s | ) | const
| override virtual

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

Implements Gaudi::HistogramBase.

Definition at line 322 of file Generic3D.h.

323 {
324 s << "\n3D Histogram Table: " << std::endl;
325 s << "BinX, BinY, BinZ, Height, Error " << std::endl;
326 for ( int i = 0; i < xAxis().bins(); ++i )
327 for ( int j = 0; j < yAxis().bins(); ++j )
328 for ( int k = 0; k < zAxis().bins(); ++k )
329 s << binMeanX( i, j, k ) << ", " << binMeanY( i, j, k ) << ", " << binMeanZ( i, j, k ) << ", "
330 << binHeight( i, j, k ) << ", " << binError( i, j, k ) << std::endl;
331 s << std::endl;
332 return s;
333 }
std::endl
T endl(T...args)
Gaudi::Generic3D::binMeanY
double binMeanY(int, int indexY, int) const override
The weighted mean along the y axis of a given bin.
Definition: Generic3D.h:95
Gaudi::Generic3D::yAxis
const AIDA::IAxis & yAxis() const override
Get the y axis of the IHistogram3D.
Definition: Generic3D.h:188
Gaudi::Generic3D::zAxis
const AIDA::IAxis & zAxis() const override
Get the z axis of the IHistogram3D.
Definition: Generic3D.h:190
Gaudi::Generic3D::binHeight
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:138
Gaudi::Generic3D::xAxis
const AIDA::IAxis & xAxis() const override
Get the x axis of the IHistogram3D.
Definition: Generic3D.h:186
gaudirun.s
string s
Definition: gaudirun.py:253
Gaudi::Generic3D::binMeanZ
double binMeanZ(int, int, int indexZ) const override
The weighted mean along the z axis of a given bin.
Definition: Generic3D.h:100
Gaudi::Generic3D::binMeanX
double binMeanX(int indexX, int, int) const override
The weighted mean along the x axis of a given bin.
Definition: Generic3D.h:90
Gaudi::Generic3D::binError
double binError(int indexX, int indexY, int indexZ) const override
The error of a given bin.
Definition: Generic3D.h:168
template<class INTERFACE , class IMPLEMENTATION >

int Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::write | ( | const char * | file_name | ) | const
| override virtual

Write (ASCII) the histogram table into a file.

Implements Gaudi::HistogramBase.

Definition at line 337 of file Generic3D.h.

338 {
339 TFile* f = TFile::Open( file_name, "RECREATE" );
340 Int_t nbytes = m_rep->Write();
341 f->Close();
342 return nbytes;
343 }
Gaudi::Generic3D::m_rep
std::unique_ptr< IMPLEMENTATION > m_rep
Reference to underlying implementation.
Definition: Generic3D.h:237
template<typename INTERFACE, typename IMPLEMENTATION>

const AIDA::IAxis& Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::xAxis | ( |  | ) | const
| inline override

Get the x axis of the IHistogram3D.

Definition at line 186 of file Generic3D.h.

186 { return m_xAxis; }
Gaudi::Generic3D::m_xAxis
Gaudi::Axis m_xAxis
Definition: Generic3D.h:231
template<typename INTERFACE, typename IMPLEMENTATION>

const AIDA::IAxis& Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::yAxis | ( |  | ) | const
| inline override

Get the y axis of the IHistogram3D.

Definition at line 188 of file Generic3D.h.

188 { return m_yAxis; }
Gaudi::Generic3D::m_yAxis
Gaudi::Axis m_yAxis
Definition: Generic3D.h:232
template<typename INTERFACE, typename IMPLEMENTATION>

const AIDA::IAxis& Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::zAxis | ( |  | ) | const
| inline override

Get the z axis of the IHistogram3D.

Definition at line 190 of file Generic3D.h.

190 { return m_zAxis; }
Gaudi::Generic3D::m_zAxis
Gaudi::Axis m_zAxis
Definition: Generic3D.h:233

## Member Data Documentation

template<typename INTERFACE, typename IMPLEMENTATION>

AIDA::Annotation Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::m_annotation
| mutable protected

Object annotations.

Definition at line 235 of file Generic3D.h.

template<typename INTERFACE, typename IMPLEMENTATION>

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

Definition at line 239 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 237 of file Generic3D.h.

template<typename INTERFACE, typename IMPLEMENTATION>

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

Definition at line 241 of file Generic3D.h.

template<typename INTERFACE, typename IMPLEMENTATION>

Gaudi::Axis Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::m_xAxis
| protected

Definition at line 231 of file Generic3D.h.

template<typename INTERFACE, typename IMPLEMENTATION>

Gaudi::Axis Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::m_yAxis
| protected

Definition at line 232 of file Generic3D.h.

template<typename INTERFACE, typename IMPLEMENTATION>

Gaudi::Axis Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::m_zAxis
| protected

Definition at line 233 of file Generic3D.h.

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

- GaudiCommonSvc/GaudiCommonSvc/Generic3D.h