Problem 547

Summary: G4Polyhedra::DistanceToOut() sometimes returns kInfinity on Mac OS
Product: Geant4 Reporter: danielstrul
Component: geometry/solidsAssignee: davidw
Status: RESOLVED FIXED    
Severity: normal    
Priority: P2    
Version: 5.2   
Hardware: Other   
OS: Other   

Description danielstrul 2003-10-16 03:41:49 CEST
I've been shooting particles along random directions on a G4Polyhedra (hexagon
section) : in some cases, the particles fail to find an intersection with the
faces and DistanceToOut() returns kInfinity. From then on, the behaviour of the
particle becomes erratic, often jumping several meters away (out of the World
volume) and causing the simulation to crash.

When this happenned, an intersection could be found by slightly rotating the
particle direction (a few millidegrees). I guessed the particles where missing
the faces because they were going into cracks between the polyhedra faces (but I
may be utterly wrong).

This problem was found an a Mac under the OS Darwin, with G4.5.2+CLHEP1.8, with
optimised compilation. I know there is theoretically no support for this
platform, but in case...

Note that I've repeated this test on a Linux workstation (RH 8.0/gcc3.2): this
problem was also present for G4.4.1+CLHEP1.7.5, but it disappeared with the
G4.5.X+CLHEP1.8 series.

Best regards,
Daniel Strul
Comment 1 davidw 2004-01-06 11:11:59 CET
Thanks to Daniel Strul for supplied a working application demonstrating the bug.
This is greatly appreciated.

This problem was traced to a bug in G4PolyhedraSide, in which a particle could
leak out the exact center of a facet of a polyhedra in which the inner radius is
zero. A fix has been implemented and committed to cvs (G4PolyhedraSide.cc
revision 1.7).