65 std::ostringstream message;
66 message <<
"Axis has zero length." <<
G4endl
67 <<
"Default axis ( 1.0, 0.0, 0.0 ) is used.";
68 G4Exception(
"G4CylindricalSurface::G4CylindricalSurface()",
82 std::ostringstream message;
83 message <<
"Negative radius." <<
G4endl
84 <<
"Default radius of 1.0 is used.";
85 G4Exception(
"G4CylindricalSurface::G4CylindricalSurface()",
101 :
G4Surface(), axis(c.axis), radius(c.radius)
109 if (&c ==
this) {
return *
this; }
119 return "G4CylindricalSurface";
124 os <<
"G4CylindricalSurface surface with origin: " <<
origin <<
"\t"
125 <<
"radius: " <<
radius <<
"\tand axis " <<
axis <<
"\n";
154 G4Vector3D lv ( kInfinity, kInfinity, kInfinity );
188 if ( a <= 0.0 ) {
return 0; }
190 G4double b = 2. * ( d * dhat - da * dira );
192 G4double radical = b * b + 4. * a * c;
194 if ( radical < 0.0 ) {
return 0; }
196 G4double root = std::sqrt( radical );
197 sol[0] = ( - b + root ) / ( 2. * a );
198 sol[1] = ( - b - root ) / ( 2. * a );
209 for ( isoln = 0; isoln < maxsoln; isoln++ )
213 if ( sol[isoln] >= kInfinity )
220 if ((tmp * which_way) >= 0.0 )
848 if ( nmag != 0.0 ) { n = n * (1/nmag); }
862 if ( nmag != 0.0 ) { n = n * (1/nmag); }
947 if ( r >= 0.0 ) {
radius = r; }
950 std::ostringstream message;
951 message <<
"Negative radius." <<
G4endl
952 <<
"Default radius of " <<
radius <<
" is used.";
#define SURFACE_PRECISION
void sort_double(G4double[], G4int, G4int)
HepGeom::Vector3D< G4double > G4Vector3D
virtual ~G4CylindricalSurface()
G4Vector3D GetAxis() const
virtual void PrintOn(std::ostream &os=G4cout) const
virtual G4int Inside(const G4Vector3D &x) const
virtual G4double Scale() const
virtual G4Vector3D SurfaceNormal(const G4Point3D &p) const
virtual const char * NameOf() const
G4int Intersect(const G4Ray &ry)
virtual G4Vector3D Normal(const G4Vector3D &p) const
G4double GetRadius() const
virtual G4int WithinBoundary(const G4Vector3D &x) const
void SetRadius(G4double r)
virtual G4double HowNear(const G4Vector3D &x) const
G4Point3D GetPoint(G4double i) const
const G4Vector3D & GetDir() const
const G4Point3D & GetStart() const
G4Vector3D GetOrigin() const
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)