| The Gaudi Framework v32r1 (f65d50dc)

Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Gaudi::Generic1D< INTERFACE, IMPLEMENTATION > Class Template Reference

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

`#include <GaudiPI/Generic1D.h>`

Inheritance diagram for Gaudi::Generic1D< INTERFACE, IMPLEMENTATION >:
[legend]
Collaboration diagram for Gaudi::Generic1D< INTERFACE, IMPLEMENTATION >:
[legend]

## Public Types
typedef Generic1D< INTERFACE, IMPLEMENTATION > | Base

## Public Member Functions
| Generic1D ()=default
| Default constructor. More...
virtual const std::string & | userLevelClassType () const
| The AIDA user-level unterface leaf class type. More...
void * | cast (const std::string &cl) const override
| Manual cast by class name. 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...
Axis & | axis ()
| Access to axis object. More...
const Axis & | axis () const override
| Get the x axis of the IHistogram1D. 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...
int | binEntries (int index) const override
| Number of entries in the corresponding bin (ie the number of times fill was called for this bin). More...
virtual double | binRms (int index) const
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...
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 | reset () override
| Reset the Histogram; as if just created. More...
bool | add (const INTERFACE &profile) override
| Modifies this IProfile1D by adding the contents of profile to it. More...
virtual int | rIndex (int index) const
| operator methods More...
double | binMean (int index) const override
| The weighted mean of a bin. More...
double | binHeight (int index) const override
| Total height of the corresponding bin (ie the sum of the weights in this bin). More...
double | binError (int index) const override
| The error of a given bin. More...
double | mean () const override
| The mean of the whole IHistogram1D. More...
double | rms () const override
| The RMS of the whole IHistogram1D. More...
int | coordToIndex (double coord) const override
| Get the bin number corresponding to a given coordinate along the x axis. 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 index) const
template<>
void | adoptRepresentation (TObject *rep)
| Adopt ROOT histogram representation. More...
template<>
int | binEntries (int index) const
template<>
void * | cast (const std::string &className) const
template<>
void | adoptRepresentation (TObject *rep)
| Adopt ROOT histogram representation. More...
Public Member Functions inherited from Gaudi::HistogramBase
virtual | ~HistogramBase ()=default

## Protected Member Functions
| Generic1D (IMPLEMENTATION *p)
| constructor More...

## Protected Attributes
Axis | m_axis
| 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
int | m_sumEntries

## Detailed Description

### template<class INTERFACE, class IMPLEMENTATION>
class Gaudi::Generic1D< 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 35 of file Generic1D.h.

## Member Typedef Documentation

## ◆ Base

template<class INTERFACE, class IMPLEMENTATION>

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

Definition at line 37 of file Generic1D.h.

## Constructor & Destructor Documentation

## ◆ Generic1D() [1/2]

template<class INTERFACE, class IMPLEMENTATION>

Gaudi::Generic1D< INTERFACE, IMPLEMENTATION >::Generic1D | ( |  | ) |
| default

Default constructor.

## ◆ Generic1D() [2/2]

template<class INTERFACE, class IMPLEMENTATION>

Gaudi::Generic1D< INTERFACE, IMPLEMENTATION >::Generic1D | ( | IMPLEMENTATION * | p | ) |
| inline protected

constructor

Definition at line 43 of file Generic1D.h.

43 : m_rep( p ) {}
Gaudi::Generic1D::m_rep
std::unique_ptr< IMPLEMENTATION > m_rep
Reference to underlying implementation.
Definition: Generic1D.h:130

## Member Function Documentation

## ◆ add()

template<class INTERFACE, class IMPLEMENTATION >

bool Gaudi::Generic1D< INTERFACE, IMPLEMENTATION >::add | ( | const INTERFACE & | profile | ) |
| override

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

Definition at line 198 of file Generic1D.h.

198 {
199 const Generic1D<INTERFACE, IMPLEMENTATION>* p = dynamic_cast<const Generic1D<INTERFACE, IMPLEMENTATION>*>( &h );
200 if ( p ) {
201 m_rep->Add( p->m_rep.get() );
202 return true;
203 }
204 throw std::runtime_error( "Cannot add profile histograms of different implementations." );
205 }
Gaudi::Generic1D::m_rep
std::unique_ptr< IMPLEMENTATION > m_rep
Reference to underlying implementation.
Definition: Generic1D.h:130
std::runtime_error
STL class.

## ◆ adoptRepresentation() [1/3]

template<>

void Gaudi::Generic1D< AIDA::IHistogram1D, TH1D >::adoptRepresentation | ( | TObject * | rep | ) |
| virtual

Adopt ROOT histogram representation.

Implements Gaudi::HistogramBase.

Definition at line 51 of file H1D.cpp.

51 {
52 TH1D* imp = dynamic_cast<TH1D*>( rep );
53 if ( !imp ) throw std::runtime_error( "Cannot adopt native histogram representation." );
54 m_rep.reset( imp );
55 }
Gaudi::Generic1D::m_rep
std::unique_ptr< IMPLEMENTATION > m_rep
Reference to underlying implementation.
Definition: Generic1D.h:130
std::runtime_error
STL class.
std::unique_ptr::reset
T reset(T... args)

## ◆ adoptRepresentation() [2/3]

template<class INTERFACE, class IMPLEMENTATION>

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

Adopt ROOT histogram representation.

Implements Gaudi::HistogramBase.

Reimplemented in Gaudi::Histogram1D.

## ◆ adoptRepresentation() [3/3]

template<>

void Gaudi::Generic1D< AIDA::IProfile1D, TProfile >::adoptRepresentation | ( | TObject * | rep | ) |
| virtual

Adopt ROOT histogram representation.

Implements Gaudi::HistogramBase.

Definition at line 58 of file P1D.cpp.

58 {
59 TProfile* imp = dynamic_cast<TProfile*>( rep );
60 if ( !imp ) throw std::runtime_error( "Cannot adopt native histogram representation." );
61 m_rep.reset( imp );
62 m_axis.initialize( m_rep->GetXaxis(), true );
63 const TArrayD* a = m_rep->GetSumw2();
64 if ( !a || ( a && a->GetSize() == 0 ) ) m_rep->Sumw2();
65 setTitle( m_rep->GetTitle() );
66 }
Gaudi::Generic1D::m_rep
std::unique_ptr< IMPLEMENTATION > m_rep
Reference to underlying implementation.
Definition: Generic1D.h:130
Gaudi::Generic1D::setTitle
bool setTitle(const std::string &title) override
Set the title of the object.
Definition: Generic1D.h:138
std::runtime_error
STL class.
Gaudi::Generic1D::m_axis
Axis m_axis
Axis member.
Definition: Generic1D.h:126
std::unique_ptr::reset
T reset(T... args)
Gaudi::Axis::initialize
void initialize(TAxis *itaxi, bool)
Definition: Axis.h:63

## ◆ allEntries()

template<class INTERFACE, class IMPLEMENTATION>

int Gaudi::Generic1D< INTERFACE, IMPLEMENTATION >::allEntries | ( |  | ) | const
| inline override

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

Definition at line 74 of file Generic1D.h.

74 { return m_rep->GetEntries(); }
Gaudi::Generic1D::m_rep
std::unique_ptr< IMPLEMENTATION > m_rep
Reference to underlying implementation.
Definition: Generic1D.h:130

## ◆ annotation() [1/2]

template<class INTERFACE, class IMPLEMENTATION>

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

Access annotation object.

Definition at line 63 of file Generic1D.h.

63 { return m_annotation; }
Gaudi::Generic1D::m_annotation
AIDA::Annotation m_annotation
Object annotations.
Definition: Generic1D.h:128

## ◆ annotation() [2/2]

template<class INTERFACE, class IMPLEMENTATION>

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

Access annotation object (cons)

Definition at line 65 of file Generic1D.h.

65 { return m_annotation; }
Gaudi::Generic1D::m_annotation
AIDA::Annotation m_annotation
Object annotations.
Definition: Generic1D.h:128

## ◆ axis() [1/2]

template<class INTERFACE, class IMPLEMENTATION>

Axis& Gaudi::Generic1D< INTERFACE, IMPLEMENTATION >::axis | ( |  | ) |
| inline

Access to axis object.

Definition at line 67 of file Generic1D.h.

67 { return m_axis; }
Gaudi::Generic1D::m_axis
Axis m_axis
Axis member.
Definition: Generic1D.h:126

## ◆ axis() [2/2]

template<class INTERFACE, class IMPLEMENTATION>

const Axis& Gaudi::Generic1D< INTERFACE, IMPLEMENTATION >::axis | ( |  | ) | const
| inline override

Get the x axis of the IHistogram1D.

Definition at line 69 of file Generic1D.h.

69 { return m_axis; }
Gaudi::Generic1D::m_axis
Axis m_axis
Axis member.
Definition: Generic1D.h:126

## ◆ binEntries() [1/3]

template<>

int Gaudi::Generic1D< AIDA::IProfile1D, TProfile >::binEntries | ( | int | index | ) | const

Definition at line 42 of file P1D.cpp.

42 {
43 return int( m_rep->GetBinEntries( rIndex( index ) ) + 0.5 );
44 }
Gaudi::Generic1D::m_rep
std::unique_ptr< IMPLEMENTATION > m_rep
Reference to underlying implementation.
Definition: Generic1D.h:130
Gaudi::Generic1D::rIndex
virtual int rIndex(int index) const
operator methods
Definition: Generic1D.h:102

## ◆ binEntries() [2/3]

template<>

int Gaudi::Generic1D< AIDA::IHistogram1D, TH1D >::binEntries | ( | int | index | ) | const

Definition at line 44 of file H1D.cpp.

44 {
45 if ( binHeight( index ) <= 0 ) return 0;
46 double xx = binHeight( index ) / binError( index );
47 return int( xx * xx + 0.5 );
48 }
Gaudi::Generic1D::binError
double binError(int index) const override
The error of a given bin.
Definition: Generic1D.h:168
Gaudi::Generic1D::binHeight
double binHeight(int index) const override
Total height of the corresponding bin (ie the sum of the weights in this bin).
Definition: Generic1D.h:163

## ◆ binEntries() [3/3]

template<class INTERFACE, class IMPLEMENTATION>

int Gaudi::Generic1D< INTERFACE, IMPLEMENTATION >::binEntries | ( | int | index | ) | const
| override

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

## ◆ binError()

template<class INTERFACE , class IMPLEMENTATION >

double Gaudi::Generic1D< INTERFACE, IMPLEMENTATION >::binError | ( | int | index | ) | const
| override

The error of a given bin.

Definition at line 168 of file Generic1D.h.

168 {
169 return m_rep->GetBinError( rIndex( index ) );
170 }
Gaudi::Generic1D::m_rep
std::unique_ptr< IMPLEMENTATION > m_rep
Reference to underlying implementation.
Definition: Generic1D.h:130
Gaudi::Generic1D::rIndex
virtual int rIndex(int index) const
operator methods
Definition: Generic1D.h:102

## ◆ binHeight()

template<class INTERFACE , class IMPLEMENTATION >

double Gaudi::Generic1D< INTERFACE, IMPLEMENTATION >::binHeight | ( | int | index | ) | const
| override

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

Definition at line 163 of file Generic1D.h.

163 {
164 return m_rep->GetBinContent( rIndex( index ) );
165 }
Gaudi::Generic1D::m_rep
std::unique_ptr< IMPLEMENTATION > m_rep
Reference to underlying implementation.
Definition: Generic1D.h:130
Gaudi::Generic1D::rIndex
virtual int rIndex(int index) const
operator methods
Definition: Generic1D.h:102

## ◆ binMean()

template<class INTERFACE , class IMPLEMENTATION >

double Gaudi::Generic1D< INTERFACE, IMPLEMENTATION >::binMean | ( | int | index | ) | const
| override

The weighted mean of a bin.

Definition at line 158 of file Generic1D.h.

158 {
159 return m_rep->GetBinCenter( rIndex( index ) );
160 }
Gaudi::Generic1D::m_rep
std::unique_ptr< IMPLEMENTATION > m_rep
Reference to underlying implementation.
Definition: Generic1D.h:130
Gaudi::Generic1D::rIndex
virtual int rIndex(int index) const
operator methods
Definition: Generic1D.h:102

## ◆ binRms()

template<class INTERFACE , class IMPLEMENTATION >

double Gaudi::Generic1D< INTERFACE, IMPLEMENTATION >::binRms | ( | int | index | ) | const
| virtual

Definition at line 153 of file Generic1D.h.

153 {
154 return m_rep->GetBinError( rIndex( index ) );
155 }
Gaudi::Generic1D::m_rep
std::unique_ptr< IMPLEMENTATION > m_rep
Reference to underlying implementation.
Definition: Generic1D.h:130
Gaudi::Generic1D::rIndex
virtual int rIndex(int index) const
operator methods
Definition: Generic1D.h:102

## ◆ cast() [1/3]

template<>

void * Gaudi::Generic1D< AIDA::IHistogram1D, TH1D >::cast | ( | const std::string & | className | ) | const

Definition at line 37 of file H1D.cpp.

37 {
38 if ( className == "AIDA::IHistogram1D" ) return const_cast<AIDA::IHistogram1D*>( (AIDA::IHistogram1D*)this );
39 if ( className == "AIDA::IHistogram" ) return const_cast<AIDA::IHistogram*>( (AIDA::IHistogram*)this );
40 return nullptr;
41 }

## ◆ cast() [2/3]

template<>

void * Gaudi::Generic1D< AIDA::IProfile1D, TProfile >::cast | ( | const std::string & | className | ) | const

Definition at line 47 of file P1D.cpp.

47 {
48 return className == "AIDA::IProfile1D"
49 ? const_cast<AIDA::IProfile1D*>( static_cast<const AIDA::IProfile1D*>( this ) )
50 : className == "AIDA::IProfile"
51 ? const_cast<AIDA::IProfile*>( static_cast<const AIDA::IProfile*>( this ) )
52 : className == "AIDA::IBaseHistogram"
53 ? const_cast<AIDA::IBaseHistogram*>( static_cast<const AIDA::IBaseHistogram*>( this ) )
54 : nullptr;
55 }
AIDA
GaudiKernel.
Definition: Fill.h:10

## ◆ cast() [3/3]

template<class INTERFACE, class IMPLEMENTATION>

void* Gaudi::Generic1D< INTERFACE, IMPLEMENTATION >::cast | ( | const std::string & | cl | ) | const
| override

Manual cast by class name.

## ◆ coordToIndex()

template<class INTERFACE, class IMPLEMENTATION>

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

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

Definition at line 114 of file Generic1D.h.

114 { return axis().coordToIndex( coord ); }
Gaudi::Axis::coordToIndex
int coordToIndex(double coord) const override
Convert a coordinate on the axis to a bin number.
Definition: Axis.h:127
Gaudi::Generic1D::axis
Axis & axis()
Access to axis object.
Definition: Generic1D.h:67

## ◆ dimension()

template<class INTERFACE, class IMPLEMENTATION>

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

Get the Histogram's dimension.

Definition at line 116 of file Generic1D.h.

116 { return 1; }

## ◆ entries()

template<class INTERFACE, class IMPLEMENTATION>

int Gaudi::Generic1D< INTERFACE, IMPLEMENTATION >::entries | ( |  | ) | const
| inline override

Get the number or all the entries.

Definition at line 72 of file Generic1D.h.

72 { return m_rep->GetEntries(); }
Gaudi::Generic1D::m_rep
std::unique_ptr< IMPLEMENTATION > m_rep
Reference to underlying implementation.
Definition: Generic1D.h:130

## ◆ equivalentBinEntries()

template<class INTERFACE , class IMPLEMENTATION >

double Gaudi::Generic1D< INTERFACE, IMPLEMENTATION >::equivalentBinEntries | ( |  | ) | const
| virtual

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

Definition at line 184 of file Generic1D.h.

184 {
185 if ( sumBinHeights() <= 0 ) return 0;
186 Stat_t stats[11]; // cover up to 3D...
187 m_rep->GetStats( stats );
188 return stats[0] * stats[0] / stats[1];
189 }
Gaudi::Generic1D::m_rep
std::unique_ptr< IMPLEMENTATION > m_rep
Reference to underlying implementation.
Definition: Generic1D.h:130
Gaudi::Generic1D::sumBinHeights
double sumBinHeights() const override
Get the sum of in range bin heights in the IProfile.
Definition: Generic1D.h:82

## ◆ extraEntries()

template<class INTERFACE , class IMPLEMENTATION >

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

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

Definition at line 173 of file Generic1D.h.

173 {
174 return binEntries( AIDA::IAxis::UNDERFLOW_BIN ) + binEntries( AIDA::IAxis::OVERFLOW_BIN );
175 }
Gaudi::Generic1D::binEntries
int binEntries(int index) const override
Number of entries in the corresponding bin (ie the number of times fill was called for this bin).

## ◆ maxBinHeight()

template<class INTERFACE, class IMPLEMENTATION>

double Gaudi::Generic1D< INTERFACE, IMPLEMENTATION >::maxBinHeight | ( |  | ) | const
| inline override

Get the maximum height of the in-range bins.

Definition at line 90 of file Generic1D.h.

90 { return m_rep->GetMaximum(); }
Gaudi::Generic1D::m_rep
std::unique_ptr< IMPLEMENTATION > m_rep
Reference to underlying implementation.
Definition: Generic1D.h:130

## ◆ mean()

template<class INTERFACE, class IMPLEMENTATION>

double Gaudi::Generic1D< INTERFACE, IMPLEMENTATION >::mean | ( |  | ) | const
| inline override

The mean of the whole IHistogram1D.

Definition at line 110 of file Generic1D.h.

110 { return m_rep->GetMean(); }
Gaudi::Generic1D::m_rep
std::unique_ptr< IMPLEMENTATION > m_rep
Reference to underlying implementation.
Definition: Generic1D.h:130

## ◆ minBinHeight()

template<class INTERFACE, class IMPLEMENTATION>

double Gaudi::Generic1D< INTERFACE, IMPLEMENTATION >::minBinHeight | ( |  | ) | const
| inline override

Get the minimum height of the in-range bins.

Definition at line 88 of file Generic1D.h.

88 { return m_rep->GetMinimum(); }
Gaudi::Generic1D::m_rep
std::unique_ptr< IMPLEMENTATION > m_rep
Reference to underlying implementation.
Definition: Generic1D.h:130

## ◆ name()

template<class INTERFACE, class IMPLEMENTATION>

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

object name

Definition at line 59 of file Generic1D.h.

59 { return m_annotation.value( "Name" ); }
Gaudi::Generic1D::m_annotation
AIDA::Annotation m_annotation
Object annotations.
Definition: Generic1D.h:128
AIDA::Annotation::value
std::string value(const std::string &key) const override
Retrieve the value for a given key.
Definition: Annotation.h:98

## ◆ print()

template<class INTERFACE , class IMPLEMENTATION >

std::ostream & Gaudi::Generic1D< 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 208 of file Generic1D.h.

208 {
210 m_rep->Print( "all" );
211 return s;
212 }
Gaudi::Generic1D::m_rep
std::unique_ptr< IMPLEMENTATION > m_rep
Reference to underlying implementation.
Definition: Generic1D.h:130
gaudirun.s
string s
Definition: gaudirun.py:316

## ◆ representation()

template<class INTERFACE, class IMPLEMENTATION>

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

ROOT object implementation.

Implements Gaudi::HistogramBase.

Definition at line 51 of file Generic1D.h.

51 { return m_rep.get(); }
Gaudi::Generic1D::m_rep
std::unique_ptr< IMPLEMENTATION > m_rep
Reference to underlying implementation.
Definition: Generic1D.h:130
std::unique_ptr::get
T get(T... args)

## ◆ reset()

template<class INTERFACE , class IMPLEMENTATION >

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

Reset the Histogram; as if just created.

Definition at line 177 of file Generic1D.h.

177 {
178 m_sumEntries = 0;
179 m_rep->Reset();
180 return true;
181 }
Gaudi::Generic1D::m_rep
std::unique_ptr< IMPLEMENTATION > m_rep
Reference to underlying implementation.
Definition: Generic1D.h:130
Gaudi::Generic1D::m_sumEntries
int m_sumEntries
Definition: Generic1D.h:134

## ◆ rIndex()

template<class INTERFACE, class IMPLEMENTATION>

virtual int Gaudi::Generic1D< INTERFACE, IMPLEMENTATION >::rIndex | ( | int | index | ) | const
| inline virtual

operator methods

Definition at line 102 of file Generic1D.h.

102 { return m_axis.rIndex( index ); }
Gaudi::Generic1D::m_axis
Axis m_axis
Axis member.
Definition: Generic1D.h:126
Gaudi::Axis::rIndex
int rIndex(int index) const
Convert a AIDA bin number on the axis to the ROOT bin number.
Definition: Axis.h:49

## ◆ rms()

template<class INTERFACE, class IMPLEMENTATION>

double Gaudi::Generic1D< INTERFACE, IMPLEMENTATION >::rms | ( |  | ) | const
| inline override

The RMS of the whole IHistogram1D.

Definition at line 112 of file Generic1D.h.

112 { return m_rep->GetRMS(); }
Gaudi::Generic1D::m_rep
std::unique_ptr< IMPLEMENTATION > m_rep
Reference to underlying implementation.
Definition: Generic1D.h:130

## ◆ scale()

template<class INTERFACE , class IMPLEMENTATION >

bool Gaudi::Generic1D< 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 192 of file Generic1D.h.

192 {
193 m_rep->Scale( scaleFactor );
194 return true;
195 }
Gaudi::Generic1D::m_rep
std::unique_ptr< IMPLEMENTATION > m_rep
Reference to underlying implementation.
Definition: Generic1D.h:130

## ◆ setName()

template<class INTERFACE , class IMPLEMENTATION >

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

Set the name of the object.

Definition at line 146 of file Generic1D.h.

146 {
147 m_rep->SetName( newName.c_str() );
148 m_annotation.setValue( "Name", newName );
149 return true;
150 }
AIDA::Annotation::setValue
void setValue(const std::string &key, const std::string &value) override
Set value for a given key.
Definition: Annotation.h:103
Gaudi::Generic1D::m_rep
std::unique_ptr< IMPLEMENTATION > m_rep
Reference to underlying implementation.
Definition: Generic1D.h:130
Gaudi::Generic1D::m_annotation
AIDA::Annotation m_annotation
Object annotations.
Definition: Generic1D.h:128
std::string::c_str
T c_str(T... args)

## ◆ setTitle()

template<class INTERFACE , class IMPLEMENTATION >

bool Gaudi::Generic1D< INTERFACE, IMPLEMENTATION >::setTitle | ( | const std::string & | title | ) |
| override

Set the title of the object.

Definition at line 138 of file Generic1D.h.

138 {
139 m_rep->SetTitle( title.c_str() );
140 if ( !annotation().addItem( "Title", title ) ) m_annotation.setValue( "Title", title );
141 if ( !annotation().addItem( "title", title ) ) annotation().setValue( "title", title );
142 return true;
143 }
AIDA::Annotation::setValue
void setValue(const std::string &key, const std::string &value) override
Set value for a given key.
Definition: Annotation.h:103
Gaudi::Generic1D::m_rep
std::unique_ptr< IMPLEMENTATION > m_rep
Reference to underlying implementation.
Definition: Generic1D.h:130
Gaudi::Generic1D::m_annotation
AIDA::Annotation m_annotation
Object annotations.
Definition: Generic1D.h:128
std::string::c_str
T c_str(T... args)
Gaudi::Generic1D::annotation
AIDA::IAnnotation & annotation() override
Access annotation object.
Definition: Generic1D.h:63
Gaudi::Generic1D::title
std::string title() const override
Get the title of the object.
Definition: Generic1D.h:55

## ◆ sumAllBinHeights()

template<class INTERFACE, class IMPLEMENTATION>

double Gaudi::Generic1D< INTERFACE, IMPLEMENTATION >::sumAllBinHeights | ( |  | ) | const
| inline override

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

Definition at line 84 of file Generic1D.h.

84 { return m_rep->GetSum(); }
Gaudi::Generic1D::m_rep
std::unique_ptr< IMPLEMENTATION > m_rep
Reference to underlying implementation.
Definition: Generic1D.h:130

## ◆ sumBinHeights()

template<class INTERFACE, class IMPLEMENTATION>

double Gaudi::Generic1D< INTERFACE, IMPLEMENTATION >::sumBinHeights | ( |  | ) | const
| inline override

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

Definition at line 82 of file Generic1D.h.

82 { return m_rep->GetSumOfWeights(); }
Gaudi::Generic1D::m_rep
std::unique_ptr< IMPLEMENTATION > m_rep
Reference to underlying implementation.
Definition: Generic1D.h:130

## ◆ sumExtraBinHeights()

template<class INTERFACE, class IMPLEMENTATION>

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

Get the sum of the underflow and overflow bin height.

Definition at line 86 of file Generic1D.h.

86 { return sumAllBinHeights() - sumBinHeights(); }
Gaudi::Generic1D::sumAllBinHeights
double sumAllBinHeights() const override
Get the sum of all the bins heights (including underflow and overflow bin).
Definition: Generic1D.h:84
Gaudi::Generic1D::sumBinHeights
double sumBinHeights() const override
Get the sum of in range bin heights in the IProfile.
Definition: Generic1D.h:82

## ◆ title()

template<class INTERFACE, class IMPLEMENTATION>

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

Get the title of the object.

Definition at line 55 of file Generic1D.h.

55 { return m_annotation.value( "Title" ); }
Gaudi::Generic1D::m_annotation
AIDA::Annotation m_annotation
Object annotations.
Definition: Generic1D.h:128
AIDA::Annotation::value
std::string value(const std::string &key) const override
Retrieve the value for a given key.
Definition: Annotation.h:98

## ◆ userLevelClassType()

template<class INTERFACE, class IMPLEMENTATION>

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

The AIDA user-level unterface leaf class type.

Definition at line 47 of file Generic1D.h.

47 { return m_classType; }
Gaudi::Generic1D::m_classType
std::string m_classType
Definition: Generic1D.h:132

## ◆ write() [1/2]

template<class INTERFACE , class IMPLEMENTATION >

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

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

Implements Gaudi::HistogramBase.

Definition at line 216 of file Generic1D.h.

216 {
217 s << "\n1D Histogram Table: " << std::endl;
218 s << "Bin, Height, Error " << std::endl;
219 for ( int i = 0; i < axis().bins(); ++i )
220 s << binMean( i ) << ", " << binHeight( i ) << ", " << binError( i ) << std::endl;
221 s << std::endl;
222 return s;
223 }
std::endl
T endl(T... args)
Gaudi::Generic1D::binMean
double binMean(int index) const override
The weighted mean of a bin.
Definition: Generic1D.h:158
Gaudi::Generic1D::binError
double binError(int index) const override
The error of a given bin.
Definition: Generic1D.h:168
Gaudi::Generic1D::axis
Axis & axis()
Access to axis object.
Definition: Generic1D.h:67
Gaudi::Axis::bins
int bins() const override
The number of bins (excluding underflow and overflow) on the IAxis.
Definition: Axis.h:91
gaudirun.s
string s
Definition: gaudirun.py:316
Gaudi::Generic1D::binHeight
double binHeight(int index) const override
Total height of the corresponding bin (ie the sum of the weights in this bin).
Definition: Generic1D.h:163

## ◆ write() [2/2]

template<class INTERFACE , class IMPLEMENTATION >

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

Write (ASCII) the histogram table into a file.

Implements Gaudi::HistogramBase.

Definition at line 227 of file Generic1D.h.

227 {
228 TFile* f = TFile::Open( file_name, "RECREATE" );
229 Int_t nbytes = m_rep->Write();
230 f->Close();
231 return nbytes;
232 }
Gaudi::Generic1D::m_rep
std::unique_ptr< IMPLEMENTATION > m_rep
Reference to underlying implementation.
Definition: Generic1D.h:130

## Member Data Documentation

## ◆ m_annotation

template<class INTERFACE, class IMPLEMENTATION>

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

Object annotations.

Definition at line 128 of file Generic1D.h.

## ◆ m_axis

template<class INTERFACE, class IMPLEMENTATION>

Axis Gaudi::Generic1D< INTERFACE, IMPLEMENTATION >::m_axis
| protected

Axis member.

Definition at line 126 of file Generic1D.h.

## ◆ m_classType

template<class INTERFACE, class IMPLEMENTATION>

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

Definition at line 132 of file Generic1D.h.

## ◆ m_rep

template<class INTERFACE, class IMPLEMENTATION>

std::unique_ptr<IMPLEMENTATION> Gaudi::Generic1D< INTERFACE, IMPLEMENTATION >::m_rep
| protected

Reference to underlying implementation.

Definition at line 130 of file Generic1D.h.

## ◆ m_sumEntries

template<class INTERFACE, class IMPLEMENTATION>

int Gaudi::Generic1D< INTERFACE, IMPLEMENTATION >::m_sumEntries
| protected

Definition at line 134 of file Generic1D.h.

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

- GaudiCommonSvc/GaudiCommonSvc/Generic1D.h