Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2022-05-31 22:25:57

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/L1TMuonOverlapParams.h"
0013 #include "CondFormats/DataRecord/interface/L1TMuonOverlapParamsRcd.h"
0014 
0015 #include "FWCore/ServiceRegistry/interface/Service.h"
0016 #include "CondCore/DBOutputService/interface/PoolDBOutputService.h"
0017 
0018 class L1TMuonOverlapParamsWriter : public edm::one::EDAnalyzer<> {
0019 public:
0020   void analyze(const edm::Event&, const edm::EventSetup&) override;
0021 
0022   explicit L1TMuonOverlapParamsWriter(const edm::ParameterSet&) : token_{esConsumes()} {}
0023 
0024 private:
0025   edm::ESGetToken<L1TMuonOverlapParams, L1TMuonOverlapParamsRcd> token_;
0026 };
0027 
0028 void L1TMuonOverlapParamsWriter::analyze(const edm::Event& iEvent, const edm::EventSetup& evSetup) {
0029   L1TMuonOverlapParams 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, "L1TMuonOverlapPatternParamsRcd");
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(L1TMuonOverlapParamsWriter);