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