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