209 if (
fZ) {
delete[]
fZ;
fZ =
nullptr; }
218 Double_t rmin1, rmax1, rmin2, rmax2, phi1, phi2, dz;
222 for (ipl=0; ipl<
fNz-1; ipl++) {
223 dz = 0.5*(
fZ[ipl+1]-
fZ[ipl]);
227 rmin2 =
fRmin[ipl+1];
228 rmax2 =
fRmax[ipl+1];
240 for (
Int_t isec=0; isec<
fNz-1; isec++) {
246 Error(
"ComputeBBox",
"Duplicated section %d/%d for shape %s", isec, isec+1,
GetName());
249 if (
fZ[isec]>
fZ[isec+1]) {
251 Fatal(
"ComputeBBox",
"Wrong section order");
258 Fatal(
"ComputeBBox",
"Shape %s at index %d: Not allowed first two or last two sections at same Z",
285 if (ddp<0) ddp+= 360;
288 if (ddp<0) ddp+= 360;
291 if (ddp<0) ddp+= 360;
294 if (ddp<0) ddp+= 360;
313 Double_t dz, rmin1, rmax1, rmin2, rmax2;
316 if (ipl==(
fNz-1) || ipl<0) {
321 Int_t iplclose = ipl;
322 if ((
fZ[ipl+1]-point[2])<(point[2]-
fZ[ipl])) iplclose++;
325 if (iplclose==0 || iplclose==(
fNz-1)) {
345 memcpy(ptnew, point, 3*
sizeof(
Double_t));
346 dz = 0.5*(
fZ[ipl+1]-
fZ[ipl]);
351 ptnew[2] -= 0.5*(
fZ[ipl]+
fZ[ipl+1]);
354 rmin2 =
fRmin[ipl+1];
355 rmax2 =
fRmax[ipl+1];
359 else TGeoConeSeg::ComputeNormalS(ptnew,dir,norm,dz,rmin1,rmax1,rmin2,rmax2,
fC1,
fS1,
fC2,
fS2);
374 Double_t r2 = point[0]*point[0]+point[1]*point[1];
379 while ((izh-izl)>1) {
380 if (point[2] >
fZ[izt]) izl = izt;
394 rmin = (
fRmin[izl]*(dz-dz1)+
fRmin[izh]*dz1)/dz;
395 rmax = (
fRmax[izl]*(dz-dz1)+
fRmax[izh]*dz1)/dz;
397 if ((r2<rmin*rmin) || (r2>rmax*rmax))
return kFALSE;
400 if (r2<1
E-10)
return kTRUE;
402 if (phi < 0) phi+=360.0;
404 if (ddp<0) ddp+=360.;
424 if (iact<3 && safe) {
435 if (ipl==(
fNz-1)) ipl--;
441 special_case =
kTRUE;
444 point_new[0] = point[0]+sstep*dir[0];
445 point_new[1] = point[1]+sstep*dir[1];
446 point_new[2] = point[2]+sstep*dir[2];
447 if (!
Contains(point_new))
return 0.;
456 memcpy(point_new, point, 2*
sizeof(
Double_t));
458 point_new[2] = point[2]-0.5*(
fZ[ipl]+
fZ[ipl+1]);
469 if (!
fFullPhi) snxt=
TGeoTubeSeg::DistFromInsideS(point_new, dir,
fRmin[ipl],
fRmax[ipl],dz,
fC1,
fS1,
fC2,
fS2,
fCm,
fSm,
fCdphi);
472 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);
476 for (
Int_t i=0; i<3; i++) point_new[i]=point[i]+(snxt+1
E-6)*dir[i];
477 if (!
Contains(&point_new[0]))
return snxt;
492 Int_t istep=(dir[2]>0)?1:-1;
499 memcpy(&local[0], point, 3*
sizeof(
Double_t));
500 local[2]=point[2]-0.5*(zmin+zmax);
509 else snxt=
TGeoTubeSeg::DistFromOutsideS(local,dir,rmin1,rmax1,dz,
fC1,
fS1,
fC2,
fS2,
fCm,
fSm,
fCdphi);
512 else snxt=
TGeoConeSeg::DistFromOutsideS(local,dir,dz,rmin1,rmax1,rmin2,rmax2,
fC1,
fS1,
fC2,
fS2,
fCm,
fSm,
fCdphi);
514 if (snxt<1E20)
return snxt;
517 Int_t istep=(dir[2]>0)?1:-1;
528 if ((iact<3) && safe) {
540 Double_t r2 = point[0]*point[0]+point[1]*point[1];
543 if (r2>(radmax*radmax)) {
544 Double_t rpr=-point[0]*dir[0]-point[1]*dir[1];
545 Double_t nxy=dir[0]*dir[0]+dir[1]*dir[1];
554 }
else if (ifirst>=(
fNz-1)) ifirst=
fNz-2;
573 if ((snum<0) || (snum>=
fNz))
return;
578 Warning(
"DefineSection",
"Shape %s: invalid rmin=%g rmax=%g",
GetName(), rmin, rmax);
581 if (
fZ[0] >
fZ[snum]) {
633 Error(
"Divide",
"Shape %s: cannot divide a pcon on radius",
GetName());
641 for (is=0; is<
fNz; is++)
646 for (
id=0;
id<ndiv;
id++) {
653 for (ipl=0; ipl<
fNz-1; ipl++) {
654 if (start<
fZ[ipl])
continue;
656 if ((start+ndiv*step)>
fZ[ipl+1])
continue;
664 Error(
"Divide",
"Shape %s: cannot divide pcon on Z if divided region is not between 2 planes",
GetName());
667 finder =
new TGeoPatternZ(voldiv, ndiv, start, start+ndiv*step);
672 for (
id=0;
id<ndiv;
id++) {
686 else shape =
new TGeoCone(step/2,rmin1,rmax1,rmin2,rmax2);
695 Error(
"Divide",
"Shape %s: Wrong axis %d for division",
GetName(), iaxis);
752 param[0] *= param[0];
753 param[1] *= param[1];
760 param[3] = param[2]+
fDphi;
768 if (ipl<0 || ipl>(
fNz-1)) {
769 Error(
"GetRmin",
"ipl=%i out of range (0,%i) in shape %s",ipl,
fNz-1,
GetName());
780 if (ipl<0 || ipl>(
fNz-1)) {
781 Error(
"GetRmax",
"ipl=%i out of range (0,%i) in shape %s",ipl,
fNz-1,
GetName());
792 if (ipl<0 || ipl>(
fNz-1)) {
793 Error(
"GetZ",
"ipl=%i out of range (0,%i) in shape %s",ipl,
fNz-1,
GetName());
804 printf(
"*** Shape %s: TGeoPcon ***\n",
GetName());
805 printf(
" Nz = %i\n",
fNz);
806 printf(
" phi1 = %11.5f\n",
fPhi1);
807 printf(
" dphi = %11.5f\n",
fDphi);
809 printf(
" plane %i: z=%11.5f Rmin=%11.5f Rmax=%11.5f\n", ipl,
fZ[ipl],
fRmin[ipl],
fRmax[ipl]);
810 printf(
" Bounding box:\n");
820 Int_t nbPnts, nbSegs, nbPols;
822 if (nbPnts <= 0)
return nullptr;
825 nbPnts, 3*nbPnts, nbSegs, 3*nbSegs, nbPols, 6*nbPols);
850 if (nbPnts <= 0)
return;
856 Int_t indx, indx2, k;
861 for (i = 0; i < nz*2; i++) {
863 for (j = 1; j <
n; j++) {
865 buff.
fSegs[indx++] = indx2+j-1;
866 buff.
fSegs[indx++] = indx2+j;
870 buff.
fSegs[indx++] = indx2+j-1;
871 buff.
fSegs[indx++] = indx2;
876 for (i = 0; i < 2; i++) {
877 indx2 = i*(nz-1)*2*
n;
878 for (j = 0; j <
n; j++) {
880 buff.
fSegs[indx++] = indx2+j;
881 buff.
fSegs[indx++] = indx2+
n+j;
886 for (i = 0; i < (nz-1); i++) {
889 for (j = 0; j <
n; j++) {
891 buff.
fSegs[indx++] = indx2+j;
892 buff.
fSegs[indx++] = indx2+
n*2+j;
896 for (j = 0; j <
n; j++) {
898 buff.
fSegs[indx++] = indx2+j;
899 buff.
fSegs[indx++] = indx2+
n*2+j;
906 for (i = 1; i < (nz-1); i++) {
907 for (j = 0; j < 2; j++) {
909 buff.
fSegs[indx++] = 2*i *
n + j*(
n-1);
910 buff.
fSegs[indx++] = (2*i+1) *
n + j*(
n-1);
915 Int_t m =
n - 1 + (specialCase ? 1 : 0);
920 for (j = 0; j <
n-1; j++) {
922 buff.
fPols[indx++] = 4;
923 buff.
fPols[indx++] = 2*nz*
m+j;
925 buff.
fPols[indx++] = 2*nz*
m+j+1;
926 buff.
fPols[indx++] = j;
928 for (j = 0; j <
n-1; j++) {
930 buff.
fPols[indx++] = 4;
931 buff.
fPols[indx++] = 2*nz*
m+
n+j;
932 buff.
fPols[indx++] = (nz*2-2)*
m+j;
933 buff.
fPols[indx++] = 2*nz*
m+
n+j+1;
934 buff.
fPols[indx++] = (nz*2-2)*
m+
m+j;
938 buff.
fPols[indx++] = 4;
939 buff.
fPols[indx++] = 2*nz*
m+j;
941 buff.
fPols[indx++] = 2*nz*
m;
942 buff.
fPols[indx++] = j;
945 buff.
fPols[indx++] = 4;
946 buff.
fPols[indx++] = 2*nz*
m+
n+j;
947 buff.
fPols[indx++] = (nz*2-2)*
m+
m+j;
949 buff.
fPols[indx++] = (nz*2-2)*
m+j;
953 for (k = 0; k < (nz-1); k++) {
954 for (j = 0; j <
n-1; j++) {
956 buff.
fPols[indx++] = 4;
957 buff.
fPols[indx++] = 2*k*
m+j;
958 buff.
fPols[indx++] = nz*2*
m+(2*k+2)*
n+j+1;
959 buff.
fPols[indx++] = (2*k+2)*
m+j;
960 buff.
fPols[indx++] = nz*2*
m+(2*k+2)*
n+j;
962 for (j = 0; j <
n-1; j++) {
964 buff.
fPols[indx++] = 4;
965 buff.
fPols[indx++] = (2*k+1)*
m+j;
966 buff.
fPols[indx++] = nz*2*
m+(2*k+3)*
n+j;
967 buff.
fPols[indx++] = (2*k+3)*
m+j;
968 buff.
fPols[indx++] = nz*2*
m+(2*k+3)*
n+j+1;
972 buff.
fPols[indx++] = 4;
973 buff.
fPols[indx++] = 2*k*
m+j;
974 buff.
fPols[indx++] = nz*2*
m+(2*k+2)*
n;
975 buff.
fPols[indx++] = (2*k+2)*
m+j;
976 buff.
fPols[indx++] = nz*2*
m+(2*k+2)*
n+j;
979 buff.
fPols[indx++] = 4;
980 buff.
fPols[indx++] = (2*k+1)*
m+j;
981 buff.
fPols[indx++] = nz*2*
m+(2*k+3)*
n+j;
982 buff.
fPols[indx++] = (2*k+3)*
m+j;
983 buff.
fPols[indx++] = nz*2*
m+(2*k+3)*
n;
991 for (k = 0; k < (nz-1); k++) {
993 buff.
fPols[indx++] = 4;
994 buff.
fPols[indx++] = k==0 ? indx2 : indx2+2*nz*
n+2*(k-1);
995 buff.
fPols[indx++] = indx2+2*(k+1)*
n;
996 buff.
fPols[indx++] = indx2+2*nz*
n+2*k;
997 buff.
fPols[indx++] = indx2+(2*k+3)*
n;
1000 buff.
fPols[indx++] = 4;
1001 buff.
fPols[indx++] = k==0 ? indx2+
n-1 : indx2+2*nz*
n+2*(k-1)+1;
1002 buff.
fPols[indx++] = indx2+(2*k+3)*
n+
n-1;
1003 buff.
fPols[indx++] = indx2+2*nz*
n+2*k+1;
1004 buff.
fPols[indx++] = indx2+2*(k+1)*
n+
n-1;
1006 buff.
fPols[indx-8] = indx2+
n;
1007 buff.
fPols[indx-2] = indx2+2*
n-1;
1019 const Int_t nbPnts = nz *
n + 2;
1021 if ((nz < 2) || (nbPnts <= 0) || (
n < 2))
return;
1025 Int_t indx = 0, indx1 = 0, indx2 = 0, i, j;
1028 for (i = 0; i < nz; i++) {
1030 for (j = 1; j <
n; j++) {
1032 buff.
fSegs[indx++] = indx2 + j - 1;
1033 buff.
fSegs[indx++] = indx2 + j % (
n-1);
1039 for (j = 0; j <
n; j++) {
1041 buff.
fSegs[indx++] = indx2 + j % (
n-1);
1042 buff.
fSegs[indx++] = nbPnts - 2;
1047 for (j = 0; j <
n; j++) {
1049 buff.
fSegs[indx++] = indx2 + j % (
n-1);
1050 buff.
fSegs[indx++] = nbPnts - 1;
1054 for (i = 0; i < (nz - 1); i++) {
1057 for (j = 0; j <
n; j++) {
1059 buff.
fSegs[indx++] = indx2 + j % (
n-1);
1060 buff.
fSegs[indx++] = indx2 +
n + j % (
n-1);
1069 for (j = 0; j <
n - 1; j++) {
1071 buff.
fPols[indx++] = 3;
1072 buff.
fPols[indx++] = indx1 + j;
1073 buff.
fPols[indx++] = indx2 + j + 1;
1074 buff.
fPols[indx++] = indx2 + j;
1078 indx1 = (nz-1)*(
n-1);
1079 indx2 = nz*(
n-1) +
n;
1080 for (j = 0; j <
n - 1; j++) {
1082 buff.
fPols[indx++] = 3;
1083 buff.
fPols[indx++] = indx1 + j;
1084 buff.
fPols[indx++] = indx2 + j;
1085 buff.
fPols[indx++] = indx2 + j + 1;
1089 for (
Int_t k = 0; k < (nz - 1); k++) {
1091 indx2 = nz*(
n-1) +
n*2 + k*
n;
1092 for (j = 0; j <
n-1; j++) {
1094 buff.
fPols[indx++] = 4;
1095 buff.
fPols[indx++] = indx1 + j;
1096 buff.
fPols[indx++] = indx2 + j;
1097 buff.
fPols[indx++] = indx1 + j + (
n-1);
1098 buff.
fPols[indx++] = indx2 + j + 1;
1109 if (ipl<0 || ipl>
fNz-2)
return (safmin+1.);
1112 if (dz<1
E-9)
return 1E9;
1114 memcpy(ptnew, point, 3*
sizeof(
Double_t));
1115 ptnew[2] -= 0.5*(
fZ[ipl]+
fZ[ipl+1]);
1148 if (ipl==(
fNz-1))
return 0;
1149 if (ipl<0)
return 0;
1151 dz = 0.5*(
fZ[ipl+1]-
fZ[ipl]);
1157 if (saftmp<safmin) safmin = saftmp;
1163 if (safmin<0) safmin = 0;
1196 else if (ipl==
fNz-1) ipl=
fNz-2;
1197 dz = 0.5*(
fZ[ipl+1]-
fZ[ipl]);
1198 if (dz<1
E-8 && (ipl+2<
fNz)) {
1200 dz = 0.5*(
fZ[ipl+1]-
fZ[ipl]);
1209 while ((iplane<
fNz-1) && saftmp<1E10) {
1211 if (saftmp<safmin) safmin=saftmp;
1217 while ((iplane>=0) && saftmp<1E10) {
1219 if (saftmp<safmin) safmin=saftmp;
1231 out <<
" // Shape: " <<
GetName() <<
" type: " <<
ClassName() << std::endl;
1232 out <<
" phi1 = " <<
fPhi1 <<
";" << std::endl;
1233 out <<
" dphi = " <<
fDphi <<
";" << std::endl;
1234 out <<
" nz = " <<
fNz <<
";" << std::endl;
1235 out <<
" TGeoPcon *pcon = new TGeoPcon(\"" <<
GetName() <<
"\",phi1,dphi,nz);" << std::endl;
1237 out <<
" z = " <<
fZ[i] <<
";" << std::endl;
1238 out <<
" rmin = " <<
fRmin[i] <<
";" << std::endl;
1239 out <<
" rmax = " <<
fRmax[i] <<
";" << std::endl;
1240 out <<
" pcon->DefineSection(" << i <<
", z,rmin,rmax);" << std::endl;
1242 out <<
" TGeoShape *" <<
GetPointerName() <<
" = pcon;" << std::endl;
1256 Error(
"SetDimensions",
"Pcon %s: Number of Z sections must be > 2",
GetName());
1261 if (
fZ)
delete []
fZ;
1298 for (i = 0; i <
fNz; i++) {
1300 for (j = 0; j <
n; j++) {
1306 for (j = 0; j <
n; j++) {
1339 for (i = 0; i <
fNz; i++) {
1341 for (j = 0; j <
n; j++) {
1347 for (j = 0; j <
n; j++) {
1370 Int_t nvert, nsegs, npols;
1390 if (!specialCase)
return kTRUE;
1405 nvert = nsegs = npols = 0;
1414 nsegs = 4*(nz*
n-1+(specialCase ? 1 : 0));
1415 npols = 2*(nz*
n-1+(specialCase ? 1 : 0));
1418 nsegs = nz * (
n - 1) +
n * 2 + (nz - 1) *
n;
1419 npols = 2 * (
n - 1) + (nz - 1) * (
n - 1);
1433 Int_t nbPnts, nbSegs, nbPols;
1436 if (buffer.
SetRawSizes(nbPnts, 3*nbPnts, nbSegs, 3*nbSegs, nbPols, 6*nbPols)) {
1459void TGeoPcon::Streamer(
TBuffer &R__b)
R__EXTERN TGeoManager * gGeoManager
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.
Buffer base class used for serializing objects.
virtual Int_t ReadClassBuffer(const TClass *cl, void *pointer, const TClass *onfile_class=0)=0
virtual Int_t WriteClassBuffer(const TClass *cl, void *pointer)=0
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.
virtual void InspectShape() const
Prints shape parameters.
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...
A phi segment of a conical tube.
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 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
virtual Double_t Capacity() const
Computes capacity of the shape in [length^3].
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.
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
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 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.
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.
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.
TGeoVolumeMulti * MakeVolumeMulti(const char *name, TGeoMedium *medium)
Make a TGeoVolumeMulti handling a list of volumes.
TObjArray * GetListOfShapes() const
Int_t GetNsegments() const
Get number of segments approximating circles.
Node containing an offset.
Base finder class for patterns.
void SetDivIndex(Int_t index)
Double_t fSm
Cosine of (phi1+phi2)/2.
virtual const char * GetAxisName(Int_t iaxis) const
Returns name of axis IAXIS.
Double_t * GetRmax() const
virtual void SetDimensions(Double_t *param)
Set polycone dimensions starting from an array.
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.
virtual void Sizeof3D() const
fill size of this 3-D object
virtual void SetPoints(Double_t *points) const
create polycone mesh points
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 void ComputeBBox()
compute bounding box of the pcon Check if the sections are in increasing Z order
virtual void ComputeNormal(const Double_t *point, const Double_t *dir, Double_t *norm)
Compute normal to closest surface from POINT.
virtual Int_t DistancetoPrimitive(Int_t px, Int_t py)
compute closest distance from point px,py to each corner
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.
Double_t fC1
Full phi range flag.
Double_t fCdphi
Sine of (phi1+phi2)/2.
Double_t fS1
Cosine of phi1.
virtual void InspectShape() const
print shape parameters
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,...
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 void SetSegsAndPols(TBuffer3D &buff) const
Fill TBuffer3D structure for segments and polygons.
virtual Bool_t Contains(const Double_t *point) const
test if point is inside this shape check total z range
virtual void GetMeshNumbers(Int_t &nvert, Int_t &nsegs, Int_t &npols) const
Returns numbers of vertices, segments and polygons composing the shape mesh.
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
virtual Double_t Capacity() const
Computes capacity of the shape in [length^3].
Double_t fCm
Sine of phi1+dphi.
virtual const TBuffer3D & GetBuffer3D(Int_t reqSections, Bool_t localFrame) const
Fills a static 3D buffer and returns a reference.
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...
virtual TBuffer3D * MakeBuffer3D() const
Creates a TBuffer3D describing this shape.
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
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...
Bool_t HasInsideSurface() const
Returns true when pgon has internal surface It will be only disabled when all Rmin values are 0.
virtual Int_t GetNsegments() const
Returns number of segments on each mesh circle segment.
virtual Double_t GetAxisRange(Int_t iaxis, Double_t &xlo, Double_t &xhi) const
Get range of shape for a given axis.
Double_t fS2
Cosine of phi1+dphi.
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
virtual ~TGeoPcon()
destructor
void SetSegsAndPolsNoInside(TBuffer3D &buff) const
Fill TBuffer3D structure for segments and polygons, when no inner surface exists.
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...
Double_t fC2
Sine of phi1.
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save a primitive as a C++ statement(s) on output stream "out".
virtual Int_t GetNmeshVertices() const
Return number of vertices of the mesh representation.
virtual void GetBoundingCylinder(Double_t *param) const
Fill vector param[4] with the bounding cylinder parameters.
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.
Double_t * GetRmin() const
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 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.
Int_t ShapeDistancetoPrimitive(Int_t numpoints, Int_t px, Int_t py) const
Returns distance to shape primitive mesh.
virtual const char * GetName() const
Get the shape name.
static Double_t Tolerance()
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.
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...
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 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.
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...
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.
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.
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.
void AddVolume(TGeoVolume *vol)
Add a volume with valid shape to the list of volumes.
TGeoVolume, TGeoVolumeMulti, TGeoVolumeAssembly are the volume classes.
void AddNodeOffset(TGeoVolume *vol, Int_t copy_no, Double_t offset=0, Option_t *option="")
Add a division node to the list of nodes.
TGeoMedium * GetMedium() const
void SetFinder(TGeoPatternFinder *finder)
Int_t GetNdaughters() const
Int_t IndexOf(const TObject *obj) const
TObject * At(Int_t idx) const
R__ALWAYS_INLINE Bool_t TestBit(UInt_t f) const
virtual const char * ClassName() const
Returns name of class to which the object belongs.
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
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.
virtual void Fatal(const char *method, const char *msgfmt,...) const
Issue fatal error message.
const char * Data() const
Long64_t LocMin(Long64_t n, const T *a)
Return index of array with the minimum element.
Short_t Max(Short_t a, Short_t b)
Double_t ATan2(Double_t y, Double_t x)
Long64_t LocMax(Long64_t n, const T *a)
Return index of array with the maximum element.
constexpr Double_t E()
Base of natural log:
constexpr Double_t DegToRad()
Conversion from degree to radian:
Double_t Sqrt(Double_t x)
Short_t Min(Short_t a, Short_t b)
Long64_t BinarySearch(Long64_t n, const T *array, T value)
constexpr Double_t RadToDeg()
Conversion from radian to degree: