|
Geant4 11.4.0
Toolkit for the simulation of the passage of particles through matter
|
G4Tubs is a tube or tube segment with curved sides parallel to the Z-axis. The tube has a specified half-length along the Z-axis, about which it is centered, and a given minimum and maximum radius. A minimum radius of 0 corresponds to filled tube/cylinder. The tube segment is specified by starting and delta angles for phi, with 0 being the +x axis, PI/2 the +y axis. A delta angle of 2PI signifies a complete, unsegmented tube/cylinder. More...
#include <G4Tubs.hh>
Protected Member Functions | |
| void | Initialize () |
| void | CheckSPhiAngle (G4double sPhi) |
| void | CheckDPhiAngle (G4double dPhi) |
| void | CheckPhiAngles (G4double sPhi, G4double dPhi) |
| void | InitializeTrigonometry () |
| G4double | FastInverseRxy (const G4ThreeVector &pos, G4double invRad, G4double normalTolerance) const |
| G4ThreeVector | ApproxSurfaceNormal (const G4ThreeVector &p) const |
| 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 |
Protected Attributes | |
| G4double | kRadTolerance |
| G4double | kAngTolerance |
| G4double | fRMin |
| G4double | fRMax |
| G4double | fDz |
| G4double | fSPhi |
| G4double | fDPhi |
| G4double | sinCPhi |
| G4double | cosCPhi |
| G4double | cosHDPhi |
| G4double | cosHDPhiOT |
| G4double | cosHDPhiIT |
| G4double | sinSPhi |
| G4double | cosSPhi |
| G4double | sinEPhi |
| G4double | cosEPhi |
| G4bool | fPhiFullTube |
| G4double | fInvRmax |
| G4double | fInvRmin |
| G4double | halfCarTolerance |
| G4double | halfRadTolerance |
| G4double | halfAngTolerance |
| Protected Attributes inherited from G4CSGSolid | |
| G4double | fCubicVolume = 0.0 |
| G4double | fSurfaceArea = 0.0 |
| G4bool | fRebuildPolyhedron = false |
| G4Polyhedron * | fpPolyhedron = nullptr |
| Protected Attributes inherited from G4VSolid | |
| G4double | kCarTolerance |
Static Protected Attributes | |
| static constexpr G4double | kNormTolerance = 1.0e-6 |
G4Tubs is a tube or tube segment with curved sides parallel to the Z-axis. The tube has a specified half-length along the Z-axis, about which it is centered, and a given minimum and maximum radius. A minimum radius of 0 corresponds to filled tube/cylinder. The tube segment is specified by starting and delta angles for phi, with 0 being the +x axis, PI/2 the +y axis. A delta angle of 2PI signifies a complete, unsegmented tube/cylinder.
| G4Tubs::G4Tubs | ( | const G4String & | pName, |
| G4double | pRMin, | ||
| G4double | pRMax, | ||
| G4double | pDz, | ||
| G4double | pSPhi, | ||
| G4double | pDPhi ) |
Constructs a tubs with the given name and dimensions. It checks the input parameters, converting angles so 0<sphi+dpshi<=2_PI if pdphi>2PI then reset it to 2PI.
| [in] | pName | The name of the solid. |
| [in] | pRMin | Inner radius. |
| [in] | pRMax | Outer radius. |
| [in] | pDz | Half length in Z. |
| [in] | pSPhi | Starting phi angle in radians. |
| [in] | pDPhi | Angle of the segment in radians. |
Definition at line 73 of file G4Tubs.cc.
Referenced by Clone(), G4Tubs(), and operator=().
|
overridedefault |
Default destructor.
| G4Tubs::G4Tubs | ( | __void__ & | a | ) |
Fake default constructor for usage restricted to direct object persistency for clients requiring preallocation of memory for persistifiable objects.
|
default |
Copy constructor and assignment operator.
|
protected |
Algorithm for SurfaceNormal() following the original specification for points not on the surface.
Definition at line 585 of file G4Tubs.cc.
Referenced by SurfaceNormal().
|
overridevirtual |
Computes the bounding limits of the solid.
| [out] | pMin | The minimum bounding limit point. |
| [out] | pMax | The maximum bounding limit point. |
Reimplemented from G4VSolid.
Definition at line 168 of file G4Tubs.cc.
Referenced by CalculateExtent().
|
overridevirtual |
Calculates the minimum and maximum extent of the solid, when under the specified transform, and within the specified limits.
| [in] | pAxis | The axis along which compute the extent. |
| [in] | pVoxelLimit | The limiting space dictated by voxels. |
| [in] | pTransform | The internal transformation applied to the solid. |
| [out] | pMin | The minimum extent value. |
| [out] | pMax | The maximum extent value. |
Implements G4VSolid.
Definition at line 211 of file G4Tubs.cc.
|
inlineprotected |
Referenced by G4Tubs().
|
inlineprotected |
Methods resetting relevant flags and angle values.
|
overridevirtual |
Makes a clone of the object for use in multi-treading.
Reimplemented from G4VSolid.
Definition at line 1618 of file G4Tubs.cc.
|
overridevirtual |
Dispatch method for parameterisation replication mechanism and dimension computation.
Reimplemented from G4VSolid.
Definition at line 157 of file G4Tubs.cc.
|
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 1770 of file G4Tubs.cc.
Referenced by G4GMocrenFileSceneHandler::AddSolid(), and G4ArrowModel::G4ArrowModel().
|
overridevirtual |
|
overridevirtual |
Calculates the distance to the nearest surface of a shape from an outside point. The distance can be an underestimate.
| [in] | p | The point at offset p. |
Implements G4VSolid.
Definition at line 1083 of file G4Tubs.cc.
|
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.
| [in] | p | The point at offset p. |
| [in] | v | The normalised direction vector. |
Implements G4VSolid.
Definition at line 717 of file G4Tubs.cc.
Referenced by DistanceToIn().
|
overridevirtual |
Calculates the distance to the nearest surface of a shape from an inside point 'p'. The distance can be an underestimate.
| [in] | p | The point at offset p. |
Implements G4VSolid.
Definition at line 1549 of file G4Tubs.cc.
|
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.
| [in] | p | The point at offset p. |
| [in] | v | The normalised direction vector. |
| [in] | calcNorm | Flag to indicate if to calculate the normal or not. |
| [out] | validNorm | Flag 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] | n | The exiting outwards normal vector (undefined Magnitude). 'calcNorm' must be true, otherwise it is unused. |
Implements G4VSolid.
Definition at line 1127 of file G4Tubs.cc.
|
inlineprotected |
Computes fast inverse cylindrical (Rxy) radius for points expected to be on a cylindrical surface. Ensures that surface normal vector produced has magnitude with 'normalTolerance' of unit.
Referenced by DistanceToOut().
|
inline |
Referenced by BoundingLimits(), and CalculateExtent().
|
inline |
Referenced by BoundingLimits(), and CalculateExtent().
|
overridevirtual |
Returning an estimation of the solid volume (capacity) and surface area, in internal units.
Reimplemented from G4VSolid.
|
inline |
|
overridevirtual |
|
inline |
Accessors.
Referenced by BoundingLimits(), G4tgbVolume::BuildSolidForDivision(), CalculateExtent(), G4tgbGeometryDumper::GetSolidParams(), G4PSCylinderSurfaceCurrent::IsSelectedSurface(), G4PSCylinderSurfaceFlux::IsSelectedSurface(), G4GDMLWriteParamvol::Tube_dimensionsWrite(), and G4GDMLWriteSolids::TubeWrite().
|
inline |
|
overridevirtual |
Returns a random point located and uniformly distributed on the surface of the solid.
Reimplemented from G4VSolid.
Definition at line 1650 of file G4Tubs.cc.
|
inline |
Referenced by BoundingLimits(), and CalculateExtent().
|
inline |
Referenced by BoundingLimits(), and CalculateExtent().
|
inline |
|
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.
|
inline |
Referenced by BoundingLimits(), G4tgbVolume::BuildSolidForDivision(), CalculateExtent(), G4tgbGeometryDumper::GetSolidParams(), G4PSCylinderSurfaceCurrent::IsSelectedSurface(), G4PSCylinderSurfaceFlux::IsSelectedSurface(), G4GDMLWriteParamvol::Tube_dimensionsWrite(), and G4GDMLWriteSolids::TubeWrite().
|
inlineprotected |
Resets the relevant values to zero.
|
inlineprotected |
Recomputes relevant trigonometric values and caches them.
|
overridevirtual |
Concrete implementations of the expected query interfaces for solids, as defined in the base class G4VSolid.
Implements G4VSolid.
Definition at line 327 of file G4Tubs.cc.
Referenced by DistanceToOut().
Definition at line 123 of file G4Tubs.cc.
|
inline |
|
inline |
Modifiers.
Referenced by G4ParameterisationTubsPhi::ComputeDimensions(), G4ParameterisationTubsRho::ComputeDimensions(), and G4ParameterisationTubsZ::ComputeDimensions().
|
inline |
|
inline |
|
overridevirtual |
Streams the object contents to an output stream.
Reimplemented from G4CSGSolid.
Definition at line 1627 of file G4Tubs.cc.
|
overridevirtual |
Returns the outwards pointing unit normal of the shape for the surface closest to the point at offset 'p'.
| [in] | p | The point at offset p. |
Implements G4VSolid.
Definition at line 494 of file G4Tubs.cc.
|
protected |
Definition at line 271 of file G4Tubs.hh.
Referenced by DistanceToIn(), DistanceToIn(), DistanceToOut(), DistanceToOut(), and operator=().
|
protected |
Definition at line 272 of file G4Tubs.hh.
Referenced by ApproxSurfaceNormal(), DistanceToIn(), DistanceToIn(), DistanceToOut(), DistanceToOut(), GetPointOnSurface(), operator=(), and SurfaceNormal().
|
protected |
Definition at line 271 of file G4Tubs.hh.
Referenced by DistanceToIn(), and operator=().
|
protected |
Definition at line 271 of file G4Tubs.hh.
Referenced by DistanceToIn(), and operator=().
|
protected |
Definition at line 271 of file G4Tubs.hh.
Referenced by operator=().
|
protected |
Definition at line 272 of file G4Tubs.hh.
Referenced by ApproxSurfaceNormal(), DistanceToIn(), DistanceToIn(), DistanceToOut(), DistanceToOut(), GetPointOnSurface(), operator=(), and SurfaceNormal().
|
protected |
Definition at line 268 of file G4Tubs.hh.
Referenced by ApproxSurfaceNormal(), CreatePolyhedron(), DistanceToOut(), G4Tubs(), GetCubicVolume(), GetPointOnSurface(), GetSurfaceArea(), Inside(), operator=(), StreamInfo(), and SurfaceNormal().
|
protected |
Definition at line 268 of file G4Tubs.hh.
Referenced by ApproxSurfaceNormal(), CreatePolyhedron(), DistanceToIn(), DistanceToIn(), DistanceToOut(), DistanceToOut(), G4Tubs(), GetCubicVolume(), GetPointOnSurface(), GetSurfaceArea(), Inside(), operator=(), StreamInfo(), and SurfaceNormal().
|
protected |
More cached values - inverse of Rmax, Rmin.
Definition at line 278 of file G4Tubs.hh.
Referenced by DistanceToOut(), G4Tubs(), and operator=().
|
protected |
Definition at line 278 of file G4Tubs.hh.
Referenced by DistanceToIn(), G4Tubs(), and operator=().
|
protected |
Flag for identification of section or full tube.
Definition at line 275 of file G4Tubs.hh.
Referenced by ApproxSurfaceNormal(), DistanceToIn(), DistanceToIn(), DistanceToOut(), DistanceToOut(), GetSurfaceArea(), Inside(), operator=(), and SurfaceNormal().
|
protected |
Definition at line 268 of file G4Tubs.hh.
Referenced by ApproxSurfaceNormal(), CreatePolyhedron(), DistanceToIn(), DistanceToIn(), DistanceToOut(), DistanceToOut(), G4Tubs(), GetCubicVolume(), GetPointOnSurface(), GetSurfaceArea(), Inside(), operator=(), StreamInfo(), and SurfaceNormal().
|
protected |
Radial and angular dimensions.
Definition at line 268 of file G4Tubs.hh.
Referenced by ApproxSurfaceNormal(), CreatePolyhedron(), DistanceToIn(), DistanceToIn(), DistanceToOut(), DistanceToOut(), G4Tubs(), GetCubicVolume(), GetPointOnSurface(), GetSurfaceArea(), Inside(), operator=(), StreamInfo(), and SurfaceNormal().
|
protected |
Definition at line 268 of file G4Tubs.hh.
Referenced by ApproxSurfaceNormal(), CreatePolyhedron(), DistanceToOut(), G4Tubs(), GetPointOnSurface(), Inside(), operator=(), StreamInfo(), and SurfaceNormal().
|
protected |
Definition at line 281 of file G4Tubs.hh.
Referenced by DistanceToOut(), G4Tubs(), Inside(), operator=(), and SurfaceNormal().
|
protected |
Cached half tolerance values.
Definition at line 281 of file G4Tubs.hh.
Referenced by DistanceToIn(), DistanceToOut(), G4Tubs(), Inside(), operator=(), and SurfaceNormal().
|
protected |
Definition at line 281 of file G4Tubs.hh.
Referenced by DistanceToIn(), G4Tubs(), Inside(), and operator=().
|
protected |
Definition at line 262 of file G4Tubs.hh.
Referenced by G4Tubs(), and operator=().
|
staticconstexprprotected |
Tolerance of unity for surface normal.
Definition at line 265 of file G4Tubs.hh.
Referenced by DistanceToOut().
|
protected |
Radial and angular tolerances.
Definition at line 262 of file G4Tubs.hh.
Referenced by DistanceToIn(), DistanceToOut(), G4Tubs(), and operator=().
|
protected |
Cached trigonometric values.
Definition at line 271 of file G4Tubs.hh.
Referenced by DistanceToIn(), DistanceToIn(), DistanceToOut(), DistanceToOut(), and operator=().
|
protected |
Definition at line 272 of file G4Tubs.hh.
Referenced by ApproxSurfaceNormal(), DistanceToIn(), DistanceToIn(), DistanceToOut(), DistanceToOut(), GetPointOnSurface(), operator=(), and SurfaceNormal().
|
protected |
Definition at line 272 of file G4Tubs.hh.
Referenced by ApproxSurfaceNormal(), DistanceToIn(), DistanceToIn(), DistanceToOut(), DistanceToOut(), GetPointOnSurface(), operator=(), and SurfaceNormal().