The class DetectorConstrution was only implemented once in many runs

The projection was implemented many times according to different DetectorConstruction class, the parameter in DetectorConstruction class was changed through Messenger class.
but only the result from first run is right, the result from the other runs indicated that the contents in DetectorConstruction class were eliminated.

the key codes:
G4VPhysicalVolume* fpDetectorConstruction::ConstructVolumes()
{
G4GeometryManager::GetInstance()->OpenGeometry();
G4PhysicalVolumeStore::GetInstance()->Clean();
G4LogicalVolumeStore::GetInstance()->Clean();
G4SolidStore::GetInstance()->Clean();



}

//…oooOO0OOooo…oooOO0OOooo…oooOO0OOooo…oooOO0OOooo…

void fpDetectorConstruction::Set_Coincide_Detector_Position(G4double pos)
{
Position=pos;
G4RunManager::GetRunManager()->ReinitializeGeometry();
}

//…oooOO0OOooo…oooOO0OOooo…oooOO0OOooo…oooOO0OOooo…

_Geant4 Version:_11.1.1
_Operating System:_Ubuntu 20.04
_Compiler/Version:_GCC 9.4.0
_CMake Version:_3.16.3


This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.