CondTools
DQM
plugins
DQMSummaryEventSetupAnalyzer.cc
Go to the documentation of this file.
1
#include "
FWCore/Framework/interface/EDAnalyzer.h
"
2
#include "
FWCore/Framework/interface/Event.h
"
3
#include "
FWCore/Framework/interface/EventSetup.h
"
4
#include "
FWCore/ParameterSet/interface/ParameterSet.h
"
5
#include "
FWCore/Framework/interface/ESHandle.h
"
6
#include "
FWCore/Utilities/interface/Exception.h
"
7
#include "
CondFormats/DQMObjects/interface/DQMSummary.h
"
8
#include "
CondFormats/DataRecord/interface/DQMSummaryRcd.h
"
9
#include "
FWCore/Framework/interface/MakerMacros.h
"
10
#include <iostream>
11
12
namespace
edmtest
{
13
class
DQMSummaryEventSetupAnalyzer
:
public
edm::EDAnalyzer
{
14
public
:
15
explicit
DQMSummaryEventSetupAnalyzer
(
const
edm::ParameterSet
&
pset
);
16
explicit
DQMSummaryEventSetupAnalyzer
(
int
i
);
17
~DQMSummaryEventSetupAnalyzer
()
override
;
18
void
analyze
(
const
edm::Event
&
event
,
const
edm::EventSetup
&
setup
)
override
;
19
};
20
21
DQMSummaryEventSetupAnalyzer::DQMSummaryEventSetupAnalyzer
(
const
edm::ParameterSet
&
pset
) {
22
std::cout
<<
"DQMSummaryEventSetupAnalyzer"
<< std::endl;
23
}
24
25
DQMSummaryEventSetupAnalyzer::DQMSummaryEventSetupAnalyzer
(
int
i
) {
26
std::cout
<<
"DQMSummaryEventSetupAnalyzer"
<<
i
<< std::endl;
27
}
28
29
DQMSummaryEventSetupAnalyzer::~DQMSummaryEventSetupAnalyzer
() {
30
std::cout
<<
"~DQMSummaryEventSetupAnalyzer"
<< std::endl;
31
}
32
33
void
DQMSummaryEventSetupAnalyzer::analyze
(
const
edm::Event
&
event
,
const
edm::EventSetup
&
setup
) {
34
std::cout
<<
"### DQMSummaryEventSetupAnalyzer::analyze"
<< std::endl;
35
std::cout
<<
"--- RUN NUMBER: "
<<
event
.id().run() << std::endl;
36
std::cout
<<
"--- EVENT NUMBER: "
<<
event
.id().event() << std::endl;
37
edm::eventsetup::EventSetupRecordKey
recordKey(
38
edm::eventsetup::EventSetupRecordKey::TypeTag::findType
(
"DQMSummaryRcd"
));
39
if
(recordKey.
type
() ==
edm::eventsetup::EventSetupRecordKey::TypeTag
()) {
40
throw
cms::Exception
(
"Record not found"
) <<
"Record \"DQMSummaryRcd"
41
<<
"\" does not exist!"
<< std::endl;
42
}
43
edm::ESHandle<DQMSummary>
sum;
44
std::cout
<<
"got EShandle"
<< std::endl;
45
setup
.get<
DQMSummaryRcd
>().
get
(sum);
46
std::cout
<<
"got the Event Setup"
<< std::endl;
47
const
DQMSummary
*
summary
= sum.
product
();
48
std::cout
<<
"got DQMSummary* "
<< std::endl;
49
std::cout
<<
"print result"
<< std::endl;
50
summary
->printAllValues();
51
}
52
53
DEFINE_FWK_MODULE
(
DQMSummaryEventSetupAnalyzer
);
54
}
// namespace edmtest
edm::ESHandle::product
T const * product() const
Definition:
ESHandle.h:86
edm::eventsetup::heterocontainer::HCTypeTag::findType
static HCTypeTag findType(char const *iTypeName)
find a type based on the types name, if not found will return default HCTypeTag
Definition:
HCTypeTag.cc:121
DQMSummaryRcd.h
mps_fire.i
i
Definition:
mps_fire.py:355
DQMSummary
Definition:
DQMSummary.h:19
ESHandle.h
edmtest
Definition:
AlignPCLThresholdsReader.cc:12
gather_cfg.cout
cout
Definition:
gather_cfg.py:144
EDAnalyzer.h
edm::eventsetup::EventSetupRecordKey
Definition:
EventSetupRecordKey.h:30
singleTopDQM_cfi.setup
setup
Definition:
singleTopDQM_cfi.py:37
edm::EDAnalyzer
Definition:
EDAnalyzer.h:29
DQMSummary.h
MakerMacros.h
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition:
MakerMacros.h:16
edm::ESHandle
Definition:
DTSurvey.h:22
edm::eventsetup::EventSetupRecordKey::TypeTag
heterocontainer::HCTypeTag TypeTag
Definition:
EventSetupRecordKey.h:32
edm::ParameterSet
Definition:
ParameterSet.h:36
Event.h
edm::eventsetup::EventSetupRecordKey::type
const TypeTag & type() const
Definition:
EventSetupRecordKey.h:40
edmLumisInFiles.summary
summary
Definition:
edmLumisInFiles.py:39
edm::EventSetup
Definition:
EventSetup.h:57
get
#define get
edmtest::DQMSummaryEventSetupAnalyzer::~DQMSummaryEventSetupAnalyzer
~DQMSummaryEventSetupAnalyzer() override
Definition:
DQMSummaryEventSetupAnalyzer.cc:29
Exception
Definition:
hltDiff.cc:246
EventSetup.h
Exception.h
ParameterSet.h
edmtest::DQMSummaryEventSetupAnalyzer
Definition:
DQMSummaryEventSetupAnalyzer.cc:13
event
Definition:
event.py:1
edm::Event
Definition:
Event.h:73
edmtest::DQMSummaryEventSetupAnalyzer::DQMSummaryEventSetupAnalyzer
DQMSummaryEventSetupAnalyzer(const edm::ParameterSet &pset)
Definition:
DQMSummaryEventSetupAnalyzer.cc:21
edmtest::DQMSummaryEventSetupAnalyzer::analyze
void analyze(const edm::Event &event, const edm::EventSetup &setup) override
Definition:
DQMSummaryEventSetupAnalyzer.cc:33
muonDTDigis_cfi.pset
pset
Definition:
muonDTDigis_cfi.py:27
DQMSummaryRcd
Definition:
DQMSummaryRcd.h:24
Generated for CMSSW Reference Manual by
1.8.16