]> git.uio.no Git - u/mrichter/AliRoot.git/blob - STRUCT/AliHALL.cxx
Support collar at FMD2 position.
[u/mrichter/AliRoot.git] / STRUCT / AliHALL.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 //  Experimental Hall                                                        //
21 //  This class contains the description of the experimental hall             //
22 //                                                                           //
23 //Begin_Html
24 /*
25 <img src="picts/AliHALLClass.gif">
26 </pre>
27 <br clear=left>
28 <font size=+2 color=red>
29 <p>The responsible person for this module is
30 <a href="mailto:andreas.morsch@cern.ch">Andreas Morsch</a>.
31 </font>
32 <pre>
33 */
34 //End_Html
35 //                                                                           //
36 //                                                                           //
37 ///////////////////////////////////////////////////////////////////////////////
38
39 #include <TVirtualMC.h>
40
41 #include "AliConst.h"
42 #include "AliHALL.h"
43 #include "AliMagF.h"
44 #include "AliRun.h"
45 #include "AliLog.h"
46  
47 ClassImp(AliHALL)
48  
49 //_____________________________________________________________________________
50 AliHALL::AliHALL()
51 {
52   //
53   // Default constructor for the experimental Hall
54   //
55 }
56  
57 //_____________________________________________________________________________
58 AliHALL::AliHALL(const char *name, const char *title)
59        : AliModule(name,title)
60 {
61   //
62   // Standard constructor for the experimental Hall
63   //
64   //PH  SetMarkerColor(7);
65   //PH  SetMarkerStyle(2);
66   //PH  SetMarkerSize(0.4);
67 }
68  
69 //_____________________________________________________________________________
70 void AliHALL::CreateGeometry()
71 {
72   //
73   // Create the geometry of the exprimental hall
74   //
75   //Begin_Html
76   /*
77     <img src="picts/AliHALLTree.gif">
78   */
79   //End_Html
80   //
81   // If ZDC is not present the experimental hall includes a short
82   // section of the accelerator tunnel
83   //
84   //Begin_Html
85   /*
86     <img src="picts/AliHALLSmall.gif">
87   */
88   //End_Html
89   //
90   // If ZDC is present the experimental hall includes the accelerator
91   // tunnel beyond the ZDC
92   //
93   //Begin_Html
94   /*
95     <img src="picts/AliHALLLarge.gif">
96   */
97   //End_Html
98
99   
100   Float_t r2;
101   Float_t phid, phim, pbox[3], h, r, tspar[5];
102   Float_t w1, dh, am, bm, dl,cm, hm, dr, dx, xl;
103   Int_t idrotm[1999];
104   Float_t trdpar[4], trapar[11], hullen;
105   Float_t phi;
106   
107   Int_t *idtmed = fIdtmed->GetArray()-1899;
108   
109   //     RB24/26 TUNNEL FLOOR 
110   
111   r   = 220.;
112   h   = 140.;
113   phi = TMath::ACos(h / r);
114   xl  = r * TMath::Sin(phi);
115   dr  = 1600.;
116   dh  = dr * TMath::Cos(phi);
117   dl  = dr * TMath::Sin(phi);
118   if (gAlice->GetModule("ZDC") == 0) {
119     
120     //     No ZDC 
121     hullen = 370.;
122   } else {
123     
124     //     ZDC is present 
125     hullen = 6520.;
126   }
127   trdpar[0] = xl + dl;
128   trdpar[1] = xl;
129   trdpar[2] = hullen;
130   trdpar[3] = dh / 2.;
131   AliMatrix(idrotm[1900], 90., 0., 0., 0., 90., 90.);
132   AliMatrix(idrotm[1901], 270., 0., 90., 90., 0., 0.);
133   gMC->Gsvolu("HUFL", "TRD1", idtmed[1956], trdpar, 4);
134   r2 = hullen + 1900.;
135   gMC->Gspos("HUFL", 1, "ALIC", 70.,-100-trdpar[3] , -r2, idrotm[1900], "ONLY");
136   
137   //     RB24/26 wall 
138   
139   phid     = phi * 57.296;
140   tspar[0] = r;
141   tspar[1] = r + dr;
142   tspar[2] = hullen;
143   tspar[3] = phid - 90.;
144   tspar[4] = 270. - phid;
145   gMC->Gsvolu("HUWA", "TUBS", idtmed[1956], tspar, 5);
146   gMC->Gspos("HUWA", 1, "ALIC", 70., 40., -1900 - hullen , 0, "ONLY");
147   
148
149   //     Hall floor 
150   
151   phid      = 16.197;
152   trdpar[0] = 700.;
153   trdpar[1] = TMath::Tan(phid * kDegrad) * 190. + 700.;
154   trdpar[2] = 550.;
155   trdpar[3] = 95.;
156   gMC->Gsvolu("HHF1", "TRD1", idtmed[1956], trdpar, 4);
157   gMC->Gspos("HHF1", 1, "ALIC", 0., -801., 1350., idrotm[1900], "ONLY");
158   gMC->Gspos("HHF1", 2, "ALIC", 0., -801.,-1350., idrotm[1900], "ONLY");
159   
160   //     Hall side walls 
161   
162   trapar[0] = 550.;
163   trapar[1] = 0.;
164   trapar[2] = 0.;
165   trapar[3] = 1273.78/2;
166   trapar[4] = 235.;
167   trapar[5] = 50.;
168   trapar[6] = TMath::ATan((trapar[4] - trapar[5]) / 2. / trapar[3]) * kRaddeg;
169   trapar[7] = trapar[3];
170   trapar[8] = trapar[4];
171   trapar[9] = trapar[5];
172   trapar[10] = trapar[6];
173   dx = trapar[4] * 1.5 + 700. - trapar[5] * .5;
174   gMC->Gsvolu("HHW1", "TRAP", idtmed[1956], trapar, 11);
175   gMC->Gspos("HHW1", 1, "ALIC", dx, -896+trapar[3],  1350., 0, "ONLY");
176   gMC->Gspos("HHW1", 2, "ALIC",-dx, -896+trapar[3],  1350., idrotm[1901], "ONLY");
177   gMC->Gspos("HHW1", 3, "ALIC", dx, -896+trapar[3], -1350., 0, "ONLY");
178   gMC->Gspos("HHW1", 4, "ALIC",-dx, -896+trapar[3], -1350., idrotm[1901], "ONLY");
179   pbox[0] = 50.;
180   pbox[1] = (500. - (trapar[3] * 2. - 896.)) / 2.;
181   pbox[2] = 1900.;
182   gMC->Gsvolu("HBW1", "BOX ", idtmed[1956], pbox, 3);
183   gMC->Gspos("HBW1", 1, "ALIC",  1120., 500-pbox[1], 0., 0, "ONLY");
184   gMC->Gspos("HBW1", 2, "ALIC", -1120., 500-pbox[1], 0., 0, "ONLY");
185   
186   //     slanted wall close to L3 magnet 
187   
188   phim = 45.;
189   hm   = 790.;
190   //rm   = hm / TMath::Cos(phim / 2. * kDegrad);
191   am   = hm * TMath::Tan(phim / 2. * kDegrad);
192   bm   = (hm + 76.) / hm * am;
193   cm   = bm * 2. / TMath::Sqrt(2.);
194   trapar[0] = 800.;
195   trapar[1] = 0.;
196   trapar[2] = 0.;
197   trapar[3] = (1273.78 - cm) / 2.;
198   trapar[4] = 235. - cm * TMath::Tan(phid * kDegrad) / 2.;
199   trapar[5] = 50.;
200   trapar[6] = TMath::ATan((trapar[4] - trapar[5]) / 2. / trapar[3]) * kRaddeg;
201   trapar[7] = trapar[3];
202   trapar[8] = trapar[4];
203   trapar[9] = trapar[5];
204   trapar[10] = trapar[6];
205   w1 = trapar[4];
206   dx = cm*TMath::Tan(phid * kDegrad) + 700. + trapar[4] * 1.5 - trapar[5] * .5;
207   gMC->Gsvolu("HHW2", "TRAP", idtmed[1956], trapar, 11);
208   r2 = cm - 896. + trapar[3];
209   gMC->Gspos("HHW2", 1, "ALIC", dx, r2, 0., 0, "ONLY");
210   gMC->Gspos("HHW2", 2, "ALIC",-dx, r2, 0., idrotm[1901], "ONLY");
211   trapar[3]  = cm / 2.;
212   trapar[4]  = w1 + cm / 2.;
213   trapar[5]  = w1;
214   trapar[6]  = TMath::ATan(.5) * kRaddeg;
215   trapar[7]  = trapar[3];
216   trapar[8]  = trapar[4];
217   trapar[9]  = trapar[5];
218   trapar[10] = trapar[6];
219   dx = 1170. - trapar[4] * .5 - trapar[5] * .5;
220   gMC->Gsvolu("HHW3", "TRAP", idtmed[1956], trapar, 11);
221   r2 = trapar[3] - 896.;
222   gMC->Gspos("HHW3", 1, "ALIC", dx, r2, 0., 0, "ONLY");
223   gMC->Gspos("HHW3", 2, "ALIC",-dx, r2, 0., idrotm[1901], "ONLY");
224   
225
226   tspar[0] = 1070.;
227   tspar[1] = 1170.;
228   tspar[2] = 1900.;
229   tspar[3] = 0.;
230   tspar[4] = 180.;
231   gMC->Gsvolu("HHC1", "TUBS", idtmed[1956], tspar, 5);
232   gMC->Gspos("HHC1", 1, "ALIC", 0., 500., 0., 0, "ONLY");
233   trdpar[0] = 1170 - trapar[4] * 2.;
234   trdpar[1] = trdpar[0] + TMath::Tan(phim * kDegrad) * 76.;
235   trdpar[2] = 800.;
236   trdpar[3] = 38.;
237   gMC->Gsvolu("HHF2", "TRD1", idtmed[1956], trdpar, 4);
238   gMC->Gspos("HHF2", 1, "ALIC", 0., -858., 0., idrotm[1900], "ONLY");
239   
240   //     pillars for working platform 
241   
242   pbox[0] = 40.;
243   pbox[1] = 96.;
244   pbox[2] = 550.;
245   gMC->Gsvolu("HPIL", "BOX ", idtmed[1956], pbox, 3);
246   gMC->Gspos("HPIL", 1, "ALIC", 165.,-706+pbox[1] , -1350., 0, "ONLY");
247   gMC->Gspos("HPIL", 2, "ALIC",-165.,-706+pbox[1] , -1350., 0, "ONLY");
248   
249   //     simple concrete beam shield 
250   
251   Float_t ppgon[10];
252   ppgon[0] =    45.;
253   ppgon[1] =   360.;
254   ppgon[2] =     4.;
255   ppgon[3] =     2.;
256   ppgon[7] =  1800.;
257   ppgon[8] =   150.;
258   ppgon[9] =   250.;
259   ppgon[4] =   720.;
260   ppgon[5] =   150.;
261   ppgon[6] =   250.;
262
263   gMC->Gsvolu("HMBS", "PGON", idtmed[1956], ppgon, 10);
264   gMC->Gspos("HMBS", 1, "ALIC", 0., 70., 0., 0, "ONLY");
265 }
266
267 //_____________________________________________________________________________
268 void AliHALL::CreateMaterials()
269 {
270   //
271   // Create materials for the experimental hall
272   //
273     
274   Int_t   isxfld = 0;
275   Float_t sxmgmx = gAlice->Field()->Max();
276   
277   Float_t aconc[10] = { 1.,12.01,15.994,22.99,24.305,26.98,28.086,39.1,40.08,55.85 };
278   Float_t zconc[10] = { 1.,6.,8.,11.,12.,13.,14.,19.,20.,26. };
279   Float_t wconc[10] = { .01,.001,.529107,.016,.002,.033872,.337021,.013,.044,.014 };
280   
281   Float_t aAir[4]={12.0107,14.0067,15.9994,39.948};
282   Float_t zAir[4]={6.,7.,8.,18.};
283   Float_t wAir[4]={0.000124,0.755267,0.231781,0.012827};
284   Float_t dAir = 1.20479E-3;
285
286 // Steel  
287   Float_t asteel[4] = { 55.847,51.9961,58.6934,28.0855 };
288   Float_t zsteel[4] = { 26.,24.,28.,14. };
289   Float_t wsteel[4] = { .715,.18,.1,.005 };
290
291   Float_t epsil, stmin, deemax, tmaxfd, stemax;
292
293   
294   AliMixture(15, "AIR0$      ", aAir, zAir, dAir, 4, wAir);
295   AliMixture(35, "AIR1$      ", aAir, zAir, dAir, 4, wAir);
296   AliMixture(55, "AIR2$      ", aAir, zAir, dAir, 4, wAir);
297
298   AliMixture(17, "CONCRETE0$", aconc, zconc, 2.35, 10, wconc);
299   AliMixture(37, "CONCRETE1$", aconc, zconc, 2.35, 10, wconc);
300   AliMixture(57, "CONCRETE2$", aconc, zconc, 2.35, 10, wconc);
301
302   //     Stainless Steel 
303   AliMixture(10, "STAINLESS STEEL1", asteel, zsteel, 7.88, 4, wsteel);
304   AliMixture(30, "STAINLESS STEEL2", asteel, zsteel, 7.88, 4, wsteel);
305   AliMixture(50, "STAINLESS STEEL3", asteel, zsteel, 7.88, 4, wsteel);
306   
307   // **************** 
308   //     Defines tracking media parameters. 
309   //     Les valeurs sont commentees pour laisser le defaut 
310   //     a GEANT (version 3-21, page CONS200), f.m. 
311   epsil  = .001;  // Tracking precision, 
312   stemax = -1.;   // Maximum displacement for multiple scat 
313   tmaxfd = -20.;  // Maximum angle due to field deflection 
314   deemax = -.3;   // Maximum fractional energy loss, DLS 
315   stmin  = -.8;
316   // *************** 
317   
318   //  Stainless Steel
319   AliMedium(10, "STST_C0             ", 10, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
320   AliMedium(30, "STST_C1             ", 30, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
321   AliMedium(50, "STST_C2             ", 50, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
322   
323   //    Air 
324   
325   AliMedium(15, "AIR_C0           ", 15, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
326   AliMedium(35, "AIR_C1           ", 35, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
327   AliMedium(55, "AIR_C2           ", 55, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
328   
329   //    Concrete 
330   
331   AliMedium(17, "CC_C0            ", 17, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
332   AliMedium(37, "CC_C1            ", 37, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
333   AliMedium(57, "CC_C2            ", 57, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
334 }
335
336 //_____________________________________________________________________________
337 void AliHALL::Init()
338 {
339   //
340   // Initialise the HALL after it has been built
341   //
342   Int_t i;
343   //
344   if(AliLog::GetGlobalDebugLevel()>0) {
345     printf("\n%s: ",ClassName());
346     for(i=0;i<35;i++) printf("*");
347     printf(" HALL_INIT ");
348     for(i=0;i<35;i++) printf("*");
349     printf("\n%s: ",ClassName());
350     //
351     // Here the HALL initialisation code (if any!)
352     for(i=0;i<80;i++) printf("*");
353     printf("\n");
354   }
355 }
356
357 //_____________________________________________________________________________
358 void AliHALL::DrawModule() const
359 {
360   //
361   // Draw a shaded view of Experimental Hall
362   //
363
364   // Set everything unseen
365   gMC->Gsatt("*", "seen", -1);
366   // 
367   // Set ALIC mother transparent
368   gMC->Gsatt("ALIC","SEEN",0);
369   //
370   // Set the volumes visible
371   gMC->Gsatt("HUFL","seen",1);
372   gMC->Gsatt("HUWA","seen",1);
373   gMC->Gsatt("HUP2","seen",1);
374   gMC->Gsatt("HEW1","seen",1);
375   gMC->Gsatt("HHF1","seen",1);
376   gMC->Gsatt("HHW1","seen",1);
377   gMC->Gsatt("HBW1","seen",1);
378   gMC->Gsatt("HHW2","seen",1);
379   gMC->Gsatt("HHW3","seen",1);
380   gMC->Gsatt("HHC1","seen",1);
381   gMC->Gsatt("HHF2","seen",1);
382   gMC->Gsatt("HPIL","seen",1);
383   gMC->Gsatt("HMBS","seen",1);
384   gMC->Gsatt("HBBS","seen",1);
385   gMC->Gsatt("HPBS","seen",1);
386   gMC->Gsatt("HXFI","seen",1);
387   gMC->Gsatt("HXII","seen",1);
388   //
389   gMC->Gdopt("hide", "on");
390   gMC->Gdopt("shad", "on");
391   gMC->Gsatt("*", "fill", 7);
392   gMC->SetClipBox(".");
393   if (gAlice->GetModule("ZDC") == 0) {
394     //
395     // ZDC is not present
396     //
397     gMC->SetClipBox("*", 0, 3000, -3000, 3000, -6000, 6000);
398     gMC->DefaultRange();
399     gMC->Gdraw("alic", 40, 30, 0, 12, 7.5, .005, .005);
400   } else {
401     //
402     // ZDC is present
403     //
404     gMC->SetClipBox("*", 0, 2000, -2000, 2000, -2000, 16000);
405     gMC->DefaultRange();
406     gMC->Gdraw("alic", 40, 30, 0, 17.5, 10, .0019, .0019);
407   }
408   gMC->Gdhead(1111, "Experimental Hall");
409   gMC->Gdman(18, 2, "MAN");
410 }
411