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