54 if (is_raytracing != raytracing) {
62void AddText(
TPaveText *pave,
const char *datamember,
Double_t value,
const char *comment)
65 for (
Int_t i=0; i<128; i++)
line[i] =
' ';
66 memcpy(&
line[0], datamember, strlen(datamember));
69 sprintf(number,
"%5.2f", value);
70 memcpy(&
line[12], number, strlen(number));
73 sprintf(&
line[30],
"%s",comment);
80void AddText(
TPaveText *pave,
const char *datamember,
Int_t value,
const char *comment)
83 for (
Int_t i=0; i<128; i++)
line[i] =
' ';
84 memcpy(&
line[0], datamember, strlen(datamember));
87 sprintf(number,
"%5i", value);
88 memcpy(&
line[12], number, strlen(number));
91 sprintf(&
line[30],
"%s",comment);
102 if (!pave || !pf)
return;
103 for (
Int_t i=0; i<128; i++)
line[i] =
' ';
110 AddText(pave,
"fNdiv",finder->
GetNdiv(),
"number of divisions");
111 AddText(pave,
"fStart",finder->
GetStart(),
"start divisioning position");
112 AddText(pave,
"fStep",finder->
GetStep(),
"division step");
120 if (!
c || !vol)
return;
125 sprintf(fname,
"t_%s.gif",
name);
138 return (1+
Int_t(color));
143 raytracing = !raytracing;
146 if (!painter)
return;
157 new TCanvas(
"chelp",
"Help to run demos",200,10,700,600);
160 welcome->
AddText(
"Welcome to the new geometry package");
169 hdemo->
AddText(
"- Demo for building TGeo basic shapes and simple geometry. Shape parameters are");
170 hdemo->
AddText(
" displayed in the right pad");
171 hdemo->
AddText(
"- Click left mouse button to execute one demo");
172 hdemo->
AddText(
"- While pointing the mouse to the pad containing the geometry, do:");
173 hdemo->
AddText(
"- .... click-and-move to rotate");
174 hdemo->
AddText(
"- .... press j/k to zoom/unzoom");
175 hdemo->
AddText(
"- .... press l/h/u/i to move the view center around");
176 hdemo->
AddText(
"- Click Ray-trace ON/OFF to toggle ray-tracing");
177 hdemo->
AddText(
"- Use <View with x3d> from the <View> menu to get an x3d view");
178 hdemo->
AddText(
"- .... same methods to rotate/zoom/move the view");
179 hdemo->
AddText(
"- Execute box(1,8) to divide a box in 8 equal slices along X");
180 hdemo->
AddText(
"- Most shapes can be divided on X,Y,Z,Rxy or Phi :");
181 hdemo->
AddText(
"- .... root[0] <shape>(IAXIS, NDIV, START, STEP);");
182 hdemo->
AddText(
" .... IAXIS = 1,2,3 meaning (X,Y,Z) or (Rxy, Phi, Z)");
183 hdemo->
AddText(
" .... NDIV = number of slices");
184 hdemo->
AddText(
" .... START = start slicing position");
185 hdemo->
AddText(
" .... STEP = division step");
186 hdemo->
AddText(
"- Click Comments ON/OFF to toggle comments");
187 hdemo->
AddText(
"- Click Ideal/Align geometry to see how alignment works");
215 bar->
AddButton(
"How to run ",
"help()",
"Instructions for running this macro");
216 bar->
AddButton(
"Arb8 ",
"arb8()",
"An arbitrary polyhedron defined by vertices (max 8) sitting on 2 parallel planes");
217 bar->
AddButton(
"Box ",
"box()",
"A box shape.");
218 bar->
AddButton(
"Composite ",
"composite()",
"A composite shape");
219 bar->
AddButton(
"Cone ",
"cone()",
"A conical tube");
220 bar->
AddButton(
"Cone segment",
"coneseg()",
"A conical segment");
221 bar->
AddButton(
"Cut tube ",
"ctub()",
"A cut tube segment");
222 bar->
AddButton(
"Elliptical tube",
"eltu()",
"An elliptical tube");
223 bar->
AddButton(
"Extruded poly",
"xtru()",
"A general polygone extrusion");
224 bar->
AddButton(
"Hyperboloid ",
"hype()",
"A hyperboloid");
225 bar->
AddButton(
"Paraboloid ",
"parab()",
"A paraboloid");
226 bar->
AddButton(
"Polycone ",
"pcon()",
"A polycone shape");
227 bar->
AddButton(
"Polygone ",
"pgon()",
"A polygone");
228 bar->
AddButton(
"Parallelepiped",
"para()",
"A parallelepiped shape");
229 bar->
AddButton(
"Sphere ",
"sphere()",
"A spherical sector");
230 bar->
AddButton(
"Trd1 ",
"trd1()",
"A trapezoid with dX varying with Z");
231 bar->
AddButton(
"Trd2 ",
"trd2()",
"A trapezoid with both dX and dY varying with Z");
232 bar->
AddButton(
"Trapezoid ",
"trap()",
"A general trapezoid");
233 bar->
AddButton(
"Torus ",
"torus()",
"A toroidal segment");
234 bar->
AddButton(
"Tube ",
"tube()",
"A tube with inner and outer radius");
235 bar->
AddButton(
"Tube segment",
"tubeseg()",
"A tube segment");
236 bar->
AddButton(
"Twisted trap",
"gtra()",
"A twisted trapezoid");
237 bar->
AddButton(
"Tessellated ",
"tessellated()",
"A tessellated shape");
238 bar->
AddButton(
"Aligned (ideal)",
"ideal()",
"An ideal (un-aligned) geometry");
239 bar->
AddButton(
"Un-aligned",
"align()",
"Some alignment operation");
240 bar->
AddButton(
"RAY-TRACE ON/OFF",
"raytrace()",
"Toggle ray-tracing mode");
241 bar->
AddButton(
"COMMENTS ON/OFF",
"comments = !comments;",
"Toggle explanations pad ON/OFF");
242 bar->
AddButton(
"AXES ON/OFF",
"axes()",
"Toggle axes ON/OFF");
243 bar->
AddButton(
"AUTOROTATE ON/OFF",
"autorotate()",
"Toggle autorotation ON/OFF");
245 gROOT->SaveContext();
262 if (!painter)
return;
272 if (
gROOT->IsInterrupted())
break;
274 if (longit>360) longit -= 360.;
279 view =
gPad->GetView();
303 gROOT->GetListOfCanvases()->Delete();
304 if (iaxis<0 || iaxis>3) {
305 printf(
"Wrong division axis. Range is 1-3.\n");
312 gPad->SetPad(0,0,1,0.4);
314 gPad->SetPad(0,0.4,1,1);
335 if (!comments)
return;
342 AddText(
pt,
"fDX",
box->GetDX(),
"half length in X");
343 AddText(
pt,
"fDY",
box->GetDY(),
"half length in Y");
344 AddText(
pt,
"fDZ",
box->GetDZ(),
"half length in Z");
345 AddText(
pt,
"fOrigin[0]",(
box->GetOrigin())[0],
"box origin on X");
346 AddText(
pt,
"fOrigin[1]",(
box->GetOrigin())[1],
"box origin on Y");
347 AddText(
pt,
"fOrigin[2]",(
box->GetOrigin())[2],
"box origin on Z");
349 pt->
AddText(
"Execute: box(iaxis, ndiv, start, step) to divide this.");
350 pt->
AddText(
"----- IAXIS can be 1, 2 or 3 (X, Y, Z)");
351 pt->
AddText(
"----- NDIV must be a positive integer");
352 pt->
AddText(
"----- START must be a valid axis offset within shape range on divided axis");
353 pt->
AddText(
"----- STEP is the division step. START+NDIV*STEP must be in range also");
354 pt->
AddText(
"----- If START and STEP are omitted, all range of the axis will be divided");
371 gROOT->GetListOfCanvases()->Delete();
376 gPad->SetPad(0,0,1,0.4);
378 gPad->SetPad(0,0.4,1,1);
399 if (!comments)
return;
406 AddText(
pt,
"fX",para->
GetX(),
"half length in X");
407 AddText(
pt,
"fY",para->
GetY(),
"half length in Y");
408 AddText(
pt,
"fZ",para->
GetZ(),
"half length in Z");
409 AddText(
pt,
"fAlpha",para->
GetAlpha(),
"angle about Y of the Z bases");
410 AddText(
pt,
"fTheta",para->
GetTheta(),
"inclination of para axis about Z");
411 AddText(
pt,
"fPhi",para->
GetPhi(),
"phi angle of para axis");
413 pt->
AddText(
"Execute: para(iaxis, ndiv, start, step) to divide this.");
414 pt->
AddText(
"----- IAXIS can be 1, 2 or 3 (X, Y, Z)");
415 pt->
AddText(
"----- NDIV must be a positive integer");
416 pt->
AddText(
"----- START must be a valid axis offset within shape range on divided axis");
417 pt->
AddText(
"----- STEP is the division step. START+NDIV*STEP must be in range also");
418 pt->
AddText(
"----- If START and STEP are omitted, all range of the axis will be divided");
434 gROOT->GetListOfCanvases()->Delete();
435 if (iaxis<0 || iaxis>3) {
436 printf(
"Wrong division axis. Range is 1-3.\n");
443 gPad->SetPad(0,0,1,0.4);
445 gPad->SetPad(0,0.4,1,1);
467 if (!comments)
return;
474 AddText(
pt,
"fRmin",tube->
GetRmin(),
"minimum radius");
475 AddText(
pt,
"fRmax",tube->
GetRmax(),
"maximum radius");
476 AddText(
pt,
"fDZ", tube->
GetDZ(),
"half length in Z");
478 pt->
AddText(
"Execute: tube(iaxis, ndiv, start, step) to divide this.");
479 pt->
AddText(
"----- IAXIS can be 1, 2 or 3 (Rxy, Phi, Z)");
480 pt->
AddText(
"----- NDIV must be a positive integer");
481 pt->
AddText(
"----- START must be a valid axis offset within shape range on divided axis");
482 pt->
AddText(
"----- STEP is the division step. START+NDIV*STEP must be in range also");
483 pt->
AddText(
"----- If START and STEP are omitted, all range of the axis will be divided");
499 gROOT->GetListOfCanvases()->Delete();
500 if (iaxis<0 || iaxis>3) {
501 printf(
"Wrong division axis. Range is 1-3.\n");
504 TCanvas *
c =
new TCanvas(
"tubeseg shape",
"A tube segment ", 700,1000);
508 gPad->SetPad(0,0,1,0.4);
510 gPad->SetPad(0,0.4,1,1);
532 if (!comments)
return;
539 AddText(
pt,
"fRmin",tubeseg->
GetRmin(),
"minimum radius");
540 AddText(
pt,
"fRmax",tubeseg->
GetRmax(),
"maximum radius");
541 AddText(
pt,
"fDZ", tubeseg->
GetDZ(),
"half length in Z");
542 AddText(
pt,
"fPhi1",tubeseg->
GetPhi1(),
"first phi limit");
543 AddText(
pt,
"fPhi2",tubeseg->
GetPhi2(),
"second phi limit");
545 pt->
AddText(
"Execute: tubeseg(iaxis, ndiv, start, step) to divide this.");
546 pt->
AddText(
"----- IAXIS can be 1, 2 or 3 (Rxy, Phi, Z)");
547 pt->
AddText(
"----- NDIV must be a positive integer");
548 pt->
AddText(
"----- START must be a valid axis offset within shape range on divided axis");
549 pt->
AddText(
"----- STEP is the division step. START+NDIV*STEP must be in range also");
550 pt->
AddText(
"----- If START and STEP are omitted, all range of the axis will be divided");
566 gROOT->GetListOfCanvases()->Delete();
567 if (iaxis<0 || iaxis>2) {
568 printf(
"Wrong division axis. Range is 1-2.\n");
571 TCanvas *
c =
new TCanvas(
"ctub shape",
"A cut tube segment ", 700,1000);
575 gPad->SetPad(0,0,1,0.4);
577 gPad->SetPad(0,0.4,1,1);
597 TGeoVolume *vol =
gGeoManager->
MakeCtub(
"CTUB",med, 20,30,40,-30,250, nlow[0], nlow[1], nlow[2], nhi[0],nhi[1],nhi[2]);
611 if (!comments)
return;
618 AddText(
pt,
"fRmin",tubeseg->
GetRmin(),
"minimum radius");
619 AddText(
pt,
"fRmax",tubeseg->
GetRmax(),
"maximum radius");
620 AddText(
pt,
"fDZ", tubeseg->
GetDZ(),
"half length in Z");
621 AddText(
pt,
"fPhi1",tubeseg->
GetPhi1(),
"first phi limit");
622 AddText(
pt,
"fPhi2",tubeseg->
GetPhi2(),
"second phi limit");
635 gROOT->GetListOfCanvases()->Delete();
636 if (iaxis<0 || iaxis>3) {
637 printf(
"Wrong division axis. Range is 1-3.\n");
641 printf(
"cannot divide cone on Rxy\n");
648 gPad->SetPad(0,0,1,0.4);
650 gPad->SetPad(0,0.4,1,1);
671 if (!comments)
return;
678 AddText(
pt,
"fDZ", cone->
GetDZ(),
"half length in Z");
679 AddText(
pt,
"fRmin1",cone->
GetRmin1(),
"inner radius at -dz");
680 AddText(
pt,
"fRmax1",cone->
GetRmax1(),
"outer radius at -dz");
681 AddText(
pt,
"fRmin2",cone->
GetRmin2(),
"inner radius at +dz");
682 AddText(
pt,
"fRmax2",cone->
GetRmax2(),
"outer radius at +dz");
684 pt->
AddText(
"Execute: cone(iaxis, ndiv, start, step) to divide this.");
685 pt->
AddText(
"----- IAXIS can be 2 or 3 (Phi, Z)");
686 pt->
AddText(
"----- NDIV must be a positive integer");
687 pt->
AddText(
"----- START must be a valid axis offset within shape range on divided axis");
688 pt->
AddText(
"----- STEP is the division step. START+NDIV*STEP must be in range also");
689 pt->
AddText(
"----- If START and STEP are omitted, all range of the axis will be divided");
705 gROOT->GetListOfCanvases()->Delete();
706 if (iaxis<0 || iaxis>3) {
707 printf(
"Wrong division axis. Range is 1-3.\n");
714 gPad->SetPad(0,0,1,0.4);
716 gPad->SetPad(0,0.4,1,1);
737 if (!comments)
return;
744 AddText(
pt,
"fDZ", coneseg->
GetDZ(),
"half length in Z");
745 AddText(
pt,
"fRmin1",coneseg->
GetRmin1(),
"inner radius at -dz");
746 AddText(
pt,
"fRmax1",coneseg->
GetRmax1(),
"outer radius at -dz");
747 AddText(
pt,
"fRmin2",coneseg->
GetRmin1(),
"inner radius at +dz");
748 AddText(
pt,
"fRmax2",coneseg->
GetRmax1(),
"outer radius at +dz");
749 AddText(
pt,
"fPhi1",coneseg->
GetPhi1(),
"first phi limit");
750 AddText(
pt,
"fPhi2",coneseg->
GetPhi2(),
"second phi limit");
752 pt->
AddText(
"Execute: coneseg(iaxis, ndiv, start, step) to divide this.");
753 pt->
AddText(
"----- IAXIS can be 2 or 3 (Phi, Z)");
754 pt->
AddText(
"----- NDIV must be a positive integer");
755 pt->
AddText(
"----- START must be a valid axis offset within shape range on divided axis");
756 pt->
AddText(
"----- STEP is the division step. START+NDIV*STEP must be in range also");
757 pt->
AddText(
"----- If START and STEP are omitted, all range of the axis will be divided");
773 gROOT->GetListOfCanvases()->Delete();
774 TCanvas *
c =
new TCanvas(
"eltu shape",
"An Elliptical tube", 700,1000);
778 gPad->SetPad(0,0,1,0.4);
780 gPad->SetPad(0,0.4,1,1);
801 if (!comments)
return;
808 AddText(
pt,
"fA",eltu->
GetA(),
"semi-axis along x");
809 AddText(
pt,
"fB",eltu->
GetB(),
"semi-axis along y");
810 AddText(
pt,
"fDZ", eltu->
GetDZ(),
"half length in Z");
812 pt->
AddText(
"Execute: eltu(iaxis, ndiv, start, step) to divide this.");
813 pt->
AddText(
"----- IAXIS can be 2 or 3 (Phi, Z)");
814 pt->
AddText(
"----- NDIV must be a positive integer");
815 pt->
AddText(
"----- START must be a valid axis offset within shape range on divided axis");
816 pt->
AddText(
"----- STEP is the division step. START+NDIV*STEP must be in range also");
817 pt->
AddText(
"----- If START and STEP are omitted, all range of the axis will be divided");
833 gROOT->GetListOfCanvases()->Delete();
835 printf(
"Cannot divide spheres\n");
838 TCanvas *
c =
new TCanvas(
"Sphere shap",
"A spherical sector", 700,1000);
842 gPad->SetPad(0,0,1,0.4);
844 gPad->SetPad(0,0.4,1,1);
865 if (!comments)
return;
872 AddText(
pt,
"fRmin",sphere->
GetRmin(),
"inner radius");
873 AddText(
pt,
"fRmax",sphere->
GetRmax(),
"outer radius");
874 AddText(
pt,
"fTheta1",sphere->
GetTheta1(),
"lower theta limit");
875 AddText(
pt,
"fTheta2",sphere->
GetTheta2(),
"higher theta limit");
876 AddText(
pt,
"fPhi1",sphere->
GetPhi1(),
"lower phi limit");
877 AddText(
pt,
"fPhi2",sphere->
GetPhi2(),
"higher phi limit");
889 gROOT->GetListOfCanvases()->Delete();
891 printf(
"Cannot divide a torus\n");
894 TCanvas *
c =
new TCanvas(
"torus shape",
"A toroidal segment", 700,1000);
898 gPad->SetPad(0,0,1,0.4);
900 gPad->SetPad(0,0.4,1,1);
920 if (!comments)
return;
927 AddText(
pt,
"fR",tor->
GetR(),
"radius of the ring");
928 AddText(
pt,
"fRmin",tor->
GetRmin(),
"minimum radius");
929 AddText(
pt,
"fRmax",tor->
GetRmax(),
"maximum radius");
930 AddText(
pt,
"fPhi1", tor->
GetPhi1(),
"starting phi angle");
931 AddText(
pt,
"fDphi", tor->
GetDphi(),
"phi range");
942 gROOT->GetListOfCanvases()->Delete();
943 if (iaxis<0 || iaxis>3) {
944 printf(
"Wrong division axis. Range is 1-3.\n");
948 printf(
"Cannot divide trd1 on X axis\n");
952 TCanvas *
c =
new TCanvas(
"trd1 shape",
"A trapezoid with dX varying", 700,1000);
956 gPad->SetPad(0,0,1,0.4);
958 gPad->SetPad(0,0.4,1,1);
979 if (!comments)
return;
986 AddText(
pt,
"fDx1",trd1->
GetDx1(),
"half length in X at lower Z surface(-dz)");
987 AddText(
pt,
"fDx2",trd1->
GetDx2(),
"half length in X at higher Z surface(+dz)");
988 AddText(
pt,
"fDy",trd1->
GetDy(),
"half length in Y");
989 AddText(
pt,
"fDz",trd1->
GetDz(),
"half length in Z");
991 pt->
AddText(
"Execute: trd1(iaxis, ndiv, start, step) to divide this.");
992 pt->
AddText(
"----- IAXIS can be 2 or 3 (Y, Z)");
993 pt->
AddText(
"----- NDIV must be a positive integer");
994 pt->
AddText(
"----- START must be a valid axis offset within shape range on divided axis");
995 pt->
AddText(
"----- STEP is the division step. START+NDIV*STEP must be in range also");
996 pt->
AddText(
"----- If START and STEP are omitted, all range of the axis will be divided");
1012 gROOT->GetListOfCanvases()->Delete();
1013 TCanvas *
c =
new TCanvas(
"parab shape",
"A paraboloid segment", 700,1000);
1017 gPad->SetPad(0,0,1,0.4);
1019 gPad->SetPad(0,0.4,1,1);
1036 if (!comments)
return;
1042 AddText(
pt,
"fRlo",par->
GetRlo(),
"radius at Z=-dz");
1043 AddText(
pt,
"fRhi",par->
GetRhi(),
"radius at Z=+dz");
1044 AddText(
pt,
"fDz",par->
GetDz(),
"half-length on Z axis");
1045 pt->
AddText(
"----- A paraboloid is described by the equation:");
1046 pt->
AddText(
"----- z = a*r*r + b; where: r = x*x + y*y");
1047 pt->
AddText(
"----- Create with: TGeoParaboloid *parab = new TGeoParaboloid(rlo, rhi, dz);");
1048 pt->
AddText(
"----- dz: half-length in Z (range from -dz to +dz");
1049 pt->
AddText(
"----- rlo: radius at z=-dz given by: -dz = a*rlo*rlo + b");
1050 pt->
AddText(
"----- rhi: radius at z=+dz given by: dz = a*rhi*rhi + b");
1051 pt->
AddText(
"----- rlo != rhi; both >= 0");
1065 gROOT->GetListOfCanvases()->Delete();
1070 gPad->SetPad(0,0,1,0.4);
1072 gPad->SetPad(0,0.4,1,1);
1089 if (!comments)
return;
1095 AddText(
pt,
"fRmin",hype->
GetRmin(),
"minimum inner radius");
1096 AddText(
pt,
"fStIn",hype->
GetStIn(),
"inner surface stereo angle [deg]");
1097 AddText(
pt,
"fRmax",hype->
GetRmax(),
"minimum outer radius");
1098 AddText(
pt,
"fStOut",hype->
GetStOut(),
"outer surface stereo angle [deg]");
1099 AddText(
pt,
"fDz",hype->
GetDz(),
"half-length on Z axis");
1100 pt->
AddText(
"----- A hyperboloid is described by the equation:");
1101 pt->
AddText(
"----- r^2 - (tan(stereo)*z)^2 = rmin^2; where: r = x*x + y*y");
1102 pt->
AddText(
"----- Create with: TGeoHype *hype = new TGeoHype(rin, stin, rout, stout, dz);");
1103 pt->
AddText(
"----- rin < rout; rout > 0");
1104 pt->
AddText(
"----- rin = 0; stin > 0 => inner surface conical");
1105 pt->
AddText(
"----- stin/stout = 0 => corresponding surface cylindrical");
1118 gROOT->GetListOfCanvases()->Delete();
1119 if (iaxis<0 || iaxis>3) {
1120 printf(
"Wrong division axis. Range is 1-3.\n");
1124 printf(
"Cannot divide pcon on Rxy\n");
1131 gPad->SetPad(0,0,1,0.4);
1133 gPad->SetPad(0,0.4,1,1);
1159 if (!comments)
return;
1165 AddText(
pt,
"fPhi1",pcon->
GetPhi1(),
"lower phi limit");
1166 AddText(
pt,
"fDphi",pcon->
GetDphi(),
"phi range");
1167 AddText(
pt,
"fNz",pcon->
GetNz(),
"number of z planes");
1170 sprintf(
line,
"fZ[%i]=%5.2f fRmin[%i]=%5.2f fRmax[%i]=%5.2f",
1177 pt->
AddText(
"Execute: pcon(iaxis, ndiv, start, step) to divide this.");
1178 pt->
AddText(
"----- IAXIS can be 2 or 3 (Phi, Z)");
1179 pt->
AddText(
"----- NDIV must be a positive integer");
1180 pt->
AddText(
"----- START must be a valid axis offset within shape range on divided axis");
1181 pt->
AddText(
"----- STEP is the division step. START+NDIV*STEP must be in range also");
1182 pt->
AddText(
"----- If START and STEP are omitted, all range of the axis will be divided");
1198 gROOT->GetListOfCanvases()->Delete();
1199 if (iaxis<0 || iaxis>3) {
1200 printf(
"Wrong division axis. Range is 1-3.\n");
1204 printf(
"Cannot divide pgon on Rxy\n");
1211 gPad->SetPad(0,0,1,0.4);
1213 gPad->SetPad(0,0.4,1,1);
1239 if (!comments)
return;
1245 AddText(
pt,
"fPhi1",pgon->
GetPhi1(),
"lower phi limit");
1246 AddText(
pt,
"fDphi",pgon->
GetDphi(),
"phi range");
1247 AddText(
pt,
"fNedges",pgon->
GetNedges(),
"number of edges");
1248 AddText(
pt,
"fNz",pgon->
GetNz(),
"number of z planes");
1251 sprintf(
line,
"fZ[%i]=%5.2f fRmin[%i]=%5.2f fRmax[%i]=%5.2f",
1258 pt->
AddText(
"Execute: pgon(iaxis, ndiv, start, step) to divide this.");
1259 pt->
AddText(
"----- IAXIS can be 2 or 3 (Phi, Z)");
1260 pt->
AddText(
"----- NDIV must be a positive integer");
1261 pt->
AddText(
"----- START must be a valid axis offset within shape range on divided axis");
1262 pt->
AddText(
"----- STEP is the division step. START+NDIV*STEP must be in range also");
1263 pt->
AddText(
"----- If START and STEP are omitted, all range of the axis will be divided");
1280 gROOT->GetListOfCanvases()->Delete();
1282 printf(
"Cannot divide arb8\n");
1285 TCanvas *
c =
new TCanvas(
"arb8 shape",
"An arbitrary polyhedron", 700,1000);
1289 gPad->SetPad(0,0,1,0.4);
1291 gPad->SetPad(0,0.4,1,1);
1321 if (!comments)
return;
1327 AddText(
pt,
"fDz",arb->
GetDz(),
"Z half length");
1333 for (i=0; i<4; i++) {
1334 sprintf(
line,
" fXY[%d] = (%5.2f, %5.2f)", i, vert[2*i], vert[2*i+1]);
1341 for (i=4; i<8; i++) {
1342 sprintf(
line,
" fXY[%d] = (%5.2f, %5.2f)", i, vert[2*i], vert[2*i+1]);
1359 gROOT->GetListOfCanvases()->Delete();
1360 if (iaxis && iaxis!=3) {
1361 printf(
"Wrong division axis. Can divide only in Z (3)\n");
1364 TCanvas *
c =
new TCanvas(
"trd2 shape",
"A trapezoid with dX and dY varying with Z", 700,1000);
1368 gPad->SetPad(0,0,1,0.4);
1370 gPad->SetPad(0,0.4,1,1);
1391 if (!comments)
return;
1398 AddText(
pt,
"fDx1",trd2->
GetDx1(),
"half length in X at lower Z surface(-dz)");
1399 AddText(
pt,
"fDx2",trd2->
GetDx2(),
"half length in X at higher Z surface(+dz)");
1400 AddText(
pt,
"fDy1",trd2->
GetDy1(),
"half length in Y at lower Z surface(-dz)");
1401 AddText(
pt,
"fDy2",trd2->
GetDy2(),
"half length in Y at higher Z surface(-dz)");
1402 AddText(
pt,
"fDz",trd2->
GetDz(),
"half length in Z");
1404 pt->
AddText(
"Execute: trd2(iaxis, ndiv, start, step) to divide this.");
1405 pt->
AddText(
"----- IAXIS can be only 3 (Z)");
1406 pt->
AddText(
"----- NDIV must be a positive integer");
1407 pt->
AddText(
"----- START must be a valid axis offset within shape range on divided axis");
1408 pt->
AddText(
"----- STEP is the division step. START+NDIV*STEP must be in range also");
1409 pt->
AddText(
"----- If START and STEP are omitted, all range of the axis will be divided");
1425 gROOT->GetListOfCanvases()->Delete();
1426 if (iaxis && iaxis!=3) {
1427 printf(
"Wrong division axis. Can divide only in Z (3)\n");
1430 TCanvas *
c =
new TCanvas(
"trap shape",
"A more general trapezoid", 700,1000);
1434 gPad->SetPad(0,0,1,0.4);
1436 gPad->SetPad(0,0.4,1,1);
1444 TGeoVolume *vol =
gGeoManager->
MakeTrap(
"Trap",med, 30,15,30,20,10,15,0,20,10,15,0);
1457 if (!comments)
return;
1464 AddText(
pt,
"fDz",trap->
GetDz(),
"half length in Z");
1465 AddText(
pt,
"fTheta",trap->
GetTheta(),
"theta angle of trapezoid axis");
1466 AddText(
pt,
"fPhi",trap->
GetPhi(),
"phi angle of trapezoid axis");
1467 AddText(
pt,
"fH1",trap->
GetH1(),
"half length in y at -fDz");
1468 AddText(
pt,
"fAlpha1",trap->
GetAlpha1(),
"angle between centers of x edges and y axis at -fDz");
1469 AddText(
pt,
"fBl1",trap->
GetBl1(),
"half length in x at -dZ and y=-fH1");
1470 AddText(
pt,
"fTl1",trap->
GetTl1(),
"half length in x at -dZ and y=+fH1");
1471 AddText(
pt,
"fH2",trap->
GetH2(),
"half length in y at +fDz");
1472 AddText(
pt,
"fBl2",trap->
GetBl2(),
"half length in x at +dZ and y=-fH1");
1473 AddText(
pt,
"fTl2",trap->
GetTl2(),
"half length in x at +dZ and y=+fH1");
1474 AddText(
pt,
"fAlpha2",trap->
GetAlpha2(),
"angle between centers of x edges and y axis at +fDz");
1476 pt->
AddText(
"Execute: trap(iaxis, ndiv, start, step) to divide this.");
1477 pt->
AddText(
"----- IAXIS can be only 3 (Z)");
1478 pt->
AddText(
"----- NDIV must be a positive integer");
1479 pt->
AddText(
"----- START must be a valid axis offset within shape range on divided axis");
1480 pt->
AddText(
"----- STEP is the division step. START+NDIV*STEP must be in range also");
1481 pt->
AddText(
"----- If START and STEP are omitted, all range of the axis will be divided");
1497 gROOT->GetListOfCanvases()->Delete();
1498 if (iaxis && iaxis!=3) {
1499 printf(
"Wrong division axis. Can divide only in Z (3)\n");
1502 TCanvas *
c =
new TCanvas(
"gtra shape",
"A twisted trapezoid", 700,1000);
1506 gPad->SetPad(0,0,1,0.4);
1508 gPad->SetPad(0,0.4,1,1);
1516 TGeoVolume *vol =
gGeoManager->
MakeGtra(
"Gtra",med, 30,15,30,30,20,10,15,0,20,10,15,0);
1529 if (!comments)
return;
1536 AddText(
pt,
"fDz",trap->
GetDz(),
"half length in Z");
1537 AddText(
pt,
"fTheta",trap->
GetTheta(),
"theta angle of trapezoid axis");
1538 AddText(
pt,
"fPhi",trap->
GetPhi(),
"phi angle of trapezoid axis");
1540 AddText(
pt,
"fH1",trap->
GetH1(),
"half length in y at -fDz");
1541 AddText(
pt,
"fAlpha1",trap->
GetAlpha1(),
"angle between centers of x edges and y axis at -fDz");
1542 AddText(
pt,
"fBl1",trap->
GetBl1(),
"half length in x at -dZ and y=-fH1");
1543 AddText(
pt,
"fTl1",trap->
GetTl1(),
"half length in x at -dZ and y=+fH1");
1544 AddText(
pt,
"fH2",trap->
GetH2(),
"half length in y at +fDz");
1545 AddText(
pt,
"fBl2",trap->
GetBl2(),
"half length in x at +dZ and y=-fH1");
1546 AddText(
pt,
"fTl2",trap->
GetTl2(),
"half length in x at +dZ and y=+fH1");
1547 AddText(
pt,
"fAlpha2",trap->
GetAlpha2(),
"angle between centers of x edges and y axis at +fDz");
1549 pt->
AddText(
"Execute: gtra(iaxis, ndiv, start, step) to divide this.");
1550 pt->
AddText(
"----- IAXIS can be only 3 (Z)");
1551 pt->
AddText(
"----- NDIV must be a positive integer");
1552 pt->
AddText(
"----- START must be a valid axis offset within shape range on divided axis");
1553 pt->
AddText(
"----- STEP is the division step. START+NDIV*STEP must be in range also");
1554 pt->
AddText(
"----- If START and STEP are omitted, all range of the axis will be divided");
1570 gROOT->GetListOfCanvases()->Delete();
1571 TCanvas *
c =
new TCanvas(
"gtra shape",
"A twisted trapezoid", 700,1000);
1575 gPad->SetPad(0,0,1,0.4);
1577 gPad->SetPad(0,0.4,1,1);
1587 Double_t x[8] = {-30,-30,30,30,15,15,-15,-15};
1588 Double_t y[8] = {-30,30,30,-30,-30,15,15,-30};
1601 if (!comments)
return;
1607 AddText(
pt,
"fNvert",xtru->
GetNvert(),
"number of polygone vertices");
1608 AddText(
pt,
"fNz",xtru->
GetNz(),
"number of Z sections");
1609 pt->
AddText(
"----- Any Z section is an arbitrary polygone");
1610 pt->
AddText(
"----- The shape can have an arbitrary number of Z sections, as for pcon/pgon");
1611 pt->
AddText(
"----- Create with: TGeoXtru *xtru = new TGeoXtru(nz);");
1612 pt->
AddText(
"----- Define the blueprint polygon :");
1613 pt->
AddText(
"----- Double_t x[8] = {-30,-30,30,30,15,15,-15,-15};");
1614 pt->
AddText(
"----- Double_t y[8] = {-30,30,30,-30,-30,15,15,-30};");
1615 pt->
AddText(
"----- xtru->DefinePolygon(8,x,y);");
1616 pt->
AddText(
"----- Define translations/scales of the blueprint for Z sections :");
1617 pt->
AddText(
"----- xtru->DefineSection(i, Zsection, x0, y0, scale);");
1618 pt->
AddText(
"----- Sections have to be defined in increasing Z order");
1619 pt->
AddText(
"----- 2 sections can be defined at same Z (not for first/last sections)");
1633 gROOT->GetListOfCanvases()->Delete();
1634 TCanvas *
c =
new TCanvas(
"tessellated shape",
"A tessellated shape", 700,1000);
1638 gPad->SetPad(0,0,1,0.4);
1640 gPad->SetPad(0,0.4,1,1);
1650 std::vector<Tessellated::Vertex_t> vert;
1652 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);
1653 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));
1654 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);
1655 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);
1656 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);
1657 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));
1658 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));
1659 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));
1660 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));
1661 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);
1662 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));
1663 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);
1664 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);
1665 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);
1666 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));
1667 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));
1668 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);
1669 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));
1670 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));
1671 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);
1672 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);
1673 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));
1674 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);
1675 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);
1676 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);
1677 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);
1678 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);
1679 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);
1680 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);
1681 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);
1683 tsl->
AddFacet(vert[0], vert[1], vert[2], vert[3]);
1684 tsl->
AddFacet(vert[4], vert[7], vert[6], vert[5]);
1685 tsl->
AddFacet(vert[8], vert[9], vert[10], vert[11]);
1686 tsl->
AddFacet(vert[12], vert[15], vert[14], vert[13]);
1687 tsl->
AddFacet(vert[16], vert[17], vert[18], vert[19]);
1688 tsl->
AddFacet(vert[20], vert[21], vert[22], vert[23]);
1689 tsl->
AddFacet(vert[24], vert[25], vert[26], vert[27]);
1690 tsl->
AddFacet(vert[28], vert[29], vert[30], vert[31]);
1691 tsl->
AddFacet(vert[32], vert[35], vert[34], vert[33]);
1692 tsl->
AddFacet(vert[36], vert[39], vert[38], vert[37]);
1693 tsl->
AddFacet(vert[40], vert[41], vert[42], vert[43]);
1694 tsl->
AddFacet(vert[44], vert[45], vert[46], vert[47]);
1695 tsl->
AddFacet(vert[48], vert[51], vert[50], vert[49]);
1696 tsl->
AddFacet(vert[52], vert[55], vert[54], vert[53]);
1697 tsl->
AddFacet(vert[56], vert[57], vert[58], vert[59]);
1698 tsl->
AddFacet(vert[60], vert[63], vert[62], vert[61]);
1699 tsl->
AddFacet(vert[64], vert[67], vert[66], vert[65]);
1700 tsl->
AddFacet(vert[68], vert[71], vert[70], vert[69]);
1701 tsl->
AddFacet(vert[72], vert[73], vert[74], vert[75]);
1702 tsl->
AddFacet(vert[76], vert[77], vert[78], vert[79]);
1703 tsl->
AddFacet(vert[80], vert[81], vert[82], vert[83]);
1704 tsl->
AddFacet(vert[84], vert[87], vert[86], vert[85]);
1705 tsl->
AddFacet(vert[88], vert[89], vert[90], vert[91]);
1706 tsl->
AddFacet(vert[92], vert[93], vert[94], vert[95]);
1707 tsl->
AddFacet(vert[96], vert[99], vert[98], vert[97]);
1708 tsl->
AddFacet(vert[100], vert[101], vert[102], vert[103]);
1709 tsl->
AddFacet(vert[104], vert[107], vert[106], vert[105]);
1710 tsl->
AddFacet(vert[108], vert[111], vert[110], vert[109]);
1711 tsl->
AddFacet(vert[112], vert[113], vert[114], vert[115]);
1712 tsl->
AddFacet(vert[116], vert[117], vert[118], vert[119]);
1721 if (!comments)
return;
1727 AddText(
pt,
"fNfacets",tsl->
GetNfacets(),
"number of facets");
1728 AddText(
pt,
"fNvertices",tsl->
GetNvertices(),
"number of vertices");
1729 pt->
AddText(
"----- A tessellated shape is defined by the number of facets");
1730 pt->
AddText(
"----- facets can be added using AddFacet");
1731 pt->
AddText(
"----- Create with: TGeoTessellated *tsl = new TGeoTessellated(nfacets);");
1744 gROOT->GetListOfCanvases()->Delete();
1745 TCanvas *
c =
new TCanvas(
"composite shape",
"A Boolean shape composition", 700,1000);
1749 gPad->SetPad(0,0,1,0.4);
1751 gPad->SetPad(0,0.4,1,1);
1781 if (!comments)
return;
1787 pt->
AddText(
"----- Define the shape components and don't forget to name them");
1788 pt->
AddText(
"----- Define geometrical transformations that apply to shape components");
1789 pt->
AddText(
"----- Name all transformations and register them");
1790 pt->
AddText(
"----- Define the composite shape based on a Boolean expression");
1791 pt->
AddText(
" TGeoCompositeShape(\"someName\", \"expression\")");
1792 pt->
AddText(
"----- Expression is made of <shapeName:transfName> components related by Boolean operators");
1793 pt->
AddText(
"----- Boolean operators can be: (+) union, (-) subtraction and (*) intersection");
1794 pt->
AddText(
"----- Use parenthesis in the expression to force precedence");
1840 gROOT->GetListOfCanvases()->Delete();
1841 TCanvas *
c =
new TCanvas(
"composite shape",
"A Boolean shape composition", 700,1000);
1845 gPad->SetPad(0,0,1,0.4);
1847 gPad->SetPad(0,0.4,1,1);
1867 if (!comments)
return;
1873 pt->
AddText(
"-- Create physical nodes for the objects you want to align");
1874 pt->
AddText(
"-- You must start from a valid CLOSED geometry");
1875 pt->
AddText(
" TGeoPhysicalNode *node = gGeoManager->MakePhysicalNode(const char *path)");
1876 pt->
AddText(
" + creates a physical node represented by path, e.g. TOP_1/A_2/B_3");
1877 pt->
AddText(
" node->Align(TGeoMatrix *newmat, TGeoShape *newshape, Bool_t check=kFALSE)");
1878 pt->
AddText(
" + newmat = new matrix to replace final node LOCAL matrix");
1879 pt->
AddText(
" + newshape = new shape to replace final node shape");
1880 pt->
AddText(
" + check = optional check if the new aligned node is overlapping");
1899 printf(
"Click: <Ideal geometry> first\n");
1906 for (
Int_t i=1; i<=10; i++) {
1907 for (
Int_t j=1; j<=10; j++) {
1909 sprintf(
name,
"TOP_1/SX_%d/SY_%d/CELL_1",i,j);
R__EXTERN TGeoManager * gGeoManager
R__EXTERN TRandom * gRandom
virtual void SetFillColor(Color_t fcolor)
Set the fill area color.
virtual void SetLineColor(Color_t lcolor)
Set the line color.
virtual void SetTextAlign(Short_t align=11)
Set the text alignment.
virtual void SetTextColor(Color_t tcolor=1)
Set the text color.
virtual void SetTextFont(Font_t tfont=62)
Set the text font.
virtual void SetTextSize(Float_t tsize=1)
Set the text size.
A Control Bar is a fully user configurable tool which provides fast access to frequently used operati...
void Show()
Show control bar.
void AddButton(TControlBarButton *button)
Add button.
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 Double_t GetDZ() const
Composite shapes are Boolean combinations of two or more shape components.
A cone segment is a cone having a range in phi.
The cones are defined by 5 parameters:
virtual Double_t GetRmax2() const
virtual Double_t GetRmin2() const
virtual Double_t GetRmin1() const
virtual Double_t GetRmax1() const
An elliptical tube is defined by the two semi-axes A and B.
virtual Double_t GetA() const
virtual Double_t GetB() const
Double_t GetTwistAngle() const
A hyperboloid is represented as a solid limited by two planes perpendicular to the Z axis (top and bo...
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.
TVirtualGeoPainter * GetGeomPainter()
Make a default painter if none present. Returns pointer to it.
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
A paraboloid is defined by the revolution surface generated by a parabola and is bounded by two plane...
Base finder class for patterns.
TGeoVolume * GetVolume() const
Double_t GetStart() const
A polycone is represented by a sequence of tubes/cones, glued together at defined Z planes.
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
Polygons are defined in the same way as polycones, the difference being just that the segments betwee...
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
TGeoSphere are not just balls having internal and external radii, but sectors of a sphere having defi...
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.
The torus is defined by its axial radius, its inner and outer radius.
Class describing translations.
void SetTranslation(Double_t dx, Double_t dy, Double_t dz)
Set translation components.
Double_t GetAlpha2() const
Double_t GetTheta() const
Double_t GetAlpha1() const
A trapezoid with only X varying with Z.
A trapezoid with only X varying with Z.
A tube segment is a tube having a range in phi.
virtual Double_t GetRmin() const
virtual Double_t GetDz() const
virtual Double_t GetRmax() const
TGeoVolume, TGeoVolumeMulti, TGeoVolumeAssembly are the volume classes.
virtual void cd(Int_t inode) const
Actualize matrix of node indexed <inode>
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 void Draw(Option_t *option="")
draw top volume according to option
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.
A TGeoXtru shape is represented by the extrusion of an arbitrary polygon with fixed outline between s...
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.
A Pave (see TPave) with text, lines or/and boxes inside.
virtual TText * AddText(Double_t x1, Double_t y1, const char *label)
Add a new Text line to this pavetext at given coordinates.
virtual void Draw(Option_t *option="")
Draw this pavetext with its current attributes.
virtual void SetAllWith(const char *text, Option_t *option, Double_t value)
Set attribute option for all lines containing string text.
Bool_t ProcessEvents()
Process events if timer did time out.
Random number generator class based on M.
virtual Double_t Rndm()
Machine independent random number generator.
Base class for several text objects.
virtual Double_t GetPsi()=0
virtual Double_t GetLongitude()=0
virtual void ShowAxis()=0
virtual Double_t GetLatitude()=0
virtual void SetView(Double_t longitude, Double_t latitude, Double_t psi, Int_t &irep)=0
Abstract class for geometry painters.
virtual Bool_t IsRaytracing() const =0
virtual void SetRaytracing(Bool_t flag=kTRUE)=0
void box(Int_t pat, Double_t x1, Double_t y1, Double_t x2, Double_t y2)
Double_t Sqrt(Double_t x)