Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:20:18

0001 // CaloParamsWriter
0002 //
0003 #include "FWCore/Framework/interface/one/EDAnalyzer.h"
0004 #include "FWCore/Framework/interface/Event.h"
0005 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0006 
0007 #include "FWCore/Framework/interface/EventSetup.h"
0008 #include "FWCore/Framework/interface/ESHandle.h"
0009 
0010 #include "CondFormats/DataRecord/interface/L1TCaloParamsRcd.h"
0011 #include "CondFormats/L1TObjects/interface/CaloParams.h"
0012 
0013 #include "FWCore/ServiceRegistry/interface/Service.h"
0014 #include "CondCore/DBOutputService/interface/PoolDBOutputService.h"
0015 #include "CondTools/L1Trigger/interface/DataWriter.h"
0016 
0017 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0018 #include "FWCore/MessageLogger/interface/MessageDrop.h"
0019 
0020 #include "FWCore/PluginManager/interface/ModuleDef.h"
0021 #include "FWCore/Framework/interface/MakerMacros.h"
0022 
0023 #include <iostream>
0024 
0025 #include <iostream>
0026 
0027 //
0028 // class declaration
0029 //
0030 
0031 class CaloParamsWriter : public edm::one::EDAnalyzer<> {
0032 public:
0033   explicit CaloParamsWriter(const edm::ParameterSet&) {}
0034   ~CaloParamsWriter() override {}
0035   void analyze(const edm::Event&, const edm::EventSetup&) override;
0036 };
0037 
0038 void CaloParamsWriter::analyze(const edm::Event& iEvent, const edm::EventSetup& evSetup) {
0039   l1t::DataWriter dataWriter;
0040   std::string token = dataWriter.writePayload(evSetup, "L1TCaloParamsRcd@CaloParams");
0041   if (dataWriter.updateIOV("L1TCaloParamsRcd", token, 1, false))
0042     std::cout << "IOV updated!" << std::endl;
0043   std::cout << "Payload token = " << token << std::endl;
0044 }
0045 
0046 DEFINE_FWK_MODULE(CaloParamsWriter);