40 :
G4Surface(), radius(1.0), phi_1(0.0), phi_2(2*pi),
41 theta_1(0.0), theta_2(pi)
68 x_axis = xhat * (1/ xhatmag);
72 std::ostringstream message;
73 message <<
"x_axis has zero length." <<
G4endl
74 <<
"Default x_axis of (1, 0, 0) is used.";
75 G4Exception(
"G4SphericalSurface::G4SphericalSurface()",
85 z_axis = zhat *(1/ zhatmag);
89 std::ostringstream message;
90 message <<
"z_axis has zero length." <<
G4endl
91 <<
"Default z_axis of (0, 0, 1) is used.";
92 G4Exception(
"G4SphericalSurface::G4SphericalSurface()",
106 std::ostringstream message;
107 message <<
"Radius cannot be less than zero." <<
G4endl
108 <<
"Default radius of 1.0 is used.";
109 G4Exception(
"G4SphericalSurface::G4SphericalSurface()",
118 if ( ( ph1 >= 0.0 ) && ( ph1 < 2*pi ) )
124 std::ostringstream message;
125 message <<
"Lower azimuthal limit is out of range." <<
G4endl
126 <<
"Default angle of 0 is used.";
127 G4Exception(
"G4SphericalSurface::G4SphericalSurface()",
133 if ( ( ph2 >
phi_1 ) && ( ph2 <= (
phi_1 + twopi ) ) )
139 std::ostringstream message;
140 message <<
"Upper azimuthal limit is out of range." <<
G4endl
141 <<
"Default angle of 2*PI is used.";
142 G4Exception(
"G4SphericalSurface::G4SphericalSurface()",
151 if ( ( th1 >= 0.0 ) && ( th1 < pi ) )
157 std::ostringstream message;
158 message <<
"Lower polar limit is out of range." <<
G4endl
159 <<
"Default angle of 0 is used.";
160 G4Exception(
"G4SphericalSurface::G4SphericalSurface()",
172 std::ostringstream message;
173 message <<
"Upper polar limit is out of range." <<
G4endl
174 <<
"Default angle of PI is used.";
175 G4Exception(
"G4SphericalSurface::G4SphericalSurface()",
203 if (&surf ==
this) {
return *
this; }
217 return "G4SphericalSurface";
222 os <<
"G4SphericalSurface surface with origin: " <<
origin <<
"\t"
223 <<
"radius: " <<
radius <<
"\n"
224 <<
"\t local x_axis: " <<
x_axis
225 <<
"\t local z_axis: " <<
z_axis <<
"\n"
226 <<
"\t lower azimuthal limit: " <<
phi_1 <<
" radians\n"
227 <<
"\t upper azimuthal limit: " <<
phi_2 <<
" radians\n"
228 <<
"\t lower polar limit : " <<
theta_1 <<
" radians\n"
229 <<
"\t upper polar limit : " <<
theta_2 <<
" radians\n";
375 if(!which_way) { which_way =-1; }
378 G4Vector3D lv ( kInfinity, kInfinity, kInfinity );
388 G4int isoln = 0, maxsoln = 2;
403 if ( r <= 0.0 ) {
return 0; }
413 if ( radical < 0.0 ) {
return 0; }
415 G4double root = std::sqrt( radical );
434 for ( isoln = 0; isoln < maxsoln; isoln++ )
438 if ( ss[isoln] >= kInfinity ) {
return 0; }
731 if ( nmag != 0.0 ) { n = n * (1/ nmag); }
749 if ( nmag != 0.0 ) { n = n * (1/ nmag); }
763 if (
HowNear( x ) >= 0.0 ) {
return 1; }
800 G4double phi = std::atan2( py, px );
802 if ( phi < 0.0 ) { phi += twopi; }
806 if ( ( phi >=
phi_1 ) && ( phi <=
phi_2 ) ) {
return 1; }
812 if ( ( phi >=
phi_1 ) && ( phi <=
phi_2 ) ) {
return 1; }
826 if (
radius == 0.0 ) {
return 1.0; }
849 if ( r >= 0.0 ) {
radius = r; }
852 std::ostringstream message;
853 message <<
"Radius cannot be less than zero." <<
G4endl
854 <<
"Original value of " <<
radius <<
" is retained.";
861 if ( ( ph1 >= 0.0 ) && ( ph1 < twopi ) ) {
phi_1 = ph1; }
864 std::ostringstream message;
865 message <<
"Lower azimuthal limit out of range." <<
G4endl
866 <<
"Original value of " <<
phi_1 <<
" is retained.";
871 if ( ( ph2 >
phi_1 ) && ( ph2 <= (
phi_1 + twopi ) ) ) {
phi_2 = ph2; }
876 std::ostringstream message;
877 message <<
"Upper azimuthal limit out of range." <<
G4endl
878 <<
"Value of " <<
phi_2 <<
" is used.";
885 if ( ( th1 >= 0.0 ) && ( th1 < pi ) ) {
theta_1 = th1; }
888 std::ostringstream message;
889 message <<
"Lower polar limit out of range." <<
G4endl
890 <<
"Original value of " <<
theta_1 <<
" is retained.";
900 std::ostringstream message;
901 message <<
"Upper polar limit out of range." <<
G4endl
902 <<
"Value of " <<
theta_2 <<
" is used.";
HepGeom::Vector3D< G4double > G4Vector3D
G4Point3D GetPoint(G4double i) const
const G4Vector3D & GetDir() const
const G4Point3D & GetStart() const
virtual G4int Inside(const G4Vector3D &x) const
virtual G4double Scale() const
G4double GetRadius() const
virtual G4Vector3D Normal(const G4Vector3D &p) const
virtual void PrintOn(std::ostream &os=G4cout) const
virtual G4int WithinBoundary(const G4Vector3D &x) const
virtual const char * NameOf() const
virtual ~G4SphericalSurface()
virtual void resize(G4double r, G4double ph1, G4double ph2, G4double th1, G4double th2)
G4int Intersect(const G4Ray &)
virtual G4double HowNear(const G4Vector3D &x) const
virtual G4double Area() const
virtual G4Vector3D SurfaceNormal(const G4Point3D &p) const
G4Vector3D GetOrigin() const
BasicVector3D< T > cross(const BasicVector3D< T > &v) const
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)