DQMServices
StreamerIO
plugins
DQMMonitoringService.h
Go to the documentation of this file.
1
#ifndef DQMServices_StreamerIO_DQMMonitoringService_h
2
#define DQMServices_StreamerIO_DQMMonitoringService_h
3
4
#include "
FWCore/ParameterSet/interface/ParameterSet.h
"
5
#include "
FWCore/ServiceRegistry/interface/ActivityRegistry.h
"
6
#include "
DataFormats/Provenance/interface/EventID.h
"
7
#include "
DataFormats/Provenance/interface/LuminosityBlockID.h
"
8
#include "
DataFormats/Provenance/interface/Timestamp.h
"
9
#include "
DataFormats/Provenance/interface/ModuleDescription.h
"
10
#include "
DataFormats/Provenance/interface/ParameterSetID.h
"
11
#include "
FWCore/MessageLogger/interface/MessageLogger.h
"
12
#include "
FWCore/ServiceRegistry/interface/StreamContext.h
"
13
#include "
FWCore/ServiceRegistry/interface/GlobalContext.h
"
14
#include "
FWCore/Utilities/interface/StreamID.h
"
15
#include <filesystem>
16
17
#include <string>
18
#include <vector>
19
#include <map>
20
#include <queue>
21
#include <sstream>
22
#include <chrono>
23
#include <unordered_map>
24
25
#include <filesystem>
26
#include <boost/format.hpp>
27
#include <boost/property_tree/json_parser.hpp>
28
#include <boost/property_tree/ptree.hpp>
29
#include <boost/asio.hpp>
30
31
/*
32
* This service is very similar to the FastMonitoringService in the HLT,
33
* except that it is used for monitoring online DQM applications
34
*/
35
36
namespace
dqmservices
{
37
38
using
boost::property_tree::ptree;
39
40
using
edm::GlobalContext
;
41
using
edm::StreamContext
;
42
using
edm::StreamID
;
43
44
class
DQMMonitoringService
{
45
public
:
46
DQMMonitoringService
(
const
edm::ParameterSet
&,
edm::ActivityRegistry
&);
47
~DQMMonitoringService
();
48
49
void
connect
();
50
void
keepAlive
();
51
52
void
outputLumiUpdate
();
53
void
outputUpdate
(ptree&
doc
);
54
55
void
evLumi
(
GlobalContext
const
&);
56
void
evEvent
(
StreamID
const
&);
57
58
void
tryUpdate
();
59
60
private
:
61
boost::asio::local::stream_protocol::iostream
mstream_
;
62
63
// global number of events processed
64
long
nevents_
;
65
66
// time point, number of events and the lumi number at the time we switched to
67
// it
68
unsigned
long
last_lumi_
;
// last lumi (we report stats for it, after we
69
// switch to the next one)
70
std::chrono::high_resolution_clock::time_point
last_lumi_time_
;
71
std::chrono::high_resolution_clock::time_point
last_update_time_
;
72
long
last_lumi_nevents_
;
73
74
unsigned
long
run_
;
// current run
75
unsigned
long
lumi_
;
// current lumi
76
};
77
78
}
// namespace dqmservices
79
80
#endif
edm::StreamID
Definition:
StreamID.h:30
dqmservices::DQMMonitoringService::outputUpdate
void outputUpdate(ptree &doc)
Definition:
DQMMonitoringService.cc:105
MessageLogger.h
dqmservices
Definition:
DQMFileIterator.cc:18
dqmservices::DQMMonitoringService::keepAlive
void keepAlive()
Definition:
DQMMonitoringService.cc:123
boostedTaus_cff.doc
doc
Definition:
boostedTaus_cff.py:20
dqmservices::DQMMonitoringService::last_lumi_
unsigned long last_lumi_
Definition:
DQMMonitoringService.h:68
dqmservices::DQMMonitoringService::lumi_
unsigned long lumi_
Definition:
DQMMonitoringService.h:75
dqmservices::DQMMonitoringService::last_lumi_nevents_
long last_lumi_nevents_
Definition:
DQMMonitoringService.h:72
LuminosityBlockID.h
dqmservices::DQMMonitoringService::run_
unsigned long run_
Definition:
DQMMonitoringService.h:74
ModuleDescription.h
ActivityRegistry.h
edm::StreamContext
Definition:
StreamContext.h:31
dqmservices::DQMMonitoringService::outputLumiUpdate
void outputLumiUpdate()
Definition:
DQMMonitoringService.cc:43
EventID.h
edm::ActivityRegistry
Definition:
ActivityRegistry.h:134
dqmservices::DQMMonitoringService::evEvent
void evEvent(StreamID const &)
Definition:
DQMMonitoringService.cc:100
edm::GlobalContext
Definition:
GlobalContext.h:29
dqmservices::DQMMonitoringService::~DQMMonitoringService
~DQMMonitoringService()
Definition:
DQMMonitoringService.cc:41
edm::ParameterSet
Definition:
ParameterSet.h:47
GlobalContext.h
Timestamp.h
dqmservices::DQMMonitoringService::mstream_
boost::asio::local::stream_protocol::iostream mstream_
Definition:
DQMMonitoringService.h:61
dqmservices::DQMMonitoringService::DQMMonitoringService
DQMMonitoringService(const edm::ParameterSet &, edm::ActivityRegistry &)
Definition:
DQMMonitoringService.cc:18
dqmservices::DQMMonitoringService::last_lumi_time_
std::chrono::high_resolution_clock::time_point last_lumi_time_
Definition:
DQMMonitoringService.h:70
ParameterSetID.h
dqmservices::DQMMonitoringService::nevents_
long nevents_
Definition:
DQMMonitoringService.h:64
ParameterSet.h
dqmservices::DQMMonitoringService::evLumi
void evLumi(GlobalContext const &)
Definition:
DQMMonitoringService.cc:84
StreamContext.h
dqmservices::DQMMonitoringService::last_update_time_
std::chrono::high_resolution_clock::time_point last_update_time_
Definition:
DQMMonitoringService.h:71
StreamID.h
dqmservices::DQMMonitoringService::connect
void connect()
dqmservices::DQMMonitoringService
Definition:
DQMMonitoringService.h:44
dqmservices::DQMMonitoringService::tryUpdate
void tryUpdate()
Definition:
DQMMonitoringService.cc:133
Generated for CMSSW Reference Manual by
1.8.16