Geant4  10.03
G4Orb.cc
Go to the documentation of this file.
1 //
2 // ********************************************************************
3 // * License and Disclaimer *
4 // * *
5 // * The Geant4 software is copyright of the Copyright Holders of *
6 // * the Geant4 Collaboration. It is provided under the terms and *
7 // * conditions of the Geant4 Software License, included in the file *
8 // * LICENSE and available at http://cern.ch/geant4/license . These *
9 // * include a list of copyright holders. *
10 // * *
11 // * Neither the authors of this software system, nor their employing *
12 // * institutes,nor the agencies providing financial support for this *
13 // * work make any representation or warranty, express or implied, *
14 // * regarding this software system or assume any liability for its *
15 // * use. Please see the license in the file LICENSE and URL above *
16 // * for the full disclaimer and the limitation of liability. *
17 // * *
18 // * This code implementation is the result of the scientific and *
19 // * technical work of the GEANT4 collaboration. *
20 // * By using, copying, modifying or distributing the software (or *
21 // * any work based on the software) you agree to acknowledge its *
22 // * use in resulting scientific publications, and indicate your *
23 // * acceptance of all terms of the Geant4 Software license. *
24 // ********************************************************************
25 //
26 // $Id: G4Orb.cc 101121 2016-11-07 09:18:01Z gcosmo $
27 //
28 // class G4Orb
29 //
30 // Implementation for G4Orb class
31 //
32 // History:
33 //
34 // 27.10.16 E.Tcherniaev - added Extent(), reimplemented CalculateExtent()
35 // 05.04.12 M.Kelsey - GetPointOnSurface() throw flat in cos(theta)
36 // 30.06.04 V.Grichine - bug fixed in DistanceToIn(p,v) on Rmax surface
37 // 20.08.03 V.Grichine - created
38 //
40 
41 #include "G4Orb.hh"
42 
43 #if !defined(G4GEOM_USE_UORB)
44 
45 #include "G4TwoVector.hh"
46 #include "G4VoxelLimits.hh"
47 #include "G4AffineTransform.hh"
48 #include "G4GeometryTolerance.hh"
49 #include "G4BoundingEnvelope.hh"
50 
51 #include "G4VPVParameterisation.hh"
52 
53 #include "Randomize.hh"
54 
55 #include "meshdefs.hh"
56 
57 #include "G4VGraphicsScene.hh"
58 
59 using namespace CLHEP;
60 
61 // Private enum: Not for external use - used by distanceToOut
62 
63 enum ESide {kNull,kRMax};
64 
65 // used by normal
66 
67 enum ENorm {kNRMax};
68 
69 
71 //
72 // constructor - check positive radius
73 //
74 
75 G4Orb::G4Orb( const G4String& pName, G4double pRmax )
76 : G4CSGSolid(pName), fRmax(pRmax)
77 {
78 
79  const G4double fEpsilon = 2.e-11; // relative tolerance of fRmax
80 
81  G4double kRadTolerance
83 
84  // Check radius
85  //
86  if ( pRmax < 10*kCarTolerance )
87  {
88  G4Exception("G4Orb::G4Orb()", "GeomSolids0002", FatalException,
89  "Invalid radius < 10*kCarTolerance.");
90  }
91  fRmaxTolerance = std::max( kRadTolerance, fEpsilon*fRmax);
92 
93 }
94 
96 //
97 // Fake default constructor - sets only member data and allocates memory
98 // for usage restricted to object persistency.
99 //
100 G4Orb::G4Orb( __void__& a )
101  : G4CSGSolid(a), fRmax(0.), fRmaxTolerance(0.)
102 {
103 }
104 
106 //
107 // Destructor
108 
110 {
111 }
112 
114 //
115 // Copy constructor
116 
117 G4Orb::G4Orb(const G4Orb& rhs)
118  : G4CSGSolid(rhs), fRmax(rhs.fRmax), fRmaxTolerance(rhs.fRmaxTolerance)
119 {
120 }
121 
123 //
124 // Assignment operator
125 
127 {
128  // Check assignment to self
129  //
130  if (this == &rhs) { return *this; }
131 
132  // Copy base class data
133  //
135 
136  // Copy data
137  //
138  fRmax = rhs.fRmax;
140 
141  return *this;
142 }
143 
145 //
146 // Dispatch to parameterisation for replication mechanism dimension
147 // computation & modification.
148 
150  const G4int n,
151  const G4VPhysicalVolume* pRep )
152 {
153  p->ComputeDimensions(*this,n,pRep);
154 }
155 
157 //
158 // Get bounding box
159 
160 void G4Orb::Extent(G4ThreeVector& pMin, G4ThreeVector& pMax) const
161 {
162  G4double radius = GetRadius();
163  pMin.set(-radius,-radius,-radius);
164  pMax.set( radius, radius, radius);
165 
166  // Check correctness of the bounding box
167  //
168  if (pMin.x() >= pMax.x() || pMin.y() >= pMax.y() || pMin.z() >= pMax.z())
169  {
170  std::ostringstream message;
171  message << "Bad bounding box (min >= max) for solid: "
172  << GetName() << " !"
173  << "\npMin = " << pMin
174  << "\npMax = " << pMax;
175  G4Exception("G4Orb::Extent()", "GeomMgt0001", JustWarning, message);
176  DumpInfo();
177  }
178 }
179 
181 //
182 // Calculate extent under transform and specified limit
183 
185  const G4VoxelLimits& pVoxelLimit,
186  const G4AffineTransform& pTransform,
187  G4double& pMin, G4double& pMax) const
188 {
189  G4ThreeVector bmin, bmax;
190  G4bool exist;
191 
192  // Get bounding box
193  Extent(bmin,bmax);
194 
195  // Check bounding box
196  G4BoundingEnvelope bbox(bmin,bmax);
197 #ifdef G4BBOX_EXTENT
198  if (true) return bbox.CalculateExtent(pAxis,pVoxelLimit,pTransform,pMin,pMax);
199 #endif
200  if (bbox.BoundingBoxVsVoxelLimits(pAxis,pVoxelLimit,pTransform,pMin,pMax))
201  {
202  return exist = (pMin < pMax) ? true : false;
203  }
204 
205  // Find bounding envelope and calculate extent
206  //
207  static const G4int NTHETA = 8; // number of steps along Theta
208  static const G4int NPHI = 16; // number of steps along Phi
209  static const G4double sinHalfTheta = std::sin(halfpi/NTHETA);
210  static const G4double cosHalfTheta = std::cos(halfpi/NTHETA);
211  static const G4double sinHalfPhi = std::sin(pi/NPHI);
212  static const G4double cosHalfPhi = std::cos(pi/NPHI);
213  static const G4double sinStepTheta = 2.*sinHalfTheta*cosHalfTheta;
214  static const G4double cosStepTheta = 1. - 2.*sinHalfTheta*sinHalfTheta;
215  static const G4double sinStepPhi = 2.*sinHalfPhi*cosHalfPhi;
216  static const G4double cosStepPhi = 1. - 2.*sinHalfPhi*sinHalfPhi;
217 
218  G4double radius = GetRadius();
219  G4double rtheta = radius/cosHalfTheta;
220  G4double rphi = rtheta/cosHalfPhi;
221 
222  // set reference circle
223  G4TwoVector xy[NPHI];
224  G4double sinCurPhi = sinHalfPhi;
225  G4double cosCurPhi = cosHalfPhi;
226  for (G4int k=0; k<NPHI; ++k)
227  {
228  xy[k].set(cosCurPhi,sinCurPhi);
229  G4double sinTmpPhi = sinCurPhi;
230  sinCurPhi = sinCurPhi*cosStepPhi + cosCurPhi*sinStepPhi;
231  cosCurPhi = cosCurPhi*cosStepPhi - sinTmpPhi*sinStepPhi;
232  }
233 
234  // set bounding circles
235  G4ThreeVectorList circles[NTHETA];
236  for (G4int i=0; i<NTHETA; ++i) circles[i].resize(NPHI);
237 
238  G4double sinCurTheta = sinHalfTheta;
239  G4double cosCurTheta = cosHalfTheta;
240  for (G4int i=0; i<NTHETA; ++i)
241  {
242  G4double z = rtheta*cosCurTheta;
243  G4double rho = rphi*sinCurTheta;
244  for (G4int k=0; k<NPHI; ++k)
245  {
246  circles[i][k].set(rho*xy[k].x(),rho*xy[k].y(),z);
247  }
248  G4double sinTmpTheta = sinCurTheta;
249  sinCurTheta = sinCurTheta*cosStepTheta + cosCurTheta*sinStepTheta;
250  cosCurTheta = cosCurTheta*cosStepTheta - sinTmpTheta*sinStepTheta;
251  }
252 
253  // set envelope and calculate extent
254  std::vector<const G4ThreeVectorList *> polygons;
255  polygons.resize(NTHETA);
256  for (G4int i=0; i<NTHETA; ++i) polygons[i] = &circles[i];
257 
258  G4BoundingEnvelope benv(bmin,bmax,polygons);
259  exist = benv.CalculateExtent(pAxis,pVoxelLimit,pTransform,pMin,pMax);
260  return exist;
261 }
262 
264 //
265 // Return whether point inside/outside/on surface
266 // Split into radius checks
267 //
268 
270 {
271  G4double rad2,tolRMax;
272  EInside in;
273 
274 
275  rad2 = p.x()*p.x()+p.y()*p.y()+p.z()*p.z();
276 
277  G4double radius = std::sqrt(rad2);
278 
279  // G4double radius = std::sqrt(rad2);
280  // Check radial surface
281  // sets `in'
282 
283  tolRMax = fRmax - fRmaxTolerance*0.5;
284 
285  if ( radius <= tolRMax ) { in = kInside; }
286  else
287  {
288  tolRMax = fRmax + fRmaxTolerance*0.5;
289  if ( radius <= tolRMax ) { in = kSurface; }
290  else { in = kOutside; }
291  }
292  return in;
293 }
294 
296 //
297 // Return unit normal of surface closest to p
298 // - note if point on z axis, ignore phi divided sides
299 // - unsafe if point close to z axis a rmin=0 - no explicit checks
300 
302 {
303  ENorm side = kNRMax;
304  G4ThreeVector norm;
305  G4double radius = std::sqrt(p.x()*p.x()+p.y()*p.y()+p.z()*p.z());
306 
307  switch (side)
308  {
309  case kNRMax:
310  norm = G4ThreeVector(p.x()/radius,p.y()/radius,p.z()/radius);
311  break;
312  default: // Should never reach this case ...
313  DumpInfo();
314  G4Exception("G4Orb::SurfaceNormal()", "GeomSolids1002", JustWarning,
315  "Undefined side for valid surface normal to solid.");
316  break;
317  }
318 
319  return norm;
320 }
321 
323 //
324 // Calculate distance to shape from outside, along normalised vector
325 // - return kInfinity if no intersection, or intersection distance <= tolerance
326 //
327 // -> If point is outside outer radius, compute intersection with rmax
328 // - if no intersection return
329 // - if valid phi,theta return intersection Dist
330 
332  const G4ThreeVector& v ) const
333 {
334  G4double snxt = kInfinity; // snxt = default return value
335 
336  G4double radius, pDotV3d; // , tolORMax2, tolIRMax2;
337  G4double c, d2, sd = kInfinity;
338 
339  const G4double dRmax = 100.*fRmax;
340 
341  // General Precalcs
342 
343  radius = std::sqrt(p.x()*p.x() + p.y()*p.y() + p.z()*p.z());
344  pDotV3d = p.x()*v.x() + p.y()*v.y() + p.z()*v.z();
345 
346  // Radial Precalcs
347 
348  // tolORMax2 = (fRmax+fRmaxTolerance*0.5)*(fRmax+fRmaxTolerance*0.5);
349  // tolIRMax2 = (fRmax-fRmaxTolerance*0.5)*(fRmax-fRmaxTolerance*0.5);
350 
351  // Outer spherical shell intersection
352  // - Only if outside tolerant fRmax
353  // - Check for if inside and outer G4Orb heading through solid (-> 0)
354  // - No intersect -> no intersection with G4Orb
355  //
356  // Shell eqn: x^2+y^2+z^2 = RSPH^2
357  //
358  // => (px+svx)^2+(py+svy)^2+(pz+svz)^2=R^2
359  //
360  // => (px^2+py^2+pz^2) +2sd(pxvx+pyvy+pzvz)+sd^2(vx^2+vy^2+vz^2)=R^2
361  // => rad2 +2sd(pDotV3d) +sd^2 =R^2
362  //
363  // => sd=-pDotV3d+-std::sqrt(pDotV3d^2-(rad2-R^2))
364 
365  c = (radius - fRmax)*(radius + fRmax);
366 
367  if( radius > fRmax-fRmaxTolerance*0.5 ) // not inside in terms of Inside(p)
368  {
369  if ( c > fRmaxTolerance*fRmax )
370  {
371  // If outside tolerant boundary of outer G4Orb in terms of c
372  // [ should be std::sqrt(rad2) - fRmax > fRmaxTolerance*0.5 ]
373 
374  d2 = pDotV3d*pDotV3d - c;
375 
376  if ( d2 >= 0 )
377  {
378  sd = -pDotV3d - std::sqrt(d2);
379  if ( sd >= 0 )
380  {
381  if ( sd > dRmax ) // Avoid rounding errors due to precision issues seen on
382  { // 64 bits systems. Split long distances and recompute
383  G4double fTerm = sd - std::fmod(sd,dRmax);
384  sd = fTerm + DistanceToIn(p+fTerm*v,v);
385  }
386  return snxt = sd;
387  }
388  }
389  else // No intersection with G4Orb
390  {
391  return snxt = kInfinity;
392  }
393  }
394  else // not outside in terms of c
395  {
396  if ( c > -fRmaxTolerance*fRmax ) // on surface
397  {
398  d2 = pDotV3d*pDotV3d - c;
399  if ( (d2 < fRmaxTolerance*fRmax) || (pDotV3d >= 0) )
400  {
401  return snxt = kInfinity;
402  }
403  else
404  {
405  return snxt = 0.;
406  }
407  }
408  }
409  }
410 #ifdef G4CSGDEBUG
411  else // inside ???
412  {
413  G4Exception("G4Orb::DistanceToIn(p,v)", "GeomSolids1002",
414  JustWarning, "Point p is inside !?");
415  }
416 #endif
417 
418  return snxt;
419 }
420 
422 //
423 // Calculate distance (<= actual) to closest surface of shape from outside
424 // - Calculate distance to radial plane
425 // - Return 0 if point inside
426 
428 {
429  G4double safe = 0.0,
430  radius = std::sqrt(p.x()*p.x()+p.y()*p.y()+p.z()*p.z());
431  safe = radius - fRmax;
432  if( safe < 0 ) { safe = 0.; }
433  return safe;
434 }
435 
437 //
438 // Calculate distance to surface of shape from `inside', allowing for tolerance
439 //
440 
442  const G4ThreeVector& v,
443  const G4bool calcNorm,
444  G4bool *validNorm,
445  G4ThreeVector *n ) const
446 {
447  G4double snxt = kInfinity; // ??? snxt is default return value
448  ESide side = kNull;
449 
450  G4double rad2,pDotV3d;
451  G4double xi,yi,zi; // Intersection point
452  G4double c,d2;
453 
454  rad2 = p.x()*p.x() + p.y()*p.y() + p.z()*p.z();
455  pDotV3d = p.x()*v.x() + p.y()*v.y() + p.z()*v.z();
456 
457  // Radial Intersection from G4Orb::DistanceToIn
458  //
459  // Outer spherical shell intersection
460  // - Only if outside tolerant fRmax
461  // - Check for if inside and outer G4Orb heading through solid (-> 0)
462  // - No intersect -> no intersection with G4Orb
463  //
464  // Shell eqn: x^2+y^2+z^2=RSPH^2
465  //
466  // => (px+svx)^2+(py+svy)^2+(pz+svz)^2=R^2
467  //
468  // => (px^2+py^2+pz^2) +2s(pxvx+pyvy+pzvz)+s^2(vx^2+vy^2+vz^2)=R^2
469  // => rad2 +2s(pDotV3d) +s^2 =R^2
470  //
471  // => s=-pDotV3d+-std::sqrt(pDotV3d^2-(rad2-R^2))
472 
473  const G4double Rmax_plus = fRmax + fRmaxTolerance*0.5;
474  G4double radius = std::sqrt(rad2);
475 
476  if ( radius <= Rmax_plus )
477  {
478  c = (radius - fRmax)*(radius + fRmax);
479 
480  if ( c < fRmaxTolerance*fRmax )
481  {
482  // Within tolerant Outer radius
483  //
484  // The test is
485  // radius - fRmax < 0.5*fRmaxTolerance
486  // => radius < fRmax + 0.5*kRadTol
487  // => rad2 < (fRmax + 0.5*kRadTol)^2
488  // => rad2 < fRmax^2 + 2.*0.5*fRmax*kRadTol + 0.25*kRadTol*kRadTol
489  // => rad2 - fRmax^2 <~ fRmax*kRadTol
490 
491  d2 = pDotV3d*pDotV3d - c;
492 
493  if( ( c > -fRmaxTolerance*fRmax) && // on tolerant surface
494  ( ( pDotV3d >= 0 ) || ( d2 < 0 )) ) // leaving outside from Rmax
495  // not re-entering
496  {
497  if(calcNorm)
498  {
499  *validNorm = true;
500  *n = G4ThreeVector(p.x()/fRmax,p.y()/fRmax,p.z()/fRmax);
501  }
502  return snxt = 0;
503  }
504  else
505  {
506  snxt = -pDotV3d + std::sqrt(d2); // second root since inside Rmax
507  side = kRMax;
508  }
509  }
510  }
511  else // p is outside ???
512  {
513  G4cout << G4endl;
514  DumpInfo();
515  std::ostringstream message;
516  G4int oldprc = message.precision(16);
517  message << "Logic error: snxt = kInfinity ???" << G4endl
518  << "Position:" << G4endl << G4endl
519  << "p.x() = " << p.x()/mm << " mm" << G4endl
520  << "p.y() = " << p.y()/mm << " mm" << G4endl
521  << "p.z() = " << p.z()/mm << " mm" << G4endl << G4endl
522  << "Rp = "<< std::sqrt( p.x()*p.x()+p.y()*p.y()+p.z()*p.z() )/mm
523  << " mm" << G4endl << G4endl
524  << "Direction:" << G4endl << G4endl
525  << "v.x() = " << v.x() << G4endl
526  << "v.y() = " << v.y() << G4endl
527  << "v.z() = " << v.z() << G4endl << G4endl
528  << "Proposed distance :" << G4endl << G4endl
529  << "snxt = " << snxt/mm << " mm" << G4endl;
530  message.precision(oldprc);
531  G4Exception("G4Orb::DistanceToOut(p,v,..)", "GeomSolids1002",
532  JustWarning, message);
533  }
534  if (calcNorm) // Output switch operator
535  {
536  switch( side )
537  {
538  case kRMax:
539  xi=p.x()+snxt*v.x();
540  yi=p.y()+snxt*v.y();
541  zi=p.z()+snxt*v.z();
542  *n=G4ThreeVector(xi/fRmax,yi/fRmax,zi/fRmax);
543  *validNorm=true;
544  break;
545  default:
546  G4cout << G4endl;
547  DumpInfo();
548  std::ostringstream message;
549  G4int oldprc = message.precision(16);
550  message << "Undefined side for valid surface normal to solid."
551  << G4endl
552  << "Position:" << G4endl << G4endl
553  << "p.x() = " << p.x()/mm << " mm" << G4endl
554  << "p.y() = " << p.y()/mm << " mm" << G4endl
555  << "p.z() = " << p.z()/mm << " mm" << G4endl << G4endl
556  << "Direction:" << G4endl << G4endl
557  << "v.x() = " << v.x() << G4endl
558  << "v.y() = " << v.y() << G4endl
559  << "v.z() = " << v.z() << G4endl << G4endl
560  << "Proposed distance :" << G4endl << G4endl
561  << "snxt = " << snxt/mm << " mm" << G4endl;
562  message.precision(oldprc);
563  G4Exception("G4Orb::DistanceToOut(p,v,..)","GeomSolids1002",
564  JustWarning, message);
565  break;
566  }
567  }
568  return snxt;
569 }
570 
572 //
573 // Calculate distance (<=actual) to closest surface of shape from inside
574 
576 {
577  G4double safe=0.0,radius = std::sqrt(p.x()*p.x()+p.y()*p.y()+p.z()*p.z());
578 
579 #ifdef G4CSGDEBUG
580  if( Inside(p) == kOutside )
581  {
582  G4int oldprc = G4cout.precision(16);
583  G4cout << G4endl;
584  DumpInfo();
585  G4cout << "Position:" << G4endl << G4endl;
586  G4cout << "p.x() = " << p.x()/mm << " mm" << G4endl;
587  G4cout << "p.y() = " << p.y()/mm << " mm" << G4endl;
588  G4cout << "p.z() = " << p.z()/mm << " mm" << G4endl << G4endl;
589  G4cout.precision(oldprc);
590  G4Exception("G4Orb::DistanceToOut(p)", "GeomSolids1002",
591  JustWarning, "Point p is outside !?" );
592  }
593 #endif
594 
595  safe = fRmax - radius;
596  if ( safe < 0. ) safe = 0.;
597  return safe;
598 }
599 
601 //
602 // G4EntityType
603 
605 {
606  return G4String("G4Orb");
607 }
608 
610 //
611 // Make a clone of the object
612 //
614 {
615  return new G4Orb(*this);
616 }
617 
619 //
620 // Stream object contents to an output stream
621 
622 std::ostream& G4Orb::StreamInfo( std::ostream& os ) const
623 {
624  G4int oldprc = os.precision(16);
625  os << "-----------------------------------------------------------\n"
626  << " *** Dump for solid - " << GetName() << " ***\n"
627  << " ===================================================\n"
628  << " Solid type: G4Orb\n"
629  << " Parameters: \n"
630 
631  << " outer radius: " << fRmax/mm << " mm \n"
632  << "-----------------------------------------------------------\n";
633  os.precision(oldprc);
634 
635  return os;
636 }
637 
639 //
640 // GetPointOnSurface
641 
643 {
644  // generate a random number from zero to 2pi...
645  //
646  G4double phi = G4RandFlat::shoot(0.,2.*pi);
647  G4double cosphi = std::cos(phi);
648  G4double sinphi = std::sin(phi);
649 
650  // generate a random point uniform in area
651  G4double costheta = G4RandFlat::shoot(-1.,1.);
652  G4double sintheta = std::sqrt(1.-sqr(costheta));
653 
654  return G4ThreeVector (fRmax*sintheta*cosphi,
655  fRmax*sintheta*sinphi, fRmax*costheta);
656 }
657 
659 //
660 // Methods for visualisation
661 
663 {
664  scene.AddSolid (*this);
665 }
666 
668 {
669  return new G4PolyhedronSphere (0., fRmax, 0., 2*pi, 0., pi);
670 }
671 
672 #endif
G4String GetName() const
ThreeVector shoot(const G4int Ap, const G4int Af)
void Extent(G4ThreeVector &pMin, G4ThreeVector &pMax) const
Definition: G4Orb.cc:160
static constexpr double mm
Definition: G4SIunits.hh:115
static const G4double kInfinity
Definition: geomdefs.hh:42
G4Orb & operator=(const G4Orb &rhs)
Definition: G4Orb.cc:126
CLHEP::Hep3Vector G4ThreeVector
virtual ~G4Orb()
Definition: G4Orb.cc:109
G4bool CalculateExtent(const EAxis pAxis, const G4VoxelLimits &pVoxelLimit, const G4AffineTransform &pTransform, G4double &pmin, G4double &pmax) const
Definition: G4Orb.cc:184
std::vector< ExP01TrackerHit * > a
Definition: ExP01Classes.hh:33
static const G4double d2
void DescribeYourselfTo(G4VGraphicsScene &scene) const
Definition: G4Orb.cc:662
Definition: G4Orb.cc:63
G4ThreeVector GetPointOnSurface() const
Definition: G4Orb.cc:642
ESide
Definition: G4Orb.hh:138
virtual void AddSolid(const G4Box &)=0
int G4int
Definition: G4Types.hh:78
EInside Inside(const G4ThreeVector &p) const
Definition: G4Orb.cc:269
G4double DistanceToIn(const G4ThreeVector &p, const G4ThreeVector &v) const
Definition: G4Orb.cc:331
void DumpInfo() const
G4Polyhedron * CreatePolyhedron() const
Definition: G4Orb.cc:667
ENorm
Definition: G4Cons.cc:80
G4double GetRadius() const
G4Orb(const G4String &pName, G4double pRmax)
Definition: G4Orb.cc:75
std::ostream & StreamInfo(std::ostream &os) const
Definition: G4Orb.cc:622
G4GLOB_DLL std::ostream G4cout
G4GeometryType GetEntityType() const
Definition: G4Orb.cc:604
G4double GetRadialTolerance() const
bool G4bool
Definition: G4Types.hh:79
Definition: G4Orb.cc:67
void ComputeDimensions(G4VPVParameterisation *p, const G4int n, const G4VPhysicalVolume *pRep)
Definition: G4Orb.cc:149
G4bool CalculateExtent(const EAxis pAxis, const G4VoxelLimits &pVoxelLimits, const G4Transform3D &pTransform3D, G4double &pMin, G4double &pMax) const
G4bool BoundingBoxVsVoxelLimits(const EAxis pAxis, const G4VoxelLimits &pVoxelLimits, const G4Transform3D &pTransform3D, G4double &pMin, G4double &pMax) const
const G4int n
std::vector< G4ThreeVector > G4ThreeVectorList
Definition: G4Orb.hh:61
G4VSolid * Clone() const
Definition: G4Orb.cc:613
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
virtual void ComputeDimensions(G4Box &, const G4int, const G4VPhysicalVolume *) const
G4double fRmax
Definition: G4Orb.hh:146
ENorm
Definition: G4Orb.hh:142
Definition: G4Orb.cc:63
T max(const T t1, const T t2)
brief Return the largest of the two arguments
EInside
Definition: geomdefs.hh:58
EAxis
Definition: geomdefs.hh:54
G4double fRmaxTolerance
Definition: G4Orb.hh:147
CLHEP::Hep2Vector G4TwoVector
Definition: G4TwoVector.hh:42
#define G4endl
Definition: G4ios.hh:61
G4double kCarTolerance
Definition: G4VSolid.hh:307
static constexpr double pi
Definition: G4SIunits.hh:75
static constexpr double halfpi
Definition: G4SIunits.hh:77
ESide
Definition: G4Cons.cc:76
T sqr(const T &x)
Definition: templates.hh:145
G4double DistanceToOut(const G4ThreeVector &p, const G4ThreeVector &v, const G4bool calcNorm=G4bool(false), G4bool *validNorm=0, G4ThreeVector *n=0) const
Definition: G4Orb.cc:441
double G4double
Definition: G4Types.hh:76
G4CSGSolid & operator=(const G4CSGSolid &rhs)
Definition: G4CSGSolid.cc:91
static G4GeometryTolerance * GetInstance()
G4ThreeVector SurfaceNormal(const G4ThreeVector &p) const
Definition: G4Orb.cc:301