Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #include "CondTools/L1TriggerExt/interface/L1ObjectKeysOnlineProdBaseExt.h"
0002 
0003 #include "CondTools/L1Trigger/interface/Exception.h"
0004 
0005 #include "FWCore/Framework/interface/EventSetup.h"
0006 
0007 L1ObjectKeysOnlineProdBaseExt::L1ObjectKeysOnlineProdBaseExt(const edm::ParameterSet& iConfig)
0008     // The subsystemLabel is used by L1TriggerKeyOnlineProdExt to identify the
0009     // L1TriggerKeysExt to concatenate.
0010     : L1TriggerKeyExt_token(setWhatProduced(this, iConfig.getParameter<std::string>("subsystemLabel"))
0011                                 .consumes(edm::ESInputTag{"", "SubsystemKeysOnly"})),
0012       m_omdsReader(iConfig.getParameter<std::string>("onlineDB"),
0013                    iConfig.getParameter<std::string>("onlineAuthentication")) {}
0014 
0015 L1ObjectKeysOnlineProdBaseExt::~L1ObjectKeysOnlineProdBaseExt() {
0016   // do anything here that needs to be done at desctruction time
0017   // (e.g. close files, deallocate resources etc.)
0018 }
0019 
0020 // ------------ method called to produce the data  ------------
0021 L1ObjectKeysOnlineProdBaseExt::ReturnType L1ObjectKeysOnlineProdBaseExt::produce(const L1TriggerKeyExtRcd& iRecord) {
0022   // Get L1TriggerKeyExt with label "SubsystemKeysOnly".  Re-throw exception if
0023   // not present.
0024   L1TriggerKeyExt subsystemKeys;
0025   try {
0026     subsystemKeys = iRecord.get(L1TriggerKeyExt_token);
0027   } catch (l1t::DataAlreadyPresentException& ex) {
0028     throw ex;
0029   }
0030 
0031   // Copy L1TriggerKeyExt to new object.
0032   auto pL1TriggerKey = std::make_unique<L1TriggerKeyExt>(subsystemKeys);
0033 
0034   // Get object keys.
0035   fillObjectKeys(pL1TriggerKey.get());
0036 
0037   return pL1TriggerKey;
0038 }
0039 
0040 //define this as a plug-in
0041 //DEFINE_FWK_EVENTSETUP_MODULE(L1ObjectKeysOnlineProdBaseExt);