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