33 #if !defined(G4GEOM_USE_UORB)
49 using namespace CLHEP;
84 :
G4CSGSolid(rhs), fRmax(rhs.fRmax), halfRmaxTol(rhs.halfRmaxTol),
85 sqrRmaxPlusTol(rhs.sqrRmaxPlusTol), sqrRmaxMinusTol(rhs.sqrRmaxMinusTol)
97 if (
this == &rhs) {
return *
this; }
126 "Invalid radius < 10*kCarTolerance.");
154 pMin.
set(-radius,-radius,-radius);
155 pMax.
set( radius, radius, radius);
159 if (pMin.
x() >= pMax.
x() || pMin.
y() >= pMax.
y() || pMin.
z() >= pMax.
z())
162 message <<
"Bad bounding box (min >= max) for solid: "
164 <<
"\npMin = " << pMin
165 <<
"\npMax = " <<
pMax;
166 G4Exception(
"G4Orb::BoundingLimits()",
"GeomMgt0001",
194 return exist = (pMin <
pMax) ?
true :
false;
199 static const G4int NTHETA = 8;
200 static const G4int NPHI = 16;
203 static const G4double sinHalfPhi = std::sin(
pi/NPHI);
204 static const G4double cosHalfPhi = std::cos(
pi/NPHI);
205 static const G4double sinStepTheta = 2.*sinHalfTheta*cosHalfTheta;
206 static const G4double cosStepTheta = 1. - 2.*sinHalfTheta*sinHalfTheta;
207 static const G4double sinStepPhi = 2.*sinHalfPhi*cosHalfPhi;
208 static const G4double cosStepPhi = 1. - 2.*sinHalfPhi*sinHalfPhi;
211 G4double rtheta = radius/cosHalfTheta;
220 xy[
k].
set(cosCurPhi,sinCurPhi);
222 sinCurPhi = sinCurPhi*cosStepPhi + cosCurPhi*sinStepPhi;
223 cosCurPhi = cosCurPhi*cosStepPhi - sinTmpPhi*sinStepPhi;
228 for (
G4int i=0; i<NTHETA; ++i) { circles[i].resize(NPHI); }
230 G4double sinCurTheta = sinHalfTheta;
231 G4double cosCurTheta = cosHalfTheta;
232 for (
G4int i=0; i<NTHETA; ++i)
238 circles[i][
k].set(rho*xy[
k].
x(),rho*xy[
k].
y(),z);
241 sinCurTheta = sinCurTheta*cosStepTheta + cosCurTheta*sinStepTheta;
242 cosCurTheta = cosCurTheta*cosStepTheta - sinTmpTheta*sinStepTheta;
246 std::vector<const G4ThreeVectorList *> polygons;
247 polygons.resize(NTHETA);
248 for (
G4int i=0; i<NTHETA; ++i) { polygons[i] = &circles[i]; }
272 return (1/p.
mag())*p;
310 dist = dist - 1.e-8*dist -
fRmax;
327 return (dist > 0) ? dist : 0.;
351 *n = p*(1./std::sqrt(rr));
365 G4double tmax = (D <= 0) ? 0. : std::sqrt(D) - pv;
371 *n = ptmax*(1./ptmax.
mag());
386 G4int oldprc = message.precision(16);
387 message <<
"Point p is outside (!?) of solid: " <<
GetName() <<
"\n";
388 message <<
"Position:\n";
389 message <<
" p.x() = " << p.
x()/
mm <<
" mm\n";
390 message <<
" p.y() = " << p.
y()/
mm <<
" mm\n";
391 message <<
" p.z() = " << p.
z()/
mm <<
" mm";
393 G4Exception(
"G4Trap::DistanceToOut(p)",
"GeomSolids1002",
399 return (dist > 0) ? dist : 0.;
417 return new G4Orb(*
this);
426 G4int oldprc = os.precision(16);
427 os <<
"-----------------------------------------------------------\n"
428 <<
" *** Dump for solid - " <<
GetName() <<
" ***\n"
429 <<
" ===================================================\n"
430 <<
" Solid type: G4Orb\n"
432 <<
" outer radius: " <<
fRmax/
mm <<
" mm \n"
433 <<
"-----------------------------------------------------------\n";
434 os.precision(oldprc);