Geant4-11
Public Member Functions | Protected Attributes | Private Member Functions | Private Attributes | Related Functions
G4ErrorPlaneSurfaceTarget Class Reference

#include <G4ErrorPlaneSurfaceTarget.hh>

Inheritance diagram for G4ErrorPlaneSurfaceTarget:
G4ErrorSurfaceTarget HepGeom::Plane3D< G4double > G4ErrorTanPlaneTarget G4ErrorTarget

Public Member Functions

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

Protected Attributes

G4ErrorTargetType theType
 

Private Member Functions

G4double a () const
 
G4double b () const
 
G4double c () const
 
G4double d () const
 
G4double distance (const Point3D< G4double > &p) const
 
Normal3D< G4doublenormal () const
 
Plane3D< G4double > & normalize ()
 
bool operator!= (const Plane3D< G4double > &p) const
 
bool operator== (const Plane3D< G4double > &p) const
 
Point3D< G4doublepoint () const
 
Point3D< G4doublepoint (const Point3D< G4double > &p) const
 
Plane3D< G4double > & transform (const Transform3D &m)
 

Private Attributes

G4double a_
 
G4double b_
 
G4double c_
 
G4double d_
 

Related Functions

(Note that these are not member functions.)

std::ostream & operator<< (std::ostream &os, const Plane3D< double > &p)
 
std::ostream & operator<< (std::ostream &os, const Plane3D< float > &p)
 

Detailed Description

Definition at line 42 of file G4ErrorPlaneSurfaceTarget.hh.

Constructor & Destructor Documentation

◆ G4ErrorPlaneSurfaceTarget() [1/3]

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

Definition at line 42 of file G4ErrorPlaneSurfaceTarget.cc.

44 : G4Plane3D( aa, ab, ac, ad )
45{
47
48#ifdef G4VERBOSE
50 {
51 Dump( " $$$ creating G4ErrorPlaneSurfaceTarget from parameters");
52 }
53#endif
54}
static const G4double ab
@ G4ErrorTarget_PlaneSurface
HepGeom::Plane3D< G4double > G4Plane3D
Definition: G4Plane3D.hh:36
virtual void Dump(const G4String &msg) const
G4ErrorTargetType theType

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

◆ G4ErrorPlaneSurfaceTarget() [2/3]

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

Definition at line 58 of file G4ErrorPlaneSurfaceTarget.cc.

60 : G4Plane3D( norm, pt )
61{
63
64#ifdef G4VERBOSE
66 {
67 Dump( " $$$ creating G4ErrorPlaneSurfaceTarget from point and normal");
68 }
69#endif
70}

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

◆ G4ErrorPlaneSurfaceTarget() [3/3]

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

Definition at line 74 of file G4ErrorPlaneSurfaceTarget.cc.

78 : G4Plane3D( p1, p2, p3 )
79{
81
82#ifdef G4VERBOSE
84 {
85 Dump( " $$$ creating G4ErrorPlaneSurfaceTarget from three points");
86 }
87#endif
88}

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

◆ ~G4ErrorPlaneSurfaceTarget()

G4ErrorPlaneSurfaceTarget::~G4ErrorPlaneSurfaceTarget ( )
default

Member Function Documentation

◆ a()

G4double HepGeom::Plane3D< G4double >::a ( ) const
inlineinherited

Returns the a-coefficient in the plane equation: a*x+b*y+c*z+d=0.

Definition at line 84 of file Plane3D.h.

84{ return a_; }

◆ b()

G4double HepGeom::Plane3D< G4double >::b ( ) const
inlineinherited

Returns the b-coefficient in the plane equation: a*x+b*y+c*z+d=0.

Definition at line 87 of file Plane3D.h.

87{ return b_; }

◆ c()

G4double HepGeom::Plane3D< G4double >::c ( ) const
inlineinherited

Returns the c-coefficient in the plane equation: a*x+b*y+c*z+d=0.

Definition at line 90 of file Plane3D.h.

90{ return c_; }

◆ d()

G4double HepGeom::Plane3D< G4double >::d ( ) const
inlineinherited

Returns the free member of the plane equation: a*x+b*y+c*z+d=0.

Definition at line 93 of file Plane3D.h.

93{ return d_; }

◆ distance()

G4double HepGeom::Plane3D< G4double >::distance ( const Point3D< G4double > &  p) const
inlineinherited

Returns distance to the point.

Definition at line 109 of file Plane3D.h.

109 {
110 return a()*p.x() + b()*p.y() + c()*p.z() + d();
111 }
G4double d() const
Definition: Plane3D.h:93
G4double b() const
Definition: Plane3D.h:87
G4double c() const
Definition: Plane3D.h:90
G4double a() const
Definition: Plane3D.h:84

◆ Dump()

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

Implements G4ErrorSurfaceTarget.

Definition at line 166 of file G4ErrorPlaneSurfaceTarget.cc.

167{
168 G4cout << msg << " point = " << point()
169 << " normal = " << normal() << G4endl;
170}
#define G4endl
Definition: G4ios.hh:57
G4GLOB_DLL std::ostream G4cout
Normal3D< G4double > normal() const
Definition: Plane3D.h:97
Point3D< G4double > point() const
Definition: Plane3D.h:122

References G4cout, G4endl, HepGeom::Plane3D< G4double >::normal(), and HepGeom::Plane3D< G4double >::point().

Referenced by G4ErrorPlaneSurfaceTarget().

◆ GetDistanceFromPoint() [1/2]

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

Implements G4ErrorSurfaceTarget.

Definition at line 111 of file G4ErrorPlaneSurfaceTarget.cc.

113{
114 if( std::fabs( dir.mag() -1. ) > 1.E-6 )
115 {
116 std::ostringstream message;
117 message << "Direction is not a unit vector: " << dir << " !";
118 G4Exception("G4ErrorPlaneSurfaceTarget::GetDistanceFromPoint()",
119 "GeomMgt1002", JustWarning, message);
120 }
121 G4double dist = -(a_ * pt.x() + b_ * pt.y() + c_ * pt.z() + d_)
122 / (a_ * dir.x() + b_ * dir.y() + c_ * dir.z() );
123
124#ifdef G4VERBOSE
126 {
127 G4cout << " G4ErrorPlaneSurfaceTarget::GetDistanceFromPoint()" << G4endl
128 << " Point: " << pt << ", Direction: " << dir << G4endl
129 << " Distance: " << dist << G4endl;
130 }
131#endif
132
133 return dist;
134}
@ JustWarning
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
Definition: G4Exception.cc:35
double G4double
Definition: G4Types.hh:83

References HepGeom::Plane3D< G4double >::a_, HepGeom::Plane3D< G4double >::b_, HepGeom::Plane3D< G4double >::c_, HepGeom::Plane3D< G4double >::d_, G4cout, G4endl, G4Exception(), JustWarning, CLHEP::Hep3Vector::mag(), G4ErrorPropagatorData::verbose(), CLHEP::Hep3Vector::x(), CLHEP::Hep3Vector::y(), and CLHEP::Hep3Vector::z().

Referenced by Intersect().

◆ GetDistanceFromPoint() [2/2]

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

Implements G4ErrorSurfaceTarget.

Definition at line 138 of file G4ErrorPlaneSurfaceTarget.cc.

140{
141 G4ThreeVector vec = point() - pt;
142 G4double dist = std::fabs(vec * normal() / normal().mag());
143
144#ifdef G4VERBOSE
146 {
147 G4cout << " G4ErrorPlaneSurfaceTarget::GetDistanceFromPoint()" << G4endl
148 << " Point: " << pt << G4endl
149 << " Distance: " << dist << G4endl;
150 }
151#endif
152
153 return dist;
154}

References G4cout, G4endl, HepGeom::Plane3D< G4double >::normal(), HepGeom::Plane3D< G4double >::point(), and G4ErrorPropagatorData::verbose().

◆ GetTangentPlane()

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

Implements G4ErrorSurfaceTarget.

Definition at line 158 of file G4ErrorPlaneSurfaceTarget.cc.

160{
161 return *this;
162}

◆ GetType()

G4ErrorTargetType G4ErrorTarget::GetType ( ) const
inlineinherited

◆ Intersect()

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

Definition at line 92 of file G4ErrorPlaneSurfaceTarget.cc.

94{
96 G4Point3D inters = pt + lam * dir;
97
98#ifdef G4VERBOSE
100 {
101 G4cout << " $$$ creating G4ErrorPlaneSurfaceTarget::Intersect "
102 << inters << G4endl;
103 }
104#endif
105
106 return inters;
107}
virtual G4double GetDistanceFromPoint(const G4ThreeVector &point, const G4ThreeVector &direc) const

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

◆ normal()

Normal3D< G4double > HepGeom::Plane3D< G4double >::normal ( ) const
inlineinherited

Returns normal.

Definition at line 97 of file Plane3D.h.

97{ return Normal3D<T>(a_,b_,c_); }

◆ normalize()

Plane3D< G4double > & HepGeom::Plane3D< G4double >::normalize ( )
inlineinherited

Normalization.

Definition at line 101 of file Plane3D.h.

101 {
102 double ll = std::sqrt(a_*a_ + b_*b_ + c_*c_);
103 if (ll > 0.) { a_ /= ll; b_ /= ll; c_ /= ll, d_ /= ll; }
104 return *this;
105 }

◆ operator!=()

bool HepGeom::Plane3D< G4double >::operator!= ( const Plane3D< G4double > &  p) const
inlineinherited

Test for inequality.

Definition at line 135 of file Plane3D.h.

135 {
136 return a() != p.a() || b() != p.b() || c() != p.c() || d() != p.d();
137 }

◆ operator==()

bool HepGeom::Plane3D< G4double >::operator== ( const Plane3D< G4double > &  p) const
inlineinherited

Test for equality.

Definition at line 129 of file Plane3D.h.

129 {
130 return a() == p.a() && b() == p.b() && c() == p.c() && d() == p.d();
131 }

◆ point() [1/2]

Point3D< G4double > HepGeom::Plane3D< G4double >::point ( ) const
inlineinherited

Returns projection of the origin to the plane.

Definition at line 122 of file Plane3D.h.

122 {
123 T k = -d()/(a()*a()+b()*b()+c()*c());
124 return Point3D<T>(a()*k, b()*k, c()*k);
125 }

◆ point() [2/2]

Point3D< G4double > HepGeom::Plane3D< G4double >::point ( const Point3D< G4double > &  p) const
inlineinherited

Returns projection of the point to the plane.

Definition at line 115 of file Plane3D.h.

115 {
116 T k = distance(p)/(a()*a()+b()*b()+c()*c());
117 return Point3D<T>(p.x()-a()*k, p.y()-b()*k, p.z()-c()*k);
118 }
G4double distance(const Point3D< G4double > &p) const
Definition: Plane3D.h:109

◆ TargetReached()

G4bool G4ErrorTarget::TargetReached ( const G4Step )
virtualinherited

Reimplemented in G4ErrorGeomVolumeTarget.

Definition at line 46 of file G4ErrorTarget.cc.

47{
48 return false;
49}

◆ transform()

Plane3D< G4double > & HepGeom::Plane3D< G4double >::transform ( const Transform3D m)
inlineinherited

Transformation by Transform3D.

Definition at line 141 of file Plane3D.h.

141 {
142 Normal3D<T> n = normal();
143 n.transform(m);
144 d_ = -n*point().transform(m); a_ = n.x(); b_ = n.y(); c_ = n.z();
145 return *this;
146 }
static constexpr double m
Definition: G4SIunits.hh:109

Friends And Related Function Documentation

◆ operator<<() [1/2]

std::ostream & operator<< ( std::ostream &  os,
const Plane3D< double > &  p 
)
related

Output to the stream.

Definition at line 159 of file Plane3D.cc.

28 {
29 return os
30 << '(' << p.a() << ',' << p.b() << ',' << p.c() << ',' << p.d() << ')';
31 }

◆ operator<<() [2/2]

std::ostream & operator<< ( std::ostream &  os,
const Plane3D< float > &  p 
)
related

Output to the stream.

Definition at line 153 of file Plane3D.cc.

21 {
22 return os
23 << '(' << p.a() << ',' << p.b() << ',' << p.c() << ',' << p.d() << ')';
24 }

Field Documentation

◆ a_

G4double HepGeom::Plane3D< G4double >::a_
protectedinherited

Definition at line 30 of file Plane3D.h.

◆ b_

G4double HepGeom::Plane3D< G4double >::b_
protectedinherited

Definition at line 30 of file Plane3D.h.

◆ c_

G4double HepGeom::Plane3D< G4double >::c_
protectedinherited

Definition at line 30 of file Plane3D.h.

◆ d_

G4double HepGeom::Plane3D< G4double >::d_
protectedinherited

Definition at line 30 of file Plane3D.h.

◆ theType

G4ErrorTargetType G4ErrorTarget::theType
protectedinherited

The documentation for this class was generated from the following files: