CMS 3D CMS Logo

JetResolutionDBWriter.cc
Go to the documentation of this file.
1 // Author: Sébastien Brochet
2 
3 #include <memory>
4 #include <string>
5 #include <fstream>
6 #include <iostream>
16 
18 public:
20  void beginJob() override;
21  void analyze(const edm::Event&, const edm::EventSetup&) override {}
22  void endJob() override {}
23  ~JetResolutionDBWriter() override {}
24 
25 private:
28 };
29 
30 // Constructor
32  m_record = pSet.getUntrackedParameter<std::string>("record");
34 }
35 
36 // Begin Job
38  std::cout << "Loading data from '" << m_path << "'" << std::endl;
39 
40  const JME::JetResolutionObject jerObject(m_path);
41 
42  std::cout << "Opening PoolDBOutputService" << std::endl;
43 
44  // now write it into the DB
46  if (s.isAvailable()) {
47  std::cout << "Setting up payload record " << m_record << std::endl;
48  cond::Time_t sinceTime = s->isNewTagRequest(m_record) ? s->beginOfTime() : s->currentTime();
49  s->writeOneIOV(jerObject, sinceTime, m_record);
50 
51  std::cout << "Object saved into the database with the record: " << m_record << std::endl;
52  }
53 }
54 
JetResolutionDBWriter(const edm::ParameterSet &)
void analyze(const edm::Event &, const edm::EventSetup &) override
T getUntrackedParameter(std::string const &, T const &) const
unsigned long long Time_t
Definition: Time.h:14
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16