 |
Belle II Software
release-05-02-19
|
20 #include <framework/logging/Logger.h>
33 class MonitoringObject :
public TNamed {
53 if (cc->GetName() == canv->GetName()) {
54 B2ERROR(
"Canvas with name " << canv->GetName() <<
" already in the " << fName <<
55 " MonitoringObject! Use different name (or call getCanvas(name) to access pointer to the existing TCanvas).");
100 if (cc->GetName() == name)
return cc;
102 B2WARNING(
"TCanvas with name " << name <<
" not found in MonitoringObject " << fName);
126 void setVariable(
const std::string& var,
float val,
float upErr = -1.,
float dwErr = -1)
129 auto vv =
m_vars.find(var);
130 if (vv !=
m_vars.end()) vv->second = val;
131 else m_vars.insert({var, val});
135 if (vvE !=
m_upErr.end()) vvE->second = upErr;
136 else m_upErr.insert({var, upErr});
141 if (vvE !=
m_dwErr.end()) vvE->second = dwErr;
142 else m_dwErr.insert({var, dwErr});
152 void setVariable(
const std::string& var,
const std::string& val)
156 if (pair.first == var) {
161 m_strVars.push_back(std::pair<std::string, std::string>(var, val));
169 std::map<std::string, float>
m_vars;
170 std::map<std::string, float>
m_upErr;
171 std::map<std::string, float>
m_dwErr;
173 std::vector<std::pair<std::string, std::string>>
m_strVars;
std::map< std::string, float > m_dwErr
map of lower errors of variables
void print() const
Print content of MonitoringObject.
std::vector< std::pair< std::string, std::string > > m_strVars
map of all string variables
MonitoringObject()
Constructor.
std::map< std::string, float > m_upErr
map of upper errors of variables
const std::map< std::string, float > & getVariables()
Get map of all float variables.
const std::map< std::string, float > & getLowError()
Get map of all float variables lower errors.
TCanvas * getCanvas(const std::string &name)
Get pointer to existing canvas with given name (NULL is returned if not existing)
Abstract base class for different kinds of events.
ClassDefOverride(MonitoringObject, 1)
classdef
void addCanvas(TCanvas *canv)
Add Canvas to monitoring object.
std::vector< TCanvas * > m_Canvases
vector of all TCanvases
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)
const std::vector< std::pair< std::string, std::string > > & getStringVariables()
Get vector of all string variables.
const std::map< std::string, float > & getUpError()
Get map of all float variables upper errors.
std::map< std::string, float > m_vars
map of all float variables
const std::vector< TCanvas * > & getListOfCanvases()
Get list of all canvases.
MonitoringObject is a basic object to hold data for the run-dependency monitoring Run summary TCanvas...