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/L1RPCHsbConfigRcd.h"
0029 #include "CondFormats/L1TObjects/interface/L1RPCHsbConfig.h"
0030
0031
0032
0033
0034
0035 class RPCTriggerHsbConfig : public edm::ESProducer {
0036 public:
0037 RPCTriggerHsbConfig(const edm::ParameterSet&);
0038 ~RPCTriggerHsbConfig() override;
0039
0040 typedef std::unique_ptr<L1RPCHsbConfig> ReturnType;
0041
0042 ReturnType produce(const L1RPCHsbConfigRcd&);
0043
0044 private:
0045 std::vector<int> m_hsb0;
0046 std::vector<int> m_hsb1;
0047 };
0048
0049
0050
0051
0052
0053
0054
0055
0056
0057
0058
0059
0060 RPCTriggerHsbConfig::RPCTriggerHsbConfig(const edm::ParameterSet& iConfig) {
0061
0062
0063 setWhatProduced(this);
0064
0065 m_hsb0 = iConfig.getParameter<std::vector<int> >("hsb0Mask");
0066 m_hsb1 = iConfig.getParameter<std::vector<int> >("hsb1Mask");
0067
0068 if (m_hsb0.size() != 8 || m_hsb1.size() != 8)
0069 throw cms::Exception("BadConfig") << " hsbMask needs to be 8 digits long \n";
0070
0071
0072 }
0073
0074 RPCTriggerHsbConfig::~RPCTriggerHsbConfig() {}
0075
0076
0077
0078
0079
0080
0081 RPCTriggerHsbConfig::ReturnType RPCTriggerHsbConfig::produce(const L1RPCHsbConfigRcd& iRecord) {
0082 auto pRPCTriggerHsbConfig = std::make_unique<L1RPCHsbConfig>();
0083
0084 pRPCTriggerHsbConfig->setHsbMask(0, m_hsb0);
0085 pRPCTriggerHsbConfig->setHsbMask(1, m_hsb1);
0086
0087 return pRPCTriggerHsbConfig;
0088 }
0089
0090
0091 DEFINE_FWK_EVENTSETUP_MODULE(RPCTriggerHsbConfig);