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