All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 constructor. More...
 
virtual ~Generic1D ()
 Default destructor. More...
 
virtual const std::string & userLevelClassType () const
 The AIDA user-level unterface leaf class type. More...
 
virtual void * cast (const std::string &cl) const
 Manual cast by class name. More...
 
TObject * representation () const
 ROOT object implementation. More...
 
virtual void adoptRepresentation (TObject *rep)
 Adopt ROOT histogram representation. More...
 
virtual std::string title () const
 Get the title of the object. More...
 
virtual bool setTitle (const std::string &title)
 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...
 
virtual AIDA::IAnnotation & annotation ()
 Access annotation object. More...
 
virtual const AIDA::IAnnotation & annotation () const
 Access annotation object (cons) More...
 
Axisaxis ()
 Access to axis object. More...
 
const Axisaxis () const
 Get the x axis of the IHistogram1D. More...
 
virtual int entries () const
 Get the number or all the entries. More...
 
virtual int allEntries () const
 Get the number or all the entries, both in range and underflow/overflow bins of the IProfile. More...
 
virtual int extraEntries () const
 Get the number of entries in the underflow and overflow bins. More...
 
virtual int binEntries (int index) const
 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
 
virtual double sumBinHeights () const
 Get the sum of in range bin heights in the IProfile. More...
 
virtual double sumAllBinHeights () const
 Get the sum of all the bins heights (including underflow and overflow bin). More...
 
virtual double sumExtraBinHeights () const
 Get the sum of the underflow and overflow bin height. More...
 
virtual double minBinHeight () const
 Get the minimum height of the in-range bins. More...
 
virtual double maxBinHeight () const
 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...
 
virtual bool reset ()
 Reset the Histogram; as if just created. More...
 
virtual bool add (const INTERFACE &profile)
 Modifies this IProfile1D by adding the contents of profile to it. More...
 
virtual int rIndex (int index) const
 operator methods More...
 
virtual double binMean (int index) const
 The weighted mean of a bin. More...
 
virtual double binHeight (int index) const
 Total height of the corresponding bin (ie the sum of the weights in this bin). More...
 
virtual double binError (int index) const
 The error of a given bin. More...
 
virtual double mean () const
 The mean of the whole IHistogram1D. More...
 
virtual double rms () const
 The RMS of the whole IHistogram1D. More...
 
virtual int coordToIndex (double coord) const
 Get the bin number corresponding to a given coordinate along the x axis. More...
 
virtual int dimension () const
 Get the Histogram's dimension. More...
 
virtual std::ostream & print (std::ostream &s) const
 Print (ASCII) the histogram into the output stream. More...
 
virtual std::ostream & write (std::ostream &s) const
 Write (ASCII) the histogram table into the output stream. More...
 
virtual int write (const char *file_name) const
 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 ()
 

Protected Attributes

Axis m_axis
 Axis member. More...
 
AIDA::Annotation m_annotation
 Object annotations. More...
 
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 29 of file Generic1D.h.

Member Typedef Documentation

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

Definition at line 31 of file Generic1D.h.

Constructor & Destructor Documentation

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

Default constructor.

Definition at line 33 of file Generic1D.h.

33 : m_rep(0) {}
IMPLEMENTATION * m_rep
Reference to underlying implementation.
Definition: Generic1D.h:119
template<class INTERFACE, class IMPLEMENTATION>
virtual Gaudi::Generic1D< INTERFACE, IMPLEMENTATION >::~Generic1D ( )
inlinevirtual

Default destructor.

Definition at line 35 of file Generic1D.h.

35 { delete m_rep; }
IMPLEMENTATION * m_rep
Reference to underlying implementation.
Definition: Generic1D.h:119

Member Function Documentation

template<class INTERFACE, class IMPLEMENTATION >
bool Gaudi::Generic1D< INTERFACE, IMPLEMENTATION >::add ( const INTERFACE &  profile)
virtual

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

Definition at line 190 of file Generic1D.h.

190  {
191  const Generic1D<INTERFACE,IMPLEMENTATION>* p =
192  dynamic_cast<const Generic1D<INTERFACE,IMPLEMENTATION>*>(&h);
193  if ( p ) {
194  m_rep->Add(p->m_rep);
195  return true;
196  }
197  throw std::runtime_error("Cannot add profile histograms of different implementations.");
198  }
IMPLEMENTATION * m_rep
Reference to underlying implementation.
Definition: Generic1D.h:119
template<class INTERFACE, class IMPLEMENTATION>
virtual void Gaudi::Generic1D< INTERFACE, IMPLEMENTATION >::adoptRepresentation ( TObject *  rep)
virtual

Adopt ROOT histogram representation.

Implements Gaudi::HistogramBase.

Reimplemented in Gaudi::Histogram1D.

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

Adopt ROOT histogram representation.

Implements Gaudi::HistogramBase.

Definition at line 49 of file H1D.cpp.

49  {
50  TH1D* imp = dynamic_cast<TH1D*>(rep);
51  if ( imp ) {
52  if ( m_rep ) delete m_rep;
53  m_rep = imp;
54  return;
55  }
56  throw std::runtime_error("Cannot adopt native histogram representation.");
57  }
IMPLEMENTATION * m_rep
Reference to underlying implementation.
Definition: Generic1D.h:119
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 ) {
62  if ( m_rep ) delete m_rep;
63  m_rep = imp;
64  m_axis.initialize(m_rep->GetXaxis(),true);
65  const TArrayD* a = m_rep->GetSumw2();
66  if ( 0 == a || (a && a->GetSize()==0) ) m_rep->Sumw2();
67  setTitle(m_rep->GetTitle());
68  return;
69  }
70  throw std::runtime_error("Cannot adopt native histogram representation.");
71  }
Axis m_axis
Axis member.
Definition: Generic1D.h:115
IMPLEMENTATION * m_rep
Reference to underlying implementation.
Definition: Generic1D.h:119
void initialize(TAxis *itaxi, bool)
Definition: Axis.h:71
virtual bool setTitle(const std::string &title)
Set the title of the object.
Definition: Generic1D.h:127
template<class INTERFACE, class IMPLEMENTATION>
virtual int Gaudi::Generic1D< INTERFACE, IMPLEMENTATION >::allEntries ( ) const
inlinevirtual

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

Definition at line 64 of file Generic1D.h.

64 { return int(m_rep->GetEntries()); }
IMPLEMENTATION * m_rep
Reference to underlying implementation.
Definition: Generic1D.h:119
template<class INTERFACE, class IMPLEMENTATION>
virtual AIDA::IAnnotation& Gaudi::Generic1D< INTERFACE, IMPLEMENTATION >::annotation ( )
inlinevirtual

Access annotation object.

Definition at line 53 of file Generic1D.h.

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

Access annotation object (cons)

Definition at line 55 of file Generic1D.h.

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

Access to axis object.

Definition at line 57 of file Generic1D.h.

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

Get the x axis of the IHistogram1D.

Definition at line 59 of file Generic1D.h.

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

Definition at line 42 of file H1D.cpp.

42  {
43  if (binHeight(index)<=0) return 0;
44  double xx = binHeight(index)/binError(index);
45  return int(xx*xx+0.5);
46  }
virtual double binError(int index) const
The error of a given bin.
Definition: Generic1D.h:159
virtual double binHeight(int index) const
Total height of the corresponding bin (ie the sum of the weights in this bin).
Definition: Generic1D.h:154
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  }
IMPLEMENTATION * m_rep
Reference to underlying implementation.
Definition: Generic1D.h:119
virtual int rIndex(int index) const
operator methods
Definition: Generic1D.h:91
template<class INTERFACE, class IMPLEMENTATION>
virtual int Gaudi::Generic1D< INTERFACE, IMPLEMENTATION >::binEntries ( int  index) const
virtual

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
virtual

The error of a given bin.

Definition at line 159 of file Generic1D.h.

159  {
160  return m_rep->GetBinError ( rIndex(index) );
161  }
IMPLEMENTATION * m_rep
Reference to underlying implementation.
Definition: Generic1D.h:119
virtual int rIndex(int index) const
operator methods
Definition: Generic1D.h:91
template<class INTERFACE , class IMPLEMENTATION >
double Gaudi::Generic1D< INTERFACE, IMPLEMENTATION >::binHeight ( int  index) const
virtual

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

Definition at line 154 of file Generic1D.h.

154  {
155  return m_rep->GetBinContent ( rIndex(index) );
156  }
IMPLEMENTATION * m_rep
Reference to underlying implementation.
Definition: Generic1D.h:119
virtual int rIndex(int index) const
operator methods
Definition: Generic1D.h:91
template<class INTERFACE , class IMPLEMENTATION >
double Gaudi::Generic1D< INTERFACE, IMPLEMENTATION >::binMean ( int  index) const
virtual

The weighted mean of a bin.

Definition at line 149 of file Generic1D.h.

149  {
150  return m_rep->GetBinCenter ( rIndex(index) );
151  }
IMPLEMENTATION * m_rep
Reference to underlying implementation.
Definition: Generic1D.h:119
virtual int rIndex(int index) const
operator methods
Definition: Generic1D.h:91
template<class INTERFACE , class IMPLEMENTATION >
double Gaudi::Generic1D< INTERFACE, IMPLEMENTATION >::binRms ( int  index) const
virtual

Definition at line 144 of file Generic1D.h.

144  {
145  return m_rep->GetBinError ( rIndex(index) );
146  }
IMPLEMENTATION * m_rep
Reference to underlying implementation.
Definition: Generic1D.h:119
virtual int rIndex(int index) const
operator methods
Definition: Generic1D.h:91
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 0;
40  }
template<class INTERFACE, class IMPLEMENTATION>
virtual void* Gaudi::Generic1D< INTERFACE, IMPLEMENTATION >::cast ( const std::string &  cl) const
virtual

Manual cast by class name.

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 0;
56  }
template<class INTERFACE, class IMPLEMENTATION>
virtual int Gaudi::Generic1D< INTERFACE, IMPLEMENTATION >::coordToIndex ( double  coord) const
inlinevirtual

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

Definition at line 103 of file Generic1D.h.

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

Get the Histogram's dimension.

Definition at line 105 of file Generic1D.h.

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

Get the number or all the entries.

Definition at line 62 of file Generic1D.h.

62 { return (int)m_rep->GetEntries(); }
IMPLEMENTATION * m_rep
Reference to underlying implementation.
Definition: Generic1D.h:119
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 176 of file Generic1D.h.

176  {
177  if (sumBinHeights() <= 0) return 0;
178  Stat_t stats[11]; // cover up to 3D...
179  m_rep->GetStats(stats);
180  return stats[0]*stats[0]/stats[1];
181  }
IMPLEMENTATION * m_rep
Reference to underlying implementation.
Definition: Generic1D.h:119
virtual double sumBinHeights() const
Get the sum of in range bin heights in the IProfile.
Definition: Generic1D.h:72
template<class INTERFACE , class IMPLEMENTATION >
int Gaudi::Generic1D< INTERFACE, IMPLEMENTATION >::extraEntries ( ) const
virtual

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

Definition at line 164 of file Generic1D.h.

164  {
165  return binEntries(AIDA::IAxis::UNDERFLOW_BIN) +
166  binEntries(AIDA::IAxis::OVERFLOW_BIN);
167  }
virtual int binEntries(int index) const
Number of entries in the corresponding bin (ie the number of times fill was called for this bin)...
template<class INTERFACE, class IMPLEMENTATION>
virtual double Gaudi::Generic1D< INTERFACE, IMPLEMENTATION >::maxBinHeight ( ) const
inlinevirtual

Get the maximum height of the in-range bins.

Definition at line 80 of file Generic1D.h.

80 { return m_rep->GetMaximum(); }
IMPLEMENTATION * m_rep
Reference to underlying implementation.
Definition: Generic1D.h:119
template<class INTERFACE, class IMPLEMENTATION>
virtual double Gaudi::Generic1D< INTERFACE, IMPLEMENTATION >::mean ( ) const
inlinevirtual

The mean of the whole IHistogram1D.

Definition at line 99 of file Generic1D.h.

99 { return m_rep->GetMean(); }
IMPLEMENTATION * m_rep
Reference to underlying implementation.
Definition: Generic1D.h:119
template<class INTERFACE, class IMPLEMENTATION>
virtual double Gaudi::Generic1D< INTERFACE, IMPLEMENTATION >::minBinHeight ( ) const
inlinevirtual

Get the minimum height of the in-range bins.

Definition at line 78 of file Generic1D.h.

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

object name

Definition at line 49 of file Generic1D.h.

49 { return m_annotation.value("Name"); }
AIDA::Annotation m_annotation
Object annotations.
Definition: Generic1D.h:117
std::string value(const std::string &key) const
Retrieve the value for a given key.
Definition: Annotation.h:117
template<class INTERFACE , class IMPLEMENTATION >
std::ostream & Gaudi::Generic1D< INTERFACE, IMPLEMENTATION >::print ( std::ostream &  s) const
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 201 of file Generic1D.h.

201  {
203  m_rep->Print("all");
204  return s;
205  }
IMPLEMENTATION * m_rep
Reference to underlying implementation.
Definition: Generic1D.h:119
string s
Definition: gaudirun.py:210
template<class INTERFACE, class IMPLEMENTATION>
TObject* Gaudi::Generic1D< INTERFACE, IMPLEMENTATION >::representation ( ) const
inlinevirtual

ROOT object implementation.

Implements Gaudi::HistogramBase.

Definition at line 41 of file Generic1D.h.

41 { return m_rep; }
IMPLEMENTATION * m_rep
Reference to underlying implementation.
Definition: Generic1D.h:119
template<class INTERFACE , class IMPLEMENTATION >
bool Gaudi::Generic1D< INTERFACE, IMPLEMENTATION >::reset ( )
virtual

Reset the Histogram; as if just created.

Reimplemented in Gaudi::Histogram1D.

Definition at line 169 of file Generic1D.h.

169  {
170  m_sumEntries = 0;
171  m_rep->Reset();
172  return true;
173  }
IMPLEMENTATION * m_rep
Reference to underlying implementation.
Definition: Generic1D.h:119
template<class INTERFACE, class IMPLEMENTATION>
virtual int Gaudi::Generic1D< INTERFACE, IMPLEMENTATION >::rIndex ( int  index) const
inlinevirtual

operator methods

Definition at line 91 of file Generic1D.h.

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

The RMS of the whole IHistogram1D.

Definition at line 101 of file Generic1D.h.

101 { return m_rep->GetRMS(); }
IMPLEMENTATION * m_rep
Reference to underlying implementation.
Definition: Generic1D.h:119
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 184 of file Generic1D.h.

184  {
185  m_rep->Scale ( scaleFactor );
186  return true;
187  }
IMPLEMENTATION * m_rep
Reference to underlying implementation.
Definition: Generic1D.h:119
template<class INTERFACE , class IMPLEMENTATION >
bool Gaudi::Generic1D< INTERFACE, IMPLEMENTATION >::setName ( const std::string &  newName)

Set the name of the object.

Definition at line 137 of file Generic1D.h.

137  {
138  m_rep->SetName(newName.c_str());
139  m_annotation.setValue( "Name", newName );
140  return true;
141  }
AIDA::Annotation m_annotation
Object annotations.
Definition: Generic1D.h:117
IMPLEMENTATION * m_rep
Reference to underlying implementation.
Definition: Generic1D.h:119
void setValue(const std::string &key, const std::string &value)
Set value for a given key.
Definition: Annotation.h:124
template<class INTERFACE , class IMPLEMENTATION >
bool Gaudi::Generic1D< INTERFACE, IMPLEMENTATION >::setTitle ( const std::string &  title)
virtual

Set the title of the object.

Definition at line 127 of file Generic1D.h.

127  {
128  m_rep->SetTitle(title.c_str());
129  if ( !annotation().addItem( "Title", title ) )
130  m_annotation.setValue( "Title" , title );
131  if ( !annotation().addItem( "title", title ) )
132  annotation().setValue( "title", title );
133  return true;
134  }
virtual std::string title() const
Get the title of the object.
Definition: Generic1D.h:45
AIDA::Annotation m_annotation
Object annotations.
Definition: Generic1D.h:117
IMPLEMENTATION * m_rep
Reference to underlying implementation.
Definition: Generic1D.h:119
void setValue(const std::string &key, const std::string &value)
Set value for a given key.
Definition: Annotation.h:124
virtual AIDA::IAnnotation & annotation()
Access annotation object.
Definition: Generic1D.h:53
template<class INTERFACE, class IMPLEMENTATION>
virtual double Gaudi::Generic1D< INTERFACE, IMPLEMENTATION >::sumAllBinHeights ( ) const
inlinevirtual

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

Definition at line 74 of file Generic1D.h.

74 { return m_rep->GetSum(); }
IMPLEMENTATION * m_rep
Reference to underlying implementation.
Definition: Generic1D.h:119
template<class INTERFACE, class IMPLEMENTATION>
virtual double Gaudi::Generic1D< INTERFACE, IMPLEMENTATION >::sumBinHeights ( ) const
inlinevirtual

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

Definition at line 72 of file Generic1D.h.

72 { return m_rep->GetSumOfWeights(); }
IMPLEMENTATION * m_rep
Reference to underlying implementation.
Definition: Generic1D.h:119
template<class INTERFACE, class IMPLEMENTATION>
virtual double Gaudi::Generic1D< INTERFACE, IMPLEMENTATION >::sumExtraBinHeights ( ) const
inlinevirtual

Get the sum of the underflow and overflow bin height.

Definition at line 76 of file Generic1D.h.

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

Get the title of the object.

Definition at line 45 of file Generic1D.h.

45 { return m_annotation.value("Title"); }
AIDA::Annotation m_annotation
Object annotations.
Definition: Generic1D.h:117
std::string value(const std::string &key) const
Retrieve the value for a given key.
Definition: Annotation.h:117
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 37 of file Generic1D.h.

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

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

Implements Gaudi::HistogramBase.

Definition at line 209 of file Generic1D.h.

209  {
210  s << "\n1D Histogram Table: " << std::endl;
211  s << "Bin, Height, Error " << std::endl;
212  for( int i = 0; i < axis().bins(); ++i )
213  s << binMean( i ) << ", "
214  << binHeight( i ) << ", "
215  << binError ( i ) << std::endl;
216  s << std::endl;
217  return s;
218  }
virtual double binError(int index) const
The error of a given bin.
Definition: Generic1D.h:159
Axis & axis()
Access to axis object.
Definition: Generic1D.h:57
string s
Definition: gaudirun.py:210
virtual int bins() const
The number of bins (excluding underflow and overflow) on the IAxis.
Definition: Axis.h:105
virtual double binMean(int index) const
The weighted mean of a bin.
Definition: Generic1D.h:149
virtual double binHeight(int index) const
Total height of the corresponding bin (ie the sum of the weights in this bin).
Definition: Generic1D.h:154
list i
Definition: ana.py:128
template<class INTERFACE , class IMPLEMENTATION >
int Gaudi::Generic1D< INTERFACE, IMPLEMENTATION >::write ( const char *  file_name) const
virtual

Write (ASCII) the histogram table into a file.

Implements Gaudi::HistogramBase.

Definition at line 222 of file Generic1D.h.

223  {
224  TFile *f = TFile::Open(file_name,"RECREATE");
225  Int_t nbytes = m_rep->Write();
226  f->Close();
227  return nbytes;
228  }
IMPLEMENTATION * m_rep
Reference to underlying implementation.
Definition: Generic1D.h:119

Member Data Documentation

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

Object annotations.

Definition at line 117 of file Generic1D.h.

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

Axis member.

Definition at line 115 of file Generic1D.h.

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

Definition at line 121 of file Generic1D.h.

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

Reference to underlying implementation.

Definition at line 119 of file Generic1D.h.

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

Definition at line 123 of file Generic1D.h.


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