DQMOffline
Trigger
plugins
HLTDQMObjSelector.cc
Go to the documentation of this file.
1
#include "
FWCore/Utilities/interface/EDGetToken.h
"
2
#include "
FWCore/ParameterSet/interface/ParameterSet.h
"
3
#include "
FWCore/ParameterSet/interface/ParameterSetDescription.h
"
4
#include "
FWCore/ParameterSet/interface/ConfigurationDescriptions.h
"
5
#include "
FWCore/Framework/interface/Event.h
"
6
#include "
FWCore/Framework/interface/EventSetup.h
"
7
#include "
FWCore/Framework/interface/stream/EDProducer.h
"
8
#include "
CommonTools/Utils/interface/StringCutObjectSelector.h
"
9
#include "
DataFormats/Common/interface/ValueMap.h
"
10
11
template
<
typename
ObjType,
typename
ObjCollType>
12
class
HLTDQMObjSelector
:
public
edm::stream::EDProducer
<> {
13
public
:
14
explicit
HLTDQMObjSelector
(
const
edm::ParameterSet
&
config
);
15
void
produce
(
edm::Event
&,
edm::EventSetup
const
&)
override
;
16
static
void
fillDescriptions
(
edm::ConfigurationDescriptions
& descriptions);
17
18
private
:
19
edm::EDGetTokenT<ObjCollType>
token_
;
20
StringCutObjectSelector<ObjType, true>
selection_
;
21
};
22
23
template
<
typename
ObjType,
typename
ObjCollType>
24
HLTDQMObjSelector<ObjType, ObjCollType>::HLTDQMObjSelector
(
const
edm::ParameterSet
&
config
)
25
: token_(consumes<ObjCollType>(
config
.getParameter<
edm
::
InputTag
>(
"objs"
))),
26
selection_(
config
.getParameter<
std
::
string
>(
"selection"
)) {
27
produces<edm::ValueMap<bool> >();
28
}
29
30
template
<
typename
ObjType,
typename
ObjCollType>
31
void
HLTDQMObjSelector<ObjType, ObjCollType>::fillDescriptions
(
edm::ConfigurationDescriptions
& descriptions) {
32
edm::ParameterSetDescription
desc;
33
desc.
add
<
edm::InputTag
>(
"objs"
,
edm::InputTag
(
""
));
34
desc.
add
<
std::string
>(
"selection"
,
"et > 5"
);
35
descriptions.
add
(
"hltDQMObjSelector"
, desc);
36
}
37
38
template
<
typename
ObjType,
typename
ObjCollType>
39
void
HLTDQMObjSelector<ObjType, ObjCollType>::produce
(
edm::Event
&
event
,
const
edm::EventSetup
&
setup
) {
40
edm::Handle<ObjCollType>
handle
;
41
event
.getByToken(token_,
handle
);
42
43
if
(!
handle
.isValid())
44
return
;
45
46
std::vector<bool> selResults;
47
for
(
auto
&
obj
: *
handle
) {
48
selResults.push_back(selection_(
obj
));
49
}
50
auto
valMap = std::make_unique<edm::ValueMap<bool> >();
51
edm::ValueMap<bool>::Filler
filler
(*valMap);
52
filler
.insert(
handle
, selResults.begin(), selResults.end());
53
filler
.fill();
54
event
.put(
std::move
(valMap));
55
}
56
57
#include "
FWCore/Framework/interface/MakerMacros.h
"
58
#include "
DataFormats/EgammaCandidates/interface/GsfElectron.h
"
59
#include "
DataFormats/EgammaCandidates/interface/GsfElectronFwd.h
"
60
using
HLTDQMGsfEleSelector
=
HLTDQMObjSelector<reco::GsfElectron, reco::GsfElectronCollection>
;
61
DEFINE_FWK_MODULE
(
HLTDQMGsfEleSelector
);
ConfigurationDescriptions.h
edm::ParameterSetDescription::add
ParameterDescriptionBase * add(U const &iLabel, T const &value)
Definition:
ParameterSetDescription.h:95
patZpeak.handle
handle
Definition:
patZpeak.py:23
edm::EDGetTokenT< ObjCollType >
edm
HLT enums.
Definition:
AlignableModifier.h:19
edm::ParameterSetDescription
Definition:
ParameterSetDescription.h:52
HLTDQMObjSelector
Definition:
HLTDQMObjSelector.cc:12
EDProducer.h
HLTDQMObjSelector::fillDescriptions
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
Definition:
HLTDQMObjSelector.cc:31
edm::Handle
Definition:
AssociativeIterator.h:50
singleTopDQM_cfi.setup
setup
Definition:
singleTopDQM_cfi.py:37
config
Definition:
config.py:1
MakerMacros.h
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
ParameterSetDescription.h
GsfElectron.h
EDGetToken.h
getGTfromDQMFile.obj
obj
Definition:
getGTfromDQMFile.py:32
edm::ConfigurationDescriptions
Definition:
ConfigurationDescriptions.h:28
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:256
GsfElectronFwd.h
HLT_2018_cff.InputTag
InputTag
Definition:
HLT_2018_cff.py:79016
edm::ParameterSet
Definition:
ParameterSet.h:36
Event.h
trigObjTnPSource_cfi.filler
filler
Definition:
trigObjTnPSource_cfi.py:21
edm::stream::EDProducer
Definition:
EDProducer.h:38
edm::EventSetup
Definition:
EventSetup.h:57
HLTDQMObjSelector::selection_
StringCutObjectSelector< ObjType, true > selection_
Definition:
HLTDQMObjSelector.cc:20
ValueMap.h
eostools.move
def move(src, dest)
Definition:
eostools.py:511
std
Definition:
JetResolutionObject.h:76
StringCutObjectSelector.h
StringCutObjectSelector< ObjType, true >
EventSetup.h
edm::helper::Filler
Definition:
ValueMap.h:22
HLTDQMObjSelector::HLTDQMObjSelector
HLTDQMObjSelector(const edm::ParameterSet &config)
Definition:
HLTDQMObjSelector.cc:24
ParameterSet.h
event
Definition:
event.py:1
edm::Event
Definition:
Event.h:73
HLTDQMObjSelector::produce
void produce(edm::Event &, edm::EventSetup const &) override
Definition:
HLTDQMObjSelector.cc:39
edm::InputTag
Definition:
InputTag.h:15
HLTDQMObjSelector::token_
edm::EDGetTokenT< ObjCollType > token_
Definition:
HLTDQMObjSelector.cc:19
Generated for CMSSW Reference Manual by
1.8.16