18#include <framework/logging/Logger.h>
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).");
98 if (cc->GetName() == name)
return cc;
100 B2WARNING(
"TCanvas with name " << name <<
" not found in MonitoringObject " << fName);
124 void setVariable(
const std::string& var,
float val,
float upErr = -1.,
float dwErr = -1)
127 auto vv =
m_vars.find(var);
128 if (vv !=
m_vars.end()) vv->second = val;
129 else m_vars.insert({var, val});
133 if (vvE !=
m_upErr.end()) vvE->second = upErr;
134 else m_upErr.insert({var, upErr});
139 if (vvE !=
m_dwErr.end()) vvE->second = dwErr;
140 else m_dwErr.insert({var, dwErr});
154 if (pair.first == var) {
159 m_strVars.push_back(std::pair<std::string, std::string>(var, val));
171 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.