00001 00018 #include "CondTools/L1Trigger/interface/L1ObjectKeysOnlineProdBase.h" 00019 #include "FWCore/MessageLogger/interface/MessageLogger.h" 00020 00021 class L1MuGMTRSKeysOnlineProd : public L1ObjectKeysOnlineProdBase { 00022 public: 00023 L1MuGMTRSKeysOnlineProd(const edm::ParameterSet& iConfig) ; 00024 ~L1MuGMTRSKeysOnlineProd() {} 00025 00026 virtual void fillObjectKeys( ReturnType pL1TriggerKey ) ; 00027 private: 00028 bool m_enableL1MuGMTChannelMask ; 00029 }; 00030 00031 L1MuGMTRSKeysOnlineProd::L1MuGMTRSKeysOnlineProd(const edm::ParameterSet& iConfig) 00032 : L1ObjectKeysOnlineProdBase( iConfig ), 00033 m_enableL1MuGMTChannelMask( iConfig.getParameter< bool >( "enableL1MuGMTChannelMask" ) ) 00034 { 00035 } 00036 00037 void 00038 L1MuGMTRSKeysOnlineProd::fillObjectKeys( ReturnType pL1TriggerKey ) 00039 { 00040 if( m_enableL1MuGMTChannelMask ) 00041 { 00042 // Execute SQL queries to get data from OMDS (using key) and make C++ object. 00043 // Example: SELECT A_KEY FROM CMS_XXX.XXX_RUN_SETTINGS_KEYS_CURRENT 00044 l1t::OMDSReader::QueryResults objectKeyResults = 00045 m_omdsReader.basicQuery( 00046 "GMT_RUN_SETTINGS_FK", 00047 "CMS_GMT", 00048 "GMT_RUN_SETTINGS_KEY_CURRENT" ); 00049 00050 std::string objectKey ; 00051 00052 // check if query was successful 00053 if( objectKeyResults.queryFailed() ) 00054 { 00055 edm::LogError("L1-O2O") 00056 << "Problem with key for record L1MuGMTChannelMaskRcd: query failed "; 00057 } 00058 else if( objectKeyResults.numberRows() != 1 ) 00059 { 00060 edm::LogError("L1-O2O") 00061 << "Problem with key for record L1MuGMTChannelMaskRcd: " 00062 << (objectKeyResults.numberRows()) << " rows were returned"; 00063 } 00064 else 00065 { 00066 objectKeyResults.fillVariable( objectKey ) ; 00067 } 00068 00069 pL1TriggerKey->add( "L1MuGMTChannelMaskRcd", "L1MuGMTChannelMask", objectKey ) ; 00070 } 00071 } 00072 00073 DEFINE_FWK_EVENTSETUP_MODULE(L1MuGMTRSKeysOnlineProd);