CMS 3D CMS Logo

XMLGeometryBuilder.cc
Go to the documentation of this file.
12 
13 #include <string>
14 #include <vector>
15 #include <fstream>
16 
17 class XMLGeometryBuilder : public edm::one::EDAnalyzer<edm::one::WatchRuns> {
18 public:
20 
21  void beginJob() override;
22  void beginRun(edm::Run const& iEvent, edm::EventSetup const&) override {}
23  void analyze(edm::Event const& iEvent, edm::EventSetup const&) override {}
24  void endRun(edm::Run const& iEvent, edm::EventSetup const&) override {}
25 
26 private:
28  bool m_zip;
30 };
31 
33  m_fname = iConfig.getUntrackedParameter<std::string>("XMLFileName", "test.xml");
34  m_zip = iConfig.getUntrackedParameter<bool>("ZIP", true);
35  m_record = iConfig.getUntrackedParameter<std::string>("record", "GeometryFileRcd");
36 }
37 
39  edm::LogInfo("XMLGeometryBuilder") << "XMLGeometryBuilder::beginJob";
41  if (!mydbservice.isAvailable()) {
42  edm::LogError("XMLGeometryBuilder") << "PoolDBOutputService unavailable";
43  return;
44  }
45 
46  FileBlob pgf(m_fname, m_zip);
47 
48  if (mydbservice->isNewTagRequest(m_record)) {
49  mydbservice->createOneIOV(pgf, mydbservice->beginOfTime(), m_record);
50  } else {
51  edm::LogError("XMLGeometryBuilder") << "GeometryFileRcd Tag already exist";
52  }
53 }
54 
void beginRun(edm::Run const &iEvent, edm::EventSetup const &) override
XMLGeometryBuilder(const edm::ParameterSet &)
void beginJob() override
Log< level::Error, false > LogError
void createOneIOV(const T &payload, cond::Time_t firstSinceTime, const std::string &recordName)
T getUntrackedParameter(std::string const &, T const &) const
int iEvent
Definition: GenABIO.cc:224
bool isNewTagRequest(const std::string &recordName)
void analyze(edm::Event const &iEvent, edm::EventSetup const &) override
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
Log< level::Info, false > LogInfo
void endRun(edm::Run const &iEvent, edm::EventSetup const &) override
bool isAvailable() const
Definition: Service.h:40
Definition: Run.h:45