77 std::ostringstream message;
78 message <<
"Negative length." <<
G4endl
79 <<
"Default length of 0.0 is used.";
80 G4Exception(
"G4FConicalSurface::G4FConicalSurface()",
91 std::ostringstream message;
92 message <<
"Negative small radius." <<
G4endl
93 <<
"Default value of 0.0 is used.";
94 G4Exception(
"G4FConicalSurface::G4FConicalSurface()",
105 std::ostringstream message;
106 message <<
"Large radius must exceed small radius" <<
G4endl
107 <<
"Default value of small radius +1 is used.";
108 G4Exception(
"G4FConicalSurface::G4FConicalSurface()",
121 return "G4FConicalSurface";
145 Tmp = (Origin - Radius);
148 Tmp = Origin + Radius;
151 Tmp = EndOrigin - Radius;
154 Tmp = EndOrigin + Radius;
162 os <<
"G4FConicalSurface with origin: " <<
origin <<
"\t"
166 <<
"\t and length: " <<
length <<
"\n";
192 if ( ( qmag >= ls ) && ( qmag <= ll ) )
233 std::ostringstream message;
234 message <<
"Negative length." <<
G4endl
235 <<
"Original value of " <<
length <<
" is retained.";
245 std::ostringstream message;
246 message <<
"Negative small radius." <<
G4endl
247 <<
"Original value of " <<
small_radius <<
" is retained.";
261 std::ostringstream message;
262 message <<
"Large radius must exceed small radius." <<
G4endl
310 G4double A = t * da * da - dhat * dhat;
312 G4double C = ( -gamma * gamma + t * ga * ga
316 G4double radical = B * B - 4.0 * A * C;
323 G4double root = std::sqrt( radical );
324 sol[0] = ( - B + root ) / ( 2. * A );
325 sol[1] = ( - B - root ) / ( 2. * A );
344 for (
G4int i = 0; i < 2; i++ )
346 if(sol[i] < kInfinity) {
374 xd =
G4Vector3D ( std::sqrt ( x.
x()*x.
x() + x.
y()*x.
y() ) , 0 , x.
z() );
376 G4double r = (upcorner.
z() - downcorner.
z()) / (upcorner.
x() - downcorner.
x());
377 G4double q = (downcorner.
z()*upcorner.
x() - upcorner.
z()*downcorner.
x()) /
378 (upcorner.
x() - downcorner.
x());
380 G4double Zinter = (xd.
z()*r*r + xd.
x()*r +q)/(1+r*r) ;
382 if ( ((Zinter >= downcorner.
z()) && (Zinter <=upcorner.
z())) ||
383 ((Zinter >= upcorner.
z()) && (Zinter <=downcorner.
z())) ) {
384 hownear = std::fabs(r*xd.
x()-xd.
z()+q)/std::sqrt(1+r*r);
387 hownear = std::min ( (xd-upcorner).mag() , (xd-downcorner).mag() );
399 G4double r = std::sqrt( ss*ss - da*da);
HepGeom::Point3D< G4double > G4Point3D
const G4Point3D PINFINITY(kInfinity, kInfinity, kInfinity)
HepGeom::Vector3D< G4double > G4Vector3D
void Init(const G4Vector3D &refDirection0, const G4Vector3D &axis0, const G4Point3D &location0)
G4Point3D GetLocation() const
G4Vector3D GetAxis() const
void Init(const G4Point3D &)
void Extend(const G4Point3D &)
virtual const char * Name() const
virtual G4Vector3D SurfaceNormal(const G4Point3D &p) const
virtual G4double HowNear(const G4Vector3D &x) const
virtual G4double Area() const
virtual void resize(G4double l, G4double sr, G4double lr)
G4int Inside(const G4Vector3D &x) const
virtual void PrintOn(std::ostream &os=G4cout) const
G4int Intersect(const G4Ray &ry)
virtual G4double Scale() const
virtual G4int WithinBoundary(const G4Vector3D &x) const
virtual ~G4FConicalSurface()
G4Axis2Placement3D Position
G4int operator==(const G4FConicalSurface &c) const
const G4Vector3D & GetDir() const
const G4Point3D & GetStart() const
G4BoundingBox3D * GetBBox()
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)