From 181af0f35630355de52f7b00554c8d3a6d42baf9 Mon Sep 17 00:00:00 2001 From: Jan Kieseler Date: Wed, 20 Sep 2023 23:36:10 +0200 Subject: [PATCH] turn off vis in batch --- src/G4System.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/G4System.cc b/src/G4System.cc index a9e819d..9b833e1 100644 --- a/src/G4System.cc +++ b/src/G4System.cc @@ -111,7 +111,10 @@ void G4System::run_visualize(const std::string& partSpecies, double minEnergy, d for(const auto& c : commands){ UImanager->ApplyCommand(c); } - run_batch(1, partSpecies, minEnergy, maxEnergy); + G4String partSpec = partSpecies; + G4cout << "running visualisation with particle species " << partSpec << G4endl; + actionInitialization->setGeneratorProperties(minEnergy, maxEnergy, partSpec); + runManager->BeamOn(1); } void G4System::run_gui(){ @@ -132,6 +135,7 @@ void G4System::run_batch(int nEvents,const std::string& partSpecies, double minE G4String partSpec = partSpecies; G4cout << "running with particle species " << partSpec << G4endl; UImanager->ApplyCommand("/run/initialize"); + UImanager->ApplyCommand("/vis/disable"); actionInitialization->setGeneratorProperties(minEnergy, maxEnergy, partSpec); runManager->BeamOn(nEvents); }