Geant4  10.01.p02
UTrap Class Reference

#include <UTrap.hh>

+ Inheritance diagram for UTrap:
+ Collaboration diagram for UTrap:

Public Member Functions

 UTrap (const std::string &pName, double pDz, double pTheta, double pPhi, double pDy1, double pDx1, double pDx2, double pAlp1, double pDy2, double pDx3, double pDx4, double pAlp2)
 
 UTrap (const std::string &pName, const UVector3 pt[8])
 
 UTrap (const std::string &pName, double pZ, double pY, double pX, double pLTX)
 
 UTrap (const std::string &pName, double pDx1, double pDx2, double pDy1, double pDy2, double pDz)
 
 UTrap (const std::string &pName, double pDx, double pDy, double pDz, double pAlpha, double pTheta, double pPhi)
 
 UTrap (const std::string &pName)
 
virtual ~UTrap ()
 
double GetZHalfLength () const
 
double GetYHalfLength1 () const
 
double GetXHalfLength1 () const
 
double GetXHalfLength2 () const
 
double GetTanAlpha1 () const
 
double GetYHalfLength2 () const
 
double GetXHalfLength3 () const
 
double GetXHalfLength4 () const
 
double GetTanAlpha2 () const
 
UTrapSidePlane GetSidePlane (int n) const
 
UVector3 GetSymAxis () const
 
void SetAllParameters (double pDz, double pTheta, double pPhi, double pDy1, double pDx1, double pDx2, double pAlp1, double pDy2, double pDx3, double pDx4, double pAlp2)
 
void SetPlanes (const UVector3 pt[8])
 
double Capacity ()
 
double SurfaceArea ()
 
VUSolid::EnumInside Inside (const UVector3 &p) const
 
UVector3 SurfaceNormal (const UVector3 &p) const
 
bool Normal (const UVector3 &aPoint, UVector3 &aNormal) const
 
double DistanceToIn (const UVector3 &p, const UVector3 &v, double aPstep=UUtils::kInfinity) const
 
double SafetyFromOutside (const UVector3 &p, bool precise=false) const
 
double DistanceToOut (const UVector3 &p, const UVector3 &v, UVector3 &aNormalVector, bool &aConvex, double aPstep=UUtils::kInfinity) const
 
double SafetyFromInside (const UVector3 &p, bool precise=false) const
 
UGeometryType GetEntityType () const
 
UVector3 GetPointOnSurface () const
 
VUSolidClone () const
 
virtual void Extent (UVector3 &aMin, UVector3 &aMax) const
 
std::ostream & StreamInfo (std::ostream &os) const
 
 UTrap (const UTrap &rhs)
 
UTrapoperator= (const UTrap &rhs)
 
double GetThetaCphi () const
 
double GetThetaSphi () const
 
- Public Member Functions inherited from VUSolid
 VUSolid ()
 
 VUSolid (const std::string &name)
 
virtual ~VUSolid ()
 
double GetCarTolerance () const
 
double GetRadTolerance () const
 
double GetAngTolerance () const
 
void SetCarTolerance (double eps)
 
void SetRadTolerance (double eps)
 
void SetAngTolerance (double eps)
 
virtual void ExtentAxis (EAxisType aAxis, double &aMin, double &aMax) const
 
const std::string & GetName () const
 
void SetName (const std::string &aName)
 
virtual void SamplePointsInside (int, UVector3 *) const
 
virtual void SamplePointsOnSurface (int, UVector3 *) const
 
virtual void SamplePointsOnEdge (int, UVector3 *) const
 
double EstimateCubicVolume (int nStat, double epsilon) const
 
double EstimateSurfaceArea (int nStat, double ell) const
 

Protected Member Functions

bool MakePlanes ()
 
bool MakePlane (const UVector3 &p1, const UVector3 &p2, const UVector3 &p3, const UVector3 &p4, UTrapSidePlane &plane)
 

Private Member Functions

UVector3 ApproxSurfaceNormal (const UVector3 &p) const
 
double GetFaceArea (const UVector3 &p1, const UVector3 &p2, const UVector3 &p3, const UVector3 &p4)
 
UVector3 GetPointOnPlane (UVector3 p0, UVector3 p1, UVector3 p2, UVector3 p3, double &area) const
 
void GetParametersList (int, double *) const
 
void ComputeBBox (UBBox *, bool)
 

Private Attributes

double fDz
 
double fTthetaCphi
 
double fTthetaSphi
 
double fDy1
 
double fDx1
 
double fDx2
 
double fTalpha1
 
double fDy2
 
double fDx3
 
double fDx4
 
double fTalpha2
 
UTrapSidePlane fPlanes [4]
 
double fCubicVolume
 
double fSurfaceArea
 

Additional Inherited Members

- Public Types inherited from VUSolid
enum  EnumInside { eInside =0, eSurface =1, eOutside =2 }
 
enum  EAxisType { eXaxis =0, eYaxis =1, eZaxis =2 }
 
- Static Public Member Functions inherited from VUSolid
static double Tolerance ()
 
- Static Protected Attributes inherited from VUSolid
static double fgTolerance = 1.0E-9
 
static double frTolerance = 1.0E-9
 
static double faTolerance = 1.0E-9
 

Detailed Description

Definition at line 80 of file UTrap.hh.

Constructor & Destructor Documentation

UTrap::UTrap ( const std::string &  pName,
double  pDz,
double  pTheta,
double  pPhi,
double  pDy1,
double  pDx1,
double  pDx2,
double  pAlp1,
double  pDy2,
double  pDx3,
double  pDx4,
double  pAlp2 
)

Definition at line 42 of file UTrap.cc.

References UUtils::Exception(), fCubicVolume, fDx1, fDx2, fDx3, fDx4, fDy1, fDy2, fDz, fSurfaceArea, fTalpha1, fTalpha2, fTthetaCphi, fTthetaSphi, VUSolid::GetName(), MakePlanes(), and UFatalErrorInArguments.

Referenced by Clone().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

UTrap::UTrap ( const std::string &  pName,
const UVector3  pt[8] 
)

Definition at line 89 of file UTrap.cc.

References fCubicVolume, fSurfaceArea, and SetPlanes().

+ Here is the call graph for this function:

UTrap::UTrap ( const std::string &  pName,
double  pZ,
double  pY,
double  pX,
double  pLTX 
)

Definition at line 102 of file UTrap.cc.

References UUtils::Exception(), fCubicVolume, fDx1, fDx2, fDx3, fDx4, fDy1, fDy2, fDz, fPlanes, fSurfaceArea, fTalpha1, fTalpha2, fTthetaCphi, fTthetaSphi, VUSolid::GetName(), MakePlane(), UFatalError, and UFatalErrorInArguments.

+ Here is the call graph for this function:

UTrap::UTrap ( const std::string &  pName,
double  pDx1,
double  pDx2,
double  pDy1,
double  pDy2,
double  pDz 
)

Definition at line 202 of file UTrap.cc.

References UUtils::Exception(), fCubicVolume, fDx1, fDx2, fDx3, fDx4, fDy1, fDy2, fDz, fPlanes, fSurfaceArea, fTalpha1, fTalpha2, fTthetaCphi, fTthetaSphi, VUSolid::GetName(), MakePlane(), and UFatalErrorInArguments.

+ Here is the call graph for this function:

UTrap::UTrap ( const std::string &  pName,
double  pDx,
double  pDy,
double  pDz,
double  pAlpha,
double  pTheta,
double  pPhi 
)

Definition at line 302 of file UTrap.cc.

References UUtils::Exception(), fCubicVolume, fDx1, fDx2, fDx3, fDx4, fDy1, fDy2, fDz, fPlanes, fSurfaceArea, fTalpha1, fTalpha2, fTthetaCphi, fTthetaSphi, VUSolid::GetName(), MakePlane(), and UFatalErrorInArguments.

+ Here is the call graph for this function:

UTrap::UTrap ( const std::string &  pName)

Definition at line 405 of file UTrap.cc.

References fCubicVolume, fSurfaceArea, and MakePlanes().

+ Here is the call graph for this function:

UTrap::~UTrap ( )
virtual

Definition at line 420 of file UTrap.cc.

UTrap::UTrap ( const UTrap rhs)

Member Function Documentation

UVector3 UTrap::ApproxSurfaceNormal ( const UVector3 p) const
private

Definition at line 903 of file UTrap.cc.

References a, UTrapSidePlane::b, UTrapSidePlane::c, UTrapSidePlane::d, fDz, fPlanes, UUtils::kInfinity, UVector3::x(), UVector3::y(), and UVector3::z().

Referenced by Normal().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

double UTrap::Capacity ( )
inlinevirtual

Implements VUSolid.

VUSolid * UTrap::Clone ( ) const
virtual

Implements VUSolid.

Definition at line 1395 of file UTrap.cc.

References UTrap().

+ Here is the call graph for this function:

void UTrap::ComputeBBox ( UBBox ,
bool   
)
inlineprivatevirtual

Implements VUSolid.

Definition at line 241 of file UTrap.hh.

double UTrap::DistanceToIn ( const UVector3 p,
const UVector3 v,
double  aPstep = UUtils::kInfinity 
) const
virtual

Implements VUSolid.

Definition at line 944 of file UTrap.cc.

References UTrapSidePlane::a, UTrapSidePlane::b, UTrapSidePlane::c, UTrapSidePlane::d, fDz, fPlanes, UUtils::kInfinity, G4INCL::Math::max(), smax, VUSolid::Tolerance(), UVector3::x(), UVector3::y(), and UVector3::z().

+ Here is the call graph for this function:

double UTrap::DistanceToOut ( const UVector3 p,
const UVector3 v,
UVector3 aNormalVector,
bool &  aConvex,
double  aPstep = UUtils::kInfinity 
) const
virtual

Implements VUSolid.

Definition at line 1086 of file UTrap.cc.

References a, UTrapSidePlane::a, UTrapSidePlane::b, UTrapSidePlane::c, UTrapSidePlane::d, UUtils::Exception(), fDz, fPlanes, UUtils::kInfinity, kMZ, kPZ, ks0, ks1, ks2, ks3, kUndef, G4INCL::Math::max(), VUSolid::Tolerance(), UWarning, UVector3::x(), UVector3::y(), and UVector3::z().

+ Here is the call graph for this function:

void UTrap::Extent ( UVector3 aMin,
UVector3 aMax 
) const
virtual

Implements VUSolid.

Definition at line 1548 of file UTrap.cc.

References fDx1, fDx2, fDx3, fDx4, fDy1, fDy2, fDz, fTalpha1, fTalpha2, fTthetaCphi, fTthetaSphi, UVector3::x(), UVector3::y(), z, and UVector3::z().

+ Here is the call graph for this function:

UGeometryType UTrap::GetEntityType ( ) const
virtual

Implements VUSolid.

Definition at line 1386 of file UTrap.cc.

double UTrap::GetFaceArea ( const UVector3 p1,
const UVector3 p2,
const UVector3 p3,
const UVector3 p4 
)
inlineprivate
void UTrap::GetParametersList ( int  ,
double *   
) const
inlineprivatevirtual

Implements VUSolid.

Definition at line 238 of file UTrap.hh.

UVector3 UTrap::GetPointOnPlane ( UVector3  p0,
UVector3  p1,
UVector3  p2,
UVector3  p3,
double &  area 
) const
private

Definition at line 1444 of file UTrap.cc.

References UVector3::Mag(), CLHEP::normal(), p0, p1, p2, UUtils::Random(), UVector3::x(), UVector3::y(), and UVector3::z().

Referenced by GetPointOnSurface().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

UVector3 UTrap::GetPointOnSurface ( ) const
virtual

Implements VUSolid.

Definition at line 1491 of file UTrap.cc.

References fDx1, fDx2, fDx3, fDx4, fDy1, fDy2, fDz, fTalpha1, fTalpha2, fTthetaCphi, fTthetaSphi, GetPointOnPlane(), and UUtils::Random().

+ Here is the call graph for this function:

UTrapSidePlane UTrap::GetSidePlane ( int  n) const
inline

Referenced by G4UTrap::GetSidePlane().

+ Here is the caller graph for this function:

UVector3 UTrap::GetSymAxis ( ) const
inline

Referenced by G4UTrap::GetSymAxis().

+ Here is the caller graph for this function:

double UTrap::GetTanAlpha1 ( ) const
inline

Referenced by G4UTrap::GetTanAlpha1().

+ Here is the caller graph for this function:

double UTrap::GetTanAlpha2 ( ) const
inline

Referenced by G4UTrap::GetTanAlpha2().

+ Here is the caller graph for this function:

double UTrap::GetThetaCphi ( ) const
inline

Referenced by G4UTrap::CreatePolyhedron().

+ Here is the caller graph for this function:

double UTrap::GetThetaSphi ( ) const
inline

Referenced by G4UTrap::CreatePolyhedron().

+ Here is the caller graph for this function:

double UTrap::GetXHalfLength1 ( ) const
inline

Referenced by G4UTrap::GetXHalfLength1().

+ Here is the caller graph for this function:

double UTrap::GetXHalfLength2 ( ) const
inline

Referenced by G4UTrap::GetXHalfLength2().

+ Here is the caller graph for this function:

double UTrap::GetXHalfLength3 ( ) const
inline

Referenced by G4UTrap::GetXHalfLength3().

+ Here is the caller graph for this function:

double UTrap::GetXHalfLength4 ( ) const
inline

Referenced by G4UTrap::GetXHalfLength4().

+ Here is the caller graph for this function:

double UTrap::GetYHalfLength1 ( ) const
inline

Referenced by G4UTrap::GetYHalfLength1().

+ Here is the caller graph for this function:

double UTrap::GetYHalfLength2 ( ) const
inline

Referenced by G4UTrap::GetYHalfLength2().

+ Here is the caller graph for this function:

double UTrap::GetZHalfLength ( ) const
inline

Referenced by G4UTrap::GetZHalfLength().

+ Here is the caller graph for this function:

VUSolid::EnumInside UTrap::Inside ( const UVector3 p) const
virtual

Implements VUSolid.

Definition at line 781 of file UTrap.cc.

References UTrapSidePlane::a, UTrapSidePlane::b, UTrapSidePlane::c, UTrapSidePlane::d, VUSolid::eInside, VUSolid::eOutside, VUSolid::eSurface, fDz, fPlanes, VUSolid::Tolerance(), UVector3::x(), UVector3::y(), and UVector3::z().

Referenced by SafetyFromInside().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool UTrap::MakePlane ( const UVector3 p1,
const UVector3 p2,
const UVector3 p3,
const UVector3 p4,
UTrapSidePlane plane 
)
protected

Definition at line 704 of file UTrap.cc.

References a, UTrapSidePlane::a, UTrapSidePlane::b, UTrapSidePlane::c, UVector3::Cross(), UTrapSidePlane::d, UVector3::Dot(), UUtils::Exception(), VUSolid::GetName(), kCoplanar_Tolerance, UVector3::Mag(), p1, UFatalError, UVector3::x(), UVector3::y(), and UVector3::z().

Referenced by MakePlanes(), SetPlanes(), and UTrap().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool UTrap::MakePlanes ( )
protected

Definition at line 625 of file UTrap.cc.

References UUtils::Exception(), fDx1, fDx2, fDx3, fDx4, fDy1, fDy2, fDz, fPlanes, fTalpha1, fTalpha2, fTthetaCphi, fTthetaSphi, VUSolid::GetName(), MakePlane(), and UFatalError.

Referenced by SetAllParameters(), and UTrap().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool UTrap::Normal ( const UVector3 aPoint,
UVector3 aNormal 
) const
virtual

Implements VUSolid.

Definition at line 822 of file UTrap.cc.

References a, ApproxSurfaceNormal(), UTrapSidePlane::b, UTrapSidePlane::c, UTrapSidePlane::d, UUtils::Exception(), fDz, fPlanes, UUtils::kInfinity, VUSolid::Tolerance(), UVector3::Unit(), UWarning, UVector3::x(), UVector3::y(), and UVector3::z().

+ Here is the call graph for this function:

double UTrap::SafetyFromInside ( const UVector3 p,
bool  precise = false 
) const
virtual

Implements VUSolid.

Definition at line 1345 of file UTrap.cc.

References UTrapSidePlane::a, UTrapSidePlane::b, UTrapSidePlane::c, UTrapSidePlane::d, VUSolid::eOutside, UUtils::Exception(), fDz, fPlanes, Inside(), UWarning, UVector3::x(), UVector3::y(), and UVector3::z().

+ Here is the call graph for this function:

double UTrap::SafetyFromOutside ( const UVector3 p,
bool  precise = false 
) const
virtual

Implements VUSolid.

Definition at line 1066 of file UTrap.cc.

References UTrapSidePlane::a, UTrapSidePlane::b, UTrapSidePlane::c, UTrapSidePlane::d, fDz, fPlanes, UVector3::x(), UVector3::y(), and UVector3::z().

+ Here is the call graph for this function:

void UTrap::SetAllParameters ( double  pDz,
double  pTheta,
double  pPhi,
double  pDy1,
double  pDx1,
double  pDx2,
double  pAlp1,
double  pDy2,
double  pDx3,
double  pDx4,
double  pAlp2 
)

Definition at line 492 of file UTrap.cc.

References UUtils::Exception(), fCubicVolume, fDx1, fDx2, fDx3, fDx4, fDy1, fDy2, fDz, fSurfaceArea, fTalpha1, fTalpha2, fTthetaCphi, fTthetaSphi, VUSolid::GetName(), MakePlanes(), and UFatalErrorInArguments.

Referenced by G4UTrap::SetAllParameters().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void UTrap::SetPlanes ( const UVector3  pt[8])

Definition at line 534 of file UTrap.cc.

References UUtils::Exception(), fDx1, fDx2, fDx3, fDx4, fDy1, fDy2, fDz, fPlanes, fTalpha1, fTalpha2, fTthetaCphi, fTthetaSphi, VUSolid::GetName(), MakePlane(), VUSolid::Tolerance(), UFatalError, UFatalErrorInArguments, and z.

Referenced by G4UTrap::SetPlanes(), and UTrap().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

std::ostream & UTrap::StreamInfo ( std::ostream &  os) const
virtual

Implements VUSolid.

Definition at line 1404 of file UTrap.cc.

References UTrapSidePlane::a, UTrapSidePlane::b, UTrapSidePlane::c, UTrapSidePlane::d, fDx1, fDx2, fDx3, fDx4, fDy1, fDy2, fDz, fPlanes, fTalpha1, fTalpha2, fTthetaCphi, fTthetaSphi, VUSolid::GetName(), and UUtils::kPi.

+ Here is the call graph for this function:

double UTrap::SurfaceArea ( )
inlinevirtual

Implements VUSolid.

UVector3 UTrap::SurfaceNormal ( const UVector3 p) const

Member Data Documentation

double UTrap::fCubicVolume
private

Definition at line 250 of file UTrap.hh.

Referenced by operator=(), SetAllParameters(), and UTrap().

double UTrap::fDx1
private
double UTrap::fDx2
private
double UTrap::fDx3
private
double UTrap::fDx4
private
double UTrap::fDy1
private
double UTrap::fDy2
private
double UTrap::fSurfaceArea
private

Definition at line 251 of file UTrap.hh.

Referenced by operator=(), SetAllParameters(), and UTrap().

double UTrap::fTalpha1
private
double UTrap::fTalpha2
private
double UTrap::fTthetaCphi
private
double UTrap::fTthetaSphi
private

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