256 if (
fZ) {
delete[]
fZ;
fZ = 0;}
265 Double_t rmin1, rmax1, rmin2, rmax2, phi1, phi2, dz;
269 for (ipl=0; ipl<
fNz-1; ipl++) {
270 dz = 0.5*(
fZ[ipl+1]-
fZ[ipl]);
274 rmin2 =
fRmin[ipl+1];
275 rmax2 =
fRmax[ipl+1];
287 for (
Int_t isec=0; isec<
fNz-1; isec++) {
293 Error(
"ComputeBBox",
"Duplicated section %d/%d for shape %s", isec, isec+1,
GetName());
296 if (
fZ[isec]>
fZ[isec+1]) {
298 Fatal(
"ComputeBBox",
"Wrong section order");
305 Fatal(
"ComputeBBox",
"Shape %s at index %d: Not allowed first two or last two sections at same Z",
332 if (ddp<0) ddp+= 360;
333 if (ddp<=
fDphi) xmax = rmax;
335 if (ddp<0) ddp+= 360;
336 if (ddp<=
fDphi) ymax = rmax;
338 if (ddp<0) ddp+= 360;
339 if (ddp<=
fDphi) xmin = -rmax;
341 if (ddp<0) ddp+= 360;
342 if (ddp<=
fDphi) ymin = -rmax;
360 Double_t dz, rmin1, rmax1, rmin2, rmax2;
363 if (ipl==(
fNz-1) || ipl<0) {
368 Int_t iplclose = ipl;
369 if ((
fZ[ipl+1]-point[2])<(point[2]-
fZ[ipl])) iplclose++;
372 if (iplclose==0 || iplclose==(
fNz-1)) {
377 r =
TMath::Sqrt(point[0]*point[0]+point[1]*point[1]);
384 r =
TMath::Sqrt(point[0]*point[0]+point[1]*point[1]);
392 memcpy(ptnew, point, 3*
sizeof(
Double_t));
393 dz = 0.5*(
fZ[ipl+1]-
fZ[ipl]);
398 ptnew[2] -= 0.5*(
fZ[ipl]+
fZ[ipl+1]);
401 rmin2 =
fRmin[ipl+1];
402 rmax2 =
fRmax[ipl+1];
406 else TGeoConeSeg::ComputeNormalS(ptnew,dir,norm,dz,rmin1,rmax1,rmin2,rmax2,
fC1,
fS1,
fC2,
fS2);
421 Double_t r2 = point[0]*point[0]+point[1]*point[1];
426 while ((izh-izl)>1) {
427 if (point[2] >
fZ[izt]) izl = izt;
441 rmin = (
fRmin[izl]*(dz-dz1)+
fRmin[izh]*dz1)/dz;
442 rmax = (
fRmax[izl]*(dz-dz1)+
fRmax[izh]*dz1)/dz;
444 if ((r2<rmin*rmin) || (r2>rmax*rmax))
return kFALSE;
447 if (r2<1
E-10)
return kTRUE;
449 if (phi < 0) phi+=360.0;
451 if (ddp<0) ddp+=360.;
471 if (iact<3 && safe) {
482 if (ipl==(
fNz-1)) ipl--;
488 special_case =
kTRUE;
491 point_new[0] = point[0]+sstep*dir[0];
492 point_new[1] = point[1]+sstep*dir[1];
493 point_new[2] = point[2]+sstep*dir[2];
494 if (!
Contains(point_new))
return 0.;
503 memcpy(point_new, point, 2*
sizeof(
Double_t));
505 point_new[2] = point[2]-0.5*(
fZ[ipl]+
fZ[ipl+1]);
516 if (!
fFullPhi) snxt=
TGeoTubeSeg::DistFromInsideS(point_new, dir,
fRmin[ipl],
fRmax[ipl],dz,
fC1,
fS1,
fC2,
fS2,
fCm,
fSm,
fCdphi);
519 if (!
fFullPhi) snxt=
TGeoConeSeg::DistFromInsideS(point_new,dir,dz,
fRmin[ipl],
fRmax[ipl],
fRmin[ipl+1],
fRmax[ipl+1],
fC1,
fS1,
fC2,
fS2,
fCm,
fSm,
fCdphi);
523 for (
Int_t i=0; i<3; i++) point_new[i]=point[i]+(snxt+1
E-6)*dir[i];
524 if (!
Contains(&point_new[0]))
return snxt;
539 Int_t istep=(dir[2]>0)?1:-1;
546 memcpy(&local[0], point, 3*
sizeof(
Double_t));
547 local[2]=point[2]-0.5*(zmin+zmax);
556 else snxt=
TGeoTubeSeg::DistFromOutsideS(local,dir,rmin1,rmax1,dz,
fC1,
fS1,
fC2,
fS2,
fCm,
fSm,
fCdphi);
559 else snxt=
TGeoConeSeg::DistFromOutsideS(local,dir,dz,rmin1,rmax1,rmin2,rmax2,
fC1,
fS1,
fC2,
fS2,
fCm,
fSm,
fCdphi);
561 if (snxt<1E20)
return snxt;
564 Int_t istep=(dir[2]>0)?1:-1;
575 if ((iact<3) && safe) {
587 Double_t r2 = point[0]*point[0]+point[1]*point[1];
590 if (r2>(radmax*radmax)) {
591 Double_t rpr=-point[0]*dir[0]-point[1]*dir[1];
592 Double_t nxy=dir[0]*dir[0]+dir[1]*dir[1];
601 }
else if (ifirst>=(
fNz-1)) ifirst=
fNz-2;
620 if ((snum<0) || (snum>=
fNz))
return;
625 Warning(
"DefineSection",
"Shape %s: invalid rmin=%g rmax=%g",
GetName(), rmin, rmax);
628 if (
fZ[0] >
fZ[snum]) {
680 Error(
"Divide",
"Shape %s: cannot divide a pcon on radius",
GetName());
688 for (is=0; is<
fNz; is++)
693 for (
id=0;
id<ndiv;
id++) {
700 for (ipl=0; ipl<fNz-1; ipl++) {
701 if (start<
fZ[ipl])
continue;
703 if ((start+ndiv*step)>
fZ[ipl+1])
continue;
711 Error(
"Divide",
"Shape %s: cannot divide pcon on Z if divided region is not between 2 planes",
GetName());
714 finder =
new TGeoPatternZ(voldiv, ndiv, start, start+ndiv*step);
719 for (
id=0;
id<ndiv;
id++) {
733 else shape =
new TGeoCone(step/2,rmin1,rmax1,rmin2,rmax2);
742 Error(
"Divide",
"Shape %s: Wrong axis %d for division",
GetName(), iaxis);
799 param[0] *= param[0];
800 param[1] *= param[1];
807 param[3] = param[2]+
fDphi;
815 if (ipl<0 || ipl>(
fNz-1)) {
816 Error(
"GetRmin",
"ipl=%i out of range (0,%i) in shape %s",ipl,
fNz-1,
GetName());
827 if (ipl<0 || ipl>(
fNz-1)) {
828 Error(
"GetRmax",
"ipl=%i out of range (0,%i) in shape %s",ipl,
fNz-1,
GetName());
839 if (ipl<0 || ipl>(
fNz-1)) {
840 Error(
"GetZ",
"ipl=%i out of range (0,%i) in shape %s",ipl,
fNz-1,
GetName());
851 printf(
"*** Shape %s: TGeoPcon ***\n",
GetName());
852 printf(
" Nz = %i\n",
fNz);
853 printf(
" phi1 = %11.5f\n",
fPhi1);
854 printf(
" dphi = %11.5f\n",
fDphi);
856 printf(
" plane %i: z=%11.5f Rmin=%11.5f Rmax=%11.5f\n", ipl,
fZ[ipl],
fRmin[ipl],
fRmax[ipl]);
857 printf(
" Bounding box:\n");
869 if (nz < 2)
return 0;
871 if (nbPnts <= 0)
return 0;
877 Int_t nbSegs = 4*(nz*n-1+(specialCase ==
kTRUE));
878 Int_t nbPols = 2*(nz*n-1+(specialCase ==
kTRUE));
880 nbPnts, 3*nbPnts, nbSegs, 3*nbSegs, nbPols, 6*nbPols);
900 if (nbPnts <= 0)
return;
907 Int_t indx, indx2, k;
912 for (i = 0; i < nz*2; i++) {
914 for (j = 1; j <
n; j++) {
915 buff.
fSegs[indx++] = c;
916 buff.
fSegs[indx++] = indx2+j-1;
917 buff.
fSegs[indx++] = indx2+j;
920 buff.
fSegs[indx++] = c;
921 buff.
fSegs[indx++] = indx2+j-1;
922 buff.
fSegs[indx++] = indx2;
927 for (i = 0; i < 2; i++) {
928 indx2 = i*(nz-1)*2*n;
929 for (j = 0; j <
n; j++) {
930 buff.
fSegs[indx++] = c;
931 buff.
fSegs[indx++] = indx2+j;
932 buff.
fSegs[indx++] = indx2+n+j;
937 for (i = 0; i < (nz-1); i++) {
940 for (j = 0; j <
n; j++) {
941 buff.
fSegs[indx++] = c+2;
942 buff.
fSegs[indx++] = indx2+j;
943 buff.
fSegs[indx++] = indx2+n*2+j;
947 for (j = 0; j <
n; j++) {
948 buff.
fSegs[indx++] = c+3;
949 buff.
fSegs[indx++] = indx2+j;
950 buff.
fSegs[indx++] = indx2+n*2+j;
957 for (i = 1; i < (nz-1); i++) {
958 for (j = 0; j < 2; j++) {
959 buff.
fSegs[indx++] = c;
960 buff.
fSegs[indx++] = 2*i * n + j*(n-1);
961 buff.
fSegs[indx++] = (2*i+1) * n + j*(n-1);
971 for (j = 0; j < n-1; j++) {
972 buff.
fPols[indx++] = c+3;
973 buff.
fPols[indx++] = 4;
974 buff.
fPols[indx++] = 2*nz*m+j;
975 buff.
fPols[indx++] = m+j;
976 buff.
fPols[indx++] = 2*nz*m+j+1;
977 buff.
fPols[indx++] = j;
979 for (j = 0; j < n-1; j++) {
980 buff.
fPols[indx++] = c+3;
981 buff.
fPols[indx++] = 4;
982 buff.
fPols[indx++] = 2*nz*m+n+j;
983 buff.
fPols[indx++] = (nz*2-2)*m+j;
984 buff.
fPols[indx++] = 2*nz*m+n+j+1;
985 buff.
fPols[indx++] = (nz*2-2)*m+m+j;
988 buff.
fPols[indx++] = c+3;
989 buff.
fPols[indx++] = 4;
990 buff.
fPols[indx++] = 2*nz*m+j;
991 buff.
fPols[indx++] = m+j;
992 buff.
fPols[indx++] = 2*nz*
m;
993 buff.
fPols[indx++] = j;
995 buff.
fPols[indx++] = c+3;
996 buff.
fPols[indx++] = 4;
997 buff.
fPols[indx++] = 2*nz*m+n+j;
998 buff.
fPols[indx++] = (nz*2-2)*m+m+j;
999 buff.
fPols[indx++] = 2*nz*m+
n;
1000 buff.
fPols[indx++] = (nz*2-2)*m+j;
1004 for (k = 0; k < (nz-1); k++) {
1005 for (j = 0; j < n-1; j++) {
1006 buff.
fPols[indx++] = c;
1007 buff.
fPols[indx++] = 4;
1008 buff.
fPols[indx++] = 2*k*m+j;
1009 buff.
fPols[indx++] = nz*2*m+(2*k+2)*n+j+1;
1010 buff.
fPols[indx++] = (2*k+2)*m+j;
1011 buff.
fPols[indx++] = nz*2*m+(2*k+2)*n+j;
1013 for (j = 0; j < n-1; j++) {
1014 buff.
fPols[indx++] = c+1;
1015 buff.
fPols[indx++] = 4;
1016 buff.
fPols[indx++] = (2*k+1)*m+j;
1017 buff.
fPols[indx++] = nz*2*m+(2*k+3)*n+j;
1018 buff.
fPols[indx++] = (2*k+3)*m+j;
1019 buff.
fPols[indx++] = nz*2*m+(2*k+3)*n+j+1;
1022 buff.
fPols[indx++] = c;
1023 buff.
fPols[indx++] = 4;
1024 buff.
fPols[indx++] = 2*k*m+j;
1025 buff.
fPols[indx++] = nz*2*m+(2*k+2)*n;
1026 buff.
fPols[indx++] = (2*k+2)*m+j;
1027 buff.
fPols[indx++] = nz*2*m+(2*k+2)*n+j;
1029 buff.
fPols[indx++] = c+1;
1030 buff.
fPols[indx++] = 4;
1031 buff.
fPols[indx++] = (2*k+1)*m+j;
1032 buff.
fPols[indx++] = nz*2*m+(2*k+3)*n+j;
1033 buff.
fPols[indx++] = (2*k+3)*m+j;
1034 buff.
fPols[indx++] = nz*2*m+(2*k+3)*n;
1042 for (k = 0; k < (nz-1); k++) {
1043 buff.
fPols[indx++] = c+2;
1044 buff.
fPols[indx++] = 4;
1045 buff.
fPols[indx++] = k==0 ? indx2 : indx2+2*nz*n+2*(k-1);
1046 buff.
fPols[indx++] = indx2+2*(k+1)*n;
1047 buff.
fPols[indx++] = indx2+2*nz*n+2*k;
1048 buff.
fPols[indx++] = indx2+(2*k+3)*n;
1050 buff.
fPols[indx++] = c+2;
1051 buff.
fPols[indx++] = 4;
1052 buff.
fPols[indx++] = k==0 ? indx2+n-1 : indx2+2*nz*n+2*(k-1)+1;
1053 buff.
fPols[indx++] = indx2+(2*k+3)*n+n-1;
1054 buff.
fPols[indx++] = indx2+2*nz*n+2*k+1;
1055 buff.
fPols[indx++] = indx2+2*(k+1)*n+n-1;
1057 buff.
fPols[indx-8] = indx2+
n;
1058 buff.
fPols[indx-2] = indx2+2*n-1;
1068 if (ipl<0 || ipl>
fNz-2)
return (safmin+1.);
1071 if (dz<1
E-9)
return 1E9;
1073 memcpy(ptnew, point, 3*
sizeof(
Double_t));
1074 ptnew[2] -= 0.5*(
fZ[ipl]+
fZ[ipl+1]);
1107 if (ipl==(
fNz-1))
return 0;
1108 if (ipl<0)
return 0;
1110 dz = 0.5*(
fZ[ipl+1]-
fZ[ipl]);
1116 if (saftmp<safmin) safmin = saftmp;
1122 if (safmin<0) safmin = 0;
1155 else if (ipl==
fNz-1) ipl=
fNz-2;
1156 dz = 0.5*(
fZ[ipl+1]-
fZ[ipl]);
1157 if (dz<1
E-8 && (ipl+2<
fNz)) {
1159 dz = 0.5*(
fZ[ipl+1]-
fZ[ipl]);
1168 while ((iplane<
fNz-1) && saftmp<1E10) {
1170 if (saftmp<safmin) safmin=saftmp;
1176 while ((iplane>=0) && saftmp<1E10) {
1178 if (saftmp<safmin) safmin=saftmp;
1190 out <<
" // Shape: " <<
GetName() <<
" type: " <<
ClassName() << std::endl;
1191 out <<
" phi1 = " <<
fPhi1 <<
";" << std::endl;
1192 out <<
" dphi = " <<
fDphi <<
";" << std::endl;
1193 out <<
" nz = " <<
fNz <<
";" << std::endl;
1194 out <<
" TGeoPcon *pcon = new TGeoPcon(\"" <<
GetName() <<
"\",phi1,dphi,nz);" << std::endl;
1196 out <<
" z = " <<
fZ[i] <<
";" << std::endl;
1197 out <<
" rmin = " <<
fRmin[i] <<
";" << std::endl;
1198 out <<
" rmax = " <<
fRmax[i] <<
";" << std::endl;
1199 out <<
" pcon->DefineSection(" << i <<
", z,rmin,rmax);" << std::endl;
1201 out <<
" TGeoShape *" <<
GetPointerName() <<
" = pcon;" << std::endl;
1215 Error(
"SetDimensions",
"Pcon %s: Number of Z sections must be > 2",
GetName());
1220 if (
fZ)
delete []
fZ;
1255 for (i = 0; i <
fNz; i++) {
1256 for (j = 0; j <
n; j++) {
1260 points[indx++] =
fZ[i];
1262 for (j = 0; j <
n; j++) {
1266 points[indx++] =
fZ[i];
1284 for (i = 0; i <
fNz; i++) {
1285 for (j = 0; j <
n; j++) {
1289 points[indx++] =
fZ[i];
1291 for (j = 0; j <
n; j++) {
1295 points[indx++] =
fZ[i];
1326 nsegs = 4*(nz*n-1+(specialCase ==
kTRUE));
1327 npols = 2*(nz*n-1+(specialCase ==
kTRUE));
1343 if (nz >= 2 && nbPnts > 0) {
1345 Int_t nbSegs = 4*(nz*n-1+(specialCase ==
kTRUE));
1346 Int_t nbPols = 2*(nz*n-1+(specialCase ==
kTRUE));
1347 if (buffer.
SetRawSizes(nbPnts, 3*nbPnts, nbSegs, 3*nbSegs, nbPols, 6*nbPols)) {
1370 void TGeoPcon::Streamer(
TBuffer &R__b)
1397 for (
Int_t i=0; i<vecsize; i++) inside[i] =
Contains(&points[3*i]);
1407 for (
Int_t i=0; i<vecsize; i++)
ComputeNormal(&points[3*i], &dirs[3*i], &norms[3*i]);
1415 for (
Int_t i=0; i<vecsize; i++) dists[i] =
DistFromInside(&points[3*i], &dirs[3*i], 3, step[i]);
1423 for (
Int_t i=0; i<vecsize; i++) dists[i] =
DistFromOutside(&points[3*i], &dirs[3*i], 3, step[i]);
1433 for (
Int_t i=0; i<vecsize; i++) safe[i] =
Safety(&points[3*i], inside[i]);
TGeoVolumeMulti * MakeVolumeMulti(const char *name, TGeoMedium *medium)
Make a TGeoVolumeMulti handling a list of volumes.
static Double_t DistFromOutsideS(const Double_t *point, const Double_t *dir, Double_t dz, Double_t rmin1, Double_t rmax1, Double_t rmin2, Double_t rmax2)
Compute distance from outside point to surface of the tube Boundary safe algorithm.
virtual Double_t Capacity() const
Computes capacity of the shape in [length^3].
virtual Double_t GetAxisRange(Int_t iaxis, Double_t &xlo, Double_t &xhi) const
Get range of shape for a given axis.
virtual Int_t WriteClassBuffer(const TClass *cl, void *pointer)=0
static Double_t DistFromInsideS(const Double_t *point, const Double_t *dir, Double_t dz, Double_t rmin1, Double_t rmax1, Double_t rmin2, Double_t rmax2)
Compute distance from inside point to surface of the cone (static) Boundary safe algorithm.
Double_t fC2
Sine of phi1.
virtual Double_t Safety(const Double_t *point, Bool_t in=kTRUE) const
computes the closest distance from given point to this shape, according to option.
Long64_t LocMax(Long64_t n, const T *a)
void SetFinder(TGeoPatternFinder *finder)
virtual void SetDimensions(Double_t *param)
Set polycone dimensions starting from an array.
static Double_t DistFromOutsideS(const Double_t *point, const Double_t *dir, Double_t dz, Double_t rmin1, Double_t rmax1, Double_t rmin2, Double_t rmax2, Double_t c1, Double_t s1, Double_t c2, Double_t s2, Double_t cm, Double_t sm, Double_t cdfi)
compute distance from outside point to surface of arbitrary tube
Double_t fC1
Full phi range flag.
void AddNodeOffset(TGeoVolume *vol, Int_t copy_no, Double_t offset=0, Option_t *option="")
Add a division node to the list of nodes.
Double_t fS2
Cosine of phi1+dphi.
virtual ~TGeoPcon()
destructor
Double_t SafetyToSegment(const Double_t *point, Int_t ipl, Bool_t in=kTRUE, Double_t safmin=TGeoShape::Big()) const
Compute safety from POINT to segment between planes ipl, ipl+1 within safmin.
TGeoVolume, TGeoVolumeMulti, TGeoVolumeAssembly are the volume classes.
Buffer base class used for serializing objects.
virtual void ComputeNormal(const Double_t *point, const Double_t *dir, Double_t *norm)
Compute normal to closest surface from POINT.
static Double_t SafetyS(const Double_t *point, Bool_t in, Double_t dz, Double_t rmin1, Double_t rmax1, Double_t rmin2, Double_t rmax2, Int_t skipz=0)
computes the closest distance from given point to this shape, according to option.
virtual Int_t GetNsegments() const
Returns number of segments on each mesh circle segment.
virtual Double_t DistFromInside(const Double_t *point, const Double_t *dir, Int_t iact=1, Double_t step=TGeoShape::Big(), Double_t *safe=0) const
compute distance from inside point to surface of the polycone
R__ALWAYS_INLINE Bool_t TestBit(UInt_t f) const
Short_t Min(Short_t a, Short_t b)
Double_t fS1
Cosine of phi1.
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...
TGeoPcon & operator=(const TGeoPcon &)
assignment operator
virtual void InspectShape() const
Prints shape parameters.
TObject * At(Int_t idx) const
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.
virtual TBuffer3D * MakeBuffer3D() const
Creates a TBuffer3D describing this shape.
virtual void Contains_v(const Double_t *points, Bool_t *inside, Int_t vecsize) const
Check the inside status for each of the points in the array.
virtual Int_t DistancetoPrimitive(Int_t px, Int_t py)
compute closest distance from point px,py to each corner
static Bool_t IsSameWithinTolerance(Double_t a, Double_t b)
Check if two numbers differ with less than a tolerance.
virtual void GetBoundingCylinder(Double_t *param) const
Fill vector param[4] with the bounding cylinder parameters.
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
static Double_t Tolerance()
Int_t GetNdaughters() const
static void ComputeNormalS(const Double_t *point, const Double_t *dir, Double_t *norm, Double_t dz, Double_t rmin1, Double_t rmax1, Double_t rmin2, Double_t rmax2)
Compute normal to closest surface from POINT.
static Double_t SafetyS(const Double_t *point, Bool_t in, Double_t dz, Double_t rmin1, Double_t rmax1, Double_t rmin2, Double_t rmax2, Double_t phi1, Double_t phi2, Int_t skipz=0)
Static method to compute the closest distance from given point to this shape.
virtual const char * ClassName() const
Returns name of class to which the object belongs.
A phi segment of a conical tube.
void AddVolume(TGeoVolume *vol)
Add a volume with valid shape to the list of volumes.
constexpr Double_t DegToRad()
TGeoMedium * GetMedium() const
virtual Bool_t Contains(const Double_t *point) const
test if point is inside this shape check total z range
Double_t ATan2(Double_t, Double_t)
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save a primitive as a C++ statement(s) on output stream "out".
Double_t fCm
Sine of phi1+dphi.
void SetSectionsValid(UInt_t mask)
const char * GetPointerName() const
Provide a pointer name containing uid.
virtual Int_t GetNmeshVertices() const
Return number of vertices of the mesh representation.
virtual void InspectShape() const
print shape parameters
Base finder class for patterns.
virtual const char * GetName() const
Get the shape name.
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...
Double_t * GetRmax() const
virtual void Sizeof3D() const
fill size of this 3-D object
virtual const TBuffer3D & GetBuffer3D(Int_t reqSections, Bool_t localFrame) const
Fills a static 3D buffer and returns a reference.
Double_t * GetRmin() const
virtual void DistFromOutside_v(const Double_t *points, const Double_t *dirs, Double_t *dists, Int_t vecsize, Double_t *step) const
Compute distance from array of input points having directions specified by dirs. Store output in dist...
Int_t GetNsegments() const
Get number of segments approximating circles.
Int_t ShapeDistancetoPrimitive(Int_t numpoints, Int_t px, Int_t py) const
Returns distance to shape primitive mesh.
Bool_t SectionsValid(UInt_t mask) const
TNamed & operator=(const TNamed &rhs)
TNamed assignment operator.
Base abstract class for all shapes.
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.
virtual void Safety_v(const Double_t *points, const Bool_t *inside, Double_t *safe, Int_t vecsize) const
Compute safe distance from each of the points in the input array.
virtual TGeoVolume * Divide(TGeoVolume *voldiv, const char *divname, Int_t iaxis, Int_t ndiv, Double_t start, Double_t step)
Divide this polycone shape belonging to volume "voldiv" into ndiv volumes called divname, from start position with the given step.
virtual const char * GetAxisName(Int_t iaxis) const
Returns name of axis IAXIS.
virtual void SetSegsAndPols(TBuffer3D &buff) const
Fill TBuffer3D structure for segments and polygons.
TObjArray * GetListOfShapes() const
void TransformPoints(Double_t *points, UInt_t NbPoints) const
Tranform a set of points (LocalToMaster)
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
virtual void ComputeBBox()
compute bounding box of the pcon Check if the sections are in increasing Z order
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.
Generic 3D primitive description class.
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.
void SetDivIndex(Int_t index)
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.
virtual Int_t ReadClassBuffer(const TClass *cl, void *pointer, const TClass *onfile_class=0)=0
virtual void SetPoints(Double_t *points) const
create polycone mesh points
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...
R__EXTERN TGeoManager * gGeoManager
virtual Double_t DistFromOutside(const Double_t *point, const Double_t *dir, Int_t iact=1, Double_t step=TGeoShape::Big(), Double_t *safe=0) const
Compute distance from outside point to surface of the box.
Int_t IndexOf(const TObject *obj) const
Node containing an offset.
you should not use this method at all Int_t Int_t Double_t Double_t Double_t e
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.
static void ComputeNormalS(const Double_t *point, const Double_t *dir, Double_t *norm, Double_t dz, Double_t rmin1, Double_t rmax1, Double_t rmin2, Double_t rmax2, Double_t c1, Double_t s1, Double_t c2, Double_t s2)
Compute normal to closest surface from POINT.
static Double_t DistFromInsideS(const Double_t *point, const Double_t *dir, Double_t dz, Double_t rmin1, Double_t rmax1, Double_t rmin2, Double_t rmax2, 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
void SetShapeBit(UInt_t f, Bool_t set)
Equivalent of TObject::SetBit.
you should not use this method at all Int_t Int_t z
virtual void FillBuffer3D(TBuffer3D &buffer, Int_t reqSections, Bool_t localFrame) const
Fills the supplied buffer, with sections in desired frame See TBuffer3D.h for explanation of sections...
constexpr Double_t RadToDeg()
virtual void DistFromInside_v(const Double_t *points, const Double_t *dirs, Double_t *dists, Int_t vecsize, Double_t *step) const
Compute distance from array of input points having directions specified by dirs. Store output in dist...
virtual Double_t DistFromOutside(const Double_t *point, const Double_t *dir, Int_t iact=1, Double_t step=TGeoShape::Big(), Double_t *safe=0) const
compute distance from outside point to surface of the tube
Short_t Max(Short_t a, Short_t b)
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...
virtual Double_t Capacity() const
Computes capacity of the shape in [length^3].
virtual void DefineSection(Int_t snum, Double_t z, Double_t rmin, Double_t rmax)
Defines z position of a section plane, rmin and rmax at this z.
virtual void GetMeshNumbers(Int_t &nvert, Int_t &nsegs, Int_t &npols) const
Returns numbers of vertices, segments and polygons composing the shape mesh.
static constexpr double pc
virtual void ComputeNormal_v(const Double_t *points, const Double_t *dirs, Double_t *norms, Int_t vecsize)
Compute the normal for an array o points so that norm.dot.dir is positive Input: Arrays of point coor...
Double_t DistToSegZ(const Double_t *point, const Double_t *dir, Int_t &iz) const
compute distance to a pcon Z slice. Segment iz must be valid
Double_t Sqrt(Double_t x)
virtual void Fatal(const char *method, const char *msgfmt,...) const
Issue fatal error message.
Long64_t LocMin(Long64_t n, const T *a)
Int_t GetBasicColor() const
Get the basic color (0-7).
Double_t fSm
Cosine of (phi1+phi2)/2.
Long64_t BinarySearch(Long64_t n, const T *array, T value)
Double_t fCdphi
Sine of (phi1+phi2)/2.
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
const char * Data() const