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 
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->writeOne<JME::JetResolutionObject>(jerObject, sinceTime, m_record);
50 
51  std::cout << "Object saved into the database with the record: " << m_record << std::endl;
52  }
53 }
54 
JetResolutionObject.h
JetResolutionDBWriter::m_path
std::string m_path
Definition: JetResolutionDBWriter.cc:27
JME::JetResolutionObject
Definition: JetResolutionObject.h:116
contentValuesFiles.fullPath
fullPath
Definition: contentValuesFiles.py:64
gather_cfg.cout
cout
Definition: gather_cfg.py:144
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
EDAnalyzer.h
edm::EDAnalyzer
Definition: EDAnalyzer.h:28
JetResolutionDBWriter
Definition: JetResolutionDBWriter.cc:17
EDMException.h
edm::FileInPath
Definition: FileInPath.h:61
MakerMacros.h
alignCSCRings.s
s
Definition: alignCSCRings.py:92
PoolDBOutputService.h
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
Service.h
edm::ParameterSet
Definition: ParameterSet.h:47
JetResolutionDBWriter::m_record
std::string m_record
Definition: JetResolutionDBWriter.cc:26
Event.h
cond::Time_t
unsigned long long Time_t
Definition: Time.h:14
JetResolutionDBWriter::analyze
void analyze(const edm::Event &, const edm::EventSetup &) override
Definition: JetResolutionDBWriter.cc:21
edm::Service< cond::service::PoolDBOutputService >
edm::EventSetup
Definition: EventSetup.h:58
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
JetResolutionDBWriter::~JetResolutionDBWriter
~JetResolutionDBWriter() override
Definition: JetResolutionDBWriter.cc:23
Frameworkfwd.h
JetResolutionDBWriter::endJob
void endJob() override
Definition: JetResolutionDBWriter.cc:22
ParameterSet.h
JetResolutionDBWriter::beginJob
void beginJob() override
Definition: JetResolutionDBWriter.cc:37
JetResolutionDBWriter::JetResolutionDBWriter
JetResolutionDBWriter(const edm::ParameterSet &)
Definition: JetResolutionDBWriter.cc:31
edm::Event
Definition: Event.h:73