CondTools
L1TriggerExt
plugins
L1TriggerKeyOnlineProdExt.cc
Go to the documentation of this file.
1
#include "
FWCore/MessageLogger/interface/MessageLogger.h
"
2
3
#include "
CondTools/L1TriggerExt/plugins/L1TriggerKeyOnlineProdExt.h
"
4
5
#include "
CondTools/L1Trigger/interface/Exception.h
"
6
7
#include "
FWCore/Framework/interface/EventSetup.h
"
8
9
L1TriggerKeyOnlineProdExt::L1TriggerKeyOnlineProdExt
(
const
edm::ParameterSet
& iConfig) {
10
//the following line is needed to tell the framework what
11
// data is being produced
12
auto
cc
=
setWhatProduced
(
this
);
13
14
for
(
auto
const
&
label
: iConfig.
getParameter
<std::vector<std::string> >(
"subsystemLabels"
)) {
15
m_subsystemTokens
.emplace_back(
cc
.consumesFrom<
L1TriggerKeyExt
,
L1TriggerKeyExtRcd
>(
edm::ESInputTag
{
""
, label}));
16
17
//now do what ever other initialization is needed
18
}
19
20
cc
.setConsumes(
L1TriggerKeyExt_token
,
edm::ESInputTag
{
""
,
"SubsystemKeysOnly"
});
21
}
22
23
L1TriggerKeyOnlineProdExt::~L1TriggerKeyOnlineProdExt
() {
24
// do anything here that needs to be done at desctruction time
25
// (e.g. close files, deallocate resources etc.)
26
}
27
28
//
29
// member functions
30
//
31
32
// ------------ method called to produce the data ------------
33
L1TriggerKeyOnlineProdExt::ReturnType
L1TriggerKeyOnlineProdExt::produce
(
const
L1TriggerKeyExtRcd
& iRecord) {
34
// Start with "SubsystemKeysOnly"
35
L1TriggerKeyExt
subsystemKeys;
36
try
{
37
subsystemKeys = iRecord.
get
(
L1TriggerKeyExt_token
);
38
}
catch
(
l1t::DataAlreadyPresentException
& ex) {
39
throw
ex;
40
}
41
42
auto
pL1TriggerKey = std::make_unique<L1TriggerKeyExt>(subsystemKeys);
43
44
// Collate object keys
45
for
(
auto
const
&
token
:
m_subsystemTokens
) {
46
pL1TriggerKey->add(iRecord.
get
(
token
).recordToKeyMap());
47
}
48
49
return
pL1TriggerKey;
50
}
51
52
//define this as a plug-in
53
//DEFINE_FWK_EVENTSETUP_MODULE(L1TriggerKeyOnlineProdExt);
edm::ESInputTag
Definition:
ESInputTag.h:87
MessageLogger.h
Exception.h
L1TriggerKeyOnlineProdExt::L1TriggerKeyOnlineProdExt
L1TriggerKeyOnlineProdExt(const edm::ParameterSet &)
Definition:
L1TriggerKeyOnlineProdExt.cc:9
L1TriggerKeyExtRcd
Definition:
L1TriggerKeyExtRcd.h:8
edm::ESProducer::setWhatProduced
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition:
ESProducer.h:138
l1t::DataAlreadyPresentException
Definition:
Exception.h:32
L1TriggerKeyOnlineProdExt::~L1TriggerKeyOnlineProdExt
~L1TriggerKeyOnlineProdExt() override
Definition:
L1TriggerKeyOnlineProdExt.cc:23
L1TriggerKeyOnlineProdExt::produce
ReturnType produce(const L1TriggerKeyExtRcd &)
Definition:
L1TriggerKeyOnlineProdExt.cc:33
edm::eventsetup::DependentRecordImplementation::get
ProductT const & get(ESGetToken< ProductT, DepRecordT > const &iToken) const
Definition:
DependentRecordImplementation.h:112
L1TriggerKeyExt
Definition:
L1TriggerKeyExt.h:23
edm::ParameterSet
Definition:
ParameterSet.h:36
L1TriggerKeyOnlineProdExt::L1TriggerKeyExt_token
edm::ESGetToken< L1TriggerKeyExt, L1TriggerKeyExtRcd > L1TriggerKeyExt_token
Definition:
L1TriggerKeyOnlineProdExt.h:27
L1TriggerKeyOnlineProdExt::ReturnType
std::unique_ptr< L1TriggerKeyExt > ReturnType
Definition:
L1TriggerKeyOnlineProdExt.h:21
cc
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
EventSetup.h
L1TriggerKeyOnlineProdExt::m_subsystemTokens
std::vector< edm::ESGetToken< L1TriggerKeyExt, L1TriggerKeyExtRcd > > m_subsystemTokens
Definition:
L1TriggerKeyOnlineProdExt.h:28
L1TriggerKeyOnlineProdExt.h
label
const char * label
Definition:
PFTauDecayModeTools.cc:11
unpackBuffers-CaloStage2.token
token
Definition:
unpackBuffers-CaloStage2.py:316
Generated for CMSSW Reference Manual by
1.8.16