ALICE experimental hall in official ALICE physics coordinate system.
[u/mrichter/AliRoot.git] / STRUCT / AliHALL.cxx
CommitLineData
4c039060 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
eeacf08b 16/* $Id$ */
4c039060 17
fe4da5cc 18///////////////////////////////////////////////////////////////////////////////
19// //
20// Experimental Hall //
21// This class contains the description of the experimental hall //
22// //
23//Begin_Html
24/*
1439f98e 25<img src="picts/AliHALLClass.gif">
fe4da5cc 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
88cb7938 39#include <TVirtualMC.h>
40
41#include "AliConst.h"
fe4da5cc 42#include "AliHALL.h"
94de3818 43#include "AliMagF.h"
88cb7938 44#include "AliRun.h"
fe4da5cc 45
46ClassImp(AliHALL)
47
48//_____________________________________________________________________________
b8032157 49AliHALL::AliHALL()
fe4da5cc 50{
51 //
52 // Default constructor for the experimental Hall
53 //
54}
55
56//_____________________________________________________________________________
57AliHALL::AliHALL(const char *name, const char *title)
b8032157 58 : AliModule(name,title)
fe4da5cc 59{
60 //
61 // Standard constructor for the experimental Hall
62 //
63 SetMarkerColor(7);
64 SetMarkerStyle(2);
65 SetMarkerSize(0.4);
66}
67
68//_____________________________________________________________________________
fe4da5cc 69void AliHALL::CreateGeometry()
70{
71 //
72 // Create the geometry of the exprimental hall
73 //
74 //Begin_Html
75 /*
1439f98e 76 <img src="picts/AliHALLTree.gif">
fe4da5cc 77 */
78 //End_Html
79 //
80 // If ZDC is not present the experimental hall includes a short
81 // section of the accelerator tunnel
82 //
83 //Begin_Html
84 /*
1439f98e 85 <img src="picts/AliHALLSmall.gif">
fe4da5cc 86 */
87 //End_Html
88 //
89 // If ZDC is present the experimental hall includes the accelerator
90 // tunnel beyond the ZDC
91 //
92 //Begin_Html
93 /*
1439f98e 94 <img src="picts/AliHALLLarge.gif">
fe4da5cc 95 */
96 //End_Html
97
98
fe4da5cc 99 Float_t r2;
9c671c0f 100 Float_t phid, phim, pbox[3], h, r, tspar[5];
fe4da5cc 101 Float_t w1, dh, am, bm, dl,cm, hm, dr, dx, xl;
102 Int_t idrotm[1999];
103 Float_t trdpar[4], trapar[11], hullen;
60404de7 104 Float_t phi;
fe4da5cc 105
ad51aeb0 106 Int_t *idtmed = fIdtmed->GetArray()-1899;
fe4da5cc 107
fe4da5cc 108 // RB24/26 TUNNEL FLOOR
109
110 r = 220.;
111 h = 140.;
112 phi = TMath::ACos(h / r);
113 xl = r * TMath::Sin(phi);
114 dr = 100.;
115 dh = dr * TMath::Cos(phi);
116 dl = dr * TMath::Sin(phi);
b8032157 117 if (gAlice->GetModule("ZDC") == 0) {
fe4da5cc 118
119 // No ZDC
120 hullen = 250.;
121 } else {
122
123 // ZDC is present
124 hullen = 6400.;
125 }
126 trdpar[0] = xl + dl;
127 trdpar[1] = xl;
128 trdpar[2] = hullen;
129 trdpar[3] = dh / 2.;
130 AliMatrix(idrotm[1900], 90., 0., 0., 0., 90., 90.);
131 AliMatrix(idrotm[1901], 270., 0., 90., 90., 0., 0.);
cfce8870 132 gMC->Gsvolu("HUFL", "TRD1", idtmed[1956], trdpar, 4);
fe4da5cc 133 r2 = hullen + 2020.;
299e56a5 134 gMC->Gspos("HUFL", 1, "ALIC", 70.,-100-trdpar[3] , -r2, idrotm[1900], "ONLY");
fe4da5cc 135
136 // RB24/26 wall
137
138 phid = phi * 57.296;
139 tspar[0] = r;
140 tspar[1] = r + dr;
141 tspar[2] = hullen;
142 tspar[3] = phid - 90.;
143 tspar[4] = 270. - phid;
cfce8870 144 gMC->Gsvolu("HUWA", "TUBS", idtmed[1956], tspar, 5);
299e56a5 145 gMC->Gspos("HUWA", 1, "ALIC", 70., 40., -2020 - hullen , 0, "ONLY");
fe4da5cc 146
fe4da5cc 147 // END WALL
9c671c0f 148 gMC->Gsvolu("HEW1", "BOX ", idtmed[1956], pbox, 0);
149 pbox[0] = 600.;
150 pbox[1] = 418.;
fe4da5cc 151 pbox[2] = 60.;
299e56a5 152 gMC->Gsposp("HEW1", 1, "ALIC", 0., -pbox[1]-60., -1960, 0, "ONLY", pbox, 3);
9c671c0f 153 pbox[1] = 822.;
299e56a5 154 gMC->Gsposp("HEW1", 2, "ALIC", 0., pbox[1]+60., -1960, 0, "ONLY", pbox, 3);
9c671c0f 155 pbox[0] = 270.;
156 pbox[1] = 60.;
299e56a5 157 gMC->Gsposp("HEW1", 3, "ALIC", pbox[0]+60., 0. , -1960, 0, "ONLY", pbox, 3);
158 gMC->Gsposp("HEW1", 4, "ALIC", -pbox[0]-60., 0. , -1960, 0, "ONLY", pbox, 3);
9c671c0f 159
fe4da5cc 160 // hall floor
161
162 phid = 16.197;
163 trdpar[0] = 700.;
164 trdpar[1] = TMath::Tan(phid * kDegrad) * 190. + 700.;
165 trdpar[2] = 550.;
166 trdpar[3] = 95.;
cfce8870 167 gMC->Gsvolu("HHF1", "TRD1", idtmed[1956], trdpar, 4);
168 gMC->Gspos("HHF1", 1, "ALIC", 0., -801., 1350., idrotm[1900], "ONLY");
169 gMC->Gspos("HHF1", 2, "ALIC", 0., -801.,-1350., idrotm[1900], "ONLY");
fe4da5cc 170
171 // hall side walls
172
173 trapar[0] = 550.;
174 trapar[1] = 0.;
175 trapar[2] = 0.;
176 trapar[3] = 1273.78/2;
177 trapar[4] = 235.;
178 trapar[5] = 50.;
179 trapar[6] = TMath::ATan((trapar[4] - trapar[5]) / 2. / trapar[3]) * kRaddeg;
180 trapar[7] = trapar[3];
181 trapar[8] = trapar[4];
182 trapar[9] = trapar[5];
183 trapar[10] = trapar[6];
184 dx = trapar[4] * 1.5 + 700. - trapar[5] * .5;
cfce8870 185 gMC->Gsvolu("HHW1", "TRAP", idtmed[1956], trapar, 11);
186 gMC->Gspos("HHW1", 1, "ALIC", dx, -896+trapar[3], 1350., 0, "ONLY");
187 gMC->Gspos("HHW1", 2, "ALIC",-dx, -896+trapar[3], 1350., idrotm[1901], "ONLY");
188 gMC->Gspos("HHW1", 3, "ALIC", dx, -896+trapar[3], -1350., 0, "ONLY");
189 gMC->Gspos("HHW1", 4, "ALIC",-dx, -896+trapar[3], -1350., idrotm[1901], "ONLY");
fe4da5cc 190 pbox[0] = 50.;
191 pbox[1] = (500. - (trapar[3] * 2. - 896.)) / 2.;
192 pbox[2] = 1900.;
cfce8870 193 gMC->Gsvolu("HBW1", "BOX ", idtmed[1956], pbox, 3);
194 gMC->Gspos("HBW1", 1, "ALIC", 1120., 500-pbox[1], 0., 0, "ONLY");
195 gMC->Gspos("HBW1", 2, "ALIC", -1120., 500-pbox[1], 0., 0, "ONLY");
fe4da5cc 196
197 // slanted wall close to L3 magnet
198
199 phim = 45.;
200 hm = 790.;
201 //rm = hm / TMath::Cos(phim / 2. * kDegrad);
202 am = hm * TMath::Tan(phim / 2. * kDegrad);
203 bm = (hm + 76.) / hm * am;
204 cm = bm * 2. / TMath::Sqrt(2.);
205 trapar[0] = 800.;
206 trapar[1] = 0.;
207 trapar[2] = 0.;
208 trapar[3] = (1273.78 - cm) / 2.;
209 trapar[4] = 235. - cm * TMath::Tan(phid * kDegrad) / 2.;
210 trapar[5] = 50.;
211 trapar[6] = TMath::ATan((trapar[4] - trapar[5]) / 2. / trapar[3]) * kRaddeg;
212 trapar[7] = trapar[3];
213 trapar[8] = trapar[4];
214 trapar[9] = trapar[5];
215 trapar[10] = trapar[6];
216 w1 = trapar[4];
217 dx = cm*TMath::Tan(phid * kDegrad) + 700. + trapar[4] * 1.5 - trapar[5] * .5;
cfce8870 218 gMC->Gsvolu("HHW2", "TRAP", idtmed[1956], trapar, 11);
fe4da5cc 219 r2 = cm - 896. + trapar[3];
cfce8870 220 gMC->Gspos("HHW2", 1, "ALIC", dx, r2, 0., 0, "ONLY");
221 gMC->Gspos("HHW2", 2, "ALIC",-dx, r2, 0., idrotm[1901], "ONLY");
fe4da5cc 222 trapar[3] = cm / 2.;
223 trapar[4] = w1 + cm / 2.;
224 trapar[5] = w1;
225 trapar[6] = TMath::ATan(.5) * kRaddeg;
226 trapar[7] = trapar[3];
227 trapar[8] = trapar[4];
228 trapar[9] = trapar[5];
229 trapar[10] = trapar[6];
230 dx = 1170. - trapar[4] * .5 - trapar[5] * .5;
cfce8870 231 gMC->Gsvolu("HHW3", "TRAP", idtmed[1956], trapar, 11);
fe4da5cc 232 r2 = trapar[3] - 896.;
cfce8870 233 gMC->Gspos("HHW3", 1, "ALIC", dx, r2, 0., 0, "ONLY");
234 gMC->Gspos("HHW3", 2, "ALIC",-dx, r2, 0., idrotm[1901], "ONLY");
fe4da5cc 235
236
237 tspar[0] = 1070.;
238 tspar[1] = 1170.;
239 tspar[2] = 1900.;
240 tspar[3] = 0.;
241 tspar[4] = 180.;
cfce8870 242 gMC->Gsvolu("HHC1", "TUBS", idtmed[1956], tspar, 5);
243 gMC->Gspos("HHC1", 1, "ALIC", 0., 500., 0., 0, "ONLY");
fe4da5cc 244 trdpar[0] = 1170 - trapar[4] * 2.;
245 trdpar[1] = trdpar[0] + TMath::Tan(phim * kDegrad) * 76.;
246 trdpar[2] = 800.;
247 trdpar[3] = 38.;
cfce8870 248 gMC->Gsvolu("HHF2", "TRD1", idtmed[1956], trdpar, 4);
249 gMC->Gspos("HHF2", 1, "ALIC", 0., -858., 0., idrotm[1900], "ONLY");
fe4da5cc 250
251 // pillars for working platform
252
253 pbox[0] = 40.;
9b21f9d2 254 pbox[1] = 96.;
fe4da5cc 255 pbox[2] = 550.;
cfce8870 256 gMC->Gsvolu("HPIL", "BOX ", idtmed[1956], pbox, 3);
299e56a5 257 gMC->Gspos("HPIL", 1, "ALIC", 165.,-706+pbox[1] , -1350., 0, "ONLY");
258 gMC->Gspos("HPIL", 2, "ALIC",-165.,-706+pbox[1] , -1350., 0, "ONLY");
fe4da5cc 259
43707c21 260 // simple concrete beam shield
fe4da5cc 261
43707c21 262 Float_t ppgon[10];
263 ppgon[0] = 45.;
264 ppgon[1] = 360.;
265 ppgon[2] = 4.;
266 ppgon[3] = 2.;
299e56a5 267 ppgon[7] = 1800.;
43707c21 268 ppgon[8] = 150.;
269 ppgon[9] = 250.;
299e56a5 270 ppgon[4] = 720.;
271 ppgon[5] = 150.;
272 ppgon[6] = 250.;
43707c21 273
274 gMC->Gsvolu("HMBS", "PGON", idtmed[1956], ppgon, 10);
275 gMC->Gspos("HMBS", 1, "ALIC", 0., 70., 0., 0, "ONLY");
fe4da5cc 276}
277
278//_____________________________________________________________________________
279void AliHALL::CreateMaterials()
280{
281 //
282 // Create materials for the experimental hall
283 //
284
285
b43eb0dc 286 Int_t isxfld = gAlice->Field()->Integ();
287 Float_t sxmgmx = gAlice->Field()->Max();
fe4da5cc 288
289 Float_t aconc[10] = { 1.,12.01,15.994,22.99,24.305,26.98,28.086,39.1,40.08,55.85 };
290 Float_t zconc[10] = { 1.,6.,8.,11.,12.,13.,14.,19.,20.,26. };
291 Float_t wconc[10] = { .01,.001,.529107,.016,.002,.033872,.337021,.013,.044,.014 };
292
293 Float_t epsil, stmin, deemax, tmaxfd, stemax;
294
295 // FOR CONCRETE
296
297 AliMaterial(10, "IRON$ ", 55.85, 26., 7.87, 1.76, 17.1);
298 AliMaterial(30, "IRON$ ", 55.85, 26., 7.87, 1.76, 17.1);
299 AliMaterial(50, "IRON$ ", 55.85, 26., 7.87, 1.76, 17.1);
300 AliMaterial(15, "AIR$ ", 14.61, 7.3, .001205, 30423.24, 67500);
301 AliMaterial(35, "AIR$ ", 14.61, 7.3, .001205, 30423.24, 67500);
302 AliMaterial(55, "AIR$ ", 14.61, 7.3, .001205, 30423.24, 67500);
303 AliMixture(17, "CONCRETE$", aconc, zconc, 2.35, 10, wconc);
304 AliMixture(37, "CONCRETE$", aconc, zconc, 2.35, 10, wconc);
305 AliMixture(57, "CONCRETE$", aconc, zconc, 2.35, 10, wconc);
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 // IRON
319
b43eb0dc 320 AliMedium(10, "FE_C0 ", 10, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
321 AliMedium(30, "FE_C1 ", 30, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
322 AliMedium(50, "FE_C2 ", 50, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
fe4da5cc 323
324 // Air
325
b43eb0dc 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);
fe4da5cc 329
330 // Concrete
331
b43eb0dc 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);
fe4da5cc 335}
336
337//_____________________________________________________________________________
338void AliHALL::Init()
339{
340 //
341 // Initialise the HALL after it has been built
342 //
343 Int_t i;
344 //
9e1a0ddb 345 if(fDebug) {
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 }
fe4da5cc 356}
357
358//_____________________________________________________________________________
eeacf08b 359void AliHALL::DrawModule() const
fe4da5cc 360{
361 //
362 // Draw a shaded view of Experimental Hall
363 //
364
fe4da5cc 365 // Set everything unseen
cfce8870 366 gMC->Gsatt("*", "seen", -1);
fe4da5cc 367 //
368 // Set ALIC mother transparent
cfce8870 369 gMC->Gsatt("ALIC","SEEN",0);
fe4da5cc 370 //
371 // Set the volumes visible
cfce8870 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);
fe4da5cc 389 //
cfce8870 390 gMC->Gdopt("hide", "on");
391 gMC->Gdopt("shad", "on");
392 gMC->Gsatt("*", "fill", 7);
393 gMC->SetClipBox(".");
b8032157 394 if (gAlice->GetModule("ZDC") == 0) {
fe4da5cc 395 //
396 // ZDC is not present
397 //
cfce8870 398 gMC->SetClipBox("*", 0, 3000, -3000, 3000, -6000, 6000);
399 gMC->DefaultRange();
400 gMC->Gdraw("alic", 40, 30, 0, 12, 7.5, .005, .005);
fe4da5cc 401 } else {
402 //
403 // ZDC is present
404 //
cfce8870 405 gMC->SetClipBox("*", 0, 2000, -2000, 2000, -2000, 16000);
406 gMC->DefaultRange();
407 gMC->Gdraw("alic", 40, 30, 0, 17.5, 10, .0019, .0019);
fe4da5cc 408 }
cfce8870 409 gMC->Gdhead(1111, "Experimental Hall");
410 gMC->Gdman(18, 2, "MAN");
fe4da5cc 411}
412