File indexing completed on 2024-04-06 12:21:07
0001 #include "L1MuonOverlapPhase1ParamsDBProducer.h"
0002
0003 #include "CondCore/DBOutputService/interface/PoolDBOutputService.h"
0004 #include "CondFormats/L1TObjects/interface/L1TMuonOverlapParams.h"
0005 #include "FWCore/Framework/interface/ESHandle.h"
0006 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0007 #include "FWCore/ServiceRegistry/interface/Service.h"
0008 #include <memory>
0009
0010 L1MuonOverlapPhase1ParamsDBProducer::L1MuonOverlapPhase1ParamsDBProducer(const edm::ParameterSet& cfg)
0011 : omtfParamsEsToken(esConsumes<L1TMuonOverlapParams, L1TMuonOverlapParamsRcd, edm::Transition::BeginRun>()) {
0012 edm::LogVerbatim("L1MuonOverlapParamsDBProducer") << " L1MuonOverlapPhase1ParamsDBProducer() " << std::endl;
0013 }
0014
0015
0016 void L1MuonOverlapPhase1ParamsDBProducer::beginRun(edm::Run const& run, edm::EventSetup const& iSetup) {
0017 omtfParams = std::make_unique<L1TMuonOverlapParams>(iSetup.getData(omtfParamsEsToken));
0018
0019 if (!omtfParams) {
0020 edm::LogError("L1MuonOverlapParamsDBProducer") << "Could not retrieve parameters from Event Setup" << std::endl;
0021 }
0022
0023 edm::LogVerbatim("L1MuonOverlapParamsDBProducer") << " beginRun() " << std::endl;
0024 }
0025
0026
0027
0028 void L1MuonOverlapPhase1ParamsDBProducer::analyze(const edm::Event& ev, const edm::EventSetup& es) {
0029 edm::LogVerbatim("L1MuonOverlapParamsDBProducer") << " analyze() line " << __LINE__ << std::endl;
0030 std::string recordName = "L1TMuonOverlapParamsRcd";
0031 edm::Service<cond::service::PoolDBOutputService> poolDbService;
0032 if (poolDbService.isAvailable()) {
0033 poolDbService->writeOneIOV(*omtfParams, poolDbService->currentTime(), recordName);
0034 }
0035 edm::LogVerbatim("L1MuonOverlapParamsDBProducer") << " analyze() line " << __LINE__ << std::endl;
0036 }
0037
0038
0039 #include "FWCore/Framework/interface/MakerMacros.h"
0040 DEFINE_FWK_MODULE(L1MuonOverlapPhase1ParamsDBProducer);