Latest update from Prashant
[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
71//_____________________________________________________________________________
fe4da5cc 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
e7d8dedc 203 if(!strcmp(gMC->GetName(),"TGeant3")
204 || !strcmp(gMC->GetName(),"TFluka")
205 || !strcmp(gMC->GetName(),"TGeant3TGeo")) {
a00df67b 206
207 gMC->Gspos("L3O1", 1, "L3FR", 0., 30., 0., 0, "MANY");
208 gMC->Gspos("L3O2", 1, "L3IR", 0., 30., 0., 0, "MANY");
209 gMC->Gspos("L3O3", 1, "L3FX", 0., 30., 0., 0, "MANY");
210 gMC->Gspos("L3O4", 1, "L3IX", 0., 30., 0., 0, "MANY");
211
212 }
213 else {
214 gMC->Gspos("L3O1", 1, "ALIC", 0., 0., 0., 0, "MANY");
215 gMC->Gspos("L3O2", 1, "ALIC", 0., 0., 0., 0, "MANY");
216 gMC->Gsbool("L3O1", "L3DO");
217 gMC->Gsbool("L3O2", "L3DO");
218
219 gMC->Gspos("L3O3", 1, "ALIC", 0., 0., 0., idrotm[300], "MANY");
220 gMC->Gspos("L3O4", 1, "ALIC", 0., 0., 0., idrotm[300], "MANY");
221 gMC->Gsbool("L3O3", "L3DX");
222 gMC->Gsbool("L3O4", "L3DX");
223 }
fe4da5cc 224}
225
226//_____________________________________________________________________________
227void AliMAG::CreateMaterials()
228{
229 //
230 // Create materials for L3 magnet
231 //
232
b43eb0dc 233 Int_t isxfld = gAlice->Field()->Integ();
234 Float_t sxmgmx = gAlice->Field()->Max();
fe4da5cc 235 Float_t epsil, stmin, deemax, tmaxfd, stemax;
002b3738 236
237
fe4da5cc 238 // --- Define the various materials for GEANT ---
239
002b3738 240 Float_t aAir[4]={12.0107,14.0067,15.9994,39.948};
241 Float_t zAir[4]={6.,7.,8.,18.};
242 Float_t wAir[4]={0.000124,0.755267,0.231781,0.012827};
243 Float_t dAir = 1.20479E-3;
244
245
fe4da5cc 246 // Aluminum
4a9de4af 247 AliMaterial(9, "Al0$", 26.98, 13., 2.7, 8.9, 37.2);
248 AliMaterial(29, "Al1$", 26.98, 13., 2.7, 8.9, 37.2);
fe4da5cc 249
250 // Iron
4a9de4af 251 AliMaterial(10, "Fe0$", 55.85, 26., 7.87, 1.76, 17.1);
252 AliMaterial(30, "Fe1$", 55.85, 26., 7.87, 1.76, 17.1);
fe4da5cc 253
254 // Air
4a9de4af 255 AliMixture(15, "AIR0$ ", aAir, zAir, dAir, 4, wAir);
256 AliMixture(35, "AIR1$ ", aAir, zAir, dAir, 4, wAir);
fe4da5cc 257
258 // ****************
259 // Defines tracking media parameters.
260 // Les valeurs sont commentees pour laisser le defaut
261 // a GEANT (version 3-21, page CONS200), f.m.
262 epsil = .001; // Tracking precision,
263 stemax = -1.; // Maximum displacement for multiple scat
264 tmaxfd = -20.; // Maximum angle due to field deflection
265 deemax = -.3; // Maximum fractional energy loss, DLS
266 stmin = -.8;
267 // ***************
268
269 // IRON
270
b43eb0dc 271 AliMedium(10, "FE_C0 ", 10, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
272 AliMedium(30, "FE_C1 ", 30, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
fe4da5cc 273
274 // ALUMINUM
275
b43eb0dc 276 AliMedium(9, "ALU_C0 ", 9, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
277 AliMedium(29, "ALU_C1 ", 29, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
fe4da5cc 278
279 // AIR
280
b43eb0dc 281 AliMedium(15, "AIR_C0 ", 15, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
282 AliMedium(35, "AIR_C1 ", 35, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
fe4da5cc 283}
284
285//_____________________________________________________________________________
ba380e33 286void AliMAG::DrawModule() const
fe4da5cc 287{
288 //
289 // Draw a shaded view of the L3 magnet
290 //
291}
292
293//_____________________________________________________________________________
294void AliMAG::Init()
295{
296 //
297 // Initialise L3 magnet after it has been built
298 Int_t i;
299 //
4951e003 300 if(AliLog::GetGlobalDebugLevel()>0) {
9e1a0ddb 301 printf("\n%s: ",ClassName());
302 for(i=0;i<35;i++) printf("*");
303 printf(" MAG_INIT ");
304 for(i=0;i<35;i++) printf("*");
305 printf("\n%s: ",ClassName());
306 //
307 // Here the MAG initialisation code (if any!)
308 for(i=0;i<80;i++) printf("*");
309 printf("\n");
310 }
fe4da5cc 311}
312