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