CMS 3D CMS Logo

L1TriggerKeyOnlineProdExt.cc
Go to the documentation of this file.
2 
4 
6 
8 
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  L1TriggerKeyExt_token = cc.consumes(edm::ESInputTag{"", "SubsystemKeysOnly"});
21 }
22 
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 ------------
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);
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:166
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
uint32_t cc[maxCellsPerHit]
Definition: gpuFishbone.h:49
std::vector< edm::ESGetToken< L1TriggerKeyExt, L1TriggerKeyExtRcd > > m_subsystemTokens
char const * label
ReturnType produce(const L1TriggerKeyExtRcd &)
std::unique_ptr< L1TriggerKeyExt > ReturnType
edm::ESGetToken< L1TriggerKeyExt, L1TriggerKeyExtRcd > L1TriggerKeyExt_token
ProductT const & get(ESGetToken< ProductT, DepRecordT > const &iToken) const
L1TriggerKeyOnlineProdExt(const edm::ParameterSet &)