Warning about deleting ... store while geometry closed!

Hi,

I wrote a small G4 application called tiny.cc attached to this post. I compiled it with Geant4.10.7.1. When I run it I got the following warning message at the end of the run:

Run Summary
  Number of events processed : 100
  User=0.010000s Real=0.028433s Sys=0.010000s [Cpu=70.3%]
WARNING - Attempt to delete the physical volume store while geometry closed !
WARNING - Attempt to delete the logical volume store while geometry closed !
WARNING - Attempt to delete the solid store while geometry closed !
WARNING - Attempt to delete the region store while geometry closed !

I have to add the following line

G4GeometryManager::GetInstance()->OpenGeometry();

at the end of the main function to manually open the geometry to avoid those warnings. Why didn’t the run manager automatically open the geometry at the end of a run?

Thanks, Jing

tiny.cc (3.4 KB)
CMakeLists.txt (326 Bytes)
detector.txt|attachment](upload://gR0pMsCVmhj27TWbDqTf2DeuHhy.txt) (767 Bytes)radiate.txt|attachment](upload://nhrGLd7gTC8KazrGcE80g6AMAdA.txt) (717 Bytes)

To repeat the problem, run

$ cd /path/to/tiny
$ mkdir build
$ cd build
$ ccmake ..
$ make
$ cd ..
$ G4RUN_MANAGER_TYPE=Serial ./build/tiny detector.txt radiate.txt

Hi, can you add deletion of the run-manager in the end of your main()?

That solved the problem and how could I forget about that… Thanks!