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

#include <G4TwistTubsFlatSide.hh>

+ Inheritance diagram for G4TwistTubsFlatSide:

Public Member Functions

 G4TwistTubsFlatSide (const G4String &name, const G4RotationMatrix &rot, const G4ThreeVector &tlate, const G4ThreeVector &n, const EAxis axis1=kRho, const EAxis axis2=kPhi, G4double axis0min=-kInfinity, G4double axis1min=-kInfinity, G4double axis0max=kInfinity, G4double axis1max=kInfinity)
 
 G4TwistTubsFlatSide (const G4String &name, G4double EndInnerRadius[2], G4double EndOuterRadius[2], G4double DPhi, G4double EndPhi[2], G4double EndZ[2], G4int handedness)
 
virtual ~G4TwistTubsFlatSide ()
 
virtual G4ThreeVector GetNormal (const G4ThreeVector &, G4bool isGlobal=false)
 
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[])
 
virtual G4ThreeVector SurfacePoint (G4double, G4double, G4bool isGlobal=false)
 
virtual G4double GetBoundaryMin (G4double phi)
 
virtual G4double GetBoundaryMax (G4double phi)
 
virtual G4double GetSurfaceArea ()
 
virtual void GetFacets (G4int m, G4int n, G4double xyz[][3], G4int faces[][4], G4int iside)
 
 G4TwistTubsFlatSide (__void__ &)
 
- Public Member Functions inherited from G4VTwistSurface
 G4VTwistSurface (const G4String &name)
 
 G4VTwistSurface (const G4String &name, const G4RotationMatrix &rot, const G4ThreeVector &tlate, G4int handedness, const EAxis axis1, const EAxis axis2, G4double axis0min=-kInfinity, G4double axis1min=-kInfinity, G4double axis0max=kInfinity, G4double axis1max=kInfinity)
 
virtual ~G4VTwistSurface ()
 
virtual G4int AmIOnLeftSide (const G4ThreeVector &me, const G4ThreeVector &vec, G4bool withTol=true)
 
virtual G4double DistanceToBoundary (G4int areacode, G4ThreeVector &xx, const G4ThreeVector &p)
 
virtual G4double DistanceToIn (const G4ThreeVector &gp, const G4ThreeVector &gv, G4ThreeVector &gxxbest)
 
virtual G4double DistanceToOut (const G4ThreeVector &gp, const G4ThreeVector &gv, G4ThreeVector &gxxbest)
 
virtual G4double DistanceTo (const G4ThreeVector &gp, G4ThreeVector &gxx)
 
virtual G4int DistanceToSurface (const G4ThreeVector &gp, const G4ThreeVector &gv, G4ThreeVector gxx[], G4double distance[], G4int areacode[], G4bool isvalid[], EValidate validate=kValidateWithTol)=0
 
virtual G4int DistanceToSurface (const G4ThreeVector &gp, G4ThreeVector gxx[], G4double distance[], G4int areacode[])=0
 
void DebugPrint () const
 
virtual G4ThreeVector GetNormal (const G4ThreeVector &xx, G4bool isGlobal)=0
 
virtual G4String GetName () const
 
virtual void GetBoundaryParameters (const G4int &areacode, G4ThreeVector &d, G4ThreeVector &x0, G4int &boundarytype) const
 
virtual G4ThreeVector GetBoundaryAtPZ (G4int areacode, const G4ThreeVector &p) const
 
G4double DistanceToPlaneWithV (const G4ThreeVector &p, const G4ThreeVector &v, const G4ThreeVector &x0, const G4ThreeVector &n0, G4ThreeVector &xx)
 
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 DistanceToLine (const G4ThreeVector &p, const G4ThreeVector &x0, const G4ThreeVector &d, G4ThreeVector &xx)
 
G4bool IsAxis0 (G4int areacode) const
 
G4bool IsAxis1 (G4int areacode) const
 
G4bool IsOutside (G4int areacode) const
 
G4bool IsInside (G4int areacode, G4bool testbitmode=false) const
 
G4bool IsBoundary (G4int areacode, G4bool testbitmode=false) const
 
G4bool IsCorner (G4int areacode, G4bool testbitmode=false) const
 
G4bool IsValidNorm () const
 
G4bool IsSameBoundary (G4VTwistSurface *surface1, G4int areacode1, G4VTwistSurface *surface2, G4int areacode2) const
 
G4int GetAxisType (G4int areacode, G4int whichaxis) const
 
G4ThreeVector ComputeGlobalPoint (const G4ThreeVector &lp) const
 
G4ThreeVector ComputeLocalPoint (const G4ThreeVector &gp) const
 
G4ThreeVector ComputeGlobalDirection (const G4ThreeVector &lp) const
 
G4ThreeVector ComputeLocalDirection (const G4ThreeVector &gp) const
 
void SetAxis (G4int i, const EAxis axis)
 
void SetNeighbours (G4VTwistSurface *axis0min, G4VTwistSurface *axis1min, G4VTwistSurface *axis0max, G4VTwistSurface *axis1max)
 
virtual G4ThreeVector SurfacePoint (G4double, G4double, G4bool isGlobal=false)=0
 
virtual G4double GetBoundaryMin (G4double)=0
 
virtual G4double GetBoundaryMax (G4double)=0
 
virtual G4double GetSurfaceArea ()=0
 
virtual void GetFacets (G4int m, G4int n, G4double xyz[][3], G4int faces[][4], G4int iside)=0
 
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)
 
 G4VTwistSurface (__void__ &)
 

Public Attributes

G4double fSurfaceArea
 

Protected Member Functions

virtual G4int GetAreaCode (const G4ThreeVector &xx, G4bool withTol=true)
 
- Protected Member Functions inherited from G4VTwistSurface
G4VTwistSurface ** GetNeighbours ()
 
G4int GetNeighbours (G4int areacode, G4VTwistSurface *surfaces[])
 
G4ThreeVector GetCorner (G4int areacode) const
 
void GetBoundaryAxis (G4int areacode, EAxis axis[]) const
 
void GetBoundaryLimit (G4int areacode, G4double limit[]) const
 
virtual G4int GetAreaCode (const G4ThreeVector &xx, G4bool withtol=true)=0
 
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)
 

Additional Inherited Members

- Public Types inherited from G4VTwistSurface
enum  EValidate { kDontValidate = 0 , kValidateWithTol = 1 , kValidateWithoutTol = 2 , kUninitialized = 3 }
 
- Static Public Attributes inherited from G4VTwistSurface
static const G4int sOutside = 0x00000000
 
static const G4int sInside = 0x10000000
 
static const G4int sBoundary = 0x20000000
 
static const G4int sCorner = 0x40000000
 
static const G4int sC0Min1Min = 0x40000101
 
static const G4int sC0Max1Min = 0x40000201
 
static const G4int sC0Max1Max = 0x40000202
 
static const G4int sC0Min1Max = 0x40000102
 
static const G4int sAxisMin = 0x00000101
 
static const G4int sAxisMax = 0x00000202
 
static const G4int sAxisX = 0x00000404
 
static const G4int sAxisY = 0x00000808
 
static const G4int sAxisZ = 0x00000C0C
 
static const G4int sAxisRho = 0x00001010
 
static const G4int sAxisPhi = 0x00001414
 
static const G4int sAxis0 = 0x0000FF00
 
static const G4int sAxis1 = 0x000000FF
 
static const G4int sSizeMask = 0x00000303
 
static const G4int sAxisMask = 0x0000FCFC
 
static const G4int sAreaMask = 0XF0000000
 
- Protected Attributes inherited from G4VTwistSurface
EAxis fAxis [2]
 
G4double fAxisMin [2]
 
G4double fAxisMax [2]
 
CurrentStatus fCurStatWithV
 
CurrentStatus fCurStat
 
G4RotationMatrix fRot
 
G4ThreeVector fTrans
 
G4int fHandedness
 
G4SurfCurNormal fCurrentNormal
 
G4bool fIsValidNorm
 
G4double kCarTolerance
 

Detailed Description

Definition at line 52 of file G4TwistTubsFlatSide.hh.

Constructor & Destructor Documentation

◆ G4TwistTubsFlatSide() [1/3]

G4TwistTubsFlatSide::G4TwistTubsFlatSide ( const G4String name,
const G4RotationMatrix rot,
const G4ThreeVector tlate,
const G4ThreeVector n,
const EAxis  axis1 = kRho,
const EAxis  axis2 = kPhi,
G4double  axis0min = -kInfinity,
G4double  axis1min = -kInfinity,
G4double  axis0max = kInfinity,
G4double  axis1max = kInfinity 
)

Definition at line 50 of file G4TwistTubsFlatSide.cc.

60 : G4VTwistSurface(name, rot, tlate, 0, axis0, axis1,
61 axis0min, axis1min, axis0max, axis1max)
62{
63 if (axis0 == kPhi && axis1 == kRho) {
64 G4Exception("G4TwistTubsFlatSide::G4TwistTubsFlatSide()",
65 "GeomSolids0002", FatalErrorInArgument,
66 "Should swap axis0 and axis1!");
67 }
68
69 G4ThreeVector normal = rot.inverse()*n;
70 fCurrentNormal.normal = normal.unit(); // in local coordinate system
71 fIsValidNorm = true;
72
73 SetCorners();
74 SetBoundaries();
75
76 fSurfaceArea = 1 ; // not yet implemented. This is NOT a problem for tracking
77
78}
@ FatalErrorInArgument
Hep3Vector unit() const
HepRotation inverse() const
G4SurfCurNormal fCurrentNormal
@ kPhi
Definition: geomdefs.hh:54
@ kRho
Definition: geomdefs.hh:54
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41

◆ G4TwistTubsFlatSide() [2/3]

G4TwistTubsFlatSide::G4TwistTubsFlatSide ( const G4String name,
G4double  EndInnerRadius[2],
G4double  EndOuterRadius[2],
G4double  DPhi,
G4double  EndPhi[2],
G4double  EndZ[2],
G4int  handedness 
)

Definition at line 82 of file G4TwistTubsFlatSide.cc.

89 : G4VTwistSurface(name)
90{
91 fHandedness = handedness; // +z = +ve, -z = -ve
92 fAxis[0] = kRho; // in local coordinate system
93 fAxis[1] = kPhi;
94 G4int i = (handedness < 0 ? 0 : 1);
95 fAxisMin[0] = EndInnerRadius[i]; // Inner-hype radius at z=0
96 fAxisMax[0] = EndOuterRadius[i]; // Outer-hype radius at z=0
97 fAxisMin[1] = -0.5*DPhi;
98 fAxisMax[1] = -fAxisMin[1];
99 fCurrentNormal.normal.set(0, 0, (fHandedness < 0 ? -1 : 1));
100 // Unit vector, in local coordinate system
101 fRot.rotateZ(EndPhi[i]);
102 fTrans.set(0, 0, EndZ[i]);
103 fIsValidNorm = true;
104
105 SetCorners();
106 SetBoundaries();
107
108 fSurfaceArea = 0.5*DPhi * (EndOuterRadius[i]*EndOuterRadius[i]
109 - EndInnerRadius[i]*EndInnerRadius[i] ) ;
110
111}
int G4int
Definition: G4Types.hh:66
void set(double x, double y, double z)
HepRotation & rotateZ(double delta)
Definition: Rotation.cc:92
G4double fAxisMax[2]
G4RotationMatrix fRot
G4ThreeVector fTrans
G4double fAxisMin[2]

◆ ~G4TwistTubsFlatSide()

G4TwistTubsFlatSide::~G4TwistTubsFlatSide ( )
virtual

Definition at line 126 of file G4TwistTubsFlatSide.cc.

127{
128}

◆ G4TwistTubsFlatSide() [3/3]

G4TwistTubsFlatSide::G4TwistTubsFlatSide ( __void__ &  a)

Definition at line 117 of file G4TwistTubsFlatSide.cc.

119{
120}

Member Function Documentation

◆ DistanceToSurface() [1/2]

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

Implements G4VTwistSurface.

Definition at line 146 of file G4TwistTubsFlatSide.cc.

153{
154 fCurStatWithV.ResetfDone(validate, &gp, &gv);
155
156 if (fCurStatWithV.IsDone()) {
157 G4int i;
158 for (i=0; i<fCurStatWithV.GetNXX(); i++) {
159 gxx[i] = fCurStatWithV.GetXX(i);
160 distance[i] = fCurStatWithV.GetDistance(i);
161 areacode[i] = fCurStatWithV.GetAreacode(i);
162 isvalid[i] = fCurStatWithV.IsValid(i);
163 }
164 return fCurStatWithV.GetNXX();
165 } else {
166 // initialize
167 G4int i;
168 for (i=0; i<2; i++) {
169 distance[i] = kInfinity;
170 areacode[i] = sOutside;
171 isvalid[i] = false;
172 gxx[i].set(kInfinity, kInfinity, kInfinity);
173 }
174 }
175
178
179 //
180 // special case!
181 // if p is on surface, distance = 0.
182 //
183
184 if (std::fabs(p.z()) == 0.) { // if p is on the plane
185 distance[0] = 0;
186 G4ThreeVector xx = p;
187 gxx[0] = ComputeGlobalPoint(xx);
188
189 if (validate == kValidateWithTol) {
190 areacode[0] = GetAreaCode(xx);
191 if (!IsOutside(areacode[0])) {
192 isvalid[0] = true;
193 }
194 } else if (validate == kValidateWithoutTol) {
195 areacode[0] = GetAreaCode(xx, false);
196 if (IsInside(areacode[0])) {
197 isvalid[0] = true;
198 }
199 } else { // kDontValidate
200 areacode[0] = sInside;
201 isvalid[0] = true;
202 }
203
204 return 1;
205 }
206 //
207 // special case end
208 //
209
210 if (v.z() == 0) {
211
212 fCurStatWithV.SetCurrentStatus(0, gxx[0], distance[0], areacode[0],
213 isvalid[0], 0, validate, &gp, &gv);
214 return 0;
215 }
216
217 distance[0] = - (p.z() / v.z());
218
219 G4ThreeVector xx = p + distance[0]*v;
220 gxx[0] = ComputeGlobalPoint(xx);
221
222 if (validate == kValidateWithTol) {
223 areacode[0] = GetAreaCode(xx);
224 if (!IsOutside(areacode[0])) {
225 if (distance[0] >= 0) isvalid[0] = true;
226 }
227 } else if (validate == kValidateWithoutTol) {
228 areacode[0] = GetAreaCode(xx, false);
229 if (IsInside(areacode[0])) {
230 if (distance[0] >= 0) isvalid[0] = true;
231 }
232 } else { // kDontValidate
233 areacode[0] = sInside;
234 if (distance[0] >= 0) isvalid[0] = true;
235 }
236
237 fCurStatWithV.SetCurrentStatus(0, gxx[0], distance[0], areacode[0],
238 isvalid[0], 1, validate, &gp, &gv);
239
240#ifdef G4TWISTDEBUG
241 G4cerr << "ERROR - G4TwistTubsFlatSide::DistanceToSurface(p,v)" << G4endl;
242 G4cerr << " Name : " << GetName() << G4endl;
243 G4cerr << " xx : " << xx << G4endl;
244 G4cerr << " gxx[0] : " << gxx[0] << G4endl;
245 G4cerr << " dist[0] : " << distance[0] << G4endl;
246 G4cerr << " areacode[0] : " << areacode[0] << G4endl;
247 G4cerr << " isvalid[0] : " << isvalid[0] << G4endl;
248#endif
249 return 1;
250}
#define G4endl
Definition: G4ios.hh:52
G4DLLIMPORT std::ostream G4cerr
double z() const
virtual G4int GetAreaCode(const G4ThreeVector &xx, G4bool withTol=true)
G4int GetAreacode(G4int i) const
G4double GetDistance(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=0)
G4bool IsValid(G4int i) const
G4ThreeVector GetXX(G4int i) const
void ResetfDone(EValidate validate, const G4ThreeVector *p, const G4ThreeVector *v=0)
static const G4int sOutside
G4ThreeVector ComputeLocalDirection(const G4ThreeVector &gp) const
G4bool IsInside(G4int areacode, G4bool testbitmode=false) const
G4ThreeVector ComputeLocalPoint(const G4ThreeVector &gp) const
G4bool IsOutside(G4int areacode) const
static const G4int sInside
virtual G4String GetName() const
CurrentStatus fCurStatWithV
G4ThreeVector ComputeGlobalPoint(const G4ThreeVector &lp) const

◆ DistanceToSurface() [2/2]

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

Implements G4VTwistSurface.

Definition at line 255 of file G4TwistTubsFlatSide.cc.

259{
260 // Calculate distance to plane in local coordinate,
261 // then return distance and global intersection points.
262 //
263
265
266 if (fCurStat.IsDone()) {
267 G4int i;
268 for (i=0; i<fCurStat.GetNXX(); i++) {
269 gxx[i] = fCurStat.GetXX(i);
270 distance[i] = fCurStat.GetDistance(i);
271 areacode[i] = fCurStat.GetAreacode(i);
272 }
273 return fCurStat.GetNXX();
274 } else {
275 // initialize
276 G4int i;
277 for (i=0; i<2; i++) {
278 distance[i] = kInfinity;
279 areacode[i] = sOutside;
280 gxx[i].set(kInfinity, kInfinity, kInfinity);
281 }
282 }
283
285 G4ThreeVector xx;
286
287 // The plane is placed on origin with making its normal
288 // parallel to z-axis.
289 if (std::fabs(p.z()) <= 0.5 * kCarTolerance) { // if p is on the plane, return 1
290 distance[0] = 0;
291 xx = p;
292 } else {
293 distance[0] = std::fabs(p.z());
294 xx.set(p.x(), p.y(), 0);
295 }
296
297 gxx[0] = ComputeGlobalPoint(xx);
298 areacode[0] = sInside;
299 G4bool isvalid = true;
300 fCurStat.SetCurrentStatus(0, gxx[0], distance[0], areacode[0],
301 isvalid, 1, kDontValidate, &gp);
302 return 1;
303
304}
bool G4bool
Definition: G4Types.hh:67
double x() const
double y() const
CurrentStatus fCurStat

◆ GetAreaCode()

G4int G4TwistTubsFlatSide::GetAreaCode ( const G4ThreeVector xx,
G4bool  withTol = true 
)
protectedvirtual

Implements G4VTwistSurface.

Definition at line 309 of file G4TwistTubsFlatSide.cc.

311{
312
313 static const G4double rtol
315
316 G4int areacode = sInside;
317
318 if (fAxis[0] == kRho && fAxis[1] == kPhi) {
319 G4int rhoaxis = 0;
320 // G4int phiaxis = 0;
321
322 G4ThreeVector dphimin; // direction of phi-minimum boundary
323 G4ThreeVector dphimax; // direction of phi-maximum boundary
324 dphimin = GetCorner(sC0Max1Min);
325 dphimax = GetCorner(sC0Max1Max);
326
327 if (withTol) {
328
329 G4bool isoutside = false;
330
331 // test boundary of rho-axis
332
333 if (xx.getRho() <= fAxisMin[rhoaxis] + rtol) {
334
335 areacode |= (sAxis0 & (sAxisRho | sAxisMin)) | sBoundary; // rho-min
336 if (xx.getRho() < fAxisMin[rhoaxis] - rtol) isoutside = true;
337
338 } else if (xx.getRho() >= fAxisMax[rhoaxis] - rtol) {
339
340 areacode |= (sAxis0 & (sAxisRho | sAxisMax)) | sBoundary; // rho-max
341 if (xx.getRho() > fAxisMax[rhoaxis] + rtol) isoutside = true;
342
343 }
344
345 // test boundary of phi-axis
346
347 if (AmIOnLeftSide(xx, dphimin) >= 0) { // xx is on dphimin
348
349 areacode |= (sAxis1 & (sAxisPhi | sAxisMin));
350 if (areacode & sBoundary) areacode |= sCorner; // xx is on the corner.
351 else areacode |= sBoundary;
352
353 if (AmIOnLeftSide(xx, dphimin) > 0) isoutside = true;
354
355 } else if (AmIOnLeftSide(xx, dphimax) <= 0) { // xx is on dphimax
356
357 areacode |= (sAxis1 & (sAxisPhi | sAxisMax));
358 if (areacode & sBoundary) areacode |= sCorner; // xx is on the corner.
359 else areacode |= sBoundary;
360
361 if (AmIOnLeftSide(xx, dphimax) < 0) isoutside = true;
362
363 }
364
365 // if isoutside = true, clear inside bit.
366 // if not on boundary, add axis information.
367
368 if (isoutside) {
369 G4int tmpareacode = areacode & (~sInside);
370 areacode = tmpareacode;
371 } else if ((areacode & sBoundary) != sBoundary) {
372 areacode |= (sAxis0 & sAxisRho) | (sAxis1 & sAxisPhi);
373 }
374
375 } else {
376
377 // out of boundary of rho-axis
378
379 if (xx.getRho() < fAxisMin[rhoaxis]) {
380 areacode |= (sAxis0 & (sAxisRho | sAxisMin)) | sBoundary;
381 } else if (xx.getRho() > fAxisMax[rhoaxis]) {
382 areacode |= (sAxis0 & (sAxisRho | sAxisMax)) | sBoundary;
383 }
384
385 // out of boundary of phi-axis
386
387 if (AmIOnLeftSide(xx, dphimin, false) >= 0) { // xx is leftside or
388 areacode |= (sAxis1 & (sAxisPhi | sAxisMin)) ; // boundary of dphimin
389 if (areacode & sBoundary) areacode |= sCorner; // xx is on the corner.
390 else areacode |= sBoundary;
391
392 } else if (AmIOnLeftSide(xx, dphimax, false) <= 0) { // xx is rightside or
393 areacode |= (sAxis1 & (sAxisPhi | sAxisMax)) ; // boundary of dphimax
394 if (areacode & sBoundary) areacode |= sCorner; // xx is on the corner.
395 else areacode |= sBoundary;
396
397 }
398
399 if ((areacode & sBoundary) != sBoundary) {
400 areacode |= (sAxis0 & sAxisRho) | (sAxis1 & sAxisPhi);
401 }
402
403 }
404 return areacode;
405 } else {
406
407 std::ostringstream message;
408 message << "Feature NOT implemented !" << G4endl
409 << " fAxis[0] = " << fAxis[0] << G4endl
410 << " fAxis[1] = " << fAxis[1];
411 G4Exception("G4TwistTubsFlatSide::GetAreaCode()", "GeomSolids0001",
412 FatalException, message);
413 }
414 return areacode;
415}
@ FatalException
double G4double
Definition: G4Types.hh:64
double getRho() const
G4double GetRadialTolerance() const
static G4GeometryTolerance * GetInstance()
virtual G4int AmIOnLeftSide(const G4ThreeVector &me, const G4ThreeVector &vec, G4bool withTol=true)
static const G4int sAxisMax
static const G4int sAxis0
static const G4int sAxisPhi
static const G4int sAxisMin
static const G4int sC0Max1Max
static const G4int sAxis1
static const G4int sAxisRho
G4ThreeVector GetCorner(G4int areacode) const
static const G4int sBoundary
static const G4int sCorner
static const G4int sC0Max1Min

Referenced by DistanceToSurface().

◆ GetBoundaryMax()

G4double G4TwistTubsFlatSide::GetBoundaryMax ( G4double  phi)
inlinevirtual

Implements G4VTwistSurface.

Definition at line 137 of file G4TwistTubsFlatSide.hh.

138{
140 return std::atan2( dphimax.y(), dphimax.x() );
141}

Referenced by GetFacets().

◆ GetBoundaryMin()

G4double G4TwistTubsFlatSide::GetBoundaryMin ( G4double  phi)
inlinevirtual

Implements G4VTwistSurface.

Definition at line 130 of file G4TwistTubsFlatSide.hh.

131{
133 return std::atan2( dphimin.y(), dphimin.x() );
134}

Referenced by GetFacets().

◆ GetFacets()

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

Implements G4VTwistSurface.

Definition at line 509 of file G4TwistTubsFlatSide.cc.

511{
512
513 G4ThreeVector p ;
514
515 G4double rmin = fAxisMin[0] ;
516 G4double rmax = fAxisMax[0] ;
517 G4double phimin, phimax ;
518
519 G4double r,phi ;
520
521 G4int i,j ;
522
523 G4int nnode,nface ;
524
525 for ( i = 0 ; i<n ; i++ ) {
526
527 r = rmin + i*(rmax-rmin)/(n-1) ;
528
529 phimin = GetBoundaryMin(r) ;
530 phimax = GetBoundaryMax(r) ;
531
532 for ( j = 0 ; j<k ; j++ )
533 {
534 phi = phimin + j*(phimax-phimin)/(k-1) ;
535
536 nnode = GetNode(i,j,k,n,iside) ;
537 p = SurfacePoint(phi,r,true) ; // surface point in global coord.system
538
539 xyz[nnode][0] = p.x() ;
540 xyz[nnode][1] = p.y() ;
541 xyz[nnode][2] = p.z() ;
542
543 if ( i<n-1 && j<k-1 ) { // conterclock wise filling
544
545 nface = GetFace(i,j,k,n,iside) ;
546
547 if (fHandedness < 0) { // lower side
548 faces[nface][0] = GetEdgeVisibility(i,j,k,n,0,-1) * ( GetNode(i ,j ,k,n,iside)+1) ;
549 faces[nface][1] = GetEdgeVisibility(i,j,k,n,1,-1) * ( GetNode(i ,j+1,k,n,iside)+1) ;
550 faces[nface][2] = GetEdgeVisibility(i,j,k,n,2,-1) * ( GetNode(i+1,j+1,k,n,iside)+1) ;
551 faces[nface][3] = GetEdgeVisibility(i,j,k,n,3,-1) * ( GetNode(i+1,j ,k,n,iside)+1) ;
552 } else { // upper side
553 faces[nface][0] = GetEdgeVisibility(i,j,k,n,0,1) * ( GetNode(i ,j ,k,n,iside)+1) ;
554 faces[nface][1] = GetEdgeVisibility(i,j,k,n,1,1) * ( GetNode(i+1,j ,k,n,iside)+1) ;
555 faces[nface][2] = GetEdgeVisibility(i,j,k,n,2,1) * ( GetNode(i+1,j+1,k,n,iside)+1) ;
556 faces[nface][3] = GetEdgeVisibility(i,j,k,n,3,1) * ( GetNode(i ,j+1,k,n,iside)+1) ;
557
558 }
559
560
561
562 }
563 }
564 }
565}
virtual G4double GetBoundaryMin(G4double phi)
virtual G4double GetBoundaryMax(G4double phi)
virtual G4ThreeVector SurfacePoint(G4double, G4double, G4bool isGlobal=false)
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)

◆ GetNormal()

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

Implements G4VTwistSurface.

Definition at line 133 of file G4TwistTubsFlatSide.cc.

135{
136 if (isGlobal) {
138 } else {
139 return fCurrentNormal.normal;
140 }
141}
G4ThreeVector ComputeGlobalDirection(const G4ThreeVector &lp) const

◆ GetSurfaceArea()

virtual G4double G4TwistTubsFlatSide::GetSurfaceArea ( )
inlinevirtual

Implements G4VTwistSurface.

Definition at line 95 of file G4TwistTubsFlatSide.hh.

95{ return fSurfaceArea ; }

◆ SurfacePoint()

G4ThreeVector G4TwistTubsFlatSide::SurfacePoint ( G4double  phi,
G4double  rho,
G4bool  isGlobal = false 
)
inlinevirtual

Implements G4VTwistSurface.

Definition at line 120 of file G4TwistTubsFlatSide.hh.

122{
123 G4ThreeVector SurfPoint (rho*std::cos(phi) , rho*std::sin(phi) , 0);
124
125 if (isGlobal) { return (fRot * SurfPoint + fTrans); }
126 return SurfPoint;
127}

Referenced by GetFacets().

Member Data Documentation

◆ fSurfaceArea

G4double G4TwistTubsFlatSide::fSurfaceArea

Definition at line 99 of file G4TwistTubsFlatSide.hh.

Referenced by G4TwistTubsFlatSide(), and GetSurfaceArea().


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