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