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