Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #include "L1TriggerConfig/CSCTFConfigProducers/interface/CSCTFObjectKeysOnlineProd.h"
0002 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0003 
0004 CSCTFObjectKeysOnlineProd::CSCTFObjectKeysOnlineProd(const edm::ParameterSet& iConfig)
0005     : L1ObjectKeysOnlineProdBase(iConfig),
0006       m_enableConfiguration(iConfig.getParameter<bool>("enableConfiguration")),
0007       m_enablePtLut(iConfig.getParameter<bool>("enablePtLut")) {}
0008 
0009 void CSCTFObjectKeysOnlineProd::fillObjectKeys(FillType pL1TriggerKey) {
0010   std::string csctfKey = pL1TriggerKey->subsystemKey(L1TriggerKey::kCSCTF);
0011 
0012   if (!csctfKey.empty()) {
0013     if (m_enableConfiguration) {
0014       //----------------------------------------------------------------------------
0015       // register the main CSCTF key
0016       pL1TriggerKey->add("L1MuCSCTFConfigurationRcd", "L1MuCSCTFConfiguration", csctfKey);
0017       //----------------------------------------------------------------------------
0018     }
0019 
0020     if (m_enablePtLut) {
0021       //----------------------------------------------------------------------------
0022       // PT LUT
0023       //
0024       // while the sp configuration can change from sector to sector, the pt LUT file
0025       //loaded in the CSCTF boards is the same for each SP => the same PTLUT_VERSION
0026       // RETRIEVE THE VERSION FROM THE SP1 CONFIGURATION
0027       //
0028       // e.g., SELECT PTLUT_VERSION FROM CMS_CSC_TF.CSCTF_SP_CONF WHERE CSCTF_SP_CONF.SP_KEY = '1702100001'
0029       // e.g., CSCTF key of the type day/month/year, e.g. 170210 = 17th February 2010
0030       std::string sp1key = csctfKey + "0001";
0031 
0032       // query
0033       l1t::OMDSReader::QueryResults objectKeyResults = m_omdsReader.basicQuery(
0034           "PTLUT_VERSION", "CMS_CSC_TF", "CSCTF_SP_CONF", "CSCTF_SP_CONF.SP_KEY", m_omdsReader.singleAttribute(sp1key));
0035 
0036       // check if query was successful
0037       if (objectKeyResults.queryFailed() || objectKeyResults.numberRows() != 1) {
0038         edm::LogError("L1-O2O") << "Problem with CSCTF key while retrieving "
0039                                 << "the PTLUT_VERSION";
0040         return;
0041       }
0042 
0043       // register the pt LUT key
0044       std::string ptLutKey;
0045       objectKeyResults.fillVariable(ptLutKey);
0046       pL1TriggerKey->add("L1MuCSCPtLutRcd", "L1MuCSCPtLut", ptLutKey);
0047       //----------------------------------------------------------------------------
0048     }
0049   }
0050 }