File indexing completed on 2024-04-06 12:22:25
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020 #include <memory>
0021
0022
0023 #include "FWCore/Framework/interface/ModuleFactory.h"
0024 #include "FWCore/Framework/interface/ESProducer.h"
0025
0026 #include "FWCore/Framework/interface/ESHandle.h"
0027
0028 #include "CondFormats/DataRecord/interface/L1RPCBxOrConfigRcd.h"
0029 #include "CondFormats/L1TObjects/interface/L1RPCBxOrConfig.h"
0030
0031
0032
0033
0034
0035 class RPCTriggerBxOrConfig : public edm::ESProducer {
0036 public:
0037 RPCTriggerBxOrConfig(const edm::ParameterSet&);
0038 ~RPCTriggerBxOrConfig() override;
0039
0040 typedef std::unique_ptr<L1RPCBxOrConfig> ReturnType;
0041
0042 ReturnType produce(const L1RPCBxOrConfigRcd&);
0043
0044 private:
0045 int m_firstBX;
0046 int m_lastBX;
0047 };
0048
0049
0050
0051
0052
0053
0054
0055
0056
0057
0058
0059
0060 RPCTriggerBxOrConfig::RPCTriggerBxOrConfig(const edm::ParameterSet& iConfig) {
0061
0062
0063 setWhatProduced(this);
0064
0065 m_firstBX = iConfig.getParameter<int>("firstBX");
0066 m_lastBX = iConfig.getParameter<int>("lastBX");
0067 }
0068
0069 RPCTriggerBxOrConfig::~RPCTriggerBxOrConfig() {}
0070
0071
0072
0073
0074
0075
0076 RPCTriggerBxOrConfig::ReturnType RPCTriggerBxOrConfig::produce(const L1RPCBxOrConfigRcd& iRecord) {
0077 auto pRPCTriggerBxOrConfig = std::make_unique<L1RPCBxOrConfig>();
0078
0079 if (m_firstBX > m_lastBX)
0080 throw cms::Exception("BadConfig") << " firstBX < m_lastBX "
0081 << "\n";
0082
0083 pRPCTriggerBxOrConfig->setFirstBX(m_firstBX);
0084 pRPCTriggerBxOrConfig->setLastBX(m_lastBX);
0085
0086 return pRPCTriggerBxOrConfig;
0087 }
0088
0089
0090 DEFINE_FWK_EVENTSETUP_MODULE(RPCTriggerBxOrConfig);