@@ -38,8 +38,14 @@ void export_G4RunManager(py::module &m)
3838 .def (" GetPrintProgress" , &G4RunManager::GetPrintProgress)
3939
4040 .def (" Initialize" , &G4RunManager::Initialize)
41- .def (" BeamOn" , &G4RunManager::BeamOn, py::arg (" n_event" ),
42- py::arg (" macroFile" ) = static_cast <const char *>(nullptr ), py::arg (" n_select" ) = -1 , " Starts event loop." )
41+ .def (
42+ " BeamOn" ,
43+ [](G4RunManager &self, G4int n_event, const char *macroFile = 0 , G4int n_select = -1 ) {
44+ py::gil_scoped_release gil;
45+ self.BeamOn (n_event, macroFile, n_select);
46+ },
47+ py::arg (" n_event" ), py::arg (" macroFile" ) = static_cast <const char *>(nullptr ), py::arg (" n_select" ) = -1 ,
48+ " Starts event loop." )
4349
4450 .def (" SetUserInitialization" ,
4551 [](G4RunManager &self, G4VUserDetectorConstruction *detector) {
@@ -140,7 +146,9 @@ void export_G4RunManager(py::module &m)
140146 py::arg (" topologyIsChanged" ) = true )
141147
142148 .def (" DumpRegion" , py::overload_cast<const G4String &>(&G4RunManager::DumpRegion, py::const_))
143- .def (" DumpRegion" , py::overload_cast<G4Region *>(&G4RunManager::DumpRegion, py::const_))
149+ .def (" DumpRegion" , py::overload_cast<G4Region *>(&G4RunManager::DumpRegion, py::const_),
150+ py::arg (" region" ) = static_cast <G4Region *>(nullptr ))
151+
144152 .def (" rndmSaveThisRun" , &G4RunManager::rndmSaveThisRun)
145153 .def (" rndmSaveThisEvent" , &G4RunManager::rndmSaveThisEvent)
146154 .def (" RestoreRandomNumberStatus" , &G4RunManager::RestoreRandomNumberStatus)
0 commit comments