Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
station1.C
Go to the documentation of this file.
1/// \file
2/// \ingroup tutorial_geom
3/// Drawing a space station, using ROOT geometry class.
4///
5/// Reviewed by Sunman Kim (sunman98@hanmail.net)
6/// Supervisor: Prof. Inkyu Park (icpark@physics.uos.ac.kr)
7///
8/// How to run: `.x station1.C` in ROOT terminal, then use OpenGL
9///
10/// This macro was created for the evaluation of Computational Physics course in 2006.
11/// We thank to Prof. Inkyu Park for his special lecture on ROOT and to all of ROOT team
12///
13/// \image html geom_station1.png width=800px
14/// \macro_code
15///
16/// \author Chang Yeol Lee, Dept. of Physics, Univ. of Seoul
17
18#include "TGeoManager.h"
19
20void station1()
21{
22
23 TGeoManager *geom = new TGeoManager("geom", "My first 3D geometry");
24
25 TGeoMaterial *vacuum = new TGeoMaterial("vacuum", 0, 0, 0);
26 TGeoMaterial *Fe = new TGeoMaterial("Fe", 55.845, 26, 7.87);
27 TGeoMaterial *Cu = new TGeoMaterial("Cu", 63.549, 29, 8.92);
28
29 TGeoMedium *Air = new TGeoMedium("Vacuum", 0, vacuum);
30 TGeoMedium *Iron = new TGeoMedium("Iron", 1, Fe);
31 TGeoMedium *Copper = new TGeoMedium("Copper", 2, Cu);
32
33 TGeoVolume *top = geom->MakeBox("top", Air, 1000, 1000, 1000);
34 geom->SetTopVolume(top);
35 geom->SetTopVisible(false);
36 // If you want to see the boundary, please input the number, 1 instead of 0.
37 // Like this, geom->SetTopVisible(1);
38
39 TGeoVolume *Cone1 = geom->MakeCone("Cone1", Copper, 650, 0, 20, 0, 20);
40 Cone1->SetFillColor(35);
41 Cone1->SetLineColor(35);
42 top->AddNodeOverlap(Cone1, 1, new TGeoTranslation(0, 0, 0));
43
44 TGeoVolume *Cone2 = geom->MakeCone("Cone2", Copper, 25, 0, 30, 0, 30);
45 Cone2->SetFillColor(7);
46 Cone2->SetLineColor(7);
47 top->AddNodeOverlap(Cone2, 1, new TGeoTranslation(0, 0, 630));
48
49 TGeoVolume *Cone21 = geom->MakeCone("Cone21", Copper, 30, 0, 30, 0, 30);
50 Cone21->SetFillColor(29);
51 Cone21->SetLineColor(29);
52 top->AddNodeOverlap(Cone21, 1, new TGeoTranslation(0, 0, 550));
53
54 TGeoVolume *Cone22 = geom->MakeCone("Cone22", Copper, 5, 0, 50, 0, 50);
55 Cone22->SetFillColor(2);
56 Cone22->SetLineColor(2);
57 top->AddNodeOverlap(Cone22, 1, new TGeoTranslation(0, 0, 500));
58
59 for (int i = 0; i < 28; i++) {
60 TGeoVolume *Cone00 = geom->MakeCone("Cone00", Copper, 3, 0, 25, 0, 25);
61 Cone00->SetFillColor(1);
62 Cone00->SetLineColor(1);
63 top->AddNodeOverlap(Cone00, 1, new TGeoTranslation(0, 0, -100 + 20 * i));
64 }
65
66 TGeoVolume *Cone3 = geom->MakeCone("Cone3", Copper, 60, 0, 70, 0, 0);
67 Cone3->SetFillColor(13);
68 Cone3->SetLineColor(13);
69 top->AddNodeOverlap(Cone3, 1, new TGeoTranslation(-60, 0, -110));
70
71 TGeoVolume *Cone31 = geom->MakeCone("Cone31", Copper, 230, 0, 70, 0, 70);
72 Cone31->SetFillColor(13);
73 Cone31->SetLineColor(13);
74 top->AddNodeOverlap(Cone31, 1, new TGeoTranslation(-60, 0, -400));
75
76 for (int i = 0; i < 5; i++) {
77 Cone31 = geom->MakeCone("Cone31", Copper, 7, 0, 73, 0, 73);
78 Cone31->SetFillColor(21);
79 Cone31->SetLineColor(21);
80 top->AddNodeOverlap(Cone31, 1, new TGeoTranslation(-60, 0, -170 - (500 / 6 * (i + 1))));
81 top->AddNodeOverlap(Cone31, 1, new TGeoTranslation(60, 0, -170 - (500 / 6 * (i + 1))));
82 top->AddNodeOverlap(Cone31, 1, new TGeoTranslation(0, -60, -170 - (500 / 6 * (i + 1))));
83 top->AddNodeOverlap(Cone31, 1, new TGeoTranslation(0, 60, -170 - (500 / 6 * (i + 1))));
84 }
85
86 TGeoVolume *Cone32 = geom->MakeCone("Cone32", Copper, 30, 60, 50, 0, 70);
87 Cone32->SetFillColor(35);
88 Cone32->SetLineColor(35);
89 top->AddNodeOverlap(Cone32, 1, new TGeoTranslation(-60, 0, -650));
90
91 TGeoVolume *Cone321 = geom->MakeCone("Cone321", Copper, 5, 60, 50, 0, 50);
92 Cone321->SetFillColor(2);
93 Cone321->SetLineColor(2);
94 top->AddNodeOverlap(Cone321, 1, new TGeoTranslation(-60, 0, -680));
95
96 TGeoVolume *Cone4 = geom->MakeCone("Cone4", Copper, 60, 0, 70, 0, 0);
97 Cone4->SetFillColor(13);
98 Cone4->SetLineColor(13);
99 top->AddNodeOverlap(Cone3, 1, new TGeoTranslation(60, 0, -110));
100
101 for (int i = 1; i <= 8; i++) {
102 TGeoVolume *Torus2 = geom->MakeTorus("Torus2", Iron, 120, 20, 40, 45 * i - 4, 8);
103 Torus2->SetFillColor(18);
104 Torus2->SetLineColor(18);
105 top->AddNodeOverlap(Torus2, 1, new TGeoTranslation(0, 0, 610));
106
107 TGeoVolume *Tubs = geom->MakeTubs("Line", Iron, 0, 190, 5, 45 * i - 1, 45 * i + 1);
108 Tubs->SetFillColor(18);
109 Tubs->SetLineColor(18);
110 top->AddNodeOverlap(Tubs, 1, new TGeoTranslation(0, 0, 610));
111 }
112
113 TGeoVolume *Cone41 = geom->MakeCone("Cone41", Copper, 230, 0, 70, 0, 70);
114 Cone41->SetFillColor(13);
115 Cone41->SetLineColor(13);
116 top->AddNodeOverlap(Cone41, 1, new TGeoTranslation(60, 0, -400));
117
118 TGeoVolume *Cone42 = geom->MakeCone("Cone42", Copper, 30, 60, 50, 0, 70);
119 Cone42->SetFillColor(35);
120 Cone42->SetLineColor(35);
121 top->AddNodeOverlap(Cone42, 1, new TGeoTranslation(60, 0, -650));
122
123 TGeoVolume *Cone421 = geom->MakeCone("Cone421", Copper, 5, 60, 50, 0, 50);
124 Cone421->SetFillColor(2);
125 Cone421->SetLineColor(2);
126 top->AddNodeOverlap(Cone421, 1, new TGeoTranslation(60, 0, -680));
127
128 TGeoVolume *Cone5 = geom->MakeCone("Cone5", Copper, 60, 0, 70, 0, 0);
129 Cone5->SetFillColor(13);
130 Cone5->SetLineColor(13);
131 top->AddNodeOverlap(Cone3, 1, new TGeoTranslation(0, -60, -110));
132
133 TGeoVolume *Cone51 = geom->MakeCone("Cone51", Copper, 230, 0, 70, 0, 70);
134 Cone51->SetFillColor(13);
135 Cone51->SetLineColor(13);
136 top->AddNodeOverlap(Cone51, 1, new TGeoTranslation(0, -60, -400));
137
138 TGeoVolume *Cone52 = geom->MakeCone("Cone52", Copper, 30, 60, 50, 0, 70);
139 Cone52->SetFillColor(35);
140 Cone52->SetLineColor(35);
141 top->AddNodeOverlap(Cone52, 1, new TGeoTranslation(0, -60, -650));
142
143 TGeoVolume *Cone521 = geom->MakeCone("Cone521", Copper, 5, 60, 50, 0, 50);
144 Cone521->SetFillColor(2);
145 Cone521->SetLineColor(2);
146 top->AddNodeOverlap(Cone521, 1, new TGeoTranslation(0, -60, -680));
147
148 TGeoVolume *Cone6 = geom->MakeCone("Cone6", Copper, 60, 0, 70, 0, 0);
149 Cone6->SetFillColor(13);
150 Cone6->SetLineColor(13);
151 top->AddNodeOverlap(Cone3, 1, new TGeoTranslation(0, 60, -110));
152
153 TGeoVolume *Cone61 = geom->MakeCone("Cone61", Copper, 230, 0, 70, 0, 70);
154 Cone61->SetFillColor(13);
155 Cone61->SetLineColor(13);
156 top->AddNodeOverlap(Cone61, 1, new TGeoTranslation(0, 60, -400));
157
158 TGeoVolume *Cone62 = geom->MakeCone("Cone62", Copper, 30, 60, 50, 0, 70);
159 Cone62->SetFillColor(35);
160 Cone62->SetLineColor(35);
161 top->AddNodeOverlap(Cone62, 1, new TGeoTranslation(0, 60, -650));
162
163 TGeoVolume *Cone621 = geom->MakeCone("Cone621", Copper, 5, 60, 50, 0, 50);
164 Cone621->SetFillColor(2);
165 Cone621->SetLineColor(2);
166 top->AddNodeOverlap(Cone621, 1, new TGeoTranslation(0, 60, -680));
167
168 TGeoVolume *Cone7 = geom->MakeCone("Cone7", Copper, 50, 0, 40, 0, 5);
169 Cone7->SetFillColor(13);
170 Cone7->SetLineColor(13);
171 top->AddNodeOverlap(Cone7, 1, new TGeoCombiTrans(-90, -60, 10, new TGeoRotation("Cone7", 90, -90, -90)));
172
173 TGeoVolume *Cone71 = geom->MakeCone("Cone71", Copper, 50, 0, 60, 0, 40);
174 Cone71->SetFillColor(16);
175 Cone71->SetLineColor(16);
176 top->AddNodeOverlap(Cone71, 1, new TGeoCombiTrans(10, -60, 10, new TGeoRotation("Cone7", 90, -90, -90)));
177
178 TGeoVolume *Cone711 = geom->MakeCone("Cone711", Copper, 10, 0, 10, 0, 60);
179 Cone711->SetFillColor(13);
180 Cone711->SetLineColor(13);
181 top->AddNodeOverlap(Cone711, 1, new TGeoCombiTrans(70, -60, 10, new TGeoRotation("Cone7", 90, -90, -90)));
182
183 TGeoVolume *Torus1 = geom->MakeTorus("Torus1", Iron, 120, 30, 20);
184 Torus1->SetFillColor(33);
185 Torus1->SetLineColor(33);
186 top->AddNodeOverlap(Torus1, 1, new TGeoTranslation(0, 0, 610));
187
188 TGeoVolume *Cone8 = geom->MakeCone("Cone8", Copper, 50, 0, 40, 0, 5);
189 Cone8->SetFillColor(13);
190 Cone8->SetLineColor(13);
191 top->AddNodeOverlap(Cone8, 1, new TGeoCombiTrans(100, 60, 10, new TGeoRotation("Cone8", 90, 90, 0)));
192
193 TGeoVolume *Cone81 = geom->MakeCone("Cone81", Copper, 50, 0, 60, 0, 40);
194 Cone81->SetFillColor(16);
195 Cone81->SetLineColor(16);
196 top->AddNodeOverlap(Cone81, 1, new TGeoCombiTrans(0, 60, 10, new TGeoRotation("Cone8", 90, 90, 0)));
197
198 TGeoVolume *Cone811 = geom->MakeCone("Cone811", Copper, 10, 0, 10, 0, 60);
199 Cone811->SetFillColor(13);
200 Cone811->SetLineColor(13);
201 top->AddNodeOverlap(Cone811, 1, new TGeoCombiTrans(-60, 60, 10, new TGeoRotation("Cone8", 90, 90, 0)));
202
203 TGeoVolume *Box1 = geom->MakeBox("Box1", Copper, 10, 10, 3);
204 Box1->SetFillColor(3);
205 Box1->SetLineColor(3);
206 top->AddNodeOverlap(Box1, 1, new TGeoCombiTrans(-110, -50, 645, new TGeoRotation("Box1", 0, 0, 30)));
207
208 TGeoVolume *Box2 = geom->MakeBox("Box2", Copper, 10, 10, 3);
209 Box2->SetFillColor(3);
210 Box2->SetLineColor(3);
211 top->AddNodeOverlap(Box2, 1, new TGeoCombiTrans(110, 45, 645, new TGeoRotation("Box2", 0, 0, 30)));
212
213 TGeoVolume *Box3 = geom->MakeBox("Box3", Copper, 10, 10, 3);
214 Box3->SetFillColor(3);
215 Box3->SetLineColor(3);
216 top->AddNodeOverlap(Box3, 1, new TGeoCombiTrans(-45, -110, 645, new TGeoRotation("Box3", 0, 0, 70)));
217
218 TGeoVolume *Box4 = geom->MakeBox("Box4", Copper, 10, 10, 3);
219 Box4->SetFillColor(3);
220 Box4->SetLineColor(3);
221 top->AddNodeOverlap(Box4, 1, new TGeoCombiTrans(45, 110, 645, new TGeoRotation("Box4", 0, 0, 70)));
222
223 TGeoVolume *Box5 = geom->MakeBox("Box5", Copper, 10, 10, 3);
224 Box5->SetFillColor(3);
225 Box5->SetLineColor(3);
226 top->AddNodeOverlap(Box5, 1, new TGeoCombiTrans(45, -110, 645, new TGeoRotation("Box5", 0, 0, 30)));
227
228 TGeoVolume *Box6 = geom->MakeBox("Box6", Copper, 10, 10, 3);
229 Box6->SetFillColor(3);
230 Box6->SetLineColor(3);
231 top->AddNodeOverlap(Box6, 1, new TGeoCombiTrans(-45, 110, 645, new TGeoRotation("Box6", 0, 0, 25)));
232
233 TGeoVolume *Box7 = geom->MakeBox("Box7", Copper, 10, 10, 3);
234 Box7->SetFillColor(3);
235 Box7->SetLineColor(3);
236 top->AddNodeOverlap(Box7, 1, new TGeoCombiTrans(110, -50, 645, new TGeoRotation("Box7", 0, 0, 60)));
237
238 TGeoVolume *Box8 = geom->MakeBox("Box8", Copper, 10, 10, 3);
239 Box8->SetFillColor(3);
240 Box8->SetLineColor(3);
241 top->AddNodeOverlap(Box8, 1, new TGeoCombiTrans(-110, 45, 645, new TGeoRotation("Box8", 0, 0, 60)));
242
243 Torus1 = geom->MakeTorus("Torus1", Iron, 120, 30, 20);
244 Torus1->SetFillColor(33);
245 Torus1->SetLineColor(33);
246 top->AddNodeOverlap(Torus1, 1, new TGeoTranslation(0, 0, 610));
247
248 for (int i = 1; i <= 8; i++) {
249 TGeoVolume *Torus2 = geom->MakeTorus("Torus2", Iron, 120, 20, 40, 45 * i - 4, 8);
250 Torus2->SetFillColor(18);
251 Torus2->SetLineColor(18);
252 top->AddNodeOverlap(Torus2, 1, new TGeoTranslation(0, 0, 610));
253
254 TGeoVolume *Tubs = geom->MakeTubs("Line", Iron, 0, 190, 5, 45 * i - 1, 45 * i + 1);
255 Tubs->SetFillColor(18);
256 Tubs->SetLineColor(18);
257 top->AddNodeOverlap(Tubs, 1, new TGeoTranslation(0, 0, 610));
258 }
259
260 TGeoVolume *Sphere00 = geom->MakeSphere("Sphere00", Iron, 0, 15, 0, 45, 0);
261 Sphere00->SetFillColor(2);
262 Sphere00->SetLineColor(2);
263 top->AddNodeOverlap(Sphere00, 1, new TGeoTranslation(-145, -145, 600));
264
265 TGeoVolume *Sphere01 = geom->MakeSphere("Sphere01", Iron, 0, 15, 0, 45, 0);
266 Sphere01->SetFillColor(2);
267 Sphere01->SetLineColor(2);
268 top->AddNodeOverlap(Sphere01, 1, new TGeoTranslation(0, -210, 600));
269
270 TGeoVolume *Sphere02 = geom->MakeSphere("Sphere02", Iron, 0, 15, 0, 45, 0);
271 Sphere02->SetFillColor(2);
272 Sphere02->SetLineColor(2);
273 top->AddNodeOverlap(Sphere02, 1, new TGeoTranslation(145, 145, 600));
274
275 TGeoVolume *Sphere03 = geom->MakeSphere("Sphere03", Iron, 0, 15, 0, 45, 0);
276 Sphere03->SetFillColor(2);
277 Sphere03->SetLineColor(2);
278 top->AddNodeOverlap(Sphere03, 1, new TGeoTranslation(0, 210, 600));
279
280 TGeoVolume *Sphere04 = geom->MakeSphere("Sphere04", Iron, 0, 15, 0, 45, 0);
281 Sphere04->SetFillColor(2);
282 Sphere04->SetLineColor(2);
283 top->AddNodeOverlap(Sphere04, 1, new TGeoTranslation(145, -145, 600));
284
285 TGeoVolume *Sphere05 = geom->MakeSphere("Sphere05", Iron, 0, 15, 0, 45, 0);
286 Sphere05->SetFillColor(2);
287 Sphere05->SetLineColor(2);
288 top->AddNodeOverlap(Sphere05, 1, new TGeoTranslation(-210, 0, 600));
289
290 TGeoVolume *Sphere06 = geom->MakeSphere("Sphere06", Iron, 0, 15, 0, 45, 0);
291 Sphere06->SetFillColor(2);
292 Sphere06->SetLineColor(2);
293 top->AddNodeOverlap(Sphere06, 1, new TGeoTranslation(210, 0, 600));
294
295 TGeoVolume *Sphere07 = geom->MakeSphere("Sphere07", Iron, 0, 15, 0, 45, 0);
296 Sphere07->SetFillColor(2);
297 Sphere07->SetLineColor(2);
298 top->AddNodeOverlap(Sphere07, 1, new TGeoTranslation(-145, 145, 600));
299
300 TGeoVolume *Torus3 = geom->MakeTorus("Torus3", Iron, 190, 0, 10);
301 Torus3->SetFillColor(18);
302 Torus3->SetLineColor(18);
303 top->AddNodeOverlap(Torus3, 1, new TGeoTranslation(0, 0, 610));
304
305 TGeoVolume *Sphere1 = geom->MakeSphere("Sphere1", Iron, 0, 20, 0, 180, 0, 360);
306 Sphere1->SetFillColor(2);
307 Sphere1->SetLineColor(2);
308 top->AddNodeOverlap(Sphere1, 1, new TGeoTranslation(0, 0, 650));
309
310 TGeoVolume *Tubs = geom->MakeTubs("Tubs", Iron, 0, 40, 50, 0, 360);
311 Tubs->SetFillColor(29);
312 Tubs->SetLineColor(29);
313 top->AddNodeOverlap(Tubs, 1, new TGeoTranslation(0, 0, 500));
314
315 TGeoVolume *Tubs1 = geom->MakeTubs("Tubs1", Iron, 50, 60, 230, 40, 150);
316 Tubs1->SetFillColor(18);
317 Tubs1->SetLineColor(18);
318 top->AddNodeOverlap(Tubs1, 1, new TGeoTranslation(-170, -30, -400));
319
320 TGeoVolume *Tubs11 = geom->MakeTubs("Tubs11", Iron, 50, 60, 230, 220, 330);
321 Tubs11->SetFillColor(18);
322 Tubs11->SetLineColor(18);
323 top->AddNodeOverlap(Tubs11, 1, new TGeoTranslation(-260, 35, -400));
324
325 TGeoVolume *Sphere111 = geom->MakeSphere("Sphere111", Iron, 0, 10, 0, 180, 0, 360);
326 Sphere111->SetFillColor(2);
327 Sphere111->SetLineColor(2);
328 top->AddNodeOverlap(Sphere111, 1, new TGeoTranslation(-310, 0, -165));
329
330 TGeoVolume *Sphere112 = geom->MakeSphere("Sphere112", Iron, 0, 10, 0, 180, 0, 360);
331 Sphere112->SetFillColor(2);
332 Sphere112->SetLineColor(2);
333 top->AddNodeOverlap(Sphere112, 1, new TGeoTranslation(-310, 0, -400));
334
335 TGeoVolume *Sphere113 = geom->MakeSphere("Sphere113", Iron, 0, 10, 0, 180, 0, 360);
336 Sphere113->SetFillColor(2);
337 Sphere113->SetLineColor(2);
338 top->AddNodeOverlap(Sphere113, 1, new TGeoTranslation(-310, 0, -635));
339
340 TGeoVolume *Tubs2 = geom->MakeTubs("Tubs2", Iron, 50, 60, 230, 220, 330);
341 Tubs2->SetFillColor(18);
342 Tubs2->SetLineColor(18);
343 top->AddNodeOverlap(Tubs2, 1, new TGeoTranslation(170, 30, -400));
344
345 TGeoVolume *Tubs21 = geom->MakeTubs("Tubs21", Iron, 50, 60, 230, 400, 510);
346 Tubs21->SetFillColor(18);
347 Tubs21->SetLineColor(18);
348 top->AddNodeOverlap(Tubs21, 1, new TGeoTranslation(265, -25, -400));
349
350 TGeoVolume *Sphere211 = geom->MakeSphere("Sphere211", Iron, 0, 10, 0, 180, 0, 360);
351 Sphere211->SetFillColor(2);
352 Sphere211->SetLineColor(2);
353 top->AddNodeOverlap(Sphere211, 1, new TGeoTranslation(310, 0, -165));
354
355 TGeoVolume *Sphere212 = geom->MakeSphere("Sphere212", Iron, 0, 10, 0, 180, 0, 360);
356 Sphere212->SetFillColor(2);
357 Sphere212->SetLineColor(2);
358 top->AddNodeOverlap(Sphere212, 1, new TGeoTranslation(310, 0, -400));
359
360 TGeoVolume *Sphere213 = geom->MakeSphere("Sphere213", Iron, 0, 10, 0, 180, 0, 360);
361 Sphere213->SetFillColor(2);
362 Sphere213->SetLineColor(2);
363 top->AddNodeOverlap(Sphere213, 1, new TGeoTranslation(310, 0, -635));
364
365 TGeoVolume *Tubs3 = geom->MakeTubs("Tubs3", Iron, 50, 60, 230, 130, 260);
366 Tubs3->SetFillColor(18);
367 Tubs3->SetLineColor(18);
368 top->AddNodeOverlap(Tubs3, 1, new TGeoTranslation(30, -170, -400));
369
370 TGeoVolume *Tubs31 = geom->MakeTubs("Tubs31", Iron, 50, 60, 230, 310, 440);
371 Tubs31->SetFillColor(18);
372 Tubs31->SetLineColor(18);
373 top->AddNodeOverlap(Tubs31, 1, new TGeoTranslation(0, -275, -400));
374
375 TGeoVolume *Sphere311 = geom->MakeSphere("Sphere311", Iron, 0, 10, 0, 180, 0, 360);
376 Sphere311->SetFillColor(2);
377 Sphere311->SetLineColor(2);
378 top->AddNodeOverlap(Sphere311, 1, new TGeoTranslation(-35, 320, -165));
379
380 TGeoVolume *Sphere312 = geom->MakeSphere("Sphere312", Iron, 0, 10, 0, 180, 0, 360);
381 Sphere312->SetFillColor(2);
382 Sphere312->SetLineColor(2);
383 top->AddNodeOverlap(Sphere312, 1, new TGeoTranslation(-35, 320, -400));
384
385 TGeoVolume *Sphere313 = geom->MakeSphere("Sphere313", Iron, 0, 10, 0, 180, 0, 360);
386 Sphere313->SetFillColor(2);
387 Sphere313->SetLineColor(2);
388 top->AddNodeOverlap(Sphere313, 1, new TGeoTranslation(-35, 320, -635));
389
390 TGeoVolume *Tubs4 = geom->MakeTubs("Tubs4", Iron, 50, 60, 230, 310, 440);
391 Tubs4->SetFillColor(18);
392 Tubs4->SetLineColor(18);
393 top->AddNodeOverlap(Tubs4, 1, new TGeoTranslation(-30, 170, -400));
394
395 TGeoVolume *Tubs41 = geom->MakeTubs("Tubs41", Iron, 50, 60, 230, 490, 620);
396 Tubs41->SetFillColor(18);
397 Tubs41->SetLineColor(18);
398 top->AddNodeOverlap(Tubs41, 1, new TGeoTranslation(0, 275, -400));
399
400 TGeoVolume *Sphere411 = geom->MakeSphere("Sphere411", Iron, 0, 10, 0, 180, 0, 360);
401 Sphere411->SetFillColor(2);
402 Sphere411->SetLineColor(2);
403 top->AddNodeOverlap(Sphere411, 1, new TGeoTranslation(30, -320, -165));
404
405 TGeoVolume *Sphere412 = geom->MakeSphere("Sphere412", Iron, 0, 10, 0, 180, 0, 360);
406 Sphere412->SetFillColor(2);
407 Sphere412->SetLineColor(2);
408 top->AddNodeOverlap(Sphere412, 1, new TGeoTranslation(30, -320, -400));
409
410 TGeoVolume *Sphere413 = geom->MakeSphere("Sphere413", Iron, 0, 10, 0, 180, 0, 360);
411 Sphere413->SetFillColor(2);
412 Sphere413->SetLineColor(2);
413 top->AddNodeOverlap(Sphere413, 1, new TGeoTranslation(30, -320, -635));
414
415 TGeoVolume *Cone010 = geom->MakeCone("Cone010", Iron, 30, 0, 30, 0, 30);
416 Cone010->SetFillColor(2);
417 Cone010->SetLineColor(2);
418 top->AddNodeOverlap(Cone010, 1, new TGeoTranslation(0, 0, 250));
419
420 TGeoVolume *Torus010 = geom->MakeTorus("Torus010", Iron, 300, 50, 40);
421 Torus010->SetFillColor(33);
422 Torus010->SetLineColor(33);
423 top->AddNodeOverlap(Torus010, 1, new TGeoTranslation(0, 0, 250));
424
425 TGeoVolume *Torus011 = geom->MakeTorus("Torus011", Iron, 400, 10, 10);
426 Torus011->SetFillColor(33);
427 Torus011->SetLineColor(33);
428 top->AddNodeOverlap(Torus011, 1, new TGeoTranslation(0, 0, 250));
429
430 TGeoVolume *Torus012 = geom->MakeTorus("Torus012", Iron, 200, 10, 10);
431 Torus012->SetFillColor(33);
432 Torus012->SetLineColor(33);
433 top->AddNodeOverlap(Torus012, 1, new TGeoTranslation(0, 0, 250));
434
435 TGeoVolume *Sphere010 = geom->MakeSphere("Sphere010", Iron, 0, 10, 0, 180, 0, 360);
436 Sphere010->SetFillColor(2);
437 Sphere010->SetLineColor(2);
438 top->AddNodeOverlap(Sphere010, 1, new TGeoTranslation(-290, -290, 250));
439
440 TGeoVolume *Sphere011 = geom->MakeSphere("Sphere011", Iron, 0, 10, 0, 180, 0, 360);
441 Sphere011->SetFillColor(2);
442 Sphere011->SetLineColor(2);
443 top->AddNodeOverlap(Sphere011, 1, new TGeoTranslation(290, 290, 250));
444
445 TGeoVolume *Sphere012 = geom->MakeSphere("Sphere012", Iron, 0, 10, 0, 180, 0, 360);
446 Sphere012->SetFillColor(2);
447 Sphere012->SetLineColor(2);
448 top->AddNodeOverlap(Sphere012, 1, new TGeoTranslation(0, -410, 250));
449
450 TGeoVolume *Sphere013 = geom->MakeSphere("Sphere013", Iron, 0, 10, 0, 180, 0, 360);
451 Sphere013->SetFillColor(2);
452 Sphere013->SetLineColor(2);
453 top->AddNodeOverlap(Sphere013, 1, new TGeoTranslation(0, 410, 250));
454
455 TGeoVolume *Sphere014 = geom->MakeSphere("Sphere014", Iron, 0, 10, 0, 180, 0, 360);
456 Sphere014->SetFillColor(2);
457 Sphere014->SetLineColor(2);
458 top->AddNodeOverlap(Sphere014, 1, new TGeoTranslation(290, -290, 250));
459
460 TGeoVolume *Sphere015 = geom->MakeSphere("Sphere015", Iron, 0, 10, 0, 180, 0, 360);
461 Sphere015->SetFillColor(2);
462 Sphere015->SetLineColor(2);
463 top->AddNodeOverlap(Sphere015, 1, new TGeoTranslation(-290, 290, 250));
464
465 TGeoVolume *Sphere016 = geom->MakeSphere("Sphere016", Iron, 0, 10, 0, 180, 0, 360);
466 Sphere016->SetFillColor(2);
467 Sphere016->SetLineColor(2);
468 top->AddNodeOverlap(Sphere016, 1, new TGeoTranslation(410, 0, 250));
469
470 TGeoVolume *Sphere017 = geom->MakeSphere("Sphere017", Iron, 0, 10, 0, 180, 0, 360);
471 Sphere017->SetFillColor(2);
472 Sphere017->SetLineColor(2);
473 top->AddNodeOverlap(Sphere017, 1, new TGeoTranslation(-410, 0, 250));
474
475 TGeoVolume *Box010 = geom->MakeBox("Box010", Copper, 10, 10, 3);
476 Box010->SetFillColor(3);
477 Box010->SetLineColor(3);
478 top->AddNodeOverlap(Box1, 1, new TGeoCombiTrans(-120, -280, 300, new TGeoRotation("Box010", 0, 0, 70)));
479
480 TGeoVolume *Box011 = geom->MakeBox("Box011", Copper, 10, 10, 3);
481 Box011->SetFillColor(3);
482 Box011->SetLineColor(3);
483 top->AddNodeOverlap(Box011, 1, new TGeoCombiTrans(120, 280, 300, new TGeoRotation("Box011", 0, 0, 70)));
484
485 TGeoVolume *Box012 = geom->MakeBox("Box012", Copper, 10, 10, 3);
486 Box012->SetFillColor(3);
487 Box012->SetLineColor(3);
488 top->AddNodeOverlap(Box012, 1, new TGeoCombiTrans(120, -280, 300, new TGeoRotation("Box012", 0, 0, 30)));
489
490 TGeoVolume *Box013 = geom->MakeBox("Box013", Copper, 10, 10, 3);
491 Box013->SetFillColor(3);
492 Box013->SetLineColor(3);
493 top->AddNodeOverlap(Box013, 1, new TGeoCombiTrans(-120, 280, 300, new TGeoRotation("Box013", 0, 0, 30)));
494
495 TGeoVolume *Box014 = geom->MakeBox("Box010", Copper, 10, 10, 3);
496 Box014->SetFillColor(3);
497 Box014->SetLineColor(3);
498 top->AddNodeOverlap(Box014, 1, new TGeoCombiTrans(270, -120, 300, new TGeoRotation("Box014", 0, 0, 70)));
499
500 TGeoVolume *Box015 = geom->MakeBox("Box015", Copper, 10, 10, 3);
501 Box015->SetFillColor(3);
502 Box015->SetLineColor(3);
503 top->AddNodeOverlap(Box015, 1, new TGeoCombiTrans(-270, 120, 300, new TGeoRotation("Box015", 0, 0, 70)));
504
505 TGeoVolume *Box016 = geom->MakeBox("Box016", Copper, 10, 10, 3);
506 Box016->SetFillColor(3);
507 Box016->SetLineColor(3);
508 top->AddNodeOverlap(Box016, 1, new TGeoCombiTrans(270, 100, 300, new TGeoRotation("Box016", 0, 0, 30)));
509
510 TGeoVolume *Box017 = geom->MakeBox("Box017", Copper, 10, 10, 3);
511 Box017->SetFillColor(3);
512 Box017->SetLineColor(3);
513 top->AddNodeOverlap(Box017, 1, new TGeoCombiTrans(-270, -120, 300, new TGeoRotation("Box017", 0, 0, 30)));
514
515 for (int i = 1; i <= 8; i++) {
516 TGeoVolume *Torus0101 = geom->MakeTorus("Torus0101", Iron, 300, 70, 40, 45 * i - 4, 8);
517 Torus0101->SetFillColor(18);
518 Torus0101->SetLineColor(18);
519 top->AddNodeOverlap(Torus0101, 1, new TGeoTranslation(0, 0, 250));
520
521 TGeoVolume *Tubs0101 = geom->MakeTubs("Line", Iron, 0, 400, 5, 45 * i - 1, 45 * i + 1);
522 Tubs0101->SetFillColor(18);
523 Tubs0101->SetLineColor(18);
524 top->AddNodeOverlap(Tubs0101, 1, new TGeoTranslation(0, 0, 250));
525 }
526
527 Cone31->SetFillColor(38);
528 top->SetVisibility(false);
529 geom->CloseGeometry();
530
531 top->Draw("ogl");
532}
virtual void SetFillColor(Color_t fcolor)
Set the fill area color.
Definition TAttFill.h:37
Class describing rotation + translation.
Definition TGeoMatrix.h:317
The manager class for any TGeo geometry.
Definition TGeoManager.h:44
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 * 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 * 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 * 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.
void SetTopVisible(Bool_t vis=kTRUE)
make top volume visible on screen
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.
Base class describing materials.
Media are used to store properties related to tracking and which are useful only when using geometry ...
Definition TGeoMedium.h:23
Class describing rotations.
Definition TGeoMatrix.h:168
Class describing translations.
Definition TGeoMatrix.h:116
TGeoVolume, TGeoVolumeMulti, TGeoVolumeAssembly are the volume classes.
Definition TGeoVolume.h:43
void SetVisibility(Bool_t vis=kTRUE) override
set visibility of this volume
void Draw(Option_t *option="") override
draw top volume according to option
virtual void AddNodeOverlap(TGeoVolume *vol, Int_t copy_no, TGeoMatrix *mat=nullptr, Option_t *option="")
Add a TGeoNode to the list of nodes.
void SetLineColor(Color_t lcolor) override
Set the line color.