106 SetHypeDimensions(rin, stin, rout, stout, dz);
109 SetShapeBit(kGeoRunTimeShape);
119 SetHypeDimensions(rin, stin, rout, stout, dz);
122 SetShapeBit(kGeoRunTimeShape);
137 SetDimensions(param);
140 SetShapeBit(kGeoRunTimeShape);
170 Error(
"ComputeBBox",
"Shape %s hyperbolic surfaces are malformed: rin=%g, stin=%g, rout=%g, stout=%g",
GetName(),
185 Double_t rsq = point[0] * point[0] + point[1] * point[1];
193 if (i == 0 ||
r < 1.E-10) {
194 norm[0] = norm[1] = 0.;
210 if (norm[0] * dir[0] + norm[1] * dir[1] + norm[2] * dir[2] < 0) {
224 Double_t r2 = point[0] * point[0] + point[1] * point[1];
251 if (iact < 3 && safe) {
255 if ((iact == 1) && (*safe > step))
262 sz = (
fDz - point[2]) / dir[2];
267 sz = -(
fDz + point[2]) / dir[2];
296 if (iact < 3 && safe) {
300 if ((iact == 1) && (step <= *safe))
312 if ((point[2] * dir[2]) < 0) {
316 xi = point[0] + sz * dir[0];
317 yi = point[1] + sz * dir[1];
334 zi = point[2] + s[0] * dir[2];
337 else if (npos == 2) {
338 zi = point[2] + s[1] * dir[2];
345 zi = point[2] + s[0] * dir[2];
348 else if (npos == 2) {
349 zi = point[2] + s[1] * dir[2];
373 Double_t a = dir[0] * dir[0] + dir[1] * dir[1] - t0 * dir[2] * dir[2];
374 Double_t b = t0 * point[2] * dir[2] - point[0] * dir[0] - point[1] * dir[1];
375 Double_t c = point[0] * point[0] + point[1] * point[1] - t0 * point[2] * point[2] - r0 * r0;
396 snext = (
b + i * sone * delta) * ainv;
424 Error(
"Divide",
"Hyperboloids cannot be divided. Division volume %s not created", divname);
463 param[0] *= param[0];
465 param[1] *= param[1];
486 Error(
"GetMakeRuntimeShape",
"Shape %s does not have negative Z range",
GetName());
498 printf(
"*** Shape %s: TGeoHype ***\n",
GetName());
499 printf(
" Rin = %11.5f\n",
fRmin);
500 printf(
" sin = %11.5f\n",
fStIn);
501 printf(
" Rout = %11.5f\n",
fRmax);
502 printf(
" sout = %11.5f\n",
fStOut);
503 printf(
" dz = %11.5f\n",
fDz);
505 printf(
" Bounding box:\n");
517 Int_t nbPnts = (hasRmin) ? (2 *
n *
n) : (
n *
n + 2);
518 Int_t nbSegs = (hasRmin) ? (4 *
n *
n) : (
n * (2 *
n + 1));
519 Int_t nbPols = (hasRmin) ? (2 *
n *
n) : (
n * (
n + 1));
541 Int_t irout = (hasRmin) ? (
n *
n) : 2;
575 Int_t isout = (hasRmin) ? (isgenin +
n * (
n - 1)) : 0;
576 Int_t isgenout = isout +
n *
n;
577 Int_t islo = isgenout +
n * (
n - 1);
583 for (i = 0; i <
n; i++) {
584 for (j = 0; j <
n; j++) {
585 npt = 3 * (
isin +
n * i + j);
587 buff.
fSegs[npt + 1] = irin +
n * i + j;
588 buff.
fSegs[npt + 2] = irin +
n * i + ((j + 1) %
n);
592 for (i = 0; i <
n - 1; i++) {
593 for (j = 0; j <
n; j++) {
594 npt = 3 * (isgenin +
n * i + j);
596 buff.
fSegs[npt + 1] = irin +
n * i + j;
597 buff.
fSegs[npt + 2] = irin +
n * (i + 1) + j;
602 for (i = 0; i <
n; i++) {
603 for (j = 0; j <
n; j++) {
604 npt = 3 * (isout +
n * i + j);
606 buff.
fSegs[npt + 1] = irout +
n * i + j;
607 buff.
fSegs[npt + 2] = irout +
n * i + ((j + 1) %
n);
611 for (i = 0; i <
n - 1; i++) {
612 for (j = 0; j <
n; j++) {
613 npt = 3 * (isgenout +
n * i + j);
615 buff.
fSegs[npt + 1] = irout +
n * i + j;
616 buff.
fSegs[npt + 2] = irout +
n * (i + 1) + j;
620 for (j = 0; j <
n; j++) {
621 npt = 3 * (islo + j);
623 buff.
fSegs[npt + 1] = irin;
625 buff.
fSegs[npt + 1] += j;
626 buff.
fSegs[npt + 2] = irout + j;
629 for (j = 0; j <
n; j++) {
630 npt = 3 * (ishi + j);
632 buff.
fSegs[npt + 1] = irin + 1;
634 buff.
fSegs[npt + 1] +=
n * (
n - 1) + j - 1;
635 buff.
fSegs[npt + 2] = irout +
n * (
n - 1) + j;
661 Int_t ipout = (hasRmin) ? (ipin +
n * (
n - 1)) : 0;
662 Int_t iplo = ipout +
n * (
n - 1);
666 for (i = 0; i <
n - 1; i++) {
667 for (j = 0; j <
n; j++) {
668 npt = 6 * (ipin +
n * i + j);
670 buff.
fPols[npt + 1] = 4;
672 buff.
fPols[npt + 3] = isgenin + i *
n + ((j + 1) %
n);
674 buff.
fPols[npt + 5] = isgenin + i *
n + j;
679 for (i = 0; i <
n - 1; i++) {
680 for (j = 0; j <
n; j++) {
681 npt = 6 * (ipout +
n * i + j);
683 buff.
fPols[npt + 1] = 4;
684 buff.
fPols[npt + 2] = isout +
n * i + j;
685 buff.
fPols[npt + 3] = isgenout + i *
n + j;
686 buff.
fPols[npt + 4] = isout +
n * (i + 1) + j;
687 buff.
fPols[npt + 5] = isgenout + i *
n + ((j + 1) %
n);
692 for (j = 0; j <
n; j++) {
693 npt = 6 * (iplo + j);
695 buff.
fPols[npt + 1] = 4;
697 buff.
fPols[npt + 3] = islo + j;
698 buff.
fPols[npt + 4] = isout + j;
699 buff.
fPols[npt + 5] = islo + ((j + 1) %
n);
701 for (j = 0; j <
n; j++) {
702 npt = 6 * (ipup + j);
704 buff.
fPols[npt + 1] = 4;
706 buff.
fPols[npt + 3] = ishi + ((j + 1) %
n);
707 buff.
fPols[npt + 4] = isout +
n * (
n - 1) + j;
708 buff.
fPols[npt + 5] = ishi + j;
711 for (j = 0; j <
n; j++) {
712 npt = 6 * iplo + 5 * j;
714 buff.
fPols[npt + 1] = 3;
715 buff.
fPols[npt + 2] = isout + j;
716 buff.
fPols[npt + 3] = islo + ((j + 1) %
n);
717 buff.
fPols[npt + 4] = islo + j;
719 for (j = 0; j <
n; j++) {
720 npt = 6 * iplo + 5 * (
n + j);
722 buff.
fPols[npt + 1] = 3;
723 buff.
fPols[npt + 2] = isout +
n * (
n - 1) + j;
724 buff.
fPols[npt + 3] = ishi + j;
725 buff.
fPols[npt + 4] = ishi + ((j + 1) %
n);
743 return (r0 * r0 + tsq * z * z);
761 return ((
r *
r - r0 * r0) / tsq);
800 rsq = point[0] * point[0] + point[1] * point[1];
843 out <<
" rin = " <<
fRmin <<
";" << std::endl;
844 out <<
" stin = " <<
fStIn <<
";" << std::endl;
845 out <<
" rout = " <<
fRmax <<
";" << std::endl;
846 out <<
" stout = " <<
fStOut <<
";" << std::endl;
847 out <<
" dz = " <<
fDz <<
";" << std::endl;
903 dz = 2. *
fDz / (
n - 1);
909 for (i = 0; i <
n; i++) {
912 for (j = 0; j <
n; j++) {
928 for (i = 0; i <
n; i++) {
931 for (j = 0; j <
n; j++) {
952 dz = 2. *
fDz / (
n - 1);
958 for (i = 0; i <
n; i++) {
961 for (j = 0; j <
n; j++) {
977 for (i = 0; i <
n; i++) {
980 for (j = 0; j <
n; j++) {
996 nvert = (hasRmin) ? (2 *
n *
n) : (
n *
n + 2);
997 nsegs = (hasRmin) ? (4 *
n *
n) : (
n * (2 *
n + 1));
998 npols = (hasRmin) ? (2 *
n *
n) : (
n * (
n + 1));
1028 Int_t nbPnts = (hasRmin) ? (2 *
n *
n) : (
n *
n + 2);
1029 Int_t nbSegs = (hasRmin) ? (4 *
n *
n) : (
n * (2 *
n + 1));
1030 Int_t nbPols = (hasRmin) ? (2 *
n *
n) : (
n * (
n + 1));
1031 if (buffer.SetRawSizes(nbPnts, 3 * nbPnts, nbSegs, 3 * nbSegs, nbPols, 6 * nbPols)) {
1037 if (!buffer.fLocalFrame) {
1055 for (
Int_t i = 0; i < vecsize; i++)
1066 for (
Int_t i = 0; i < vecsize; i++)
1076 for (
Int_t i = 0; i < vecsize; i++)
1086 for (
Int_t i = 0; i < vecsize; i++)
1097 for (
Int_t i = 0; i < vecsize; i++)
void Error(const char *location, const char *msgfmt,...)
Use this function in case an error occurred.
void Warning(const char *location, const char *msgfmt,...)
Use this function in warning situations.
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t r
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t points
R__EXTERN TGeoManager * gGeoManager
#define isin(address, start, length)
Generic 3D primitive description class.
void FillBuffer3D(TBuffer3D &buffer, Int_t reqSections, Bool_t localFrame) const override
Fill the supplied buffer, with sections in desired frame See TBuffer3D.h for explanation of sections,...
Double_t DistFromOutside(const Double_t *point, const Double_t *dir, Int_t iact=1, Double_t step=TGeoShape::Big(), Double_t *safe=nullptr) const override
void InspectShape() const override
Int_t GetNmeshVertices() const override
const TBuffer3D & GetBuffer3D(Int_t reqSections, Bool_t localFrame) const override
Stub implementation to avoid forcing implementation at this stage.
Double_t SafetyToHype(const Double_t *point, Bool_t inner, Bool_t in) const
TGeoShape * GetMakeRuntimeShape(TGeoShape *mother, TGeoMatrix *mat) const override
Double_t ZHypeSq(Double_t r, Bool_t inner) const
void ComputeNormal(const Double_t *point, const Double_t *dir, Double_t *norm) override
void SetSegsAndPols(TBuffer3D &buff) const override
void DistFromOutside_v(const Double_t *points, const Double_t *dirs, Double_t *dists, Int_t vecsize, Double_t *step) const override
Double_t RadiusHypeSq(Double_t z, Bool_t inner) const
TGeoVolume * Divide(TGeoVolume *voldiv, const char *divname, Int_t iaxis, Int_t ndiv, Double_t start, Double_t step) override
Double_t Safety(const Double_t *point, Bool_t in=kTRUE) const override
void ComputeBBox() override
void SavePrimitive(std::ostream &out, Option_t *option="") override
Save a primitive as a C++ statement(s) on output stream "out".
Int_t DistancetoPrimitive(Int_t px, Int_t py) override
Computes distance from point (px,py) to the object.
Double_t Capacity() const override
void Sizeof3D() const override
Int_t DistToHype(const Double_t *point, const Double_t *dir, Double_t *s, Bool_t inner, Bool_t in) const
void ComputeNormal_v(const Double_t *points, const Double_t *dirs, Double_t *norms, Int_t vecsize) override
void Safety_v(const Double_t *points, const Bool_t *inside, Double_t *safe, Int_t vecsize) const override
void SetDimensions(Double_t *param) override
void SetPoints(Double_t *points) const override
Double_t DistFromInside(const Double_t *point, const Double_t *dir, Int_t iact=1, Double_t step=TGeoShape::Big(), Double_t *safe=nullptr) const override
void GetBoundingCylinder(Double_t *param) const override
void SetHypeDimensions(Double_t rin, Double_t stin, Double_t rout, Double_t stout, Double_t dz)
Double_t DistFromOutside(const Double_t *point, const Double_t *dir, Int_t iact=1, Double_t step=TGeoShape::Big(), Double_t *safe=nullptr) const override
void InspectShape() const override
Bool_t Contains(const Double_t *point) const override
void GetMeshNumbers(Int_t &nvert, Int_t &nsegs, Int_t &npols) const override
Double_t GetAxisRange(Int_t iaxis, Double_t &xlo, Double_t &xhi) const override
TBuffer3D * MakeBuffer3D() const override
void DistFromInside_v(const Double_t *points, const Double_t *dirs, Double_t *dists, Int_t vecsize, Double_t *step) const override
void Contains_v(const Double_t *points, Bool_t *inside, Int_t vecsize) const override
Int_t GetNsegments() const
Get number of segments approximating circles.
Geometrical transformation package.
Base abstract class for all shapes.
virtual Double_t GetAxisRange(Int_t iaxis, Double_t &xlo, Double_t &xhi) const =0
Int_t GetBasicColor() const
Get the basic color (0-7).
void TransformPoints(Double_t *points, UInt_t NbPoints) const
Tranform a set of points (LocalToMaster)
void SetShapeBit(UInt_t f, Bool_t set)
Equivalent of TObject::SetBit.
const char * GetPointerName() const
Provide a pointer name containing uid.
Int_t ShapeDistancetoPrimitive(Int_t numpoints, Int_t px, Int_t py) const
Returns distance to shape primitive mesh.
const char * GetName() const override
Get the shape name.
static Double_t Tolerance()
Bool_t TestShapeBit(UInt_t f) const
TGeoVolume, TGeoVolumeMulti, TGeoVolumeAssembly are the volume classes.
R__ALWAYS_INLINE Bool_t TestBit(UInt_t f) const
virtual const char * ClassName() const
Returns name of class to which the object belongs.
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
RVec< PromoteType< T > > sin(const RVec< T > &v)
Long64_t LocMin(Long64_t n, const T *a)
Returns index of array with the minimum element.
T1 Sign(T1 a, T2 b)
Returns a value with the magnitude of a and the sign of b.
Double_t ATan2(Double_t y, Double_t x)
Returns the principal value of the arc tangent of y/x, expressed in radians.
constexpr Double_t DegToRad()
Conversion from degree to radian: .
Double_t Sqrt(Double_t x)
Returns the square root of x.
Short_t Min(Short_t a, Short_t b)
Returns the smallest of a and b.
Double_t Cos(Double_t)
Returns the cosine of an angle of x radians.
Double_t Sin(Double_t)
Returns the sine of an angle of x radians.
Double_t Tan(Double_t)
Returns the tangent of an angle of x radians.
Short_t Abs(Short_t d)
Returns the absolute value of parameter Short_t d.