Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 // -*- C++ -*-
0002 //
0003 // Package:    L1TriggerConfig
0004 // Class:      RCTObjectKeysOnlineProd
0005 //
0006 /**\class RCTObjectKeysOnlineProd RCTObjectKeysOnlineProd.h L1TriggerConfig/RCTConfigProducers/src/RCTObjectKeysOnlineProd.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:  Fri Aug 22 19:51:36 CEST 2008
0016 //
0017 //
0018 
0019 // system include files
0020 
0021 // user include files
0022 #include "CondTools/L1Trigger/interface/L1ObjectKeysOnlineProdBase.h"
0023 #include <sstream>
0024 #include "CoralBase/TimeStamp.h"
0025 #include <cmath>
0026 
0027 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0028 
0029 //
0030 // class declaration
0031 //
0032 
0033 class L1RCT_RSKeysOnlineProd : public L1ObjectKeysOnlineProdBase {
0034 public:
0035   L1RCT_RSKeysOnlineProd(const edm::ParameterSet& iConfig);
0036   ~L1RCT_RSKeysOnlineProd() override {}
0037 
0038   void fillObjectKeys(FillType pL1TriggerKey) override;
0039 
0040 private:
0041   // ----------member data ---------------------------
0042   bool m_enableL1RCTChannelMask;
0043 };
0044 
0045 //
0046 // constants, enums and typedefs
0047 //
0048 
0049 //
0050 // static data member definitions
0051 //
0052 
0053 //
0054 // constructors and destructor
0055 //
0056 L1RCT_RSKeysOnlineProd::L1RCT_RSKeysOnlineProd(const edm::ParameterSet& iConfig)
0057     : L1ObjectKeysOnlineProdBase(iConfig),
0058       m_enableL1RCTChannelMask(iConfig.getParameter<bool>("enableL1RCTChannelMask")) {}
0059 
0060 //
0061 // member functions
0062 //
0063 
0064 // ------------ method called to produce the data  ------------
0065 void L1RCT_RSKeysOnlineProd::fillObjectKeys(FillType pL1TriggerKey) {
0066   if (m_enableL1RCTChannelMask) {
0067     l1t::OMDSReader::QueryResults objectKeyResults =
0068         m_omdsReader.basicQuery("ID", "CMS_RCT", "RCT_RUN_SETTINGS_KEY_CURRENT");
0069 
0070     std::string objectKey;
0071 
0072     if (objectKeyResults.queryFailed())
0073 
0074     {
0075       edm::LogError("L1-O2O") << "Problem with jey for record L1RCTCHannelMaskRcd: query failed.";
0076     } else if (objectKeyResults.numberRows() != 1) {
0077       edm::LogError("L1-O2O") << "Problem with key for record L1RCTChannelMaskRcd: " << (objectKeyResults.numberRows())
0078                               << " rows were returned";
0079     } else {
0080       objectKeyResults.fillVariable(objectKey);
0081     }
0082     pL1TriggerKey->add("L1RCTChannelMaskRcd", "L1RCTChannelMask", objectKey);
0083   }
0084 }
0085 
0086 //define this as a plug-in
0087 DEFINE_FWK_EVENTSETUP_MODULE(L1RCT_RSKeysOnlineProd);