Belle II Software  release-08-01-10
DQMFileMetaData.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/dataobjects/DQMFileMetaData.h>
10 
11 
12 #include <framework/utilities/HTML.h>
13 #include <framework/utilities/KeyValuePrinter.h>
14 
15 //#include <nlohmann/json.hpp>
16 
17 #include <iostream>
18 
19 using namespace std;
20 using namespace Belle2;
21 
22 DQMFileMetaData::DQMFileMetaData() :
23  m_nEvents(0), m_experiment(0), m_run(0), m_date(""), m_release(""), m_procID(""), m_rtype(""), m_isMC(false),
24  m_databaseGlobalTag("")
25 {
26 }
27 
28 
29 void DQMFileMetaData::Print(Option_t* option) const
30 {
31 
32  const bool all = (option && option == std::string("all"));
33  KeyValuePrinter printer(false);
34  printer.put("nEvents", m_nEvents);
35  printer.put("Experiment", m_experiment);
36  printer.put("Run", m_run);
37 
38  if (all) {
39  printer.put("run type", m_rtype);
40  printer.put("run date", m_date);
41  printer.put("processing", m_procID);
42  printer.put("release", m_release);
43  printer.put("isMC", m_isMC);
44  printer.put("globalTag", m_databaseGlobalTag);
45  }
46  std::cout << "=== DQMFileMetaData ===\n";
47  std::cout << printer.string();
48  std::cout << "=======================\n";
49 }
virtual void Print(Option_t *option="") const override
Print the content of the meta data object.
std::string m_databaseGlobalTag
Global tag in the database used for production of this file.
unsigned int m_nEvents
Number of events.
bool m_isMC
Is it generated or real data?.
std::string m_rtype
run type (physics, cosmics, etc.)
std::string m_procID
processing ID
std::string m_release
Software release version.
std::string m_date
run date and time (UTC).
int m_experiment
experiment number.
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.
Abstract base class for different kinds of events.