Geant4 11.1.1
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 *ax0min, G4VTwistSurface *ax1min, G4VTwistSurface *ax0max, G4VTwistSurface *ax1max)
 
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__ &)
 

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 41 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 39 of file G4TwistTubsFlatSide.cc.

49 : G4VTwistSurface(name, rot, tlate, 0, axis0, axis1,
50 axis0min, axis1min, axis0max, axis1max)
51{
52 if (axis0 == kPhi && axis1 == kRho)
53 {
54 G4Exception("G4TwistTubsFlatSide::G4TwistTubsFlatSide()",
55 "GeomSolids0002", FatalErrorInArgument,
56 "Should swap axis0 and axis1!");
57 }
58
59 G4ThreeVector normal = rot.inverse()*n;
60 fCurrentNormal.normal = normal.unit(); // in local coordinate system
61 fIsValidNorm = true;
62
63 SetCorners();
64 SetBoundaries();
65
66 fSurfaceArea = 1. ; // NOTE: not yet implemented!
67}
@ FatalErrorInArgument
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
Definition: G4Exception.cc:59
Hep3Vector unit() const
HepRotation inverse() const
G4SurfCurNormal fCurrentNormal
@ kPhi
Definition: geomdefs.hh:60
@ kRho
Definition: geomdefs.hh:58

◆ 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 69 of file G4TwistTubsFlatSide.cc.

76 : G4VTwistSurface(name)
77{
78 fHandedness = handedness; // +z = +ve, -z = -ve
79 fAxis[0] = kRho; // in local coordinate system
80 fAxis[1] = kPhi;
81 G4int i = (handedness < 0 ? 0 : 1);
82 fAxisMin[0] = EndInnerRadius[i]; // Inner-hype radius at z=0
83 fAxisMax[0] = EndOuterRadius[i]; // Outer-hype radius at z=0
84 fAxisMin[1] = -0.5*DPhi;
85 fAxisMax[1] = -fAxisMin[1];
86 fCurrentNormal.normal.set(0, 0, (fHandedness < 0 ? -1 : 1));
87 // Unit vector, in local coordinate system
88 fRot.rotateZ(EndPhi[i]);
89 fTrans.set(0, 0, EndZ[i]);
90 fIsValidNorm = true;
91
92 SetCorners();
93 SetBoundaries();
94
95 fSurfaceArea = 0.5*DPhi * (EndOuterRadius[i]*EndOuterRadius[i]
96 - EndInnerRadius[i]*EndInnerRadius[i] ) ;
97}
int G4int
Definition: G4Types.hh:85
void set(double x, double y, double z)
HepRotation & rotateZ(double delta)
Definition: Rotation.cc:87
G4double fAxisMax[2]
G4RotationMatrix fRot
G4ThreeVector fTrans
G4double fAxisMin[2]

◆ ~G4TwistTubsFlatSide()

G4TwistTubsFlatSide::~G4TwistTubsFlatSide ( )
virtual

Definition at line 110 of file G4TwistTubsFlatSide.cc.

111{
112}

◆ G4TwistTubsFlatSide() [3/3]

G4TwistTubsFlatSide::G4TwistTubsFlatSide ( __void__ &  a)

Definition at line 102 of file G4TwistTubsFlatSide.cc.

103 : G4VTwistSurface(a)
104{
105}

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 133 of file G4TwistTubsFlatSide.cc.

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

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

◆ GetAreaCode()

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

Implements G4VTwistSurface.

Definition at line 316 of file G4TwistTubsFlatSide.cc.

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

128{
130 return std::atan2( dphimax.y(), dphimax.x() );
131}

Referenced by GetFacets().

◆ GetBoundaryMin()

G4double G4TwistTubsFlatSide::GetBoundaryMin ( G4double  phi)
inlinevirtual

Implements G4VTwistSurface.

Definition at line 120 of file G4TwistTubsFlatSide.hh.

121{
123 return std::atan2( dphimin.y(), dphimin.x() );
124}

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 529 of file G4TwistTubsFlatSide.cc.

531{
532 G4ThreeVector p ;
533
534 G4double rmin = fAxisMin[0] ;
535 G4double rmax = fAxisMax[0] ;
536 G4double phimin, phimax ;
537
538 G4double r,phi ;
539 G4int nnode,nface ;
540
541 for ( G4int i = 0 ; i<n ; ++i )
542 {
543 r = rmin + i*(rmax-rmin)/(n-1) ;
544
545 phimin = GetBoundaryMin(r) ;
546 phimax = GetBoundaryMax(r) ;
547
548 for ( G4int j = 0 ; j<k ; ++j )
549 {
550 phi = phimin + j*(phimax-phimin)/(k-1) ;
551
552 nnode = GetNode(i,j,k,n,iside) ;
553 p = SurfacePoint(phi,r,true) ; // surface point in global coord.system
554
555 xyz[nnode][0] = p.x() ;
556 xyz[nnode][1] = p.y() ;
557 xyz[nnode][2] = p.z() ;
558
559 if ( i<n-1 && j<k-1 ) // conterclock wise filling
560 {
561 nface = GetFace(i,j,k,n,iside) ;
562
563 if (fHandedness < 0) // lower side
564 {
565 faces[nface][0] = GetEdgeVisibility(i,j,k,n,0,-1)
566 * ( GetNode(i ,j ,k,n,iside)+1) ;
567 faces[nface][1] = GetEdgeVisibility(i,j,k,n,1,-1)
568 * ( GetNode(i ,j+1,k,n,iside)+1) ;
569 faces[nface][2] = GetEdgeVisibility(i,j,k,n,2,-1)
570 * ( GetNode(i+1,j+1,k,n,iside)+1) ;
571 faces[nface][3] = GetEdgeVisibility(i,j,k,n,3,-1)
572 * ( GetNode(i+1,j ,k,n,iside)+1) ;
573 }
574 else // upper side
575 {
576 faces[nface][0] = GetEdgeVisibility(i,j,k,n,0,1)
577 * ( GetNode(i ,j ,k,n,iside)+1) ;
578 faces[nface][1] = GetEdgeVisibility(i,j,k,n,1,1)
579 * ( GetNode(i+1,j ,k,n,iside)+1) ;
580 faces[nface][2] = GetEdgeVisibility(i,j,k,n,2,1)
581 * ( GetNode(i+1,j+1,k,n,iside)+1) ;
582 faces[nface][3] = GetEdgeVisibility(i,j,k,n,3,1)
583 * ( GetNode(i ,j+1,k,n,iside)+1) ;
584 }
585 }
586 }
587 }
588}
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 117 of file G4TwistTubsFlatSide.cc.

119{
120 if (isGlobal)
121 {
123 }
124 else
125 {
126 return fCurrentNormal.normal;
127 }
128}
G4ThreeVector ComputeGlobalDirection(const G4ThreeVector &lp) const

◆ GetSurfaceArea()

virtual G4double G4TwistTubsFlatSide::GetSurfaceArea ( )
inlinevirtual

Implements G4VTwistSurface.

Definition at line 84 of file G4TwistTubsFlatSide.hh.

84{ return fSurfaceArea ; }

◆ SurfacePoint()

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

Implements G4VTwistSurface.

Definition at line 110 of file G4TwistTubsFlatSide.hh.

112{
113 G4ThreeVector SurfPoint (rho*std::cos(phi) , rho*std::sin(phi) , 0);
114
115 if (isGlobal) { return (fRot * SurfPoint + fTrans); }
116 return SurfPoint;
117}

Referenced by GetFacets().


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