16 #include <DD4hep/DetElement.h>
17 #include <DD4hep/Detector.h>
18 #include <DDG4/Geant4Converter.h>
19 #include <DDG4/Geant4GeometryInfo.h>
20 #include <DDG4/Geant4Mapping.h>
21 #include <Parsers/Printout.h>
26 std::shared_ptr<DD4hep::DD4hepDetector>
detector)
27 : G4VUserDetectorConstruction(), m_detector(std::
move(detector)) {}
33 return m_detector->geometryService->detector();
38 if (m_world ==
nullptr) {
39 dd4hep::sim::Geant4Mapping& g4map = dd4hep::sim::Geant4Mapping::instance();
40 auto conv = dd4hep::sim::Geant4Converter(dd4hepDetector(),
42 dd4hep::sim::Geant4GeometryInfo* geo_info =
43 conv.create(dd4hepDetector().world()).detach();
44 g4map.attach(geo_info);
46 m_world = geo_info->world();
48 g4map.volumeManager();
54 std::shared_ptr<DD4hep::DD4hepDetector>
detector)
55 : m_detector(std::
move(detector)) {}
60 std::unique_ptr<G4VUserDetectorConstruction>
62 return std::make_unique<DDG4DetectorConstruction>(m_detector);