155 static Int_t oseconds = 0;
158 static Int_t nrefresh = 0;
159 const char symbol[4] = {
'=',
'\\',
'|',
'/'};
160 char progress[11] =
" ";
161 Int_t ichar = icount%4;
172 if (ocurrent > osize) ocurrent=osize;
182 if (owatch && !last) {
185 hours = (
Int_t)(time/3600.);
187 minutes = (
Int_t)(time/60.);
189 seconds = (
Int_t)time;
191 if (oseconds==seconds) {
195 oneoftwo = !oneoftwo;
199 if (refresh && oneoftwo) {
209 for (i=0; i<
nchar; i++) progress[i] =
'=';
210 progress[
nchar] = symbol[ichar];
211 for (i=
nchar+1; i<10; i++) progress[i] =
' ';
215 if(
size<10000) fprintf(stderr,
"%s [%10s] %4lld ", oname.
Data(), progress, ocurrent);
216 else if(
size<100000) fprintf(stderr,
"%s [%10s] %5lld ",oname.
Data(), progress, ocurrent);
217 else fprintf(stderr,
"%s [%10s] %7lld ",oname.
Data(), progress, ocurrent);
218 if (time>0.) fprintf(stderr,
"[%6.2f %%] TIME %.2d:%.2d:%.2d %s\r",
percent, hours, minutes, seconds, message.
Data());
219 else fprintf(stderr,
"[%6.2f %%] %s\r",
percent, message.
Data());
220 if (refresh && oneoftwo) oname = nname;
230 fprintf(stderr,
"\n");
242 Info(
"CheckBoundaryErrors",
"Top volume is %s",tvol->
GetName());
256 TTree *bug=
new TTree(
"bug",
"Geometrical problems");
257 bug->
Branch(
"pos",xyz,
"xyz[3]/D");
258 bug->
Branch(
"dir",dir,
"dir[3]/D");
259 bug->
Branch(
"push",&relp,
"push/D");
260 bug->
Branch(
"path",&path,
"path/C");
261 bug->
Branch(
"cdir",&cdir,
"cdir/C");
263 dl[0] =
box->GetDX();
264 dl[1] =
box->GetDY();
265 dl[2] =
box->GetDZ();
266 ori[0] = (
box->GetOrigin())[0];
267 ori[1] = (
box->GetOrigin())[1];
268 ori[2] = (
box->GetOrigin())[2];
270 dl[0] = dl[1] = dl[2] = radius;
273 TH1F *hnew =
new TH1F(
"hnew",
"Precision pushing",30,-20.,10.);
274 TH1F *hold =
new TH1F(
"hold",
"Precision pulling", 30,-20.,10.);
275 TH2F *hplotS =
new TH2F(
"hplotS",
"Problematic points",100,-dl[0],dl[0],100,-dl[1],dl[1]);
281 Long_t n100 = ntracks/100;
283 printf(
"Random box : %f, %f, %f, %f, %f, %f\n", ori[0], ori[1], ori[2], dl[0], dl[1], dl[2]);
284 printf(
"Start... %i points\n", ntracks);
288 while (igen<ntracks) {
300 if (n100 && !(igen%n100))
313 for(
Int_t i=0; i<30; ++i) {
315 for(
Int_t j=0; j<3; ++j) nxyz[j]=xyz[j]+step*(1.+relp)*dir[j];
322 Double_t dotp = norm[0]*dir[0]+norm[1]*dir[1]+norm[2]*dir[2];
323 printf(
"Forward error i=%d p=%5.4f %5.4f %5.4f s=%5.4f dot=%5.4f path=%s\n",
324 i,xyz[0],xyz[1],xyz[2],step,dotp,path);
326 strncpy(cdir,
"Forward",10);
334 for(
Int_t i=0; i<30; ++i) {
336 for(
Int_t j=0; j<3; ++j) nxyz[j]=xyz[j]+step*(1.+relp)*dir[j];
343 Double_t dotp = norm[0]*dir[0]+norm[1]*dir[1]+norm[2]*dir[2];
344 printf(
"Backward error i=%d p=%5.4f %5.4f %5.4f s=%5.4f dot=%5.4f path=%s\n",
345 i,xyz[0],xyz[1],xyz[2],step,dotp,path);
346 strncpy(cdir,
"Backward",10);
355 if (itry) printf(
"CPU time/point = %5.2emus: Real time/point = %5.2emus\n",
364 if (itry) printf(
"Effic = %3.1f%%\n",(100.*igen)/itry);
373 new TCanvas(
"c3",
"Plot",600,600);
374 hplotS->
Draw(
"cont0");
405 printf(
"%-9s error push=%g p=%5.4f %5.4f %5.4f s=%5.4f dot=%5.4f path=%s\n",
406 cdir,push,xyz[0],xyz[1],xyz[2],1.,1.,path);
413 printf(
"%-9s error push=%g p=%5.4f %5.4f %5.4f s=%5.4f dot=%5.4f path=%s\n",
414 cdir,push,xyz[0],xyz[1],xyz[2],1.,1.,path);
420 for (
Int_t j=0; j<3; j++) nxyz[j]=xyz[j]+step*(1.+0.1*push)*dir[j];
423 printf(
" -> next = %s push=%g change=%d\n", next->
GetName(),push, (
UInt_t)change);
438 for (
Int_t j=0; j<3; j++) nxyz[j]=xyz[j]+step*dir[j];
488 printf(
"====================================================================\n");
489 printf(
"STAGE 1: Overlap checking by sampling within 10 microns\n");
490 printf(
"====================================================================\n");
494 printf(
"====================================================================\n");
495 printf(
"STAGE 2: Global overlap/extrusion checking within 10 microns\n");
496 printf(
"====================================================================\n");
500 if (!checkcrossings) {
516 printf(
"====================================================================\n");
517 printf(
"STAGE 3: Propagating %i tracks starting from vertex\n and counting number of boundary crossings...\n", ntracks);
518 printf(
"====================================================================\n");
522 memset(point, 0, 3*
sizeof(
Double_t));
527 for (i=0; i<ntracks; i++) {
538 printf(
"No boundary crossed\n");
546 printf(
"Time for crossing %i boundaries: %g [ms]\n", nbound, time1);
547 printf(
"Time per track for full geometry traversal: %g [ms], per crossing: %g [ms]\n", time2, time3);
551 printf(
"====================================================================\n");
552 printf(
"STAGE 4: How much navigation time per volume per next+safety call\n");
553 printf(
"====================================================================\n");
563 strncpy(volname, vol->
GetName(),15);
567 while ((current=next())) {
570 if (
fFlags[uid])
continue;
574 strncpy(volname, vol->
GetName(),15);
584 c1->SetTopMargin(0.15);
585 TFile *
f =
new TFile(
"statistics.root",
"RECREATE");
586 TH1F *
h =
new TH1F(
"h",
"number of boundary crossings per volume",3,0,3);
592 for (i=0; i<nuid; i++) {
598 time_tot_pertrack /= ntracks;
600 h->LabelsOption(
">",
"X");
604 TCanvas *
c2 =
new TCanvas(
"c3",
"time spent per volume in navigation",10,10,900,500);
606 c2->SetTopMargin(0.15);
607 TH2F *h2 =
new TH2F(
"h2",
"time per FNB call vs. ndaughters", 100, 0,100,100,0,15);
610 TH1F *
h1 =
new TH1F(
"h1",
"percent of time spent per volume",3,0,3);
614 for (i=0; i<nuid; i++) {
626 c3->SetTopMargin(0.15);
653 printf(
"Error in trying to cross boundary of %s\n", current->
GetName());
699 Error(
"SetNmeshPoints",
"Cannot allow less than 1000 points for checking - set to 1000");
719 Double_t point[3], dir[3], lpt[3], ldir[3];
725 for (
Int_t i=0; i<1000000; i++) {
764 printf(
"Time for volume %s (assemb=%d): %g [ms] ndaughters=%d ncross=%d\n", vol->
GetName(), vol->
IsAssembly(), time_per_track, vol->
GetNdaughters(), ncrossings);
765 return time_per_track;
799 Int_t nelem1, nelem2;
800 Int_t dim1=1000, dim2=1000;
801 if ((startx==0) && (starty==0) && (startz==0)) eps=1E-3;
802 start[0] = startx+eps;
803 start[1] = starty+eps;
804 start[2] = startz+eps;
808 Int_t ist1, ist2, ifound;
809 for (i=0; i<nrays; i++) {
811 if ((i%n10) == 0) printf(
"%i percent\n",
Int_t(100*i/nrays));
821 array1 =
ShootRay(&start[0], dir[0], dir[1], dir[2], array1, nelem1, dim1);
822 if (!nelem1)
continue;
824 memcpy(&end[0], &array1[3*(nelem1-1)], 3*
sizeof(
Double_t));
827 array2 =
ShootRay(&end[0], -dir[0], -dir[1], -dir[2], array2, nelem2, dim2, &start[0]);
829 printf(
"#### NOTHING BACK ###########################\n");
830 for (j=0; j<nelem1; j++) {
832 pm->
SetNextPoint(array1[3*j], array1[3*j+1], array1[3*j+2]);
838 for (j=0; j<k; j++) {
839 memcpy(&dummy[0], &array2[3*j], 3*
sizeof(
Double_t));
840 memcpy(&array2[3*j], &array2[3*(nelem2-1-j)], 3*
sizeof(
Double_t));
841 memcpy(&array2[3*(nelem2-1-j)], &dummy[0], 3*
sizeof(
Double_t));
844 if (nelem1!=nelem2) printf(
"### DIFFERENT SIZES : nelem1=%i nelem2=%i ##########\n", nelem1, nelem2);
848 dx = array1[3*ist1]-array2[3*ist2];
849 dy = array1[3*ist1+1]-array2[3*ist2+1];
850 dz = array1[3*ist1+2]-array2[3*ist2+2];
851 dw = dx*dir[0]+dy*dir[1]+dz*dir[2];
860 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);
862 pm->
SetNextPoint(array2[3*ist2], array2[3*ist2+1], array2[3*ist2+2]);
871 while ((ist1<nelem1-1) && (ist2<nelem2)) {
877 dx = array1[3*ist1+3]-array1[3*ist1];
878 dy = array1[3*ist1+4]-array1[3*ist1+1];
879 dz = array1[3*ist1+5]-array1[3*ist1+2];
881 dwmin = dx+dir[0]+dy*dir[1]+dz*dir[2];
882 while (ist2<nelem2) {
884 dx = array2[3*ist2]-array1[3*ist1];
885 dy = array2[3*ist2+1]-array1[3*ist1+1];
886 dz = array2[3*ist2+2]-array1[3*ist1+2];
887 dw = dx+dir[0]+dy*dir[1]+dz*dir[2];
908 pm->
SetNextPoint(array2[3*ist2], array2[3*ist2+1], array2[3*ist2+2]);
909 printf(
"### EXTRA BOUNDARY %i : %s found at DCLOSE=%f\n", ist2,
fGeoManager->
GetPath(), dw);
919 pm->
SetNextPoint(array2[3*ist1+3], array2[3*ist1+4], array2[3*ist1+5]);
920 printf(
"### BOUNDARY MISSED BACK #########################\n");
954 for (
Int_t i=0; i<numPoints; i++) {
957 if (rsq < 1.e-10)
continue;
984 Bool_t extrude, isextrusion, isoverlapping;
1031 for (ip=0; ip<numPoints2; ip++) {
1032 memcpy(local, &points2[3*ip], 3*
sizeof(
Double_t));
1036 extrude = !shape1->
Contains(local);
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);
1067 if (safety<ovlp) extrude=
kFALSE;
1072 isextrusion =
kTRUE;
1087 for (ip=0; ip<numPoints1; ip++) {
1088 memcpy(local, &points1[3*ip], 3*
sizeof(
Double_t));
1089 if (local[0]<1
e-10 && local[1]<1
e-10)
continue;
1095 if (safety<ovlp) overlap=
kFALSE;
1098 if (!isoverlapping) {
1099 isoverlapping =
kTRUE;
1110 for (ip=0; ip<numPoints2; ip++) {
1111 memcpy(local, &points2[3*ip], 3*
sizeof(
Double_t));
1112 if (local[0]<1
e-10 && local[1]<1
e-10)
continue;
1118 if (safety<ovlp) overlap=
kFALSE;
1121 if (!isoverlapping) {
1122 isoverlapping =
kTRUE;
1144 if (!voxels)
return;
1157 Int_t *check_list =
nullptr;
1163 Int_t id=0, id0=0, id1=0;
1175 while (ipoint < npoints) {
1182 if (itry>10000 && !ipoint) {
1183 Error(
"CheckOverlapsBySampling",
"No point inside volume!!! - aborting");
1192 if (!check_list || ncheck<2)
continue;
1193 for (
id=0;
id<ncheck;
id++) {
1194 id0 = check_list[
id];
1201 if (!incrt)
continue;
1213 if (flags)
delete [] flags;
1242 &mat1,&mat2,
kTRUE, safe);
1243 flags[nd*id1+id0] = nodeovlp;
1252 if (flags)
delete [] flags;
1253 if (!novlps)
return;
1257 Info(
"CheckOverlapsBySampling",
"#Found %d overlaps adding-up to %g +/- %g [cm3] for daughters of %s",
1258 novlps, capacity, err*capacity, vol->
GetName());
1276 while ((node=next1())) {
1288 if (nd<2)
return nchecks;
1290 if (!vox)
return nchecks;
1298 for (
id=0;
id<nd;
id++) {
1303 if (!ovlps)
continue;
1304 for (ko=0; ko<novlp; ko++) {
1306 if (io<=
id)
continue;
1313 while ((node=next1())) {
1317 while ((node1=next2())) {
1333 while ((node1=next2())) {
1369 if (!npoints) npoints = 1000000;
1386 while ((node=next1())) {
1400 while ((nodecheck=next1.
GetNode(level--))) {
1421 Warning(
"CheckOverlaps",
"Volume %s with %i daughters but not voxelized", vol->
GetName(),nd);
1435 for (
id=0;
id<nd;
id++) {
1440 if (!ovlps)
continue;
1443 for (ko=0; ko<novlp; ko++) {
1445 if (io<=
id)
continue;
1457 while ((node=next1())) {
1464 while ((node1=next2())) {
1474 while ((nodecheck=next2.
GetNode(level--))) {
1480 while ((nodecheck=next1.
GetNode(level--))) {
1508 while ((nodecheck=next1.
GetNode(level--))) {
1528 while ((node1=next2())) {
1538 while ((nodecheck=next2.
GetNode(level--))) {
1600 printf(
"=== Check current point : (%g, %g, %g) ===\n", point[0], point[1], point[2]);
1606 printf(
"Safety radius : %f\n", close);
1652 Error(
"CheckShape",
"Test number %d not existent", testNo);
1674 const Int_t kNtracks = 1000;
1675 Int_t n10 = nsamples/10;
1682 TH1D *hist =
new TH1D(
"hTest1",
"Residual distance from inside/outside",200,-20, 0);
1690 while (itot<nsamples) {
1700 if ((itot%n10) == 0) printf(
"%i percent\n",
Int_t(100*itot/nsamples));
1702 for (i=0; i<kNtracks; i++) {
1715 printf(
"DistFromInside: (%19.15f, %19.15f, %19.15f, %19.15f, %19.15f, %19.15f) %f/%f(max)\n",
1716 point[0],point[1],point[2],dir[0],dir[1],dir[2], d1,dmove);
1721 pmfrominside->
SetNextPoint(point[0],point[1],point[2]);
1722 for (j=0; j<3; j++) pnew[j] = point[j] + d1*dir[j];
1724 pmfrominside->
Draw();
1734 for (j=0; j<3; j++) {
1735 pnew[j] = point[j] + dmove*dir[j];
1740 delta = dmove-d1-d2;
1745 printf(
"Error: (%19.15f, %19.15f, %19.15f, %19.15f, %19.15f, %19.15f) d1=%f d2=%f dmove=%f\n",
1746 point[0],point[1],point[2],dir[0],dir[1],dir[2], d1,d2,dmove);
1748 printf(
" (*)DistFromOutside(%19.15f, %19.15f, %19.15f, %19.15f, %19.15f, %19.15f) dnext = %f\n",
1753 printf(
" DistFromOutside(%19.15f, %19.15f, %19.15f, %19.15f, %19.15f, %19.15f) dnext = %f\n",
1754 point[0]+d1*dir[0],point[1]+d1*dir[1], point[2]+d1*dir[2], dir[0],dir[1],dir[2],
dnext);
1756 printf(
" DistFromOutside(%19.15f, %19.15f, %19.15f, %19.15f, %19.15f, %19.15f) = %f\n",
1757 pnew[0],pnew[1],pnew[2],dnew[0],dnew[1],dnew[2], d2);
1762 pmfrominside->
SetNextPoint(point[0],point[1],point[2]);
1763 for (j=0; j<3; j++) point[j] += d1*dir[j];
1764 pmfrominside->
SetNextPoint(point[0],point[1],point[2]);
1765 pmfrominside->
Draw();
1772 for (j=0; j<3; j++) pnew[j] += d2*dnew[j];
1773 if (d2<1E10) pmfromoutside->
SetNextPoint(pnew[0],pnew[1],pnew[2]);
1774 pmfromoutside->
Draw();
1783 printf(
"Error DistFromInside(%19.15f, %19.15f, %19.15f, %19.15f, %19.15f, %19.15f) d1=%f d1p=%f\n",
1784 pnew[0],pnew[1],pnew[2],dnew[0],dnew[1],dnew[2],d1,
dnext);
1789 pmfrominside->
SetNextPoint(point[0],point[1],point[2]);
1790 for (j=0; j<3; j++) point[j] += d1*dir[j];
1791 pmfrominside->
SetNextPoint(point[0],point[1],point[2]);
1792 pmfrominside->
Draw();
1799 for (j=0; j<3; j++) pnew[j] +=
dnext*dnew[j];
1800 if (d2<1E10) pmfromoutside->
SetNextPoint(pnew[0],pnew[1],pnew[2]);
1801 pmfromoutside->
Draw();
1804 if (
TMath::Abs(delta) < 1E-20) delta = 1E-30;
1810 new TCanvas(
"Test01",
"Residuals DistFromInside/Outside", 800, 600);
1826 const Int_t kNtracks = 1000;
1827 Int_t n10 = nsamples/10;
1839 while (itot<nsamples) {
1848 if ((itot%n10) == 0) printf(
"%i percent\n",
Int_t(100*itot/nsamples));
1850 for (i=0; i<kNtracks; i++) {
1859 printf(
"Error safety (%19.15f, %19.15f, %19.15f, %19.15f, %19.15f, %19.15f) safe=%f dist=%f\n",
1860 point[0],point[1],point[2], dir[0], dir[1], dir[2], safe, dist);
1868 pm1->
SetNextPoint(point[0]+safe*dir[0],point[1]+safe*dir[1],point[2]+safe*dir[2]);
1874 pm2->
SetNextPoint(point[0]+dist*dir[0],point[1]+dist*dir[1],point[2]+dist*dir[2]);
1897 const Int_t kNtracks = 1000;
1898 Int_t n10 = nsamples/10;
1899 Int_t itot = 0, errcnt = 0, errsame=0;
1905 while (itot<nsamples) {
1911 inside = shape->
Contains(&spoint[3*itot]);
1920 Double_t point[3],newpoint[3], oldpoint[3];
1922 Double_t norm[3], newnorm[3], oldnorm[3];
1933 for (itot = 0; itot<nsamples; itot++) {
1935 if ((itot%n10) == 0) printf(
"%i percent\n",
Int_t(100*itot/nsamples));
1937 oldnorm[0] = oldnorm[1] = oldnorm[2] = 0.;
1939 for (
Int_t j=0; j<3; j++) {
1940 oldpoint[j] = point[j] = spoint[3*itot+j];
1941 olddir[j] = dir[j] = sdir[3*itot+j];
1943 for (i=0; i<kNtracks; i++) {
1944 if (errcnt>0)
break;
1946 for (
Int_t j=0; j<3; j++) {
1947 newpoint[j] = point[j] + dist*dir[j];
1951 dot = olddir[0]*oldnorm[0]+olddir[1]*oldnorm[1]+ olddir[2]*oldnorm[2];
1954 printf(
"Error point outside (%19.15f, %19.15f, %19.15f, %19.15f, %19.15f, %19.15f) =%g olddist=%g\n",
1955 point[0],point[1],point[2], dir[0], dir[1], dir[2], dist, olddist);
1956 printf(
" old point: (%19.15f, %19.15f, %19.15f, %19.15f, %19.15f, %19.15f)\n",
1957 oldpoint[0],oldpoint[1],oldpoint[2], olddir[0], olddir[1], olddir[2]);
1966 pm1->
SetNextPoint(oldpoint[0],oldpoint[1],oldpoint[2]);
1973 printf(
"Error DistFromInside(%19.15f, %19.15f, %19.15f, %19.15f, %19.15f, %19.15f) =%g olddist=%g\n",
1974 point[0],point[1],point[2], dir[0], dir[1], dir[2], dist, olddist);
1975 printf(
" new norm: (%g, %g, %g)\n", newnorm[0], newnorm[1], newnorm[2]);
1976 printf(
" old point: (%19.15f, %19.15f, %19.15f, %19.15f, %19.15f, %19.15f)\n",
1977 oldpoint[0],oldpoint[1],oldpoint[2], olddir[0], olddir[1], olddir[2]);
1978 printf(
" old norm: (%g, %g, %g)\n", oldnorm[0], oldnorm[1], oldnorm[2]);
1987 pm1->
SetNextPoint(oldpoint[0],oldpoint[1],oldpoint[2]);
1993 for (
Int_t j=0; j<3; j++) {
1994 oldpoint[j] = point[j];
1995 point[j] += dist*dir[j];
2000 printf(
"Error safety (%19.15f, %19.15f, %19.15f) safe=%g\n",
2001 point[0],point[1],point[2], safe);
2014 memcpy(oldnorm, norm, 3*
sizeof(
Double_t));
2015 memcpy(olddir, dir, 3*
sizeof(
Double_t));
2022 ndotd = dir[0]*norm[0]+dir[1]*norm[1]+dir[2]*norm[2];
2025 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] = 1E-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);
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;
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));
2538 if (recheck) printf(
"RECHECK\n");
2548 printf(
"Random box : %f, %f, %f\n", dx, dy, dz);
2551 for (i=0; i<npoints; i++) {
2557 printf(
"Generation time :\n");
2561 printf(
"Start... %i points\n", npoints);
2563 for (i=0; i<npoints; i++) {
2569 if (node1 != node) {
2570 printf(
"Difference for x=%g y=%g z=%g\n", xyz[3*i], xyz[3*i+1], xyz[3*i+2]);
2571 printf(
" from top : %s\n", node->
GetName());
2588 printf(
"Checking overlaps for path :\n");
2593 Int_t npoints = 1000000;
2621 if (!shape->
Contains(point))
continue;
2643 ntpl->
Draw(
"z:y:x");
2650 printf(
"using FindNode...\n");
2651 for (
Int_t j=0; j<npoints; j++) {
2658 markthis->
SetNextPoint(xyz[3*j], xyz[3*j+1], xyz[3*j+2]);
2664 if (ic >= 128) ic = 0;
2669 pm->
AddAt(marker, ic);
2672 marker->
SetNextPoint(xyz[3*j], xyz[3*j+1], xyz[3*j+2]);
2674 if (overlaps->
IndexOf(node) < 0) overlaps->
Add(node);
2682 markthis->
Draw(
"SAME");
2686 printf(
"list of overlapping nodes :\n");
2690 else printf(
"%s ONLY\n", node->
GetName());
2692 }
else printf(
"No overlaps\n");
2707 if (!nmat)
return 0;
2709 memset(nin, 0, nmat*
sizeof(
Int_t));
2736 if (!node)
continue;
2739 if (indmat<0)
continue;
2742 if ((iin%100000)==0 || igen>1E8) {
2745 for (indmat=0; indmat<nmat; indmat++) {
2748 if (dens<1E-2) dens=0;
2750 weight += dens*
Double_t(nin[indmat]);
2751 sigma += dens*dens*nin[indmat];
2757 if (eps<precision || igen>1E8) {
2759 printf(
"=== Weight of %s : %g +/- %g [kg]\n",
2764 if (isverbose && eps<0.5*eps0) {
2765 printf(
"%8dK: %14.7g kg %g %%\n",
2766 igen/1000, weight, eps*100);
2792 for (
Int_t i=0; i<npoints; i++) {
2794 if (!shape->
Contains(point))
continue;
2796 if (!checklist)
continue;
2797 if (!ncheck)
continue;
2798 for (
Int_t id=0;
id<ncheck;
id++) {
2799 node = vol->
GetNode(checklist[
id]);
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t r
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t index
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize id
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void value
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t nchar
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t points
Option_t Option_t TPoint TPoint percent
R__EXTERN TGeoIdentity * gGeoIdentity
R__EXTERN TRandom * gRandom
char * Form(const char *fmt,...)
Formats a string in a circular formatting buffer.
R__EXTERN TStyle * gStyle
virtual void SetFillColor(Color_t fcolor)
Set the fill area color.
virtual Color_t GetLineColor() const
Return the line color.
virtual void SetLineWidth(Width_t lwidth)
Set the line width.
virtual void SetLineColor(Color_t lcolor)
Set the line color.
virtual void SetMarkerColor(Color_t mcolor=1)
Set the marker color.
virtual void SetMarkerStyle(Style_t mstyle=1)
Set the marker style.
virtual void SetMarkerSize(Size_t msize=1)
Set the marker size.
virtual Double_t GetBinCenter(Int_t bin) const
Return center of bin.
Generic 3D primitive description class.
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.
virtual Int_t GetSize() const
Return the capacity of the collection, i.e.
A ROOT file is a suite of consecutive data records (TKey instances) with a well defined format.
Geometry checking package.
Int_t PropagateInGeom(Double_t *, Double_t *)
Propagate from START along DIR from boundary to boundary until exiting geometry.
Int_t fNchecks
Selected node for overlap checking.
void CheckShape(TGeoShape *shape, Int_t testNo, Int_t nsamples, Option_t *option)
Test for shape navigation methods.
Bool_t * fFlags
Array of timing per volume.
TStopwatch * fTimer
Array of flags per volume.
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...
TGeoChecker()
Default constructor.
virtual ~TGeoChecker()
Destructor.
void ShapeNormal(TGeoShape *shape, Int_t nsamples, Option_t *option)
Check of validity of the normal for a given shape.
void CheckOverlaps(const TGeoVolume *vol, Double_t ovlp=0.1, Option_t *option="")
Check illegal overlaps for volume VOL within a limit OVLP.
void TestOverlaps(const char *path)
Geometry overlap checker based on sampling.
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.
Double_t * fVal2
Array of number of crossings per volume.
TGeoManager * fGeoManager
void ShapeDistances(TGeoShape *shape, Int_t nsamples, Option_t *option)
Test TGeoShape::DistFromInside/Outside.
Int_t NChecksPerVolume(TGeoVolume *vol)
Compute number of overlaps combinations to check per volume.
void ShapeSafety(TGeoShape *shape, Int_t nsamples, Option_t *option)
Check of validity of safe distance for a given shape.
void CheckGeometryFull(Bool_t checkoverlaps=kTRUE, Bool_t checkcrossings=kTRUE, Int_t nrays=10000, const Double_t *vertex=nullptr)
Geometry checking.
void Score(TGeoVolume *, Int_t, Double_t)
Score a hit for VOL.
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=nullptr) const
Shoot one ray from start point with direction (dirx,diry,dirz).
void CleanPoints(Double_t *points, Int_t &numPoints) const
Number of points on mesh to be checked.
TGeoNode * SamplePoints(Int_t npoints, Double_t &dist, Double_t epsil, const char *g3path)
shoot npoints randomly in a box of 1E-5 around current point.
TGeoNode * fSelectedNode
Timer.
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.
void OpProgress(const char *opname, Long64_t current, Long64_t size, TStopwatch *watch=nullptr, Bool_t last=kFALSE, Bool_t refresh=kFALSE, const char *msg="")
Print current operation progress.
Int_t fNmeshPoints
Number of checks for current volume.
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...
virtual void CheckBoundaryReference(Int_t icheck=-1)
Check the boundary errors reference file created by CheckBoundaryErrors method.
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 daughters of the volume containing this point.
void SetNmeshPoints(Int_t npoints=1000)
Set number of points to be generated on the shape outline when checking for overlaps.
void PrintOverlaps() const
Print the current list of overlaps held by the manager class.
void Test(Int_t npoints, Option_t *option)
Check time of finding "Where am I" for n points.
Double_t TimingPerVolume(TGeoVolume *)
Compute timing per "FindNextBoundary" + "Safety" call.
Bool_t TestVoxels(TGeoVolume *vol, Int_t npoints=1000000)
Returns optimal voxelization type for volume vol.
void RandomRays(Int_t nrays, Double_t startx, Double_t starty, Double_t startz, const char *target_vol=nullptr, Bool_t check_norm=kFALSE)
Randomly shoot nrays from point (startx,starty,startz) and plot intersections with surfaces for curre...
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 RandomPoints(TGeoVolume *vol, Int_t npoints, Option_t *option)
Draw random points in the bounding box of a volume.
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...
Double_t CheckVoxels(TGeoVolume *vol, TGeoVoxelFinder *voxels, Double_t *xyz, Int_t npoints)
count voxel timing
Matrix class used for computing global transformations Should NOT be used for node definition.
void Multiply(const TGeoMatrix *right)
multiply to the right with an other transformation if right is identity matrix, just return
void Reset(TGeoVolume *top=nullptr)
Resets the iterator for volume TOP.
const TGeoMatrix * GetCurrentMatrix() const
Returns global matrix for current node.
void SetTopName(const char *name)
Set the top name for path.
void GetPath(TString &path) const
Returns the path for the current node.
TGeoNode * GetNode(Int_t level) const
Returns current node at a given level.
void Skip()
Stop iterating the current branch.
The manager class for any TGeo geometry.
TGeoNode * GetMother(Int_t up=1) const
Double_t * FindNormalFast()
Computes fast normal to next crossed boundary, assuming that the current point is close enough to the...
TObjArray * GetListOfUVolumes() const
TObjArray * GetListOfOverlaps()
void CdUp()
Go one level up in geometry.
virtual Bool_t cd(const char *path="")
Browse the tree of nodes starting from fTopNode according to pathname.
void LocalToMaster(const Double_t *local, Double_t *master) const
void RestoreMasterVolume()
Restore the master volume of the geometry.
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.
TGeoNavigator * GetCurrentNavigator() const
Returns current navigator for the calling thread.
TGeoVolume * GetMasterVolume() const
TGeoNode * GetCurrentNode() const
void SetCurrentDirection(Double_t *dir)
void SetVisLevel(Int_t level=3)
set default level down to which visualization is performed
TGeoNode * FindNextBoundary(Double_t stepmax=TGeoShape::Big(), const char *path="", Bool_t frombdr=kFALSE)
Find distance to next boundary and store it in fStep.
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)...
TGeoVolume * GetVolume(const char *name) const
Search for a named volume. All trailing blanks stripped.
TGeoNode * FindNextBoundaryAndStep(Double_t stepmax=TGeoShape::Big(), Bool_t compsafe=kFALSE)
Compute distance to next boundary within STEPMAX.
void SetCurrentPoint(Double_t *point)
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 ...
TGeoNode * FindNode(Bool_t safe_start=kTRUE)
Returns deepest node containing current point.
const Double_t * GetCurrentPoint() const
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.
TGeoNode * InitTrack(const Double_t *point, const Double_t *dir)
Initialize current point and current direction vector (normalized) in MARS.
TGeoHMatrix * GetCurrentMatrix() const
TGeoNode * GetTopNode() const
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.
const char * GetPath() const
Get path to the current node in the form /node0/node1/...
Int_t AddOverlap(const TNamed *ovlp)
Add an illegal overlap/extrusion to the list.
static void SetVerboseLevel(Int_t vl)
Return current verbosity level (static function).
void SetStep(Double_t step)
TGeoVolume * GetCurrentVolume() const
static Int_t GetVerboseLevel()
Set verbosity level (static function).
void CdTop()
Make top level node the current node.
Double_t Safety(Bool_t inside=kFALSE)
Compute safe distance from the current point.
void MasterToLocal(const Double_t *master, Double_t *local) const
void ResetState()
Reset current state flags.
void CdDown(Int_t index)
Make a daughter of current node current.
TList * GetListOfMaterials() const
TGeoVolume * GetTopVolume() const
void SetTopVisible(Bool_t vis=kTRUE)
make top volume visible on screen
void CheckOverlaps(Double_t ovlp=0.1, Option_t *option="")
Check all geometry for illegal overlaps within a limit OVLP.
Bool_t IsEntering() const
Base class describing materials.
Int_t GetIndex()
Retrieve material index in the list of materials.
virtual Double_t GetRadLen() const
virtual Double_t GetDensity() const
Geometrical transformation package.
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
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 LocalToMaster(const Double_t *local, Double_t *master) const
convert a point by multiplying its column vector (x, y, z, 1) to matrix inverse
TGeoMaterial * GetMaterial() const
Class providing navigation API for TGeo geometries.
TGeoNodeCache * GetCache() const
TGeoStateInfo * GetInfo()
Get next state info pointer.
void ReleaseInfo()
Release last used state info pointer.
A node represent a volume positioned inside another.They store links to both volumes and to the TGeoM...
Bool_t IsOverlapping() const
Bool_t IsOnScreen() const
check if this node is drawn. Assumes that this node is current
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)
virtual TGeoMatrix * GetMatrix() const =0
Int_t * GetOverlaps(Int_t &novlp) const
virtual void MasterToLocal(const Double_t *master, Double_t *local) const
Convert the point coordinates from mother reference to local reference system.
void InspectNode() const
Inspect this node.
Base class describing geometry overlaps.
TPolyMarker3D * GetPolyMarker() const
void SetNextPoint(Double_t x, Double_t y, Double_t z)
Set next overlapping point.
void SetOverlap(Double_t ovlp)
virtual void PrintInfo() const
Print some info.
Double_t GetOverlap() const
Base abstract class for all shapes.
virtual void ComputeNormal(const Double_t *point, const Double_t *dir, Double_t *norm)=0
virtual Double_t DistFromInside(const Double_t *point, const Double_t *dir, Int_t iact=1, Double_t step=TGeoShape::Big(), Double_t *safe=nullptr) const =0
virtual void GetMeshNumbers(Int_t &, Int_t &, Int_t &) const
virtual Bool_t GetPointsOnSegments(Int_t npoints, Double_t *array) const =0
static void SetTransform(TGeoMatrix *matrix)
Set current transformation matrix that applies to shape.
virtual Double_t Safety(const Double_t *point, Bool_t in=kTRUE) const =0
virtual const char * GetName() const
Get the shape name.
virtual Double_t DistFromOutside(const Double_t *point, const Double_t *dir, Int_t iact=1, Double_t step=TGeoShape::Big(), Double_t *safe=nullptr) const =0
virtual Double_t Capacity() const =0
virtual Bool_t Contains(const Double_t *point) const =0
static Double_t Tolerance()
virtual void SetPoints(Double_t *points) const =0
virtual void Draw(Option_t *option="")
Draw this shape.
Class describing translations.
TGeoVolume, TGeoVolumeMulti, TGeoVolumeAssembly are the volume classes.
TGeoMedium * GetMedium() const
Bool_t Contains(const Double_t *point) const
virtual TGeoNode * AddNode(TGeoVolume *vol, Int_t copy_no, TGeoMatrix *mat=nullptr, Option_t *option="")
Add a TGeoNode to the list of nodes.
TGeoMaterial * GetMaterial() const
Int_t GetNdaughters() const
virtual void SetLineStyle(Style_t lstyle)
Set the line style.
void VisibleDaughters(Bool_t vis=kTRUE)
set visibility for daughters
void FindOverlaps() const
loop all nodes marked as overlaps and find overlapping brothers
TGeoNode * GetNode(const char *name) const
get the pointer to a daughter node
virtual void SetVisibility(Bool_t vis=kTRUE)
set visibility of this volume
Int_t GetIndex(const TGeoNode *node) const
get index number for a given daughter
TGeoPatternFinder * GetFinder() const
TGeoVoxelFinder * GetVoxels() const
Getter for optimization structure.
TGeoShape * GetShape() const
virtual void Draw(Option_t *option="")
draw top volume according to option
virtual Int_t GetCurrentNodeIndex() const
virtual void DrawOnly(Option_t *option="")
draw only this volume
virtual void SetLineColor(Color_t lcolor)
Set the line color.
virtual Bool_t IsAssembly() const
Returns true if the volume is an assembly or a scaled assembly.
virtual Bool_t IsVisible() const
void InspectShape() const
Finder class handling voxels.
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 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 FindOverlaps(Int_t inode) const
create the list of nodes for which the bboxes overlap with inode's bbox
Bool_t NeedRebuild() const
1-D histogram with a double per channel (see TH1 documentation)}
1-D histogram with a float per channel (see TH1 documentation)}
virtual void LabelsOption(Option_t *option="h", Option_t *axis="X")
Sort bins with labels or set option(s) to draw axis with labels.
static void AddDirectory(Bool_t add=kTRUE)
Sets the flag controlling the automatic add of histograms in memory.
virtual Int_t Fill(Double_t x)
Increment bin with abscissa X by 1.
void Draw(Option_t *option="") override
Draw this histogram with options.
virtual UInt_t SetCanExtend(UInt_t extendBitMask)
Make the histogram axes extendable / not extendable according to the bit mask returns the previous bi...
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.
virtual void SetStats(Bool_t stats=kTRUE)
Set statistics option on/off.
2-D histogram with a float per channel (see TH1 documentation)}
Int_t Fill(Double_t) override
Invalid Fill method.
TObject * At(Int_t idx) const override
Returns the object at position idx. Returns 0 if idx is out of range.
virtual void SetTitle(const char *title="")
Set the title of the TNamed.
const char * GetName() const override
Returns name of object.
A simple TTree restricted to a list of float variables only.
Int_t Fill() override
Fill a Ntuple with current values in fArgs.
Int_t GetEntriesFast() const
Int_t IndexOf(const TObject *obj) const override
void AddAt(TObject *obj, Int_t idx) override
Add object at position ids.
Int_t GetEntries() const override
Return the number of objects in array (i.e.
TObject * At(Int_t idx) const override
TObject * RemoveAt(Int_t idx) override
Remove object at index idx.
void Add(TObject *obj) override
Mother of all ROOT objects.
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.
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
virtual void Draw(Option_t *option="")
Default Draw method for all objects.
virtual void Info(const char *method, const char *msgfmt,...) const
Issue info message.
A 3-dimensional polyline.
virtual void SetPoint(Int_t point, Double_t x, Double_t y, Double_t z)
Set point n to x, y, z.
virtual Int_t GetN() const
virtual Int_t SetNextPoint(Double_t x, Double_t y, Double_t z)
Set point following LastPoint to x, y, z.
void Draw(Option_t *option="") override
Draws 3-D polymarker with its current attributes.
Double_t Rndm() override
Machine independent random number generator.
virtual Double_t Uniform(Double_t x1=1)
Returns a uniform deviate on the interval (0, x1).
Double_t RealTime()
Stop the stopwatch (if it is running) and return the realtime (in seconds) passed between the start a...
void Start(Bool_t reset=kTRUE)
Start the stopwatch.
Double_t CpuTime()
Stop the stopwatch (if it is running) and return the cputime (in seconds) passed between the start an...
void Continue()
Resume a stopped stopwatch.
void Stop()
Stop the stopwatch.
void Print(Option_t *option="") const override
Print the real and cpu time passed between the start and stop events.
void ToLower()
Change string to lower-case.
TSubString Strip(EStripType s=kTrailing, char c=' ') const
Return a substring of self stripped at beginning and/or end.
const char * Data() const
TString & Remove(Ssiz_t pos)
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString.
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
Ssiz_t Index(const char *pat, Ssiz_t i=0, ECaseCompare cmp=kExact) const
void SetOptStat(Int_t stat=1)
The type of information printed in the histogram statistics box can be selected via the parameter mod...
A TTree represents a columnar dataset.
virtual Int_t Fill()
Fill all branches.
virtual Int_t GetEntry(Long64_t entry, Int_t getall=0)
Read all branches of entry and return total number of bytes read.
void Draw(Option_t *opt) override
Default Draw method for all objects.
virtual Int_t SetBranchAddress(const char *bname, void *add, TBranch **ptr=nullptr)
Change branch address, dealing with clone trees properly.
virtual Long64_t GetEntries() const
TBranch * Branch(const char *name, T *obj, Int_t bufsize=32000, Int_t splitlevel=99)
Add a new branch, and infer the data type from the type of obj being passed.
Int_t Write(const char *name=nullptr, Int_t option=0, Int_t bufsize=0) override
Write this object to the current directory.
void box(Int_t pat, Double_t x1, Double_t y1, Double_t x2, Double_t y2)
Double_t ACos(Double_t)
Returns the principal value of the arc cosine of x, expressed in radians.
Short_t Max(Short_t a, Short_t b)
Returns the largest of a and b.
Double_t Log(Double_t x)
Returns the natural logarithm of x.
Double_t Sqrt(Double_t x)
Returns the square root of x.
Short_t Min(Short_t a, Short_t b)
Returns the smallest of a and b.
Double_t Cos(Double_t)
Returns the cosine of an angle of x radians.
Double_t Sin(Double_t)
Returns the sine of an angle of x radians.
Short_t Abs(Short_t d)
Returns the absolute value of parameter Short_t d.
constexpr Double_t TwoPi()
Statefull info for the current geometry level.
#define dnext(otri1, otri2)
#define lnext(otri1, otri2)