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
15using namespace std;
16using namespace Belle2;
17
19{
20
21 KeyValuePrinter printVar(false);
22 printVar.put("Name", GetName());
23 for (const auto& var : m_vars) {
24 printVar.put(var.first, var.second);
25 }
26 for (const auto& var : m_strVars) {
27 printVar.put(var.first, var.second);
28 }
29
30 KeyValuePrinter printCanv(false);
31 for (const auto& canv : m_Canvases) {
32 printCanv.put(canv->GetName(), canv->GetTitle());
33 }
34
35 std::cout << "=== MonitoringObject ===\n";
36 std::cout << printVar.string();
37 std::cout << "\n List of canvases: \n";
38 std::cout << printCanv.string();
39 std::cout << "========================\n";
40}
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.