G4ErrorPlaneSurfaceTarget Class Reference

#include <G4ErrorPlaneSurfaceTarget.hh>

Inheritance diagram for G4ErrorPlaneSurfaceTarget:

G4ErrorSurfaceTarget G4ErrorTanPlaneTarget G4ErrorTarget

Public Member Functions

 G4ErrorPlaneSurfaceTarget (G4double a=0, G4double b=0, G4double c=0, G4double d=0)
 G4ErrorPlaneSurfaceTarget (const G4Normal3D &n, const G4Point3D &p)
 G4ErrorPlaneSurfaceTarget (const G4Point3D &p1, const G4Point3D &p2, const G4Point3D &p3)
 ~G4ErrorPlaneSurfaceTarget ()
virtual G4ThreeVector Intersect (const G4ThreeVector &point, const G4ThreeVector &direc) const
virtual G4double GetDistanceFromPoint (const G4ThreeVector &point, const G4ThreeVector &direc) const
virtual G4double GetDistanceFromPoint (const G4ThreeVector &pt) const
virtual G4Plane3D GetTangentPlane (const G4ThreeVector &point) const
virtual void Dump (const G4String &msg) const

Detailed Description

Definition at line 50 of file G4ErrorPlaneSurfaceTarget.hh.


Constructor & Destructor Documentation

G4ErrorPlaneSurfaceTarget::G4ErrorPlaneSurfaceTarget ( G4double  a = 0,
G4double  b = 0,
G4double  c = 0,
G4double  d = 0 
)

Definition at line 46 of file G4ErrorPlaneSurfaceTarget.cc.

References Dump(), G4ErrorTarget_PlaneSurface, G4ErrorTarget::theType, and G4ErrorPropagatorData::verbose().

00047   : G4Plane3D( aa, ab, ac, ad ) 
00048 {
00049   theType = G4ErrorTarget_PlaneSurface;
00050 
00051 #ifdef G4VERBOSE
00052   if(G4ErrorPropagatorData::verbose() >= 2 )
00053   { 
00054     Dump( " $$$ creating G4ErrorPlaneSurfaceTarget from parameters");
00055   }
00056 #endif
00057 }

G4ErrorPlaneSurfaceTarget::G4ErrorPlaneSurfaceTarget ( const G4Normal3D n,
const G4Point3D p 
)

Definition at line 62 of file G4ErrorPlaneSurfaceTarget.cc.

References Dump(), G4ErrorTarget_PlaneSurface, G4ErrorTarget::theType, and G4ErrorPropagatorData::verbose().

00063   : G4Plane3D( norm, pt ) 
00064 {
00065   theType = G4ErrorTarget_PlaneSurface;
00066 
00067 #ifdef G4VERBOSE
00068   if(G4ErrorPropagatorData::verbose() >= 2 )
00069   { 
00070     Dump( " $$$ creating G4ErrorPlaneSurfaceTarget from point and normal");
00071   }
00072 #endif
00073 }

G4ErrorPlaneSurfaceTarget::G4ErrorPlaneSurfaceTarget ( const G4Point3D p1,
const G4Point3D p2,
const G4Point3D p3 
)

Definition at line 78 of file G4ErrorPlaneSurfaceTarget.cc.

References Dump(), G4ErrorTarget_PlaneSurface, G4ErrorTarget::theType, and G4ErrorPropagatorData::verbose().

00081   : G4Plane3D( p1, p2, p3 )
00082 {
00083   theType = G4ErrorTarget_PlaneSurface;
00084 
00085 #ifdef G4VERBOSE
00086   if(G4ErrorPropagatorData::verbose() >= 2 )
00087   { 
00088     Dump( " $$$ creating G4ErrorPlaneSurfaceTarget from three points");
00089   }
00090 #endif
00091 }

G4ErrorPlaneSurfaceTarget::~G4ErrorPlaneSurfaceTarget (  ) 

Definition at line 95 of file G4ErrorPlaneSurfaceTarget.cc.

00096 {
00097 }


Member Function Documentation

void G4ErrorPlaneSurfaceTarget::Dump ( const G4String msg  )  const [virtual]

Implements G4ErrorSurfaceTarget.

Definition at line 175 of file G4ErrorPlaneSurfaceTarget.cc.

References G4cout, and G4endl.

Referenced by G4ErrorPlaneSurfaceTarget().

00176 {
00177   G4cout << msg << " point = " << point()
00178                 << " normal = " << normal() << G4endl;
00179 }

G4double G4ErrorPlaneSurfaceTarget::GetDistanceFromPoint ( const G4ThreeVector pt  )  const [virtual]

Implements G4ErrorSurfaceTarget.

Definition at line 148 of file G4ErrorPlaneSurfaceTarget.cc.

References G4InuclParticleNames::alpha, G4cout, G4endl, and G4ErrorPropagatorData::verbose().

00149 {
00150   G4ThreeVector vec = point() - pt;
00151   G4double alpha = std::acos( vec * normal() / vec.mag() / normal().mag() );
00152   G4double dist = std::fabs(vec.mag() * std::cos( alpha ));
00153   
00154 #ifdef G4VERBOSE
00155   if(G4ErrorPropagatorData::verbose() >= 3 )
00156   {
00157     G4cout << " G4ErrorPlaneSurfaceTarget::GetDistanceFromPoint()" << G4endl
00158            << "   Point: " << pt << G4endl
00159            << "   Distance: " << dist << G4endl;
00160   }
00161 #endif
00162 
00163   return dist;
00164 }

G4double G4ErrorPlaneSurfaceTarget::GetDistanceFromPoint ( const G4ThreeVector point,
const G4ThreeVector direc 
) const [virtual]

Implements G4ErrorSurfaceTarget.

Definition at line 121 of file G4ErrorPlaneSurfaceTarget.cc.

References G4cout, G4endl, G4Exception(), JustWarning, and G4ErrorPropagatorData::verbose().

Referenced by Intersect().

00122 {
00123   if( std::fabs( dir.mag() -1. ) > 1.E-6 )
00124   {
00125     std::ostringstream message;
00126     message << "Direction is not a unit vector: " << dir << " !";
00127     G4Exception("G4ErrorPlaneSurfaceTarget::GetDistanceFromPoint()",
00128                 "GeomMgt1002", JustWarning, message);
00129   }
00130   G4double dist = -(a_ * pt.x() + b_ * pt.y() + c_ * pt.z() + d_)
00131                  / (a_ * dir.x() + b_ * dir.y() + c_ * dir.z() );
00132 
00133 #ifdef G4VERBOSE
00134   if(G4ErrorPropagatorData::verbose() >= 3 )
00135   {
00136     G4cout << " G4ErrorPlaneSurfaceTarget::GetDistanceFromPoint()" << G4endl
00137            << "   Point: " << pt << ", Direction: " << dir << G4endl
00138            << "   Distance: " << dist << G4endl;
00139   }
00140 #endif
00141   
00142   return dist;
00143 }

G4Plane3D G4ErrorPlaneSurfaceTarget::GetTangentPlane ( const G4ThreeVector point  )  const [virtual]

Implements G4ErrorSurfaceTarget.

Definition at line 169 of file G4ErrorPlaneSurfaceTarget.cc.

00170 {
00171   return *this;
00172 }

G4ThreeVector G4ErrorPlaneSurfaceTarget::Intersect ( const G4ThreeVector point,
const G4ThreeVector direc 
) const [virtual]

Definition at line 102 of file G4ErrorPlaneSurfaceTarget.cc.

References G4cout, G4endl, GetDistanceFromPoint(), G4InuclParticleNames::lam, and G4ErrorPropagatorData::verbose().

00103 {
00104   G4double lam = GetDistanceFromPoint( pt, dir );
00105   G4Point3D inters = pt + lam * dir;
00106 
00107 #ifdef G4VERBOSE
00108   if(G4ErrorPropagatorData::verbose() >= 4 )
00109   { 
00110     G4cout << " $$$ creating G4ErrorPlaneSurfaceTarget::Intersect "
00111            << inters << G4endl;
00112   }
00113 #endif
00114 
00115   return inters;
00116 }


The documentation for this class was generated from the following files:
Generated on Mon May 27 17:51:55 2013 for Geant4 by  doxygen 1.4.7