CMS 3D CMS Logo

L1TriggerKeyOnlineProdExt.cc
Go to the documentation of this file.
2 
4 
6 
8 
10  : m_subsystemLabels(iConfig.getParameter<std::vector<std::string> >("subsystemLabels")) {
11  //the following line is needed to tell the framework what
12  // data is being produced
13  setWhatProduced(this);
14 
15  //now do what ever other initialization is needed
16 }
17 
19  // do anything here that needs to be done at desctruction time
20  // (e.g. close files, deallocate resources etc.)
21 }
22 
23 //
24 // member functions
25 //
26 
27 // ------------ method called to produce the data ------------
29  // Start with "SubsystemKeysOnly"
30  edm::ESHandle<L1TriggerKeyExt> subsystemKeys;
31  try {
32  iRecord.get("SubsystemKeysOnly", subsystemKeys);
33  } catch (l1t::DataAlreadyPresentException& ex) {
34  throw ex;
35  }
36 
37  auto pL1TriggerKey = std::make_unique<L1TriggerKeyExt>(*subsystemKeys);
38 
39  // Collate object keys
40  std::vector<std::string>::const_iterator itr = m_subsystemLabels.begin();
41  std::vector<std::string>::const_iterator end = m_subsystemLabels.end();
42  for (; itr != end; ++itr) {
44  try {
45  iRecord.get(*itr, objectKeys);
46  } catch (l1t::DataAlreadyPresentException& ex) {
47  throw ex;
48  }
49 
50  pL1TriggerKey->add(objectKeys->recordToKeyMap());
51  }
52 
53  return pL1TriggerKey;
54 }
55 
56 //define this as a plug-in
57 //DEFINE_FWK_EVENTSETUP_MODULE(L1TriggerKeyOnlineProdExt);
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:138
const RecordToKey & recordToKeyMap() const
ProductT const & get(ESGetToken< ProductT, DepRecordT > const &iToken) const
#define end
Definition: vmac.h:39
ReturnType produce(const L1TriggerKeyExtRcd &)
std::vector< std::string > m_subsystemLabels
std::unique_ptr< L1TriggerKeyExt > ReturnType
L1TriggerKeyOnlineProdExt(const edm::ParameterSet &)