]> git.uio.no Git - u/mrichter/AliRoot.git/blob - STRUCT/AliDIPOv2.cxx
Reorientation of the W-Rings between chambers according to the new
[u/mrichter/AliRoot.git] / STRUCT / AliDIPOv2.cxx
1 /**************************************************************************
2  * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3  *                                                                        *
4  * Author: The ALICE Off-line Project.                                    *
5  * Contributors are mentioned in the code where appropriate.              *
6  *                                                                        *
7  * Permission to use, copy, modify and distribute this software and its   *
8  * documentation strictly for non-commercial purposes is hereby granted   *
9  * without fee, provided that the above copyright notice appears in all   *
10  * copies and that both the copyright notice and this permission notice   *
11  * appear in the supporting documentation. The authors make no claims     *
12  * about the suitability of this software for any purpose. It is          *
13  * provided "as is" without express or implied warranty.                  *
14  **************************************************************************/
15
16 /* $Id$ */
17
18 ///////////////////////////////////////////////////////////////////////////////
19 //                                                                           //
20 //  Magnetic Dipole version 1                                                //
21 //                                                                           //
22 //Begin_Html
23 /*
24 <img src="picts/AliDIPOv2Class.gif">
25 </pre>
26 <br clear=left>
27 <font size=+2 color=red>
28 <p>The responsible person for this module is
29 <a href="mailto:andreas.morsch@cern.ch">Andreas Morsch</a>.
30 </font>
31 <pre>
32 */
33 //End_Html
34 //                                                                           //
35 //                                                                           //
36
37 #include <TVirtualMC.h>
38 #include <TGeoVolume.h>
39
40 #include "AliConst.h"
41 #include "AliDIPOv2.h"
42 #include "AliMagF.h"
43 #include "AliRun.h"
44  
45 ClassImp(AliDIPOv2)
46  
47 //_____________________________________________________________________________
48 AliDIPOv2::AliDIPOv2() 
49 {
50   //
51   // Last design of magnetic dipole version 2
52   //
53 }
54  
55 //_____________________________________________________________________________
56 AliDIPOv2::AliDIPOv2(const char *name, const char *title)
57   : AliDIPO(name,title)
58 {
59   //
60   // Standard constructor for the magnetic dipole version 2    
61 }
62
63 void AliDIPOv2::CreateGeometry()
64 {
65   //
66   // Creation of the geometry of the magnetic DIPOLE version 2
67   //
68
69     CreateSpectrometerDipole();
70     CreateCompensatorDipole();
71 }
72
73
74 //_____________________________________________________________________________
75 void AliDIPOv2::CreateSpectrometerDipole()
76 {
77   //
78   // Creation of the geometry of the magnetic DIPOLE version 2
79   //
80
81   Float_t cpar[5], tpar[18], ypar[12];
82   Float_t dz, dx, dy;
83   Int_t idrotm[1899];
84   Float_t accMax, the1, phi1, the2, phi2, the3, phi3;
85   
86   Int_t *idtmed = fIdtmed->GetArray()-1799;
87
88 //  const Int_t kCoil = 1813;
89 //  const Int_t kCable= 1811;
90
91   const Int_t kCoil = 1808;
92   const Int_t kCable= 1808;
93   
94   accMax = 9.;   // ANGLE POLAIRE MAXIMUM 
95
96   //       DIPOLE MAGNET 
97   const Float_t kZDipole = 975; 
98
99   tpar[ 0] = 0.; 
100   tpar[ 1] = 360.;
101   tpar[ 2] = 4.; 
102   //
103   tpar[ 3] = -250.55 + kZDipole;
104   tpar[ 4] =  30.1;
105   tpar[ 5] = 527.34; 
106   //
107   tpar[ 6] = 37. + kZDipole;
108   tpar[ 7] =  30.1;
109   tpar[ 8] = 527.34;
110   //
111   tpar[ 9] = 37. + kZDipole;
112   tpar[10] = tpar[ 9] * TMath::Tan(2. * TMath::Pi() / 180.);
113   tpar[11] = 527.34;
114   //
115   tpar[12] = 260.55 + kZDipole;
116   tpar[13] = tpar[12] * TMath::Tan(2. * TMath::Pi() / 180.);
117   tpar[14] = 527.34;
118   gMC->Gsvolu("DDIP", "PCON", idtmed[1874], tpar, 15);
119   //
120   //       Coils 
121   // air - m.f. 
122   cpar[0] = 207.;
123   cpar[1] = 274.;
124   cpar[2] = 37.65;
125   cpar[3] = 119.;
126   cpar[4] = 241.; 
127   //   coil - high cuts
128   gMC->Gsvolu("DC1 ", "TUBS", idtmed[kCoil+40], cpar, 5);
129   cpar[3] = -61.;
130   cpar[4] = 61.;
131   gMC->Gsvolu("DC2 ", "TUBS", idtmed[kCoil+40], cpar, 5);
132
133   //  coil - low cuts cuts
134   cpar[0] = 207.;
135 //  cpar[1] = cpar[0] + 10.;
136   cpar[1] = 217;
137   cpar[3] = 119.;
138   cpar[4] = 241.;
139
140   gMC->Gsvolu("DC3 ", "TUBS", idtmed[kCoil], cpar, 5);
141   cpar[0] = 207.; 
142   cpar[1] = 217; 
143   cpar[3] = -61.;
144   cpar[4] = 61.;
145   gMC->Gsvolu("DC4 ", "TUBS", idtmed[kCoil], cpar, 5);
146
147   gMC->Gspos("DC3 ", 1, "DC1 ", 0., 0., 0., 0, "ONLY");
148   gMC->Gspos("DC4 ", 1, "DC2 ", 0., 0., 0., 0, "ONLY");
149
150 //  dz =  37.65 - 243.55
151   dz = -205.9-2.45;
152   dx = 5.;
153   gMC->Gspos("DC1 ", 1, "DDIP",  dx, 0.,  dz+kZDipole, 0, "ONLY");
154   gMC->Gspos("DC1 ", 2, "DDIP",  dx, 0., -dz+kZDipole, 0, "ONLY");
155   gMC->Gspos("DC2 ", 1, "DDIP", -dx, 0.,  dz+kZDipole, 0, "ONLY");
156   gMC->Gspos("DC2 ", 2, "DDIP", -dx, 0., -dz+kZDipole, 0, "ONLY");
157   the1 = 180.;
158   phi1 = 0.;
159   the2 = 90.;
160   phi2 = 151.;
161   the3 = 90.;
162   phi3 = 61.;
163   AliMatrix(idrotm[1800], the1, phi1, the2, phi2, the3, phi3);
164   phi2 = 29.;  //90-61
165   the3 = -90.;
166   phi3 = -61.;
167   AliMatrix(idrotm[1801], the1, phi1, the2, phi2, the3, phi3);
168   the1 = 0.;
169   phi1 = 0.;
170   the2 = 90.;
171   phi2 = 151.;
172   the3 = 90.;
173   phi3 = 61.;
174   AliMatrix(idrotm[1802], the1, phi1, the2, phi2, the3, phi3);
175   phi2 = 29.;
176   the3 = -90.;
177   phi3 = -61.;
178   AliMatrix(idrotm[1803], the1, phi1, the2, phi2, the3, phi3);
179
180   cpar[0] = 25.;
181   cpar[1] = 100.3; //25+75.3
182   cpar[2] = 33.5;
183   cpar[3] = 270.;
184   cpar[4] = 360.;
185 //*  coil high cuts
186   gMC->Gsvolu("DC11", "TUBS", idtmed[kCoil+40], cpar, 5);
187
188   dx = TMath::Sin(30.5*kDegrad) * -(207.+33.5)+5./TMath::Sin(30.5*kDegrad); 
189   dy = TMath::Cos(30.5*kDegrad) * -(207.+33.5);  
190   dz = cpar[1] - 243.55-2.45;
191   gMC->Gspos("DC11", 1, "DDIP",  dx, dy,  dz+kZDipole, idrotm[1800], "ONLY");
192   gMC->Gspos("DC11", 2, "DDIP",  dx, dy, -dz+kZDipole, idrotm[1802], "ONLY");
193   gMC->Gspos("DC11", 3, "DDIP", -dx, dy,  dz+kZDipole, idrotm[1801], "ONLY");
194   gMC->Gspos("DC11", 4, "DDIP", -dx, dy, -dz+kZDipole, idrotm[1803], "ONLY");
195
196
197
198 //* ... higher cuts
199   cpar[0] = 25.;
200   cpar[1] = 100.3; //25+75.3
201   cpar[2] = 33.5;
202   cpar[3] = 0.;
203   cpar[4] = 90.;
204 //*  coil high cuts
205   gMC->Gsvolu("DC12", "TUBS", idtmed[kCoil+40], cpar, 5);
206
207   dx = TMath::Sin(30.5*kDegrad) * -(207.+33.5)+5./TMath::Sin(30.5*kDegrad); 
208   dy = TMath::Cos(30.5*kDegrad) *(207.+33.5);  
209   dz = cpar[1] - 243.55-2.45;
210   gMC->Gspos("DC12", 1, "DDIP",  dx, dy,  dz+kZDipole, idrotm[1801], "ONLY");
211   gMC->Gspos("DC12", 2, "DDIP",  dx, dy, -dz+kZDipole, idrotm[1803], "ONLY");
212   gMC->Gspos("DC12", 3, "DDIP", -dx, dy,  dz+kZDipole, idrotm[1800], "ONLY");
213   gMC->Gspos("DC12", 4, "DDIP", -dx, dy, -dz+kZDipole, idrotm[1802], "ONLY");
214
215   the1 = 90.;
216   phi1 = 61.;
217   the2 = 90.;
218   phi2 = 151.;
219   the3 = 0.;
220   phi3 = 0.;
221   AliMatrix(idrotm[1804], the1, phi1, the2, phi2, the3, phi3);
222   the1 = 90.;
223   phi1 = -61.;
224   the2 = 90.;
225   phi2 = -151.;
226   AliMatrix(idrotm[1805], the1, phi1, the2, phi2, the3, phi3);
227   the1 = 90.;
228   phi1 = 119.; //180 -61
229   the2 = 90.;
230   phi2 = 209.; //270-61
231   AliMatrix(idrotm[1806], the1, phi1, the2, phi2, the3, phi3);
232   the1 = 90.;
233   phi1 = -119.;
234   the2 = 90.;
235   phi2 = -209.;
236   AliMatrix(idrotm[1807], the1, phi1, the2, phi2, the3, phi3); 
237
238 //*  coil - high cuts
239
240   tpar[0] = 37.65;
241   tpar[1] = 33.5;
242   tpar[2] = 145.5;
243   gMC->Gsvolu("DL1 ", "BOX ", idtmed[kCoil+40], tpar, 3);
244
245 // coil - low cuts
246
247   tpar[0] = 5.;
248   dx = 37.65  - 5.;  
249   gMC->Gsvolu("DL2 ", "BOX ", idtmed[kCoil], tpar, 3);
250   gMC->Gspos("DL2 ", 1, "DL1 ", dx, 0., 0., 0, "ONLY");
251
252   dx =-53.62;
253   dy =-241.26819;
254   dz = 0.; 
255   gMC->Gspos("DL1 ", 1, "DDIP", dx,  dy, dz+kZDipole, idrotm[1804], "ONLY");
256   gMC->Gspos("DL1 ", 2, "DDIP", dx, -dy, dz+kZDipole, idrotm[1805], "ONLY");
257   gMC->Gspos("DL1 ", 3, "DDIP",-dx,  dy, dz+kZDipole, idrotm[1806], "ONLY");
258   gMC->Gspos("DL1 ", 4, "DDIP",-dx, -dy, dz+kZDipole, idrotm[1807], "ONLY");
259
260   // Contactor
261
262  //  high cuts
263
264   //Steel outer face planes
265
266   cpar[0] = 207.-18.6;
267   cpar[1] = 274.+18.6;
268   cpar[2] = 1.;
269   cpar[3] = -50.;
270   cpar[4] = 50.; 
271  
272   gMC->Gsvolu("DCO1", "TUBS", idtmed[1818], cpar, 5);
273   dx = -5.;
274   dz = 168.25-1.5-1.;
275   gMC->Gspos("DCO1", 1, "DDIP", dx, 0, dz+kZDipole, 0, "ONLY");
276   dz = 243.55+4.5+1.5+1.;
277   gMC->Gspos("DCO1", 2, "DDIP", dx, 0, dz+kZDipole, 0, "ONLY");
278   
279   // 9.06.2000
280
281   //  cpar[0] = 207.-18.6;
282   //  cpar[1] = 274.+18.6;
283   // cpar[2] = 1.;
284   cpar[3] = 180.-50.;
285   cpar[4] = 180.+50.; 
286  
287   gMC->Gsvolu("DCO2", "TUBS", idtmed[1818], cpar, 5);
288   dx = +5.;
289   dz = 168.25-1.5-1.;
290   gMC->Gspos("DCO2", 1, "DDIP", dx, 0, dz+kZDipole, 0, "ONLY");
291   dz = 243.55+4.5+1.5+1.;
292   gMC->Gspos("DCO2", 2, "DDIP", dx, 0, dz+kZDipole, 0, "ONLY");
293  
294
295
296   // Resin face planes
297
298   cpar[0] = 207.;
299   cpar[1] = 274.;
300   cpar[2] = .75;
301   cpar[3] = -50.;
302   cpar[4] = 50.; 
303  
304   gMC->Gsvolu("DCO3", "TUBS", idtmed[1812], cpar, 5);
305   dx = -5;
306   dz = 168.25-0.75;
307   gMC->Gspos("DCO3", 1, "DDIP", dx,  0, dz+kZDipole, 0, "ONLY");
308   dz = 243.55+4.5+0.75;
309   gMC->Gspos("DCO3", 2, "DDIP", dx,  0, dz+kZDipole, 0, "ONLY");
310
311   // 9.06.2000
312
313   cpar[3] = 180.-50.;
314   cpar[4] = 180.+50.; 
315   gMC->Gsvolu("DCO4", "TUBS", idtmed[1812], cpar, 5);
316   dx = +5;
317   dz = 168.25-0.75;
318   gMC->Gspos("DCO4", 1, "DDIP", dx,  0, dz+kZDipole, 0, "ONLY");
319   dz = 243.55+4.5+0.75 ;
320   gMC->Gspos("DCO4", 2, "DDIP", dx,  0, dz+kZDipole, 0, "ONLY");
321
322  
323   // G10 face plane
324
325   cpar[0] = 207.;
326   cpar[1] = 274.;
327   cpar[2] = 2.25;
328   cpar[3] = -50.;
329   cpar[4] = 50.; 
330  
331   gMC->Gsvolu("DCO5", "TUBS", idtmed[1810], cpar, 5);
332
333   dx = -5;
334   dz = 243.55+2.25;
335   gMC->Gspos("DCO5", 1, "DDIP", dx,  0, dz+kZDipole, 0, "ONLY");
336
337   // 9.06.2000
338
339   cpar[3] = 180.-50.;
340   cpar[4] = 180.+50.; 
341
342   gMC->Gsvolu("DCO6", "TUBS", idtmed[1810], cpar, 5);
343
344   dx = +5;
345   dz = 243.55+2.25;
346   gMC->Gspos("DCO6", 1, "DDIP", dx,  0, dz+kZDipole, 0, "ONLY");
347
348   //Steel supported planes
349
350   cpar[0] = 274.+1.5+2.;
351   cpar[1] = 274.+18.6;
352   cpar[2] = 1.;
353   cpar[3] = -50.;
354   cpar[4] = 50.;  
355  
356   gMC->Gsvolu("DCO7", "TUBS", idtmed[1818], cpar, 5);
357
358   dx = -5;
359   dz = 168.25+1.;
360   gMC->Gspos("DCO7", 1, "DDIP", dx, 0, dz+kZDipole, 0, "ONLY");
361
362   // 9.06.2000
363   cpar[0] = 274.+1.5+2.;
364   cpar[1] = 274.+18.6;
365   cpar[2] = 1.;
366   cpar[3] = 180.-50.;
367   cpar[4] = 180.+50.; 
368
369  
370   gMC->Gsvolu("DCO8", "TUBS", idtmed[1818], cpar, 5);
371
372   dx = +5;
373   dz = 168.25+1.;
374   gMC->Gspos("DCO8", 1, "DDIP", dx, 0, dz+kZDipole, 0, "ONLY");
375
376   //
377
378   cpar[0] = 207.- 18.6;
379   cpar[1] = 207.- 2.- 1.5;
380   cpar[2] = 1.;
381   cpar[3] = -50.;
382   cpar[4] = 50.; 
383
384   gMC->Gsvolu("DCO9", "TUBS", idtmed[1818], cpar, 5);
385
386   dx = -5;
387   dz = 168.25+1.;
388   gMC->Gspos("DCO9", 1, "DDIP", dx, 0, dz+kZDipole, 0, "ONLY");
389
390   // 9.06.2000
391
392   cpar[0] = 207.- 18.6;
393   cpar[1] = 207.- 2.- 1.5;
394   cpar[2] = 1.;
395   cpar[3] = 180.-50.;
396   cpar[4] = 180.+50.; 
397
398   gMC->Gsvolu("DCOA", "TUBS", idtmed[1818], cpar, 5);
399
400   dx = +5;
401   dz = 168.25+1.;
402   gMC->Gspos("DCOA", 1, "DDIP", dx, 0, dz+kZDipole, 0, "ONLY");
403
404
405   // Sides steel planes
406
407   cpar[0] = 207. - 1.5 -2.;
408   cpar[1] = 207. - 1.5;
409   cpar[2] = ((243.55+4.5+1.5)-168.25)/2;
410   cpar[3] = -50.;
411   cpar[4] = 50.; 
412  
413   gMC->Gsvolu("DCOB", "TUBS", idtmed[1818], cpar, 5);
414
415   cpar[0] = 274. + 1.5;
416   cpar[1] = 274. + 1.5 +2.;
417
418   gMC->Gsvolu("DCOC", "TUBS", idtmed[1818], cpar, 5);
419
420   dx=-5.;
421   dz = ((243.55+4.5+1.5)+168.25)/2;
422   gMC->Gspos("DCOB", 1, "DDIP", dx,  0, dz+kZDipole, 0, "ONLY");
423   gMC->Gspos("DCOC", 1, "DDIP", dx,  0, dz+kZDipole, 0, "ONLY");
424
425   // 9.06.2000
426
427   cpar[0] = 207. - 1.5 -2.;
428   cpar[1] = 207. - 1.5;
429   cpar[2] = ((243.55+4.5+1.5)-168.25)/2;
430   cpar[3] = 180.-50.;
431   cpar[4] = 180.+50.; 
432
433   gMC->Gsvolu("DCOD", "TUBS", idtmed[1818], cpar, 5);
434
435   cpar[0] = 274. + 1.5;
436   cpar[1] = 274. + 1.5 +2.;
437
438   gMC->Gsvolu("DCOE", "TUBS", idtmed[1818], cpar, 5);
439
440   dx=+5.;
441   dz = ((243.55+4.5+1.5)+168.25)/2;
442   gMC->Gspos("DCOD", 1, "DDIP", dx,  0, dz+kZDipole, 0, "ONLY");
443   gMC->Gspos("DCOE", 1, "DDIP", dx,  0, dz+kZDipole, 0, "ONLY");
444
445
446   // Top and bottom resin  planes
447
448   cpar[0] = 207. - 1.5;
449   cpar[1] = 207.;
450   cpar[2] = ((243.55+4.5+1.5)-168.25)/2;
451   cpar[3] = -50.;
452   cpar[4] = 50.; 
453  
454   gMC->Gsvolu("DCOF", "TUBS", idtmed[1812], cpar, 5);
455
456   cpar[0] = 274.;
457   cpar[1] = 274. + 1.5;
458
459   gMC->Gsvolu("DCOG", "TUBS", idtmed[1812], cpar, 5);
460
461
462   dx=-5.;
463   dz = ((243.55+4.5+1.5)+168.25)/2;
464   gMC->Gspos("DCOF", 1, "DDIP", dx,  0, dz+kZDipole, 0, "ONLY");
465   gMC->Gspos("DCOG", 1, "DDIP", dx,  0, dz+kZDipole, 0, "ONLY");
466
467   // 9.06.2000
468   cpar[0] = 207. - 1.5;
469   cpar[1] = 207.;
470   cpar[2] = ((243.55+4.5+1.5)-168.25)/2;
471
472   cpar[3] = 180.-50.;
473   cpar[4] = 180.+50.; 
474
475   gMC->Gsvolu("DCOH", "TUBS", idtmed[1812], cpar, 5);
476
477   cpar[0] = 274.;
478   cpar[1] = 274. + 1.5;
479
480   gMC->Gsvolu("DCOI", "TUBS", idtmed[1812], cpar, 5);
481
482
483   dx=+5.;
484   dz = ((243.55+4.5+1.5)+168.25)/2;
485   gMC->Gspos("DCOH", 1, "DDIP", dx,  0, dz+kZDipole, 0, "ONLY");
486   gMC->Gspos("DCOI", 1, "DDIP", dx,  0, dz+kZDipole, 0, "ONLY");
487
488
489   // Aluminum cabels
490
491   cpar[0] = 274. + 1.5  +2.;
492   cpar[1] = 274. + 1.5  +2. + 80.;
493   cpar[2] = 5.05/2;
494   cpar[3] = -24.;
495   cpar[4] = 24.; 
496  
497   gMC->Gsvolu("DCOJ", "TUBS", idtmed[kCable], cpar, 5);
498
499   //  dx = 274. + 1.5  +2. +40.;
500   //  dx = 5. + 1.5 +2. +40.;
501   //  dx = 5. + 1.5 +2.;
502   dx=-5.;
503   dz = 168.25 + 5.05 + 5.05/2;
504   gMC->Gspos("DCOJ", 1, "DDIP", dx,  0, dz+kZDipole, 0, "ONLY");
505
506   dz = 243.55 - 5.05/2;
507   gMC->Gspos("DCOJ", 2, "DDIP", dx,  0, dz+kZDipole, 0, "ONLY");
508
509   // 9.06.2000
510
511   cpar[3] = 180.-24.;
512   cpar[4] = 180.+24.; 
513
514    gMC->Gsvolu("DCOK", "TUBS", idtmed[kCable], cpar, 5);
515
516   //  dx = 274. + 1.5  +2. +40.;
517   //  dx = 5. + 1.5 +2. +40.;
518   //  dx = 5. + 1.5 +2.;
519   dx=+5.;
520   dz = 168.25 + 5.05 + 5.05/2;
521   gMC->Gspos("DCOK", 1, "DDIP", dx,  0, dz+kZDipole, 0, "ONLY");
522
523   dz = 243.55 - 5.05/2;
524   gMC->Gspos("DCOK", 2, "DDIP", dx,  0, dz+kZDipole, 0, "ONLY");
525
526  
527   //   YOKE 
528
529 // Top and bottom blocks
530   ypar[0] = 298.1; 
531   ypar[1] = 69.5;
532   ypar[2] = 155.75;
533
534 // iron- high cuts
535   gMC->Gsvolu("DY1 ", "BOX ", idtmed[1858], ypar, 3);
536   ypar[0] = 144.+10.; 
537   ypar[1] = 193.3+10.;
538   ypar[2] = 5.;
539   ypar[3] = 155.75;
540   dy = -69.5 + 5.;
541 // iron- low cuts
542   gMC->Gsvolu("DY11", "TRD1", idtmed[1818], ypar, 4);
543   gMC->Gspos("DY11", 1, "DY1 ", 0.,  dy, 0., 0, "ONLY");
544
545   dy = 365.5;
546   dz = 4.95;
547   gMC->Gspos("DY1 ", 1, "DDIP", 0.,  dy, -dz+kZDipole, 0, "ONLY");
548
549   the1 = 270.;
550   phi1 = 0.;
551   the2 = 270.;
552   phi2 = 90.;
553   the3 = 0.;
554   phi3 = 0.;
555   AliMatrix(idrotm[1808], the1, phi1, the2, phi2, the3, phi3);
556   gMC->Gspos("DY1 ", 2, "DDIP", 0., -dy, -dz+kZDipole, idrotm[1808] , "ONLY");
557
558 // side walls
559   //  ypar[0] = 579./2.; 
560   ypar[0] = 296.; 
561   ypar[1] = 0.;
562   ypar[2] = 0.;
563   ypar[3] = 155.75;
564   ypar[4] = 47.9;
565   ypar[5] = 72.55;
566   ypar[6] = 4.3058039629;
567   // z+ 
568   ypar[7] = 155.75;
569   ypar[8] = 47.9;
570   ypar[9] = 72.55;
571   ypar[10] = 4.3058039629;
572
573 // iron - high cuts
574
575   gMC->Gsvolu("DY2 ", "TRAP", idtmed[1858], ypar,11);
576
577   ypar[4] = 47.9 -5.;
578   ypar[5] = 72.55 -5.;
579
580   ypar[8] = 47.9 -5.;
581   ypar[9] = 72.55 -5.;
582
583
584 // iron - low cuts
585
586   gMC->Gsvolu("DY22", "TRAP", idtmed[1818], ypar,11);
587
588   dy = 0.;
589   dx = -5.;
590
591   gMC->Gspos("DY22", 1, "DY2 ", dx,  dy, 0., 0, "ONLY");
592
593   the1 = 90.;
594   phi1 = 180.;
595   the2 = 180.;
596   phi2 = 180.;
597   the3 = 90.;
598   phi3 = 90.;
599   AliMatrix(idrotm[1809], the1, phi1, the2, phi2, the3, phi3);
600
601   the1 = 90.;
602   phi1 = 0.;
603   the2 = 180.;
604   phi2 = 0.;
605   the3 = 90.;
606   phi3 = 90.;
607   AliMatrix(idrotm[1810], the1, phi1, the2, phi2, the3, phi3);
608
609   dx = 228.875;
610   dz = - 4.95;
611   
612   gMC->Gspos("DY2 ", 1, "DDIP",  dx, 0.0,  dz+kZDipole, idrotm[1809], "ONLY");
613   gMC->Gspos("DY2 ", 2, "DDIP", -dx, 0.0,  dz+kZDipole, idrotm[1810], "ONLY");
614   
615   AliMatrix(idrotm[1811], 270., 0., 90., 90., 180., 0.);
616   gMC->Gspos("DDIP", 1, "ALIC", 0., 0., 0., idrotm[1811], "ONLY");
617   gMC->Gsatt("DDIP", "SEEN", 0);
618 }
619
620
621 void AliDIPOv2::CreateCompensatorDipole()
622 {
623     //
624     //  Geometry of the compensator Dipole MBWMD (was MCB @ SPS)
625     //  LAB I/EA Note 74.10
626     //  6/5/1974
627     //
628     const Float_t kHCoil       =  22.;  // Coil Height
629     const Float_t kWCoil       =  12.;  // Coil Width
630     const Float_t kLCoilH      = 250.;  // Hor. Coil Length
631     const Float_t kRCoilC      =  31.;  // Circ Coil Radius
632     const Float_t kWBase       = 125.;  // Base Width
633     const Float_t kHBase       =  30.;  // Base Height
634     
635     const Float_t kWUYoke      =  16.;
636     const Float_t kHUYoke      =  31.;
637
638     const Float_t kWLYoke      =  50.0;
639     const Float_t kHLYoke      =  61.0;
640     const Float_t kLLYoke      =  kLCoilH + kRCoilC;
641
642     const Float_t kWApperture  =  12.;
643     const Float_t kDCoil       =  kHUYoke + kHLYoke - 6. - 2. * kRCoilC;
644     
645     const Float_t kH           =  kHBase +  kHUYoke +  kHLYoke;
646     
647     Int_t *idtmed = fIdtmed->GetArray()-1799;
648     Int_t idrotm[1899];
649 //
650     Float_t pbox[3];
651 //  Mother volumes
652     TGeoVolumeAssembly* asDCM0 = new TGeoVolumeAssembly("DCM0");
653     gMC->Gsatt ("DCM0", "SEEN", 0);
654     
655 //
656 //  Mother volume containing lower coil
657     pbox[0] = kWLYoke / 2.;
658     pbox[1] = kHLYoke / 2.;
659     pbox[2] = kLLYoke / 2.;
660     
661     gMC->Gsvolu("DCML", "BOX", idtmed[1809 + 40], pbox, 3);
662 //
663 // Base
664     pbox[0] = kWBase / 2.;
665     pbox[1] = kHBase / 2.;
666     gMC->Gsvolu("DCBA", "BOX", idtmed[1809 + 40], pbox, 3);
667 //
668 // Coil: straight sections, horizontal
669     pbox[0] = kWCoil  / 2.;
670     pbox[1] = kHCoil  / 2.;
671     pbox[2] = kLCoilH / 2.;
672     gMC->Gsvolu("DCH1", "BOX", idtmed[1816 + 40], pbox, 3);
673 //
674 // Coil: straight sections, horizontal
675     pbox[0] = kWCoil  / 2.;
676     pbox[1] = kHCoil  / 2.;
677     pbox[2] = kLCoilH / 2.;
678     gMC->Gsvolu("DCH2", "BOX", idtmed[1816 + 40], pbox, 3);
679
680 //
681 // Mother volume containing upper coil
682     pbox[0] =  kWUYoke / 2.;
683     pbox[1] =  kHUYoke / 2.;
684     pbox[2] =  kLCoilH / 2.;
685     gMC->Gsvolu("DCMU", "BOX", idtmed[1809 + 40], pbox, 3);
686
687 //
688 // Coil: straight sections, vertical
689     pbox[0] = kWCoil / 2.;
690     pbox[1] = kDCoil / 2.;
691     pbox[2] = kHCoil / 2.;
692     
693     gMC->Gsvolu("DCCV", "BOX", idtmed[1816 + 40], pbox, 3);
694 //
695 // Coil: circular section 
696
697     Float_t ptubs[5];
698     ptubs[0] = kRCoilC - kHCoil;
699     ptubs[1] = kRCoilC;
700     ptubs[2] = kWCoil / 2.;
701     ptubs[3] =  0.;
702     ptubs[4] = 90.;
703     gMC->Gsvolu("DCC1", "TUBS", idtmed[1816 + 40], ptubs, 5);
704 //
705 // Clamps
706     Float_t ppgon[10];
707     ppgon[0] =  0.;
708     ppgon[1] = 90.;
709     ppgon[2] =  1.;
710     ppgon[3] =  2.;
711     ppgon[4] = -1.;
712     ppgon[5] =  0.;
713     ppgon[6] = 24.75;
714     ppgon[7] =  1.;
715     ppgon[8] =  0.;
716     ppgon[9] = 24.75;
717     gMC->Gsvolu("DCLA", "PGON", idtmed[1809 + 40], ppgon, 10);
718 //
719 // Assemble all
720 //
721     AliMatrix(idrotm[1811], -90., 0., 90., 90.,   0., 0.);
722     AliMatrix(idrotm[1812],   0., 0., 90., 90.,  90., 0.);  
723     AliMatrix(idrotm[1813], 180., 0., 90., 90.,  90., 0.);
724     AliMatrix(idrotm[1814],   0., 180., 90., 270.,  90., 0.);
725     AliMatrix(idrotm[1815], 180., 180., 90., 270.,  90., 0.);  
726     
727     Float_t dx, dy, dz;
728     Float_t dy0 = 0.;
729
730     dy0 = -kH / 2. + kHBase/2.;
731     gMC->Gspos("DCBA", 1, "DCM0",  0., dy0, 15.0, 0, "ONLY");
732     
733     // Lower coil
734     dx = ( kWLYoke - kWCoil) / 2.;
735     dy = (-kHLYoke + kHCoil) / 2. + 6.;
736     gMC->Gspos("DCH1", 1, "DCML",  dx, dy,  -kRCoilC / 2., 0, "ONLY");
737     // Lower mother volume
738     dx = (kWLYoke + kWApperture) / 2.;
739     dy0 += (kHBase +  kHLYoke) / 2.;
740     gMC->Gspos("DCML", 1, "DCM0", -dx, dy0, kRCoilC / 2., 0, "ONLY");
741     gMC->Gspos("DCML", 2, "DCM0", +dx, dy0, kRCoilC / 2., idrotm[1811], "ONLY");
742     
743     dx = (kWUYoke - kWCoil) / 2.;
744     dy = (kHUYoke - kHCoil) / 2;
745     // Upper coil
746     gMC->Gspos("DCH2", 1, "DCMU",   dx,  dy, 0., 0, "ONLY");
747     // Upper mother volume
748     dx = (kWUYoke + kWApperture) / 2.;
749     dy0 +=  (kHLYoke + kHUYoke) / 2.;
750     gMC->Gspos("DCMU", 1, "DCM0", -dx, dy0, 0., 0, "ONLY");
751     gMC->Gspos("DCMU", 2, "DCM0", +dx, dy0, 0., idrotm[1811], "ONLY");
752
753     // Vertical coils
754     dx =  (kWCoil +  kWApperture) / 2.;
755     dy =  kH / 2. - kDCoil / 2. - kRCoilC;
756     dz =  (kLCoilH - kHCoil) / 2. + kRCoilC;
757     gMC->Gspos("DCCV", 1, "DCM0",  dx,  dy, -dz, 0, "ONLY");
758     gMC->Gspos("DCCV", 2, "DCM0", -dx,  dy, -dz, 0, "ONLY");
759
760     dx = (kWLYoke - kWCoil) / 2.;
761     dy = -kHLYoke / 2. + kDCoil / 2. + 6. + kRCoilC;
762     dz =  kLLYoke / 2. - kHCoil / 2.;
763     
764     gMC->Gspos("DCCV", 3, "DCML", dx, dy,  dz, 0, "ONLY");
765
766
767
768     // Circular coil
769     dx =  (kWCoil +  kWApperture) / 2.;
770     dy = dy0 + kHUYoke / 2. - kRCoilC;
771     dz =  kLCoilH / 2.;
772     gMC->Gspos("DCC1", 1, "DCM0", -dx, dy,  dz, idrotm[1812], "ONLY");
773     gMC->Gspos("DCC1", 2, "DCM0", +dx, dy,  dz, idrotm[1812], "ONLY");
774     gMC->Gspos("DCC1", 3, "DCM0", +dx, dy, -dz, idrotm[1813], "ONLY");
775     gMC->Gspos("DCC1", 4, "DCM0", -dx, dy, -dz, idrotm[1813], "ONLY");
776     dy = -kH / 2. + kHBase + 6. + kRCoilC;
777     gMC->Gspos("DCC1", 5, "DCM0", +dx, dy, -dz, idrotm[1815], "ONLY");
778     gMC->Gspos("DCC1", 6, "DCM0", -dx, dy, -dz, idrotm[1815], "ONLY");
779
780     dx = ( kWLYoke - kWCoil) / 2.;
781     dy =  -kHLYoke / 2. + 6. + kRCoilC;
782     dz =  kLLYoke / 2. - kRCoilC;
783     gMC->Gspos("DCC1", 7, "DCML", dx, dy, dz, idrotm[1814], "ONLY");
784
785 //  Clamps
786     dx = kWApperture / 2. + kWUYoke;
787     dy = -kH / 2. + kHLYoke + kHBase;
788     
789
790     gMC->Gspos("DCLA", 1, "DCM0",  dx, dy, -119., 0, "ONLY");
791     gMC->Gspos("DCLA", 2, "DCM0",  dx, dy,  -44., 0, "ONLY");
792     gMC->Gspos("DCLA", 3, "DCM0",  dx, dy,   46., 0, "ONLY");
793     gMC->Gspos("DCLA", 4, "DCM0",  dx, dy,  119., 0, "ONLY");
794
795     gMC->Gspos("DCLA", 5, "DCM0",  -dx, dy, -119., idrotm[1811], "ONLY");
796     gMC->Gspos("DCLA", 6, "DCM0",  -dx, dy,  -44., idrotm[1811], "ONLY");
797     gMC->Gspos("DCLA", 7, "DCM0",  -dx, dy,   46., idrotm[1811], "ONLY");
798     gMC->Gspos("DCLA", 8, "DCM0",  -dx, dy,  119., idrotm[1811], "ONLY");
799
800
801     AliMatrix(idrotm[1816], 270., 0., 90., 90.,  180., 0.);  
802     gMC->Gspos("DCM0", 1, "ALIC",  0., -12.,  1075., idrotm[1816], "ONLY");
803 }
804
805 //_____________________________________________________________________________
806 void AliDIPOv2::DrawModule() const
807 {
808   //
809   // Draw a shaded view of the muon absorber
810   //
811
812   // Set everything unseen
813   gMC->Gsatt("*", "seen", -1);
814   // 
815   // Set ALIC mother transparent
816   gMC->Gsatt("ALIC","SEEN",0);
817   //
818   // Set the volumes visible
819   gMC->Gsatt("DDIP","seen",0);
820   gMC->Gsatt("DC1 ","seen",1);
821   gMC->Gsatt("DC2 ","seen",1);
822   gMC->Gsatt("DC3 ","seen",1);
823   gMC->Gsatt("DC4 ","seen",1);
824   gMC->Gsatt("DC11","seen",1);
825   gMC->Gsatt("DC21","seen",1);
826   gMC->Gsatt("DC12","seen",1);
827   gMC->Gsatt("DC22","seen",1);
828   gMC->Gsatt("DL1 ","seen",1);
829   gMC->Gsatt("DL2 ","seen",1);
830   gMC->Gsatt("DY1 ","seen",1);
831   gMC->Gsatt("DY2 ","seen",1);
832   gMC->Gsatt("DYL ","seen",1);
833   gMC->Gsatt("DY3 ","seen",1);
834  // gMC->Gsatt("DY4 ","seen",1);
835  // gMC->Gsatt("DY5 ","seen",1);
836  // gMC->Gsatt("DY6 ","seen",1);
837 //  gMC->Gsatt("DY7 ","seen",1);
838   //
839   gMC->Gdopt("hide", "on");
840   gMC->Gdopt("shad", "on");
841   gMC->Gsatt("*", "fill", 7);
842   gMC->SetClipBox(".");
843   gMC->SetClipBox(".");
844   gMC->DefaultRange();
845   gMC->Gdraw("alic", 30, 30, 0, 17, 13.5, .019, .019);
846   gMC->Gdhead(1111, "Magnetic Dipole Version 2");
847   gMC->Gdman(16, 4, "MAN");
848 }
849
850
851
852
853 //_____________________________________________________________________________
854 void AliDIPOv2::CreateMaterials()
855 {
856   //
857   // Create Materials for Magnetic Dipole version 2
858   //
859   
860   Int_t isxfld1   = gAlice->Field()->Integ();
861   Int_t isxfld2   = gAlice->Field()->PrecInteg();
862   Float_t sxmgmx  = gAlice->Field()->Max();
863   
864   
865   Float_t asteel[4] = { 55.847,51.9961,58.6934,28.0855 };
866   Float_t zsteel[4] = { 26.,24.,28.,14. };
867   Float_t wsteel[4] = { .715,.18,.1,.005 };
868
869   Float_t acoil[3]  = { 26.98,1.01,16. };
870   Float_t zcoil[3]  = { 13.,1.,8. };
871   Float_t wcoil[3]  = { .66,.226,.114 };
872
873   Float_t aresi[3]  = { 1.01,12.011,16.};
874   Float_t zresi[3]  = { 1.,6.,8. };
875   Float_t wresi[3]  = { .0644,.7655,.1701 };
876
877   Float_t aG10[5] = { 1.01,12.011,16.,28.085 ,79.904 };
878   Float_t zG10[5] = { 1.,6.,8.,14.,35. };
879   Float_t wG10[5] = { .02089,.22338,.28493,.41342,.05738 };
880
881     // AIR
882
883   Float_t aAir[4]={12.0107,14.0067,15.9994,39.948};
884   Float_t zAir[4]={6.,7.,8.,18.};
885   Float_t wAir[4]={0.000124,0.755267,0.231781,0.012827};
886   Float_t dAir = 1.20479E-3;
887   Float_t dAir1 = 1.20479E-10;
888
889   
890   Float_t epsil, stmin, deemax, tmaxfd, stemax;
891   
892   // --- Define the various materials for GEANT --- 
893   //     Aluminum 
894   AliMaterial( 9, "ALUMINIUM0$", 26.98, 13., 2.7, 8.9, 37.2);
895   AliMaterial(29, "ALUMINIUM1$", 26.98, 13., 2.7, 8.9, 37.2);
896   AliMaterial(49, "ALUMINIUM2$", 26.98, 13., 2.7, 8.9, 37.2);
897   
898   //     Iron 
899   AliMaterial(10, "IRON0$     ", 55.85, 26., 7.87, 1.76, 17.1);
900   AliMaterial(30, "IRON1$     ", 55.85, 26., 7.87, 1.76, 17.1);
901   AliMaterial(50, "IRON2$     ", 55.85, 26., 7.87, 1.76, 17.1);
902   //     Copper
903   AliMaterial(17, "COPPER0$   ", 63.55, 29., 8.96, 1.43, 15.1);
904   AliMaterial(37, "COPPER1$   ", 63.55, 29., 8.96, 1.43, 15.1);
905   AliMaterial(57, "COPPER2$   ", 63.55, 29., 8.96, 1.43, 15.1);
906   //     Air 
907   AliMixture(15, "AIR0$      ", aAir, zAir, dAir, 4, wAir);
908   AliMixture(35, "AIR1$      ", aAir, zAir, dAir, 4, wAir);
909   AliMixture(55, "AIR2$      ", aAir, zAir, dAir, 4, wAir);
910   AliMixture(75, "AIR_MUON   ", aAir, zAir, dAir, 4, wAir);
911   //     Vacuum 
912   AliMixture(16, "VACUUM0$ ", aAir, zAir, dAir1, 4, wAir);
913   AliMixture(36, "VACUUM1$ ", aAir, zAir, dAir1, 4, wAir);
914   AliMixture(56, "VACUUM2$ ", aAir, zAir, dAir1, 4, wAir);
915   
916   //     stainless Steel 
917   AliMixture(19, "STAINLESS STEEL0$", asteel, zsteel, 7.88, 4, wsteel);
918   AliMixture(39, "STAINLESS STEEL1$", asteel, zsteel, 7.88, 4, wsteel);
919   AliMixture(59, "STAINLESS STEEL2$", asteel, zsteel, 7.88, 4, wsteel);
920   
921   //     Coil 
922   AliMixture(14, "Al0$", acoil, zcoil, 2.122, 3, wcoil);
923   AliMixture(34, "Al1$", acoil, zcoil, 2.122, 3, wcoil);
924   AliMixture(54, "Al2$", acoil, zcoil, 2.122, 3, wcoil);
925
926   //RESIN
927   AliMixture(13, "RESIN0$", aresi, zresi, 1.05, 3, wresi);
928   AliMixture(33, "RESIN1$", aresi, zresi, 1.05, 3, wresi);
929   AliMixture(53, "RESIN2$", aresi, zresi, 1.05, 3, wresi);  
930
931   //G10
932   AliMixture(11, "G100$", aG10, zG10, 1.7, 5, wG10);
933   AliMixture(31, "G101$", aG10, zG10, 1.7, 5, wG10);
934   AliMixture(51, "G102$", aG10, zG10, 1.7, 5, wG10); 
935  
936   // **************** 
937   //     Defines tracking media parameters. 
938   //     Les valeurs sont commentees pour laisser le defaut 
939   //     a GEANT (version 3-21, page CONS200), f.m. 
940   epsil  = .001;  // Tracking precision, 
941   stemax = -1.;   // Maximum displacement for multiple scat 
942   tmaxfd = -20.;  // Maximum angle due to field deflection 
943   deemax = -.3;   // Maximum fractional energy loss, DLS 
944   stmin  = -.8;
945   // *************** 
946   
947   //    Aluminum 
948   AliMedium( 9, "ALU_C0          ",  9, 0, isxfld1, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
949   AliMedium(29, "ALU_C1          ", 29, 0, isxfld1, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
950   AliMedium(49, "ALU_C2          ", 49, 0, isxfld1, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
951   
952   //    Iron 
953   AliMedium(10, "FE_C0           ", 10, 0, isxfld1, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
954   AliMedium(30, "FE_C1           ", 30, 0, isxfld1, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
955   AliMedium(50, "FE_C2           ", 50, 0, isxfld1, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
956   
957   //    Air 
958   AliMedium(15, "AIR_C0          ", 15, 0, isxfld1, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
959   AliMedium(35, "AIR_C1          ", 35, 0, isxfld1, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
960   AliMedium(55, "AIR_C2          ", 55, 0, isxfld1, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
961   AliMedium(75, "AIR_MUON        ", 75, 0, isxfld2, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
962   
963   //    Vacuum 
964   AliMedium(16, "VA_C0           ", 16, 0, isxfld1, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
965   AliMedium(36, "VA_C1           ", 36, 0, isxfld1, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
966   AliMedium(56, "VA_C2           ", 56, 0, isxfld1, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
967   
968   //    Steel 
969   AliMedium(19, "ST_C0           ", 19, 0, isxfld1, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
970   AliMedium(39, "ST_C1           ", 39, 0, isxfld1, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
971   AliMedium(59, "ST_C3           ", 59, 0, isxfld1, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
972   
973   //    Coil 
974   AliMedium(14, "Coil_C1         ", 14, 0, isxfld1, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
975   AliMedium(34, "Coil_C2         ", 34, 0, isxfld1, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
976   AliMedium(54, "Coil_C3         ", 54, 0, isxfld1, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
977
978   //    Resin 
979   AliMedium(13, "RESIN_C0        ", 13, 0, isxfld1, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
980   AliMedium(33, "RESIN_C1        ", 33, 0, isxfld1, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
981   AliMedium(53, "RESIN_C2        ", 53, 0, isxfld1, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
982
983   //    G10 
984   AliMedium(11, "G10_C0          ", 11, 0, isxfld1, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
985   AliMedium(31, "G10_C1          ", 31, 0, isxfld1, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
986   AliMedium(51, "G10_C2          ", 51, 0, isxfld1, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
987   //
988   //    Copper
989   AliMedium(17, "Cu_C0           ", 17, 0, isxfld1, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
990   AliMedium(37, "Cu_C1           ", 37, 0, isxfld1, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
991   AliMedium(57, "Cu_C2           ", 57, 0, isxfld1, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
992
993 }
994
995
996
997
998
999