CMS 3D CMS Logo

L1TriggerKeyDummyProdExt.cc
Go to the documentation of this file.
2 
4  //the following line is needed to tell the framework what
5  // data is being produced
6 
7  // Label should be empty, "SubsystemKeysOnly" or any subsystem label expected
8  // by L1TriggerKeyOnlineProd.
9  std::string label = iConfig.getParameter<std::string>("label");
10  setWhatProduced(this, label);
11 
12  //now do what ever other initialization is needed
13  m_key.setTSCKey(iConfig.getParameter<std::string>("tscKey"));
18 
19  if (label != "SubsystemKeysOnly") {
20  typedef std::vector<edm::ParameterSet> ObjectKeys;
21  ObjectKeys keys = iConfig.getParameter<ObjectKeys>("objectKeys");
22 
23  for (ObjectKeys::const_iterator it = keys.begin(); it != keys.end(); ++it) {
24  // Replace ?s with spaces.
25  std::string key = it->getParameter<std::string>("key");
26  replace(key.begin(), key.end(), '?', ' ');
27 
28  m_key.add(it->getParameter<std::string>("record"), it->getParameter<std::string>("type"), key);
29  }
30  }
31 }
32 
34  // do anything here that needs to be done at desctruction time
35  // (e.g. close files, deallocate resources etc.)
36 }
37 
38 //
39 // member functions
40 //
41 
42 // ------------ method called to produce the data ------------
44  return std::make_unique<L1TriggerKeyExt>(m_key);
45 }
46 
47 //define this as a plug-in
48 //DEFINE_FWK_EVENTSETUP_MODULE(L1TriggerKeyDummyProdExt);
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:166
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
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 &)