55 type1 = (std::fabs(z[1]-z[0]) > std::fabs(r[1]-r[0]));
59 B = (r[1]-r[0])/(z[1]-z[0]);
60 A = 0.5*( r[1]+r[0] -
B*(z[1]+z[0]) );
64 B = (z[1]-z[0])/(r[1]-r[0]);
65 A = 0.5*( z[1]+z[0] -
B*(r[1]+r[0]) );
72 rLo = r[0]-halfCarTolerance;
rHi = r[1]+halfCarTolerance;
76 rLo = r[1]-halfCarTolerance;
rHi = r[0]+halfCarTolerance;
81 zLo = z[0]-halfCarTolerance;
zHi = z[1]+halfCarTolerance;
85 zLo = z[1]-halfCarTolerance;
zHi = z[0]+halfCarTolerance;
95 : zLo(0.), zHi(0.), rLo(0.), rHi(0.), type1(false),
A(0.),
B(0.)
123 if (z < zLo || z >
zHi)
return false;
127 if (r < rLo || r >
rHi)
return false;
219 G4double tx = v.x(), ty = v.y(), tz = v.z();
227 if (radical < -1E-6*std::fabs(b)) {
return 0; }
229 if (radical < 1E-6*std::fabs(b))
236 if(
B==0.) {
return 0; }
237 if ( std::fabs(x0*ty - y0*tx) < std::fabs(1E-6/
B) )
247 radical = std::sqrt(radical);
252 G4double sa, sb, q = -0.5*( b + (b < 0 ? -radical : +radical) );
255 if (sa < sb) { *s1 = sa; *s2 = sb; }
else { *s1 = sb; *s2 = sa; }
256 if (
A +
B*(z0+(*s1)*tz) < 0) {
return 0; }
261 G4double sa, sb, q = -0.5*( b + (b < 0 ? -radical : +radical) );
264 *s1 = (
B*tz > 0)^(sa > sb) ? sb : sa;
274 if (
A +
B*(z0+(*s1)*tz) < 0) {
return 0; }
309 G4double tx = v.x(), ty = v.y(), tz = v.z();
316 if (std::fabs(tz) < 1/
kInfinity) {
return 0; }
330 if (radical < -1E-6*std::fabs(b)) {
return 0; }
332 if (radical < 1E-6*std::fabs(b))
339 if ( std::fabs(x0*ty - y0*tx) < std::fabs(1E-6/B) )
349 radical = std::sqrt(radical);
354 G4double sa, sb, q = -0.5*( b + (b < 0 ? -radical : +radical) );
357 if (sa < sb) { *s1 = sa; *s2 = sb; }
else { *s1 = sb; *s2 = sa; }
358 if ((
z0 + (*s1)*tz -
A)/B < 0) {
return 0; }
363 G4double sa, sb, q = -0.5*( b + (b < 0 ? -radical : +radical) );
366 *s1 = (tz*B > 0)^(sa > sb) ? sb : sa;
376 if ((
z0 + (*s1)*tz -
A)/B < 0) {
return 0; }
static const G4double kInfinity
CLHEP::Hep3Vector G4ThreeVector
G4double GetSurfaceTolerance() const
G4int LineHitsCone1(const G4ThreeVector &p, const G4ThreeVector &v, G4double *s1, G4double *s2)
G4bool HitOn(const G4double r, const G4double z)
double B(double temperature)
G4int LineHitsCone(const G4ThreeVector &p, const G4ThreeVector &v, G4double *s1, G4double *s2)
double A(double temperature)
G4int LineHitsCone2(const G4ThreeVector &p, const G4ThreeVector &v, G4double *s1, G4double *s2)
virtual ~G4IntersectingCone()
G4IntersectingCone(const G4double r[2], const G4double z[2])
static G4GeometryTolerance * GetInstance()