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