DQMOffline
Trigger
plugins
EventShapeDQM.cc
Go to the documentation of this file.
1
#include "
FWCore/MessageLogger/interface/MessageLogger.h
"
2
#include "
FWCore/Framework/interface/Frameworkfwd.h
"
3
#include "
FWCore/Framework/interface/MakerMacros.h
"
4
#include "
FWCore/Common/interface/TriggerNames.h
"
5
#include "
DataFormats/HLTReco/interface/TriggerObject.h
"
6
#include "
DQMOffline/Trigger/interface/EventShapeDQM.h
"
7
8
EventShapeDQM::EventShapeDQM
(
const
edm::ParameterSet
& ps) {
9
triggerResults_
= consumes<edm::TriggerResults>(ps.
getParameter
<
edm::InputTag
>(
"triggerResults"
));
10
theEPCollection_
= consumes<reco::EvtPlaneCollection>(ps.
getParameter
<
edm::InputTag
>(
"EPlabel"
));
11
triggerPath_
= ps.
getParameter
<
std::string
>(
"triggerPath"
);
12
13
order_
= ps.
getParameter
<
int
>(
"order"
);
14
EPidx_
= ps.
getParameter
<
int
>(
"EPidx"
);
15
EPlvl_
= ps.
getParameter
<
int
>(
"EPlvl"
);
16
}
17
18
EventShapeDQM::~EventShapeDQM
() =
default
;
19
20
void
EventShapeDQM::bookHistograms
(
DQMStore::IBooker
& ibooker_,
edm::Run
const
&,
edm::EventSetup
const
&) {
21
ibooker_.
cd
();
22
;
23
ibooker_.
setCurrentFolder
(
"HLT/HI/"
+
triggerPath_
);
24
25
h_Q
= ibooker_.
book1D
(
"hQn"
, Form(
"Q%i;Q%i"
,
order_
,
order_
), 500, 0, 0.5);
26
27
ibooker_.
cd
();
28
}
29
30
void
EventShapeDQM::analyze
(
edm::Event
const
&
e
,
edm::EventSetup
const
& eSetup) {
31
edm::Handle<edm::TriggerResults>
hltresults
;
32
e
.getByToken(
triggerResults_
,
hltresults
);
33
if
(!
hltresults
.isValid()) {
34
return
;
35
}
36
37
bool
hasFired =
false
;
38
const
edm::TriggerNames
&
trigNames
=
e
.triggerNames(*
hltresults
);
39
unsigned
int
numTriggers =
trigNames
.size();
40
for
(
unsigned
int
hltIndex = 0; hltIndex < numTriggers; ++hltIndex) {
41
if
(
trigNames
.triggerName(hltIndex).find(
triggerPath_
) != std::string::npos &&
hltresults
->wasrun(hltIndex) &&
42
hltresults
->accept(hltIndex)) {
43
hasFired =
true
;
44
}
45
}
46
47
edm::Handle<reco::EvtPlaneCollection>
ep_;
48
e
.getByToken(
theEPCollection_
, ep_);
49
if
(!ep_.
isValid
()) {
50
return
;
51
}
52
53
if
(hasFired) {
54
h_Q
->
Fill
((*ep_)[
EPidx_
].vn(
EPlvl_
));
55
}
56
}
57
58
DEFINE_FWK_MODULE
(
EventShapeDQM
);
EventShapeDQM::analyze
void analyze(edm::Event const &e, edm::EventSetup const &eSetup) override
Definition:
EventShapeDQM.cc:30
EventShapeDQM::triggerResults_
edm::EDGetTokenT< edm::TriggerResults > triggerResults_
Definition:
EventShapeDQM.h:32
MessageLogger.h
trigNames
static const char *const trigNames[]
Definition:
EcalDumpRaw.cc:57
HLTBitAnalyser_cfi.hltresults
hltresults
Definition:
HLTBitAnalyser_cfi.py:13
edm::Run
Definition:
Run.h:45
EventShapeDQM::EPidx_
int EPidx_
Definition:
EventShapeDQM.h:37
dqm::implementation::NavigatorBase::setCurrentFolder
virtual void setCurrentFolder(std::string const &fullpath)
Definition:
DQMStore.cc:32
EventShapeDQM::EPlvl_
int EPlvl_
Definition:
EventShapeDQM.h:38
EventShapeDQM::theEPCollection_
edm::EDGetTokenT< reco::EvtPlaneCollection > theEPCollection_
Definition:
EventShapeDQM.h:33
edm::Handle< edm::TriggerResults >
MakerMacros.h
EventShapeDQM::order_
int order_
Definition:
EventShapeDQM.h:36
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition:
MakerMacros.h:16
EventShapeDQM::EventShapeDQM
EventShapeDQM(const edm::ParameterSet &ps)
Definition:
EventShapeDQM.cc:8
dqm::impl::MonitorElement::Fill
void Fill(long long x)
Definition:
MonitorElement.h:290
dqm::implementation::NavigatorBase::cd
virtual void cd()
Definition:
DQMStore.cc:29
EventShapeDQM::~EventShapeDQM
~EventShapeDQM() override
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:256
edm::ParameterSet
Definition:
ParameterSet.h:47
TriggerNames.h
EventShapeDQM
Definition:
EventShapeDQM.h:22
edm::EventSetup
Definition:
EventSetup.h:57
TriggerObject.h
EventShapeDQM::h_Q
MonitorElement * h_Q
Definition:
EventShapeDQM.h:41
EventShapeDQM.h
Frameworkfwd.h
edm::TriggerNames
Definition:
TriggerNames.h:55
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition:
ParameterSet.h:303
dqm::implementation::IBooker
Definition:
DQMStore.h:43
EventShapeDQM::bookHistograms
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
Definition:
EventShapeDQM.cc:20
edm::HandleBase::isValid
bool isValid() const
Definition:
HandleBase.h:70
edm::Event
Definition:
Event.h:73
EventShapeDQM::triggerPath_
std::string triggerPath_
Definition:
EventShapeDQM.h:35
edm::InputTag
Definition:
InputTag.h:15
dqm::implementation::IBooker::book1D
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition:
DQMStore.h:98
MillePedeFileConverter_cfg.e
e
Definition:
MillePedeFileConverter_cfg.py:37
Generated for CMSSW Reference Manual by
1.8.16