234 Double_t rsq = point[0] * point[0] + point[1] * point[1];
249 if (
norm[0] * dir[0] +
norm[1] * dir[1] < 0) {
265 if (
norm[0] * dir[0] +
norm[1] * dir[1] < 0) {
278 Double_t r2 = point[0] * point[0] + point[1] * point[1];
292 numPoints = 2 * (
n + 1);
315 Double_t rsq = point[0] * point[0] + point[1] * point[1];
382 if (point[2] * dir[2] >= 0)
385 xi = point[0] + s * dir[0];
386 yi = point[1] + s * dir[1];
392 Double_t rsq = point[0] * point[0] + point[1] * point[1];
410 if (point[2] * dir[2] < 0)
433 zi = point[2] + s * dir[2];
448 zi = point[2] + s * dir[2];
460 zi = point[2] + s * dir[2];
540 for (
id = 0;
id < ndiv;
id++) {
541 shape =
new TGeoTube(start +
id * step, start + (
id + 1) * step,
fDz);
545 voldiv->AddNodeOffset(vol,
id, 0, opt.
Data());
558 for (
id = 0;
id < ndiv;
id++) {
559 voldiv->AddNodeOffset(vol,
id, start +
id * step + step / 2, opt.
Data());
572 for (
id = 0;
id < ndiv;
id++) {
573 voldiv->AddNodeOffset(vol,
id, start + step / 2 +
id * step, opt.
Data());
577 default:
Error(
"Divide",
"In shape %s wrong axis type for division",
GetName());
return nullptr;
588 case 2:
return "PHI";
590 default:
return "UNDEFINED";
629 param[0] *= param[0];
631 param[1] *= param[1];
679 printf(
" Bounding box:\n");
700 for (i = 0; i < 4; i++) {
701 for (
j = 0;
j <
n;
j++) {
711 for (i = 4; i < 6; i++) {
712 for (
j = 0;
j <
n;
j++) {
722 for (i = 6; i < 8; i++) {
723 for (
j = 0;
j <
n;
j++) {
727 buffer.
fSegs[
indx + 2] = (2 * (i - 6) + 1) *
n +
j;
733 for (
j = 0;
j <
n;
j++) {
744 for (
j = 0;
j <
n;
j++) {
755 for (
j = 0;
j <
n;
j++) {
766 for (
j = 0;
j <
n;
j++) {
781 for (i = 0; i < 2; i++) {
782 for (
j = 0;
j <
n;
j++) {
790 for (
j = 0;
j <
n;
j++) {
799 for (i = 3; i < 5; i++) {
800 for (
j = 0;
j <
n;
j++) {
809 for (
j = 0;
j <
n;
j++) {
819 for (
j = 0;
j <
n;
j++) {
828 for (
j = 0;
j <
n;
j++) {
871 Double_t rsq = point[0] * point[0] + point[1] * point[1];
878 for (
Int_t i = 0; i < 3; i++)
891 Double_t rsq = point[0] * point[0] + point[1] * point[1];
895 saf[0] =
dz - point[2];
898 saf[0] =
dz + point[2];
910 for (
Int_t i = 0; i < 3; i++)
923 out <<
" rmin = " <<
fRmin <<
";" << std::endl;
924 out <<
" rmax = " <<
fRmax <<
";" << std::endl;
925 out <<
" dz = " <<
fDz <<
";" << std::endl;
926 out <<
" TGeoShape *" <<
GetPointerName() <<
" = new TGeoTube(\"" <<
GetName() <<
"\",rmin,rmax,dz);" << std::endl;
1012 array[
icrt++] =
r * s;
1052 for (
j = 0;
j <
n;
j++) {
1064 for (
j = 0;
j <
n;
j++) {
1084 for (
j = 0;
j <
n;
j++) {
1115 for (
j = 0;
j <
n;
j++) {
1127 for (
j = 0;
j <
n;
j++) {
1147 for (
j = 0;
j <
n;
j++) {
1169 numPoints = 2 * (
n + 1);
1295 :
TGeoTube(), fPhi1(0.), fPhi2(0.), fS1(0.), fC1(0.), fS2(0.), fC2(0.), fSm(0.), fCm(0.), fCdfi(0.)
1305 :
TGeoTube(
rmin,
rmax,
dz), fPhi1(0.), fPhi2(0.), fS1(0.), fC1(0.), fS2(0.), fC2(0.), fSm(0.), fCm(0.), fCdfi(0.)
1454 Double_t rsq = point[0] * point[0] + point[1] * point[1];
1473 if (
norm[0] * dir[0] +
norm[1] * dir[1] < 0) {
1486 Double_t rsq = point[0] * point[0] + point[1] * point[1];
1499 if (
norm[0] * dir[0] +
norm[1] * dir[1] < 0) {
1522 const Int_t numPoints = 4 *
n;
1538 Double_t rsq = point[0] * point[0] + point[1] * point[1];
1561 xi = point[0] +
sfmin * dir[0];
1562 yi = point[1] +
sfmin * dir[1];
1563 if (
yi * cm - xi *
sm < 0)
1579 xi = point[0] +
sfmin * dir[0];
1580 yi = point[1] +
sfmin * dir[1];
1581 if (
yi * cm - xi *
sm > 0)
1604 return TGeoTubeSeg::DistFromInsideS(point, dir,
fRmin,
fRmax,
fDz,
fC1,
fS1,
fC2,
fS2,
fCm,
fSm,
fCdfi);
1625 if (point[2] * dir[2] >= 0)
1628 xi = point[0] + s * dir[0];
1629 yi = point[1] + s * dir[1];
1639 Double_t rsq = point[0] * point[0] + point[1] * point[1];
1651 cpsi = point[0] * cm + point[1] *
sm;
1664 if (point[2] * dir[2] < 0)
1685 if (point[0] *
c1 + point[1] *
s1 > point[0] *
c2 + point[1] *
s2) {
1686 un = dir[0] *
s1 - dir[1] *
c1;
1691 un = -dir[0] *
s2 + dir[1] *
c2;
1693 s = -point[0] *
s2 + point[1] *
c2;
1696 zi = point[2] + s * dir[2];
1698 xi = point[0] + s * dir[0];
1699 yi = point[1] + s * dir[1];
1702 if ((
yi * cm - xi *
sm) > 0)
1709 un = -dir[0] *
s2 + dir[1] *
c2;
1714 un = dir[0] *
s1 - dir[1] *
c1;
1716 s = point[0] *
s1 - point[1] *
c1;
1719 zi = point[2] + s * dir[2];
1721 xi = point[0] + s * dir[0];
1722 yi = point[1] + s * dir[1];
1725 if ((
yi * cm - xi *
sm) < 0)
1741 zi = point[2] + s * dir[2];
1743 xi = point[0] + s * dir[0];
1744 yi = point[1] + s * dir[1];
1759 zi = point[2] + s * dir[2];
1762 xi = point[0] + s * dir[0];
1763 yi = point[1] + s * dir[1];
1769 s = point[0] *
s1 - point[1] *
c1;
1772 zi = point[2] + s * dir[2];
1774 xi = point[0] + s * dir[0];
1775 yi = point[1] + s * dir[1];
1778 if ((
yi * cm - xi *
sm) <= 0) {
1786 un = dir[0] *
s2 - dir[1] *
c2;
1788 s = (point[1] *
c2 - point[0] *
s2) /
un;
1789 if (s >= 0 && s <
snxt) {
1790 zi = point[2] + s * dir[2];
1792 xi = point[0] + s * dir[0];
1793 yi = point[1] + s * dir[1];
1796 if ((
yi * cm - xi *
sm) >= 0) {
1819 zi = point[2] + s * dir[2];
1821 xi = point[0] + s * dir[0];
1822 yi = point[1] + s * dir[1];
1836 zi = point[2] + s * dir[2];
1838 xi = point[0] + s * dir[0];
1839 yi = point[1] + s * dir[1];
1850 s = point[0] *
s1 - point[1] *
c1;
1853 zi = point[2] + s * dir[2];
1855 xi = point[0] + s * dir[0];
1856 yi = point[1] + s * dir[1];
1859 if ((
yi * cm - xi *
sm) <= 0) {
1867 un = dir[0] *
s2 - dir[1] *
c2;
1869 s = point[1] *
c2 - point[0] *
s2;
1872 zi = point[2] + s * dir[2];
1874 xi = point[0] + s * dir[0];
1875 yi = point[1] + s * dir[1];
1878 if ((
yi * cm - xi *
sm) >= 0) {
1900 if ((
iact == 1) && (step <= *
safe))
1911 return TGeoTubeSeg::DistFromOutsideS(point, dir,
fRmin,
fRmax,
fDz,
fC1,
fS1,
fC2,
fS2,
fCm,
fSm,
fCdfi);
1932 Double_t end = start + ndiv * step;
1939 for (
id = 0;
id < ndiv;
id++) {
1944 voldiv->AddNodeOffset(vol,
id, 0, opt.
Data());
1965 for (
id = 0;
id < ndiv;
id++) {
1966 voldiv->AddNodeOffset(vol,
id, start +
id * step + step / 2, opt.
Data());
1979 for (
id = 0;
id < ndiv;
id++) {
1980 voldiv->AddNodeOffset(vol,
id, start + step / 2 +
id * step, opt.
Data());
1984 default:
Error(
"Divide",
"In shape %s wrong axis type for division",
GetName());
return nullptr;
2023 param[0] *= param[0];
2025 param[1] *= param[1];
2039 Error(
"GetMakeRuntimeShape",
"Invalid mother for shape %s",
GetName());
2067 printf(
" Bounding box:\n");
2081 for (i = 0; i < 4; i++) {
2082 for (
j = 1;
j <
n;
j++) {
2083 buff.fSegs[(i *
n +
j - 1) * 3] =
c;
2084 buff.fSegs[(i *
n +
j - 1) * 3 + 1] = i *
n +
j - 1;
2085 buff.fSegs[(i *
n +
j - 1) * 3 + 2] = i *
n +
j;
2088 for (i = 4; i < 6; i++) {
2089 for (
j = 0;
j <
n;
j++) {
2090 buff.fSegs[(i *
n +
j) * 3] =
c + 1;
2091 buff.fSegs[(i *
n +
j) * 3 + 1] = (i - 4) *
n +
j;
2092 buff.fSegs[(i *
n +
j) * 3 + 2] = (i - 2) *
n +
j;
2095 for (i = 6; i < 8; i++) {
2096 for (
j = 0;
j <
n;
j++) {
2097 buff.fSegs[(i *
n +
j) * 3] =
c;
2098 buff.fSegs[(i *
n +
j) * 3 + 1] = 2 * (i - 6) *
n +
j;
2099 buff.fSegs[(i *
n +
j) * 3 + 2] = (2 * (i - 6) + 1) *
n +
j;
2106 for (
j = 0;
j <
n - 1;
j++) {
2115 for (
j = 0;
j <
n - 1;
j++) {
2124 for (
j = 0;
j <
n - 1;
j++) {
2129 buff.fPols[
indx++] = ((i - 2) * 2 + 1) *
n +
j;
2133 for (
j = 0;
j <
n - 1;
j++) {
2137 buff.fPols[
indx++] = ((i - 2) * 2 + 1) *
n +
j;
2162 Double_t rsq = point[0] * point[0] + point[1] * point[1];
2212 Double_t rsq = point[0] * point[0] + point[1] * point[1];
2217 saf[0] =
dz - point[2];
2220 saf[0] =
dz + point[2];
2288 out <<
" // Shape: " <<
GetName() <<
" type: " <<
ClassName() << std::endl;
2289 out <<
" rmin = " <<
fRmin <<
";" << std::endl;
2290 out <<
" rmax = " <<
fRmax <<
";" << std::endl;
2291 out <<
" dz = " <<
fDz <<
";" << std::endl;
2292 out <<
" phi1 = " <<
fPhi1 <<
";" << std::endl;
2293 out <<
" phi2 = " <<
fPhi2 <<
";" << std::endl;
2294 out <<
" TGeoShape *" <<
GetPointerName() <<
" = new TGeoTubeSeg(\"" <<
GetName() <<
"\",rmin,rmax,dz,phi1,phi2);"
2401 array[
icrt++] =
r * s;
2444 for (
j = 0;
j <
n;
j++) {
2454 for (
j = 0;
j <
n;
j++) {
2487 for (
j = 0;
j <
n;
j++) {
2497 for (
j = 0;
j <
n;
j++) {
2674 SetCtubDimensions(params[0], params[1], params[2], params[3], params[4], params[5], params[6], params[7], params[8],
2675 params[9], params[10]);
2699 if ((
fNlow[2] > -(1E-10)) || (
fNhigh[2] < 1E-10)) {
2700 Error(
"ComputeBBox",
"In shape %s wrong definition of cut planes",
GetName());
2714 for (i = 0; i < 2; i++) {
2741 for (i = 0; i < 2; i++) {
2800 fDZ = 0.5 * (zmax - zmin);
2801 fOrigin[2] = 0.5 * (zmax + zmin);
2813 Double_t rsq = point[0] * point[0] + point[1] * point[1];
2829 if (
norm[0] * dir[0] +
norm[1] * dir[1] +
norm[2] * dir[2] < 0) {
2838 if (
norm[0] * dir[0] +
norm[1] * dir[1] +
norm[2] * dir[2] < 0) {
2850 if (
norm[0] * dir[0] +
norm[1] * dir[1] < 0) {
2870 Double_t r2 = point[0] * point[0] + point[1] * point[1];
2934 if ((
iact == 1) && (step <= *
safe))
2944 Double_t rsq = point[0] * point[0] + point[1] * point[1];
2959 xi = point[0] + s * dir[0];
2960 yi = point[1] + s * dir[1];
2975 xi = point[0] + s * dir[0];
2976 yi = point[1] + s * dir[1];
3000 xi = point[0] + s * dir[0];
3001 yi = point[1] + s * dir[1];
3002 zi = point[2] + s * dir[2];
3022 xi = point[0] + s * dir[0];
3023 yi = point[1] + s * dir[1];
3024 zi = point[2] + s * dir[2];
3042 s = (point[1] *
fC1 - point[0] *
fS1) /
un;
3044 xi = point[0] + s * dir[0];
3045 yi = point[1] + s * dir[1];
3046 zi = point[2] + s * dir[2];
3062 s = (point[1] *
fC2 - point[0] *
fS2) /
un;
3064 xi = point[0] + s * dir[0];
3065 yi = point[1] + s * dir[1];
3066 zi = point[2] + s * dir[2];
3095 Double_t rsq = point[0] * point[0] + point[1] * point[1];
3126 if (
fRmin > 1E-10) {
3158 Warning(
"Divide",
"In shape %s division of a cut tube not implemented",
GetName());
3171 Error(
"GetMakeRuntimeShape",
"Invalid mother for shape %s",
GetName());
3185 return (
new TGeoCtub(
rmin,
rmax,
dz,
fPhi1,
fPhi2,
fNlow[0],
fNlow[1],
fNlow[2],
fNhigh[0],
fNhigh[1],
fNhigh[2]));
3210 Double_t rsq = point[0] * point[0] + point[1] * point[1];
3228 for (
Int_t i = 0; i < 4; i++)
3259 out <<
" // Shape: " <<
GetName() <<
" type: " <<
ClassName() << std::endl;
3260 out <<
" rmin = " <<
fRmin <<
";" << std::endl;
3261 out <<
" rmax = " <<
fRmax <<
";" << std::endl;
3262 out <<
" dz = " <<
fDz <<
";" << std::endl;
3263 out <<
" phi1 = " <<
fPhi1 <<
";" << std::endl;
3264 out <<
" phi2 = " <<
fPhi2 <<
";" << std::endl;
3265 out <<
" lx = " <<
fNlow[0] <<
";" << std::endl;
3266 out <<
" ly = " <<
fNlow[1] <<
";" << std::endl;
3267 out <<
" lz = " <<
fNlow[2] <<
";" << std::endl;
3268 out <<
" tx = " <<
fNhigh[0] <<
";" << std::endl;
3269 out <<
" ty = " <<
fNhigh[1] <<
";" << std::endl;
3270 out <<
" tz = " <<
fNhigh[2] <<
";" << std::endl;
3272 <<
"\",rmin,rmax,dz,phi1,phi2,lx,ly,lz,tx,ty,tz);" << std::endl;
3281 SetCtubDimensions(param[0], param[1], param[2], param[3], param[4], param[5], param[6], param[7], param[8], param[9],
3410 for (
j = 0;
j <
n;
j++) {
3420 for (
j = 0;
j <
n;
j++) {
3453 for (
j = 0;
j <
n;
j++) {
3463 for (
j = 0;
j <
n;
j++) {
3493 for (
UInt_t i = 0; i < 3; i++) {
int Int_t
Signed integer 4 bytes (int)
float Float_t
Float 4 bytes (float)
double Double_t
Double 8 bytes.
const char Option_t
Option string (const char)
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.
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
~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...
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.
a cylindrical phi divison pattern
a cylindrical R divison pattern
base finder class for patterns. A pattern is specifying a division type
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.
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.
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()