ROOT  6.07/01
Reference Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
lego.C
Go to the documentation of this file.
1 #include "TSystem.h"
2 #include "TGeoManager.h"
3 
4 void lego()
5 {
6  // Drawing a figure, made of lego block, using ROOT geometry class.
7  // Name: lego.C
8  // Author: Soon Gi Kwon(1116won@hanmail.net), Dept. of Physics, Univ. of Seoul
9  // Reviewed by Sunman Kim (sunman98@hanmail.net)
10  // Supervisor: Prof. Inkyu Park (icpark@physics.uos.ac.kr)
11  //
12  // How to run: .x lego.C in ROOT terminal, then use OpenGL
13  //
14  // This macro was created for the evaluation of Computational Physics course in 2006.
15  // We thank to Prof. Inkyu Park for his special lecture on ROOT and to all of ROOT team
16  //
17 
18  TGeoManager *geom = new TGeoManager("geom","My first 3D geometry");
19 
20 
21  TGeoMaterial *vacuum=new TGeoMaterial("vacuum",0,0,0);
22  TGeoMaterial *Fe=new TGeoMaterial("Fe",55.845,26,7.87);
23 
24 
25 
26  TGeoMedium *Air=new TGeoMedium("Vacuum",0,vacuum);
27  TGeoMedium *Iron=new TGeoMedium("Iron",1,Fe);
28 
29 
30  // create volume
31  TGeoVolume *top=geom->MakeBox("top",Air,100,100,100);
32  geom->SetTopVolume(top);
33  geom->SetTopVisible(0);
34  // If you want to see the boundary, please input the number, 1 instead of 0.
35  // Like this, geom->SetTopVisible(1);
36 
37 
38 //----------------------------------------------------------------------
39 
40 TGeoVolume *ha1=geom->MakeSphere("ha1",Iron,0,10,80,90,0,360);
41  ha1->SetLineColor(41);
42 top->AddNodeOverlap(ha1,1,new TGeoCombiTrans(0,0,4,new TGeoRotation("ha1",0,0,0)));
43 
44 TGeoVolume *ha2=geom->MakeSphere("ha2",Iron,0,7,90,180,0,360);
45  ha2->SetLineColor(41);
46 top->AddNodeOverlap(ha2,1,new TGeoCombiTrans(0,0,4,new TGeoRotation("ha2",0,180,0)));
47 
48 TGeoVolume *ha3=geom->MakeSphere("ha3",Iron,0,7.3,80,90,0,360);
49  ha3->SetLineColor(2);
50 top->AddNodeOverlap(ha3,1,new TGeoCombiTrans(0,0,4.8,new TGeoRotation("ha3",0,0,0)));
51 
52 
53 TGeoVolume *h1=geom->MakeTubs("h1",Iron,0,6,4.5,0,0);
54  h1->SetLineColor(5);
55 top->AddNodeOverlap(h1,1,new TGeoCombiTrans(0,0,0,new TGeoRotation("h1",0,0,0)));
56 
57 TGeoVolume *h2=geom->MakeSphere("h2",Iron,0,7.5,0,52.5,0,360);
58  h2->SetLineColor(5);
59 top->AddNodeOverlap(h2,1,new TGeoCombiTrans(0,0,0,new TGeoRotation("h2",0,0,0)));
60 
61 TGeoVolume *h3=geom->MakeSphere("h3",Iron,0,7.5,0,52.5,0,360);
62  h3->SetLineColor(5);
63 top->AddNodeOverlap(h3,1,new TGeoCombiTrans(0,0,0,new TGeoRotation("h3",180,180,0)));
64 
65 TGeoVolume *h4=geom->MakeTubs("h4",Iron,2.5,3.5,1.5,0,0);
66  h4->SetLineColor(5);
67 top->AddNodeOverlap(h4,1,new TGeoCombiTrans(0,0,7.5,new TGeoRotation("h4",0,0,0)));
68 
69 
70 
71 TGeoVolume *t1_1=geom->MakeTubs("t1_1",Iron,0,0.8,1,0,360);
72  t1_1->SetLineColor(12);
73 top->AddNodeOverlap(t1_1,1,new TGeoCombiTrans(-5,2,1.5,new TGeoRotation("t1_1",-90,90,0)));
74 
75 TGeoVolume *t2_1=geom->MakeTubs("t2_1",Iron,0,0.8,1,0,360);
76  t2_1->SetLineColor(12);
77 top->AddNodeOverlap(t2_1,1,new TGeoCombiTrans(-5,-2,1.5,new TGeoRotation("t2_1",-90,90,0)));
78 
79 TGeoVolume *fb1=geom->MakeTubs("fb1",Iron,2,2.3,1,100,260);
80  fb1->SetLineColor(12);
81 top->AddNodeOverlap(fb1,1,new TGeoCombiTrans(-5,0,-1,new TGeoRotation("fb1",90,90,90)));
82 
83 
84 
85 TGeoVolume *m1=geom->MakeBox("m1",Iron,7,8,4);
86  m1->SetLineColor(2);
87 top->AddNodeOverlap(m1,1,new TGeoCombiTrans(0,0,-17,new TGeoRotation("m1",90,90,0)));
88 
89 TGeoVolume *m2=geom->MakeTubs("m2",Iron,0,1,7,90,180);
90  m2->SetLineColor(2);
91 top->AddNodeOverlap(m2,1,new TGeoCombiTrans(-3,0,-9,new TGeoRotation("m2",0,90,0)));
92 
93 TGeoVolume *m3=geom->MakeTubs("m3",Iron,0,1,7,0,90);
94  m3->SetLineColor(2);
95 top->AddNodeOverlap(m3,1,new TGeoCombiTrans(3,0,-9,new TGeoRotation("m3",0,90,0)));
96 
97 TGeoVolume *m4=geom->MakeBox("m4",Iron,3,7,0.5);
98  m4->SetLineColor(2);
99 top->AddNodeOverlap(m4,1,new TGeoCombiTrans(0,0,-8.5,new TGeoRotation("m4",90,0,90)));
100 
101 TGeoVolume *m5=geom->MakeTubs("m5",Iron,0,1.5,1.2,0,0);
102  m5->SetLineColor(5);
103 top->AddNodeOverlap(m5,1,new TGeoCombiTrans(0,0,-7.8,new TGeoRotation("m5",0,0,0)));
104 
105 TGeoVolume *m6=geom->MakeTrd2("m6",Iron,4,4,0,2,8);
106 m6->SetLineColor(2);
107 top->AddNodeOverlap(m6,1,new TGeoCombiTrans(0,-7,-17,new TGeoRotation("m6",0,180,0)));
108 
109 TGeoVolume *m7=geom->MakeTrd2("m7",Iron,4,4,0,2,8);
110 m7->SetLineColor(2);
111 top->AddNodeOverlap(m7,1,new TGeoCombiTrans(0,7,-17,new TGeoRotation("m7",0,180,0)));
112 
113 
114 TGeoVolume *md1=geom->MakeBox("md1",Iron,4,8.5,0.7);
115  md1->SetLineColor(37);
116 top->AddNodeOverlap(md1,1,new TGeoCombiTrans(0,0,-25.5,new TGeoRotation("md1",0,0,0)));
117 
118 TGeoVolume *md2=geom->MakeBox("md2",Iron,3,0.4,2);
119 md2->SetLineColor(37);
120 top->AddNodeOverlap(md2,1,new TGeoCombiTrans(0,0,-28,new TGeoRotation("md2",0,0,0)));
121 
122 TGeoVolume *d1=geom->MakeTrd2("d1",Iron,3,4,4,4,7);
123 d1->SetLineColor(37);
124 top->AddNodeOverlap(d1,1,new TGeoCombiTrans(-4.8,4.5,-35,new TGeoRotation("d1",90,45,-90)));
125 
126 TGeoVolume *d2=geom->MakeTrd2("d2",Iron,3,4,4,4,7);
127 d2->SetLineColor(37);
128 top->AddNodeOverlap(d2,1,new TGeoCombiTrans(0,-4.5,-37,new TGeoRotation("d2",0,0,0)));
129 
130 TGeoVolume *d3=geom->MakeTubs("d3",Iron,0,4,3.98,0,180);
131  d3->SetLineColor(37);
132 top->AddNodeOverlap(d3,1,new TGeoCombiTrans(0,4.5,-30.2,new TGeoRotation("d3",0,90,-45)));
133 
134 TGeoVolume *d4=geom->MakeTubs("d4",Iron,0,4,3.98,0,180);
135  d4->SetLineColor(37);
136 top->AddNodeOverlap(d4,1,new TGeoCombiTrans(0,-4.5,-30,new TGeoRotation("d4",0,90,0)));
137 
138 TGeoVolume *d5=geom->MakeBox("d5",Iron,4,4,1);
139 d5->SetLineColor(37);
140 top->AddNodeOverlap(d5,1,new TGeoCombiTrans(-10.2,4.5,-39,new TGeoRotation("d5",90,45,-90)));
141 
142 TGeoVolume *d6=geom->MakeBox("d6",Iron,4,4,1);
143 d6->SetLineColor(37);
144 top->AddNodeOverlap(d6,1,new TGeoCombiTrans(-1,-4.5,-43.4,new TGeoRotation("d6",0,0,0)));
145 
146 
147 
148 TGeoVolume *a1=geom->MakeTubs("a1",Iron,0,1.5,4,0,0);
149  a1->SetLineColor(1);
150 top->AddNodeOverlap(a1,1,new TGeoCombiTrans(0,10,-15.1,new TGeoRotation("a1",0,20,45)));
151 
152 TGeoVolume *a2=geom->MakeSphere("a2",Iron,0,1.48,0,180,0,200);
153  a2->SetLineColor(1);
154 top->AddNodeOverlap(a2,1,new TGeoCombiTrans(0,8.6,-11.5,new TGeoRotation("a2",120,80,20)));
155 
156 TGeoVolume *a3=geom->MakeTubs("a3",Iron,0,1.5,2.2,0,0);
157  a3->SetLineColor(1);
158 top->AddNodeOverlap(a3,1,new TGeoCombiTrans(0,11.3,-20.6,new TGeoRotation("a3",300,0,40)));
159 
160 TGeoVolume *a4=geom->MakeTubs("a4",Iron,0,1,1,0,0);
161  a4->SetLineColor(5);
162 top->AddNodeOverlap(a4,1,new TGeoCombiTrans(0,11.3,-23.8,new TGeoRotation("a4",75,0,30)));
163 
164 TGeoVolume *a5=geom->MakeTubs("a5",Iron,1.5,2.5,2,0,270);
165  a5->SetLineColor(5);
166 top->AddNodeOverlap(a5,1,new TGeoCombiTrans(0,11.3,-26.5,new TGeoRotation("a5",-90,90,00)));
167 
168 
169 
170 
171 TGeoVolume *a1_1=geom->MakeTubs("a1_1",Iron,0,1.5,4,0,0);
172  a1_1->SetLineColor(1);
173 top->AddNodeOverlap(a1_1,1,new TGeoCombiTrans(0,-10,-15.1,new TGeoRotation("a1_1",0,-20,-45)));
174 
175 TGeoVolume *a2_1=geom->MakeSphere("a2_1",Iron,0,1.48,0,180,0,200);
176  a2_1->SetLineColor(1);
177 top->AddNodeOverlap(a2_1,1,new TGeoCombiTrans(0,-8.6,-11.5,new TGeoRotation("a2_1",120,80,-20)));
178 
179 TGeoVolume *a3_1=geom->MakeTubs("a3_1",Iron,0,1.5,2.2,0,0);
180  a3_1->SetLineColor(1);
181 top->AddNodeOverlap(a3_1,1,new TGeoCombiTrans(0,-11.3,-20.6,new TGeoRotation("a3_1",-300,0,-40)));
182 
183 TGeoVolume *a4_1=geom->MakeTubs("a4_1",Iron,0,1,1,0,0);
184  a4_1->SetLineColor(5);
185 top->AddNodeOverlap(a4_1,1,new TGeoCombiTrans(0,-11.3,-23.8,new TGeoRotation("a4_1",-75,0,-30)));
186 
187 a5=geom->MakeTubs("a5_1",Iron,1.5,2.5,2,0,270);
188  a5->SetLineColor(5);
189 top->AddNodeOverlap(a5,1,new TGeoCombiTrans(0,-11.3,-26.5,new TGeoRotation("a5",90,90,00)));
190 
191 
192 //**********************************NO,2******************
193 
194 
195 TGeoVolume *ha_1=geom->MakeSphere("ha_1",Iron,0,10,80,90,0,360);
196  ha_1->SetLineColor(6);
197 top->AddNodeOverlap(ha_1,1,new TGeoCombiTrans(0,36,4,new TGeoRotation("ha_1",0,0,0)));
198 
199 TGeoVolume *ha_2=geom->MakeTubs("ha_2",Iron,0,6,5,0,0);
200  ha_2->SetLineColor(6);
201 top->AddNodeOverlap(ha_2,1,new TGeoCombiTrans(0,36,10,new TGeoRotation("ha_2",0,180,0)));
202 
203 TGeoVolume *ha_3=geom->MakeTubs("ha_3",Iron,0,1,12,0,0);
204  ha_3->SetLineColor(28);
205 top->AddNodeOverlap(ha_3,1,new TGeoCombiTrans(0,36,8,new TGeoRotation("ha_3",0,90,0)));
206 
207 TGeoVolume *ha_4=geom->MakeTubs("ha_4",Iron,0,1,3,0,0);
208  ha_4->SetLineColor(28);
209 top->AddNodeOverlap(ha_4,1,new TGeoCombiTrans(0,22,10,new TGeoRotation("ha_4",0,0,0)));
210 
211 TGeoVolume *ha_5=geom->MakeTubs("ha_5",Iron,0,1,3,0,0);
212  ha_5->SetLineColor(28);
213 top->AddNodeOverlap(ha_5,1,new TGeoCombiTrans(0,46,10,new TGeoRotation("ha_5",0,0,0)));
214 
215 TGeoVolume *ha_6=geom->MakeTubs("ha_6",Iron,0,1,3,0,0);
216  ha_6->SetLineColor(28);
217 top->AddNodeOverlap(ha_6,1,new TGeoCombiTrans(0,24,10,new TGeoRotation("ha_6",0,0,0)));
218 
219 TGeoVolume *ha_7=geom->MakeTubs("ha_7",Iron,0,1,3,0,0);
220  ha_7->SetLineColor(28);
221 top->AddNodeOverlap(ha_7,1,new TGeoCombiTrans(0,48,10,new TGeoRotation("ha_7",0,0,0)));
222 
223 TGeoVolume *ha_8=geom->MakeBox("ha_8",Iron,2,0.5,2);
224  ha_8->SetLineColor(19);
225 top->AddNodeOverlap(ha_8,1,new TGeoCombiTrans(-4.2,36,9,new TGeoRotation("ha_8",0,45,0)));
226 
227 
228 TGeoVolume *ha_9=geom->MakeBox("ha_9",Iron,2,0.5,2);
229  ha_9->SetLineColor(19);
230 top->AddNodeOverlap(ha_9,1,new TGeoCombiTrans(-4.2,36,9,new TGeoRotation("ha_9",0,135,0)));
231 
232 
233 
234 TGeoVolume *h_1=geom->MakeTubs("h_1",Iron,0,6,4.5,0,0);
235  h_1->SetLineColor(5);
236 top->AddNodeOverlap(h_1,1,new TGeoCombiTrans(0,36,0,new TGeoRotation("h_1",0,0,0)));
237 
238 TGeoVolume *h_2=geom->MakeSphere("h_2",Iron,0,7.5,0,52.5,0,360);
239  h_2->SetLineColor(5);
240 top->AddNodeOverlap(h_2,1,new TGeoCombiTrans(0,36,0,new TGeoRotation("h_2",0,0,0)));
241 
242 TGeoVolume *h_3=geom->MakeSphere("h_3",Iron,0,7.5,0,52.5,0,360);
243  h_3->SetLineColor(5);
244 top->AddNodeOverlap(h_3,1,new TGeoCombiTrans(0,36,0,new TGeoRotation("h_3",180,180,0)));
245 
246 TGeoVolume *h_4=geom->MakeTubs("h_4",Iron,2.5,3.5,1.5,0,0);
247  h_4->SetLineColor(5);
248 top->AddNodeOverlap(h_4,1,new TGeoCombiTrans(0,36,7.5,new TGeoRotation("h_4",0,0,0)));
249 
250 
251 TGeoVolume *fa1=geom->MakeTubs("fa1",Iron,0,0.5,1,0,360);
252  fa1->SetLineColor(12);
253 top->AddNodeOverlap(fa1,1,new TGeoCombiTrans(-5,38,1.5,new TGeoRotation("fa1",-90,90,0)));
254 
255 TGeoVolume *fa2=geom->MakeTubs("fa2",Iron,0,0.5,1,0,360);
256  fa2->SetLineColor(12);
257 top->AddNodeOverlap(fa2,1,new TGeoCombiTrans(-5,34,1.5,new TGeoRotation("fa2",-90,90,0)));
258 
259 TGeoVolume *fa1_1=geom->MakeTubs("fa1_1",Iron,1,1.2,1,0,360);
260  fa1_1->SetLineColor(12);
261 top->AddNodeOverlap(fa1_1,1,new TGeoCombiTrans(-5,38,1.5,new TGeoRotation("fa1_1",-90,90,0)));
262 
263 TGeoVolume *fa2_1=geom->MakeTubs("fa2_1",Iron,1,1.2,1,0,360);
264  fa2_1->SetLineColor(12);
265 top->AddNodeOverlap(fa2_1,1,new TGeoCombiTrans(-5,34,1.5,new TGeoRotation("fa2_1",-90,90,0)));
266 
267 TGeoVolume *fa3=geom->MakeTubs("fa3",Iron,2,2.3,1,90,270);
268  fa3->SetLineColor(12);
269 top->AddNodeOverlap(fa3,1,new TGeoCombiTrans(-5,36,-1,new TGeoRotation("fa3",90,90,90)));
270 
271 
272 
273 TGeoVolume *m_1=geom->MakeBox("m_1",Iron,7,8,4);
274  m_1->SetLineColor(25);
275 top->AddNodeOverlap(m_1,1,new TGeoCombiTrans(0,36,-17,new TGeoRotation("m_1",90,90,0)));
276 
277 TGeoVolume *m_2=geom->MakeTubs("m_2",Iron,0,1,7,90,180);
278  m_2->SetLineColor(25);
279 top->AddNodeOverlap(m_2,1,new TGeoCombiTrans(-3,36,-9,new TGeoRotation("m_2",0,90,0)));
280 
281 TGeoVolume *m_3=geom->MakeTubs("m_3",Iron,0,1,7,0,90);
282  m_3->SetLineColor(25);
283 top->AddNodeOverlap(m_3,1,new TGeoCombiTrans(3,36,-9,new TGeoRotation("m_3",0,90,0)));
284 
285 TGeoVolume *m_4=geom->MakeBox("m_4",Iron,3,7,0.5);
286  m_4->SetLineColor(25);
287 top->AddNodeOverlap(m_4,1,new TGeoCombiTrans(0,36,-8.5,new TGeoRotation("m_4",90,0,90)));
288 
289 TGeoVolume *m_5=geom->MakeTubs("m_5",Iron,0,1.5,1.2,0,0);
290  m_5->SetLineColor(5);
291 top->AddNodeOverlap(m_5,1,new TGeoCombiTrans(0,36,-7.8,new TGeoRotation("m_5",0,0,0)));
292 
293 TGeoVolume *m_6=geom->MakeTrd2("m_6",Iron,4,4,0,2,8);
294 m_6->SetLineColor(25);
295 top->AddNodeOverlap(m_6,1,new TGeoCombiTrans(0,29,-17,new TGeoRotation("m_6",0,180,0)));
296 
297 TGeoVolume *m_7=geom->MakeTrd2("m_7",Iron,4,4,0,2,8);
298 m_7->SetLineColor(25);
299 top->AddNodeOverlap(m_7,1,new TGeoCombiTrans(0,43,-17,new TGeoRotation("m_7",0,180,0)));
300 
301 
302 TGeoVolume *md_1=geom->MakeBox("md_1",Iron,4,8.5,0.7);
303  md_1->SetLineColor(48);
304 top->AddNodeOverlap(md_1,1,new TGeoCombiTrans(0,36,-25.5,new TGeoRotation("md_1",0,0,0)));
305 
306 TGeoVolume *md_2=geom->MakeBox("md_2",Iron,3,0.4,2);
307 md_2->SetLineColor(48);
308 top->AddNodeOverlap(md_2,1,new TGeoCombiTrans(0,36,-28,new TGeoRotation("md_2",0,0,0)));
309 
310 TGeoVolume *d_1=geom->MakeTrd2("d_1",Iron,3,4,4,4,7);
311 d_1->SetLineColor(48);
312 top->AddNodeOverlap(d_1,1,new TGeoCombiTrans(0,40.5,-37.2,new TGeoRotation("d_1",0,0,0)));
313 
314 TGeoVolume *d_2=geom->MakeTrd2("d_2",Iron,3,4,4,4,7);
315 d_2->SetLineColor(48);
316 top->AddNodeOverlap(d_2,1,new TGeoCombiTrans(0,31.5,-37.2,new TGeoRotation("d_2",0,0,0)));
317 
318 TGeoVolume *d_3=geom->MakeTubs("d_3",Iron,0,4,3.98,0,180);
319  d_3->SetLineColor(48);
320 top->AddNodeOverlap(d_3,1,new TGeoCombiTrans(0,40.5,-30.2,new TGeoRotation("d_3",0,90,0)));
321 
322 TGeoVolume *d_4=geom->MakeTubs("d_4",Iron,0,4,3.98,0,180);
323  d_4->SetLineColor(48);
324 top->AddNodeOverlap(d_4,1,new TGeoCombiTrans(0,31.5,-30.2,new TGeoRotation("d_4",0,90,0)));
325 
326 TGeoVolume *d_5=geom->MakeBox("d_5",Iron,4,4,1);
327 d_5->SetLineColor(48);
328 top->AddNodeOverlap(d_5,1,new TGeoCombiTrans(-1,40.5,-43.7,new TGeoRotation("d_5",0,0,0)));
329 
330 TGeoVolume *d_6=geom->MakeBox("d_6",Iron,4,4,1);
331 d_6->SetLineColor(48);
332 top->AddNodeOverlap(d_6,1,new TGeoCombiTrans(-1,31.5,-43.7,new TGeoRotation("d_6",0,0,0)));
333 
334 
335 
336 
337 TGeoVolume *a_1=geom->MakeTubs("a_1",Iron,0,1.5,4,0,0);
338  a_1->SetLineColor(45);
339 top->AddNodeOverlap(a_1,1,new TGeoCombiTrans(0,46,-15.1,new TGeoRotation("a_1",0,20,45)));
340 
341 TGeoVolume *a_2=geom->MakeSphere("a_2",Iron,0,1.48,0,180,0,200);
342  a_2->SetLineColor(45);
343 top->AddNodeOverlap(a_2,1,new TGeoCombiTrans(0,44.6,-11.5,new TGeoRotation("a_2",120,80,20)));
344 
345 TGeoVolume *a_3=geom->MakeTubs("a_3",Iron,0,1.5,2.2,0,0);
346  a_3->SetLineColor(45);
347 top->AddNodeOverlap(a_3,1,new TGeoCombiTrans(0,47.3,-20.6,new TGeoRotation("a_3",300,0,40)));
348 
349 TGeoVolume *a_4=geom->MakeTubs("a_4",Iron,0,1,1,0,0);
350  a_4->SetLineColor(12);
351 top->AddNodeOverlap(a_4,1,new TGeoCombiTrans(0,47.3,-23.8,new TGeoRotation("a_4",75,0,30)));
352 
353 TGeoVolume *a_5=geom->MakeTubs("a_5",Iron,1.5,2.5,2,0,270);
354  a_5->SetLineColor(12);
355 top->AddNodeOverlap(a_5,1,new TGeoCombiTrans(0,47.3,-26.5,new TGeoRotation("a_5",-90,90,0)));
356 
357 
358 
359 
360 TGeoVolume *Aa1=geom->MakeTubs("Aa1",Iron,0,1.5,4,0,0);
361  Aa1->SetLineColor(45);
362 top->AddNodeOverlap(Aa1,1,new TGeoCombiTrans(0,26,-15.1,new TGeoRotation("Aa1",0,-20,-45)));
363 
364 TGeoVolume *Aa2=geom->MakeSphere("Aa2",Iron,0,1.48,0,180,0,200);
365  Aa2->SetLineColor(45);
366 top->AddNodeOverlap(Aa2,1,new TGeoCombiTrans(0,27.4,-11.5,new TGeoRotation("Aa2",120,80,-20)));
367 
368 TGeoVolume *Aa3=geom->MakeTubs("Aa3",Iron,0,1.5,2.2,0,0);
369  Aa3->SetLineColor(45);
370 top->AddNodeOverlap(Aa3,1,new TGeoCombiTrans(0,24.7,-20.6,new TGeoRotation("Aa3",-300,0,-40)));
371 
372 TGeoVolume *Aa4=geom->MakeTubs("Aa4",Iron,0,1,1,0,0);
373  Aa4->SetLineColor(12);
374 top->AddNodeOverlap(Aa4,1,new TGeoCombiTrans(0,24.7,-23.8,new TGeoRotation("Aa4",-75,0,-30)));
375 
376 TGeoVolume *Aa5=geom->MakeTubs("Aa5",Iron,1.5,2.5,2,0,270);
377  Aa5->SetLineColor(12);
378 top->AddNodeOverlap(Aa5,1,new TGeoCombiTrans(0,24.7,-26.5,new TGeoRotation("Aa5",90,90,00)));
379 
380 
381 
382 TGeoVolume *bag1=geom->MakeBox("bag1",Iron,10,4,6);
383 bag1->SetLineColor(19);
384 top->AddNodeOverlap(bag1,1,new TGeoCombiTrans(0,48,-36,new TGeoRotation("bag1",0,0,0)));
385 
386 TGeoVolume *bag2=geom->MakeTubs("bag2",Iron,3,4,1,180,360);
387  bag2->SetLineColor(19);
388 top->AddNodeOverlap(bag2,1,new TGeoCombiTrans(0,48,-30,new TGeoRotation("bag2",0,270,0)));
389 
390 
391 TGeoVolume *well=geom->MakeBox("well",Iron,5,10,3);
392 well->SetLineColor(18);
393 top->AddNodeOverlap(well,1,new TGeoCombiTrans(-26.5,-17,-42,new TGeoRotation("well",0,0,0)));
394 
395 
396 TGeoVolume *K5=geom->MakeTubs("K5",Iron,0,3,3,0,0);
397  K5->SetLineColor(18);
398 top->AddNodeOverlap(K5,1,new TGeoCombiTrans(-27,-12.5,-39,new TGeoRotation("K5",0,0,0)));
399 
400 TGeoVolume *K4=geom->MakeTubs("K4",Iron,0,3,3,0,0);
401  K4->SetLineColor(18);
402 top->AddNodeOverlap(K4,1,new TGeoCombiTrans(-27,-21.5,-39,new TGeoRotation("K4",0,0,0)));
403 
404 
405 
406 //==============Board=========
407 char nB[100];
408 int Z=0,Y=0;
409 TGeoVolume *bo1;
410 
411 while(Y<6){
412 while(Z<10){
413 sprintf(nB,"B%d_Y%d",Z,Y);
414 bo1=geom->MakeTubs(nB,Iron,0,3,3,0,0);
415 bo1->SetLineColor(8);
416 top->AddNodeOverlap(bo1,1,new TGeoCombiTrans(-27+(Y*9),-21.5+(Z*9),-45,new TGeoRotation("bo1",0,0,0)));
417 Z++;
418 }
419 Y++; Z=0;
420 }
421 
422 
423 TGeoVolume *bo2=geom->MakeBox("bo2",Iron,27,45,3);
424 bo2->SetLineColor(8);
425 top->AddNodeOverlap(bo2,1,new TGeoCombiTrans(-4.5,18,-48,new TGeoRotation("bo2",0,0,0)));
426 
427 
428 
429 
430 top->SetVisibility(0);
431 geom->CloseGeometry();
432 
433  top->Draw("ogl");
434 
435 }
void SetTopVisible(Bool_t vis=kTRUE)
make top volume visible on screen
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
void SetTopVolume(TGeoVolume *vol)
Set the top volume and corresponding node as starting point of the geometry.
TGeoVolume * MakeSphere(const char *name, TGeoMedium *medium, Double_t rmin, Double_t rmax, Double_t themin=0, Double_t themax=180, Double_t phimin=0, Double_t phimax=360)
Make in one step a volume pointing to a sphere shape with given medium.
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.
TH2D * h2
Definition: fit2dHist.C:45
TH1F * h1
Definition: legend1.C:5
void CloseGeometry(Option_t *option="d")
Closing geometry implies checking the geometry validity, fixing shapes with negative parameters (run-...
TGeoVolume * MakeTrd2(const char *name, TGeoMedium *medium, Double_t dx1, Double_t dx2, Double_t dy1, Double_t dy2, Double_t dz)
Make in one step a volume pointing to a TGeoTrd2 shape with given medium.
void lego()
Definition: lego.C:4
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.
virtual void SetVisibility(Bool_t vis=kTRUE)
set visibility of this volume
virtual void SetLineColor(Color_t lcolor)
Set the line color.
std::complex< float_v > Z
Definition: main.cpp:120