Geant4-11
Data Structures | Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes
G4TwistedTubs Class Reference

#include <G4TwistedTubs.hh>

Inheritance diagram for G4TwistedTubs:
G4VSolid

Data Structures

class  LastState
 
class  LastValue
 
class  LastValueWithDoubleVector
 
class  LastVector
 

Public Member Functions

void BoundingLimits (G4ThreeVector &pMin, G4ThreeVector &pMax) const
 
G4bool CalculateExtent (const EAxis pAxis, const G4VoxelLimits &pVoxelLimit, const G4AffineTransform &pTransform, G4double &pMin, G4double &pMax) const
 
G4VSolidClone () const
 
void ComputeDimensions (G4VPVParameterisation *, const G4int, const G4VPhysicalVolume *)
 
G4PolyhedronCreatePolyhedron () const
 
void DescribeYourselfTo (G4VGraphicsScene &scene) const
 
G4double DistanceToIn (const G4ThreeVector &p) const
 
G4double DistanceToIn (const G4ThreeVector &p, const G4ThreeVector &v) const
 
G4double DistanceToOut (const G4ThreeVector &p) const
 
G4double DistanceToOut (const G4ThreeVector &p, const G4ThreeVector &v, const G4bool calcnorm=false, G4bool *validnorm=nullptr, G4ThreeVector *n=nullptr) const
 
void DumpInfo () const
 
G4double EstimateCubicVolume (G4int nStat, G4double epsilon) const
 
G4double EstimateSurfaceArea (G4int nStat, G4double ell) const
 
 G4TwistedTubs (__void__ &)
 
 G4TwistedTubs (const G4String &pname, G4double twistedangle, G4double endinnerrad, G4double endouterrad, G4double halfzlen, G4double dphi)
 
 G4TwistedTubs (const G4String &pname, G4double twistedangle, G4double endinnerrad, G4double endouterrad, G4double halfzlen, G4int nseg, G4double totphi)
 
 G4TwistedTubs (const G4String &pname, G4double twistedangle, G4double innerrad, G4double outerrad, G4double negativeEndz, G4double positiveEndz, G4double dphi)
 
 G4TwistedTubs (const G4String &pname, G4double twistedangle, G4double innerrad, G4double outerrad, G4double negativeEndz, G4double positiveEndz, G4int nseg, G4double totphi)
 
 G4TwistedTubs (const G4TwistedTubs &rhs)
 
virtual G4VSolidGetConstituentSolid (G4int no)
 
virtual const G4VSolidGetConstituentSolid (G4int no) const
 
G4double GetCubicVolume ()
 
virtual G4DisplacedSolidGetDisplacedSolidPtr ()
 
virtual const G4DisplacedSolidGetDisplacedSolidPtr () const
 
G4double GetDPhi () const
 
G4double GetEndInnerRadius () const
 
G4double GetEndInnerRadius (G4int i) const
 
G4double GetEndOuterRadius () const
 
G4double GetEndOuterRadius (G4int i) const
 
G4double GetEndPhi (G4int i) const
 
G4double GetEndZ (G4int i) const
 
G4GeometryType GetEntityType () const
 
G4VisExtent GetExtent () const
 
G4double GetInnerRadius () const
 
G4double GetInnerStereo () const
 
G4double GetKappa () const
 
G4String GetName () const
 
G4double GetOuterRadius () const
 
G4double GetOuterStereo () const
 
G4double GetPhiTwist () const
 
G4ThreeVector GetPointOnSurface () const
 
G4PolyhedronGetPolyhedron () const
 
G4double GetSurfaceArea ()
 
G4double GetTanInnerStereo () const
 
G4double GetTanInnerStereo2 () const
 
G4double GetTanOuterStereo () const
 
G4double GetTanOuterStereo2 () const
 
G4double GetTolerance () const
 
G4double GetZHalfLength () const
 
EInside Inside (const G4ThreeVector &p) const
 
G4TwistedTubsoperator= (const G4TwistedTubs &rhs)
 
G4bool operator== (const G4VSolid &s) const
 
void SetName (const G4String &name)
 
std::ostream & StreamInfo (std::ostream &os) const
 
G4ThreeVector SurfaceNormal (const G4ThreeVector &p) const
 
virtual ~G4TwistedTubs ()
 

Protected Member Functions

void CalculateClippedPolygonExtent (G4ThreeVectorList &pPolygon, 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 ClipCrossSection (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 kCarTolerance
 

Private Member Functions

void ClipPolygonToSimpleLimits (G4ThreeVectorList &pPolygon, G4ThreeVectorList &outputPolygon, const G4VoxelLimits &pVoxelLimit) const
 
void CreateSurfaces ()
 
void SetFields (G4double phitwist, G4double innerrad, G4double outerrad, G4double negativeEndz, G4double positiveEndz)
 

Private Attributes

G4double fCubicVolume = 0.0
 
G4double fDPhi
 
G4double fEndInnerRadius [2]
 
G4double fEndOuterRadius [2]
 
G4double fEndPhi [2]
 
G4double fEndZ [2]
 
G4double fEndZ2 [2]
 
G4VTwistSurfacefFormerTwisted
 
G4VTwistSurfacefInnerHype
 
G4double fInnerRadius
 
G4double fInnerRadius2
 
G4double fInnerStereo
 
G4double fKappa
 
LastValue fLastDistanceToIn
 
LastValueWithDoubleVector fLastDistanceToInWithV
 
LastValue fLastDistanceToOut
 
LastValueWithDoubleVector fLastDistanceToOutWithV
 
LastState fLastInside
 
LastVector fLastNormal
 
G4VTwistSurfacefLatterTwisted
 
G4VTwistSurfacefLowerEndcap
 
G4VTwistSurfacefOuterHype
 
G4double fOuterRadius
 
G4double fOuterRadius2
 
G4double fOuterStereo
 
G4double fPhiTwist
 
G4PolyhedronfpPolyhedron = nullptr
 
G4bool fRebuildPolyhedron = false
 
G4String fshapeName
 
G4double fSurfaceArea = 0.0
 
G4double fTanInnerStereo
 
G4double fTanInnerStereo2
 
G4double fTanOuterStereo
 
G4double fTanOuterStereo2
 
G4VTwistSurfacefUpperEndcap
 
G4double fZHalfLength
 

Detailed Description

Definition at line 55 of file G4TwistedTubs.hh.

Constructor & Destructor Documentation

◆ G4TwistedTubs() [1/6]

G4TwistedTubs::G4TwistedTubs ( const G4String pname,
G4double  twistedangle,
G4double  endinnerrad,
G4double  endouterrad,
G4double  halfzlen,
G4double  dphi 
)

Definition at line 62 of file G4TwistedTubs.cc.

68 : G4VSolid(pname), fDPhi(dphi),
71{
72 if (endinnerrad < DBL_MIN)
73 {
74 G4Exception("G4TwistedTubs::G4TwistedTubs()", "GeomSolids0002",
75 FatalErrorInArgument, "Invalid end-inner-radius!");
76 }
77
78 G4double sinhalftwist = std::sin(0.5 * twistedangle);
79
80 G4double endinnerradX = endinnerrad * sinhalftwist;
81 G4double innerrad = std::sqrt( endinnerrad * endinnerrad
82 - endinnerradX * endinnerradX );
83
84 G4double endouterradX = endouterrad * sinhalftwist;
85 G4double outerrad = std::sqrt( endouterrad * endouterrad
86 - endouterradX * endouterradX );
87
88 // temporary treatment!!
89 SetFields(twistedangle, innerrad, outerrad, -halfzlen, halfzlen);
91}
@ FatalErrorInArgument
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
Definition: G4Exception.cc:35
double G4double
Definition: G4Types.hh:83
G4VTwistSurface * fLatterTwisted
void SetFields(G4double phitwist, G4double innerrad, G4double outerrad, G4double negativeEndz, G4double positiveEndz)
G4VTwistSurface * fFormerTwisted
G4VTwistSurface * fUpperEndcap
void CreateSurfaces()
G4VTwistSurface * fLowerEndcap
G4VTwistSurface * fInnerHype
G4VTwistSurface * fOuterHype
G4VSolid(const G4String &name)
Definition: G4VSolid.cc:57
string pname
Definition: eplot.py:33
#define DBL_MIN
Definition: templates.hh:54

References CreateSurfaces(), DBL_MIN, FatalErrorInArgument, G4Exception(), and SetFields().

Referenced by Clone().

◆ G4TwistedTubs() [2/6]

G4TwistedTubs::G4TwistedTubs ( const G4String pname,
G4double  twistedangle,
G4double  endinnerrad,
G4double  endouterrad,
G4double  halfzlen,
G4int  nseg,
G4double  totphi 
)

Definition at line 93 of file G4TwistedTubs.cc.

100 : G4VSolid(pname),
103{
104
105 if (!nseg)
106 {
107 std::ostringstream message;
108 message << "Invalid number of segments." << G4endl
109 << " nseg = " << nseg;
110 G4Exception("G4TwistedTubs::G4TwistedTubs()", "GeomSolids0002",
111 FatalErrorInArgument, message);
112 }
113 if (totphi == DBL_MIN || endinnerrad < DBL_MIN)
114 {
115 G4Exception("G4TwistedTubs::G4TwistedTubs()", "GeomSolids0002",
116 FatalErrorInArgument, "Invalid total-phi or end-inner-radius!");
117 }
118
119 G4double sinhalftwist = std::sin(0.5 * twistedangle);
120
121 G4double endinnerradX = endinnerrad * sinhalftwist;
122 G4double innerrad = std::sqrt( endinnerrad * endinnerrad
123 - endinnerradX * endinnerradX );
124
125 G4double endouterradX = endouterrad * sinhalftwist;
126 G4double outerrad = std::sqrt( endouterrad * endouterrad
127 - endouterradX * endouterradX );
128
129 // temporary treatment!!
130 fDPhi = totphi / nseg;
131 SetFields(twistedangle, innerrad, outerrad, -halfzlen, halfzlen);
133}
#define G4endl
Definition: G4ios.hh:57

References CreateSurfaces(), DBL_MIN, FatalErrorInArgument, fDPhi, G4endl, G4Exception(), and SetFields().

◆ G4TwistedTubs() [3/6]

G4TwistedTubs::G4TwistedTubs ( const G4String pname,
G4double  twistedangle,
G4double  innerrad,
G4double  outerrad,
G4double  negativeEndz,
G4double  positiveEndz,
G4double  dphi 
)

Definition at line 135 of file G4TwistedTubs.cc.

142 : G4VSolid(pname), fDPhi(dphi),
145{
146 if (innerrad < DBL_MIN)
147 {
148 G4Exception("G4TwistedTubs::G4TwistedTubs()", "GeomSolids0002",
149 FatalErrorInArgument, "Invalid end-inner-radius!");
150 }
151
152 SetFields(twistedangle, innerrad, outerrad, negativeEndz, positiveEndz);
154}

References CreateSurfaces(), DBL_MIN, FatalErrorInArgument, G4Exception(), and SetFields().

◆ G4TwistedTubs() [4/6]

G4TwistedTubs::G4TwistedTubs ( const G4String pname,
G4double  twistedangle,
G4double  innerrad,
G4double  outerrad,
G4double  negativeEndz,
G4double  positiveEndz,
G4int  nseg,
G4double  totphi 
)

Definition at line 156 of file G4TwistedTubs.cc.

164 : G4VSolid(pname),
167{
168 if (!nseg)
169 {
170 std::ostringstream message;
171 message << "Invalid number of segments." << G4endl
172 << " nseg = " << nseg;
173 G4Exception("G4TwistedTubs::G4TwistedTubs()", "GeomSolids0002",
174 FatalErrorInArgument, message);
175 }
176 if (totphi == DBL_MIN || innerrad < DBL_MIN)
177 {
178 G4Exception("G4TwistedTubs::G4TwistedTubs()", "GeomSolids0002",
179 FatalErrorInArgument, "Invalid total-phi or end-inner-radius!");
180 }
181
182 fDPhi = totphi / nseg;
183 SetFields(twistedangle, innerrad, outerrad, negativeEndz, positiveEndz);
185}

References CreateSurfaces(), DBL_MIN, FatalErrorInArgument, fDPhi, G4endl, G4Exception(), and SetFields().

◆ ~G4TwistedTubs()

G4TwistedTubs::~G4TwistedTubs ( )
virtual

Definition at line 202 of file G4TwistedTubs.cc.

203{
204 if (fLowerEndcap) { delete fLowerEndcap; }
205 if (fUpperEndcap) { delete fUpperEndcap; }
206 if (fLatterTwisted) { delete fLatterTwisted; }
207 if (fFormerTwisted) { delete fFormerTwisted; }
208 if (fInnerHype) { delete fInnerHype; }
209 if (fOuterHype) { delete fOuterHype; }
210 if (fpPolyhedron) { delete fpPolyhedron; fpPolyhedron = nullptr; }
211}
G4Polyhedron * fpPolyhedron

References fFormerTwisted, fInnerHype, fLatterTwisted, fLowerEndcap, fOuterHype, fpPolyhedron, and fUpperEndcap.

◆ G4TwistedTubs() [5/6]

G4TwistedTubs::G4TwistedTubs ( __void__ &  a)

Definition at line 190 of file G4TwistedTubs.cc.

191 : G4VSolid(a), fPhiTwist(0.), fInnerRadius(0.), fOuterRadius(0.), fDPhi(0.),
196{
197}
G4double fPhiTwist
G4double fOuterRadius
G4double fTanInnerStereo2
G4double fOuterStereo
G4double fTanInnerStereo
G4double fTanOuterStereo
G4double fInnerStereo
G4double fTanOuterStereo2
G4double fInnerRadius2
G4double fInnerRadius
G4double fZHalfLength
G4double fOuterRadius2

◆ G4TwistedTubs() [6/6]

G4TwistedTubs::G4TwistedTubs ( const G4TwistedTubs rhs)

Definition at line 216 of file G4TwistedTubs.cc.

217 : G4VSolid(rhs), fPhiTwist(rhs.fPhiTwist),
226 fInnerHype(0), fOuterHype(0),
233{
234 for (auto i=0; i<2; ++i)
235 {
236 fEndZ[i] = rhs.fEndZ[i];
239 fEndPhi[i] = rhs.fEndPhi[i];
240 fEndZ2[i] = rhs.fEndZ2[i];
241 }
243}
G4double fEndZ2[2]
LastValue fLastDistanceToOut
G4double fSurfaceArea
LastValue fLastDistanceToIn
G4double fEndZ[2]
G4double fCubicVolume
G4double fEndInnerRadius[2]
LastValueWithDoubleVector fLastDistanceToOutWithV
LastVector fLastNormal
LastValueWithDoubleVector fLastDistanceToInWithV
LastState fLastInside
G4double fEndPhi[2]
G4double fEndOuterRadius[2]

References CreateSurfaces(), fEndInnerRadius, fEndOuterRadius, fEndPhi, fEndZ, and fEndZ2.

Member Function Documentation

◆ BoundingLimits()

void G4TwistedTubs::BoundingLimits ( G4ThreeVector pMin,
G4ThreeVector pMax 
) const
virtual

Reimplemented from G4VSolid.

Definition at line 309 of file G4TwistedTubs.cc.

311{
312 // Find bounding tube
313 G4double rmin = GetInnerRadius();
315
316 G4double zmin = std::min(GetEndZ(0), GetEndZ(1));
317 G4double zmax = std::max(GetEndZ(0), GetEndZ(1));
318
319 G4double dphi = 0.5*GetDPhi();
320 G4double sphi = std::min(GetEndPhi(0), GetEndPhi(1)) - dphi;
321 G4double ephi = std::max(GetEndPhi(0), GetEndPhi(1)) + dphi;
322 G4double totalphi = ephi - sphi;
323
324 // Find bounding box
325 if (dphi <= 0 || totalphi >= CLHEP::twopi)
326 {
327 pMin.set(-rmax,-rmax, zmin);
328 pMax.set( rmax, rmax, zmax);
329 }
330 else
331 {
332 G4TwoVector vmin,vmax;
333 G4GeomTools::DiskExtent(rmin, rmax, sphi, totalphi, vmin, vmax);
334 pMin.set(vmin.x(), vmin.y(), zmin);
335 pMax.set(vmax.x(), vmax.y(), zmax);
336 }
337
338 // Check correctness of the bounding box
339 //
340 if (pMin.x() >= pMax.x() || pMin.y() >= pMax.y() || pMin.z() >= pMax.z())
341 {
342 std::ostringstream message;
343 message << "Bad bounding box (min >= max) for solid: "
344 << GetName() << " !"
345 << "\npMin = " << pMin
346 << "\npMax = " << pMax;
347 G4Exception("G4TwistedTubs::BoundingLimits()", "GeomMgt0001",
348 JustWarning, message);
349 DumpInfo();
350 }
351}
@ JustWarning
static const G4double pMax
static const G4double pMin
double x() const
double y() const
static G4bool DiskExtent(G4double rmin, G4double rmax, G4double startPhi, G4double delPhi, G4TwoVector &pmin, G4TwoVector &pmax)
Definition: G4GeomTools.cc:390
G4double GetEndOuterRadius() const
G4double GetEndPhi(G4int i) const
G4double GetEndZ(G4int i) const
G4double GetInnerRadius() const
G4double GetDPhi() const
G4String GetName() const
void DumpInfo() const
static constexpr double twopi
Definition: SystemOfUnits.h:56
T max(const T t1, const T t2)
brief Return the largest of the two arguments
T min(const T t1, const T t2)
brief Return the smallest of the two arguments

References G4GeomTools::DiskExtent(), G4VSolid::DumpInfo(), G4Exception(), GetDPhi(), GetEndOuterRadius(), GetEndPhi(), GetEndZ(), GetInnerRadius(), G4VSolid::GetName(), JustWarning, G4INCL::Math::max(), G4INCL::Math::min(), pMax, pMin, CLHEP::twopi, CLHEP::Hep2Vector::x(), and CLHEP::Hep2Vector::y().

Referenced by CalculateExtent(), and GetExtent().

◆ CalculateClippedPolygonExtent()

void G4VSolid::CalculateClippedPolygonExtent ( G4ThreeVectorList pPolygon,
const G4VoxelLimits pVoxelLimit,
const EAxis  pAxis,
G4double pMin,
G4double pMax 
) const
protectedinherited

Definition at line 489 of file G4VSolid.cc.

494{
495 G4int noLeft,i;
496 G4double component;
497
498 ClipPolygon(pPolygon,pVoxelLimit,pAxis);
499 noLeft = pPolygon.size();
500
501 if ( noLeft )
502 {
503 for (i=0; i<noLeft; ++i)
504 {
505 component = pPolygon[i].operator()(pAxis);
506
507 if (component < pMin)
508 {
509 pMin = component;
510 }
511 if (component > pMax)
512 {
513 pMax = component;
514 }
515 }
516 }
517}
int G4int
Definition: G4Types.hh:85
void ClipPolygon(G4ThreeVectorList &pPolygon, const G4VoxelLimits &pVoxelLimit, const EAxis pAxis) const
Definition: G4VSolid.cc:539

References G4VSolid::ClipPolygon(), pMax, and pMin.

Referenced by G4VSolid::ClipBetweenSections(), and G4VSolid::ClipCrossSection().

◆ CalculateExtent()

G4bool G4TwistedTubs::CalculateExtent ( const EAxis  pAxis,
const G4VoxelLimits pVoxelLimit,
const G4AffineTransform pTransform,
G4double pMin,
G4double pMax 
) const
virtual

Implements G4VSolid.

Definition at line 357 of file G4TwistedTubs.cc.

361{
362 G4ThreeVector bmin, bmax;
363
364 // Get bounding box
365 BoundingLimits(bmin,bmax);
366
367 // Find extent
368 G4BoundingEnvelope bbox(bmin,bmax);
369 return bbox.CalculateExtent(pAxis,pVoxelLimit,pTransform,pMin,pMax);
370}
void BoundingLimits(G4ThreeVector &pMin, G4ThreeVector &pMax) const

References BoundingLimits(), G4BoundingEnvelope::CalculateExtent(), pMax, and pMin.

◆ ClipBetweenSections()

void G4VSolid::ClipBetweenSections ( G4ThreeVectorList pVertices,
const G4int  pSectionIndex,
const G4VoxelLimits pVoxelLimit,
const EAxis  pAxis,
G4double pMin,
G4double pMax 
) const
protectedinherited

Definition at line 444 of file G4VSolid.cc.

449{
450 G4ThreeVectorList polygon;
451 polygon.reserve(4);
452 polygon.push_back((*pVertices)[pSectionIndex]);
453 polygon.push_back((*pVertices)[pSectionIndex+4]);
454 polygon.push_back((*pVertices)[pSectionIndex+5]);
455 polygon.push_back((*pVertices)[pSectionIndex+1]);
456 CalculateClippedPolygonExtent(polygon,pVoxelLimit,pAxis,pMin,pMax);
457 polygon.clear();
458
459 polygon.push_back((*pVertices)[pSectionIndex+1]);
460 polygon.push_back((*pVertices)[pSectionIndex+5]);
461 polygon.push_back((*pVertices)[pSectionIndex+6]);
462 polygon.push_back((*pVertices)[pSectionIndex+2]);
463 CalculateClippedPolygonExtent(polygon,pVoxelLimit,pAxis,pMin,pMax);
464 polygon.clear();
465
466 polygon.push_back((*pVertices)[pSectionIndex+2]);
467 polygon.push_back((*pVertices)[pSectionIndex+6]);
468 polygon.push_back((*pVertices)[pSectionIndex+7]);
469 polygon.push_back((*pVertices)[pSectionIndex+3]);
470 CalculateClippedPolygonExtent(polygon,pVoxelLimit,pAxis,pMin,pMax);
471 polygon.clear();
472
473 polygon.push_back((*pVertices)[pSectionIndex+3]);
474 polygon.push_back((*pVertices)[pSectionIndex+7]);
475 polygon.push_back((*pVertices)[pSectionIndex+4]);
476 polygon.push_back((*pVertices)[pSectionIndex]);
477 CalculateClippedPolygonExtent(polygon,pVoxelLimit,pAxis,pMin,pMax);
478 return;
479}
std::vector< G4ThreeVector > G4ThreeVectorList
void CalculateClippedPolygonExtent(G4ThreeVectorList &pPolygon, const G4VoxelLimits &pVoxelLimit, const EAxis pAxis, G4double &pMin, G4double &pMax) const
Definition: G4VSolid.cc:489

References G4VSolid::CalculateClippedPolygonExtent(), pMax, and pMin.

◆ ClipCrossSection()

void G4VSolid::ClipCrossSection ( G4ThreeVectorList pVertices,
const G4int  pSectionIndex,
const G4VoxelLimits pVoxelLimit,
const EAxis  pAxis,
G4double pMin,
G4double pMax 
) const
protectedinherited

Definition at line 414 of file G4VSolid.cc.

419{
420
421 G4ThreeVectorList polygon;
422 polygon.reserve(4);
423 polygon.push_back((*pVertices)[pSectionIndex]);
424 polygon.push_back((*pVertices)[pSectionIndex+1]);
425 polygon.push_back((*pVertices)[pSectionIndex+2]);
426 polygon.push_back((*pVertices)[pSectionIndex+3]);
427 CalculateClippedPolygonExtent(polygon,pVoxelLimit,pAxis,pMin,pMax);
428 return;
429}

References G4VSolid::CalculateClippedPolygonExtent(), pMax, and pMin.

◆ ClipPolygon()

void G4VSolid::ClipPolygon ( G4ThreeVectorList pPolygon,
const G4VoxelLimits pVoxelLimit,
const EAxis  pAxis 
) const
protectedinherited

Definition at line 539 of file G4VSolid.cc.

542{
543 G4ThreeVectorList outputPolygon;
544
545 if ( pVoxelLimit.IsLimited() )
546 {
547 if (pVoxelLimit.IsXLimited() ) // && pAxis != kXAxis)
548 {
549 G4VoxelLimits simpleLimit1;
550 simpleLimit1.AddLimit(kXAxis,pVoxelLimit.GetMinXExtent(),kInfinity);
551 ClipPolygonToSimpleLimits(pPolygon,outputPolygon,simpleLimit1);
552
553 pPolygon.clear();
554
555 if ( !outputPolygon.size() ) return;
556
557 G4VoxelLimits simpleLimit2;
558 simpleLimit2.AddLimit(kXAxis,-kInfinity,pVoxelLimit.GetMaxXExtent());
559 ClipPolygonToSimpleLimits(outputPolygon,pPolygon,simpleLimit2);
560
561 if ( !pPolygon.size() ) return;
562 else outputPolygon.clear();
563 }
564 if ( pVoxelLimit.IsYLimited() ) // && pAxis != kYAxis)
565 {
566 G4VoxelLimits simpleLimit1;
567 simpleLimit1.AddLimit(kYAxis,pVoxelLimit.GetMinYExtent(),kInfinity);
568 ClipPolygonToSimpleLimits(pPolygon,outputPolygon,simpleLimit1);
569
570 // Must always clear pPolygon - for clip to simpleLimit2 and in case of
571 // early exit
572
573 pPolygon.clear();
574
575 if ( !outputPolygon.size() ) return;
576
577 G4VoxelLimits simpleLimit2;
578 simpleLimit2.AddLimit(kYAxis,-kInfinity,pVoxelLimit.GetMaxYExtent());
579 ClipPolygonToSimpleLimits(outputPolygon,pPolygon,simpleLimit2);
580
581 if ( !pPolygon.size() ) return;
582 else outputPolygon.clear();
583 }
584 if ( pVoxelLimit.IsZLimited() ) // && pAxis != kZAxis)
585 {
586 G4VoxelLimits simpleLimit1;
587 simpleLimit1.AddLimit(kZAxis,pVoxelLimit.GetMinZExtent(),kInfinity);
588 ClipPolygonToSimpleLimits(pPolygon,outputPolygon,simpleLimit1);
589
590 // Must always clear pPolygon - for clip to simpleLimit2 and in case of
591 // early exit
592
593 pPolygon.clear();
594
595 if ( !outputPolygon.size() ) return;
596
597 G4VoxelLimits simpleLimit2;
598 simpleLimit2.AddLimit(kZAxis,-kInfinity,pVoxelLimit.GetMaxZExtent());
599 ClipPolygonToSimpleLimits(outputPolygon,pPolygon,simpleLimit2);
600
601 // Return after final clip - no cleanup
602 }
603 }
604}
void ClipPolygonToSimpleLimits(G4ThreeVectorList &pPolygon, G4ThreeVectorList &outputPolygon, const G4VoxelLimits &pVoxelLimit) const
Definition: G4VSolid.cc:612
G4bool IsYLimited() const
G4double GetMinZExtent() const
void AddLimit(const EAxis pAxis, const G4double pMin, const G4double pMax)
G4bool IsXLimited() const
G4double GetMaxYExtent() const
G4double GetMaxZExtent() const
G4double GetMinYExtent() const
G4double GetMinXExtent() const
G4bool IsZLimited() const
G4bool IsLimited() const
G4double GetMaxXExtent() const
@ kYAxis
Definition: geomdefs.hh:56
@ kXAxis
Definition: geomdefs.hh:55
@ kZAxis
Definition: geomdefs.hh:57
static const G4double kInfinity
Definition: geomdefs.hh:41

References G4VoxelLimits::AddLimit(), G4VSolid::ClipPolygonToSimpleLimits(), G4VoxelLimits::GetMaxXExtent(), G4VoxelLimits::GetMaxYExtent(), G4VoxelLimits::GetMaxZExtent(), G4VoxelLimits::GetMinXExtent(), G4VoxelLimits::GetMinYExtent(), G4VoxelLimits::GetMinZExtent(), G4VoxelLimits::IsLimited(), G4VoxelLimits::IsXLimited(), G4VoxelLimits::IsYLimited(), G4VoxelLimits::IsZLimited(), kInfinity, kXAxis, kYAxis, and kZAxis.

Referenced by G4VSolid::CalculateClippedPolygonExtent().

◆ ClipPolygonToSimpleLimits()

void G4VSolid::ClipPolygonToSimpleLimits ( G4ThreeVectorList pPolygon,
G4ThreeVectorList outputPolygon,
const G4VoxelLimits pVoxelLimit 
) const
privateinherited

Definition at line 612 of file G4VSolid.cc.

615{
616 G4int i;
617 G4int noVertices=pPolygon.size();
618 G4ThreeVector vEnd,vStart;
619
620 for (i = 0 ; i < noVertices ; ++i )
621 {
622 vStart = pPolygon[i];
623 if ( i == noVertices-1 ) vEnd = pPolygon[0];
624 else vEnd = pPolygon[i+1];
625
626 if ( pVoxelLimit.Inside(vStart) )
627 {
628 if (pVoxelLimit.Inside(vEnd))
629 {
630 // vStart and vEnd inside -> output end point
631 //
632 outputPolygon.push_back(vEnd);
633 }
634 else
635 {
636 // vStart inside, vEnd outside -> output crossing point
637 //
638 pVoxelLimit.ClipToLimits(vStart,vEnd);
639 outputPolygon.push_back(vEnd);
640 }
641 }
642 else
643 {
644 if (pVoxelLimit.Inside(vEnd))
645 {
646 // vStart outside, vEnd inside -> output inside section
647 //
648 pVoxelLimit.ClipToLimits(vStart,vEnd);
649 outputPolygon.push_back(vStart);
650 outputPolygon.push_back(vEnd);
651 }
652 else // Both point outside -> no output
653 {
654 // outputPolygon.push_back(vStart);
655 // outputPolygon.push_back(vEnd);
656 }
657 }
658 }
659}
G4bool ClipToLimits(G4ThreeVector &pStart, G4ThreeVector &pEnd) const
G4bool Inside(const G4ThreeVector &pVec) const

References G4VoxelLimits::ClipToLimits(), and G4VoxelLimits::Inside().

Referenced by G4VSolid::ClipPolygon().

◆ Clone()

G4VSolid * G4TwistedTubs::Clone ( ) const
virtual

Reimplemented from G4VSolid.

Definition at line 1023 of file G4TwistedTubs.cc.

1024{
1025 return new G4TwistedTubs(*this);
1026}
G4TwistedTubs(const G4String &pname, G4double twistedangle, G4double endinnerrad, G4double endouterrad, G4double halfzlen, G4double dphi)

References G4TwistedTubs().

◆ ComputeDimensions()

void G4TwistedTubs::ComputeDimensions ( G4VPVParameterisation ,
const  G4int,
const G4VPhysicalVolume  
)
virtual

Reimplemented from G4VSolid.

Definition at line 297 of file G4TwistedTubs.cc.

300{
301 G4Exception("G4TwistedTubs::ComputeDimensions()",
302 "GeomSolids0001", FatalException,
303 "G4TwistedTubs does not support Parameterisation.");
304}
@ FatalException

References FatalException, and G4Exception().

◆ CreatePolyhedron()

G4Polyhedron * G4TwistedTubs::CreatePolyhedron ( ) const
virtual

Reimplemented from G4VSolid.

Definition at line 898 of file G4TwistedTubs.cc.

899{
900 // number of meshes
901 //
902 G4double absPhiTwist = std::abs(fPhiTwist);
903 G4double dA = std::max(fDPhi,absPhiTwist);
904 const G4int k =
906 const G4int n =
908
909 const G4int nnodes = 4*(k-1)*(n-2) + 2*k*k ;
910 const G4int nfaces = 4*(k-1)*(n-1) + 2*(k-1)*(k-1) ;
911
912 G4Polyhedron* ph = new G4Polyhedron;
913 typedef G4double G4double3[3];
914 typedef G4int G4int4[4];
915 G4double3* xyz = new G4double3[nnodes]; // number of nodes
916 G4int4* faces = new G4int4[nfaces] ; // number of faces
917 fLowerEndcap->GetFacets(k,k,xyz,faces,0) ;
918 fUpperEndcap->GetFacets(k,k,xyz,faces,1) ;
919 fInnerHype->GetFacets(k,n,xyz,faces,2) ;
920 fFormerTwisted->GetFacets(k,n,xyz,faces,3) ;
921 fOuterHype->GetFacets(k,n,xyz,faces,4) ;
922 fLatterTwisted->GetFacets(k,n,xyz,faces,5) ;
923
924 ph->createPolyhedron(nnodes,nfaces,xyz,faces);
925
926 delete[] xyz;
927 delete[] faces;
928
929 return ph;
930}
static constexpr double twopi
Definition: G4SIunits.hh:56
virtual void GetFacets(G4int m, G4int n, G4double xyz[][3], G4int faces[][4], G4int iside)=0
static G4int GetNumberOfRotationSteps()
G4int createPolyhedron(G4int Nnodes, G4int Nfaces, const G4double xyz[][3], const G4int faces[][4])

References HepPolyhedron::createPolyhedron(), fDPhi, fFormerTwisted, fInnerHype, fLatterTwisted, fLowerEndcap, fOuterHype, fPhiTwist, fUpperEndcap, G4VTwistSurface::GetFacets(), HepPolyhedron::GetNumberOfRotationSteps(), G4INCL::Math::max(), CLHEP::detail::n, and twopi.

Referenced by GetPolyhedron().

◆ CreateSurfaces()

void G4TwistedTubs::CreateSurfaces ( )
private

Definition at line 954 of file G4TwistedTubs.cc.

955{
956 // create 6 surfaces of TwistedTub
957
958 G4ThreeVector x0(0, 0, fEndZ[0]);
959 G4ThreeVector n (0, 0, -1);
960
961 fLowerEndcap = new G4TwistTubsFlatSide("LowerEndcap",
963 fDPhi, fEndPhi, fEndZ, -1) ;
964
965 fUpperEndcap = new G4TwistTubsFlatSide("UpperEndcap",
967 fDPhi, fEndPhi, fEndZ, 1) ;
968
969 G4RotationMatrix rotHalfDPhi;
970 rotHalfDPhi.rotateZ(0.5*fDPhi);
971
972 fLatterTwisted = new G4TwistTubsSide("LatterTwisted",
976 1 ) ;
977 fFormerTwisted = new G4TwistTubsSide("FormerTwisted",
981 -1 ) ;
982
983 fInnerHype = new G4TwistTubsHypeSide("InnerHype",
988 fOuterHype = new G4TwistTubsHypeSide("OuterHype",
993
994
995 // set neighbour surfaces
996 //
1009}
HepRotation & rotateZ(double delta)
Definition: Rotation.cc:87
void SetNeighbours(G4VTwistSurface *ax0min, G4VTwistSurface *ax1min, G4VTwistSurface *ax0max, G4VTwistSurface *ax1max)

References fDPhi, fEndInnerRadius, fEndOuterRadius, fEndPhi, fEndZ, fFormerTwisted, fInnerHype, fInnerRadius, fKappa, fLatterTwisted, fLowerEndcap, fOuterHype, fOuterRadius, fTanInnerStereo, fTanOuterStereo, fUpperEndcap, CLHEP::detail::n, CLHEP::HepRotation::rotateZ(), and G4VTwistSurface::SetNeighbours().

Referenced by G4TwistedTubs(), and operator=().

◆ DescribeYourselfTo()

void G4TwistedTubs::DescribeYourselfTo ( G4VGraphicsScene scene) const
virtual

Implements G4VSolid.

Definition at line 876 of file G4TwistedTubs.cc.

877{
878 scene.AddSolid (*this);
879}
virtual void AddSolid(const G4Box &)=0

References G4VGraphicsScene::AddSolid().

◆ DistanceToIn() [1/2]

G4double G4TwistedTubs::DistanceToIn ( const G4ThreeVector p) const
virtual

Implements G4VSolid.

Definition at line 572 of file G4TwistedTubs.cc.

573{
574 // DistanceToIn(p):
575 // Calculate distance to surface of shape from `outside',
576 // allowing for tolerance
577
578 //
579 // checking last value
580 //
581
582 G4ThreeVector* tmpp;
583 G4double* tmpdist;
584 if (fLastDistanceToIn.p == p)
585 {
587 }
588 else
589 {
590 tmpp = const_cast<G4ThreeVector*>(&(fLastDistanceToIn.p));
591 tmpdist = const_cast<G4double*>(&(fLastDistanceToIn.value));
592 tmpp->set(p.x(), p.y(), p.z());
593 }
594
595 //
596 // Calculate DistanceToIn(p)
597 //
598
599 EInside currentside = Inside(p);
600
601 switch (currentside)
602 {
603 case (kInside) :
604 {}
605 case (kSurface) :
606 {
607 *tmpdist = 0.;
609 }
610 case (kOutside) :
611 {
612 // Initialize
613 G4double distance = kInfinity;
614
615 // find intersections and choose nearest one.
616 G4VTwistSurface *surfaces[6];
617 surfaces[0] = fLowerEndcap;
618 surfaces[1] = fUpperEndcap;
619 surfaces[2] = fLatterTwisted;
620 surfaces[3] = fFormerTwisted;
621 surfaces[4] = fInnerHype;
622 surfaces[5] = fOuterHype;
623
624 G4ThreeVector xx;
625 G4ThreeVector bestxx;
626 for (auto i=0; i<6; ++i)
627 {
628 G4double tmpdistance = surfaces[i]->DistanceTo(p, xx);
629 if (tmpdistance < distance)
630 {
631 distance = tmpdistance;
632 bestxx = xx;
633 }
634 }
635 *tmpdist = distance;
637 }
638 default :
639 {
640 G4Exception("G4TwistedTubs::DistanceToIn(p)", "GeomSolids0003",
641 FatalException, "Unknown point location!");
642 }
643 } // switch end
644
645 return kInfinity;
646}
double z() const
double x() const
double y() const
void set(double x, double y, double z)
EInside Inside(const G4ThreeVector &p) const
virtual G4double DistanceTo(const G4ThreeVector &gp, G4ThreeVector &gxx)
EInside
Definition: geomdefs.hh:67
@ kInside
Definition: geomdefs.hh:70
@ kOutside
Definition: geomdefs.hh:68
@ kSurface
Definition: geomdefs.hh:69

References G4VTwistSurface::DistanceTo(), FatalException, fFormerTwisted, fInnerHype, fLastDistanceToIn, fLatterTwisted, fLowerEndcap, fOuterHype, fUpperEndcap, G4Exception(), Inside(), kInfinity, kInside, kOutside, kSurface, G4TwistedTubs::LastValue::p, CLHEP::Hep3Vector::set(), G4TwistedTubs::LastValue::value, CLHEP::Hep3Vector::x(), CLHEP::Hep3Vector::y(), and CLHEP::Hep3Vector::z().

◆ DistanceToIn() [2/2]

G4double G4TwistedTubs::DistanceToIn ( const G4ThreeVector p,
const G4ThreeVector v 
) const
virtual

Implements G4VSolid.

Definition at line 482 of file G4TwistedTubs.cc.

484{
485
486 // DistanceToIn (p, v):
487 // Calculate distance to surface of shape from `outside'
488 // along with the v, allowing for tolerance.
489 // The function returns kInfinity if no intersection or
490 // just grazing within tolerance.
491
492 //
493 // checking last value
494 //
495
496 G4ThreeVector* tmpp;
497 G4ThreeVector* tmpv;
498 G4double* tmpdist;
500 {
502 }
503 else
504 {
505 tmpp = const_cast<G4ThreeVector*>(&(fLastDistanceToInWithV.p));
506 tmpv = const_cast<G4ThreeVector*>(&(fLastDistanceToInWithV.vec));
507 tmpdist = const_cast<G4double*>(&(fLastDistanceToInWithV.value));
508 tmpp->set(p.x(), p.y(), p.z());
509 tmpv->set(v.x(), v.y(), v.z());
510 }
511
512 //
513 // Calculate DistanceToIn(p,v)
514 //
515
516 EInside currentside = Inside(p);
517
518 if (currentside == kInside)
519 {
520 }
521 else
522 {
523 if (currentside == kSurface)
524 {
525 // particle is just on a boundary.
526 // If the particle is entering to the volume, return 0.
527 //
529 if (normal*v < 0)
530 {
531 *tmpdist = 0.;
533 }
534 }
535 }
536
537 // now, we can take smallest positive distance.
538
539 // Initialize
540 //
541 G4double distance = kInfinity;
542
543 // find intersections and choose nearest one.
544 //
545 G4VTwistSurface* surfaces[6];
546 surfaces[0] = fLowerEndcap;
547 surfaces[1] = fUpperEndcap;
548 surfaces[2] = fLatterTwisted;
549 surfaces[3] = fFormerTwisted;
550 surfaces[4] = fInnerHype;
551 surfaces[5] = fOuterHype;
552
553 G4ThreeVector xx;
554 G4ThreeVector bestxx;
555 for (auto i=0; i<6; ++i)
556 {
557 G4double tmpdistance = surfaces[i]->DistanceToIn(p, v, xx);
558 if (tmpdistance < distance)
559 {
560 distance = tmpdistance;
561 bestxx = xx;
562 }
563 }
564 *tmpdist = distance;
565
567}
G4ThreeVector SurfaceNormal(const G4ThreeVector &p) const
virtual G4double DistanceToIn(const G4ThreeVector &gp, const G4ThreeVector &gv, G4ThreeVector &gxxbest)
static double normal(HepRandomEngine *eptr)
Definition: RandPoisson.cc:79

References G4VTwistSurface::DistanceToIn(), fFormerTwisted, fInnerHype, fLastDistanceToIn, fLastDistanceToInWithV, fLatterTwisted, fLowerEndcap, fOuterHype, fUpperEndcap, Inside(), kInfinity, kInside, kSurface, CLHEP::normal(), G4TwistedTubs::LastValueWithDoubleVector::p, CLHEP::Hep3Vector::set(), SurfaceNormal(), G4TwistedTubs::LastValue::value, G4TwistedTubs::LastValueWithDoubleVector::value, G4TwistedTubs::LastValueWithDoubleVector::vec, CLHEP::Hep3Vector::x(), CLHEP::Hep3Vector::y(), and CLHEP::Hep3Vector::z().

◆ DistanceToOut() [1/2]

G4double G4TwistedTubs::DistanceToOut ( const G4ThreeVector p) const
virtual

Implements G4VSolid.

Definition at line 762 of file G4TwistedTubs.cc.

763{
764 // DistanceToOut(p):
765 // Calculate distance to surface of shape from `inside',
766 // allowing for tolerance
767
768 //
769 // checking last value
770 //
771
772 G4ThreeVector* tmpp;
773 G4double* tmpdist;
774 if (fLastDistanceToOut.p == p)
775 {
777 }
778 else
779 {
780 tmpp = const_cast<G4ThreeVector*>(&(fLastDistanceToOut.p));
781 tmpdist = const_cast<G4double*>(&(fLastDistanceToOut.value));
782 tmpp->set(p.x(), p.y(), p.z());
783 }
784
785 //
786 // Calculate DistanceToOut(p)
787 //
788
789 EInside currentside = Inside(p);
790
791 switch (currentside)
792 {
793 case (kOutside) :
794 {
795 }
796 case (kSurface) :
797 {
798 *tmpdist = 0.;
800 }
801 case (kInside) :
802 {
803 // Initialize
804 G4double distance = kInfinity;
805
806 // find intersections and choose nearest one.
807 G4VTwistSurface* surfaces[6];
808 surfaces[0] = fLatterTwisted;
809 surfaces[1] = fFormerTwisted;
810 surfaces[2] = fInnerHype;
811 surfaces[3] = fOuterHype;
812 surfaces[4] = fLowerEndcap;
813 surfaces[5] = fUpperEndcap;
814
815 G4ThreeVector xx;
816 G4ThreeVector bestxx;
817 for (auto i=0; i<6; ++i)
818 {
819 G4double tmpdistance = surfaces[i]->DistanceTo(p, xx);
820 if (tmpdistance < distance)
821 {
822 distance = tmpdistance;
823 bestxx = xx;
824 }
825 }
826 *tmpdist = distance;
827
829 }
830 default :
831 {
832 G4Exception("G4TwistedTubs::DistanceToOut(p)", "GeomSolids0003",
833 FatalException, "Unknown point location!");
834 }
835 } // switch end
836
837 return 0.;
838}

References G4VTwistSurface::DistanceTo(), FatalException, fFormerTwisted, fInnerHype, fLastDistanceToOut, fLatterTwisted, fLowerEndcap, fOuterHype, fUpperEndcap, G4Exception(), Inside(), kInfinity, kInside, kOutside, kSurface, G4TwistedTubs::LastValue::p, CLHEP::Hep3Vector::set(), G4TwistedTubs::LastValue::value, CLHEP::Hep3Vector::x(), CLHEP::Hep3Vector::y(), and CLHEP::Hep3Vector::z().

◆ DistanceToOut() [2/2]

G4double G4TwistedTubs::DistanceToOut ( const G4ThreeVector p,
const G4ThreeVector v,
const G4bool  calcnorm = false,
G4bool validnorm = nullptr,
G4ThreeVector n = nullptr 
) const
virtual

Implements G4VSolid.

Definition at line 651 of file G4TwistedTubs.cc.

656{
657 // DistanceToOut (p, v):
658 // Calculate distance to surface of shape from `inside'
659 // along with the v, allowing for tolerance.
660 // The function returns kInfinity if no intersection or
661 // just grazing within tolerance.
662
663 //
664 // checking last value
665 //
666
667 G4ThreeVector* tmpp;
668 G4ThreeVector* tmpv;
669 G4double* tmpdist;
671 {
673 }
674 else
675 {
676 tmpp = const_cast<G4ThreeVector*>(&(fLastDistanceToOutWithV.p));
677 tmpv = const_cast<G4ThreeVector*>(&(fLastDistanceToOutWithV.vec));
678 tmpdist = const_cast<G4double*>(&(fLastDistanceToOutWithV.value));
679 tmpp->set(p.x(), p.y(), p.z());
680 tmpv->set(v.x(), v.y(), v.z());
681 }
682
683 //
684 // Calculate DistanceToOut(p,v)
685 //
686
687 EInside currentside = Inside(p);
688
689 if (currentside == kOutside)
690 {
691 }
692 else
693 {
694 if (currentside == kSurface)
695 {
696 // particle is just on a boundary.
697 // If the particle is exiting from the volume, return 0.
698 //
700 G4VTwistSurface *blockedsurface = fLastNormal.surface[0];
701 if (normal*v > 0)
702 {
703 if (calcNorm)
704 {
705 *norm = (blockedsurface->GetNormal(p, true));
706 *validNorm = blockedsurface->IsValidNorm();
707 }
708 *tmpdist = 0.;
710 }
711 }
712 }
713
714 // now, we can take smallest positive distance.
715
716 // Initialize
717 //
718 G4double distance = kInfinity;
719
720 // find intersections and choose nearest one.
721 //
722 G4VTwistSurface* surfaces[6];
723 surfaces[0] = fLatterTwisted;
724 surfaces[1] = fFormerTwisted;
725 surfaces[2] = fInnerHype;
726 surfaces[3] = fOuterHype;
727 surfaces[4] = fLowerEndcap;
728 surfaces[5] = fUpperEndcap;
729
730 G4int besti = -1;
731 G4ThreeVector xx;
732 G4ThreeVector bestxx;
733 for (auto i=0; i<6; ++i)
734 {
735 G4double tmpdistance = surfaces[i]->DistanceToOut(p, v, xx);
736 if (tmpdistance < distance)
737 {
738 distance = tmpdistance;
739 bestxx = xx;
740 besti = i;
741 }
742 }
743
744 if (calcNorm)
745 {
746 if (besti != -1)
747 {
748 *norm = (surfaces[besti]->GetNormal(p, true));
749 *validNorm = surfaces[besti]->IsValidNorm();
750 }
751 }
752
753 *tmpdist = distance;
754
756}
G4VTwistSurface ** surface
G4bool IsValidNorm() const
virtual G4double DistanceToOut(const G4ThreeVector &gp, const G4ThreeVector &gv, G4ThreeVector &gxxbest)
virtual G4ThreeVector GetNormal(const G4ThreeVector &xx, G4bool isGlobal)=0

References G4VTwistSurface::DistanceToOut(), fFormerTwisted, fInnerHype, fLastDistanceToOutWithV, fLastNormal, fLatterTwisted, fLowerEndcap, fOuterHype, fUpperEndcap, G4VTwistSurface::GetNormal(), Inside(), G4VTwistSurface::IsValidNorm(), kInfinity, kOutside, kSurface, CLHEP::normal(), G4TwistedTubs::LastValueWithDoubleVector::p, CLHEP::Hep3Vector::set(), G4TwistedTubs::LastVector::surface, SurfaceNormal(), G4TwistedTubs::LastValueWithDoubleVector::value, G4TwistedTubs::LastValueWithDoubleVector::vec, CLHEP::Hep3Vector::x(), CLHEP::Hep3Vector::y(), and CLHEP::Hep3Vector::z().

◆ DumpInfo()

void G4VSolid::DumpInfo ( ) const
inlineinherited

Referenced by G4Cons::ApproxSurfaceNormal(), G4CutTubs::ApproxSurfaceNormal(), G4Sphere::ApproxSurfaceNormal(), G4Torus::ApproxSurfaceNormal(), G4Tubs::ApproxSurfaceNormal(), G4ReflectedSolid::BoundingLimits(), G4DisplacedSolid::BoundingLimits(), G4IntersectionSolid::BoundingLimits(), G4ScaledSolid::BoundingLimits(), G4SubtractionSolid::BoundingLimits(), G4UnionSolid::BoundingLimits(), G4Box::BoundingLimits(), G4Cons::BoundingLimits(), G4CutTubs::BoundingLimits(), G4Orb::BoundingLimits(), G4Para::BoundingLimits(), G4Sphere::BoundingLimits(), G4Torus::BoundingLimits(), G4Trap::BoundingLimits(), G4Trd::BoundingLimits(), G4Tubs::BoundingLimits(), G4EllipticalCone::BoundingLimits(), G4ExtrudedSolid::BoundingLimits(), G4GenericPolycone::BoundingLimits(), G4GenericTrap::BoundingLimits(), G4Hype::BoundingLimits(), G4Paraboloid::BoundingLimits(), G4Polycone::BoundingLimits(), G4Polyhedra::BoundingLimits(), G4TessellatedSolid::BoundingLimits(), BoundingLimits(), G4ParameterisationBoxX::ComputeDimensions(), G4ParameterisationBoxY::ComputeDimensions(), G4ParameterisationBoxZ::ComputeDimensions(), G4ParameterisationConsRho::ComputeDimensions(), G4ParameterisationConsPhi::ComputeDimensions(), G4ParameterisationConsZ::ComputeDimensions(), G4ParameterisationParaX::ComputeDimensions(), G4ParameterisationParaY::ComputeDimensions(), G4ParameterisationParaZ::ComputeDimensions(), G4ParameterisationPolyconeRho::ComputeDimensions(), G4ParameterisationPolyconePhi::ComputeDimensions(), G4ParameterisationPolyconeZ::ComputeDimensions(), G4ParameterisationPolyhedraRho::ComputeDimensions(), G4ParameterisationPolyhedraPhi::ComputeDimensions(), G4ParameterisationPolyhedraZ::ComputeDimensions(), G4ParameterisationTrdX::ComputeDimensions(), G4ParameterisationTrdY::ComputeDimensions(), G4ParameterisationTrdZ::ComputeDimensions(), G4ParameterisationTubsRho::ComputeDimensions(), G4ParameterisationTubsPhi::ComputeDimensions(), G4ParameterisationTubsZ::ComputeDimensions(), G4ReflectedSolid::ComputeDimensions(), G4DisplacedSolid::ComputeDimensions(), G4ScaledSolid::ComputeDimensions(), G4ParameterisedNavigation::ComputeStep(), G4ReplicaNavigation::ComputeStep(), G4DisplacedSolid::CreatePolyhedron(), G4ScaledSolid::CreatePolyhedron(), G4SubtractionSolid::DistanceToIn(), G4Box::DistanceToOut(), G4Orb::DistanceToOut(), G4Para::DistanceToOut(), G4Trap::DistanceToOut(), G4Trd::DistanceToOut(), G4Paraboloid::DistanceToOut(), G4VTwistedFaceted::DistanceToOut(), G4Cons::DistanceToOut(), G4CutTubs::DistanceToOut(), G4Sphere::DistanceToOut(), G4Torus::DistanceToOut(), G4Tubs::DistanceToOut(), G4Ellipsoid::DistanceToOut(), G4EllipticalCone::DistanceToOut(), G4EllipticalTube::DistanceToOut(), G4GenericTrap::DistanceToOut(), export_G4VSolid(), G4Polycone::G4Polycone(), G4Polyhedra::G4Polyhedra(), G4BooleanSolid::GetConstituentSolid(), G4NavigationLogger::PostComputeStepLog(), G4Box::SurfaceNormal(), G4Para::SurfaceNormal(), G4Trap::SurfaceNormal(), G4Trd::SurfaceNormal(), G4Ellipsoid::SurfaceNormal(), G4EllipticalCone::SurfaceNormal(), G4EllipticalTube::SurfaceNormal(), G4ExtrudedSolid::SurfaceNormal(), and G4Tet::SurfaceNormal().

◆ EstimateCubicVolume()

G4double G4VSolid::EstimateCubicVolume ( G4int  nStat,
G4double  epsilon 
) const
inherited

Definition at line 203 of file G4VSolid.cc.

204{
205 G4int iInside=0;
206 G4double px,py,pz,minX,maxX,minY,maxY,minZ,maxZ,volume,halfepsilon;
208 EInside in;
209
210 // values needed for CalculateExtent signature
211
212 G4VoxelLimits limit; // Unlimited
213 G4AffineTransform origin;
214
215 // min max extents of pSolid along X,Y,Z
216
217 CalculateExtent(kXAxis,limit,origin,minX,maxX);
218 CalculateExtent(kYAxis,limit,origin,minY,maxY);
219 CalculateExtent(kZAxis,limit,origin,minZ,maxZ);
220
221 // limits
222
223 if(nStat < 100) nStat = 100;
224 if(epsilon > 0.01) epsilon = 0.01;
225 halfepsilon = 0.5*epsilon;
226
227 for(auto i = 0; i < nStat; ++i )
228 {
229 px = minX-halfepsilon+(maxX-minX+epsilon)*G4QuickRand();
230 py = minY-halfepsilon+(maxY-minY+epsilon)*G4QuickRand();
231 pz = minZ-halfepsilon+(maxZ-minZ+epsilon)*G4QuickRand();
232 p = G4ThreeVector(px,py,pz);
233 in = Inside(p);
234 if(in != kOutside) ++iInside;
235 }
236 volume = (maxX-minX+epsilon)*(maxY-minY+epsilon)
237 * (maxZ-minZ+epsilon)*iInside/nStat;
238 return volume;
239}
G4double epsilon(G4double density, G4double temperature)
static const G4int maxZ
G4double G4QuickRand()
Definition: G4QuickRand.hh:34
CLHEP::Hep3Vector G4ThreeVector
virtual G4bool CalculateExtent(const EAxis pAxis, const G4VoxelLimits &pVoxelLimit, const G4AffineTransform &pTransform, G4double &pMin, G4double &pMax) const =0
virtual EInside Inside(const G4ThreeVector &p) const =0

References G4VSolid::CalculateExtent(), epsilon(), G4QuickRand(), G4VSolid::Inside(), kOutside, kXAxis, kYAxis, kZAxis, and maxZ.

Referenced by G4VSolid::GetCubicVolume(), G4BooleanSolid::GetCubicVolume(), and G4VCSGfaceted::GetCubicVolume().

◆ EstimateSurfaceArea()

G4double G4VSolid::EstimateSurfaceArea ( G4int  nStat,
G4double  ell 
) const
inherited

Definition at line 265 of file G4VSolid.cc.

266{
267 static const G4double s2 = 1./std::sqrt(2.);
268 static const G4double s3 = 1./std::sqrt(3.);
269 static const G4ThreeVector directions[64] =
270 {
271 G4ThreeVector( 0, 0, 0), G4ThreeVector( -1, 0, 0), // ( , , ) ( -, , )
272 G4ThreeVector( 1, 0, 0), G4ThreeVector( -1, 0, 0), // ( +, , ) (-+, , )
273 G4ThreeVector( 0, -1, 0), G4ThreeVector(-s2,-s2, 0), // ( , -, ) ( -, -, )
274 G4ThreeVector( s2, -s2, 0), G4ThreeVector( 0, -1, 0), // ( +, -, ) (-+, -, )
275
276 G4ThreeVector( 0, 1, 0), G4ThreeVector( -s2, s2, 0), // ( , +, ) ( -, +, )
277 G4ThreeVector( s2, s2, 0), G4ThreeVector( 0, 1, 0), // ( +, +, ) (-+, +, )
278 G4ThreeVector( 0, -1, 0), G4ThreeVector( -1, 0, 0), // ( ,-+, ) ( -,-+, )
279 G4ThreeVector( 1, 0, 0), G4ThreeVector( -1, 0, 0), // ( +,-+, ) (-+,-+, )
280
281 G4ThreeVector( 0, 0, -1), G4ThreeVector(-s2, 0,-s2), // ( , , -) ( -, , -)
282 G4ThreeVector( s2, 0,-s2), G4ThreeVector( 0, 0, -1), // ( +, , -) (-+, , -)
283 G4ThreeVector( 0,-s2,-s2), G4ThreeVector(-s3,-s3,-s3), // ( , -, -) ( -, -, -)
284 G4ThreeVector( s3,-s3,-s3), G4ThreeVector( 0,-s2,-s2), // ( +, -, -) (-+, -, -)
285
286 G4ThreeVector( 0, s2,-s2), G4ThreeVector(-s3, s3,-s3), // ( , +, -) ( -, +, -)
287 G4ThreeVector( s3, s3,-s3), G4ThreeVector( 0, s2,-s2), // ( +, +, -) (-+, +, -)
288 G4ThreeVector( 0, 0, -1), G4ThreeVector(-s2, 0,-s2), // ( ,-+, -) ( -,-+, -)
289 G4ThreeVector( s2, 0,-s2), G4ThreeVector( 0, 0, -1), // ( +,-+, -) (-+,-+, -)
290
291 G4ThreeVector( 0, 0, 1), G4ThreeVector(-s2, 0, s2), // ( , , +) ( -, , +)
292 G4ThreeVector( s2, 0, s2), G4ThreeVector( 0, 0, 1), // ( +, , +) (-+, , +)
293 G4ThreeVector( 0,-s2, s2), G4ThreeVector(-s3,-s3, s3), // ( , -, +) ( -, -, +)
294 G4ThreeVector( s3,-s3, s3), G4ThreeVector( 0,-s2, s2), // ( +, -, +) (-+, -, +)
295
296 G4ThreeVector( 0, s2, s2), G4ThreeVector(-s3, s3, s3), // ( , +, +) ( -, +, +)
297 G4ThreeVector( s3, s3, s3), G4ThreeVector( 0, s2, s2), // ( +, +, +) (-+, +, +)
298 G4ThreeVector( 0, 0, 1), G4ThreeVector(-s2, 0, s2), // ( ,-+, +) ( -,-+, +)
299 G4ThreeVector( s2, 0, s2), G4ThreeVector( 0, 0, 1), // ( +,-+, +) (-+,-+, +)
300
301 G4ThreeVector( 0, 0, -1), G4ThreeVector( -1, 0, 0), // ( , ,-+) ( -, ,-+)
302 G4ThreeVector( 1, 0, 0), G4ThreeVector( -1, 0, 0), // ( +, ,-+) (-+, ,-+)
303 G4ThreeVector( 0, -1, 0), G4ThreeVector(-s2,-s2, 0), // ( , -,-+) ( -, -,-+)
304 G4ThreeVector( s2, -s2, 0), G4ThreeVector( 0, -1, 0), // ( +, -,-+) (-+, -,-+)
305
306 G4ThreeVector( 0, 1, 0), G4ThreeVector( -s2, s2, 0), // ( , +,-+) ( -, +,-+)
307 G4ThreeVector( s2, s2, 0), G4ThreeVector( 0, 1, 0), // ( +, +,-+) (-+, +,-+)
308 G4ThreeVector( 0, -1, 0), G4ThreeVector( -1, 0, 0), // ( ,-+,-+) ( -,-+,-+)
309 G4ThreeVector( 1, 0, 0), G4ThreeVector( -1, 0, 0), // ( +,-+,-+) (-+,-+,-+)
310 };
311
312 G4ThreeVector bmin, bmax;
313 BoundingLimits(bmin, bmax);
314
315 G4double dX = bmax.x() - bmin.x();
316 G4double dY = bmax.y() - bmin.y();
317 G4double dZ = bmax.z() - bmin.z();
318
319 // Define statistics and shell thickness
320 //
321 G4int npoints = (nstat < 1000) ? 1000 : nstat;
322 G4double coeff = 0.5 / std::cbrt(G4double(npoints));
323 G4double eps = (ell > 0) ? ell : coeff * std::min(std::min(dX, dY), dZ);
324 G4double del = 1.8 * eps; // shold be more than sqrt(3.)
325
326 G4double minX = bmin.x() - eps;
327 G4double minY = bmin.y() - eps;
328 G4double minZ = bmin.z() - eps;
329
330 G4double dd = 2. * eps;
331 dX += dd;
332 dY += dd;
333 dZ += dd;
334
335 // Calculate surface area
336 //
337 G4int icount = 0;
338 for(auto i = 0; i < npoints; ++i)
339 {
340 G4double px = minX + dX*G4QuickRand();
341 G4double py = minY + dY*G4QuickRand();
342 G4double pz = minZ + dZ*G4QuickRand();
343 G4ThreeVector p = G4ThreeVector(px, py, pz);
344 EInside in = Inside(p);
345 G4double dist = 0;
346 if (in == kInside)
347 {
348 if (DistanceToOut(p) >= eps) continue;
349 G4int icase = 0;
350 if (Inside(G4ThreeVector(px-del, py, pz)) != kInside) icase += 1;
351 if (Inside(G4ThreeVector(px+del, py, pz)) != kInside) icase += 2;
352 if (Inside(G4ThreeVector(px, py-del, pz)) != kInside) icase += 4;
353 if (Inside(G4ThreeVector(px, py+del, pz)) != kInside) icase += 8;
354 if (Inside(G4ThreeVector(px, py, pz-del)) != kInside) icase += 16;
355 if (Inside(G4ThreeVector(px, py, pz+del)) != kInside) icase += 32;
356 if (icase == 0) continue;
357 G4ThreeVector v = directions[icase];
358 dist = DistanceToOut(p, v);
359 G4ThreeVector n = SurfaceNormal(p + v*dist);
360 dist *= v.dot(n);
361 }
362 else if (in == kOutside)
363 {
364 if (DistanceToIn(p) >= eps) continue;
365 G4int icase = 0;
366 if (Inside(G4ThreeVector(px-del, py, pz)) != kOutside) icase += 1;
367 if (Inside(G4ThreeVector(px+del, py, pz)) != kOutside) icase += 2;
368 if (Inside(G4ThreeVector(px, py-del, pz)) != kOutside) icase += 4;
369 if (Inside(G4ThreeVector(px, py+del, pz)) != kOutside) icase += 8;
370 if (Inside(G4ThreeVector(px, py, pz-del)) != kOutside) icase += 16;
371 if (Inside(G4ThreeVector(px, py, pz+del)) != kOutside) icase += 32;
372 if (icase == 0) continue;
373 G4ThreeVector v = directions[icase];
374 dist = DistanceToIn(p, v);
375 if (dist == kInfinity) continue;
376 G4ThreeVector n = SurfaceNormal(p + v*dist);
377 dist *= -(v.dot(n));
378 }
379 if (dist < eps) ++icount;
380 }
381 return dX*dY*dZ*icount/npoints/dd;
382}
static const G4double eps
double dot(const Hep3Vector &) const
virtual G4double DistanceToOut(const G4ThreeVector &p, const G4ThreeVector &v, const G4bool calcNorm=false, G4bool *validNorm=nullptr, G4ThreeVector *n=nullptr) const =0
virtual G4ThreeVector SurfaceNormal(const G4ThreeVector &p) const =0
virtual void BoundingLimits(G4ThreeVector &pMin, G4ThreeVector &pMax) const
Definition: G4VSolid.cc:665
virtual G4double DistanceToIn(const G4ThreeVector &p, const G4ThreeVector &v) const =0

References G4VSolid::BoundingLimits(), G4VSolid::DistanceToIn(), G4VSolid::DistanceToOut(), CLHEP::Hep3Vector::dot(), eps, G4QuickRand(), G4VSolid::Inside(), kInfinity, kInside, kOutside, G4INCL::Math::min(), CLHEP::detail::n, G4VSolid::SurfaceNormal(), CLHEP::Hep3Vector::x(), CLHEP::Hep3Vector::y(), and CLHEP::Hep3Vector::z().

Referenced by G4VSolid::GetSurfaceArea(), G4MultiUnion::GetSurfaceArea(), and G4VCSGfaceted::GetSurfaceArea().

◆ GetConstituentSolid() [1/2]

G4VSolid * G4VSolid::GetConstituentSolid ( G4int  no)
virtualinherited

Reimplemented in G4BooleanSolid.

Definition at line 170 of file G4VSolid.cc.

171{ return nullptr; }

◆ GetConstituentSolid() [2/2]

const G4VSolid * G4VSolid::GetConstituentSolid ( G4int  no) const
virtualinherited

Reimplemented in G4BooleanSolid.

Definition at line 167 of file G4VSolid.cc.

168{ return nullptr; }

Referenced by G4BooleanSolid::StackPolyhedron().

◆ GetCubicVolume()

G4double G4TwistedTubs::GetCubicVolume ( )
virtual

Reimplemented from G4VSolid.

Definition at line 1031 of file G4TwistedTubs.cc.

1032{
1033 if (fCubicVolume == 0.)
1034 {
1035 G4double DPhi = GetDPhi();
1036 G4double Z0 = GetEndZ(0);
1037 G4double Z1 = GetEndZ(1);
1038 G4double Ain = GetInnerRadius();
1039 G4double Aout = GetOuterRadius();
1040 G4double R0in = GetEndInnerRadius(0);
1041 G4double R1in = GetEndInnerRadius(1);
1042 G4double R0out = GetEndOuterRadius(0);
1043 G4double R1out = GetEndOuterRadius(1);
1044
1045 // V_hyperboloid = pi*h*(2*a*a + R*R)/3
1046 fCubicVolume = (2.*(Z1 - Z0)*(Aout + Ain)*(Aout - Ain)
1047 + Z1*(R1out + R1in)*(R1out - R1in)
1048 - Z0*(R0out + R0in)*(R0out - R0in))*DPhi/6.;
1049 }
1050 return fCubicVolume;
1051}
G4double GetOuterRadius() const
G4double GetEndInnerRadius() const
static const G4double Z1[5]
Definition: paraMaker.cc:41

References fCubicVolume, GetDPhi(), GetEndInnerRadius(), GetEndOuterRadius(), GetEndZ(), GetInnerRadius(), GetOuterRadius(), and anonymous_namespace{paraMaker.cc}::Z1.

◆ GetDisplacedSolidPtr() [1/2]

G4DisplacedSolid * G4VSolid::GetDisplacedSolidPtr ( )
virtualinherited

Reimplemented in G4DisplacedSolid.

Definition at line 176 of file G4VSolid.cc.

177{ return nullptr; }

◆ GetDisplacedSolidPtr() [2/2]

const G4DisplacedSolid * G4VSolid::GetDisplacedSolidPtr ( ) const
virtualinherited

Reimplemented in G4DisplacedSolid.

Definition at line 173 of file G4VSolid.cc.

174{ return nullptr; }

◆ GetDPhi()

G4double G4TwistedTubs::GetDPhi ( ) const
inline

◆ GetEndInnerRadius() [1/2]

G4double G4TwistedTubs::GetEndInnerRadius ( ) const
inline

Definition at line 150 of file G4TwistedTubs.hh.

151 { return (fEndInnerRadius[0] > fEndInnerRadius[1] ?

References fEndInnerRadius.

Referenced by GetCubicVolume(), and GetPointOnSurface().

◆ GetEndInnerRadius() [2/2]

G4double G4TwistedTubs::GetEndInnerRadius ( G4int  i) const
inline

Definition at line 146 of file G4TwistedTubs.hh.

147 { return fEndInnerRadius[i]; }

References fEndInnerRadius.

◆ GetEndOuterRadius() [1/2]

G4double G4TwistedTubs::GetEndOuterRadius ( ) const
inline

Definition at line 153 of file G4TwistedTubs.hh.

154 { return (fEndOuterRadius[0] > fEndOuterRadius[1] ?

References fEndOuterRadius.

Referenced by BoundingLimits(), GetCubicVolume(), and GetPointOnSurface().

◆ GetEndOuterRadius() [2/2]

G4double G4TwistedTubs::GetEndOuterRadius ( G4int  i) const
inline

Definition at line 148 of file G4TwistedTubs.hh.

149 { return fEndOuterRadius[i]; }

References fEndOuterRadius.

◆ GetEndPhi()

G4double G4TwistedTubs::GetEndPhi ( G4int  i) const
inline

Definition at line 145 of file G4TwistedTubs.hh.

145{ return fEndPhi[i]; }

References fEndPhi.

Referenced by BoundingLimits(), and export_G4TwistedTubs().

◆ GetEndZ()

G4double G4TwistedTubs::GetEndZ ( G4int  i) const
inline

Definition at line 144 of file G4TwistedTubs.hh.

144{ return fEndZ[i] ; }

References fEndZ.

Referenced by BoundingLimits(), export_G4TwistedTubs(), GetCubicVolume(), and G4GDMLWriteSolids::TwistedtubsWrite().

◆ GetEntityType()

G4GeometryType G4TwistedTubs::GetEntityType ( ) const
virtual

Implements G4VSolid.

Definition at line 1015 of file G4TwistedTubs.cc.

1016{
1017 return G4String("G4TwistedTubs");
1018}

◆ GetExtent()

G4VisExtent G4TwistedTubs::GetExtent ( ) const
virtual

Reimplemented from G4VSolid.

Definition at line 884 of file G4TwistedTubs.cc.

885{
886 // Define the sides of the box into which the G4Tubs instance would fit.
887 //
888 G4ThreeVector pmin,pmax;
889 BoundingLimits(pmin,pmax);
890 return G4VisExtent(pmin.x(),pmax.x(),
891 pmin.y(),pmax.y(),
892 pmin.z(),pmax.z());
893}

References BoundingLimits(), CLHEP::Hep3Vector::x(), CLHEP::Hep3Vector::y(), and CLHEP::Hep3Vector::z().

◆ GetInnerRadius()

G4double G4TwistedTubs::GetInnerRadius ( ) const
inline

◆ GetInnerStereo()

G4double G4TwistedTubs::GetInnerStereo ( ) const
inline

Definition at line 134 of file G4TwistedTubs.hh.

134{ return fInnerStereo; }

References fInnerStereo.

Referenced by export_G4TwistedTubs().

◆ GetKappa()

G4double G4TwistedTubs::GetKappa ( ) const
inline

Definition at line 137 of file G4TwistedTubs.hh.

137{ return fKappa ; }

References fKappa.

Referenced by export_G4TwistedTubs().

◆ GetName()

G4String G4VSolid::GetName ( ) const
inlineinherited

Referenced by G4GMocrenFileSceneHandler::AddDetector(), G4HepRepFileSceneHandler::AddHepRepInstance(), G4GMocrenFileSceneHandler::AddPrimitive(), G4HepRepFileSceneHandler::AddSolid(), G4GMocrenFileSceneHandler::AddSolid(), G4VtkSceneHandler::AddSolid(), G4GDMLWriteSolids::AddSolid(), G4NavigationLogger::AlongComputeStepLog(), G4GDMLWriteSolids::BooleanWrite(), G4ReflectedSolid::BoundingLimits(), G4DisplacedSolid::BoundingLimits(), G4IntersectionSolid::BoundingLimits(), G4ScaledSolid::BoundingLimits(), G4SubtractionSolid::BoundingLimits(), G4UnionSolid::BoundingLimits(), G4Box::BoundingLimits(), G4Cons::BoundingLimits(), G4CutTubs::BoundingLimits(), G4Orb::BoundingLimits(), G4Para::BoundingLimits(), G4Sphere::BoundingLimits(), G4Torus::BoundingLimits(), G4Trap::BoundingLimits(), G4Trd::BoundingLimits(), G4Tubs::BoundingLimits(), G4EllipticalCone::BoundingLimits(), G4ExtrudedSolid::BoundingLimits(), G4GenericPolycone::BoundingLimits(), G4GenericTrap::BoundingLimits(), G4Hype::BoundingLimits(), G4Paraboloid::BoundingLimits(), G4Polycone::BoundingLimits(), G4Polyhedra::BoundingLimits(), G4TessellatedSolid::BoundingLimits(), BoundingLimits(), G4GDMLWriteSolids::BoxWrite(), G4ExtrudedSolid::CalculateExtent(), G4GenericPolycone::CalculateExtent(), G4Polycone::CalculateExtent(), G4Polyhedra::CalculateExtent(), G4NavigationLogger::CheckDaughterEntryPoint(), G4VDivisionParameterisation::CheckNDivAndWidth(), G4VDivisionParameterisation::CheckOffset(), G4GenericTrap::CheckOrder(), G4Para::CheckParameters(), G4Trap::CheckParameters(), G4Trd::CheckParameters(), G4Ellipsoid::CheckParameters(), G4EllipticalTube::CheckParameters(), G4ParameterisationPolyconeRho::CheckParametersValidity(), G4ParameterisationPolyconeZ::CheckParametersValidity(), G4ParameterisationPolyhedraRho::CheckParametersValidity(), G4ParameterisationPolyhedraPhi::CheckParametersValidity(), G4ParameterisationPolyhedraZ::CheckParametersValidity(), G4PhantomParameterisation::CheckVoxelsFillContainer(), G4GenericTrap::ComputeIsTwisted(), G4VoxelNavigation::ComputeSafety(), G4VoxelSafety::ComputeSafety(), G4NavigationLogger::ComputeSafetyLog(), G4ParameterisedNavigation::ComputeStep(), G4ReplicaNavigation::ComputeStep(), G4GDMLWriteSolids::ConeWrite(), G4Polyhedra::Create(), G4GenericPolycone::Create(), G4Polycone::Create(), G4PhysicalVolumeModel::CreateCurrentAttValues(), G4ReflectedSolid::CreatePolyhedron(), G4ReflectionFactory::CreateReflectedLV(), G4GenericTrap::CreateTessellatedSolid(), G4GDMLWriteSolids::CutTubeWrite(), G4SolidStore::DeRegister(), G4PhysicalVolumeModel::DescribeSolid(), G4SubtractionSolid::DistanceToIn(), G4Paraboloid::DistanceToIn(), G4TessellatedSolid::DistanceToIn(), G4Box::DistanceToOut(), G4Orb::DistanceToOut(), G4Para::DistanceToOut(), G4Trap::DistanceToOut(), G4Trd::DistanceToOut(), G4EllipticalCone::DistanceToOut(), G4TessellatedSolid::DistanceToOut(), G4Ellipsoid::DistanceToOut(), G4EllipticalTube::DistanceToOut(), G4tgbGeometryDumper::DumpMultiUnionVolume(), G4tgbGeometryDumper::DumpScaledVolume(), G4tgbGeometryDumper::DumpSolid(), G4GDMLWriteSolids::ElconeWrite(), G4GDMLWriteSolids::EllipsoidWrite(), G4GDMLWriteSolids::EltubeWrite(), G4PVDivision::ErrorInAxis(), G4ReplicatedSlice::ErrorInAxis(), export_G4VSolid(), G4Box::G4Box(), G4Cons::G4Cons(), G4CutTubs::G4CutTubs(), G4EllipticalCone::G4EllipticalCone(), G4Hype::G4Hype(), G4Para::G4Para(), G4Paraboloid::G4Paraboloid(), G4Polycone::G4Polycone(), G4Polyhedra::G4Polyhedra(), G4Sphere::G4Sphere(), G4Tet::G4Tet(), G4Trap::G4Trap(), G4Tubs::G4Tubs(), G4VParameterisationCons::G4VParameterisationCons(), G4VParameterisationPara::G4VParameterisationPara(), G4VParameterisationPolycone::G4VParameterisationPolycone(), G4VParameterisationPolyhedra::G4VParameterisationPolyhedra(), G4VParameterisationTrd::G4VParameterisationTrd(), G4VTwistedFaceted::G4VTwistedFaceted(), G4GDMLWriteSolids::GenericPolyconeWrite(), G4GDMLWriteSolids::GenTrapWrite(), G4Navigator::GetGlobalExitNormal(), G4Navigator::GetLocalExitNormal(), G4ITNavigator1::GetLocalExitNormal(), G4ITNavigator2::GetLocalExitNormal(), G4BooleanSolid::GetPointOnSurface(), G4PhantomParameterisation::GetReplicaNo(), G4GDMLWriteSolids::HypeWrite(), G4TessellatedSolid::InsideNoVoxels(), G4TessellatedSolid::InsideVoxels(), G4ITNavigator1::LocateGlobalPointAndSetup(), G4ITNavigator2::LocateGlobalPointAndSetup(), G4Navigator::LocateGlobalPointAndSetup(), G4GenericTrap::MakeDownFacet(), G4Trap::MakePlanes(), G4GenericTrap::MakeUpFacet(), G4GDMLWriteSolids::MultiUnionWrite(), G4GDMLWriteSolids::OrbWrite(), G4GDMLWriteSolids::ParaboloidWrite(), G4GDMLWriteParamvol::ParametersWrite(), G4GDMLWriteSolids::ParaWrite(), G4GDMLWriteSolids::PolyconeWrite(), G4GDMLWriteSolids::PolyhedraWrite(), G4NavigationLogger::PostComputeStepLog(), G4NavigationLogger::PreComputeStepLog(), G4NavigationLogger::PrintDaughterLog(), G4PseudoScene::ProcessVolume(), G4SolidStore::Register(), G4tgbVolumeMgr::RegisterMe(), G4NavigationLogger::ReportOutsideMother(), G4ASCIITreeSceneHandler::RequestPrimitives(), G4VSceneHandler::RequestPrimitives(), G4GenericPolycone::Reset(), G4Polyhedra::Reset(), G4VoxelSafety::SafetyForVoxelNode(), G4GDMLWriteSolids::ScaledWrite(), G4Torus::SetAllParameters(), G4Tet::SetBoundingLimits(), G4Polycone::SetOriginalParameters(), G4Polyhedra::SetOriginalParameters(), G4TessellatedSolid::SetSolidClosed(), G4Tet::SetVertices(), G4Box::SetXHalfLength(), G4Box::SetYHalfLength(), G4Box::SetZHalfLength(), G4GDMLWriteSolids::SphereWrite(), G4BooleanSolid::StackPolyhedron(), G4ReflectedSolid::StreamInfo(), G4BooleanSolid::StreamInfo(), G4DisplacedSolid::StreamInfo(), G4MultiUnion::StreamInfo(), G4ScaledSolid::StreamInfo(), G4Box::StreamInfo(), G4Cons::StreamInfo(), G4CSGSolid::StreamInfo(), G4CutTubs::StreamInfo(), G4Orb::StreamInfo(), G4Para::StreamInfo(), G4Sphere::StreamInfo(), G4Torus::StreamInfo(), G4Trap::StreamInfo(), G4Trd::StreamInfo(), G4Tubs::StreamInfo(), G4Ellipsoid::StreamInfo(), G4EllipticalCone::StreamInfo(), G4EllipticalTube::StreamInfo(), G4ExtrudedSolid::StreamInfo(), G4GenericPolycone::StreamInfo(), G4GenericTrap::StreamInfo(), G4Hype::StreamInfo(), G4Paraboloid::StreamInfo(), G4Polycone::StreamInfo(), G4Polyhedra::StreamInfo(), G4TessellatedSolid::StreamInfo(), G4Tet::StreamInfo(), G4TwistedBox::StreamInfo(), G4TwistedTrap::StreamInfo(), G4TwistedTrd::StreamInfo(), StreamInfo(), G4VCSGfaceted::StreamInfo(), G4VTwistedFaceted::StreamInfo(), G4GDMLRead::StripNames(), SubstractSolids(), G4UnionSolid::SurfaceNormal(), G4Box::SurfaceNormal(), G4Para::SurfaceNormal(), G4Trap::SurfaceNormal(), G4Trd::SurfaceNormal(), G4Ellipsoid::SurfaceNormal(), G4EllipticalCone::SurfaceNormal(), G4EllipticalTube::SurfaceNormal(), G4ExtrudedSolid::SurfaceNormal(), G4Tet::SurfaceNormal(), G4GDMLWriteSolids::TessellatedWrite(), G4GDMLWriteSolids::TetWrite(), G4GDMLWriteSolids::TorusWrite(), G4GDMLWriteSolids::TrapWrite(), G4GDMLWriteStructure::TraverseVolumeTree(), G4GDMLWriteSolids::TrdWrite(), G4GDMLWriteSolids::TubeWrite(), G4GDMLWriteSolids::TwistedboxWrite(), G4GDMLWriteSolids::TwistedtrapWrite(), G4GDMLWriteSolids::TwistedtrdWrite(), G4GDMLWriteSolids::TwistedtubsWrite(), G4PhysicalVolumeModel::VisitGeometryAndGetVisReps(), and G4GDMLWriteSolids::XtruWrite().

◆ GetOuterRadius()

G4double G4TwistedTubs::GetOuterRadius ( ) const
inline

◆ GetOuterStereo()

G4double G4TwistedTubs::GetOuterStereo ( ) const
inline

Definition at line 135 of file G4TwistedTubs.hh.

135{ return fOuterStereo; }

References fOuterStereo.

Referenced by export_G4TwistedTubs().

◆ GetPhiTwist()

G4double G4TwistedTubs::GetPhiTwist ( ) const
inline

◆ GetPointOnSurface()

G4ThreeVector G4TwistedTubs::GetPointOnSurface ( ) const
virtual

Reimplemented from G4VSolid.

Definition at line 1065 of file G4TwistedTubs.cc.

1066{
1067
1069 G4double phi , phimin, phimax ;
1070 G4double x , xmin, xmax ;
1071 G4double r , rmin, rmax ;
1072
1079
1080 G4double chose = G4RandFlat::shoot(0.,a1 + a2 + a3 + a4 + a5 + a6) ;
1081
1082 if(chose < a1)
1083 {
1084
1085 phimin = fOuterHype->GetBoundaryMin(z) ;
1086 phimax = fOuterHype->GetBoundaryMax(z) ;
1087 phi = G4RandFlat::shoot(phimin,phimax) ;
1088
1089 return fOuterHype->SurfacePoint(phi,z,true) ;
1090
1091 }
1092 else if ( (chose >= a1) && (chose < a1 + a2 ) )
1093 {
1094
1095 phimin = fInnerHype->GetBoundaryMin(z) ;
1096 phimax = fInnerHype->GetBoundaryMax(z) ;
1097 phi = G4RandFlat::shoot(phimin,phimax) ;
1098
1099 return fInnerHype->SurfacePoint(phi,z,true) ;
1100
1101 }
1102 else if ( (chose >= a1 + a2 ) && (chose < a1 + a2 + a3 ) )
1103 {
1104
1105 xmin = fLatterTwisted->GetBoundaryMin(z) ;
1106 xmax = fLatterTwisted->GetBoundaryMax(z) ;
1107 x = G4RandFlat::shoot(xmin,xmax) ;
1108
1109 return fLatterTwisted->SurfacePoint(x,z,true) ;
1110
1111 }
1112 else if ( (chose >= a1 + a2 + a3 ) && (chose < a1 + a2 + a3 + a4 ) )
1113 {
1114
1115 xmin = fFormerTwisted->GetBoundaryMin(z) ;
1116 xmax = fFormerTwisted->GetBoundaryMax(z) ;
1117 x = G4RandFlat::shoot(xmin,xmax) ;
1118
1119 return fFormerTwisted->SurfacePoint(x,z,true) ;
1120 }
1121 else if( (chose >= a1 + a2 + a3 + a4 )&&(chose < a1 + a2 + a3 + a4 + a5 ) )
1122 {
1123 rmin = GetEndInnerRadius(0) ;
1124 rmax = GetEndOuterRadius(0) ;
1125 r = std::sqrt(G4RandFlat::shoot()*(sqr(rmax)-sqr(rmin))+sqr(rmin));
1126
1127 phimin = fLowerEndcap->GetBoundaryMin(r) ;
1128 phimax = fLowerEndcap->GetBoundaryMax(r) ;
1129 phi = G4RandFlat::shoot(phimin,phimax) ;
1130
1131 return fLowerEndcap->SurfacePoint(phi,r,true) ;
1132 }
1133 else
1134 {
1135 rmin = GetEndInnerRadius(1) ;
1136 rmax = GetEndOuterRadius(1) ;
1137 r = rmin + (rmax-rmin)*std::sqrt(G4RandFlat::shoot());
1138
1139 phimin = fUpperEndcap->GetBoundaryMin(r) ;
1140 phimax = fUpperEndcap->GetBoundaryMax(r) ;
1141 phi = G4RandFlat::shoot(phimin,phimax) ;
1142
1143 return fUpperEndcap->SurfacePoint(phi,r,true) ;
1144 }
1145}
virtual G4double GetBoundaryMin(G4double)=0
virtual G4ThreeVector SurfacePoint(G4double, G4double, G4bool isGlobal=false)=0
virtual G4double GetBoundaryMax(G4double)=0
virtual G4double GetSurfaceArea()=0
ThreeVector shoot(const G4int Ap, const G4int Af)
T sqr(const T &x)
Definition: templates.hh:128

References fEndZ, fFormerTwisted, fInnerHype, fLatterTwisted, fLowerEndcap, fOuterHype, fUpperEndcap, G4VTwistSurface::GetBoundaryMax(), G4VTwistSurface::GetBoundaryMin(), GetEndInnerRadius(), GetEndOuterRadius(), G4VTwistSurface::GetSurfaceArea(), G4INCL::DeJongSpin::shoot(), sqr(), and G4VTwistSurface::SurfacePoint().

◆ GetPolyhedron()

G4Polyhedron * G4TwistedTubs::GetPolyhedron ( ) const
virtual

◆ GetSurfaceArea()

G4double G4TwistedTubs::GetSurfaceArea ( )
virtual

Reimplemented from G4VSolid.

Definition at line 1056 of file G4TwistedTubs.cc.

1057{
1059 return fSurfaceArea;
1060}
virtual G4double GetSurfaceArea()
Definition: G4VSolid.cc:250

References fSurfaceArea, and G4VSolid::GetSurfaceArea().

◆ GetTanInnerStereo()

G4double G4TwistedTubs::GetTanInnerStereo ( ) const
inline

Definition at line 139 of file G4TwistedTubs.hh.

139{ return fTanInnerStereo ; }

References fTanInnerStereo.

Referenced by export_G4TwistedTubs().

◆ GetTanInnerStereo2()

G4double G4TwistedTubs::GetTanInnerStereo2 ( ) const
inline

Definition at line 140 of file G4TwistedTubs.hh.

140{ return fTanInnerStereo2 ; }

References fTanInnerStereo2.

Referenced by export_G4TwistedTubs().

◆ GetTanOuterStereo()

G4double G4TwistedTubs::GetTanOuterStereo ( ) const
inline

Definition at line 141 of file G4TwistedTubs.hh.

141{ return fTanOuterStereo ; }

References fTanOuterStereo.

Referenced by export_G4TwistedTubs().

◆ GetTanOuterStereo2()

G4double G4TwistedTubs::GetTanOuterStereo2 ( ) const
inline

Definition at line 142 of file G4TwistedTubs.hh.

142{ return fTanOuterStereo2 ; }

References fTanOuterStereo2.

Referenced by export_G4TwistedTubs().

◆ GetTolerance()

G4double G4VSolid::GetTolerance ( ) const
inlineinherited

◆ GetZHalfLength()

G4double G4TwistedTubs::GetZHalfLength ( ) const
inline

Definition at line 136 of file G4TwistedTubs.hh.

136{ return fZHalfLength; }

References fZHalfLength.

Referenced by export_G4TwistedTubs(), and G4tgbGeometryDumper::GetSolidParams().

◆ Inside()

EInside G4TwistedTubs::Inside ( const G4ThreeVector p) const
virtual

Implements G4VSolid.

Definition at line 376 of file G4TwistedTubs.cc.

377{
378
379 const G4double halftol
381 // static G4int timerid = -1;
382 // G4Timer timer(timerid, "G4TwistedTubs", "Inside");
383 // timer.Start();
384
385 G4ThreeVector *tmpp;
386 EInside *tmpinside;
387 if (fLastInside.p == p)
388 {
389 return fLastInside.inside;
390 }
391 else
392 {
393 tmpp = const_cast<G4ThreeVector*>(&(fLastInside.p));
394 tmpinside = const_cast<EInside*>(&(fLastInside.inside));
395 tmpp->set(p.x(), p.y(), p.z());
396 }
397
398 EInside outerhypearea = ((G4TwistTubsHypeSide *)fOuterHype)->Inside(p);
399 G4double innerhyperho = ((G4TwistTubsHypeSide *)fInnerHype)->GetRhoAtPZ(p);
400 G4double distanceToOut = p.getRho() - innerhyperho; // +ve: inside
401
402 if ((outerhypearea == kOutside) || (distanceToOut < -halftol))
403 {
404 *tmpinside = kOutside;
405 }
406 else if (outerhypearea == kSurface)
407 {
408 *tmpinside = kSurface;
409 }
410 else
411 {
412 if (distanceToOut <= halftol)
413 {
414 *tmpinside = kSurface;
415 }
416 else
417 {
418 *tmpinside = kInside;
419 }
420 }
421
422 return fLastInside.inside;
423}
double getRho() const
G4double GetRadialTolerance() const
static G4GeometryTolerance * GetInstance()

References fInnerHype, fLastInside, fOuterHype, G4GeometryTolerance::GetInstance(), G4GeometryTolerance::GetRadialTolerance(), CLHEP::Hep3Vector::getRho(), G4TwistedTubs::LastState::inside, kInside, kOutside, kSurface, G4TwistedTubs::LastState::p, CLHEP::Hep3Vector::set(), CLHEP::Hep3Vector::x(), CLHEP::Hep3Vector::y(), and CLHEP::Hep3Vector::z().

Referenced by DistanceToIn(), and DistanceToOut().

◆ operator=()

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

Definition at line 249 of file G4TwistedTubs.cc.

250{
251 // Check assignment to self
252 //
253 if (this == &rhs) { return *this; }
254
255 // Copy base class data
256 //
258
259 // Copy data
260 //
261 fPhiTwist= rhs.fPhiTwist;
277
278 for (auto i=0; i<2; ++i)
279 {
280 fEndZ[i] = rhs.fEndZ[i];
283 fEndPhi[i] = rhs.fEndPhi[i];
284 fEndZ2[i] = rhs.fEndZ2[i];
285 }
286
288 fRebuildPolyhedron = false;
289 delete fpPolyhedron; fpPolyhedron = nullptr;
290
291 return *this;
292}
G4VSolid & operator=(const G4VSolid &rhs)
Definition: G4VSolid.cc:107

References CreateSurfaces(), fCubicVolume, fDPhi, fEndInnerRadius, fEndOuterRadius, fEndPhi, fEndZ, fEndZ2, fFormerTwisted, fInnerHype, fInnerRadius, fInnerRadius2, fInnerStereo, fKappa, fLastDistanceToIn, fLastDistanceToInWithV, fLastDistanceToOut, fLastDistanceToOutWithV, fLastInside, fLastNormal, fLatterTwisted, fLowerEndcap, fOuterHype, fOuterRadius, fOuterRadius2, fOuterStereo, fPhiTwist, fpPolyhedron, fRebuildPolyhedron, fSurfaceArea, fTanInnerStereo, fTanInnerStereo2, fTanOuterStereo, fTanOuterStereo2, fUpperEndcap, fZHalfLength, and G4VSolid::operator=().

◆ operator==()

G4bool G4VSolid::operator== ( const G4VSolid s) const
inlineinherited

◆ SetFields()

void G4TwistedTubs::SetFields ( G4double  phitwist,
G4double  innerrad,
G4double  outerrad,
G4double  negativeEndz,
G4double  positiveEndz 
)
inlineprivate

Definition at line 344 of file G4TwistedTubs.hh.

347{
348 fCubicVolume = 0.;
349 fPhiTwist = phitwist;
350 fEndZ[0] = negativeEndz;
351 fEndZ[1] = positiveEndz;
352 fEndZ2[0] = fEndZ[0] * fEndZ[0];
353 fEndZ2[1] = fEndZ[1] * fEndZ[1];
354 fInnerRadius = innerrad;
355 fOuterRadius = outerrad;
358
359 if (std::fabs(fEndZ[0]) >= std::fabs(fEndZ[1]))
360 {
361 fZHalfLength = std::fabs(fEndZ[0]);
362 }
363 else
364 {
365 fZHalfLength = std::fabs(fEndZ[1]);
366 }
367
368 G4double parity = (fPhiTwist > 0 ? 1 : -1);
369 G4double tanHalfTwist = std::tan(0.5 * fPhiTwist);
370 G4double innerNumerator = std::fabs(fInnerRadius * tanHalfTwist) * parity;
371 G4double outerNumerator = std::fabs(fOuterRadius * tanHalfTwist) * parity;
372
373 fTanInnerStereo = innerNumerator / fZHalfLength;
374 fTanOuterStereo = outerNumerator / fZHalfLength;
377 fInnerStereo = std::atan2(innerNumerator, fZHalfLength);
378 fOuterStereo = std::atan2(outerNumerator, fZHalfLength);
383
384 fKappa = tanHalfTwist / fZHalfLength;
385 fEndPhi[0] = std::atan2(fEndZ[0] * tanHalfTwist, fZHalfLength);
386 fEndPhi[1] = std::atan2(fEndZ[1] * tanHalfTwist, fZHalfLength);
387
388#ifdef G4TWISTDEBUG
389 G4cout << "/********* G4TwistedTubs::SetFields() Field Parameters ***************** " << G4endl;
390 G4cout << "/* fPhiTwist : " << fPhiTwist << G4endl;
391 G4cout << "/* fEndZ(0, 1) : " << fEndZ[0] << " , " << fEndZ[1] << G4endl;
392 G4cout << "/* fEndPhi(0, 1) : " << fEndPhi[0] << " , " << fEndPhi[1] << G4endl;
393 G4cout << "/* fInnerRadius, fOuterRadius : " << fInnerRadius << " , " << fOuterRadius << G4endl;
394 G4cout << "/* fEndInnerRadius(0, 1) : " << fEndInnerRadius[0] << " , "
395 << fEndInnerRadius[1] << G4endl;
396 G4cout << "/* fEndOuterRadius(0, 1) : " << fEndOuterRadius[0] << " , "
397 << fEndOuterRadius[1] << G4endl;
398 G4cout << "/* fInnerStereo, fOuterStereo : " << fInnerStereo << " , " << fOuterStereo << G4endl;
399 G4cout << "/* tanHalfTwist, fKappa : " << tanHalfTwist << " , " << fKappa << G4endl;
400 G4cout << "/*********************************************************************** " << G4endl;
401#endif
402}
G4GLOB_DLL std::ostream G4cout
static int parity(int x)

References fCubicVolume, fEndInnerRadius, fEndOuterRadius, fEndPhi, fEndZ, fEndZ2, fInnerRadius, fInnerRadius2, fInnerStereo, fKappa, fOuterRadius, fOuterRadius2, fOuterStereo, fPhiTwist, fTanInnerStereo, fTanInnerStereo2, fTanOuterStereo, fTanOuterStereo2, fZHalfLength, G4cout, G4endl, and parity().

Referenced by G4TwistedTubs().

◆ SetName()

void G4VSolid::SetName ( const G4String name)
inherited

Definition at line 127 of file G4VSolid.cc.

128{
131}
void SetMapValid(G4bool val)
Definition: G4SolidStore.hh:76
static G4SolidStore * GetInstance()
G4String fshapeName
Definition: G4VSolid.hh:312
const char * name(G4int ptype)

References G4VSolid::fshapeName, G4SolidStore::GetInstance(), G4InuclParticleNames::name(), and G4SolidStore::SetMapValid().

Referenced by export_G4VSolid(), G4MultiUnion::G4MultiUnion(), and G4GDMLRead::StripNames().

◆ StreamInfo()

std::ostream & G4TwistedTubs::StreamInfo ( std::ostream &  os) const
virtual

Implements G4VSolid.

Definition at line 843 of file G4TwistedTubs.cc.

844{
845 //
846 // Stream object contents to an output stream
847 //
848 G4int oldprc = os.precision(16);
849 os << "-----------------------------------------------------------\n"
850 << " *** Dump for solid - " << GetName() << " ***\n"
851 << " ===================================================\n"
852 << " Solid type: G4TwistedTubs\n"
853 << " Parameters: \n"
854 << " -ve end Z : " << fEndZ[0]/mm << " mm \n"
855 << " +ve end Z : " << fEndZ[1]/mm << " mm \n"
856 << " inner end radius(-ve z): " << fEndInnerRadius[0]/mm << " mm \n"
857 << " inner end radius(+ve z): " << fEndInnerRadius[1]/mm << " mm \n"
858 << " outer end radius(-ve z): " << fEndOuterRadius[0]/mm << " mm \n"
859 << " outer end radius(+ve z): " << fEndOuterRadius[1]/mm << " mm \n"
860 << " inner radius (z=0) : " << fInnerRadius/mm << " mm \n"
861 << " outer radius (z=0) : " << fOuterRadius/mm << " mm \n"
862 << " twisted angle : " << fPhiTwist/degree << " degrees \n"
863 << " inner stereo angle : " << fInnerStereo/degree << " degrees \n"
864 << " outer stereo angle : " << fOuterStereo/degree << " degrees \n"
865 << " phi-width of a piece : " << fDPhi/degree << " degrees \n"
866 << "-----------------------------------------------------------\n";
867 os.precision(oldprc);
868
869 return os;
870}
static constexpr double mm
Definition: G4SIunits.hh:95
static constexpr double degree
Definition: G4SIunits.hh:124

References degree, fDPhi, fEndInnerRadius, fEndOuterRadius, fEndZ, fInnerRadius, fInnerStereo, fOuterRadius, fOuterStereo, fPhiTwist, G4VSolid::GetName(), and mm.

◆ SurfaceNormal()

G4ThreeVector G4TwistedTubs::SurfaceNormal ( const G4ThreeVector p) const
virtual

Implements G4VSolid.

Definition at line 428 of file G4TwistedTubs.cc.

429{
430 //
431 // return the normal unit vector to the Hyperbolical Surface at a point
432 // p on (or nearly on) the surface
433 //
434 // Which of the three or four surfaces are we closest to?
435 //
436
437 if (fLastNormal.p == p)
438 {
439 return fLastNormal.vec;
440 }
441 G4ThreeVector *tmpp =
442 const_cast<G4ThreeVector*>(&(fLastNormal.p));
443 G4ThreeVector *tmpnormal =
444 const_cast<G4ThreeVector*>(&(fLastNormal.vec));
445 G4VTwistSurface **tmpsurface =
446 const_cast<G4VTwistSurface**>(fLastNormal.surface);
447 tmpp->set(p.x(), p.y(), p.z());
448
449 G4double distance = kInfinity;
450
451 G4VTwistSurface *surfaces[6];
452 surfaces[0] = fLatterTwisted;
453 surfaces[1] = fFormerTwisted;
454 surfaces[2] = fInnerHype;
455 surfaces[3] = fOuterHype;
456 surfaces[4] = fLowerEndcap;
457 surfaces[5] = fUpperEndcap;
458
459 G4ThreeVector xx;
460 G4ThreeVector bestxx;
461 G4int besti = -1;
462 for (auto i=0; i<6; ++i)
463 {
464 G4double tmpdistance = surfaces[i]->DistanceTo(p, xx);
465 if (tmpdistance < distance)
466 {
467 distance = tmpdistance;
468 bestxx = xx;
469 besti = i;
470 }
471 }
472
473 tmpsurface[0] = surfaces[besti];
474 *tmpnormal = tmpsurface[0]->GetNormal(bestxx, true);
475
476 return fLastNormal.vec;
477}

References G4VTwistSurface::DistanceTo(), fFormerTwisted, fInnerHype, fLastNormal, fLatterTwisted, fLowerEndcap, fOuterHype, fUpperEndcap, G4VTwistSurface::GetNormal(), kInfinity, G4TwistedTubs::LastVector::p, CLHEP::Hep3Vector::set(), G4TwistedTubs::LastVector::surface, G4TwistedTubs::LastVector::vec, CLHEP::Hep3Vector::x(), CLHEP::Hep3Vector::y(), and CLHEP::Hep3Vector::z().

Referenced by DistanceToIn(), and DistanceToOut().

Field Documentation

◆ fCubicVolume

G4double G4TwistedTubs::fCubicVolume = 0.0
private

Definition at line 224 of file G4TwistedTubs.hh.

Referenced by GetCubicVolume(), operator=(), and SetFields().

◆ fDPhi

G4double G4TwistedTubs::fDPhi
private

◆ fEndInnerRadius

G4double G4TwistedTubs::fEndInnerRadius[2]
private

◆ fEndOuterRadius

G4double G4TwistedTubs::fEndOuterRadius[2]
private

◆ fEndPhi

G4double G4TwistedTubs::fEndPhi[2]
private

Definition at line 209 of file G4TwistedTubs.hh.

Referenced by CreateSurfaces(), G4TwistedTubs(), GetEndPhi(), operator=(), and SetFields().

◆ fEndZ

G4double G4TwistedTubs::fEndZ[2]
private

◆ fEndZ2

G4double G4TwistedTubs::fEndZ2[2]
private

Definition at line 215 of file G4TwistedTubs.hh.

Referenced by G4TwistedTubs(), operator=(), and SetFields().

◆ fFormerTwisted

G4VTwistSurface* G4TwistedTubs::fFormerTwisted
private

◆ fInnerHype

G4VTwistSurface* G4TwistedTubs::fInnerHype
private

◆ fInnerRadius

G4double G4TwistedTubs::fInnerRadius
private

Definition at line 196 of file G4TwistedTubs.hh.

Referenced by CreateSurfaces(), GetInnerRadius(), operator=(), SetFields(), and StreamInfo().

◆ fInnerRadius2

G4double G4TwistedTubs::fInnerRadius2
private

Definition at line 211 of file G4TwistedTubs.hh.

Referenced by operator=(), and SetFields().

◆ fInnerStereo

G4double G4TwistedTubs::fInnerStereo
private

Definition at line 202 of file G4TwistedTubs.hh.

Referenced by GetInnerStereo(), operator=(), SetFields(), and StreamInfo().

◆ fKappa

G4double G4TwistedTubs::fKappa
private

Definition at line 206 of file G4TwistedTubs.hh.

Referenced by CreateSurfaces(), GetKappa(), operator=(), and SetFields().

◆ fLastDistanceToIn

LastValue G4TwistedTubs::fLastDistanceToIn
private

Definition at line 330 of file G4TwistedTubs.hh.

Referenced by DistanceToIn(), and operator=().

◆ fLastDistanceToInWithV

LastValueWithDoubleVector G4TwistedTubs::fLastDistanceToInWithV
private

Definition at line 332 of file G4TwistedTubs.hh.

Referenced by DistanceToIn(), and operator=().

◆ fLastDistanceToOut

LastValue G4TwistedTubs::fLastDistanceToOut
private

Definition at line 331 of file G4TwistedTubs.hh.

Referenced by DistanceToOut(), and operator=().

◆ fLastDistanceToOutWithV

LastValueWithDoubleVector G4TwistedTubs::fLastDistanceToOutWithV
private

Definition at line 333 of file G4TwistedTubs.hh.

Referenced by DistanceToOut(), and operator=().

◆ fLastInside

LastState G4TwistedTubs::fLastInside
private

Definition at line 328 of file G4TwistedTubs.hh.

Referenced by Inside(), and operator=().

◆ fLastNormal

LastVector G4TwistedTubs::fLastNormal
private

Definition at line 329 of file G4TwistedTubs.hh.

Referenced by DistanceToOut(), operator=(), and SurfaceNormal().

◆ fLatterTwisted

G4VTwistSurface* G4TwistedTubs::fLatterTwisted
private

◆ fLowerEndcap

G4VTwistSurface* G4TwistedTubs::fLowerEndcap
private

◆ fOuterHype

G4VTwistSurface* G4TwistedTubs::fOuterHype
private

◆ fOuterRadius

G4double G4TwistedTubs::fOuterRadius
private

Definition at line 197 of file G4TwistedTubs.hh.

Referenced by CreateSurfaces(), GetOuterRadius(), operator=(), SetFields(), and StreamInfo().

◆ fOuterRadius2

G4double G4TwistedTubs::fOuterRadius2
private

Definition at line 212 of file G4TwistedTubs.hh.

Referenced by operator=(), and SetFields().

◆ fOuterStereo

G4double G4TwistedTubs::fOuterStereo
private

Definition at line 203 of file G4TwistedTubs.hh.

Referenced by GetOuterStereo(), operator=(), SetFields(), and StreamInfo().

◆ fPhiTwist

G4double G4TwistedTubs::fPhiTwist
private

Definition at line 195 of file G4TwistedTubs.hh.

Referenced by CreatePolyhedron(), GetPhiTwist(), operator=(), SetFields(), and StreamInfo().

◆ fpPolyhedron

G4Polyhedron* G4TwistedTubs::fpPolyhedron = nullptr
mutableprivate

Definition at line 228 of file G4TwistedTubs.hh.

Referenced by GetPolyhedron(), operator=(), and ~G4TwistedTubs().

◆ fRebuildPolyhedron

G4bool G4TwistedTubs::fRebuildPolyhedron = false
mutableprivate

Definition at line 227 of file G4TwistedTubs.hh.

Referenced by GetPolyhedron(), and operator=().

◆ fshapeName

G4String G4VSolid::fshapeName
privateinherited

Definition at line 312 of file G4VSolid.hh.

Referenced by G4VSolid::operator=(), and G4VSolid::SetName().

◆ fSurfaceArea

G4double G4TwistedTubs::fSurfaceArea = 0.0
private

Definition at line 225 of file G4TwistedTubs.hh.

Referenced by GetSurfaceArea(), and operator=().

◆ fTanInnerStereo

G4double G4TwistedTubs::fTanInnerStereo
private

Definition at line 204 of file G4TwistedTubs.hh.

Referenced by CreateSurfaces(), GetTanInnerStereo(), operator=(), and SetFields().

◆ fTanInnerStereo2

G4double G4TwistedTubs::fTanInnerStereo2
private

Definition at line 213 of file G4TwistedTubs.hh.

Referenced by GetTanInnerStereo2(), operator=(), and SetFields().

◆ fTanOuterStereo

G4double G4TwistedTubs::fTanOuterStereo
private

Definition at line 205 of file G4TwistedTubs.hh.

Referenced by CreateSurfaces(), GetTanOuterStereo(), operator=(), and SetFields().

◆ fTanOuterStereo2

G4double G4TwistedTubs::fTanOuterStereo2
private

Definition at line 214 of file G4TwistedTubs.hh.

Referenced by GetTanOuterStereo2(), operator=(), and SetFields().

◆ fUpperEndcap

G4VTwistSurface* G4TwistedTubs::fUpperEndcap
private

◆ fZHalfLength

G4double G4TwistedTubs::fZHalfLength
private

Definition at line 200 of file G4TwistedTubs.hh.

Referenced by GetZHalfLength(), operator=(), and SetFields().

◆ kCarTolerance

G4double G4VSolid::kCarTolerance
protectedinherited

Definition at line 299 of file G4VSolid.hh.

Referenced by G4TessellatedSolid::AddFacet(), G4Polycone::CalculateExtent(), G4Polyhedra::CalculateExtent(), G4Tet::CheckDegeneracy(), G4Para::CheckParameters(), G4Trd::CheckParameters(), G4Ellipsoid::CheckParameters(), G4EllipticalTube::CheckParameters(), G4GenericTrap::ComputeIsTwisted(), G4Polyhedra::Create(), G4GenericPolycone::Create(), G4Polycone::Create(), G4CutTubs::CreatePolyhedron(), G4TessellatedSolid::CreateVertexList(), G4VCSGfaceted::DistanceTo(), G4Sphere::DistanceToIn(), G4Ellipsoid::DistanceToIn(), G4Hype::DistanceToIn(), G4Paraboloid::DistanceToIn(), G4VCSGfaceted::DistanceToIn(), G4TessellatedSolid::DistanceToInCore(), G4Cons::DistanceToOut(), G4CutTubs::DistanceToOut(), G4Sphere::DistanceToOut(), G4Torus::DistanceToOut(), G4Tubs::DistanceToOut(), G4GenericTrap::DistanceToOut(), G4Hype::DistanceToOut(), G4Paraboloid::DistanceToOut(), G4VCSGfaceted::DistanceToOut(), G4TessellatedSolid::DistanceToOutCandidates(), G4TessellatedSolid::DistanceToOutCore(), G4TessellatedSolid::DistanceToOutNoVoxels(), G4GenericTrap::DistToPlane(), G4GenericTrap::DistToTriangle(), G4Box::G4Box(), G4Cons::G4Cons(), G4CutTubs::G4CutTubs(), G4EllipticalCone::G4EllipticalCone(), G4ExtrudedSolid::G4ExtrudedSolid(), G4GenericTrap::G4GenericTrap(), G4Hype::G4Hype(), G4Para::G4Para(), G4Sphere::G4Sphere(), G4Tet::G4Tet(), G4Trap::G4Trap(), G4Tubs::G4Tubs(), G4UnionSolid::G4UnionSolid(), G4VSolid::G4VSolid(), G4VTwistedFaceted::G4VTwistedFaceted(), G4GenericPolycone::GetPointOnSurface(), G4Polycone::GetPointOnSurface(), G4UnionSolid::Init(), G4Orb::Initialize(), G4TessellatedSolid::Initialize(), G4SubtractionSolid::Inside(), G4Hype::Inside(), G4Paraboloid::Inside(), G4VCSGfaceted::Inside(), G4VTwistedFaceted::Inside(), G4TessellatedSolid::InsideNoVoxels(), G4GenericTrap::InsidePolygone(), G4TessellatedSolid::InsideVoxels(), G4CutTubs::IsCrossingCutPlanes(), G4GenericTrap::IsSegCrossingZ(), G4Trap::MakePlane(), G4GenericTrap::NormalToPlane(), G4VSolid::operator=(), G4TessellatedSolid::SafetyFromInside(), G4TessellatedSolid::SafetyFromOutside(), G4Torus::SetAllParameters(), G4Polycone::SetOriginalParameters(), G4Polyhedra::SetOriginalParameters(), G4Box::SetXHalfLength(), G4Box::SetYHalfLength(), G4Box::SetZHalfLength(), G4Torus::SurfaceNormal(), G4GenericTrap::SurfaceNormal(), and G4Paraboloid::SurfaceNormal().


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