DPGAnalysis
Skims
src
HLTInspect.cc
Go to the documentation of this file.
1
// -*- C++ -*-
2
//
3
// Package: BeamSplash
4
// Class: BeamSPlash
5
//
6
//
7
// Original Author: Luca Malgeri
8
9
#include <memory>
10
#include <vector>
11
#include <map>
12
#include <set>
13
14
// user include files
15
#include "
DPGAnalysis/Skims/interface/HLTInspect.h
"
16
17
#include "
FWCore/Utilities/interface/InputTag.h
"
18
#include "
FWCore/Framework/interface/Frameworkfwd.h
"
19
#include "
FWCore/Framework/interface/EDFilter.h
"
20
#include "
FWCore/Framework/interface/Event.h
"
21
#include "
FWCore/Framework/interface/MakerMacros.h
"
22
#include "
FWCore/ParameterSet/interface/ParameterSet.h
"
23
#include "
FWCore/Framework/interface/ESHandle.h
"
24
#include "
FWCore/MessageLogger/interface/MessageLogger.h
"
25
#include "
DataFormats/L1GlobalTrigger/interface/L1GtFdlWord.h
"
26
#include "
DataFormats/L1GlobalTrigger/interface/L1GlobalTriggerReadoutRecord.h
"
27
#include "
DataFormats/Common/interface/TriggerResults.h
"
28
#include "
FWCore/Common/interface/TriggerNames.h
"
29
30
using namespace
edm
;
31
using namespace
std
;
32
33
HLTInspect::HLTInspect
(
const
edm::ParameterSet
& iConfig) {
34
hlTriggerResults_ = iConfig.
getParameter
<
edm::InputTag
>(
"HLTriggerResults"
);
35
init_ =
false
;
36
}
37
38
HLTInspect::~HLTInspect
() {}
39
void
HLTInspect::analyze
(
const
edm::Event
&
iEvent
,
const
edm::EventSetup
&
c
) {
40
int
ievt =
iEvent
.id().event();
41
int
irun =
iEvent
.id().run();
42
int
ils =
iEvent
.luminosityBlock();
43
int
bx
=
iEvent
.bunchCrossing();
44
//
45
// trigger type
46
//
47
int
trigger_type = -1;
48
if
(
iEvent
.isRealData())
49
trigger_type =
iEvent
.experimentType();
50
51
//hlt info
52
edm::Handle<TriggerResults>
HLTR;
53
iEvent
.getByLabel(hlTriggerResults_, HLTR);
54
55
if
(HLTR.
isValid
() ==
false
) {
56
std::cout
<<
" HLTInspect Error - Could not access Results with name "
<< hlTriggerResults_ << std::endl;
57
}
58
if
(HLTR.
isValid
()) {
59
if
(!init_) {
60
init_ =
true
;
61
const
edm::TriggerNames
&
triggerNames
=
iEvent
.triggerNames(*HLTR);
62
hlNames_ =
triggerNames
.triggerNames();
63
}
64
std::cout
<<
"HLTInspect: Run "
<< irun <<
" Ev "
<< ievt <<
" LB "
<< ils <<
" BX "
<<
bx
<<
" Type "
65
<< trigger_type <<
" Acc: "
;
66
const
unsigned
int
n
(hlNames_.size());
67
for
(
unsigned
int
i
= 0;
i
!=
n
; ++
i
) {
68
if
(HLTR->
accept
(
i
)) {
69
std::cout
<< hlNames_[
i
] <<
","
;
70
}
71
}
72
std::cout
<< std::endl;
73
}
74
}
75
//define this as a plug-in
76
DEFINE_FWK_MODULE
(
HLTInspect
);
mps_fire.i
i
Definition:
mps_fire.py:355
MessageLogger.h
dqmiodumpmetadata.n
n
Definition:
dqmiodumpmetadata.py:28
ESHandle.h
TriggerResults.h
edm
HLT enums.
Definition:
AlignableModifier.h:19
gather_cfg.cout
cout
Definition:
gather_cfg.py:144
l1GtPatternGenerator_cfi.bx
bx
Definition:
l1GtPatternGenerator_cfi.py:18
EDFilter.h
HLTInspect.h
HLTInspect::~HLTInspect
~HLTInspect() override
Definition:
HLTInspect.cc:38
edm::Handle
Definition:
AssociativeIterator.h:50
HLTInspect::analyze
void analyze(const edm::Event &e, const edm::EventSetup &c) override
Definition:
HLTInspect.cc:39
MakerMacros.h
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition:
MakerMacros.h:16
L1TEGammaOffline_cfi.triggerNames
triggerNames
Definition:
L1TEGammaOffline_cfi.py:40
L1GtFdlWord.h
edm::ParameterSet
Definition:
ParameterSet.h:36
Event.h
TriggerNames.h
iEvent
int iEvent
Definition:
GenABIO.cc:224
edm::EventSetup
Definition:
EventSetup.h:57
HltBtagPostValidation_cff.c
c
Definition:
HltBtagPostValidation_cff.py:31
InputTag.h
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
HLTInspect
Definition:
HLTInspect.h:31
std
Definition:
JetResolutionObject.h:76
Frameworkfwd.h
edm::TriggerNames
Definition:
TriggerNames.h:55
HLTInspect::HLTInspect
HLTInspect(const edm::ParameterSet &)
Definition:
HLTInspect.cc:33
edm::HLTGlobalStatus::accept
bool accept() const
Has at least one path accepted the event?
Definition:
HLTGlobalStatus.h:49
ParameterSet.h
edm::HandleBase::isValid
bool isValid() const
Definition:
HandleBase.h:70
edm::Event
Definition:
Event.h:73
edm::InputTag
Definition:
InputTag.h:15
L1GlobalTriggerReadoutRecord.h
Generated for CMSSW Reference Manual by
1.8.16