Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 // -*- C++ -*-
0002 //
0003 // Package:    L1TriggerConfig
0004 // Class:      DTTFTSCObjectKeysOnlineProd
0005 //
0006 /**\class DTTFTSCObjectKeysOnlineProd DTTFTSCObjectKeysOnlineProd.h L1TriggerConfig/DTTFConfigProducers/src/DTTFTSCObjectKeysOnlineProd.cc
0007 
0008  Description: <one line class summary>
0009 
0010  Implementation:
0011      <Notes on implementation>
0012 */
0013 //
0014 // Original Author:  Werner Man-Li Sun
0015 //         Created:  Thu Oct  2 21:43:50 CEST 2008
0016 //
0017 //
0018 
0019 // system include files
0020 
0021 // user include files
0022 #include "CondTools/L1Trigger/interface/L1ObjectKeysOnlineProdBase.h"
0023 
0024 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0025 
0026 //
0027 // class declaration
0028 //
0029 
0030 class DTTFTSCObjectKeysOnlineProd : public L1ObjectKeysOnlineProdBase {
0031 public:
0032   DTTFTSCObjectKeysOnlineProd(const edm::ParameterSet&);
0033   ~DTTFTSCObjectKeysOnlineProd() override;
0034 
0035   void fillObjectKeys(FillType) override;
0036 
0037 private:
0038   // ----------member data ---------------------------
0039 };
0040 
0041 //
0042 // constants, enums and typedefs
0043 //
0044 
0045 //
0046 // static data member definitions
0047 //
0048 
0049 //
0050 // constructors and destructor
0051 //
0052 DTTFTSCObjectKeysOnlineProd::DTTFTSCObjectKeysOnlineProd(const edm::ParameterSet& iConfig)
0053     : L1ObjectKeysOnlineProdBase(iConfig) {}
0054 
0055 DTTFTSCObjectKeysOnlineProd::~DTTFTSCObjectKeysOnlineProd() {
0056   // do anything here that needs to be done at desctruction time
0057   // (e.g. close files, deallocate resources etc.)
0058 }
0059 
0060 //
0061 // member functions
0062 //
0063 
0064 // ------------ method called to produce the data  ------------
0065 void DTTFTSCObjectKeysOnlineProd::fillObjectKeys(FillType pL1TriggerKey) {
0066   std::string dttfKey = pL1TriggerKey->subsystemKey(L1TriggerKey::kDTTF);
0067 
0068   if (!dttfKey.empty()) {
0069     // SELECT LUT_KEY FROM CMS_DT_TF.DTTF_CONF WHERE DTTF_CONF.ID = dttfKey
0070     l1t::OMDSReader::QueryResults lutKeyResults = m_omdsReader.basicQuery(
0071         "LUT_KEY", "CMS_DT_TF", "DTTF_CONF", "DTTF_CONF.ID", m_omdsReader.singleAttribute(dttfKey));
0072 
0073     if (lutKeyResults.queryFailed() || lutKeyResults.numberRows() != 1)  // check query successful
0074     {
0075       edm::LogError("L1-O2O") << "Problem with DTTF key.";
0076       return;
0077     }
0078 
0079     std::string lutKey;
0080     lutKeyResults.fillVariable(lutKey);
0081 
0082     pL1TriggerKey->add("L1MuDTEtaPatternLutRcd", "L1MuDTEtaPatternLut", lutKey);
0083 
0084     pL1TriggerKey->add("L1MuDTExtLutRcd", "L1MuDTExtLut", lutKey);
0085 
0086     pL1TriggerKey->add("L1MuDTPhiLutRcd", "L1MuDTPhiLut", lutKey);
0087 
0088     pL1TriggerKey->add("L1MuDTPtaLutRcd", "L1MuDTPtaLut", lutKey);
0089 
0090     pL1TriggerKey->add("L1MuDTQualPatternLutRcd", "L1MuDTQualPatternLut", lutKey);
0091 
0092     pL1TriggerKey->add("L1MuDTTFParametersRcd", "L1MuDTTFParameters", dttfKey);
0093   }
0094 }
0095 
0096 //define this as a plug-in
0097 DEFINE_FWK_EVENTSETUP_MODULE(DTTFTSCObjectKeysOnlineProd);