Belle II Software  release-05-02-19
MonitoringObject.cc
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2010-2015 - Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Luka Santelj *
7  * *
8  * This software is provided "as is" without any warranty. *
9  **************************************************************************/
10 
11 #include <dqm/dataobjects/MonitoringObject.h>
12 
13 #include <framework/utilities/KeyValuePrinter.h>
14 
15 #include <iostream>
16 #include <sstream>
17 
18 using namespace std;
19 using namespace Belle2;
20 
21 void MonitoringObject::print() const
22 {
23 
24  KeyValuePrinter printVar(false);
25  printVar.put("Name", GetName());
26  for (const auto& var : m_vars) {
27  printVar.put(var.first, var.second);
28  }
29  for (const auto& var : m_strVars) {
30  printVar.put(var.first, var.second);
31  }
32 
33  KeyValuePrinter printCanv(false);
34  for (const auto& canv : m_Canvases) {
35  printCanv.put(canv->GetName(), canv->GetTitle());
36  }
37 
38  std::cout << "=== MonitoringObject ===\n";
39  std::cout << printVar.string();
40  std::cout << "\n List of canvases: \n";
41  std::cout << printCanv.string();
42  std::cout << "========================\n";
43 }
Belle2::KeyValuePrinter
create human-readable or JSON output for key value pairs.
Definition: KeyValuePrinter.h:56
Belle2::KeyValuePrinter::put
void put(const std::string &key, const T &value)
Add one key-value pair.
Definition: KeyValuePrinter.h:79
Belle2::KeyValuePrinter::string
std::string string() const
Return completed string.
Definition: KeyValuePrinter.h:71
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19