Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 13:31:14

0001 #include <iostream>
0002 #include "CondTools/L1TriggerExt/interface/L1ObjectKeysOnlineProdBaseExt.h"
0003 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0004 
0005 class L1TUtmTriggerMenuObjectKeysOnlineProd : public L1ObjectKeysOnlineProdBaseExt {
0006 private:
0007 public:
0008   void fillObjectKeys(L1TriggerKeyExt* pL1TriggerKey) override;
0009 
0010   L1TUtmTriggerMenuObjectKeysOnlineProd(const edm::ParameterSet&);
0011   ~L1TUtmTriggerMenuObjectKeysOnlineProd(void) override {}
0012 };
0013 
0014 L1TUtmTriggerMenuObjectKeysOnlineProd::L1TUtmTriggerMenuObjectKeysOnlineProd(const edm::ParameterSet& iConfig)
0015     : L1ObjectKeysOnlineProdBaseExt(iConfig) {}
0016 
0017 void L1TUtmTriggerMenuObjectKeysOnlineProd::fillObjectKeys(L1TriggerKeyExt* pL1TriggerKey) {
0018   std::string uGTKey = pL1TriggerKey->subsystemKey(L1TriggerKeyExt::kuGT);
0019 
0020   uGTKey = uGTKey.substr(0, uGTKey.find(':'));
0021 
0022   std::string stage2Schema = "CMS_TRG_L1_CONF";
0023 
0024   std::string l1_menu_key;
0025   std::vector<std::string> queryStrings;
0026   queryStrings.push_back("L1_MENU");
0027 
0028   std::string l1_menu_name, ugt_key;
0029 
0030   // select L1_MENU from CMS_TRG_L1_CONF.UGT_KEYS where ID = objectKey ;
0031   l1t::OMDSReader::QueryResults queryResult = m_omdsReader.basicQuery(
0032       queryStrings, stage2Schema, "UGT_KEYS", "UGT_KEYS.ID", m_omdsReader.singleAttribute(uGTKey));
0033 
0034   if (queryResult.queryFailed() || queryResult.numberRows() != 1) {
0035     edm::LogError("L1-O2O") << "Cannot get UGT_KEYS.L1_MENU for ID = " << uGTKey << " expect a crash later ";
0036     return;
0037   }
0038 
0039   if (!queryResult.fillVariable("L1_MENU", l1_menu_key))
0040     l1_menu_key = "";
0041 
0042   pL1TriggerKey->add("L1TUtmTriggerMenuO2ORcd", "L1TUtmTriggerMenu", l1_menu_key);
0043 }
0044 
0045 //define this as a plug-in
0046 DEFINE_FWK_EVENTSETUP_MODULE(L1TUtmTriggerMenuObjectKeysOnlineProd);