Geant4  10.01.p02
USphere Class Reference

#include <USphere.hh>

+ Inheritance diagram for USphere:
+ Collaboration diagram for USphere:

Public Member Functions

 USphere (const std::string &pName, double pRmin, double pRmax, double pSPhi, double pDPhi, double pSTheta, double pDTheta)
 
 ~USphere ()
 
double GetInnerRadius () const
 
double GetOuterRadius () const
 
double GetStartPhiAngle () const
 
double GetDeltaPhiAngle () const
 
double GetStartThetaAngle () const
 
double GetDeltaThetaAngle () const
 
void SetInnerRadius (double newRMin)
 
void SetOuterRadius (double newRmax)
 
void SetStartPhiAngle (double newSphi, bool trig=true)
 
void SetDeltaPhiAngle (double newDphi)
 
void SetStartThetaAngle (double newSTheta)
 
void SetDeltaThetaAngle (double newDTheta)
 
double Capacity ()
 
double SurfaceArea ()
 
VUSolid::EnumInside Inside (const UVector3 &p) const
 
bool Normal (const UVector3 &p, UVector3 &n) const
 
double DistanceToIn (const UVector3 &p, const UVector3 &v, double aPstep=UUtils::kInfinity) const
 
double SafetyFromOutside (const UVector3 &p, bool aAccurate=false) const
 
double DistanceToOut (const UVector3 &p, const UVector3 &v, UVector3 &n, bool &validNorm, double aPstep=UUtils::kInfinity) const
 
double SafetyFromInside (const UVector3 &p, bool aAccurate=false) const
 
UGeometryType GetEntityType () const
 
UVector3 GetPointOnSurface () const
 
VUSolidClone () const
 
std::ostream & StreamInfo (std::ostream &os) const
 
UVisExtent GetExtent () const
 
void Extent (UVector3 &aMin, UVector3 &aMax) const
 
void GetParametersList (int, double *) const
 
virtual void ComputeBBox (UBBox *, bool)
 
 USphere (const USphere &rhs)
 
USphereoperator= (const USphere &rhs)
 
double GetRmin () const
 
double GetRmax () const
 
double GetSPhi () const
 
double GetDPhi () const
 
double GetSTheta () const
 
double GetDTheta () const
 
double GetInsideRadius () const
 
void SetInsideRadius (double newRmin)
 
- 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
 

Private Types

enum  ESide {
  kNull, kRMin, kRMax, kSPhi,
  kEPhi, kSTheta, kETheta
}
 
enum  ENorm {
  kNRMin, kNRMax, kNSPhi, kNEPhi,
  kNSTheta, kNETheta
}
 

Private Member Functions

void Initialize ()
 
void CheckThetaAngles (double sTheta, double dTheta)
 
void CheckSPhiAngle (double sPhi)
 
void CheckDPhiAngle (double dPhi)
 
void CheckPhiAngles (double sPhi, double dPhi)
 
void InitializePhiTrigonometry ()
 
void InitializeThetaTrigonometry ()
 
UVector3 ApproxSurfaceNormal (const UVector3 &p) const
 

Private Attributes

double fCubicVolume
 
double fSurfaceArea
 
double fRminTolerance
 
double kTolerance
 
double kAngTolerance
 
double kRadTolerance
 
double fEpsilon
 
double fRmin
 
double fRmax
 
double fSPhi
 
double fDPhi
 
double fSTheta
 
double fDTheta
 
double sinCPhi
 
double cosCPhi
 
double cosHDPhiOT
 
double cosHDPhiIT
 
double sinSPhi
 
double cosSPhi
 
double sinEPhi
 
double cosEPhi
 
double hDPhi
 
double cPhi
 
double ePhi
 
double sinSTheta
 
double cosSTheta
 
double sinETheta
 
double cosETheta
 
double tanSTheta
 
double tanSTheta2
 
double tanETheta
 
double tanETheta2
 
double eTheta
 
bool fFullPhiSphere
 
bool fFullThetaSphere
 
bool fFullSphere
 

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 55 of file USphere.hh.

Member Enumeration Documentation

enum USphere::ENorm
private
Enumerator
kNRMin 
kNRMax 
kNSPhi 
kNEPhi 
kNSTheta 
kNETheta 

Definition at line 179 of file USphere.hh.

enum USphere::ESide
private
Enumerator
kNull 
kRMin 
kRMax 
kSPhi 
kEPhi 
kSTheta 
kETheta 

Definition at line 175 of file USphere.hh.

Constructor & Destructor Documentation

USphere::USphere ( const std::string &  pName,
double  pRmin,
double  pRmax,
double  pSPhi,
double  pDPhi,
double  pSTheta,
double  pDTheta 
)

Definition at line 34 of file USphere.cc.

References CheckPhiAngles(), CheckThetaAngles(), UUtils::Exception(), VUSolid::faTolerance, fEpsilon, fRmax, fRmin, fRminTolerance, VUSolid::frTolerance, VUSolid::GetName(), kAngTolerance, kRadTolerance, kTolerance, G4INCL::Math::max(), and UFatalErrorInArguments.

Referenced by Clone().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

USphere::~USphere ( )

Definition at line 70 of file USphere.cc.

USphere::USphere ( const USphere rhs)

Definition at line 78 of file USphere.cc.

Member Function Documentation

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

Definition at line 454 of file USphere.cc.

References cosEPhi, cosETheta, cosSPhi, cosSTheta, UUtils::Exception(), fDPhi, fDTheta, fFullPhiSphere, fFullThetaSphere, fRmax, fRmin, fSPhi, fSTheta, kNEPhi, kNETheta, kNRMax, kNRMin, kNSPhi, kNSTheta, UUtils::kPi, sinEPhi, sinETheta, sinSPhi, sinSTheta, UWarning, 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 USphere::Capacity ( )
inlinevirtual

Implements VUSolid.

Definition at line 489 of file USphere.hh.

References fCubicVolume, fDPhi, fDTheta, fRmax, fRmin, and fSTheta.

void USphere::CheckDPhiAngle ( double  dPhi)
inlineprivate

Definition at line 351 of file USphere.hh.

References UUtils::Exception(), fDPhi, fFullPhiSphere, fSPhi, VUSolid::GetName(), kAngTolerance, UUtils::kPi, and UFatalError.

Referenced by CheckPhiAngles().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void USphere::CheckPhiAngles ( double  sPhi,
double  dPhi 
)
inlineprivate

Definition at line 379 of file USphere.hh.

References CheckDPhiAngle(), CheckSPhiAngle(), fFullPhiSphere, fFullSphere, fFullThetaSphere, and InitializePhiTrigonometry().

Referenced by SetDeltaPhiAngle(), and USphere().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void USphere::CheckSPhiAngle ( double  sPhi)
inlineprivate

Definition at line 332 of file USphere.hh.

References fDPhi, fSPhi, and UUtils::kPi.

Referenced by CheckPhiAngles(), and SetStartPhiAngle().

+ Here is the caller graph for this function:

void USphere::CheckThetaAngles ( double  sTheta,
double  dTheta 
)
inlineprivate

Definition at line 287 of file USphere.hh.

References UUtils::Exception(), fDTheta, fFullPhiSphere, fFullSphere, fFullThetaSphere, fSTheta, VUSolid::GetName(), InitializeThetaTrigonometry(), UUtils::kPi, and UFatalError.

Referenced by SetDeltaThetaAngle(), SetStartThetaAngle(), and USphere().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

VUSolid * USphere::Clone ( ) const
virtual

Implements VUSolid.

Definition at line 2893 of file USphere.cc.

References USphere().

+ Here is the call graph for this function:

virtual void USphere::ComputeBBox ( UBBox ,
bool   
)
inlinevirtual

Implements VUSolid.

Definition at line 129 of file USphere.hh.

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

Implements VUSolid.

Definition at line 629 of file USphere.cc.

References cosCPhi, cosEPhi, cosHDPhiIT, cosHDPhiOT, cosSPhi, d2, eTheta, fFullPhiSphere, fFullThetaSphere, fRmax, fRmin, fRminTolerance, fSTheta, UUtils::Infinity(), kAngTolerance, UUtils::kPi, kTolerance, sinCPhi, sinEPhi, sinSPhi, tanETheta2, tanSTheta2, VUSolid::Tolerance(), UVector3::x(), UVector3::y(), and UVector3::z().

+ Here is the call graph for this function:

double USphere::DistanceToOut ( const UVector3 p,
const UVector3 v,
UVector3 n,
bool &  validNorm,
double  aPstep = UUtils::kInfinity 
) const
virtual

Implements VUSolid.

Definition at line 1669 of file USphere.cc.

References cosCPhi, cosEPhi, cosSPhi, d2, ePhi, eTheta, UUtils::Exception(), fDPhi, fFullPhiSphere, fFullThetaSphere, fRmax, fRmin, fRminTolerance, fSPhi, fSTheta, UUtils::Infinity(), kAngTolerance, kEPhi, kETheta, kNull, UUtils::kPi, kRMax, kRMin, kSPhi, kSTheta, kTolerance, sinCPhi, sinEPhi, sinETheta, sinSPhi, tanETheta, tanETheta2, tanSTheta, tanSTheta2, VUSolid::Tolerance(), UWarning, UVector3::x(), UVector3::y(), and UVector3::z().

+ Here is the call graph for this function:

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

Implements VUSolid.

Definition at line 3071 of file USphere.cc.

References fRmax, and UVector3::Set().

+ Here is the call graph for this function:

double USphere::GetDeltaPhiAngle ( ) const
inline

Definition at line 230 of file USphere.hh.

References fDPhi.

Referenced by G4USphere::GetDeltaPhiAngle(), GetDPhi(), and GetParametersList().

+ Here is the caller graph for this function:

double USphere::GetDeltaThetaAngle ( ) const
inline

Definition at line 241 of file USphere.hh.

References fDTheta.

Referenced by G4USphere::GetDeltaThetaAngle(), GetDTheta(), and GetParametersList().

+ Here is the caller graph for this function:

double USphere::GetDPhi ( ) const
inline

Definition at line 471 of file USphere.hh.

References GetDeltaPhiAngle().

+ Here is the call graph for this function:

double USphere::GetDTheta ( ) const
inline

Definition at line 483 of file USphere.hh.

References GetDeltaThetaAngle().

+ Here is the call graph for this function:

UGeometryType USphere::GetEntityType ( ) const
virtual

Implements VUSolid.

Definition at line 2884 of file USphere.cc.

UVisExtent USphere::GetExtent ( ) const
double USphere::GetInnerRadius ( ) const
inline

Definition at line 212 of file USphere.hh.

References fRmin.

Referenced by G4USphere::GetInnerRadius(), and GetParametersList().

+ Here is the caller graph for this function:

double USphere::GetInsideRadius ( ) const
inline

Definition at line 206 of file USphere.hh.

References fRmin.

Referenced by GetRmin().

+ Here is the caller graph for this function:

double USphere::GetOuterRadius ( ) const
inline

Definition at line 218 of file USphere.hh.

References fRmax.

Referenced by G4USphere::GetOuterRadius(), GetParametersList(), and GetRmax().

+ Here is the caller graph for this function:

void USphere::GetParametersList ( int  ,
double *  aArray 
) const
virtual

Implements VUSolid.

Definition at line 3077 of file USphere.cc.

References GetDeltaPhiAngle(), GetDeltaThetaAngle(), GetInnerRadius(), GetOuterRadius(), GetStartPhiAngle(), and GetStartThetaAngle().

+ Here is the call graph for this function:

UVector3 USphere::GetPointOnSurface ( ) const
virtual

Implements VUSolid.

Definition at line 2926 of file USphere.cc.

References cosEPhi, cosETheta, cosSPhi, cosSTheta, ePhi, eTheta, fDPhi, fDTheta, fFullPhiSphere, fRmax, fRmin, fSPhi, fSTheta, UUtils::GetRadiusInRing(), UUtils::kPi, UUtils::Random(), sinEPhi, sinETheta, sinSPhi, sinSTheta, UUtils::sqr(), tanETheta, and tanSTheta.

+ Here is the call graph for this function:

double USphere::GetRmax ( ) const
inline

Definition at line 459 of file USphere.hh.

References GetOuterRadius().

+ Here is the call graph for this function:

double USphere::GetRmin ( ) const
inline

Definition at line 453 of file USphere.hh.

References GetInsideRadius().

+ Here is the call graph for this function:

double USphere::GetSPhi ( ) const
inline

Definition at line 465 of file USphere.hh.

References GetStartPhiAngle().

+ Here is the call graph for this function:

double USphere::GetStartPhiAngle ( ) const
inline

Definition at line 224 of file USphere.hh.

References fSPhi.

Referenced by GetParametersList(), GetSPhi(), and G4USphere::GetStartPhiAngle().

+ Here is the caller graph for this function:

double USphere::GetStartThetaAngle ( ) const
inline

Definition at line 236 of file USphere.hh.

References fSTheta.

Referenced by GetParametersList(), G4USphere::GetStartThetaAngle(), and GetSTheta().

+ Here is the caller graph for this function:

double USphere::GetSTheta ( ) const
inline

Definition at line 477 of file USphere.hh.

References GetStartThetaAngle().

+ Here is the call graph for this function:

void USphere::Initialize ( )
inlineprivate

Definition at line 247 of file USphere.hh.

References fCubicVolume, and fSurfaceArea.

Referenced by SetDeltaPhiAngle(), SetDeltaThetaAngle(), SetInsideRadius(), SetOuterRadius(), SetStartPhiAngle(), and SetStartThetaAngle().

+ Here is the caller graph for this function:

void USphere::InitializePhiTrigonometry ( )
inlineprivate

Definition at line 254 of file USphere.hh.

References cosCPhi, cosEPhi, cosHDPhiIT, cosHDPhiOT, cosSPhi, cPhi, ePhi, fDPhi, fSPhi, hDPhi, kAngTolerance, sinCPhi, sinEPhi, and sinSPhi.

Referenced by CheckPhiAngles(), and SetStartPhiAngle().

+ Here is the caller graph for this function:

void USphere::InitializeThetaTrigonometry ( )
inlineprivate

Definition at line 271 of file USphere.hh.

References cosETheta, cosSTheta, eTheta, fDTheta, fSTheta, sinETheta, sinSTheta, tanETheta, tanETheta2, tanSTheta, and tanSTheta2.

Referenced by CheckThetaAngles().

+ Here is the caller graph for this function:

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

Implements VUSolid.

Definition at line 164 of file USphere.cc.

References VUSolid::eInside, VUSolid::eOutside, ePhi, VUSolid::eSurface, eTheta, fFullPhiSphere, fFullThetaSphere, fRmax, fRmin, fRminTolerance, fSPhi, fSTheta, kAngTolerance, UUtils::kPi, kTolerance, G4INCL::Math::max(), 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 USphere::Normal ( const UVector3 p,
UVector3 n 
) const
virtual

Implements VUSolid.

Definition at line 291 of file USphere.cc.

References ApproxSurfaceNormal(), cosEPhi, cosETheta, cosSPhi, cosSTheta, ePhi, eTheta, UUtils::Exception(), fFullPhiSphere, fFullSphere, fFullThetaSphere, fRmax, fRmin, fSPhi, fSTheta, UUtils::Infinity(), kAngTolerance, UUtils::kPi, sinEPhi, sinETheta, sinSPhi, sinSTheta, VUSolid::Tolerance(), UVector3::Unit(), UWarning, UVector3::x(), UVector3::y(), and UVector3::z().

+ Here is the call graph for this function:

double USphere::SafetyFromInside ( const UVector3 p,
bool  aAccurate = false 
) const
virtual

Implements VUSolid.

Definition at line 2654 of file USphere.cc.

References cosCPhi, cosEPhi, cosSPhi, VUSolid::eOutside, eTheta, UUtils::Exception(), fFullPhiSphere, fFullThetaSphere, fRmax, fRmin, fSTheta, UUtils::Infinity(), Inside(), UUtils::kPi, G4INCL::Math::min(), sinCPhi, sinEPhi, sinSPhi, UWarning, UVector3::x(), UVector3::y(), and UVector3::z().

+ Here is the call graph for this function:

double USphere::SafetyFromOutside ( const UVector3 p,
bool  aAccurate = false 
) const
virtual

Implements VUSolid.

Definition at line 1564 of file USphere.cc.

References cosCPhi, cosEPhi, cosSPhi, eTheta, fFullPhiSphere, fFullThetaSphere, fRmax, fRmin, fSTheta, hDPhi, UUtils::kPi, sinCPhi, sinEPhi, sinSPhi, UVector3::x(), UVector3::y(), and UVector3::z().

+ Here is the call graph for this function:

void USphere::SetDeltaPhiAngle ( double  newDphi)
inline

Definition at line 430 of file USphere.hh.

References CheckPhiAngles(), fSPhi, and Initialize().

Referenced by G4USphere::SetDeltaPhiAngle().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void USphere::SetDeltaThetaAngle ( double  newDTheta)
inline

Definition at line 444 of file USphere.hh.

References CheckThetaAngles(), fSTheta, and Initialize().

Referenced by G4USphere::SetDeltaThetaAngle().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void USphere::SetInnerRadius ( double  newRMin)
inline

Definition at line 401 of file USphere.hh.

References SetInsideRadius().

Referenced by G4USphere::SetInnerRadius().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void USphere::SetInsideRadius ( double  newRmin)
inline

Definition at line 393 of file USphere.hh.

References fEpsilon, fRmin, fRminTolerance, Initialize(), kRadTolerance, and G4INCL::Math::max().

Referenced by SetInnerRadius().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void USphere::SetOuterRadius ( double  newRmax)
inline

Definition at line 407 of file USphere.hh.

References fEpsilon, fRmax, Initialize(), kRadTolerance, kTolerance, and G4INCL::Math::max().

Referenced by G4USphere::SetOuterRadius().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void USphere::SetStartPhiAngle ( double  newSphi,
bool  trig = true 
)
inline

Definition at line 415 of file USphere.hh.

References CheckSPhiAngle(), fFullPhiSphere, Initialize(), and InitializePhiTrigonometry().

Referenced by G4USphere::SetStartPhiAngle().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void USphere::SetStartThetaAngle ( double  newSTheta)
inline

Definition at line 437 of file USphere.hh.

References CheckThetaAngles(), fDTheta, and Initialize().

Referenced by G4USphere::SetStartThetaAngle().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Implements VUSolid.

Definition at line 2902 of file USphere.cc.

References fDPhi, fDTheta, fRmax, fRmin, fSPhi, fSTheta, VUSolid::GetName(), and UUtils::kPi.

+ Here is the call graph for this function:

double USphere::SurfaceArea ( )
virtual

Member Data Documentation

double USphere::cosCPhi
private
double USphere::cosETheta
private
double USphere::cosHDPhiIT
private

Definition at line 190 of file USphere.hh.

Referenced by DistanceToIn(), InitializePhiTrigonometry(), and operator=().

double USphere::cosHDPhiOT
private

Definition at line 190 of file USphere.hh.

Referenced by DistanceToIn(), InitializePhiTrigonometry(), and operator=().

double USphere::cosSTheta
private
double USphere::cPhi
private

Definition at line 190 of file USphere.hh.

Referenced by InitializePhiTrigonometry(), and operator=().

double USphere::ePhi
private
double USphere::fCubicVolume
private

Definition at line 148 of file USphere.hh.

Referenced by Capacity(), Initialize(), and operator=().

double USphere::fEpsilon
private

Definition at line 181 of file USphere.hh.

Referenced by operator=(), SetInsideRadius(), SetOuterRadius(), and USphere().

bool USphere::fFullSphere
private

Definition at line 200 of file USphere.hh.

Referenced by CheckPhiAngles(), CheckThetaAngles(), Normal(), and operator=().

bool USphere::fFullThetaSphere
private
double USphere::fRminTolerance
private

Definition at line 181 of file USphere.hh.

Referenced by DistanceToIn(), DistanceToOut(), Inside(), operator=(), SetInsideRadius(), and USphere().

double USphere::fSurfaceArea
private

Definition at line 149 of file USphere.hh.

Referenced by Initialize(), operator=(), and SurfaceArea().

double USphere::hDPhi
private

Definition at line 190 of file USphere.hh.

Referenced by InitializePhiTrigonometry(), operator=(), and SafetyFromOutside().

double USphere::kAngTolerance
private
double USphere::kRadTolerance
private

Definition at line 181 of file USphere.hh.

Referenced by operator=(), SetInsideRadius(), SetOuterRadius(), and USphere().

double USphere::kTolerance
private

Definition at line 181 of file USphere.hh.

Referenced by DistanceToIn(), DistanceToOut(), Inside(), operator=(), SetOuterRadius(), and USphere().

double USphere::sinCPhi
private
double USphere::sinETheta
private
double USphere::sinSTheta
private
double USphere::tanETheta
private
double USphere::tanETheta2
private

Definition at line 195 of file USphere.hh.

Referenced by DistanceToIn(), DistanceToOut(), InitializeThetaTrigonometry(), and operator=().

double USphere::tanSTheta
private
double USphere::tanSTheta2
private

Definition at line 195 of file USphere.hh.

Referenced by DistanceToIn(), DistanceToOut(), InitializeThetaTrigonometry(), and operator=().


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