]> git.uio.no Git - u/mrichter/AliRoot.git/blob - STRUCT/AliHALL.cxx
Medium array is now private for each module
[u/mrichter/AliRoot.git] / STRUCT / AliHALL.cxx
1 ///////////////////////////////////////////////////////////////////////////////
2 //                                                                           //
3 //  Experimental Hall                                                        //
4 //  This class contains the description of the experimental hall             //
5 //                                                                           //
6 //Begin_Html
7 /*
8 <img src="picts/AliHALLClass.gif">
9 </pre>
10 <br clear=left>
11 <font size=+2 color=red>
12 <p>The responsible person for this module is
13 <a href="mailto:andreas.morsch@cern.ch">Andreas Morsch</a>.
14 </font>
15 <pre>
16 */
17 //End_Html
18 //                                                                           //
19 //                                                                           //
20 ///////////////////////////////////////////////////////////////////////////////
21
22 #include "AliHALL.h"
23 #include "AliRun.h"
24 #include "AliConst.h"
25  
26 ClassImp(AliHALL)
27  
28 //_____________________________________________________________________________
29 AliHALL::AliHALL()
30 {
31   //
32   // Default constructor for the experimental Hall
33   //
34 }
35  
36 //_____________________________________________________________________________
37 AliHALL::AliHALL(const char *name, const char *title)
38        : AliModule(name,title)
39 {
40   //
41   // Standard constructor for the experimental Hall
42   //
43   SetMarkerColor(7);
44   SetMarkerStyle(2);
45   SetMarkerSize(0.4);
46 }
47  
48 //_____________________________________________________________________________
49 void AliHALL::CreateGeometry()
50 {
51   //
52   // Create the geometry of the exprimental hall
53   //
54   //Begin_Html
55   /*
56     <img src="picts/AliHALLTree.gif">
57   */
58   //End_Html
59   //
60   // If ZDC is not present the experimental hall includes a short
61   // section of the accelerator tunnel
62   //
63   //Begin_Html
64   /*
65     <img src="picts/AliHALLSmall.gif">
66   */
67   //End_Html
68   //
69   // If ZDC is present the experimental hall includes the accelerator
70   // tunnel beyond the ZDC
71   //
72   //Begin_Html
73   /*
74     <img src="picts/AliHALLLarge.gif">
75   */
76   //End_Html
77
78   
79   AliMC* pMC = AliMC::GetMC();
80   
81   Float_t r2;
82   Float_t phid, phim, tpar[3], pbox[3], zfil_out, h, r, tspar[5];
83   Float_t w1, dh, am, bm, dl,cm, hm, dr, dx, xl;
84   Int_t idrotm[1999];
85   Float_t trdpar[4], trapar[11], hullen;
86   Float_t dz, phi, par[3], zfil_in;
87   
88   Int_t *idtmed = fIdtmed->GetArray()-1899;
89   
90   //abs_d   = 90.;  // DEFINES DRIFT LENGTH 
91   //z_nose  = 102.;
92   //z_cone  = 285.;
93   //theta1  = 24.;  // 1. angle defining the front absorber 
94   //theta2  = 5.;   // 2. angle defining the front absorbe 
95   //acc_max = 9.;   // ANGLE POLAIRE MAXIMUM 
96   //acc_min = 2.;   // ANGLE POLAIRE MINIMUM DE DETECTION 
97   //abs_l   = 503.;
98   //d_steel = 1.;   // THICKNESS OF STEEL SUPPORT 
99   //d_poly  = 7.5;
100   //d_pb    = 2.5;
101   //abs_cc  = 315.; // DEFINES LENGTH OF CARBON 
102   //abs_c   = 358.;
103   //abs_s   = 150.; // DEFINES W-SHIELD LENGTH 
104   //abs_n   = 80.;  // START OF NOSE 
105   //r_abs   = 4.;
106   //r_pb    = .1;
107   //epsilon = .01;
108   //theta_r = 3.;
109   //d_rear  = 35.;
110   //theta_open = .75;
111   
112   //z_l3     = 700.;
113   //zmag_in  = 725.;
114   //zmag_out = 1225.;
115   zfil_in  = 1471.;
116   zfil_out = 1591.;
117   //zcon_in  = 1900.;
118   //zcon_out = 2e3;
119   //zcone_e  = 859.0875;
120   //spec_l   = 1800.;
121   //zplug_in = 1780.;
122   //zplug_out= 1900.;
123   
124   //     Chamber position 
125   //      CZ1=515.5 
126   //cz1 = 511.;
127   //cz2 = 686.;
128   //cz3 = 971.;
129   //cz4 = 1245.;
130   //cz5 = 1445.;
131   //cz6 = 1610.;
132   //cz7 = 1710.;
133   
134   
135   //     RB24/26 TUNNEL FLOOR 
136   
137   r   = 220.;
138   h   = 140.;
139   phi = TMath::ACos(h / r);
140   xl  = r * TMath::Sin(phi);
141   dr  = 100.;
142   dh  = dr * TMath::Cos(phi);
143   dl  = dr * TMath::Sin(phi);
144   if (gAlice->GetModule("ZDC") == 0) {
145     
146     //     No ZDC 
147     hullen = 250.;
148   } else {
149     
150     //     ZDC is present 
151     hullen = 6400.;
152   }
153   trdpar[0] = xl + dl;
154   trdpar[1] = xl;
155   trdpar[2] = hullen;
156   trdpar[3] = dh / 2.;
157   AliMatrix(idrotm[1900], 90., 0., 0., 0., 90., 90.);
158   AliMatrix(idrotm[1901], 270., 0., 90., 90., 0., 0.);
159   pMC->Gsvolu("HUFL", "TRD1", idtmed[1956], trdpar, 4);
160   r2 = hullen + 2020.;
161   pMC->Gspos("HUFL", 1, "ALIC", 70.,-100-trdpar[3] , r2, idrotm[1900], "ONLY");
162   
163   //     RB24/26 wall 
164   
165   phid     = phi * 57.296;
166   tspar[0] = r;
167   tspar[1] = r + dr;
168   tspar[2] = hullen;
169   tspar[3] = phid - 90.;
170   tspar[4] = 270. - phid;
171   pMC->Gsvolu("HUWA", "TUBS", idtmed[1956], tspar, 5);
172   pMC->Gspos("HUWA", 1, "ALIC", 70., 40.,2020+hullen , 0, "ONLY");
173   
174   //     tunnelplug 
175   
176   tpar[0] = 0.;
177   tpar[1] = 50.;
178   tpar[2] = 60.;
179   pMC->Gsvolu("HUP2", "TUBE", idtmed[1954], tpar, 3);
180   
181   //     END WALL 
182   
183   pbox[0] = 1200.;
184   pbox[1] = 1300.;
185   pbox[2] = 60.;
186   pMC->Gsvolu("HEW1", "BOX ", idtmed[1956], pbox, 3);
187   pMC->Gspos("HUP2", 1, "HEW1", 0.,-404., 0.,   0, "ONLY");
188   pMC->Gspos("HEW1", 1, "ALIC", 0., 404., 1960, 0, "ONLY");
189   
190   //     hall floor 
191   
192   phid      = 16.197;
193   trdpar[0] = 700.;
194   trdpar[1] = TMath::Tan(phid * kDegrad) * 190. + 700.;
195   trdpar[2] = 550.;
196   trdpar[3] = 95.;
197   pMC->Gsvolu("HHF1", "TRD1", idtmed[1956], trdpar, 4);
198   pMC->Gspos("HHF1", 1, "ALIC", 0., -801., 1350., idrotm[1900], "ONLY");
199   pMC->Gspos("HHF1", 2, "ALIC", 0., -801.,-1350., idrotm[1900], "ONLY");
200   
201   //     hall side walls 
202   
203   trapar[0] = 550.;
204   trapar[1] = 0.;
205   trapar[2] = 0.;
206   trapar[3] = 1273.78/2;
207   trapar[4] = 235.;
208   trapar[5] = 50.;
209   trapar[6] = TMath::ATan((trapar[4] - trapar[5]) / 2. / trapar[3]) * kRaddeg;
210   trapar[7] = trapar[3];
211   trapar[8] = trapar[4];
212   trapar[9] = trapar[5];
213   trapar[10] = trapar[6];
214   dx = trapar[4] * 1.5 + 700. - trapar[5] * .5;
215   pMC->Gsvolu("HHW1", "TRAP", idtmed[1956], trapar, 11);
216   pMC->Gspos("HHW1", 1, "ALIC", dx, -896+trapar[3],  1350., 0, "ONLY");
217   pMC->Gspos("HHW1", 2, "ALIC",-dx, -896+trapar[3],  1350., idrotm[1901], "ONLY");
218   pMC->Gspos("HHW1", 3, "ALIC", dx, -896+trapar[3], -1350., 0, "ONLY");
219   pMC->Gspos("HHW1", 4, "ALIC",-dx, -896+trapar[3], -1350., idrotm[1901], "ONLY");
220   pbox[0] = 50.;
221   pbox[1] = (500. - (trapar[3] * 2. - 896.)) / 2.;
222   pbox[2] = 1900.;
223   pMC->Gsvolu("HBW1", "BOX ", idtmed[1956], pbox, 3);
224   pMC->Gspos("HBW1", 1, "ALIC",  1120., 500-pbox[1], 0., 0, "ONLY");
225   pMC->Gspos("HBW1", 2, "ALIC", -1120., 500-pbox[1], 0., 0, "ONLY");
226   
227   //     slanted wall close to L3 magnet 
228   
229   phim = 45.;
230   hm   = 790.;
231   //rm   = hm / TMath::Cos(phim / 2. * kDegrad);
232   am   = hm * TMath::Tan(phim / 2. * kDegrad);
233   bm   = (hm + 76.) / hm * am;
234   cm   = bm * 2. / TMath::Sqrt(2.);
235   trapar[0] = 800.;
236   trapar[1] = 0.;
237   trapar[2] = 0.;
238   trapar[3] = (1273.78 - cm) / 2.;
239   trapar[4] = 235. - cm * TMath::Tan(phid * kDegrad) / 2.;
240   trapar[5] = 50.;
241   trapar[6] = TMath::ATan((trapar[4] - trapar[5]) / 2. / trapar[3]) * kRaddeg;
242   trapar[7] = trapar[3];
243   trapar[8] = trapar[4];
244   trapar[9] = trapar[5];
245   trapar[10] = trapar[6];
246   w1 = trapar[4];
247   dx = cm*TMath::Tan(phid * kDegrad) + 700. + trapar[4] * 1.5 - trapar[5] * .5;
248   pMC->Gsvolu("HHW2", "TRAP", idtmed[1956], trapar, 11);
249   r2 = cm - 896. + trapar[3];
250   pMC->Gspos("HHW2", 1, "ALIC", dx, r2, 0., 0, "ONLY");
251   pMC->Gspos("HHW2", 2, "ALIC",-dx, r2, 0., idrotm[1901], "ONLY");
252   trapar[3]  = cm / 2.;
253   trapar[4]  = w1 + cm / 2.;
254   trapar[5]  = w1;
255   trapar[6]  = TMath::ATan(.5) * kRaddeg;
256   trapar[7]  = trapar[3];
257   trapar[8]  = trapar[4];
258   trapar[9]  = trapar[5];
259   trapar[10] = trapar[6];
260   dx = 1170. - trapar[4] * .5 - trapar[5] * .5;
261   pMC->Gsvolu("HHW3", "TRAP", idtmed[1956], trapar, 11);
262   r2 = trapar[3] - 896.;
263   pMC->Gspos("HHW3", 1, "ALIC", dx, r2, 0., 0, "ONLY");
264   pMC->Gspos("HHW3", 2, "ALIC",-dx, r2, 0., idrotm[1901], "ONLY");
265   
266
267   tspar[0] = 1070.;
268   tspar[1] = 1170.;
269   tspar[2] = 1900.;
270   tspar[3] = 0.;
271   tspar[4] = 180.;
272   pMC->Gsvolu("HHC1", "TUBS", idtmed[1956], tspar, 5);
273   pMC->Gspos("HHC1", 1, "ALIC", 0., 500., 0., 0, "ONLY");
274   trdpar[0] = 1170 - trapar[4] * 2.;
275   trdpar[1] = trdpar[0] + TMath::Tan(phim * kDegrad) * 76.;
276   trdpar[2] = 800.;
277   trdpar[3] = 38.;
278   pMC->Gsvolu("HHF2", "TRD1", idtmed[1956], trdpar, 4);
279   pMC->Gspos("HHF2", 1, "ALIC", 0., -858., 0., idrotm[1900], "ONLY");
280   
281   //     pillars for working platform 
282   
283   pbox[0] = 40.;
284   pbox[1] = 120.;
285   pbox[2] = 550.;
286   pMC->Gsvolu("HPIL", "BOX ", idtmed[1956], pbox, 3);
287   pMC->Gspos("HPIL", 1, "ALIC", 165.,-706+pbox[1] , 1350., 0, "ONLY");
288   pMC->Gspos("HPIL", 2, "ALIC",-165.,-706+pbox[1] , 1350., 0, "ONLY");
289   
290   //     concrete beam shield 
291   
292   pbox[0] = 402.5;
293   pbox[1] = 260.;
294   pbox[2] = 120.;
295   pMC->Gsvolu("HMBS", "BOX ", idtmed[1956], pbox, 3);
296   pbox[0] = 85.;
297   pbox[1] = 100.;
298   pMC->Gsvolu("HBBS", "BOX ", idtmed[1956], pbox, 3);
299   pMC->Gspos("HBBS", 1, "HMBS", -157.5, 0., 0., 0, "ONLY");
300   pbox[0] = 40.;
301   pbox[1] = 130.;
302   pMC->Gsvolu("HPBS", "BOX ", idtmed[1956], pbox, 3);
303   pMC->Gspos("HPBS", 1, "HMBS", 202.5,  30.,    0., 0, "ONLY");
304   pMC->Gspos("HMBS", 1, "ALIC", 157.5, -50., -820., 0, "ONLY");
305   
306   //       MUON FILTER 
307   par[0] = 30.;
308   par[1] = 310.;
309   par[2] = (zfil_out - zfil_in) / 2.;
310   pMC->Gsvolu("HXFI", "TUBE", idtmed[1949], par, 3);
311   dz = (zfil_in + zfil_out) / 2.;
312   par[2] -= 10.;
313   pMC->Gsvolu("HXII", "TUBE", idtmed[1909], par, 3);
314   pMC->Gspos("HXII", 1, "HXFI", 0., 0., 0., 0, "ONLY");
315   pMC->Gspos("HXFI", 1, "ALIC", 0., 0., dz, 0, "ONLY");
316 }
317
318 //_____________________________________________________________________________
319 void AliHALL::CreateMaterials()
320 {
321   //
322   // Create materials for the experimental hall
323   //
324   
325
326   Int_t   ISXFLD = gAlice->Field()->Integ();
327   Float_t SXMGMX = gAlice->Field()->Max();
328   
329   Float_t aconc[10] = { 1.,12.01,15.994,22.99,24.305,26.98,28.086,39.1,40.08,55.85 };
330   Float_t zconc[10] = { 1.,6.,8.,11.,12.,13.,14.,19.,20.,26. };
331   Float_t wconc[10] = { .01,.001,.529107,.016,.002,.033872,.337021,.013,.044,.014 };
332   
333   Float_t epsil, stmin, deemax, tmaxfd, stemax;
334
335   //     FOR CONCRETE 
336   
337   AliMaterial(10, "IRON$     ", 55.85, 26., 7.87, 1.76, 17.1);
338   AliMaterial(30, "IRON$     ", 55.85, 26., 7.87, 1.76, 17.1);
339   AliMaterial(50, "IRON$     ", 55.85, 26., 7.87, 1.76, 17.1);
340   AliMaterial(15, "AIR$      ", 14.61, 7.3, .001205, 30423.24, 67500);
341   AliMaterial(35, "AIR$      ", 14.61, 7.3, .001205, 30423.24, 67500);
342   AliMaterial(55, "AIR$      ", 14.61, 7.3, .001205, 30423.24, 67500);
343   AliMixture(17, "CONCRETE$", aconc, zconc, 2.35, 10, wconc);
344   AliMixture(37, "CONCRETE$", aconc, zconc, 2.35, 10, wconc);
345   AliMixture(57, "CONCRETE$", aconc, zconc, 2.35, 10, wconc);
346   
347   // **************** 
348   //     Defines tracking media parameters. 
349   //     Les valeurs sont commentees pour laisser le defaut 
350   //     a GEANT (version 3-21, page CONS200), f.m. 
351   epsil  = .001;  // Tracking precision, 
352   stemax = -1.;   // Maximum displacement for multiple scat 
353   tmaxfd = -20.;  // Maximum angle due to field deflection 
354   deemax = -.3;   // Maximum fractional energy loss, DLS 
355   stmin  = -.8;
356   // *************** 
357   
358   //     IRON 
359   
360   AliMedium(10, "FE_C0             ", 10, 0, ISXFLD, SXMGMX, tmaxfd, stemax, deemax, epsil, stmin);
361   AliMedium(30, "FE_C1             ", 30, 0, ISXFLD, SXMGMX, tmaxfd, stemax, deemax, epsil, stmin);
362   AliMedium(50, "FE_C2             ", 50, 0, ISXFLD, SXMGMX, tmaxfd, stemax, deemax, epsil, stmin);
363   
364   //    Air 
365   
366   AliMedium(15, "AIR_C0           ", 15, 0, ISXFLD, SXMGMX, tmaxfd, stemax, deemax, epsil, stmin);
367   AliMedium(35, "AIR_C1           ", 35, 0, ISXFLD, SXMGMX, tmaxfd, stemax, deemax, epsil, stmin);
368   AliMedium(55, "AIR_C2           ", 55, 0, ISXFLD, SXMGMX, tmaxfd, stemax, deemax, epsil, stmin);
369   
370   //    Concrete 
371   
372   AliMedium(17, "CC_C0            ", 17, 0, ISXFLD, SXMGMX, tmaxfd, stemax, deemax, epsil, stmin);
373   AliMedium(37, "CC_C1            ", 37, 0, ISXFLD, SXMGMX, tmaxfd, stemax, deemax, epsil, stmin);
374   AliMedium(57, "CC_C2            ", 57, 0, ISXFLD, SXMGMX, tmaxfd, stemax, deemax, epsil, stmin);
375 }
376
377 //_____________________________________________________________________________
378 void AliHALL::Init()
379 {
380   //
381   // Initialise the HALL after it has been built
382   //
383   Int_t i;
384   //
385   printf("\n");
386   for(i=0;i<35;i++) printf("*");
387   printf(" HALL_INIT ");
388   for(i=0;i<35;i++) printf("*");
389   printf("\n");
390   //
391   // Here the HALL initialisation code (if any!)
392   for(i=0;i<80;i++) printf("*");
393   printf("\n");
394 }
395
396 //_____________________________________________________________________________
397 void AliHALL::DrawModule()
398 {
399   //
400   // Draw a shaded view of Experimental Hall
401   //
402
403   AliMC* pMC = AliMC::GetMC();
404   
405   // Set everything unseen
406   pMC->Gsatt("*", "seen", -1);
407   // 
408   // Set ALIC mother transparent
409   pMC->Gsatt("ALIC","SEEN",0);
410   //
411   // Set the volumes visible
412   pMC->Gsatt("HUFL","seen",1);
413   pMC->Gsatt("HUWA","seen",1);
414   pMC->Gsatt("HUP2","seen",1);
415   pMC->Gsatt("HEW1","seen",1);
416   pMC->Gsatt("HHF1","seen",1);
417   pMC->Gsatt("HHW1","seen",1);
418   pMC->Gsatt("HBW1","seen",1);
419   pMC->Gsatt("HHW2","seen",1);
420   pMC->Gsatt("HHW3","seen",1);
421   pMC->Gsatt("HHC1","seen",1);
422   pMC->Gsatt("HHF2","seen",1);
423   pMC->Gsatt("HPIL","seen",1);
424   pMC->Gsatt("HMBS","seen",1);
425   pMC->Gsatt("HBBS","seen",1);
426   pMC->Gsatt("HPBS","seen",1);
427   pMC->Gsatt("HXFI","seen",1);
428   pMC->Gsatt("HXII","seen",1);
429   //
430   pMC->Gdopt("hide", "on");
431   pMC->Gdopt("shad", "on");
432   pMC->Gsatt("*", "fill", 7);
433   pMC->SetClipBox(".");
434   if (gAlice->GetModule("ZDC") == 0) {
435     //
436     // ZDC is not present
437     //
438     pMC->SetClipBox("*", 0, 3000, -3000, 3000, -6000, 6000);
439     pMC->DefaultRange();
440     pMC->Gdraw("alic", 40, 30, 0, 12, 7.5, .005, .005);
441   } else {
442     //
443     // ZDC is present
444     //
445     pMC->SetClipBox("*", 0, 2000, -2000, 2000, -2000, 16000);
446     pMC->DefaultRange();
447     pMC->Gdraw("alic", 40, 30, 0, 17.5, 10, .0019, .0019);
448   }
449   pMC->Gdhead(1111, "Experimental Hall");
450   pMC->Gdman(18, 2, "MAN");
451 }
452