Belle II Software development
MonitoringObject.cc
1/**************************************************************************
2 * basf2 (Belle II Analysis Software Framework) *
3 * Author: The Belle II Collaboration *
4 * *
5 * See git log for contributors and copyright holders. *
6 * This file is licensed under LGPL-3.0, see LICENSE.md. *
7 **************************************************************************/
8
9#include <dqm/core/MonitoringObject.h>
10
11#include <framework/utilities/KeyValuePrinter.h>
12
13#include <iostream>
14#include <sstream>
15
16using namespace std;
17using namespace Belle2;
18
20{
21
22 KeyValuePrinter printVar(false);
23 printVar.put("Name", GetName());
24 for (const auto& var : m_vars) {
25 printVar.put(var.first, var.second);
26 }
27 for (const auto& var : m_strVars) {
28 printVar.put(var.first, var.second);
29 }
30
31 KeyValuePrinter printCanv(false);
32 for (const auto& canv : m_Canvases) {
33 printCanv.put(canv->GetName(), canv->GetTitle());
34 }
35
36 std::cout << "=== MonitoringObject ===\n";
37 std::cout << printVar.string();
38 std::cout << "\n List of canvases: \n";
39 std::cout << printCanv.string();
40 std::cout << "========================\n";
41}
create human-readable or JSON output for key value pairs.
void put(const std::string &key, const T &value)
Add one key-value pair.
std::string string() const
Return completed string.
std::vector< TCanvas * > m_Canvases
vector of all TCanvases
std::map< std::string, float > m_vars
map of all float variables
void print() const
Print content of MonitoringObject.
std::vector< std::pair< std::string, std::string > > m_strVars
map of all string variables
Abstract base class for different kinds of events.
STL namespace.