Problem with changing the geometry built by ASCII file

Hi all
I’m using ASCII file to construct the detector.
After a successful BeamOn(), I modify the ASCII file to change the geometry, and call:


Then I call BeamOn() again and the program is aborted with a exception saying

Rotation matrix repeated… R00

Where R00 is a parameter I defined in the ASCII file to build the geometry.
I think this is indicating that when runManager calls the Construct() again in the second BeamOn(), the G4tgbVolumeMgr reads the ASCII again and tries to register the same parameter R00, causing the repeated parameter abort.

If I don’t call ReinitializeGeometry(true); and just


instead, the abort will not happen, however, nor will the geometry modification.

I’ve browsed some G4tgbVolumeMgr source code to find ways delete these parameters and tried deleting G4tgbVolumeMgr pointer at the beginning of Construct(). Unfortunately, these attempts failed.

Therefore, I am asking here for help. Did I make any mistake when changing the geometry? It’s there anything I can do to avoid this repeated parameter abort?

PS: My goal is to implement detector geometry modification without recompiling or even restarting the executable.

A little update here.
Tried to call G4tgrRotationMatricsFactory::GetInstance()->DumpRotmMatrix()(or function with a similar name… ) to dump the repeated R00 and failed.

This is what I do
I am doing

G4GeometryManager* geomMgr = G4GeometryManager::GetInstance();
modify geometry…
// Notify the VisManager as well
pVVisManager = G4VVisManager::GetConcreteInstance();
if(pVVisManager) pVVisManager->GeometryHasChanged();

and it works.