161 static Int_t oseconds = 0;
164 static Int_t nrefresh = 0;
165 const char symbol[4] = {
'=',
'\\',
'|',
'/'};
166 char progress[11] =
" ";
167 Int_t ichar = icount%4;
178 if (ocurrent > osize) ocurrent=osize;
188 if (owatch && !last) {
191 hours = (
Int_t)(time/3600.);
193 minutes = (
Int_t)(time/60.);
195 seconds = (
Int_t)time;
197 if (oseconds==seconds) {
201 oneoftwo = !oneoftwo;
205 if (refresh && oneoftwo) {
211 Double_t percent = 100.0*ocurrent/osize;
213 if (nchar>10) nchar=10;
215 for (i=0; i<nchar; i++) progress[i] =
'=';
216 progress[nchar] = symbol[ichar];
217 for (i=nchar+1; i<10; i++) progress[i] =
' ';
221 if(size<10000) fprintf(stderr,
"%s [%10s] %4lld ", oname.
Data(), progress, ocurrent);
222 else if(size<100000) fprintf(stderr,
"%s [%10s] %5lld ",oname.
Data(), progress, ocurrent);
223 else fprintf(stderr,
"%s [%10s] %7lld ",oname.
Data(), progress, ocurrent);
224 if (time>0.) fprintf(stderr,
"[%6.2f %%] TIME %.2d:%.2d:%.2d %s\r", percent, hours, minutes, seconds, message.
Data());
225 else fprintf(stderr,
"[%6.2f %%] %s\r", percent, message.
Data());
226 if (refresh && oneoftwo) oname = nname;
236 fprintf(stderr,
"\n");
248 Info(
"CheckBoundaryErrors",
"Top volume is %s",tvol->
GetName());
262 TTree *bug=
new TTree(
"bug",
"Geometrical problems");
263 bug->
Branch(
"pos",xyz,
"xyz[3]/D");
264 bug->
Branch(
"dir",dir,
"dir[3]/D");
265 bug->
Branch(
"push",&relp,
"push/D");
266 bug->
Branch(
"path",&path,
"path/C");
267 bug->
Branch(
"cdir",&cdir,
"cdir/C");
269 dl[0] = box->
GetDX();
270 dl[1] = box->
GetDY();
271 dl[2] = box->
GetDZ();
276 dl[0] = dl[1] = dl[2] = radius;
279 TH1F *hnew =
new TH1F(
"hnew",
"Precision pushing",30,-20.,10.);
280 TH1F *hold =
new TH1F(
"hold",
"Precision pulling", 30,-20.,10.);
281 TH2F *hplotS =
new TH2F(
"hplotS",
"Problematic points",100,-dl[0],dl[0],100,-dl[1],dl[1]);
287 Long_t n100 = ntracks/100;
289 printf(
"Random box : %f, %f, %f, %f, %f, %f\n", ori[0], ori[1], ori[2], dl[0], dl[1], dl[2]);
290 printf(
"Start... %i points\n", ntracks);
294 while (igen<ntracks) {
306 if (n100 && !(igen%n100))
319 for(
Int_t i=0; i<30; ++i) {
321 for(
Int_t j=0; j<3; ++j) nxyz[j]=xyz[j]+step*(1.+relp)*dir[j];
328 Double_t dotp = norm[0]*dir[0]+norm[1]*dir[1]+norm[2]*dir[2];
329 printf(
"Forward error i=%d p=%5.4f %5.4f %5.4f s=%5.4f dot=%5.4f path=%s\n",
330 i,xyz[0],xyz[1],xyz[2],step,dotp,path);
332 strncpy(cdir,
"Forward",10);
340 for(
Int_t i=0; i<30; ++i) {
342 for(
Int_t j=0; j<3; ++j) nxyz[j]=xyz[j]+step*(1.+relp)*dir[j];
349 Double_t dotp = norm[0]*dir[0]+norm[1]*dir[1]+norm[2]*dir[2];
350 printf(
"Backward error i=%d p=%5.4f %5.4f %5.4f s=%5.4f dot=%5.4f path=%s\n",
351 i,xyz[0],xyz[1],xyz[2],step,dotp,path);
352 strncpy(cdir,
"Backward",10);
361 if (itry) printf(
"CPU time/point = %5.2emus: Real time/point = %5.2emus\n",
370 if (itry) printf(
"Effic = %3.1f%%\n",(100.*igen)/itry);
379 new TCanvas(
"c3",
"Plot",600,600);
380 hplotS->
Draw(
"cont0");
407 printf(
"nentries %d\n",nentries);
411 printf(
"%-9s error push=%g p=%5.4f %5.4f %5.4f s=%5.4f dot=%5.4f path=%s\n",
412 cdir,push,xyz[0],xyz[1],xyz[2],1.,1.,path);
415 if (icheck>=nentries)
return;
419 printf(
"%-9s error push=%g p=%5.4f %5.4f %5.4f s=%5.4f dot=%5.4f path=%s\n",
420 cdir,push,xyz[0],xyz[1],xyz[2],1.,1.,path);
426 for (
Int_t j=0; j<3; j++) nxyz[j]=xyz[j]+step*(1.+0.1*push)*dir[j];
429 printf(
" -> next = %s push=%g change=%d\n", next->
GetName(),
push, (
UInt_t)change);
444 for (
Int_t j=0; j<3; j++) nxyz[j]=xyz[j]+step*dir[j];
490 printf(
"====================================================================\n");
491 printf(
"STAGE 1: Overlap checking by sampling within 10 microns\n");
492 printf(
"====================================================================\n");
496 printf(
"====================================================================\n");
497 printf(
"STAGE 2: Global overlap/extrusion checking within 10 microns\n");
498 printf(
"====================================================================\n");
502 if (!checkcrossings) {
518 printf(
"====================================================================\n");
519 printf(
"STAGE 3: Propagating %i tracks starting from vertex\n and conting number of boundary crossings...\n", ntracks);
520 printf(
"====================================================================\n");
524 memset(point, 0, 3*
sizeof(
Double_t));
525 if (vertex) memcpy(point, vertex, 3*
sizeof(
Double_t));
529 for (i=0; i<ntracks; i++) {
540 printf(
"No boundary crossed\n");
548 printf(
"Time for crossing %i boundaries: %g [ms]\n", nbound, time1);
549 printf(
"Time per track for full geometry traversal: %g [ms], per crossing: %g [ms]\n", time2, time3);
553 printf(
"====================================================================\n");
554 printf(
"STAGE 4: How much navigation time per volume per next+safety call\n");
555 printf(
"====================================================================\n");
565 strncpy(volname, vol->
GetName(),15);
569 while ((current=next())) {
570 vol = current->GetVolume();
572 if (
fFlags[uid])
continue;
576 strncpy(volname, vol->
GetName(),15);
587 TFile *
f =
new TFile(
"statistics.root",
"RECREATE");
588 TH1F *
h =
new TH1F(
"h",
"number of boundary crossings per volume",3,0,3);
594 for (i=0; i<nuid; i++) {
600 time_tot_pertrack /= ntracks;
606 TCanvas *
c2 =
new TCanvas(
"c3",
"time spent per volume in navigation",10,10,900,500);
609 TH2F *h2 =
new TH2F(
"h2",
"time per FNB call vs. ndaughters", 100, 0,100,100,0,15);
612 TH1F *
h1 =
new TH1F(
"h1",
"percent of time spent per volume",3,0,3);
616 for (i=0; i<nuid; i++) {
619 value =
fVal1[i]*
fVal2[i]/ntracks/time_tot_pertrack;
655 printf(
"Error in trying to cross boundary of %s\n", current->
GetName());
701 Error(
"SetNmeshPoints",
"Cannot allow less than 1000 points for checking - set to 1000");
721 Double_t point[3], dir[3], lpt[3], ldir[3];
728 for (
Int_t i=0; i<1000000; i++) {
768 printf(
"Time for volume %s (assemb=%d): %g [ms] ndaughters=%d ncross=%d\n", vol->
GetName(), vol->
IsAssembly(), time_per_track, vol->
GetNdaughters(), ncrossings);
769 return time_per_track;
803 Int_t nelem1, nelem2;
804 Int_t dim1=1000, dim2=1000;
805 if ((startx==0) && (starty==0) && (startz==0)) eps=1
E-3;
806 start[0] = startx+eps;
807 start[1] = starty+eps;
808 start[2] = startz+eps;
812 Int_t ist1, ist2, ifound;
813 for (i=0; i<nrays; i++) {
815 if ((i%n10) == 0) printf(
"%i percent\n",
Int_t(100*i/nrays));
825 array1 =
ShootRay(&start[0], dir[0], dir[1], dir[2], array1, nelem1, dim1);
826 if (!nelem1)
continue;
828 memcpy(&end[0], &array1[3*(nelem1-1)], 3*
sizeof(
Double_t));
831 array2 =
ShootRay(&end[0], -dir[0], -dir[1], -dir[2], array2, nelem2, dim2, &start[0]);
833 printf(
"#### NOTHING BACK ###########################\n");
834 for (j=0; j<nelem1; j++) {
836 pm->
SetNextPoint(array1[3*j], array1[3*j+1], array1[3*j+2]);
842 for (j=0; j<k; j++) {
843 memcpy(&dummy[0], &array2[3*j], 3*
sizeof(
Double_t));
844 memcpy(&array2[3*j], &array2[3*(nelem2-1-j)], 3*
sizeof(
Double_t));
845 memcpy(&array2[3*(nelem2-1-j)], &dummy[0], 3*
sizeof(
Double_t));
848 if (nelem1!=nelem2) printf(
"### DIFFERENT SIZES : nelem1=%i nelem2=%i ##########\n", nelem1, nelem2);
852 dx = array1[3*ist1]-array2[3*ist2];
853 dy = array1[3*ist1+1]-array2[3*ist2+1];
854 dz = array1[3*ist1+2]-array2[3*ist2+2];
855 dw = dx*dir[0]+dy*dir[1]+dz*dir[2];
864 printf(
"### NOT MATCHING %i f:(%f, %f, %f) b:(%f %f %f) DCLOSE=%f\n", ist2, array1[3*ist1], array1[3*ist1+1], array1[3*ist1+2], array2[3*ist2], array2[3*ist2+1], array2[3*ist2+2],dw);
866 pm->
SetNextPoint(array2[3*ist2], array2[3*ist2+1], array2[3*ist2+2]);
875 while ((ist1<nelem1-1) && (ist2<nelem2)) {
881 dx = array1[3*ist1+3]-array1[3*ist1];
882 dy = array1[3*ist1+4]-array1[3*ist1+1];
883 dz = array1[3*ist1+5]-array1[3*ist1+2];
885 dwmin = dx+dir[0]+dy*dir[1]+dz*dir[2];
886 while (ist2<nelem2) {
888 dx = array2[3*ist2]-array1[3*ist1];
889 dy = array2[3*ist2+1]-array1[3*ist1+1];
890 dz = array2[3*ist2+2]-array1[3*ist1+2];
891 dw = dx+dir[0]+dy*dir[1]+dz*dir[2];
912 pm->
SetNextPoint(array2[3*ist2], array2[3*ist2+1], array2[3*ist2+2]);
913 printf(
"### EXTRA BOUNDARY %i : %s found at DCLOSE=%f\n", ist2,
fGeoManager->
GetPath(), dw);
923 pm->
SetNextPoint(array2[3*ist1+3], array2[3*ist1+4], array2[3*ist1+5]);
924 printf(
"### BOUNDARY MISSED BACK #########################\n");
957 for (
Int_t i=0; i<numPoints; i++) {
959 rsq = points[j]*points[j]+points[j+1]*points[j+1];
960 if (rsq < 1.
e-10)
continue;
961 points[k] = points[j];
962 points[k+1] = points[j+1];
963 points[k+2] = points[j+2];
983 Bool_t extrude, isextrusion, isoverlapping;
999 if (shape1->GetPointsOnSegments(
fNmeshPoints, points1)) {
1002 shape1->SetPoints(points1);
1015 if (shape2->GetPointsOnSegments(
fNmeshPoints, points2)) {
1018 shape2->SetPoints(points2);
1031 for (ip=0; ip<numPoints2; ip++) {
1032 memcpy(local, &points2[3*ip], 3*
sizeof(
Double_t));
1036 extrude = !shape1->Contains(local);
1038 safety = shape1->Safety(local,
kFALSE);
1039 if (safety<ovlp) extrude=
kFALSE;
1043 isextrusion =
kTRUE;
1054 for (ip=0; ip<numPoints1; ip++) {
1055 memcpy(local, &points1[3*ip], 3*
sizeof(
Double_t));
1056 if (local[0]<1
e-10 && local[1]<1
e-10)
continue;
1059 extrude = shape2->Contains(local1);
1062 safety = shape1->Safety(local,
kTRUE);
1066 safety = shape2->Safety(local1,
kTRUE);
1067 if (safety<ovlp) extrude=
kFALSE;
1072 isextrusion =
kTRUE;
1089 for (ip=0; ip<numPoints1; ip++) {
1090 memcpy(local, &points1[3*ip], 3*
sizeof(
Double_t));
1091 if (local[0]<1
e-10 && local[1]<1
e-10)
continue;
1094 overlap = shape2->Contains(local);
1096 safety = shape2->Safety(local,
kTRUE);
1097 if (safety<ovlp) overlap=
kFALSE;
1100 if (!isoverlapping) {
1101 isoverlapping =
kTRUE;
1112 for (ip=0; ip<numPoints2; ip++) {
1113 memcpy(local, &points2[3*ip], 3*
sizeof(
Double_t));
1114 if (local[0]<1
e-10 && local[1]<1
e-10)
continue;
1117 overlap = shape1->Contains(local);
1119 safety = shape1->Safety(local,
kTRUE);
1120 if (safety<ovlp) overlap=
kFALSE;
1123 if (!isoverlapping) {
1124 isoverlapping =
kTRUE;
1146 if (!voxels)
return;
1159 Int_t *check_list = 0;
1165 Int_t id=0, id0=0, id1=0;
1177 while (ipoint < npoints) {
1184 if (itry>10000 && !ipoint) {
1185 Error(
"CheckOverlapsBySampling",
"No point inside volume!!! - aborting");
1194 if (!check_list || ncheck<2)
continue;
1195 for (
id=0;
id<ncheck;
id++) {
1196 id0 = check_list[
id];
1203 if (!incrt)
continue;
1225 while (cindex >= 0) {
1235 while (cindex >= 0) {
1243 &mat1,&mat2,
kTRUE, safe);
1244 flags[nd*id1+id0] = nodeovlp;
1253 if (flags)
delete [] flags;
1254 if (!novlps)
return;
1258 Info(
"CheckOverlapsBySampling",
"#Found %d overlaps adding-up to %g +/- %g [cm3] for daughters of %s",
1259 novlps, capacity, err*capacity, vol->
GetName());
1277 while ((node=next1())) {
1289 if (nd<2)
return nchecks;
1291 if (!vox)
return nchecks;
1299 for (
id=0;
id<nd;
id++) {
1304 if (!ovlps)
continue;
1305 for (ko=0; ko<novlp; ko++) {
1307 if (io<=
id)
continue;
1314 while ((node=next1())) {
1318 while ((node1=next2())) {
1334 while ((node1=next2())) {
1370 if (!npoints) npoints = 1000000;
1387 while ((node=next1())) {
1401 while ((nodecheck=next1.
GetNode(level--))) {
1422 Warning(
"CheckOverlaps",
"Volume %s with %i daughters but not voxelized", vol->
GetName(),nd);
1436 for (
id=0;
id<nd;
id++) {
1441 if (!ovlps)
continue;
1444 for (ko=0; ko<novlp; ko++) {
1446 if (io<=
id)
continue;
1458 while ((node=next1())) {
1465 while ((node1=next2())) {
1475 while ((nodecheck=next2.
GetNode(level--))) {
1481 while ((nodecheck=next1.
GetNode(level--))) {
1509 while ((nodecheck=next1.
GetNode(level--))) {
1529 while ((node1=next2())) {
1539 while ((nodecheck=next2.
GetNode(level--))) {
1601 printf(
"=== Check current point : (%g, %g, %g) ===\n", point[0], point[1], point[2]);
1607 printf(
"Safety radius : %f\n", close);
1654 Error(
"CheckShape",
"Test number %d not existent", testNo);
1676 const Int_t kNtracks = 1000;
1677 Int_t n10 = nsamples/10;
1684 TH1D *hist =
new TH1D(
"hTest1",
"Residual distance from inside/outside",200,-20, 0);
1692 while (itot<nsamples) {
1702 if ((itot%n10) == 0) printf(
"%i percent\n",
Int_t(100*itot/nsamples));
1704 for (i=0; i<kNtracks; i++) {
1717 printf(
"DistFromInside: (%19.15f, %19.15f, %19.15f, %19.15f, %19.15f, %19.15f) %f/%f(max)\n",
1718 point[0],point[1],point[2],dir[0],dir[1],dir[2], d1,dmove);
1723 pmfrominside->
SetNextPoint(point[0],point[1],point[2]);
1724 for (j=0; j<3; j++) pnew[j] = point[j] + d1*dir[j];
1726 pmfrominside->
Draw();
1734 if (d1+dnext<dmax) dmove = d1+0.5*
dnext;
1736 for (j=0; j<3; j++) {
1737 pnew[j] = point[j] + dmove*dir[j];
1742 delta = dmove-d1-d2;
1747 printf(
"Error: (%19.15f, %19.15f, %19.15f, %19.15f, %19.15f, %19.15f) d1=%f d2=%f dmove=%f\n",
1748 point[0],point[1],point[2],dir[0],dir[1],dir[2], d1,d2,dmove);
1750 printf(
" (*)DistFromOutside(%19.15f, %19.15f, %19.15f, %19.15f, %19.15f, %19.15f) dnext = %f\n",
1755 printf(
" DistFromOutside(%19.15f, %19.15f, %19.15f, %19.15f, %19.15f, %19.15f) dnext = %f\n",
1756 point[0]+d1*dir[0],point[1]+d1*dir[1], point[2]+d1*dir[2], dir[0],dir[1],dir[2],dnext);
1758 printf(
" DistFromOutside(%19.15f, %19.15f, %19.15f, %19.15f, %19.15f, %19.15f) = %f\n",
1759 pnew[0],pnew[1],pnew[2],dnew[0],dnew[1],dnew[2], d2);
1764 pmfrominside->
SetNextPoint(point[0],point[1],point[2]);
1765 for (j=0; j<3; j++) point[j] += d1*dir[j];
1766 pmfrominside->
SetNextPoint(point[0],point[1],point[2]);
1767 pmfrominside->
Draw();
1774 for (j=0; j<3; j++) pnew[j] += d2*dnew[j];
1775 if (d2<1E10) pmfromoutside->
SetNextPoint(pnew[0],pnew[1],pnew[2]);
1776 pmfromoutside->
Draw();
1785 printf(
"Error DistFromInside(%19.15f, %19.15f, %19.15f, %19.15f, %19.15f, %19.15f) d1=%f d1p=%f\n",
1786 pnew[0],pnew[1],pnew[2],dnew[0],dnew[1],dnew[2],d1,dnext);
1791 pmfrominside->
SetNextPoint(point[0],point[1],point[2]);
1792 for (j=0; j<3; j++) point[j] += d1*dir[j];
1793 pmfrominside->
SetNextPoint(point[0],point[1],point[2]);
1794 pmfrominside->
Draw();
1801 for (j=0; j<3; j++) pnew[j] += dnext*dnew[j];
1802 if (d2<1E10) pmfromoutside->
SetNextPoint(pnew[0],pnew[1],pnew[2]);
1803 pmfromoutside->
Draw();
1812 new TCanvas(
"Test01",
"Residuals DistFromInside/Outside", 800, 600);
1828 const Int_t kNtracks = 1000;
1829 Int_t n10 = nsamples/10;
1841 while (itot<nsamples) {
1850 if ((itot%n10) == 0) printf(
"%i percent\n",
Int_t(100*itot/nsamples));
1852 for (i=0; i<kNtracks; i++) {
1861 printf(
"Error safety (%19.15f, %19.15f, %19.15f, %19.15f, %19.15f, %19.15f) safe=%f dist=%f\n",
1862 point[0],point[1],point[2], dir[0], dir[1], dir[2], safe, dist);
1870 pm1->
SetNextPoint(point[0]+safe*dir[0],point[1]+safe*dir[1],point[2]+safe*dir[2]);
1876 pm2->
SetNextPoint(point[0]+dist*dir[0],point[1]+dist*dir[1],point[2]+dist*dir[2]);
1899 const Int_t kNtracks = 1000;
1900 Int_t n10 = nsamples/10;
1901 Int_t itot = 0, errcnt = 0, errsame=0;
1907 while (itot<nsamples) {
1913 inside = shape->
Contains(&spoint[3*itot]);
1922 Double_t point[3],newpoint[3], oldpoint[3];
1935 for (itot = 0; itot<nsamples; itot++) {
1937 if ((itot%n10) == 0) printf(
"%i percent\n",
Int_t(100*itot/nsamples));
1939 oldnorm[0] = oldnorm[1] = oldnorm[2] = 0.;
1941 for (
Int_t j=0; j<3; j++) {
1942 oldpoint[j] = point[j] = spoint[3*itot+j];
1943 olddir[j] = dir[j] = sdir[3*itot+j];
1945 for (i=0; i<kNtracks; i++) {
1946 if (errcnt>0)
break;
1948 for (
Int_t j=0; j<3; j++) {
1949 newpoint[j] = point[j] + dist*dir[j];
1953 dot = olddir[0]*oldnorm[0]+olddir[1]*oldnorm[1]+ olddir[2]*oldnorm[2];
1956 printf(
"Error point outside (%19.15f, %19.15f, %19.15f, %19.15f, %19.15f, %19.15f) =%g olddist=%g\n",
1957 point[0],point[1],point[2], dir[0], dir[1], dir[2], dist, olddist);
1958 printf(
" old point: (%19.15f, %19.15f, %19.15f, %19.15f, %19.15f, %19.15f)\n",
1959 oldpoint[0],oldpoint[1],oldpoint[2], olddir[0], olddir[1], olddir[2]);
1968 pm1->
SetNextPoint(oldpoint[0],oldpoint[1],oldpoint[2]);
1975 printf(
"Error DistFromInside(%19.15f, %19.15f, %19.15f, %19.15f, %19.15f, %19.15f) =%g olddist=%g\n",
1976 point[0],point[1],point[2], dir[0], dir[1], dir[2], dist, olddist);
1977 printf(
" new norm: (%g, %g, %g)\n", newnorm[0], newnorm[1], newnorm[2]);
1978 printf(
" old point: (%19.15f, %19.15f, %19.15f, %19.15f, %19.15f, %19.15f)\n",
1979 oldpoint[0],oldpoint[1],oldpoint[2], olddir[0], olddir[1], olddir[2]);
1980 printf(
" old norm: (%g, %g, %g)\n", oldnorm[0], oldnorm[1], oldnorm[2]);
1989 pm1->
SetNextPoint(oldpoint[0],oldpoint[1],oldpoint[2]);
1995 for (
Int_t j=0; j<3; j++) {
1996 oldpoint[j] = point[j];
1997 point[j] += dist*dir[j];
2002 printf(
"Error safety (%19.15f, %19.15f, %19.15f) safe=%g\n",
2003 point[0],point[1],point[2], safe);
2016 memcpy(oldnorm, norm, 3*
sizeof(
Double_t));
2017 memcpy(olddir, dir, 3*
sizeof(
Double_t));
2024 ndotd = dir[0]*norm[0]+dir[1]*norm[1]+dir[2]*norm[2];
2027 if ((itot%10) == 0) pm2->
SetNextPoint(point[0],point[1],point[2]);
2048 TH2F *hist =
new TH2F(
"lego", option, nphi, phimin, phimax, ntheta, themin, themax);
2057 Int_t ntot = ntheta * nphi;
2058 Int_t n10 = ntot/10;
2059 Int_t igen = 0, iloop=0;
2060 printf(
"=== Lego plot sph. => nrays=%i\n", ntot);
2061 for (i=1; i<=nphi; i++) {
2062 for (j=1; j<=ntheta; j++) {
2065 if ((igen%n10) == 0) printf(
"%i percent\n",
Int_t(100*igen/ntot));
2070 start[0] = start[1] = start[2] = 1
E-3;
2096 if (iloop>1000) printf(
"%i steps\n", iloop);
2100 if (endnode==0 && step>1E10)
break;
2102 startnode = endnode;
2113 hist->
Fill(phi, theta, x);
2140 printf(
"Random box : %f, %f, %f\n", dx, dy, dz);
2142 printf(
"Start... %i points\n", npoints);
2146 Int_t n10 = npoints/10;
2148 while (igen<npoints) {
2155 if ((igen%n10) == 0) printf(
"%i percent\n",
Int_t(100*igen/npoints));
2158 if (!node)
continue;
2164 if ((ic<0) || (ic>=128)) ic = 1;
2171 pm->
AddAt(marker, ic);
2176 printf(
"Number of visible points : %i\n", i);
2178 printf(
"efficiency : %g\n", ratio);
2181 if (marker) marker->
Draw(
"SAME");
2185 printf(
"---Make them visible with : gGeoManager->GetTopVolume()->VisibleDaughters();\n");
2212 printf(
"Start... %i rays\n", nrays);
2216 Int_t ipoint, inull;
2229 while (itot<nrays) {
2234 if ((itot%n10) == 0) printf(
"%i percent\n",
Int_t(100*itot/nrays));
2262 line->
SetPoint(ipoint++, start[0], start[1], start[2]);
2282 line->
SetPoint(ipoint, point[0], point[1], point[2]);
2283 if (!vis2 && check_norm) {
2287 normline->
SetPoint(0, point[0], point[1], point[2]);
2288 normline->
SetPoint(1, point[0]+normal[0]*normlen,
2289 point[1]+normal[1]*normlen,
2290 point[2]+normal[2]*normlen);
2300 line->
SetPoint(ipoint++, point[0], point[1], point[2]);
2306 normline->
SetPoint(0, point[0], point[1], point[2]);
2307 normline->
SetPoint(1, point[0]+normal[0]*normlen,
2308 point[1]+normal[1]*normlen,
2309 point[2]+normal[2]*normlen);
2312 if (!random) pm->
Add(normline);
2319 if (line) line->
Draw(
"SAME");
2321 printf(
"number of segments : %i\n", i);
2341 if (!node) {dist=-1;
return 0;}
2343 if (strlen(g3path)) hasg3 =
kTRUE;
2356 eps[0] = epsil; eps[1]=epsil; eps[2]=epsil;
2363 index = spath.
Index(
"/", index+1);
2365 name = spath(0, index);
2366 if (strstr(g3path, name.
Data())) {
2373 if (strlen(common.
Data())) {
2384 if (!nodegeo)
return 0;
2385 if (!nodeg3)
return 0;
2389 for (
Int_t i=0; i<npoints; i++) {
2390 xyz[0] = point[0] - eps[0] + 2*eps[0]*
gRandom->
Rndm();
2391 xyz[1] = point[1] - eps[1] + 2*eps[1]*
gRandom->
Rndm();
2392 xyz[2] = point[2] - eps[2] + 2*eps[2]*
gRandom->
Rndm();
2395 dist1 =
TMath::Sqrt((xyz[0]-point[0])*(xyz[0]-point[0])+
2396 (xyz[1]-point[1])*(xyz[1]-point[1])+(xyz[2]-point[2])*(xyz[2]-point[2]));
2408 if (!node_close) dist = -1;
2413 memcpy(&point[0], pointg, 3*
sizeof(
Double_t));
2414 for (
Int_t i=0; i<npoints; i++) {
2421 dist1 =
TMath::Sqrt((point[0]-pointg[0])*(point[0]-pointg[0])+
2422 (point[1]-pointg[1])*(point[1]-pointg[1])+(point[2]-pointg[2])*(point[2]-pointg[2]));
2426 memcpy(&closest[0], pointg, 3*
sizeof(
Double_t));
2436 if (!node_close) dist=-1;
2450 printf(
"empty input array\n");
2468 if (step>1E10)
return array;
2473 forward = dirx*(endpoint[0]-point[0])+diry*(endpoint[1]-point[1])+dirz*(endpoint[2]-point[2]);
2482 memcpy(temparray, array, 3*dim*
sizeof(
Double_t));
2487 memcpy(&array[3*nelem], point, 3*
sizeof(
Double_t));
2491 if (endnode==0 && step>1E10) {
2510 if (istep>0) printf(
"%i steps\n", istep);
2513 memcpy(temparray, array, 3*dim*
sizeof(
Double_t));
2518 memcpy(&array[3*nelem], point, 3*
sizeof(
Double_t));
2521 is_entering =
kTRUE;
2538 Bool_t recheck = !strcmp(option,
"RECHECK");
2539 if (recheck) printf(
"RECHECK\n");
2549 printf(
"Random box : %f, %f, %f\n", dx, dy, dz);
2552 for (i=0; i<npoints; i++) {
2558 printf(
"Generation time :\n");
2562 printf(
"Start... %i points\n", npoints);
2564 for (i=0; i<npoints; i++) {
2570 if (node1 != node) {
2571 printf(
"Difference for x=%g y=%g z=%g\n", xyz[3*i], xyz[3*i+1], xyz[3*i+2]);
2572 printf(
" from top : %s\n", node->
GetName());
2589 printf(
"Checking overlaps for path :\n");
2594 Int_t npoints = 1000000;
2622 if (!shape->
Contains(point))
continue;
2636 ntpl->
Fill(xmin,ymin,zmin);
2637 ntpl->
Fill(xmax,ymin,zmin);
2638 ntpl->
Fill(xmin,ymax,zmin);
2639 ntpl->
Fill(xmax,ymax,zmin);
2640 ntpl->
Fill(xmin,ymin,zmax);
2641 ntpl->
Fill(xmax,ymin,zmax);
2642 ntpl->
Fill(xmin,ymax,zmax);
2643 ntpl->
Fill(xmax,ymax,zmax);
2644 ntpl->
Draw(
"z:y:x");
2651 printf(
"using FindNode...\n");
2652 for (
Int_t j=0; j<npoints; j++) {
2659 markthis->
SetNextPoint(xyz[3*j], xyz[3*j+1], xyz[3*j+2]);
2665 if (ic >= 128) ic = 0;
2670 pm->
AddAt(marker, ic);
2673 marker->
SetNextPoint(xyz[3*j], xyz[3*j+1], xyz[3*j+2]);
2675 if (overlaps->
IndexOf(node) < 0) overlaps->
Add(node);
2683 markthis->
Draw(
"SAME");
2687 printf(
"list of overlapping nodes :\n");
2691 else printf(
"%s ONLY\n", node->
GetName());
2693 }
else printf(
"No overlaps\n");
2708 if (!nmat)
return 0;
2710 memset(nin, 0, nmat*
sizeof(
Int_t));
2737 if (!node)
continue;
2740 if (indmat<0)
continue;
2743 if ((iin%100000)==0 || igen>1E8) {
2746 for (indmat=0; indmat<nmat; indmat++) {
2749 if (dens<1
E-2) dens=0;
2751 weight += dens*
Double_t(nin[indmat]);
2752 sigma += dens*dens*nin[indmat];
2758 if (eps<precision || igen>1E8) {
2760 printf(
"=== Weight of %s : %g +/- %g [kg]\n",
2765 if (isverbose && eps<0.5*eps0) {
2766 printf(
"%8dK: %14.7g kg %g %%\n",
2767 igen/1000, weight, eps*100);
2793 for (
Int_t i=0; i<npoints; i++) {
2795 if (!shape->
Contains(point))
continue;
2797 if (!checklist)
continue;
2798 if (!ncheck)
continue;
2799 for (
Int_t id=0;
id<ncheck;
id++) {
2800 node = vol->
GetNode(checklist[
id]);
void SetTopVisible(Bool_t vis=kTRUE)
make top volume visible on screen
Statefull info for the current geometry level.
Bool_t IsEntering() const
virtual const char * GetName() const
Returns name of object.
virtual void SetLineWidth(Width_t lwidth)
Set the line width.
virtual ~TGeoChecker()
Destructor.
virtual Int_t Fill(Double_t x)
Increment bin with abscissa X by 1.
void TestOverlaps(const char *path)
— Geometry overlap checker based on sampling.
double dist(Rotation3D const &r1, Rotation3D const &r2)
TGeoNode * InitTrack(const Double_t *point, const Double_t *dir)
Initialize current point and current direction vector (normalized) in MARS.
void GetPath(TString &path) const
Returns the path for the current node.
virtual void Info(const char *method, const char *msgfmt,...) const
Issue info message.
Double_t RealTime()
Stop the stopwatch (if it is running) and return the realtime (in seconds) passed between the start a...
The manager class for any TGeo geometry.
Double_t * ShootRay(Double_t *start, Double_t dirx, Double_t diry, Double_t dirz, Double_t *array, Int_t &nelem, Int_t &dim, Double_t *enpoint=0) const
Shoot one ray from start point with direction (dirx,diry,dirz).
Bool_t IsSameLocation(Double_t x, Double_t y, Double_t z, Bool_t change=kFALSE)
Checks if point (x,y,z) is still in the current node.
void Start(Bool_t reset=kTRUE)
Start the stopwatch.
void SetCurrentDirection(Double_t *dir)
virtual void LabelsOption(Option_t *option="h", Option_t *axis="X")
Set option(s) to draw axis with labels.
virtual void Voxelize(Option_t *option="")
Voxelize attached volume according to option If the volume is an assembly, make sure the bbox is comp...
virtual void ComputeNormal(const Double_t *point, const Double_t *dir, Double_t *norm)=0
void Print(Option_t *option="") const
Print the real and cpu time passed between the start and stop events.
virtual Double_t GetDX() const
Double_t * fVal2
Array of number of crossings per volume.
TGeoOverlap * MakeCheckOverlap(const char *name, TGeoVolume *vol1, TGeoVolume *vol2, TGeoMatrix *mat1, TGeoMatrix *mat2, Bool_t isovlp, Double_t ovlp)
Check if the 2 non-assembly volume candidates overlap/extrude. Returns overlap object.
TGeoNode * fSelectedNode
Timer.
virtual Double_t GetDensity() const
Bool_t IsOverlapping() const
Geometrical transformation package.
Double_t Safety(Bool_t inside=kFALSE)
Compute safe distance from the current point.
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
TGeoStateInfo * GetInfo()
Get next state info pointer.
TGeoNode * GetNode(const char *name) const
get the pointer to a daughter node
void CdUp()
Go one level up in geometry.
void CheckOverlaps(Double_t ovlp=0.1, Option_t *option="")
Check all geometry for illegal overlaps within a limit OVLP.
R__EXTERN TStyle * gStyle
void ShapeNormal(TGeoShape *shape, Int_t nsamples, Option_t *option)
Check of validity of the normal for a given shape.
void CleanPoints(Double_t *points, Int_t &numPoints) const
Number of points on mesh to be checked.
virtual Int_t Fill()
Fill all branches.
TGeoMaterial * GetMaterial() const
THist< 1, float, THistStatContent, THistStatUncertainty > TH1F
virtual void CheckBoundaryErrors(Int_t ntracks=1000000, Double_t radius=-1.)
Check pushes and pulls needed to cross the next boundary with respect to the position given by FindNe...
#define lnext(otri1, otri2)
TGeoVolume, TGeoVolumeMulti, TGeoVolumeAssembly are the volume classes.
A ROOT file is a suite of consecutive data records (TKey instances) with a well defined format...
TVirtualPad * cd(Int_t subpadnumber=0)
Set current canvas & pad.
TH2F * LegoPlot(Int_t ntheta=60, Double_t themin=0., Double_t themax=180., Int_t nphi=90, Double_t phimin=0., Double_t phimax=360., Double_t rmin=0., Double_t rmax=9999999, Option_t *option="")
Generate a lego plot fot the top volume, according to option.
void Skip()
Stop iterating the current branch.
virtual void Draw(Option_t *option="")
draw top volume according to option
virtual TObject * Get(const char *namecycle)
Return pointer to object identified by namecycle.
TGeoVolume * GetVolume(const char *name) const
Search for a named volume. All trailing blanks stripped.
Class describing translations.
static Int_t GetVerboseLevel()
Set verbosity level (static function).
static void SetVerboseLevel(Int_t vl)
Return current verbosity level (static function).
Ssiz_t Index(const char *pat, Ssiz_t i=0, ECaseCompare cmp=kExact) const
void InspectShape() const
virtual Int_t GetEntry(Long64_t entry=0, Int_t getall=0)
Read all branches of entry and return total number of bytes read.
Matrix class used for computing global transformations Should NOT be used for node definition...
tomato 1-D histogram with a float per channel (see TH1 documentation)}
Base class describing materials.
void Multiply(const TGeoMatrix *right)
multiply to the right with an other transformation if right is identity matrix, just return ...
void MasterToLocal(const Double_t *master, Double_t *local) const
Double_t CpuTime()
Stop the stopwatch (if it is running) and return the cputime (in seconds) passed between the start an...
virtual void DrawOnly(Option_t *option="")
draw only this volume
Short_t Min(Short_t a, Short_t b)
void ToLower()
Change string to lower-case.
void VisibleDaughters(Bool_t vis=kTRUE)
set visibility for daughters
A 3-dimensional polyline.
TGeoVolume * GetMasterVolume() const
TGeoNodeCache * GetCache() const
TGeoNode * GetNode(Int_t level) const
Returns current node at a given level.
void Score(TGeoVolume *, Int_t, Double_t)
Score a hit for VOL.
void Reset(TGeoVolume *top=0)
Resets the iterator for volume TOP.
TObject * At(Int_t idx) const
void box(Int_t pat, Double_t x1, Double_t y1, Double_t x2, Double_t y2)
Int_t PropagateInGeom(Double_t *, Double_t *)
Propagate from START along DIR from boundary to boundary until exiting geometry.
TGeoVoxelFinder * GetVoxels() const
Getter for optimization structure.
virtual void SetTopMargin(Float_t topmargin)
Set Pad top margin in fraction of the pad height.
Bool_t NeedRebuild() const
TList * GetListOfMaterials() const
static void AddDirectory(Bool_t add=kTRUE)
Sets the flag controlling the automatic add of histograms in memory.
virtual void PrintInfo() const
Print some info.
static Double_t Tolerance()
void ResetState()
Reset current state flags.
Int_t GetNdaughters() const
Int_t fNmeshPoints
Number of checks for current volume.
TGeoVolume * MakeSphere(const char *name, TGeoMedium *medium, Double_t rmin, Double_t rmax, Double_t themin=0, Double_t themax=180, Double_t phimin=0, Double_t phimax=360)
Make in one step a volume pointing to a sphere shape with given medium.
virtual Bool_t Contains(const Double_t *point) const =0
virtual const char * ClassName() const
Returns name of class to which the object belongs.
Double_t TimingPerVolume(TGeoVolume *)
Compute timing per "FindNextBoundary" + "Safety" call.
TGeoPatternFinder * GetFinder() const
void Stop()
Stop the stopwatch.
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString...
virtual Int_t SetBranchAddress(const char *bname, void *add, TBranch **ptr=0)
Change branch address, dealing with clone trees properly.
void CheckOverlaps(const TGeoVolume *vol, Double_t ovlp=0.1, Option_t *option="")
Check illegal overlaps for volume VOL within a limit OVLP.
void SetCurrentPoint(Double_t *point)
void CdDown(Int_t index)
Make a daughter of current node current.
virtual void SetGrid(Int_t valuex=1, Int_t valuey=1)
void InspectNode() const
Inspect this node.
const char * GetPath() const
Get path to the current node in the form /node0/node1/...
Bool_t IsOnScreen() const
check if this node is drawn. Assumes that this node is current
virtual Double_t GetBinCenter(Int_t bin) const
Return center of bin.
TGeoMedium * GetMedium() const
virtual void SetMarkerColor(Color_t mcolor=1)
Set the marker color.
const TGeoMatrix * GetCurrentMatrix() const
Returns global matrix for current node.
void CheckOverlapsBySampling(TGeoVolume *vol, Double_t ovlp=0.1, Int_t npoints=1000000) const
Check illegal overlaps for volume VOL within a limit OVLP by sampling npoints inside the volume shape...
void SetTopName(const char *name)
Set the top name for path.
void Test(Int_t npoints, Option_t *option)
Check time of finding "Where am I" for n points.
virtual Bool_t IsVisible() const
void LocalToMaster(const Double_t *local, Double_t *master) const
virtual TGeoMatrix * GetMatrix() const =0
TGeoMaterial * GetMaterial() const
void RandomRays(Int_t nrays, Double_t startx, Double_t starty, Double_t startz, const char *target_vol=0, Bool_t check_norm=kFALSE)
Randomly shoot nrays from point (startx,starty,startz) and plot intersections with surfaces for curre...
void SetNmeshPoints(Int_t npoints=1000)
Set number of points to be generated on the shape outline when checking for overlaps.
void Continue()
Resume a stopped stopwatch.
virtual void LocalToMasterVect(const Double_t *local, Double_t *master) const
convert a vector by multiplying its column vector (x, y, z, 1) to matrix inverse
void RestoreMasterVolume()
Restore the master volume of the geometry.
static void SetTransform(TGeoMatrix *matrix)
Set current transformation matrix that applies to shape.
void SetOverlap(Double_t ovlp)
TGeoNode * GetCurrentNode() const
void ReleaseInfo()
Release last used state info pointer.
virtual void AddNode(TGeoVolume *vol, Int_t copy_no, TGeoMatrix *mat=0, Option_t *option="")
Add a TGeoNode to the list of nodes.
virtual Double_t Rndm()
Machine independent random number generator.
Int_t fNchecks
Selected node for overlap checking.
Int_t GetIndex()
Retrieve material index in the list of materials.
virtual const char * GetName() const
Get the shape name.
Int_t AddOverlap(const TNamed *ovlp)
Add an illegal overlap/extrusion to the list.
virtual void SetLineColor(Color_t lcolor)
Set the line color.
Double_t CheckVoxels(TGeoVolume *vol, TGeoVoxelFinder *voxels, Double_t *xyz, Int_t npoints)
count voxel timing
virtual Int_t Write(const char *name=0, Int_t option=0, Int_t bufsize=0)
Write this object to the current directory.
Bool_t TestVoxels(TGeoVolume *vol, Int_t npoints=1000000)
Returns optimal voxelization type for volume vol.
Base abstract class for all shapes.
A simple TTree restricted to a list of float variables only.
void ShapeSafety(TGeoShape *shape, Int_t nsamples, Option_t *option)
Check of validity of safe distance for a given shape.
virtual void Draw(Option_t *option="")
Draw this histogram with options.
TGeoNode * Step(Bool_t is_geom=kTRUE, Bool_t cross=kTRUE)
Make a rectilinear step of length fStep from current point (fPoint) on current direction (fDirection)...
void SetNextPoint(Double_t x, Double_t y, Double_t z)
Set next overlapping point.
virtual void SetFillColor(Color_t fcolor)
Set the fill area color.
Bool_t * fFlags
Array of timing per volume.
virtual Int_t Write(const char *name=0, Int_t opt=0, Int_t bufsiz=0)
Write memory objects to this file.
TGeoNode * FindNextBoundaryAndStep(Double_t stepmax=TGeoShape::Big(), Bool_t compsafe=kFALSE)
Compute distance to next boundary within STEPMAX.
virtual void FindOverlaps(Int_t inode) const
create the list of nodes for which the bboxes overlap with inode's bbox
virtual TObject * RemoveAt(Int_t idx)
Remove object at index idx.
Int_t GetIndex(const TGeoNode *node) const
get index number for a given daughter
tomato 2-D histogram with a float per channel (see TH1 documentation)}
void SetStep(Double_t step)
Double_t * FindNormalFast()
Computes fast normal to next crossed boundary, assuming that the current point is close enough to the...
virtual Double_t Safety(const Double_t *point, Bool_t in=kTRUE) const =0
void RandomPoints(TGeoVolume *vol, Int_t npoints, Option_t *option)
Draw random points in the bounding box of a volume.
static int push(struct mg_context *ctx, FILE *fp, SOCKET sock, SSL *ssl, const char *buf, int len, double timeout)
virtual void CheckBoundaryReference(Int_t icheck=-1)
Check the boundary errors reference file created by CheckBoundaryErrors method.
TGeoVolume * GetCurrentVolume() const
virtual void LabelsDeflate(Option_t *axis="X")
Reduce the number of bins for the axis passed in the option to the number of bins having a label...
Int_t GetEntriesFast() const
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
char * Form(const char *fmt,...)
TGeoManager * fGeoManager
TGeoHMatrix * GetCurrentMatrix() const
virtual const Double_t * GetOrigin() const
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.
TSubString Strip(EStripType s=kTrailing, char c=' ') const
Return a substring of self stripped at beginning and/or end.
Generic 3D primitive description class.
virtual void SetMarkerStyle(Style_t mstyle=1)
Set the marker style.
TGeoNode * GetTopNode() const
virtual TObject * At(Int_t idx) const
Returns the object at position idx. Returns 0 if idx is out of range.
R__EXTERN TRandom * gRandom
tomato 1-D histogram with a double per channel (see TH1 documentation)}
virtual Double_t GetDY() const
virtual void Draw(Option_t *option="")
Draws 3-D polymarker with its current attributes.
virtual void AddAt(TObject *obj, Int_t idx)
Add object at position ids.
virtual void SetMarkerSize(Size_t msize=1)
Set the marker size.
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 =0
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
TGeoNode * FindNode(Bool_t safe_start=kTRUE)
Returns deepest node containing current point.
Bool_t Contains(const Double_t *point) const
virtual void MasterToLocal(const Double_t *master, Double_t *local) const
Convert the point coordinates from mother reference to local reference system.
virtual Color_t GetLineColor() const
Return the line color.
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 =0
virtual void Draw(Option_t *option="")
Draw this 3-D polyline with its current attributes.
virtual Int_t GetCurrentNodeIndex() const
TString & Remove(Ssiz_t pos)
virtual Bool_t cd(const char *path="")
Browse the tree of nodes starting from fTopNode according to pathname.
virtual Int_t SetNextPoint(Double_t x, Double_t y, Double_t z)
Set point following LastPoint to x, y, z.
void OpProgress(const char *opname, Long64_t current, Long64_t size, TStopwatch *watch=0, Bool_t last=kFALSE, Bool_t refresh=kFALSE, const char *msg="")
Print current operation progress.
virtual void SetPoint(Int_t point, Double_t x, Double_t y, Double_t z)
Set point n to x, y, z.
virtual void MasterToLocal(const Double_t *master, Double_t *local) const
convert a point by multiplying its column vector (x, y, z, 1) to matrix
virtual void SetVisibility(Bool_t vis=kTRUE)
set visibility of this volume
virtual void GetMeshNumbers(Int_t &, Int_t &, Int_t &) const
virtual void SetLineStyle(Style_t lstyle)
Set the line style.
void CheckShape(TGeoShape *shape, Int_t testNo, Int_t nsamples, Option_t *option)
Test for shape navigation methods.
Int_t IndexOf(const TObject *obj) const
void CheckGeometry(Int_t nrays, Double_t startx, Double_t starty, Double_t startz) const
Shoot nrays with random directions from starting point (startx, starty, startz) in the reference fram...
void CdTop()
Make top level node the current node.
void CheckPoint(Double_t x=0, Double_t y=0, Double_t z=0, Option_t *option="")
— Draw point (x,y,z) over the picture of the daughers of the volume containing this point...
static RooMathCoreReg dummy
virtual void Draw(Option_t *opt)
Default Draw method for all objects.
virtual Int_t Fill()
Fill a Ntuple with current values in fArgs.
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
you should not use this method at all Int_t Int_t Double_t Double_t Double_t e
void forward(const LAYERDATA &prevLayerData, LAYERDATA &currLayerData)
apply the weights (and functions) in forward direction of the DNN
virtual Double_t Uniform(Double_t x1=1)
Returns a uniform deviate on the interval (0, x1).
Finder class handling voxels.
TObjArray * GetListOfUVolumes() const
virtual Long64_t GetEntries() const
virtual Double_t Capacity() const =0
virtual void SetLineColor(Color_t lcolor)
Set the line color.
virtual UInt_t SetCanExtend(UInt_t extendBitMask)
Make the histogram axes extendable / not extendable according to the bit mask returns the previous bi...
void PrintOverlaps() const
Print the current list of overlaps held by the manager class.
Mother of all ROOT objects.
Double_t Weight(Double_t precision=0.01, Option_t *option="v")
Estimate weight of top level volume with a precision SIGMA(W)/W better than PRECISION.
you should not use this method at all Int_t Int_t z
TGeoNode * FindNextBoundary(Double_t stepmax=TGeoShape::Big(), const char *path="", Bool_t frombdr=kFALSE)
Find distance to next boundary and store it in fStep.
Class providing navigation API for TGeo geometries.
virtual Int_t Branch(TCollection *list, Int_t bufsize=32000, Int_t splitlevel=99, const char *name="")
Create one branch for each element in the collection.
TGeoNode * SamplePoints(Int_t npoints, Double_t &dist, Double_t epsil, const char *g3path)
shoot npoints randomly in a box of 1E-5 arround current point.
void CheckGeometryFull(Bool_t checkoverlaps=kTRUE, Bool_t checkcrossings=kTRUE, Int_t nrays=10000, const Double_t *vertex=NULL)
Geometry checking.
A node represent a volume positioned inside another.They store links to both volumes and to the TGeoM...
void ShapeDistances(TGeoShape *shape, Int_t nsamples, Option_t *option)
Test TGeoShape::DistFromInside/Outside.
R__EXTERN TGeoIdentity * gGeoIdentity
void SetVisLevel(Int_t level=3)
set default level down to which visualization is performed
TGeoNavigator * GetCurrentNavigator() const
Returns current navigator for the calling thread.
virtual void Divide(Int_t nx=1, Int_t ny=1, Float_t xmargin=0.01, Float_t ymargin=0.01, Int_t color=0)
Automatic pad generation by division.
#define dnext(otri1, otri2)
virtual Int_t GetN() const
Double_t * FindNormal(Bool_t forward=kTRUE)
Computes normal vector to the next surface that will be or was already crossed when propagating on a ...
Short_t Max(Short_t a, Short_t b)
const Double_t * GetCurrentPoint() const
Int_t * GetOverlaps(Int_t &novlp) const
void SetOptStat(Int_t stat=1)
The type of information printed in the histogram statistics box can be selected via the parameter mod...
THist< 1, double, THistStatContent, THistStatUncertainty > TH1D
TGeoNode * GetMother(Int_t up=1) const
Int_t GetEntries() const
Return the number of objects in array (i.e.
TPolyMarker3D * GetPolyMarker() const
A TTree object has a header with a name and a title.
TStopwatch * fTimer
Array of flags per volume.
TObjArray * GetListOfOverlaps()
def normal(shape, name=None)
Double_t Sqrt(Double_t x)
TGeoVolume * GetTopVolume() const
virtual Double_t GetRadLen() const
void FindOverlaps() const
loop all nodes marked as overlaps and find overlapping brothers
TGeoShape * GetShape() const
TGeoNode * FindNextDaughterBoundary(Double_t *point, Double_t *dir, Int_t &idaughter, Bool_t compmatrix=kFALSE)
Computes as fStep the distance to next daughter of the current volume.
virtual Int_t GetSize() const
virtual void Draw(Option_t *option="")
Draw this shape.
Int_t Fill(Double_t)
Invalid Fill method.
virtual void SetTitle(const char *title="")
Set the title of the TNamed.
THist< 2, float, THistStatContent, THistStatUncertainty > TH2F
TGeoChecker()
Default constructor.
double norm(double *x, double *p)
TGeoVolume * GetVolume() const
virtual void SetStats(Bool_t stats=kTRUE)
Set statistics option on/off.
void SetOverlaps(Int_t *ovlp, Int_t novlp)
set the list of overlaps for this node (ovlp must be created with operator new)
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
Int_t NChecksPerVolume(TGeoVolume *vol)
Compute number of overlaps combinations to check per volume.
Double_t GetOverlap() const
virtual Double_t GetDZ() const
const char * Data() const
virtual Bool_t IsAssembly() const
Returns true if the volume is an assembly or a scaled assembly.