CondTools
L1TriggerExt
src
L1ObjectKeysOnlineProdBaseExt.cc
Go to the documentation of this file.
1
#include "
CondTools/L1TriggerExt/interface/L1ObjectKeysOnlineProdBaseExt.h
"
2
3
#include "
CondTools/L1Trigger/interface/Exception.h
"
4
5
#include "
FWCore/Framework/interface/EventSetup.h
"
6
7
L1ObjectKeysOnlineProdBaseExt::L1ObjectKeysOnlineProdBaseExt
(
const
edm::ParameterSet
& iConfig)
8
: m_omdsReader(iConfig.getParameter<
std
::
string
>(
"onlineDB"
),
9
iConfig.getParameter<
std
::
string
>(
"onlineAuthentication"
)) {
10
//the following line is needed to tell the framework what
11
// data is being produced
12
13
// The subsystemLabel is used by L1TriggerKeyOnlineProdExt to identify the
14
// L1TriggerKeysExt to concatenate.
15
setWhatProduced
(
this
, iConfig.
getParameter
<
std::string
>(
"subsystemLabel"
))
16
.setConsumes(
L1TriggerKeyExt_token
,
edm::ESInputTag
{
""
,
"SubsystemKeysOnly"
});
17
18
//now do what ever other initialization is needed
19
}
20
21
L1ObjectKeysOnlineProdBaseExt::~L1ObjectKeysOnlineProdBaseExt
() {
22
// do anything here that needs to be done at desctruction time
23
// (e.g. close files, deallocate resources etc.)
24
}
25
26
// ------------ method called to produce the data ------------
27
L1ObjectKeysOnlineProdBaseExt::ReturnType
L1ObjectKeysOnlineProdBaseExt::produce
(
const
L1TriggerKeyExtRcd
& iRecord) {
28
// Get L1TriggerKeyExt with label "SubsystemKeysOnly". Re-throw exception if
29
// not present.
30
L1TriggerKeyExt
subsystemKeys;
31
try
{
32
subsystemKeys = iRecord.
get
(
L1TriggerKeyExt_token
);
33
}
catch
(
l1t::DataAlreadyPresentException
& ex) {
34
throw
ex;
35
}
36
37
// Copy L1TriggerKeyExt to new object.
38
auto
pL1TriggerKey = std::make_unique<L1TriggerKeyExt>(subsystemKeys);
39
40
// Get object keys.
41
fillObjectKeys
(pL1TriggerKey.get());
42
43
return
pL1TriggerKey;
44
}
45
46
//define this as a plug-in
47
//DEFINE_FWK_EVENTSETUP_MODULE(L1ObjectKeysOnlineProdBaseExt);
L1ObjectKeysOnlineProdBaseExt::fillObjectKeys
virtual void fillObjectKeys(L1TriggerKeyExt *pL1TriggerKey)=0
edm::ESInputTag
Definition:
ESInputTag.h:87
Exception.h
L1ObjectKeysOnlineProdBaseExt::produce
ReturnType produce(const L1TriggerKeyExtRcd &)
Definition:
L1ObjectKeysOnlineProdBaseExt.cc:27
L1ObjectKeysOnlineProdBaseExt::~L1ObjectKeysOnlineProdBaseExt
~L1ObjectKeysOnlineProdBaseExt() override
Definition:
L1ObjectKeysOnlineProdBaseExt.cc:21
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
L1ObjectKeysOnlineProdBaseExt::ReturnType
std::unique_ptr< L1TriggerKeyExt > ReturnType
Definition:
L1ObjectKeysOnlineProdBaseExt.h:24
edm::eventsetup::DependentRecordImplementation::get
ProductT const & get(ESGetToken< ProductT, DepRecordT > const &iToken) const
Definition:
DependentRecordImplementation.h:112
L1TriggerKeyExt
Definition:
L1TriggerKeyExt.h:23
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:256
edm::ParameterSet
Definition:
ParameterSet.h:36
L1ObjectKeysOnlineProdBaseExt::L1ObjectKeysOnlineProdBaseExt
L1ObjectKeysOnlineProdBaseExt(const edm::ParameterSet &)
Definition:
L1ObjectKeysOnlineProdBaseExt.cc:7
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
L1ObjectKeysOnlineProdBaseExt::L1TriggerKeyExt_token
edm::ESGetToken< L1TriggerKeyExt, L1TriggerKeyExtRcd > L1TriggerKeyExt_token
Definition:
L1ObjectKeysOnlineProdBaseExt.h:32
std
Definition:
JetResolutionObject.h:76
L1ObjectKeysOnlineProdBaseExt.h
EventSetup.h
Generated for CMSSW Reference Manual by
1.8.16