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  using namespace edm::es;
39 
40  // Start with "SubsystemKeysOnly"
41  edm::ESHandle< L1TriggerKeyExt > subsystemKeys ;
42  try
43  {
44  iRecord.get( "SubsystemKeysOnly", subsystemKeys ) ;
45  }
47  {
48  throw ex ;
49  }
50 
51  auto pL1TriggerKey = std::make_unique< L1TriggerKeyExt >(*subsystemKeys) ;
52 
53  // Collate object keys
54  std::vector< std::string >::const_iterator itr = m_subsystemLabels.begin() ;
55  std::vector< std::string >::const_iterator end = m_subsystemLabels.end() ;
56  for( ; itr != end ; ++itr )
57  {
59  try
60  {
61  iRecord.get( *itr, objectKeys ) ;
62  }
64  {
65  throw ex ;
66  }
67 
68  pL1TriggerKey->add( objectKeys->recordToKeyMap() ) ;
69  }
70 
71  return pL1TriggerKey ;
72 }
73 
74 //define this as a plug-in
75 //DEFINE_FWK_EVENTSETUP_MODULE(L1TriggerKeyOnlineProdExt);
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:116
std::vector< std::string > m_subsystemLabels
const RecordToKey & recordToKeyMap() const
#define end
Definition: vmac.h:39
ReturnType produce(const L1TriggerKeyExtRcd &)
std::unique_ptr< L1TriggerKeyExt > ReturnType
L1TriggerKeyOnlineProdExt(const edm::ParameterSet &)
bool get(HolderT &iHolder) const