The Gaudi Framework  master (ff829712)
Loading...
Searching...
No Matches
Gaudi::Generic3D< INTERFACE, IMPLEMENTATION > Class Template Reference

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

#include <GaudiPI/Generic3D.h>

Inheritance diagram for Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >:
Collaboration diagram for Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >:

Public Types

typedef Generic3D< INTERFACE, IMPLEMENTATION > Base
 

Public Member Functions

 Generic3D ()=default
 Default constructor.
 
TObject * representation () const override
 ROOT object implementation.
 
void adoptRepresentation (TObject *rep) override
 Adopt ROOT histogram representation.
 
int dimension () const override
 Get the Histogram's dimension.
 
std::string title () const override
 Get the title of the object.
 
bool setTitle (const std::string &title) override
 Set the title of the object.
 
std::string name () const
 object name
 
bool setName (const std::string &newName)
 Sets the name of the object.
 
AIDA::IAnnotation & annotation () override
 Access annotation object.
 
const AIDA::IAnnotation & annotation () const override
 Access annotation object (cons)
 
int entries () const override
 Get the number or all the entries.
 
int allEntries () const override
 Get the number or all the entries, both in range and underflow/overflow bins of the IProfile.
 
double sumBinHeights () const override
 Get the sum of in range bin heights in the IProfile.
 
double sumAllBinHeights () const override
 Get the sum of all the bins heights (including underflow and overflow bin).
 
double sumExtraBinHeights () const override
 Get the sum of the underflow and overflow bin height.
 
double minBinHeight () const override
 Get the minimum height of the in-range bins.
 
double maxBinHeight () const override
 Get the maximum height of the in-range bins.
 
int rIndexX (int index) const
 
int rIndexY (int index) const
 
int rIndexZ (int index) const
 
double binMeanX (int indexX, int, int) const override
 The weighted mean along the x axis of a given bin.
 
double binMeanY (int, int indexY, int) const override
 The weighted mean along the y axis of a given bin.
 
double binMeanZ (int, int, int indexZ) const override
 The weighted mean along the z axis of a given bin.
 
int binEntries (int indexX, int indexY, int indexZ) const override
 Number of entries in the corresponding bin (ie the number of times fill was calle d for this bin).
 
int binEntriesX (int index) const override
 Sum of all the entries of the bins along a given x bin.
 
int binEntriesY (int index) const override
 Sum of all the entries of the bins along a given y bin.
 
int binEntriesZ (int index) const override
 Sum of all the entries of the bins along a given z bin.
 
double binHeight (int indexX, int indexY, int indexZ) const
 Total height of the corresponding bin (ie the sum of the weights in this bin).
 
double binHeightX (int index) const override
 Sum of all the heights of the bins along a given x bin.
 
double binHeightY (int index) const override
 Sum of all the heights of the bins along a given y bin.
 
double binHeightZ (int index) const override
 Sum of all the heights of the bins along a given z bin.
 
double binError (int indexX, int indexY, int indexZ) const override
 The error of a given bin.
 
double meanX () const override
 The mean of the IHistogram3D along the x axis.
 
double meanY () const override
 The mean of the IHistogram3D along the y axis.
 
double meanZ () const override
 The mean of the IHistogram3D along the z axis.
 
double rmsX () const override
 The RMS of the IHistogram3D along the x axis.
 
double rmsY () const override
 The RMS of the IHistogram3D along the y axis.
 
double rmsZ () const override
 The RMS of the IHistogram3D along the z axis.
 
const AIDA::IAxis & xAxis () const override
 Get the x axis of the IHistogram3D.
 
const AIDA::IAxis & yAxis () const override
 Get the y axis of the IHistogram3D.
 
const AIDA::IAxis & zAxis () const override
 Get the z axis of the IHistogram3D.
 
int coordToIndexX (double coord) const override
 Get the bin number corresponding to a given coordinate along the x axis.
 
int coordToIndexY (double coord) const override
 Get the bin number corresponding to a given coordinate along the y axis.
 
int coordToIndexZ (double coord) const override
 Get the bin number corresponding to a given coordinate along the z axis.
 
double equivalentBinEntries () const override
 Number of equivalent entries, i.e. SUM[ weight ] ^ 2 / SUM[ weight^2 ]
 
bool scale (double scaleFactor) override
 Scale the weights and the errors of all the IHistogram's bins (in-range and out-of-range ones) by a given scale factor.
 
bool add (const INTERFACE &hist) override
 Add to this Histogram3D the contents of another IHistogram3D.
 
int extraEntries () const override
 
std::ostream & print (std::ostream &s) const override
 Print (ASCII) the histogram into the output stream.
 
std::ostream & write (std::ostream &s) const override
 Write (ASCII) the histogram table into the output stream.
 
int write (const char *file_name) const override
 Write (ASCII) the histogram table into a file.
 
void adoptRepresentation (TObject *rep)
 Adopt ROOT histogram representation.
 
- Public Member Functions inherited from Gaudi::HistogramBase
virtual ~HistogramBase ()=default
 

Protected Member Functions

 Generic3D (IMPLEMENTATION *p)
 constructor
 

Protected Attributes

Gaudi::Axis m_xAxis
 
Gaudi::Axis m_yAxis
 
Gaudi::Axis m_zAxis
 
AIDA::Annotation m_annotation
 Object annotations.
 
std::unique_ptr< IMPLEMENTATION > m_rep
 Reference to underlying implementation.
 
std::string m_classType
 
int m_sumEntries = 0
 

Detailed Description

template<typename INTERFACE, typename IMPLEMENTATION>
class Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >

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

Credits: This code is the result of some stripdown implementation of LCG/PI. Credits to them!

Author
M.Frank

Definition at line 45 of file Generic3D.h.

Member Typedef Documentation

◆ Base

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

Definition at line 47 of file Generic3D.h.

Constructor & Destructor Documentation

◆ Generic3D() [1/2]

template<typename INTERFACE, typename IMPLEMENTATION>
Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::Generic3D ( )
default

Default constructor.

◆ Generic3D() [2/2]

template<typename INTERFACE, typename IMPLEMENTATION>
Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::Generic3D ( IMPLEMENTATION * p)
inlineprotected

constructor

Definition at line 53 of file Generic3D.h.

53: m_rep( p ) {}
Common AIDA implementation stuff for histograms and profiles using ROOT implementations.
Definition Generic3D.h:45
std::unique_ptr< IMPLEMENTATION > m_rep
Reference to underlying implementation.
Definition Generic3D.h:229

Member Function Documentation

◆ add()

template<typename INTERFACE, typename IMPLEMENTATION>
bool Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::add ( const INTERFACE & hist)
inlineoverride

Add to this Histogram3D the contents of another IHistogram3D.

Definition at line 198 of file Generic3D.h.

198 {
199 const Base* p = dynamic_cast<const Base*>( &hist );
200 if ( !p ) throw std::runtime_error( "Cannot add profile histograms of different implementations." );
201 m_rep->Add( p->m_rep.get() );
202 return true;
203 }
Generic3D< INTERFACE, IMPLEMENTATION > Base
Definition Generic3D.h:47

◆ adoptRepresentation() [1/2]

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

Adopt ROOT histogram representation.

Implements Gaudi::HistogramBase.

Definition at line 31 of file H3D.cpp.

31 {
32 TH3D* imp = dynamic_cast<TH3D*>( rep );
33 if ( !imp ) throw std::runtime_error( "Cannot adopt native histogram representation." );
34 m_rep.reset( imp );
35 m_xAxis.initialize( m_rep->GetXaxis(), true );
36 m_yAxis.initialize( m_rep->GetYaxis(), true );
37 m_zAxis.initialize( m_rep->GetZaxis(), true );
38 const TArrayD* a = m_rep->GetSumw2();
39 if ( !a || ( a && a->GetSize() == 0 ) ) m_rep->Sumw2();
40 setTitle( m_rep->GetTitle() );
41 }
Gaudi::Axis m_zAxis
Definition Generic3D.h:225
Gaudi::Axis m_xAxis
Definition Generic3D.h:223
Gaudi::Axis m_yAxis
Definition Generic3D.h:224
bool setTitle(const std::string &title) override
Set the title of the object.
Definition Generic3D.h:237

◆ adoptRepresentation() [2/2]

template<typename INTERFACE, typename IMPLEMENTATION>
void Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::adoptRepresentation ( TObject * rep)
overridevirtual

Adopt ROOT histogram representation.

Implements Gaudi::HistogramBase.

◆ allEntries()

template<class INTERFACE, class IMPLEMENTATION>
int Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::allEntries ( ) const
override

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

Definition at line 256 of file Generic3D.h.

256 {
257 return int( m_rep->GetEntries() );
258 }

◆ annotation() [1/2]

template<typename INTERFACE, typename IMPLEMENTATION>
const AIDA::IAnnotation & Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::annotation ( ) const
inlineoverride

Access annotation object (cons)

Definition at line 74 of file Generic3D.h.

74{ return m_annotation; }
AIDA::Annotation m_annotation
Object annotations.
Definition Generic3D.h:227

◆ annotation() [2/2]

template<typename INTERFACE, typename IMPLEMENTATION>
AIDA::IAnnotation & Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::annotation ( )
inlineoverride

Access annotation object.

Definition at line 72 of file Generic3D.h.

72{ return m_annotation; }

◆ binEntries()

template<typename INTERFACE, typename IMPLEMENTATION>
int Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::binEntries ( int indexX,
int indexY,
int indexZ ) const
inlineoverride

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

Definition at line 108 of file Generic3D.h.

108 {
109 if ( binHeight( indexX, indexY, indexZ ) <= 0 ) return 0;
111 return int( xx * xx + 0.5 );
112 }
double binError(int indexX, int indexY, int indexZ) const override
The error of a given bin.
Definition Generic3D.h:163
double binHeight(int indexX, int indexY, int indexZ) const
Total height of the corresponding bin (ie the sum of the weights in this bin).
Definition Generic3D.h:137

◆ binEntriesX()

template<typename INTERFACE, typename IMPLEMENTATION>
int Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::binEntriesX ( int index) const
inlineoverride

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

Definition at line 114 of file Generic3D.h.

114 {
115 int n = 0;
116 for ( int i = -2; i < yAxis().bins(); ++i )
117 for ( int j = -2; j < zAxis().bins(); ++j ) n += binEntries( index, i, j );
118 return n;
119 }
const AIDA::IAxis & zAxis() const override
Get the z axis of the IHistogram3D.
Definition Generic3D.h:184
int binEntries(int indexX, int indexY, int indexZ) const override
Number of entries in the corresponding bin (ie the number of times fill was calle d for this bin).
Definition Generic3D.h:108
const AIDA::IAxis & yAxis() const override
Get the y axis of the IHistogram3D.
Definition Generic3D.h:182

◆ binEntriesY()

template<typename INTERFACE, typename IMPLEMENTATION>
int Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::binEntriesY ( int index) const
inlineoverride

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

Definition at line 121 of file Generic3D.h.

121 {
122 int n = 0;
123 for ( int i = -2; i < xAxis().bins(); ++i )
124 for ( int j = -2; j < zAxis().bins(); ++j ) n += binEntries( i, index, j );
125 return n;
126 }
const AIDA::IAxis & xAxis() const override
Get the x axis of the IHistogram3D.
Definition Generic3D.h:180

◆ binEntriesZ()

template<typename INTERFACE, typename IMPLEMENTATION>
int Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::binEntriesZ ( int index) const
inlineoverride

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

Definition at line 129 of file Generic3D.h.

129 {
130 int n = 0;
131 for ( int i = -2; i < xAxis().bins(); ++i )
132 for ( int j = -2; j < yAxis().bins(); ++j ) n += binEntries( i, j, index );
133 return n;
134 }

◆ binError()

template<typename INTERFACE, typename IMPLEMENTATION>
double Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::binError ( int indexX,
int indexY,
int indexZ ) const
inlineoverride

The error of a given bin.

Definition at line 163 of file Generic3D.h.

163 {
164 return m_rep->GetBinError( rIndexX( indexX ), rIndexY( indexY ), rIndexZ( indexZ ) );
165 }
int rIndexY(int index) const
Definition Generic3D.h:92
int rIndexZ(int index) const
Definition Generic3D.h:93
int rIndexX(int index) const
Definition Generic3D.h:91

◆ binHeight()

template<typename INTERFACE, typename IMPLEMENTATION>
double Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::binHeight ( int indexX,
int indexY,
int indexZ ) const
inline

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

Definition at line 137 of file Generic3D.h.

137 {
138 return m_rep->GetBinContent( rIndexX( indexX ), rIndexY( indexY ), rIndexZ( indexZ ) );
139 }

◆ binHeightX()

template<typename INTERFACE, typename IMPLEMENTATION>
double Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::binHeightX ( int index) const
inlineoverride

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

Definition at line 142 of file Generic3D.h.

142 {
143 double s = 0;
144 for ( int i = -2; i < yAxis().bins(); ++i )
145 for ( int j = -2; j < zAxis().bins(); ++j ) s += binHeight( index, i, j );
146 return s;
147 }

◆ binHeightY()

template<typename INTERFACE, typename IMPLEMENTATION>
double Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::binHeightY ( int index) const
inlineoverride

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

Definition at line 149 of file Generic3D.h.

149 {
150 double s = 0;
151 for ( int i = -2; i < xAxis().bins(); ++i )
152 for ( int j = -2; j < zAxis().bins(); ++j ) s += binHeight( i, index, j );
153 return s;
154 }

◆ binHeightZ()

template<typename INTERFACE, typename IMPLEMENTATION>
double Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::binHeightZ ( int index) const
inlineoverride

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

Definition at line 156 of file Generic3D.h.

156 {
157 double s = 0;
158 for ( int i = -2; i < xAxis().bins(); ++i )
159 for ( int j = -2; j < yAxis().bins(); ++j ) s += binHeight( i, j, index );
160 return s;
161 }

◆ binMeanX()

template<typename INTERFACE, typename IMPLEMENTATION>
double Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::binMeanX ( int indexX,
int ,
int  ) const
inlineoverride

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

Definition at line 96 of file Generic3D.h.

96 {
97 return m_rep->GetXaxis()->GetBinCenter( rIndexX( indexX ) );
98 }

◆ binMeanY()

template<typename INTERFACE, typename IMPLEMENTATION>
double Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::binMeanY ( int ,
int indexY,
int  ) const
inlineoverride

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

Definition at line 100 of file Generic3D.h.

100 {
101 return m_rep->GetYaxis()->GetBinCenter( rIndexY( indexY ) );
102 }

◆ binMeanZ()

template<typename INTERFACE, typename IMPLEMENTATION>
double Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::binMeanZ ( int ,
int ,
int indexZ ) const
inlineoverride

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

Definition at line 104 of file Generic3D.h.

104 {
105 return m_rep->GetYaxis()->GetBinCenter( rIndexY( indexZ ) );
106 }

◆ coordToIndexX()

template<typename INTERFACE, typename IMPLEMENTATION>
int Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::coordToIndexX ( double coord) const
inlineoverride

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

Definition at line 186 of file Generic3D.h.

186{ return xAxis().coordToIndex( coord ); }

◆ coordToIndexY()

template<typename INTERFACE, typename IMPLEMENTATION>
int Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::coordToIndexY ( double coord) const
inlineoverride

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

Definition at line 188 of file Generic3D.h.

188{ return yAxis().coordToIndex( coord ); }

◆ coordToIndexZ()

template<typename INTERFACE, typename IMPLEMENTATION>
int Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::coordToIndexZ ( double coord) const
inlineoverride

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

Definition at line 190 of file Generic3D.h.

190{ return zAxis().coordToIndex( coord ); }

◆ dimension()

template<typename INTERFACE, typename IMPLEMENTATION>
int Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::dimension ( ) const
inlineoverride

Get the Histogram's dimension.

Definition at line 62 of file Generic3D.h.

62{ return 3; }

◆ entries()

template<class INTERFACE, class IMPLEMENTATION>
int Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::entries ( ) const
override

Get the number or all the entries.

Definition at line 251 of file Generic3D.h.

251 {
252 return m_rep->GetEntries();
253 }

◆ equivalentBinEntries()

template<class INTERFACE, class IMPLEMENTATION>
double Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::equivalentBinEntries ( ) const
override

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

Definition at line 281 of file Generic3D.h.

281 {
282 if ( sumBinHeights() <= 0 ) return 0;
283 Stat_t stats[11]; // cover up to 3D...
284 m_rep->GetStats( stats );
285 return stats[0] * stats[0] / stats[1];
286 }
double sumBinHeights() const override
Get the sum of in range bin heights in the IProfile.
Definition Generic3D.h:271

◆ extraEntries()

◆ maxBinHeight()

template<class INTERFACE, class IMPLEMENTATION>
double Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::maxBinHeight ( ) const
override

Get the maximum height of the in-range bins.

Definition at line 266 of file Generic3D.h.

266 {
267 return m_rep->GetMaximum();
268 }

◆ meanX()

template<typename INTERFACE, typename IMPLEMENTATION>
double Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::meanX ( ) const
inlineoverride

The mean of the IHistogram3D along the x axis.

Definition at line 167 of file Generic3D.h.

167{ return m_rep->GetMean( 1 ); }

◆ meanY()

template<typename INTERFACE, typename IMPLEMENTATION>
double Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::meanY ( ) const
inlineoverride

The mean of the IHistogram3D along the y axis.

Definition at line 170 of file Generic3D.h.

170{ return m_rep->GetMean( 2 ); }

◆ meanZ()

template<typename INTERFACE, typename IMPLEMENTATION>
double Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::meanZ ( ) const
inlineoverride

The mean of the IHistogram3D along the z axis.

Definition at line 172 of file Generic3D.h.

172{ return m_rep->GetMean( 3 ); }

◆ minBinHeight()

template<class INTERFACE, class IMPLEMENTATION>
double Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::minBinHeight ( ) const
override

Get the minimum height of the in-range bins.

Definition at line 261 of file Generic3D.h.

261 {
262 return m_rep->GetMinimum();
263 }

◆ name()

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

object name

Definition at line 68 of file Generic3D.h.

68{ return m_annotation.value( "Name" ); }

◆ print()

template<class INTERFACE, class IMPLEMENTATION>
std::ostream & Gaudi::Generic3D< 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 295 of file Generic3D.h.

295 {
297 m_rep->Print( "all" );
298 return s;
299 }

◆ representation()

template<typename INTERFACE, typename IMPLEMENTATION>
TObject * Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::representation ( ) const
inlineoverridevirtual

ROOT object implementation.

Implements Gaudi::HistogramBase.

Definition at line 57 of file Generic3D.h.

57{ return m_rep.get(); }

◆ rIndexX()

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

Definition at line 91 of file Generic3D.h.

91{ return m_xAxis.rIndex( index ); }

◆ rIndexY()

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

Definition at line 92 of file Generic3D.h.

92{ return m_yAxis.rIndex( index ); }

◆ rIndexZ()

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

Definition at line 93 of file Generic3D.h.

93{ return m_zAxis.rIndex( index ); }

◆ rmsX()

template<typename INTERFACE, typename IMPLEMENTATION>
double Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::rmsX ( ) const
inlineoverride

The RMS of the IHistogram3D along the x axis.

Definition at line 174 of file Generic3D.h.

174{ return m_rep->GetRMS( 1 ); }

◆ rmsY()

template<typename INTERFACE, typename IMPLEMENTATION>
double Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::rmsY ( ) const
inlineoverride

The RMS of the IHistogram3D along the y axis.

Definition at line 176 of file Generic3D.h.

176{ return m_rep->GetRMS( 2 ); }

◆ rmsZ()

template<typename INTERFACE, typename IMPLEMENTATION>
double Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::rmsZ ( ) const
inlineoverride

The RMS of the IHistogram3D along the z axis.

Definition at line 178 of file Generic3D.h.

178{ return m_rep->GetRMS( 3 ); }

◆ scale()

template<class INTERFACE, class IMPLEMENTATION>
bool Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::scale ( double scaleFactor)
override

Scale the weights and the errors of all the IHistogram's bins (in-range and out-of-range ones) by a given scale factor.

Definition at line 289 of file Generic3D.h.

289 {
290 m_rep->Scale( scaleFactor );
291 return true;
292 }

◆ setName()

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

Sets the name of the object.

Definition at line 245 of file Generic3D.h.

245 {
246 m_rep->SetName( newName.c_str() );
247 m_annotation.setValue( "Name", newName );
248 return true;
249 }

◆ setTitle()

template<class INTERFACE, class IMPLEMENTATION>
bool Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::setTitle ( const std::string & title)
override

Set the title of the object.

Definition at line 237 of file Generic3D.h.

237 {
238 m_rep->SetTitle( title.c_str() );
239 if ( !annotation().addItem( "Title", title ) ) m_annotation.setValue( "Title", title );
240 if ( !annotation().addItem( "title", title ) ) annotation().setValue( "title", title );
241 return true;
242 }
std::string title() const override
Get the title of the object.
Definition Generic3D.h:64
AIDA::IAnnotation & annotation() override
Access annotation object.
Definition Generic3D.h:72

◆ sumAllBinHeights()

template<class INTERFACE, class IMPLEMENTATION>
double Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::sumAllBinHeights ( ) const
override

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

Definition at line 276 of file Generic3D.h.

276 {
277 return m_rep->GetSum();
278 }

◆ sumBinHeights()

template<class INTERFACE, class IMPLEMENTATION>
double Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::sumBinHeights ( ) const
override

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

Definition at line 271 of file Generic3D.h.

271 {
272 return m_rep->GetSumOfWeights();
273 }

◆ sumExtraBinHeights()

template<typename INTERFACE, typename IMPLEMENTATION>
double Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::sumExtraBinHeights ( ) const
inlineoverride

Get the sum of the underflow and overflow bin height.

Definition at line 85 of file Generic3D.h.

85{ return sumAllBinHeights() - sumBinHeights(); }
double sumAllBinHeights() const override
Get the sum of all the bins heights (including underflow and overflow bin).
Definition Generic3D.h:276

◆ title()

template<typename INTERFACE, typename IMPLEMENTATION>
std::string Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::title ( ) const
inlineoverride

Get the title of the object.

Definition at line 64 of file Generic3D.h.

64{ return m_annotation.value( "Title" ); }

◆ write() [1/2]

template<class INTERFACE, class IMPLEMENTATION>
int Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::write ( const char * file_name) const
overridevirtual

Write (ASCII) the histogram table into a file.

Implements Gaudi::HistogramBase.

Definition at line 317 of file Generic3D.h.

317 {
318 TFile* f = TFile::Open( file_name, "RECREATE" );
319 Int_t nbytes = m_rep->Write();
320 f->Close();
321 return nbytes;
322 }

◆ write() [2/2]

template<class INTERFACE, class IMPLEMENTATION>
std::ostream & Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::write ( std::ostream & s) const
overridevirtual

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

Implements Gaudi::HistogramBase.

Definition at line 303 of file Generic3D.h.

303 {
304 s << "\n3D Histogram Table: " << std::endl;
305 s << "BinX, BinY, BinZ, Height, Error " << std::endl;
306 for ( int i = 0; i < xAxis().bins(); ++i )
307 for ( int j = 0; j < yAxis().bins(); ++j )
308 for ( int k = 0; k < zAxis().bins(); ++k )
309 s << binMeanX( i, j, k ) << ", " << binMeanY( i, j, k ) << ", " << binMeanZ( i, j, k ) << ", "
310 << binHeight( i, j, k ) << ", " << binError( i, j, k ) << std::endl;
311 s << std::endl;
312 return s;
313 }
double binMeanY(int, int indexY, int) const override
The weighted mean along the y axis of a given bin.
Definition Generic3D.h:100
double binMeanZ(int, int, int indexZ) const override
The weighted mean along the z axis of a given bin.
Definition Generic3D.h:104
double binMeanX(int indexX, int, int) const override
The weighted mean along the x axis of a given bin.
Definition Generic3D.h:96

◆ xAxis()

template<typename INTERFACE, typename IMPLEMENTATION>
const AIDA::IAxis & Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::xAxis ( ) const
inlineoverride

Get the x axis of the IHistogram3D.

Definition at line 180 of file Generic3D.h.

180{ return m_xAxis; }

◆ yAxis()

template<typename INTERFACE, typename IMPLEMENTATION>
const AIDA::IAxis & Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::yAxis ( ) const
inlineoverride

Get the y axis of the IHistogram3D.

Definition at line 182 of file Generic3D.h.

182{ return m_yAxis; }

◆ zAxis()

template<typename INTERFACE, typename IMPLEMENTATION>
const AIDA::IAxis & Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::zAxis ( ) const
inlineoverride

Get the z axis of the IHistogram3D.

Definition at line 184 of file Generic3D.h.

184{ return m_zAxis; }

Member Data Documentation

◆ m_annotation

template<typename INTERFACE, typename IMPLEMENTATION>
AIDA::Annotation Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::m_annotation
mutableprotected

Object annotations.

Definition at line 227 of file Generic3D.h.

◆ m_classType

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

Definition at line 231 of file Generic3D.h.

◆ m_rep

template<typename INTERFACE, typename IMPLEMENTATION>
std::unique_ptr<IMPLEMENTATION> Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::m_rep
protected

Reference to underlying implementation.

Definition at line 229 of file Generic3D.h.

◆ m_sumEntries

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

Definition at line 233 of file Generic3D.h.

◆ m_xAxis

template<typename INTERFACE, typename IMPLEMENTATION>
Gaudi::Axis Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::m_xAxis
protected

Definition at line 223 of file Generic3D.h.

◆ m_yAxis

template<typename INTERFACE, typename IMPLEMENTATION>
Gaudi::Axis Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::m_yAxis
protected

Definition at line 224 of file Generic3D.h.

◆ m_zAxis

template<typename INTERFACE, typename IMPLEMENTATION>
Gaudi::Axis Gaudi::Generic3D< INTERFACE, IMPLEMENTATION >::m_zAxis
protected

Definition at line 225 of file Generic3D.h.


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