Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
south_gate.C
Go to the documentation of this file.
1/// \file
2/// \ingroup tutorial_geom
3/// Drawing a famous Korean gate, the South gate, called Namdeamoon in Korean, 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 south_gate.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_south_gate.png width=800px
14/// \macro_code
15///
16/// \author Lan Hee Yang(yangd5d5@hotmail.com), Dept. of Physics, Univ. of Seoul
17
18#include "TGeoManager.h"
19
20void south_gate()
21{
22
23 TGeoManager *geom = new TGeoManager("geom", "My first 3D geometry");
24
25 TGeoMaterial *vacuum = new TGeoMaterial("vacuum", 0, 0, 0); // a,z,rho
26 TGeoMaterial *Fe = new TGeoMaterial("Fe", 55.845, 26, 7.87);
27
28 // Create media
29
30 TGeoMedium *Air = new TGeoMedium("Vacuum", 0, vacuum);
31 TGeoMedium *Iron = new TGeoMedium("Iron", 1, Fe);
32
33 // Create volume
34
35 TGeoVolume *top = geom->MakeBox("top", Air, 1000, 1000, 1000);
36 geom->SetTopVolume(top);
37 geom->SetTopVisible(false);
38 // If you want to see the boundary, please input the number, 1 instead of 0.
39 // Like this, geom->SetTopVisible(1);
40
41 // base
42
43 char nBlocks[100];
44 int i = 1;
45 int N = 0;
46 int f = 0;
47 int di[2];
48 di[0] = 0;
49 di[1] = 30;
50 TGeoVolume *mBlock;
51
52 while (f < 11) {
53 while (i < 14) {
54 if (i == 6 && f < 8) {
55 i = i + 3;
56 }
57
58 sprintf(nBlocks, "f%d_bg%d", f, N++);
59 mBlock = geom->MakeBox(nBlocks, Iron, 29, 149, 9);
60 mBlock->SetLineColor(20);
61 if (f < 8) {
62 if (i <= 5 && f < 8) {
63 top->AddNodeOverlap(mBlock, 1, new TGeoTranslation(-120 - ((i - 1) * 60) - di[f % 2], 5, 5 + (20 * f)));
64 } else if (i > 5 && f < 8) {
65 top->AddNodeOverlap(mBlock, 1, new TGeoTranslation(120 + ((i - 9) * 60) + di[f % 2], 5, 5 + (20 * f)));
66 }
67 } else {
68 top->AddNodeOverlap(mBlock, 1, new TGeoTranslation(-420 + (i * 60) - di[f % 2], 5, 5 + (20 * f)));
69 }
70 i++;
71 if (i >= 14 && f >= 8 && f % 2 == 1) {
72 sprintf(nBlocks, "f%d_bg%d", f, N++);
73 mBlock = geom->MakeBox(nBlocks, Iron, 29, 149, 9);
74 mBlock->SetLineColor(20);
75 top->AddNodeOverlap(mBlock, 1, new TGeoTranslation(-420 + (i * 60) - di[f % 2], 5, 5 + (20 * f)));
76 i++;
77 }
78 if (f % 2 == 0) {
79 sprintf(nBlocks, "f%d_bg%d", f, N++);
80 mBlock = geom->MakeBox(nBlocks, Iron, 14.5, 149, 9);
81 mBlock->SetLineColor(20);
82 top->AddNodeOverlap(mBlock, 1, new TGeoTranslation(-405, 5, 5 + (20 * f)));
83 sprintf(nBlocks, "f%d_bg%d", f, N++);
84 mBlock = geom->MakeBox(nBlocks, Iron, 14.5, 149, 9);
85 mBlock->SetLineColor(20);
86 top->AddNodeOverlap(mBlock, 1, new TGeoTranslation(405, 5, 5 + (20 * f)));
87 } else if (f < 5) {
88 sprintf(nBlocks, "f%d_bg%d", f, N++);
89 mBlock = geom->MakeBox(nBlocks, Iron, 14.5, 149, 9);
90 mBlock->SetLineColor(20);
91 top->AddNodeOverlap(mBlock, 1, new TGeoTranslation(-105, 5, 5 + (20 * f)));
92 sprintf(nBlocks, "f%d_bg%d", f, N++);
93 mBlock = geom->MakeBox(nBlocks, Iron, 14.5, 149, 9);
94 mBlock->SetLineColor(20);
95 top->AddNodeOverlap(mBlock, 1, new TGeoTranslation(105, 5, 5 + (20 * f)));
96 }
97 }
98 sprintf(nBlocks, "f%d_bg%d", 8, N++);
99 mBlock = geom->MakeBox(nBlocks, Iron, 40, 149, 9);
100 mBlock->SetLineColor(20);
101 top->AddNodeOverlap(mBlock, 1, new TGeoTranslation(-80, 5, 145));
102 sprintf(nBlocks, "f%d_bg%d", 8, N++);
103 mBlock = geom->MakeBox(nBlocks, Iron, 40, 149, 9);
104 mBlock->SetLineColor(20);
105 top->AddNodeOverlap(mBlock, 1, new TGeoTranslation(80, 5, 145));
106
107 sprintf(nBlocks, "f%d_bg%d", 7, N++);
108 mBlock = geom->MakeBox(nBlocks, Iron, 15, 149, 9);
109 mBlock->SetLineColor(20);
110 top->AddNodeOverlap(mBlock, 1, new TGeoTranslation(-75, 5, 125));
111 sprintf(nBlocks, "f%d_bg%d", 7, N++);
112 mBlock = geom->MakeBox(nBlocks, Iron, 15, 149, 9);
113 mBlock->SetLineColor(20);
114 top->AddNodeOverlap(mBlock, 1, new TGeoTranslation(75, 5, 125));
115
116 sprintf(nBlocks, "f%d_bg%d", 6, N++);
117 mBlock = geom->MakeBox(nBlocks, Iron, 24, 149, 9);
118 mBlock->SetLineColor(20);
119 top->AddNodeOverlap(mBlock, 1, new TGeoTranslation(-95, 5, 105));
120 sprintf(nBlocks, "f%d_bg%d", 6, N++);
121 mBlock = geom->MakeBox(nBlocks, Iron, 24, 149, 9);
122 mBlock->SetLineColor(20);
123 top->AddNodeOverlap(mBlock, 1, new TGeoTranslation(95, 5, 105));
124
125 i = 1;
126 f++;
127 }
128
129 // wall
130
131 f = 0;
132 while (f < 5) {
133 i = 0;
134 while (i < 65) {
135 sprintf(nBlocks, "f%d_bg%d", f, N++);
136 mBlock = geom->MakeBox(nBlocks, Iron, 5.8, 3, 3.8);
137 mBlock->SetLineColor(25);
138 top->AddNodeOverlap(mBlock, 1, new TGeoTranslation(-384 + (i * 12), 137, 218 + (f * 8)));
139 i++;
140 }
141 f++;
142 }
143
144 f = 0;
145 while (f < 5) {
146 i = 0;
147 while (i < 65) {
148 sprintf(nBlocks, "f%d_bg%d", f, N++);
149 mBlock = geom->MakeBox(nBlocks, Iron, 5.8, 3, 3.8);
150 mBlock->SetLineColor(25);
151 top->AddNodeOverlap(mBlock, 1, new TGeoTranslation(-384 + (i * 12), -137, 218 + (f * 8)));
152 i++;
153 }
154 f++;
155 }
156
157 f = 0;
158 while (f < 7) {
159 i = 0;
160 while (i < 22) {
161 sprintf(nBlocks, "f%d_bg%d", f, N++);
162 mBlock = geom->MakeBox(nBlocks, Iron, 3, 5.8, 3.8);
163 mBlock->SetLineColor(25);
164 top->AddNodeOverlap(mBlock, 1, new TGeoTranslation(-384, -126 + (i * 12), 218 + (f * 8)));
165 i++;
166 }
167 f++;
168 }
169
170 f = 0;
171 while (f < 7) {
172 i = 0;
173 while (i < 22) {
174 sprintf(nBlocks, "f%d_bg%d", f, N++);
175 mBlock = geom->MakeBox(nBlocks, Iron, 3, 5.8, 3.8);
176 mBlock->SetLineColor(25);
177 top->AddNodeOverlap(mBlock, 1, new TGeoTranslation(384, -126 + (i * 12), 218 + (f * 8)));
178 i++;
179 }
180 f++;
181 }
182
183 // arch
184
185 int k;
186 k = 0;
187 i = 0;
188
189 while (i < 5) {
190 while (k < 10) {
191 sprintf(nBlocks, "ab%d", N++);
192 mBlock = geom->MakeTubs(nBlocks, Iron, 70, 89, 14, (i * 36) + 0.5, (i + 1) * 36 - 0.5);
193 mBlock->SetLineColor(20);
194 top->AddNodeOverlap(mBlock, 1, new TGeoCombiTrans(0, -130 + (k * 30), 70, new TGeoRotation("r1", 0, 90, 0)));
195 k++;
196 }
197 i++;
198 k = 0;
199 }
200
201 sprintf(nBlocks, "ab%d", N++);
202 mBlock = geom->MakeBox(nBlocks, Iron, 9, 149, 17);
203 mBlock->SetLineColor(20);
204 top->AddNodeOverlap(mBlock, 1, new TGeoTranslation(80, 5, 14));
205 sprintf(nBlocks, "ab%d", N++);
206 mBlock = geom->MakeBox(nBlocks, Iron, 9, 149, 18);
207 mBlock->SetLineColor(20);
208 top->AddNodeOverlap(mBlock, 1, new TGeoTranslation(80, 5, 51));
209
210 sprintf(nBlocks, "ab%d", N++);
211 mBlock = geom->MakeBox(nBlocks, Iron, 9, 149, 17);
212 mBlock->SetLineColor(20);
213 top->AddNodeOverlap(mBlock, 1, new TGeoTranslation(-80, 5, 14));
214 sprintf(nBlocks, "ab%d", N++);
215 mBlock = geom->MakeBox(nBlocks, Iron, 9, 149, 18);
216 mBlock->SetLineColor(20);
217 top->AddNodeOverlap(mBlock, 1, new TGeoTranslation(-80, 5, 51));
218
219 // wall's kiwa
220
221 k = 0;
222 i = 0;
223
224 while (i < 5) {
225 while (k < 52) {
226 sprintf(nBlocks, "ab%d", N++);
227 mBlock = geom->MakeTubs(nBlocks, Iron, 1, 3, 7, 0, 180);
228 mBlock->SetLineColor(12);
229 top->AddNodeOverlap(mBlock, 1,
230 new TGeoCombiTrans(-382 + (k * 15), 137, 255, new TGeoRotation("r1", 90, 90, 0)));
231 k++;
232 }
233 i++;
234 k = 0;
235 }
236
237 k = 0;
238 i = 0;
239
240 while (i < 5) {
241 while (k < 52) {
242 sprintf(nBlocks, "ab%d", N++);
243 mBlock = geom->MakeTubs(nBlocks, Iron, 2.5, 3, 7, 0, 180);
244 mBlock->SetLineColor(12);
245 top->AddNodeOverlap(mBlock, 1,
246 new TGeoCombiTrans(-382 + (k * 15), -137, 255, new TGeoRotation("r1", 90, 90, 0)));
247 k++;
248 }
249 i++;
250 k = 0;
251 }
252
253 k = 0;
254 i = 0;
255
256 while (i < 5) {
257 while (k < 20) {
258 sprintf(nBlocks, "ab%d", N++);
259 mBlock = geom->MakeTubs(nBlocks, Iron, 2.5, 3, 6, 0, 180);
260 mBlock->SetLineColor(12);
261 top->AddNodeOverlap(mBlock, 1,
262 new TGeoCombiTrans(-382, -123 + (k * 13), 271, new TGeoRotation("r1", 0, 90, 0)));
263 k++;
264 }
265 i++;
266 k = 0;
267 }
268
269 k = 0;
270 i = 0;
271
272 while (i < 5) {
273 while (k < 20) {
274 sprintf(nBlocks, "ab%d", N++);
275 mBlock = geom->MakeTubs(nBlocks, Iron, 2.5, 3, 7, 0, 180);
276 mBlock->SetLineColor(12);
277 top->AddNodeOverlap(mBlock, 1,
278 new TGeoCombiTrans(382, -123 + (k * 13), 271, new TGeoRotation("r1", 0, 90, 0)));
279 k++;
280 }
281 i++;
282 k = 0;
283 }
284
285 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
286
287 // 1 floor
288
289 k = 0;
290 i = 0;
291
292 while (i < 5) {
293 while (k < 7) {
294 sprintf(nBlocks, "ab%d", N++);
295 mBlock = geom->MakeTubs(nBlocks, Iron, 0, 5, 56, 0, 360);
296 mBlock->SetLineColor(50);
297
298 if (k <= 2) {
299
300 top->AddNodeOverlap(mBlock, 1,
301 new TGeoCombiTrans(-300 + (k * 100), 80, 260, new TGeoRotation("r1", 0, 0, 0)));
302 } else if (k >= 4) {
303 top->AddNodeOverlap(mBlock, 1,
304 new TGeoCombiTrans(-300 + (k * 100), 80, 260, new TGeoRotation("r1", 0, 0, 0)));
305 }
306
307 k++;
308 }
309 i++;
310 k = 0;
311 }
312
313 k = 0;
314 i = 0;
315
316 while (i < 5) {
317 while (k < 7) {
318 sprintf(nBlocks, "ab%d", N++);
319 mBlock = geom->MakeTubs(nBlocks, Iron, 0, 5, 56, 0, 360);
320 mBlock->SetLineColor(50);
321
322 if (k <= 2) {
323
324 top->AddNodeOverlap(mBlock, 1,
325 new TGeoCombiTrans(-300 + (k * 100), -80, 260, new TGeoRotation("r1", 0, 0, 0)));
326 } else if (k >= 4) {
327 top->AddNodeOverlap(mBlock, 1,
328 new TGeoCombiTrans(-300 + (k * 100), -80, 260, new TGeoRotation("r1", 0, 0, 0)));
329 }
330
331 k++;
332 }
333 i++;
334 k = 0;
335 }
336
337 // ||=====||======||=====||=====||=====||=====||
338
339 sprintf(nBlocks, "ab%d", N++);
340 mBlock = geom->MakeBox(nBlocks, Iron, 298, 78, 8);
341 mBlock->SetLineColor(42);
342 top->AddNodeOverlap(mBlock, 1, new TGeoTranslation(0, 0, 300));
343
344 sprintf(nBlocks, "ab%d", N++);
345 mBlock = geom->MakeBox(nBlocks, Iron, 298, 78, 5);
346 mBlock->SetLineColor(42);
347 top->AddNodeOverlap(mBlock, 1, new TGeoTranslation(0, 0, 320));
348
349 // 1
350 k = 0;
351 i = 0;
352
353 while (i < 5) {
354 while (k < 6) {
355 sprintf(nBlocks, "ab%d", N++);
356 mBlock = geom->MakeBox(nBlocks, Iron, 18, 10, 8);
357 mBlock->SetLineColor(8);
358 {
359 top->AddNodeOverlap(mBlock, 1,
360 new TGeoCombiTrans(-250 + (k * 100), 70, 300, new TGeoRotation("r1", 0, 0, 0)));
361 }
362 k++;
363 }
364 i++;
365 k = 0;
366 }
367
368 k = 0;
369 i = 0;
370
371 while (i < 5) {
372 while (k < 6) {
373 sprintf(nBlocks, "ab%d", N++);
374 mBlock = geom->MakeBox(nBlocks, Iron, 18, 10, 8);
375 mBlock->SetLineColor(8);
376 {
377 top->AddNodeOverlap(mBlock, 1,
378 new TGeoCombiTrans(-250 + (k * 100), -70, 300, new TGeoRotation("r1", 0, 0, 0)));
379 }
380 k++;
381 }
382 i++;
383 k = 0;
384 }
385
386 sprintf(nBlocks, "ab%d", N++);
387 mBlock = geom->MakeBox(nBlocks, Iron, 18, 10, 8);
388 mBlock->SetLineColor(8);
389 top->AddNodeOverlap(mBlock, 1, new TGeoCombiTrans(-290, 0, 300, new TGeoRotation("r1", 90, 0, 0)));
390
391 sprintf(nBlocks, "ab%d", N++);
392 mBlock = geom->MakeBox(nBlocks, Iron, 18, 10, 8);
393 mBlock->SetLineColor(8);
394 top->AddNodeOverlap(mBlock, 1, new TGeoCombiTrans(290, 0, 300, new TGeoRotation("r1", 90, 0, 0)));
395
396 // 2
397 k = 0;
398 i = 0;
399
400 while (i < 5) {
401 while (k < 6) {
402 sprintf(nBlocks, "ab%d", N++);
403 mBlock = geom->MakeBox(nBlocks, Iron, 18, 10, 5);
404 mBlock->SetLineColor(8);
405 {
406 top->AddNodeOverlap(mBlock, 1,
407 new TGeoCombiTrans(-250 + (k * 100), 70, 320, new TGeoRotation("r1", 0, 0, 0)));
408 }
409 k++;
410 }
411 i++;
412 k = 0;
413 }
414
415 k = 0;
416 i = 0;
417
418 while (i < 5) {
419 while (k < 6) {
420 sprintf(nBlocks, "ab%d", N++);
421 mBlock = geom->MakeBox(nBlocks, Iron, 18, 10, 5);
422 mBlock->SetLineColor(8);
423 {
424 top->AddNodeOverlap(mBlock, 1,
425 new TGeoCombiTrans(-250 + (k * 100), -70, 320, new TGeoRotation("r1", 0, 0, 0)));
426 }
427 k++;
428 }
429 i++;
430 k = 0;
431 }
432
433 sprintf(nBlocks, "ab%d", N++);
434 mBlock = geom->MakeBox(nBlocks, Iron, 18, 10, 5);
435 mBlock->SetLineColor(8);
436 top->AddNodeOverlap(mBlock, 1, new TGeoCombiTrans(-290, 0, 320, new TGeoRotation("r1", 90, 0, 0)));
437
438 sprintf(nBlocks, "ab%d", N++);
439 mBlock = geom->MakeBox(nBlocks, Iron, 18, 10, 5);
440 mBlock->SetLineColor(8);
441 top->AddNodeOverlap(mBlock, 1, new TGeoCombiTrans(290, 0, 320, new TGeoRotation("r1", 90, 0, 0)));
442
443 //___||____||_____||____||____||____||____||
444
445 k = 0;
446 i = 0;
447
448 while (i < 5) {
449 while (k < 19) {
450 sprintf(nBlocks, "ab%d", N++);
451 mBlock = geom->MakeBox(nBlocks, Iron, 5, 5, 20);
452 mBlock->SetLineColor(50);
453 top->AddNodeOverlap(mBlock, 1,
454 new TGeoCombiTrans(-300 + (k * 33.3), 78, 345, new TGeoRotation("r1", 0, 0, 0)));
455 k++;
456 }
457 i++;
458 k = 0;
459 }
460
461 k = 0;
462 i = 0;
463
464 while (i < 5) {
465 while (k < 19) {
466 sprintf(nBlocks, "ab%d", N++);
467 mBlock = geom->MakeBox(nBlocks, Iron, 5, 5, 20);
468 mBlock->SetLineColor(50);
469 top->AddNodeOverlap(mBlock, 1,
470 new TGeoCombiTrans(-300 + (k * 33.3), -78, 345, new TGeoRotation("r1", 0, 0, 0)));
471 k++;
472 }
473 i++;
474 k = 0;
475 }
476
477 k = 0;
478 i = 0;
479
480 while (i < 5) {
481 while (k < 5) {
482 sprintf(nBlocks, "ab%d", N++);
483 mBlock = geom->MakeBox(nBlocks, Iron, 5, 5, 20);
484 mBlock->SetLineColor(50);
485 top->AddNodeOverlap(mBlock, 1, new TGeoCombiTrans(-300, -78 + (k * 33), 345, new TGeoRotation("r1", 0, 0, 0)));
486 k++;
487 }
488 i++;
489 k = 0;
490 }
491
492 k = 0;
493 i = 0;
494
495 while (i < 5) {
496 while (k < 5) {
497 sprintf(nBlocks, "ab%d", N++);
498 mBlock = geom->MakeBox(nBlocks, Iron, 5, 5, 20);
499 mBlock->SetLineColor(50);
500 top->AddNodeOverlap(mBlock, 1, new TGeoCombiTrans(300, -78 + (k * 33), 345, new TGeoRotation("r1", 0, 0, 0)));
501 k++;
502 }
503 i++;
504 k = 0;
505 }
506
507 // ||// ||// ||// ||//
508
509 k = 0;
510 i = 0;
511
512 while (i < 5) {
513 while (k < 19) {
514 sprintf(nBlocks, "ab%d", N++);
515 mBlock = geom->MakeBox(nBlocks, Iron, 5, 5, 20);
516 mBlock->SetLineColor(50);
517 top->AddNodeOverlap(mBlock, 1,
518 new TGeoCombiTrans(-300 + (k * 33.3), 90, 342, new TGeoRotation("r1", 0, -45, 0)));
519 k++;
520 }
521 i++;
522 k = 0;
523 }
524
525 k = 0;
526 i = 0;
527
528 while (i < 5) {
529 while (k < 19) {
530 sprintf(nBlocks, "ab%d", N++);
531 mBlock = geom->MakeBox(nBlocks, Iron, 5, 5, 20);
532 mBlock->SetLineColor(50);
533 top->AddNodeOverlap(mBlock, 1,
534 new TGeoCombiTrans(-300 + (k * 33.3), -90, 342, new TGeoRotation("r1", 0, 45, 0)));
535 k++;
536 }
537 i++;
538 k = 0;
539 }
540
541 k = 0;
542 i = 0;
543
544 while (i < 5) {
545 while (k < 5) {
546 sprintf(nBlocks, "ab%d", N++);
547 mBlock = geom->MakeBox(nBlocks, Iron, 5, 5, 20);
548 mBlock->SetLineColor(50);
549 top->AddNodeOverlap(mBlock, 1,
550 new TGeoCombiTrans(-318, -78 + (k * 33), 345, new TGeoRotation("r1", -90, 45, 0)));
551 k++;
552 }
553 i++;
554 k = 0;
555 }
556
557 k = 0;
558 i = 0;
559
560 while (i < 5) {
561 while (k < 5) {
562 sprintf(nBlocks, "ab%d", N++);
563 mBlock = geom->MakeBox(nBlocks, Iron, 5, 5, 20);
564 mBlock->SetLineColor(50);
565 top->AddNodeOverlap(mBlock, 1,
566 new TGeoCombiTrans(318, -78 + (k * 33), 345, new TGeoRotation("r1", 90, 45, 0)));
567 k++;
568 }
569 i++;
570 k = 0;
571 }
572
573 // /// || / / / / / / / || / / / / / / / / || / / / / / / / / / / /
574
575 sprintf(nBlocks, "ab%d", N++);
576 mBlock = geom->MakeBox(nBlocks, Iron, 330, 10, 2);
577 mBlock->SetLineColor(42);
578 top->AddNodeOverlap(mBlock, 1, new TGeoCombiTrans(0, -107, 362, new TGeoRotation("r1", 0, -45, 0)));
579
580 sprintf(nBlocks, "ab%d", N++);
581 mBlock = geom->MakeBox(nBlocks, Iron, 330, 10, 2);
582 mBlock->SetLineColor(42);
583 top->AddNodeOverlap(mBlock, 1, new TGeoCombiTrans(0, 107, 362, new TGeoRotation("r1", 0, 45, 0)));
584
585 sprintf(nBlocks, "ab%d", N++);
586 mBlock = geom->MakeBox(nBlocks, Iron, 110, 10, 2);
587 mBlock->SetLineColor(42);
588 top->AddNodeOverlap(mBlock, 1, new TGeoCombiTrans(330, 0, 362, new TGeoRotation("r1", 90, -45, 0)));
589
590 sprintf(nBlocks, "ab%d", N++);
591 mBlock = geom->MakeBox(nBlocks, Iron, 110, 10, 2);
592 mBlock->SetLineColor(42);
593 top->AddNodeOverlap(mBlock, 1, new TGeoCombiTrans(-330, 0, 362, new TGeoRotation("r1", 90, 45, 0)));
594
595 /////////////////////// add box
596
597 k = 0;
598 i = 0;
599
600 while (i < 5) {
601 while (k < 6) {
602 sprintf(nBlocks, "ab%d", N++);
603 mBlock = geom->MakeBox(nBlocks, Iron, 18, 10, 2);
604 mBlock->SetLineColor(8);
605 {
606 top->AddNodeOverlap(mBlock, 1,
607 new TGeoCombiTrans(-270 + (k * 100), -108, 362, new TGeoRotation("r1", 0, -45, 0)));
608 }
609 k++;
610 }
611 i++;
612 k = 0;
613 }
614
615 k = 0;
616 i = 0;
617
618 while (i < 5) {
619 while (k < 6) {
620 sprintf(nBlocks, "ab%d", N++);
621 mBlock = geom->MakeBox(nBlocks, Iron, 18, 10, 2);
622 mBlock->SetLineColor(8);
623 {
624 top->AddNodeOverlap(mBlock, 1,
625 new TGeoCombiTrans(-270 + (k * 100), 108, 362, new TGeoRotation("r1", 0, 45, 0)));
626 }
627 k++;
628 }
629 i++;
630 k = 0;
631 }
632
633 sprintf(nBlocks, "ab%d", N++);
634 mBlock = geom->MakeBox(nBlocks, Iron, 18, 10, 2);
635 mBlock->SetLineColor(8);
636 top->AddNodeOverlap(mBlock, 1, new TGeoCombiTrans(331, 0, 362, new TGeoRotation("r1", 90, -45, 0)));
637
638 sprintf(nBlocks, "ab%d", N++);
639 mBlock = geom->MakeBox(nBlocks, Iron, 18, 10, 2);
640 mBlock->SetLineColor(8);
641 top->AddNodeOverlap(mBlock, 1, new TGeoCombiTrans(-331, 0, 362, new TGeoRotation("r1", 90, 45, 0)));
642
643 /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
644
645 // 2nd floor
646
647 k = 0;
648 i = 0;
649
650 while (i < 5) {
651 while (k < 7) {
652 sprintf(nBlocks, "ab%d", N++);
653 mBlock = geom->MakeTubs(nBlocks, Iron, 0, 5, 30, 0, 360);
654 mBlock->SetLineColor(50);
655
656 if (k <= 2) {
657
658 top->AddNodeOverlap(mBlock, 1,
659 new TGeoCombiTrans(-300 + (k * 100), 80, 465, new TGeoRotation("r1", 0, 0, 0)));
660 } else if (k >= 4) {
661 top->AddNodeOverlap(mBlock, 1,
662 new TGeoCombiTrans(-300 + (k * 100), 80, 465, new TGeoRotation("r1", 0, 0, 0)));
663 }
664
665 k++;
666 }
667 i++;
668 k = 0;
669 }
670
671 k = 0;
672 i = 0;
673
674 while (i < 5) {
675 while (k < 7) {
676 sprintf(nBlocks, "ab%d", N++);
677 mBlock = geom->MakeTubs(nBlocks, Iron, 0, 5, 30, 0, 360);
678 mBlock->SetLineColor(50);
679
680 if (k <= 2) {
681
682 top->AddNodeOverlap(mBlock, 1,
683 new TGeoCombiTrans(-300 + (k * 100), -80, 465, new TGeoRotation("r1", 0, 0, 0)));
684 } else if (k >= 4) {
685 top->AddNodeOverlap(mBlock, 1,
686 new TGeoCombiTrans(-300 + (k * 100), -80, 465, new TGeoRotation("r1", 0, 0, 0)));
687 }
688
689 k++;
690 }
691 i++;
692 k = 0;
693 }
694
695 // ||=====||======||=====||=====||=====||=====||
696
697 sprintf(nBlocks, "ab%d", N++);
698 mBlock = geom->MakeBox(nBlocks, Iron, 302, 80, 8);
699 mBlock->SetLineColor(42);
700 top->AddNodeOverlap(mBlock, 1, new TGeoTranslation(0, 0, 480));
701
702 sprintf(nBlocks, "ab%d", N++);
703 mBlock = geom->MakeBox(nBlocks, Iron, 302, 80, 5);
704 mBlock->SetLineColor(42);
705 top->AddNodeOverlap(mBlock, 1, new TGeoTranslation(0, 0, 500));
706
707 sprintf(nBlocks, "ab%d", N++);
708 mBlock = geom->MakeBox(nBlocks, Iron, 305, 80, 2.5);
709 mBlock->SetLineColor(50);
710 top->AddNodeOverlap(mBlock, 1, new TGeoTranslation(0, 0, 465));
711
712 ///////////////////////add box
713
714 // 1
715 k = 0;
716 i = 0;
717
718 while (i < 5) {
719 while (k < 6) {
720 sprintf(nBlocks, "ab%d", N++);
721 mBlock = geom->MakeBox(nBlocks, Iron, 18, 10, 8);
722 mBlock->SetLineColor(8);
723 {
724 top->AddNodeOverlap(mBlock, 1,
725 new TGeoCombiTrans(-250 + (k * 100), 71, 480, new TGeoRotation("r1", 0, 0, 0)));
726 }
727 k++;
728 }
729 i++;
730 k = 0;
731 }
732
733 k = 0;
734 i = 0;
735
736 while (i < 5) {
737 while (k < 6) {
738 sprintf(nBlocks, "ab%d", N++);
739 mBlock = geom->MakeBox(nBlocks, Iron, 18, 10, 8);
740 mBlock->SetLineColor(8);
741 {
742 top->AddNodeOverlap(mBlock, 1,
743 new TGeoCombiTrans(-250 + (k * 100), -71, 480, new TGeoRotation("r1", 0, 0, 0)));
744 }
745 k++;
746 }
747 i++;
748 k = 0;
749 }
750
751 sprintf(nBlocks, "ab%d", N++);
752 mBlock = geom->MakeBox(nBlocks, Iron, 18, 10, 8);
753 mBlock->SetLineColor(8);
754 top->AddNodeOverlap(mBlock, 1, new TGeoCombiTrans(-293, 0, 480, new TGeoRotation("r1", 90, 0, 0)));
755
756 sprintf(nBlocks, "ab%d", N++);
757 mBlock = geom->MakeBox(nBlocks, Iron, 18, 10, 8);
758 mBlock->SetLineColor(8);
759 top->AddNodeOverlap(mBlock, 1, new TGeoCombiTrans(293, 0, 480, new TGeoRotation("r1", 90, 0, 0)));
760
761 // 2
762 k = 0;
763 i = 0;
764
765 while (i < 5) {
766 while (k < 6) {
767 sprintf(nBlocks, "ab%d", N++);
768 mBlock = geom->MakeBox(nBlocks, Iron, 18, 10, 5);
769 mBlock->SetLineColor(8);
770 {
771 top->AddNodeOverlap(mBlock, 1,
772 new TGeoCombiTrans(-250 + (k * 100), 71, 500, new TGeoRotation("r1", 0, 0, 0)));
773 }
774 k++;
775 }
776 i++;
777 k = 0;
778 }
779
780 k = 0;
781 i = 0;
782
783 while (i < 5) {
784 while (k < 6) {
785 sprintf(nBlocks, "ab%d", N++);
786 mBlock = geom->MakeBox(nBlocks, Iron, 18, 10, 5);
787 mBlock->SetLineColor(8);
788 {
789 top->AddNodeOverlap(mBlock, 1,
790 new TGeoCombiTrans(-250 + (k * 100), -71, 500, new TGeoRotation("r1", 0, 0, 0)));
791 }
792 k++;
793 }
794 i++;
795 k = 0;
796 }
797
798 sprintf(nBlocks, "ab%d", N++);
799 mBlock = geom->MakeBox(nBlocks, Iron, 18, 10, 5);
800 mBlock->SetLineColor(8);
801 top->AddNodeOverlap(mBlock, 1, new TGeoCombiTrans(-293, 0, 500, new TGeoRotation("r1", 90, 0, 0)));
802
803 sprintf(nBlocks, "ab%d", N++);
804 mBlock = geom->MakeBox(nBlocks, Iron, 18, 10, 5);
805 mBlock->SetLineColor(8);
806 top->AddNodeOverlap(mBlock, 1, new TGeoCombiTrans(293, 0, 500, new TGeoRotation("r1", 90, 0, 0)));
807
808 // 1 ___||____||_____||____||____||____||____||
809
810 k = 0;
811 i = 0;
812
813 while (i < 5) {
814 while (k < 25) {
815 sprintf(nBlocks, "ab%d", N++);
816 mBlock = geom->MakeBox(nBlocks, Iron, 1.5, 5, 15);
817 mBlock->SetLineColor(50);
818 top->AddNodeOverlap(mBlock, 1, new TGeoCombiTrans(-300 + (k * 25), 78, 450, new TGeoRotation("r1", 0, 0, 0)));
819 k++;
820 }
821 i++;
822 k = 0;
823 }
824
825 k = 0;
826 i = 0;
827
828 while (i < 5) {
829 while (k < 25) {
830 sprintf(nBlocks, "ab%d", N++);
831 mBlock = geom->MakeBox(nBlocks, Iron, 1.5, 5, 15);
832 mBlock->SetLineColor(50);
833 top->AddNodeOverlap(mBlock, 1, new TGeoCombiTrans(-300 + (k * 25), -78, 450, new TGeoRotation("r1", 0, 0, 0)));
834 k++;
835 }
836 i++;
837 k = 0;
838 }
839
840 k = 0;
841 i = 0;
842
843 while (i < 5) {
844 while (k < 7) {
845 sprintf(nBlocks, "ab%d", N++);
846 mBlock = geom->MakeBox(nBlocks, Iron, 5, 1.5, 15);
847 mBlock->SetLineColor(50);
848 top->AddNodeOverlap(mBlock, 1, new TGeoCombiTrans(-300, -78 + (k * 25), 450, new TGeoRotation("r1", 0, 0, 0)));
849 k++;
850 }
851 i++;
852 k = 0;
853 }
854
855 k = 0;
856 i = 0;
857
858 while (i < 5) {
859 while (k < 7) {
860 sprintf(nBlocks, "ab%d", N++);
861 mBlock = geom->MakeBox(nBlocks, Iron, 5, 1.5, 15);
862 mBlock->SetLineColor(50);
863 top->AddNodeOverlap(mBlock, 1, new TGeoCombiTrans(300, -78 + (k * 25), 450, new TGeoRotation("r1", 0, 0, 0)));
864 k++;
865 }
866 i++;
867 k = 0;
868 }
869
870 // 2 ___||____||_____||____||____||____||____||
871
872 k = 0;
873 i = 0;
874
875 while (i < 5) {
876 while (k < 19) {
877 sprintf(nBlocks, "ab%d", N++);
878 mBlock = geom->MakeBox(nBlocks, Iron, 5, 5, 20);
879 mBlock->SetLineColor(50);
880 top->AddNodeOverlap(mBlock, 1,
881 new TGeoCombiTrans(-300 + (k * 33.3), 78, 525, new TGeoRotation("r1", 0, 0, 0)));
882 k++;
883 }
884 i++;
885 k = 0;
886 }
887
888 k = 0;
889 i = 0;
890
891 while (i < 5) {
892 while (k < 19) {
893 sprintf(nBlocks, "ab%d", N++);
894 mBlock = geom->MakeBox(nBlocks, Iron, 5, 5, 20);
895 mBlock->SetLineColor(50);
896 top->AddNodeOverlap(mBlock, 1,
897 new TGeoCombiTrans(-300 + (k * 33.3), -78, 525, new TGeoRotation("r1", 0, 0, 0)));
898 k++;
899 }
900 i++;
901 k = 0;
902 }
903
904 k = 0;
905 i = 0;
906
907 while (i < 5) {
908 while (k < 5) {
909 sprintf(nBlocks, "ab%d", N++);
910 mBlock = geom->MakeBox(nBlocks, Iron, 5, 5, 20);
911 mBlock->SetLineColor(50);
912 top->AddNodeOverlap(mBlock, 1, new TGeoCombiTrans(-300, -78 + (k * 33), 525, new TGeoRotation("r1", 0, 0, 0)));
913 k++;
914 }
915 i++;
916 k = 0;
917 }
918
919 k = 0;
920 i = 0;
921
922 while (i < 5) {
923 while (k < 5) {
924 sprintf(nBlocks, "ab%d", N++);
925 mBlock = geom->MakeBox(nBlocks, Iron, 5, 5, 20);
926 mBlock->SetLineColor(50);
927 top->AddNodeOverlap(mBlock, 1, new TGeoCombiTrans(300, -78 + (k * 33), 525, new TGeoRotation("r1", 0, 0, 0)));
928 k++;
929 }
930 i++;
931 k = 0;
932 }
933
934 // ||// ||// ||// ||//
935
936 // down
937
938 k = 0;
939 i = 0;
940
941 while (i < 5) {
942 while (k < 19) {
943 sprintf(nBlocks, "ab%d", N++);
944 mBlock = geom->MakeBox(nBlocks, Iron, 5, 5, 20);
945 mBlock->SetLineColor(50);
946 top->AddNodeOverlap(mBlock, 1,
947 new TGeoCombiTrans(-300 + (k * 33.3), 90, 522, new TGeoRotation("r1", 0, -45, 0)));
948 k++;
949 }
950 i++;
951 k = 0;
952 }
953
954 k = 0;
955 i = 0;
956
957 while (i < 5) {
958 while (k < 19) {
959 sprintf(nBlocks, "ab%d", N++);
960 mBlock = geom->MakeBox(nBlocks, Iron, 5, 5, 20);
961 mBlock->SetLineColor(50);
962 top->AddNodeOverlap(mBlock, 1,
963 new TGeoCombiTrans(-300 + (k * 33.3), -90, 522, new TGeoRotation("r1", 0, 45, 0)));
964 k++;
965 }
966 i++;
967 k = 0;
968 }
969
970 k = 0;
971 i = 0;
972
973 while (i < 5) {
974 while (k < 5) {
975 sprintf(nBlocks, "ab%d", N++);
976 mBlock = geom->MakeBox(nBlocks, Iron, 5, 5, 20);
977 mBlock->SetLineColor(50);
978 top->AddNodeOverlap(mBlock, 1,
979 new TGeoCombiTrans(-318, -78 + (k * 33.3), 525, new TGeoRotation("r1", -90, 45, 0)));
980 k++;
981 }
982 i++;
983 k = 0;
984 }
985
986 k = 0;
987 i = 0;
988
989 while (i < 5) {
990 while (k < 5) {
991 sprintf(nBlocks, "ab%d", N++);
992 mBlock = geom->MakeBox(nBlocks, Iron, 5, 5, 20);
993 mBlock->SetLineColor(50);
994 top->AddNodeOverlap(mBlock, 1,
995 new TGeoCombiTrans(318, -78 + (k * 33.3), 525, new TGeoRotation("r1", 90, 45, 0)));
996 k++;
997 }
998 i++;
999 k = 0;
1000 }
1001
1002 // up
1003
1004 k = 0;
1005 i = 0;
1006
1007 while (i < 5) {
1008 while (k < 50) {
1009 sprintf(nBlocks, "ab%d", N++);
1010 mBlock = geom->MakeBox(nBlocks, Iron, 2.5, 2.5, 20);
1011 mBlock->SetLineColor(50);
1012 top->AddNodeOverlap(mBlock, 1,
1013 new TGeoCombiTrans(-320 + (k * 13), 115, 562, new TGeoRotation("r1", 0, -115, 0)));
1014 k++;
1015 }
1016 i++;
1017 k = 0;
1018 }
1019
1020 k = 0;
1021 i = 0;
1022
1023 while (i < 5) {
1024 while (k < 50) {
1025 sprintf(nBlocks, "ab%d", N++);
1026 mBlock = geom->MakeBox(nBlocks, Iron, 2.5, 2.5, 20);
1027 mBlock->SetLineColor(50);
1028 top->AddNodeOverlap(mBlock, 1,
1029 new TGeoCombiTrans(-320 + (k * 13), -115, 562, new TGeoRotation("r1", 0, 115, 0)));
1030 k++;
1031 }
1032 i++;
1033 k = 0;
1034 }
1035
1036 k = 0;
1037 i = 0;
1038
1039 while (i < 5) {
1040 while (k < 17) {
1041 sprintf(nBlocks, "ab%d", N++);
1042 mBlock = geom->MakeBox(nBlocks, Iron, 2.5, 2.5, 20);
1043 mBlock->SetLineColor(50);
1044 top->AddNodeOverlap(mBlock, 1,
1045 new TGeoCombiTrans(-340, -98 + (k * 13), 565, new TGeoRotation("r1", -90, 115, 0)));
1046 k++;
1047 }
1048 i++;
1049 k = 0;
1050 }
1051
1052 k = 0;
1053 i = 0;
1054
1055 while (i < 5) {
1056 while (k < 17) {
1057 sprintf(nBlocks, "ab%d", N++);
1058 mBlock = geom->MakeBox(nBlocks, Iron, 2.5, 2.5, 20);
1059 mBlock->SetLineColor(50);
1060 top->AddNodeOverlap(mBlock, 1,
1061 new TGeoCombiTrans(340, -98 + (k * 13), 565, new TGeoRotation("r1", 90, 115, 0)));
1062 k++;
1063 }
1064 i++;
1065 k = 0;
1066 }
1067
1068 // up2
1069
1070 k = 0;
1071 i = 0;
1072
1073 while (i < 5) {
1074 while (k < 50) {
1075 sprintf(nBlocks, "ab%d", N++);
1076 mBlock = geom->MakeBox(nBlocks, Iron, 2.5, 2.5, 20);
1077 mBlock->SetLineColor(50);
1078 top->AddNodeOverlap(mBlock, 1,
1079 new TGeoCombiTrans(-320 + (k * 13), 115, 375, new TGeoRotation("r1", 0, -115, 0)));
1080 k++;
1081 }
1082 i++;
1083 k = 0;
1084 }
1085
1086 k = 0;
1087 i = 0;
1088
1089 while (i < 5) {
1090 while (k < 50) {
1091 sprintf(nBlocks, "ab%d", N++);
1092 mBlock = geom->MakeBox(nBlocks, Iron, 2.5, 2.5, 20);
1093 mBlock->SetLineColor(50);
1094 top->AddNodeOverlap(mBlock, 1,
1095 new TGeoCombiTrans(-320 + (k * 13), -115, 375, new TGeoRotation("r1", 0, 115, 0)));
1096 k++;
1097 }
1098 i++;
1099 k = 0;
1100 }
1101
1102 k = 0;
1103 i = 0;
1104
1105 while (i < 5) {
1106 while (k < 17) {
1107 sprintf(nBlocks, "ab%d", N++);
1108 mBlock = geom->MakeBox(nBlocks, Iron, 2.5, 2.5, 20);
1109 mBlock->SetLineColor(50);
1110 top->AddNodeOverlap(mBlock, 1,
1111 new TGeoCombiTrans(-340, -98 + (k * 13), 375, new TGeoRotation("r1", -90, 115, 0)));
1112 k++;
1113 }
1114 i++;
1115 k = 0;
1116 }
1117
1118 k = 0;
1119 i = 0;
1120
1121 while (i < 5) {
1122 while (k < 17) {
1123 sprintf(nBlocks, "ab%d", N++);
1124 mBlock = geom->MakeBox(nBlocks, Iron, 2.5, 2.5, 20);
1125 mBlock->SetLineColor(50);
1126 top->AddNodeOverlap(mBlock, 1,
1127 new TGeoCombiTrans(340, -98 + (k * 13), 375, new TGeoRotation("r1", 90, 115, 0)));
1128 k++;
1129 }
1130 i++;
1131 k = 0;
1132 }
1133
1134 // up 3
1135
1136 k = 0;
1137 i = 0;
1138
1139 while (i < 5) {
1140 while (k < 50) {
1141 sprintf(nBlocks, "ab%d", N++);
1142 mBlock = geom->MakeBox(nBlocks, Iron, 2.5, 2.5, 20);
1143 mBlock->SetLineColor(44);
1144 top->AddNodeOverlap(mBlock, 1,
1145 new TGeoCombiTrans(-320 + (k * 13), 115, 568, new TGeoRotation("r1", 0, -115, 0)));
1146 k++;
1147 }
1148 i++;
1149 k = 0;
1150 }
1151
1152 k = 0;
1153 i = 0;
1154
1155 while (i < 5) {
1156 while (k < 50) {
1157 sprintf(nBlocks, "ab%d", N++);
1158 mBlock = geom->MakeBox(nBlocks, Iron, 2.5, 2.5, 20);
1159 mBlock->SetLineColor(44);
1160 top->AddNodeOverlap(mBlock, 1,
1161 new TGeoCombiTrans(-320 + (k * 13), -115, 568, new TGeoRotation("r1", 0, 115, 0)));
1162 k++;
1163 }
1164 i++;
1165 k = 0;
1166 }
1167
1168 k = 0;
1169 i = 0;
1170
1171 while (i < 5) {
1172 while (k < 17) {
1173 sprintf(nBlocks, "ab%d", N++);
1174 mBlock = geom->MakeBox(nBlocks, Iron, 2.5, 2.5, 20);
1175 mBlock->SetLineColor(44);
1176 top->AddNodeOverlap(mBlock, 1,
1177 new TGeoCombiTrans(-340, -98 + (k * 13), 568, new TGeoRotation("r1", -90, 115, 0)));
1178 k++;
1179 }
1180 i++;
1181 k = 0;
1182 }
1183
1184 k = 0;
1185 i = 0;
1186
1187 while (i < 5) {
1188 while (k < 17) {
1189 sprintf(nBlocks, "ab%d", N++);
1190 mBlock = geom->MakeBox(nBlocks, Iron, 2.5, 2.5, 20);
1191 mBlock->SetLineColor(44);
1192 top->AddNodeOverlap(mBlock, 1,
1193 new TGeoCombiTrans(340, -98 + (k * 13), 568, new TGeoRotation("r1", 90, 115, 0)));
1194 k++;
1195 }
1196 i++;
1197 k = 0;
1198 }
1199
1200 // up4
1201
1202 k = 0;
1203 i = 0;
1204
1205 while (i < 5) {
1206 while (k < 50) {
1207 sprintf(nBlocks, "ab%d", N++);
1208 mBlock = geom->MakeBox(nBlocks, Iron, 2.5, 2.5, 20);
1209 mBlock->SetLineColor(44);
1210 top->AddNodeOverlap(mBlock, 1,
1211 new TGeoCombiTrans(-320 + (k * 13), 115, 385, new TGeoRotation("r1", 0, -115, 0)));
1212 k++;
1213 }
1214 i++;
1215 k = 0;
1216 }
1217
1218 k = 0;
1219 i = 0;
1220
1221 while (i < 5) {
1222 while (k < 50) {
1223 sprintf(nBlocks, "ab%d", N++);
1224 mBlock = geom->MakeBox(nBlocks, Iron, 2.5, 2.5, 20);
1225 mBlock->SetLineColor(44);
1226 top->AddNodeOverlap(mBlock, 1,
1227 new TGeoCombiTrans(-320 + (k * 13), -115, 385, new TGeoRotation("r1", 0, 115, 0)));
1228 k++;
1229 }
1230 i++;
1231 k = 0;
1232 }
1233
1234 k = 0;
1235 i = 0;
1236
1237 while (i < 5) {
1238 while (k < 17) {
1239 sprintf(nBlocks, "ab%d", N++);
1240 mBlock = geom->MakeBox(nBlocks, Iron, 2.5, 2.5, 20);
1241 mBlock->SetLineColor(44);
1242 top->AddNodeOverlap(mBlock, 1,
1243 new TGeoCombiTrans(-340, -98 + (k * 13), 385, new TGeoRotation("r1", -90, 115, 0)));
1244 k++;
1245 }
1246 i++;
1247 k = 0;
1248 }
1249
1250 k = 0;
1251 i = 0;
1252
1253 while (i < 5) {
1254 while (k < 17) {
1255 sprintf(nBlocks, "ab%d", N++);
1256 mBlock = geom->MakeBox(nBlocks, Iron, 2.5, 2.5, 20);
1257 mBlock->SetLineColor(44);
1258 top->AddNodeOverlap(mBlock, 1,
1259 new TGeoCombiTrans(340, -98 + (k * 13), 385, new TGeoRotation("r1", 90, 115, 0)));
1260 k++;
1261 }
1262 i++;
1263 k = 0;
1264 }
1265
1266 // up kiwa
1267 //=========
1268 sprintf(nBlocks, "ab%d", N++);
1269 mBlock = geom->MakeBox(nBlocks, Iron, 270, 15, 20);
1270 mBlock->SetLineColor(10);
1271 top->AddNodeOverlap(mBlock, 1, new TGeoCombiTrans(0, 0, 620, new TGeoRotation("r1", 0, 0, 0)));
1272 //===============//2
1273 sprintf(nBlocks, "ab%d", N++);
1274 mBlock = geom->MakeBox(nBlocks, Iron, 75, 15, 20);
1275 mBlock->SetLineColor(10);
1276 top->AddNodeOverlap(mBlock, 1, new TGeoCombiTrans(300, -50, 600, new TGeoRotation("r1", 0, 20, -40)));
1277
1278 sprintf(nBlocks, "ab%d", N++);
1279 mBlock = geom->MakeBox(nBlocks, Iron, 75, 15, 20);
1280 mBlock->SetLineColor(10);
1281 top->AddNodeOverlap(mBlock, 1, new TGeoCombiTrans(300, 50, 600, new TGeoRotation("r1", 0, -20, 40)));
1282
1283 sprintf(nBlocks, "ab%d", N++);
1284 mBlock = geom->MakeBox(nBlocks, Iron, 75, 15, 20);
1285 mBlock->SetLineColor(10);
1286 top->AddNodeOverlap(mBlock, 1, new TGeoCombiTrans(-300, 50, 600, new TGeoRotation("r1", 0, -20, -40)));
1287
1288 sprintf(nBlocks, "ab%d", N++);
1289 mBlock = geom->MakeBox(nBlocks, Iron, 75, 15, 20);
1290 mBlock->SetLineColor(10);
1291 top->AddNodeOverlap(mBlock, 1, new TGeoCombiTrans(-300, -50, 600, new TGeoRotation("r1", 0, 20, 40)));
1292
1293 //===============//1
1294 sprintf(nBlocks, "ab%d", N++);
1295 mBlock = geom->MakeBox(nBlocks, Iron, 50, 15, 20);
1296 mBlock->SetLineColor(10);
1297 top->AddNodeOverlap(mBlock, 1, new TGeoCombiTrans(300, -80, 413, new TGeoRotation("r1", 0, 20, -40)));
1298
1299 sprintf(nBlocks, "ab%d", N++);
1300 mBlock = geom->MakeBox(nBlocks, Iron, 50, 15, 20);
1301 mBlock->SetLineColor(10);
1302 top->AddNodeOverlap(mBlock, 1, new TGeoCombiTrans(300, 80, 413, new TGeoRotation("r1", 0, -20, 40)));
1303
1304 sprintf(nBlocks, "ab%d", N++);
1305 mBlock = geom->MakeBox(nBlocks, Iron, 50, 15, 20);
1306 mBlock->SetLineColor(10);
1307 top->AddNodeOverlap(mBlock, 1, new TGeoCombiTrans(-300, 80, 413, new TGeoRotation("r1", 0, -20, -40)));
1308
1309 sprintf(nBlocks, "ab%d", N++);
1310 mBlock = geom->MakeBox(nBlocks, Iron, 50, 15, 20);
1311 mBlock->SetLineColor(10);
1312 top->AddNodeOverlap(mBlock, 1, new TGeoCombiTrans(-300, -80, 413, new TGeoRotation("r1", 0, 20, 40)));
1313
1314 // _1_
1315
1316 // front
1317
1318 k = 0;
1319 i = 0;
1320 while (i < 7) {
1321 while (k < 44) {
1322 sprintf(nBlocks, "ab%d", N++);
1323 mBlock = geom->MakeTubs(nBlocks, Iron, 3, 6, 6, 10, 170);
1324 mBlock->SetLineColor(13);
1325 top->AddNodeOverlap(
1326 mBlock, 1,
1327 new TGeoCombiTrans(-280 + (k * 13), 70 + (i * 12.5), 425 - (i * 5), new TGeoRotation("r1", 0, 60, 0)));
1328 k++;
1329 }
1330 i++;
1331 k = 0;
1332 }
1333
1334 k = 0;
1335 i = 0;
1336
1337 while (i < 7) {
1338 while (k < 44) {
1339 sprintf(nBlocks, "ab%d", N++);
1340 mBlock = geom->MakeTubs(nBlocks, Iron, 3, 6, 6, 10, 170);
1341 mBlock->SetLineColor(13);
1342 top->AddNodeOverlap(
1343 mBlock, 1,
1344 new TGeoCombiTrans(-280 + (k * 13), -70 - (i * 12.5), 425 - (i * 5), new TGeoRotation("r1", 0, 120, 0)));
1345 k++;
1346 }
1347 i++;
1348 k = 0;
1349 }
1350
1351 //_2_
1352
1353 k = 0;
1354 i = 0;
1355 while (i < 11) {
1356 while (k < 43) {
1357 sprintf(nBlocks, "ab%d", N++);
1358 mBlock = geom->MakeTubs(nBlocks, Iron, 3, 6, 6, 10, 170);
1359 mBlock->SetLineColor(13);
1360
1361 top->AddNodeOverlap(
1362 mBlock, 1,
1363 new TGeoCombiTrans(-270 + (k * 13), 15 + (i * 12.5), 620 - (i * 5), new TGeoRotation("r1", 0, 60, 0)));
1364 k++;
1365 }
1366 i++;
1367 k = 0;
1368 }
1369
1370 k = 0;
1371 i = 0;
1372
1373 while (i < 11) {
1374 while (k < 43) {
1375 sprintf(nBlocks, "ab%d", N++);
1376 mBlock = geom->MakeTubs(nBlocks, Iron, 3, 6, 6, 10, 170);
1377 mBlock->SetLineColor(13);
1378 top->AddNodeOverlap(
1379 mBlock, 1,
1380 new TGeoCombiTrans(-270 + (k * 13), -15 - (i * 12.5), 620 - (i * 5), new TGeoRotation("r1", 0, 120, 0)));
1381 k++;
1382 }
1383 i++;
1384 k = 0;
1385 }
1386
1387 //////left
1388 k = 0;
1389 i = 0;
1390
1391 while (i < 6) {
1392 while (k < 11) {
1393 sprintf(nBlocks, "ab%d", N++);
1394 mBlock = geom->MakeTubs(nBlocks, Iron, 3, 6, 6, 10, 170);
1395 mBlock->SetLineColor(13);
1396 top->AddNodeOverlap(
1397 mBlock, 1, new TGeoCombiTrans(-335, 81.25 + (i * 12.5), 592.5 - (i * 2), new TGeoRotation("r1", 0, 60, 0)));
1398 k++;
1399 }
1400 i++;
1401 k = 0;
1402 }
1403
1404 k = 0;
1405 i = 0;
1406
1407 while (i < 7) {
1408 while (k < 11) {
1409 sprintf(nBlocks, "ab%d", N++);
1410 mBlock = geom->MakeTubs(nBlocks, Iron, 3, 6, 6, 10, 170);
1411 mBlock->SetLineColor(13);
1412 top->AddNodeOverlap(
1413 mBlock, 1, new TGeoCombiTrans(-322, 69.75 + (i * 12.5), 595 - (i * 2), new TGeoRotation("r1", 0, 60, 0)));
1414 k++;
1415 }
1416 i++;
1417 k = 0;
1418 }
1419
1420 k = 0;
1421 i = 0;
1422
1423 while (i < 8) {
1424 while (k < 11) {
1425 sprintf(nBlocks, "ab%d", N++);
1426 mBlock = geom->MakeTubs(nBlocks, Iron, 3, 6, 6, 10, 170);
1427 mBlock->SetLineColor(13);
1428 top->AddNodeOverlap(
1429 mBlock, 1, new TGeoCombiTrans(-309, 56.25 + (i * 12.5), 605 - (i * 4), new TGeoRotation("r1", 0, 60, 0)));
1430 k++;
1431 }
1432 i++;
1433 k = 0;
1434 }
1435
1436 k = 0;
1437 i = 0;
1438
1439 while (i < 9) {
1440 while (k < 11) {
1441 sprintf(nBlocks, "ab%d", N++);
1442 mBlock = geom->MakeTubs(nBlocks, Iron, 3, 6, 6, 10, 170);
1443 mBlock->SetLineColor(13);
1444 top->AddNodeOverlap(
1445 mBlock, 1, new TGeoCombiTrans(-296, 50 + (i * 12.5), 610 - (i * 4), new TGeoRotation("r1", 0, 60, 0)));
1446 k++;
1447 }
1448 i++;
1449 k = 0;
1450 }
1451
1452 k = 0;
1453 i = 0;
1454
1455 while (i < 10) {
1456 while (k < 11) {
1457 sprintf(nBlocks, "ab%d", N++);
1458 mBlock = geom->MakeTubs(nBlocks, Iron, 3, 6, 6, 10, 170);
1459 mBlock->SetLineColor(13);
1460 top->AddNodeOverlap(
1461 mBlock, 1, new TGeoCombiTrans(-283, 37.5 + (i * 12.5), 615 - (i * 4), new TGeoRotation("r1", 0, 60, 0)));
1462 k++;
1463 }
1464 i++;
1465 k = 0;
1466 }
1467
1468 k = 0;
1469 i = 0;
1470
1471 while (i < 6) {
1472 while (k < 11) {
1473 sprintf(nBlocks, "ab%d", N++);
1474 mBlock = geom->MakeTubs(nBlocks, Iron, 3, 6, 6, 10, 170);
1475 mBlock->SetLineColor(13);
1476 top->AddNodeOverlap(
1477 mBlock, 1,
1478 new TGeoCombiTrans(-335, -81.25 - (i * 12.5), 592.5 - (i * 2), new TGeoRotation("r1", 0, 120, 0)));
1479 k++;
1480 }
1481 i++;
1482 k = 0;
1483 }
1484
1485 k = 0;
1486 i = 0;
1487
1488 while (i < 7) {
1489 while (k < 11) {
1490 sprintf(nBlocks, "ab%d", N++);
1491 mBlock = geom->MakeTubs(nBlocks, Iron, 3, 6, 6, 10, 170);
1492 mBlock->SetLineColor(13);
1493 top->AddNodeOverlap(
1494 mBlock, 1, new TGeoCombiTrans(-322, -69.75 - (i * 12.5), 595 - (i * 2), new TGeoRotation("r1", 0, 120, 0)));
1495 k++;
1496 }
1497 i++;
1498 k = 0;
1499 }
1500
1501 k = 0;
1502 i = 0;
1503
1504 while (i < 8) {
1505 while (k < 11) {
1506 sprintf(nBlocks, "ab%d", N++);
1507 mBlock = geom->MakeTubs(nBlocks, Iron, 3, 6, 6, 10, 170);
1508 mBlock->SetLineColor(13);
1509 top->AddNodeOverlap(
1510 mBlock, 1, new TGeoCombiTrans(-309, -56.25 - (i * 12.5), 605 - (i * 4), new TGeoRotation("r1", 0, 120, 0)));
1511 k++;
1512 }
1513 i++;
1514 k = 0;
1515 }
1516
1517 k = 0;
1518 i = 0;
1519
1520 while (i < 9) {
1521 while (k < 11) {
1522 sprintf(nBlocks, "ab%d", N++);
1523 mBlock = geom->MakeTubs(nBlocks, Iron, 3, 6, 6, 10, 170);
1524 mBlock->SetLineColor(13);
1525 top->AddNodeOverlap(
1526 mBlock, 1, new TGeoCombiTrans(-296, -50 - (i * 12.5), 610 - (i * 4), new TGeoRotation("r1", 0, 120, 0)));
1527 k++;
1528 }
1529 i++;
1530 k = 0;
1531 }
1532
1533 k = 0;
1534 i = 0;
1535
1536 while (i < 10) {
1537 while (k < 11) {
1538 sprintf(nBlocks, "ab%d", N++);
1539 mBlock = geom->MakeTubs(nBlocks, Iron, 3, 6, 6, 10, 170);
1540 mBlock->SetLineColor(13);
1541 top->AddNodeOverlap(
1542 mBlock, 1, new TGeoCombiTrans(-283, -37.5 - (i * 12.5), 615 - (i * 4), new TGeoRotation("r1", 0, 120, 0)));
1543 k++;
1544 }
1545 i++;
1546 k = 0;
1547 }
1548
1549 //////////right
1550
1551 k = 0;
1552 i = 0;
1553
1554 while (i < 6) {
1555 while (k < 11) {
1556 sprintf(nBlocks, "ab%d", N++);
1557 mBlock = geom->MakeTubs(nBlocks, Iron, 3, 6, 6, 10, 170);
1558 mBlock->SetLineColor(13);
1559 top->AddNodeOverlap(
1560 mBlock, 1, new TGeoCombiTrans(335, 81.25 + (i * 12.5), 592.5 - (i * 2), new TGeoRotation("r1", 0, 60, 0)));
1561 k++;
1562 }
1563 i++;
1564 k = 0;
1565 }
1566
1567 k = 0;
1568 i = 0;
1569
1570 while (i < 7) {
1571 while (k < 11) {
1572 sprintf(nBlocks, "ab%d", N++);
1573 mBlock = geom->MakeTubs(nBlocks, Iron, 3, 6, 6, 10, 170);
1574 mBlock->SetLineColor(13);
1575 top->AddNodeOverlap(
1576 mBlock, 1, new TGeoCombiTrans(322, 69.75 + (i * 12.5), 595 - (i * 2), new TGeoRotation("r1", 0, 60, 0)));
1577 k++;
1578 }
1579 i++;
1580 k = 0;
1581 }
1582
1583 k = 0;
1584 i = 0;
1585
1586 while (i < 8) {
1587 while (k < 11) {
1588 sprintf(nBlocks, "ab%d", N++);
1589 mBlock = geom->MakeTubs(nBlocks, Iron, 3, 6, 6, 10, 170);
1590 mBlock->SetLineColor(13);
1591 top->AddNodeOverlap(
1592 mBlock, 1, new TGeoCombiTrans(309, 56.25 + (i * 12.5), 605 - (i * 4), new TGeoRotation("r1", 0, 60, 0)));
1593 k++;
1594 }
1595 i++;
1596 k = 0;
1597 }
1598
1599 k = 0;
1600 i = 0;
1601
1602 while (i < 9) {
1603 while (k < 11) {
1604 sprintf(nBlocks, "ab%d", N++);
1605 mBlock = geom->MakeTubs(nBlocks, Iron, 3, 6, 6, 10, 170);
1606 mBlock->SetLineColor(13);
1607 top->AddNodeOverlap(mBlock, 1,
1608 new TGeoCombiTrans(296, 50 + (i * 12.5), 610 - (i * 4), new TGeoRotation("r1", 0, 60, 0)));
1609 k++;
1610 }
1611 i++;
1612 k = 0;
1613 }
1614
1615 k = 0;
1616 i = 0;
1617
1618 while (i < 10) {
1619 while (k < 11) {
1620 sprintf(nBlocks, "ab%d", N++);
1621 mBlock = geom->MakeTubs(nBlocks, Iron, 3, 6, 6, 10, 170);
1622 mBlock->SetLineColor(13);
1623 top->AddNodeOverlap(
1624 mBlock, 1, new TGeoCombiTrans(283, 37.5 + (i * 12.5), 615 - (i * 4), new TGeoRotation("r1", 0, 60, 0)));
1625 k++;
1626 }
1627 i++;
1628 k = 0;
1629 }
1630
1631 //
1632
1633 k = 0;
1634 i = 0;
1635
1636 while (i < 6) {
1637 while (k < 11) {
1638 sprintf(nBlocks, "ab%d", N++);
1639 mBlock = geom->MakeTubs(nBlocks, Iron, 3, 6, 6, 10, 170);
1640 mBlock->SetLineColor(13);
1641 top->AddNodeOverlap(
1642 mBlock, 1,
1643 new TGeoCombiTrans(335, -81.25 - (i * 12.5), 592.5 - (i * 2), new TGeoRotation("r1", 0, 120, 0)));
1644 k++;
1645 }
1646 i++;
1647 k = 0;
1648 }
1649
1650 k = 0;
1651 i = 0;
1652
1653 while (i < 7) {
1654 while (k < 11) {
1655 sprintf(nBlocks, "ab%d", N++);
1656 mBlock = geom->MakeTubs(nBlocks, Iron, 3, 6, 6, 10, 170);
1657 mBlock->SetLineColor(13);
1658 top->AddNodeOverlap(
1659 mBlock, 1, new TGeoCombiTrans(322, -69.75 - (i * 12.5), 595 - (i * 2), new TGeoRotation("r1", 0, 120, 0)));
1660 k++;
1661 }
1662 i++;
1663 k = 0;
1664 }
1665
1666 k = 0;
1667 i = 0;
1668
1669 while (i < 8) {
1670 while (k < 11) {
1671 sprintf(nBlocks, "ab%d", N++);
1672 mBlock = geom->MakeTubs(nBlocks, Iron, 3, 6, 6, 10, 170);
1673 mBlock->SetLineColor(13);
1674 top->AddNodeOverlap(
1675 mBlock, 1, new TGeoCombiTrans(309, -56.25 - (i * 12.5), 605 - (i * 4), new TGeoRotation("r1", 0, 120, 0)));
1676 k++;
1677 }
1678 i++;
1679 k = 0;
1680 }
1681
1682 k = 0;
1683 i = 0;
1684
1685 while (i < 9) {
1686 while (k < 11) {
1687 sprintf(nBlocks, "ab%d", N++);
1688 mBlock = geom->MakeTubs(nBlocks, Iron, 3, 6, 6, 10, 170);
1689 mBlock->SetLineColor(13);
1690 top->AddNodeOverlap(
1691 mBlock, 1, new TGeoCombiTrans(296, -50 - (i * 12.5), 610 - (i * 4), new TGeoRotation("r1", 0, 120, 0)));
1692 k++;
1693 }
1694 i++;
1695 k = 0;
1696 }
1697
1698 k = 0;
1699 i = 0;
1700
1701 while (i < 10) {
1702 while (k < 11) {
1703 sprintf(nBlocks, "ab%d", N++);
1704 mBlock = geom->MakeTubs(nBlocks, Iron, 3, 6, 6, 10, 170);
1705 mBlock->SetLineColor(13);
1706 top->AddNodeOverlap(
1707 mBlock, 1, new TGeoCombiTrans(283, -37.5 - (i * 12.5), 615 - (i * 4), new TGeoRotation("r1", 0, 120, 0)));
1708 k++;
1709 }
1710 i++;
1711 k = 0;
1712 }
1713
1714 // /// || / / / / / / / || / / / / / / / / || / / / / / / / / / / /
1715
1716 sprintf(nBlocks, "ab%d", N++);
1717 mBlock = geom->MakeBox(nBlocks, Iron, 330, 10, 2);
1718 mBlock->SetLineColor(42);
1719 top->AddNodeOverlap(mBlock, 1, new TGeoCombiTrans(0, -110, 550, new TGeoRotation("r1", 0, -45, 0)));
1720
1721 sprintf(nBlocks, "ab%d", N++);
1722 mBlock = geom->MakeBox(nBlocks, Iron, 330, 10, 2);
1723 mBlock->SetLineColor(42);
1724 top->AddNodeOverlap(mBlock, 1, new TGeoCombiTrans(0, 110, 550, new TGeoRotation("r1", 0, 45, 0)));
1725
1726 sprintf(nBlocks, "ab%d", N++);
1727 mBlock = geom->MakeBox(nBlocks, Iron, 110, 10, 2);
1728 mBlock->SetLineColor(42);
1729 top->AddNodeOverlap(mBlock, 1, new TGeoCombiTrans(335, 0, 550, new TGeoRotation("r1", 90, -45, 0)));
1730
1731 sprintf(nBlocks, "ab%d", N++);
1732 mBlock = geom->MakeBox(nBlocks, Iron, 110, 10, 2);
1733 mBlock->SetLineColor(42);
1734 top->AddNodeOverlap(mBlock, 1, new TGeoCombiTrans(-335, 0, 550, new TGeoRotation("r1", 90, 45, 0)));
1735
1736 ////////////////////////////////add box
1737
1738 k = 0;
1739 i = 0;
1740
1741 while (i < 5) {
1742 while (k < 6) {
1743 sprintf(nBlocks, "ab%d", N++);
1744 mBlock = geom->MakeBox(nBlocks, Iron, 18, 10, 2);
1745 mBlock->SetLineColor(8);
1746 {
1747 top->AddNodeOverlap(mBlock, 1,
1748 new TGeoCombiTrans(-270 + (k * 100), -111, 550, new TGeoRotation("r1", 0, -45, 0)));
1749 }
1750 k++;
1751 }
1752 i++;
1753 k = 0;
1754 }
1755
1756 k = 0;
1757 i = 0;
1758
1759 while (i < 5) {
1760 while (k < 6) {
1761 sprintf(nBlocks, "ab%d", N++);
1762 mBlock = geom->MakeBox(nBlocks, Iron, 18, 10, 2);
1763 mBlock->SetLineColor(8);
1764 {
1765 top->AddNodeOverlap(mBlock, 1,
1766 new TGeoCombiTrans(-270 + (k * 100), 111, 550, new TGeoRotation("r1", 0, 45, 0)));
1767 }
1768 k++;
1769 }
1770 i++;
1771 k = 0;
1772 }
1773
1774 sprintf(nBlocks, "ab%d", N++);
1775 mBlock = geom->MakeBox(nBlocks, Iron, 18, 10, 2);
1776 mBlock->SetLineColor(8);
1777 top->AddNodeOverlap(mBlock, 1, new TGeoCombiTrans(336, 0, 550, new TGeoRotation("r1", 90, -45, 0)));
1778
1779 sprintf(nBlocks, "ab%d", N++);
1780 mBlock = geom->MakeBox(nBlocks, Iron, 18, 10, 2);
1781 mBlock->SetLineColor(8);
1782 top->AddNodeOverlap(mBlock, 1, new TGeoCombiTrans(-336, 0, 550, new TGeoRotation("r1", 90, 45, 0)));
1783
1784 // | | | | |
1785
1786 sprintf(nBlocks, "ab%d", N++);
1787 mBlock = geom->MakeBox(nBlocks, Iron, 300, 75, 40);
1788 mBlock->SetLineColor(45);
1789 top->AddNodeOverlap(mBlock, 1, new TGeoCombiTrans(0, 0, 450, new TGeoRotation("r1", 0, 0, 0)));
1790
1791 // kiwa
1792 sprintf(nBlocks, "ab%d", N++);
1793 mBlock = geom->MakeBox(nBlocks, Iron, 305, 80, 2.5);
1794 mBlock->SetLineColor(10);
1795 top->AddNodeOverlap(mBlock, 1, new TGeoTranslation(0, 0, 430));
1796
1797 top->SetVisibility(false);
1798 geom->CloseGeometry();
1799
1800 top->Draw("ogl");
1801}
#define f(i)
Definition RSha256.hxx:104
#define N
Class describing rotation + translation.
Definition TGeoMatrix.h:317
The manager class for any TGeo geometry.
Definition TGeoManager.h:44
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.
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.