CMS 3D CMS Logo

L1TMuonOverlapParamsDBProducer.cc
Go to the documentation of this file.
1 
2 #include <memory>
3 #include <string>
4 
16 
17 class L1MuonOverlapParamsDBProducer : public edm::one::EDAnalyzer<edm::one::WatchRuns> {
18 public:
20  void beginRun(const edm::Run&, const edm::EventSetup&) override;
21  void endRun(const edm::Run&, const edm::EventSetup&) override;
22  void analyze(const edm::Event&, const edm::EventSetup&) override;
23 
24 private:
26  std::unique_ptr<L1TMuonOverlapParams> omtfParams;
27 };
28 
30  : esTokenParams_(esConsumes<edm::Transition::BeginRun>(edm::ESInputTag("", "params"))) {}
34  omtfParams = std::make_unique<L1TMuonOverlapParams>(iSetup.getData(esTokenParams_));
35  if (!omtfParams) {
36  edm::LogError("L1TMuonOverlapTrackProducer") << "Could not retrieve parameters from Event Setup" << std::endl;
37  }
38 }
40 
44  std::string recordName = "L1TMuonOverlapParamsRcd";
46  if (poolDbService.isAvailable()) {
47  poolDbService->writeOneIOV(*omtfParams, poolDbService->currentTime(), recordName);
48  }
49 }
ESGetTokenH3DDVariant esConsumes(std::string const &Record, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
void beginRun(const edm::Run &, const edm::EventSetup &) override
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
Definition: EventSetup.h:119
L1MuonOverlapParamsDBProducer(const edm::ParameterSet &)
Log< level::Error, false > LogError
void analyze(const edm::Event &, const edm::EventSetup &) override
Hash writeOneIOV(const T &payload, Time_t time, const std::string &recordName)
Transition
Definition: Transition.h:12
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
std::unique_ptr< L1TMuonOverlapParams > omtfParams
void endRun(const edm::Run &, const edm::EventSetup &) override
edm::ESGetToken< L1TMuonOverlapParams, L1TMuonOverlapParamsRcd > esTokenParams_
HLT enums.
bool isAvailable() const
Definition: Service.h:40
Definition: Run.h:45