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