File indexing completed on 2024-04-06 12:22:26
0001 #include <iomanip>
0002 #include <iostream>
0003
0004 #include "FWCore/Framework/interface/one/EDAnalyzer.h"
0005
0006 #include "FWCore/Framework/interface/Event.h"
0007 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0008
0009 #include "FWCore/Framework/interface/EventSetup.h"
0010 #include "FWCore/Framework/interface/ESHandle.h"
0011
0012 #include "CondFormats/L1TObjects/interface/L1TriggerKeyExt.h"
0013 #include "CondFormats/DataRecord/interface/L1TriggerKeyExtRcd.h"
0014
0015 #include "FWCore/ServiceRegistry/interface/Service.h"
0016 #include "CondCore/DBOutputService/interface/PoolDBOutputService.h"
0017
0018 class L1KeyWriter : public edm::one::EDAnalyzer<> {
0019 public:
0020 void analyze(const edm::Event&, const edm::EventSetup&) override;
0021
0022 explicit L1KeyWriter(const edm::ParameterSet&) : token_{esConsumes()} {}
0023
0024 private:
0025 edm::ESGetToken<L1TriggerKeyExt, L1TriggerKeyExtRcd> token_;
0026 };
0027
0028 void L1KeyWriter::analyze(const edm::Event& iEvent, const edm::EventSetup& evSetup) {
0029 L1TriggerKeyExt const& ptr1 = evSetup.getData(token_);
0030
0031 edm::Service<cond::service::PoolDBOutputService> poolDb;
0032 if (poolDb.isAvailable()) {
0033 cond::Time_t firstSinceTime = poolDb->beginOfTime();
0034 poolDb->writeOneIOV(ptr1, firstSinceTime, "L1TriggerKeyExtRcd");
0035 }
0036 }
0037
0038 #include "FWCore/PluginManager/interface/ModuleDef.h"
0039 #include "FWCore/Framework/interface/MakerMacros.h"
0040 #include "FWCore/Framework/interface/ModuleFactory.h"
0041
0042 DEFINE_FWK_MODULE(L1KeyWriter);