57 Dump(
" $$$ creating G4ErrorCylSurfaceTarget ");
67 : fradius(radius), ftransform(trans.Inverse())
74 Dump(
" $$$ creating G4ErrorCylSurfaceTarget ");
93 G4Exception(
"G4ErrorCylSurfaceTarget::GetDistanceFromPoint()",
102 G4double dist = (localPoint-inters).mag();
107 G4cout <<
" G4ErrorCylSurfaceTarget::GetDistanceFromPoint():" <<
G4endl
108 <<
" Global point " << point <<
" dir " << dir <<
G4endl
109 <<
" Intersection " << inters <<
G4endl
110 <<
" Distance " << dist <<
G4endl;
111 Dump(
" CylSurface: " );
129 G4cout <<
" G4ErrorCylSurfaceTarget::GetDistanceFromPoint:" <<
G4endl
130 <<
" Global point " << point <<
G4endl
132 Dump(
" CylSurface: " );
145 G4double eqa = localDir.
x()*localDir.
x()+localDir.
y()*localDir.
y();
146 G4double eqb = 2*(localPoint.
x()*localDir.
x()+localPoint.
y()*localDir.
y());
148 +localPoint.
y()*localPoint.
y();
152 if( eqa*inside > 0. )
154 lambda = (-eqb + std::sqrt(eqb*eqb-4*eqa*eqc) ) / (2.*eqa);
156 else if( eqa*inside < 0. )
158 lambda = (-eqb - std::sqrt(eqb*eqb-4*eqa*eqc) ) / (2.*eqa);
169 message <<
"Intersection not possible !" <<
G4endl
170 <<
" Point: " << localPoint <<
", direction: "
172 Dump(
" CylSurface: " );
173 G4Exception(
"G4ErrorCylSurfaceTarget::IntersectLocal()",
183 G4cout <<
" G4ErrorCylSurfaceTarget::IntersectLocal " << inters <<
" "
184 << inters.
perp() <<
" localPoint " << localPoint <<
" localDir "
205 message <<
"Local point not at surface !" <<
G4endl
206 <<
" Point: " << point <<
", local: " << localPoint
208 <<
" is not at surface, but far away by: "
210 G4Exception(
"G4ErrorCylSurfaceTarget::GetTangentPlane()",
G4AffineTransform ftransform
static const G4double kInfinity
void message(RunManager *runmanager)
static double normal(HepRandomEngine *eptr)
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
G4ErrorTargetType theType
HepGeom::Plane3D< G4double > G4Plane3D
virtual G4double GetDistanceFromPoint(const G4ThreeVector &point, const G4ThreeVector &direc) const
virtual void Dump(const G4String &msg) const
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
G4GLOB_DLL std::ostream G4cout
static G4GeometryTolerance * GetInstance()
~G4ErrorCylSurfaceTarget()
HepRotation inverse() const
G4double GetSurfaceTolerance() const