`G4RunManager::ReinitializeGeometry()` with `destroyFirst = true` doesn't clear `G4LogicalBorderSurfaceTable`

I came across this when trying to optimize geometry parameters for scintilator detector. When reconstructing geometry completely, G4LogicalBorderSurface::CleanSurfaceTable() is not called. Border surfaces will still reference removed physical volumes, and result in wrong memory access.

I wonder if this should be included in the destroyFirst switch, or should a note be added?


Geant4 Version: 4.11.1.1
Operating System: Windows
Compiler/Version: msvc v143
CMake Version: 3.24.2

1 Like