10 void rootgeom(
bool vis =
true)
14 TGeoManager *geom =
new TGeoManager(
"simple1",
"Simple geometry");
17 TGeoMaterial *matVacuum =
new TGeoMaterial(
"Vacuum", 0,0,0);
18 TGeoMaterial *matAl =
new TGeoMaterial(
"Al", 26.98,13,2.7);
20 TGeoMedium *Vacuum =
new TGeoMedium(
"Vacuum",1, matVacuum);
21 TGeoMedium *Al =
new TGeoMedium(
"Root Material",2, matAl);
24 TGeoTranslation *tr1 =
new TGeoTranslation(20., 0, 0.);
25 TGeoTranslation *tr2 =
new TGeoTranslation(10., 0., 0.);
26 TGeoTranslation *tr3 =
new TGeoTranslation(10., 20., 0.);
27 TGeoTranslation *tr4 =
new TGeoTranslation(5., 10., 0.);
28 TGeoTranslation *tr5 =
new TGeoTranslation(20., 0., 0.);
29 TGeoTranslation *tr6 =
new TGeoTranslation(-5., 0., 0.);
30 TGeoTranslation *tr7 =
new TGeoTranslation(7.5, 7.5, 0.);
31 TGeoRotation *rot1 =
new TGeoRotation(
"rot1", 90., 0., 90., 270., 0., 0.);
32 TGeoCombiTrans *combi1 =
new TGeoCombiTrans(7.5, -7.5, 0., rot1);
33 TGeoTranslation *tr8 =
new TGeoTranslation(7.5, -5., 0.);
34 TGeoTranslation *tr9 =
new TGeoTranslation(7.5, 20., 0.);
35 TGeoTranslation *tr10 =
new TGeoTranslation(85., 0., 0.);
36 TGeoTranslation *tr11 =
new TGeoTranslation(35., 0., 0.);
37 TGeoTranslation *tr12 =
new TGeoTranslation(-15., 0., 0.);
38 TGeoTranslation *tr13 =
new TGeoTranslation(-65., 0., 0.);
40 TGeoTranslation *tr14 =
new TGeoTranslation(0,0,-100);
41 TGeoCombiTrans *combi2 =
new TGeoCombiTrans(0,0,100,
42 new TGeoRotation(
"rot2",90,180,90,90,180,0));
43 TGeoCombiTrans *combi3 =
new TGeoCombiTrans(100,0,0,
44 new TGeoRotation(
"rot3",90,270,0,0,90,180));
45 TGeoCombiTrans *combi4 =
new TGeoCombiTrans(-100,0,0,
46 new TGeoRotation(
"rot4",90,90,0,0,90,0));
47 TGeoCombiTrans *combi5 =
new TGeoCombiTrans(0,100,0,
48 new TGeoRotation(
"rot5",0,0,90,180,90,270));
49 TGeoCombiTrans *combi6 =
new TGeoCombiTrans(0,-100,0,
50 new TGeoRotation(
"rot6",180,0,90,180,90,90));
53 Double_t worldx = 110.;
54 Double_t worldy = 50.;
56 TGeoVolume *top = geom->MakeBox(
"TOP", Vacuum, 270., 270., 120.);
57 geom->SetTopVolume(top);
58 TGeoVolume *replica = geom->MakeBox(
"REPLICA", Vacuum,120,120,120);
59 replica->SetVisibility(kFALSE);
60 TGeoVolume *rootbox = geom->MakeBox(
"ROOT", Vacuum, 110., 50., 5.);
61 rootbox->SetVisibility(kFALSE);
64 TGeoVolume *R = geom->MakeBox(
"R", Vacuum, 25., 25., 5.);
65 R->SetVisibility(kFALSE);
66 TGeoVolume *bar1 = geom->MakeBox(
"bar1", Al, 5., 25, 5.);
67 bar1->SetLineColor(kRed);
68 R->AddNode(bar1, 1, tr1);
69 TGeoVolume *bar2 = geom->MakeBox(
"bar2", Al, 5., 5., 5.);
70 bar2->SetLineColor(kRed);
71 R->AddNode(bar2, 1, tr2);
72 R->AddNode(bar2, 2, tr3);
73 TGeoVolume *tub1 = geom->MakeTubs(
"tub1", Al, 5., 15., 5., 90., 270.);
74 tub1->SetLineColor(kRed);
75 R->AddNode(tub1, 1, tr4);
76 TGeoVolume *bar3 = geom->MakeArb8(
"bar3", Al, 5.);
77 bar3->SetLineColor(kRed);
78 TGeoArb8 *arb = (TGeoArb8*)bar3->GetShape();
79 arb->SetVertex(0, 15., -5.);
80 arb->SetVertex(1, 0., -25.);
81 arb->SetVertex(2, -10., -25.);
82 arb->SetVertex(3, 5., -5.);
83 arb->SetVertex(4, 15., -5.);
84 arb->SetVertex(5, 0., -25.);
85 arb->SetVertex(6, -10., -25.);
86 arb->SetVertex(7, 5., -5.);
87 R->AddNode(bar3, 1, gGeoIdentity);
90 TGeoVolume *O = geom->MakeBox(
"O", Vacuum, 25., 25., 5.);
91 O->SetVisibility(kFALSE);
92 TGeoVolume *bar4 = geom->MakeBox(
"bar4", Al, 5., 7.5, 5.);
93 bar4->SetLineColor(kYellow);
94 O->AddNode(bar4, 1, tr5);
95 O->AddNode(bar4, 2, tr6);
96 TGeoVolume *tub2 = geom->MakeTubs(
"tub1", Al, 7.5, 17.5, 5., 0., 180.);
97 tub2->SetLineColor(kYellow);
98 O->AddNode(tub2, 1, tr7);
99 O->AddNode(tub2, 2, combi1);
102 TGeoVolume *T = geom->MakeBox(
"T", Vacuum, 25., 25., 5.);
103 T->SetVisibility(kFALSE);
104 TGeoVolume *bar5 = geom->MakeBox(
"bar5", Al, 5., 20., 5.);
105 bar5->SetLineColor(kBlue);
106 T->AddNode(bar5, 1, tr8);
107 TGeoVolume *bar6 = geom->MakeBox(
"bar6", Al, 17.5, 5., 5.);
108 bar6->SetLineColor(kBlue);
109 T->AddNode(bar6, 1, tr9);
113 rootbox->AddNode(R, 1, tr10);
114 rootbox->AddNode(O, 1, tr11);
115 rootbox->AddNode(O, 2, tr12);
116 rootbox->AddNode(T, 1, tr13);
118 replica->AddNode(rootbox, 1, tr14);
119 replica->AddNode(rootbox, 2, combi2);
120 replica->AddNode(rootbox, 3, combi3);
121 replica->AddNode(rootbox, 4, combi4);
122 replica->AddNode(rootbox, 5, combi5);
123 replica->AddNode(rootbox, 6, combi6);
125 top->AddNode(replica, 1,
new TGeoTranslation(-150, -150, 0));
126 top->AddNode(replica, 2,
new TGeoTranslation(150, -150, 0));
127 top->AddNode(replica, 3,
new TGeoTranslation(150, 150, 0));
128 top->AddNode(replica, 4,
new TGeoTranslation(-150, 150, 0));
131 geom->CloseGeometry();
139 geom->SetVisLevel(4);
140 if (vis) top->Draw(
"ogle");