ATLAS Offline Software
Public Member Functions | Private Attributes | List of all members
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
 
std::string name () const
 
ToolHandle< GenericMonitoringTool > * monTool () 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("") { }

◆ 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  }

Member Function Documentation

◆ Fill() [1/2]

template<typename T >
void TIDA::Histogram< T >::Fill ( 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 ( d,
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 );
49  Monitored::Group( *m_monTool, s, sw );
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 >
std::string TIDA::Histogram< T >::name ( ) const
inline

Definition at line 54 of file TIDAHistogram.h.

54 { return m_name; }

Member Data Documentation

◆ m_monTool

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

Definition at line 60 of file TIDAHistogram.h.

◆ m_name

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

Definition at line 62 of file TIDAHistogram.h.


The documentation for this class was generated from the following file:
TIDA::Histogram::m_monTool
ToolHandle< GenericMonitoringTool > * m_monTool
Definition: TIDAHistogram.h:56
TrigDefs::Group
Group
Properties of a chain group.
Definition: GroupProperties.h:13
python.SystemOfUnits.s
int s
Definition: SystemOfUnits.py:131
python.SystemOfUnits.m
int m
Definition: SystemOfUnits.py:91
hist_file_dump.d
d
Definition: hist_file_dump.py:137
TIDA::Histogram::m_name
std::string m_name
Definition: TIDAHistogram.h:62
TIDA::Histogram::name
std::string name() const
Definition: TIDAHistogram.h:54
Monitored::Scalar
Declare a monitored scalar variable.
Definition: MonitoredScalar.h:34
python.IoTestsLib.w
def w
Definition: IoTestsLib.py:200