Use AliPythiaRndm for Gaussian random numbers.
[u/mrichter/AliRoot.git] / STRUCT / AliMAG.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// L3 Magnet //
21// //
22//Begin_Html
23/*
1439f98e 24<img src="picts/AliMAGClass.gif">
fe4da5cc 25</pre>
26<br clear=left>
27<font size=+2 color=red>
28<p>The responsible person for this module is
29<a href="mailto:andreas.morsch@cern.ch">Andreas Morsch</a>.
30</font>
31<pre>
32*/
33//End_Html
34// //
35///////////////////////////////////////////////////////////////////////////////
36
88cb7938 37#include <TVirtualMC.h>
38
fe4da5cc 39#include "AliMAG.h"
94de3818 40#include "AliMagF.h"
88cb7938 41#include "AliRun.h"
fe4da5cc 42
43ClassImp(AliMAG)
44
45//_____________________________________________________________________________
46AliMAG::AliMAG()
47{
48 //
49 // Default constructor for L3 magnet
50 //
51}
52
53//_____________________________________________________________________________
54AliMAG::AliMAG(const char *name, const char *title)
b8032157 55 : AliModule(name,title)
fe4da5cc 56{
57 //
58 // Standard constructor for L3 magnet
59 //
60 //Begin_Html
61 /*
1439f98e 62 <img src="picts/aliMAG.gif">
fe4da5cc 63 */
64 //End_Html
65
66 SetMarkerColor(7);
67 SetMarkerStyle(2);
68 SetMarkerSize(0.4);
69}
70
fe4da5cc 71//_____________________________________________________________________________
72void AliMAG::CreateGeometry()
73{
74 //
75 // Create geometry for L3 magnet
76 //
77 //Begin_Html
78 /*
1439f98e 79 <img src="picts/mag.gif">
fe4da5cc 80 */
81 //End_Html
82 //Begin_Html
83 /*
1439f98e 84 <img src="picts/tree_mag.gif">
fe4da5cc 85 */
86 //End_Html
87
ad51aeb0 88 Int_t *idtmed = fIdtmed->GetArray()-299;
fe4da5cc 89
90 Float_t dpar[13];
91 Int_t idrotm[399];
92 Float_t par[10];
93
94 // ANGLE POLAIRE MAXIMUM
95
96 // Define Mother
97
98 par[0] = 22.5;
95bb7c88 99 par[1] = 360.;
fe4da5cc 100 par[2] = 8.;
101 par[3] = 2.;
102 par[4] = -600.;
103 par[5] = 580.;
104 par[6] = 790.;
105 par[7] = 600.;
106 par[8] = 580.;
107 par[9] = 790.;
cfce8870 108 gMC->Gsvolu("L3MO", "PGON", idtmed[334], par, 10);
109 gMC->Gspos("L3MO", 1, "ALIC", 0., -30., 0., 0, "ONLY");
fe4da5cc 110
111 // Define coils
112
113 par[5] = 585.;
114 par[6] = 690.;
115 par[8] = 585.;
116 par[9] = 690.;
cfce8870 117 gMC->Gsvolu("L3CO", "PGON", idtmed[328], par, 10);
118 gMC->Gspos("L3CO", 1, "L3MO", 0., 0., 0., 0, "ONLY");
fe4da5cc 119
120 par[5] = 580.;
121 par[6] = 585.;
122 par[8] = 580.;
123 par[9] = 585.;
cfce8870 124 gMC->Gsvolu("L3C1", "PGON", idtmed[308], par, 10);
125 gMC->Gspos("L3C1", 1, "L3MO", 0., 0., 0., 0, "ONLY");
fe4da5cc 126
127 // Define yoke
128
129 par[5] = 690.;
130 par[6] = 790.;
131 par[8] = 690.;
132 par[9] = 790.;
cfce8870 133 gMC->Gsvolu("L3YO", "PGON", idtmed[329], par, 10);
134 gMC->Gspos("L3YO", 1, "L3MO", 0., 0., 0., 0, "ONLY");
fe4da5cc 135
136 // Define the return yoke of L3 (DOOR)
137
138 par[4] = 600.;
139 par[5] = 0.;
140 par[6] = 790.;
141 par[7] = 700.;
142 par[8] = par[5];
143 par[9] = par[6];
cfce8870 144 gMC->Gsvolu("L3DO", "PGON", idtmed[334], par, 10);
a00df67b 145 gMC->Gsvolu("L3DX", "PGON", idtmed[334], par, 10);
fe4da5cc 146
147 par[4] = 610.;
148 par[5] = 0.;
149 par[6] = 790.;
150 par[7] = 700.;
151 par[8] = par[5];
152 par[9] = par[6];
cfce8870 153 gMC->Gsvolu("L3FR", "PGON", idtmed[329], par, 10);
a00df67b 154 gMC->Gsvolu("L3FX", "PGON", idtmed[329], par, 10);
fe4da5cc 155
156 // INNER LAYER
157
158 par[4] = 600.;
159 par[7] = 610.;
cfce8870 160 gMC->Gsvolu("L3IR", "PGON", idtmed[309], par, 10);
a00df67b 161 gMC->Gsvolu("L3IX", "PGON", idtmed[309], par, 10);
fe4da5cc 162
163 // DOOR OPENING
164
165 dpar[0] = 22.5;
95bb7c88 166 dpar[1] = 360;
fe4da5cc 167 dpar[2] = 8.;
168 dpar[3] = 3.;
169 dpar[4] = 610.;
170 dpar[5] = 0.;
171 dpar[6] = 163.5;
172 dpar[7] = 670.;
173 dpar[8] = dpar[5];
174 dpar[9] = dpar[6];
175 dpar[10] = 700.;
176 dpar[11] = dpar[5];
177 dpar[12] = dpar[6] + 50.;
cfce8870 178 gMC->Gsvolu("L3O1", "PGON", idtmed[314], dpar, 13);
a00df67b 179 gMC->Gsvolu("L3O3", "PGON", idtmed[314], dpar, 13);
fe4da5cc 180 par[4] = 600.;
181 par[5] = 0.;
182 par[6] = 163.5;
183 par[7] = 610.;
184 par[8] = 0.;
185 par[9] = 163.5;
cfce8870 186 gMC->Gsvolu("L3O2", "PGON", idtmed[314], par, 10);
a00df67b 187 gMC->Gsvolu("L3O4", "PGON", idtmed[314], par, 10);
fe4da5cc 188
189 // THE DOOR OPENING HAS TO BE PLACED WITH 'MANY' SINCE THE REGION
190 // WILL CONTAIN A MUON CHAMBER, BEAM PIPE AND BEAM SHIELD
191 // PLACED WITH 'ONLY'.
192
a00df67b 193 AliMatrix(idrotm[300], 90., 0., 90., 90., 180., 0.);
194
195 gMC->Gspos("L3DO", 1, "ALIC", 0., -30., 0., 0, "MANY");
cfce8870 196 gMC->Gspos("L3FR", 1, "L3DO", 0., 0., 0., 0, "MANY");
197 gMC->Gspos("L3IR", 1, "L3DO", 0., 0., 0., 0, "MANY");
fe4da5cc 198
a00df67b 199 gMC->Gspos("L3DX", 1, "ALIC", 0., -30., 0., idrotm[300], "MANY");
200 gMC->Gspos("L3FX", 1, "L3DX", 0., 0., 0., 0, "MANY");
201 gMC->Gspos("L3IX", 1, "L3DX", 0., 0., 0., 0, "MANY");
202
ad3762d0 203 if(!strcmp(gMC->GetName(),"TGeant3")) {
a00df67b 204
205 gMC->Gspos("L3O1", 1, "L3FR", 0., 30., 0., 0, "MANY");
206 gMC->Gspos("L3O2", 1, "L3IR", 0., 30., 0., 0, "MANY");
207 gMC->Gspos("L3O3", 1, "L3FX", 0., 30., 0., 0, "MANY");
208 gMC->Gspos("L3O4", 1, "L3IX", 0., 30., 0., 0, "MANY");
209
210 }
211 else {
212 gMC->Gspos("L3O1", 1, "ALIC", 0., 0., 0., 0, "MANY");
213 gMC->Gspos("L3O2", 1, "ALIC", 0., 0., 0., 0, "MANY");
214 gMC->Gsbool("L3O1", "L3DO");
215 gMC->Gsbool("L3O2", "L3DO");
216
217 gMC->Gspos("L3O3", 1, "ALIC", 0., 0., 0., idrotm[300], "MANY");
218 gMC->Gspos("L3O4", 1, "ALIC", 0., 0., 0., idrotm[300], "MANY");
219 gMC->Gsbool("L3O3", "L3DX");
220 gMC->Gsbool("L3O4", "L3DX");
221 }
fe4da5cc 222}
223
224//_____________________________________________________________________________
225void AliMAG::CreateMaterials()
226{
227 //
228 // Create materials for L3 magnet
229 //
230
b43eb0dc 231 Int_t isxfld = gAlice->Field()->Integ();
232 Float_t sxmgmx = gAlice->Field()->Max();
fe4da5cc 233
234 Float_t epsil, stmin, deemax, tmaxfd, stemax;
235 // --- Define the various materials for GEANT ---
236
237 // Aluminum
238 AliMaterial(9, "Al$", 26.98, 13., 2.7, 8.9, 37.2);
239 AliMaterial(29, "Al$", 26.98, 13., 2.7, 8.9, 37.2);
240
241 // Iron
242 AliMaterial(10, "Fe$", 55.85, 26., 7.87, 1.76, 17.1);
243 AliMaterial(30, "Fe$", 55.85, 26., 7.87, 1.76, 17.1);
244
245 // Air
246 AliMaterial(15, "Air$", 14.61, 7.3, .001205, 30420., 67500);
247 AliMaterial(35, "Air$", 14.61, 7.3, .001205, 30420., 67500);
248
249 // ****************
250 // Defines tracking media parameters.
251 // Les valeurs sont commentees pour laisser le defaut
252 // a GEANT (version 3-21, page CONS200), f.m.
253 epsil = .001; // Tracking precision,
254 stemax = -1.; // Maximum displacement for multiple scat
255 tmaxfd = -20.; // Maximum angle due to field deflection
256 deemax = -.3; // Maximum fractional energy loss, DLS
257 stmin = -.8;
258 // ***************
259
260 // IRON
261
b43eb0dc 262 AliMedium(10, "FE_C0 ", 10, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
263 AliMedium(30, "FE_C1 ", 30, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
fe4da5cc 264
265 // ALUMINUM
266
b43eb0dc 267 AliMedium(9, "ALU_C0 ", 9, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
268 AliMedium(29, "ALU_C1 ", 29, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
fe4da5cc 269
270 // AIR
271
b43eb0dc 272 AliMedium(15, "AIR_C0 ", 15, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
273 AliMedium(35, "AIR_C1 ", 35, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
fe4da5cc 274}
275
276//_____________________________________________________________________________
b8032157 277void AliMAG::DrawModule()
fe4da5cc 278{
279 //
280 // Draw a shaded view of the L3 magnet
281 //
282}
283
284//_____________________________________________________________________________
285void AliMAG::Init()
286{
287 //
288 // Initialise L3 magnet after it has been built
289 Int_t i;
290 //
9e1a0ddb 291 if(fDebug) {
292 printf("\n%s: ",ClassName());
293 for(i=0;i<35;i++) printf("*");
294 printf(" MAG_INIT ");
295 for(i=0;i<35;i++) printf("*");
296 printf("\n%s: ",ClassName());
297 //
298 // Here the MAG initialisation code (if any!)
299 for(i=0;i<80;i++) printf("*");
300 printf("\n");
301 }
fe4da5cc 302}
303