Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:03:14

0001 #include "CondTools/L1TriggerExt/plugins/L1TriggerKeyDummyProdExt.h"
0002 
0003 L1TriggerKeyDummyProdExt::L1TriggerKeyDummyProdExt(const edm::ParameterSet& iConfig) {
0004   //the following line is needed to tell the framework what
0005   // data is being produced
0006 
0007   // Label should be empty, "SubsystemKeysOnly" or any subsystem label expected
0008   // by L1TriggerKeyOnlineProd.
0009   std::string label = iConfig.getParameter<std::string>("label");
0010   setWhatProduced(this, label);
0011 
0012   //now do what ever other initialization is needed
0013   m_key.setTSCKey(iConfig.getParameter<std::string>("tscKey"));
0014   m_key.setSubsystemKey(L1TriggerKeyExt::kuGT, iConfig.getParameter<std::string>("uGTKey"));
0015   m_key.setSubsystemKey(L1TriggerKeyExt::kuGMT, iConfig.getParameter<std::string>("uGMTKey"));
0016   m_key.setSubsystemKey(L1TriggerKeyExt::kBMTF, iConfig.getParameter<std::string>("BMTFKey"));
0017   m_key.setSubsystemKey(L1TriggerKeyExt::kCALO, iConfig.getParameter<std::string>("CALOKey"));
0018 
0019   if (label != "SubsystemKeysOnly") {
0020     typedef std::vector<edm::ParameterSet> ObjectKeys;
0021     ObjectKeys keys = iConfig.getParameter<ObjectKeys>("objectKeys");
0022 
0023     for (ObjectKeys::const_iterator it = keys.begin(); it != keys.end(); ++it) {
0024       // Replace ?s with spaces.
0025       std::string key = it->getParameter<std::string>("key");
0026       replace(key.begin(), key.end(), '?', ' ');
0027 
0028       m_key.add(it->getParameter<std::string>("record"), it->getParameter<std::string>("type"), key);
0029     }
0030   }
0031 }
0032 
0033 L1TriggerKeyDummyProdExt::~L1TriggerKeyDummyProdExt() {
0034   // do anything here that needs to be done at desctruction time
0035   // (e.g. close files, deallocate resources etc.)
0036 }
0037 
0038 //
0039 // member functions
0040 //
0041 
0042 // ------------ method called to produce the data  ------------
0043 L1TriggerKeyDummyProdExt::ReturnType L1TriggerKeyDummyProdExt::produce(const L1TriggerKeyExtRcd& iRecord) {
0044   return std::make_unique<L1TriggerKeyExt>(m_key);
0045 }
0046 
0047 //define this as a plug-in
0048 //DEFINE_FWK_EVENTSETUP_MODULE(L1TriggerKeyDummyProdExt);