55 Dump(
" $$$ creating G4ErrorCylSurfaceTarget ");
65 : fradius(radius), ftransform(trans.Inverse())
72 Dump(
" $$$ creating G4ErrorCylSurfaceTarget ");
85 G4Exception(
"G4ErrorCylSurfaceTarget::GetDistanceFromPoint()",
94 G4double dist = (localPoint-inters).mag();
99 G4cout <<
" G4ErrorCylSurfaceTarget::GetDistanceFromPoint():" <<
G4endl
100 <<
" Global point " << point <<
" dir " << dir <<
G4endl
101 <<
" Intersection " << inters <<
G4endl
102 <<
" Distance " << dist <<
G4endl;
103 Dump(
" CylSurface: " );
121 G4cout <<
" G4ErrorCylSurfaceTarget::GetDistanceFromPoint:" <<
G4endl
122 <<
" Global point " << point <<
G4endl
124 Dump(
" CylSurface: " );
137 G4double eqa = localDir.
x()*localDir.
x()+localDir.
y()*localDir.
y();
138 G4double eqb = 2*(localPoint.
x()*localDir.
x()+localPoint.
y()*localDir.
y());
140 +localPoint.
y()*localPoint.
y();
144 if( eqa*inside > 0. )
146 lambda = (-eqb + std::sqrt(eqb*eqb-4*eqa*eqc) ) / (2.*eqa);
148 else if( eqa*inside < 0. )
150 lambda = (-eqb - std::sqrt(eqb*eqb-4*eqa*eqc) ) / (2.*eqa);
160 std::ostringstream message;
161 message <<
"Intersection not possible !" <<
G4endl
162 <<
" Point: " << localPoint <<
", direction: "
164 Dump(
" CylSurface: " );
165 G4Exception(
"G4ErrorCylSurfaceTarget::IntersectLocal()",
175 G4cout <<
" G4ErrorCylSurfaceTarget::IntersectLocal " << inters <<
" "
176 << inters.
perp() <<
" localPoint " << localPoint <<
" localDir "
196 std::ostringstream message;
197 message <<
"Local point not at surface !" <<
G4endl
198 <<
" Point: " << point <<
", local: " << localPoint
200 <<
" is not at surface, but far away by: "
202 G4Exception(
"G4ErrorCylSurfaceTarget::GetTangentPlane()",
@ G4ErrorTarget_CylindricalSurface
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
HepGeom::Plane3D< G4double > G4Plane3D
G4GLOB_DLL std::ostream G4cout
HepRotation inverse() const
virtual G4Plane3D GetTangentPlane(const G4ThreeVector &point) const
G4ErrorCylSurfaceTarget(const G4double &radius, const G4ThreeVector &trans=G4ThreeVector(), const G4RotationMatrix &rotm=G4RotationMatrix())
virtual G4ThreeVector IntersectLocal(const G4ThreeVector &point, const G4ThreeVector &direc) const
virtual void Dump(const G4String &msg) const
G4AffineTransform ftransform
virtual G4double GetDistanceFromPoint(const G4ThreeVector &point, const G4ThreeVector &direc) const
G4ErrorTargetType theType
G4double GetSurfaceTolerance() const
static G4GeometryTolerance * GetInstance()
static const G4double kInfinity
static double normal(HepRandomEngine *eptr)