diff --git a/Simulation/G4Faser/G4FaserAlg/src/G4FaserAlg.cxx b/Simulation/G4Faser/G4FaserAlg/src/G4FaserAlg.cxx index 45b30b961663ccd9131a29c7cfc450743796c297..69ff7cfd61bceff6cebf6a01043012c78c0a379b 100644 --- a/Simulation/G4Faser/G4FaserAlg/src/G4FaserAlg.cxx +++ b/Simulation/G4Faser/G4FaserAlg/src/G4FaserAlg.cxx @@ -200,12 +200,14 @@ void G4FaserAlg::initializeOnce() if(m_userLimitsSvc.retrieve().isFailure()) { throw std::runtime_error("Could not initialize ATLAS UserLimitsSvc!"); } - - G4LogicalVolumeStore* store = G4LogicalVolumeStore::GetInstance(); - G4LogicalVolume* world = store->GetVolume("Faser::Faser"); - G4GDMLParser parser {}; - parser.Write("Faser.gdml", world); - ATH_MSG_ALWAYS("Wrote detector geometry to GDML file"); + + if (!m_gdmlFilename.empty()) + { + G4LogicalVolumeStore* store = G4LogicalVolumeStore::GetInstance(); + G4LogicalVolume* world = store->GetVolume("Faser::Faser"); + G4GDMLParser parser {}; + parser.Write(m_gdmlFilename.value(), world); + } if (m_activateParallelGeometries) { G4VModularPhysicsList* thePhysicsList=dynamic_cast<G4VModularPhysicsList*>(m_physListSvc->GetPhysicsList()); diff --git a/Simulation/G4Faser/G4FaserAlg/src/G4FaserAlg.h b/Simulation/G4Faser/G4FaserAlg/src/G4FaserAlg.h index 420e23f7154244d03d1645aeeddcdf95e7c08ba4..1dbadf47ac6ed83bd5012ead048d077d951e624f 100644 --- a/Simulation/G4Faser/G4FaserAlg/src/G4FaserAlg.h +++ b/Simulation/G4Faser/G4FaserAlg/src/G4FaserAlg.h @@ -120,6 +120,8 @@ private: /// Activate multi-threading configuration Gaudi::Property<bool> m_useMT{this,"MultiThreading", false, "Multi-threading specific settings"}; Gaudi::Property<bool> m_activateParallelGeometries{this, "ActivateParallelWorlds", false, "Toggle on/off the G4 parallel geometry system"}; + /// Dump GDML file + Gaudi::Property<std::string> m_gdmlFilename{this, "GDMLfile", "", "GDML geometry file to write"}; /// Random number service ServiceHandle<IAthRNGSvc> m_rndmGenSvc{this, "AtRndmGenSvc", "AthRNGSvc", ""}; // TODO rename property /// Random Stream Name