Belle II Software  release-08-01-10
MonitoringObject Class Reference

MonitoringObject is a basic object to hold data for the run-dependency monitoring Run summary TCanvases and monitoring variables. More...

#include <MonitoringObject.h>

Inheritance diagram for MonitoringObject:
Collaboration diagram for MonitoringObject:

Public Member Functions

 MonitoringObject ()
 Constructor.
 
 MonitoringObject (const std::string &name)
 Constructor with name (always use this)
 
void addCanvas (TCanvas *canv)
 Add Canvas to monitoring object. More...
 
const std::map< std::string, float > & getVariables ()
 Get map of all float variables.
 
const std::map< std::string, float > & getUpError ()
 Get map of all float variables upper errors.
 
const std::map< std::string, float > & getLowError ()
 Get map of all float variables lower errors.
 
const std::vector< std::pair< std::string, std::string > > & getStringVariables ()
 Get vector of all string variables.
 
TCanvas * getCanvas (const std::string &name)
 Get pointer to existing canvas with given name (NULL is returned if not existing)
 
const std::vector< TCanvas * > & getListOfCanvases ()
 Get list of all canvases.
 
void print () const
 Print content of MonitoringObject.
 
void setVariable (const std::string &var, float val, float upErr=-1., float dwErr=-1)
 set value to float variable (new variable is made if not yet existing) More...
 
void setVariable (const std::string &var, const std::string &val)
 set value to string variable (new variable is made if not yet existing) More...
 

Private Member Functions

 ClassDefOverride (MonitoringObject, 1)
 classdef
 

Private Attributes

std::vector< TCanvas * > m_Canvases
 vector of all TCanvases
 
std::map< std::string, float > m_vars
 map of all float variables
 
std::map< std::string, float > m_upErr
 map of upper errors of variables
 
std::map< std::string, float > m_dwErr
 map of lower errors of variables
 
std::vector< std::pair< std::string, std::string > > m_strVars
 map of all string variables
 

Detailed Description

MonitoringObject is a basic object to hold data for the run-dependency monitoring Run summary TCanvases and monitoring variables.

Definition at line 31 of file MonitoringObject.h.

Member Function Documentation

◆ addCanvas()

void addCanvas ( TCanvas *  canv)
inline

Add Canvas to monitoring object.

Parameters
canvpointer to canvas to add

Definition at line 48 of file MonitoringObject.h.

49  {
50  for (auto cc : m_Canvases) {
51  if (cc->GetName() == canv->GetName()) {
52  B2ERROR("Canvas with name " << canv->GetName() << " already in the " << fName <<
53  " MonitoringObject! Use different name (or call getCanvas(name) to access pointer to the existing TCanvas).");
54  return;
55  }
56  }
57  m_Canvases.push_back(canv);
58  };
std::vector< TCanvas * > m_Canvases
vector of all TCanvases

◆ setVariable() [1/2]

void setVariable ( const std::string &  var,
const std::string &  val 
)
inline

set value to string variable (new variable is made if not yet existing)

Parameters
varvariable name
valvariable value

Definition at line 150 of file MonitoringObject.h.

◆ setVariable() [2/2]

void setVariable ( const std::string &  var,
float  val,
float  upErr = -1.,
float  dwErr = -1 
)
inline

set value to float variable (new variable is made if not yet existing)

Parameters
varvariable name
valvariable value
upErrvariable size of positive error
dwErrvariable size of negative error (if not set, symmetric error with size upErr is used)

Definition at line 124 of file MonitoringObject.h.


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