Geant4 9.6.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4Parabola Class Reference

#include <G4Parabola.hh>

+ Inheritance diagram for G4Parabola:

Public Member Functions

 G4Parabola ()
 
virtual ~G4Parabola ()
 
 G4Parabola (const G4Parabola &right)
 
G4Parabolaoperator= (const G4Parabola &right)
 
G4CurveProject (const G4Transform3D &tr=G4Transform3D::Identity)
 
G4bool Tangent (G4CurvePoint &cp, G4Vector3D &v)
 
G4double GetPMax () const
 
G4Point3D GetPoint (G4double param) const
 
G4double GetPPoint (const G4Point3D &p) const
 
G4double GetFocalDist () const
 
void Init (const G4Axis2Placement3D &position0, G4double focalDist0)
 
G4int IntersectRay2D (const G4Ray &ray)
 
- Public Member Functions inherited from G4Conic
 G4Conic ()
 
virtual ~G4Conic ()
 
 G4Conic (const G4Conic &right)
 
G4Conicoperator= (const G4Conic &right)
 
const G4Axis2Placement3DGetPosition () const
 
G4double GetPShift () const
 
void SetPShift (G4double pShift0)
 
- Public Member Functions inherited from G4Curve
 G4Curve ()
 
virtual ~G4Curve ()
 
 G4Curve (const G4Curve &c)
 
G4Curveoperator= (const G4Curve &c)
 
G4bool operator== (const G4Curve &right) const
 
virtual G4String GetEntityType () const
 
virtual G4CurveProject (const G4Transform3D &tr=G4Transform3D::Identity)=0
 
virtual G4bool Tangent (G4CurvePoint &cp, G4Vector3D &v)=0
 
virtual G4int IntersectRay2D (const G4Ray &ray)=0
 
const G4Point3DGetStart () const
 
const G4Point3DGetEnd () const
 
G4double GetPStart () const
 
G4double GetPEnd () const
 
void SetBounds (G4double p1, G4double p2)
 
void SetBounds (G4double p1, const G4Point3D &p2)
 
void SetBounds (const G4Point3D &p1, G4double p2)
 
void SetBounds (const G4Point3D &p1, const G4Point3D &p2)
 
G4bool IsBounded () const
 
G4bool IsPOn (G4double param) const
 
void SetSameSense (G4int sameSense0)
 
G4int GetSameSense () const
 
virtual G4double GetPMax () const =0
 
virtual G4Point3D GetPoint (G4double param) const =0
 
virtual G4double GetPPoint (const G4Point3D &p) const =0
 
const G4BoundingBox3DBBox () const
 
virtual const char * Name () const
 
virtual void SetParentSrfPtr (const G4Surface *)
 

Protected Member Functions

void InitBounded ()
 
virtual void InitBounded ()=0
 

Additional Inherited Members

- Protected Attributes inherited from G4Conic
G4Axis2Placement3D position
 
G4double pShift
 
- Protected Attributes inherited from G4Curve
G4BoundingBox3D bBox
 
G4Point3D start
 
G4Point3D end
 
G4double pStart
 
G4double pEnd
 
G4double pRange
 
G4bool bounded
 
G4int sameSense
 
G4double kCarTolerance
 

Detailed Description

Definition at line 44 of file G4Parabola.hh.

Constructor & Destructor Documentation

◆ G4Parabola() [1/2]

G4Parabola::G4Parabola ( )

Definition at line 40 of file G4Parabola.cc.

40: focalDist(0.) {}

Referenced by Project().

◆ ~G4Parabola()

G4Parabola::~G4Parabola ( )
virtual

Definition at line 41 of file G4Parabola.cc.

41{}

◆ G4Parabola() [2/2]

G4Parabola::G4Parabola ( const G4Parabola right)

Definition at line 43 of file G4Parabola.cc.

44 : G4Conic(), focalDist(right.focalDist), F(right.F), L0(right.L0)
45{
46 pShift = right.pShift;
47 position = right.position;
48 bBox = right.bBox;
49 start = right.start;
50 end = right.end;
51 pStart = right.pStart;
52 pEnd = right.pEnd;
53 pRange = right.pRange;
54 bounded = right.bounded;
55 sameSense = right.sameSense;
56}
G4Axis2Placement3D position
Definition: G4Conic.hh:74
G4double pShift
Definition: G4Conic.hh:77
G4Conic()
Definition: G4Conic.cc:38
G4bool bounded
Definition: G4Curve.hh:166
G4double pStart
Definition: G4Curve.hh:163
G4int sameSense
Definition: G4Curve.hh:167
G4Point3D end
Definition: G4Curve.hh:162
G4BoundingBox3D bBox
Definition: G4Curve.hh:160
G4double pRange
Definition: G4Curve.hh:165
G4Point3D start
Definition: G4Curve.hh:161
G4double pEnd
Definition: G4Curve.hh:164

Member Function Documentation

◆ GetFocalDist()

G4double G4Parabola::GetFocalDist ( ) const
inline

◆ GetPMax()

G4double G4Parabola::GetPMax ( ) const
inlinevirtual

Implements G4Curve.

◆ GetPoint()

G4Point3D G4Parabola::GetPoint ( G4double  param) const
inlinevirtual

Implements G4Curve.

Referenced by InitBounded().

◆ GetPPoint()

G4double G4Parabola::GetPPoint ( const G4Point3D p) const
inlinevirtual

Implements G4Curve.

◆ Init()

void G4Parabola::Init ( const G4Axis2Placement3D position0,
G4double  focalDist0 
)
inline

Referenced by Project().

◆ InitBounded()

void G4Parabola::InitBounded ( )
protectedvirtual

Implements G4Curve.

Definition at line 119 of file G4Parabola.cc.

120{
121 // the bbox must include the start and endpoints as well as the
122 // extreme points if they lie on the curve
123 bBox.Init(GetStart(), GetEnd());
124
125 // the parameter values
126 // belonging to the points with an extreme x, y and z coordinate
127 for (G4int i=0; i<3; i++)
128 {
129 G4double x_i= position.GetPX()(i);
130
131 if (std::abs(x_i) <=
133 {
134 G4double u= - position.GetPY()(i) / x_i;
135 if (IsPOn(u))
136 bBox.Extend(GetPoint(u));
137 }
138 }
139}
double G4double
Definition: G4Types.hh:64
int G4int
Definition: G4Types.hh:66
void Init(const G4Point3D &)
void Extend(const G4Point3D &)
G4bool IsPOn(G4double param) const
const G4Point3D & GetStart() const
const G4Point3D & GetEnd() const
static G4GeometryTolerance * GetInstance()
G4double GetAngularTolerance() const
G4Point3D GetPoint(G4double param) const

◆ IntersectRay2D()

G4int G4Parabola::IntersectRay2D ( const G4Ray ray)
inlinevirtual

Implements G4Curve.

◆ operator=()

G4Parabola & G4Parabola::operator= ( const G4Parabola right)

Definition at line 58 of file G4Parabola.cc.

59{
60 if (&right == this) return *this;
61
62 F = right.F;
63 L0 = right.L0;
64 focalDist = right.focalDist;
65 pShift = right.pShift;
66 position = right.position;
67 bBox = right.bBox;
68 start = right.start;
69 end = right.end;
70 pStart = right.pStart;
71 pEnd = right.pEnd;
72 pRange = right.pRange;
73 bounded = right.bounded;
74 sameSense = right.sameSense;
75
76 return *this;
77}

◆ Project()

G4Curve * G4Parabola::Project ( const G4Transform3D tr = G4Transform3D::Identity)
virtual

Implements G4Curve.

Definition at line 79 of file G4Parabola.cc.

80{
81 G4double axisZ= (tr*position.GetPZ()).unit().z();
82
84 { return 0; }
85
86
87 G4Vector3D newAxis(0, 0, axisZ>0? +1: -1);
88
89 G4Vector3D xPrime= tr*position.GetPX();
90 xPrime.setZ(0);
91 G4Vector3D yPrime= tr*position.GetPY();
92 yPrime.setZ(0);
93 G4double u= -(xPrime*yPrime)/xPrime.mag2();
94
95 G4Point3D newLocation= G4Point3D( tr*position.GetLocation()+
96 focalDist*(u*u*xPrime+2*u*yPrime) );
97 newLocation.setZ(0);
98 G4Vector3D newRefDirection= xPrime;
99 G4double newFocalDist= (focalDist*((2*u+1)*xPrime+2*yPrime)).mag()/std::sqrt(5.);
100
101 // create the new parabola
102 G4Axis2Placement3D newPosition;
103 newPosition.Init(newRefDirection, newAxis, newLocation);
104 G4Parabola* r= new G4Parabola;
105 r->Init(newPosition, newFocalDist);
106
107 // introduce the shift in the parametrization
108 // maybe the Sign must be changed?
109 r->SetPShift(u);
110
111 // set the bounds when necessary
112 if (IsBounded())
113 r->SetBounds(GetPStart(), GetPEnd());
114
115 return r;
116}
HepGeom::Point3D< G4double > G4Point3D
Definition: G4Point3D.hh:35
void Init(const G4Vector3D &refDirection0, const G4Vector3D &axis0, const G4Point3D &location0)
void SetPShift(G4double pShift0)
G4bool IsBounded() const
void SetBounds(G4double p1, G4double p2)
G4double GetPEnd() const
G4double GetPStart() const
void Init(const G4Axis2Placement3D &position0, G4double focalDist0)

◆ Tangent()

G4bool G4Parabola::Tangent ( G4CurvePoint cp,
G4Vector3D v 
)
virtual

Implements G4Curve.

Definition at line 142 of file G4Parabola.cc.

143{
144 // The tangent is computed from the 3D point representation
145 // for all conics. An alternaive implementation (based on
146 // the parametric point) might be worthwhile adding
147 // for efficiency.
148
149 const G4Axis2Placement3D& pos= *(GetPosition());
151
152 v= p.y()*pos.GetPX() + (2*focalDist)*pos.GetPY();
153 return true;
154}
G4Vector3D GetPY() const
G4Vector3D GetPX() const
const G4Transform3D & GetToPlacementCoordinates() const
const G4Axis2Placement3D * GetPosition() const
const G4Point3D & GetPoint()

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