46std::string getOptions()
49 if (grotate) opt.append(
"rotate;");
50 if (axis) opt.append(
"axis;");
55auto geomViewer = std::make_shared<ROOT::Experimental::REveGeomViewer>();
63 geomViewer->SetShowHierarchy(
false);
65 geomViewer->Show({600, 600, 160, 0});
72 geomViewer->SetDrawOptions(getOptions());
79 geomViewer->SetDrawOptions(getOptions());
87 helpWindow->CloseConnections();
100 return (1+
Int_t(color));
104std::string AddDbl(
const char *datamember,
Double_t value,
const char *comment)
110std::string AddInt(
const char *datamember,
Int_t value,
const char *comment)
116void help(
const std::vector<std::string> &info = {},
TGeoVolume *fvol =
nullptr,
Int_t iaxis = 0,
const std::vector<std::string> &info2 = {})
118 if (!info.empty() && !comments)
121 std::vector<std::string> lines({
122 " >>>>>>> web geometry viewer <<<<<< ",
123 " Demo for building TGeo basic shapes and simple geometry. Shape parameters are",
124 " displayed in the right pad",
125 "- Click left mouse button to execute one demo",
126 "- While pointing the mouse to the pad containing the geometry, do:",
127 "- .... click-and-move to rotate",
128 "- .... use mouse wheel for zooming",
129 "- .... double click for reset position",
130 "- Execute box(1,8) to divide a box in 8 equal slices along X",
131 "- Most shapes can be divided on X,Y,Z,Rxy or Phi :",
132 "- .... root[0] <shape>(IAXIS, NDIV, START, STEP);",
133 " .... IAXIS = 1,2,3 meaning (X,Y,Z) or (Rxy, Phi, Z)",
134 " .... NDIV = number of slices",
135 " .... START = start slicing position",
136 " .... STEP = division step",
137 "- Click Comments ON/OFF to toggle comments",
138 "- Click Ideal/Align geometry to see how alignment works"
141 helpWindow->SetDefaultPage(
"file:webhelp.html");
143 unsigned connid = helpWindow->GetDisplayConnection();
151 lines.emplace_back(
Form(
"Division of %s on axis %d (%s)", volume->
GetName(), iaxis, sh->
GetAxisName(iaxis)));
152 lines.emplace_back(AddInt(
"fNdiv",finder->
GetNdiv(),
"number of divisions"));
153 lines.emplace_back(AddDbl(
"fStart",finder->
GetStart(),
"start divisioning position"));
154 lines.emplace_back(AddDbl(
"fStep",finder->
GetStep(),
"division step"));
157 lines.insert(lines.end(), info2.begin(), info2.end());
160 if (lines.size() > 10) height = 50 + lines.size()*20;
162 if (!connid) connid = helpWindow->Show({600, height, 160, 650});
164 std::string msg =
"";
166 for (
auto &
line : lines) {
167 if (
line.empty())
continue;
168 std::string
style =
"", p =
"<p style='";
170 else if (
line.find(
"----")==0) {
style =
"color:red"; }
171 else if (
line.find(
"Execute")==0) {
style =
"color:blue"; }
172 else if (
line.find(
"Division")==0) {
style =
"font-size:120%;color:green"; }
173 if (
style.empty()) p =
"<p>";
else { p.append(
style); p.append(
"'>"); }
180 helpWindow->Send(connid,
"Initial text");
182 helpWindow->Send(connid, msg);
188 if (iaxis<0 || iaxis>3) {
189 printf(
"Wrong division axis. Range is 1-3.\n");
214 help({
"TGeoBBox - box class",
215 AddDbl(
"fDX",bbox->
GetDX(),
"half length in X"),
216 AddDbl(
"fDY",bbox->
GetDY(),
"half length in Y"),
217 AddDbl(
"fDZ",bbox->
GetDZ(),
"half length in Z"),
218 AddDbl(
"fOrigin[0]",(bbox->
GetOrigin())[0],
"box origin on X"),
219 AddDbl(
"fOrigin[1]",(bbox->
GetOrigin())[1],
"box origin on Y"),
220 AddDbl(
"fOrigin[2]",(bbox->
GetOrigin())[2],
"box origin on Z")},
222 {
"Execute: box(iaxis, ndiv, start, step) to divide this.",
223 "----- IAXIS can be 1, 2 or 3 (X, Y, Z)",
224 "----- NDIV must be a positive integer",
225 "----- START must be a valid axis offset within shape range on divided axis",
226 "----- STEP is the division step. START+NDIV*STEP must be in range also",
227 "----- If START and STEP are omitted, all range of the axis will be divided"});
233 if (iaxis<0 || iaxis>3) {
234 printf(
"Wrong division axis. Range is 1-3.\n");
259 help({
"TGeoPara - parallelepiped class",
260 AddDbl(
"fX", para->
GetX(),
"half length in X"),
261 AddDbl(
"fY", para->
GetY(),
"half length in Y"),
262 AddDbl(
"fZ", para->
GetZ(),
"half length in Z"),
263 AddDbl(
"fAlpha", para->
GetAlpha(),
"angle about Y of the Z bases"),
264 AddDbl(
"fTheta", para->
GetTheta(),
"inclination of para axis about Z"),
265 AddDbl(
"fPhi", para->
GetPhi(),
"phi angle of para axis")},
267 {
"Execute: para(iaxis, ndiv, start, step) to divide this.",
268 "----- IAXIS can be 1, 2 or 3 (X, Y, Z)",
"----- NDIV must be a positive integer",
269 "----- START must be a valid axis offset within shape range on divided axis",
270 "----- STEP is the division step. START+NDIV*STEP must be in range also",
271 "----- If START and STEP are omitted, all range of the axis will be divided"});
278 if (iaxis<0 || iaxis>3) {
279 printf(
"Wrong division axis. Range is 1-3.\n");
304 help({
"TGeoTube - tube class",
305 AddDbl(
"fRmin",tube->
GetRmin(),
"minimum radius"),
306 AddDbl(
"fRmax",tube->
GetRmax(),
"maximum radius"),
307 AddDbl(
"fDZ", tube->
GetDZ(),
"half length in Z")},
309 {
"Execute: tube(iaxis, ndiv, start, step) to divide this.",
310 "----- IAXIS can be 1, 2 or 3 (Rxy, Phi, Z)",
311 "----- NDIV must be a positive integer",
312 "----- START must be a valid axis offset within shape range on divided axis",
313 "----- STEP is the division step. START+NDIV*STEP must be in range also",
314 "----- If START and STEP are omitted, all range of the axis will be divided"});
322 if (iaxis<0 || iaxis>3) {
323 printf(
"Wrong division axis. Range is 1-3.\n");
350 help({
"TGeoTubeSeg - tube segment class",
351 AddDbl(
"fRmin",tubeseg->
GetRmin(),
"minimum radius"),
352 AddDbl(
"fRmax",tubeseg->
GetRmax(),
"maximum radius"),
353 AddDbl(
"fDZ", tubeseg->
GetDZ(),
"half length in Z"),
354 AddDbl(
"fPhi1",tubeseg->
GetPhi1(),
"first phi limit"),
355 AddDbl(
"fPhi2",tubeseg->
GetPhi2(),
"second phi limit")},
357 {
"Execute: tubeseg(iaxis, ndiv, start, step) to divide this.",
358 "----- IAXIS can be 1, 2 or 3 (Rxy, Phi, Z)",
359 "----- NDIV must be a positive integer",
360 "----- START must be a valid axis offset within shape range on divided axis",
361 "----- STEP is the division step. START+NDIV*STEP must be in range also",
362 "----- If START and STEP are omitted, all range of the axis will be divided"});
369 if (iaxis<0 || iaxis>2) {
370 printf(
"Wrong division axis. Range is 1-2.\n");
392 TGeoVolume *vol =
gGeoManager->
MakeCtub(
"CTUB",med, 20,30,40,-30,250, nlow[0], nlow[1], nlow[2], nhi[0],nhi[1],nhi[2]);
409 help({
"TGeoTubeSeg - tube segment class",
410 AddDbl(
"fRmin",tubeseg->
GetRmin(),
"minimum radius"),
411 AddDbl(
"fRmax",tubeseg->
GetRmax(),
"maximum radius"),
412 AddDbl(
"fDZ", tubeseg->
GetDZ(),
"half length in Z"),
413 AddDbl(
"fPhi1",tubeseg->
GetPhi1(),
"first phi limit"),
414 AddDbl(
"fPhi2",tubeseg->
GetPhi2(),
"second phi limit")},
422 if (iaxis<0 || iaxis>3) {
423 printf(
"Wrong division axis. Range is 1-3.\n");
425 }
else if (iaxis==1) {
426 printf(
"cannot divide cone on Rxy\n");
452 help({
"TGeoCone - cone class",
453 AddDbl(
"fDZ", cone->
GetDZ(),
"half length in Z"),
454 AddDbl(
"fRmin1",cone->
GetRmin1(),
"inner radius at -dz"),
455 AddDbl(
"fRmax1",cone->
GetRmax1(),
"outer radius at -dz"),
456 AddDbl(
"fRmin2",cone->
GetRmin2(),
"inner radius at +dz"),
457 AddDbl(
"fRmax2",cone->
GetRmax2(),
"outer radius at +dz")},
459 {
"Execute: cone(iaxis, ndiv, start, step) to divide this.",
460 "----- IAXIS can be 2 or 3 (Phi, Z)",
461 "----- NDIV must be a positive integer",
462 "----- START must be a valid axis offset within shape range on divided axis",
463 "----- STEP is the division step. START+NDIV*STEP must be in range also",
464 "----- If START and STEP are omitted, all range of the axis will be divided"});
471 if (iaxis<0 || iaxis>3) {
472 printf(
"Wrong division axis. Range is 1-3.\n");
498 help({
"TGeoConeSeg - coneseg class",
499 AddDbl(
"fDZ", coneseg->
GetDZ(),
"half length in Z"),
500 AddDbl(
"fRmin1",coneseg->
GetRmin1(),
"inner radius at -dz"),
501 AddDbl(
"fRmax1",coneseg->
GetRmax1(),
"outer radius at -dz"),
502 AddDbl(
"fRmin2",coneseg->
GetRmin1(),
"inner radius at +dz"),
503 AddDbl(
"fRmax2",coneseg->
GetRmax1(),
"outer radius at +dz"),
504 AddDbl(
"fPhi1",coneseg->
GetPhi1(),
"first phi limit"),
505 AddDbl(
"fPhi2",coneseg->
GetPhi2(),
"second phi limit")},
507 {
"Execute: coneseg(iaxis, ndiv, start, step) to divide this.",
508 "----- IAXIS can be 2 or 3 (Phi, Z)",
509 "----- NDIV must be a positive integer",
510 "----- START must be a valid axis offset within shape range on divided axis",
511 "----- STEP is the division step. START+NDIV*STEP must be in range also",
512 "----- If START and STEP are omitted, all range of the axis will be divided"});
541 help({
"TGeoEltu - eltu class",
542 AddDbl(
"fA",eltu->
GetA(),
"semi-axis along x"),
543 AddDbl(
"fB",eltu->
GetB(),
"semi-axis along y"),
544 AddDbl(
"fDZ", eltu->
GetDZ(),
"half length in Z")},
546 {
"Execute: eltu(iaxis, ndiv, start, step) to divide this.",
547 "----- IAXIS can be 2 or 3 (Phi, Z)",
548 "----- NDIV must be a positive integer",
549 "----- START must be a valid axis offset within shape range on divided axis",
550 "----- STEP is the division step. START+NDIV*STEP must be in range also",
551 "----- If START and STEP are omitted, all range of the axis will be divided"});
559 printf(
"Cannot divide spheres\n");
585 help({
"TGeoSphere- sphere class",
586 AddDbl(
"fRmin",sphere->
GetRmin(),
"inner radius"),
587 AddDbl(
"fRmax",sphere->
GetRmax(),
"outer radius"),
588 AddDbl(
"fTheta1",sphere->
GetTheta1(),
"lower theta limit"),
589 AddDbl(
"fTheta2",sphere->
GetTheta2(),
"higher theta limit"),
590 AddDbl(
"fPhi1",sphere->
GetPhi1(),
"lower phi limit"),
591 AddDbl(
"fPhi2",sphere->
GetPhi2(),
"higher phi limit")},
600 printf(
"Cannot divide a torus\n");
625 help({
"TGeoTorus - torus class",
626 AddDbl(
"fR",tor->
GetR(),
"radius of the ring"),
627 AddDbl(
"fRmin",tor->
GetRmin(),
"minimum radius"),
628 AddDbl(
"fRmax",tor->
GetRmax(),
"maximum radius"),
629 AddDbl(
"fPhi1", tor->
GetPhi1(),
"starting phi angle"),
630 AddDbl(
"fDphi", tor->
GetDphi(),
"phi range")},
637 if (iaxis<0 || iaxis>3) {
638 printf(
"Wrong division axis. Range is 1-3.\n");
640 }
else if (iaxis==1) {
641 printf(
"Cannot divide trd1 on X axis\n");
668 help({
"TGeoTrd1 - Trd1 class",
669 AddDbl(
"fDx1",trd1->
GetDx1(),
"half length in X at lower Z surface(-dz)"),
670 AddDbl(
"fDx2",trd1->
GetDx2(),
"half length in X at higher Z surface(+dz)"),
671 AddDbl(
"fDy",trd1->
GetDy(),
"half length in Y"),
672 AddDbl(
"fDz",trd1->
GetDz(),
"half length in Z")},
674 {
"Execute: trd1(iaxis, ndiv, start, step) to divide this.",
675 "----- IAXIS can be 2 or 3 (Y, Z)",
676 "----- NDIV must be a positive integer",
677 "----- START must be a valid axis offset within shape range on divided axis",
678 "----- STEP is the division step. START+NDIV*STEP must be in range also",
679 "----- If START and STEP are omitted, all range of the axis will be divided"});
702 help({
"TGeoParaboloid - Paraboloid class",
703 AddDbl(
"fRlo",par->
GetRlo(),
"radius at Z=-dz"),
704 AddDbl(
"fRhi",par->
GetRhi(),
"radius at Z=+dz"),
705 AddDbl(
"fDz",par->
GetDz(),
"half-length on Z axis"),
706 "----- A paraboloid is described by the equation:",
707 "----- z = a*r*r + b; where: r = x*x + y*y",
708 "----- Create with: TGeoParaboloid *parab = new TGeoParaboloid(rlo, rhi, dz);",
709 "----- dz: half-length in Z (range from -dz to +dz",
710 "----- rlo: radius at z=-dz given by: -dz = a*rlo*rlo + b",
711 "----- rhi: radius at z=+dz given by: dz = a*rhi*rhi + b",
712 "----- rlo != rhi; both >= 0"});
734 help({
"TGeoHype - Hyperboloid class",
735 AddDbl(
"fRmin",hype->
GetRmin(),
"minimum inner radius"),
736 AddDbl(
"fStIn",hype->
GetStIn(),
"inner surface stereo angle [deg]"),
737 AddDbl(
"fRmax",hype->
GetRmax(),
"minimum outer radius"),
738 AddDbl(
"fStOut",hype->
GetStOut(),
"outer surface stereo angle [deg]"),
739 AddDbl(
"fDz",hype->
GetDz(),
"half-length on Z axis"),
740 "----- A hyperboloid is described by the equation:",
741 "----- r^2 - (tan(stereo)*z)^2 = rmin^2; where: r = x*x + y*y",
742 "----- Create with: TGeoHype *hype = new TGeoHype(rin, stin, rout, stout, dz);",
743 "----- rin < rout; rout > 0",
744 "----- rin = 0; stin > 0 => inner surface conical",
745 "----- stin/stout = 0 => corresponding surface cylindrical"});
751 if (iaxis<0 || iaxis>3) {
752 printf(
"Wrong division axis. Range is 1-3.\n");
754 }
else if (iaxis==1) {
755 printf(
"Cannot divide pcon on Rxy\n");
784 std::vector<std::string> lines = {
"TGeoPcon - pcon class",
785 AddDbl(
"fPhi1",pcon->
GetPhi1(),
"lower phi limit"),
786 AddDbl(
"fDphi",pcon->
GetDphi(),
"phi range"),
787 AddDbl(
"fNz",pcon->
GetNz(),
"number of z planes")};
790 lines.emplace_back(
Form(
"fZ[%i]=%5.2f fRmin[%i]=%5.2f fRmax[%i]=%5.2f",
793 help(lines, vol, iaxis,
794 {
"Execute: pcon(iaxis, ndiv, start, step) to divide this.",
795 "----- IAXIS can be 2 or 3 (Phi, Z)",
796 "----- NDIV must be a positive integer",
797 "----- START must be a valid axis offset within shape range on divided axis",
798 "----- STEP is the division step. START+NDIV*STEP must be in range also",
799 "----- If START and STEP are omitted, all range of the axis will be divided"});
806 if (iaxis<0 || iaxis>3) {
807 printf(
"Wrong division axis. Range is 1-3.\n");
809 }
else if (iaxis==1) {
810 printf(
"Cannot divide pgon on Rxy\n");
839 std::vector<std::string> lines({
"TGeoPgon - pgon class",
840 AddDbl(
"fPhi1",pgon->
GetPhi1(),
"lower phi limit"),
841 AddDbl(
"fDphi",pgon->
GetDphi(),
"phi range"),
842 AddDbl(
"fNedges",pgon->
GetNedges(),
"number of edges"),
843 AddDbl(
"fNz",pgon->
GetNz(),
"number of z planes")});
846 lines.emplace_back(
Form(
"fZ[%i]=%5.2f fRmin[%i]=%5.2f fRmax[%i]=%5.2f",
849 help(lines, vol, iaxis,
850 {
"Execute: pgon(iaxis, ndiv, start, step) to divide this.",
851 "----- IAXIS can be 2 or 3 (Phi, Z)",
852 "----- NDIV must be a positive integer",
853 "----- START must be a valid axis offset within shape range on divided axis",
854 "----- STEP is the division step. START+NDIV*STEP must be in range also",
855 "----- If START and STEP are omitted, all range of the axis will be divided"});
864 printf(
"Cannot divide arb8\n");
897 std::vector<std::string> lines({
"TGeoArb8 - arb8 class",
898 AddDbl(
"fDz",arb->
GetDz(),
"Z half length"),
899 "Vertices on lower Z plane:"});
902 for (
Int_t i=0; i<8; i++) {
903 if (i==4) lines.emplace_back(
"Vertices on higher Z plane:");
904 lines.emplace_back(
Form(
" fXY[%d] = (%5.2f, %5.2f)", i, vert[2*i], vert[2*i+1]));
907 help(lines, vol, iaxis);
914 if (iaxis && iaxis!=3) {
915 printf(
"Wrong division axis. trd2 can divide only in Z (3)\n");
941 help({
"TGeoTrd2 - Trd2 class",
942 AddDbl(
"fDx1",trd2->
GetDx1(),
"half length in X at lower Z surface(-dz)"),
943 AddDbl(
"fDx2",trd2->
GetDx2(),
"half length in X at higher Z surface(+dz)"),
944 AddDbl(
"fDy1",trd2->
GetDy1(),
"half length in Y at lower Z surface(-dz)"),
945 AddDbl(
"fDy2",trd2->
GetDy2(),
"half length in Y at higher Z surface(-dz)"),
946 AddDbl(
"fDz",trd2->
GetDz(),
"half length in Z")},
948 {
"Execute: trd2(iaxis, ndiv, start, step) to divide this.",
949 "----- IAXIS can be only 3 (Z)",
950 "----- NDIV must be a positive integer",
951 "----- START must be a valid axis offset within shape range on divided axis",
952 "----- STEP is the division step. START+NDIV*STEP must be in range also",
953 "----- If START and STEP are omitted, all range of the axis will be divided"});
960 if (iaxis && iaxis!=3) {
961 printf(
"Wrong division axis. Can divide only in Z (3)\n");
971 TGeoVolume *vol =
gGeoManager->
MakeTrap(
"Trap",med, 30,15,30,20,10,15,0,20,10,15,0);
987 help({
"TGeoTrap - Trapezoid class",
988 AddDbl(
"fDz",trap->
GetDz(),
"half length in Z"),
989 AddDbl(
"fTheta",trap->
GetTheta(),
"theta angle of trapezoid axis"),
990 AddDbl(
"fPhi",trap->
GetPhi(),
"phi angle of trapezoid axis"),
991 AddDbl(
"fH1",trap->
GetH1(),
"half length in y at -fDz"),
992 AddDbl(
"fAlpha1",trap->
GetAlpha1(),
"angle between centers of x edges and y axis at -fDz"),
993 AddDbl(
"fBl1",trap->
GetBl1(),
"half length in x at -dZ and y=-fH1"),
994 AddDbl(
"fTl1",trap->
GetTl1(),
"half length in x at -dZ and y=+fH1"),
995 AddDbl(
"fH2",trap->
GetH2(),
"half length in y at +fDz"),
996 AddDbl(
"fBl2",trap->
GetBl2(),
"half length in x at +dZ and y=-fH1"),
997 AddDbl(
"fTl2",trap->
GetTl2(),
"half length in x at +dZ and y=+fH1"),
998 AddDbl(
"fAlpha2",trap->
GetAlpha2(),
"angle between centers of x edges and y axis at +fDz")},
1000 {
"Execute: trap(iaxis, ndiv, start, step) to divide this.",
1001 "----- IAXIS can be only 3 (Z)",
1002 "----- NDIV must be a positive integer",
1003 "----- START must be a valid axis offset within shape range on divided axis",
1004 "----- STEP is the division step. START+NDIV*STEP must be in range also",
1005 "----- If START and STEP are omitted, all range of the axis will be divided"});
1012 if (iaxis && iaxis!=3) {
1013 printf(
"Wrong division axis. Can divide only in Z (3)\n");
1023 TGeoVolume *vol =
gGeoManager->
MakeGtra(
"Gtra",med, 30,15,30,30,20,10,15,0,20,10,15,0);
1039 help({
"TGeoGtra - Twisted trapezoid class",
1040 AddDbl(
"fDz",trap->
GetDz(),
"half length in Z"),
1041 AddDbl(
"fTheta",trap->
GetTheta(),
"theta angle of trapezoid axis"),
1042 AddDbl(
"fPhi",trap->
GetPhi(),
"phi angle of trapezoid axis"),
1044 AddDbl(
"fH1",trap->
GetH1(),
"half length in y at -fDz"),
1045 AddDbl(
"fAlpha1",trap->
GetAlpha1(),
"angle between centers of x edges and y axis at -fDz"),
1046 AddDbl(
"fBl1",trap->
GetBl1(),
"half length in x at -dZ and y=-fH1"),
1047 AddDbl(
"fTl1",trap->
GetTl1(),
"half length in x at -dZ and y=+fH1"),
1048 AddDbl(
"fH2",trap->
GetH2(),
"half length in y at +fDz"),
1049 AddDbl(
"fBl2",trap->
GetBl2(),
"half length in x at +dZ and y=-fH1"),
1050 AddDbl(
"fTl2",trap->
GetTl2(),
"half length in x at +dZ and y=+fH1"),
1051 AddDbl(
"fAlpha2",trap->
GetAlpha2(),
"angle between centers of x edges and y axis at +fDz")},
1053 {
"Execute: gtra(iaxis, ndiv, start, step) to divide this.",
1054 "----- IAXIS can be only 3 (Z)",
1055 "----- NDIV must be a positive integer",
1056 "----- START must be a valid axis offset within shape range on divided axis",
1057 "----- STEP is the division step. START+NDIV*STEP must be in range also",
1058 "----- If START and STEP are omitted, all range of the axis will be divided"});
1073 Double_t x[8] = {-30,-30,30,30,15,15,-15,-15};
1074 Double_t y[8] = {-30,30,30,-30,-30,15,15,-30};
1088 help({
"TGeoXtru - Polygonal extrusion class",
1089 AddDbl(
"fNvert",xtru->
GetNvert(),
"number of polygone vertices"),
1090 AddDbl(
"fNz",xtru->
GetNz(),
"number of Z sections"),
1091 "----- Any Z section is an arbitrary polygone",
1092 "----- The shape can have an arbitrary number of Z sections, as for pcon/pgon",
1093 "----- Create with: TGeoXtru *xtru = new TGeoXtru(nz);",
1094 "----- Define the blueprint polygon :",
1095 "----- Double_t x[8] = {-30,-30,30,30,15,15,-15,-15};",
1096 "----- Double_t y[8] = {-30,30,30,-30,-30,15,15,-30};",
1097 "----- xtru->DefinePolygon(8,x,y);",
1098 "----- Define translations/scales of the blueprint for Z sections :",
1099 "----- xtru->DefineSection(i, Zsection, x0, y0, scale);",
1100 "----- Sections have to be defined in increasing Z order",
1101 "----- 2 sections can be defined at same Z (not for first/last sections)"});
1116 std::vector<Tessellated::Vertex_t> vert;
1118 vert.emplace_back(0, 0.5 * (1 + sqrt5), -1); vert.emplace_back(0, 0.5 * (-1 + sqrt5), 0.5 * (-1 - sqrt5)); vert.emplace_back(-1, 0, 0.5 * (-1 - sqrt5)); vert.emplace_back(-1, 1, -1);
1119 vert.emplace_back(1, 1, -1); vert.emplace_back(0, 0.5 * (1 + sqrt5), -1); vert.emplace_back(0, 0.5 * (-1 + sqrt5), 0.5 * (-1 - sqrt5)); vert.emplace_back(1, 0, 0.5 * (-1 - sqrt5));
1120 vert.emplace_back(1, 1, -1); vert.emplace_back(0, 0.5 * (1 + sqrt5), -1); vert.emplace_back(0.5 * (-1 + sqrt5), 0.5 * (1 + sqrt5), 0); vert.emplace_back(0.5 * (1 + sqrt5), 1, 0);
1121 vert.emplace_back(0.5 * (1 - sqrt5), 0.5 * (1 + sqrt5), 0); vert.emplace_back(0, 0.5 * (1 + sqrt5), -1); vert.emplace_back(0.5 * (-1 + sqrt5), 0.5 * (1 + sqrt5), 0); vert.emplace_back(0, 0.5 * (1 + sqrt5), 1);
1122 vert.emplace_back(0.5 * (1 - sqrt5), 0.5 * (1 + sqrt5), 0); vert.emplace_back(0, 0.5 * (1 + sqrt5), -1); vert.emplace_back(-1, 1, -1); vert.emplace_back(0.5 * (-1 - sqrt5), 1, 0);
1123 vert.emplace_back(1, 1, -1); vert.emplace_back(0.5 * (1 + sqrt5), 1, 0); vert.emplace_back(0.5 * (1 + sqrt5), 0, 0.5 * (1 - sqrt5)); vert.emplace_back(1, 0, 0.5 * (-1 - sqrt5));
1124 vert.emplace_back(0.5 * (1 + sqrt5), 0, 0.5 * (1 - sqrt5)); vert.emplace_back(0.5 * (1 + sqrt5), -1, 0); vert.emplace_back(1, -1, -1); vert.emplace_back(1, 0, 0.5 * (-1 - sqrt5));
1125 vert.emplace_back(1, -1, -1); vert.emplace_back(0, 0.5 * (-1 - sqrt5), -1); vert.emplace_back(0, 0.5 * (1 - sqrt5), 0.5 * (-1 - sqrt5)); vert.emplace_back(1, 0, 0.5 * (-1 - sqrt5));
1126 vert.emplace_back(1, 0, 0.5 * (-1 - sqrt5)); vert.emplace_back(0, 0.5 * (-1 + sqrt5), 0.5 * (-1 - sqrt5)); vert.emplace_back(-1, 0, 0.5 * (-1 - sqrt5)); vert.emplace_back(0, 0.5 * (1 - sqrt5), 0.5 * (-1 - sqrt5));
1127 vert.emplace_back(0.5 * (-1 + sqrt5), 0.5 * (1 + sqrt5), 0); vert.emplace_back(0.5 * (1 + sqrt5), 1, 0); vert.emplace_back(1, 1, 1); vert.emplace_back(0, 0.5 * (1 + sqrt5), 1);
1128 vert.emplace_back(0.5 * (1 + sqrt5), 1, 0); vert.emplace_back(1, 1, 1); vert.emplace_back(1, 0, 0.5 * (1 + sqrt5)); vert.emplace_back(0.5 * (1 + sqrt5), 0, 0.5 * (-1 + sqrt5));
1129 vert.emplace_back(0.5 * (1 + sqrt5), 0, 0.5 * (1 - sqrt5)); vert.emplace_back(0.5 * (1 + sqrt5), 1, 0); vert.emplace_back(0.5 * (1 + sqrt5), 0, 0.5 * (-1 + sqrt5)); vert.emplace_back(0.5 * (1 + sqrt5), -1, 0);
1130 vert.emplace_back(0.5 * (1 - sqrt5), 0.5 * (1 + sqrt5), 0); vert.emplace_back(0, 0.5 * (1 + sqrt5), 1); vert.emplace_back(-1, 1, 1); vert.emplace_back(0.5 * (-1 - sqrt5), 1, 0);
1131 vert.emplace_back(0, 0.5 * (1 + sqrt5), 1); vert.emplace_back(0, 0.5 * (-1 + sqrt5), 0.5 * (1 + sqrt5)); vert.emplace_back(-1, 0, 0.5 * (1 + sqrt5)); vert.emplace_back(-1, 1, 1);
1132 vert.emplace_back(1, 1, 1); vert.emplace_back(0, 0.5 * (1 + sqrt5), 1); vert.emplace_back(0, 0.5 * (-1 + sqrt5), 0.5 * (1 + sqrt5)); vert.emplace_back(1, 0, 0.5 * (1 + sqrt5));
1133 vert.emplace_back(0, 0.5 * (1 - sqrt5), 0.5 * (1 + sqrt5)); vert.emplace_back(-1, 0, 0.5 * (1 + sqrt5)); vert.emplace_back(0, 0.5 * (-1 + sqrt5), 0.5 * (1 + sqrt5)); vert.emplace_back(1, 0, 0.5 * (1 + sqrt5));
1134 vert.emplace_back(0, 0.5 * (1 - sqrt5), 0.5 * (1 + sqrt5)); vert.emplace_back(1, 0, 0.5 * (1 + sqrt5)); vert.emplace_back(1, -1, 1); vert.emplace_back(0, 0.5 * (-1 - sqrt5), 1);
1135 vert.emplace_back(0.5 * (1 + sqrt5), 0, 0.5 * (-1 + sqrt5)); vert.emplace_back(0.5 * (1 + sqrt5), -1, 0); vert.emplace_back(1, -1, 1); vert.emplace_back(1, 0, 0.5 * (1 + sqrt5));
1136 vert.emplace_back(-1, 0, 0.5 * (1 + sqrt5)); vert.emplace_back(-1, 1, 1); vert.emplace_back(0.5 * (-1 - sqrt5), 1, 0); vert.emplace_back(0.5 * (-1 - sqrt5), 0, 0.5 * (-1 + sqrt5));
1137 vert.emplace_back(-1, -1, 1); vert.emplace_back(-1, 0, 0.5 * (1 + sqrt5)); vert.emplace_back(0.5 * (-1 - sqrt5), 0, 0.5 * (-1 + sqrt5)); vert.emplace_back(0.5 * (-1 - sqrt5), -1, 0);
1138 vert.emplace_back(0, 0.5 * (1 - sqrt5), 0.5 * (1 + sqrt5)); vert.emplace_back(-1, 0, 0.5 * (1 + sqrt5)); vert.emplace_back(-1, -1, 1); vert.emplace_back(0, 0.5 * (-1 - sqrt5), 1);
1139 vert.emplace_back(0.5 * (-1 - sqrt5), -1, 0); vert.emplace_back(0.5 * (-1 - sqrt5), 0, 0.5 * (1 - sqrt5)); vert.emplace_back(0.5 * (-1 - sqrt5), 1, 0); vert.emplace_back(0.5 * (-1 - sqrt5), 0, 0.5 * (-1 + sqrt5));
1140 vert.emplace_back(0.5 * (-1 - sqrt5), -1, 0); vert.emplace_back(0.5 * (-1 - sqrt5), 0, 0.5 * (1 - sqrt5)); vert.emplace_back(-1, 0, 0.5 * (-1 - sqrt5)); vert.emplace_back(-1, -1, -1);
1141 vert.emplace_back(0, 0.5 * (-1 - sqrt5), -1); vert.emplace_back(0.5 * (1 - sqrt5), 0.5 * (-1 - sqrt5), 0); vert.emplace_back(0.5 * (-1 - sqrt5), -1, 0); vert.emplace_back(-1, -1, -1);
1142 vert.emplace_back(0.5 * (1 - sqrt5), 0.5 * (-1 - sqrt5), 0); vert.emplace_back(0.5 * (-1 - sqrt5), -1, 0); vert.emplace_back(-1, -1, 1); vert.emplace_back(0, 0.5 * (-1 - sqrt5), 1);
1143 vert.emplace_back(-1, 1, -1); vert.emplace_back(-1, 0, 0.5 * (-1 - sqrt5)); vert.emplace_back(0.5 * (-1 - sqrt5), 0, 0.5 * (1 - sqrt5)); vert.emplace_back(0.5 * (-1 - sqrt5), 1, 0);
1144 vert.emplace_back(0, 0.5 * (-1 - sqrt5), -1); vert.emplace_back(0, 0.5 * (1 - sqrt5), 0.5 * (-1 - sqrt5)); vert.emplace_back(-1, 0, 0.5 * (-1 - sqrt5)); vert.emplace_back(-1, -1, -1);
1145 vert.emplace_back(0, 0.5 * (-1 - sqrt5), -1); vert.emplace_back(0.5 * (1 - sqrt5), 0.5 * (-1 - sqrt5), 0); vert.emplace_back(0, 0.5 * (-1 - sqrt5), 1); vert.emplace_back(0.5 * (-1 + sqrt5), 0.5 * (-1 - sqrt5), 0);
1146 vert.emplace_back(1, -1, -1); vert.emplace_back(0.5 * (1 + sqrt5), -1, 0); vert.emplace_back(0.5 * (-1 + sqrt5), 0.5 * (-1 - sqrt5), 0); vert.emplace_back(0, 0.5 * (-1 - sqrt5), -1);
1147 vert.emplace_back(0.5 * (1 + sqrt5), -1, 0); vert.emplace_back(1, -1, 1); vert.emplace_back(0, 0.5 * (-1 - sqrt5), 1); vert.emplace_back(0.5 * (-1 + sqrt5), 0.5 * (-1 - sqrt5), 0);
1149 tsl->
AddFacet(vert[0], vert[1], vert[2], vert[3]);
1150 tsl->
AddFacet(vert[4], vert[7], vert[6], vert[5]);
1151 tsl->
AddFacet(vert[8], vert[9], vert[10], vert[11]);
1152 tsl->
AddFacet(vert[12], vert[15], vert[14], vert[13]);
1153 tsl->
AddFacet(vert[16], vert[17], vert[18], vert[19]);
1154 tsl->
AddFacet(vert[20], vert[21], vert[22], vert[23]);
1155 tsl->
AddFacet(vert[24], vert[25], vert[26], vert[27]);
1156 tsl->
AddFacet(vert[28], vert[29], vert[30], vert[31]);
1157 tsl->
AddFacet(vert[32], vert[35], vert[34], vert[33]);
1158 tsl->
AddFacet(vert[36], vert[39], vert[38], vert[37]);
1159 tsl->
AddFacet(vert[40], vert[41], vert[42], vert[43]);
1160 tsl->
AddFacet(vert[44], vert[45], vert[46], vert[47]);
1161 tsl->
AddFacet(vert[48], vert[51], vert[50], vert[49]);
1162 tsl->
AddFacet(vert[52], vert[55], vert[54], vert[53]);
1163 tsl->
AddFacet(vert[56], vert[57], vert[58], vert[59]);
1164 tsl->
AddFacet(vert[60], vert[63], vert[62], vert[61]);
1165 tsl->
AddFacet(vert[64], vert[67], vert[66], vert[65]);
1166 tsl->
AddFacet(vert[68], vert[71], vert[70], vert[69]);
1167 tsl->
AddFacet(vert[72], vert[73], vert[74], vert[75]);
1168 tsl->
AddFacet(vert[76], vert[77], vert[78], vert[79]);
1169 tsl->
AddFacet(vert[80], vert[81], vert[82], vert[83]);
1170 tsl->
AddFacet(vert[84], vert[87], vert[86], vert[85]);
1171 tsl->
AddFacet(vert[88], vert[89], vert[90], vert[91]);
1172 tsl->
AddFacet(vert[92], vert[93], vert[94], vert[95]);
1173 tsl->
AddFacet(vert[96], vert[99], vert[98], vert[97]);
1174 tsl->
AddFacet(vert[100], vert[101], vert[102], vert[103]);
1175 tsl->
AddFacet(vert[104], vert[107], vert[106], vert[105]);
1176 tsl->
AddFacet(vert[108], vert[111], vert[110], vert[109]);
1177 tsl->
AddFacet(vert[112], vert[113], vert[114], vert[115]);
1178 tsl->
AddFacet(vert[116], vert[117], vert[118], vert[119]);
1188 help( {
"TGeoTessellated - Tessellated shape class",
1189 AddInt(
"fNfacets",tsl->
GetNfacets(),
"number of facets"),
1190 AddInt(
"fNvertices",tsl->
GetNvertices(),
"number of vertices"),
1191 "----- A tessellated shape is defined by the number of facets",
1192 "----- facets can be added using AddFacet",
1193 "----- Create with: TGeoTessellated *tsl = new TGeoTessellated(nfacets);"});
1229 help({
"TGeoCompositeShape - composite shape class",
1230 "----- Define the shape components and don't forget to name them",
1231 "----- Define geometrical transformations that apply to shape components",
1232 "----- Name all transformations and register them",
1233 "----- Define the composite shape based on a Boolean expression",
1234 " TGeoCompositeShape(\"someName\", \"expression\")",
1235 "----- Expression is made of <shapeName:transfName> components related by Boolean operators",
1236 "----- Boolean operators can be: (+) union, (-) subtraction and (*) intersection",
1237 "----- Use parenthesis in the expression to force precedence"});
1295 help({
"Ideal / Aligned geometry",
1296 "-- Create physical nodes for the objects you want to align",
1297 "-- You must start from a valid CLOSED geometry",
1298 " TGeoPhysicalNode *node = gGeoManager->MakePhysicalNode(const char *path)",
1299 " + creates a physical node represented by path, e.g. TOP_1/A_2/B_3",
1300 " node->Align(TGeoMatrix *newmat, TGeoShape *newshape, Bool_t check=kFALSE)",
1301 " + newmat = new matrix to replace final node LOCAL matrix",
1302 " + newshape = new shape to replace final node shape",
1303 " + check = optional check if the new aligned node is overlapping"});
1311 printf(
"Click: <Ideal geometry> first\n");
1318 for (
Int_t i=1; i<=10; i++) {
1319 for (
Int_t j=1; j<=10; j++) {
1321 sprintf(
name,
"TOP_1/SX_%d/SY_%d/CELL_1",i,j);
1340 mainWindow->TerminateROOT();
1348 mainWindow->SetDefaultPage(
"file:webdemo.html");
1351 mainWindow->SetDataCallBack([](
unsigned connid,
const std::string &arg) {
1352 gROOT->ProcessLine(arg.c_str());
1355 mainWindow->Show({150,750, 0,0});
1357 geomViewer->SetDrawOptions(getOptions());
R__EXTERN TGeoManager * gGeoManager
R__EXTERN TRandom * gRandom
char * Form(const char *fmt,...)
static std::shared_ptr< RWebWindow > Create()
Create new RWebWindow Using default RWebWindowsManager.
An arbitrary trapezoid with less than 8 vertices standing on two parallel planes perpendicular to Z a...
virtual void SetVertex(Int_t vnum, Double_t x, Double_t y)
Set values for a given vertex.
virtual const Double_t * GetOrigin() const
virtual Double_t GetDX() const
virtual Double_t GetDZ() const
virtual Double_t GetDY() const
Class handling Boolean composition of shapes.
A phi segment of a conical tube.
virtual Double_t GetRmax2() const
virtual Double_t GetRmin2() const
virtual Double_t GetRmin1() const
virtual Double_t GetRmax1() const
virtual Double_t GetA() const
virtual Double_t GetB() const
Gtra is a twisted trapezoid.
Double_t GetTwistAngle() const
Hyperboloid class defined by 5 parameters.
Double_t GetStOut() const
The manager class for any TGeo geometry.
TGeoVolume * MakeCone(const char *name, TGeoMedium *medium, Double_t dz, Double_t rmin1, Double_t rmax1, Double_t rmin2, Double_t rmax2)
Make in one step a volume pointing to a cone shape with given medium.
TGeoVolume * MakeXtru(const char *name, TGeoMedium *medium, Int_t nz)
Make a TGeoXtru-shaped volume with nz planes.
TGeoVolume * MakePcon(const char *name, TGeoMedium *medium, Double_t phi, Double_t dphi, Int_t nz)
Make in one step a volume pointing to a polycone shape with given medium.
TGeoVolume * MakeTube(const char *name, TGeoMedium *medium, Double_t rmin, Double_t rmax, Double_t dz)
Make in one step a volume pointing to a tube shape with given medium.
TGeoVolume * MakeCons(const char *name, TGeoMedium *medium, Double_t dz, Double_t rmin1, Double_t rmax1, Double_t rmin2, Double_t rmax2, Double_t phi1, Double_t phi2)
Make in one step a volume pointing to a cone segment shape with given medium.
TGeoVolume * MakePara(const char *name, TGeoMedium *medium, Double_t dx, Double_t dy, Double_t dz, Double_t alpha, Double_t theta, Double_t phi)
Make in one step a volume pointing to a parallelepiped shape with given medium.
TGeoVolume * MakeTorus(const char *name, TGeoMedium *medium, Double_t r, Double_t rmin, Double_t rmax, Double_t phi1=0, Double_t dphi=360)
Make in one step a volume pointing to a torus shape with given medium.
void CloseGeometry(Option_t *option="d")
Closing geometry implies checking the geometry validity, fixing shapes with negative parameters (run-...
TGeoVolume * MakeTrd2(const char *name, TGeoMedium *medium, Double_t dx1, Double_t dx2, Double_t dy1, Double_t dy2, Double_t dz)
Make in one step a volume pointing to a TGeoTrd2 shape with given medium.
TGeoVolume * MakeGtra(const char *name, TGeoMedium *medium, Double_t dz, Double_t theta, Double_t phi, Double_t twist, Double_t h1, Double_t bl1, Double_t tl1, Double_t alpha1, Double_t h2, Double_t bl2, Double_t tl2, Double_t alpha2)
Make in one step a volume pointing to a twisted trapezoid shape with given medium.
TGeoVolume * MakeBox(const char *name, TGeoMedium *medium, Double_t dx, Double_t dy, Double_t dz)
Make in one step a volume pointing to a box shape with given medium.
TGeoVolume * MakeTrd1(const char *name, TGeoMedium *medium, Double_t dx1, Double_t dx2, Double_t dy, Double_t dz)
Make in one step a volume pointing to a TGeoTrd1 shape with given medium.
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.
void SetTopVolume(TGeoVolume *vol)
Set the top volume and corresponding node as starting point of the geometry.
TGeoVolume * MakeCtub(const char *name, TGeoMedium *medium, Double_t rmin, Double_t rmax, Double_t dz, Double_t phi1, Double_t phi2, Double_t lx, Double_t ly, Double_t lz, Double_t tx, Double_t ty, Double_t tz)
Make in one step a volume pointing to a tube segment shape with given medium.
TGeoVolume * MakePgon(const char *name, TGeoMedium *medium, Double_t phi, Double_t dphi, Int_t nedges, Int_t nz)
Make in one step a volume pointing to a polygone shape with given medium.
TGeoVolume * MakeTrap(const char *name, TGeoMedium *medium, Double_t dz, Double_t theta, Double_t phi, Double_t h1, Double_t bl1, Double_t tl1, Double_t alpha1, Double_t h2, Double_t bl2, Double_t tl2, Double_t alpha2)
Make in one step a volume pointing to a trapezoid shape with given medium.
void SetNsegments(Int_t nseg)
Set number of segments for approximating circles in drawing.
TGeoPhysicalNode * MakePhysicalNode(const char *path=0)
Makes a physical node corresponding to a path.
TObjArray * GetListOfPhysicalNodes()
TGeoVolume * MakeHype(const char *name, TGeoMedium *medium, Double_t rin, Double_t stin, Double_t rout, Double_t stout, Double_t dz)
Make in one step a volume pointing to a tube shape with given medium.
TGeoVolume * MakeParaboloid(const char *name, TGeoMedium *medium, Double_t rlo, Double_t rhi, Double_t dz)
Make in one step a volume pointing to a tube shape with given medium.
TGeoVolume * MakeTubs(const char *name, TGeoMedium *medium, Double_t rmin, Double_t rmax, Double_t dz, Double_t phi1, Double_t phi2)
Make in one step a volume pointing to a tube segment shape with given medium.
TGeoVolume * MakeEltu(const char *name, TGeoMedium *medium, Double_t a, Double_t b, Double_t dz)
Make in one step a volume pointing to a tube shape with given medium.
Base class describing materials.
virtual void RegisterYourself()
Register the matrix in the current manager, which will become the owner.
Media are used to store properties related to tracking and which are useful only when using geometry ...
virtual TGeoMatrix * GetMatrix() const =0
Double_t GetAlpha() const
Double_t GetTheta() const
Base finder class for patterns.
TGeoVolume * GetVolume() const
Double_t GetStart() const
Double_t * GetRmax() const
virtual void DefineSection(Int_t snum, Double_t z, Double_t rmin, Double_t rmax)
Defines z position of a section plane, rmin and rmax at this z.
Double_t * GetRmin() const
Physical nodes are the actual 'touchable' objects in the geometry, representing a path of positioned ...
TGeoNode * GetNode(Int_t level=-1) const
Return node in branch at LEVEL. If not specified, return last leaf.
Bool_t Align(TGeoMatrix *newmat=0, TGeoShape *newshape=0, Bool_t check=kFALSE, Double_t ovlp=0.001)
Align a physical node with a new relative matrix/shape.
Base abstract class for all shapes.
virtual const char * GetAxisName(Int_t iaxis) const =0
virtual Double_t GetRmin() const
Double_t GetTheta2() const
virtual Double_t GetRmax() const
Double_t GetTheta1() const
bool AddFacet(const Vertex_t &pt0, const Vertex_t &pt1, const Vertex_t &pt2)
Adding a triangular facet from vertex positions in absolute coordinates.
Class describing translations.
void SetTranslation(Double_t dx, Double_t dy, Double_t dz)
Set translation components.
TRAP is a general trapezoid, i.e.
Double_t GetAlpha2() const
Double_t GetTheta() const
Double_t GetAlpha1() const
A trapezoid with only x length varying with z.
A trapezoid with both x and y lengths varying with z.
virtual Double_t GetRmin() const
virtual Double_t GetDz() const
virtual Double_t GetRmax() const
TGeoVolume, TGeoVolumeMulti, TGeoVolumeAssembly are the volume classes.
virtual TGeoNode * AddNode(TGeoVolume *vol, Int_t copy_no, TGeoMatrix *mat=0, Option_t *option="")
Add a TGeoNode to the list of nodes.
TGeoPatternFinder * GetFinder() const
TGeoShape * GetShape() const
virtual TGeoVolume * Divide(const char *divname, Int_t iaxis, Int_t ndiv, Double_t start, Double_t step, Int_t numed=0, Option_t *option="")
Division a la G3.
virtual void SetLineWidth(Width_t lwidth)
Set the line width.
virtual void SetLineColor(Color_t lcolor)
Set the line color.
An extrusion with fixed outline shape in x-y and a sequence of z extents (segments).
Bool_t DefinePolygon(Int_t nvert, const Double_t *xv, const Double_t *yv)
Creates the polygon representing the blueprint of any Xtru section.
virtual void DefineSection(Int_t snum, Double_t z, Double_t x0=0., Double_t y0=0., Double_t scale=1.)
defines z position of a section plane, rmin and rmax at this z.
virtual void SetName(const char *name)
Set the name of the TNamed.
virtual const char * GetName() const
Returns name of object.
TObject * At(Int_t idx) const
Mother of all ROOT objects.
virtual Double_t Rndm()
Machine independent random number generator.
const char * Data() const
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString.
void box(Int_t pat, Double_t x1, Double_t y1, Double_t x2, Double_t y2)
Double_t Sqrt(Double_t x)