Variable number of modules introduced
[u/mrichter/AliRoot.git] / STRUCT / AliDIPOv2.cxx
CommitLineData
fe4da5cc 1///////////////////////////////////////////////////////////////////////////////
2// //
3// Magnetic Dipole version 1 //
4// //
5//Begin_Html
6/*
1439f98e 7<img src="picts/AliDIPOv2Class.gif">
fe4da5cc 8</pre>
9<br clear=left>
10<font size=+2 color=red>
11<p>The responsible person for this module is
12<a href="mailto:andreas.morsch@cern.ch">Andreas Morsch</a>.
13</font>
14<pre>
15*/
16//End_Html
17// //
18// //
19///////////////////////////////////////////////////////////////////////////////
20
21#include "AliDIPOv2.h"
22#include "AliRun.h"
fe4da5cc 23#include "AliConst.h"
24
25ClassImp(AliDIPOv2)
26
27//_____________________________________________________________________________
b8032157 28AliDIPOv2::AliDIPOv2()
fe4da5cc 29{
30 //
31 // Default constructor for magnetic dipole version 2
32 //
33}
34
35//_____________________________________________________________________________
36AliDIPOv2::AliDIPOv2(const char *name, const char *title)
37 : AliDIPO(name,title)
38{
39 //
40 // Standard constructor for the magnetic dipole version 2
41 SetMarkerColor(7);
42 SetMarkerStyle(2);
43 SetMarkerSize(0.4);
44}
45
46//_____________________________________________________________________________
47void AliDIPOv2::CreateGeometry()
48{
49 //
50 // Creation of the geometry of the magnetic DIPOLE version 2
51 //
52 //Begin_Html
53 /*
1439f98e 54 <img src="picts/AliDIPOv2Tree.gif">
fe4da5cc 55 */
56 //End_Html
57 //Begin_Html
58 /*
1439f98e 59 <img src="picts/AliDIPOv2.gif">
fe4da5cc 60 */
61 //End_Html
62
63 AliMC* pMC = AliMC::GetMC();
64
65 Float_t cpar[5], tpar[3], ypar[4];
66 Float_t dz, dx, dy;
67 Int_t idrotm[1899];
68 Float_t acc_max, the1, phi1, the2, phi2, the3, phi3;
69
ad51aeb0 70 Int_t *idtmed = fIdtmed->GetArray()-1799;
fe4da5cc 71
72 //abs_d = 90.; // DEFINES DRIFT LENGTH
73 //z_nose = 102.;
74 //z_cone = 285.;
75 //theta1 = 24.; // 1. angle defining the front absorber
76 //theta2 = 5.; // 2. angle defining the front absorbe
77 acc_max = 9.; // ANGLE POLAIRE MAXIMUM
78 //acc_min = 2.; // ANGLE POLAIRE MINIMUM DE DETECTION
79 //abs_l = 503.;
80 //d_steel = 1.; // THICKNESS OF STEEL SUPPORT
81 //d_poly = 7.5;
82 //d_pb = 2.5;
83 //abs_cc = 315.; // DEFINES LENGTH OF CARBON
84 //abs_c = 358.;
85 //abs_s = 150.; // DEFINES W-SHIELD LENGTH
86 //abs_n = 80.; // START OF NOSE
87 //r_abs = 4.;
88 //r_pb = .1;
89 //epsilon = .01;
90 //theta_r = 3.;
91 //d_rear = 35.;
92 //theta_open = .75;
93
94 //z_l3 = 700.;
95 //zmag_in = 725.;
96 //zmag_out = 1225.;
97 //zfil_in = 1471.;
98 //zfil_out = 1591.;
99 //zcon_in = 1900.;
100 //zcon_out = 2e3;
101 //zcone_e = 859.0875;
102 //spec_l = 1800.;
103 //zplug_in = 1780.;
104 //zplug_out = 1900.;
105
106 // Chamber position
107 // CZ1=515.5
108 //cz1 = 511.;
109 //cz2 = 686.;
110 //cz3 = 971.;
111 //cz4 = 1245.;
112 //cz5 = 1445.;
113 //cz6 = 1610.;
114 //cz7 = 1710.;
115
116
117 // DIPOLE MAGNET
118
119 tpar[0] = 300.;
120 tpar[1] = 415.;
121 tpar[2] = 250.;
122 pMC->Gsvolu("DDIP", "BOX ", idtmed[1814], tpar, 3);
123
124 // COILS
125
126 // air - m.f.
127 cpar[0] = 210.;
128 cpar[1] = 263.;
129 cpar[2] = 83.2/2.;
130 cpar[3] = 120.;
131 cpar[4] = 240.;
132 pMC->Gsvolu("DC1 ", "TUBS", idtmed[1813], cpar, 5);
133 cpar[3] = -60.;
134 cpar[4] = 60.;
135 pMC->Gsvolu("DC2 ", "TUBS", idtmed[1813], cpar, 5);
136 // ... define regions for higher cuts
137 cpar[0] += 10.;
138 cpar[1] += -10.;
139 cpar[2] += -10.;
140 cpar[3] = 120.;
141 cpar[4] = 240.;
142 pMC->Gsvolu("DC3 ", "TUBS", idtmed[1833], cpar, 5);
143 pMC->Gspos("DC3 ", 1, "DC1 ", 0., 0., 0., 0, "ONLY");
144 cpar[3] = -60.;
145 cpar[4] = 60.;
146 pMC->Gsvolu("DC4 ", "TUBS", idtmed[1833], cpar, 5);
147 pMC->Gspos("DC4 ", 1, "DC2 ", 0., 0., 0., 0, "ONLY");
148 // ...
149 dz = 83.2/2. - 250.;
150 pMC->Gspos("DC1 ", 1, "DDIP", 0., 0., dz, 0, "ONLY");
151 pMC->Gspos("DC1 ", 2, "DDIP", 0., 0., -dz, 0, "ONLY");
152 pMC->Gspos("DC2 ", 1, "DDIP", 0., 0., dz, 0, "ONLY");
153 pMC->Gspos("DC2 ", 2, "DDIP", 0., 0., -dz, 0, "ONLY");
154 the1 = 180.;
155 phi1 = 0.;
156 the2 = 90.;
157 phi2 = 150.;
158 the3 = 90.;
159 phi3 = 60.;
160 AliMatrix(idrotm[1800], the1, phi1, the2, phi2, the3, phi3);
161 phi2 = 30.;
162 the3 = -90.;
163 phi3 = -60.;
164 AliMatrix(idrotm[1801], the1, phi1, the2, phi2, the3, phi3);
165 the1 = 0.;
166 phi1 = 0.;
167 the2 = 90.;
168 phi2 = 150.;
169 the3 = 90.;
170 phi3 = 60.;
171 AliMatrix(idrotm[1802], the1, phi1, the2, phi2, the3, phi3);
172 phi2 = 30.;
173 the3 = -90.;
174 phi3 = -60.;
175 AliMatrix(idrotm[1803], the1, phi1, the2, phi2, the3, phi3);
176 cpar[0] = 25.;
177 cpar[1] = 108.2;
178 cpar[2] = 26.5;
179 cpar[3] = 270.;
180 cpar[4] = 360.;
181 pMC->Gsvolu("DC11", "TUBS", idtmed[1813], cpar, 5);
182 // ... higher cuts
183 cpar[0] += 10.;
184 cpar[1] += -10.;
185 cpar[2] += -10.;
186 pMC->Gsvolu("DC21", "TUBS", idtmed[1833], cpar, 5);
187 pMC->Gspos("DC21", 1, "DC11", 0., 0., 0., 0, "ONLY");
188 // ...
189 dx = TMath::Sin(30*kDegrad) * -236.5;
190 dy = TMath::Cos(30*kDegrad) * -236.5;
191 dz = cpar[1] + 10. - 250.;
192 pMC->Gspos("DC11", 1, "DDIP", dx, dy, dz, idrotm[1800], "ONLY");
193 pMC->Gspos("DC11", 2, "DDIP", dx, dy, -dz, idrotm[1802], "ONLY");
194 pMC->Gspos("DC11", 3, "DDIP", -dx, dy, dz, idrotm[1801], "ONLY");
195 pMC->Gspos("DC11", 4, "DDIP", -dx, dy, -dz, idrotm[1803], "ONLY");
196 cpar[0] = 25.;
197 cpar[1] = 25.+83.2;
198 cpar[2] = 53./2.;
199 cpar[3] = 0.;
200 cpar[4] = 90.;
201 pMC->Gsvolu("DC12", "TUBS", idtmed[1813], cpar, 5);
202 // ... higher cuts
203 cpar[0] += 10.;
204 cpar[1] += -10.;
205 cpar[2] += -10.;
206 pMC->Gsvolu("DC22", "TUBS", idtmed[1833], cpar, 5);
207 pMC->Gspos("DC22", 1, "DC12", 0., 0., 0., 0, "ONLY");
208 // ...
209 dx = TMath::Sin(30*kDegrad) * -236.5;
210 dy = TMath::Cos(30*kDegrad) * 236.5;
211 dz = cpar[1] + 10. - 250.;
212 pMC->Gspos("DC12", 1, "DDIP", dx, dy, dz, idrotm[1801], "ONLY");
213 pMC->Gspos("DC12", 2, "DDIP", dx, dy, -dz, idrotm[1803], "ONLY");
214 pMC->Gspos("DC12", 3, "DDIP", -dx, dy, dz, idrotm[1800], "ONLY");
215 pMC->Gspos("DC12", 4, "DDIP", -dx, dy, -dz, idrotm[1802], "ONLY");
216 the1 = 90.;
217 phi1 = 60.;
218 the2 = 90.;
219 phi2 = 150.;
220 the3 = 0.;
221 phi3 = 0.;
222 AliMatrix(idrotm[1804], the1, phi1, the2, phi2, the3, phi3);
223 the1 = 90.;
224 phi1 = 120.;
225 the2 = 90.;
226 phi2 = 210.;
227 the3 = 0.;
228 phi3 = 0.;
229 AliMatrix(idrotm[1805], the1, phi1, the2, phi2, the3, phi3);
230 tpar[0] = 53./2.;
231 tpar[1] = 83.2/2.;
232 tpar[2] = 283.6/2.;
233 pMC->Gsvolu("DL1 ", "BOX ", idtmed[1813], tpar, 3);
234 // ... higher cuts
235 tpar[0] -= 10.;
236 tpar[1] -= 10.;
237 pMC->Gsvolu("DL2 ", "BOX ", idtmed[1833], tpar, 3);
238 pMC->Gspos("DL2 ", 1, "DL1 ", 0., 0., 0., 0, "ONLY");
239 // ...
240 dx = -60.5;
241 dy = -238.;
242 dz = 0.;
243 pMC->Gspos("DL1 ", 1, "DDIP", dx, dy, dz, idrotm[1804], "ONLY");
244 pMC->Gspos("DL1 ", 2, "DDIP", dx, -dy, dz, idrotm[1805], "ONLY");
245 pMC->Gspos("DL1 ", 3, "DDIP",-dx, dy, dz, idrotm[1805], "ONLY");
246 pMC->Gspos("DL1 ", 4, "DDIP",-dx, -dy, dz, idrotm[1804], "ONLY");
247
248 // YOKE
249
250 ypar[1] = 275.8;
251 ypar[2] = 5.;
252 ypar[3] = 156.8;
253 ypar[0] = ypar[1] - ypar[3] * 2. * TMath::Tan(acc_max * kDegrad);
254 pMC->Gsvolu("DY1 ", "TRD1", idtmed[1809], ypar, 4);
255 // iron -
256 dy = 283.5;
257 pMC->Gspos("DY1 ", 1, "DDIP", 0., dy, 0., 0, "ONLY");
258 pMC->Gspos("DY1 ", 2, "DDIP", 0., -dy, 0., 0, "ONLY");
259 ypar[2] = 60.;
260 pMC->Gsvolu("DY2 ", "TRD1", idtmed[1829], ypar, 4);
261 // iron -
262 dy = ypar[2] + 284.;
263 pMC->Gspos("DY2 ", 1, "DDIP", 0., dy, 0., 0, "ONLY");
264 pMC->Gspos("DY2 ", 2, "DDIP", 0., -dy, 0., 0, "ONLY");
265 the1 = 99.;
266 phi1 = 0.;
267 the2 = 90.;
268 phi2 = 90.;
269 the3 = 9.;
270 phi3 = 0.;
271 AliMatrix(idrotm[1806], the1, phi1, the2, phi2, the3, phi3);
272 the1 = 261.;
273 phi1 = 0.;
274 the3 = 171.;
275 AliMatrix(idrotm[1807], the1, phi1, the2, phi2, the3, phi3);
276 tpar[0] = 60.;
277 tpar[1] = 283.;
278 tpar[2] = 156.8;
279 pMC->Gsvolu("DYL ", "BOX ", idtmed[1814], tpar, 3);
280 tpar[0] = 5.;
281 tpar[1] = 73.;
282 pMC->Gsvolu("DY3 ", "BOX ", idtmed[1809], tpar, 3);
283 dx = tpar[0] - 60.;
284 dy = tpar[1] + 137.;
285 pMC->Gspos("DY3 ", 1, "DYL ", dx, dy, 0., 0, "ONLY");
286 pMC->Gspos("DY3 ", 2, "DYL ", dx, -dy, 0., 0, "ONLY");
287 tpar[0] = 55.;
288 pMC->Gsvolu("DY4 ", "BOX ", idtmed[1829], tpar, 3);
289 dx = dx + 5. + tpar[0];
290 pMC->Gspos("DY4 ", 1, "DYL ", dx, dy, 0., 0, "ONLY");
291 pMC->Gspos("DY4 ", 2, "DYL ", dx, -dy, 0., 0, "ONLY");
292 tpar[0] = 37.7;
293 tpar[1] = 137.;
294 pMC->Gsvolu("DY5 ", "BOX ", idtmed[1829], tpar, 3);
295 dx = 60. - tpar[0];
296 pMC->Gspos("DY5 ", 1, "DYL ", dx, 0., 0., 0, "ONLY");
297 tpar[0] = 5.;
298 pMC->Gsvolu("DY6 ", "BOX ", idtmed[1809], tpar, 3);
299 dx = dx - 37.7 - tpar[0];
300 pMC->Gspos("DY6 ", 1, "DYL ", dx, 0., 0., 0, "ONLY");
301 tpar[0] = 17.3;
302 tpar[1] = 5.;
303 pMC->Gsvolu("DY7 ", "BOX ", idtmed[1809], tpar, 3);
304 dx = tpar[0] - 60.;
305 dy = tpar[1] + 127.;
306 pMC->Gspos("DY7 ", 1, "DYL ", dx, dy, 0., 0, "ONLY");
307 pMC->Gspos("DY7 ", 2, "DYL ", dx, -dy, 0., 0, "ONLY");
308
309 dx = ypar[0] + ypar[3] * TMath::Tan(acc_max * kDegrad) - 60.;
310 pMC->Gspos("DYL ", 1, "DDIP", dx, 0., 0., idrotm[1806], "ONLY");
311 pMC->Gspos("DYL ", 2, "DDIP",-dx, 0., 0., idrotm[1807], "ONLY");
312 pMC->Gspos("DDIP", 1, "ALIC", 0., 0., 725.+250., 0, "MANY");
313 pMC->Gsatt("DDIP", "SEEN", 0);
314 pMC->Gsatt("DC21", "SEEN", 0);
315 pMC->Gsatt("DC22", "SEEN", 0);
316 pMC->Gsatt("DC3 ", "SEEN", 0);
317 pMC->Gsatt("DC4 ", "SEEN", 0);
318}
319
320//_____________________________________________________________________________
b8032157 321void AliDIPOv2::DrawModule()
fe4da5cc 322{
323 //
324 // Draw a shaded view of the muon absorber
325 //
326
327 AliMC* pMC = AliMC::GetMC();
328
329 // Set everything unseen
330 pMC->Gsatt("*", "seen", -1);
331 //
332 // Set ALIC mother transparent
333 pMC->Gsatt("ALIC","SEEN",0);
334 //
335 // Set the volumes visible
336 pMC->Gsatt("DDIP","seen",0);
337 pMC->Gsatt("DC1 ","seen",1);
338 pMC->Gsatt("DC2 ","seen",1);
339 pMC->Gsatt("DC3 ","seen",1);
340 pMC->Gsatt("DC4 ","seen",1);
341 pMC->Gsatt("DC11","seen",1);
342 pMC->Gsatt("DC21","seen",1);
343 pMC->Gsatt("DC12","seen",1);
344 pMC->Gsatt("DC22","seen",1);
345 pMC->Gsatt("DL1 ","seen",1);
346 pMC->Gsatt("DL2 ","seen",1);
347 pMC->Gsatt("DY1 ","seen",1);
348 pMC->Gsatt("DY2 ","seen",1);
349 pMC->Gsatt("DYL ","seen",1);
350 pMC->Gsatt("DY3 ","seen",1);
351 pMC->Gsatt("DY4 ","seen",1);
352 pMC->Gsatt("DY5 ","seen",1);
353 pMC->Gsatt("DY6 ","seen",1);
354 pMC->Gsatt("DY7 ","seen",1);
355 //
356 pMC->Gdopt("hide", "on");
357 pMC->Gdopt("shad", "on");
358 pMC->Gsatt("*", "fill", 7);
359 pMC->SetClipBox(".");
360 pMC->SetClipBox(".");
361 pMC->DefaultRange();
362 pMC->Gdraw("alic", 30, 30, 0, 17, 13.5, .019, .019);
363 pMC->Gdhead(1111, "Magnetic Dipole Version 2");
364 pMC->Gdman(16, 4, "MAN");
365}
366
367//_____________________________________________________________________________
368void AliDIPOv2::CreateMaterials()
369{
370 //
371 // Create Materials for Magnetic Dipole version 2
372 //
373
374 Int_t ISXFLD = gAlice->Field()->Integ();
375 Float_t SXMGMX = gAlice->Field()->Max();
376
377 Float_t asteel[4] = { 55.847,51.9961,58.6934,28.0855 };
378 Float_t zsteel[4] = { 26.,24.,28.,14. };
379 Float_t wsteel[4] = { .715,.18,.1,.005 };
380 Float_t acoil[3] = { 26.98,1.01,16. };
381 Float_t zcoil[3] = { 13.,1.,8. };
382 Float_t wcoil[3] = { .66,.226,.114 };
383
384 Float_t epsil, stmin, deemax, tmaxfd, stemax;
385
386 // --- Define the various materials for GEANT ---
387 // Aluminum
388 AliMaterial(9, "ALUMINIUM$", 26.98, 13., 2.7, 8.9, 37.2);
389 AliMaterial(29, "ALUMINIUM$", 26.98, 13., 2.7, 8.9, 37.2);
390 AliMaterial(49, "ALUMINIUM$", 26.98, 13., 2.7, 8.9, 37.2);
391
392 // Iron
393 AliMaterial(10, "IRON$ ", 55.85, 26., 7.87, 1.76, 17.1);
394 AliMaterial(30, "IRON$ ", 55.85, 26., 7.87, 1.76, 17.1);
395 AliMaterial(50, "IRON$ ", 55.85, 26., 7.87, 1.76, 17.1);
396
397 // Air
398 AliMaterial(15, "AIR$ ", 14.61, 7.3, .001205, 30423.24, 67500);
399 AliMaterial(35, "AIR$ ", 14.61, 7.3, .001205, 30423.24, 67500);
400 AliMaterial(55, "AIR$ ", 14.61, 7.3, .001205, 30423.24, 67500);
401
402 // Vacuum
403 AliMaterial(16, "VACUUM$ ", 1e-16, 1e-16, 1e-16, 1e16, 1e16);
404 AliMaterial(36, "VACUUM$ ", 1e-16, 1e-16, 1e-16, 1e16, 1e16);
405 AliMaterial(56, "VACUUM$ ", 1e-16, 1e-16, 1e-16, 1e16, 1e16);
406
407 // stainless Steel
408 AliMixture(19, "STAINLESS STEEL$", asteel, zsteel, 7.88, 4, wsteel);
409 AliMixture(39, "STAINLESS STEEL$", asteel, zsteel, 7.88, 4, wsteel);
410 AliMixture(59, "STAINLESS STEEL$", asteel, zsteel, 7.88, 4, wsteel);
411
412 // Coil
413 AliMixture(14, "Al$", acoil, zcoil, 2.122, 3, wcoil);
414 AliMixture(34, "Al$", acoil, zcoil, 2.122, 3, wcoil);
415 AliMixture(54, "Al$", acoil, zcoil, 2.122, 3, wcoil);
416
417 // ****************
418 // Defines tracking media parameters.
419 // Les valeurs sont commentees pour laisser le defaut
420 // a GEANT (version 3-21, page CONS200), f.m.
421 epsil = .001; // Tracking precision,
422 stemax = -1.; // Maximum displacement for multiple scat
423 tmaxfd = -20.; // Maximum angle due to field deflection
424 deemax = -.3; // Maximum fractional energy loss, DLS
425 stmin = -.8;
426 // ***************
427
428 // Aluminum
ad51aeb0 429 AliMedium(9, "ALU_C0 ", 9, 0, ISXFLD, SXMGMX, tmaxfd, stemax, deemax, epsil, stmin);
430 AliMedium(29, "ALU_C1 ", 29, 0, ISXFLD, SXMGMX, tmaxfd, stemax, deemax, epsil, stmin);
431 AliMedium(49, "ALU_C2 ", 49, 0, ISXFLD, SXMGMX, tmaxfd, stemax, deemax, epsil, stmin);
fe4da5cc 432
433 // Iron
ad51aeb0 434 AliMedium(10, "FE_C0 ", 10, 0, ISXFLD, SXMGMX, tmaxfd, stemax, deemax, epsil, stmin);
435 AliMedium(30, "FE_C1 ", 30, 0, ISXFLD, SXMGMX, tmaxfd, stemax, deemax, epsil, stmin);
436 AliMedium(50, "FE_C2 ", 50, 0, ISXFLD, SXMGMX, tmaxfd, stemax, deemax, epsil, stmin);
fe4da5cc 437
438 // Air
ad51aeb0 439 AliMedium(15, "AIR_C0 ", 15, 0, ISXFLD, SXMGMX, tmaxfd, stemax, deemax, epsil, stmin);
440 AliMedium(35, "AIR_C1 ", 35, 0, ISXFLD, SXMGMX, tmaxfd, stemax, deemax, epsil, stmin);
441 AliMedium(55, "AIR_C2 ", 55, 0, ISXFLD, SXMGMX, tmaxfd, stemax, deemax, epsil, stmin);
fe4da5cc 442
443 // Vacuum
ad51aeb0 444 AliMedium(16, "VA_C0 ", 16, 0, ISXFLD, SXMGMX, tmaxfd, stemax, deemax, epsil, stmin);
445 AliMedium(36, "VA_C1 ", 36, 0, ISXFLD, SXMGMX, tmaxfd, stemax, deemax, epsil, stmin);
446 AliMedium(56, "VA_C2 ", 56, 0, ISXFLD, SXMGMX, tmaxfd, stemax, deemax, epsil, stmin);
fe4da5cc 447
448 // Steel
ad51aeb0 449 AliMedium(19, "ST_C0 ", 19, 0, ISXFLD, SXMGMX, tmaxfd, stemax, deemax, epsil, stmin);
450 AliMedium(39, "ST_C1 ", 39, 0, ISXFLD, SXMGMX, tmaxfd, stemax, deemax, epsil, stmin);
451 AliMedium(59, "ST_C3 ", 59, 0, ISXFLD, SXMGMX, tmaxfd, stemax, deemax, epsil, stmin);
fe4da5cc 452
453 // Coil
ad51aeb0 454 AliMedium(14, "Coil_C1 ", 14, 0, ISXFLD, SXMGMX, tmaxfd, stemax, deemax, epsil, stmin);
455 AliMedium(34, "Coil_C2 ", 34, 0, ISXFLD, SXMGMX, tmaxfd, stemax, deemax, epsil, stmin);
456 AliMedium(54, "Coil_C3 ", 54, 0, ISXFLD, SXMGMX, tmaxfd, stemax, deemax, epsil, stmin);
fe4da5cc 457}
458