Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:22:17

0001 #include "CondTools/L1Trigger/interface/L1ObjectKeysOnlineProdBase.h"
0002 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0003 
0004 class L1GctTSCObjectKeysOnlineProd : public L1ObjectKeysOnlineProdBase {
0005 public:
0006   L1GctTSCObjectKeysOnlineProd(const edm::ParameterSet& iConfig) : L1ObjectKeysOnlineProdBase(iConfig) {}
0007   ~L1GctTSCObjectKeysOnlineProd() override {}
0008 
0009   void fillObjectKeys(FillType pL1TriggerKey) override;
0010 
0011 private:
0012 };
0013 
0014 void L1GctTSCObjectKeysOnlineProd::fillObjectKeys(FillType pL1TriggerKey) {
0015   // kMYSUBSYSTEM = kCSCTF, kDTTF, kRPC, kGMT, kRCT, kGCT, kGT, or kTSP0
0016   // subsystemKey = TRIGGERSUP_CONF.{CSCTF_KEY, DTTF_KEY, RPC_KEY, GMT_KEY, RCT_KEY, GCT_KEY, GT_KEY}
0017   std::string subsystemKey = pL1TriggerKey->subsystemKey(L1TriggerKey::kGCT);
0018 
0019   if (!subsystemKey.empty()) {
0020     // Execute SQL queries to get data from OMDS (using key) and make C++ object.
0021     // Example: SELECT A_PARAMETER FROM CMS_XXX.XXX_CONF WHERE XXX_CONF.XXX_KEY = subsystemKey
0022 
0023     // get main crate key
0024     l1t::OMDSReader::QueryResults mainCrateKeyResults =
0025         m_omdsReader.basicQuery("GCT_MAIN_CRATE_KEY",
0026                                 "CMS_GCT",
0027                                 "GCT_CONFIG",
0028                                 "GCT_CONFIG.CONFIG_KEY",
0029                                 m_omdsReader.singleAttribute(subsystemKey));
0030 
0031     // get phys params key
0032     l1t::OMDSReader::QueryResults physParamsKeyResults = m_omdsReader.basicQuery(
0033         "GCT_PHYS_PARAMS_KEY", "CMS_GCT", "GCT_MAIN_CRATE", "GCT_MAIN_CRATE.CONFIG_KEY", mainCrateKeyResults);
0034 
0035     std::string physParamsKey;
0036 
0037     if (physParamsKeyResults.queryFailed()) {
0038       edm::LogError("L1-O2O") << "Problem with key for record L1GctJetFinderParamsRcd: query failed ";
0039     } else if (physParamsKeyResults.numberRows() != 1) {
0040       edm::LogError("L1-O2O") << "Problem with key for record L1GctJetFinderParamsRcd: "
0041                               << (physParamsKeyResults.numberRows()) << " rows were returned";
0042     } else {
0043       physParamsKeyResults.fillVariable(physParamsKey);
0044     }
0045 
0046     pL1TriggerKey->add("L1GctJetFinderParamsRcd", "L1GctJetFinderParams", physParamsKey);
0047     pL1TriggerKey->add("L1JetEtScaleRcd", "L1CaloEtScale", physParamsKey);
0048     pL1TriggerKey->add("L1HtMissScaleRcd", "L1CaloEtScale", physParamsKey);
0049     pL1TriggerKey->add("L1HfRingEtScaleRcd", "L1CaloEtScale", physParamsKey);
0050   }
0051 }
0052 
0053 DEFINE_FWK_EVENTSETUP_MODULE(L1GctTSCObjectKeysOnlineProd);