17#include <framework/logging/Logger.h>
50 if (cc->GetName() == canv->GetName()) {
51 B2ERROR(
"Canvas with name " << canv->GetName() <<
" already in the " << fName <<
52 " MonitoringObject! Use different name (or call getCanvas(name) to access pointer to the existing TCanvas).");
97 if (cc->GetName() == name)
return cc;
99 B2WARNING(
"TCanvas with name " << name <<
" not found in MonitoringObject " << fName);
123 void setVariable(
const std::string& var,
float val,
float upErr = -1.,
float dwErr = -1)
126 auto vv =
m_vars.find(var);
127 if (vv !=
m_vars.end()) vv->second = val;
128 else m_vars.insert({var, val});
132 if (vvE !=
m_upErr.end()) vvE->second = upErr;
133 else m_upErr.insert({var, upErr});
138 if (vvE !=
m_dwErr.end()) vvE->second = dwErr;
139 else m_dwErr.insert({var, dwErr});
153 if (pair.first == var) {
158 m_strVars.push_back(std::pair<std::string, std::string>(var, val));
170 std::vector<std::pair<std::string, std::string>>
m_strVars;
MonitoringObject is a basic object to hold data for the run-dependency monitoring Run summary TCanvas...
MonitoringObject(const std::string &name)
Constructor with name (always use this)
std::vector< TCanvas * > m_Canvases
vector of all TCanvases
MonitoringObject()
Constructor.
void setVariable(const std::string &var, const std::string &val)
set value to string variable (new variable is made if not yet existing)
TCanvas * getCanvas(const std::string &name)
Get pointer to existing canvas with given name (NULL is returned if not existing)
ClassDefOverride(MonitoringObject, 1)
classdef
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)
std::map< std::string, float > m_upErr
map of upper errors of variables
const std::map< std::string, float > & getUpError()
Get map of all float variables upper errors.
void addCanvas(TCanvas *canv)
Add Canvas to monitoring object.
std::map< std::string, float > m_dwErr
map of lower errors of variables
std::map< std::string, float > m_vars
map of all float variables
const std::map< std::string, float > & getVariables()
Get map of all float variables.
void print() const
Print content of MonitoringObject.
const std::vector< TCanvas * > & getListOfCanvases()
Get list of all canvases.
std::vector< std::pair< std::string, std::string > > m_strVars
map of all string variables
const std::vector< std::pair< std::string, std::string > > & getStringVariables()
Get vector of all string variables.
const std::map< std::string, float > & getLowError()
Get map of all float variables lower errors.
Abstract base class for different kinds of events.