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 > >(
11  "subsystemLabels" ) )
12 {
13  //the following line is needed to tell the framework what
14  // data is being produced
15  setWhatProduced(this);
16 
17  //now do what ever other initialization is needed
18 }
19 
20 
22 {
23 
24  // do anything here that needs to be done at desctruction time
25  // (e.g. close files, deallocate resources etc.)
26 
27 }
28 
29 
30 //
31 // member functions
32 //
33 
34 // ------------ method called to produce the data ------------
37 {
38  // Start with "SubsystemKeysOnly"
39  edm::ESHandle< L1TriggerKeyExt > subsystemKeys ;
40  try
41  {
42  iRecord.get( "SubsystemKeysOnly", subsystemKeys ) ;
43  }
45  {
46  throw ex ;
47  }
48 
49  auto pL1TriggerKey = std::make_unique< L1TriggerKeyExt >(*subsystemKeys) ;
50 
51  // Collate object keys
52  std::vector< std::string >::const_iterator itr = m_subsystemLabels.begin() ;
53  std::vector< std::string >::const_iterator end = m_subsystemLabels.end() ;
54  for( ; itr != end ; ++itr )
55  {
57  try
58  {
59  iRecord.get( *itr, objectKeys ) ;
60  }
62  {
63  throw ex ;
64  }
65 
66  pL1TriggerKey->add( objectKeys->recordToKeyMap() ) ;
67  }
68 
69  return pL1TriggerKey ;
70 }
71 
72 //define this as a plug-in
73 //DEFINE_FWK_EVENTSETUP_MODULE(L1TriggerKeyOnlineProdExt);
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:124
std::vector< std::string > m_subsystemLabels
const RecordToKey & recordToKeyMap() const
ProductT const & get(ESGetToken< ProductT, DepRecordT > const &iToken) const
#define end
Definition: vmac.h:39
ReturnType produce(const L1TriggerKeyExtRcd &)
std::unique_ptr< L1TriggerKeyExt > ReturnType
L1TriggerKeyOnlineProdExt(const edm::ParameterSet &)