@@ -22,9 +22,7 @@ G4ThreadLocal GMagneto* GDetectorConstruction::gmagneto = nullptr;
2222GDetectorConstruction::GDetectorConstruction (std::shared_ptr<GOptions> gopts)
2323 : GBase(gopts, GDETECTOR_LOGGER ),
2424 G4VUserDetectorConstruction(), // Geant4 base class.
25- gopt(gopts) {
26- digitization_routines_map = std::make_shared<gdynamicdigitization::dRoutinesMap>();
27- }
25+ gopt(gopts) { digitization_routines_map = std::make_shared<gdynamicdigitization::dRoutinesMap>(); }
2826
2927G4VPhysicalVolume* GDetectorConstruction::Construct () {
3028 log->debug (NORMAL , FUNCTION_NAME );
@@ -42,8 +40,14 @@ G4VPhysicalVolume* GDetectorConstruction::Construct() {
4240
4341 // - if no systems are provided, we just launched gemc: create from options
4442 // - otherwise, it's a geometry re-load. use existing systems.
45- if (gsystems.empty ()) { gworld = std::make_shared<GWorld>(gopt); }
46- else { gworld = std::make_shared<GWorld>(gopt, gsystems); }
43+ if (gsystems.empty ()) {
44+ log->debug (NORMAL , FUNCTION_NAME , " creating world from options" );
45+ gworld = std::make_shared<GWorld>(gopt);
46+ }
47+ else {
48+ log->debug (NORMAL , FUNCTION_NAME , " creating world from a gsystem vector of size " , gsystems.size ());
49+ gworld = std::make_shared<GWorld>(gopt, gsystems);
50+ }
4751
4852 // Build Geant4 world (solids, logical and physical volumes) based on the GEMC world.
4953 g4world = std::make_shared<G4World>(gworld.get (), gopt);
@@ -148,6 +152,7 @@ void GDetectorConstruction::loadDigitizationPlugins() {
148152
149153
150154void GDetectorConstruction::reload_geometry (SystemList sl) {
155+
151156 // it could be empty for tests
152157 if (!sl.empty ()) {
153158 // Use vector assignment to update the local systems.
@@ -163,6 +168,5 @@ void GDetectorConstruction::reload_geometry(SystemList sl) {
163168 rm->DefineWorldVolume (Construct ());
164169 ConstructSDandField ();
165170 }
166-
167171 else { log->error (1 , " GDetectorConstruction::reload_geometry" , " Geant4 Run manager not found." ); }
168172}
0 commit comments