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 = new FileBlob(m_fname, m_zip);
47 
48  if (mydbservice->isNewTagRequest(m_record)) {
49  mydbservice->createNewIOV<FileBlob>(pgf, mydbservice->beginOfTime(), mydbservice->endOfTime(), m_record);
50  } else {
51  edm::LogError("XMLGeometryBuilder") << "GeometryFileRcd Tag already exist";
52  }
53 }
54 
T getUntrackedParameter(std::string const &, T const &) const
void beginRun(edm::Run const &iEvent, edm::EventSetup const &) override
XMLGeometryBuilder(const edm::ParameterSet &)
void beginJob() override
int iEvent
Definition: GenABIO.cc:224
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
bool isNewTagRequest(const std::string &recordName)
void analyze(edm::Event const &iEvent, edm::EventSetup const &) override
bool isAvailable() const
Definition: Service.h:40
void createNewIOV(T *firstPayloadObj, cond::Time_t firstSinceTime, cond::Time_t firstTillTime, const std::string &recordName, bool withlogging=false)
void endRun(edm::Run const &iEvent, edm::EventSetup const &) override
Definition: Run.h:45