62{
63
64
66 if ( xhatmag != 0.0 )
67 {
68 x_axis = xhat * (1/ xhatmag);
69 }
70 else
71 {
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()",
77
79 }
80
82
83 if (zhatmag != 0.0)
84 {
85 z_axis = zhat *(1/ zhatmag);
86 }
87 else
88 {
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()",
94
96 }
97
98
99
100 if ( r >= 0.0 )
101 {
103 }
104 else
105 {
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()",
111
113 }
114
115
116
117
118 if ( ( ph1 >= 0.0 ) && ( ph1 < 2*pi ) )
119 {
121 }
122 else
123 {
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()",
129
131 }
132
133 if ( ( ph2 >
phi_1 ) && ( ph2 <= (
phi_1 + twopi ) ) )
134 {
136 }
137 else
138 {
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()",
144
146 }
147
148
149
150
151 if ( ( th1 >= 0.0 ) && ( th1 < pi ) )
152 {
154 }
155 else
156 {
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()",
162
164 }
165
167 {
169 }
170 else
171 {
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()",
177
179 }
180}
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)