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
131 <<
" Distance " << fradius - localPoint.
perp() <<
G4endl;
132 Dump(
" CylSurface: " );
136 return fradius - localPoint.
perp();
145 G4double eqa = localDir.
x()*localDir.
x()+localDir.
y()*localDir.
y();
146 G4double eqb = 2*(localPoint.
x()*localDir.
x()+localPoint.
y()*localDir.
y());
147 G4double eqc = -fradius*fradius+localPoint.
x()*localPoint.
x()
148 +localPoint.
y()*localPoint.
y();
149 G4int inside = (localPoint.
perp() > fradius) ? -1 : 1;
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);
168 std::ostringstream message;
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 "
201 if( std::fabs( localPoint.
perp() - fradius )
204 std::ostringstream message;
205 message <<
"Local point not at surface !" <<
G4endl
206 <<
" Point: " << point <<
", local: " << localPoint
208 <<
" is not at surface, but far away by: "
209 << localPoint.
perp() - fradius <<
" !";
210 G4Exception(
"G4ErrorCylSurfaceTarget::GetTangentPlane()",
224 G4cout << msg <<
" radius " << fradius