Problem 127 - infinite loop originating from G4Cons::DistanceToOut
Summary: infinite loop originating from G4Cons::DistanceToOut
Status: RESOLVED FIXED
Alias: None
Product: Geant4
Classification: Unclassified
Component: geometry/solids (show other problems)
Version: 1.1
Hardware: Sun Solaris
: P1 critical
Assignee: Vladimir.Grichine
URL:
Depends on:
Blocks:
 
Reported: 2000-07-11 13:06 CEST by Hans-Peter.Wellisch
Modified: 2000-10-27 05:49 CEST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this problem.
Description Hans-Peter.Wellisch 2000-07-11 13:06:25 CEST
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....
Comment 1 Gabriele Cosmo 2000-07-19 10:36:59 CEST
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.
Comment 2 Hans-Peter.Wellisch 2000-07-19 11:28:59 CEST
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.
Comment 3 Vladimir.Grichine 2000-07-28 09:22:59 CEST
Under analysis. The problem has been identified in an instability
of the algorithm used for solving quadratic equations.
Comment 4 Gabriele Cosmo 2000-10-27 05:49:59 CEST
Fix introduced since tag "geom-solids-csg-V02-00-01", and now
included in reference tag "geant4-02-00-ref-04".