Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 // -*- C++ -*-
0002 //
0003 // Package:    L1TriggerConfig
0004 // Class:      RPCObjectKeysOnlineProd
0005 //
0006 /**\class RPCObjectKeysOnlineProd RPCObjectKeysOnlineProd.h L1TriggerConfig/RPCConfigProducers/src/RPCObjectKeysOnlineProd.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 19:35:26 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 RPCObjectKeysOnlineProd : public L1ObjectKeysOnlineProdBase {
0031 public:
0032   RPCObjectKeysOnlineProd(const edm::ParameterSet&);
0033   ~RPCObjectKeysOnlineProd() override;
0034 
0035   void fillObjectKeys(FillType pL1TriggerKey) override;
0036 
0037 private:
0038   // ----------member data ---------------------------
0039   bool m_enableL1RPCConfig;
0040   bool m_enableL1RPCConeDefinition;
0041   bool m_enableL1RPCHsbConfig;
0042   bool m_enableL1RPCBxOrConfig;
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 RPCObjectKeysOnlineProd::RPCObjectKeysOnlineProd(const edm::ParameterSet& iConfig)
0057     : L1ObjectKeysOnlineProdBase(iConfig),
0058       m_enableL1RPCConfig(iConfig.getParameter<bool>("enableL1RPCConfig")),
0059       m_enableL1RPCConeDefinition(iConfig.getParameter<bool>("enableL1RPCConeDefinition")),
0060       m_enableL1RPCHsbConfig(iConfig.getParameter<bool>("enableL1RPCHsbConfig")),
0061       m_enableL1RPCBxOrConfig(iConfig.getParameter<bool>("enableL1RPCBxOrConfig")) {}
0062 
0063 RPCObjectKeysOnlineProd::~RPCObjectKeysOnlineProd() {
0064   // do anything here that needs to be done at desctruction time
0065   // (e.g. close files, deallocate resources etc.)
0066 }
0067 
0068 //
0069 // member functions
0070 //
0071 
0072 // ------------ method called to produce the data  ------------
0073 void RPCObjectKeysOnlineProd::fillObjectKeys(FillType pL1TriggerKey) {
0074   std::string rpcKey = pL1TriggerKey->subsystemKey(L1TriggerKey::kRPC);
0075 
0076   if (!rpcKey.empty()) {
0077     if (m_enableL1RPCConfig) {
0078       pL1TriggerKey->add("L1RPCConfigRcd", "L1RPCConfig", rpcKey);
0079     }
0080     if (m_enableL1RPCConeDefinition) {
0081       pL1TriggerKey->add("L1RPCConeDefinitionRcd", "L1RPCConeDefinition", rpcKey);
0082     }
0083     if (m_enableL1RPCHsbConfig) {
0084       pL1TriggerKey->add("L1RPCHsbConfigRcd", "L1RPCHsbConfig", rpcKey);
0085     }
0086     if (m_enableL1RPCBxOrConfig) {
0087       pL1TriggerKey->add("L1RPCBxOrConfigRcd", "L1RPCBxOrConfig", rpcKey);
0088     }
0089   }
0090 }
0091 
0092 //define this as a plug-in
0093 DEFINE_FWK_EVENTSETUP_MODULE(RPCObjectKeysOnlineProd);