Ignore:
Timestamp:
Sep 10, 2008, 5:40:37 PM (17 years ago)
Author:
garnier
Message:

geant4.8.2 beta

Location:
trunk/source/geometry/solids
Files:
265 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/geometry/solids/BREPS/History

    r831 r850  
    1 $Id: History,v 1.68.2.1 2008/04/23 08:59:37 gcosmo Exp $
     1$Id: History,v 1.70 2008/07/08 10:01:13 gcosmo Exp $
    22----------------------------------------------------------------------------
    33
     
    1818     ----------------------------------------------------------
    1919
    20 23/04/2008 : G. Cosmo          breps-V09-00-01
    21 - Tag for release 9.1.p02.
     2008/07/2008 : G. Cosmo          breps-V09-01-02
     21- Replaced exit() statement with G4Exception in G4Ray.
    2222
    232313/03/2008 : G. Cosmo          breps-V09-01-01
  • trunk/source/geometry/solids/BREPS/include/G4Assembly.hh

    r831 r850  
    2626//
    2727// $Id: G4Assembly.hh,v 1.10 2006/06/29 18:37:33 gunter Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4Assembly.icc

    r831 r850  
    2626//
    2727// $Id: G4Assembly.icc,v 1.4 2006/06/29 18:37:35 gunter Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030// --------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4Axis2Placement3D.hh

    r831 r850  
    2626//
    2727// $Id: G4Axis2Placement3D.hh,v 1.5 2006/06/29 18:37:38 gunter Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4Axis2Placement3D.icc

    r831 r850  
    2626//
    2727// $Id: G4Axis2Placement3D.icc,v 1.9 2006/06/29 18:37:41 gunter Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030// --------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4BREPSolid.hh

    r831 r850  
    2626//
    2727// $Id: G4BREPSolid.hh,v 1.17 2006/10/19 15:35:36 gcosmo Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4BREPSolid.icc

    r831 r850  
    2626//
    2727// $Id: G4BREPSolid.icc,v 1.9 2006/10/20 14:23:19 gcosmo Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030// --------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4BREPSolidBox.hh

    r831 r850  
    2626//
    2727// $Id: G4BREPSolidBox.hh,v 1.10 2008/01/22 16:03:13 tnikitin Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4BREPSolidCone.hh

    r831 r850  
    2626//
    2727// $Id: G4BREPSolidCone.hh,v 1.11 2006/06/29 18:37:51 gunter Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4BREPSolidCylinder.hh

    r831 r850  
    2626//
    2727// $Id: G4BREPSolidCylinder.hh,v 1.10 2006/06/29 18:37:53 gunter Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4BREPSolidOpenPCone.hh

    r831 r850  
    2626//
    2727// $Id: G4BREPSolidOpenPCone.hh,v 1.9 2006/06/29 18:37:55 gunter Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4BREPSolidPCone.hh

    r831 r850  
    2626//
    2727// $Id: G4BREPSolidPCone.hh,v 1.14 2006/06/29 18:37:57 gunter Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4BREPSolidPolyhedra.hh

    r831 r850  
    2626//
    2727// $Id: G4BREPSolidPolyhedra.hh,v 1.14 2006/06/29 18:37:59 gunter Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4BREPSolidSphere.hh

    r831 r850  
    2626//
    2727// $Id: G4BREPSolidSphere.hh,v 1.11 2006/06/29 18:38:01 gunter Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4BREPSolidTorus.hh

    r831 r850  
    2626//
    2727// $Id: G4BREPSolidTorus.hh,v 1.10 2006/06/29 18:38:03 gunter Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4BSplineCurve.hh

    r831 r850  
    2626//
    2727// $Id: G4BSplineCurve.hh,v 1.13 2006/06/29 18:38:05 gunter Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4BSplineCurve.icc

    r831 r850  
    2626//
    2727// $Id: G4BSplineCurve.icc,v 1.7 2006/06/29 18:38:07 gunter Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030// --------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4BSplineCurveWithKnots.hh

    r831 r850  
    2626//
    2727// $Id: G4BSplineCurveWithKnots.hh,v 1.5 2006/06/29 18:38:09 gunter Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4BSplineSurface.hh

    r831 r850  
    2626//
    2727// $Id: G4BSplineSurface.hh,v 1.11 2006/06/29 18:38:11 gunter Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4BSplineSurface.icc

    r831 r850  
    2626//
    2727// $Id: G4BSplineSurface.icc,v 1.6 2006/06/29 18:38:14 gunter Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030// --------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4BSplineSurfaceWithKnots.hh

    r831 r850  
    2626//
    2727// $Id: G4BSplineSurfaceWithKnots.hh,v 1.4 2006/06/29 18:38:17 gunter Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4BezierSurface.hh

    r831 r850  
    2626//
    2727// $Id: G4BezierSurface.hh,v 1.7 2006/06/29 18:38:20 gunter Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4BezierSurface.icc

    r831 r850  
    2626//
    2727// $Id: G4BezierSurface.icc,v 1.4 2006/06/29 18:38:22 gunter Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030// --------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4BoundingBox3D.hh

    r831 r850  
    2626//
    2727// $Id: G4BoundingBox3D.hh,v 1.7 2007/05/11 13:49:31 gcosmo Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4BoundingBox3D.icc

    r831 r850  
    2626//
    2727// $Id: G4BoundingBox3D.icc,v 1.4 2006/06/29 18:38:27 gunter Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030// --------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4CircularCurve.hh

    r831 r850  
    2626//
    2727// $Id: G4CircularCurve.hh,v 1.9 2006/06/29 18:38:30 gunter Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4CircularCurve.icc

    r831 r850  
    2626//
    2727// $Id: G4CircularCurve.icc,v 1.6 2006/06/29 18:38:32 gunter Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030// --------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4CompositeCurve.hh

    r831 r850  
    2626//
    2727// $Id: G4CompositeCurve.hh,v 1.8 2006/06/29 18:38:35 gunter Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4CompositeCurve.icc

    r831 r850  
    2626//
    2727// $Id: G4CompositeCurve.icc,v 1.5 2006/06/29 18:38:37 gunter Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030// --------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4Conic.hh

    r831 r850  
    2626//
    2727// $Id: G4Conic.hh,v 1.7 2006/06/29 18:38:39 gunter Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4Conic.icc

    r831 r850  
    2626//
    2727// $Id: G4Conic.icc,v 1.4 2006/06/29 18:38:42 gunter Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030// --------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4ConicalSurface.hh

    r831 r850  
    2626//
    2727// $Id: G4ConicalSurface.hh,v 1.10 2006/06/29 18:38:44 gunter Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4ConicalSurface.icc

    r831 r850  
    2626//
    2727// $Id: G4ConicalSurface.icc,v 1.4 2006/06/29 18:38:47 gunter Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030// --------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4ControlPoints.hh

    r831 r850  
    2626//
    2727// $Id: G4ControlPoints.hh,v 1.7 2006/06/29 18:38:50 gunter Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4ControlPoints.icc

    r831 r850  
    2626//
    2727// $Id: G4ControlPoints.icc,v 1.3 2006/06/29 18:38:52 gunter Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030// --------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4ConvexHull.hh

    r831 r850  
    2626//
    2727// $Id: G4ConvexHull.hh,v 1.7 2006/06/29 18:38:54 gunter Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4Curve.hh

    r831 r850  
    2626//
    2727// $Id: G4Curve.hh,v 1.11 2007/05/11 13:49:31 gcosmo Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4Curve.icc

    r831 r850  
    2626//
    2727// $Id: G4Curve.icc,v 1.7 2006/06/29 18:38:58 gunter Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030// --------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4CurvePoint.hh

    r831 r850  
    2626//
    2727// $Id: G4CurvePoint.hh,v 1.6 2006/06/29 18:39:00 gunter Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4CurvePoint.icc

    r831 r850  
    2626//
    2727// $Id: G4CurvePoint.icc,v 1.4 2006/06/29 18:39:03 gunter Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030// --------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4CurveRayIntersection.hh

    r831 r850  
    2626//
    2727// $Id: G4CurveRayIntersection.hh,v 1.6 2007/05/11 13:49:31 gcosmo Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4CurveRayIntersection.icc

    r831 r850  
    2626//
    2727// $Id: G4CurveRayIntersection.icc,v 1.4 2006/06/29 18:39:07 gunter Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030// --------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4CurveVector.hh

    r831 r850  
    2626//
    2727// $Id: G4CurveVector.hh,v 1.7 2006/06/29 18:39:10 gunter Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4CylindricalSurface.hh

    r831 r850  
    2626//
    2727// $Id: G4CylindricalSurface.hh,v 1.10 2006/06/29 18:39:12 gunter Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4CylindricalSurface.icc

    r831 r850  
    2626//
    2727// $Id: G4CylindricalSurface.icc,v 1.4 2006/06/29 18:39:14 gunter Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030// --------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4Ellipse.hh

    r831 r850  
    2626//
    2727// $Id: G4Ellipse.hh,v 1.10 2006/06/29 18:39:16 gunter Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4Ellipse.icc

    r831 r850  
    2626//
    2727// $Id: G4Ellipse.icc,v 1.8 2006/06/29 18:39:18 gunter Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030// --------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4FConicalSurface.hh

    r831 r850  
    2626//
    2727// $Id: G4FConicalSurface.hh,v 1.13 2006/06/29 18:39:21 gunter Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4FConicalSurface.icc

    r831 r850  
    2626//
    2727// $Id: G4FConicalSurface.icc,v 1.4 2006/06/29 18:39:23 gunter Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030// --------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4FCylindricalSurface.hh

    r831 r850  
    2626//
    2727// $Id: G4FCylindricalSurface.hh,v 1.13 2006/06/29 18:39:25 gunter Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4FCylindricalSurface.icc

    r831 r850  
    2626//
    2727// $Id: G4FCylindricalSurface.icc,v 1.4 2006/06/29 18:39:27 gunter Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030// --------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4FPlane.hh

    r831 r850  
    2626//
    2727// $Id: G4FPlane.hh,v 1.13 2006/06/29 18:39:30 gunter Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4FPlane.icc

    r831 r850  
    2626//
    2727// $Id: G4FPlane.icc,v 1.6 2006/06/29 18:39:32 gunter Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030// --------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4Globals.hh

    r831 r850  
    2626//
    2727// $Id: G4Globals.hh,v 1.5 2006/06/29 18:39:34 gunter Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030// Author: A.Breakstone
  • trunk/source/geometry/solids/BREPS/include/G4Hyperbola.hh

    r831 r850  
    2626//
    2727// $Id: G4Hyperbola.hh,v 1.10 2006/06/29 18:39:36 gunter Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4Hyperbola.icc

    r831 r850  
    2626//
    2727// $Id: G4Hyperbola.icc,v 1.9 2006/06/29 18:39:38 gunter Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030// --------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4KnotVector.hh

    r831 r850  
    2626//
    2727// $Id: G4KnotVector.hh,v 1.10 2007/05/11 13:49:31 gcosmo Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4KnotVector.icc

    r831 r850  
    2626//
    2727// $Id: G4KnotVector.icc,v 1.5 2006/06/29 18:39:42 gunter Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030// --------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4Line.hh

    r831 r850  
    2626//
    2727// $Id: G4Line.hh,v 1.9 2006/06/29 18:39:44 gunter Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4Line.icc

    r831 r850  
    2525//
    2626//
    27 // $Id: G4Line.icc,v 1.9.4.1 2008/04/23 08:59:37 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-01-patch-02 $
     27// $Id: G4Line.icc,v 1.10 2008/03/13 14:18:57 gcosmo Exp $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030// --------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4OsloMatrix.hh

    r831 r850  
    2626//
    2727// $Id: G4OsloMatrix.hh,v 1.6 2006/06/29 18:39:49 gunter Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4OsloMatrix.icc

    r831 r850  
    2626//
    2727// $Id: G4OsloMatrix.icc,v 1.4 2006/06/29 18:39:52 gunter Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030// --------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4Parabola.hh

    r831 r850  
    2626//
    2727// $Id: G4Parabola.hh,v 1.10 2006/06/29 18:39:54 gunter Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4Parabola.icc

    r831 r850  
    2626//
    2727// $Id: G4Parabola.icc,v 1.8 2006/06/29 18:39:57 gunter Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030// --------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4PlacedSolid.hh

    r831 r850  
    2626//
    2727// $Id: G4PlacedSolid.hh,v 1.10 2006/06/29 18:39:59 gunter Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4PlacedSolid.icc

    r831 r850  
    2626//
    2727// $Id: G4PlacedSolid.icc,v 1.8 2006/06/29 18:40:02 gunter Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030// --------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4PlacementVector.hh

    r831 r850  
    2626//
    2727// $Id: G4PlacementVector.hh,v 1.7 2006/06/29 18:40:04 gunter Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4Plane.hh

    r831 r850  
    2626//
    2727// $Id: G4Plane.hh,v 1.6 2006/06/29 18:40:06 gunter Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4Point3DVector.hh

    r831 r850  
    2626//
    2727// $Id: G4Point3DVector.hh,v 1.8 2006/06/29 18:40:09 gunter Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4PointRat.hh

    r831 r850  
    2626//
    2727// $Id: G4PointRat.hh,v 1.10 2006/06/29 18:40:12 gunter Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4PointRat.icc

    r831 r850  
    2626//
    2727// $Id: G4PointRat.icc,v 1.4 2006/06/29 18:40:15 gunter Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030// --------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4ProjectedSurface.hh

    r831 r850  
    2626//
    2727// $Id: G4ProjectedSurface.hh,v 1.7 2006/06/29 18:40:17 gunter Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4ProjectedSurface.icc

    r831 r850  
    2626//
    2727// $Id: G4ProjectedSurface.icc,v 1.5 2006/06/29 18:40:19 gunter Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030// --------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4Ray.hh

    r831 r850  
    2626//
    2727// $Id: G4Ray.hh,v 1.9 2006/06/29 18:40:21 gunter Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4Ray.icc

    r831 r850  
    2626//
    2727// $Id: G4Ray.icc,v 1.7 2006/06/29 18:40:24 gunter Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030// --------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4RectangularTrimmedSurface.hh

    r831 r850  
    2626//
    2727// $Id: G4RectangularTrimmedSurface.hh,v 1.8 2006/06/29 18:40:27 gunter Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4STEPEntity.hh

    r831 r850  
    2626//
    2727// $Id: G4STEPEntity.hh,v 1.7 2006/06/29 18:40:30 gunter Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4Sort.hh

    r831 r850  
    2626//
    2727// $Id: G4Sort.hh,v 1.5 2006/06/29 18:40:33 gunter Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4SphericalSurface.hh

    r831 r850  
    2626//
    2727// $Id: G4SphericalSurface.hh,v 1.10 2006/06/29 18:40:36 gunter Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4SphericalSurface.icc

    r831 r850  
    2626//
    2727// $Id: G4SphericalSurface.icc,v 1.4 2006/06/29 18:40:39 gunter Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030// --------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4Surface.hh

    r831 r850  
    2626//
    2727// $Id: G4Surface.hh,v 1.10 2007/05/11 13:49:32 gcosmo Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4Surface.icc

    r831 r850  
    2626//
    2727// $Id: G4Surface.icc,v 1.5 2006/06/29 18:40:43 gunter Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030// --------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4SurfaceBoundary.hh

    r831 r850  
    2626//
    2727// $Id: G4SurfaceBoundary.hh,v 1.8 2006/06/29 18:40:45 gunter Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4SurfaceBoundary.icc

    r831 r850  
    2626//
    2727// $Id: G4SurfaceBoundary.icc,v 1.5 2006/06/29 18:40:47 gunter Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030// --------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4SurfaceList.hh

    r831 r850  
    2626//
    2727// $Id: G4SurfaceList.hh,v 1.6 2006/06/29 18:40:50 gunter Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4SurfaceOfLinearExtrusion.hh

    r831 r850  
    2626//
    2727// $Id: G4SurfaceOfLinearExtrusion.hh,v 1.5 2006/06/29 18:40:53 gunter Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4SurfaceOfRevolution.hh

    r831 r850  
    2626//
    2727// $Id: G4SurfaceOfRevolution.hh,v 1.5 2006/06/29 18:40:56 gunter Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4ThreeMat.hh

    r831 r850  
    2626//
    2727// $Id: G4ThreeMat.hh,v 1.10 2006/06/29 18:40:58 gunter Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4ToroidalSurface.hh

    r831 r850  
    2626//
    2727// $Id: G4ToroidalSurface.hh,v 1.7 2006/06/29 18:41:01 gunter Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4ToroidalSurface.icc

    r831 r850  
    2626//
    2727// $Id: G4ToroidalSurface.icc,v 1.4 2006/06/29 18:41:03 gunter Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030// --------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4UVHit.hh

    r831 r850  
    2626//
    2727// $Id: G4UVHit.hh,v 1.7 2006/06/29 18:41:05 gunter Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/src/G4Assembly.cc

    r831 r850  
    2626//
    2727// $Id: G4Assembly.cc,v 1.6 2006/06/29 18:41:07 gunter Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/src/G4Axis2Placement3D.cc

    r831 r850  
    2626//
    2727// $Id: G4Axis2Placement3D.cc,v 1.9 2006/06/29 18:41:09 gunter Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/src/G4BREPSolid.cc

    r831 r850  
    2525//
    2626//
    27 // $Id: G4BREPSolid.cc,v 1.36.4.1 2008/04/23 08:59:37 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-01-patch-02 $
     27// $Id: G4BREPSolid.cc,v 1.37 2008/03/13 14:18:57 gcosmo Exp $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/src/G4BREPSolidBox.cc

    r831 r850  
    2626//
    2727// $Id: G4BREPSolidBox.cc,v 1.11 2008/01/22 16:03:52 tnikitin Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/src/G4BREPSolidCone.cc

    r831 r850  
    2525//
    2626// $Id: G4BREPSolidCone.cc,v 1.15 2006/06/29 18:41:16 gunter Exp $
    27 // GEANT4 tag $Name: $
     27// GEANT4 tag $Name: HEAD $
    2828//
    2929// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/src/G4BREPSolidCylinder.cc

    r831 r850  
    2525//
    2626// $Id: G4BREPSolidCylinder.cc,v 1.11 2006/06/29 18:41:18 gunter Exp $
    27 // GEANT4 tag $Name: $
     27// GEANT4 tag $Name: HEAD $
    2828//
    2929// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/src/G4BREPSolidOpenPCone.cc

    r831 r850  
    2626//
    2727// $Id: G4BREPSolidOpenPCone.cc,v 1.11 2006/06/29 18:41:21 gunter Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/src/G4BREPSolidPCone.cc

    r831 r850  
    2525//
    2626// $Id: G4BREPSolidPCone.cc,v 1.38 2006/06/29 18:41:24 gunter Exp $
    27 // GEANT4 tag $Name: $
     27// GEANT4 tag $Name: HEAD $
    2828//
    2929// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/src/G4BREPSolidPolyhedra.cc

    r831 r850  
    2525//
    2626// $Id: G4BREPSolidPolyhedra.cc,v 1.35 2008/01/22 16:04:58 tnikitin Exp $
    27 // GEANT4 tag $Name: $
     27// GEANT4 tag $Name: HEAD $
    2828//
    2929// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/src/G4BREPSolidSphere.cc

    r831 r850  
    2626//
    2727// $Id: G4BREPSolidSphere.cc,v 1.11 2006/06/29 18:41:32 gunter Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/src/G4BREPSolidTorus.cc

    r831 r850  
    2626//
    2727// $Id: G4BREPSolidTorus.cc,v 1.9 2006/06/29 18:41:34 gunter Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/src/G4BSplineCurve.cc

    r831 r850  
    2626//
    2727// $Id: G4BSplineCurve.cc,v 1.12 2006/06/29 18:41:36 gunter Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/src/G4BSplineCurveWithKnots.cc

    r831 r850  
    2626//
    2727// $Id: G4BSplineCurveWithKnots.cc,v 1.5 2006/06/29 18:41:38 gunter Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/src/G4BSplineSurface.cc

    r831 r850  
    2525//
    2626//
    27 // $Id: G4BSplineSurface.cc,v 1.14.4.1 2008/04/23 08:59:37 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-01-patch-02 $
     27// $Id: G4BSplineSurface.cc,v 1.15 2008/03/13 14:18:57 gcosmo Exp $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/src/G4BSplineSurfaceWithKnots.cc

    r831 r850  
    2626//
    2727// $Id: G4BSplineSurfaceWithKnots.cc,v 1.4 2006/06/29 18:41:46 gunter Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/src/G4BezierSurface.cc

    r831 r850  
    2525//
    2626//
    27 // $Id: G4BezierSurface.cc,v 1.9.4.1 2008/04/23 08:59:37 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-01-patch-02 $
     27// $Id: G4BezierSurface.cc,v 1.10 2008/03/13 14:18:57 gcosmo Exp $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/src/G4BoundingBox3D.cc

    r831 r850  
    2626//
    2727// $Id: G4BoundingBox3D.cc,v 1.12 2007/07/16 08:06:55 gcosmo Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/src/G4CircularCurve.cc

    r831 r850  
    2626//
    2727// $Id: G4CircularCurve.cc,v 1.10 2006/06/29 18:41:52 gunter Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/src/G4CompositeCurve.cc

    r831 r850  
    2626//
    2727// $Id: G4CompositeCurve.cc,v 1.13 2006/06/29 18:41:54 gunter Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/src/G4Conic.cc

    r831 r850  
    2626//
    2727// $Id: G4Conic.cc,v 1.8 2006/06/29 18:41:56 gunter Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/src/G4ConicalSurface.cc

    r831 r850  
    2626//
    2727// $Id: G4ConicalSurface.cc,v 1.11 2006/06/29 18:41:58 gunter Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/src/G4ControlPoints.cc

    r831 r850  
    2626//
    2727// $Id: G4ControlPoints.cc,v 1.8 2006/06/29 18:42:00 gunter Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/src/G4Curve.cc

    r831 r850  
    2626//
    2727// $Id: G4Curve.cc,v 1.9 2007/07/16 08:06:55 gcosmo Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/src/G4CurvePoint.cc

    r831 r850  
    2626//
    2727// $Id: G4CurvePoint.cc,v 1.5 2006/06/29 18:42:04 gunter Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/src/G4CurveRayIntersection.cc

    r831 r850  
    2626//
    2727// $Id: G4CurveRayIntersection.cc,v 1.8 2007/07/16 08:06:55 gcosmo Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/src/G4CylindricalSurface.cc

    r831 r850  
    2626//
    2727// $Id: G4CylindricalSurface.cc,v 1.8 2006/06/29 18:42:08 gunter Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/src/G4Ellipse.cc

    r831 r850  
    2626//
    2727// $Id: G4Ellipse.cc,v 1.12 2007/05/18 07:33:31 gcosmo Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/src/G4FConicalSurface.cc

    r831 r850  
    2626//
    2727// $Id: G4FConicalSurface.cc,v 1.19 2006/06/29 18:42:12 gunter Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/src/G4FCylindricalSurface.cc

    r831 r850  
    2626//
    2727// $Id: G4FCylindricalSurface.cc,v 1.16 2006/06/29 18:42:14 gunter Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/src/G4FPlane.cc

    r831 r850  
    2626//
    2727// $Id: G4FPlane.cc,v 1.16 2006/06/29 18:42:16 gunter Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/src/G4Hyperbola.cc

    r831 r850  
    2626//
    2727// $Id: G4Hyperbola.cc,v 1.12 2007/05/18 07:33:31 gcosmo Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/src/G4KnotVector.cc

    r831 r850  
    2525//
    2626//
    27 // $Id: G4KnotVector.cc,v 1.10.2.1 2008/04/23 08:59:37 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-01-patch-02 $
     27// $Id: G4KnotVector.cc,v 1.11 2008/03/13 14:18:57 gcosmo Exp $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/src/G4Line.cc

    r831 r850  
    2626//
    2727// $Id: G4Line.cc,v 1.10 2006/06/29 18:42:22 gunter Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/src/G4OsloMatrix.cc

    r831 r850  
    2626//
    2727// $Id: G4OsloMatrix.cc,v 1.6 2006/06/29 18:42:24 gunter Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/src/G4Parabola.cc

    r831 r850  
    2626//
    2727// $Id: G4Parabola.cc,v 1.9 2007/05/18 07:33:31 gcosmo Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/src/G4PlacedSolid.cc

    r831 r850  
    2626//
    2727// $Id: G4PlacedSolid.cc,v 1.6 2007/05/11 13:49:32 gcosmo Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/src/G4PointRat.cc

    r831 r850  
    2626//
    2727// $Id: G4PointRat.cc,v 1.6 2006/06/29 18:42:30 gunter Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/src/G4ProjectedSurface.cc

    r831 r850  
    2525//
    2626//
    27 // $Id: G4ProjectedSurface.cc,v 1.11.4.1 2008/04/23 08:59:37 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-01-patch-02 $
     27// $Id: G4ProjectedSurface.cc,v 1.12 2008/03/13 14:18:57 gcosmo Exp $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/src/G4Ray.cc

    r831 r850  
    2525//
    2626//
    27 // $Id: G4Ray.cc,v 1.11 2006/06/29 18:42:35 gunter Exp $
    28 // GEANT4 tag $Name: $
     27// $Id: G4Ray.cc,v 1.12 2008/07/08 10:00:58 gcosmo Exp $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030// ----------------------------------------------------------------------
     
    5555{
    5656  if(number_of_plane==1)
    57     return plane2;
     57    { return plane2; }
    5858  else
    59     return plane1;
     59    { return plane1; }
    6060}
    6161
     
    7575 
    7676  if(!NearZero(RayDir.x(), SQRT_SMALL_FASTF))
    77     invdir.setX(1.0 / RayDir.x());
     77    { invdir.setX(1.0 / RayDir.x()); }
    7878   
    7979  if(!NearZero(RayDir.y(), SQRT_SMALL_FASTF))
    80     invdir.setY(1.0 / RayDir.y());
     80    { invdir.setY(1.0 / RayDir.y()); }
    8181   
    8282  if(!NearZero(RayDir.z(), SQRT_SMALL_FASTF))
    83     invdir.setZ(1.0 / RayDir.z());
     83    { invdir.setZ(1.0 / RayDir.z()); }
    8484
    8585  MatVecOrtho(dir1, RayDir);
     
    102102  G4int             i_Which;
    103103
    104   if(NearZero(in.x(), 0.0001) && NearZero(in.y(), 0.0001) &&
    105      NearZero(in.z(), 0.0001) ) 
     104  if( NearZero(in.x(), 0.0001)
     105   && NearZero(in.y(), 0.0001)
     106   && NearZero(in.z(), 0.0001) ) 
    106107  {
    107108    Vsetall( out, 0 );
     
    120121 
    121122  if( std::fabs(in.z()) < f )
     123  {
    122124    i_Which=2;
     125  }
    123126 
    124127  if(!i_Which)
     128  {
    125129    f = std::sqrt((in.y())*(in.y())+(in.z())*(in.z()));    // hypot(in.y(),in.z())
     130  }
    126131  else
     132  {
    127133    if(i_Which==1)
     134    {
    128135      f = std::sqrt((in.z())*(in.z())+(in.x())*(in.x()));  // hypot(in.z(),in.x())
    129     else
    130       f = std::sqrt((in.x())*(in.x())+(in.y())*(in.y()));  // hypot(in.x(),in.y())
    131  
    132     if( NearZero( f, SMALL ) )
    133     {
    134       Vsetall( out, 0 );
    135       return;
    136     }
    137    
    138     f = 1.0/f;
    139    
    140     if(!i_Which)
    141     {
    142       out.setX(0.0);
    143       out.setY(-in.z()*f);
    144       out.setZ( in.y()*f);
    145136    }
    146137    else
    147       if(i_Which==1)
    148       {
    149         out.setY(0.0);
    150         out.setZ(-in.x()*f);
    151         out.setX( in.y()*f);
    152       }
    153       else
    154       {
    155         out.setZ(0.0);
    156         out.setX(-in.z()*f);
    157         out.setY( in.y()*f);
    158       }
     138    {
     139      f = std::sqrt((in.x())*(in.x())+(in.y())*(in.y()));  // hypot(in.x(),in.y())
     140    }
     141  }
     142  if( NearZero( f, SMALL ) )
     143  {
     144    Vsetall( out, 0 );
     145    return;
     146  }
     147   
     148  f = 1.0/f;
     149   
     150  if(!i_Which)
     151  {
     152    out.setX(0.0);
     153    out.setY(-in.z()*f);
     154    out.setZ( in.y()*f);
     155  }
     156  else
     157  {
     158    if(i_Which==1)
     159    {
     160      out.setY(0.0);
     161      out.setZ(-in.x()*f);
     162      out.setX( in.y()*f);
     163    }
     164    else
     165    {
     166      out.setZ(0.0);
     167      out.setX(-in.z()*f);
     168      out.setY( in.y()*f);
     169    }
     170  }
    159171}
    160172
     
    221233  mag = Magnitude(plane1);
    222234  if( mag  <= SQRT_SMALL_FASTF )
     235  {
    223236    return(-1);//        FAIL
     237  }
    224238 
    225239  mag = 1/mag;
     
    240254  if (dir==G4Vector3D(0, 0, 0))
    241255  {
    242     G4cout << "\nZero direction given. Exiting...\n";
    243     exit(1);
     256    G4Exception("G4Ray::RayCheck()", "InvalidInput", FatalException,
     257                "Invalid zero direction given !");
    244258  }
    245259
  • trunk/source/geometry/solids/BREPS/src/G4RectangularTrimmedSurface.cc

    r831 r850  
    2626//
    2727// $Id: G4RectangularTrimmedSurface.cc,v 1.7 2006/06/29 18:42:37 gunter Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/src/G4Sort.cc

    r831 r850  
    2626//
    2727// $Id: G4Sort.cc,v 1.5 2006/06/29 18:42:39 gunter Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/src/G4SphericalSurface.cc

    r831 r850  
    2626//
    2727// $Id: G4SphericalSurface.cc,v 1.10 2006/06/29 18:42:41 gunter Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/src/G4Surface.cc

    r831 r850  
    2626//
    2727// $Id: G4Surface.cc,v 1.17 2007/07/16 08:06:55 gcosmo Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/src/G4SurfaceBoundary.cc

    r831 r850  
    2626//
    2727// $Id: G4SurfaceBoundary.cc,v 1.14 2006/06/29 18:42:46 gunter Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/src/G4SurfaceList.cc

    r831 r850  
    2525//
    2626//
    27 // $Id: G4SurfaceList.cc,v 1.7.4.1 2008/04/23 08:59:37 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-01-patch-02 $
     27// $Id: G4SurfaceList.cc,v 1.8 2008/03/13 14:18:57 gcosmo Exp $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/src/G4SurfaceOfLinearExtrusion.cc

    r831 r850  
    2626//
    2727// $Id: G4SurfaceOfLinearExtrusion.cc,v 1.4 2006/06/29 18:42:51 gunter Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/src/G4SurfaceOfRevolution.cc

    r831 r850  
    2929//
    3030// $Id: G4SurfaceOfRevolution.cc,v 1.4 2006/06/29 18:42:53 gunter Exp $
    31 // GEANT4 tag $Name: $
     31// GEANT4 tag $Name: HEAD $
    3232//
    3333// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/src/G4ThreeMat.cc

    r831 r850  
    2626//
    2727// $Id: G4ThreeMat.cc,v 1.8 2006/06/29 18:42:56 gunter Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/src/G4ToroidalSurface.cc

    r831 r850  
    2626//
    2727// $Id: G4ToroidalSurface.cc,v 1.10 2006/06/29 18:42:59 gunter Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/Boolean/include/G4BooleanSolid.hh

    r831 r850  
    2626//
    2727// $Id: G4BooleanSolid.hh,v 1.15 2006/10/19 15:34:49 gcosmo Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030//
  • trunk/source/geometry/solids/Boolean/include/G4BooleanSolid.icc

    r831 r850  
    2626//
    2727// $Id: G4BooleanSolid.icc,v 1.4 2006/10/20 14:20:54 gcosmo Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030// --------------------------------------------------------------------
  • trunk/source/geometry/solids/Boolean/include/G4DisplacedSolid.hh

    r831 r850  
    2626//
    2727// $Id: G4DisplacedSolid.hh,v 1.19 2006/06/29 18:43:31 gunter Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030//
  • trunk/source/geometry/solids/Boolean/include/G4IntersectionSolid.hh

    r831 r850  
    2626//
    2727// $Id: G4IntersectionSolid.hh,v 1.9 2006/06/29 18:43:33 gunter Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030//
  • trunk/source/geometry/solids/Boolean/include/G4SubtractionSolid.hh

    r831 r850  
    2626//
    2727// $Id: G4SubtractionSolid.hh,v 1.9 2006/06/29 18:43:35 gunter Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030//
  • trunk/source/geometry/solids/Boolean/include/G4UnionSolid.hh

    r831 r850  
    2626//
    2727// $Id: G4UnionSolid.hh,v 1.10 2006/06/29 18:43:37 gunter Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030//
  • trunk/source/geometry/solids/Boolean/src/G4BooleanSolid.cc

    r831 r850  
    2626//
    2727// $Id: G4BooleanSolid.cc,v 1.21 2006/10/19 15:34:49 gcosmo Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030// Implementation for the abstract base class for solids created by boolean
  • trunk/source/geometry/solids/Boolean/src/G4DisplacedSolid.cc

    r831 r850  
    2626//
    2727// $Id: G4DisplacedSolid.cc,v 1.27 2006/06/29 18:43:41 gunter Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030// Implementation for G4DisplacedSolid class for boolean
  • trunk/source/geometry/solids/Boolean/src/G4IntersectionSolid.cc

    r831 r850  
    2626//
    2727// $Id: G4IntersectionSolid.cc,v 1.30 2006/11/08 09:37:41 gcosmo Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030// Implementation of methods for the class G4IntersectionSolid
  • trunk/source/geometry/solids/Boolean/src/G4SubtractionSolid.cc

    r831 r850  
    2626//
    2727// $Id: G4SubtractionSolid.cc,v 1.31 2007/10/23 14:42:31 grichine Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030// Implementation of methods for the class G4IntersectionSolid
  • trunk/source/geometry/solids/Boolean/src/G4UnionSolid.cc

    r831 r850  
    2626//
    2727// $Id: G4UnionSolid.cc,v 1.35 2007/10/23 14:42:31 grichine Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030// Implementation of methods for the class G4IntersectionSolid
  • trunk/source/geometry/solids/CSG/History

    r831 r850  
    1 $Id: History,v 1.99.4.2 2008/04/23 09:55:26 gcosmo Exp $
     1$Id: History,v 1.105 2008/07/07 10:43:04 gcosmo Exp $
    22-------------------------------------------------------------------
    33
     
    1818     ----------------------------------------------------------
    1919
    20 Apr 23, 2008  G.Cosmo                    geom-csg-V09-00-03
    21 - Tag for release 9.1.p02.
     20Jul 07, 2008  V.Grichine                 geom-csg-V09-01-04
     21- G4Sphere: fixed bug in DistanceToOut(p, v, ...) for normal 'fSTheta'
     22  greater than 90*deg, and use of tangent giving negative value.
     23  Completes series of corrections introduced in previous tag.
     24
     25Jun 23, 2008  T.Nikitina                 geom-csg-V09-01-03
     26- G4Tubs: fix in DistanceToIn(p,v, ...) in case of point on surface with
     27  very small tangent direction; now returning kInfinity and no longer zero.
     28  It fixes rare observed cases of zero value returned by both DistanceToIn()
     29  and DistanceToOut(), causing stuck tracks with zero step length.
     30
     31Jun 20, 2008  V.Grichine
     32- G4Sphere: fixed calculation of roots in DistanceToOut(p,v,...) for
     33  theta-conical surfaces interserctions and for sTheta<=90 degree intersection.
     34  Addresses issue reported when running PET application with optical photons
     35  about mis-computation of distance on half-sphere constructs.
     36- Updated unit test for sphere.
    2237
    2338Apr 22, 2008  V.Grichine                 geom-csg-V09-01-02
  • trunk/source/geometry/solids/CSG/include/G4Box.hh

    r831 r850  
    2626//
    2727// $Id: G4Box.hh,v 1.17 2006/10/19 15:33:37 gcosmo Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030// --------------------------------------------------------------------
  • trunk/source/geometry/solids/CSG/include/G4Box.icc

    r831 r850  
    2626//
    2727// $Id: G4Box.icc,v 1.6 2006/10/19 15:33:37 gcosmo Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030// --------------------------------------------------------------------
  • trunk/source/geometry/solids/CSG/include/G4CSGSolid.hh

    r831 r850  
    2626//
    2727// $Id: G4CSGSolid.hh,v 1.12 2006/10/19 15:33:37 gcosmo Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030// 
  • trunk/source/geometry/solids/CSG/include/G4Cons.hh

    r831 r850  
    2626//
    2727// $Id: G4Cons.hh,v 1.18 2007/05/18 07:38:00 gcosmo Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030//
  • trunk/source/geometry/solids/CSG/include/G4Cons.icc

    r831 r850  
    2626//
    2727// $Id: G4Cons.icc,v 1.6 2006/10/19 15:33:37 gcosmo Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030// --------------------------------------------------------------------
  • trunk/source/geometry/solids/CSG/include/G4Orb.hh

    r831 r850  
    2626//
    2727// $Id: G4Orb.hh,v 1.11 2006/10/19 15:33:37 gcosmo Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030//
  • trunk/source/geometry/solids/CSG/include/G4Orb.icc

    r831 r850  
    2626//
    2727// $Id: G4Orb.icc,v 1.5 2006/10/19 15:33:37 gcosmo Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030// --------------------------------------------------------------------
  • trunk/source/geometry/solids/CSG/include/G4Para.hh

    r831 r850  
    2626//
    2727// $Id: G4Para.hh,v 1.18 2006/10/19 15:33:37 gcosmo Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030//
  • trunk/source/geometry/solids/CSG/include/G4Para.icc

    r831 r850  
    2626//
    2727// $Id: G4Para.icc,v 1.7 2006/10/19 15:33:37 gcosmo Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030// --------------------------------------------------------------------
  • trunk/source/geometry/solids/CSG/include/G4Sphere.hh

    r831 r850  
    2626//
    2727// $Id: G4Sphere.hh,v 1.20 2007/05/18 07:38:00 gcosmo Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030//
  • trunk/source/geometry/solids/CSG/include/G4Sphere.icc

    r831 r850  
    2626//
    2727// $Id: G4Sphere.icc,v 1.7 2006/10/19 15:33:37 gcosmo Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030// --------------------------------------------------------------------
  • trunk/source/geometry/solids/CSG/include/G4Torus.hh

    r831 r850  
    2626//
    2727// $Id: G4Torus.hh,v 1.27 2007/05/18 07:38:00 gcosmo Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030//
  • trunk/source/geometry/solids/CSG/include/G4Torus.icc

    r831 r850  
    2626//
    2727// $Id: G4Torus.icc,v 1.6 2006/10/19 15:33:37 gcosmo Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030// --------------------------------------------------------------------
  • trunk/source/geometry/solids/CSG/include/G4Trap.hh

    r831 r850  
    2626//
    2727// $Id: G4Trap.hh,v 1.17 2006/10/19 15:33:37 gcosmo Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030//
  • trunk/source/geometry/solids/CSG/include/G4Trap.icc

    r831 r850  
    2626//
    2727// $Id: G4Trap.icc,v 1.8 2006/10/19 15:33:37 gcosmo Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030// --------------------------------------------------------------------
  • trunk/source/geometry/solids/CSG/include/G4Trd.hh

    r831 r850  
    2626//
    2727// $Id: G4Trd.hh,v 1.16 2006/10/19 15:33:37 gcosmo Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030//
  • trunk/source/geometry/solids/CSG/include/G4Trd.icc

    r831 r850  
    2626//
    2727// $Id: G4Trd.icc,v 1.7 2006/10/19 15:33:37 gcosmo Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030// --------------------------------------------------------------------
  • trunk/source/geometry/solids/CSG/include/G4Tubs.hh

    r831 r850  
    2626//
    2727// $Id: G4Tubs.hh,v 1.17 2007/05/18 07:38:00 gcosmo Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030//
  • trunk/source/geometry/solids/CSG/include/G4Tubs.icc

    r831 r850  
    2626//
    2727// $Id: G4Tubs.icc,v 1.7 2006/10/19 15:33:37 gcosmo Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030// --------------------------------------------------------------------
  • trunk/source/geometry/solids/CSG/src/G4Box.cc

    r831 r850  
    2626//
    2727// $Id: G4Box.cc,v 1.44 2006/10/19 15:33:37 gcosmo Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030//
  • trunk/source/geometry/solids/CSG/src/G4CSGSolid.cc

    r831 r850  
    2626//
    2727// $Id: G4CSGSolid.cc,v 1.13 2006/10/19 15:33:37 gcosmo Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030// --------------------------------------------------------------------
  • trunk/source/geometry/solids/CSG/src/G4Cons.cc

    r831 r850  
    2525//
    2626//
    27 // $Id: G4Cons.cc,v 1.54.4.1 2008/04/23 09:05:23 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-01-patch-02 $
     27// $Id: G4Cons.cc,v 1.56 2008/02/20 08:56:16 gcosmo Exp $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030//
  • trunk/source/geometry/solids/CSG/src/G4Orb.cc

    r831 r850  
    2525//
    2626// $Id: G4Orb.cc,v 1.24 2007/05/18 07:38:01 gcosmo Exp $
    27 // GEANT4 tag $Name: $
     27// GEANT4 tag $Name: HEAD $
    2828//
    2929// class G4Orb
  • trunk/source/geometry/solids/CSG/src/G4Para.cc

    r831 r850  
    2626//
    2727// $Id: G4Para.cc,v 1.39 2006/10/19 15:33:37 gcosmo Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030// class G4Para
  • trunk/source/geometry/solids/CSG/src/G4Sphere.cc

    r831 r850  
    2525//
    2626//
    27 // $Id: G4Sphere.cc,v 1.57.2.1 2008/04/23 09:05:23 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-01-patch-02 $
     27// $Id: G4Sphere.cc,v 1.68 2008/07/07 09:35:16 grichine Exp $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030// class G4Sphere
     
    3434// History:
    3535//
     36// 12.06.08 V.Grichine: fix for theta intersections in DistanceToOut(p,v,...)
    3637// 22.07.05 O.Link    : Added check for intersection with double cone
    3738// 03.05.05 V.Grichine: SurfaceNormal(p) according to J. Apostolakis proposal
     
    4748// 25.11.98 V.Grichine: bug fixed in DistanceToIn(p,v), phi intersections
    4849// 12.11.98 V.Grichine: bug fixed in DistanceToIn(p,v), theta intersections
    49 // 09.10.98 V.Grichine: modifications in Distance ToOut(p,v,...)
     50// 09.10.98 V.Grichine: modifications in DistanceToOut(p,v,...)
    5051// 17.09.96 V.Grichine: final modifications to commit
    5152// 28.03.94 P.Kent: old C++ code converted to tolerant geometry
     
    608609      distETheta = std::fabs(pTheta-fSTheta-fDTheta);
    609610 
    610       nTs = G4ThreeVector(-std::cos(fSTheta)*std::cos(pPhi),
    611                         -std::cos(fSTheta)*std::sin(pPhi),
    612                          std::sin(fSTheta)               );
    613       nTe = G4ThreeVector( std::cos(fSTheta+fDTheta)*std::cos(pPhi),
    614                          std::cos(fSTheta+fDTheta)*std::sin(pPhi),
    615                         -std::sin(fSTheta+fDTheta)               );   
     611      nTs = G4ThreeVector(-std::cos(fSTheta)*p.x()/rho, //  *std::cos(pPhi),
     612                          -std::cos(fSTheta)*p.y()/rho, //  *std::sin(pPhi),
     613                           std::sin(fSTheta)                   );
     614
     615      nTe = G4ThreeVector( std::cos(fSTheta+fDTheta)*p.x()/rho, // *std::cos(pPhi),
     616                           std::cos(fSTheta+fDTheta)*p.y()/rho, // *std::sin(pPhi),
     617                          -std::sin(fSTheta+fDTheta)                  );   
    616618    }
    617619    else if( !fRmin )
    618620    {
    619       if ( fSTheta )                distSTheta = 0.;
    620       if ( fSTheta + fDTheta < pi ) distETheta = 0.;
     621      if ( fSTheta ) 
     622      {             
     623        distSTheta = 0.;
     624        nTs = G4ThreeVector(0.,0.,-1.);
     625      }
     626      if ( fSTheta + fDTheta < pi ) // distETheta = 0.;
     627      {             
     628        distETheta = 0.;
     629        nTe = G4ThreeVector(0.,0.,1.);
     630      }
    621631    }   
    622632  }
     
    14231433        d = std::sqrt(d2) ;
    14241434        s = -b - d ;    // First root
    1425 
    1426         if ( s < 0 )
    1427         {
    1428           s=-b+d;    // Second root
     1435        zi    = p.z() + s*v.z();
     1436
     1437        if ( s < 0 || zi*(fSTheta - halfpi) > 0 )
     1438        {
     1439          s = -b+d;    // Second root
    14291440        }
    14301441        if (s >= 0 && s < snxt)
    14311442        {
    1432           xi    = p.x() + s*v.x() ;
    1433           yi    = p.y() + s*v.y() ;
    1434           zi    = p.z() + s*v.z() ;
    1435           rhoi2 = xi*xi + yi*yi   ;
    1436           radi2 = rhoi2 + zi*zi   ;
     1443          xi    = p.x() + s*v.x();
     1444          yi    = p.y() + s*v.y();
     1445          zi    = p.z() + s*v.z();
     1446          rhoi2 = xi*xi + yi*yi;
     1447          radi2 = rhoi2 + zi*zi;
    14371448          if ( (radi2 <= tolORMax2)
    14381449            && (radi2 >= tolORMin2)
     
    15011512      }
    15021513    } 
    1503     else if (pTheta > tolETheta)
    1504     { // dist2ETheta<-kRadTolerance*0.5 && dist2STheta>0)
    1505       // Inside (theta>etheta+tol) e theta cone
     1514    else if ( pTheta > tolETheta )
     1515    {
     1516      // dist2ETheta<-kRadTolerance*0.5 && dist2STheta>0)
     1517      // Inside (theta > etheta+tol) e-theta cone
    15061518      // First root of etheta cone, second if first root `imaginary'
    15071519
     
    15171529        d = std::sqrt(d2) ;
    15181530        s = -b - d ;    // First root
    1519         if (s < 0)
     1531        zi    = p.z() + s*v.z();
     1532
     1533        if (s < 0 || zi*(fSTheta + fDTheta - halfpi) > 0)
    15201534        {
    15211535          s = -b + d ;           // second root
     
    19591973
    19601974  G4bool segTheta;                             // Theta flag and precals
    1961   G4double tanSTheta=0.,tanETheta, rhoSecTheta;
     1975  G4double tanSTheta=0.,tanETheta=0., rhoSecTheta;
    19621976  G4double tanSTheta2=0.,tanETheta2=0.;
    1963   G4double dist2STheta,dist2ETheta;
     1977  G4double dist2STheta, dist2ETheta, distTheta;
    19641978  G4double d2,s;
    19651979
    19661980  // General Precalcs
    19671981
    1968   rho2=p.x()*p.x()+p.y()*p.y();
    1969   rad2=rho2+p.z()*p.z();
     1982  rho2 = p.x()*p.x()+p.y()*p.y();
     1983  rad2 = rho2+p.z()*p.z();
    19701984  //  G4double rad=std::sqrt(rad2);
    19711985
    1972   pTheta=std::atan2(std::sqrt(rho2),p.z());
    1973 
    1974   pDotV2d=p.x()*v.x()+p.y()*v.y();
    1975   pDotV3d=pDotV2d+p.z()*v.z();
     1986  pTheta = std::atan2(std::sqrt(rho2),p.z());
     1987
     1988  pDotV2d = p.x()*v.x()+p.y()*v.y();
     1989  pDotV3d = pDotV2d+p.z()*v.z();
    19761990
    19771991  // Set phi divided flag and precalcs
    19781992
    1979   if(fDPhi<twopi)
     1993  if( fDPhi < twopi )
    19801994  {
    19811995    segPhi=true;
     
    19962010  // Theta precalcs
    19972011   
    1998   if (fDTheta < pi)
    1999   {
    2000     segTheta=true;
    2001     tolSTheta=fSTheta-kAngTolerance*0.5;
    2002     tolETheta=fSTheta+fDTheta+kAngTolerance*0.5;
    2003   }
    2004   else
    2005   {
    2006     segTheta=false;
    2007   }
     2012  if ( fDTheta < pi )
     2013  {
     2014    segTheta  = true;
     2015    tolSTheta = fSTheta - kAngTolerance*0.5;
     2016    tolETheta = fSTheta + fDTheta + kAngTolerance*0.5;
     2017  }
     2018  else segTheta = false;
     2019
    20082020   
    20092021  // Radial Intersections from G4Sphere::DistanceToIn
     
    20242036  //
    20252037  // const G4double  fractionTolerance = 1.0e-12;
    2026   const G4double  flexRadMaxTolerance = // kRadTolerance;
     2038
     2039  const G4double  flexRadMaxTolerance =            // kRadTolerance;
    20272040    std::max(kRadTolerance, fEpsilon * fRmax);
    20282041
    20292042  const G4double  Rmax_plus = fRmax + flexRadMaxTolerance*0.5;
     2043
    20302044  const G4double  flexRadMinTolerance = std::max(kRadTolerance,
    20312045                     fEpsilon * fRmin);
     2046
    20322047  const G4double  Rmin_minus= (fRmin > 0) ? fRmin-flexRadMinTolerance*0.5 : 0 ;
    20332048
     
    20632078      else
    20642079      {
    2065         snxt=-pDotV3d+std::sqrt(d2);    // second root since inside Rmax
    2066         side = kRMax ;
     2080        snxt = -pDotV3d+std::sqrt(d2);    // second root since inside Rmax
     2081        side =  kRMax ;
    20672082      }
    20682083    }
     
    20772092      d2 = pDotV3d*pDotV3d - c;
    20782093
    2079       if (c >- flexRadMinTolerance*fRmin) // 2.0 * (0.5*kRadTolerance) * fRmin
     2094      if ( c >- flexRadMinTolerance*fRmin ) // 2.0 * (0.5*kRadTolerance) * fRmin
    20802095      {
    20812096        if( c < flexRadMinTolerance*fRmin &&
    20822097            d2 >= flexRadMinTolerance*fRmin && pDotV3d < 0 ) // leaving from Rmin
    20832098        {
    2084           if(calcNorm)
    2085           {
    2086             *validNorm = false ;   // Rmin surface is concave
    2087           }
    2088           return snxt = 0 ;
     2099          if(calcNorm)  *validNorm = false ;   // Rmin surface is concave         
     2100                       return snxt = 0 ;
    20892101        }
    20902102        else
    20912103        { 
    2092           if (d2 >= 0)
    2093           {
    2094             s = -pDotV3d-std::sqrt(d2) ;
    2095             if (s>=0)     // Always intersect Rmin first
     2104          if ( d2 >= 0. )
     2105          {
     2106            s = -pDotV3d-std::sqrt(d2);
     2107
     2108            if ( s >= 0. )     // Always intersect Rmin first
    20962109            {
    20972110              snxt = s ;
     
    21292142    // => s^2(1-vz^2(1+tan^2(t))+2s(pdotv2d-pzvztan^2(t))+(rho2-pz^2tan^2(t))=0
    21302143    //
     2144 
     2145    /* ////////////////////////////////////////////////////////
     2146
    21312147    tanSTheta=std::tan(fSTheta);
    21322148    tanSTheta2=tanSTheta*tanSTheta;
     
    22882304              s = kInfinity ;  // wrong cone
    22892305            }
    2290             if (s < stheta)
    2291             {
    2292               stheta = s ;
    2293               sidetheta = kETheta ;
    2294             }
     2306          }
     2307          if (s < stheta)
     2308          {
     2309            stheta = s ;
     2310            sidetheta = kETheta ;
    22952311          }
    22962312        }
    22972313      }
    22982314    } 
    2299   }
     2315    */  ////////////////////////////////////////////////////////////
     2316
     2317    if(fSTheta) // intersection with first cons
     2318    {
     2319
     2320      tanSTheta = std::tan(fSTheta);
     2321
     2322      if( std::fabs(tanSTheta) > 5./kAngTolerance ) // kons is plane z=0
     2323      {
     2324        if( v.z() > 0. )
     2325        {
     2326          if ( std::fabs( p.z() ) <= flexRadMaxTolerance*0.5 )
     2327          {
     2328            if(calcNorm)
     2329            {
     2330              *validNorm = true;
     2331              *n = G4ThreeVector(0.,0.,1.);
     2332            }
     2333            return snxt = 0 ;
     2334          } 
     2335          // s = -p.z()/v.z();
     2336          stheta    = -p.z()/v.z();
     2337          sidetheta = kSTheta;
     2338        }
     2339      }
     2340      else // kons is not plane
     2341      {
     2342        tanSTheta2  = tanSTheta*tanSTheta;
     2343        t1          = 1-v.z()*v.z()*(1+tanSTheta2);
     2344        t2          = pDotV2d-p.z()*v.z()*tanSTheta2;  // ~vDotN if p on cons
     2345        dist2STheta = rho2-p.z()*p.z()*tanSTheta2;      // t3
     2346
     2347        // distTheta = std::sqrt(std::fabs(dist2STheta/(1+tanSTheta2)));
     2348        distTheta = std::sqrt(rho2)-p.z()*tanSTheta;
     2349
     2350        if( std::fabs(t1) < 0.5*kAngTolerance ) // 1st order equation, v parallel to kons
     2351        {
     2352          if( v.z() > 0. )
     2353          {
     2354            if(std::fabs(distTheta) < flexRadMaxTolerance*0.5) // p on surface
     2355            {
     2356              if( fSTheta < halfpi && p.z() > 0. )
     2357              {
     2358                if( calcNorm ) *validNorm = false;
     2359                              return snxt = 0.;
     2360              }
     2361              else if( fSTheta > halfpi && p.z() <= 0)
     2362              {
     2363                if( calcNorm )
     2364                {
     2365                  *validNorm = true;
     2366                  if (rho2)
     2367                  {
     2368                    rhoSecTheta = std::sqrt(rho2*(1+tanSTheta2));
     2369                   
     2370                    *n = G4ThreeVector( p.x()/rhoSecTheta,   
     2371                                        p.y()/rhoSecTheta,
     2372                                        std::sin(fSTheta)  );
     2373                  }
     2374                  else *n = G4ThreeVector(0.,0.,1.);
     2375                }
     2376                return snxt = 0.;               
     2377              }
     2378            }
     2379            // s = -0.5*dist2STheta/t2;
     2380
     2381            stheta    = -0.5*dist2STheta/t2;
     2382            sidetheta = kSTheta;
     2383          } 
     2384        }
     2385        else   // 2nd order equation, 1st root of fSTheta cone, 2nd if 1st root -ve
     2386        {
     2387          if( std::fabs(distTheta) < flexRadMaxTolerance*0.5) // && t2 >= 0.) surface
     2388          {
     2389            if( fSTheta > halfpi && t2 >= 0. ) // leave
     2390            {
     2391              if( calcNorm )
     2392              {
     2393                *validNorm = true;
     2394                if (rho2)
     2395                {
     2396                    rhoSecTheta = std::sqrt(rho2*(1+tanSTheta2));
     2397                   
     2398                    *n = G4ThreeVector( p.x()/rhoSecTheta,   
     2399                                        p.y()/rhoSecTheta,
     2400                                        std::sin(fSTheta)  );
     2401                }
     2402                else *n = G4ThreeVector(0.,0.,1.);
     2403              }                           
     2404              return snxt = 0.;
     2405            }
     2406            else if( fSTheta < halfpi  && t2 < 0. && p.z() >=0. ) // leave
     2407            {
     2408                if( calcNorm )   *validNorm = false;                                                 
     2409                return snxt = 0.;
     2410            }                               
     2411          }
     2412          b  = t2/t1;
     2413          c  = dist2STheta/t1;
     2414          d2 = b*b - c ;
     2415
     2416          if ( d2 >= 0. )
     2417          {
     2418            d = std::sqrt(d2);
     2419
     2420            if( fSTheta > halfpi )
     2421            {
     2422              s = -b - d;         // First root
     2423
     2424              if( (std::fabs(s) < flexRadMaxTolerance*0.5 && t2 < 0.) ||
     2425                              s < 0.  ||
     2426                  ( s > 0. && p.z() + s*v.z() > 0.)                   )
     2427              {
     2428                s = -b + d ; // 2nd root
     2429              }
     2430              if( s >  flexRadMaxTolerance*0.5 && p.z() + s*v.z() <= 0.) 
     2431              {
     2432                stheta    = s;
     2433                sidetheta = kSTheta;
     2434              }
     2435            }
     2436            else // sTheta < pi/2, concave surface, no normal
     2437            {
     2438              s = -b - d;         // First root
     2439
     2440              if( (std::fabs(s) < flexRadMaxTolerance*0.5 && t2 >= 0.) ||
     2441                              s < 0.                                   ||
     2442                  ( s > 0. && p.z() + s*v.z() < 0.)                      )
     2443              {
     2444                s = -b + d ; // 2nd root
     2445              }
     2446              if( s >  flexRadMaxTolerance*0.5 && p.z() + s*v.z() >= 0.) 
     2447              {
     2448                stheta    = s;
     2449                sidetheta = kSTheta;
     2450              }           
     2451            }
     2452          }
     2453        }
     2454      }
     2455    }
     2456    if (fSTheta + fDTheta < pi) // intersection with second cons
     2457    {
     2458
     2459      tanETheta = std::tan(fSTheta+fDTheta);
     2460
     2461      if( std::fabs(tanETheta) > 5./kAngTolerance ) // kons is plane z=0
     2462      {
     2463        if( v.z() < 0. )
     2464        {
     2465          if ( std::fabs( p.z() ) <= flexRadMaxTolerance*0.5 )
     2466          {
     2467            if(calcNorm)
     2468            {
     2469              *validNorm = true;
     2470              *n = G4ThreeVector(0.,0.,-1.);
     2471            }
     2472            return snxt = 0 ;
     2473          } 
     2474          s = -p.z()/v.z();
     2475
     2476          if( s < stheta)
     2477          {
     2478            stheta    = s;
     2479            sidetheta = kETheta;
     2480          }
     2481        }
     2482      }
     2483      else // kons is not plane
     2484      {
     2485        tanETheta2  = tanETheta*tanETheta;
     2486        t1          = 1-v.z()*v.z()*(1+tanETheta2);
     2487        t2          = pDotV2d-p.z()*v.z()*tanETheta2;  // ~vDotN if p on cons
     2488        dist2ETheta = rho2-p.z()*p.z()*tanETheta2;      // t3
     2489
     2490        // distTheta = std::sqrt(std::fabs(dist2ETheta/(1+tanETheta2)));
     2491        distTheta = std::sqrt(rho2)-p.z()*tanETheta;
     2492
     2493        if( std::fabs(t1) < 0.5*kAngTolerance ) // 1st order equation, v parallel to kons
     2494        {
     2495          if( v.z() < 0. )
     2496          {
     2497            if(std::fabs(distTheta) < flexRadMaxTolerance*0.5) // p on surface
     2498            {
     2499              if( fSTheta+fDTheta > halfpi && p.z() < 0. )
     2500              {
     2501                if( calcNorm ) *validNorm = false;
     2502                              return snxt = 0.;
     2503              }
     2504              else if( fSTheta+fDTheta < halfpi && p.z() >= 0)
     2505              {
     2506                if( calcNorm )
     2507                {
     2508                  *validNorm = true;
     2509                  if (rho2)
     2510                  {
     2511                    rhoSecTheta = std::sqrt(rho2*(1+tanETheta2));
     2512                   
     2513                    *n = G4ThreeVector( p.x()/rhoSecTheta,   
     2514                                        p.y()/rhoSecTheta,
     2515                                        -std::sin(fSTheta+fDTheta)  );
     2516                  }
     2517                  else *n = G4ThreeVector(0.,0.,-1.);
     2518                }
     2519                return snxt = 0.;               
     2520              }
     2521            }
     2522            s = -0.5*dist2ETheta/t2;
     2523
     2524            if( s < stheta)
     2525            {
     2526              stheta    = s;
     2527              sidetheta = kETheta;
     2528            }
     2529          } 
     2530        }
     2531        else   // 2nd order equation, 1st root of fSTheta cone, 2nd if 1st root -ve
     2532        {
     2533          if( std::fabs(distTheta) < flexRadMaxTolerance*0.5) // && t2 >= 0.) surface
     2534          {
     2535            if( fSTheta+fDTheta < halfpi && t2 >= 0. ) // leave
     2536            {
     2537              if( calcNorm )
     2538              {
     2539                *validNorm = true;
     2540                if (rho2)
     2541                {
     2542                    rhoSecTheta = std::sqrt(rho2*(1+tanETheta2));
     2543                   
     2544                    *n = G4ThreeVector( p.x()/rhoSecTheta,   
     2545                                        p.y()/rhoSecTheta,
     2546                                        -std::sin(fSTheta+fDTheta)  );
     2547                }
     2548                else *n = G4ThreeVector(0.,0.,-1.);
     2549              }                           
     2550              return snxt = 0.;
     2551            }
     2552            else if( fSTheta+fDTheta > halfpi  && t2 < 0. && p.z() <=0. ) // leave
     2553            {
     2554                if( calcNorm )   *validNorm = false;                                                 
     2555                return snxt = 0.;
     2556            }                               
     2557          }
     2558          b  = t2/t1;
     2559          c  = dist2ETheta/t1;
     2560          d2 = b*b - c ;
     2561
     2562          if ( d2 >= 0. )
     2563          {
     2564            d = std::sqrt(d2);
     2565
     2566            if( fSTheta+fDTheta < halfpi )
     2567            {
     2568              s = -b - d;         // First root
     2569
     2570              if( (std::fabs(s) < flexRadMaxTolerance*0.5 && t2 < 0.) ||
     2571                              s < 0. )
     2572              {
     2573                s = -b + d ; // 2nd root
     2574              }
     2575              if( s >  flexRadMaxTolerance*0.5 ) 
     2576              {
     2577                if( s < stheta )
     2578                {
     2579                  stheta    = s;
     2580                  sidetheta = kETheta;
     2581                }
     2582              }
     2583            }
     2584            else // sTheta+fDTheta > pi/2, concave surface, no normal
     2585            {
     2586              s = -b - d;         // First root
     2587
     2588              if( (std::fabs(s) < flexRadMaxTolerance*0.5 && t2 >= 0.) ||
     2589                              s < 0.                                   ||
     2590                  ( s > 0. && p.z() + s*v.z() > 0.)                      )
     2591              {
     2592                s = -b + d ; // 2nd root
     2593              }
     2594              if( s >  flexRadMaxTolerance*0.5 && p.z() + s*v.z() <= 0.) 
     2595              {
     2596                if( s < stheta )
     2597                {
     2598                  stheta    = s;
     2599                  sidetheta = kETheta;
     2600                }
     2601              }           
     2602            }
     2603          }
     2604        }
     2605      }
     2606    }
     2607
     2608  } // end theta intersections
    23002609
    23012610  // Phi Intersection
     
    25782887        *validNorm=true;
    25792888        break;
     2889
    25802890      case kRMin:
    25812891        *validNorm=false;  // Rmin is concave
    25822892        break;
     2893
    25832894      case kSPhi:
    2584         if (fDPhi<=pi)     // Normal to Phi-
     2895        if ( fDPhi <= pi )     // Normal to Phi-
    25852896        {
    25862897          *n=G4ThreeVector(std::sin(fSPhi),-std::cos(fSPhi),0);
     
    25892900        else *validNorm=false;
    25902901        break ;
     2902
    25912903      case kEPhi:
    2592         if (fDPhi<=pi)      // Normal to Phi+
     2904        if ( fDPhi <= pi )      // Normal to Phi+
    25932905        {
    25942906          *n=G4ThreeVector(-std::sin(fSPhi+fDPhi),std::cos(fSPhi+fDPhi),0);
     
    25972909        else *validNorm=false;
    25982910        break;
     2911
    25992912      case kSTheta:
    2600         if( fSTheta == pi*0.5 )
    2601         {
    2602           *n=G4ThreeVector(0,0,1);
     2913        if( fSTheta == halfpi )
     2914        {
     2915          *n=G4ThreeVector(0.,0.,1.);
    26032916          *validNorm=true;
    26042917        }
    2605         else if ( fSTheta > pi )
     2918        else if ( fSTheta > halfpi )
     2919        {
     2920          xi = p.x() + snxt*v.x();
     2921          yi = p.y() + snxt*v.y();
     2922          rhoSecTheta = std::sqrt((xi*xi+yi*yi)*(1+tanSTheta2));
     2923          *n = G4ThreeVector( xi/rhoSecTheta,   // N-
     2924                              yi/rhoSecTheta,
     2925                              -tanSTheta/std::sqrt(1+tanSTheta2));
     2926          *validNorm=true;
     2927        }
     2928        else *validNorm=false;  // Concave STheta cone
     2929        break;
     2930
     2931      case kETheta:
     2932        if( ( fSTheta + fDTheta ) == halfpi )
     2933        {
     2934          *n         = G4ThreeVector(0.,0.,-1.);
     2935          *validNorm = true;
     2936        }
     2937        else if ( ( fSTheta + fDTheta ) < halfpi)
    26062938        {
    26072939          xi=p.x()+snxt*v.x();
    26082940          yi=p.y()+snxt*v.y();
    2609           rhoSecTheta = std::sqrt((xi*xi+yi*yi)*(1+tanSTheta2)) ;
    2610           *n = G4ThreeVector(-xi/rhoSecTheta,   // N-
    2611                              -yi/rhoSecTheta,
    2612                              tanSTheta/std::sqrt(1+tanSTheta2)) ;
    2613           *validNorm=true;
    2614         }
    2615         else *validNorm=false;  // Concave STheta cone
    2616         break;
    2617       case kETheta:
    2618         if( ( fSTheta + fDTheta ) == pi*0.5 )
    2619         {
    2620           *n         = G4ThreeVector(0,0,-1);
    2621           *validNorm = true ;
    2622         }
    2623         else if ( ( fSTheta + fDTheta ) < pi )
    2624         {
    2625           xi=p.x()+snxt*v.x();
    2626           yi=p.y()+snxt*v.y();
    2627           rhoSecTheta = std::sqrt((xi*xi+yi*yi)*(1+tanETheta2)) ;
     2941          rhoSecTheta = std::sqrt((xi*xi+yi*yi)*(1+tanETheta2));
    26282942          *n = G4ThreeVector( xi/rhoSecTheta,   // N+
    26292943                              yi/rhoSecTheta,
    2630                               -tanSTheta/std::sqrt(1+tanSTheta2) ) ;
     2944                              -tanETheta/std::sqrt(1+tanETheta2) );
    26312945          *validNorm=true;
    26322946        }
    26332947        else *validNorm=false;   // Concave ETheta cone
    26342948        break;
     2949
    26352950      default:
    26362951        G4cout.precision(16);
  • trunk/source/geometry/solids/CSG/src/G4Torus.cc

    r831 r850  
    2626//
    2727// $Id: G4Torus.cc,v 1.63 2007/10/02 09:34:17 gcosmo Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030//
  • trunk/source/geometry/solids/CSG/src/G4Trap.cc

    r831 r850  
    2525//
    2626//
    27 // $Id: G4Trap.cc,v 1.42.4.1 2008/04/23 09:55:26 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-01-patch-02 $
     27// $Id: G4Trap.cc,v 1.45 2008/04/23 09:49:57 gcosmo Exp $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030// class G4Trap
  • trunk/source/geometry/solids/CSG/src/G4Trd.cc

    r831 r850  
    2626//
    2727// $Id: G4Trd.cc,v 1.34 2006/10/19 15:33:38 gcosmo Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030//
  • trunk/source/geometry/solids/CSG/src/G4Tubs.cc

    r831 r850  
    2525//
    2626//
    27 // $Id: G4Tubs.cc,v 1.66 2007/11/23 09:07:43 tnikitin Exp $
    28 // GEANT4 tag $Name: $
     27// $Id: G4Tubs.cc,v 1.68 2008/06/23 13:37:39 gcosmo Exp $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030//
     
    983983          iden   = std::sqrt(t3) ;
    984984          cosPsi = inum/iden ;
    985           if (cosPsi >= cosHDPhiIT)  { return 0.0; }
     985          if (cosPsi >= cosHDPhiIT)
     986          {
     987            // In the old version, the small negative tangent for the point
     988            // on surface was not taken in account, and returning 0.0 ...
     989            // New version: check the tangent for the point on surface and
     990            // if no intersection, return kInfinity, if intersection instead
     991            // return s.
     992            //
     993            c = t3-fRMax*fRMax;
     994            if ( c<=0.0 )
     995            {
     996              return 0.0;
     997            }
     998            else
     999            {
     1000              c = c/t1 ;
     1001              d = b*b-c;
     1002              if ( d>=0.0 )
     1003              {
     1004                snxt = c/(-b+std::sqrt(d)); // using safe solution
     1005                                            // for quadratic equation
     1006                if ( snxt<kCarTolerance*0.5 ) { snxt=0; }
     1007                return snxt ;
     1008              }     
     1009              else
     1010              {
     1011                return kInfinity;
     1012              }
     1013            }
     1014          }
    9861015        }
    9871016        else
    988         {
    989           return 0.0 ;
    990         }
    991       }
    992     }     
     1017        {   
     1018          // In the old version, the small negative tangent for the point
     1019          // on surface was not taken in account, and returning 0.0 ...
     1020          // New version: check the tangent for the point on surface and
     1021          // if no intersection, return kInfinity, if intersection instead
     1022          // return s.
     1023          //
     1024          c = t3 - fRMax*fRMax;
     1025          if ( c<=0.0 )
     1026          {
     1027            return 0.0;
     1028          }
     1029          else
     1030          {
     1031            c = c/t1 ;
     1032            d = b*b-c;
     1033            if ( d>=0.0 )
     1034            {
     1035              snxt= c/(-b+std::sqrt(d)); // using safe solution
     1036                                         // for quadratic equation
     1037              if ( snxt<kCarTolerance*0.5 ) { snxt=0; }
     1038              return snxt ;
     1039            }     
     1040            else
     1041            {
     1042              return kInfinity;
     1043            }
     1044          }
     1045        } // end if   (seg)
     1046      }   // end if   (t3>tolIRMin2)
     1047    }     // end if   (Inside Outer Radius)
    9931048    if ( fRMin )    // Try inner cylinder intersection
    9941049    {
     
    14591514              //
    14601515              if((std::abs(xi)<=kCarTolerance)&&(std::abs(yi)<=kCarTolerance))
    1461                 { sidephi = kSPhi;
     1516                { sidephi = kSPhi;
    14621517                if (((fSPhi-0.5*kAngTolerance)<=vphi)
    14631518                   &&((ePhi+0.5*kAngTolerance)>=vphi))
  • trunk/source/geometry/solids/specific/History

    r831 r850  
    1 $Id: History,v 1.131.2.4 2008/04/28 09:03:16 gcosmo Exp $
     1$Id: History,v 1.145 2008/08/12 08:57:31 gcosmo Exp $
    22-------------------------------------------------------------------
    33
     
    1818     ----------------------------------------------------------
    1919
    20 28-Apr-2008, G.Cosmo (geom-specific-V09-00-11)
    21 - Tag for release 9.1.p02.
     2025-Jul-2008, I.Hrivnacova (geom-specific-V09-01-14)
     21- G4ExtrudedSolid: fix in polygon decomposition; systematically use
     22  half kCarTolerance instead of kCarTolerance; added solid name in the
     23  error messages coming from fatal exceptions.
     24
     2516-Jul-2008, T.Nikitina (geom-specific-V09-01-13)
     26- G4Paraboloid: revised DistanceToOut(p,v,...) in answer to problem report
     27  #1015. Fixed precision problem when solving quadratic equation; apply
     28  comparison with kCarTolerance and not with zero; fixed logic problem in
     29  algoritm for points on surface and direction inside, relative to directions
     30  along Z, (0,0,Vz).
     31
     3222-May-2008, G.Cosmo (geom-specific-V09-01-12)
     33- Removed left-over debug printout in G4VCSGFaceted::DistanceToIn().
     34
     3515-May-2008, T.Nikitina (geom-specific-V09-01-11)
     36- Enhanced GetPointOnSurface() for generic G4Polycone and G4Polyhedra
     37  constructs; the method uses new triangulation algorithm for G4PolyPhiFace.
     38- G4ExtrudedSolid: added missing 'std' namespace to standard mathematical
     39  function calls.
    2240
    234128-Apr-2008, T.Nikitina (geom-specific-V09-01-10)
  • trunk/source/geometry/solids/specific/include/G4ClippablePolygon.hh

    r831 r850  
    2626//
    2727// $Id: G4ClippablePolygon.hh,v 1.11 2007/05/11 13:54:28 gcosmo Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030//
  • trunk/source/geometry/solids/specific/include/G4ClippablePolygon.icc

    r831 r850  
    2626//
    2727// $Id: G4ClippablePolygon.icc,v 1.4 2006/06/29 18:46:41 gunter Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030// --------------------------------------------------------------------
  • trunk/source/geometry/solids/specific/include/G4Ellipsoid.hh

    r831 r850  
    2626//
    2727// $Id: G4Ellipsoid.hh,v 1.12 2007/05/18 07:39:56 gcosmo Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030//
  • trunk/source/geometry/solids/specific/include/G4Ellipsoid.icc

    r831 r850  
    2626//
    2727// $Id: G4Ellipsoid.icc,v 1.7 2006/10/20 13:45:20 gcosmo Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030//
  • trunk/source/geometry/solids/specific/include/G4EllipticalCone.hh

    r831 r850  
    2626//
    2727// $Id: G4EllipticalCone.hh,v 1.11 2007/08/20 15:21:40 tnikitin Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030//
  • trunk/source/geometry/solids/specific/include/G4EllipticalCone.icc

    r831 r850  
    2626//
    2727// $Id: G4EllipticalCone.icc,v 1.6 2006/10/20 13:45:20 gcosmo Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030//
  • trunk/source/geometry/solids/specific/include/G4EllipticalTube.hh

    r831 r850  
    2626//
    2727// $Id: G4EllipticalTube.hh,v 1.18 2006/10/20 13:45:20 gcosmo Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030// --------------------------------------------------------------------
  • trunk/source/geometry/solids/specific/include/G4EllipticalTube.icc

    r831 r850  
    2626//
    2727// $Id: G4EllipticalTube.icc,v 1.4 2006/06/29 18:46:55 gunter Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030// --------------------------------------------------------------------
  • trunk/source/geometry/solids/specific/include/G4EnclosingCylinder.hh

    r831 r850  
    2626//
    2727// $Id: G4EnclosingCylinder.hh,v 1.8 2006/06/29 18:46:58 gunter Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030//
  • trunk/source/geometry/solids/specific/include/G4ExtrudedSolid.hh

    r831 r850  
    2525//
    2626//
    27 // $Id: G4ExtrudedSolid.hh,v 1.6.2.1 2008/04/23 08:10:24 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-01-patch-02 $
     27// $Id: G4ExtrudedSolid.hh,v 1.7 2008/02/27 12:32:48 ivana Exp $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030//
  • trunk/source/geometry/solids/specific/include/G4ExtrudedSolid.icc

    r831 r850  
    2626//
    2727// $Id: G4ExtrudedSolid.icc,v 1.2 2007/02/19 10:17:45 ivana Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030// --------------------------------------------------------------------
  • trunk/source/geometry/solids/specific/include/G4Hype.hh

    r831 r850  
    2727// $Id: G4Hype.hh,v 1.15 2006/10/20 13:45:20 gcosmo Exp $
    2828// $Original: G4Hype.hh,v 1.0 1998/06/09 16:57:50 safai Exp $
    29 // GEANT4 tag $Name: $
     29// GEANT4 tag $Name: HEAD $
    3030//
    3131//
  • trunk/source/geometry/solids/specific/include/G4Hype.icc

    r831 r850  
    2626//
    2727// $Id: G4Hype.icc,v 1.7 2006/06/29 18:47:03 gunter Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030// --------------------------------------------------------------------
  • trunk/source/geometry/solids/specific/include/G4IntersectingCone.hh

    r831 r850  
    2525//
    2626//
    27 // $Id: G4IntersectingCone.hh,v 1.9.8.1 2008/04/28 09:03:16 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-01-patch-02 $
     27// $Id: G4IntersectingCone.hh,v 1.11 2008/04/28 08:59:47 gcosmo Exp $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030//
  • trunk/source/geometry/solids/specific/include/G4Paraboloid.hh

    r831 r850  
    2626//
    2727// $Id: G4Paraboloid.hh,v 1.4 2008/01/22 17:42:09 tnikitin Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030//
  • trunk/source/geometry/solids/specific/include/G4Paraboloid.icc

    r831 r850  
    2626//
    2727// $Id: G4Paraboloid.icc,v 1.4 2007/08/21 12:58:36 gcosmo Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030//
  • trunk/source/geometry/solids/specific/include/G4PolyPhiFace.hh

    r831 r850  
    2525//
    2626//
    27 // $Id: G4PolyPhiFace.hh,v 1.10 2007/05/11 13:54:28 gcosmo Exp $
    28 // GEANT4 tag $Name: $
     27// $Id: G4PolyPhiFace.hh,v 1.12 2008/05/15 11:41:58 gcosmo Exp $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030//
     
    5858
    5959#include "G4VCSGface.hh"
     60#include "G4TwoVector.hh"
    6061
    6162class G4ReduciblePolygon;
     
    6768           zNorm;        // r/z normal
    6869  G4ThreeVector norm3D;  // 3D normal
     70
     71  // Needed for Triangulation Algorithm
     72  //
     73  G4bool ear;
     74  G4PolyPhiFaceVertex *next,*prev;
    6975};
    7076
     
    122128      // Allocates on the heap a clone of this face.
    123129
     130    G4double SurfaceArea();
     131    G4double SurfaceTriangle( G4ThreeVector p1, G4ThreeVector p2,
     132                              G4ThreeVector p3, G4ThreeVector* p4);
     133    G4ThreeVector GetPointOnFace();
     134      // Auxiliary methods for determination of points on surface.
     135
    124136  public:  // without description
    125137
     
    158170  protected:
    159171
     172    // Functions used for Triangulation in Case of generic Polygone.
     173    // The triangulation is used for GetPointOnFace()
     174
     175    G4double Area2( G4TwoVector a, G4TwoVector b, G4TwoVector c);
     176      // Calculation of 2*Area of Triangle with Sign
     177
     178    G4bool Left( G4TwoVector a, G4TwoVector b, G4TwoVector c );
     179    G4bool LeftOn( G4TwoVector a, G4TwoVector b, G4TwoVector c );
     180    G4bool Collinear( G4TwoVector a, G4TwoVector b, G4TwoVector c );
     181      // Boolean functions for sign of Surface
     182
     183    G4bool IntersectProp( G4TwoVector a, G4TwoVector b,
     184                          G4TwoVector c, G4TwoVector d );
     185      // Boolean function for finding proper intersection of two
     186      // line segments (a,b) and (c,d).
     187
     188    G4bool Between( G4TwoVector a, G4TwoVector b, G4TwoVector c );
     189      // Boolean function for determining if point c is between a and b
     190      // where the three points (a,b,c) are on the same line.
     191
     192    G4bool Intersect( G4TwoVector a, G4TwoVector b,
     193                      G4TwoVector c, G4TwoVector d );
     194      // Boolean function for finding proper intersection or not
     195      // of two line segments (a,b) and (c,d).
     196
     197    G4bool Diagonalie( G4PolyPhiFaceVertex *a, G4PolyPhiFaceVertex *b );
     198      // Boolean Diagonalie help to determine if diagonal s
     199      // of segment (a,b) is convex or reflex.
     200
     201    G4bool InCone( G4PolyPhiFaceVertex *a, G4PolyPhiFaceVertex *b );
     202      // Boolean function for determining if b is inside the cone (a0,a,a1)
     203      // where a is the center of the cone.
     204
     205    G4bool Diagonal( G4PolyPhiFaceVertex *a, G4PolyPhiFaceVertex *b );
     206      // Boolean function for determining if Diagonal is possible
     207      // inside Polycone or PolyHedra.
     208
     209    void EarInit();
     210      // Initialisation for Triangulisation by ear tips.
     211      // For details see "Computational Geometry in C" by Joseph O'Rourke.
     212
     213    void Triangulate();
     214      // Triangulisation by ear tips for Polycone or Polyhedra.
     215      // For details see "Computational Geometry in C" by Joseph O'Rourke.
     216      // NOTE: a copy of the shape is made and this copy is reordered in
     217      //       order to have a list of triangles. This list is used by the
     218      //       method GetPointOnFace().
     219
     220  protected:
     221
    160222    G4int      numEdges;            // Number of edges
    161223    G4PolyPhiFaceEdge   *edges;     // The edges of the face
     
    164226    G4ThreeVector    radial;        // Unit vector along radial direction
    165227    G4ThreeVector    surface;       // Point on surface
     228    G4ThreeVector    surface_point; // Auxiliary point on surface used for
     229                                    // method GetPointOnFace()
    166230    G4double   rMin, rMax, // Extent in r
    167231               zMin, zMax; // Extent in z
    168232    G4bool      allBehind; // True if the polycone/polyhedra
    169233                           // is behind the place of this face
    170     G4double   kCarTolerance;       // Surface thickness
     234    G4double   kCarTolerance;// Surface thickness
     235    G4double   fSurfaceArea; // Surface Area of PolyPhiFace
     236    G4PolyPhiFaceVertex *triangles; // Auxiliary pointer to 'corners' used for
     237                                    // triangulation. Copy structure, changing
     238                                    // the structure of 'corners' (ear removal)
    171239};
    172240
  • trunk/source/geometry/solids/specific/include/G4PolyPhiFace.icc

    r831 r850  
    2626//
    2727// $Id: G4PolyPhiFace.icc,v 1.6 2006/06/29 18:47:10 gunter Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030//
  • trunk/source/geometry/solids/specific/include/G4Polycone.hh

    r831 r850  
    2525//
    2626//
    27 // $Id: G4Polycone.hh,v 1.20 2007/04/26 06:18:20 tnikitin Exp $
    28 // GEANT4 tag $Name: $
     27// $Id: G4Polycone.hh,v 1.22 2008/05/15 13:45:15 gcosmo Exp $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030//
     
    116116
    117117  G4ThreeVector GetPointOnSurface() const;
    118  
     118
    119119  void ComputeDimensions(       G4VPVParameterisation* p,
    120120                          const G4int n,
  • trunk/source/geometry/solids/specific/include/G4Polycone.icc

    r831 r850  
    2626//
    2727// $Id: G4Polycone.icc,v 1.10 2006/06/29 18:47:14 gunter Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030// --------------------------------------------------------------------
  • trunk/source/geometry/solids/specific/include/G4PolyconeSide.hh

    r831 r850  
    2525//
    2626//
    27 // $Id: G4PolyconeSide.hh,v 1.10 2007/08/13 10:33:03 gcosmo Exp $
    28 // GEANT4 tag $Name: $
     27// $Id: G4PolyconeSide.hh,v 1.12 2008/05/15 11:41:58 gcosmo Exp $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030//
     
    101101
    102102    G4VCSGface *Clone() { return new G4PolyconeSide( *this ); }
     103
     104    G4double SurfaceArea();
     105    G4ThreeVector GetPointOnFace();
    103106 
    104107  public:  // without description
     
    130133             zNormEdge[2];  // Normal to edges
    131134
    132     //(WP)
    133     int ncorners;
     135    G4int ncorners;
    134136    G4ThreeVector *corners; // The coordinates of the corners (if phiIsOpen)
    135137
     
    151153
    152154    G4double kCarTolerance; // Geometrical surface thickness
     155    G4double fSurfaceArea;  // Used for surface calculation
    153156};
    154157
  • trunk/source/geometry/solids/specific/include/G4Polyhedra.hh

    r831 r850  
    2525//
    2626//
    27 // $Id: G4Polyhedra.hh,v 1.17 2007/01/22 12:58:53 gcosmo Exp $
    28 // GEANT4 tag $Name: $
     27// $Id: G4Polyhedra.hh,v 1.20 2008/05/15 13:45:15 gcosmo Exp $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030//
  • trunk/source/geometry/solids/specific/include/G4Polyhedra.icc

    r831 r850  
    2626//
    2727// $Id: G4Polyhedra.icc,v 1.11 2007/01/22 12:58:53 gcosmo Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030// --------------------------------------------------------------------
  • trunk/source/geometry/solids/specific/include/G4PolyhedraSide.hh

    r831 r850  
    2525//
    2626//
    27 // $Id: G4PolyhedraSide.hh,v 1.9 2007/05/11 13:54:28 gcosmo Exp $
    28 // GEANT4 tag $Name: $
     27// $Id: G4PolyhedraSide.hh,v 1.11 2008/05/15 11:41:59 gcosmo Exp $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030//
     
    7070{
    7171
    72   public:
     72  public:  // with description
    7373
    7474    G4PolyhedraSide( const G4PolyhedraSideRZ *prevRZ,
     
    104104
    105105    G4VCSGface *Clone() { return new G4PolyhedraSide( *this ); }
    106  
     106
     107  public:  // without description
     108
     109    // Methods used for GetPointOnSurface()
     110
     111    G4double SurfaceTriangle( G4ThreeVector p1,
     112                              G4ThreeVector p2,
     113                              G4ThreeVector p3,
     114                              G4ThreeVector *p4 );
     115    G4ThreeVector GetPointOnPlane( G4ThreeVector p0, G4ThreeVector p1,
     116                                   G4ThreeVector p2, G4ThreeVector p3,
     117                                   G4double *Area );
     118    G4double SurfaceArea();
     119    G4ThreeVector GetPointOnFace(); 
     120
    107121  public:  // without description
    108122
     
    184198
    185199    G4double kCarTolerance;  // Geometrical surface thickness
     200    G4double fSurfaceArea;   // Surface Area
    186201};
    187202
  • trunk/source/geometry/solids/specific/include/G4QuadrangularFacet.hh

    r831 r850  
    2626//
    2727// $Id: G4QuadrangularFacet.hh,v 1.5 2007/02/26 08:39:13 gcosmo Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  • trunk/source/geometry/solids/specific/include/G4ReduciblePolygon.hh

    r831 r850  
    2626//
    2727// $Id: G4ReduciblePolygon.hh,v 1.9 2006/06/29 18:47:29 gunter Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030//
  • trunk/source/geometry/solids/specific/include/G4SolidExtentList.hh

    r831 r850  
    2626//
    2727// $Id: G4SolidExtentList.hh,v 1.7 2006/06/29 18:47:32 gunter Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030//
  • trunk/source/geometry/solids/specific/include/G4TessellatedGeometryAlgorithms.hh

    r831 r850  
    2525//
    2626// $Id:
    27 // GEANT4 tag $Name: $
     27// GEANT4 tag $Name: HEAD $
    2828//
    2929// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  • trunk/source/geometry/solids/specific/include/G4TessellatedGeometryAlgorithms.icc

    r831 r850  
    2525//
    2626// $Id:
    27 // GEANT4 tag $Name: $
     27// GEANT4 tag $Name: HEAD $
    2828//
    2929// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  • trunk/source/geometry/solids/specific/include/G4TessellatedSolid.hh

    r831 r850  
    2626//
    2727// $Id: G4TessellatedSolid.hh,v 1.10 2007/12/10 16:30:13 gunter Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  • trunk/source/geometry/solids/specific/include/G4Tet.hh

    r831 r850  
    3030//
    3131// $Id: G4Tet.hh,v 1.9 2006/11/13 08:58:03 gcosmo Exp $
    32 // GEANT4 tag $Name: $
     32// GEANT4 tag $Name: HEAD $
    3333//
    3434//
  • trunk/source/geometry/solids/specific/include/G4TriangularFacet.hh

    r831 r850  
    2626//
    2727// $Id: G4TriangularFacet.hh,v 1.8 2007/12/10 16:30:18 gunter Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  • trunk/source/geometry/solids/specific/include/G4TwistTrapFlatSide.hh

    r831 r850  
    2626//
    2727// $Id: G4TwistTrapFlatSide.hh,v 1.5 2006/06/29 18:47:48 gunter Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030//
  • trunk/source/geometry/solids/specific/include/G4TwistTubsFlatSide.hh

    r831 r850  
    2626//
    2727// $Id: G4TwistTubsFlatSide.hh,v 1.5 2006/06/29 18:47:53 gunter Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030//
  • trunk/source/geometry/solids/specific/include/G4TwistTubsHypeSide.hh

    r831 r850  
    2626//
    2727// $Id: G4TwistTubsHypeSide.hh,v 1.5 2006/06/29 18:47:56 gunter Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030//
  • trunk/source/geometry/solids/specific/include/G4TwistTubsSide.hh

    r831 r850  
    2626//
    2727// $Id: G4TwistTubsSide.hh,v 1.5 2006/06/29 18:47:58 gunter Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030//
  • trunk/source/geometry/solids/specific/include/G4TwistedBox.hh

    r831 r850  
    2626//
    2727// $Id: G4TwistedBox.hh,v 1.10 2006/06/29 18:48:00 gunter Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030//
  • trunk/source/geometry/solids/specific/include/G4TwistedTrap.hh

    r831 r850  
    2626//
    2727// $Id: G4TwistedTrap.hh,v 1.10 2006/06/29 18:48:02 gunter Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030//
  • trunk/source/geometry/solids/specific/include/G4TwistedTrd.hh

    r831 r850  
    2626//
    2727// $Id: G4TwistedTrd.hh,v 1.6 2006/06/29 18:48:04 gunter Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030//
  • trunk/source/geometry/solids/specific/include/G4TwistedTubs.hh

    r831 r850  
    2626//
    2727// $Id: G4TwistedTubs.hh,v 1.14 2007/05/23 09:32:35 gcosmo Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030//
  • trunk/source/geometry/solids/specific/include/G4VCSGface.hh

    r831 r850  
    2525//
    2626//
    27 // $Id: G4VCSGface.hh,v 1.7 2006/06/29 18:48:08 gunter Exp $
    28 // GEANT4 tag $Name: $
     27// $Id: G4VCSGface.hh,v 1.9 2008/05/15 11:41:59 gcosmo Exp $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030//
     
    300300
    301301  virtual G4VCSGface* Clone() = 0;
     302
     303  virtual G4double SurfaceArea( ) = 0;
     304  virtual G4ThreeVector GetPointOnFace() = 0;
    302305};
    303306
  • trunk/source/geometry/solids/specific/include/G4VCSGfaceted.hh

    r831 r850  
    2525//
    2626//
    27 // $Id: G4VCSGfaceted.hh,v 1.13 2006/10/20 13:45:20 gcosmo Exp $
    28 // GEANT4 tag $Name: $
     27// $Id: G4VCSGfaceted.hh,v 1.17 2008/05/15 13:45:15 gcosmo Exp $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030//
     
    127127                                 const G4bool outgoing ) const;
    128128
     129    G4ThreeVector GetPointOnSurfaceGeneric()const;
     130      // Returns a random point located on the surface of the solid
     131      // in case of generic Polycone or generic Polyhedra.
     132
    129133    void CopyStuff( const G4VCSGfaceted &source );
    130134    void DeleteStuff();
  • trunk/source/geometry/solids/specific/include/G4VFacet.hh

    r831 r850  
    2626//
    2727// $Id: G4VFacet.hh,v 1.6 2007/08/23 14:45:03 gcosmo Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  • trunk/source/geometry/solids/specific/include/G4VFacet.icc

    r831 r850  
    2626//
    2727// $Id: G4VFacet.icc,v 1.5 2007/08/23 14:45:03 gcosmo Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  • trunk/source/geometry/solids/specific/include/G4VTwistSurface.hh

    r831 r850  
    2626//
    2727// $Id: G4VTwistSurface.hh,v 1.6 2007/05/11 13:54:28 gcosmo Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030//
  • trunk/source/geometry/solids/specific/include/G4VTwistSurface.icc

    r831 r850  
    2626//
    2727// $Id: G4VTwistSurface.icc,v 1.3 2006/06/29 18:48:20 gunter Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030//
  • trunk/source/geometry/solids/specific/include/G4VTwistedFaceted.hh

    r831 r850  
    2626//
    2727// $Id: G4VTwistedFaceted.hh,v 1.10 2006/10/20 13:45:20 gcosmo Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030// --------------------------------------------------------------------
  • trunk/source/geometry/solids/specific/src/G4ClippablePolygon.cc

    r831 r850  
    2626//
    2727// $Id: G4ClippablePolygon.cc,v 1.12 2007/05/11 13:54:28 gcosmo Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030//
  • trunk/source/geometry/solids/specific/src/G4Ellipsoid.cc

    r831 r850  
    2525//
    2626// $Id: G4Ellipsoid.cc,v 1.14 2007/05/18 07:39:56 gcosmo Exp $
    27 // GEANT4 tag $Name: $
     27// GEANT4 tag $Name: HEAD $
    2828//
    2929// class G4Ellipsoid
  • trunk/source/geometry/solids/specific/src/G4EllipticalCone.cc

    r831 r850  
    2424// ********************************************************************
    2525//
    26 // $Id: G4EllipticalCone.cc,v 1.15.2.1 2008/04/25 09:11:34 gcosmo Exp $
    27 // GEANT4 tag $Name: geant4-09-01-patch-02 $
     26// $Id: G4EllipticalCone.cc,v 1.16 2008/04/25 08:45:26 gcosmo Exp $
     27// GEANT4 tag $Name: HEAD $
    2828//
    2929// Implementation of G4EllipticalCone class
  • trunk/source/geometry/solids/specific/src/G4EllipticalTube.cc

    r831 r850  
    2626//
    2727// $Id: G4EllipticalTube.cc,v 1.27 2006/10/20 13:45:21 gcosmo Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030//
  • trunk/source/geometry/solids/specific/src/G4EnclosingCylinder.cc

    r831 r850  
    2626//
    2727// $Id: G4EnclosingCylinder.cc,v 1.10 2007/05/11 13:54:29 gcosmo Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030//
  • trunk/source/geometry/solids/specific/src/G4ExtrudedSolid.cc

    r831 r850  
    2525//
    2626//
    27 // $Id: G4ExtrudedSolid.cc,v 1.11.2.1 2008/04/23 08:10:24 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-01-patch-02 $
     27// $Id: G4ExtrudedSolid.cc,v 1.17 2008/08/12 08:54:57 gcosmo Exp $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030//
     
    6262  // General constructor
    6363
     64  G4String errorDescription = "InvalidSetup in \"";
     65  errorDescription += pName;
     66  errorDescription += "\"";
     67
    6468  // First check input parameters
    6569
    66   if ( fNv < 3 ) {
    67     G4Exception(
    68       "G4ExtrudedSolid::G4ExtrudedSolid()", "InvalidSetup",
    69       FatalException, "Number of polygon vertices < 3");
     70  if ( fNv < 3 )
     71  {
     72    G4Exception("G4ExtrudedSolid::G4ExtrudedSolid()", errorDescription,
     73                FatalException, "Number of polygon vertices < 3");
    7074  }
    7175     
    72   if ( fNz < 2 ) {
    73     G4Exception(
    74       "G4ExtrudedSolid::G4ExtrudedSolid()", "InvalidSetup",
    75       FatalException, "Number of z-sides < 2");
     76  if ( fNz < 2 )
     77  {
     78    G4Exception("G4ExtrudedSolid::G4ExtrudedSolid()", errorDescription,
     79                FatalException, "Number of z-sides < 2");
    7680  }
    7781     
     
    8084    if ( zsections[i].fZ > zsections[i+1].fZ )
    8185    {
    82       G4Exception(
    83         "G4ExtrudedSolid::G4ExtrudedSolid()", "InvalidSetup",
     86      G4Exception("G4ExtrudedSolid::G4ExtrudedSolid()", errorDescription,
    8487        FatalException,
    8588        "Z-sections have to be ordered by z value (z0 < z1 < z2 ...)");
    8689    }
    87     if ( std::fabs( zsections[i+1].fZ - zsections[i].fZ ) < kCarTolerance )
     90    if ( std::fabs( zsections[i+1].fZ - zsections[i].fZ ) < kCarTolerance * 0.5 )
    8891    {
    89       G4Exception(
    90         "G4ExtrudedSolid::G4ExtrudedSolid()", "InvalidSetup",
     92      G4Exception("G4ExtrudedSolid::G4ExtrudedSolid()", errorDescription,
    9193        FatalException,
    9294        "Z-sections with the same z position are not supported.");
     
    106108  if (!result)
    107109  {   
    108     G4Exception("G4ExtrudedSolid::G4ExtrudedSolid()", "InvalidSetup",
     110    G4Exception("G4ExtrudedSolid::G4ExtrudedSolid()", errorDescription,
    109111                FatalException, "Making facets failed.");
    110112  }
     
    134136  // Special constructor for solid with 2 z-sections
    135137
     138  G4String errorDescription = "InvalidSetup in \"";
     139  errorDescription += pName;
     140  errorDescription += "\"";
     141
    136142  // First check input parameters
    137143  //
    138144  if ( fNv < 3 )
    139145  {
    140     G4Exception("G4ExtrudedSolid::G4ExtrudedSolid()", "InvalidSetup",
     146    G4Exception("G4ExtrudedSolid::G4ExtrudedSolid()", errorDescription,
    141147                FatalException, "Number of polygon vertices < 3");
    142148  }
     
    154160  if (!result)
    155161  {   
    156     G4Exception("G4ExtrudedSolid::G4ExtrudedSolid()", "InvalidSetup",
     162    G4Exception("G4ExtrudedSolid::G4ExtrudedSolid()", errorDescription,
    157163                FatalException, "Making facets failed.");
    158164  }
     
    265271  if ( l1.x() == l2.x() )
    266272  {
    267     return std::fabs(p.x() - l1.x()) < kCarTolerance;
     273    return std::fabs(p.x() - l1.x()) < kCarTolerance * 0.5;
    268274  }
    269275
    270276  return std::fabs (p.y() - l1.y() - ((l2.y() - l1.y())/(l2.x() - l1.x()))
    271                                     *(p.x() - l1.x())) < kCarTolerance;
     277                                    *(p.x() - l1.x())) < kCarTolerance * 0.5;
    272278 }
    273279
     
    280286  // l1 and l2
    281287
    282   if ( p.x() < std::min(l1.x(), l2.x()) - kCarTolerance ||
    283        p.x() > std::max(l1.x(), l2.x()) + kCarTolerance ||
    284        p.y() < std::min(l1.y(), l2.y()) - kCarTolerance||
    285        p.y() > std::max(l1.y(), l2.y()) + kCarTolerance )
     288  if ( p.x() < std::min(l1.x(), l2.x()) - kCarTolerance * 0.5 ||
     289       p.x() > std::max(l1.x(), l2.x()) + kCarTolerance * 0.5 ||
     290       p.y() < std::min(l1.y(), l2.y()) - kCarTolerance * 0.5 ||
     291       p.y() > std::max(l1.y(), l2.y()) + kCarTolerance * 0.5 )
    286292  {
    287293    return false;
     
    309315                                      G4TwoVector c, G4TwoVector p) const
    310316{
    311   // Return true if p is inside of triangle abc, else returns false
     317  // Return true if p is inside of triangle abc or on its edges,
     318  // else returns false
    312319
    313320  // Check extent first
     
    318325       ( p.y() > a.y() && p.y() > b.y() && p.y() > c.y() ) ) return false;
    319326 
    320   return   IsSameSide(p, a, b, c)
    321         && IsSameSide(p, b, a, c)
    322         && IsSameSide(p, c, a, b);
     327  G4bool inside
     328    = IsSameSide(p, a, b, c)
     329      && IsSameSide(p, b, a, c)
     330      && IsSameSide(p, c, a, b);
     331
     332  G4bool onEdge
     333    = IsSameLineSegment(p, a, b)
     334      || IsSameLineSegment(p, b, c)
     335      || IsSameLineSegment(p, c, a);
     336     
     337  return inside || onEdge;   
    323338}     
    324339
     
    333348  G4TwoVector t2 = pb - po;
    334349 
    335   G4double result
    336     = (atan2(t1.y(), t1.x()) - atan2(t2.y(), t2.x()));
     350  G4double result = (std::atan2(t1.y(), t1.x()) - std::atan2(t2.y(), t2.x()));
    337351
    338352  if ( result < 0 ) result += 2*pi;
     
    439453    //
    440454    G4double angle = GetAngle(c2->first, c3->first, c1->first);
    441     //G4cout << angle << G4endl;
    442     if ( angle > pi ) {
     455
     456    if ( angle > pi )
     457    {
    443458      // G4cout << "Skipping concave vertex " << c2->second << G4endl;
    444459
     
    449464      ++c3;
    450465      if ( c3 == verticesToBeDone.end() ) { c3 = verticesToBeDone.begin(); }
     466
     467      // G4cout << "Looking at triangle : "
     468      //        << c1->second << "  " << c2->second
     469      //        << "  " << c3->second << G4endl; 
     470
    451471    }
    452472
     
    623643  // Check first if outside extent
    624644  //
    625   if ( p.x() < GetMinXExtent() - kCarTolerance ||
    626        p.x() > GetMaxXExtent() + kCarTolerance ||
    627        p.y() < GetMinYExtent() - kCarTolerance ||
    628        p.y() > GetMaxYExtent() + kCarTolerance ||
    629        p.z() < GetMinZExtent() - kCarTolerance ||
    630        p.z() > GetMaxZExtent() + kCarTolerance )
     645  if ( p.x() < GetMinXExtent() - kCarTolerance * 0.5 ||
     646       p.x() > GetMaxXExtent() + kCarTolerance * 0.5 ||
     647       p.y() < GetMinYExtent() - kCarTolerance * 0.5 ||
     648       p.y() > GetMaxYExtent() + kCarTolerance * 0.5 ||
     649       p.z() < GetMinZExtent() - kCarTolerance * 0.5 ||
     650       p.z() > GetMaxZExtent() + kCarTolerance * 0.5 )
    631651  {
    632652    // G4cout << "G4ExtrudedSolid::Outside extent: " << p << G4endl;
     
    660680    if ( IsPointInside(fPolygon[(*it)[0]], fPolygon[(*it)[1]],
    661681                       fPolygon[(*it)[2]], pscaled) )  { inside = true; }
    662                        
    663     if ( IsSameLineSegment(pscaled, fPolygon[(*it)[0]], fPolygon[(*it)[1]]) ||
    664          IsSameLineSegment(pscaled, fPolygon[(*it)[1]], fPolygon[(*it)[2]]) ||
    665          IsSameLineSegment(pscaled, fPolygon[(*it)[2]], fPolygon[(*it)[0]]) )
    666                                                        { inside = true; }
    667682    ++it;
    668683  } while ( (inside == false) && (it != fTriangles.end()) );
     
    672687    // Check if on surface of z sides
    673688    //
    674     if ( std::fabs( p.z() - fZSections[0].fZ ) < kCarTolerance ||
    675          std::fabs( p.z() - fZSections[fNz-1].fZ ) < kCarTolerance )
     689    if ( std::fabs( p.z() - fZSections[0].fZ ) < kCarTolerance * 0.5 ||
     690         std::fabs( p.z() - fZSections[fNz-1].fZ ) < kCarTolerance * 0.5 )
    676691    {
    677692      // G4cout << "G4ExtrudedSolid::Inside return Surface (on z side)"
  • trunk/source/geometry/solids/specific/src/G4Hype.cc

    r831 r850  
    2525//
    2626//
    27 // $Id: G4Hype.cc,v 1.25.8.1 2008/04/23 08:10:24 gcosmo Exp $
     27// $Id: G4Hype.cc,v 1.27 2008/04/14 08:49:28 gcosmo Exp $
    2828// $Original: G4Hype.cc,v 1.0 1998/06/09 16:57:50 safai Exp $
    29 // GEANT4 tag $Name: geant4-09-01-patch-02 $
     29// GEANT4 tag $Name: HEAD $
    3030//
    3131//
  • trunk/source/geometry/solids/specific/src/G4IntersectingCone.cc

    r831 r850  
    2525//
    2626//
    27 // $Id: G4IntersectingCone.cc,v 1.8.8.2 2008/04/28 09:03:16 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-01-patch-02 $
     27// $Id: G4IntersectingCone.cc,v 1.12 2008/04/28 08:59:47 gcosmo Exp $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030//
  • trunk/source/geometry/solids/specific/src/G4Paraboloid.cc

    r831 r850  
    2424// ********************************************************************
    2525//
    26 // $Id: G4Paraboloid.cc,v 1.5.2.1 2008/04/23 08:10:24 gcosmo Exp $
    27 // GEANT4 tag $Name: geant4-09-01-patch-02 $
     26// $Id: G4Paraboloid.cc,v 1.8 2008/07/17 07:33:00 gcosmo Exp $
     27// GEANT4 tag $Name: HEAD $
    2828//
    2929// class G4Paraboloid
    3030//
    3131// Implementation for G4Paraboloid class
    32 //
    33 // History:
    3432//
    3533// Author : Lukas Lindroos (CERN), July 2007
     
    8280  }
    8381
    84 // r1^2 = k1 * (-dz) + k2
    85 // r2^2 = k1 * ( dz) + k2
    86 // => r1^2 + r2^2 = k2 + k2 => k2 = (r2^2 + r1^2) / 2
    87 // and r2^2 - r1^2 = k1 * dz - k1 * (-dz) => k1 = (r2^2 - r1^2) / 2 / dz
     82  // r1^2 = k1 * (-dz) + k2
     83  // r2^2 = k1 * ( dz) + k2
     84  // => r1^2 + r2^2 = k2 + k2 => k2 = (r2^2 + r1^2) / 2
     85  // and r2^2 - r1^2 = k1 * dz - k1 * (-dz) => k1 = (r2^2 - r1^2) / 2 / dz
    8886
    8987  k1 = (r2 * r2 - r1 * r1) / 2 / dz;
     
    283281           rhoSurfTimesTol2  = (k1 * p.z() + k2) * sqr(kCarTolerance),
    284282           A = rho2 - ((k1 *p.z() + k2) + 0.25 * kCarTolerance * kCarTolerance);
    285 
     283 
    286284  if(A < 0 && sqr(A) > rhoSurfTimesTol2)
    287285  {
    288286    // Actually checking rho < radius of paraboloid at z = p.z().
    289287    // We're either inside or in lower/upper cutoff area.
    290 
     288   
    291289    if(std::fabs(p.z()) > dz - 0.5 * kCarTolerance)
    292290    {
     
    432430      }
    433431    }
    434     else // Direction away, no posibility of intersection
    435       { return kInfinity; }
     432    else  // Direction away, no possibility of intersection
     433    {
     434      return kInfinity;
     435    }
    436436  }
    437437  else if(r1 && p.z() < tolh - dz)
     
    455455      }
    456456    }
    457     else// Direction away, no posibility of intersection
    458       { return kInfinity; }
     457    else  // Direction away, no possibility of intersection
     458    {
     459      return kInfinity;
     460    }
    459461  }
    460462
     
    577579///////////////////////////////////////////////////////////////////////////////
    578580//
    579 // Calculate distance to surface of shape from `inside'
     581// Calculate distance to surface of shape from 'inside'
    580582
    581583G4double G4Paraboloid::DistanceToOut(const G4ThreeVector& p,
     
    598600  // to include all z) x^2 + y^2 = k1 * z + k2 => .. =>
    599601  // => s = (A +- std::sqrt(A^2 + B)) / vRho2
    600   // where
     602  // where:
     603  //
    601604  G4double A = k1 / 2 * v.z() - p.x() * v.x() - p.y() * v.y();
    602   // and
     605  //
     606  // and:
     607  //
    603608  G4double B = (-rho2 + paraRho2) * vRho2;
    604609
     
    676681    else if( ((A <= 0) && (B >= sqr(A) * (sqr(vRho2) - 1))) || (A >= 0))
    677682    {
    678       intersection = (A + std::sqrt(B + sqr(A))) / vRho2;
     683      // intersection = (A + std::sqrt(B + sqr(A))) / vRho2;
     684      // The above calculation has a precision problem:
     685      // known problem of solving quadratic equation with small A 
     686
     687      A = A/vRho2;
     688      B = (k1 * p.z() + k2 - rho2)/vRho2;
     689      intersection = B/(-A + std::sqrt(B + sqr(A)));
    679690      if(calcNorm)
    680691      {
     
    700711  {
    701712    // If this is true we're somewhere in the border.
    702 
     713   
    703714    G4ThreeVector normal = G4ThreeVector (p.x(), p.y(), -k1/2);
    704715
     
    706717    {
    707718      // We're in the lower or upper edge
     719      //
    708720      if( ((v.z() > 0) && (p.z() > 0)) || ((v.z() < 0) && (p.z() < 0)) )
    709       // If we're headig out of the object that is treated here
    710       {
     721      {             // If we're heading out of the object that is treated here
    711722        if(calcNorm)
    712723        {
     
    742753      }
    743754    }
    744     else if(normal.dot(v) >= 0)
    745     {
    746       if(calcNorm)
    747       {
    748         *validNorm = true;
    749         *n = normal.unit();
    750       }
    751       return 0;
    752     }
     755    //
     756    // Problem in the Logic :: Following condition for point on upper surface
     757    //                         and Vz<0  will return 0 (Problem #1015), but
     758    //                         it has to return intersection with parabolic
     759    //                         surface or with lower plane surface (z = -dz)
     760    // The logic has to be  :: If not found intersection until now,
     761    // do not exit but continue to search for possible intersection.
     762    // Only for point situated on both borders (Z and parabolic)
     763    // this condition has to be taken into account and done later
     764    //
     765    //
     766    // else if(normal.dot(v) >= 0)
     767    // {
     768    //   if(calcNorm)
     769    //   {
     770    //     *validNorm = true;
     771    //     *n = normal.unit();
     772    //   }
     773    //   return 0;
     774    // }
    753775
    754776    if(v.z() > 0)
     
    780802      }
    781803    }
    782     if(r1 && v.z() < 0)
     804    if( v.z() < 0)
    783805    {
    784806      // Check for collision with lower edge.
     
    809831    }
    810832
    811     if(vRho2 != 0)
    812       { intersection = (A + std::sqrt(B + sqr(A))) / vRho2; }
     833    // Note: comparison with zero below would not be correct !
     834    //
     835    if(std::fabs(vRho2) > tol2) // precision error in the calculation of
     836    {                           // intersection = (A+std::sqrt(B+sqr(A)))/vRho2
     837      A = A/vRho2;
     838      B = (k1 * p.z() + k2 - rho2);
     839      if(std::fabs(B)>kCarTolerance)
     840      {
     841        B = (B)/vRho2;
     842        intersection = B/(-A + std::sqrt(B + sqr(A)));
     843      }
     844      else                      // Point is On both borders: Z and parabolic
     845      {                         // solution depends on normal.dot(v) sign
     846        if(normal.dot(v) >= 0)
     847        {
     848          if(calcNorm)
     849          {
     850            *validNorm = true;
     851            *n = normal.unit();
     852          }
     853          return 0;
     854        }
     855        intersection = 2.*A;
     856      }
     857    }
    813858    else
    814       { intersection = ((rho2 - k2) / k1 - p.z()) / v.z(); }
     859    {
     860      intersection = ((rho2 - k2) / k1 - p.z()) / v.z();
     861    }
    815862
    816863    if(calcNorm)
  • trunk/source/geometry/solids/specific/src/G4PolyPhiFace.cc

    r831 r850  
    2525//
    2626//
    27 // $Id: G4PolyPhiFace.cc,v 1.13 2007/07/19 12:57:14 gcosmo Exp $
    28 // GEANT4 tag $Name: $
     27// $Id: G4PolyPhiFace.cc,v 1.15 2008/05/15 11:41:59 gcosmo Exp $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030//
     
    4747#include "G4GeometryTolerance.hh"
    4848
     49#include "Randomize.hh"
     50#include "G4TwoVector.hh"
     51
    4952//
    5053// Constructor
     
    6366{
    6467  kCarTolerance = G4GeometryTolerance::GetInstance()->GetSurfaceTolerance();
     68  fSurfaceArea = 0.; 
    6569
    6670  numEdges = rz->NumVertices();
     
    103107  //
    104108  corners = new G4PolyPhiFaceVertex[numEdges];
    105 
    106109  //
    107110  // Fill them
     
    110113 
    111114  G4PolyPhiFaceVertex *corn = corners;
     115  G4PolyPhiFaceVertex *helper=corners;
     116
    112117  iterRZ.Begin();
    113118  do
     
    117122    corn->x = corn->r*radial.x();
    118123    corn->y = corn->r*radial.y();
     124
     125    // Add pointer on prev corner
     126    //
     127    if( corn == corners )
     128      { corn->prev = corners+numEdges-1;}
     129    else
     130      { corn->prev = helper; }
     131
     132    // Add pointer on next corner
     133    //
     134    if( corn < corners+numEdges-1 )
     135      { corn->next = corn+1;}
     136    else
     137      { corn->next = corners; }
     138
     139    helper = corn;
    119140  } while( ++corn, iterRZ.Next() );
    120141
     
    322343  normal    = source.normal;
    323344  radial    = source.radial;
    324   surface    = source.surface;
     345  surface   = source.surface;
    325346  rMin    = source.rMin;
    326347  rMax    = source.rMax;
     
    330351
    331352  kCarTolerance = source.kCarTolerance;
     353  fSurfaceArea = source.fSurfaceArea;
    332354
    333355  //
     
    895917  return answer;
    896918}
     919
     920//
     921// Calculation of Surface Area of a Triangle
     922// In the same time Random Point in Triangle is given
     923//
     924G4double G4PolyPhiFace::SurfaceTriangle( G4ThreeVector p1,
     925                                         G4ThreeVector p2,
     926                                         G4ThreeVector p3,
     927                                         G4ThreeVector *p4 )
     928{
     929  G4ThreeVector v, w;
     930 
     931  v = p3 - p1;
     932  w = p1 - p2;
     933  G4double lambda1 = G4UniformRand();
     934  G4double lambda2 = lambda1*G4UniformRand();
     935 
     936  *p4=p2 + lambda1*w + lambda2*v;
     937  return 0.5*(v.cross(w)).mag();
     938}
     939
     940//
     941// Compute surface area
     942//
     943G4double G4PolyPhiFace::SurfaceArea()
     944{
     945  if ( fSurfaceArea==0. ) { Triangulate(); }
     946  return fSurfaceArea;
     947}
     948
     949//
     950// Return random point on face
     951//
     952G4ThreeVector G4PolyPhiFace::GetPointOnFace()
     953{
     954  Triangulate();
     955  return surface_point;
     956}
     957
     958//
     959// Auxiliary Functions used for Finding the PointOnFace using Triangulation
     960//
     961
     962//
     963// Calculation of 2*Area of Triangle with Sign
     964//
     965G4double G4PolyPhiFace::Area2( G4TwoVector a,
     966                               G4TwoVector b,
     967                               G4TwoVector c )
     968{
     969  return ((b.x()-a.x())*(c.y()-a.y())-
     970          (c.x()-a.x())*(b.y()-a.y()));
     971}
     972
     973//
     974// Boolean function for sign of Surface
     975//
     976G4bool G4PolyPhiFace::Left( G4TwoVector a,
     977                            G4TwoVector b,
     978                            G4TwoVector c )
     979{
     980  return Area2(a,b,c)>0;
     981}
     982
     983//
     984// Boolean function for sign of Surface
     985//
     986G4bool G4PolyPhiFace::LeftOn( G4TwoVector a,
     987                              G4TwoVector b,
     988                              G4TwoVector c )
     989{
     990  return Area2(a,b,c)>=0;
     991}
     992
     993//
     994// Boolean function for sign of Surface
     995//
     996G4bool G4PolyPhiFace::Collinear( G4TwoVector a,
     997                                 G4TwoVector b,
     998                                 G4TwoVector c )
     999{
     1000  return Area2(a,b,c)==0;
     1001}
     1002
     1003//
     1004// Boolean function for finding "Proper" Intersection
     1005// That means Intersection of two lines segments (a,b) and (c,d)
     1006//
     1007G4bool G4PolyPhiFace::IntersectProp( G4TwoVector a,
     1008                                     G4TwoVector b,
     1009                                     G4TwoVector c, G4TwoVector d )
     1010{
     1011  if( Collinear(a,b,c) || Collinear(a,b,d)||
     1012      Collinear(c,d,a) || Collinear(c,d,b) )  { return false; }
     1013
     1014  G4bool Positive;
     1015  Positive = !(Left(a,b,c))^!(Left(a,b,d));
     1016  return Positive && (!Left(c,d,a)^!Left(c,d,b));
     1017}
     1018
     1019//
     1020// Boolean function for determining if Point c is between a and b
     1021// For the tree points(a,b,c) on the same line
     1022//
     1023G4bool G4PolyPhiFace::Between( G4TwoVector a, G4TwoVector b, G4TwoVector c )
     1024{
     1025  if( !Collinear(a,b,c) ) { return false; }
     1026
     1027  if(a.x()!=b.x())
     1028  {
     1029    return ((a.x()<=c.x())&&(c.x()<=b.x()))||
     1030           ((a.x()>=c.x())&&(c.x()>=b.x()));
     1031  }
     1032  else
     1033  {
     1034    return ((a.y()<=c.y())&&(c.y()<=b.y()))||
     1035           ((a.y()>=c.y())&&(c.y()>=b.y()));
     1036  }
     1037}
     1038
     1039//
     1040// Boolean function for finding Intersection "Proper" or not
     1041// Between two line segments (a,b) and (c,d)
     1042//
     1043G4bool G4PolyPhiFace::Intersect( G4TwoVector a,
     1044                                 G4TwoVector b,
     1045                                 G4TwoVector c, G4TwoVector d )
     1046{
     1047 if( IntersectProp(a,b,c,d) )
     1048   { return true; }
     1049 else if( Between(a,b,c)||
     1050          Between(a,b,d)||
     1051          Between(c,d,a)||
     1052          Between(c,d,b) )
     1053   { return true; }
     1054 else
     1055   { return false; }
     1056}
     1057
     1058//
     1059// Boolean Diagonalie help to determine
     1060// if diagonal s of segment (a,b) is convex or reflex
     1061//
     1062G4bool G4PolyPhiFace::Diagonalie( G4PolyPhiFaceVertex *a,
     1063                                  G4PolyPhiFaceVertex *b )
     1064{
     1065  G4PolyPhiFaceVertex   *corner = triangles;
     1066  G4PolyPhiFaceVertex   *corner_next=triangles;
     1067
     1068  // For each Edge (corner,corner_next)
     1069  do
     1070  {
     1071    corner_next=corner->next;
     1072
     1073    // Skip edges incident to a of b
     1074    //
     1075    if( (corner!=a)&&(corner_next!=a)
     1076      &&(corner!=b)&&(corner_next!=b) )
     1077    {
     1078       G4TwoVector rz1,rz2,rz3,rz4;
     1079       rz1 = G4TwoVector(a->r,a->z);
     1080       rz2 = G4TwoVector(b->r,b->z);
     1081       rz3 = G4TwoVector(corner->r,corner->z);
     1082       rz4 = G4TwoVector(corner_next->r,corner_next->z);
     1083       if( Intersect(rz1,rz2,rz3,rz4) ) { return false; }
     1084    }
     1085    corner=corner->next;   
     1086   
     1087  } while( corner != triangles );
     1088
     1089  return true;
     1090}
     1091
     1092//
     1093// Boolean function that determine if b is Inside Cone (a0,a,a1)
     1094// being a the center of the Cone
     1095//
     1096G4bool G4PolyPhiFace::InCone( G4PolyPhiFaceVertex *a, G4PolyPhiFaceVertex *b )
     1097{
     1098  // a0,a and a1 are consecutive vertices
     1099  //
     1100  G4PolyPhiFaceVertex *a0,*a1;
     1101  a1=a->next;
     1102  a0=a->prev;
     1103
     1104  G4TwoVector arz,arz0,arz1,brz;
     1105  arz=G4TwoVector(a->r,a->z);arz0=G4TwoVector(a0->r,a0->z);
     1106  arz1=G4TwoVector(a1->r,a1->z);brz=G4TwoVector(b->r,b->z);
     1107   
     1108 
     1109  if(LeftOn(arz,arz1,arz0))  // If a is convex vertex
     1110  {
     1111    return Left(arz,brz,arz0)&&Left(brz,arz,arz1);
     1112  }
     1113  else                       // Else a is reflex
     1114  {
     1115    return !( LeftOn(arz,brz,arz1)&&LeftOn(brz,arz,arz0));
     1116  }
     1117}
     1118
     1119//
     1120// Boolean function finding if Diagonal is possible
     1121// inside Polycone or PolyHedra
     1122//
     1123G4bool G4PolyPhiFace::Diagonal( G4PolyPhiFaceVertex *a, G4PolyPhiFaceVertex *b )
     1124{
     1125  return InCone(a,b) && InCone(b,a) && Diagonalie(a,b);
     1126}
     1127
     1128//
     1129// Initialisation for Triangulisation by ear tips
     1130// For details see "Computational Geometry in C" by Joseph O'Rourke
     1131//
     1132void G4PolyPhiFace::EarInit()
     1133{
     1134  G4PolyPhiFaceVertex   *corner = triangles;
     1135  G4PolyPhiFaceVertex *c_prev,*c_next;
     1136 
     1137  do
     1138  {
     1139     // We need to determine three consecutive vertices
     1140     //
     1141     c_next=corner->next;
     1142     c_prev=corner->prev;
     1143
     1144     // Calculation of ears
     1145     //
     1146     corner->ear=Diagonal(c_prev,c_next);   
     1147     corner=corner->next;
     1148
     1149  } while( corner!=triangles );
     1150}
     1151
     1152//
     1153// Triangulisation by ear tips for Polycone or Polyhedra
     1154// For details see "Computational Geometry in C" by Joseph O'Rourke
     1155//
     1156void G4PolyPhiFace::Triangulate()
     1157{
     1158  // The copy of Polycone is made and this copy is reordered in order to
     1159  // have a list of triangles. This list is used for GetPointOnFace().
     1160
     1161  G4PolyPhiFaceVertex *tri_help = new G4PolyPhiFaceVertex[numEdges];
     1162  triangles = tri_help;
     1163  G4PolyPhiFaceVertex *triang = triangles;
     1164
     1165  std::vector<G4double> areas;
     1166  std::vector<G4ThreeVector> points;
     1167  G4double area=0.;
     1168  G4PolyPhiFaceVertex *v0,*v1,*v2,*v3,*v4;
     1169  v2=triangles;
     1170
     1171  // Make copy for prev/next for triang=corners
     1172  //
     1173  G4PolyPhiFaceVertex *helper = corners;
     1174  G4PolyPhiFaceVertex *helper2 = corners;
     1175  do
     1176  {
     1177    triang->r = helper->r;
     1178    triang->z = helper->z;
     1179    triang->x = helper->x;
     1180    triang->y= helper->y;
     1181
     1182    // add pointer on prev corner
     1183    //
     1184    if( helper==corners )
     1185      { triang->prev=triangles+numEdges-1; }
     1186    else
     1187      { triang->prev=helper2; }
     1188
     1189    // add pointer on next corner
     1190    //
     1191    if( helper<corners+numEdges-1 )
     1192      { triang->next=triang+1; }
     1193    else
     1194      { triang->next=triangles; }
     1195    helper2=triang;
     1196    helper=helper->next;
     1197    triang=triang->next;
     1198
     1199  } while( helper!=corners );
     1200
     1201  EarInit();
     1202 
     1203  G4int n=numEdges;
     1204  G4int i=0;
     1205  G4ThreeVector p1,p2,p3,p4;
     1206  const G4int max_n_loops=numEdges*10000; // protection against infinite loop
     1207
     1208  // Each step of outer loop removes one ear
     1209  //
     1210  while(n>3)  // Inner loop searches for one ear
     1211  {
     1212    v2=triangles;
     1213    do
     1214    {
     1215      if(v2->ear)  // Ear found. Fill variables
     1216      {
     1217        // (v1,v3) is diagonal
     1218        //
     1219        v3=v2->next; v4=v3->next;
     1220        v1=v2->prev; v0=v1->prev;
     1221       
     1222        // Calculate areas and points
     1223
     1224        p1=G4ThreeVector((v2)->x,(v2)->y,(v2)->z);
     1225        p2=G4ThreeVector((v1)->x,(v1)->y,(v1)->z);
     1226        p3=G4ThreeVector((v3)->x,(v3)->y,(v3)->z);
     1227
     1228        G4double result1 = SurfaceTriangle(p1,p2,p3,&p4 );
     1229        points.push_back(p4);
     1230        areas.push_back(result1);
     1231        area=area+result1;
     1232
     1233        // Update earity of diagonal endpoints
     1234        //
     1235        v1->ear=Diagonal(v0,v3);
     1236        v3->ear=Diagonal(v1,v4);
     1237
     1238        // Cut off the ear v2
     1239        // Has to be done for a copy and not for real PolyPhiFace
     1240        //
     1241        v1->next=v3;
     1242        v3->prev=v1;
     1243        triangles=v3; // In case the head was v2
     1244        n--;
     1245 
     1246        break; // out of inner loop
     1247      }        // end if ear found
     1248
     1249      v2=v2->next;
     1250   
     1251    } while( v2!=triangles );
     1252
     1253    i++;
     1254    if(i>=max_n_loops)
     1255    {
     1256      G4Exception( "G4PolyPhiFace::Triangulation()",
     1257                   "Bad_Definition_of_Solid", FatalException,
     1258                   "Maximum number of steps is reached for triangulation!" );
     1259    }
     1260  }   // end outer while loop
     1261
     1262  if(v2->next)
     1263  {
     1264     // add last triangle
     1265     //
     1266     v2=v2->next;
     1267     p1=G4ThreeVector((v2)->x,(v2)->y,(v2)->z);
     1268     p2=G4ThreeVector((v2->next)->x,(v2->next)->y,(v2->next)->z);
     1269     p3=G4ThreeVector((v2->prev)->x,(v2->prev)->y,(v2->prev)->z);
     1270     G4double result1 = SurfaceTriangle(p1,p2,p3,&p4 );
     1271     points.push_back(p4);
     1272     areas.push_back(result1);
     1273     area=area+result1;
     1274  }
     1275 
     1276  // Surface Area is stored
     1277  //
     1278  fSurfaceArea = area;
     1279 
     1280  // Second Step: choose randomly one surface
     1281  //
     1282  G4double chose = area*G4UniformRand();
     1283   
     1284  // Third Step: Get a point on choosen surface
     1285  //
     1286  G4double Achose1, Achose2;
     1287  Achose1=0; Achose2=0.;
     1288  i=0;
     1289  do
     1290  {
     1291    Achose2+=areas[i];
     1292    if(chose>=Achose1 && chose<Achose2)
     1293    {
     1294      G4ThreeVector point;
     1295       point=points[i] ;
     1296       surface_point=point;
     1297       break;     
     1298    }
     1299    i++; Achose1=Achose2;
     1300  } while( i<numEdges-2 );
     1301 
     1302  delete [] tri_help;
     1303}
  • trunk/source/geometry/solids/specific/src/G4Polycone.cc

    r831 r850  
    2525//
    2626//
    27 // $Id: G4Polycone.cc,v 1.39 2007/10/02 09:50:46 gcosmo Exp $
    28 // GEANT4 tag $Name: $
     27// $Id: G4Polycone.cc,v 1.43 2008/05/15 13:45:15 gcosmo Exp $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030//
     
    781781//
    782782G4ThreeVector G4Polycone::GetPointOnSurface() const
    783 {
    784   G4double Area=0,totArea=0,Achose1=0,Achose2=0,phi,cosphi,sinphi,rRand;
    785   G4int i=0;
    786   G4int numPlanes = original_parameters->Num_z_planes;
    787  
    788   phi = RandFlat::shoot(startPhi,endPhi);
    789   cosphi = std::cos(phi);
    790   sinphi = std::sin(phi);
    791 
    792   rRand = RandFlat::shoot(original_parameters->Rmin[0],
    793                           original_parameters->Rmax[0]);
    794  
    795   std::vector<G4double> areas;       // (numPlanes+1);
    796   std::vector<G4ThreeVector> points; // (numPlanes-1);
    797  
    798   areas.push_back(pi*(sqr(original_parameters->Rmax[0])
    799                      -sqr(original_parameters->Rmin[0])));
    800 
    801   for(i=0; i<numPlanes-1; i++)
    802   {
    803     Area = (original_parameters->Rmin[i]+original_parameters->Rmin[i+1])*
    804       std::sqrt(sqr(original_parameters->Rmin[i]
    805                    -original_parameters->Rmin[i+1])+
    806                 sqr(original_parameters->Z_values[i+1]
    807                    -original_parameters->Z_values[i]));
     783{
     784  if (!genericPcon)  // Polycone by faces
     785  {
     786    G4double Area=0,totArea=0,Achose1=0,Achose2=0,phi,cosphi,sinphi,rRand;
     787    G4int i=0;
     788    G4int numPlanes = original_parameters->Num_z_planes;
     789 
     790    phi = RandFlat::shoot(startPhi,endPhi);
     791    cosphi = std::cos(phi);
     792    sinphi = std::sin(phi);
     793
     794    rRand = RandFlat::shoot(original_parameters->Rmin[0],
     795                            original_parameters->Rmax[0]);
     796 
     797    std::vector<G4double> areas;       // (numPlanes+1);
     798    std::vector<G4ThreeVector> points; // (numPlanes-1);
     799 
     800    areas.push_back(pi*(sqr(original_parameters->Rmax[0])
     801                       -sqr(original_parameters->Rmin[0])));
     802
     803    for(i=0; i<numPlanes-1; i++)
     804    {
     805      Area = (original_parameters->Rmin[i]+original_parameters->Rmin[i+1])
     806           * std::sqrt(sqr(original_parameters->Rmin[i]
     807                      -original_parameters->Rmin[i+1])+
     808                       sqr(original_parameters->Z_values[i+1]
     809                      -original_parameters->Z_values[i]));
     810
     811      Area += (original_parameters->Rmax[i]+original_parameters->Rmax[i+1])
     812            * std::sqrt(sqr(original_parameters->Rmax[i]
     813                       -original_parameters->Rmax[i+1])+
     814                        sqr(original_parameters->Z_values[i+1]
     815                       -original_parameters->Z_values[i]));
     816
     817      Area *= 0.5*(endPhi-startPhi);
    808818   
    809     Area += (original_parameters->Rmax[i]+original_parameters->Rmax[i+1])*
    810       std::sqrt(sqr(original_parameters->Rmax[i]
    811                    -original_parameters->Rmax[i+1])+
    812                 sqr(original_parameters->Z_values[i+1]
    813                    -original_parameters->Z_values[i]));
    814 
    815     Area *= 0.5*(endPhi-startPhi);
    816    
    817     if(startPhi==0.&& endPhi == twopi)
    818     {
    819       Area += std::fabs(original_parameters->Z_values[i+1]
    820                        -original_parameters->Z_values[i])*
    821                        (original_parameters->Rmax[i]
    822                        +original_parameters->Rmax[i+1]
    823                        -original_parameters->Rmin[i]
    824                        -original_parameters->Rmin[i+1]);
    825     }
    826     areas.push_back(Area);
    827     totArea += Area;
    828   }
    829  
    830   areas.push_back(pi*(sqr(original_parameters->Rmax[numPlanes-1])-
    831                       sqr(original_parameters->Rmin[numPlanes-1])));
    832  
    833   totArea += (areas[0]+areas[numPlanes]);
    834   G4double chose = RandFlat::shoot(0.,totArea);
    835 
    836   if( (chose>=0.) && (chose<areas[0]) )
    837   {
    838     return G4ThreeVector(rRand*cosphi, rRand*sinphi,
    839                          original_parameters->Z_values[0]);
    840   }
    841  
    842   for (i=0; i<numPlanes-1; i++)
    843   {
    844     Achose1 += areas[i];
    845     Achose2 = (Achose1+areas[i+1]);
    846     if(chose>=Achose1 && chose<Achose2)
    847       {// G4cout<<"will return Point On Cut"<<G4endl;
    848       return GetPointOnCut(original_parameters->Rmin[i],
    849                            original_parameters->Rmax[i],
    850                            original_parameters->Rmin[i+1],
    851                            original_parameters->Rmax[i+1],
    852                            original_parameters->Z_values[i],
    853                            original_parameters->Z_values[i+1], Area);
    854     }
    855   }
    856 
    857   rRand = RandFlat::shoot(original_parameters->Rmin[numPlanes-1],
    858                           original_parameters->Rmax[numPlanes-1]);
    859  
    860   return G4ThreeVector(rRand*cosphi,rRand*sinphi,
    861                        original_parameters->Z_values[numPlanes-1]); 
    862 }
    863 
     819      if(startPhi==0.&& endPhi == twopi)
     820      {
     821        Area += std::fabs(original_parameters->Z_values[i+1]
     822                         -original_parameters->Z_values[i])*
     823                         (original_parameters->Rmax[i]
     824                         +original_parameters->Rmax[i+1]
     825                         -original_parameters->Rmin[i]
     826                         -original_parameters->Rmin[i+1]);
     827      }
     828      areas.push_back(Area);
     829      totArea += Area;
     830    }
     831 
     832    areas.push_back(pi*(sqr(original_parameters->Rmax[numPlanes-1])-
     833                        sqr(original_parameters->Rmin[numPlanes-1])));
     834 
     835    totArea += (areas[0]+areas[numPlanes]);
     836    G4double chose = RandFlat::shoot(0.,totArea);
     837
     838    if( (chose>=0.) && (chose<areas[0]) )
     839    {
     840      return G4ThreeVector(rRand*cosphi, rRand*sinphi,
     841                           original_parameters->Z_values[0]);
     842    }
     843 
     844    for (i=0; i<numPlanes-1; i++)
     845    {
     846      Achose1 += areas[i];
     847      Achose2 = (Achose1+areas[i+1]);
     848      if(chose>=Achose1 && chose<Achose2)
     849      {
     850        return GetPointOnCut(original_parameters->Rmin[i],
     851                             original_parameters->Rmax[i],
     852                             original_parameters->Rmin[i+1],
     853                             original_parameters->Rmax[i+1],
     854                             original_parameters->Z_values[i],
     855                             original_parameters->Z_values[i+1], Area);
     856      }
     857    }
     858
     859    rRand = RandFlat::shoot(original_parameters->Rmin[numPlanes-1],
     860                            original_parameters->Rmax[numPlanes-1]);
     861 
     862    return G4ThreeVector(rRand*cosphi,rRand*sinphi,
     863                         original_parameters->Z_values[numPlanes-1]); 
     864
     865  }
     866  else  // Generic Polycone
     867  {
     868    return GetPointOnSurfaceGeneric(); 
     869  }
     870}
    864871
    865872//
  • trunk/source/geometry/solids/specific/src/G4PolyconeSide.cc

    r831 r850  
    2525//
    2626//
    27 // $Id: G4PolyconeSide.cc,v 1.17 2007/08/13 10:33:04 gcosmo Exp $
    28 // GEANT4 tag $Name: $
     27// $Id: G4PolyconeSide.cc,v 1.19 2008/05/15 11:41:59 gcosmo Exp $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030//
     
    4646#include "G4SolidExtentList.hh"
    4747#include "G4GeometryTolerance.hh"
     48
     49#include "Randomize.hh"
    4850
    4951//
     
    6466{
    6567  kCarTolerance = G4GeometryTolerance::GetInstance()->GetSurfaceTolerance();
     68  fSurfaceArea = 0.0;
    6669
    6770  //
     
    211214
    212215  kCarTolerance = source.kCarTolerance;
     216  fSurfaceArea = source.fSurfaceArea;
    213217 
    214218  cone    = new G4IntersectingCone( *source.cone );
     
    10441048  y = 0.5*( y1+s1*ty1 + y2+s2*ty2 );
    10451049}
     1050
     1051//
     1052// Calculate surface area for GetPointOnSurface()
     1053//
     1054G4double G4PolyconeSide::SurfaceArea()
     1055{
     1056  if(fSurfaceArea==0)
     1057  {
     1058    fSurfaceArea = (r[0]+r[1])* std::sqrt(sqr(r[0]-r[1])+sqr(z[0]-z[1]));
     1059    fSurfaceArea *= 0.5*(deltaPhi);
     1060  } 
     1061  return fSurfaceArea;
     1062}
     1063
     1064//
     1065// GetPointOnFace
     1066//
     1067G4ThreeVector G4PolyconeSide::GetPointOnFace()
     1068{
     1069  G4double x,y,zz;
     1070  G4double rr,phi,dz,dr;
     1071  dr=r[1]-r[0];dz=z[1]-z[0];
     1072  phi=startPhi+deltaPhi*G4UniformRand();
     1073  rr=r[0]+dr*G4UniformRand();
     1074 
     1075  x=rr*std::cos(phi);
     1076  y=rr*std::sin(phi);
     1077
     1078  // PolyconeSide has a Ring Form
     1079  //
     1080  if (dz==0.)
     1081  {
     1082    zz=z[0];
     1083  }
     1084  else
     1085  {
     1086    if(dr==0.)  // PolyconeSide has a Tube Form
     1087    {
     1088      zz = z[0]+dz*G4UniformRand();
     1089    }
     1090    else
     1091    {
     1092      zz = z[0]+(rr-r[0])*dz/dr;
     1093    }
     1094  }
     1095
     1096  return G4ThreeVector(x,y,zz);
     1097}
  • trunk/source/geometry/solids/specific/src/G4Polyhedra.cc

    r831 r850  
    2525//
    2626//
    27 // $Id: G4Polyhedra.cc,v 1.36.8.1 2008/04/23 08:10:24 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-01-patch-02 $
     27// $Id: G4Polyhedra.cc,v 1.42 2008/05/15 13:45:15 gcosmo Exp $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030//
     
    674674G4ThreeVector G4Polyhedra::GetPointOnSurface() const
    675675{
    676   G4int j, numPlanes = original_parameters->Num_z_planes, Flag=0;
    677   G4double chose, totArea=0., Achose1, Achose2,
    678            rad1, rad2, sinphi1, sinphi2, cosphi1, cosphi2;
    679   G4double a, b, l2, rang,
    680            totalPhi,ksi,
    681            area, aTop=0., aBottom=0.,zVal=0.;
    682   G4ThreeVector p0, p1, p2, p3;
    683   std::vector<G4double> aVector1;
    684   std::vector<G4double> aVector2;
    685   std::vector<G4double> aVector3;
    686 
    687    totalPhi= (phiIsOpen) ? (endPhi-startPhi) : twopi;
    688    ksi = totalPhi/numSide;
    689    G4double cosksi = std::cos(ksi/2.);
    690 
    691   // below we generate the areas relevant to our solid
    692   //
    693   for(j=0; j<numPlanes-1; j++)
    694   {
    695     a = original_parameters->Rmax[j+1];
    696     b = original_parameters->Rmax[j];
    697     l2 = sqr(original_parameters->Z_values[j]
    698             -original_parameters->Z_values[j+1]) + sqr(b-a);
    699     area = std::sqrt(l2-sqr((a-b)*cosksi))*(a+b)*cosksi;
    700     aVector1.push_back(area);
    701   }
    702  
    703   for(j=0; j<numPlanes-1; j++)
    704   {
    705     a = original_parameters->Rmin[j+1];//*cosksi;
    706     b = original_parameters->Rmin[j];//*cosksi;
    707     l2 = sqr(original_parameters->Z_values[j]
    708             -original_parameters->Z_values[j+1]) + sqr(b-a);
    709     area = std::sqrt(l2-sqr((a-b)*cosksi))*(a+b)*cosksi;
    710     aVector2.push_back(area);
    711   }
    712  
    713   for(j=0; j<numPlanes-1; j++)
    714   {
    715     if(phiIsOpen == true)
    716     {
    717       aVector3.push_back(0.5*(original_parameters->Rmax[j]
    718                              -original_parameters->Rmin[j]
    719                              +original_parameters->Rmax[j+1]
    720                              -original_parameters->Rmin[j+1])
    721       *std::fabs(original_parameters->Z_values[j+1]
    722                 -original_parameters->Z_values[j]));
    723     }
    724     else { aVector3.push_back(0.); }
    725   }
    726  
    727   for(j=0; j<numPlanes-1; j++)
    728   {
    729     totArea += numSide*(aVector1[j]+aVector2[j])+2.*aVector3[j];
    730   }
    731  
    732   // must include top and bottom areas
    733   if(original_parameters->Rmax[numPlanes-1] != 0.)
    734   {
    735     a = original_parameters->Rmax[numPlanes-1];
    736     b = original_parameters->Rmin[numPlanes-1];
    737     l2 = sqr(a-b);
    738     aTop = std::sqrt(l2-sqr((a-b)*cosksi))*(a+b)*cosksi;
    739   }
    740 
    741   if(original_parameters->Rmax[0] != 0.)
    742   {
    743     a = original_parameters->Rmax[0];
    744     b = original_parameters->Rmin[0];
    745     l2 = sqr(a-b);
    746     aBottom = std::sqrt(l2-sqr((a-b)*cosksi))*(a+b)*cosksi;
    747   }
    748 
    749   Achose1 = 0.;
    750   Achose2 = numSide*(aVector1[0]+aVector2[0])+2.*aVector3[0];
    751 
    752   chose = RandFlat::shoot(0.,totArea+aTop+aBottom);
    753   if( (chose >= 0.) && (chose < aTop + aBottom) )
    754   { 
     676  if( !genericPgon )  // Polyhedra by faces
     677  {
     678    G4int j, numPlanes = original_parameters->Num_z_planes, Flag=0;
     679    G4double chose, totArea=0., Achose1, Achose2,
     680             rad1, rad2, sinphi1, sinphi2, cosphi1, cosphi2;
     681    G4double a, b, l2, rang, totalPhi, ksi,
     682             area, aTop=0., aBottom=0., zVal=0.;
     683
     684    G4ThreeVector p0, p1, p2, p3;
     685    std::vector<G4double> aVector1;
     686    std::vector<G4double> aVector2;
     687    std::vector<G4double> aVector3;
     688
     689    totalPhi= (phiIsOpen) ? (endPhi-startPhi) : twopi;
     690    ksi = totalPhi/numSide;
     691    G4double cosksi = std::cos(ksi/2.);
     692
     693    // Below we generate the areas relevant to our solid
     694    //
     695    for(j=0; j<numPlanes-1; j++)
     696    {
     697      a = original_parameters->Rmax[j+1];
     698      b = original_parameters->Rmax[j];
     699      l2 = sqr(original_parameters->Z_values[j]
     700              -original_parameters->Z_values[j+1]) + sqr(b-a);
     701      area = std::sqrt(l2-sqr((a-b)*cosksi))*(a+b)*cosksi;
     702      aVector1.push_back(area);
     703    }
     704
     705    for(j=0; j<numPlanes-1; j++)
     706    {
     707      a = original_parameters->Rmin[j+1];//*cosksi;
     708      b = original_parameters->Rmin[j];//*cosksi;
     709      l2 = sqr(original_parameters->Z_values[j]
     710              -original_parameters->Z_values[j+1]) + sqr(b-a);
     711      area = std::sqrt(l2-sqr((a-b)*cosksi))*(a+b)*cosksi;
     712      aVector2.push_back(area);
     713    }
     714 
     715    for(j=0; j<numPlanes-1; j++)
     716    {
     717      if(phiIsOpen == true)
     718      {
     719        aVector3.push_back(0.5*(original_parameters->Rmax[j]
     720                               -original_parameters->Rmin[j]
     721                               +original_parameters->Rmax[j+1]
     722                               -original_parameters->Rmin[j+1])
     723        *std::fabs(original_parameters->Z_values[j+1]
     724                  -original_parameters->Z_values[j]));
     725      }
     726      else { aVector3.push_back(0.); }
     727    }
     728 
     729    for(j=0; j<numPlanes-1; j++)
     730    {
     731      totArea += numSide*(aVector1[j]+aVector2[j])+2.*aVector3[j];
     732    }
     733 
     734    // Must include top and bottom areas
     735    //
     736    if(original_parameters->Rmax[numPlanes-1] != 0.)
     737    {
     738      a = original_parameters->Rmax[numPlanes-1];
     739      b = original_parameters->Rmin[numPlanes-1];
     740      l2 = sqr(a-b);
     741      aTop = std::sqrt(l2-sqr((a-b)*cosksi))*(a+b)*cosksi;
     742    }
     743
     744    if(original_parameters->Rmax[0] != 0.)
     745    {
     746      a = original_parameters->Rmax[0];
     747      b = original_parameters->Rmin[0];
     748      l2 = sqr(a-b);
     749      aBottom = std::sqrt(l2-sqr((a-b)*cosksi))*(a+b)*cosksi;
     750    }
     751
     752    Achose1 = 0.;
     753    Achose2 = numSide*(aVector1[0]+aVector2[0])+2.*aVector3[0];
     754
     755    chose = RandFlat::shoot(0.,totArea+aTop+aBottom);
     756    if( (chose >= 0.) && (chose < aTop + aBottom) )
     757    {
     758      chose = RandFlat::shoot(startPhi,startPhi+totalPhi);
     759      rang = std::floor((chose-startPhi)/ksi-0.01);
     760      if(rang<0) { rang=0; }
     761      rang = std::fabs(rang); 
     762      sinphi1 = std::sin(startPhi+rang*ksi);
     763      sinphi2 = std::sin(startPhi+(rang+1)*ksi);
     764      cosphi1 = std::cos(startPhi+rang*ksi);
     765      cosphi2 = std::cos(startPhi+(rang+1)*ksi);
     766      chose = RandFlat::shoot(0., aTop + aBottom);
     767      if(chose>=0. && chose<aTop)
     768      {
     769        rad1 = original_parameters->Rmin[numPlanes-1];
     770        rad2 = original_parameters->Rmax[numPlanes-1];
     771        zVal = original_parameters->Z_values[numPlanes-1];
     772      }
     773      else
     774      {
     775        rad1 = original_parameters->Rmin[0];
     776        rad2 = original_parameters->Rmax[0];
     777        zVal = original_parameters->Z_values[0];
     778      }
     779      p0 = G4ThreeVector(rad1*cosphi1,rad1*sinphi1,zVal);
     780      p1 = G4ThreeVector(rad2*cosphi1,rad2*sinphi1,zVal);
     781      p2 = G4ThreeVector(rad2*cosphi2,rad2*sinphi2,zVal);
     782      p3 = G4ThreeVector(rad1*cosphi2,rad1*sinphi2,zVal);
     783      return GetPointOnPlane(p0,p1,p2,p3);
     784    }
     785    else
     786    {
     787      for (j=0; j<numPlanes-1; j++)
     788      {
     789        if( ((chose >= Achose1) && (chose < Achose2)) || (j == numPlanes-2) )
     790        {
     791          Flag = j; break;
     792        }
     793        Achose1 += numSide*(aVector1[j]+aVector2[j])+2.*aVector3[j];
     794        Achose2 = Achose1 + numSide*(aVector1[j+1]+aVector2[j+1])
     795                          + 2.*aVector3[j+1];
     796      }
     797    }
     798
     799    // At this point we have chosen a subsection
     800    // between to adjacent plane cuts...
     801
     802    j = Flag;
    755803   
    756     chose = RandFlat::shoot(startPhi,startPhi+totalPhi);
    757     rang = std::floor((chose-startPhi)/ksi-0.01);
    758     if(rang<0)rang=0;
    759     rang = std::fabs(rang); 
    760     sinphi1 = std::sin(startPhi+rang*ksi);
    761     sinphi2 = std::sin(startPhi+(rang+1)*ksi);
    762     cosphi1 = std::cos(startPhi+rang*ksi);
    763     cosphi2 = std::cos(startPhi+(rang+1)*ksi);
    764     chose = RandFlat::shoot(0., aTop + aBottom);
    765     if(chose>=0. && chose<aTop)
    766     {
    767       rad1 = original_parameters->Rmin[numPlanes-1];
    768       rad2 = original_parameters->Rmax[numPlanes-1];
    769       zVal = original_parameters->Z_values[numPlanes-1];
    770     }
    771     else
    772     {
    773       rad1 = original_parameters->Rmin[0];
    774       rad2 = original_parameters->Rmax[0];
    775       zVal = original_parameters->Z_values[0];
    776     }
    777     p0 = G4ThreeVector(rad1*cosphi1,rad1*sinphi1,zVal);
    778     p1 = G4ThreeVector(rad2*cosphi1,rad2*sinphi1,zVal);
    779     p2 = G4ThreeVector(rad2*cosphi2,rad2*sinphi2,zVal);
    780     p3 = G4ThreeVector(rad1*cosphi2,rad1*sinphi2,zVal);
    781     return GetPointOnPlane(p0,p1,p2,p3);
    782   }
    783   else
    784   {
    785     for (j=0; j<numPlanes-1; j++)
    786     {
    787       if( ((chose >= Achose1) && (chose < Achose2)) || (j == numPlanes-2) )
    788       {
    789         Flag = j; break;
    790       }
    791       Achose1 += numSide*(aVector1[j]+aVector2[j])+2.*aVector3[j];
    792       Achose2 = Achose1 + numSide*(aVector1[j+1]+aVector2[j+1])
    793                         + 2.*aVector3[j+1];
    794     }
    795   }
    796 
    797   // at this point we have chosen a subsection
    798   // between to adjacent plane cuts...
    799 
    800   j = Flag;
     804    totArea = numSide*(aVector1[j]+aVector2[j])+2.*aVector3[j];
     805    chose = RandFlat::shoot(0.,totArea);
     806 
     807    if( (chose>=0.) && (chose<numSide*aVector1[j]) )
     808    {
     809      chose = RandFlat::shoot(startPhi,startPhi+totalPhi);
     810      rang = std::floor((chose-startPhi)/ksi-0.01);
     811      if(rang<0) { rang=0; }
     812      rang = std::fabs(rang);
     813      rad1 = original_parameters->Rmax[j];
     814      rad2 = original_parameters->Rmax[j+1];
     815      sinphi1 = std::sin(startPhi+rang*ksi);
     816      sinphi2 = std::sin(startPhi+(rang+1)*ksi);
     817      cosphi1 = std::cos(startPhi+rang*ksi);
     818      cosphi2 = std::cos(startPhi+(rang+1)*ksi);
     819      zVal = original_parameters->Z_values[j];
    801820   
    802   totArea = numSide*(aVector1[j]+aVector2[j])+2.*aVector3[j];
    803   chose = RandFlat::shoot(0.,totArea);
    804  
    805   if( (chose>=0.) && (chose<numSide*aVector1[j]) )
    806   {
    807     chose = RandFlat::shoot(startPhi,startPhi+totalPhi);
    808     rang = std::floor((chose-startPhi)/ksi-0.01);
    809     if(rang<0)rang=0;
    810     rang = std::fabs(rang);
    811     rad1 = original_parameters->Rmax[j];
    812     rad2 = original_parameters->Rmax[j+1];
    813     sinphi1 = std::sin(startPhi+rang*ksi);
    814     sinphi2 = std::sin(startPhi+(rang+1)*ksi);
    815     cosphi1 = std::cos(startPhi+rang*ksi);
    816     cosphi2 = std::cos(startPhi+(rang+1)*ksi);
    817     zVal = original_parameters->Z_values[j];
     821      p0 = G4ThreeVector(rad1*cosphi1,rad1*sinphi1,zVal);
     822      p1 = G4ThreeVector(rad1*cosphi2,rad1*sinphi2,zVal);
     823
     824      zVal = original_parameters->Z_values[j+1];
     825
     826      p2 = G4ThreeVector(rad2*cosphi2,rad2*sinphi2,zVal);
     827      p3 = G4ThreeVector(rad2*cosphi1,rad2*sinphi1,zVal);
     828      return GetPointOnPlane(p0,p1,p2,p3);
     829    }
     830    else if ( (chose >= numSide*aVector1[j])
     831           && (chose <= numSide*(aVector1[j]+aVector2[j])) )
     832    {
     833      chose = RandFlat::shoot(startPhi,startPhi+totalPhi);
     834      rang = std::floor((chose-startPhi)/ksi-0.01);
     835      if(rang<0) { rang=0; }
     836      rang = std::fabs(rang);
     837      rad1 = original_parameters->Rmin[j];
     838      rad2 = original_parameters->Rmin[j+1];
     839      sinphi1 = std::sin(startPhi+rang*ksi);
     840      sinphi2 = std::sin(startPhi+(rang+1)*ksi);
     841      cosphi1 = std::cos(startPhi+rang*ksi);
     842      cosphi2 = std::cos(startPhi+(rang+1)*ksi);
     843      zVal = original_parameters->Z_values[j];
     844
     845      p0 = G4ThreeVector(rad1*cosphi1,rad1*sinphi1,zVal);
     846      p1 = G4ThreeVector(rad1*cosphi2,rad1*sinphi2,zVal);
     847
     848      zVal = original_parameters->Z_values[j+1];
    818849   
    819     p0 = G4ThreeVector(rad1*cosphi1,rad1*sinphi1,zVal);
    820     p1 = G4ThreeVector(rad1*cosphi2,rad1*sinphi2,zVal);
    821 
    822     zVal = original_parameters->Z_values[j+1];
    823 
    824     p2 = G4ThreeVector(rad2*cosphi2,rad2*sinphi2,zVal);
    825     p3 = G4ThreeVector(rad2*cosphi1,rad2*sinphi1,zVal);
     850      p2 = G4ThreeVector(rad2*cosphi2,rad2*sinphi2,zVal);
     851      p3 = G4ThreeVector(rad2*cosphi1,rad2*sinphi1,zVal);
     852      return GetPointOnPlane(p0,p1,p2,p3);
     853    }
     854
     855    chose = RandFlat::shoot(0.,2.2);
     856    if( (chose>=0.) && (chose < 1.) )
     857    {
     858      rang = startPhi;
     859    }
     860    else
     861    {
     862      rang = endPhi;
     863    }
     864
     865    cosphi1 = std::cos(rang); rad1 = original_parameters->Rmin[j];
     866    sinphi1 = std::sin(rang); rad2 = original_parameters->Rmax[j];
     867
     868    p0 = G4ThreeVector(rad1*cosphi1,rad1*sinphi1,
     869                       original_parameters->Z_values[j]);
     870    p1 = G4ThreeVector(rad2*cosphi1,rad2*sinphi1,
     871                       original_parameters->Z_values[j]);
     872
     873    rad1 = original_parameters->Rmax[j+1];
     874    rad2 = original_parameters->Rmin[j+1];
     875
     876    p2 = G4ThreeVector(rad1*cosphi1,rad1*sinphi1,
     877                       original_parameters->Z_values[j+1]);
     878    p3 = G4ThreeVector(rad2*cosphi1,rad2*sinphi1,
     879                       original_parameters->Z_values[j+1]);
    826880    return GetPointOnPlane(p0,p1,p2,p3);
    827881  }
    828   else if ( (chose >= numSide*aVector1[j])
    829          && (chose <= numSide*(aVector1[j]+aVector2[j])) )
    830   {
    831    
    832     chose = RandFlat::shoot(startPhi,startPhi+totalPhi);
    833     rang = std::floor((chose-startPhi)/ksi-0.01);
    834     if(rang<0)rang=0;
    835     rang = std::fabs(rang);
    836     rad1 = original_parameters->Rmin[j];
    837     rad2 = original_parameters->Rmin[j+1];
    838     sinphi1 = std::sin(startPhi+rang*ksi);
    839     sinphi2 = std::sin(startPhi+(rang+1)*ksi);
    840     cosphi1 = std::cos(startPhi+rang*ksi);
    841     cosphi2 = std::cos(startPhi+(rang+1)*ksi);
    842     zVal = original_parameters->Z_values[j];
    843    
    844     p0 = G4ThreeVector(rad1*cosphi1,rad1*sinphi1,zVal);
    845     p1 = G4ThreeVector(rad1*cosphi2,rad1*sinphi2,zVal);
    846 
    847     zVal = original_parameters->Z_values[j+1];
    848    
    849     p2 = G4ThreeVector(rad2*cosphi2,rad2*sinphi2,zVal);
    850     p3 = G4ThreeVector(rad2*cosphi1,rad2*sinphi1,zVal);
    851     return GetPointOnPlane(p0,p1,p2,p3);
    852   }
    853 
    854   chose = RandFlat::shoot(0.,2.2);
    855   if( (chose>=0.) && (chose < 1.) )
    856   {
    857     rang = startPhi;
    858   }
    859   else
    860   {
    861     rang = endPhi;
    862   }
    863 
    864   cosphi1 = std::cos(rang); rad1 = original_parameters->Rmin[j];
    865   sinphi1 = std::sin(rang); rad2 = original_parameters->Rmax[j];
    866    
    867   p0 = G4ThreeVector(rad1*cosphi1,rad1*sinphi1,
    868                      original_parameters->Z_values[j]);
    869   p1 = G4ThreeVector(rad2*cosphi1,rad2*sinphi1,
    870                      original_parameters->Z_values[j]);
    871    
    872   rad1 = original_parameters->Rmax[j+1];
    873   rad2 = original_parameters->Rmin[j+1];
    874      
    875   p2 = G4ThreeVector(rad1*cosphi1,rad1*sinphi1,
    876                      original_parameters->Z_values[j+1]);
    877   p3 = G4ThreeVector(rad2*cosphi1,rad2*sinphi1,
    878                      original_parameters->Z_values[j+1]);
    879   return GetPointOnPlane(p0,p1,p2,p3);
    880 }
    881 
     882  else  // Generic polyhedra
     883  {
     884    return GetPointOnSurfaceGeneric();
     885  }
     886}
    882887
    883888//
  • trunk/source/geometry/solids/specific/src/G4PolyhedraSide.cc

    r831 r850  
    2525//
    2626//
    27 // $Id: G4PolyhedraSide.cc,v 1.13 2007/05/31 13:52:48 gcosmo Exp $
    28 // GEANT4 tag $Name: $
     27// $Id: G4PolyhedraSide.cc,v 1.15 2008/05/15 11:41:59 gcosmo Exp $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030//
     
    3535// G4PolyhedraSide.cc
    3636//
    37 // Implemenation of the face representing one segmented side of a Polyhedra
     37// Implementation of the face representing one segmented side of a Polyhedra
    3838//
    3939// --------------------------------------------------------------------
     
    4545#include "G4SolidExtentList.hh"
    4646#include "G4GeometryTolerance.hh"
     47
     48#include "Randomize.hh"
    4749
    4850//
     
    6466
    6567  kCarTolerance = G4GeometryTolerance::GetInstance()->GetSurfaceTolerance();
    66 
     68  fSurfaceArea=0.;
    6769  //
    6870  // Record values
     
    359361
    360362  kCarTolerance = source.kCarTolerance;
    361  
     363  fSurfaceArea = source.fSurfaceArea;
     364
    362365  cone = new G4IntersectingCone( *source.cone );
    363366
     
    11401143  return std::sqrt( distFaceNorm*distFaceNorm + distOut2 );
    11411144}
     1145
     1146
     1147//
     1148// Calculation of surface area of a triangle.
     1149// At the same time a random point in the triangle is given
     1150//
     1151G4double G4PolyhedraSide::SurfaceTriangle( G4ThreeVector p1,
     1152                                           G4ThreeVector p2,
     1153                                           G4ThreeVector p3,
     1154                                           G4ThreeVector *p4 )
     1155{
     1156  G4ThreeVector v, w;
     1157 
     1158  v = p3 - p1;
     1159  w = p1 - p2;
     1160  G4double lambda1 = G4UniformRand();
     1161  G4double lambda2 = lambda1*G4UniformRand();
     1162 
     1163  *p4=p2 + lambda1*w + lambda2*v;
     1164  return 0.5*(v.cross(w)).mag();
     1165}
     1166
     1167
     1168//
     1169// GetPointOnPlane
     1170//
     1171// Auxiliary method for GetPointOnSurface()
     1172//
     1173G4ThreeVector
     1174G4PolyhedraSide::GetPointOnPlane( G4ThreeVector p0, G4ThreeVector p1,
     1175                                  G4ThreeVector p2, G4ThreeVector p3,
     1176                                  G4double *Area )
     1177{
     1178  G4double chose,aOne,aTwo;
     1179  G4ThreeVector point1,point2;
     1180  aOne = SurfaceTriangle(p0,p1,p2,&point1);
     1181  aTwo = SurfaceTriangle(p2,p3,p0,&point2);
     1182  *Area= aOne+aTwo;
     1183
     1184  chose = G4UniformRand()*(aOne+aTwo);
     1185  if( (chose>=0.) && (chose < aOne) )
     1186  {
     1187   return (point1);   
     1188  }
     1189  return (point2);
     1190}
     1191
     1192
     1193//
     1194// SurfaceArea()
     1195//
     1196G4double G4PolyhedraSide::SurfaceArea()
     1197{
     1198  if( fSurfaceArea==0. )
     1199  {
     1200    // Define the variables
     1201    //
     1202    G4double area,areas;
     1203    G4ThreeVector point1;
     1204    G4ThreeVector v1,v2,v3,v4;
     1205    G4PolyhedraSideVec *vec = vecs;
     1206    areas=0.;
     1207
     1208    // Do a loop on all SideEdge
     1209    //
     1210    do
     1211    {
     1212      // Define 4points for a Plane or Triangle
     1213      //
     1214      G4ThreeVector v1=vec->edges[0]->corner[0];
     1215      G4ThreeVector v2=vec->edges[0]->corner[1];
     1216      G4ThreeVector v3=vec->edges[1]->corner[1];
     1217      G4ThreeVector v4=vec->edges[1]->corner[0];
     1218      point1=GetPointOnPlane(v1,v2,v3,v4,&area);
     1219      areas+=area;
     1220    } while( ++vec < vecs + numSide);
     1221
     1222    fSurfaceArea=areas;
     1223  }
     1224  return fSurfaceArea;
     1225}
     1226
     1227
     1228//
     1229// GetPointOnFace()
     1230//
     1231G4ThreeVector G4PolyhedraSide::GetPointOnFace()
     1232{
     1233  // Define the variables
     1234  //
     1235  std::vector<G4double>areas;
     1236  std::vector<G4ThreeVector>points;
     1237  G4double area=0;
     1238  G4double result1;
     1239  G4ThreeVector point1;
     1240  G4ThreeVector v1,v2,v3,v4;
     1241  G4PolyhedraSideVec *vec = vecs;
     1242
     1243  // Do a loop on all SideEdge
     1244  //
     1245  do
     1246  {
     1247    // Define 4points for a Plane or Triangle
     1248    //
     1249    G4ThreeVector v1=vec->edges[0]->corner[0];
     1250    G4ThreeVector v2=vec->edges[0]->corner[1];
     1251    G4ThreeVector v3=vec->edges[1]->corner[1];
     1252    G4ThreeVector v4=vec->edges[1]->corner[0];
     1253    point1=GetPointOnPlane(v1,v2,v3,v4,&result1);
     1254    points.push_back(point1);
     1255    areas.push_back(result1);
     1256    area+=result1;
     1257  } while( ++vec < vecs+numSide );
     1258
     1259  // Choose randomly one of the surfaces and point on it
     1260  //
     1261  G4double chose = area*G4UniformRand();
     1262  G4double Achose1,Achose2;
     1263  Achose1=0;Achose2=0.;
     1264  G4int i=0;
     1265  do
     1266  {
     1267    Achose2+=areas[i];
     1268    if(chose>=Achose1 && chose<Achose2)
     1269    {
     1270      point1=points[i] ; break;     
     1271    }
     1272    i++; Achose1=Achose2;
     1273  } while( i<numSide );
     1274 
     1275  return point1;
     1276}
  • trunk/source/geometry/solids/specific/src/G4QuadrangularFacet.cc

    r831 r850  
    2626//
    2727// $Id: G4QuadrangularFacet.cc,v 1.6 2007/08/23 14:49:23 gcosmo Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  • trunk/source/geometry/solids/specific/src/G4ReduciblePolygon.cc

    r831 r850  
    2626//
    2727// $Id: G4ReduciblePolygon.cc,v 1.11 2006/06/29 18:48:53 gunter Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030//
  • trunk/source/geometry/solids/specific/src/G4SolidExtentList.cc

    r831 r850  
    2626//
    2727// $Id: G4SolidExtentList.cc,v 1.5 2007/05/11 13:54:29 gcosmo Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030//
  • trunk/source/geometry/solids/specific/src/G4TessellatedGeometryAlgorithms.cc

    r831 r850  
    2525//
    2626// $Id: G4TessellatedGeometryAlgorithms.cc,v 1.5 2007/12/12 16:51:12 gcosmo Exp $
    27 // GEANT4 tag $Name: $
     27// GEANT4 tag $Name: HEAD $
    2828//
    2929// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  • trunk/source/geometry/solids/specific/src/G4TessellatedSolid.cc

    r831 r850  
    2525// ********************************************************************
    2626//
    27 // $Id: G4TessellatedSolid.cc,v 1.14.2.1 2008/04/23 08:10:24 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-01-patch-02 $
     27// $Id: G4TessellatedSolid.cc,v 1.18 2008/03/13 11:58:28 gcosmo Exp $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  • trunk/source/geometry/solids/specific/src/G4Tet.cc

    r831 r850  
    2929//
    3030// $Id: G4Tet.cc,v 1.11 2006/11/13 08:58:03 gcosmo Exp $
    31 // GEANT4 tag $Name: $
     31// GEANT4 tag $Name: HEAD $
    3232//
    3333// class G4Tet
  • trunk/source/geometry/solids/specific/src/G4TriangularFacet.cc

    r831 r850  
    2626//
    2727// $Id: G4TriangularFacet.cc,v 1.10 2007/12/10 16:30:35 gunter Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  • trunk/source/geometry/solids/specific/src/G4TwistBoxSide.cc

    r831 r850  
    2626//
    2727// $Id: G4TwistBoxSide.cc,v 1.6 2007/05/23 09:31:02 gcosmo Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030//
  • trunk/source/geometry/solids/specific/src/G4TwistTrapAlphaSide.cc

    r831 r850  
    2626//
    2727// $Id: G4TwistTrapAlphaSide.cc,v 1.8 2007/05/23 13:26:06 gcosmo Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030//
  • trunk/source/geometry/solids/specific/src/G4TwistTrapFlatSide.cc

    r831 r850  
    2626//
    2727// $Id: G4TwistTrapFlatSide.cc,v 1.6 2007/05/23 09:31:02 gcosmo Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030//
  • trunk/source/geometry/solids/specific/src/G4TwistTrapParallelSide.cc

    r831 r850  
    2626//
    2727// $Id: G4TwistTrapParallelSide.cc,v
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030//
  • trunk/source/geometry/solids/specific/src/G4TwistTubsFlatSide.cc

    r831 r850  
    2626//
    2727// $Id: G4TwistTubsFlatSide.cc,v 1.7 2007/05/23 09:31:02 gcosmo Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030//
  • trunk/source/geometry/solids/specific/src/G4TwistTubsHypeSide.cc

    r831 r850  
    2626//
    2727// $Id: G4TwistTubsHypeSide.cc,v 1.6 2007/05/18 07:39:56 gcosmo Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030//
  • trunk/source/geometry/solids/specific/src/G4TwistTubsSide.cc

    r831 r850  
    2626//
    2727// $Id: G4TwistTubsSide.cc,v 1.5 2006/06/29 18:49:18 gunter Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030//
  • trunk/source/geometry/solids/specific/src/G4TwistedBox.cc

    r831 r850  
    2626//
    2727// $Id: G4TwistedBox.cc,v 1.12 2006/06/29 18:49:20 gunter Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030//
  • trunk/source/geometry/solids/specific/src/G4TwistedTrap.cc

    r831 r850  
    2626//
    2727// $Id: G4TwistedTrap.cc,v 1.14 2006/06/29 18:49:23 gunter Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030//
  • trunk/source/geometry/solids/specific/src/G4TwistedTrd.cc

    r831 r850  
    2626//
    2727// $Id: G4TwistedTrd.cc,v 1.7 2006/06/29 18:49:25 gunter Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030//
  • trunk/source/geometry/solids/specific/src/G4TwistedTubs.cc

    r831 r850  
    2626//
    2727// $Id: G4TwistedTubs.cc,v 1.24 2007/05/18 07:39:56 gcosmo Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030//
  • trunk/source/geometry/solids/specific/src/G4VCSGfaceted.cc

    r831 r850  
    3030// and all its terms.
    3131//
    32 // $Id: G4VCSGfaceted.cc,v 1.20 2006/10/20 14:21:36 gcosmo Exp $
    33 // GEANT4 tag $Name: $
     32// $Id: G4VCSGfaceted.cc,v 1.25 2008/05/22 10:22:52 gcosmo Exp $
     33// GEANT4 tag $Name: HEAD $
    3434//
    3535//
     
    5151#include "G4VoxelLimits.hh"
    5252#include "G4AffineTransform.hh"
     53
     54#include "Randomize.hh"
    5355
    5456#include "G4Polyhedron.hh"   
     
    105107const G4VCSGfaceted &G4VCSGfaceted::operator=( const G4VCSGfaceted &source )
    106108{
    107   if (&source == this) return *this;
     109  if (&source == this) { return *this; }
    108110 
    109111  DeleteStuff();
     
    122124{
    123125  numFace = source.numFace;
    124   if (numFace == 0) return;    // odd, but permissable?
     126  if (numFace == 0) { return; }    // odd, but permissable?
    125127 
    126128  faces = new G4VCSGface*[numFace];
     
    128130  G4VCSGface **face = faces,
    129131       **sourceFace = source.faces;
    130   do {
     132  do
     133  {
    131134    *face = (*sourceFace)->Clone();
    132135  } while( ++sourceFace, ++face < faces+numFace );
     
    146149  {
    147150    G4VCSGface **face = faces;
    148     do {
     151    do
     152    {
    149153      delete *face;
    150154    } while( ++face < faces + numFace );
     
    170174  //
    171175  G4VCSGface **face = faces;
    172   do {
     176  do
     177  {
    173178    (*face)->CalculateExtent( axis, voxelLimit, transform, extentList );
    174179  } while( ++face < faces + numFace );
     
    194199  G4VCSGface **face = faces;
    195200  G4double best = kInfinity;
    196   do {
     201  do
     202  {
    197203    G4double distance;
    198204    EInside result = (*face)->Inside( p, kCarTolerance/2, &distance );
    199     if (result == kSurface) return kSurface;
     205    if (result == kSurface) { return kSurface; }
    200206    if (distance < best)
    201207    {
     
    217223  G4VCSGface **face = faces;
    218224  G4double best = kInfinity;
    219   do {
     225  do
     226  {
    220227    G4double distance;
    221228    G4ThreeVector normal = (*face)->Normal( p, &distance );
     
    241248  G4VCSGface *bestFace=0;
    242249  G4VCSGface **face = faces;
    243   do {
     250  do
     251  {
    244252    G4double   faceDistance,
    245253               faceDistFromSurface;
     
    258266        distFromSurface = faceDistFromSurface;
    259267        bestFace = *face;
    260         if (distFromSurface <= 0) return 0;
     268        if (distFromSurface <= 0) { return 0; }
    261269      }
    262270    }
     
    265273  if (distance < kInfinity && distFromSurface<kCarTolerance/2)
    266274  {
    267     if (bestFace->Distance(p,false) < kCarTolerance/2) distance = 0;
     275    if (bestFace->Distance(p,false) < kCarTolerance/2)  { distance = 0; }
    268276  }
    269277
     
    297305 
    298306  G4VCSGface **face = faces;
    299   do {
     307  do
     308  {
    300309    G4double  faceDistance,
    301310              faceDistFromSurface;
     
    309318      // Intersecting face
    310319      //
    311       if ( (distance < kInfinity) || (!faceAllBehind) ) allBehind = false;
     320      if ( (distance < kInfinity) || (!faceAllBehind) )  { allBehind = false; }
    312321      if (faceDistance < distance)
    313322      {
     
    316325        normal = faceNormal;
    317326        bestFace = *face;
    318         if (distFromSurface <= 0) break;
     327        if (distFromSurface <= 0)  { break; }
    319328      }
    320329    }
     
    324333  {
    325334    if (distFromSurface <= 0)
     335    {
    326336      distance = 0;
     337    }
    327338    else if (distFromSurface<kCarTolerance/2)
    328339    {
    329       if (bestFace->Distance(p,true) < kCarTolerance/2) distance = 0;
     340      if (bestFace->Distance(p,true) < kCarTolerance/2)  { distance = 0; }
    330341    }
    331342
     
    338349  else
    339350  {
    340     if (Inside(p) == kSurface) distance = 0;
    341     if (calcNorm) *validNorm = false;
     351    if (Inside(p) == kSurface)  { distance = 0; }
     352    if (calcNorm)  { *validNorm = false; }
    342353  }
    343354
     
    365376  G4VCSGface **face = faces;
    366377  G4double best = kInfinity;
    367   do {
     378  do
     379  {
    368380    G4double distance = (*face)->Distance( p, outgoing );
    369     if (distance < best) best = distance;
     381    if (distance < best)  { best = distance; }
    370382  } while( ++face < faces + numFace );
    371383
     
    400412
    401413  G4VCSGface **face = faces;
    402   do {   
     414  do
     415  {   
    403416    const G4ThreeVector **axis = axes+5 ;
    404417    G4double *answer = answers+5;
    405     do {
     418    do
     419    {
    406420      G4double testFace = (*face)->Extent( **axis );
    407       if (testFace > *answer) *answer = testFace;
     421      if (testFace > *answer)  { *answer = testFace; }
    408422    }
    409423    while( --axis, --answer >= answers );
     
    412426 
    413427    return G4VisExtent( -answers[0], answers[1],
    414           -answers[2], answers[3],
    415           -answers[4], answers[5]  );
     428                        -answers[2], answers[3],
     429                        -answers[4], answers[5]  );
    416430}
    417431
     
    524538G4double G4VCSGfaceted::GetCubicVolume()
    525539{
    526   if(fCubicVolume != 0.) ;
    527   else   fCubicVolume = EstimateCubicVolume(fStatistics,fCubVolEpsilon);
     540  if(fCubicVolume != 0.) {;}
     541  else   { fCubicVolume = EstimateCubicVolume(fStatistics,fCubVolEpsilon); }
    528542  return fCubicVolume;
    529543}
     
    535549G4double G4VCSGfaceted::GetSurfaceArea()
    536550{
    537   if(fSurfaceArea != 0.) ;
    538   else   fSurfaceArea = EstimateCubicVolume(fStatistics,fAreaAccuracy);
     551  if(fSurfaceArea != 0.) {;}
     552  else   { fSurfaceArea = EstimateCubicVolume(fStatistics,fAreaAccuracy); }
    539553  return fSurfaceArea;
    540554}
     
    549563      fpPolyhedron->GetNumberOfRotationStepsAtTimeOfCreation() !=
    550564      fpPolyhedron->GetNumberOfRotationSteps())
    551     {
    552       delete fpPolyhedron;
    553       fpPolyhedron = CreatePolyhedron();
    554     }
     565  {
     566    delete fpPolyhedron;
     567    fpPolyhedron = CreatePolyhedron();
     568  }
    555569  return fpPolyhedron;
    556570}
     571
     572
     573//
     574// GetPointOnSurfaceGeneric proportional to Areas of faces
     575// in case of GenericPolycone or GenericPolyhedra
     576//
     577G4ThreeVector G4VCSGfaceted::GetPointOnSurfaceGeneric( ) const
     578{
     579  // Preparing variables
     580  //
     581  G4ThreeVector answer=G4ThreeVector(0.,0.,0.);
     582  G4VCSGface **face = faces;
     583  G4double area = 0;
     584  G4int i;
     585  std::vector<G4double> areas;
     586
     587  // First step: calculate surface areas
     588  //
     589  do
     590  {
     591    G4double result = (*face)->SurfaceArea( );
     592    areas.push_back(result);
     593    area=area+result;
     594  } while( ++face < faces + numFace );
     595
     596  // Second Step: choose randomly one surface
     597  //
     598  G4VCSGface **face1 = faces;
     599  G4double chose = area*G4UniformRand();
     600  G4double Achose1, Achose2;
     601  Achose1=0; Achose2=0.;
     602  i=0;
     603
     604  do
     605  {
     606    Achose2+=areas[i];
     607    if(chose>=Achose1 && chose<Achose2)
     608    {
     609      G4ThreeVector point;
     610      point= (*face1)->GetPointOnFace();
     611      return point;
     612    }
     613    i++;
     614    Achose1=Achose2;
     615  } while( ++face1 < faces + numFace );
     616
     617  return answer;
     618}
  • trunk/source/geometry/solids/specific/src/G4VFacet.cc

    r831 r850  
    2626//
    2727// $Id: G4VFacet.cc,v 1.6 2007/08/23 14:45:03 gcosmo Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  • trunk/source/geometry/solids/specific/src/G4VTwistSurface.cc

    r831 r850  
    2626//
    2727// $Id: G4VTwistSurface.cc,v 1.9 2007/05/31 13:52:48 gcosmo Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: HEAD $
    2929//
    3030//
  • trunk/source/geometry/solids/specific/src/G4VTwistedFaceted.cc

    r831 r850  
    2525//
    2626// $Id: G4VTwistedFaceted.cc,v 1.18 2007/05/25 09:42:34 gcosmo Exp $
    27 // GEANT4 tag $Name: $
     27// GEANT4 tag $Name: HEAD $
    2828//
    2929//
Note: See TracChangeset for help on using the changeset viewer.