Skip to content
Snippets Groups Projects
Commit 9fcfde8d authored by Marilena Bandieramonte's avatar Marilena Bandieramonte
Browse files

Merge branch 'fix-fsl-config' into 'master'

Fix interface between fullSimLight configurator and Geant4

See merge request !134
parents 9b7b5d9b d02b7331
No related branches found
No related tags found
1 merge request!134Fix interface between fullSimLight configurator and Geant4
......@@ -267,11 +267,15 @@ int main(int argc, char** argv) {
detector->AddSensitiveDetectorPlugin(element);
}
G4bool initialized=false;
//parse and apply G4Commands
for (const auto& element : simConfig::jf["g4ui_commands"]){
//std::cout<<"G4Commands: "<<element<<std::endl;
for (const G4String& element : simConfig::jf["g4ui_commands"]){
//std::cout<<"Applying G4Commands: "<<element<<std::endl;
//Initialize the Geant4 kernel before applying the first FSL user interface command
if(element.contains("FSLgun") && !initialized) {
runManager->Initialize();
initialized=true;
}
UI->ApplyCommand(element);
}
......@@ -286,8 +290,8 @@ int main(int argc, char** argv) {
<< " ===================================================== " << G4endl;
// Initialize G4 kernel
runManager->Initialize();
// Initialize the G4 kernel if it hasn't been initialized
if (!initialized) runManager->Initialize();
runManager->BeamOn(simConfig::fsl.nEvents);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment