#include <G4Box.hh>
|
| G4Box (const G4String &pName, G4double pX, G4double pY, G4double pZ) |
|
virtual | ~G4Box () |
|
void | ComputeDimensions (G4VPVParameterisation *p, const G4int n, const G4VPhysicalVolume *pRep) |
|
void | Extent (G4ThreeVector &pMin, G4ThreeVector &pMax) const |
|
G4bool | CalculateExtent (const EAxis pAxis, const G4VoxelLimits &pVoxelLimit, const G4AffineTransform &pTransform, G4double &pMin, G4double &pMax) const |
|
G4double | GetXHalfLength () const |
|
G4double | GetYHalfLength () const |
|
G4double | GetZHalfLength () const |
|
void | SetXHalfLength (G4double dx) |
|
void | SetYHalfLength (G4double dy) |
|
void | SetZHalfLength (G4double dz) |
|
G4double | GetCubicVolume () |
|
G4double | GetSurfaceArea () |
|
EInside | Inside (const G4ThreeVector &p) const |
|
G4ThreeVector | SurfaceNormal (const G4ThreeVector &p) const |
|
G4double | DistanceToIn (const G4ThreeVector &p, const G4ThreeVector &v) const |
|
G4double | DistanceToIn (const G4ThreeVector &p) const |
|
G4double | DistanceToOut (const G4ThreeVector &p, const G4ThreeVector &v, const G4bool calcNorm=false, G4bool *validNorm=0, G4ThreeVector *n=0) const |
|
G4double | DistanceToOut (const G4ThreeVector &p) const |
|
G4GeometryType | GetEntityType () const |
|
G4ThreeVector | GetPointOnSurface () const |
|
G4VSolid * | Clone () const |
|
std::ostream & | StreamInfo (std::ostream &os) const |
|
void | DescribeYourselfTo (G4VGraphicsScene &scene) const |
|
G4VisExtent | GetExtent () const |
|
G4Polyhedron * | CreatePolyhedron () const |
|
| G4Box (__void__ &) |
|
| G4Box (const G4Box &rhs) |
|
G4Box & | operator= (const G4Box &rhs) |
|
| G4CSGSolid (const G4String &pName) |
|
virtual | ~G4CSGSolid () |
|
virtual G4Polyhedron * | GetPolyhedron () const |
|
| G4CSGSolid (__void__ &) |
|
| G4CSGSolid (const G4CSGSolid &rhs) |
|
G4CSGSolid & | operator= (const G4CSGSolid &rhs) |
|
| G4VSolid (const G4String &name) |
|
virtual | ~G4VSolid () |
|
G4bool | operator== (const G4VSolid &s) const |
|
G4String | GetName () const |
|
void | SetName (const G4String &name) |
|
G4double | GetTolerance () const |
|
void | DumpInfo () const |
|
virtual const G4VSolid * | GetConstituentSolid (G4int no) const |
|
virtual G4VSolid * | GetConstituentSolid (G4int no) |
|
virtual const G4DisplacedSolid * | GetDisplacedSolidPtr () const |
|
virtual G4DisplacedSolid * | GetDisplacedSolidPtr () |
|
| G4VSolid (__void__ &) |
|
| G4VSolid (const G4VSolid &rhs) |
|
G4VSolid & | operator= (const G4VSolid &rhs) |
|
G4double | EstimateCubicVolume (G4int nStat, G4double epsilon) const |
|
G4double | EstimateSurfaceArea (G4int nStat, G4double ell) const |
|
|
G4double | GetRadiusInRing (G4double rmin, G4double rmax) const |
|
void | CalculateClippedPolygonExtent (G4ThreeVectorList &pPolygon, const G4VoxelLimits &pVoxelLimit, const EAxis pAxis, G4double &pMin, G4double &pMax) const |
|
void | ClipCrossSection (G4ThreeVectorList *pVertices, const G4int pSectionIndex, const G4VoxelLimits &pVoxelLimit, const EAxis pAxis, G4double &pMin, G4double &pMax) const |
|
void | ClipBetweenSections (G4ThreeVectorList *pVertices, const G4int pSectionIndex, const G4VoxelLimits &pVoxelLimit, const EAxis pAxis, G4double &pMin, G4double &pMax) const |
|
void | ClipPolygon (G4ThreeVectorList &pPolygon, const G4VoxelLimits &pVoxelLimit, const EAxis pAxis) const |
|
G4double | fCubicVolume |
|
G4double | fSurfaceArea |
|
G4bool | fRebuildPolyhedron |
|
G4Polyhedron * | fpPolyhedron |
|
G4double | kCarTolerance |
|
Definition at line 64 of file G4Box.hh.
Enumerator |
---|
kUndefined |
|
kPX |
|
kMX |
|
kPY |
|
kMY |
|
kPZ |
|
kMZ |
|
Definition at line 135 of file G4Box.hh.
Definition at line 63 of file G4Box.cc.
74 std::ostringstream message;
75 message <<
"Dimensions too small for Solid: " <<
GetName() <<
"!" <<
G4endl
76 <<
" hX, hY, hZ = " << pX <<
", " << pY <<
", " << pZ;
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
G4CSGSolid(const G4String &pName)
G4Box::G4Box |
( |
__void__ & |
a | ) |
|
Definition at line 86 of file G4Box.cc.
87 :
G4CSGSolid(
a), fDx(0.), fDy(0.), fDz(0.), delta(0.)
std::vector< ExP01TrackerHit * > a
G4CSGSolid(const G4String &pName)
G4Box::G4Box |
( |
const G4Box & |
rhs | ) |
|
Definition at line 103 of file G4Box.cc.
104 :
G4CSGSolid(rhs), fDx(rhs.fDx), fDy(rhs.fDy), fDz(rhs.fDz), delta(rhs.delta)
G4CSGSolid(const G4String &pName)
Implements G4VSolid.
Definition at line 233 of file G4Box.cc.
245 return bbox.CalculateExtent(pAxis,pVoxelLimit,pTransform,pMin,pMax);
void Extent(G4ThreeVector &pMin, G4ThreeVector &pMax) const
Reimplemented from G4VSolid.
Definition at line 864 of file G4Box.cc.
866 return new G4Box(*
this);
G4Box(const G4String &pName, G4double pX, G4double pY, G4double pZ)
Reimplemented from G4VSolid.
Definition at line 199 of file G4Box.cc.
virtual void ComputeDimensions(G4Box &, const G4int, const G4VPhysicalVolume *) const
Implements G4VSolid.
Definition at line 873 of file G4Box.cc.
virtual void AddSolid(const G4Box &)=0
Implements G4VSolid.
Definition at line 436 of file G4Box.cc.
445 safx = std::fabs(p.
x()) - fDx ;
446 safy = std::fabs(p.
y()) - fDy ;
447 safz = std::fabs(p.
z()) - fDz ;
454 if ( ((p.
x()*v.
x() >= 0.0) && (safx > -delta))
455 || ((p.
y()*v.
y() >= 0.0) && (safy > -delta))
456 || ((p.
z()*v.
z() >= 0.0) && (safz > -delta)) )
466 stmp = 1.0/std::fabs(v.
x()) ;
471 smax = (fDx+std::fabs(p.
x()))*stmp ;
475 if (v.
x() < 0) { sOut = (fDx + p.
x())*stmp ; }
476 else { sOut = (fDx - p.
x())*stmp ; }
484 stmp = 1.0/std::fabs(v.
y()) ;
489 smaxy = (fDy+std::fabs(p.
y()))*stmp ;
491 if (sminy > smin) { smin=sminy ; }
492 if (smaxy < smax) { smax=smaxy ; }
494 if (smin >= (smax-delta))
501 if (v.
y() < 0) { sOuty = (fDy + p.
y())*stmp ; }
502 else { sOuty = (fDy - p.
y())*stmp ; }
503 if( sOuty < sOut ) { sOut = sOuty ; }
511 stmp = 1.0/std::fabs(v.
z()) ;
516 smaxz = (fDz+std::fabs(p.
z()))*stmp ;
518 if (sminz > smin) { smin = sminz ; }
519 if (smaxz < smax) { smax = smaxz ; }
521 if (smin >= (smax-delta))
528 if (v.
z() < 0) { sOutz = (fDz + p.
z())*stmp ; }
529 else { sOutz = (fDz - p.
z())*stmp ; }
530 if( sOutz < sOut ) { sOut = sOutz ; }
534 if (sOut <= (smin + delta))
538 if (smin < delta) { smin = 0.0 ; }
static const G4double kInfinity
Implements G4VSolid.
Definition at line 550 of file G4Box.cc.
552 G4double safex, safey, safez, safe = 0.0 ;
554 safex = std::fabs(p.
x()) - fDx ;
555 safey = std::fabs(p.
y()) - fDy ;
556 safez = std::fabs(p.
z()) - fDz ;
558 if (safex > safe) { safe = safex ; }
559 if (safey > safe) { safe = safey ; }
560 if (safez > safe) { safe = safez ; }
Implements G4VSolid.
Definition at line 573 of file G4Box.cc.
580 if (calcNorm) { *validNorm = true ; }
584 pdist = fDx - p.
x() ;
599 pdist = fDx + p.
x() ;
603 snxt = -pdist/v.
x() ;
635 pdist = fDy + p.
y() ;
720 std::ostringstream message;
721 G4int oldprc = message.precision(16);
722 message <<
"Undefined side for valid surface normal to solid."
724 <<
"Position:" << G4endl << G4endl
725 <<
"p.x() = " << p.
x()/
mm <<
" mm" << G4endl
726 <<
"p.y() = " << p.
y()/
mm <<
" mm" << G4endl
727 <<
"p.z() = " << p.
z()/
mm <<
" mm" << G4endl << G4endl
728 <<
"Direction:" << G4endl << G4endl
729 <<
"v.x() = " << v.
x() << G4endl
730 <<
"v.y() = " << v.
y() << G4endl
731 <<
"v.z() = " << v.
z() << G4endl << G4endl
732 <<
"Proposed distance :" << G4endl << G4endl
733 <<
"snxt = " << snxt/
mm <<
" mm" <<
G4endl;
734 message.precision(oldprc);
735 G4Exception(
"G4Box::DistanceToOut(p,v,..)",
"GeomSolids1002",
static constexpr double mm
static const G4double kInfinity
CLHEP::Hep3Vector G4ThreeVector
G4GLOB_DLL std::ostream G4cout
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Implements G4VSolid.
Definition at line 748 of file G4Box.cc.
750 G4double safx1,safx2,safy1,safy2,safz1,safz2,safe=0.0;
762 G4cout.precision(oldprc) ;
763 G4Exception(
"G4Box::DistanceToOut(p)",
"GeomSolids1002",
768 safx1 = fDx - p.
x() ;
769 safx2 = fDx + p.
x() ;
770 safy1 = fDy - p.
y() ;
771 safy2 = fDy + p.
y() ;
772 safz1 = fDz - p.
z() ;
773 safz2 = fDz + p.
z() ;
777 if (safx2 < safx1) { safe = safx2; }
778 else { safe = safx1; }
779 if (safy1 < safe) { safe = safy1; }
780 if (safy2 < safe) { safe = safy2; }
781 if (safz1 < safe) { safe = safz1; }
782 if (safz2 < safe) { safe = safz2; }
784 if (safe < 0) { safe = 0 ; }
static constexpr double mm
G4GLOB_DLL std::ostream G4cout
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
EInside Inside(const G4ThreeVector &p) const
Reimplemented from G4VSolid.
Definition at line 210 of file G4Box.cc.
212 pMin.
set(-fDx,-fDy,-fDz);
213 pMax.
set( fDx, fDy, fDz);
217 if (pMin.
x() >= pMax.
x() || pMin.
y() >= pMax.
y() || pMin.
z() >= pMax.
z())
219 std::ostringstream message;
220 message <<
"Bad bounding box (min >= max) for solid: "
222 <<
"\npMin = " << pMin
223 <<
"\npMax = " << pMax;
void set(double x, double y, double z)
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Reimplemented from G4VSolid.
Definition at line 825 of file G4Box.cc.
828 G4double Sxy = fDx*fDy, Sxz = fDx*fDz, Syz = fDy*fDz;
830 sumS = Sxy + Sxz + Syz;
841 else if ( ( select - Sxy ) < Sxz )
CLHEP::Hep3Vector G4ThreeVector
G4double G4Box::GetXHalfLength |
( |
| ) |
const |
|
inline |
G4double G4Box::GetYHalfLength |
( |
| ) |
const |
|
inline |
G4double G4Box::GetZHalfLength |
( |
| ) |
const |
|
inline |
Implements G4VSolid.
Definition at line 252 of file G4Box.cc.
257 if ( q.x() <= (fDx - delta) )
259 if (q.y() <= (fDy - delta) )
261 if ( q.z() <= (fDz - delta) ) { in =
kInside ; }
262 else if ( q.z() <= (fDz + delta) ) { in =
kSurface ; }
264 else if ( q.y() <= (fDy + delta) )
266 if ( q.z() <= (fDz + delta) ) { in =
kSurface ; }
269 else if ( q.x() <= (fDx + delta) )
271 if ( q.y() <= (fDy + delta) )
273 if ( q.z() <= (fDz + delta) ) { in =
kSurface ; }
Definition at line 112 of file G4Box.cc.
116 if (
this == &rhs) {
return *
this; }
G4CSGSolid & operator=(const G4CSGSolid &rhs)
Definition at line 134 of file G4Box.cc.
142 std::ostringstream message;
143 message <<
"Dimension X too small for solid: " <<
GetName() <<
"!"
146 G4Exception(
"G4Box::SetXHalfLength()",
"GeomSolids0002",
G4bool fRebuildPolyhedron
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition at line 154 of file G4Box.cc.
162 std::ostringstream message;
163 message <<
"Dimension Y too small for solid: " <<
GetName() <<
"!"
166 G4Exception(
"G4Box::SetYHalfLength()",
"GeomSolids0002",
G4bool fRebuildPolyhedron
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition at line 174 of file G4Box.cc.
182 std::ostringstream message;
183 message <<
"Dimension Z too small for solid: " <<
GetName() <<
"!"
186 G4Exception(
"G4Box::SetZHalfLength()",
"GeomSolids0002",
G4bool fRebuildPolyhedron
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
std::ostream & G4Box::StreamInfo |
( |
std::ostream & |
os | ) |
const |
|
virtual |
Reimplemented from G4CSGSolid.
Definition at line 801 of file G4Box.cc.
803 G4int oldprc = os.precision(16);
804 os <<
"-----------------------------------------------------------\n"
805 <<
" *** Dump for solid - " <<
GetName() <<
" ***\n"
806 <<
" ===================================================\n"
807 <<
" Solid type: G4Box\n"
809 <<
" half length X: " << fDx/
mm <<
" mm \n"
810 <<
" half length Y: " << fDy/
mm <<
" mm \n"
811 <<
" half length Z: " << fDz/
mm <<
" mm \n"
812 <<
"-----------------------------------------------------------\n";
813 os.precision(oldprc);
static constexpr double mm
Implements G4VSolid.
Definition at line 285 of file G4Box.cc.
292 distx = std::fabs(std::fabs(p.
x()) - fDx) ;
293 disty = std::fabs(std::fabs(p.
y()) - fDy) ;
294 distz = std::fabs(std::fabs(p.
z()) - fDz) ;
306 G4ThreeVector normX(0.,0.,0.), normY(0.,0.,0.), normZ(0.,0.,0.);
313 if ( p.
x() >= 0. ) { normX= nX ; }
321 if ( p.
y() >= 0. ) { normY= nY; }
329 if ( p.
z() >= 0. ) { normZ= nZ; }
334 static const G4double invSqrt2 = 1.0 / std::sqrt(2.0);
335 static const G4double invSqrt3 = 1.0 / std::sqrt(3.0);
339 if( noSurfaces == 1 )
346 if( noSurfaces == 2 )
349 norm = invSqrt2 * sumnorm;
354 norm = invSqrt3 * sumnorm;
362 "Point p is not on surface !?" );
364 norm = ApproxSurfaceNormal(p);
CLHEP::Hep3Vector G4ThreeVector
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
The documentation for this class was generated from the following files:
- source/geant4.10.03.p03/source/geometry/solids/CSG/include/G4Box.hh
- source/geant4.10.03.p03/source/geometry/solids/CSG/src/G4Box.cc