Geant4  10.01.p01
UUtils Namespace Reference

Classes

struct  CompareAsc
 
struct  CompareDesc
 

Functions

short Sign (short a, short b)
 
int Sign (int a, int b)
 
long Sign (long a, long b)
 
float Sign (float a, float b)
 
double Sign (double a, double b)
 
double Infinity ()
 
double ASin (double)
 
double ACos (double)
 
double ATan (double)
 
double ATan2 (double, double)
 
void Exception (const char *originOfException, const char *exceptionCode, UExceptionSeverity severity, int level, const char *description)
 
bool AreEqualAbs (double af, double bf, double epsilon)
 
bool AreEqualRel (double af, double bf, double relPrec)
 
long LocMin (long n, const double *a)
 
long LocMax (long n, const double *a)
 
void TransformLimits (UVector3 &min, UVector3 &max, const UTransform3D &transformation)
 
double Random (double min=0.0, double max=1.0)
 
std::string ToString (int number)
 
std::string ToString (double number)
 
int FileSize (const std::string &filePath)
 
int StrPos (const std::string &haystack, const std::string &needle)
 
double GetRadiusInRing (double rmin, double rmax)
 
template<class T >
sqr (const T &x)
 
bool StrEnds (std::string const &fullString, std::string const &ending)
 

Variables

static const double kPi = 3.14159265358979323846
 
static const double kTwoPi = 2.0 * kPi
 
static const double kRadToDeg = 180.0 / kPi
 
static const double kDegToRad = kPi / 180.0
 
static const double kSqrt2 = 1.4142135623730950488016887242097
 
static const double kInfinity = DBL_MAX
 
static const double kMeshAngleDefault = (kPi / 4)
 
static const int kMinMeshSections = 3
 
static const int kMaxMeshSections = 37
 

Function Documentation

double UUtils::ACos ( double  x)
inline

Definition at line 213 of file UUtils.hh.

References kPi.

Referenced by UVector3::Angle(), and UVector3::Theta().

+ Here is the caller graph for this function:

bool UUtils::AreEqualAbs ( double  af,
double  bf,
double  epsilon 
)
inline

Definition at line 75 of file UUtils.hh.

bool UUtils::AreEqualRel ( double  af,
double  bf,
double  relPrec 
)
inline

Definition at line 80 of file UUtils.hh.

double UUtils::ASin ( double  x)
inline

Definition at line 206 of file UUtils.hh.

References kPi.

double UUtils::ATan ( double  )
inline
double UUtils::ATan2 ( double  y,
double  x 
)
inline

Definition at line 221 of file UUtils.hh.

References kPi.

Referenced by UVector3::Phi().

+ Here is the caller graph for this function:

void UUtils::Exception ( const char *  originOfException,
const char *  exceptionCode,
UExceptionSeverity  severity,
int  level,
const char *  description 
)

Definition at line 122 of file UUtils.cc.

References Error, FatalError, FatalErrorInArguments, and Warning.

Referenced by UTessellatedSolid::AddFacet(), UExtrudedSolid::AddGeneralPolygonFacets(), UTubs::ApproxSurfaceNormal(), USphere::ApproxSurfaceNormal(), UCons::ApproxSurfaceNormal(), UTrd::CheckAndSetAllParameters(), USphere::CheckDPhiAngle(), UGenericTrap::CheckOrder(), USphere::CheckThetaAngles(), UGenericTrap::ComputeIsTwisted(), UGenericPolycone::Create(), UReduciblePolygon::Create(), UPolyhedra::Create(), UPolyPhiFace::Diagnose(), UOrb::DistanceToIn(), UTessellatedSolid::DistanceToInNoVoxels(), UOrb::DistanceToOut(), UTet::DistanceToOut(), UTrd::DistanceToOut(), UTubs::DistanceToOut(), UGenericTrap::DistanceToOut(), UCons::DistanceToOut(), USphere::DistanceToOut(), UTrap::DistanceToOut(), UTessellatedSolid::DistanceToOutNoVoxels(), UPolyhedra::Init(), UPolycone::Init(), UExtrudedSolid::Initialise(), UGenericTrap::Initialise(), UTessellatedSolid::InsideNoVoxels(), UTessellatedSolid::InsideVoxels(), UGenericTrap::MakeDownFacet(), UTrap::MakePlane(), UTrap::MakePlanes(), UGenericTrap::MakeUpFacet(), UTrd::Normal(), UTubs::Normal(), UGenericTrap::Normal(), UCons::Normal(), USphere::Normal(), UTessellatedSolid::Normal(), UTrap::Normal(), UPolyhedra::Reset(), UOrb::SafetyFromInside(), UTrd::SafetyFromInside(), UTubs::SafetyFromInside(), UCons::SafetyFromInside(), USphere::SafetyFromInside(), UTessellatedSolid::SafetyFromInside(), UTrap::SafetyFromInside(), UTessellatedSolid::SafetyFromOutside(), UTrap::SetAllParameters(), G4P1Messenger::SetNewValue(), G4P2Messenger::SetNewValue(), G4H2Messenger::SetNewValue(), G4H3Messenger::SetNewValue(), G4HnMessenger::SetNewValue(), G4H1Messenger::SetNewValue(), UPolycone::SetOriginalParameters(), UTrap::SetPlanes(), UBox::SetXHalfLength(), UBox::SetYHalfLength(), UBox::SetZHalfLength(), UPolyPhiFace::Triangulate(), UBox::UBox(), UCons::UCons(), UOrb::UOrb(), UPolycone::UPolycone(), UQuadrangularFacet::UQuadrangularFacet(), USphere::USphere(), UTet::UTet(), UTrap::UTrap(), UTriangularFacet::UTriangularFacet(), and UTubs::UTubs().

int UUtils::FileSize ( const std::string &  filePath)

Definition at line 91 of file UUtils.cc.

double UUtils::GetRadiusInRing ( double  rmin,
double  rmax 
)
inline

Definition at line 155 of file UUtils.hh.

References Random(), and sqr().

Referenced by UTubs::GetPointOnSurface(), UCons::GetPointOnSurface(), and USphere::GetPointOnSurface().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

double UUtils::Infinity ( )
inline

Definition at line 172 of file UUtils.hh.

Referenced by USphere::DistanceToIn(), USphere::DistanceToOut(), and USphere::Normal().

+ Here is the caller graph for this function:

long UUtils::LocMax ( long  n,
const double *  a 
)
long UUtils::LocMin ( long  n,
const double *  a 
)
short UUtils::Sign ( short  a,
short  b 
)
inline

Definition at line 179 of file UUtils.hh.

Referenced by UBox::DistanceToOut(), G4StatMFChannel::FragmentsMomenta(), UBox::Normal(), G4ViewParameters::ReadInteger(), and G4QGSDiffractiveExcitation::String().

+ Here is the caller graph for this function:

int UUtils::Sign ( int  a,
int  b 
)
inline

Definition at line 184 of file UUtils.hh.

long UUtils::Sign ( long  a,
long  b 
)
inline

Definition at line 189 of file UUtils.hh.

float UUtils::Sign ( float  a,
float  b 
)
inline

Definition at line 194 of file UUtils.hh.

double UUtils::Sign ( double  a,
double  b 
)
inline

Definition at line 199 of file UUtils.hh.

template<class T >
T UUtils::sqr ( const T &  x)
inline
bool UUtils::StrEnds ( std::string const &  fullString,
std::string const &  ending 
)
inline

Definition at line 142 of file UUtils.hh.

int UUtils::StrPos ( const std::string &  haystack,
const std::string &  needle 
)

Definition at line 105 of file UUtils.cc.

string UUtils::ToString ( int  number)

Definition at line 77 of file UUtils.cc.

Referenced by UVoxelizer::BuildBitmasks().

+ Here is the caller graph for this function:

string UUtils::ToString ( double  number)

Definition at line 84 of file UUtils.cc.

void UUtils::TransformLimits ( UVector3 min,
UVector3 max,
const UTransform3D transformation 
)

Definition at line 29 of file UUtils.cc.

References UTransform3D::GlobalPoint(), kInfinity, UVector3::Set(), UVector3::x, UVector3::y, and UVector3::z.

Referenced by UMultiUnion::Extent().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Variable Documentation

const double UUtils::kDegToRad = kPi / 180.0
static
const double UUtils::kInfinity = DBL_MAX
static

Definition at line 53 of file UUtils.hh.

Referenced by UTrap::ApproxSurfaceNormal(), UGenericPolycone::Create(), UPolyhedra::Create(), UQuadrangularFacet::Distance(), UTriangularFacet::Distance(), UPolyhedraSide::Distance(), UVCSGfaceted::DistanceTo(), UOrb::DistanceToIn(), UTet::DistanceToIn(), UVCSGfaceted::DistanceToIn(), UGenericPolycone::DistanceToIn(), UTrd::DistanceToIn(), UBox::DistanceToIn(), UMultiUnion::DistanceToIn(), UTubs::DistanceToIn(), UGenericTrap::DistanceToIn(), UCons::DistanceToIn(), UPolycone::DistanceToIn(), UPolyhedra::DistanceToIn(), UTrap::DistanceToIn(), UMultiUnion::DistanceToInCandidates(), UTessellatedSolid::DistanceToInCandidates(), UTessellatedSolid::DistanceToInCore(), UVCSGfaceted::DistanceToInNoVoxels(), UMultiUnion::DistanceToInNoVoxels(), UTessellatedSolid::DistanceToInNoVoxels(), UVoxelizer::DistanceToNext(), UTet::DistanceToOut(), UVCSGfaceted::DistanceToOut(), UTrd::DistanceToOut(), UBox::DistanceToOut(), UTubs::DistanceToOut(), UGenericTrap::DistanceToOut(), UCons::DistanceToOut(), UTrap::DistanceToOut(), UTessellatedSolid::DistanceToOutCore(), UVCSGfaceted::DistanceToOutNoVoxels(), UMultiUnion::DistanceToOutNoVoxels(), UTessellatedSolid::DistanceToOutNoVoxels(), UMultiUnion::DistanceToOutVoxels(), UGenericTrap::DistToPlane(), UGenericTrap::DistToTriangle(), UPolyhedraSide::Extent(), UPolyPhiFace::Extent(), UTessellatedSolid::Initialize(), UVCSGfaceted::Inside(), UPolyPhiFace::InsideEdges(), UVCSGfaceted::InsideNoVoxels(), UTessellatedSolid::InsideNoVoxels(), UTessellatedSolid::InsideVoxels(), UQuadrangularFacet::Intersect(), UTriangularFacet::Intersect(), UTessellatedSolid::MinDistanceFacet(), UVCSGfaceted::Normal(), UTubs::Normal(), UCons::Normal(), UMultiUnion::Normal(), UTessellatedSolid::Normal(), UTrap::Normal(), UPolyhedraSide::Safety(), UPolyconeSide::Safety(), UPolyPhiFace::Safety(), UMultiUnion::SafetyFromInside(), UVCSGfaceted::SafetyFromInside(), UPolycone::SafetyFromInside(), UTessellatedSolid::SafetyFromInside(), UTrd::SafetyFromInsideAccurate(), UVCSGfaceted::SafetyFromInsideSection(), UMultiUnion::SafetyFromOutside(), UTessellatedSolid::SafetyFromOutside(), UTrd::SafetyFromOutsideAccurate(), and UMultiUnion::SafetyFromOutsideNumberNode().

const int UUtils::kMaxMeshSections = 37
static

Definition at line 57 of file UUtils.hh.

const double UUtils::kMeshAngleDefault = (kPi / 4)
static

Definition at line 55 of file UUtils.hh.

const int UUtils::kMinMeshSections = 3
static

Definition at line 56 of file UUtils.hh.

const double UUtils::kRadToDeg = 180.0 / kPi
static

Definition at line 50 of file UUtils.hh.

const double UUtils::kSqrt2 = 1.4142135623730950488016887242097
static

Definition at line 52 of file UUtils.hh.

const double UUtils::kTwoPi = 2.0 * kPi
static

Definition at line 49 of file UUtils.hh.

Referenced by UPolycone::Init(), and UPolycone::InsideSection().