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 >:
Collaboration diagram for Gaudi::Generic1D< INTERFACE, IMPLEMENTATION >:

Public Types

typedef Generic1D< INTERFACE, IMPLEMENTATION > Base
 

Public Member Functions

 Generic1D ()=default
 Default constructor. More...
 
 ~Generic1D () override=default
 Default destructor. More...
 
virtual const std::stringuserLevelClassType () 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...
 
Axisaxis ()
 Access to axis object. More...
 
const Axisaxis () 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::ostreamprint (std::ostream &s) const override
 Print (ASCII) the histogram into the output stream. More...
 
std::ostreamwrite (std::ostream &s) const override
 Write (ASCII) the histogram table into the output stream. More...
 
int write (const char *file_name) const override
 Write (ASCII) the histogram table into a file. More...
 
template<>
void * cast (const std::string &className) const
 
template<>
int binEntries (int 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 37 of file Generic1D.h.

Member Typedef Documentation

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

Definition at line 39 of file Generic1D.h.

Constructor & Destructor Documentation

template<class INTERFACE, class IMPLEMENTATION>
Gaudi::Generic1D< INTERFACE, IMPLEMENTATION >::Generic1D ( )
default

Default constructor.

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

constructor

Definition at line 44 of file Generic1D.h.

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

Default destructor.

Member Function Documentation

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 202 of file Generic1D.h.

202  {
203  const Generic1D<INTERFACE,IMPLEMENTATION>* p =
204  dynamic_cast<const Generic1D<INTERFACE,IMPLEMENTATION>*>(&h);
205  if ( p ) {
206  m_rep->Add(p->m_rep.get());
207  return true;
208  }
209  throw std::runtime_error("Cannot add profile histograms of different implementations.");
210  }
std::unique_ptr< IMPLEMENTATION > m_rep
Reference to underlying implementation.
Definition: Generic1D.h:131
template<>
void Gaudi::Generic1D< AIDA::IHistogram1D, TH1D >::adoptRepresentation ( TObject *  rep)
virtual

Adopt ROOT histogram representation.

Implements Gaudi::HistogramBase.

Definition at line 50 of file H1D.cpp.

50  {
51  TH1D* imp = dynamic_cast<TH1D*>(rep);
52  if ( !imp ) throw std::runtime_error("Cannot adopt native histogram representation.");
53  m_rep.reset(imp);
54  }
std::unique_ptr< IMPLEMENTATION > m_rep
Reference to underlying implementation.
Definition: Generic1D.h:131
T reset(T...args)
template<class INTERFACE, class IMPLEMENTATION>
void Gaudi::Generic1D< INTERFACE, IMPLEMENTATION >::adoptRepresentation ( TObject *  rep)
overridevirtual

Adopt ROOT histogram representation.

Implements Gaudi::HistogramBase.

Reimplemented in Gaudi::Histogram1D.

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

Adopt ROOT histogram representation.

Implements Gaudi::HistogramBase.

Definition at line 59 of file P1D.cpp.

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

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

Definition at line 76 of file Generic1D.h.

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

Access annotation object.

Definition at line 65 of file Generic1D.h.

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

Access annotation object (cons)

Definition at line 67 of file Generic1D.h.

67 { return m_annotation; }
AIDA::Annotation m_annotation
Object annotations.
Definition: Generic1D.h:129
template<class INTERFACE, class IMPLEMENTATION>
Axis& Gaudi::Generic1D< INTERFACE, IMPLEMENTATION >::axis ( )
inline

Access to axis object.

Definition at line 69 of file Generic1D.h.

69 { return m_axis; }
Axis m_axis
Axis member.
Definition: Generic1D.h:127
template<class INTERFACE, class IMPLEMENTATION>
const Axis& Gaudi::Generic1D< INTERFACE, IMPLEMENTATION >::axis ( ) const
inlineoverride

Get the x axis of the IHistogram1D.

Definition at line 71 of file Generic1D.h.

71 { return m_axis; }
Axis m_axis
Axis member.
Definition: Generic1D.h:127
template<>
int Gaudi::Generic1D< AIDA::IHistogram1D, TH1D >::binEntries ( int  index) const

Definition at line 43 of file H1D.cpp.

43  {
44  if (binHeight(index)<=0) return 0;
45  double xx = binHeight(index)/binError(index);
46  return int(xx*xx+0.5);
47  }
double binHeight(int index) const override
Total height of the corresponding bin (ie the sum of the weights in this bin).
Definition: Generic1D.h:166
double binError(int index) const override
The error of a given bin.
Definition: Generic1D.h:171
template<>
int Gaudi::Generic1D< AIDA::IProfile1D, TProfile >::binEntries ( int  index) const

Definition at line 44 of file P1D.cpp.

44  {
45  return int(m_rep->GetBinEntries( rIndex(index) )+0.5);
46  }
std::unique_ptr< IMPLEMENTATION > m_rep
Reference to underlying implementation.
Definition: Generic1D.h:131
virtual int rIndex(int index) const
operator methods
Definition: Generic1D.h:103
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).

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

The error of a given bin.

Definition at line 171 of file Generic1D.h.

171  {
172  return m_rep->GetBinError ( rIndex(index) );
173  }
std::unique_ptr< IMPLEMENTATION > m_rep
Reference to underlying implementation.
Definition: Generic1D.h:131
virtual int rIndex(int index) const
operator methods
Definition: Generic1D.h:103
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 166 of file Generic1D.h.

166  {
167  return m_rep->GetBinContent ( rIndex(index) );
168  }
std::unique_ptr< IMPLEMENTATION > m_rep
Reference to underlying implementation.
Definition: Generic1D.h:131
virtual int rIndex(int index) const
operator methods
Definition: Generic1D.h:103
template<class INTERFACE , class IMPLEMENTATION >
double Gaudi::Generic1D< INTERFACE, IMPLEMENTATION >::binMean ( int  index) const
override

The weighted mean of a bin.

Definition at line 161 of file Generic1D.h.

161  {
162  return m_rep->GetBinCenter ( rIndex(index) );
163  }
std::unique_ptr< IMPLEMENTATION > m_rep
Reference to underlying implementation.
Definition: Generic1D.h:131
virtual int rIndex(int index) const
operator methods
Definition: Generic1D.h:103
template<class INTERFACE , class IMPLEMENTATION >
double Gaudi::Generic1D< INTERFACE, IMPLEMENTATION >::binRms ( int  index) const
virtual

Definition at line 156 of file Generic1D.h.

156  {
157  return m_rep->GetBinError ( rIndex(index) );
158  }
std::unique_ptr< IMPLEMENTATION > m_rep
Reference to underlying implementation.
Definition: Generic1D.h:131
virtual int rIndex(int index) const
operator methods
Definition: Generic1D.h:103
template<>
void * Gaudi::Generic1D< AIDA::IHistogram1D, TH1D >::cast ( const std::string className) const

Definition at line 34 of file H1D.cpp.

34  {
35  if (className == "AIDA::IHistogram1D")
36  return const_cast<AIDA::IHistogram1D*>((AIDA::IHistogram1D*)this);
37  if (className == "AIDA::IHistogram")
38  return const_cast<AIDA::IHistogram*>((AIDA::IHistogram*)this);
39  return nullptr;
40  }
template<>
void * Gaudi::Generic1D< AIDA::IProfile1D, TProfile >::cast ( const std::string className) const

Definition at line 48 of file P1D.cpp.

48  {
49  if (className == "AIDA::IProfile1D")
50  return const_cast<AIDA::IProfile1D*>((AIDA::IProfile1D*)this);
51  else if (className == "AIDA::IProfile")
52  return const_cast<AIDA::IProfile*>((AIDA::IProfile*)this);
53  else if (className == "AIDA::IBaseHistogram")
54  return const_cast<AIDA::IBaseHistogram*>((AIDA::IBaseHistogram*)this);
55  return nullptr;
56  }
template<class INTERFACE, class IMPLEMENTATION>
void* Gaudi::Generic1D< INTERFACE, IMPLEMENTATION >::cast ( const std::string cl) const
override

Manual cast by class name.

template<class INTERFACE, class IMPLEMENTATION>
int Gaudi::Generic1D< INTERFACE, IMPLEMENTATION >::coordToIndex ( double  coord) const
inlineoverride

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

Definition at line 115 of file Generic1D.h.

115 { return axis().coordToIndex(coord);}
Axis & axis()
Access to axis object.
Definition: Generic1D.h:69
int coordToIndex(double coord) const override
Convert a coordinate on the axis to a bin number.
Definition: Axis.h:139
template<class INTERFACE, class IMPLEMENTATION>
int Gaudi::Generic1D< INTERFACE, IMPLEMENTATION >::dimension ( ) const
inlineoverride

Get the Histogram's dimension.

Definition at line 117 of file Generic1D.h.

117 { return 1; }
template<class INTERFACE, class IMPLEMENTATION>
int Gaudi::Generic1D< INTERFACE, IMPLEMENTATION >::entries ( ) const
inlineoverride

Get the number or all the entries.

Definition at line 74 of file Generic1D.h.

74 { return m_rep->GetEntries(); }
std::unique_ptr< IMPLEMENTATION > m_rep
Reference to underlying implementation.
Definition: Generic1D.h:131
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 188 of file Generic1D.h.

188  {
189  if (sumBinHeights() <= 0) return 0;
190  Stat_t stats[11]; // cover up to 3D...
191  m_rep->GetStats(stats);
192  return stats[0]*stats[0]/stats[1];
193  }
double sumBinHeights() const override
Get the sum of in range bin heights in the IProfile.
Definition: Generic1D.h:84
std::unique_ptr< IMPLEMENTATION > m_rep
Reference to underlying implementation.
Definition: Generic1D.h:131
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 176 of file Generic1D.h.

176  {
177  return binEntries(AIDA::IAxis::UNDERFLOW_BIN) +
178  binEntries(AIDA::IAxis::OVERFLOW_BIN);
179  }
int binEntries(int index) const override
Number of entries in the corresponding bin (ie the number of times fill was called for this bin)...
template<class INTERFACE, class IMPLEMENTATION>
double Gaudi::Generic1D< INTERFACE, IMPLEMENTATION >::maxBinHeight ( ) const
inlineoverride

Get the maximum height of the in-range bins.

Definition at line 92 of file Generic1D.h.

92 { return m_rep->GetMaximum(); }
std::unique_ptr< IMPLEMENTATION > m_rep
Reference to underlying implementation.
Definition: Generic1D.h:131
template<class INTERFACE, class IMPLEMENTATION>
double Gaudi::Generic1D< INTERFACE, IMPLEMENTATION >::mean ( ) const
inlineoverride

The mean of the whole IHistogram1D.

Definition at line 111 of file Generic1D.h.

111 { return m_rep->GetMean(); }
std::unique_ptr< IMPLEMENTATION > m_rep
Reference to underlying implementation.
Definition: Generic1D.h:131
template<class INTERFACE, class IMPLEMENTATION>
double Gaudi::Generic1D< INTERFACE, IMPLEMENTATION >::minBinHeight ( ) const
inlineoverride

Get the minimum height of the in-range bins.

Definition at line 90 of file Generic1D.h.

90 { return m_rep->GetMinimum(); }
std::unique_ptr< IMPLEMENTATION > m_rep
Reference to underlying implementation.
Definition: Generic1D.h:131
template<class INTERFACE, class IMPLEMENTATION>
std::string Gaudi::Generic1D< INTERFACE, IMPLEMENTATION >::name ( ) const
inline

object name

Definition at line 61 of file Generic1D.h.

61 { return m_annotation.value("Name"); }
AIDA::Annotation m_annotation
Object annotations.
Definition: Generic1D.h:129
std::string value(const std::string &key) const override
Retrieve the value for a given key.
Definition: Annotation.h:114
template<class INTERFACE , class IMPLEMENTATION >
std::ostream & Gaudi::Generic1D< INTERFACE, IMPLEMENTATION >::print ( std::ostream s) const
overridevirtual

Print (ASCII) the histogram into the output stream.

bin contents and errors are printed for all bins including under and overflows

Implements Gaudi::HistogramBase.

Definition at line 213 of file Generic1D.h.

213  {
215  m_rep->Print("all");
216  return s;
217  }
std::unique_ptr< IMPLEMENTATION > m_rep
Reference to underlying implementation.
Definition: Generic1D.h:131
string s
Definition: gaudirun.py:245
template<class INTERFACE, class IMPLEMENTATION>
TObject* Gaudi::Generic1D< INTERFACE, IMPLEMENTATION >::representation ( ) const
inlineoverridevirtual

ROOT object implementation.

Implements Gaudi::HistogramBase.

Definition at line 53 of file Generic1D.h.

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

Reset the Histogram; as if just created.

Definition at line 181 of file Generic1D.h.

181  {
182  m_sumEntries = 0;
183  m_rep->Reset();
184  return true;
185  }
std::unique_ptr< IMPLEMENTATION > m_rep
Reference to underlying implementation.
Definition: Generic1D.h:131
template<class INTERFACE, class IMPLEMENTATION>
virtual int Gaudi::Generic1D< INTERFACE, IMPLEMENTATION >::rIndex ( int  index) const
inlinevirtual

operator methods

Definition at line 103 of file Generic1D.h.

103 { return m_axis.rIndex(index);}
Axis m_axis
Axis member.
Definition: Generic1D.h:127
int rIndex(int index) const
Convert a AIDA bin number on the axis to the ROOT bin number.
Definition: Axis.h:55
template<class INTERFACE, class IMPLEMENTATION>
double Gaudi::Generic1D< INTERFACE, IMPLEMENTATION >::rms ( ) const
inlineoverride

The RMS of the whole IHistogram1D.

Definition at line 113 of file Generic1D.h.

113 { return m_rep->GetRMS(); }
std::unique_ptr< IMPLEMENTATION > m_rep
Reference to underlying implementation.
Definition: Generic1D.h:131
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 196 of file Generic1D.h.

196  {
197  m_rep->Scale ( scaleFactor );
198  return true;
199  }
std::unique_ptr< IMPLEMENTATION > m_rep
Reference to underlying implementation.
Definition: Generic1D.h:131
template<class INTERFACE , class IMPLEMENTATION >
bool Gaudi::Generic1D< INTERFACE, IMPLEMENTATION >::setName ( const std::string newName)

Set the name of the object.

Definition at line 149 of file Generic1D.h.

149  {
150  m_rep->SetName(newName.c_str());
151  m_annotation.setValue( "Name", newName );
152  return true;
153  }
void setValue(const std::string &key, const std::string &value) override
Set value for a given key.
Definition: Annotation.h:121
std::unique_ptr< IMPLEMENTATION > m_rep
Reference to underlying implementation.
Definition: Generic1D.h:131
AIDA::Annotation m_annotation
Object annotations.
Definition: Generic1D.h:129
T c_str(T...args)
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 139 of file Generic1D.h.

139  {
140  m_rep->SetTitle(title.c_str());
141  if ( !annotation().addItem( "Title", title ) )
142  m_annotation.setValue( "Title" , title );
143  if ( !annotation().addItem( "title", title ) )
144  annotation().setValue( "title", title );
145  return true;
146  }
void setValue(const std::string &key, const std::string &value) override
Set value for a given key.
Definition: Annotation.h:121
std::unique_ptr< IMPLEMENTATION > m_rep
Reference to underlying implementation.
Definition: Generic1D.h:131
AIDA::Annotation m_annotation
Object annotations.
Definition: Generic1D.h:129
T c_str(T...args)
AIDA::IAnnotation & annotation() override
Access annotation object.
Definition: Generic1D.h:65
template<class INTERFACE, class IMPLEMENTATION>
double Gaudi::Generic1D< INTERFACE, IMPLEMENTATION >::sumAllBinHeights ( ) const
inlineoverride

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

Definition at line 86 of file Generic1D.h.

86 { return m_rep->GetSum(); }
std::unique_ptr< IMPLEMENTATION > m_rep
Reference to underlying implementation.
Definition: Generic1D.h:131
template<class INTERFACE, class IMPLEMENTATION>
double Gaudi::Generic1D< INTERFACE, IMPLEMENTATION >::sumBinHeights ( ) const
inlineoverride

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

Definition at line 84 of file Generic1D.h.

84 { return m_rep->GetSumOfWeights(); }
std::unique_ptr< IMPLEMENTATION > m_rep
Reference to underlying implementation.
Definition: Generic1D.h:131
template<class INTERFACE, class IMPLEMENTATION>
double Gaudi::Generic1D< INTERFACE, IMPLEMENTATION >::sumExtraBinHeights ( ) const
inlineoverride

Get the sum of the underflow and overflow bin height.

Definition at line 88 of file Generic1D.h.

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

Get the title of the object.

Definition at line 57 of file Generic1D.h.

57 { return m_annotation.value("Title"); }
AIDA::Annotation m_annotation
Object annotations.
Definition: Generic1D.h:129
std::string value(const std::string &key) const override
Retrieve the value for a given key.
Definition: Annotation.h:114
template<class INTERFACE, class IMPLEMENTATION>
virtual const std::string& Gaudi::Generic1D< INTERFACE, IMPLEMENTATION >::userLevelClassType ( ) const
inlinevirtual

The AIDA user-level unterface leaf class type.

Definition at line 49 of file Generic1D.h.

49 { return m_classType; }
std::string m_classType
Definition: Generic1D.h:133
template<class INTERFACE , class IMPLEMENTATION >
std::ostream & Gaudi::Generic1D< INTERFACE, IMPLEMENTATION >::write ( std::ostream s) const
overridevirtual

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

Implements Gaudi::HistogramBase.

Definition at line 221 of file Generic1D.h.

221  {
222  s << "\n1D Histogram Table: " << std::endl;
223  s << "Bin, Height, Error " << std::endl;
224  for( int i = 0; i < axis().bins(); ++i )
225  s << binMean( i ) << ", "
226  << binHeight( i ) << ", "
227  << binError ( i ) << std::endl;
228  s << std::endl;
229  return s;
230  }
T endl(T...args)
double binHeight(int index) const override
Total height of the corresponding bin (ie the sum of the weights in this bin).
Definition: Generic1D.h:166
double binError(int index) const override
The error of a given bin.
Definition: Generic1D.h:171
Axis & axis()
Access to axis object.
Definition: Generic1D.h:69
int bins() const override
The number of bins (excluding underflow and overflow) on the IAxis.
Definition: Axis.h:105
double binMean(int index) const override
The weighted mean of a bin.
Definition: Generic1D.h:161
string s
Definition: gaudirun.py:245
template<class INTERFACE , class IMPLEMENTATION >
int Gaudi::Generic1D< INTERFACE, IMPLEMENTATION >::write ( const char *  file_name) const
overridevirtual

Write (ASCII) the histogram table into a file.

Implements Gaudi::HistogramBase.

Definition at line 234 of file Generic1D.h.

235  {
236  TFile *f = TFile::Open(file_name,"RECREATE");
237  Int_t nbytes = m_rep->Write();
238  f->Close();
239  return nbytes;
240  }
std::unique_ptr< IMPLEMENTATION > m_rep
Reference to underlying implementation.
Definition: Generic1D.h:131

Member Data Documentation

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

Object annotations.

Definition at line 129 of file Generic1D.h.

template<class INTERFACE, class IMPLEMENTATION>
Axis Gaudi::Generic1D< INTERFACE, IMPLEMENTATION >::m_axis
protected

Axis member.

Definition at line 127 of file Generic1D.h.

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

Definition at line 133 of file Generic1D.h.

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

Reference to underlying implementation.

Definition at line 131 of file Generic1D.h.

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

Definition at line 135 of file Generic1D.h.


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