Hi folks, we have an endless loop in event 1, when trying to run our geant4 based simulation. DistanceToOut returns 0. We have a case, where safeZ gets set to 0, and later this is returned as DistanceToOut. The assignment is done in G4Cons.cc at 2151 safeZ=fDz-fabs(p.z()); The only other interesting thing I saw was that phi seems to be exactly equal to 2*pi. Here a trace: =>[1] G4Cons::DistanceToOut(this = 0x1e203a0, p = CLASS), line 2151 in "G4Cons.cc" [2] G4NormalNavigation::ComputeStep(this = 0x1ca87e8, localPoint = CLASS, localDirection = CLASS, currentProposedStepLength = 1.7976931348623e+308, newSafety = 1.669694454868e-316, history = CLASS, validExitNormal = 1, exitNormal = CLASS, exiting = 0, entering = 0, pBlockedPhysical = 0x1ca876c, blockedReplicaNo = -1), line 45 in "G4NormalNavigation.cc" [3] G4Navigator::ComputeStep(this = 0x1ca8748, pGlobalpoint = CLASS, pDirection = CLASS, pCurrentProposedStepLength = 1.7976931348623e+308, pNewSafety = 1.669694454868e-316), line 521 in "G4Navigator.cc" [4] G4Transportation::AlongStepGetPhysicalInteractionLength(this = 0x2042698, track = CLASS, previousStepSize = 0.0, currentMinimumStep = 1.7976931348623e+308, currentSafety = 0.0, selection = 0x1ca770c), line 159 in "G4Transportation.cc" [5] G4SteppingManager::DefinePhysicalStepLength(this = 0x1ca75d8), line 157 in "G4SteppingManager.icc" [6] G4SteppingManager::Stepping(this = 0x1ca75d8), line 153 in "G4SteppingManager.cc" [7] G4TrackingManager::ProcessOneTrack(this = 0x1c96ae0, apValueG4Track = 0x2db6b40), line 96 in "G4TrackingManager.cc" [8] G4EventManager::ProcessOneEvent(this = 0x1ca7598, anEvent = 0x1c9daa8), line 134 in "G4EventManager.cc" [9] G4RunManager::DoEventLoop(this = 0x1ca7518, n_event = 1, macroFile = (nil), n_select = -1), line 234 in "G4RunManager.cc" [10] G4RunManager::BeamOn(this = 0x1ca7518, n_event = 1, macroFile = (nil), n_select = -1), line 137 in "G4RunManager.cc" [11] G4RunMessenger::SetNewValue(this = 0x1cd0b58, command = 0x1cd4868, newValue = CLASS), line 163 in "G4RunMessenger.cc" [12] G4UIcommand::DoIt(this = 0x1cd4868, parameterList = CLASS), line 151 in "G4UIcommand.cc" [13] G4UImanager::ApplyCommand(this = 0x1cabb90, aCommand = CLASS), line 232 in "G4UImanager.cc" [14] G4UIterminal::ExecuteCommand(this = 0x2a05b98, aCommand = CLASS), line 88 in "G4UIterminal.cc" [15] G4UIterminal::SessionStart(this = 0x2a05b98), line 51 in "G4UIterminal.cc" [16] main(argc = 1, argv = 0xefffe7e4), line 92 in "CMSExample.cc" P.S.: Note that the coding style in this class (G4Cons) beats everything I ever saw in the hadronics....
A fix to G4Cons::DistanceToOut() has been committed after geant4.1.1. It is included in Geant4.2.0. You can also retrieve it by updating to tag "geom-solids-csg-V01-01-04" for geometry/solids/CSG. Please, let us know if that fix the problem. PPS: it's not clear to me what coding style rules you're referring to... :) but recently Vladimir rearranged some cosmectics in the CSG code.
Looking at the repository, I find that the changes in G4Cons.cc between 4.1.1. and 4.2. are the removal of the GetExtent method, and the addition of some print-out. None of these changes hints towards a fix for our problem. Puzzled, Hans-Peter.
Under analysis. The problem has been identified in an instability of the algorithm used for solving quadratic equations.
Fix introduced since tag "geom-solids-csg-V02-00-01", and now included in reference tag "geant4-02-00-ref-04".