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;
229 if (radical < -EPS*std::fabs(b)) {
return 0; }
231 if (radical < EPS*std::fabs(b))
238 if(
B==0.) {
return 0; }
239 if ( std::fabs(x0*ty - y0*tx) < std::fabs(EPS/
B) )
249 radical = std::sqrt(radical);
254 G4double sa, sb, q = -0.5*( b + (b < 0 ? -radical : +radical) );
257 if (sa < sb) { *s1 = sa; *s2 = sb; }
else { *s1 = sb; *s2 = sa; }
258 if (
A +
B*(z0+(*s1)*tz) < 0) {
return 0; }
263 G4double sa, sb, q = -0.5*( b + (b < 0 ? -radical : +radical) );
266 *s1 = (
B*tz > 0)^(sa > sb) ? sb : sa;
276 if (
A +
B*(z0+(*s1)*tz) < 0) {
return 0; }
319 if (std::fabs(tz) < 1/
kInfinity) {
return 0; }
327 G4double a = tz*tz - B2*(tx*tx + ty*ty);
333 if (radical < -EPS*std::fabs(b)) {
return 0; }
335 if (radical < EPS*std::fabs(b))
342 if ( std::fabs(x0*ty - y0*tx) < std::fabs(EPS/B) )
352 radical = std::sqrt(radical);
357 G4double sa, sb, q = -0.5*( b + (b < 0 ? -radical : +radical) );
360 if (sa < sb) { *s1 = sa; *s2 = sb; }
else { *s1 = sb; *s2 = sa; }
361 if ((
z0 + (*s1)*tz -
A)/B < 0) {
return 0; }
366 G4double sa, sb, q = -0.5*( b + (b < 0 ? -radical : +radical) );
369 *s1 = (tz*B > 0)^(sa > sb) ? sb : sa;
379 if ((
z0 + (*s1)*tz -
A)/B < 0) {
return 0; }
static const G4double kInfinity
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()