CMS 3D CMS Logo

XMLGeometryReader.cc
Go to the documentation of this file.
11 
12 #include <string>
13 #include <vector>
14 #include <fstream>
15 
16 class XMLGeometryReader : public edm::one::EDAnalyzer<edm::one::WatchRuns> {
17 public:
19 
20  void beginJob() override {}
21  void beginRun(edm::Run const& iEvent, edm::EventSetup const&) override;
22  void analyze(edm::Event const& iEvent, edm::EventSetup const&) override {}
23  void endRun(edm::Run const& iEvent, edm::EventSetup const&) override {}
24 
25 private:
28 };
29 
31  m_fname = iConfig.getUntrackedParameter<std::string>("XMLFileName", "test.xml");
32  m_label = iConfig.getUntrackedParameter<std::string>("geomLabel", "Extended");
33 }
34 
36  edm::LogInfo("XMLGeometryReader") << "XMLGeometryReader::beginRun";
37 
40  std::unique_ptr<std::vector<unsigned char> > blob((*geometry).getUncompressedBlob());
41 
42  std::string outfile1(m_fname);
43  std::ofstream output1(outfile1.c_str());
44  output1.write((const char*)&(*blob)[0], blob->size());
45  output1.close();
46 }
47 
EDAnalyzer.h
GeometryFileRcd
Definition: GeometryFileRcd.h:5
MessageLogger.h
skim900GeV_StreamA_MinBiasPD_cfg.output1
output1
Definition: skim900GeV_StreamA_MinBiasPD_cfg.py:212
ESHandle.h
edm::Run
Definition: Run.h:45
geometry
Definition: geometry.py:1
XMLGeometryReader::XMLGeometryReader
XMLGeometryReader(const edm::ParameterSet &)
Definition: XMLGeometryReader.cc:30
XMLGeometryReader::analyze
void analyze(edm::Event const &iEvent, edm::EventSetup const &) override
Definition: XMLGeometryReader.cc:22
relativeConstraints.geometry
geometry
Definition: relativeConstraints.py:39
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
edm::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
edm::one::EDAnalyzer
Definition: EDAnalyzer.h:30
FileBlob.h
GeometryFileRcd.h
MakerMacros.h
edm::EventSetup::get
T get() const
Definition: EventSetup.h:87
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
Service.h
edm::ESHandle
Definition: DTSurvey.h:22
XMLGeometryReader::beginJob
void beginJob() override
Definition: XMLGeometryReader.cc:20
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::ParameterSet
Definition: ParameterSet.h:47
Event.h
iEvent
int iEvent
Definition: GenABIO.cc:224
XMLGeometryReader::m_fname
std::string m_fname
Definition: XMLGeometryReader.cc:26
edm::EventSetup
Definition: EventSetup.h:58
get
#define get
writedatasetfile.run
run
Definition: writedatasetfile.py:27
XMLGeometryReader
Definition: XMLGeometryReader.cc:16
EventSetup.h
XMLGeometryReader::endRun
void endRun(edm::Run const &iEvent, edm::EventSetup const &) override
Definition: XMLGeometryReader.cc:23
XMLGeometryReader::m_label
std::string m_label
Definition: XMLGeometryReader.cc:27
ParameterSet.h
XMLGeometryReader::beginRun
void beginRun(edm::Run const &iEvent, edm::EventSetup const &) override
Definition: XMLGeometryReader.cc:35
edm::Event
Definition: Event.h:73