File indexing completed on 2025-01-18 09:11:44
0001
0002
0003
0004
0005
0006
0007
0008
0009 #include "ActsExamples/Geant4Detector/GdmlDetectorConstruction.hpp"
0010
0011 #include "ActsExamples/Geant4/Geant4ConstructionOptions.hpp"
0012 #include "ActsExamples/Geant4/RegionCreator.hpp"
0013
0014 #include <utility>
0015
0016 #include <G4GDMLParser.hh>
0017
0018 namespace ActsExamples {
0019
0020 GdmlDetectorConstruction::GdmlDetectorConstruction(
0021 std::string path, const Geant4ConstructionOptions& options)
0022 : G4VUserDetectorConstruction(),
0023 m_path(std::move(path)),
0024 m_options(options) {}
0025
0026 G4VPhysicalVolume* GdmlDetectorConstruction::Construct() {
0027 if (m_world == nullptr) {
0028 G4GDMLParser parser;
0029
0030 parser.Read(m_path);
0031 m_world = parser.GetWorldVolume();
0032
0033
0034 for (const auto& regionCreator : m_options.regionCreators) {
0035 regionCreator->buildRegion();
0036 }
0037 }
0038 return m_world;
0039 }
0040
0041 }