ATLAS Offline Software
Loading...
Searching...
No Matches
TIDA::Histogram< T > Class Template Reference

#include <TIDAHistogram.h>

Collaboration diagram for TIDA::Histogram< T >:

Public Member Functions

 Histogram ()
 Histogram (ToolHandle< GenericMonitoringTool > *m, const std::string &name)
void Fill (T d) const
void Fill (T d, T w) const
const std::string & name () const
ToolHandle< GenericMonitoringTool > * monTool () const
const Histogramoperator-> () const

Private Attributes

ToolHandle< GenericMonitoringTool > * m_monTool
std::string m_name

Detailed Description

template<typename T>
class TIDA::Histogram< T >

Definition at line 25 of file TIDAHistogram.h.

Constructor & Destructor Documentation

◆ Histogram() [1/2]

template<typename T>
TIDA::Histogram< T >::Histogram ( )
inline

Definition at line 29 of file TIDAHistogram.h.

29: m_monTool(0), m_name("") { }
ToolHandle< GenericMonitoringTool > * m_monTool
std::string m_name

◆ Histogram() [2/2]

template<typename T>
TIDA::Histogram< T >::Histogram ( ToolHandle< GenericMonitoringTool > * m,
const std::string & name )
inline

Definition at line 31 of file TIDAHistogram.h.

31 : m_monTool(m), m_name(name) {
32 // std::cout << "book: " << m_name << " " << m_monTool->name() << std::endl;
33 }
const std::string & name() const

Member Function Documentation

◆ Fill() [1/2]

template<typename T>
void TIDA::Histogram< T >::Fill ( T d) const
inline

Definition at line 35 of file TIDAHistogram.h.

35 {
36 if ( m_monTool ) {
37 // std::cout << "Histogram::Fill() monTool " << m_monTool << "\tname: " << m_name << "\td: " << d << "\t" << monTool()->name() << std::endl;
38 auto s = Monitored::Scalar<T>( m_name, d );
40 }
41 else std::cerr << "Histogram " << m_name << "\tmonTool not defined" << std::endl;
42 }

◆ Fill() [2/2]

template<typename T>
void TIDA::Histogram< T >::Fill ( T d,
T w ) const
inline

Definition at line 44 of file TIDAHistogram.h.

44 {
45 if ( m_monTool ) {
46 // std::cout << "Histogram::Fill() monTool " << m_monTool << "\tname: " << m_name << "\td: " << d << "\tw:" << w << std::endl;
47 auto s = Monitored::Scalar<T>( m_name, d );
48 auto sw = Monitored::Scalar<T>( m_name+"_weight", w );
50 }
51 else std::cerr << "Histogram " << m_name << "\tmonTool not defined" << std::endl;
52 }

◆ monTool()

template<typename T>
ToolHandle< GenericMonitoringTool > * TIDA::Histogram< T >::monTool ( ) const
inline

Definition at line 56 of file TIDAHistogram.h.

56{ return m_monTool; };

◆ name()

template<typename T>
const std::string & TIDA::Histogram< T >::name ( ) const
inline

Definition at line 54 of file TIDAHistogram.h.

54{ return m_name; }

◆ operator->()

template<typename T>
const Histogram * TIDA::Histogram< T >::operator-> ( ) const
inline

Definition at line 58 of file TIDAHistogram.h.

58{ return this; }

Member Data Documentation

◆ m_monTool

template<typename T>
ToolHandle<GenericMonitoringTool>* TIDA::Histogram< T >::m_monTool
private

Definition at line 62 of file TIDAHistogram.h.

◆ m_name

template<typename T>
std::string TIDA::Histogram< T >::m_name
private

Definition at line 64 of file TIDAHistogram.h.


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