81 Fatal(
"TGeoVoxelFinder",
"Null pointer for volume");
205 for (
id = 0;
id < nd;
id++) {
209 box->SetBoxPoints(&vert[0]);
210 for (
Int_t point = 0; point < 8; point++) {
213 xyz[0] = xyz[1] =
pt[0];
214 xyz[2] = xyz[3] =
pt[1];
215 xyz[4] = xyz[5] =
pt[2];
218 for (
Int_t j = 0; j < 3; j++) {
219 if (
pt[j] < xyz[2 * j])
221 if (
pt[j] > xyz[2 * j + 1])
222 xyz[2 * j + 1] =
pt[j];
225 fBoxes[6 *
id] = 0.5 * (xyz[1] - xyz[0]);
226 fBoxes[6 *
id + 1] = 0.5 * (xyz[3] - xyz[2]);
227 fBoxes[6 *
id + 2] = 0.5 * (xyz[5] - xyz[4]);
228 fBoxes[6 *
id + 3] = 0.5 * (xyz[0] + xyz[1]);
229 fBoxes[6 *
id + 4] = 0.5 * (xyz[2] + xyz[3]);
230 fBoxes[6 *
id + 5] = 0.5 * (xyz[4] + xyz[5]);
242 memcpy(master, local, 3 *
sizeof(
Double_t));
257 Double_t dxyz, minsafe2 = minsafe * minsafe;
258 Int_t ist = 6 * inode;
261 for (i = 0; i < 3; i++) {
276 printf(
"Voxelization efficiency for %s\n",
fVolume->GetName());
286 for (
id = 0;
id <
fIbx - 1;
id++) {
290 effslice = nd / effslice;
292 printf(
"Woops : slice X\n");
294 printf(
"X efficiency : %g\n", effslice);
298 for (
id = 0;
id <
fIby - 1;
id++) {
302 effslice = nd / effslice;
304 printf(
"Woops : slice X\n");
306 printf(
"Y efficiency : %g\n", effslice);
310 for (
id = 0;
id <
fIbz - 1;
id++) {
314 effslice = nd / effslice;
316 printf(
"Woops : slice X\n");
318 printf(
"Z efficiency : %g\n", effslice);
321 printf(
"Total efficiency : %g\n", eff);
331 Double_t xmin1, xmax1, ymin1, ymax1, zmin1, zmax1;
349 if (ddx1 * ddx2 <= 0.)
353 if (ddx1 * ddx2 <= 0.)
357 if (ddx1 * ddx2 <= 0.)
370 Double_t xmin1, xmax1, ymin1, ymax1, zmin1, zmax1;
373 Int_t *ovlps =
nullptr;
384 for (
Int_t ib = 0; ib < nd; ib++) {
396 if (ddx1 * ddx2 <= 0.)
400 if (ddx1 * ddx2 <= 0.)
404 if (ddx1 * ddx2 <= 0.)
413 ovlps =
new Int_t[novlp];
414 memcpy(ovlps, otmp, novlp *
sizeof(
Int_t));
473 Int_t *list =
nullptr;
493 Int_t *list =
nullptr;
513 Int_t *list =
nullptr;
536 for (icand = 0; icand < ncheck; icand++) {
537 bitnumber = (
UInt_t)list[icand];
538 loc = bitnumber >> 3;
540 byte = (~td.fVoxBits1[loc]) & (1 << bit);
557 for (icand = 0; icand < ncheck; icand++) {
558 bitnumber = (
UInt_t)list[icand];
559 loc = bitnumber >> 3;
561 byte = (~td.fVoxBits1[loc]) & array1[loc] & (1 << bit);
579 for (icand = 0; icand < ncheck; icand++) {
580 bitnumber = (
UInt_t)list[icand];
581 loc = bitnumber >> 3;
583 byte = (~td.fVoxBits1[loc]) & array1[loc] & array2[loc] & (1 << bit);
627 if (dind[0] < 0 || dind[0] >
fIbx - 1)
642 dforced[0] = dmin[0];
652 dforced[0] = dmin[0];
671 if (dind[1] < 0 || dind[1] >
fIby - 1)
687 dforced[1] = dmin[1];
697 dforced[1] = dmin[1];
716 if (dind[2] < 0 || dind[2] >
fIbz - 1)
732 dforced[2] = dmin[2];
742 dforced[2] = dmin[2];
769 if (dforced[1] > dslice) {
775 if (dforced[2] > dslice) {
784 if (dforced[2] > dslice) {
797 if (dforced[2] > dslice) {
811 dslice = dmin[islice];
812 if (dslice >= maxstep) {
822 Int_t ndd[2] = {0, 0};
837 if ((dslice > dmin[1]) && td.
fVoxInc[1]) {
838 xptnew = point[1] + dslice / td.
fVoxInvdir[1];
856 if ((dslice > dmin[2]) && td.
fVoxInc[2]) {
857 xptnew = point[2] + dslice / td.
fVoxInvdir[2];
953 return GetValidExtra(ndd[0], slice1, ndd[1], slice2, new_list, ncheck, td);
966 if ((dslice > dmin[0]) && td.
fVoxInc[0]) {
967 xptnew = point[0] + dslice / td.
fVoxInvdir[0];
985 if ((dslice > dmin[2]) && td.
fVoxInc[2]) {
986 xptnew = point[2] + dslice / td.
fVoxInvdir[2];
1082 return GetValidExtra(ndd[0], slice1, ndd[1], slice2, new_list, ncheck, td);
1095 if ((dslice > dmin[1]) && td.
fVoxInc[1]) {
1096 xptnew = point[1] + dslice / td.
fVoxInvdir[1];
1114 if ((dslice > dmin[0]) && td.
fVoxInc[0]) {
1115 xptnew = point[0] + dslice / td.
fVoxInvdir[0];
1211 return GetValidExtra(ndd[0], slice1, ndd[1], slice2, new_list, ncheck, td);
1213 default:
Error(
"GetNextCandidates",
"Invalid islice=%i inside %s", islice,
fVolume->GetName());
1236 for (
Int_t i = 0; i < 3; i++) {
1240 td.
fVoxInc[i] = (dir[i] > 0) ? 1 : -1;
1297 memset(&nd[0], 0, 3 *
sizeof(
Int_t));
1319 if (slicex && slicey) {
1334 Error(
"SortCrossedVoxels",
"no slices for %s",
fVolume->GetName());
1358 if (
fVolume->GetNdaughters() == 1) {
1360 if (point[0] <
fXb[0] || point[0] >
fXb[1])
1364 if (point[1] <
fYb[0] || point[1] >
fYb[1])
1369 if (point[2] <
fZb[0] || point[2] >
fZb[1])
1380 Int_t nd[3] = {0, 0, 0};
1384 if ((im == -1) || (im ==
fIbx - 1))
1397 if ((im == -1) || (im ==
fIby - 1))
1415 if ((im == -1) || (im ==
fIbz - 1))
1422 if (slice1 && slice2) {
1439 case 0:
Error(
"GetCheckList",
"No slices for %s",
fVolume->GetName());
return nullptr;
1457 Int_t nd[3] = {0, 0, 0};
1485 if (slice1 && slice2) {
1499 case 0:
Error(
"GetCheckList",
"No slices for %s",
fVolume->GetName());
return nullptr;
1540 Int_t nbytes = 1 + ((nd - 1) >> 3);
1545 for (current_byte = 0; current_byte < nbytes; current_byte++) {
1546 byte = array1[current_byte];
1549 for (current_bit = 0; current_bit < 8; current_bit++) {
1550 if (
byte & (1 << current_bit)) {
1551 result[nf++] = (current_byte << 3) + current_bit;
1572 Int_t nbytes = 1 + ((nd - 1) >> 3);
1587 for (current_byte = 0; current_byte < nbytes; current_byte++) {
1588 byte = array1[current_byte];
1589 icand = current_byte << 3;
1592 for (current_bit = 0; current_bit < 8; current_bit++) {
1593 if (
byte & (1 << current_bit)) {
1616 Int_t nbytes = 1 + ((nd - 1) >> 3);
1621 for (current_byte = 0; current_byte < nbytes; current_byte++) {
1623 byte = (~td.fVoxBits1[current_byte]) & array1[current_byte];
1626 for (current_bit = 0; current_bit < 8; current_bit++) {
1627 if (
byte & (1 << current_bit)) {
1651 Int_t nbytes = 1 + ((nd - 1) >> 3);
1655 for (current_byte = 0; current_byte < nbytes; current_byte++) {
1656 byte = (~td.fVoxBits1[current_byte]) & (array1[current_byte] & array2[current_byte]);
1659 for (current_bit = 0; current_bit < 8; current_bit++) {
1660 if (
byte & (1 << current_bit)) {
1680 Int_t nbytes = 1 + ((nd - 1) >> 3);
1684 for (current_byte = 0; current_byte < nbytes; current_byte++) {
1685 byte = (~td.fVoxBits1[current_byte]) & (array1[current_byte] & array2[current_byte] & array3[current_byte]);
1688 for (current_bit = 0; current_bit < 8; current_bit++) {
1689 if (
byte & (1 << current_bit)) {
1705 Int_t nbytes = 1 + ((nd - 1) >> 3);
1710 for (current_byte = 0; current_byte < nbytes; current_byte++) {
1711 byte = array1[current_byte] & array2[current_byte];
1714 for (current_bit = 0; current_bit < 8; current_bit++) {
1715 if (
byte & (1 << current_bit)) {
1716 result[nf++] = (current_byte << 3) + current_bit;
1717 if ((nf == n1) || (nf == n2)) {
1738 Int_t nbytes = 1 + ((nd - 1) >> 3);
1744 for (current_byte = 0; current_byte < nbytes; current_byte++) {
1745 byte = array1[current_byte] & array2[current_byte];
1746 icand = current_byte << 3;
1750 for (current_bit = 0; current_bit < 8; current_bit++) {
1751 if (
byte & (1 << current_bit)) {
1767 Int_t nbytes = 1 + ((nd - 1) >> 3);
1772 for (current_byte = 0; current_byte < nbytes; current_byte++) {
1773 byte = array1[current_byte] & array2[current_byte] & array3[current_byte];
1776 for (current_bit = 0; current_bit < 8; current_bit++) {
1777 if (
byte & (1 << current_bit)) {
1778 result[nf++] = (current_byte << 3) + current_bit;
1779 if ((nf == n1) || (nf == n2) || (nf == n3)) {
1800 Int_t nbytes = 1 + ((nd - 1) >> 3);
1806 for (current_byte = 0; current_byte < nbytes; current_byte++) {
1807 byte = array1[current_byte] & array2[current_byte] & array3[current_byte];
1808 icand = current_byte << 3;
1812 for (current_bit = 0; current_bit < 8; current_bit++) {
1813 if (
byte & (1 << current_bit)) {
1826 Int_t nperslice = 1 + (nd - 1) / (8 *
sizeof(
UChar_t));
1827 Int_t nmaxslices = 2 * nd + 1;
1835 zmin = (
box->GetOrigin())[2] -
box->GetDZ();
1836 zmax = (
box->GetOrigin())[2] +
box->GetDZ();
1838 Error(
"SortAll",
"Wrong bounding box for volume %s",
fVolume->GetName());
1844 for (
id = 0;
id < nd;
id++) {
1849 boundaries[2 *
id + 2 * nd] =
fBoxes[6 *
id + 4] -
fBoxes[6 *
id + 1];
1850 boundaries[2 *
id + 2 * nd + 1] =
fBoxes[6 *
id + 4] +
fBoxes[6 *
id + 1];
1852 boundaries[2 *
id + 4 * nd] =
fBoxes[6 *
id + 5] -
fBoxes[6 *
id + 2];
1853 boundaries[2 *
id + 4 * nd + 1] =
fBoxes[6 *
id + 5] +
fBoxes[6 *
id + 2];
1855 auto prod = nmaxslices * nperslice;
1856 if (nmaxslices != prod / nperslice) {
1857 Error(
"SortAll",
"Data type (Int_t) overflow for volume %s",
fVolume->GetName());
1871 Int_t nleft, nright;
1874 Double_t xxmin, xxmax, xbmin, xbmax, ddx1, ddx2;
1883 for (
id = 0;
id < 2 * nd;
id++) {
1885 temp[ib++] = boundaries[index[
id]];
1888 if (
TMath::Abs(temp[ib - 1] - boundaries[index[
id]]) > 1E-10)
1889 temp[ib++] = boundaries[index[
id]];
1893 Error(
"SortAll",
"Cannot voxelize %s :less than 2 boundaries on X",
fVolume->GetName());
1894 delete[] boundaries;
1899 delete[] extra_left;
1900 delete[] extra_right;
1906 if (((temp[0] -
xmin) < 1E-10) && ((temp[1] -
xmax) > -1E-10)) {
1938 memset(ind, 0, (nmaxslices * nperslice) *
sizeof(
UChar_t));
1952 for (
id = 0;
id <
fNox;
id++) {
1956 extra[indextra] = extra[indextra + 1] = 0;
1958 bits = &ind[current];
1960 xxmax =
fXb[
id + 1];
1961 for (
Int_t ic = 0; ic < nd; ic++) {
1964 ddx1 = xbmin - xxmax;
1967 ddx2 = xbmax - xxmin;
1974 loc = bitnumber / 8;
1975 bit = bitnumber % 8;
1976 bits[loc] |= 1 << bit;
1979 ddx1 = xbmin - xxmin;
1980 ddx2 = xbmax - xxmax;
1981 if ((
id == 0) || (ddx1 > -1E-10)) {
1982 extra_left[nleft++] = ic;
1985 if ((
id == (
fNoz - 1)) || (ddx2 < 1E-10)) {
1986 extra_right[nright++] = ic;
1991 current += nperslice;
1993 extra[indextra] = nleft;
1994 extra[indextra + 1] = nright;
1996 memcpy(&extra[indextra + 2], extra_left, nleft *
sizeof(
Int_t));
1998 memcpy(&extra[indextra + 2 + nleft], extra_right, nright *
sizeof(
Int_t));
1999 indextra += 2 + nleft + nright;
2009 if (indextra > nmaxslices * 4)
2010 printf(
"Woops!!!\n");
2019 for (
id = 0;
id < 2 * nd;
id++) {
2021 temp[ib++] = boundaries[2 * nd + index[
id]];
2024 if (
TMath::Abs(temp[ib - 1] - boundaries[2 * nd + index[
id]]) > 1E-10)
2025 temp[ib++] = boundaries[2 * nd + index[
id]];
2029 Error(
"SortAll",
"Cannot voxelize %s :less than 2 boundaries on Y",
fVolume->GetName());
2030 delete[] boundaries;
2035 delete[] extra_left;
2036 delete[] extra_right;
2042 if (((temp[0] -
ymin) < 1E-10) && ((temp[1] -
ymax) > -1E-10)) {
2075 memset(ind, 0, (nmaxslices * nperslice) *
sizeof(
UChar_t));
2089 for (
id = 0;
id <
fNoy;
id++) {
2093 extra[indextra] = extra[indextra + 1] = 0;
2095 bits = &ind[current];
2097 xxmax =
fYb[
id + 1];
2098 for (
Int_t ic = 0; ic < nd; ic++) {
2101 ddx1 = xbmin - xxmax;
2104 ddx2 = xbmax - xxmin;
2111 loc = bitnumber / 8;
2112 bit = bitnumber % 8;
2113 bits[loc] |= 1 << bit;
2116 ddx1 = xbmin - xxmin;
2117 ddx2 = xbmax - xxmax;
2118 if ((
id == 0) || (ddx1 > -1E-10)) {
2119 extra_left[nleft++] = ic;
2122 if ((
id == (
fNoz - 1)) || (ddx2 < 1E-10)) {
2123 extra_right[nright++] = ic;
2128 current += nperslice;
2130 extra[indextra] = nleft;
2131 extra[indextra + 1] = nright;
2133 memcpy(&extra[indextra + 2], extra_left, nleft *
sizeof(
Int_t));
2135 memcpy(&extra[indextra + 2 + nleft], extra_right, nright *
sizeof(
Int_t));
2136 indextra += 2 + nleft + nright;
2146 if (indextra > nmaxslices * 4)
2147 printf(
"Woops!!!\n");
2156 for (
id = 0;
id < 2 * nd;
id++) {
2158 temp[ib++] = boundaries[4 * nd + index[
id]];
2161 if ((
TMath::Abs(temp[ib - 1] - boundaries[4 * nd + index[
id]])) > 1E-10)
2162 temp[ib++] = boundaries[4 * nd + index[
id]];
2166 Error(
"SortAll",
"Cannot voxelize %s :less than 2 boundaries on Z",
fVolume->GetName());
2167 delete[] boundaries;
2172 delete[] extra_left;
2173 delete[] extra_right;
2179 if (((temp[0] - zmin) < 1E-10) && ((temp[1] - zmax) > -1E-10)) {
2212 memset(ind, 0, (nmaxslices * nperslice) *
sizeof(
UChar_t));
2226 for (
id = 0;
id <
fNoz;
id++) {
2230 extra[indextra] = extra[indextra + 1] = 0;
2232 bits = &ind[current];
2234 xxmax =
fZb[
id + 1];
2235 for (
Int_t ic = 0; ic < nd; ic++) {
2238 ddx1 = xbmin - xxmax;
2241 ddx2 = xbmax - xxmin;
2248 loc = bitnumber / 8;
2249 bit = bitnumber % 8;
2250 bits[loc] |= 1 << bit;
2253 ddx1 = xbmin - xxmin;
2254 ddx2 = xbmax - xxmax;
2255 if ((
id == 0) || (ddx1 > -1E-10)) {
2256 extra_left[nleft++] = ic;
2259 if ((
id == (
fNoz - 1)) || (ddx2 < 1E-10)) {
2260 extra_right[nright++] = ic;
2265 current += nperslice;
2267 extra[indextra] = nleft;
2268 extra[indextra + 1] = nright;
2270 memcpy(&extra[indextra + 2], extra_left, nleft *
sizeof(
Int_t));
2272 memcpy(&extra[indextra + 2 + nleft], extra_right, nright *
sizeof(
Int_t));
2273 indextra += 2 + nleft + nright;
2283 if (indextra > nmaxslices * 4)
2284 printf(
"Woops!!!\n");
2288 delete[] boundaries;
2293 delete[] extra_left;
2294 delete[] extra_right;
2299 Error(
"SortAll",
"Volume %s: Cannot make slices on any axis",
fVolume->GetName());
2316 printf(
"Voxels for volume %s (nd=%i)\n",
fVolume->GetName(),
fVolume->GetNdaughters());
2320 Int_t nbytes = 1 + ((
fVolume->GetNdaughters() - 1) >> 3);
2325 for (
id = 0;
id <
fIbx;
id++) {
2326 printf(
"%15.10f\n",
fXb[
id]);
2327 if (
id == (
fIbx - 1))
2329 printf(
"slice %i : %i\n",
id,
fNsliceX[
id]);
2332 for (i = 0; i < nbytes; i++) {
2334 for (bit = 0; bit < 8; bit++) {
2335 if (
byte & (1 << bit))
2336 printf(
" %i ", 8 * i + bit);
2342 printf(
" extra_about_left = %i\n", nextra);
2344 printf(
" extra_about_right = %i\n", nextra);
2347 printf(
"%15.10f\n",
fXb[0]);
2348 for (
id = 0;
id < nd;
id++)
2351 printf(
"%15.10f\n",
fXb[1]);
2355 for (
id = 0;
id <
fIby;
id++) {
2356 printf(
"%15.10f\n",
fYb[
id]);
2357 if (
id == (
fIby - 1))
2359 printf(
"slice %i : %i\n",
id,
fNsliceY[
id]);
2362 for (i = 0; i < nbytes; i++) {
2364 for (bit = 0; bit < 8; bit++) {
2365 if (
byte & (1 << bit))
2366 printf(
" %i ", 8 * i + bit);
2371 printf(
" extra_about_left = %i\n", nextra);
2373 printf(
" extra_about_right = %i\n", nextra);
2376 printf(
"%15.10f\n",
fYb[0]);
2377 for (
id = 0;
id < nd;
id++)
2380 printf(
"%15.10f\n",
fYb[1]);
2385 for (
id = 0;
id <
fIbz;
id++) {
2386 printf(
"%15.10f\n",
fZb[
id]);
2387 if (
id == (
fIbz - 1))
2389 printf(
"slice %i : %i\n",
id,
fNsliceZ[
id]);
2392 for (i = 0; i < nbytes; i++) {
2394 for (bit = 0; bit < 8; bit++) {
2395 if (
byte & (1 << bit))
2396 printf(
" %i ", 8 * i + bit);
2402 printf(
" extra_about_left = %i\n", nextra);
2404 printf(
" extra_about_right = %i\n", nextra);
2407 printf(
"%15.10f\n",
fZb[0]);
2408 for (
id = 0;
id < nd;
id++)
2411 printf(
"%15.10f\n",
fZb[1]);
2428 if ((im == -1) || (im ==
fIbx - 1)) {
2429 printf(
"Voxel X limits: OUT\n");
2431 printf(
"Voxel X limits: %g %g\n",
fXb[im],
fXb[im + 1]);
2436 if ((im == -1) || (im ==
fIby - 1)) {
2437 printf(
"Voxel Y limits: OUT\n");
2439 printf(
"Voxel Y limits: %g %g\n",
fYb[im],
fYb[im + 1]);
2444 if ((im == -1) || (im ==
fIbz - 1)) {
2445 printf(
"Voxel Z limits: OUT\n");
2447 printf(
"Voxel Z limits: %g %g\n",
fZb[im],
fZb[im + 1]);
2458 fVolume->GetShape()->ComputeBBox();
2461 for (
Int_t i = 0; i < nd; i++) {
2462 vd =
fVolume->GetNode(i)->GetVolume();
int Int_t
Signed integer 4 bytes (int).
short Version_t
Class version identifier (short).
unsigned char UChar_t
Unsigned Character 1 byte (unsigned char).
unsigned int UInt_t
Unsigned integer 4 bytes (unsigned int).
bool Bool_t
Boolean (0=false, 1=true) (bool).
double Double_t
Double 8 bytes.
const char Option_t
Option string (const char).
externTGeoManager * gGeoManager
Buffer base class used for serializing objects.
virtual Version_t ReadVersion(UInt_t *start=nullptr, UInt_t *bcnt=nullptr, const TClass *cl=nullptr)=0
virtual void ReadFastArray(Bool_t *b, Int_t n)=0
virtual Int_t ReadClassBuffer(const TClass *cl, void *pointer, const TClass *onfile_class=nullptr)=0
virtual Int_t WriteClassBuffer(const TClass *cl, void *pointer)=0
Geometrical transformation package.
virtual void LocalToMaster(const Double_t *local, Double_t *master) const
convert a point by multiplying its column vector (x, y, z, 1) to matrix inverse
A node represent a volume positioned inside another.They store links to both volumes and to the TGeoM...
TGeoVolume * GetVolume() const
void SetOverlaps(Int_t *ovlp, Int_t novlp)
set the list of overlaps for this node (ovlp must be created with operator new)
static Bool_t IsSameWithinTolerance(Double_t a, Double_t b)
Check if two numbers differ with less than a tolerance.
virtual void ComputeBBox()=0
static Double_t Tolerance()
TGeoVolume, TGeoVolumeMulti, TGeoVolumeAssembly are the volume classes.
TGeoShape * GetShape() const
virtual Bool_t IsAssembly() const
Returns true if the volume is an assembly or a scaled assembly.
void Print(Option_t *option="") const override
Print the voxels.
TGeoVoxelFinder(const TGeoVoxelFinder &)=delete
Bool_t Union(Int_t n1, UChar_t *array1, TGeoStateInfo &td)
make union of older bits with new array printf("Union - one slice\n");
void SetNeedRebuild(Bool_t flag=kTRUE)
void Streamer(TBuffer &) override
Stream an object of class TGeoVoxelFinder.
virtual Int_t * GetCheckList(const Double_t *point, Int_t &nelem, TGeoStateInfo &td)
get the list of daughter indices for which point is inside their bbox
virtual Int_t * GetNextVoxel(const Double_t *point, const Double_t *dir, Int_t &ncheck, TGeoStateInfo &td)
get the list of new candidates for the next voxel crossed by current ray printf("### GetNextVoxel\n")...
~TGeoVoxelFinder() override
Destructor.
virtual void Voxelize(Option_t *option="")
Voxelize attached volume according to option If the volume is an assembly, make sure the bbox is comp...
void DaughterToMother(Int_t id, const Double_t *local, Double_t *master) const
convert a point from the local reference system of node id to reference system of mother volume
Bool_t Intersect(Int_t n1, UChar_t *array1, Int_t &nf, Int_t *result)
return the list of nodes corresponding to one array of bits
virtual Int_t * GetNextCandidates(const Double_t *point, Int_t &ncheck, TGeoStateInfo &td)
Returns list of new candidates in next voxel.
Bool_t GetIndices(const Double_t *point, TGeoStateInfo &td)
Get indices for current slices on x, y, z.
void SortAll(Option_t *option="")
order bounding boxes along x, y, z
Bool_t IsSafeVoxel(const Double_t *point, Int_t inode, Double_t minsafe) const
Computes squared distance from POINT to the voxel(s) containing node INODE.
Int_t * GetExtraY(Int_t islice, Bool_t left, Int_t &nextra) const
Return the list of extra candidates in a given Y slice compared to another (left or right).
void BuildVoxelLimits()
build the array of bounding boxes of the nodes inside
Int_t * GetVoxelCandidates(Int_t i, Int_t j, Int_t k, Int_t &ncheck, TGeoStateInfo &td)
get the list of candidates in voxel (i,j,k) - no check
void SetInvalid(Bool_t flag=kTRUE)
virtual void FindOverlaps(Int_t inode) const
create the list of nodes for which the bboxes overlap with inode's bbox
void PrintVoxelLimits(const Double_t *point) const
print the voxel containing point
Bool_t NeedRebuild() const
Int_t GetNcandidates(TGeoStateInfo &td) const
Bool_t MayOverlap(UInt_t i, UInt_t j) const
check if the aligned bounding boxes of nodes i and j overlap
virtual Double_t Efficiency()
Compute voxelization efficiency.
virtual void SortCrossedVoxels(const Double_t *point, const Double_t *dir, TGeoStateInfo &td)
get the list in the next voxel crossed by a ray
Int_t * GetExtraZ(Int_t islice, Bool_t left, Int_t &nextra) const
Return the list of extra candidates in a given Z slice compared to another (left or right).
Int_t * GetExtraX(Int_t islice, Bool_t left, Int_t &nextra) const
Return the list of extra candidates in a given X slice compared to another (left or right).
Int_t * GetValidExtra(Int_t *list, Int_t &ncheck, TGeoStateInfo &td)
Get extra candidates that are not contained in current check list.
Bool_t IntersectAndStore(Int_t n1, UChar_t *array1, TGeoStateInfo &td)
return the list of nodes corresponding to one array of bits
TGeoVoxelFinder()
Default constructor.
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.
void box(Int_t pat, Double_t x1, Double_t y1, Double_t x2, Double_t y2)
Long64_t LocMin(Long64_t n, const T *a)
Returns index of array with the minimum element.
Short_t Min(Short_t a, Short_t b)
Returns the smallest of a and b.
void Sort(Index n, const Element *a, Index *index, Bool_t down=kTRUE)
Sort the n elements of the array a of generic templated type Element.
Long64_t BinarySearch(Long64_t n, const T *array, T value)
Binary search in an array of n values to locate value.
Short_t Abs(Short_t d)
Returns the absolute value of parameter Short_t d.
Statefull info for the current geometry level.