236 Double_t rsq = point[0] * point[0] + point[1] * point[1];
251 if (
norm[0] * dir[0] +
norm[1] * dir[1] < 0) {
267 if (
norm[0] * dir[0] +
norm[1] * dir[1] < 0) {
280 Double_t r2 = point[0] * point[0] + point[1] * point[1];
294 numPoints = 2 * (
n + 1);
317 Double_t rsq = point[0] * point[0] + point[1] * point[1];
384 if (point[2] * dir[2] >= 0)
387 xi = point[0] + s * dir[0];
388 yi = point[1] + s * dir[1];
394 Double_t rsq = point[0] * point[0] + point[1] * point[1];
412 if (point[2] * dir[2] < 0)
435 zi = point[2] + s * dir[2];
450 zi = point[2] + s * dir[2];
462 zi = point[2] + s * dir[2];
542 for (
id = 0;
id < ndiv;
id++) {
543 shape =
new TGeoTube(start +
id * step, start + (
id + 1) * step,
fDz);
547 voldiv->AddNodeOffset(vol,
id, 0, opt.
Data());
560 for (
id = 0;
id < ndiv;
id++) {
561 voldiv->AddNodeOffset(vol,
id, start +
id * step + step / 2, opt.
Data());
574 for (
id = 0;
id < ndiv;
id++) {
575 voldiv->AddNodeOffset(vol,
id, start + step / 2 +
id * step, opt.
Data());
579 default:
Error(
"Divide",
"In shape %s wrong axis type for division",
GetName());
return nullptr;
590 case 2:
return "PHI";
592 default:
return "UNDEFINED";
631 param[0] *= param[0];
633 param[1] *= param[1];
681 printf(
" Bounding box:\n");
727 for (i = 0; i < 4; i++) {
728 for (
j = 0;
j <
n;
j++) {
738 for (i = 4; i < 6; i++) {
739 for (
j = 0;
j <
n;
j++) {
749 for (i = 6; i < 8; i++) {
750 for (
j = 0;
j <
n;
j++) {
754 buffer.
fSegs[
indx + 2] = (2 * (i - 6) + 1) *
n +
j;
760 for (
j = 0;
j <
n;
j++) {
771 for (
j = 0;
j <
n;
j++) {
782 for (
j = 0;
j <
n;
j++) {
793 for (
j = 0;
j <
n;
j++) {
808 for (i = 0; i < 2; i++) {
809 for (
j = 0;
j <
n;
j++) {
817 for (
j = 0;
j <
n;
j++) {
826 for (i = 3; i < 5; i++) {
827 for (
j = 0;
j <
n;
j++) {
836 for (
j = 0;
j <
n;
j++) {
846 for (
j = 0;
j <
n;
j++) {
855 for (
j = 0;
j <
n;
j++) {
898 Double_t rsq = point[0] * point[0] + point[1] * point[1];
905 for (
Int_t i = 0; i < 3; i++)
918 Double_t rsq = point[0] * point[0] + point[1] * point[1];
922 saf[0] =
dz - point[2];
925 saf[0] =
dz + point[2];
937 for (
Int_t i = 0; i < 3; i++)
950 out <<
" rmin = " <<
fRmin <<
";" << std::endl;
951 out <<
" rmax = " <<
fRmax <<
";" << std::endl;
952 out <<
" dz = " <<
fDz <<
";" << std::endl;
953 out <<
" TGeoShape *" <<
GetPointerName() <<
" = new TGeoTube(\"" <<
GetName() <<
"\",rmin,rmax,dz);" << std::endl;
988 Error(
"GetPointsOnSegments",
"Npoints must be even number");
1008 for (
Int_t i = 0; i < nc; i++) {
1045 for (
j = 0;
j <
n;
j++) {
1057 for (
j = 0;
j <
n;
j++) {
1077 for (
j = 0;
j <
n;
j++) {
1108 for (
j = 0;
j <
n;
j++) {
1120 for (
j = 0;
j <
n;
j++) {
1140 for (
j = 0;
j <
n;
j++) {
1162 numPoints = 2 * (
n + 1);
1290 :
TGeoTube(), fPhi1(0.), fPhi2(0.), fS1(0.), fC1(0.), fS2(0.), fC2(0.), fSm(0.), fCm(0.), fCdfi(0.)
1300 :
TGeoTube(
rmin,
rmax,
dz), fPhi1(0.), fPhi2(0.), fS1(0.), fC1(0.), fS2(0.), fC2(0.), fSm(0.), fCm(0.), fCdfi(0.)
1449 Double_t rsq = point[0] * point[0] + point[1] * point[1];
1468 if (
norm[0] * dir[0] +
norm[1] * dir[1] < 0) {
1481 Double_t rsq = point[0] * point[0] + point[1] * point[1];
1494 if (
norm[0] * dir[0] +
norm[1] * dir[1] < 0) {
1517 const Int_t numPoints = 4 *
n;
1533 Double_t rsq = point[0] * point[0] + point[1] * point[1];
1556 xi = point[0] +
sfmin * dir[0];
1557 yi = point[1] +
sfmin * dir[1];
1558 if (
yi * cm - xi *
sm < 0)
1574 xi = point[0] +
sfmin * dir[0];
1575 yi = point[1] +
sfmin * dir[1];
1576 if (
yi * cm - xi *
sm > 0)
1599 return TGeoTubeSeg::DistFromInsideS(point, dir,
fRmin,
fRmax,
fDz,
fC1,
fS1,
fC2,
fS2,
fCm,
fSm,
fCdfi);
1620 if (point[2] * dir[2] >= 0)
1623 xi = point[0] + s * dir[0];
1624 yi = point[1] + s * dir[1];
1634 Double_t rsq = point[0] * point[0] + point[1] * point[1];
1646 cpsi = point[0] * cm + point[1] *
sm;
1659 if (point[2] * dir[2] < 0)
1680 if (point[0] *
c1 + point[1] *
s1 > point[0] *
c2 + point[1] *
s2) {
1681 un = dir[0] *
s1 - dir[1] *
c1;
1686 un = -dir[0] *
s2 + dir[1] *
c2;
1688 s = -point[0] *
s2 + point[1] *
c2;
1691 zi = point[2] + s * dir[2];
1693 xi = point[0] + s * dir[0];
1694 yi = point[1] + s * dir[1];
1697 if ((
yi * cm - xi *
sm) > 0)
1704 un = -dir[0] *
s2 + dir[1] *
c2;
1709 un = dir[0] *
s1 - dir[1] *
c1;
1711 s = point[0] *
s1 - point[1] *
c1;
1714 zi = point[2] + s * dir[2];
1716 xi = point[0] + s * dir[0];
1717 yi = point[1] + s * dir[1];
1720 if ((
yi * cm - xi *
sm) < 0)
1736 zi = point[2] + s * dir[2];
1738 xi = point[0] + s * dir[0];
1739 yi = point[1] + s * dir[1];
1754 zi = point[2] + s * dir[2];
1757 xi = point[0] + s * dir[0];
1758 yi = point[1] + s * dir[1];
1764 s = point[0] *
s1 - point[1] *
c1;
1767 zi = point[2] + s * dir[2];
1769 xi = point[0] + s * dir[0];
1770 yi = point[1] + s * dir[1];
1773 if ((
yi * cm - xi *
sm) <= 0) {
1781 un = dir[0] *
s2 - dir[1] *
c2;
1783 s = (point[1] *
c2 - point[0] *
s2) /
un;
1784 if (s >= 0 && s <
snxt) {
1785 zi = point[2] + s * dir[2];
1787 xi = point[0] + s * dir[0];
1788 yi = point[1] + s * dir[1];
1791 if ((
yi * cm - xi *
sm) >= 0) {
1814 zi = point[2] + s * dir[2];
1816 xi = point[0] + s * dir[0];
1817 yi = point[1] + s * dir[1];
1831 zi = point[2] + s * dir[2];
1833 xi = point[0] + s * dir[0];
1834 yi = point[1] + s * dir[1];
1845 s = point[0] *
s1 - point[1] *
c1;
1848 zi = point[2] + s * dir[2];
1850 xi = point[0] + s * dir[0];
1851 yi = point[1] + s * dir[1];
1854 if ((
yi * cm - xi *
sm) <= 0) {
1862 un = dir[0] *
s2 - dir[1] *
c2;
1864 s = point[1] *
c2 - point[0] *
s2;
1867 zi = point[2] + s * dir[2];
1869 xi = point[0] + s * dir[0];
1870 yi = point[1] + s * dir[1];
1873 if ((
yi * cm - xi *
sm) >= 0) {
1895 if ((
iact == 1) && (step <= *
safe))
1906 return TGeoTubeSeg::DistFromOutsideS(point, dir,
fRmin,
fRmax,
fDz,
fC1,
fS1,
fC2,
fS2,
fCm,
fSm,
fCdfi);
1927 Double_t end = start + ndiv * step;
1934 for (
id = 0;
id < ndiv;
id++) {
1939 voldiv->AddNodeOffset(vol,
id, 0, opt.
Data());
1960 for (
id = 0;
id < ndiv;
id++) {
1961 voldiv->AddNodeOffset(vol,
id, start +
id * step + step / 2, opt.
Data());
1974 for (
id = 0;
id < ndiv;
id++) {
1975 voldiv->AddNodeOffset(vol,
id, start + step / 2 +
id * step, opt.
Data());
1979 default:
Error(
"Divide",
"In shape %s wrong axis type for division",
GetName());
return nullptr;
2018 param[0] *= param[0];
2020 param[1] *= param[1];
2034 Error(
"GetMakeRuntimeShape",
"Invalid mother for shape %s",
GetName());
2062 printf(
" Bounding box:\n");
2097 for (i = 0; i < 4; i++) {
2098 for (
j = 1;
j <
n;
j++) {
2099 buff.fSegs[(i *
n +
j - 1) * 3] =
c;
2100 buff.fSegs[(i *
n +
j - 1) * 3 + 1] = i *
n +
j - 1;
2101 buff.fSegs[(i *
n +
j - 1) * 3 + 2] = i *
n +
j;
2104 for (i = 4; i < 6; i++) {
2105 for (
j = 0;
j <
n;
j++) {
2106 buff.fSegs[(i *
n +
j) * 3] =
c + 1;
2107 buff.fSegs[(i *
n +
j) * 3 + 1] = (i - 4) *
n +
j;
2108 buff.fSegs[(i *
n +
j) * 3 + 2] = (i - 2) *
n +
j;
2111 for (i = 6; i < 8; i++) {
2112 for (
j = 0;
j <
n;
j++) {
2113 buff.fSegs[(i *
n +
j) * 3] =
c;
2114 buff.fSegs[(i *
n +
j) * 3 + 1] = 2 * (i - 6) *
n +
j;
2115 buff.fSegs[(i *
n +
j) * 3 + 2] = (2 * (i - 6) + 1) *
n +
j;
2122 for (
j = 0;
j <
n - 1;
j++) {
2131 for (
j = 0;
j <
n - 1;
j++) {
2140 for (
j = 0;
j <
n - 1;
j++) {
2145 buff.fPols[
indx++] = ((i - 2) * 2 + 1) *
n +
j;
2149 for (
j = 0;
j <
n - 1;
j++) {
2153 buff.fPols[
indx++] = ((i - 2) * 2 + 1) *
n +
j;
2178 Double_t rsq = point[0] * point[0] + point[1] * point[1];
2228 Double_t rsq = point[0] * point[0] + point[1] * point[1];
2233 saf[0] =
dz - point[2];
2236 saf[0] =
dz + point[2];
2304 out <<
" // Shape: " <<
GetName() <<
" type: " <<
ClassName() << std::endl;
2305 out <<
" rmin = " <<
fRmin <<
";" << std::endl;
2306 out <<
" rmax = " <<
fRmax <<
";" << std::endl;
2307 out <<
" dz = " <<
fDz <<
";" << std::endl;
2308 out <<
" phi1 = " <<
fPhi1 <<
";" << std::endl;
2309 out <<
" phi2 = " <<
fPhi2 <<
";" << std::endl;
2310 out <<
" TGeoShape *" <<
GetPointerName() <<
" = new TGeoTubeSeg(\"" <<
GetName() <<
"\",rmin,rmax,dz,phi1,phi2);"
2356 Error(
"GetPointsOnSegments",
"Npoints must be even number");
2369 for (
Int_t i = 0; i < nc; i++) {
2370 if (i == (nc - 1)) {
2409 for (
j = 0;
j <
n;
j++) {
2419 for (
j = 0;
j <
n;
j++) {
2452 for (
j = 0;
j <
n;
j++) {
2462 for (
j = 0;
j <
n;
j++) {
2641 SetCtubDimensions(params[0], params[1], params[2], params[3], params[4], params[5], params[6], params[7], params[8],
2642 params[9], params[10]);
2666 if ((
fNlow[2] > -(1E-10)) || (
fNhigh[2] < 1E-10)) {
2667 Error(
"ComputeBBox",
"In shape %s wrong definition of cut planes",
GetName());
2681 for (i = 0; i < 2; i++) {
2708 for (i = 0; i < 2; i++) {
2767 fDZ = 0.5 * (zmax - zmin);
2768 fOrigin[2] = 0.5 * (zmax + zmin);
2780 Double_t rsq = point[0] * point[0] + point[1] * point[1];
2796 if (
norm[0] * dir[0] +
norm[1] * dir[1] +
norm[2] * dir[2] < 0) {
2805 if (
norm[0] * dir[0] +
norm[1] * dir[1] +
norm[2] * dir[2] < 0) {
2817 if (
norm[0] * dir[0] +
norm[1] * dir[1] < 0) {
2837 Double_t r2 = point[0] * point[0] + point[1] * point[1];
2901 if ((
iact == 1) && (step <= *
safe))
2911 Double_t rsq = point[0] * point[0] + point[1] * point[1];
2926 xi = point[0] + s * dir[0];
2927 yi = point[1] + s * dir[1];
2942 xi = point[0] + s * dir[0];
2943 yi = point[1] + s * dir[1];
2967 xi = point[0] + s * dir[0];
2968 yi = point[1] + s * dir[1];
2969 zi = point[2] + s * dir[2];
2989 xi = point[0] + s * dir[0];
2990 yi = point[1] + s * dir[1];
2991 zi = point[2] + s * dir[2];
3009 s = (point[1] *
fC1 - point[0] *
fS1) /
un;
3011 xi = point[0] + s * dir[0];
3012 yi = point[1] + s * dir[1];
3013 zi = point[2] + s * dir[2];
3029 s = (point[1] *
fC2 - point[0] *
fS2) /
un;
3031 xi = point[0] + s * dir[0];
3032 yi = point[1] + s * dir[1];
3033 zi = point[2] + s * dir[2];
3062 Double_t rsq = point[0] * point[0] + point[1] * point[1];
3093 if (
fRmin > 1E-10) {
3125 Warning(
"Divide",
"In shape %s division of a cut tube not implemented",
GetName());
3138 Error(
"GetMakeRuntimeShape",
"Invalid mother for shape %s",
GetName());
3152 return (
new TGeoCtub(
rmin,
rmax,
dz,
fPhi1,
fPhi2,
fNlow[0],
fNlow[1],
fNlow[2],
fNhigh[0],
fNhigh[1],
fNhigh[2]));
3177 Double_t rsq = point[0] * point[0] + point[1] * point[1];
3195 for (
Int_t i = 0; i < 4; i++)
3226 out <<
" // Shape: " <<
GetName() <<
" type: " <<
ClassName() << std::endl;
3227 out <<
" rmin = " <<
fRmin <<
";" << std::endl;
3228 out <<
" rmax = " <<
fRmax <<
";" << std::endl;
3229 out <<
" dz = " <<
fDz <<
";" << std::endl;
3230 out <<
" phi1 = " <<
fPhi1 <<
";" << std::endl;
3231 out <<
" phi2 = " <<
fPhi2 <<
";" << std::endl;
3232 out <<
" lx = " <<
fNlow[0] <<
";" << std::endl;
3233 out <<
" ly = " <<
fNlow[1] <<
";" << std::endl;
3234 out <<
" lz = " <<
fNlow[2] <<
";" << std::endl;
3235 out <<
" tx = " <<
fNhigh[0] <<
";" << std::endl;
3236 out <<
" ty = " <<
fNhigh[1] <<
";" << std::endl;
3237 out <<
" tz = " <<
fNhigh[2] <<
";" << std::endl;
3239 <<
"\",rmin,rmax,dz,phi1,phi2,lx,ly,lz,tx,ty,tz);" << std::endl;
3248 SetCtubDimensions(param[0], param[1], param[2], param[3], param[4], param[5], param[6], param[7], param[8], param[9],
3283 for (
j = 0;
j <
n;
j++) {
3293 for (
j = 0;
j <
n;
j++) {
3326 for (
j = 0;
j <
n;
j++) {
3336 for (
j = 0;
j <
n;
j++) {
3384 for (
UInt_t i = 0; i < 3; i++) {
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
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.
void Fatal(const char *location, const char *msgfmt,...)
Use this function in case of a fatal error. It will abort the program.
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 id
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
Cut tube segment description class - see TBuffer3DTypes for producer classes.
Double_t fLowPlaneNorm[3]
Double_t fHighPlaneNorm[3]
Tube segment description class - see TBuffer3DTypes for producer classes.
Complete tube description class - see TBuffer3DTypes for producer classes.
Generic 3D primitive description class.
Bool_t SectionsValid(UInt_t mask) const
void SetSectionsValid(UInt_t mask)
Bool_t SetRawSizes(UInt_t reqPnts, UInt_t reqPntsCapacity, UInt_t reqSegs, UInt_t reqSegsCapacity, UInt_t reqPols, UInt_t reqPolsCapacity)
Set kRaw tessellation section of buffer with supplied sizes.
void FillBuffer3D(TBuffer3D &buffer, Int_t reqSections, Bool_t localFrame) const override
Fills 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
Compute distance from outside point to surface of the box.
void InspectShape() const override
Prints shape parameters.
The cut tubes constructor has the form:
void Safety_v(const Double_t *points, const Bool_t *inside, Double_t *safe, Int_t vecsize) const override
Compute safe distance from each of the points in the input array.
void ComputeNormal_v(const Double_t *points, const Double_t *dirs, Double_t *norms, Int_t vecsize) override
Compute the normal for an array o points so that norm.dot.dir is positive Input: Arrays of point coor...
Bool_t GetPointsOnSegments(Int_t npoints, Double_t *array) const override
Fills array with n random points located on the line segments of the shape mesh.
void Contains_v(const Double_t *points, Bool_t *inside, Int_t vecsize) const override
Check the inside status for each of the points in the array.
const TBuffer3D & GetBuffer3D(Int_t reqSections, Bool_t localFrame) const override
Fills a static 3D buffer and returns a reference.
TGeoShape * GetMakeRuntimeShape(TGeoShape *mother, TGeoMatrix *mat) const override
in case shape has some negative parameters, these has to be computed in order to fit the mother
void SetDimensions(Double_t *param) override
Set dimensions of the cut tube starting from a list.
void ComputeNormal(const Double_t *point, const Double_t *dir, Double_t *norm) const override
Compute normal to closest surface from POINT.
Double_t Capacity() const override
Computes capacity of the shape in [length^3].
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
compute distance from outside point to surface of the cut tube
Bool_t Contains(const Double_t *point) const override
check if point is contained in the cut tube check the lower cut plane
Double_t Safety(const Double_t *point, Bool_t in=kTRUE) const override
computes the closest distance from given point to this shape, according to option.
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
compute distance from inside point to surface of the cut tube
TGeoVolume * Divide(TGeoVolume *voldiv, const char *divname, Int_t iaxis, Int_t ndiv, Double_t start, Double_t step) override
Divide the tube along one axis.
Double_t GetZcoord(Double_t xc, Double_t yc, Double_t zc) const
compute real Z coordinate of a point belonging to either lower or higher caps (z should be either +fD...
void InspectShape() const override
print shape parameters
void GetMeshNumbers(Int_t &nvert, Int_t &nsegs, Int_t &npols) const override
Returns numbers of vertices, segments and polygons composing the shape mesh.
~TGeoCtub() override
destructor
void DistFromInside_v(const Double_t *points, const Double_t *dirs, Double_t *dists, Int_t vecsize, Double_t *step) const override
Compute distance from array of input points having directions specified by dirs. Store output in dist...
Double_t GetAxisRange(Int_t iaxis, Double_t &xlo, Double_t &xhi) const override
Get range of shape for a given axis.
void DistFromOutside_v(const Double_t *points, const Double_t *dirs, Double_t *dists, Int_t vecsize, Double_t *step) const override
Compute distance from array of input points having directions specified by dirs. Store output in dist...
Int_t GetNmeshVertices() const override
Return number of vertices of the mesh representation.
void SetPoints(Double_t *points) const override
Create mesh points for the cut tube.
void SetCtubDimensions(Double_t rmin, Double_t rmax, Double_t dz, Double_t phi1, Double_t phi2, Double_t lx, Double_t ly, Double_t lz, Double_t tx, Double_t ty, Double_t tz)
set dimensions of a cut tube
void SavePrimitive(std::ostream &out, Option_t *option="") override
Save a primitive as a C++ statement(s) on output stream "out".
void ComputeBBox() override
compute minimum bounding box of the ctub
TGeoVolumeMulti * MakeVolumeMulti(const char *name, TGeoMedium *medium)
Make a TGeoVolumeMulti handling a list of volumes.
Int_t GetNsegments() const
Get number of segments approximating circles.
Geometrical transformation package.
Node containing an offset.
Base finder class for patterns.
Base abstract class for all shapes.
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.
static Double_t DistToPhiMin(const Double_t *point, const Double_t *dir, Double_t s1, Double_t c1, Double_t s2, Double_t c2, Double_t sm, Double_t cm, Bool_t in=kTRUE)
compute distance from point (inside phi) to both phi planes. Return minimum.
static Double_t SafetyPhi(const Double_t *point, Bool_t in, Double_t phi1, Double_t phi2)
Static method to compute safety w.r.t a phi corner defined by cosines/sines of the angles phi1,...
static Bool_t IsSameWithinTolerance(Double_t a, Double_t b)
Check if two numbers differ with less than a tolerance.
const char * GetPointerName() const
Provide a pointer name containing uid.
static Bool_t IsInPhiRange(const Double_t *point, Double_t phi1, Double_t phi2)
Static method to check if a point is in the phi range (phi1, phi2) [degrees].
Int_t ShapeDistancetoPrimitive(Int_t numpoints, Int_t px, Int_t py) const
Returns distance to shape primitive mesh.
static void NormalPhi(const Double_t *point, const Double_t *dir, Double_t *norm, Double_t c1, Double_t s1, Double_t c2, Double_t s2)
Static method to compute normal to phi planes.
const char * GetName() const override
Get the shape name.
static Double_t Tolerance()
static Bool_t IsCloseToPhi(Double_t epsil, const Double_t *point, Double_t c1, Double_t s1, Double_t c2, Double_t s2)
True if point is closer than epsil to one of the phi planes defined by c1,s1 or c2,...
Bool_t TestShapeBit(UInt_t f) const
A tube segment is a tube having a range in phi.
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
compute distance from outside point to surface of the tube segment fist localize point w....
void ComputeNormal_v(const Double_t *points, const Double_t *dirs, Double_t *norms, Int_t vecsize) override
Compute the normal for an array o points so that norm.dot.dir is positive Input: Arrays of point coor...
void SetPoints(Double_t *points) const override
Create tube segment mesh points.
Double_t Capacity() const override
Computes capacity of the shape in [length^3].
TGeoTubeSeg()
Default constructor.
~TGeoTubeSeg() override
destructor
void Safety_v(const Double_t *points, const Bool_t *inside, Double_t *safe, Int_t vecsize) const override
Compute safe distance from each of the points in the input array.
TBuffer3D * MakeBuffer3D() const override
Creates a TBuffer3D describing this shape.
void Sizeof3D() const override
fill size of this 3-D object
Bool_t GetPointsOnSegments(Int_t npoints, Double_t *array) const override
Fills array with n random points located on the line segments of the shape mesh.
TGeoShape * GetMakeRuntimeShape(TGeoShape *mother, TGeoMatrix *mat) const override
in case shape has some negative parameters, these has to be computed in order to fit the mother
void InspectShape() const override
print shape parameters
static Double_t DistFromInsideS(const Double_t *point, const Double_t *dir, Double_t rmin, Double_t rmax, Double_t dz, Double_t c1, Double_t s1, Double_t c2, Double_t s2, Double_t cm, Double_t sm, Double_t cdfi)
Compute distance from inside point to surface of the tube segment (static) Boundary safe algorithm.
void SetDimensions(Double_t *param) override
Set dimensions of the tube segment starting from a list.
void AfterStreamer() override
Function called after streaming an object of this class.
Bool_t Contains(const Double_t *point) const override
test if point is inside this tube segment first check if point is inside the tube
static Double_t DistFromOutsideS(const Double_t *point, const Double_t *dir, Double_t rmin, Double_t rmax, Double_t dz, Double_t c1, Double_t s1, Double_t c2, Double_t s2, Double_t cm, Double_t sm, Double_t cdfi)
Static method to compute distance to arbitrary tube segment from outside point Boundary safe algorith...
void ComputeBBox() override
compute bounding box of the tube segment
void DistFromOutside_v(const Double_t *points, const Double_t *dirs, Double_t *dists, Int_t vecsize, Double_t *step) const override
Compute distance from array of input points having directions specified by dirs. Store output in dist...
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
Compute distance from inside point to surface of the tube segment Boundary safe algorithm.
void ComputeNormal(const Double_t *point, const Double_t *dir, Double_t *norm) const override
Compute normal to closest surface from POINT.
static Double_t SafetyS(const Double_t *point, Bool_t in, Double_t rmin, Double_t rmax, Double_t dz, Double_t phi1, Double_t phi2, Int_t skipz=0)
Static method to compute the closest distance from given point to this shape.
void GetBoundingCylinder(Double_t *param) const override
Fill vector param[4] with the bounding cylinder parameters.
Int_t DistancetoPrimitive(Int_t px, Int_t py) override
compute closest distance from point px,py to each corner
void InitTrigonometry()
Init frequently used trigonometric values.
TGeoVolume * Divide(TGeoVolume *voldiv, const char *divname, Int_t iaxis, Int_t ndiv, Double_t start, Double_t step) override
Divide this tube segment shape belonging to volume "voldiv" into ndiv volumes called divname,...
Double_t Safety(const Double_t *point, Bool_t in=kTRUE) const override
computes the closest distance from given point InitTrigonometry();to this shape, according to option.
void SetTubsDimensions(Double_t rmin, Double_t rmax, Double_t dz, Double_t phi1, Double_t phi2)
Set dimensions of the tube segment.
Int_t GetNmeshVertices() const override
Return number of vertices of the mesh representation.
const TBuffer3D & GetBuffer3D(Int_t reqSections, Bool_t localFrame) const override
Fills a static 3D buffer and returns a reference.
Double_t GetAxisRange(Int_t iaxis, Double_t &xlo, Double_t &xhi) const override
Get range of shape for a given axis.
void GetMeshNumbers(Int_t &nvert, Int_t &nsegs, Int_t &npols) const override
Returns numbers of vertices, segments and polygons composing the shape mesh.
void SavePrimitive(std::ostream &out, Option_t *option="") override
Save a primitive as a C++ statement(s) on output stream "out".
void DistFromInside_v(const Double_t *points, const Double_t *dirs, Double_t *dists, Int_t vecsize, Double_t *step) const override
Compute distance from array of input points having directions specified by dirs. Store output in dist...
static void ComputeNormalS(const Double_t *point, const Double_t *dir, Double_t *norm, Double_t rmin, Double_t rmax, Double_t dz, Double_t c1, Double_t s1, Double_t c2, Double_t s2)
Compute normal to closest surface from POINT.
void Contains_v(const Double_t *points, Bool_t *inside, Int_t vecsize) const override
Check the inside status for each of the points in the array.
void SetSegsAndPols(TBuffer3D &buff) const override
Fill TBuffer3D structure for segments and polygons.
Int_t GetNmeshVertices() const override
Return number of vertices of the mesh representation.
void GetBoundingCylinder(Double_t *param) const override
Fill vector param[4] with the bounding cylinder parameters.
void ComputeNormal(const Double_t *point, const Double_t *dir, Double_t *norm) const override
Compute normal to closest surface from POINT.
void Safety_v(const Double_t *points, const Bool_t *inside, Double_t *safe, Int_t vecsize) const override
Compute safe distance from each of the points in the input array.
void GetMeshNumbers(Int_t &nvert, Int_t &nsegs, Int_t &npols) const override
Returns numbers of vertices, segments and polygons composing the shape mesh.
static void DistToTube(Double_t rsq, Double_t nsq, Double_t rdotn, Double_t radius, Double_t &b, Double_t &delta)
Static method computing the distance to a tube with given radius, starting from POINT along DIR direc...
Double_t GetAxisRange(Int_t iaxis, Double_t &xlo, Double_t &xhi) const override
Get range of shape for a given axis.
void SetTubeDimensions(Double_t rmin, Double_t rmax, Double_t dz)
Set tube dimensions.
TBuffer3D * MakeBuffer3D() const override
Creates a TBuffer3D describing this shape.
Int_t DistancetoPrimitive(Int_t px, Int_t py) override
compute closest distance from point px,py to each corner
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
Compute distance from outside point to surface of the tube and safe distance Boundary safe algorithm.
void ComputeNormal_v(const Double_t *points, const Double_t *dirs, Double_t *norms, Int_t vecsize) override
Compute the normal for an array o points so that norm.dot.dir is positive Input: Arrays of point coor...
static Double_t DistFromOutsideS(const Double_t *point, const Double_t *dir, Double_t rmin, Double_t rmax, Double_t dz)
Static method to compute distance from outside point to a tube with given parameters Boundary safe al...
void SavePrimitive(std::ostream &out, Option_t *option="") override
Save a primitive as a C++ statement(s) on output stream "out".
void ComputeBBox() override
compute bounding box of the tube
void DistFromInside_v(const Double_t *points, const Double_t *dirs, Double_t *dists, Int_t vecsize, Double_t *step) const override
Compute distance from array of input points having directions specified by dirs. Store output in dist...
static Double_t SafetyS(const Double_t *point, Bool_t in, Double_t rmin, Double_t rmax, Double_t dz, Int_t skipz=0)
computes the closest distance from given point to this shape, according to option.
void InspectShape() const override
print shape parameters
Bool_t Contains(const Double_t *point) const override
test if point is inside this tube
void DistFromOutside_v(const Double_t *points, const Double_t *dirs, Double_t *dists, Int_t vecsize, Double_t *step) const override
Compute distance from array of input points having directions specified by dirs. Store output in dist...
void SetSegsAndPols(TBuffer3D &buff) const override
Fill TBuffer3D structure for segments and polygons.
Bool_t GetPointsOnSegments(Int_t npoints, Double_t *array) const override
Fills array with n random points located on the line segments of the shape mesh.
void SetPoints(Double_t *points) const override
create tube mesh points
TGeoVolume * Divide(TGeoVolume *voldiv, const char *divname, Int_t iaxis, Int_t ndiv, Double_t start, Double_t step) override
Divide this tube shape belonging to volume "voldiv" into ndiv volumes called divname,...
void SetDimensions(Double_t *param) override
Set tube dimensions starting from a list.
Double_t Capacity() const override
Computes capacity of the shape in [length^3].
static void ComputeNormalS(const Double_t *point, const Double_t *dir, Double_t *norm, Double_t rmin, Double_t rmax, Double_t dz)
Compute normal to closest surface from POINT.
Double_t Safety(const Double_t *point, Bool_t in=kTRUE) const override
computes the closest distance from given point to this shape, according to option.
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
Compute distance from inside point to surface of the tube Boundary safe algorithm.
void Sizeof3D() const override
fill size of this 3-D object
TGeoShape * GetMakeRuntimeShape(TGeoShape *mother, TGeoMatrix *mat) const override
in case shape has some negative parameters, these has to be computed in order to fit the mother
const TBuffer3D & GetBuffer3D(Int_t reqSections, Bool_t localFrame) const override
Fills a static 3D buffer and returns a reference.
const char * GetAxisName(Int_t iaxis) const override
Returns name of axis IAXIS.
void Contains_v(const Double_t *points, Bool_t *inside, Int_t vecsize) const override
Check the inside status for each of the points in the array.
~TGeoTube() override
destructor
static Double_t DistFromInsideS(const Double_t *point, const Double_t *dir, Double_t rmin, Double_t rmax, Double_t dz)
Compute distance from inside point to surface of the tube (static) Boundary safe algorithm.
TGeoTube()
Default constructor.
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.
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
const char * Data() const
Long64_t LocMin(Long64_t n, const T *a)
Returns index of array with the minimum element.
Short_t Max(Short_t a, Short_t b)
Returns the largest of a and b.
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.
Long64_t LocMax(Long64_t n, const T *a)
Returns index of array with the maximum element.
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.
constexpr Double_t RadToDeg()
Conversion from radian to degree: .
Short_t Abs(Short_t d)
Returns the absolute value of parameter Short_t d.
constexpr Double_t TwoPi()