DQMServices
Demo
plugins
DemoGlobalDQMEDAnalyzer.cc
Go to the documentation of this file.
1
// -*- C++ -*-
2
//
3
// Package: DQMServices/Demo
4
// Class: DemoGlobalDQMEDAnalyzer
5
//
13
//
14
// Original Author: Marcel Schneider
15
// Created: Wed, 22 May 2019 15:18:23 GMT
16
//
17
//
18
19
#include <string>
20
21
#include "
FWCore/Framework/interface/Frameworkfwd.h
"
22
#include "
DQMServices/Core/interface/DQMGlobalEDAnalyzer.h
"
23
24
#include "
FWCore/Framework/interface/Event.h
"
25
#include "
FWCore/Framework/interface/MakerMacros.h
"
26
#include "
FWCore/ParameterSet/interface/ParameterSet.h
"
27
28
struct
Histograms_Demo2
{
29
typedef
dqm::reco::MonitorElement
MonitorElement
;
30
MonitorElement
*
histo_
;
31
};
32
33
class
DemoGlobalDQMEDAnalyzer
:
public
DQMGlobalEDAnalyzer
<Histograms_Demo2> {
34
public
:
35
explicit
DemoGlobalDQMEDAnalyzer
(
const
edm::ParameterSet
&);
36
~DemoGlobalDQMEDAnalyzer
()
override
;
37
38
static
void
fillDescriptions
(
edm::ConfigurationDescriptions
& descriptions);
39
40
private
:
41
void
bookHistograms
(
DQMStore::IBooker
&,
edm::Run
const
&,
edm::EventSetup
const
&,
Histograms_Demo2
&)
const override
;
42
43
void
dqmAnalyze
(
edm::Event
const
&,
edm::EventSetup
const
&,
Histograms_Demo2
const
&)
const override
;
44
45
std::string
folder_
;
46
};
47
48
DemoGlobalDQMEDAnalyzer::DemoGlobalDQMEDAnalyzer
(
const
edm::ParameterSet
& iConfig)
49
:
folder_
(iConfig.getParameter<
std
::
string
>(
"folder"
)) {
50
// now do what ever initialization is needed
51
}
52
53
DemoGlobalDQMEDAnalyzer::~DemoGlobalDQMEDAnalyzer
() {
54
// do anything here that needs to be done at desctruction time
55
// (e.g. close files, deallocate resources etc.)
56
}
57
58
// ------------ method called for each event ------------
59
void
DemoGlobalDQMEDAnalyzer::dqmAnalyze
(
edm::Event
const
&
iEvent
,
60
edm::EventSetup
const
& iSetup,
61
Histograms_Demo2
const
&
histos
)
const
{
62
histos
.histo_->Fill(5);
63
}
64
65
void
DemoGlobalDQMEDAnalyzer::bookHistograms
(DQMStore::IBooker& ibook,
66
edm::Run
const
&
run
,
67
edm::EventSetup
const
& iSetup,
68
Histograms_Demo2
&
histos
)
const
{
69
ibook.setCurrentFolder(
folder_
);
70
histos
.histo_ = ibook.book1D(
"EXAMPLE"
,
"EXAMPLE"
, 10, 0., 10.);
71
}
72
73
// ------------ method fills 'descriptions' with the allowed parameters for the module ------------
74
void
DemoGlobalDQMEDAnalyzer::fillDescriptions
(
edm::ConfigurationDescriptions
& descriptions) {
75
edm::ParameterSetDescription
desc;
76
desc.
add
<
std::string
>(
"folder"
,
"MY_FOLDER"
);
77
descriptions.
add
(
"demo2"
, desc);
78
}
79
80
// define this as a plug-in
81
DEFINE_FWK_MODULE
(
DemoGlobalDQMEDAnalyzer
);
dqm::impl::MonitorElement
Definition:
MonitorElement.h:98
edm::ParameterSetDescription::add
ParameterDescriptionBase * add(U const &iLabel, T const &value)
Definition:
ParameterSetDescription.h:95
DemoGlobalDQMEDAnalyzer::~DemoGlobalDQMEDAnalyzer
~DemoGlobalDQMEDAnalyzer() override
Definition:
DemoGlobalDQMEDAnalyzer.cc:53
edm::Run
Definition:
Run.h:45
edm::ParameterSetDescription
Definition:
ParameterSetDescription.h:52
Histograms_Demo2::histo_
MonitorElement * histo_
Definition:
DemoGlobalDQMEDAnalyzer.cc:30
dqm::legacy::DQMStore::IBooker
dqm::implementation::IBooker IBooker
Definition:
DQMStore.h:729
MakerMacros.h
DemoGlobalDQMEDAnalyzer::folder_
std::string folder_
Definition:
DemoGlobalDQMEDAnalyzer.cc:45
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition:
MakerMacros.h:16
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition:
ConfigurationDescriptions.cc:57
DemoGlobalDQMEDAnalyzer::dqmAnalyze
void dqmAnalyze(edm::Event const &, edm::EventSetup const &, Histograms_Demo2 const &) const override
Definition:
DemoGlobalDQMEDAnalyzer.cc:59
Histograms_Demo2::MonitorElement
dqm::reco::MonitorElement MonitorElement
Definition:
DemoGlobalDQMEDAnalyzer.cc:29
edm::ConfigurationDescriptions
Definition:
ConfigurationDescriptions.h:28
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:256
folder_
std::string folder_
Definition:
DQMEDAnalyzer.cc:60
edm::ParameterSet
Definition:
ParameterSet.h:36
Event.h
DemoGlobalDQMEDAnalyzer
Definition:
DemoGlobalDQMEDAnalyzer.cc:33
DemoGlobalDQMEDAnalyzer::bookHistograms
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &, Histograms_Demo2 &) const override
Definition:
DemoGlobalDQMEDAnalyzer.cc:65
iEvent
int iEvent
Definition:
GenABIO.cc:224
edm::EventSetup
Definition:
EventSetup.h:57
combine.histos
histos
Definition:
combine.py:4
std
Definition:
JetResolutionObject.h:76
writedatasetfile.run
run
Definition:
writedatasetfile.py:27
Frameworkfwd.h
DemoGlobalDQMEDAnalyzer::DemoGlobalDQMEDAnalyzer
DemoGlobalDQMEDAnalyzer(const edm::ParameterSet &)
Definition:
DemoGlobalDQMEDAnalyzer.cc:48
DemoGlobalDQMEDAnalyzer::fillDescriptions
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
Definition:
DemoGlobalDQMEDAnalyzer.cc:74
Histograms_Demo2
Definition:
DemoGlobalDQMEDAnalyzer.cc:28
DQMGlobalEDAnalyzer
Definition:
DQMGlobalEDAnalyzer.h:13
ParameterSet.h
edm::Event
Definition:
Event.h:73
DQMGlobalEDAnalyzer.h
Generated for CMSSW Reference Manual by
1.8.16