CMS 3D CMS Logo

DDTestDumpGeometry.cc
Go to the documentation of this file.
8 #include "DD4hep/Detector.h"
9 #include "DD4hep/DD4hepRootPersistency.h"
10 
11 #include "TGeoManager.h"
12 #include "TFile.h"
13 #include "TSystem.h"
14 
15 #include <iostream>
16 #include <string>
17 
18 using namespace std;
19 using namespace cms;
20 using namespace edm;
21 
22 class DDTestDumpGeometry : public one::EDAnalyzer<> {
23 public:
24  explicit DDTestDumpGeometry(const ParameterSet&);
25 
26  void beginJob() override {}
27  void analyze(Event const& iEvent, EventSetup const&) override;
28  void endJob() override {}
29 
30 private:
32 };
33 
35  : m_tag(iConfig.getParameter<ESInputTag>("DDDetector"))
36 {}
37 
38 void
39 DDTestDumpGeometry::analyze(const Event&, const EventSetup& iEventSetup)
40 {
41  LogVerbatim("Geometry") << "DDTestDumpGeometry::analyze: " << m_tag;
43  iEventSetup.get<GeometryFileRcd>().get(m_tag.module(), det);
44 
45  TGeoManager const& geom = det->description()->manager();
46 
47  TGeoIterator next(geom.GetTopVolume());
48  TGeoNode *node;
49  TString path;
50  while(( node = next())) {
51  next.GetPath( path );
52  LogVerbatim("Geometry") << path << ": "<< node->GetVolume()->GetName();
53  }
54 }
55 
void beginJob() override
example_stream void analyze(const edm::Event &, const edm::EventSetup &) override
int iEvent
Definition: GenABIO.cc:224
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
const ESInputTag m_tag
void endJob() override
void analyze(Event const &iEvent, EventSetup const &) override
Namespace of DDCMS conversion namespace.
DDTestDumpGeometry(const ParameterSet &)
HLT enums.
T get() const
Definition: EventSetup.h:71
const std::string & module() const
Definition: ESInputTag.h:99
Detector const * description() const
Definition: DDDetector.h:24