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

G4Orb represents a full sphere. More...

#include <G4Orb.hh>

Inheritance diagram for G4Orb:

Public Member Functions

 G4Orb (const G4String &pName, G4double pRmax)
 ~G4Orb () override=default
G4double GetRadius () const
G4double GetRadialTolerance () const
void SetRadius (G4double newRmax)
G4double GetCubicVolume () override
G4double GetSurfaceArea () override
void ComputeDimensions (G4VPVParameterisation *p, const G4int n, const G4VPhysicalVolume *pRep) override
void BoundingLimits (G4ThreeVector &pMin, G4ThreeVector &pMax) const override
G4bool CalculateExtent (const EAxis pAxis, const G4VoxelLimits &pVoxelLimit, const G4AffineTransform &pTransform, G4double &pmin, G4double &pmax) const override
EInside Inside (const G4ThreeVector &p) const override
G4ThreeVector SurfaceNormal (const G4ThreeVector &p) const override
G4double DistanceToIn (const G4ThreeVector &p, const G4ThreeVector &v) const override
G4double DistanceToIn (const G4ThreeVector &p) const override
G4double DistanceToOut (const G4ThreeVector &p, const G4ThreeVector &v, const G4bool calcNorm=false, G4bool *validNorm=nullptr, G4ThreeVector *n=nullptr) const override
G4double DistanceToOut (const G4ThreeVector &p) const override
G4GeometryType GetEntityType () const override
G4ThreeVector GetPointOnSurface () const override
G4VSolidClone () const override
std::ostream & StreamInfo (std::ostream &os) const override
void DescribeYourselfTo (G4VGraphicsScene &scene) const override
G4VisExtent GetExtent () const override
G4PolyhedronCreatePolyhedron () const override
 G4Orb (__void__ &)
 G4Orb (const G4Orb &rhs)=default
G4Orboperator= (const G4Orb &rhs)
Public Member Functions inherited from G4CSGSolid
 G4CSGSolid (const G4String &pName)
 ~G4CSGSolid () override
G4PolyhedronGetPolyhedron () const override
 G4CSGSolid (__void__ &)
 G4CSGSolid (const G4CSGSolid &rhs)
G4CSGSolidoperator= (const G4CSGSolid &rhs)
Public Member Functions inherited from G4VSolid
 G4VSolid (const G4String &name)
virtual ~G4VSolid ()
 G4VSolid (const G4VSolid &rhs)
G4VSolidoperator= (const G4VSolid &rhs)
G4bool operator== (const G4VSolid &s) const
G4String GetName () const
void SetName (const G4String &name)
G4double GetTolerance () const
virtual G4int GetNumOfConstituents () const
virtual G4bool IsFaceted () const
void DumpInfo () const
virtual const G4VSolidGetConstituentSolid (G4int no) const
virtual G4VSolidGetConstituentSolid (G4int no)
virtual const G4DisplacedSolidGetDisplacedSolidPtr () const
virtual G4DisplacedSolidGetDisplacedSolidPtr ()
 G4VSolid (__void__ &)
G4double EstimateCubicVolume (G4int nStat, G4double epsilon) const
G4double EstimateSurfaceArea (G4int nStat, G4double epsilon) const

Protected Member Functions

void Initialize ()
Protected Member Functions inherited from G4CSGSolid
G4double GetRadiusInRing (G4double rmin, G4double rmax) const
Protected Member Functions inherited from G4VSolid
void CalculateClippedPolygonExtent (G4ThreeVectorList &pPolygon, const G4VoxelLimits &pVoxelLimit, const EAxis pAxis, G4double &pMin, G4double &pMax) const
void ClipCrossSection (G4ThreeVectorList *pVertices, const G4int pSectionIndex, const G4VoxelLimits &pVoxelLimit, const EAxis pAxis, G4double &pMin, G4double &pMax) const
void ClipBetweenSections (G4ThreeVectorList *pVertices, const G4int pSectionIndex, const G4VoxelLimits &pVoxelLimit, const EAxis pAxis, G4double &pMin, G4double &pMax) const
void ClipPolygon (G4ThreeVectorList &pPolygon, const G4VoxelLimits &pVoxelLimit, const EAxis pAxis) const

Additional Inherited Members

Protected Attributes inherited from G4CSGSolid
G4double fCubicVolume = 0.0
G4double fSurfaceArea = 0.0
G4bool fRebuildPolyhedron = false
G4PolyhedronfpPolyhedron = nullptr
Protected Attributes inherited from G4VSolid
G4double kCarTolerance

Detailed Description

G4Orb represents a full sphere.

Definition at line 58 of file G4Orb.hh.

Constructor & Destructor Documentation

◆ G4Orb() [1/3]

G4Orb::G4Orb ( const G4String & pName,
G4double pRmax )

Constructs a full sphere, given a name and its radius.

Parameters
[in]pNameThe name of the solid.
[in]pRmaxOuter radius.

Definition at line 58 of file G4Orb.cc.

59 : G4CSGSolid(pName), fRmax(pRmax)
60{
61 Initialize();
62}
G4CSGSolid(const G4String &pName)
Definition G4CSGSolid.cc:49
void Initialize()
Definition G4Orb.cc:102

Referenced by Clone(), G4Orb(), and operator=().

◆ ~G4Orb()

G4Orb::~G4Orb ( )
overridedefault

Default destructor.

◆ G4Orb() [2/3]

G4Orb::G4Orb ( __void__ & a)

Fake default constructor for usage restricted to direct object persistency for clients requiring preallocation of memory for persistifiable objects.

Definition at line 69 of file G4Orb.cc.

70 : G4CSGSolid(a)
71{
72}

◆ G4Orb() [3/3]

G4Orb::G4Orb ( const G4Orb & rhs)
default

Copy constructor and assignment operator.

Member Function Documentation

◆ BoundingLimits()

void G4Orb::BoundingLimits ( G4ThreeVector & pMin,
G4ThreeVector & pMax ) const
overridevirtual

Computes the bounding limits of the solid.

Parameters
[out]pMinThe minimum bounding limit point.
[out]pMaxThe maximum bounding limit point.

Reimplemented from G4VSolid.

Definition at line 136 of file G4Orb.cc.

137{
138 G4double radius = GetRadius();
139 pMin.set(-radius,-radius,-radius);
140 pMax.set( radius, radius, radius);
141
142 // Check correctness of the bounding box
143 //
144 if (pMin.x() >= pMax.x() || pMin.y() >= pMax.y() || pMin.z() >= pMax.z())
145 {
146 std::ostringstream message;
147 message << "Bad bounding box (min >= max) for solid: "
148 << GetName() << " !"
149 << "\npMin = " << pMin
150 << "\npMax = " << pMax;
151 G4Exception("G4Orb::BoundingLimits()", "GeomMgt0001",
152 JustWarning, message);
153 DumpInfo();
154 }
155}
@ JustWarning
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
double G4double
Definition G4Types.hh:83
double z() const
double x() const
double y() const
void set(double x, double y, double z)
G4double GetRadius() const
G4String GetName() const
void DumpInfo() const

Referenced by CalculateExtent().

◆ CalculateExtent()

G4bool G4Orb::CalculateExtent ( const EAxis pAxis,
const G4VoxelLimits & pVoxelLimit,
const G4AffineTransform & pTransform,
G4double & pmin,
G4double & pmax ) const
overridevirtual

Calculates the minimum and maximum extent of the solid, when under the specified transform, and within the specified limits.

Parameters
[in]pAxisThe axis along which compute the extent.
[in]pVoxelLimitThe limiting space dictated by voxels.
[in]pTransformThe internal transformation applied to the solid.
[out]pMinThe minimum extent value.
[out]pMaxThe maximum extent value.
Returns
True if the solid is intersected by the extent region.

Implements G4VSolid.

Definition at line 161 of file G4Orb.cc.

165{
166 G4ThreeVector bmin, bmax;
167 G4bool exist;
168
169 // Get bounding box
170 BoundingLimits(bmin,bmax);
171
172 // Check bounding box
173 G4BoundingEnvelope bbox(bmin,bmax);
174#ifdef G4BBOX_EXTENT
175 return bbox.CalculateExtent(pAxis,pVoxelLimit,pTransform,pMin,pMax);
176#endif
177 if (bbox.BoundingBoxVsVoxelLimits(pAxis,pVoxelLimit,pTransform,pMin,pMax))
178 {
179 return exist = pMin < pMax;
180 }
181
182 // Find bounding envelope and calculate extent
183 //
184 static const G4int NTHETA = 8; // number of steps along Theta
185 static const G4int NPHI = 16; // number of steps along Phi
186 static const G4double sinHalfTheta = std::sin(halfpi/NTHETA);
187 static const G4double cosHalfTheta = std::cos(halfpi/NTHETA);
188 static const G4double sinHalfPhi = std::sin(pi/NPHI);
189 static const G4double cosHalfPhi = std::cos(pi/NPHI);
190 static const G4double sinStepTheta = 2.*sinHalfTheta*cosHalfTheta;
191 static const G4double cosStepTheta = 1. - 2.*sinHalfTheta*sinHalfTheta;
192 static const G4double sinStepPhi = 2.*sinHalfPhi*cosHalfPhi;
193 static const G4double cosStepPhi = 1. - 2.*sinHalfPhi*sinHalfPhi;
194
195 G4double radius = GetRadius();
196 G4double rtheta = radius/cosHalfTheta;
197 G4double rphi = rtheta/cosHalfPhi;
198
199 // set reference circle
200 G4TwoVector xy[NPHI];
201 G4double sinCurPhi = sinHalfPhi;
202 G4double cosCurPhi = cosHalfPhi;
203 for (auto & k : xy)
204 {
205 k.set(cosCurPhi,sinCurPhi);
206 G4double sinTmpPhi = sinCurPhi;
207 sinCurPhi = sinCurPhi*cosStepPhi + cosCurPhi*sinStepPhi;
208 cosCurPhi = cosCurPhi*cosStepPhi - sinTmpPhi*sinStepPhi;
209 }
210
211 // set bounding circles
212 G4ThreeVectorList circles[NTHETA];
213 for (auto & circle : circles) { circle.resize(NPHI); }
214
215 G4double sinCurTheta = sinHalfTheta;
216 G4double cosCurTheta = cosHalfTheta;
217 for (auto & circle : circles)
218 {
219 G4double z = rtheta*cosCurTheta;
220 G4double rho = rphi*sinCurTheta;
221 for (G4int k=0; k<NPHI; ++k)
222 {
223 circle[k].set(rho*xy[k].x(),rho*xy[k].y(),z);
224 }
225 G4double sinTmpTheta = sinCurTheta;
226 sinCurTheta = sinCurTheta*cosStepTheta + cosCurTheta*sinStepTheta;
227 cosCurTheta = cosCurTheta*cosStepTheta - sinTmpTheta*sinStepTheta;
228 }
229
230 // set envelope and calculate extent
231 std::vector<const G4ThreeVectorList *> polygons;
232 polygons.resize(NTHETA);
233 for (G4int i=0; i<NTHETA; ++i) { polygons[i] = &circles[i]; }
234
235 G4BoundingEnvelope benv(bmin,bmax,polygons);
236 exist = benv.CalculateExtent(pAxis,pVoxelLimit,pTransform,pMin,pMax);
237 return exist;
238}
std::vector< G4ThreeVector > G4ThreeVectorList
CLHEP::Hep3Vector G4ThreeVector
CLHEP::Hep2Vector G4TwoVector
bool G4bool
Definition G4Types.hh:86
int G4int
Definition G4Types.hh:85
void BoundingLimits(G4ThreeVector &pMin, G4ThreeVector &pMax) const override
Definition G4Orb.cc:136

◆ Clone()

G4VSolid * G4Orb::Clone ( ) const
overridevirtual

Makes a clone of the object for use in multi-treading.

Returns
A pointer to the new cloned allocated solid.

Reimplemented from G4VSolid.

Definition at line 401 of file G4Orb.cc.

402{
403 return new G4Orb(*this);
404}
G4Orb(const G4String &pName, G4double pRmax)
Definition G4Orb.cc:58

◆ ComputeDimensions()

void G4Orb::ComputeDimensions ( G4VPVParameterisation * p,
const G4int n,
const G4VPhysicalVolume * pRep )
overridevirtual

Dispatch method for parameterisation replication mechanism and dimension computation.

Reimplemented from G4VSolid.

Definition at line 125 of file G4Orb.cc.

128{
129 p->ComputeDimensions(*this,n,pRep);
130}
virtual void ComputeDimensions(G4Box &, const G4int, const G4VPhysicalVolume *) const

◆ CreatePolyhedron()

G4Polyhedron * G4Orb::CreatePolyhedron ( ) const
overridevirtual

Creates a Polyhedron used for Visualisation. It is the caller's responsibility to delete it. A null pointer means "not created".

Reimplemented from G4VSolid.

Definition at line 484 of file G4Orb.cc.

485{
486 return new G4PolyhedronSphere (0., fRmax, 0., 2*pi, 0., pi);
487}

◆ DescribeYourselfTo()

void G4Orb::DescribeYourselfTo ( G4VGraphicsScene & scene) const
overridevirtual

Methods for creating graphical representations (i.e. for visualisation).

Implements G4VSolid.

Definition at line 474 of file G4Orb.cc.

475{
476 scene.AddSolid (*this);
477}
virtual void AddSolid(const G4Box &)=0

◆ DistanceToIn() [1/2]

G4double G4Orb::DistanceToIn ( const G4ThreeVector & p) const
overridevirtual

Calculates the distance to the nearest surface of a shape from an outside point. The distance can be an underestimate.

Parameters
[in]pThe point at offset p.
Returns
The safety distance to enter the shape.

Implements G4VSolid.

Definition at line 310 of file G4Orb.cc.

311{
312 G4double dist = p.mag() - fRmax;
313 return (dist > 0) ? dist : 0.;
314}
double mag() const

◆ DistanceToIn() [2/2]

G4double G4Orb::DistanceToIn ( const G4ThreeVector & p,
const G4ThreeVector & v ) const
overridevirtual

Returns the distance along the normalised vector 'v' to the shape, from the point at offset 'p'. If there is no intersection, returns kInfinity. The first intersection resulting from 'leaving' a surface/volume is discarded. Hence, it is tolerant of points on the surface of the shape.

Parameters
[in]pThe point at offset p.
[in]vThe normalised direction vector.
Returns
The distance to enter the shape.

Implements G4VSolid.

Definition at line 266 of file G4Orb.cc.

268{
269 // Check if point is on the surface and traveling away
270 //
271 G4double rr = p.mag2();
272 G4double pv = p.dot(v);
273 if (rr >= sqrRmaxMinusTol && pv >= 0) { return kInfinity; }
274
275 // Find intersection
276 //
277 // Sphere eqn: x^2 + y^2 + z^2 = R^2
278 //
279 // => (px + t*vx)^2 + (py + t*vy)^2 + (pz + t*vz)^2 = R^2
280 // => r^2 + 2t(p.v) + t^2 = R^2
281 // => tmin = -(p.v) - Sqrt((p.v)^2 - (r^2 - R^2))
282 //
283 G4double D = pv*pv - rr + fRmax*fRmax;
284 if (D < 0) { return kInfinity; } // no intersection
285
286 G4double sqrtD = std::sqrt(D);
287 G4double dist = -pv - sqrtD;
288
289 // Avoid rounding errors due to precision issues seen on 64 bits systems.
290 // Split long distances and recompute
291 //
292 G4double Dmax = 32*fRmax;
293 if (dist > Dmax)
294 {
295 dist = dist - 1.e-8*dist - fRmax; // to stay outside after the move
296 dist += DistanceToIn(p + dist*v, v);
297 return (dist >= kInfinity) ? kInfinity : dist;
298 }
299
300 if (sqrtD*2 <= halfRmaxTol) { return kInfinity; } // touch
301
302 return (dist < halfRmaxTol) ? 0. : dist;
303}
G4double D(G4double temp)
double mag2() const
double dot(const Hep3Vector &) const
G4double DistanceToIn(const G4ThreeVector &p, const G4ThreeVector &v) const override
Definition G4Orb.cc:266

Referenced by DistanceToIn().

◆ DistanceToOut() [1/2]

G4double G4Orb::DistanceToOut ( const G4ThreeVector & p) const
overridevirtual

Calculates the distance to the nearest surface of a shape from an inside point 'p'. The distance can be an underestimate.

Parameters
[in]pThe point at offset p.
Returns
The safety distance to exit the shape.

Implements G4VSolid.

Definition at line 366 of file G4Orb.cc.

367{
368#ifdef G4CSGDEBUG
369 if( Inside(p) == kOutside )
370 {
371 std::ostringstream message;
372 G4int oldprc = message.precision(16);
373 message << "Point p is outside (!?) of solid: " << GetName() << "\n";
374 message << "Position:\n";
375 message << " p.x() = " << p.x()/mm << " mm\n";
376 message << " p.y() = " << p.y()/mm << " mm\n";
377 message << " p.z() = " << p.z()/mm << " mm";
378 G4cout.precision(oldprc);
379 G4Exception("G4Trap::DistanceToOut(p)", "GeomSolids1002",
380 JustWarning, message );
381 DumpInfo();
382 }
383#endif
384 G4double dist = fRmax - p.mag();
385 return (dist > 0) ? dist : 0.;
386}
G4GLOB_DLL std::ostream G4cout
EInside Inside(const G4ThreeVector &p) const override
Definition G4Orb.cc:244
@ kOutside
Definition geomdefs.hh:68

◆ DistanceToOut() [2/2]

G4double G4Orb::DistanceToOut ( const G4ThreeVector & p,
const G4ThreeVector & v,
const G4bool calcNorm = false,
G4bool * validNorm = nullptr,
G4ThreeVector * n = nullptr ) const
overridevirtual

Returns the distance along the normalised vector 'v' to the shape, from a point at an offset 'p' inside or on the surface of the shape. Intersections with surfaces, when the point is less than Tolerance/2 from a surface must be ignored.

Parameters
[in]pThe point at offset p.
[in]vThe normalised direction vector.
[in]calcNormFlag to indicate if to calculate the normal or not.
[out]validNormFlag set to true if the solid lies entirely behind or on the exiting surface. It is set false if the solid does not lie entirely behind or on the exiting surface. 'calcNorm' must be true, otherwise it is unused.
[out]nThe exiting outwards normal vector (undefined Magnitude). 'calcNorm' must be true, otherwise it is unused.
Returns
The distance to exit the shape.

Implements G4VSolid.

Definition at line 322 of file G4Orb.cc.

327{
328 // Check if point is on the surface and traveling away
329 //
330 G4double rr = p.mag2();
331 G4double pv = p.dot(v);
332 if (rr >= sqrRmaxMinusTol && pv > 0)
333 {
334 if (calcNorm)
335 {
336 *validNorm = true;
337 *n = p*(1./std::sqrt(rr));
338 }
339 return 0.;
340 }
341
342 // Find intersection
343 //
344 // Sphere eqn: x^2 + y^2 + z^2 = R^2
345 //
346 // => (px + t*vx)^2 + (py + t*vy)^2 + (pz + t*vz)^2 = R^2
347 // => r^2 + 2t(p.v) + t^2 = R^2
348 // => tmax = -(p.v) + Sqrt((p.v)^2 - (r^2 - R^2))
349 //
350 G4double D = pv*pv - rr + fRmax*fRmax;
351 G4double tmax = (D <= 0) ? 0. : std::sqrt(D) - pv;
352 if (tmax < halfRmaxTol) { tmax = 0.; }
353 if (calcNorm)
354 {
355 *validNorm = true;
356 G4ThreeVector ptmax = p + tmax*v;
357 *n = ptmax*(1./ptmax.mag());
358 }
359 return tmax;
360}

◆ GetCubicVolume()

G4double G4Orb::GetCubicVolume ( )
overridevirtual

Returning an estimation of the solid volume (capacity) and surface area, in internal units.

Reimplemented from G4VSolid.

Definition at line 445 of file G4Orb.cc.

446{
447 if (fCubicVolume == 0)
448 {
449 G4AutoLock l(&orbMutex);
450 fCubicVolume = 4*CLHEP::pi*fRmax*fRmax*fRmax/3.;
451 l.unlock();
452 }
453 return fCubicVolume;
454}
G4TemplateAutoLock< G4Mutex > G4AutoLock
G4double fCubicVolume
Definition G4CSGSolid.hh:92

◆ GetEntityType()

G4GeometryType G4Orb::GetEntityType ( ) const
overridevirtual

Returns the type ID, "G4Orb" of the solid.

Implements G4VSolid.

Definition at line 392 of file G4Orb.cc.

393{
394 return {"G4Orb"};
395}

◆ GetExtent()

G4VisExtent G4Orb::GetExtent ( ) const
overridevirtual

Provides extent (bounding box) as possible hint to the graphics view.

Reimplemented from G4VSolid.

Definition at line 479 of file G4Orb.cc.

480{
481 return {-fRmax, fRmax, -fRmax, fRmax, -fRmax, fRmax};
482}

◆ GetPointOnSurface()

G4ThreeVector G4Orb::GetPointOnSurface ( ) const
overridevirtual

Returns a random point located and uniformly distributed on the surface of the solid.

Reimplemented from G4VSolid.

Definition at line 428 of file G4Orb.cc.

429{
430 G4double u, v, b;
431 do
432 {
433 u = 2.*G4QuickRand() - 1.;
434 v = 2.*G4QuickRand() - 1.;
435 b = sqr(u) + sqr(v);
436 } while(b > 1.);
437 G4double a = 2.*std::sqrt(1. - b);
438 return { fRmax*a*u, fRmax*a*v, fRmax*(2.*b - 1.) };
439}
G4double G4QuickRand(uint32_t seed=0)
T sqr(const T &x)
Definition templates.hh:128

◆ GetRadialTolerance()

G4double G4Orb::GetRadialTolerance ( ) const
inline

◆ GetRadius()

◆ GetSurfaceArea()

G4double G4Orb::GetSurfaceArea ( )
overridevirtual

Returns an estimation of the solid surface area in internal units. This method may be overloaded by derived classes to compute the exact geometrical quantity for solids where this is possible, or anyway to cache the computed value. Note: the computed value is NOT cached.

Reimplemented from G4VSolid.

Definition at line 460 of file G4Orb.cc.

461{
462 if (fSurfaceArea == 0)
463 {
464 G4AutoLock l(&orbMutex);
465 fSurfaceArea = 4*CLHEP::pi*fRmax*fRmax;
466 l.unlock();
467 }
468 return fSurfaceArea;
469}
G4double fSurfaceArea
Definition G4CSGSolid.hh:93

◆ Initialize()

void G4Orb::Initialize ( )
protected

Checks radius and initialises data members. Used in constructor.

Definition at line 102 of file G4Orb.cc.

103{
104 const G4double fEpsilon = 2.e-11; // relative tolerance of fRmax
105
106 // Check radius
107 //
108 if ( fRmax < 10*kCarTolerance )
109 {
110 G4Exception("G4Orb::Initialize()", "GeomSolids0002", FatalException,
111 "Invalid radius < 10*kCarTolerance.");
112 }
113 halfRmaxTol = 0.5 * std::max(kCarTolerance, fEpsilon*fRmax);
114 G4double rmaxPlusTol = fRmax + halfRmaxTol;
115 G4double rmaxMinusTol = fRmax - halfRmaxTol;
116 sqrRmaxPlusTol = rmaxPlusTol*rmaxPlusTol;
117 sqrRmaxMinusTol = rmaxMinusTol*rmaxMinusTol;
118}
@ FatalException
G4double kCarTolerance
Definition G4VSolid.hh:418

Referenced by G4Orb().

◆ Inside()

EInside G4Orb::Inside ( const G4ThreeVector & p) const
overridevirtual

Concrete implementations of the expected query interfaces for solids, as defined in the base class G4VSolid.

Implements G4VSolid.

Definition at line 244 of file G4Orb.cc.

245{
246 G4double rr = p.mag2();
247 if (rr > sqrRmaxPlusTol) { return kOutside; }
248 return (rr > sqrRmaxMinusTol) ? kSurface : kInside;
249}
@ kInside
Definition geomdefs.hh:70
@ kSurface
Definition geomdefs.hh:69

Referenced by DistanceToOut().

◆ operator=()

G4Orb & G4Orb::operator= ( const G4Orb & rhs)

Definition at line 78 of file G4Orb.cc.

79{
80 // Check assignment to self
81 //
82 if (this == &rhs) { return *this; }
83
84 // Copy base class data
85 //
87
88 // Copy data
89 //
90 fRmax = rhs.fRmax;
91 halfRmaxTol = rhs.halfRmaxTol;
92 sqrRmaxPlusTol = rhs.sqrRmaxPlusTol;
93 sqrRmaxMinusTol = rhs.sqrRmaxMinusTol;
94
95 return *this;
96}
G4CSGSolid & operator=(const G4CSGSolid &rhs)
Definition G4CSGSolid.cc:89

◆ SetRadius()

void G4Orb::SetRadius ( G4double newRmax)
inline

◆ StreamInfo()

std::ostream & G4Orb::StreamInfo ( std::ostream & os) const
overridevirtual

Streams the object contents to an output stream.

Reimplemented from G4CSGSolid.

Definition at line 410 of file G4Orb.cc.

411{
412 G4long oldprc = os.precision(16);
413 os << "-----------------------------------------------------------\n"
414 << " *** Dump for solid - " << GetName() << " ***\n"
415 << " ===================================================\n"
416 << " Solid type: G4Orb\n"
417 << " Parameters: \n"
418 << " outer radius: " << fRmax/mm << " mm \n"
419 << "-----------------------------------------------------------\n";
420 os.precision(oldprc);
421 return os;
422}
long G4long
Definition G4Types.hh:87

◆ SurfaceNormal()

G4ThreeVector G4Orb::SurfaceNormal ( const G4ThreeVector & p) const
overridevirtual

Returns the outwards pointing unit normal of the shape for the surface closest to the point at offset 'p'.

Parameters
[in]pThe point at offset p.
Returns
The outwards pointing unit normal.

Implements G4VSolid.

Definition at line 255 of file G4Orb.cc.

256{
257 return (1/p.mag())*p;
258}

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