Geant4-11
Public Types | Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes
G4TwistTrapAlphaSide Class Reference

#include <G4TwistTrapAlphaSide.hh>

Inheritance diagram for G4TwistTrapAlphaSide:
G4VTwistSurface

Public Types

enum  EValidate { kDontValidate = 0 , kValidateWithTol = 1 , kValidateWithoutTol = 2 , kUninitialized = 3 }
 

Public Member Functions

virtual G4int AmIOnLeftSide (const G4ThreeVector &me, const G4ThreeVector &vec, G4bool withTol=true)
 
G4ThreeVector ComputeGlobalDirection (const G4ThreeVector &lp) const
 
G4ThreeVector ComputeGlobalPoint (const G4ThreeVector &lp) const
 
G4ThreeVector ComputeLocalDirection (const G4ThreeVector &gp) const
 
G4ThreeVector ComputeLocalPoint (const G4ThreeVector &gp) const
 
void DebugPrint () const
 
virtual G4double DistanceTo (const G4ThreeVector &gp, G4ThreeVector &gxx)
 
virtual G4double DistanceToBoundary (G4int areacode, G4ThreeVector &xx, const G4ThreeVector &p)
 
virtual G4double DistanceToIn (const G4ThreeVector &gp, const G4ThreeVector &gv, G4ThreeVector &gxxbest)
 
G4double DistanceToLine (const G4ThreeVector &p, const G4ThreeVector &x0, const G4ThreeVector &d, G4ThreeVector &xx)
 
virtual G4double DistanceToOut (const G4ThreeVector &gp, const G4ThreeVector &gv, G4ThreeVector &gxxbest)
 
G4double DistanceToPlane (const G4ThreeVector &p, const G4ThreeVector &x0, const G4ThreeVector &n0, G4ThreeVector &xx)
 
G4double DistanceToPlane (const G4ThreeVector &p, const G4ThreeVector &x0, const G4ThreeVector &t1, const G4ThreeVector &t2, G4ThreeVector &xx, G4ThreeVector &n)
 
G4double DistanceToPlaneWithV (const G4ThreeVector &p, const G4ThreeVector &v, const G4ThreeVector &x0, const G4ThreeVector &n0, G4ThreeVector &xx)
 
virtual G4int DistanceToSurface (const G4ThreeVector &gp, const G4ThreeVector &gv, G4ThreeVector gxx[], G4double distance[], G4int areacode[], G4bool isvalid[], EValidate validate=kValidateWithTol)
 
virtual G4int DistanceToSurface (const G4ThreeVector &gp, G4ThreeVector gxx[], G4double distance[], G4int areacode[])
 
 G4TwistTrapAlphaSide (__void__ &)
 
 G4TwistTrapAlphaSide (const G4String &name, G4double PhiTwist, G4double pDz, G4double pTheta, G4double pPhi, G4double pDy1, G4double pDx1, G4double pDx2, G4double pDy2, G4double pDx3, G4double pDx4, G4double pAlph, G4double AngleSide)
 
G4int GetAxisType (G4int areacode, G4int whichaxis) const
 
virtual G4ThreeVector GetBoundaryAtPZ (G4int areacode, const G4ThreeVector &p) const
 
virtual void GetBoundaryParameters (const G4int &areacode, G4ThreeVector &d, G4ThreeVector &x0, G4int &boundarytype) const
 
G4int GetEdgeVisibility (G4int i, G4int j, G4int m, G4int n, G4int number, G4int orientation)
 
G4int GetFace (G4int i, G4int j, G4int m, G4int n, G4int iside)
 
virtual G4String GetName () const
 
G4int GetNode (G4int i, G4int j, G4int m, G4int n, G4int iside)
 
virtual G4ThreeVector GetNormal (const G4ThreeVector &xx, G4bool isGlobal=false)
 
G4bool IsAxis0 (G4int areacode) const
 
G4bool IsAxis1 (G4int areacode) const
 
G4bool IsBoundary (G4int areacode, G4bool testbitmode=false) const
 
G4bool IsCorner (G4int areacode, G4bool testbitmode=false) const
 
G4bool IsInside (G4int areacode, G4bool testbitmode=false) const
 
G4bool IsOutside (G4int areacode) const
 
G4bool IsSameBoundary (G4VTwistSurface *surface1, G4int areacode1, G4VTwistSurface *surface2, G4int areacode2) const
 
G4bool IsValidNorm () const
 
void SetAxis (G4int i, const EAxis axis)
 
void SetNeighbours (G4VTwistSurface *ax0min, G4VTwistSurface *ax1min, G4VTwistSurface *ax0max, G4VTwistSurface *ax1max)
 
virtual ~G4TwistTrapAlphaSide ()
 

Static Public Attributes

static const G4int sAreaMask = 0XF0000000
 
static const G4int sAxis0 = 0x0000FF00
 
static const G4int sAxis1 = 0x000000FF
 
static const G4int sAxisMask = 0x0000FCFC
 
static const G4int sAxisMax = 0x00000202
 
static const G4int sAxisMin = 0x00000101
 
static const G4int sAxisPhi = 0x00001414
 
static const G4int sAxisRho = 0x00001010
 
static const G4int sAxisX = 0x00000404
 
static const G4int sAxisY = 0x00000808
 
static const G4int sAxisZ = 0x00000C0C
 
static const G4int sBoundary = 0x20000000
 
static const G4int sC0Max1Max = 0x40000202
 
static const G4int sC0Max1Min = 0x40000201
 
static const G4int sC0Min1Max = 0x40000102
 
static const G4int sC0Min1Min = 0x40000101
 
static const G4int sCorner = 0x40000000
 
static const G4int sInside = 0x10000000
 
static const G4int sOutside = 0x00000000
 
static const G4int sSizeMask = 0x00000303
 

Protected Member Functions

void GetBoundaryAxis (G4int areacode, EAxis axis[]) const
 
void GetBoundaryLimit (G4int areacode, G4double limit[]) const
 
G4ThreeVector GetCorner (G4int areacode) const
 
G4VTwistSurface ** GetNeighbours ()
 
G4int GetNeighbours (G4int areacode, G4VTwistSurface *surfaces[])
 
virtual void SetBoundary (const G4int &axiscode, const G4ThreeVector &direction, const G4ThreeVector &x0, const G4int &boundarytype)
 
void SetCorner (G4int areacode, G4double x, G4double y, G4double z)
 

Protected Attributes

EAxis fAxis [2]
 
G4double fAxisMax [2]
 
G4double fAxisMin [2]
 
G4SurfCurNormal fCurrentNormal
 
CurrentStatus fCurStat
 
CurrentStatus fCurStatWithV
 
G4int fHandedness
 
G4bool fIsValidNorm
 
G4RotationMatrix fRot
 
G4ThreeVector fTrans
 
G4double kCarTolerance
 

Private Member Functions

virtual G4int GetAreaCode (const G4ThreeVector &xx, G4bool withTol=true)
 
virtual G4double GetBoundaryMax (G4double phi)
 
virtual G4double GetBoundaryMin (G4double phi)
 
virtual void GetFacets (G4int m, G4int n, G4double xyz[][3], G4int faces[][4], G4int iside)
 
void GetPhiUAtX (G4ThreeVector p, G4double &phi, G4double &u)
 
virtual G4double GetSurfaceArea ()
 
G4double GetValueA (G4double phi)
 
G4double GetValueB (G4double phi)
 
G4double GetValueD (G4double phi)
 
G4ThreeVector NormAng (G4double phi, G4double u)
 
G4ThreeVector ProjectPoint (const G4ThreeVector &p, G4bool isglobal=false)
 
virtual void SetBoundaries ()
 
virtual void SetCorners ()
 
virtual G4ThreeVector SurfacePoint (G4double phi, G4double u, G4bool isGlobal=false)
 
G4double Xcoef (G4double u, G4double phi)
 

Private Attributes

G4double fa1md1
 
G4double fa2md2
 
G4double fAlph
 
G4SurfSideQuery fAmIOnLeftSide
 
G4double fAngleSide
 
Boundary fBoundaries [4]
 
G4ThreeVector fCorners [4]
 
G4double fdeltaX
 
G4double fdeltaY
 
G4double fDx1
 
G4double fDx2
 
G4double fDx3
 
G4double fDx3minus1
 
G4double fDx3plus1
 
G4double fDx4
 
G4double fDx4minus2
 
G4double fDx4plus2
 
G4double fDy1
 
G4double fDy2
 
G4double fDy2minus1
 
G4double fDy2plus1
 
G4double fDz
 
G4String fName
 
G4VTwistSurfacefNeighbours [4]
 
G4double fPhi
 
G4double fPhiTwist
 
G4double fTAlph
 
G4double fTheta
 

Detailed Description

Definition at line 41 of file G4TwistTrapAlphaSide.hh.

Member Enumeration Documentation

◆ EValidate

Enumerator
kDontValidate 
kValidateWithTol 
kValidateWithoutTol 
kUninitialized 

Definition at line 52 of file G4VTwistSurface.hh.

Constructor & Destructor Documentation

◆ G4TwistTrapAlphaSide() [1/2]

G4TwistTrapAlphaSide::G4TwistTrapAlphaSide ( const G4String name,
G4double  PhiTwist,
G4double  pDz,
G4double  pTheta,
G4double  pPhi,
G4double  pDy1,
G4double  pDx1,
G4double  pDx2,
G4double  pDy2,
G4double  pDx3,
G4double  pDx4,
G4double  pAlph,
G4double  AngleSide 
)

Definition at line 40 of file G4TwistTrapAlphaSide.cc.

56{
57 fAxis[0] = kYAxis; // in local coordinate system
58 fAxis[1] = kZAxis;
59 fAxisMin[0] = -kInfinity ; // Y Axis boundary
60 fAxisMax[0] = kInfinity ; // depends on z !!
61 fAxisMin[1] = -pDz ; // Z Axis boundary
62 fAxisMax[1] = pDz ;
63
64 fDx1 = pDx1 ;
65 fDx2 = pDx2 ;
66 fDx3 = pDx3 ;
67 fDx4 = pDx4 ;
68
69 fDy1 = pDy1 ;
70 fDy2 = pDy2 ;
71
72 fDz = pDz ;
73
74 fAlph = pAlph ;
75 fTAlph = std::tan(fAlph) ;
76
77 fTheta = pTheta ;
78 fPhi = pPhi ;
79
80 // precalculate frequently used parameters
81 fDx4plus2 = fDx4 + fDx2 ;
82 fDx4minus2 = fDx4 - fDx2 ;
83 fDx3plus1 = fDx3 + fDx1 ;
84 fDx3minus1 = fDx3 - fDx1 ;
85 fDy2plus1 = fDy2 + fDy1 ;
86 fDy2minus1 = fDy2 - fDy1 ;
87
88 fa1md1 = 2*fDx2 - 2*fDx1 ;
89 fa2md2 = 2*fDx4 - 2*fDx3 ;
90
91 fPhiTwist = PhiTwist ; // dphi
92 fAngleSide = AngleSide ; // 0,90,180,270 deg
93
94 fdeltaX = 2 * fDz * std::tan(fTheta) * std::cos(fPhi);
95 // dx in surface equation
96 fdeltaY = 2 * fDz * std::tan(fTheta) * std::sin(fPhi);
97 // dy in surface equation
98
99 fRot.rotateZ( AngleSide ) ;
100
101 fTrans.set(0, 0, 0); // No Translation
102 fIsValidNorm = false;
103
104 SetCorners() ;
105 SetBoundaries() ;
106}
void set(double x, double y, double z)
HepRotation & rotateZ(double delta)
Definition: Rotation.cc:87
G4VTwistSurface(const G4String &name)
G4double fAxisMax[2]
G4RotationMatrix fRot
G4ThreeVector fTrans
G4double fAxisMin[2]
@ kYAxis
Definition: geomdefs.hh:56
@ kZAxis
Definition: geomdefs.hh:57
static const G4double kInfinity
Definition: geomdefs.hh:41
const char * name(G4int ptype)

References fa1md1, fa2md2, fAlph, fAngleSide, G4VTwistSurface::fAxis, G4VTwistSurface::fAxisMax, G4VTwistSurface::fAxisMin, fdeltaX, fdeltaY, fDx1, fDx2, fDx3, fDx3minus1, fDx3plus1, fDx4, fDx4minus2, fDx4plus2, fDy1, fDy2, fDy2minus1, fDy2plus1, fDz, G4VTwistSurface::fIsValidNorm, fPhi, fPhiTwist, G4VTwistSurface::fRot, fTAlph, fTheta, G4VTwistSurface::fTrans, kInfinity, kYAxis, kZAxis, CLHEP::HepRotation::rotateZ(), CLHEP::Hep3Vector::set(), SetBoundaries(), and SetCorners().

◆ ~G4TwistTrapAlphaSide()

G4TwistTrapAlphaSide::~G4TwistTrapAlphaSide ( )
virtual

Definition at line 125 of file G4TwistTrapAlphaSide.cc.

126{
127}

◆ G4TwistTrapAlphaSide() [2/2]

G4TwistTrapAlphaSide::G4TwistTrapAlphaSide ( __void__ &  a)

Definition at line 112 of file G4TwistTrapAlphaSide.cc.

113 : G4VTwistSurface(a), fTheta(0.), fPhi(0.), fDy1(0.), fDx1(0.), fDx2(0.),
114 fDy2(0.), fDx3(0.), fDx4(0.), fDz(0.), fAlph(0.), fTAlph(0.), fPhiTwist(0.),
115 fAngleSide(0.), fDx4plus2(0.), fDx4minus2(0.), fDx3plus1(0.), fDx3minus1(0.),
116 fDy2plus1(0.), fDy2minus1(0.), fa1md1(0.), fa2md2(0.), fdeltaX(0.),
117 fdeltaY(0.)
118{
119}

Member Function Documentation

◆ AmIOnLeftSide()

G4int G4VTwistSurface::AmIOnLeftSide ( const G4ThreeVector me,
const G4ThreeVector vec,
G4bool  withTol = true 
)
virtualinherited

Definition at line 147 of file G4VTwistSurface.cc.

150{
151 // AmIOnLeftSide returns phi-location of "me"
152 // (phi relation between me and vec projected on z=0 plane).
153 // If "me" is on -ve-phi-side of "vec", it returns 1.
154 // On the other hand, if "me" is on +ve-phi-side of "vec",
155 // it returns -1.
156 // (The return value represents z-coordinate of normal vector
157 // of me.cross(vec).)
158 // If me is on boundary of vec, return 0.
159
160 const G4double kAngTolerance
162
163 G4RotationMatrix unitrot;
164 const G4RotationMatrix rottol = unitrot.rotateZ(0.5*kAngTolerance);
165 const G4RotationMatrix invrottol = unitrot.rotateZ(-1.*kAngTolerance);
166
167 if (fAmIOnLeftSide.me == me
168 && fAmIOnLeftSide.vec == vec
169 && fAmIOnLeftSide.withTol == withtol)
170 {
172 }
173
174 fAmIOnLeftSide.me = me;
175 fAmIOnLeftSide.vec = vec;
176 fAmIOnLeftSide.withTol = withtol;
177
178 G4ThreeVector met = (G4ThreeVector(me.x(), me.y(), 0.)).unit();
179 G4ThreeVector vect = (G4ThreeVector(vec.x(), vec.y(), 0.)).unit();
180
181 G4ThreeVector ivect = invrottol * vect;
182 G4ThreeVector rvect = rottol * vect;
183
184 G4double metcrossvect = met.x() * vect.y() - met.y() * vect.x();
185
186 if (withtol)
187 {
188 if (met.x() * ivect.y() - met.y() * ivect.x() > 0 &&
189 metcrossvect >= 0) {
191 } else if (met.x() * rvect.y() - met.y() * rvect.x() < 0 &&
192 metcrossvect <= 0) {
194 } else {
196 }
197 }
198 else
199 {
200 if (metcrossvect > 0) {
202 } else if (metcrossvect < 0 ) {
204 } else {
206 }
207 }
208
209#ifdef G4TWISTDEBUG
210 G4cout << " === G4VTwistSurface::AmIOnLeftSide() =============="
211 << G4endl;
212 G4cout << " Name , returncode : " << fName << " "
214 G4cout << " me, vec : " << std::setprecision(14) << me
215 << " " << vec << G4endl;
216 G4cout << " met, vect : " << met << " " << vect << G4endl;
217 G4cout << " ivec, rvec : " << ivect << " " << rvect << G4endl;
218 G4cout << " met x vect : " << metcrossvect << G4endl;
219 G4cout << " met x ivec : " << met.cross(ivect) << G4endl;
220 G4cout << " met x rvec : " << met.cross(rvect) << G4endl;
221 G4cout << " =============================================="
222 << G4endl;
223#endif
224
226}
CLHEP::Hep3Vector G4ThreeVector
double G4double
Definition: G4Types.hh:83
#define G4endl
Definition: G4ios.hh:57
G4GLOB_DLL std::ostream G4cout
double x() const
double y() const
Hep3Vector cross(const Hep3Vector &) const
static G4GeometryTolerance * GetInstance()
G4double GetAngularTolerance() const
G4SurfSideQuery fAmIOnLeftSide

References G4VTwistSurface::G4SurfSideQuery::amIOnLeftSide, CLHEP::Hep3Vector::cross(), G4VTwistSurface::fAmIOnLeftSide, G4VTwistSurface::fName, G4cout, G4endl, G4GeometryTolerance::GetAngularTolerance(), G4GeometryTolerance::GetInstance(), G4VTwistSurface::G4SurfSideQuery::me, CLHEP::HepRotation::rotateZ(), G4VTwistSurface::G4SurfSideQuery::vec, G4VTwistSurface::G4SurfSideQuery::withTol, CLHEP::Hep3Vector::x(), and CLHEP::Hep3Vector::y().

Referenced by G4TwistTubsSide::DistanceToSurface(), G4TwistTubsFlatSide::GetAreaCode(), and G4TwistTubsHypeSide::GetAreaCodeInPhi().

◆ ComputeGlobalDirection()

G4ThreeVector G4VTwistSurface::ComputeGlobalDirection ( const G4ThreeVector lp) const
inlineinherited

◆ ComputeGlobalPoint()

G4ThreeVector G4VTwistSurface::ComputeGlobalPoint ( const G4ThreeVector lp) const
inlineinherited

◆ ComputeLocalDirection()

G4ThreeVector G4VTwistSurface::ComputeLocalDirection ( const G4ThreeVector gp) const
inlineinherited

◆ ComputeLocalPoint()

G4ThreeVector G4VTwistSurface::ComputeLocalPoint ( const G4ThreeVector gp) const
inlineinherited

◆ DebugPrint()

void G4VTwistSurface::DebugPrint ( ) const
inherited

Definition at line 1139 of file G4VTwistSurface.cc.

1140{
1145
1146 G4cout << "/* G4VTwistSurface::DebugPrint():--------------------------"
1147 << G4endl;
1148 G4cout << "/* Name = " << fName << G4endl;
1149 G4cout << "/* Axis = " << std::hex << fAxis[0] << " "
1150 << std::hex << fAxis[1]
1151 << " (0,1,2,3,5 = kXAxis,kYAxis,kZAxis,kRho,kPhi)"
1152 << std::dec << G4endl;
1153 G4cout << "/* BoundaryLimit(in local) fAxis0(min, max) = ("<<fAxisMin[0]
1154 << ", " << fAxisMax[0] << ")" << G4endl;
1155 G4cout << "/* BoundaryLimit(in local) fAxis1(min, max) = ("<<fAxisMin[1]
1156 << ", " << fAxisMax[1] << ")" << G4endl;
1157 G4cout << "/* Cornar point sC0Min1Min = " << A << G4endl;
1158 G4cout << "/* Cornar point sC0Max1Min = " << B << G4endl;
1159 G4cout << "/* Cornar point sC0Max1Max = " << C << G4endl;
1160 G4cout << "/* Cornar point sC0Min1Max = " << D << G4endl;
1161 G4cout << "/*---------------------------------------------------------"
1162 << G4endl;
1163}
G4double C(G4double temp)
G4double B(G4double temperature)
G4double D(G4double temp)
const G4double A[17]
static const G4int sC0Min1Min
static const G4int sC0Min1Max
static const G4int sC0Max1Max
G4ThreeVector GetCorner(G4int areacode) const
static const G4int sC0Max1Min

References A, B(), C(), D(), G4VTwistSurface::fAxis, G4VTwistSurface::fAxisMax, G4VTwistSurface::fAxisMin, G4VTwistSurface::fName, G4VTwistSurface::fRot, G4VTwistSurface::fTrans, G4cout, G4endl, G4VTwistSurface::GetCorner(), G4VTwistSurface::sC0Max1Max, G4VTwistSurface::sC0Max1Min, G4VTwistSurface::sC0Min1Max, and G4VTwistSurface::sC0Min1Min.

◆ DistanceTo()

G4double G4VTwistSurface::DistanceTo ( const G4ThreeVector gp,
G4ThreeVector gxx 
)
virtualinherited

Definition at line 577 of file G4VTwistSurface.cc.

579{
580#ifdef G4TWISTDEBUG
581 G4cout << "~~~~~ G4VTwistSurface::DistanceTo(p) - Start ~~~~~~~~~" << G4endl;
582 G4cout << " Name : " << fName << G4endl;
583 G4cout << " gp : " << gp << G4endl;
584 G4cout << "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" << G4endl;
585#endif
586
587
589 G4double distance[G4VSURFACENXX] ;
590 G4int areacode[G4VSURFACENXX] ;
591
592 for (G4int i = 0 ; i<G4VSURFACENXX ; ++i )
593 {
594 distance[i] = kInfinity ;
595 areacode[i] = sOutside ;
596 }
597
598 DistanceToSurface(gp, gxx, distance, areacode);
599 gxxbest = gxx[0];
600
601#ifdef G4TWISTDEBUG
602 G4cout << "~~~~~ G4VTwistSurface::DistanceTo(p) - return ~~~~~~~~" << G4endl;
603 G4cout << " Name : " << fName << G4endl;
604 G4cout << " gxx : " << gxxbest << G4endl;
605 G4cout << " bestdist : " << distance[0] << G4endl;
606 G4cout << "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" << G4endl;
607#endif
608
609 return distance[0];
610}
int G4int
Definition: G4Types.hh:85
#define G4VSURFACENXX
static const G4int sOutside
virtual G4int DistanceToSurface(const G4ThreeVector &gp, const G4ThreeVector &gv, G4ThreeVector gxx[], G4double distance[], G4int areacode[], G4bool isvalid[], EValidate validate=kValidateWithTol)=0

References G4VTwistSurface::DistanceToSurface(), G4VTwistSurface::fName, G4cout, G4endl, G4VSURFACENXX, kInfinity, and G4VTwistSurface::sOutside.

Referenced by G4TwistedTubs::DistanceToIn(), G4VTwistedFaceted::DistanceToIn(), G4TwistedTubs::DistanceToOut(), G4VTwistedFaceted::DistanceToOut(), G4TwistedTubs::SurfaceNormal(), and G4VTwistedFaceted::SurfaceNormal().

◆ DistanceToBoundary()

G4double G4VTwistSurface::DistanceToBoundary ( G4int  areacode,
G4ThreeVector xx,
const G4ThreeVector p 
)
virtualinherited

Definition at line 231 of file G4VTwistSurface.cc.

234{
235 // DistanceToBoundary
236 //
237 // return distance to nearest boundary from arbitrary point p
238 // in local coodinate.
239 // Argument areacode must be one of them:
240 // sAxis0 & sAxisMin, sAxis0 & sAxisMax,
241 // sAxis1 & sAxisMin, sAxis1 & sAxisMax.
242 //
243
244 G4ThreeVector d; // direction vector of the boundary
245 G4ThreeVector x0; // reference point of the boundary
246 G4double dist = kInfinity;
247 G4int boundarytype;
248
249 if (IsAxis0(areacode) && IsAxis1(areacode))
250 {
251 std::ostringstream message;
252 message << "Point is in the corner area." << G4endl
253 << " Point is in the corner area. This function returns"
254 << G4endl
255 << " a direction vector of a boundary line." << G4endl
256 << " areacode = " << areacode;
257 G4Exception("G4VTwistSurface::DistanceToBoundary()", "GeomSolids0003",
258 FatalException, message);
259 }
260 else if (IsAxis0(areacode) || IsAxis1(areacode))
261 {
262 GetBoundaryParameters(areacode, d, x0, boundarytype);
263 if (boundarytype == sAxisPhi)
264 {
265 G4double t = x0.getRho() / p.getRho();
266 xx.set(t*p.x(), t*p.y(), x0.z());
267 dist = (xx - p).mag();
268 }
269 else
270 {
271 // linear boundary
272 // sAxisX, sAxisY, sAxisZ, sAxisRho
273 dist = DistanceToLine(p, x0, d, xx);
274 }
275 }
276 else
277 {
278 std::ostringstream message;
279 message << "Bad areacode of boundary." << G4endl
280 << " areacode = " << areacode;
281 G4Exception("G4VTwistSurface::DistanceToBoundary()", "GeomSolids0003",
282 FatalException, message);
283 }
284 return dist;
285}
@ FatalException
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
Definition: G4Exception.cc:35
double z() const
double getRho() const
G4bool IsAxis1(G4int areacode) const
G4bool IsAxis0(G4int areacode) const
G4double DistanceToLine(const G4ThreeVector &p, const G4ThreeVector &x0, const G4ThreeVector &d, G4ThreeVector &xx)
static const G4int sAxisPhi
virtual void GetBoundaryParameters(const G4int &areacode, G4ThreeVector &d, G4ThreeVector &x0, G4int &boundarytype) const

References G4VTwistSurface::DistanceToLine(), FatalException, G4endl, G4Exception(), G4VTwistSurface::GetBoundaryParameters(), CLHEP::Hep3Vector::getRho(), G4VTwistSurface::IsAxis0(), G4VTwistSurface::IsAxis1(), kInfinity, G4VTwistSurface::sAxisPhi, CLHEP::Hep3Vector::set(), CLHEP::Hep3Vector::x(), CLHEP::Hep3Vector::y(), and CLHEP::Hep3Vector::z().

Referenced by G4TwistTubsSide::DistanceToSurface().

◆ DistanceToIn()

G4double G4VTwistSurface::DistanceToIn ( const G4ThreeVector gp,
const G4ThreeVector gv,
G4ThreeVector gxxbest 
)
virtualinherited

Definition at line 290 of file G4VTwistSurface.cc.

293{
294#ifdef G4TWISTDEBUG
295 G4cout << " ~~~~ G4VTwistSurface::DistanceToIn(p,v) - Start ~~~~" << G4endl;
296 G4cout << " Name : " << fName << G4endl;
297 G4cout << " gp : " << gp << G4endl;
298 G4cout << " gv : " << gv << G4endl;
299 G4cout << "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" << G4endl;
300#endif
301
303 G4double distance[G4VSURFACENXX] ;
304 G4int areacode[G4VSURFACENXX] ;
305 G4bool isvalid[G4VSURFACENXX] ;
306
307 for (G4int i = 0 ; i<G4VSURFACENXX ; ++i )
308 {
309 distance[i] = kInfinity ;
310 areacode[i] = sOutside ;
311 isvalid[i] = false ;
312 }
313
314 G4double bestdistance = kInfinity;
315#ifdef G4TWISTDEBUG
316 G4int besti = -1;
317#endif
319
320 G4int nxx = DistanceToSurface(gp, gv, gxx, distance, areacode,
321 isvalid, kValidateWithTol);
322
323 for (G4int i=0; i<nxx; ++i)
324 {
325
326 // skip this intersection if:
327 // - invalid intersection
328 // - particle goes outword the surface
329
330 if (!isvalid[i])
331 {
332 // xx[i] is sOutside or distance[i] < 0
333 continue;
334 }
335
336 G4ThreeVector normal = GetNormal(gxx[i], true);
337
338 if ((normal * gv) >= 0)
339 {
340
341#ifdef G4TWISTDEBUG
342 G4cout << " G4VTwistSurface::DistanceToIn(p,v): "
343 << "particle goes outword the surface." << G4endl;
344#endif
345 continue;
346 }
347
348 //
349 // accept this intersection if the intersection is inside.
350 //
351
352 if (IsInside(areacode[i]))
353 {
354 if (distance[i] < bestdistance)
355 {
356 bestdistance = distance[i];
357 bestgxx = gxx[i];
358#ifdef G4TWISTDEBUG
359 besti = i;
360 G4cout << " G4VTwistSurface::DistanceToIn(p,v): "
361 << " areacode sInside name, distance = "
362 << fName << " "<< bestdistance << G4endl;
363#endif
364 }
365
366 //
367 // else, the intersection is on boundary or corner.
368 //
369
370 }
371 else
372 {
373 G4VTwistSurface* neighbours[2];
374 G4bool isaccepted[2] = {false, false};
375 G4int nneighbours = GetNeighbours(areacode[i], neighbours);
376
377 for (G4int j=0; j<nneighbours; ++j)
378 {
379 // if on corner, nneighbours = 2.
380 // if on boundary, nneighbours = 1.
381
383 G4double tmpdist[G4VSURFACENXX] ;
384 G4int tmpareacode[G4VSURFACENXX] ;
385 G4bool tmpisvalid[G4VSURFACENXX] ;
386
387 for (G4int l = 0 ; l<G4VSURFACENXX ; ++l )
388 {
389 tmpdist[l] = kInfinity ;
390 tmpareacode[l] = sOutside ;
391 tmpisvalid[l] = false ;
392 }
393
394 G4int tmpnxx = neighbours[j]->DistanceToSurface(
395 gp, gv, tmpgxx, tmpdist,
396 tmpareacode, tmpisvalid,
398 G4ThreeVector neighbournormal;
399
400 for (G4int k=0; k< tmpnxx; ++k)
401 {
402 //
403 // if tmpxx[k] is valid && sInside, the final winner must
404 // be neighbour surface. return kInfinity.
405 // else , choose tmpxx on same boundary of xx, then check normal
406 //
407
408 if (IsInside(tmpareacode[k]))
409 {
410#ifdef G4TWISTDEBUG
411 G4cout << " G4VTwistSurface:DistanceToIn(p,v): "
412 << " intersection "<< tmpgxx[k] << G4endl
413 << " is inside of neighbour surface of " << fName
414 << " . returning kInfinity." << G4endl;
415 G4cout << "~~ G4VTwistSurface::DistanceToIn(p,v) - return ~~"
416 << G4endl;
417 G4cout << " No intersections " << G4endl;
418 G4cout << " Name : " << fName << G4endl;
419 G4cout << "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
420 << G4endl;
421#endif
422 if (tmpisvalid[k]) return kInfinity;
423 continue;
424
425 //
426 // if tmpxx[k] is valid && sInside, the final winner must
427 // be neighbour surface. return .
428 //
429
430 }
431 else if (IsSameBoundary(this,areacode[i],
432 neighbours[j], tmpareacode[k]))
433 {
434 // tmpxx[k] is same boundary (or corner) of xx.
435
436 neighbournormal = neighbours[j]->GetNormal(tmpgxx[k], true);
437 if (neighbournormal * gv < 0) isaccepted[j] = true;
438 }
439 }
440
441 // if nneighbours = 1, chabge isaccepted[1] before
442 // exiting neighboursurface loop.
443
444 if (nneighbours == 1) isaccepted[1] = true;
445
446 } // neighboursurface loop end
447
448 // now, we can accept xx intersection
449
450 if (isaccepted[0] == true && isaccepted[1] == true)
451 {
452 if (distance[i] < bestdistance)
453 {
454 bestdistance = distance[i];
455 gxxbest = gxx[i];
456#ifdef G4TWISTDEBUG
457 besti = i;
458 G4cout << " G4VTwistSurface::DistanceToIn(p,v): "
459 << " areacode sBoundary & sBoundary distance = "
460 << fName << " " << distance[i] << G4endl;
461#endif
462 }
463 }
464 } // else end
465 } // intersection loop end
466
467 gxxbest = bestgxx;
468
469#ifdef G4TWISTDEBUG
470 if (besti < 0)
471 {
472 G4cout << "~~~ G4VTwistSurface::DistanceToIn(p,v) - return ~~~" << G4endl;
473 G4cout << " No intersections " << G4endl;
474 G4cout << " Name : " << fName << G4endl;
475 G4cout << "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" << G4endl;
476 }
477 else
478 {
479 G4cout << "~~~ G4VTwistSurface::DistanceToIn(p,v) : return ~~~" << G4endl;
480 G4cout << " Name, i : " << fName << " , " << besti << G4endl;
481 G4cout << " gxx[i] : " << gxxbest << G4endl;
482 G4cout << " bestdist : " << bestdistance << G4endl;
483 G4cout << "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" << G4endl;
484 }
485
486#endif
487
488 return bestdistance;
489}
bool G4bool
Definition: G4Types.hh:86
G4VTwistSurface ** GetNeighbours()
G4bool IsInside(G4int areacode, G4bool testbitmode=false) const
G4bool IsSameBoundary(G4VTwistSurface *surface1, G4int areacode1, G4VTwistSurface *surface2, G4int areacode2) const
virtual G4ThreeVector GetNormal(const G4ThreeVector &xx, G4bool isGlobal)=0
static double normal(HepRandomEngine *eptr)
Definition: RandPoisson.cc:79

References G4VTwistSurface::DistanceToSurface(), G4VTwistSurface::fName, G4cout, G4endl, G4VSURFACENXX, G4VTwistSurface::GetNeighbours(), G4VTwistSurface::GetNormal(), G4VTwistSurface::IsInside(), G4VTwistSurface::IsSameBoundary(), kInfinity, G4VTwistSurface::kValidateWithTol, CLHEP::normal(), and G4VTwistSurface::sOutside.

Referenced by G4TwistedTubs::DistanceToIn(), and G4VTwistedFaceted::DistanceToIn().

◆ DistanceToLine()

G4double G4VTwistSurface::DistanceToLine ( const G4ThreeVector p,
const G4ThreeVector x0,
const G4ThreeVector d,
G4ThreeVector xx 
)
inlineinherited

◆ DistanceToOut()

G4double G4VTwistSurface::DistanceToOut ( const G4ThreeVector gp,
const G4ThreeVector gv,
G4ThreeVector gxxbest 
)
virtualinherited

Definition at line 494 of file G4VTwistSurface.cc.

497{
498#ifdef G4TWISTDEBUG
499 G4cout << "~~~~~ G4VTwistSurface::DistanceToOut(p,v) - Start ~~~~" << G4endl;
500 G4cout << " Name : " << fName << G4endl;
501 G4cout << " gp : " << gp << G4endl;
502 G4cout << " gv : " << gv << G4endl;
503 G4cout << "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" << G4endl;
504#endif
505
507 G4double distance[G4VSURFACENXX];
508 G4int areacode[G4VSURFACENXX];
509 G4bool isvalid[G4VSURFACENXX];
510
511 for ( G4int i = 0 ; i<G4VSURFACENXX ; ++i )
512 {
513 distance[i] = kInfinity ;
514 areacode[i] = sOutside ;
515 isvalid[i] = false ;
516 }
517
518 G4int nxx;
519 G4double bestdistance = kInfinity;
520
521 nxx = DistanceToSurface(gp, gv, gxx, distance, areacode,
522 isvalid, kValidateWithTol);
523
524 for (G4int i=0; i<nxx; ++i)
525 {
526 if (!(isvalid[i]))
527 {
528 continue;
529 }
530
531 G4ThreeVector normal = GetNormal(gxx[i], true);
532 if (normal * gv <= 0)
533 {
534 // particle goes toword inside of solid, return kInfinity
535#ifdef G4TWISTDEBUG
536 G4cout << " G4VTwistSurface::DistanceToOut(p,v): normal*gv < 0 "
537 << fName << " " << normal
538 << G4endl;
539#endif
540 }
541 else
542 {
543 // gxx[i] is accepted.
544 if (distance[i] < bestdistance)
545 {
546 bestdistance = distance[i];
547 gxxbest = gxx[i];
548 }
549 }
550 }
551
552#ifdef G4TWISTDEBUG
553 if (besti < 0)
554 {
555 G4cout << "~~ G4VTwistSurface::DistanceToOut(p,v) - return ~~" << G4endl;
556 G4cout << " No intersections " << G4endl;
557 G4cout << " Name : " << fName << G4endl;
558 G4cout << " bestdist : " << bestdistance << G4endl;
559 G4cout << "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" << G4endl;
560 }
561 else
562 {
563 G4cout << "~~ G4VTwistSurface::DistanceToOut(p,v) : return ~~" << G4endl;
564 G4cout << " Name, i : " << fName << " , " << i << G4endl;
565 G4cout << " gxx[i] : " << gxxbest << G4endl;
566 G4cout << " bestdist : " << bestdistance << G4endl;
567 G4cout << "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" << G4endl;
568 }
569#endif
570
571 return bestdistance;
572}

References G4VTwistSurface::DistanceToSurface(), G4VTwistSurface::fName, G4cout, G4endl, G4VSURFACENXX, G4VTwistSurface::GetNormal(), kInfinity, G4VTwistSurface::kValidateWithTol, CLHEP::normal(), and G4VTwistSurface::sOutside.

Referenced by G4TwistedTubs::DistanceToOut(), and G4VTwistedFaceted::DistanceToOut().

◆ DistanceToPlane() [1/2]

G4double G4VTwistSurface::DistanceToPlane ( const G4ThreeVector p,
const G4ThreeVector x0,
const G4ThreeVector n0,
G4ThreeVector xx 
)
inlineinherited

◆ DistanceToPlane() [2/2]

G4double G4VTwistSurface::DistanceToPlane ( const G4ThreeVector p,
const G4ThreeVector x0,
const G4ThreeVector t1,
const G4ThreeVector t2,
G4ThreeVector xx,
G4ThreeVector n 
)
inlineinherited

◆ DistanceToPlaneWithV()

G4double G4VTwistSurface::DistanceToPlaneWithV ( const G4ThreeVector p,
const G4ThreeVector v,
const G4ThreeVector x0,
const G4ThreeVector n0,
G4ThreeVector xx 
)
inlineinherited

◆ DistanceToSurface() [1/2]

G4int G4TwistTrapAlphaSide::DistanceToSurface ( const G4ThreeVector gp,
const G4ThreeVector gv,
G4ThreeVector  gxx[],
G4double  distance[],
G4int  areacode[],
G4bool  isvalid[],
EValidate  validate = kValidateWithTol 
)
virtual

Implements G4VTwistSurface.

Definition at line 188 of file G4TwistTrapAlphaSide.cc.

195{
196 static const G4double pihalf = pi/2 ;
197 const G4double ctol = 0.5 * kCarTolerance;
198
199 G4bool IsParallel = false ;
200 G4bool IsConverged = false ;
201
202 G4int nxx = 0 ; // number of physical solutions
203
204 fCurStatWithV.ResetfDone(validate, &gp, &gv);
205
206 if (fCurStatWithV.IsDone())
207 {
208 for (G4int i=0; i<fCurStatWithV.GetNXX(); ++i)
209 {
210 gxx[i] = fCurStatWithV.GetXX(i);
211 distance[i] = fCurStatWithV.GetDistance(i);
212 areacode[i] = fCurStatWithV.GetAreacode(i);
213 isvalid[i] = fCurStatWithV.IsValid(i);
214 }
215 return fCurStatWithV.GetNXX();
216 }
217 else // initialise
218 {
219 for (G4int j=0; j<G4VSURFACENXX ; ++j)
220 {
221 distance[j] = kInfinity;
222 areacode[j] = sOutside;
223 isvalid[j] = false;
225 }
226 }
227
230
231#ifdef G4TWISTDEBUG
232 G4cout << "Local point p = " << p << G4endl ;
233 G4cout << "Local direction v = " << v << G4endl ;
234#endif
235
236 G4double phi,u ; // parameters
237
238 // temporary variables
239
240 G4double tmpdist = kInfinity ;
241 G4ThreeVector tmpxx;
242 G4int tmpareacode = sOutside ;
243 G4bool tmpisvalid = false ;
244
245 std::vector<Intersection> xbuf ;
246 Intersection xbuftmp ;
247
248 // prepare some variables for the intersection finder
249
250 G4double L = 2*fDz ;
251
252 G4double phixz = fPhiTwist * ( p.x() * v.z() - p.z() * v.x() ) ;
253 G4double phiyz = fPhiTwist * ( p.y() * v.z() - p.z() * v.y() ) ;
254
255
256 // special case vz = 0
257
258 if ( v.z() == 0. )
259 {
260 if ( std::fabs(p.z()) <= L ) // intersection possible in z
261 {
262 phi = p.z() * fPhiTwist / L ; // phi is determined by the z-position
263 u = (fDy1*(4*(-(fdeltaY*phi*v.x()) + fPhiTwist*p.y()*v.x()
264 + fdeltaX*phi*v.y() - fPhiTwist*p.x()*v.y())
266 + 2*(fDx3minus1 + fDx4minus2)*phi)
267 *(v.y()*std::cos(phi) - v.x()*std::sin(phi))))
268 /(fPhiTwist*(4*fDy1* v.x() - (fa1md1 + 4*fDy1*fTAlph)*v.y())
269 *std::cos(phi) + fPhiTwist*(fa1md1*v.x()
270 + 4*fDy1*(fTAlph*v.x() + v.y()))*std::sin(phi));
271 xbuftmp.phi = phi ;
272 xbuftmp.u = u ;
273 xbuftmp.areacode = sOutside ;
274 xbuftmp.distance = kInfinity ;
275 xbuftmp.isvalid = false ;
276
277 xbuf.push_back(xbuftmp) ; // store it to xbuf
278 }
279 else // no intersection possible
280 {
281 distance[0] = kInfinity;
283 isvalid[0] = false ;
284 areacode[0] = sOutside ;
285 fCurStatWithV.SetCurrentStatus(0, gxx[0], distance[0],
286 areacode[0], isvalid[0],
287 0, validate, &gp, &gv);
288 return 0;
289 } // end std::fabs(p.z() <= L
290 } // end v.z() == 0
291 else // general solution for non-zero vz
292 {
293
294 G4double c[8],srd[7],si[7] ;
295
296 c[7] = 57600*
297 fDy1*(fa1md1*phiyz +
298 fDy1*(-4*phixz + 4*fTAlph*phiyz
299 + (fDx3plus1 + fDx4plus2)*fPhiTwist*v.z())) ;
300 c[6] = -57600*
301 fDy1*(4*fDy1*(phiyz + 2*fDz*v.x() + fTAlph*(phixz - 2*fDz*v.y()))
303 - 2*fdeltaY*fTAlph)*v.z()
304 + fa1md1*(phixz - 2*fDz*v.y() + fdeltaY*v.z()));
305 c[5] = 4800*
306 fDy1*(fa1md1*(-5*phiyz - 24*fDz*v.x() + 12*fdeltaX*v.z()) +
307 fDy1*(20*phixz - 4*(5*fTAlph*phiyz + 24*fDz*fTAlph*v.x()
308 + 24*fDz*v.y()) + (48*fdeltaY + (fDx3plus1 + fDx4plus2)
309 *fPhiTwist + 48*fdeltaX*fTAlph)*v.z()));
310 c[4] = 4800*
311 fDy1*(fa1md1*(phixz - 10*fDz*v.y() + 5*fdeltaY*v.z())
312 + 2*fDy1*(2*phiyz + 20*fDz*v.x()
313 + (-10*fdeltaX + fDx3minus1 + fDx4minus2)*v.z()
314 + 2*fTAlph*(phixz - 10*fDz*v.y() + 5*fdeltaY*v.z())));
315 c[3] = -96*
316 fDy1*(-(fa1md1*(phiyz + 100*fDz*v.x() - 50*fdeltaX*v.z()))
317 + fDy1*(4*phixz - 400*fDz*v.y()
318 + (200*fdeltaY - (fDx3plus1 + fDx4plus2)*fPhiTwist)*v.z()
319 - 4*fTAlph*(phiyz + 100*fDz*v.x() - 50*fdeltaX*v.z())));
320 c[2] = 32*
321 fDy1*(4*fDy1*(7*fTAlph*phixz + 7*phiyz - 6*fDz*v.x() + 6*fDz*fTAlph*v.y())
323 + fa1md1*(7*phixz + 6*fDz*v.y() - 3*fdeltaY*v.z()));
324 c[1] = -8*
325 fDy1*(fa1md1*(-9*phiyz - 56*fDz*v.x() + 28*fdeltaX*v.z())
326 + 4*fDy1*(9*phixz - 9*fTAlph*phiyz - 56*fDz*fTAlph*v.x()
327 - 56*fDz*v.y() + 28*(fdeltaY + fdeltaX*fTAlph)*v.z()));
328 c[0] = 72*
329 fDy1*(fa1md1*(2*fDz*v.y() - fdeltaY*v.z())
330 + fDy1*(-8*fDz*v.x() + 8*fDz*fTAlph*v.y()
331 + 4*fdeltaX*v.z() - 4*fdeltaY*fTAlph*v.z()));
332
333#ifdef G4TWISTDEBUG
334 G4cout << "coef = " << c[0] << " "
335 << c[1] << " "
336 << c[2] << " "
337 << c[3] << " "
338 << c[4] << " "
339 << c[5] << " "
340 << c[6] << " "
341 << c[7] << G4endl ;
342#endif
343
344 G4JTPolynomialSolver trapEq ;
345 G4int num = trapEq.FindRoots(c,7,srd,si);
346
347 for (G4int i = 0 ; i<num ; i++ ) // loop over all math solutions
348 {
349 if ( si[i]==0.0 ) // only real solutions
350 {
351#ifdef G4TWISTDEBUG
352 G4cout << "Solution " << i << " : " << srd[i] << G4endl ;
353#endif
354 phi = std::fmod(srd[i] , pihalf) ;
355 u = (fDy1*(4*(phiyz + 2*fDz*phi*v.y() - fdeltaY*phi*v.z())
357 + 2*(fDx3minus1 + fDx4minus2)*phi)*v.z()*std::sin(phi)))
358 /(fPhiTwist*v.z()*(4*fDy1*std::cos(phi)
359 + (fa1md1 + 4*fDy1*fTAlph)*std::sin(phi)));
360 xbuftmp.phi = phi ;
361 xbuftmp.u = u ;
362 xbuftmp.areacode = sOutside ;
363 xbuftmp.distance = kInfinity ;
364 xbuftmp.isvalid = false ;
365
366 xbuf.push_back(xbuftmp) ; // store it to xbuf
367
368#ifdef G4TWISTDEBUG
369 G4cout << "solution " << i << " = " << phi << " , " << u << G4endl ;
370#endif
371 } // end if real solution
372 } // end loop i
373 } // end general case
374
375 nxx = xbuf.size() ; // save the number of solutions
376
377 G4ThreeVector xxonsurface ; // point on surface
378 G4ThreeVector surfacenormal ; // normal vector
379 G4double deltaX; // distance between intersection point and point on surface
380 G4double theta; // angle between track and surfacenormal
381 G4double factor; // a scaling factor
382 G4int maxint=30; // number of iterations
383
384 for ( size_t k = 0 ; k<xbuf.size() ; ++k )
385 {
386#ifdef G4TWISTDEBUG
387 G4cout << "Solution " << k << " : "
388 << "reconstructed phiR = " << xbuf[k].phi
389 << ", uR = " << xbuf[k].u << G4endl ;
390#endif
391
392 phi = xbuf[k].phi ; // get the stored values for phi and u
393 u = xbuf[k].u ;
394
395 IsConverged = false ; // no convergence at the beginning
396
397 for ( G4int i = 1 ; i<maxint ; ++i )
398 {
399 xxonsurface = SurfacePoint(phi,u) ;
400 surfacenormal = NormAng(phi,u) ;
401
402 tmpdist = DistanceToPlaneWithV(p, v, xxonsurface, surfacenormal, tmpxx);
403 deltaX = ( tmpxx - xxonsurface ).mag() ;
404 theta = std::fabs(std::acos(v*surfacenormal) - pihalf) ;
405 if ( theta < 0.001 )
406 {
407 factor = 50 ;
408 IsParallel = true ;
409 }
410 else
411 {
412 factor = 1 ;
413 }
414
415#ifdef G4TWISTDEBUG
416 G4cout << "Step i = " << i << ", distance = " << tmpdist
417 << ", " << deltaX << G4endl ;
418 G4cout << "X = " << tmpxx << G4endl ;
419#endif
420
421 GetPhiUAtX(tmpxx, phi, u) ;
422 // the new point xx is accepted and phi/u replaced
423
424#ifdef G4TWISTDEBUG
425 G4cout << "approximated phi = " << phi << ", u = " << u << G4endl ;
426#endif
427
428 if ( deltaX <= factor*ctol ) { IsConverged = true ; break ; }
429
430 } // end iterative loop (i)
431
432 if ( std::fabs(tmpdist)<ctol ) { tmpdist = 0 ; }
433
434#ifdef G4TWISTDEBUG
435 G4cout << "refined solution " << phi << " , " << u << G4endl ;
436 G4cout << "distance = " << tmpdist << G4endl ;
437 G4cout << "local X = " << tmpxx << G4endl ;
438#endif
439
440 tmpisvalid = false ; // init
441
442 if ( IsConverged )
443 {
444 if (validate == kValidateWithTol)
445 {
446 tmpareacode = GetAreaCode(tmpxx);
447 if (!IsOutside(tmpareacode))
448 {
449 if (tmpdist >= 0) tmpisvalid = true;
450 }
451 }
452 else if (validate == kValidateWithoutTol)
453 {
454 tmpareacode = GetAreaCode(tmpxx, false);
455 if (IsInside(tmpareacode))
456 {
457 if (tmpdist >= 0) { tmpisvalid = true; }
458 }
459 }
460 else // kDontValidate
461 {
462 G4Exception("G4TwistTrapAlphaSide::DistanceToSurface()",
463 "GeomSolids0001", FatalException,
464 "Feature NOT implemented !");
465 }
466 }
467 else
468 {
469 tmpdist = kInfinity; // no convergence after 10 steps
470 tmpisvalid = false ; // solution is not vaild
471 }
472
473 // store the found values
474 //
475 xbuf[k].xx = tmpxx ;
476 xbuf[k].distance = tmpdist ;
477 xbuf[k].areacode = tmpareacode ;
478 xbuf[k].isvalid = tmpisvalid ;
479
480 } // end loop over physical solutions (variable k)
481
482 std::sort(xbuf.begin() , xbuf.end(), DistanceSort ) ; // sorting
483
484#ifdef G4TWISTDEBUG
485 G4cout << G4endl << "list xbuf after sorting : " << G4endl ;
486 G4cout << G4endl << G4endl ;
487#endif
488
489 // erase identical intersection (within kCarTolerance)
490 //
491 xbuf.erase( std::unique(xbuf.begin(), xbuf.end() , EqualIntersection ),
492 xbuf.end() );
493
494
495 // add guesses
496 //
497 G4int nxxtmp = xbuf.size() ;
498
499 if ( nxxtmp<2 || IsParallel ) // positive end
500 {
501
502#ifdef G4TWISTDEBUG
503 G4cout << "add guess at +z/2 .. " << G4endl ;
504#endif
505
506 phi = fPhiTwist/2 ;
507 u = 0 ;
508
509 xbuftmp.phi = phi ;
510 xbuftmp.u = u ;
511 xbuftmp.areacode = sOutside ;
512 xbuftmp.distance = kInfinity ;
513 xbuftmp.isvalid = false ;
514
515 xbuf.push_back(xbuftmp) ; // store it to xbuf
516
517#ifdef G4TWISTDEBUG
518 G4cout << "add guess at -z/2 .. " << G4endl ;
519#endif
520
521 phi = -fPhiTwist/2 ;
522 u = 0 ;
523
524 xbuftmp.phi = phi ;
525 xbuftmp.u = u ;
526 xbuftmp.areacode = sOutside ;
527 xbuftmp.distance = kInfinity ;
528 xbuftmp.isvalid = false ;
529
530 xbuf.push_back(xbuftmp) ; // store it to xbuf
531
532 for ( size_t k = nxxtmp ; k<xbuf.size() ; ++k )
533 {
534
535#ifdef G4TWISTDEBUG
536 G4cout << "Solution " << k << " : "
537 << "reconstructed phiR = " << xbuf[k].phi
538 << ", uR = " << xbuf[k].u << G4endl ;
539#endif
540
541 phi = xbuf[k].phi ; // get the stored values for phi and u
542 u = xbuf[k].u ;
543
544 IsConverged = false ; // no convergence at the beginning
545
546 for ( G4int i = 1 ; i<maxint ; ++i )
547 {
548 xxonsurface = SurfacePoint(phi,u) ;
549 surfacenormal = NormAng(phi,u) ;
550 tmpdist = DistanceToPlaneWithV(p, v, xxonsurface, surfacenormal, tmpxx);
551 deltaX = ( tmpxx - xxonsurface ).mag();
552 theta = std::fabs(std::acos(v*surfacenormal) - pihalf);
553 if ( theta < 0.001 )
554 {
555 factor = 50 ;
556 }
557 else
558 {
559 factor = 1 ;
560 }
561
562#ifdef G4TWISTDEBUG
563 G4cout << "Step i = " << i << ", distance = " << tmpdist
564 << ", " << deltaX << G4endl
565 << "X = " << tmpxx << G4endl ;
566#endif
567
568 GetPhiUAtX(tmpxx, phi, u) ;
569 // the new point xx is accepted and phi/u replaced
570
571#ifdef G4TWISTDEBUG
572 G4cout << "approximated phi = " << phi << ", u = " << u << G4endl ;
573#endif
574
575 if ( deltaX <= factor*ctol ) { IsConverged = true ; break ; }
576
577 } // end iterative loop (i)
578
579 if ( std::fabs(tmpdist)<ctol ) { tmpdist = 0; }
580
581#ifdef G4TWISTDEBUG
582 G4cout << "refined solution " << phi << " , " << u << G4endl ;
583 G4cout << "distance = " << tmpdist << G4endl ;
584 G4cout << "local X = " << tmpxx << G4endl ;
585#endif
586
587 tmpisvalid = false ; // init
588
589 if ( IsConverged )
590 {
591 if (validate == kValidateWithTol)
592 {
593 tmpareacode = GetAreaCode(tmpxx);
594 if (!IsOutside(tmpareacode))
595 {
596 if (tmpdist >= 0) { tmpisvalid = true; }
597 }
598 }
599 else if (validate == kValidateWithoutTol)
600 {
601 tmpareacode = GetAreaCode(tmpxx, false);
602 if (IsInside(tmpareacode))
603 {
604 if (tmpdist >= 0) { tmpisvalid = true; }
605 }
606 }
607 else // kDontValidate
608 {
609 G4Exception("G4TwistedBoxSide::DistanceToSurface()",
610 "GeomSolids0001", FatalException,
611 "Feature NOT implemented !");
612 }
613 }
614 else
615 {
616 tmpdist = kInfinity; // no convergence after 10 steps
617 tmpisvalid = false ; // solution is not vaild
618 }
619
620 // store the found values
621 //
622 xbuf[k].xx = tmpxx ;
623 xbuf[k].distance = tmpdist ;
624 xbuf[k].areacode = tmpareacode ;
625 xbuf[k].isvalid = tmpisvalid ;
626
627 } // end loop over physical solutions
628 } // end less than 2 solutions
629
630 // sort again
631 std::sort(xbuf.begin() , xbuf.end(), DistanceSort ) ; // sorting
632
633 // erase identical intersection (within kCarTolerance)
634 xbuf.erase( std::unique(xbuf.begin(), xbuf.end() , EqualIntersection ) ,
635 xbuf.end() );
636
637#ifdef G4TWISTDEBUG
638 G4cout << G4endl << "list xbuf after sorting : " << G4endl ;
639 G4cout << G4endl << G4endl ;
640#endif
641
642 nxx = xbuf.size() ; // determine number of solutions again.
643
644 for ( size_t i = 0 ; i<xbuf.size() ; ++i )
645 {
646 distance[i] = xbuf[i].distance;
647 gxx[i] = ComputeGlobalPoint(xbuf[i].xx);
648 areacode[i] = xbuf[i].areacode ;
649 isvalid[i] = xbuf[i].isvalid ;
650
651 fCurStatWithV.SetCurrentStatus(i, gxx[i], distance[i], areacode[i],
652 isvalid[i], nxx, validate, &gp, &gv);
653#ifdef G4TWISTDEBUG
654 G4cout << "element Nr. " << i
655 << ", local Intersection = " << xbuf[i].xx
656 << ", distance = " << xbuf[i].distance
657 << ", u = " << xbuf[i].u
658 << ", phi = " << xbuf[i].phi
659 << ", isvalid = " << xbuf[i].isvalid
660 << G4endl ;
661#endif
662
663 } // end for( i ) loop
664
665#ifdef G4TWISTDEBUG
666 G4cout << "G4TwistTrapAlphaSide finished " << G4endl ;
667 G4cout << nxx << " possible physical solutions found" << G4endl ;
668 for ( G4int k= 0 ; k< nxx ; k++ )
669 {
670 G4cout << "global intersection Point found: " << gxx[k] << G4endl ;
671 G4cout << "distance = " << distance[k] << G4endl ;
672 G4cout << "isvalid = " << isvalid[k] << G4endl ;
673 }
674#endif
675
676 return nxx ;
677}
static constexpr double L
Definition: G4SIunits.hh:104
static constexpr double pi
Definition: G4SIunits.hh:55
G4bool DistanceSort(const Intersection &a, const Intersection &b)
G4bool EqualIntersection(const Intersection &a, const Intersection &b)
G4int FindRoots(G4double *op, G4int degree, G4double *zeror, G4double *zeroi)
virtual G4int GetAreaCode(const G4ThreeVector &xx, G4bool withTol=true)
virtual G4ThreeVector SurfacePoint(G4double phi, G4double u, G4bool isGlobal=false)
void GetPhiUAtX(G4ThreeVector p, G4double &phi, G4double &u)
G4ThreeVector NormAng(G4double phi, G4double u)
G4int GetAreacode(G4int i) const
G4double GetDistance(G4int i) const
G4bool IsValid(G4int i) const
void SetCurrentStatus(G4int i, G4ThreeVector &xx, G4double &dist, G4int &areacode, G4bool &isvalid, G4int nxx, EValidate validate, const G4ThreeVector *p, const G4ThreeVector *v=nullptr)
G4ThreeVector GetXX(G4int i) const
void ResetfDone(EValidate validate, const G4ThreeVector *p, const G4ThreeVector *v=nullptr)
G4ThreeVector ComputeLocalDirection(const G4ThreeVector &gp) const
G4ThreeVector ComputeLocalPoint(const G4ThreeVector &gp) const
G4bool IsOutside(G4int areacode) const
CurrentStatus fCurStatWithV
G4double DistanceToPlaneWithV(const G4ThreeVector &p, const G4ThreeVector &v, const G4ThreeVector &x0, const G4ThreeVector &n0, G4ThreeVector &xx)
G4ThreeVector ComputeGlobalPoint(const G4ThreeVector &lp) const

References Intersection::areacode, G4VTwistSurface::ComputeGlobalPoint(), G4VTwistSurface::ComputeLocalDirection(), G4VTwistSurface::ComputeLocalPoint(), Intersection::distance, DistanceSort(), G4VTwistSurface::DistanceToPlaneWithV(), EqualIntersection(), fa1md1, FatalException, G4VTwistSurface::fCurStatWithV, fdeltaX, fdeltaY, fDx3minus1, fDx3plus1, fDx4minus2, fDx4plus2, fDy1, fDz, G4JTPolynomialSolver::FindRoots(), fPhiTwist, fTAlph, G4cout, G4endl, G4Exception(), G4VSURFACENXX, GetAreaCode(), G4VTwistSurface::CurrentStatus::GetAreacode(), G4VTwistSurface::CurrentStatus::GetDistance(), G4VTwistSurface::CurrentStatus::GetNXX(), GetPhiUAtX(), G4VTwistSurface::CurrentStatus::GetXX(), G4VTwistSurface::CurrentStatus::IsDone(), G4VTwistSurface::IsInside(), G4VTwistSurface::IsOutside(), G4VTwistSurface::CurrentStatus::IsValid(), Intersection::isvalid, G4VTwistSurface::kCarTolerance, kInfinity, G4VTwistSurface::kValidateWithoutTol, G4VTwistSurface::kValidateWithTol, L, NormAng(), Intersection::phi, pi, G4VTwistSurface::CurrentStatus::ResetfDone(), CLHEP::Hep3Vector::set(), G4VTwistSurface::CurrentStatus::SetCurrentStatus(), G4VTwistSurface::sOutside, SurfacePoint(), Intersection::u, CLHEP::Hep3Vector::x(), CLHEP::Hep3Vector::y(), and CLHEP::Hep3Vector::z().

◆ DistanceToSurface() [2/2]

G4int G4TwistTrapAlphaSide::DistanceToSurface ( const G4ThreeVector gp,
G4ThreeVector  gxx[],
G4double  distance[],
G4int  areacode[] 
)
virtual

Implements G4VTwistSurface.

Definition at line 684 of file G4TwistTrapAlphaSide.cc.

688{
689 const G4double ctol = 0.5 * kCarTolerance;
690
692
693 if (fCurStat.IsDone())
694 {
695 for (G4int i=0; i<fCurStat.GetNXX(); ++i)
696 {
697 gxx[i] = fCurStat.GetXX(i);
698 distance[i] = fCurStat.GetDistance(i);
699 areacode[i] = fCurStat.GetAreacode(i);
700 }
701 return fCurStat.GetNXX();
702 }
703 else // initialize
704 {
705 for (G4int i=0; i<G4VSURFACENXX; ++i)
706 {
707 distance[i] = kInfinity;
708 areacode[i] = sOutside;
710 }
711 }
712
714 G4ThreeVector xx; // intersection point
715 G4ThreeVector xxonsurface ; // interpolated intersection point
716
717 // the surfacenormal at that surface point
718 //
719 G4double phiR = 0 ;
720 G4double uR = 0 ;
721
722 G4ThreeVector surfacenormal ;
723 G4double deltaX, uMax ;
724 G4double halfphi = 0.5*fPhiTwist ;
725
726 for ( G4int i = 1 ; i<20 ; ++i )
727 {
728 xxonsurface = SurfacePoint(phiR,uR) ;
729 surfacenormal = NormAng(phiR,uR) ;
730 distance[0] = DistanceToPlane(p,xxonsurface,surfacenormal,xx); // new XX
731 deltaX = ( xx - xxonsurface ).mag() ;
732
733#ifdef G4TWISTDEBUG
734 G4cout << "i = " << i << ", distance = " << distance[0]
735 << ", " << deltaX << G4endl
736 << "X = " << xx << G4endl ;
737#endif
738
739 // the new point xx is accepted and phi/psi replaced
740 //
741 GetPhiUAtX(xx, phiR, uR) ;
742
743 if ( deltaX <= ctol ) { break ; }
744 }
745
746 // check validity of solution ( valid phi,psi )
747
748 uMax = GetBoundaryMax(phiR) ;
749
750 if ( phiR > halfphi ) { phiR = halfphi ; }
751 if ( phiR < -halfphi ) { phiR = -halfphi ; }
752 if ( uR > uMax ) { uR = uMax ; }
753 if ( uR < -uMax ) { uR = -uMax ; }
754
755 xxonsurface = SurfacePoint(phiR,uR) ;
756 distance[0] = ( p - xx ).mag() ;
757 if ( distance[0] <= ctol ) { distance[0] = 0 ; }
758
759 // end of validity
760
761#ifdef G4TWISTDEBUG
762 G4cout << "refined solution " << phiR << " , " << uR << " , " << G4endl ;
763 G4cout << "distance = " << distance[0] << G4endl ;
764 G4cout << "X = " << xx << G4endl ;
765#endif
766
767 G4bool isvalid = true;
768 gxx[0] = ComputeGlobalPoint(xx);
769
770#ifdef G4TWISTDEBUG
771 G4cout << "intersection Point found: " << gxx[0] << G4endl ;
772 G4cout << "distance = " << distance[0] << G4endl ;
773#endif
774
775 fCurStat.SetCurrentStatus(0, gxx[0], distance[0], areacode[0],
776 isvalid, 1, kDontValidate, &gp);
777 return 1;
778}
virtual G4double GetBoundaryMax(G4double phi)
G4double DistanceToPlane(const G4ThreeVector &p, const G4ThreeVector &x0, const G4ThreeVector &n0, G4ThreeVector &xx)
CurrentStatus fCurStat

References G4VTwistSurface::ComputeGlobalPoint(), G4VTwistSurface::ComputeLocalPoint(), G4VTwistSurface::DistanceToPlane(), G4VTwistSurface::fCurStat, fPhiTwist, G4cout, G4endl, G4VSURFACENXX, G4VTwistSurface::CurrentStatus::GetAreacode(), GetBoundaryMax(), G4VTwistSurface::CurrentStatus::GetDistance(), G4VTwistSurface::CurrentStatus::GetNXX(), GetPhiUAtX(), G4VTwistSurface::CurrentStatus::GetXX(), G4VTwistSurface::CurrentStatus::IsDone(), G4VTwistSurface::kCarTolerance, G4VTwistSurface::kDontValidate, kInfinity, NormAng(), G4VTwistSurface::CurrentStatus::ResetfDone(), CLHEP::Hep3Vector::set(), G4VTwistSurface::CurrentStatus::SetCurrentStatus(), G4VTwistSurface::sOutside, and SurfacePoint().

◆ GetAreaCode()

G4int G4TwistTrapAlphaSide::GetAreaCode ( const G4ThreeVector xx,
G4bool  withTol = true 
)
privatevirtual

Implements G4VTwistSurface.

Definition at line 785 of file G4TwistTrapAlphaSide.cc.

786{
787 // We must use the function in local coordinate system.
788 // See the description of DistanceToSurface(p,v).
789
790 const G4double ctol = 0.5 * kCarTolerance;
791
792 G4double phi ;
793 G4double yprime ;
794 GetPhiUAtX(xx, phi,yprime ) ;
795
796 G4double fYAxisMax = GetBoundaryMax(phi) ;
797 G4double fYAxisMin = GetBoundaryMin(phi) ;
798
799#ifdef G4TWISTDEBUG
800 G4cout << "GetAreaCode: phi = " << phi << G4endl ;
801 G4cout << "GetAreaCode: yprime = " << yprime << G4endl ;
802 G4cout << "Intervall is " << fYAxisMin << " to " << fYAxisMax << G4endl ;
803#endif
804
805 G4int areacode = sInside;
806
807 if (fAxis[0] == kYAxis && fAxis[1] == kZAxis)
808 {
809 G4int zaxis = 1;
810
811 if (withTol)
812 {
813 G4bool isoutside = false;
814
815 // test boundary of yaxis
816
817 if (yprime < fYAxisMin + ctol)
818 {
819 areacode |= (sAxis0 & (sAxisY | sAxisMin)) | sBoundary;
820 if (yprime <= fYAxisMin - ctol) { isoutside = true; }
821
822 }
823 else if (yprime > fYAxisMax - ctol)
824 {
825 areacode |= (sAxis0 & (sAxisY | sAxisMax)) | sBoundary;
826 if (yprime >= fYAxisMax + ctol) { isoutside = true; }
827 }
828
829 // test boundary of z-axis
830
831 if (xx.z() < fAxisMin[zaxis] + ctol)
832 {
833 areacode |= (sAxis1 & (sAxisZ | sAxisMin));
834
835 if (areacode & sBoundary) // xx is on the corner
836 { areacode |= sCorner; }
837
838 else
839 { areacode |= sBoundary; }
840 if (xx.z() <= fAxisMin[zaxis] - ctol) { isoutside = true; }
841 }
842 else if (xx.z() > fAxisMax[zaxis] - ctol)
843 {
844 areacode |= (sAxis1 & (sAxisZ | sAxisMax));
845
846 if (areacode & sBoundary) // xx is on the corner
847 { areacode |= sCorner; }
848 else
849 { areacode |= sBoundary; }
850 if (xx.z() >= fAxisMax[zaxis] + ctol) { isoutside = true; }
851 }
852
853 // if isoutside = true, clear inside bit.
854 // if not on boundary, add axis information.
855
856 if (isoutside)
857 {
858 G4int tmpareacode = areacode & (~sInside);
859 areacode = tmpareacode;
860 }
861 else if ((areacode & sBoundary) != sBoundary)
862 {
863 areacode |= (sAxis0 & sAxisY) | (sAxis1 & sAxisZ);
864 }
865
866 }
867 else
868 {
869 // boundary of y-axis
870
871 if (yprime < fYAxisMin )
872 {
873 areacode |= (sAxis0 & (sAxisY | sAxisMin)) | sBoundary;
874 }
875 else if (yprime > fYAxisMax)
876 {
877 areacode |= (sAxis0 & (sAxisY | sAxisMax)) | sBoundary;
878 }
879
880 // boundary of z-axis
881
882 if (xx.z() < fAxisMin[zaxis])
883 {
884 areacode |= (sAxis1 & (sAxisZ | sAxisMin));
885 if (areacode & sBoundary) // xx is on the corner
886 { areacode |= sCorner; }
887 else
888 { areacode |= sBoundary; }
889 }
890 else if (xx.z() > fAxisMax[zaxis])
891 {
892 areacode |= (sAxis1 & (sAxisZ | sAxisMax)) ;
893 if (areacode & sBoundary) // xx is on the corner
894 { areacode |= sCorner; }
895 else
896 { areacode |= sBoundary; }
897 }
898
899 if ((areacode & sBoundary) != sBoundary)
900 {
901 areacode |= (sAxis0 & sAxisY) | (sAxis1 & sAxisZ);
902 }
903 }
904 return areacode;
905 }
906 else
907 {
908 G4Exception("G4TwistTrapAlphaSide::GetAreaCode()",
909 "GeomSolids0001", FatalException,
910 "Feature NOT implemented !");
911 }
912 return areacode;
913}
virtual G4double GetBoundaryMin(G4double phi)
static const G4int sAxisMax
static const G4int sAxis0
static const G4int sAxisMin
static const G4int sAxis1
static const G4int sBoundary
static const G4int sAxisZ
static const G4int sCorner
static const G4int sInside
static const G4int sAxisY

References FatalException, G4VTwistSurface::fAxis, G4VTwistSurface::fAxisMax, G4VTwistSurface::fAxisMin, G4cout, G4endl, G4Exception(), GetBoundaryMax(), GetBoundaryMin(), GetPhiUAtX(), G4VTwistSurface::kCarTolerance, kYAxis, kZAxis, G4VTwistSurface::sAxis0, G4VTwistSurface::sAxis1, G4VTwistSurface::sAxisMax, G4VTwistSurface::sAxisMin, G4VTwistSurface::sAxisY, G4VTwistSurface::sAxisZ, G4VTwistSurface::sBoundary, G4VTwistSurface::sCorner, G4VTwistSurface::sInside, and CLHEP::Hep3Vector::z().

Referenced by DistanceToSurface().

◆ GetAxisType()

G4int G4VTwistSurface::GetAxisType ( G4int  areacode,
G4int  whichaxis 
) const
inlineinherited

◆ GetBoundaryAtPZ()

G4ThreeVector G4VTwistSurface::GetBoundaryAtPZ ( G4int  areacode,
const G4ThreeVector p 
) const
virtualinherited

Definition at line 698 of file G4VTwistSurface.cc.

700{
701 // areacode must be one of them:
702 // sAxis0 & sAxisMin, sAxis0 & sAxisMax,
703 // sAxis1 & sAxisMin, sAxis1 & sAxisMax.
704
705 if (areacode & sAxis0 && areacode & sAxis1)
706 {
707 std::ostringstream message;
708 message << "Point is in the corner area." << G4endl
709 << " This function returns "
710 << "a direction vector of a boundary line." << G4endl
711 << " areacode = " << areacode;
712 G4Exception("G4VTwistSurface::GetBoundaryAtPZ()", "GeomSolids0003",
713 FatalException, message);
714 }
715
717 G4ThreeVector x0;
718 G4int boundarytype;
719 G4bool found = false;
720
721 for (G4int i=0; i<4; ++i)
722 {
723 if (fBoundaries[i].GetBoundaryParameters(areacode, d, x0,
724 boundarytype))
725 {
726 found = true;
727 continue;
728 }
729 }
730
731 if (!found)
732 {
733 std::ostringstream message;
734 message << "Not registered boundary." << G4endl
735 << " Boundary at areacode " << areacode << G4endl
736 << " is not registered.";
737 G4Exception("G4VTwistSurface::GetBoundaryAtPZ()", "GeomSolids0002",
738 FatalException, message);
739 }
740
741 if (((boundarytype & sAxisPhi) == sAxisPhi) ||
742 ((boundarytype & sAxisRho) == sAxisRho))
743 {
744 std::ostringstream message;
745 message << "Not a z-depended line boundary." << G4endl
746 << " Boundary at areacode " << areacode << G4endl
747 << " is not a z-depended line.";
748 G4Exception("G4VTwistSurface::GetBoundaryAtPZ()", "GeomSolids0002",
749 FatalException, message);
750 }
751 return ((p.z() - x0.z()) / d.z()) * d + x0;
752}
Boundary fBoundaries[4]
static const G4int sAxisRho

References FatalException, G4VTwistSurface::fBoundaries, G4endl, G4Exception(), G4VTwistSurface::GetBoundaryParameters(), G4VTwistSurface::sAxis0, G4VTwistSurface::sAxis1, G4VTwistSurface::sAxisPhi, G4VTwistSurface::sAxisRho, and CLHEP::Hep3Vector::z().

Referenced by G4TwistTubsSide::DistanceToSurface(), G4TwistTubsHypeSide::GetAreaCodeInPhi(), G4TwistTubsHypeSide::GetBoundaryMax(), and G4TwistTubsHypeSide::GetBoundaryMin().

◆ GetBoundaryAxis()

void G4VTwistSurface::GetBoundaryAxis ( G4int  areacode,
EAxis  axis[] 
) const
protectedinherited

Definition at line 783 of file G4VTwistSurface.cc.

784{
785 if ((areacode & sBoundary) != sBoundary) {
786 G4Exception("G4VTwistSurface::GetBoundaryAxis()", "GeomSolids0003",
787 FatalException, "Not located on a boundary!");
788 }
789 for (G4int i=0; i<2; ++i)
790 {
791 G4int whichaxis = 0 ;
792 if (i == 0) {
793 whichaxis = sAxis0;
794 } else if (i == 1) {
795 whichaxis = sAxis1;
796 }
797
798 // extracted axiscode of whichaxis
799 G4int axiscode = whichaxis & sAxisMask & areacode ;
800 if (axiscode) {
801 if (axiscode == (whichaxis & sAxisX)) {
802 axis[i] = kXAxis;
803 } else if (axiscode == (whichaxis & sAxisY)) {
804 axis[i] = kYAxis;
805 } else if (axiscode == (whichaxis & sAxisZ)) {
806 axis[i] = kZAxis;
807 } else if (axiscode == (whichaxis & sAxisRho)) {
808 axis[i] = kRho;
809 } else if (axiscode == (whichaxis & sAxisPhi)) {
810 axis[i] = kPhi;
811 } else {
812 std::ostringstream message;
813 message << "Not supported areacode." << G4endl
814 << " areacode " << areacode;
815 G4Exception("G4VTwistSurface::GetBoundaryAxis()", "GeomSolids0001",
816 FatalException, message);
817 }
818 }
819 }
820}
static const G4int sAxisMask
static const G4int sAxisX
@ kPhi
Definition: geomdefs.hh:60
@ kXAxis
Definition: geomdefs.hh:55
@ kRho
Definition: geomdefs.hh:58

References FatalException, G4endl, G4Exception(), kPhi, kRho, kXAxis, kYAxis, kZAxis, G4VTwistSurface::sAxis0, G4VTwistSurface::sAxis1, G4VTwistSurface::sAxisMask, G4VTwistSurface::sAxisPhi, G4VTwistSurface::sAxisRho, G4VTwistSurface::sAxisX, G4VTwistSurface::sAxisY, G4VTwistSurface::sAxisZ, and G4VTwistSurface::sBoundary.

◆ GetBoundaryLimit()

void G4VTwistSurface::GetBoundaryLimit ( G4int  areacode,
G4double  limit[] 
) const
protectedinherited

Definition at line 825 of file G4VTwistSurface.cc.

826{
827 if (areacode & sCorner) {
828 if (areacode & sC0Min1Min) {
829 limit[0] = fAxisMin[0];
830 limit[1] = fAxisMin[1];
831 } else if (areacode & sC0Max1Min) {
832 limit[0] = fAxisMax[0];
833 limit[1] = fAxisMin[1];
834 } else if (areacode & sC0Max1Max) {
835 limit[0] = fAxisMax[0];
836 limit[1] = fAxisMax[1];
837 } else if (areacode & sC0Min1Max) {
838 limit[0] = fAxisMin[0];
839 limit[1] = fAxisMax[1];
840 }
841 } else if (areacode & sBoundary) {
842 if (areacode & (sAxis0 | sAxisMin)) {
843 limit[0] = fAxisMin[0];
844 } else if (areacode & (sAxis1 | sAxisMin)) {
845 limit[0] = fAxisMin[1];
846 } else if (areacode & (sAxis0 | sAxisMax)) {
847 limit[0] = fAxisMax[0];
848 } else if (areacode & (sAxis1 | sAxisMax)) {
849 limit[0] = fAxisMax[1];
850 }
851 } else {
852 std::ostringstream message;
853 message << "Not located on a boundary!" << G4endl
854 << " areacode " << areacode;
855 G4Exception("G4VTwistSurface::GetBoundaryLimit()", "GeomSolids1002",
856 JustWarning, message);
857 }
858}
@ JustWarning

References G4VTwistSurface::fAxisMax, G4VTwistSurface::fAxisMin, G4endl, G4Exception(), JustWarning, G4VTwistSurface::sAxis0, G4VTwistSurface::sAxis1, G4VTwistSurface::sAxisMax, G4VTwistSurface::sAxisMin, G4VTwistSurface::sBoundary, G4VTwistSurface::sC0Max1Max, G4VTwistSurface::sC0Max1Min, G4VTwistSurface::sC0Min1Max, G4VTwistSurface::sC0Min1Min, and G4VTwistSurface::sCorner.

◆ GetBoundaryMax()

G4double G4TwistTrapAlphaSide::GetBoundaryMax ( G4double  phi)
inlineprivatevirtual

Implements G4VTwistSurface.

Definition at line 200 of file G4TwistTrapAlphaSide.hh.

201{
202 return 0.5*GetValueB(phi) ;
203}
G4double GetValueB(G4double phi)

References GetValueB().

Referenced by DistanceToSurface(), and GetAreaCode().

◆ GetBoundaryMin()

G4double G4TwistTrapAlphaSide::GetBoundaryMin ( G4double  phi)
inlineprivatevirtual

Implements G4VTwistSurface.

Definition at line 194 of file G4TwistTrapAlphaSide.hh.

195{
196 return -0.5*GetValueB(phi) ;
197}

References GetValueB().

Referenced by GetAreaCode().

◆ GetBoundaryParameters()

void G4VTwistSurface::GetBoundaryParameters ( const G4int areacode,
G4ThreeVector d,
G4ThreeVector x0,
G4int boundarytype 
) const
virtualinherited

Definition at line 668 of file G4VTwistSurface.cc.

672{
673 // areacode must be one of them:
674 // sAxis0 & sAxisMin, sAxis0 & sAxisMax,
675 // sAxis1 & sAxisMin, sAxis1 & sAxisMax.
676
677 for (G4int i=0; i<4; ++i)
678 {
679 if (fBoundaries[i].GetBoundaryParameters(areacode, d, x0,
680 boundarytype))
681 {
682 return;
683 }
684 }
685
686 std::ostringstream message;
687 message << "Not registered boundary." << G4endl
688 << " Boundary at areacode " << std::hex << areacode
689 << std::dec << G4endl
690 << " is not registered.";
691 G4Exception("G4VTwistSurface::GetBoundaryParameters()", "GeomSolids0002",
692 FatalException, message);
693}

References FatalException, G4VTwistSurface::fBoundaries, G4endl, G4Exception(), and G4VTwistSurface::GetBoundaryParameters().

Referenced by G4VTwistSurface::DistanceToBoundary(), G4TwistTubsSide::DistanceToSurface(), G4VTwistSurface::GetBoundaryAtPZ(), G4VTwistSurface::GetBoundaryParameters(), and G4VTwistSurface::IsSameBoundary().

◆ GetCorner()

G4ThreeVector G4VTwistSurface::GetCorner ( G4int  areacode) const
inlineprotectedinherited

◆ GetEdgeVisibility()

G4int G4VTwistSurface::GetEdgeVisibility ( G4int  i,
G4int  j,
G4int  m,
G4int  n,
G4int  number,
G4int  orientation 
)
inherited

Definition at line 1031 of file G4VTwistSurface.cc.

1033{
1034 // clockwise filling -> positive orientation
1035 // counter clockwise filling -> negative orientation
1036
1037 //
1038 // d C c
1039 // +------+
1040 // | |
1041 // | |
1042 // | |
1043 // D | |B
1044 // | |
1045 // | |
1046 // | |
1047 // +------+
1048 // a A b
1049 //
1050 // a = +--+ A = ---+
1051 // b = --++ B = --+-
1052 // c = -++- C = -+--
1053 // d = ++-- D = +---
1054
1055
1056 // check first invisible faces
1057
1058 if ( ( i>0 && i<n-2 ) && ( j>0 && j<k-2 ) )
1059 {
1060 return -1 ; // always invisible, signs: ----
1061 }
1062
1063 // change first the vertex number (depends on the orientation)
1064 // 0,1,2,3 -> 3,2,1,0
1065 if ( orientation < 0 ) { number = ( 3 - number ) ; }
1066
1067 // check true edges
1068 if ( ( j>=1 && j<=k-3 ) )
1069 {
1070 if ( i == 0 ) { // signs (A): ---+
1071 return ( number == 3 ) ? 1 : -1 ;
1072 }
1073
1074 else if ( i == n-2 ) { // signs (C): -+--
1075 return ( number == 1 ) ? 1 : -1 ;
1076 }
1077
1078 else
1079 {
1080 std::ostringstream message;
1081 message << "Not correct face number: " << GetName() << " !";
1082 G4Exception("G4TwistSurface::G4GetEdgeVisibility()",
1083 "GeomSolids0003", FatalException, message);
1084 }
1085 }
1086
1087 if ( ( i>=1 && i<=n-3 ) )
1088 {
1089 if ( j == 0 ) { // signs (D): +---
1090 return ( number == 0 ) ? 1 : -1 ;
1091 }
1092
1093 else if ( j == k-2 ) { // signs (B): --+-
1094 return ( number == 2 ) ? 1 : -1 ;
1095 }
1096
1097 else
1098 {
1099 std::ostringstream message;
1100 message << "Not correct face number: " << GetName() << " !";
1101 G4Exception("G4TwistSurface::G4GetEdgeVisibility()",
1102 "GeomSolids0003", FatalException, message);
1103 }
1104 }
1105
1106 // now the corners
1107 if ( i == 0 && j == 0 ) { // signs (a) : +--+
1108 return ( number == 0 || number == 3 ) ? 1 : -1 ;
1109 }
1110 else if ( i == 0 && j == k-2 ) { // signs (b) : --++
1111 return ( number == 2 || number == 3 ) ? 1 : -1 ;
1112 }
1113 else if ( i == n-2 && j == k-2 ) { // signs (c) : -++-
1114 return ( number == 1 || number == 2 ) ? 1 : -1 ;
1115 }
1116 else if ( i == n-2 && j == 0 ) { // signs (d) : ++--
1117 return ( number == 0 || number == 1 ) ? 1 : -1 ;
1118 }
1119 else
1120 {
1121 std::ostringstream message;
1122 message << "Not correct face number: " << GetName() << " !";
1123 G4Exception("G4TwistSurface::G4GetEdgeVisibility()",
1124 "GeomSolids0003", FatalException, message);
1125 }
1126
1127 std::ostringstream message;
1128 message << "Not correct face number: " << GetName() << " !";
1129 G4Exception("G4TwistSurface::G4GetEdgeVisibility()", "GeomSolids0003",
1130 FatalException, message);
1131
1132 return 0 ;
1133}
virtual G4String GetName() const

References FatalException, G4Exception(), G4VTwistSurface::GetName(), and CLHEP::detail::n.

Referenced by G4TwistBoxSide::GetFacets(), GetFacets(), G4TwistTrapFlatSide::GetFacets(), G4TwistTrapParallelSide::GetFacets(), G4TwistTubsFlatSide::GetFacets(), G4TwistTubsHypeSide::GetFacets(), and G4TwistTubsSide::GetFacets().

◆ GetFace()

G4int G4VTwistSurface::GetFace ( G4int  i,
G4int  j,
G4int  m,
G4int  n,
G4int  iside 
)
inherited

Definition at line 906 of file G4VTwistSurface.cc.

908{
909 // this is the face mapping function
910 // (i,j) -> face number
911
912 if ( iside == 0 ) {
913 return i * ( k - 1 ) + j ;
914 }
915
916 else if ( iside == 1 ) {
917 return (k-1)*(k-1) + i*(k-1) + j ;
918 }
919
920 else if ( iside == 2 ) {
921 return 2*(k-1)*(k-1) + i*(k-1) + j ;
922 }
923
924 else if ( iside == 3 ) {
925 return 2*(k-1)*(k-1) + (n-1)*(k-1) + i*(k-1) + j ;
926 }
927
928 else if ( iside == 4 ) {
929 return 2*(k-1)*(k-1) + 2*(n-1)*(k-1) + i*(k-1) + j ;
930 }
931
932 else if ( iside == 5 ) {
933 return 2*(k-1)*(k-1) + 3*(n-1)*(k-1) + i*(k-1) + j ;
934 }
935
936 else {
937 std::ostringstream message;
938 message << "Not correct side number: "
939 << GetName() << G4endl
940 << "iside is " << iside << " but should be "
941 << "0,1,2,3,4 or 5" << ".";
942 G4Exception("G4TwistSurface::G4GetFace()", "GeomSolids0002",
943 FatalException, message);
944 }
945
946 return -1 ; // wrong face
947}

References FatalException, G4endl, G4Exception(), G4VTwistSurface::GetName(), and CLHEP::detail::n.

Referenced by G4TwistBoxSide::GetFacets(), GetFacets(), G4TwistTrapFlatSide::GetFacets(), G4TwistTrapParallelSide::GetFacets(), G4TwistTubsFlatSide::GetFacets(), G4TwistTubsHypeSide::GetFacets(), and G4TwistTubsSide::GetFacets().

◆ GetFacets()

void G4TwistTrapAlphaSide::GetFacets ( G4int  m,
G4int  n,
G4double  xyz[][3],
G4int  faces[][4],
G4int  iside 
)
privatevirtual

Implements G4VTwistSurface.

Definition at line 1103 of file G4TwistTrapAlphaSide.cc.

1105{
1106
1107 G4double phi ;
1108 G4double b ;
1109
1110 G4double z, u ; // the two parameters for the surface equation
1111 G4ThreeVector p ; // a point on the surface, given by (z,u)
1112
1113 G4int nnode ;
1114 G4int nface ;
1115
1116 // calculate the (n-1)*(k-1) vertices
1117
1118 for ( G4int i = 0 ; i<n ; ++i )
1119 {
1120 z = -fDz+i*(2.*fDz)/(n-1) ;
1121 phi = z*fPhiTwist/(2*fDz) ;
1122 b = GetValueB(phi) ;
1123
1124 for ( G4int j = 0 ; j<k ; ++j )
1125 {
1126 nnode = GetNode(i,j,k,n,iside) ;
1127 u = -b/2 +j*b/(k-1) ;
1128 p = SurfacePoint(phi,u,true) ; // surface point in global coordinates
1129
1130 xyz[nnode][0] = p.x() ;
1131 xyz[nnode][1] = p.y() ;
1132 xyz[nnode][2] = p.z() ;
1133
1134 if ( i<n-1 && j<k-1 ) // conterclock wise filling
1135 {
1136 nface = GetFace(i,j,k,n,iside) ;
1137 faces[nface][0] = GetEdgeVisibility(i,j,k,n,0,-1)
1138 * (GetNode(i ,j ,k,n,iside)+1) ; // f77 numbering
1139 faces[nface][1] = GetEdgeVisibility(i,j,k,n,1,-1)
1140 * (GetNode(i ,j+1,k,n,iside)+1) ;
1141 faces[nface][2] = GetEdgeVisibility(i,j,k,n,2,-1)
1142 * (GetNode(i+1,j+1,k,n,iside)+1) ;
1143 faces[nface][3] = GetEdgeVisibility(i,j,k,n,3,-1)
1144 * (GetNode(i+1,j ,k,n,iside)+1) ;
1145 }
1146 }
1147 }
1148}
G4int GetNode(G4int i, G4int j, G4int m, G4int n, G4int iside)
G4int GetFace(G4int i, G4int j, G4int m, G4int n, G4int iside)
G4int GetEdgeVisibility(G4int i, G4int j, G4int m, G4int n, G4int number, G4int orientation)

References fDz, fPhiTwist, G4VTwistSurface::GetEdgeVisibility(), G4VTwistSurface::GetFace(), G4VTwistSurface::GetNode(), GetValueB(), CLHEP::detail::n, SurfacePoint(), CLHEP::Hep3Vector::x(), CLHEP::Hep3Vector::y(), and CLHEP::Hep3Vector::z().

◆ GetName()

virtual G4String G4VTwistSurface::GetName ( ) const
inlinevirtualinherited

◆ GetNeighbours() [1/2]

G4VTwistSurface ** G4VTwistSurface::GetNeighbours ( )
inlineprotectedinherited

Definition at line 183 of file G4VTwistSurface.hh.

183{ return fNeighbours; }
G4VTwistSurface * fNeighbours[4]

References G4VTwistSurface::fNeighbours.

Referenced by G4VTwistSurface::DistanceToIn().

◆ GetNeighbours() [2/2]

G4int G4VTwistSurface::GetNeighbours ( G4int  areacode,
G4VTwistSurface surfaces[] 
)
inlineprotectedinherited

◆ GetNode()

G4int G4VTwistSurface::GetNode ( G4int  i,
G4int  j,
G4int  m,
G4int  n,
G4int  iside 
)
inherited

Definition at line 952 of file G4VTwistSurface.cc.

954{
955 // this is the node mapping function
956 // (i,j) -> node number
957 // Depends on the side iside and the used meshing of the surface
958
959 if ( iside == 0 )
960 {
961 // lower endcap is kxk squared.
962 // n = k
963 return i * k + j ;
964 }
965
966 if ( iside == 1 )
967 {
968 // upper endcap is kxk squared. Shift by k*k
969 // n = k
970 return k*k + i*k + j ;
971 }
972
973 else if ( iside == 2 )
974 {
975 // front side.
976 if ( i == 0 ) { return j ; }
977 else if ( i == n-1 ) { return k*k + j ; }
978 else { return 2*k*k + 4*(i-1)*(k-1) + j ; }
979 }
980
981 else if ( iside == 3 )
982 {
983 // right side
984 if ( i == 0 ) { return (j+1)*k - 1 ; }
985 else if ( i == n-1 ) { return k*k + (j+1)*k - 1 ; }
986 else
987 {
988 return 2*k*k + 4*(i-1)*(k-1) + (k-1) + j ;
989 }
990 }
991 else if ( iside == 4 )
992 {
993 // back side
994 if ( i == 0 ) { return k*k - 1 - j ; } // reversed order
995 else if ( i == n-1 ) { return 2*k*k - 1 - j ; } // reversed order
996 else
997 {
998 return 2*k*k + 4*(i-1)*(k-1) + 2*(k-1) + j ; // normal order
999 }
1000 }
1001 else if ( iside == 5 )
1002 {
1003 // left side
1004 if ( i == 0 ) { return k*k - (j+1)*k ; } // reversed order
1005 else if ( i == n-1) { return 2*k*k - (j+1)*k ; } // reverded order
1006 else
1007 {
1008 if ( j == k-1 ) { return 2*k*k + 4*(i-1)*(k-1) ; } // special case
1009 else
1010 {
1011 return 2*k*k + 4*(i-1)*(k-1) + 3*(k-1) + j ; // normal order
1012 }
1013 }
1014 }
1015 else
1016 {
1017 std::ostringstream message;
1018 message << "Not correct side number: "
1019 << GetName() << G4endl
1020 << "iside is " << iside << " but should be "
1021 << "0,1,2,3,4 or 5" << ".";
1022 G4Exception("G4TwistSurface::G4GetNode()", "GeomSolids0002",
1023 FatalException, message);
1024 }
1025 return -1 ; // wrong node
1026}

References FatalException, G4endl, G4Exception(), G4VTwistSurface::GetName(), and CLHEP::detail::n.

Referenced by G4TwistBoxSide::GetFacets(), GetFacets(), G4TwistTrapFlatSide::GetFacets(), G4TwistTrapParallelSide::GetFacets(), G4TwistTubsFlatSide::GetFacets(), G4TwistTubsHypeSide::GetFacets(), and G4TwistTubsSide::GetFacets().

◆ GetNormal()

G4ThreeVector G4TwistTrapAlphaSide::GetNormal ( const G4ThreeVector xx,
G4bool  isGlobal = false 
)
virtual

Implements G4VTwistSurface.

Definition at line 134 of file G4TwistTrapAlphaSide.cc.

136{
137 // GetNormal returns a normal vector at a surface (or very close
138 // to surface) point at tmpxx.
139 // If isGlobal=true, it returns the normal in global coordinate.
140 //
141
142 G4ThreeVector xx;
143 if (isGlobal)
144 {
145 xx = ComputeLocalPoint(tmpxx);
146 if ((xx - fCurrentNormal.p).mag() < 0.5 * kCarTolerance)
147 {
149 }
150 }
151 else
152 {
153 xx = tmpxx;
154 if (xx == fCurrentNormal.p)
155 {
156 return fCurrentNormal.normal;
157 }
158 }
159
160 G4double phi ;
161 G4double u ;
162
163 GetPhiUAtX(xx,phi,u) ; // phi,u for point xx close to surface
164
165 G4ThreeVector normal = NormAng(phi,u) ; // the normal vector at phi,u
166
167#ifdef G4TWISTDEBUG
168 G4cout << "normal vector = " << normal << G4endl ;
169 G4cout << "phi = " << phi << " , u = " << u << G4endl ;
170#endif
171
172 if (isGlobal)
173 {
175 }
176 else
177 {
179 }
180
181 return fCurrentNormal.normal;
182}
G4ThreeVector ComputeGlobalDirection(const G4ThreeVector &lp) const
G4SurfCurNormal fCurrentNormal

References G4VTwistSurface::ComputeGlobalDirection(), G4VTwistSurface::ComputeLocalPoint(), G4VTwistSurface::fCurrentNormal, G4cout, G4endl, GetPhiUAtX(), G4VTwistSurface::kCarTolerance, CLHEP::normal(), G4VTwistSurface::G4SurfCurNormal::normal, NormAng(), and G4VTwistSurface::G4SurfCurNormal::p.

◆ GetPhiUAtX()

void G4TwistTrapAlphaSide::GetPhiUAtX ( G4ThreeVector  p,
G4double phi,
G4double u 
)
private

Definition at line 1033 of file G4TwistTrapAlphaSide.cc.

1034{
1035 // find closest point XX on surface for a given point p
1036 // X0 is a point on the surface, d is the direction
1037 // ( both for a fixed z = pz)
1038
1039 // phi is given by the z coordinate of p
1040
1041 phi = p.z()/(2*fDz)*fPhiTwist ;
1042 u = (fPhiTwist*(2*fDx1*fDx1 - 2*fDx2*fDx2 - fa1md1*(fDx3 + fDx4)
1044 - 2*(2*fDx1*fDx1 - 2*fDx2*fDx2 + fa1md1*(fDx3 + fDx4)
1045 + 4*(fDx3minus1 + fDx4minus2)*fDy1*fTAlph)*phi
1046 - 4*(fa1md1*(fdeltaX*phi - fPhiTwist*p.x())
1047 + 4*fDy1*(fdeltaY*phi + fdeltaX*fTAlph*phi
1048 - fPhiTwist*(fTAlph*p.x() + p.y())))*std::cos(phi)
1049 - 4*(fa1md1*fdeltaY*phi - 4*fdeltaX*fDy1*phi
1050 + 4*fdeltaY*fDy1*fTAlph*phi + 4*fDy1*fPhiTwist*p.x()
1051 - fPhiTwist*(fa1md1 + 4*fDy1*fTAlph)*p.y())*std::sin(phi))
1052 /(fDy1* fPhiTwist*((std::fabs(((fa1md1 + 4*fDy1*fTAlph)*std::cos(phi))
1053 /fDy1 - 4*std::sin(phi)))
1054 *(std::fabs(((fa1md1 + 4*fDy1*fTAlph)*std::cos(phi))
1055 /fDy1 - 4*std::sin(phi)))
1056 + (std::fabs(4*std::cos(phi)
1057 + ((fa1md1 + 4*fDy1*fTAlph)*std::sin(phi))/fDy1))
1058 * (std::fabs(4*std::cos(phi)
1059 + ((fa1md1 + 4*fDy1*fTAlph)*std::sin(phi))/fDy1)))) ;
1060}

References fa1md1, fdeltaX, fdeltaY, fDx1, fDx2, fDx3, fDx3minus1, fDx3plus1, fDx4, fDx4minus2, fDx4plus2, fDy1, fDz, fPhiTwist, fTAlph, CLHEP::Hep3Vector::x(), CLHEP::Hep3Vector::y(), and CLHEP::Hep3Vector::z().

Referenced by DistanceToSurface(), GetAreaCode(), GetNormal(), and ProjectPoint().

◆ GetSurfaceArea()

G4double G4TwistTrapAlphaSide::GetSurfaceArea ( )
inlineprivatevirtual

Implements G4VTwistSurface.

Definition at line 206 of file G4TwistTrapAlphaSide.hh.

207{
208 return (fDz*(std::sqrt(16*fDy1*fDy1
209 + (fa1md1 + 4*fDy1*fTAlph)*(fa1md1 + 4*fDy1*fTAlph))
210 + std::sqrt(16*fDy2*fDy2 + (fa2md2 + 4*fDy2*fTAlph)
211 * (fa2md2 + 4*fDy2*fTAlph))))/2. ;
212}

References fa1md1, fa2md2, fDy1, fDy2, fDz, and fTAlph.

◆ GetValueA()

G4double G4TwistTrapAlphaSide::GetValueA ( G4double  phi)
inlineprivate

Definition at line 152 of file G4TwistTrapAlphaSide.hh.

153{
154 return ( fDx4plus2 + fDx4minus2 * ( 2 * phi ) / fPhiTwist ) ;
155}

References fDx4minus2, fDx4plus2, and fPhiTwist.

Referenced by Xcoef().

◆ GetValueB()

G4double G4TwistTrapAlphaSide::GetValueB ( G4double  phi)
inlineprivate

Definition at line 164 of file G4TwistTrapAlphaSide.hh.

165{
166 return ( fDy2plus1 + fDy2minus1 * ( 2 * phi ) / fPhiTwist ) ;
167}

References fDy2minus1, fDy2plus1, and fPhiTwist.

Referenced by GetBoundaryMax(), GetBoundaryMin(), GetFacets(), and Xcoef().

◆ GetValueD()

G4double G4TwistTrapAlphaSide::GetValueD ( G4double  phi)
inlineprivate

Definition at line 158 of file G4TwistTrapAlphaSide.hh.

159{
160 return ( fDx3plus1 + fDx3minus1 * ( 2 * phi) / fPhiTwist ) ;
161}

References fDx3minus1, fDx3plus1, and fPhiTwist.

Referenced by Xcoef().

◆ IsAxis0()

G4bool G4VTwistSurface::IsAxis0 ( G4int  areacode) const
inlineinherited

◆ IsAxis1()

G4bool G4VTwistSurface::IsAxis1 ( G4int  areacode) const
inlineinherited

◆ IsBoundary()

G4bool G4VTwistSurface::IsBoundary ( G4int  areacode,
G4bool  testbitmode = false 
) const
inlineinherited

◆ IsCorner()

G4bool G4VTwistSurface::IsCorner ( G4int  areacode,
G4bool  testbitmode = false 
) const
inlineinherited

◆ IsInside()

G4bool G4VTwistSurface::IsInside ( G4int  areacode,
G4bool  testbitmode = false 
) const
inlineinherited

◆ IsOutside()

G4bool G4VTwistSurface::IsOutside ( G4int  areacode) const
inlineinherited

◆ IsSameBoundary()

G4bool G4VTwistSurface::IsSameBoundary ( G4VTwistSurface surface1,
G4int  areacode1,
G4VTwistSurface surface2,
G4int  areacode2 
) const
inherited

Definition at line 616 of file G4VTwistSurface.cc.

618{
619 //
620 // IsSameBoundary
621 //
622 // checking tool whether two boundaries on different surfaces are same or not.
623 //
624
625 G4bool testbitmode = true;
626 G4bool iscorner[2] = {IsCorner(areacode1, testbitmode),
627 IsCorner(areacode2, testbitmode)};
628
629 if (iscorner[0] && iscorner[1])
630 {
631 // on corner
632 G4ThreeVector corner1 =
633 surf1->ComputeGlobalPoint(surf1->GetCorner(areacode1));
634 G4ThreeVector corner2 =
635 surf2->ComputeGlobalPoint(surf2->GetCorner(areacode2));
636
637 if ((corner1 - corner2).mag() < kCarTolerance) { return true; }
638 else { return false; }
639 }
640 else if ((IsBoundary(areacode1, testbitmode) && (!iscorner[0])) &&
641 (IsBoundary(areacode2, testbitmode) && (!iscorner[1])))
642 {
643 // on boundary
644 G4ThreeVector d1, d2, ld1, ld2;
645 G4ThreeVector x01, x02, lx01, lx02;
646 G4int type1, type2;
647 surf1->GetBoundaryParameters(areacode1, ld1, lx01, type1);
648 surf2->GetBoundaryParameters(areacode2, ld2, lx02, type2);
649
650 x01 = surf1->ComputeGlobalPoint(lx01);
651 x02 = surf2->ComputeGlobalPoint(lx02);
652 d1 = surf1->ComputeGlobalDirection(ld1);
653 d2 = surf2->ComputeGlobalDirection(ld2);
654
655 if ((x01 - x02).mag() < kCarTolerance &&
656 (d1 - d2).mag() < kCarTolerance) { return true; }
657 else { return false; }
658 }
659 else
660 {
661 return false;
662 }
663}
static const G4double d1
static const G4double d2
G4bool IsCorner(G4int areacode, G4bool testbitmode=false) const
G4bool IsBoundary(G4int areacode, G4bool testbitmode=false) const

References G4VTwistSurface::ComputeGlobalDirection(), G4VTwistSurface::ComputeGlobalPoint(), d1, d2, G4VTwistSurface::GetBoundaryParameters(), G4VTwistSurface::GetCorner(), G4VTwistSurface::IsBoundary(), G4VTwistSurface::IsCorner(), and G4VTwistSurface::kCarTolerance.

Referenced by G4VTwistSurface::DistanceToIn().

◆ IsValidNorm()

G4bool G4VTwistSurface::IsValidNorm ( ) const
inlineinherited

◆ NormAng()

G4ThreeVector G4TwistTrapAlphaSide::NormAng ( G4double  phi,
G4double  u 
)
inlineprivate

Definition at line 215 of file G4TwistTrapAlphaSide.hh.

216{
217 // function to calculate the norm at a given point on the surface
218 // replace a1-d1
219
220 G4ThreeVector nvec ( fDy1* fDz*(4*fDy1*std::cos(phi)
221 + (fa1md1 + 4*fDy1*fTAlph)*std::sin(phi)),
222 -(fDy1* fDz*((fa1md1 + 4*fDy1*fTAlph)*std::cos(phi)
223 - 4*fDy1*std::sin(phi))),
228 *(fa1md1 + 4*fDy1*fTAlph)*phi)
229 + fPhiTwist*(16*fDy1*fDy1
230 + (fa1md1 + 4*fDy1*fTAlph)
231 *(fa1md1 + 4*fDy1*fTAlph))*u
233 + 4*fdeltaY*fDy1*fTAlph)* std::cos(phi)
234 - 4*fDy1*(fa1md1*fdeltaX + 4*fDy1*(fdeltaY
235 + fdeltaX*fTAlph))*std::sin(phi))/ 8. ) ;
236 return nvec.unit();
237}

References fa1md1, fdeltaX, fdeltaY, fDx2, fDx3minus1, fDx3plus1, fDx4, fDx4minus2, fDy1, fDz, fPhiTwist, fTAlph, and CLHEP::Hep3Vector::unit().

Referenced by DistanceToSurface(), and GetNormal().

◆ ProjectPoint()

G4ThreeVector G4TwistTrapAlphaSide::ProjectPoint ( const G4ThreeVector p,
G4bool  isglobal = false 
)
private

Definition at line 1066 of file G4TwistTrapAlphaSide.cc.

1067{
1068 // Get Rho at p.z() on Hyperbolic Surface.
1069
1070 G4ThreeVector tmpp;
1071 if (isglobal)
1072 {
1073 tmpp = fRot.inverse()*p - fTrans;
1074 }
1075 else
1076 {
1077 tmpp = p;
1078 }
1079
1080 G4double phi ;
1081 G4double u ;
1082
1083 GetPhiUAtX( tmpp, phi, u ) ;
1084 // calculate (phi, u) for a point p close the surface
1085
1086 G4ThreeVector xx = SurfacePoint(phi,u) ;
1087 // transform back to cartesian coordinates
1088
1089 if (isglobal)
1090 {
1091 return (fRot * xx + fTrans);
1092 }
1093 else
1094 {
1095 return xx;
1096 }
1097}
HepRotation inverse() const

References G4VTwistSurface::fRot, G4VTwistSurface::fTrans, GetPhiUAtX(), CLHEP::HepRotation::inverse(), and SurfacePoint().

◆ SetAxis()

void G4VTwistSurface::SetAxis ( G4int  i,
const EAxis  axis 
)
inlineinherited

Definition at line 156 of file G4VTwistSurface.hh.

156{ fAxis[i] = axis; }

References G4VTwistSurface::fAxis.

◆ SetBoundaries()

void G4TwistTrapAlphaSide::SetBoundaries ( )
privatevirtual

Implements G4VTwistSurface.

Definition at line 987 of file G4TwistTrapAlphaSide.cc.

988{
989 // Set direction-unit vector of boundary-lines in local coodinate.
990 //
991
992 G4ThreeVector direction;
993
994 if (fAxis[0] == kYAxis && fAxis[1] == kZAxis)
995 {
996 // sAxis0 & sAxisMin
998 direction = direction.unit();
999 SetBoundary(sAxis0 & (sAxisY | sAxisMin), direction,
1001
1002 // sAxis0 & sAxisMax
1003 direction = GetCorner(sC0Max1Max) - GetCorner(sC0Max1Min);
1004 direction = direction.unit();
1005 SetBoundary(sAxis0 & (sAxisY | sAxisMax), direction,
1007
1008 // sAxis1 & sAxisMin
1009 direction = GetCorner(sC0Max1Min) - GetCorner(sC0Min1Min);
1010 direction = direction.unit();
1011 SetBoundary(sAxis1 & (sAxisZ | sAxisMin), direction,
1013
1014 // sAxis1 & sAxisMax
1015 direction = GetCorner(sC0Max1Max) - GetCorner(sC0Min1Max);
1016 direction = direction.unit();
1017 SetBoundary(sAxis1 & (sAxisZ | sAxisMax), direction,
1019
1020 }
1021 else
1022 {
1023 G4Exception("G4TwistTrapAlphaSide::SetCorners()",
1024 "GeomSolids0001", FatalException,
1025 "Feature NOT implemented !");
1026 }
1027}
Hep3Vector unit() const
virtual void SetBoundary(const G4int &axiscode, const G4ThreeVector &direction, const G4ThreeVector &x0, const G4int &boundarytype)

References FatalException, G4VTwistSurface::fAxis, G4Exception(), G4VTwistSurface::GetCorner(), kYAxis, kZAxis, G4VTwistSurface::sAxis0, G4VTwistSurface::sAxis1, G4VTwistSurface::sAxisMax, G4VTwistSurface::sAxisMin, G4VTwistSurface::sAxisY, G4VTwistSurface::sAxisZ, G4VTwistSurface::sC0Max1Max, G4VTwistSurface::sC0Max1Min, G4VTwistSurface::sC0Min1Max, G4VTwistSurface::sC0Min1Min, G4VTwistSurface::SetBoundary(), and CLHEP::Hep3Vector::unit().

Referenced by G4TwistTrapAlphaSide().

◆ SetBoundary()

void G4VTwistSurface::SetBoundary ( const G4int axiscode,
const G4ThreeVector direction,
const G4ThreeVector x0,
const G4int boundarytype 
)
protectedvirtualinherited

Definition at line 863 of file G4VTwistSurface.cc.

867{
868 G4int code = (~sAxisMask) & axiscode;
869 if ((code == (sAxis0 & sAxisMin)) ||
870 (code == (sAxis0 & sAxisMax)) ||
871 (code == (sAxis1 & sAxisMin)) ||
872 (code == (sAxis1 & sAxisMax)))
873 {
874 G4bool done = false;
875 for (auto i=0; i<4; ++i)
876 {
877 if (fBoundaries[i].IsEmpty())
878 {
879 fBoundaries[i].SetFields(axiscode, direction,
880 x0, boundarytype);
881 done = true;
882 break;
883 }
884 }
885
886 if (!done)
887 {
888 G4Exception("G4VTwistSurface::SetBoundary()", "GeomSolids0003",
889 FatalException, "Number of boundary exceeding 4!");
890 }
891 }
892 else
893 {
894 std::ostringstream message;
895 message << "Invalid axis-code." << G4endl
896 << " axiscode = "
897 << std::hex << axiscode << std::dec;
898 G4Exception("G4VTwistSurface::SetBoundary()", "GeomSolids0003",
899 FatalException, message);
900 }
901}
void SetFields(const G4int &areacode, const G4ThreeVector &d, const G4ThreeVector &x0, const G4int &boundarytype)
Definition: inftrees.h:24

References FatalException, G4VTwistSurface::fBoundaries, G4endl, G4Exception(), G4VTwistSurface::sAxis0, G4VTwistSurface::sAxis1, G4VTwistSurface::sAxisMax, G4VTwistSurface::sAxisMin, and G4VTwistSurface::Boundary::SetFields().

Referenced by G4TwistBoxSide::SetBoundaries(), SetBoundaries(), G4TwistTrapFlatSide::SetBoundaries(), G4TwistTrapParallelSide::SetBoundaries(), G4TwistTubsFlatSide::SetBoundaries(), G4TwistTubsHypeSide::SetBoundaries(), and G4TwistTubsSide::SetBoundaries().

◆ SetCorner()

void G4VTwistSurface::SetCorner ( G4int  areacode,
G4double  x,
G4double  y,
G4double  z 
)
protectedinherited

Definition at line 757 of file G4VTwistSurface.cc.

759{
760 if ((areacode & sCorner) != sCorner)
761 {
762 std::ostringstream message;
763 message << "Area code must represents corner." << G4endl
764 << " areacode " << areacode;
765 G4Exception("G4VTwistSurface::SetCorner()", "GeomSolids0002",
766 FatalException, message);
767 }
768
769 if ((areacode & sC0Min1Min) == sC0Min1Min) {
770 fCorners[0].set(x, y, z);
771 } else if ((areacode & sC0Max1Min) == sC0Max1Min) {
772 fCorners[1].set(x, y, z);
773 } else if ((areacode & sC0Max1Max) == sC0Max1Max) {
774 fCorners[2].set(x, y, z);
775 } else if ((areacode & sC0Min1Max) == sC0Min1Max) {
776 fCorners[3].set(x, y, z);
777 }
778}
G4ThreeVector fCorners[4]

References FatalException, G4VTwistSurface::fCorners, G4endl, G4Exception(), G4VTwistSurface::sC0Max1Max, G4VTwistSurface::sC0Max1Min, G4VTwistSurface::sC0Min1Max, G4VTwistSurface::sC0Min1Min, G4VTwistSurface::sCorner, and CLHEP::Hep3Vector::set().

Referenced by G4TwistBoxSide::SetCorners(), SetCorners(), G4TwistTrapFlatSide::SetCorners(), G4TwistTrapParallelSide::SetCorners(), G4TwistTubsFlatSide::SetCorners(), G4TwistTubsSide::SetCorners(), and G4TwistTubsHypeSide::SetCorners().

◆ SetCorners()

void G4TwistTrapAlphaSide::SetCorners ( )
privatevirtual

Implements G4VTwistSurface.

Definition at line 918 of file G4TwistTrapAlphaSide.cc.

919{
920
921 // Set Corner points in local coodinate.
922
923 if (fAxis[0] == kYAxis && fAxis[1] == kZAxis)
924 {
925
926 G4double x, y, z;
927
928 // corner of Axis0min and Axis1min
929 //
930 x = -fdeltaX/2. + (fDx1 - fDy1*fTAlph)*std::cos(fPhiTwist/2.)
931 - fDy1*std::sin(fPhiTwist/2.);
932 y = -fdeltaY/2. - fDy1*std::cos(fPhiTwist/2.)
933 + (-fDx1 + fDy1*fTAlph)*std::sin(fPhiTwist/2.);
934 z = -fDz ;
935
936 // G4cout << "SetCorners: " << x << ", " << y << ", " << z << G4endl ;
937
938 SetCorner(sC0Min1Min, x, y, z);
939
940 // corner of Axis0max and Axis1min
941 //
942 x = -fdeltaX/2. + (fDx2 + fDy1*fTAlph)*std::cos(fPhiTwist/2.)
943 + fDy1*std::sin(fPhiTwist/2.);
944 y = -fdeltaY/2. + fDy1*std::cos(fPhiTwist/2.)
945 - (fDx2 + fDy1*fTAlph)*std::sin(fPhiTwist/2.);
946 z = -fDz ;
947
948 // G4cout << "SetCorners: " << x << ", " << y << ", " << z << G4endl ;
949
950 SetCorner(sC0Max1Min, x, y, z);
951
952 // corner of Axis0max and Axis1max
953 //
954 x = fdeltaX/2. + (fDx4 + fDy2*fTAlph)*std::cos(fPhiTwist/2.)
955 - fDy2*std::sin(fPhiTwist/2.);
956 y = fdeltaY/2. + fDy2*std::cos(fPhiTwist/2.)
957 + (fDx4 + fDy2*fTAlph)*std::sin(fPhiTwist/2.);
958 z = fDz ;
959
960 // G4cout << "SetCorners: " << x << ", " << y << ", " << z << G4endl ;
961
962 SetCorner(sC0Max1Max, x, y, z);
963
964 // corner of Axis0min and Axis1max
965 x = fdeltaX/2. + (fDx3 - fDy2*fTAlph)*std::cos(fPhiTwist/2.)
966 + fDy2*std::sin(fPhiTwist/2.) ;
967 y = fdeltaY/2. - fDy2*std::cos(fPhiTwist/2.)
968 + (fDx3 - fDy2*fTAlph)*std::sin(fPhiTwist/2.) ;
969 z = fDz ;
970
971 // G4cout << "SetCorners: " << x << ", " << y << ", " << z << G4endl ;
972
973 SetCorner(sC0Min1Max, x, y, z);
974
975 }
976 else
977 {
978 G4Exception("G4TwistTrapAlphaSide::SetCorners()",
979 "GeomSolids0001", FatalException,
980 "Method NOT implemented !");
981 }
982}
void SetCorner(G4int areacode, G4double x, G4double y, G4double z)

References FatalException, G4VTwistSurface::fAxis, fdeltaX, fdeltaY, fDx1, fDx2, fDx3, fDx4, fDy1, fDy2, fDz, fPhiTwist, fTAlph, G4Exception(), kYAxis, kZAxis, G4VTwistSurface::sC0Max1Max, G4VTwistSurface::sC0Max1Min, G4VTwistSurface::sC0Min1Max, G4VTwistSurface::sC0Min1Min, and G4VTwistSurface::SetCorner().

Referenced by G4TwistTrapAlphaSide().

◆ SetNeighbours()

void G4VTwistSurface::SetNeighbours ( G4VTwistSurface ax0min,
G4VTwistSurface ax1min,
G4VTwistSurface ax0max,
G4VTwistSurface ax1max 
)
inlineinherited

◆ SurfacePoint()

G4ThreeVector G4TwistTrapAlphaSide::SurfacePoint ( G4double  phi,
G4double  u,
G4bool  isGlobal = false 
)
inlineprivatevirtual

Implements G4VTwistSurface.

Definition at line 180 of file G4TwistTrapAlphaSide.hh.

181{
182 // function to calculate a point on the surface, given by parameters phi,u
183
184 G4ThreeVector SurfPoint ( Xcoef(u,phi) * std::cos(phi)
185 - u * std::sin(phi) + fdeltaX*phi/fPhiTwist,
186 Xcoef(u,phi) * std::sin(phi)
187 + u * std::cos(phi) + fdeltaY*phi/fPhiTwist,
188 2*fDz*phi/fPhiTwist );
189 if (isGlobal) { return (fRot * SurfPoint + fTrans); }
190 return SurfPoint;
191}
G4double Xcoef(G4double u, G4double phi)

References fdeltaX, fdeltaY, fDz, fPhiTwist, G4VTwistSurface::fRot, G4VTwistSurface::fTrans, and Xcoef().

Referenced by DistanceToSurface(), GetFacets(), and ProjectPoint().

◆ Xcoef()

G4double G4TwistTrapAlphaSide::Xcoef ( G4double  u,
G4double  phi 
)
inlineprivate

Definition at line 171 of file G4TwistTrapAlphaSide.hh.

172{
173
174 return GetValueA(phi)/2. + (GetValueD(phi)-GetValueA(phi))/4.
175 - u*( ( GetValueD(phi)-GetValueA(phi) )/( 2 * GetValueB(phi) ) - fTAlph );
176
177}
G4double GetValueA(G4double phi)
G4double GetValueD(G4double phi)

References fTAlph, GetValueA(), GetValueB(), and GetValueD().

Referenced by SurfacePoint().

Field Documentation

◆ fa1md1

G4double G4TwistTrapAlphaSide::fa1md1
private

◆ fa2md2

G4double G4TwistTrapAlphaSide::fa2md2
private

Definition at line 141 of file G4TwistTrapAlphaSide.hh.

Referenced by G4TwistTrapAlphaSide(), and GetSurfaceArea().

◆ fAlph

G4double G4TwistTrapAlphaSide::fAlph
private

Definition at line 127 of file G4TwistTrapAlphaSide.hh.

Referenced by G4TwistTrapAlphaSide().

◆ fAmIOnLeftSide

G4SurfSideQuery G4VTwistSurface::fAmIOnLeftSide
privateinherited

◆ fAngleSide

G4double G4TwistTrapAlphaSide::fAngleSide
private

Definition at line 132 of file G4TwistTrapAlphaSide.hh.

Referenced by G4TwistTrapAlphaSide().

◆ fAxis

EAxis G4VTwistSurface::fAxis[2]
protectedinherited

◆ fAxisMax

G4double G4VTwistSurface::fAxisMax[2]
protectedinherited

◆ fAxisMin

G4double G4VTwistSurface::fAxisMin[2]
protectedinherited

◆ fBoundaries

Boundary G4VTwistSurface::fBoundaries[4]
privateinherited

◆ fCorners

G4ThreeVector G4VTwistSurface::fCorners[4]
privateinherited

◆ fCurrentNormal

G4SurfCurNormal G4VTwistSurface::fCurrentNormal
protectedinherited

◆ fCurStat

CurrentStatus G4VTwistSurface::fCurStat
protectedinherited

◆ fCurStatWithV

CurrentStatus G4VTwistSurface::fCurStatWithV
protectedinherited

◆ fdeltaX

G4double G4TwistTrapAlphaSide::fdeltaX
private

◆ fdeltaY

G4double G4TwistTrapAlphaSide::fdeltaY
private

◆ fDx1

G4double G4TwistTrapAlphaSide::fDx1
private

Definition at line 118 of file G4TwistTrapAlphaSide.hh.

Referenced by G4TwistTrapAlphaSide(), GetPhiUAtX(), and SetCorners().

◆ fDx2

G4double G4TwistTrapAlphaSide::fDx2
private

Definition at line 119 of file G4TwistTrapAlphaSide.hh.

Referenced by G4TwistTrapAlphaSide(), GetPhiUAtX(), NormAng(), and SetCorners().

◆ fDx3

G4double G4TwistTrapAlphaSide::fDx3
private

Definition at line 122 of file G4TwistTrapAlphaSide.hh.

Referenced by G4TwistTrapAlphaSide(), GetPhiUAtX(), and SetCorners().

◆ fDx3minus1

G4double G4TwistTrapAlphaSide::fDx3minus1
private

◆ fDx3plus1

G4double G4TwistTrapAlphaSide::fDx3plus1
private

◆ fDx4

G4double G4TwistTrapAlphaSide::fDx4
private

Definition at line 123 of file G4TwistTrapAlphaSide.hh.

Referenced by G4TwistTrapAlphaSide(), GetPhiUAtX(), NormAng(), and SetCorners().

◆ fDx4minus2

G4double G4TwistTrapAlphaSide::fDx4minus2
private

◆ fDx4plus2

G4double G4TwistTrapAlphaSide::fDx4plus2
private

◆ fDy1

G4double G4TwistTrapAlphaSide::fDy1
private

◆ fDy2

G4double G4TwistTrapAlphaSide::fDy2
private

Definition at line 121 of file G4TwistTrapAlphaSide.hh.

Referenced by G4TwistTrapAlphaSide(), GetSurfaceArea(), and SetCorners().

◆ fDy2minus1

G4double G4TwistTrapAlphaSide::fDy2minus1
private

Definition at line 139 of file G4TwistTrapAlphaSide.hh.

Referenced by G4TwistTrapAlphaSide(), and GetValueB().

◆ fDy2plus1

G4double G4TwistTrapAlphaSide::fDy2plus1
private

Definition at line 138 of file G4TwistTrapAlphaSide.hh.

Referenced by G4TwistTrapAlphaSide(), and GetValueB().

◆ fDz

G4double G4TwistTrapAlphaSide::fDz
private

◆ fHandedness

G4int G4VTwistSurface::fHandedness
protectedinherited

◆ fIsValidNorm

G4bool G4VTwistSurface::fIsValidNorm
protectedinherited

◆ fName

G4String G4VTwistSurface::fName
privateinherited

◆ fNeighbours

G4VTwistSurface* G4VTwistSurface::fNeighbours[4]
privateinherited

◆ fPhi

G4double G4TwistTrapAlphaSide::fPhi
private

Definition at line 115 of file G4TwistTrapAlphaSide.hh.

Referenced by G4TwistTrapAlphaSide().

◆ fPhiTwist

G4double G4TwistTrapAlphaSide::fPhiTwist
private

◆ fRot

G4RotationMatrix G4VTwistSurface::fRot
protectedinherited

◆ fTAlph

G4double G4TwistTrapAlphaSide::fTAlph
private

◆ fTheta

G4double G4TwistTrapAlphaSide::fTheta
private

Definition at line 114 of file G4TwistTrapAlphaSide.hh.

Referenced by G4TwistTrapAlphaSide().

◆ fTrans

G4ThreeVector G4VTwistSurface::fTrans
protectedinherited

◆ kCarTolerance

G4double G4VTwistSurface::kCarTolerance
protectedinherited

◆ sAreaMask

const G4int G4VTwistSurface::sAreaMask = 0XF0000000
staticinherited

Definition at line 235 of file G4VTwistSurface.hh.

◆ sAxis0

const G4int G4VTwistSurface::sAxis0 = 0x0000FF00
staticinherited

◆ sAxis1

const G4int G4VTwistSurface::sAxis1 = 0x000000FF
staticinherited

◆ sAxisMask

const G4int G4VTwistSurface::sAxisMask = 0x0000FCFC
staticinherited

Definition at line 234 of file G4VTwistSurface.hh.

Referenced by G4VTwistSurface::GetBoundaryAxis().

◆ sAxisMax

const G4int G4VTwistSurface::sAxisMax = 0x00000202
staticinherited

◆ sAxisMin

const G4int G4VTwistSurface::sAxisMin = 0x00000101
staticinherited

◆ sAxisPhi

const G4int G4VTwistSurface::sAxisPhi = 0x00001414
staticinherited

◆ sAxisRho

const G4int G4VTwistSurface::sAxisRho = 0x00001010
staticinherited

◆ sAxisX

const G4int G4VTwistSurface::sAxisX = 0x00000404
staticinherited

◆ sAxisY

const G4int G4VTwistSurface::sAxisY = 0x00000808
staticinherited

◆ sAxisZ

const G4int G4VTwistSurface::sAxisZ = 0x00000C0C
staticinherited

◆ sBoundary

const G4int G4VTwistSurface::sBoundary = 0x20000000
staticinherited

◆ sC0Max1Max

const G4int G4VTwistSurface::sC0Max1Max = 0x40000202
staticinherited

◆ sC0Max1Min

const G4int G4VTwistSurface::sC0Max1Min = 0x40000201
staticinherited

◆ sC0Min1Max

const G4int G4VTwistSurface::sC0Min1Max = 0x40000102
staticinherited

◆ sC0Min1Min

const G4int G4VTwistSurface::sC0Min1Min = 0x40000101
staticinherited

◆ sCorner

const G4int G4VTwistSurface::sCorner = 0x40000000
staticinherited

◆ sInside

const G4int G4VTwistSurface::sInside = 0x10000000
staticinherited

◆ sOutside

const G4int G4VTwistSurface::sOutside = 0x00000000
staticinherited

◆ sSizeMask

const G4int G4VTwistSurface::sSizeMask = 0x00000303
staticinherited

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