36 #if ( defined(G4GEOM_USE_USOLIDS) || defined(G4GEOM_USE_PARTIAL_USOLIDS) )
43 using namespace CLHEP;
50 G4USphere::G4USphere(
const G4String& pName,
54 : Base_t(pName, pRmin, pRmax, pSPhi, pDPhi, pSTheta, pDTheta)
63 G4USphere::G4USphere( __void__&
a )
72 G4USphere::~G4USphere()
80 G4USphere::G4USphere(
const G4USphere& rhs)
89 G4USphere& G4USphere::operator = (
const G4USphere& rhs)
93 if (
this == &rhs) {
return *
this; }
97 Base_t::operator=(rhs);
106 G4double G4USphere::GetInnerRadius()
const
108 return Base_t::GetInnerRadius();
110 G4double G4USphere::GetOuterRadius()
const
112 return Base_t::GetOuterRadius();
114 G4double G4USphere::GetStartPhiAngle()
const
116 return Base_t::GetStartPhiAngle();
118 G4double G4USphere::GetDeltaPhiAngle()
const
120 return Base_t::GetDeltaPhiAngle();
122 G4double G4USphere::GetStartThetaAngle()
const
124 return Base_t::GetStartThetaAngle();
126 G4double G4USphere::GetDeltaThetaAngle()
const
128 return Base_t::GetDeltaThetaAngle();
130 G4double G4USphere::GetSinStartPhi()
const
132 return Base_t::GetSinSPhi();
134 G4double G4USphere::GetCosStartPhi()
const
136 return Base_t::GetCosSPhi();
138 G4double G4USphere::GetSinEndPhi()
const
140 return Base_t::GetSinEPhi();
142 G4double G4USphere::GetCosEndPhi()
const
144 return Base_t::GetCosEPhi();
146 G4double G4USphere::GetSinStartTheta()
const
148 return Base_t::GetSinSTheta();
150 G4double G4USphere::GetCosStartTheta()
const
152 return Base_t::GetCosSTheta();
154 G4double G4USphere::GetSinEndTheta()
const
156 return Base_t::GetSinETheta();
158 G4double G4USphere::GetCosEndTheta()
const
160 return Base_t::GetCosETheta();
163 void G4USphere::SetInnerRadius(
G4double newRMin)
165 Base_t::SetInnerRadius(newRMin);
166 fRebuildPolyhedron =
true;
168 void G4USphere::SetOuterRadius(
G4double newRmax)
170 Base_t::SetOuterRadius(newRmax);
171 fRebuildPolyhedron =
true;
175 Base_t::SetStartPhiAngle(newSphi, trig);
176 fRebuildPolyhedron =
true;
178 void G4USphere::SetDeltaPhiAngle(
G4double newDphi)
180 Base_t::SetDeltaPhiAngle(newDphi);
181 fRebuildPolyhedron =
true;
183 void G4USphere::SetStartThetaAngle(
G4double newSTheta)
185 Base_t::SetStartThetaAngle(newSTheta);
186 fRebuildPolyhedron =
true;
188 void G4USphere::SetDeltaThetaAngle(
G4double newDTheta)
190 Base_t::SetDeltaThetaAngle(newDTheta);
191 fRebuildPolyhedron =
true;
212 return new G4USphere(*
this);
221 static G4bool checkBBox =
true;
228 if (GetDeltaThetaAngle() >=
pi && GetDeltaPhiAngle() >=
twopi)
230 pMin.
set(-rmax,-rmax,-rmax);
231 pMax.
set( rmax, rmax, rmax);
235 G4double sinStart = GetSinStartTheta();
236 G4double cosStart = GetCosStartTheta();
240 G4double stheta = GetStartThetaAngle();
241 G4double etheta = stheta + GetDeltaThetaAngle();
244 if (stheta >
halfpi) rhomax = rmax*sinStart;
245 if (etheta <
halfpi) rhomax = rmax*sinEnd;
249 GetSinStartPhi(),GetCosStartPhi(),
250 GetSinEndPhi(),GetCosEndPhi(),
255 pMin.
set(xymin.
x(),xymin.
y(),zmin);
256 pMax.
set(xymax.
x(),xymax.
y(),zmax);
261 if (pMin.
x() >= pMax.
x() || pMin.
y() >= pMax.
y() || pMin.
z() >= pMax.
z())
264 message <<
"Bad bounding box (min >= max) for solid: "
266 <<
"\npMin = " << pMin
267 <<
"\npMax = " << pMax;
268 G4Exception(
"G4USphere::BoundingLimits()",
"GeomMgt0001",
287 message <<
"Inconsistency in bounding boxes for solid: "
289 <<
"\nBBox min: wrapper = " << pMin <<
" solid = " << vmin
290 <<
"\nBBox max: wrapper = " << pMax <<
" solid = " << vmax;
291 G4Exception(
"G4USphere::BoundingLimits()",
"GeomMgt0001",
302 G4bool G4USphere::CalculateExtent(
const EAxis pAxis,
310 BoundingLimits(bmin,bmax);
314 return bbox.CalculateExtent(pAxis,pVoxelLimit,pTransform,pMin,pMax);
327 GetStartThetaAngle(),
328 GetDeltaThetaAngle());
331 #endif // G4GEOM_USE_USOLIDS
void set(double x, double y, double z)
T max(const T t1, const T t2)
brief Return the largest of the two arguments
std::vector< ExP01TrackerHit * > a
virtual void ComputeDimensions(G4Box &, const G4int, const G4VPhysicalVolume *) const
void message(RunManager *runmanager)
const G4double kCarTolerance
static constexpr double twopi
static constexpr double halfpi
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
G4GLOB_DLL std::ostream G4cout
static constexpr double pi
T min(const T t1, const T t2)
brief Return the smallest of the two arguments