The "Inside" function of G4Polycone does not consider if a side of the polycone points outward or inward. So a point P in the Polycone will be detected to be outside (because it's outside of an inward face). I fixed this by introducing a boolean variable "inward" (witch should be set to true for an inward face) in G4PolyconeSide and considered this in the Inside function of the class. G4Polycone sets this flag for inward faces of the polycone. (I hope you get these files as an attachment - if not and if your are interessted in, please feel free to contact: me h.boie@mpi-hd.mpg.de) Probably the same problem arises for similar solids but I didn't check this. Thanks for developing Geant4, your doing a great job! Yours hans
I want to thank Hans Boie for looking into this problem, and for being brave enough to investigate the code. Hans has since discovered that the problem he is having is not associated with G4Polycone or G4PolyconeSide, but may instead be associated with G4ReplicaNavigation. I will encourage him to file another bug report for G4Replica and will close this particular report. To Hans and other readers, I would like to encourage them to do the following when they believe they have found an error in a G4 solid: 1. Please list the precise parameters used in creating the solid. 2. List the precise point or trajectory which produces an error. It would be particularly helpful if this information can be embedded in a test program that we can run to reproduce the problem. Once we can reproduce the problem ourselves, it should be simple to solve. For reference, this is how G4Polycone decides which surfaces are inward or outward facing: Imagine slicing a polycone by a plane through the z axis. In this plane, the polycone is represented by a series of connected R and Z points. G4Polycone requires that these points are specified in a clockwise manner (see class G4ReduciblePolygon). Each polycone side has a start point (r1,z1) and an end point (r2,z2), and it is the order of these points that determines if a side is inward or outward facing (for example, for an inward side, z1>z2). A vector normal to the face is simply r = (z1-z2), z = (r2-r1).