CMS 3D CMS Logo

L1TriggerKeyDummyProdExt.cc
Go to the documentation of this file.
2 
4 {
5  //the following line is needed to tell the framework what
6  // data is being produced
7 
8  // Label should be empty, "SubsystemKeysOnly" or any subsystem label expected
9  // by L1TriggerKeyOnlineProd.
10  std::string label = iConfig.getParameter< std::string >( "label" ) ;
11  setWhatProduced(this, label);
12 
13  //now do what ever other initialization is needed
14  m_key.setTSCKey( iConfig.getParameter< std::string >( "tscKey" ) ) ;
16  iConfig.getParameter< std::string >( "uGTKey" ) ) ;
18  iConfig.getParameter< std::string >( "uGMTKey" ) ) ;
20  iConfig.getParameter< std::string >( "BMTFKey" ) ) ;
22  iConfig.getParameter< std::string >( "CALOKey" ) ) ;
23 
24  if( label != "SubsystemKeysOnly" )
25  {
26  typedef std::vector< edm::ParameterSet > ObjectKeys;
27  ObjectKeys keys = iConfig.getParameter< ObjectKeys >( "objectKeys" ) ;
28 
29  for( ObjectKeys::const_iterator it = keys.begin ();
30  it != keys.end() ;
31  ++it )
32  {
33  // Replace ?s with spaces.
34  std::string key = it->getParameter< std::string >( "key" ) ;
35  replace( key.begin(), key.end(), '?', ' ' ) ;
36 
37  m_key.add( it->getParameter< std::string >( "record" ),
38  it->getParameter< std::string >( "type" ),
39  key ) ;
40  }
41  }
42 }
43 
44 
46 {
47 
48  // do anything here that needs to be done at desctruction time
49  // (e.g. close files, deallocate resources etc.)
50 
51 }
52 
53 
54 //
55 // member functions
56 //
57 
58 // ------------ method called to produce the data ------------
61 {
62  using namespace edm::es;
63  return std::make_unique< L1TriggerKeyExt >(m_key) ;
64 }
65 
66 //define this as a plug-in
67 //DEFINE_FWK_EVENTSETUP_MODULE(L1TriggerKeyDummyProdExt);
T getParameter(std::string const &) const
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:116
void add(const std::string &record, const std::string &type, const std::string &key)
std::unique_ptr< L1TriggerKeyExt > ReturnType
def replace(string, replacements)
char const * label
void setTSCKey(const std::string &tscKey)
L1TriggerKeyDummyProdExt(const edm::ParameterSet &)
void setSubsystemKey(L1Subsystems subsystem, const std::string &key)
ReturnType produce(const L1TriggerKeyExtRcd &)