CMS 3D CMS Logo

L1TriggerKeyDummyProd.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: L1TriggerKeyDummyProd
4 // Class: L1TriggerKeyDummyProd
5 //
13 //
14 // Original Author: Werner Man-Li Sun
15 // Created: Sat Mar 1 01:08:46 CET 2008
16 // $Id: L1TriggerKeyDummyProd.cc,v 1.3 2008/10/13 01:48:38 wsun Exp $
17 //
18 //
19 
20 // system include files
21 
22 // user include files
24 
25 //
26 // class declaration
27 //
28 
29 //
30 // constants, enums and typedefs
31 //
32 
33 //
34 // static data member definitions
35 //
36 
37 //
38 // constructors and destructor
39 //
41  //the following line is needed to tell the framework what
42  // data is being produced
43 
44  // Label should be empty, "SubsystemKeysOnly" or any subsystem label expected
45  // by L1TriggerKeyOnlineProd.
46  std::string label = iConfig.getParameter<std::string>("label");
47  setWhatProduced(this, label);
48 
49  //now do what ever other initialization is needed
50  m_key.setTSCKey(iConfig.getParameter<std::string>("tscKey"));
59 
60  if (label != "SubsystemKeysOnly") {
61  typedef std::vector<edm::ParameterSet> ObjectKeys;
62  ObjectKeys keys = iConfig.getParameter<ObjectKeys>("objectKeys");
63 
64  for (ObjectKeys::const_iterator it = keys.begin(); it != keys.end(); ++it) {
65  // Replace ?s with spaces.
66  std::string key = it->getParameter<std::string>("key");
67  replace(key.begin(), key.end(), '?', ' ');
68 
69  m_key.add(it->getParameter<std::string>("record"), it->getParameter<std::string>("type"), key);
70  }
71  }
72 }
73 
75  // do anything here that needs to be done at desctruction time
76  // (e.g. close files, deallocate resources etc.)
77 }
78 
79 //
80 // member functions
81 //
82 
83 // ------------ method called to produce the data ------------
85  return std::make_unique<L1TriggerKey>(m_key);
86 }
87 
88 //define this as a plug-in
89 //DEFINE_FWK_EVENTSETUP_MODULE(L1TriggerKeyDummyProd);
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:166
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
L1TriggerKeyDummyProd(const edm::ParameterSet &)
def replace(string, replacements)
char const * label
void setTSCKey(const std::string &tscKey)
Definition: L1TriggerKey.h:52
std::unique_ptr< L1TriggerKey > ReturnType
void add(const std::string &record, const std::string &type, const std::string &key)
Definition: L1TriggerKey.h:42
ReturnType produce(const L1TriggerKeyRcd &)
void setSubsystemKey(L1Subsystems subsystem, const std::string &key)
Definition: L1TriggerKey.h:54