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