]> git.uio.no Git - u/mrichter/AliRoot.git/blame_incremental - STRUCT/AliMAG.cxx
silvermy@ornl.gov - rewrite of EMCAL preprocessor to use AliEMCALSensorTempArray...
[u/mrichter/AliRoot.git] / STRUCT / AliMAG.cxx
... / ...
CommitLineData
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/* $Id$ */
17
18///////////////////////////////////////////////////////////////////////////////
19// //
20// L3 Magnet //
21// //
22//Begin_Html
23/*
24<img src="picts/AliMAGClass.gif">
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*/
34//End_Html
35// //
36///////////////////////////////////////////////////////////////////////////////
37
38#include <TVirtualMC.h>
39#include <TGeoMedium.h>
40#include <TGeoVolume.h>
41#include <TGeoMatrix.h>
42#include <TGeoPgon.h>
43#include <TGeoXtru.h>
44#include <TGeoCompositeShape.h>
45#include <TGeoManager.h>
46
47#include "AliMAG.h"
48#include "AliMagF.h"
49#include "AliRun.h"
50
51ClassImp(AliMAG)
52
53//_____________________________________________________________________________
54AliMAG::AliMAG()
55{
56 //
57 // Default constructor for L3 magnet
58 //
59}
60
61//_____________________________________________________________________________
62AliMAG::AliMAG(const char *name, const char *title)
63 : AliModule(name,title)
64{
65 //
66 // Standard constructor for L3 magnet
67 //
68 //Begin_Html
69 /*
70 <img src="picts/aliMAG.gif">
71 */
72 //End_Html
73
74 //PH SetMarkerColor(7);
75 //PH SetMarkerStyle(2);
76 //PH SetMarkerSize(0.4);
77}
78
79//_____________________________________________________________________________
80void AliMAG::CreateGeometry()
81{
82 //
83 // Create geometry for L3 magnet
84 //
85 //Begin_Html
86 /*
87 <img src="picts/mag.gif">
88 */
89 //End_Html
90
91 //Begin_Html
92 /*
93 <img src="picts/tree_mag.gif">
94 <br> Dimensions taken from drawing: ALIL3___00010
95 //End_Html
96 */
97// Octagon
98 const Int_t kNSides = 8;
99 const Float_t kStartAngle = 22.5; // deg
100 const Float_t kFullAngle = 360.0; // deg
101// Mother volume
102 const Float_t kRBMotherInner = 560.00; // cm
103 const Float_t kRBMotherOuter = 790.50; // cm
104 const Float_t kLBMother = 706.00; // cm
105// Yoke
106 const Float_t kRYokeInner = 703.50; // cm
107 const Float_t kRYokeOuter = 790.50; // cm
108 const Float_t kLYoke = 620.00; // cm
109// Coil
110 const Float_t kRCoilInner = 593.00; // cm
111 const Float_t kRCoilOuter = 682.00; // cm
112 const Float_t kLCoil = 588.00; // cm
113// Cooling
114 const Float_t kRCoolingOuter = 1.70; // cm
115 const Float_t kRCoolingInner = 1.00; // cm
116// Thermal Shield
117 const Float_t kRThermalShieldInner = 566.00; // cm
118 const Float_t kRThermalShieldOuter = 571.00; // cm
119// Crown
120 const Float_t kRCrownInner = 560.00; // cm
121 const Float_t kRCrownOuter = 785.50; // cm
122 const Float_t kLCrown1 = 605.00; // cm
123 const Float_t kLCrown2 = 620.00; // cm
124 const Float_t kLCrown3 = 706.00; // cm
125// Door
126 const Float_t kRDoorOuter = 560.00; // cm
127 const Float_t kRPlugInner = 183.50; // cm
128 const Float_t kLDoor1 = 615.50; // cm
129 const Float_t kLDoor2 = 714.60; // cm
130//
131 const Float_t kDegRad = TMath::Pi()/180.;
132
133
134 //
135 // Top volume
136 TGeoVolume* top = gGeoManager->GetVolume("ALIC");
137 // Media
138 TGeoMedium* medAir = gGeoManager->GetMedium("MAG_AIR_C1");
139 TGeoMedium* medAlu = gGeoManager->GetMedium("MAG_ALU_C1");
140 TGeoMedium* medAluI = gGeoManager->GetMedium("MAG_ALU_C0");
141 TGeoMedium* medSteel = gGeoManager->GetMedium("MAG_ST_C1");
142 TGeoMedium* medWater = gGeoManager->GetMedium("MAG_WATER");
143 //
144 // Offset between LHC and LEP axis
145 Float_t os = -30.;
146
147 //
148 // Define Barrel Mother
149 //
150 TGeoPgon* shBMother = new TGeoPgon(kStartAngle, kFullAngle, kNSides, 2);
151 shBMother->DefineSection(0, -kLBMother, kRBMotherInner, kRBMotherOuter);
152 shBMother->DefineSection(1, kLBMother, kRBMotherInner, kRBMotherOuter);
153 //
154 TGeoVolume* voBMother = new TGeoVolume("L3BM", shBMother, medAir);
155 //
156 // Define Thermal Shield
157 //
158 // Only one layer
159 // This can be improved: replace by (protection - shield - insulation) !
160 //
161 TGeoPgon* shThermSh = new TGeoPgon(kStartAngle, kFullAngle, kNSides, 2);
162 shThermSh->DefineSection(0, -kLCoil, kRThermalShieldInner, kRThermalShieldOuter);
163 shThermSh->DefineSection(1, kLCoil, kRThermalShieldInner, kRThermalShieldOuter);
164 //
165 TGeoVolume* voThermSh = new TGeoVolume("L3TS", shThermSh, medAluI);
166 voBMother->AddNode(voThermSh, 1, new TGeoTranslation(0., 0., 0.));
167 //
168 // Define Coils and cooling circuits
169 //
170 TGeoPgon* shCoilMother = new TGeoPgon(kStartAngle, kFullAngle, kNSides, 2);
171 shCoilMother->DefineSection(0, -kLCoil, kRCoilInner - 2. * kRCoolingOuter, kRCoilOuter + 2. * kRCoolingOuter);
172 shCoilMother->DefineSection(1, kLCoil, kRCoilInner - 2. * kRCoolingOuter, kRCoilOuter + 2. * kRCoolingOuter);
173 //
174 // Coils
175 TGeoVolume* voCoilMother = new TGeoVolume("L3CM", shCoilMother, medAir);
176 voBMother->AddNode(voCoilMother, 1, new TGeoTranslation(0., 0., 0.));
177 // Devide into the 168 turns
178 TGeoVolume* voCoilTurn = voCoilMother->Divide("L3CD", 3, 168, 0., 0.);
179 TGeoPgon* shCoils = new TGeoPgon(kStartAngle, kFullAngle, kNSides, 2);
180 shCoils->DefineSection(0, -3., kRCoilInner, kRCoilOuter);
181 shCoils->DefineSection(1, 3., kRCoilInner, kRCoilOuter);
182 //
183 TGeoVolume* voCoils = new TGeoVolume("L3C0", shCoils, medAlu);
184 voCoilTurn->AddNode(voCoils, 1, new TGeoTranslation(0., 0., 0.));
185 //
186 // Hexagonal Cooling circuits
187 //
188 const Float_t kRCC = kRCoolingOuter;
189 const Float_t kRCW = kRCoolingInner;
190 const Float_t kRCL = kRCC * TMath::Tan(30. / 180. * TMath::Pi());
191 const Float_t kRWL = kRCW * TMath::Tan(30. / 180. * TMath::Pi());
192 // Outer Circuits
193 //
194 // Pipe
195 TGeoPgon* shCoolingPipeO = new TGeoPgon(kStartAngle, kFullAngle, kNSides, 4);
196 shCoolingPipeO->DefineSection(0, -kRCC, kRCoilOuter + kRCC, kRCoilOuter + kRCC + 0.01);
197 shCoolingPipeO->DefineSection(1, -kRCL, kRCoilOuter, kRCoilOuter + 2. * kRCC);
198 shCoolingPipeO->DefineSection(2, kRCL, kRCoilOuter, kRCoilOuter + 2. * kRCC);
199 shCoolingPipeO->DefineSection(3, kRCC, kRCoilOuter + kRCC, kRCoilOuter + kRCC + 0.01);
200 //
201 TGeoVolume* voCoolingPipeO = new TGeoVolume("L3CCO", shCoolingPipeO, medAlu);
202 voCoilTurn->AddNode(voCoolingPipeO, 1, new TGeoTranslation(0., 0., 0.));
203 //
204 TGeoPgon* shCoolingWaterO = new TGeoPgon(kStartAngle, kFullAngle, kNSides, 4);
205 shCoolingWaterO->DefineSection(0, -kRCW, kRCoilOuter + kRCC, kRCoilOuter + kRCC + 0.01);
206 shCoolingWaterO->DefineSection(1, -kRWL, kRCoilOuter + (kRCC - kRCW), kRCoilOuter + kRCC + kRCW);
207 shCoolingWaterO->DefineSection(2, kRWL, kRCoilOuter + (kRCC - kRCW), kRCoilOuter + kRCC + kRCW);
208 shCoolingWaterO->DefineSection(3, kRCW, kRCoilOuter + kRCC, kRCoilOuter + kRCC + 0.01);
209 //
210 TGeoVolume* voCoolingWaterO = new TGeoVolume("L3CWO", shCoolingWaterO, medWater);
211 voCoolingPipeO->AddNode(voCoolingWaterO, 1, new TGeoTranslation(0., 0., 0.));
212
213 // Inner Circuits
214 //
215 // Pipe
216 TGeoPgon* shCoolingPipeI = new TGeoPgon(kStartAngle, kFullAngle, kNSides, 4);
217 shCoolingPipeI->DefineSection(0, -kRCC, kRCoilInner - kRCC, kRCoilInner - kRCC + 0.01);
218 shCoolingPipeI->DefineSection(1, -kRCL, kRCoilInner - 2. * kRCC, kRCoilInner);
219 shCoolingPipeI->DefineSection(2, kRCL, kRCoilInner - 2. * kRCC, kRCoilInner);
220 shCoolingPipeI->DefineSection(3, kRCC, kRCoilInner - kRCC, kRCoilInner - kRCC + 0.01);
221 //
222 TGeoVolume* voCoolingPipeI = new TGeoVolume("L3CCI", shCoolingPipeI, medAlu);
223 voCoilTurn->AddNode(voCoolingPipeI, 1, new TGeoTranslation(0., 0., 0.));
224 //
225 TGeoPgon* shCoolingWaterI = new TGeoPgon(kStartAngle, kFullAngle, kNSides, 4);
226 shCoolingWaterI->DefineSection(0, -kRCW, kRCoilInner - kRCC, kRCoilInner - kRCC + 0.01);
227 shCoolingWaterI->DefineSection(1, -kRWL, kRCoilInner - kRCC - kRCW, kRCoilInner - (kRCC - kRCW));
228 shCoolingWaterI->DefineSection(2, kRWL, kRCoilInner - kRCC - kRCW, kRCoilInner - (kRCC - kRCW));
229 shCoolingWaterI->DefineSection(3, kRCW, kRCoilInner - kRCC, kRCoilInner - kRCC + 0.01);
230 //
231 TGeoVolume* voCoolingWaterI = new TGeoVolume("L3CWI", shCoolingWaterI, medWater);
232 voCoolingPipeI->AddNode(voCoolingWaterI, 1, new TGeoTranslation(0., 0., 0.));
233
234 //
235 // Define Yoke
236 //
237 TGeoPgon* shYoke = new TGeoPgon(kStartAngle, kFullAngle, kNSides, 2);
238 shYoke->DefineSection(0, -kLYoke, kRYokeInner, kRYokeOuter);
239 shYoke->DefineSection(1, +kLYoke, kRYokeInner, kRYokeOuter);
240 //
241 TGeoVolume* voYoke = new TGeoVolume("L3YO", shYoke, medSteel);
242 voBMother->AddNode(voYoke, 1, new TGeoTranslation(0., 0., 0.));
243
244 //
245 // Define Crown
246 //
247 TGeoPgon* shCrown = new TGeoPgon(kStartAngle, kFullAngle, kNSides, 4);
248 shCrown->DefineSection(0, kLCrown1, kRCrownInner, kRYokeInner);
249 shCrown->DefineSection(1, kLCrown2, kRCrownInner, kRYokeInner);
250 shCrown->DefineSection(2, kLCrown2, kRCrownInner, kRCrownOuter);
251 shCrown->DefineSection(3, kLCrown3, kRCrownInner, kRCrownOuter);
252 //
253 TGeoVolume* voCrown = new TGeoVolume("L3CR", shCrown, medSteel);
254
255 //
256 // Door including "Plug"
257 //
258 Float_t slo = 2. * kRDoorOuter * TMath::Tan(22.5 * kDegRad);
259 Float_t sli = 2. * kRPlugInner * TMath::Tan(22.5 * kDegRad);
260 Double_t xpol1[12], xpol2[12], ypol1[12], ypol2[12];
261
262 xpol1[ 0] = 2. ; ypol1[ 0] = kRDoorOuter;
263 xpol1[ 1] = slo/2. ; ypol1[ 1] = kRDoorOuter;
264 xpol1[ 2] = kRDoorOuter; ypol1[ 2] = slo/2.;
265 xpol1[ 3] = kRDoorOuter; ypol1[ 3] = -slo/2.;
266 xpol1[ 4] = slo/2. ; ypol1[ 4] = -kRDoorOuter;
267 xpol1[ 5] = 2. ; ypol1[ 5] = -kRDoorOuter;
268 xpol1[ 6] = 2. ; ypol1[ 6] = -kRPlugInner - os;
269 xpol1[ 7] = sli/2. ; ypol1[ 7] = -kRPlugInner - os;
270 xpol1[ 8] = kRPlugInner; ypol1[ 8] = -sli/2. - os;
271 xpol1[ 9] = kRPlugInner; ypol1[ 9] = sli/2. - os;
272 xpol1[10] = sli/2. ; ypol1[10] = kRPlugInner - os;
273 xpol1[11] = 2. ; ypol1[11] = kRPlugInner - os;
274
275 TGeoXtru* shL3DoorR = new TGeoXtru(2);
276 shL3DoorR->DefinePolygon(12, xpol1, ypol1);
277 shL3DoorR->DefineSection(0, kLDoor1);
278 shL3DoorR->DefineSection(1, kLDoor2);
279 TGeoVolume* voL3DoorR = new TGeoVolume("L3DoorR", shL3DoorR, medSteel);
280
281 for (Int_t i = 0; i < 12; i++) {
282 xpol2[i] = - xpol1[11 - i];
283 ypol2[i] = ypol1[11 - i];
284 }
285
286 TGeoXtru* shL3DoorL = new TGeoXtru(2);
287 shL3DoorL->DefinePolygon(12, xpol2, ypol2);
288 shL3DoorL->DefineSection(0, kLDoor1);
289 shL3DoorL->DefineSection(1, kLDoor2);
290 TGeoVolume* voL3DoorL = new TGeoVolume("L3DoorL", shL3DoorL, medSteel);
291 //
292 // Plug support plate
293 //
294 Float_t ro = kRPlugInner + 50.;
295 slo = 2. * ro * TMath::Tan(22.5 * kDegRad);
296
297 xpol1[ 0] = 2. ; ypol1[ 0] = ro - os;
298 xpol1[ 1] = slo/2. ; ypol1[ 1] = ro - os;
299 xpol1[ 2] = ro ; ypol1[ 2] = slo/2. - os;
300 xpol1[ 3] = ro ; ypol1[ 3] = -slo/2.- os;
301 xpol1[ 4] = slo/2. ; ypol1[ 4] = -ro - os;
302 xpol1[ 5] = 2. ; ypol1[ 5] = -ro - os;
303
304 for (Int_t i = 0; i < 12; i++) {
305 xpol2[i] = - xpol1[11 - i];
306 ypol2[i] = ypol1[11 - i];
307 }
308
309
310 TGeoXtru* shL3PlugSPR = new TGeoXtru(2);
311 shL3PlugSPR->DefinePolygon(12, xpol1, ypol1);
312 shL3PlugSPR->DefineSection(0, kLDoor1-10.);
313 shL3PlugSPR->DefineSection(1, kLDoor1);
314 TGeoVolume* voL3PlugSPR = new TGeoVolume("L3PlugSPR", shL3PlugSPR, medSteel);
315
316 TGeoXtru* shL3PlugSPL = new TGeoXtru(2);
317 shL3PlugSPL->DefinePolygon(12, xpol2, ypol2);
318 shL3PlugSPL->DefineSection(0, kLDoor1-10.);
319 shL3PlugSPL->DefineSection(1, kLDoor1);
320 TGeoVolume* voL3PlugSPL = new TGeoVolume("L3PlugSPL", shL3PlugSPL, medSteel);
321
322
323 // Position crown and door
324 TGeoRotation* rotxz = new TGeoRotation("rotxz", 90., 0., 90., 90., 180., 0.);
325
326 TGeoVolumeAssembly *l3 = new TGeoVolumeAssembly("L3MO");
327 voBMother->AddNode(voCrown, 1, new TGeoTranslation(0., 0., 0.));
328 voBMother->AddNode(voCrown, 2, new TGeoCombiTrans(0., 0., 0., rotxz));
329 l3->AddNode(voBMother, 1, new TGeoTranslation(0.,0.,0.));
330 l3->AddNode(voL3DoorR, 1, new TGeoTranslation(0., 0., 0.));
331 l3->AddNode(voL3DoorR, 2, new TGeoCombiTrans(0., 0., 0., rotxz));
332 l3->AddNode(voL3DoorL, 1, new TGeoTranslation(0., 0., 0.));
333 l3->AddNode(voL3DoorL, 2, new TGeoCombiTrans(0., 0., 0., rotxz));
334 l3->AddNode(voL3PlugSPR, 1, new TGeoTranslation(0., 0., 0.));
335 l3->AddNode(voL3PlugSPR, 2, new TGeoCombiTrans(0., 0., 0., rotxz));
336 l3->AddNode(voL3PlugSPL, 1, new TGeoTranslation(0., 0., 0.));
337 l3->AddNode(voL3PlugSPL, 2, new TGeoCombiTrans(0., 0., 0., rotxz));
338 top->AddNode(l3, 1, new TGeoTranslation(0., os, 0.));
339}
340
341//_____________________________________________________________________________
342void AliMAG::CreateMaterials()
343{
344 //
345 // Create materials for L3 magnet
346 //
347
348 Int_t isxfld = gAlice->Field()->Integ();
349 Float_t sxmgmx = gAlice->Field()->Max();
350 Float_t epsil, stmin, deemax, tmaxfd, stemax;
351
352
353 // --- Define the various materials for GEANT ---
354 // Steel
355 Float_t asteel[4] = { 55.847,51.9961,58.6934,28.0855 };
356 Float_t zsteel[4] = { 26.,24.,28.,14. };
357 Float_t wsteel[4] = { .715,.18,.1,.005 };
358 Float_t aAir[4]={12.0107,14.0067,15.9994,39.948};
359 Float_t zAir[4]={6.,7.,8.,18.};
360 Float_t wAir[4]={0.000124,0.755267,0.231781,0.012827};
361 Float_t dAir = 1.20479E-3;
362 Float_t aWater[2]={1.00794,15.9994};
363 Float_t zWater[2]={1.,8.};
364 Float_t wWater[2]={0.111894,0.888106};
365
366
367 // Aluminum
368 AliMaterial(9, "Al0$", 26.98, 13., 2.7, 8.9, 37.2);
369 AliMaterial(29, "Al1$", 26.98, 13., 2.7, 8.9, 37.2);
370
371 // Stainless Steel
372 AliMixture(19, "STAINLESS STEEL1", asteel, zsteel, 7.88, 4, wsteel);
373 AliMixture(39, "STAINLESS STEEL2", asteel, zsteel, 7.88, 4, wsteel);
374 AliMixture(59, "STAINLESS STEEL3", asteel, zsteel, 7.88, 4, wsteel);
375 // Iron
376 AliMaterial(10, "Fe0$", 55.85, 26., 7.87, 1.76, 17.1);
377 AliMaterial(30, "Fe1$", 55.85, 26., 7.87, 1.76, 17.1);
378
379 // Air
380 AliMixture(15, "AIR0$ ", aAir, zAir, dAir, 4, wAir);
381 AliMixture(35, "AIR1$ ", aAir, zAir, dAir, 4, wAir);
382 // Water
383 AliMixture(16, "WATER", aWater, zWater, 1., 2, wWater);
384
385
386 // ****************
387 // Defines tracking media parameters.
388 // Les valeurs sont commentees pour laisser le defaut
389 // a GEANT (version 3-21, page CONS200), f.m.
390 epsil = .001; // Tracking precision,
391 stemax = -1.; // Maximum displacement for multiple scat
392 tmaxfd = -20.; // Maximum angle due to field deflection
393 deemax = -.3; // Maximum fractional energy loss, DLS
394 stmin = -.8;
395 // ***************
396
397 // IRON
398
399 AliMedium(10, "FE_C0 ", 10, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
400 AliMedium(30, "FE_C1 ", 30, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
401
402 // ALUMINUM
403
404 AliMedium(9, "ALU_C0 ", 9, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
405 AliMedium(29, "ALU_C1 ", 29, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
406
407 // AIR
408
409 AliMedium(15, "AIR_C0 ", 15, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
410 AliMedium(35, "AIR_C1 ", 35, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
411 // Steel
412 AliMedium(19, "ST_C0 ", 19, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
413 AliMedium(39, "ST_C1 ", 39, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
414 AliMedium(59, "ST_C3 ", 59, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
415 // WATER
416 AliMedium(16, "WATER ", 16, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
417}
418
419//_____________________________________________________________________________
420void AliMAG::DrawModule() const
421{
422 //
423 // Draw a shaded view of the L3 magnet
424 //
425}
426
427//_____________________________________________________________________________
428void AliMAG::Init()
429{
430 //
431 // Initialise L3 magnet after it has been built
432 Int_t i;
433 //
434 if(AliLog::GetGlobalDebugLevel()>0) {
435 printf("\n%s: ",ClassName());
436 for(i=0;i<35;i++) printf("*");
437 printf(" MAG_INIT ");
438 for(i=0;i<35;i++) printf("*");
439 printf("\n%s: ",ClassName());
440 //
441 // Here the MAG initialisation code (if any!)
442 for(i=0;i<80;i++) printf("*");
443 printf("\n");
444 }
445}
446