CMS 3D CMS Logo

DDTestDumpGeometry.cc
Go to the documentation of this file.
4 #include "DD4hep/Detector.h"
5 #include "DD4hep/DD4hepRootPersistency.h"
6 
7 #include "TGeoManager.h"
8 #include "TFile.h"
9 #include "TSystem.h"
10 
11 #include <iostream>
12 #include <string>
13 
15 public:
16  explicit DDTestDumpGeometry( const edm::ParameterSet& );
17 
18  void beginJob() override {}
19  void analyze( edm::Event const& iEvent, edm::EventSetup const& ) override;
20  void endJob() override {}
21 };
22 
24 {}
25 
26 void
28 {
29  std::cout << "DDTestDumpGeometry::analyze:\n";
30  dd4hep::Detector& description = dd4hep::Detector::getInstance();
31 
32  TGeoManager& geom = description.manager();
33 
34  TGeoIterator next( geom.GetTopVolume());
35  TGeoNode *node;
36  TString path;
37  while(( node = next())) {
38  next.GetPath( path );
39  std::cout << path << ": "<< node->GetVolume()->GetName() << "\n";
40  }
41 }
42 
DDTestDumpGeometry(const edm::ParameterSet &)
void beginJob() override
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
int iEvent
Definition: GenABIO.cc:230
void endJob() override
void analyze(edm::Event const &iEvent, edm::EventSetup const &) override