| The Gaudi Framework v30r0 (c919700c)

- 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::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 >:
[legend]
Collaboration diagram for Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >:
[legend]

## 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::string & | userLevelClassType () const
| The AIDA user-level unterface leaf class type. More...
int | dimension () const override
| Get the Histogram's dimension. More...
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 * | 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 36 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 | ) |
| inline protected

constructor

Definition at line 45 of file Generic2D.h.

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

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

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 316 of file Generic2D.h.

317 {
318 const Base* p = dynamic_cast<const Base*>( &hist );
319 if ( !p ) throw std::runtime_error( "Cannot add profile histograms of different implementations." );
320 m_rep->Add( p->m_rep.get() );
321 return true;
322 }
Gaudi::Generic2D::Base
Generic2D< INTERFACE, IMPLEMENTATION > Base
Definition: Generic2D.h:39
std::runtime_error
STL class.
Gaudi::Generic2D::m_rep
std::unique_ptr< IMPLEMENTATION > m_rep
Reference to underlying implementation.
Definition: Generic2D.h:155
template<>

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

Adopt ROOT histogram representation.

Implements Gaudi::HistogramBase.

Definition at line 42 of file P2D.cpp.

43 {
44 TProfile2D* imp = dynamic_cast<TProfile2D*>( rep );
45 if ( !imp ) throw std::runtime_error( "Cannot adopt native histogram representation." );
46 m_rep.reset( imp );
47 m_xAxis.initialize( m_rep->GetXaxis(), true );
48 m_yAxis.initialize( m_rep->GetYaxis(), true );
49 setTitle( m_rep->GetTitle() );
50 }
Gaudi::Generic2D::m_xAxis
Axis m_xAxis
X axis member.
Definition: Generic2D.h:149
std::runtime_error
STL class.
std::unique_ptr::reset
T reset(T...args)
Gaudi::Axis::initialize
void initialize(TAxis *itaxi, bool)
Definition: Axis.h:67
Gaudi::Generic2D::setTitle
bool setTitle(const std::string &title) override
Set the title of the object.
Definition: Generic2D.h:163
Gaudi::Generic2D::m_yAxis
Axis m_yAxis
Y axis member.
Definition: Generic2D.h:151
Gaudi::Generic2D::m_rep
std::unique_ptr< IMPLEMENTATION > m_rep
Reference to underlying implementation.
Definition: Generic2D.h:155
template<class INTERFACE, class IMPLEMENTATION>

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

Adopt ROOT histogram representation.

Implements Gaudi::HistogramBase.

template<>

void Gaudi::Generic2D< AIDA::IHistogram2D, TH2D >::adoptRepresentation | ( | TObject * | rep | ) |
| virtual

Adopt ROOT histogram representation.

Implements Gaudi::HistogramBase.

Definition at line 127 of file H2D.cpp.

128 {
129 TH2D* imp = dynamic_cast<TH2D*>( rep );
130 if ( !imp ) throw std::runtime_error( "Cannot adopt native histogram representation." );
131 m_rep.reset( imp );
132 m_xAxis.initialize( m_rep->GetXaxis(), true );
133 m_yAxis.initialize( m_rep->GetYaxis(), true );
134 const TArrayD* a = m_rep->GetSumw2();
135 if ( !a || ( a && a->GetSize() == 0 ) ) m_rep->Sumw2();
136 setTitle( m_rep->GetTitle() );
137 }
Gaudi::Generic2D::m_xAxis
Axis m_xAxis
X axis member.
Definition: Generic2D.h:149
std::runtime_error
STL class.
std::unique_ptr::reset
T reset(T...args)
Gaudi::Axis::initialize
void initialize(TAxis *itaxi, bool)
Definition: Axis.h:67
Gaudi::Generic2D::setTitle
bool setTitle(const std::string &title) override
Set the title of the object.
Definition: Generic2D.h:163
Gaudi::Generic2D::m_yAxis
Axis m_yAxis
Y axis member.
Definition: Generic2D.h:151
Gaudi::Generic2D::m_rep
std::unique_ptr< IMPLEMENTATION > m_rep
Reference to underlying implementation.
Definition: Generic2D.h:155
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 186 of file Generic2D.h.

187 {
188 return m_rep->GetEntries();
189 }
Gaudi::Generic2D::m_rep
std::unique_ptr< IMPLEMENTATION > m_rep
Reference to underlying implementation.
Definition: Generic2D.h:155
template<class INTERFACE, class IMPLEMENTATION>

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

Access annotation object.

Definition at line 63 of file Generic2D.h.

63 { return m_annotation; }
Gaudi::Generic2D::m_annotation
AIDA::Annotation m_annotation
Object annotations.
Definition: Generic2D.h:153
template<class INTERFACE, class IMPLEMENTATION>

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

Access annotation object (cons)

Definition at line 65 of file Generic2D.h.

65 { return m_annotation; }
Gaudi::Generic2D::m_annotation
AIDA::Annotation m_annotation
Object annotations.
Definition: Generic2D.h:153
template<>

int Gaudi::Generic2D< AIDA::IProfile2D, TProfile2D >::binEntries | ( | int | idX,
|  | int | idY
| ) |  | const

Definition at line 35 of file P2D.cpp.

36 {
37 int rBin = m_rep->GetBin( rIndexX( idX ), rIndexY( idY ) );
38 return int( m_rep->GetBinEntries( rBin ) + 0.5 );
39 }
Gaudi::Generic2D::rIndexX
virtual int rIndexX(int index) const
operator methods
Definition: Generic2D.h:72
Gaudi::Generic2D::m_rep
std::unique_ptr< IMPLEMENTATION > m_rep
Reference to underlying implementation.
Definition: Generic2D.h:155
Gaudi::Generic2D::rIndexY
virtual int rIndexY(int index) const
operator methods
Definition: Generic2D.h:74
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 119 of file H2D.cpp.

120 {
121 if ( binHeight( indexX, indexY ) <= 0 ) return 0;
122 double xx = binHeight( indexX, indexY ) / binError( indexX, indexY );
123 return int( xx * xx + 0.5 );
124 }
Gaudi::Generic2D::binError
double binError(int indexX, int indexY) const override
The error on this bin.
Definition: Generic2D.h:274
Gaudi::Generic2D::binHeight
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:250
template<class INTERFACE , class IMPLEMENTATION >

int Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::binEntriesX | ( | int | indexX | ) | const
| override

Equivalent to `projectionX().binEntries(indexX)`.

Definition at line 234 of file Generic2D.h.

235 {
236 int n = 0;
237 for ( int iY = -2; iY < yAxis().bins(); ++iY ) n += binEntries( index, iY );
238 return n;
239 }
GaudiPluginService.cpluginsvc.n
n
Definition: cpluginsvc.py:228
Gaudi::Generic2D::binEntries
int binEntries(int indexX, int indexY) const override
The number of entries (ie the number of times fill was called for this bin).
Gaudi::Generic2D::yAxis
const AIDA::IAxis & yAxis() const override
Return the Y axis.
Definition: Generic2D.h:70
template<class INTERFACE , class IMPLEMENTATION >

int Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::binEntriesY | ( | int | indexY | ) | const
| override

Equivalent to `projectionY().binEntries(indexY)`.

Definition at line 242 of file Generic2D.h.

243 {
244 int n = 0;
245 for ( int iX = -2; iX < xAxis().bins(); ++iX ) n += binEntries( iX, index );
246 return n;
247 }
GaudiPluginService.cpluginsvc.n
n
Definition: cpluginsvc.py:228
Gaudi::Generic2D::binEntries
int binEntries(int indexX, int indexY) const override
The number of entries (ie the number of times fill was called for this bin).
Gaudi::Generic2D::xAxis
const AIDA::IAxis & xAxis() const override
Return the X axis.
Definition: Generic2D.h:68
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 274 of file Generic2D.h.

275 {
276 return m_rep->GetBinError( rIndexX( indexX ), rIndexY( indexY ) );
277 }
Gaudi::Generic2D::rIndexX
virtual int rIndexX(int index) const
operator methods
Definition: Generic2D.h:72
Gaudi::Generic2D::m_rep
std::unique_ptr< IMPLEMENTATION > m_rep
Reference to underlying implementation.
Definition: Generic2D.h:155
Gaudi::Generic2D::rIndexY
virtual int rIndexY(int index) const
operator methods
Definition: Generic2D.h:74
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 250 of file Generic2D.h.

251 {
252 return m_rep->GetBinContent( rIndexX( indexX ), rIndexY( indexY ) );
253 }
Gaudi::Generic2D::rIndexX
virtual int rIndexX(int index) const
operator methods
Definition: Generic2D.h:72
Gaudi::Generic2D::m_rep
std::unique_ptr< IMPLEMENTATION > m_rep
Reference to underlying implementation.
Definition: Generic2D.h:155
Gaudi::Generic2D::rIndexY
virtual int rIndexY(int index) const
operator methods
Definition: Generic2D.h:74
template<class INTERFACE , class IMPLEMENTATION >

double Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::binHeightX | ( | int | indexX | ) | const
| override

Equivalent to `projectionX().binHeight(indexX)`.

Definition at line 256 of file Generic2D.h.

257 {
258 double s = 0;
259 for ( int iY = -2; iY < yAxis().bins(); ++iY ) {
260 s += binHeight( index, iY );
261 }
262 return s;
263 }
gaudirun.s
string s
Definition: gaudirun.py:253
Gaudi::Generic2D::yAxis
const AIDA::IAxis & yAxis() const override
Return the Y axis.
Definition: Generic2D.h:70
Gaudi::Generic2D::binHeight
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:250
template<class INTERFACE , class IMPLEMENTATION >

double Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::binHeightY | ( | int | indexY | ) | const
| override

Equivalent to `projectionY().binHeight(indexY)`.

Definition at line 266 of file Generic2D.h.

267 {
268 double s = 0;
269 for ( int iX = -2; iX < xAxis().bins(); ++iX ) s += binHeight( iX, index );
270 return s;
271 }
gaudirun.s
string s
Definition: gaudirun.py:253
Gaudi::Generic2D::xAxis
const AIDA::IAxis & xAxis() const override
Return the X axis.
Definition: Generic2D.h:68
Gaudi::Generic2D::binHeight
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:250
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 222 of file Generic2D.h.

223 {
224 return m_rep->GetXaxis()->GetBinCenter( rIndexX( indexX ) );
225 }
Gaudi::Generic2D::rIndexX
virtual int rIndexX(int index) const
operator methods
Definition: Generic2D.h:72
Gaudi::Generic2D::m_rep
std::unique_ptr< IMPLEMENTATION > m_rep
Reference to underlying implementation.
Definition: Generic2D.h:155
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 228 of file Generic2D.h.

229 {
230 return m_rep->GetYaxis()->GetBinCenter( rIndexY( indexY ) );
231 }
Gaudi::Generic2D::m_rep
std::unique_ptr< IMPLEMENTATION > m_rep
Reference to underlying implementation.
Definition: Generic2D.h:155
Gaudi::Generic2D::rIndexY
virtual int rIndexY(int index) const
operator methods
Definition: Generic2D.h:74
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 216 of file Generic2D.h.

217 {
218 return m_rep->GetBinError( rIndexX( indexX ), rIndexY( indexY ) );
219 }
Gaudi::Generic2D::rIndexX
virtual int rIndexX(int index) const
operator methods
Definition: Generic2D.h:72
Gaudi::Generic2D::m_rep
std::unique_ptr< IMPLEMENTATION > m_rep
Reference to underlying implementation.
Definition: Generic2D.h:155
Gaudi::Generic2D::rIndexY
virtual int rIndexY(int index) const
operator methods
Definition: Generic2D.h:74
template<>

void * Gaudi::Generic2D< AIDA::IProfile2D, TProfile2D >::cast | ( | const std::string & | className | ) | const

Definition at line 23 of file P2D.cpp.

24 {
25 if ( className == "AIDA::IProfile2D" )
26 return const_cast<AIDA::IProfile2D*>( (AIDA::IProfile2D*)this );
27 else if ( className == "AIDA::IProfile" )
28 return const_cast<AIDA::IProfile*>( (AIDA::IProfile*)this );
29 else if ( className == "AIDA::IBaseHistogram" )
30 return const_cast<AIDA::IBaseHistogram*>( (AIDA::IBaseHistogram*)this );
31 return nullptr;
32 }
template<>

void * Gaudi::Generic2D< IHistogram2D, TH2D >::cast | ( | const std::string & | className | ) | const

Definition at line 109 of file H2D.cpp.

110 {
111 if ( className == "AIDA::IHistogram2D" )
112 return (IHistogram2D*)this;
113 else if ( className == "AIDA::IHistogram" )
114 return (IHistogram*)this;
115 return nullptr;
116 }
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 304 of file Generic2D.h.

305 {
306 return xAxis().coordToIndex( coord );
307 }
Gaudi::Generic2D::xAxis
const AIDA::IAxis & xAxis() const override
Return the X axis.
Definition: Generic2D.h:68
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 310 of file Generic2D.h.

311 {
312 return yAxis().coordToIndex( coord );
313 }
Gaudi::Generic2D::yAxis
const AIDA::IAxis & yAxis() const override
Return the Y axis.
Definition: Generic2D.h:70
template<class INTERFACE, class IMPLEMENTATION>

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

Get the Histogram's dimension.

Definition at line 139 of file Generic2D.h.

139 { 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 180 of file Generic2D.h.

181 {
182 return m_rep->GetEntries();
183 }
Gaudi::Generic2D::m_rep
std::unique_ptr< IMPLEMENTATION > m_rep
Reference to underlying implementation.
Definition: Generic2D.h:155
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 334 of file Generic2D.h.

335 {
336 if ( sumBinHeights() <= 0 ) return 0;
337 Stat_t stats[11]; // cover up to 3D...
338 m_rep->GetStats( stats );
339 return stats[0] * stats[0] / stats[1];
340 }
Gaudi::Generic2D::sumBinHeights
double sumBinHeights() const override
Get the sum of in range bin heights in the IProfile.
Definition: Generic2D.h:204
Gaudi::Generic2D::m_rep
std::unique_ptr< IMPLEMENTATION > m_rep
Reference to underlying implementation.
Definition: Generic2D.h:155
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 325 of file Generic2D.h.

326 {
327 return binEntries( AIDA::IAxis::UNDERFLOW_BIN, AIDA::IAxis::UNDERFLOW_BIN ) +
328 binEntries( AIDA::IAxis::UNDERFLOW_BIN, AIDA::IAxis::OVERFLOW_BIN ) +
329 binEntries( AIDA::IAxis::OVERFLOW_BIN, AIDA::IAxis::UNDERFLOW_BIN ) +
330 binEntries( AIDA::IAxis::OVERFLOW_BIN, AIDA::IAxis::OVERFLOW_BIN );
331 }
Gaudi::Generic2D::binEntries
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 198 of file Generic2D.h.

199 {
200 return m_rep->GetMaximum();
201 }
Gaudi::Generic2D::m_rep
std::unique_ptr< IMPLEMENTATION > m_rep
Reference to underlying implementation.
Definition: Generic2D.h:155
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 280 of file Generic2D.h.

281 {
282 return m_rep->GetMean( 1 );
283 }
Gaudi::Generic2D::m_rep
std::unique_ptr< IMPLEMENTATION > m_rep
Reference to underlying implementation.
Definition: Generic2D.h:155
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 286 of file Generic2D.h.

287 {
288 return m_rep->GetMean( 2 );
289 }
Gaudi::Generic2D::m_rep
std::unique_ptr< IMPLEMENTATION > m_rep
Reference to underlying implementation.
Definition: Generic2D.h:155
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 192 of file Generic2D.h.

193 {
194 return m_rep->GetMinimum();
195 }
Gaudi::Generic2D::m_rep
std::unique_ptr< IMPLEMENTATION > m_rep
Reference to underlying implementation.
Definition: Generic2D.h:155
template<class INTERFACE, class IMPLEMENTATION>

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

object name

Definition at line 59 of file Generic2D.h.

59 { return m_annotation.value( "Name" ); }
Gaudi::Generic2D::m_annotation
AIDA::Annotation m_annotation
Object annotations.
Definition: Generic2D.h:153
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::Generic2D< 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 358 of file Generic2D.h.

359 {
361 m_rep->Print( "all" );
362 return s;
363 }
gaudirun.s
string s
Definition: gaudirun.py:253
Gaudi::Generic2D::m_rep
std::unique_ptr< IMPLEMENTATION > m_rep
Reference to underlying implementation.
Definition: Generic2D.h:155
template<class INTERFACE, class IMPLEMENTATION>

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

ROOT object implementation.

Implements Gaudi::HistogramBase.

Definition at line 51 of file Generic2D.h.

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

bool Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::reset | ( |  | ) |
| override

Definition at line 350 of file Generic2D.h.

351 {
352 m_sumEntries = 0;
353 m_rep->Reset();
354 return true;
355 }
Gaudi::Generic2D::m_sumEntries
int m_sumEntries
cache sumEntries (allEntries) when setting contents since Root can&#39;t compute by himself ...
Definition: Generic2D.h:159
Gaudi::Generic2D::m_rep
std::unique_ptr< IMPLEMENTATION > m_rep
Reference to underlying implementation.
Definition: Generic2D.h:155
template<class INTERFACE, class IMPLEMENTATION>

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

operator methods

Definition at line 72 of file Generic2D.h.

72 { return m_xAxis.rIndex( index ); }
Gaudi::Generic2D::m_xAxis
Axis m_xAxis
X axis member.
Definition: Generic2D.h:149
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<class INTERFACE, class IMPLEMENTATION>

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

operator methods

Definition at line 74 of file Generic2D.h.

74 { return m_yAxis.rIndex( index ); }
Gaudi::Generic2D::m_yAxis
Axis m_yAxis
Y axis member.
Definition: Generic2D.h:151
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<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 292 of file Generic2D.h.

293 {
294 return m_rep->GetRMS( 1 );
295 }
Gaudi::Generic2D::m_rep
std::unique_ptr< IMPLEMENTATION > m_rep
Reference to underlying implementation.
Definition: Generic2D.h:155
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 298 of file Generic2D.h.

299 {
300 return m_rep->GetRMS( 2 );
301 }
Gaudi::Generic2D::m_rep
std::unique_ptr< IMPLEMENTATION > m_rep
Reference to underlying implementation.
Definition: Generic2D.h:155
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 343 of file Generic2D.h.

344 {
345 m_rep->Scale( scaleFactor );
346 return true;
347 }
Gaudi::Generic2D::m_rep
std::unique_ptr< IMPLEMENTATION > m_rep
Reference to underlying implementation.
Definition: Generic2D.h:155
template<class INTERFACE , class IMPLEMENTATION >

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

Set the name of the object.

Definition at line 172 of file Generic2D.h.

173 {
174 m_rep->SetName( newName.c_str() );
175 m_annotation.setValue( "Name", newName );
176 return true;
177 }
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::Generic2D::m_annotation
AIDA::Annotation m_annotation
Object annotations.
Definition: Generic2D.h:153
std::string::c_str
T c_str(T...args)
Gaudi::Generic2D::m_rep
std::unique_ptr< IMPLEMENTATION > m_rep
Reference to underlying implementation.
Definition: Generic2D.h:155
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 163 of file Generic2D.h.

164 {
165 m_rep->SetTitle( title.c_str() );
166 if ( !annotation().addItem( "Title", title ) ) m_annotation.setValue( "Title", title );
167 if ( !annotation().addItem( "title", title ) ) annotation().setValue( "title", title );
168 return true;
169 }
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::Generic2D::annotation
AIDA::IAnnotation & annotation() override
Access annotation object.
Definition: Generic2D.h:63
Gaudi::Generic2D::m_annotation
AIDA::Annotation m_annotation
Object annotations.
Definition: Generic2D.h:153
std::string::c_str
T c_str(T...args)
Gaudi::Generic2D::m_rep
std::unique_ptr< IMPLEMENTATION > m_rep
Reference to underlying implementation.
Definition: Generic2D.h:155
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 210 of file Generic2D.h.

211 {
212 return m_rep->GetSum();
213 }
Gaudi::Generic2D::m_rep
std::unique_ptr< IMPLEMENTATION > m_rep
Reference to underlying implementation.
Definition: Generic2D.h:155
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 204 of file Generic2D.h.

205 {
206 return m_rep->GetSumOfWeights();
207 }
Gaudi::Generic2D::m_rep
std::unique_ptr< IMPLEMENTATION > m_rep
Reference to underlying implementation.
Definition: Generic2D.h:155
template<class INTERFACE, class IMPLEMENTATION>

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

Get the sum of the underflow and overflow bin height.

Definition at line 87 of file Generic2D.h.

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

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

Get the title of the object.

Definition at line 55 of file Generic2D.h.

55 { return m_annotation.value( "Title" ); }
Gaudi::Generic2D::m_annotation
AIDA::Annotation m_annotation
Object annotations.
Definition: Generic2D.h:153
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>

const std::string& Gaudi::Generic2D< INTERFACE, IMPLEMENTATION >::userLevelClassType | ( |  | ) | const
| inline

The AIDA user-level unterface leaf class type.

Definition at line 137 of file Generic2D.h.

137 { return m_classType; }
Gaudi::Generic2D::m_classType
std::string m_classType
class type
Definition: Generic2D.h:157
template<class INTERFACE , class IMPLEMENTATION >

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

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

Implements Gaudi::HistogramBase.

Definition at line 367 of file Generic2D.h.

368 {
369 s << std::endl << "2D Histogram Table: " << std::endl;
370 s << "BinX, BinY, Height, Error " << std::endl;
371 for ( int i = 0; i < xAxis().bins(); ++i ) {
372 for ( int j = 0; j < yAxis().bins(); ++j ) {
373 s << binMeanX( i, j ) << ", " << binMeanY( i, j ) << ", " << binHeight( i, j ) << ", " << binError( i, j )
374 << std::endl;
375 }
376 }
377 s << std::endl;
378 return s;
379 }
std::endl
T endl(T...args)
Gaudi::Generic2D::binMeanY
double binMeanY(int indexX, int indexY) const override
The weighted mean along y of a given bin.
Definition: Generic2D.h:228
Gaudi::Generic2D::binError
double binError(int indexX, int indexY) const override
The error on this bin.
Definition: Generic2D.h:274
gaudirun.s
string s
Definition: gaudirun.py:253
Gaudi::Generic2D::binMeanX
double binMeanX(int indexX, int indexY) const override
The weighted mean along x of a given bin.
Definition: Generic2D.h:222
Gaudi::Generic2D::yAxis
const AIDA::IAxis & yAxis() const override
Return the Y axis.
Definition: Generic2D.h:70
Gaudi::Generic2D::xAxis
const AIDA::IAxis & xAxis() const override
Return the X axis.
Definition: Generic2D.h:68
Gaudi::Generic2D::binHeight
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:250
template<class INTERFACE , class IMPLEMENTATION >

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

Write (ASCII) the histogram table into a file.

Implements Gaudi::HistogramBase.

Definition at line 383 of file Generic2D.h.

384 {
385 TFile* f = TFile::Open( file_name, "RECREATE" );
386 Int_t nbytes = m_rep->Write();
387 f->Close();
388 return nbytes;
389 }
Gaudi::Generic2D::m_rep
std::unique_ptr< IMPLEMENTATION > m_rep
Reference to underlying implementation.
Definition: Generic2D.h:155
template<class INTERFACE, class IMPLEMENTATION>

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

Return the X axis.

Definition at line 68 of file Generic2D.h.

68 { return m_xAxis; }
Gaudi::Generic2D::m_xAxis
Axis m_xAxis
X axis member.
Definition: Generic2D.h:149
template<class INTERFACE, class IMPLEMENTATION>

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

Return the Y axis.

Definition at line 70 of file Generic2D.h.

70 { return m_yAxis; }
Gaudi::Generic2D::m_yAxis
Axis m_yAxis
Y axis member.
Definition: Generic2D.h:151

## Member Data Documentation

template<class INTERFACE, class IMPLEMENTATION>

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

Object annotations.

Definition at line 153 of file Generic2D.h.

template<class INTERFACE, class IMPLEMENTATION>

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

class type

Definition at line 157 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 155 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 159 of file Generic2D.h.

template<class INTERFACE, class IMPLEMENTATION>

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

X axis member.

Definition at line 149 of file Generic2D.h.

template<class INTERFACE, class IMPLEMENTATION>

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

Y axis member.

Definition at line 151 of file Generic2D.h.

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

- GaudiCommonSvc/GaudiCommonSvc/Generic2D.h