CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 
T getUntrackedParameter(std::string const &, T const &) const
JetResolutionDBWriter(const edm::ParameterSet &)
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
void analyze(const edm::Event &, const edm::EventSetup &) override
unsigned long long Time_t
Definition: Time.h:14
bool isNewTagRequest(const std::string &recordName)
bool isAvailable() const
Definition: Service.h:40
Hash writeOneIOV(const T &payload, Time_t time, const std::string &recordName)
tuple cout
Definition: gather_cfg.py:144