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