Muon dipole geometry as built.
[u/mrichter/AliRoot.git] / STRUCT / AliDIPOv3.cxx
CommitLineData
7778505e 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#include <TVirtualMC.h>
19#include <TGeoManager.h>
20#include <TGeoVolume.h>
21#include <TGeoMedium.h>
22#include <TGeoMatrix.h>
23#include <TGeoBBox.h>
24#include <TGeoTube.h>
25#include <TGeoCone.h>
26#include <TGeoPcon.h>
27
28#include "AliConst.h"
29#include "AliDIPOv3.h"
30#include "AliMagF.h"
31#include "AliRun.h"
32
33ClassImp(AliDIPOv3)
34
35//_____________________________________________________________________________
36AliDIPOv3::AliDIPOv3()
37{
38 //
39 // Last design of magnetic dipole version 2
40 //
41}
42
43//_____________________________________________________________________________
44AliDIPOv3::AliDIPOv3(const char *name, const char *title)
45 : AliDIPOv2(name,title)
46{
47 //
48 // Standard constructor for the magnetic dipole version 2
49}
50
51
52//_____________________________________________________________________________
53void AliDIPOv3::CreateSpectrometerDipole()
54{
55// Detailed dipole geometry as built
56//
57//
58// The top volume
59//
60 TGeoVolume* top = gGeoManager->GetVolume("ALIC");
61//
62// Media
63//
64 TGeoMedium* kMedSteel = gGeoManager->GetMedium("DIPO_ST_C3");
65 TGeoMedium* kMedCoil = gGeoManager->GetMedium("DIPO_Coil_C1");
66 TGeoMedium* kMedCoilSh = gGeoManager->GetMedium("DIPO_Coil_C3");
67 TGeoMedium* kMedCable = gGeoManager->GetMedium("DIPO_ALU_C2");
68 TGeoMedium* kMedAlu = gGeoManager->GetMedium("DIPO_ALU_C2");
69 TGeoMedium* kMedAir = gGeoManager->GetMedium("DIPO_AIR_MUON");
70//
71// Rotations
72//
73 TGeoRotation* rotxz = new TGeoRotation("rotxz", 90., 0., 90., 90., 180., 0.);
74 TGeoRotation* rotxz108 = new TGeoRotation("rotxz108", 90., 108., 90., 198., 180., 0.);
75 TGeoRotation* rotxz180 = new TGeoRotation("rotxz180", 90., 180., 90., 270., 180., 0.);
76 TGeoRotation* rotxz288 = new TGeoRotation("rotxz288", 90., 288., 90., 18., 180., 0.);
77
78 TGeoRotation* rotxy180 = new TGeoRotation("rotxy180", 90., 180., 90., 270., 0., 0.);
79 TGeoRotation* rotxy108 = new TGeoRotation("rotxy108", 90., 108., 90., 198., 0., 0.);
80 TGeoRotation* rotxy288 = new TGeoRotation("rotxy288", 90., 288., 90., 18., 0., 0.);
81
82 TGeoRotation* rot00 = new TGeoRotation("rot00", 180., 0., 90., 151., 90., 61.);
83 TGeoRotation* rot01 = new TGeoRotation("rot01", 180., 0., 90., 29.,- 90., -61.);
84 TGeoRotation* rot02 = new TGeoRotation("rot02", 0., 0., 90., 151., 90., 61.);
85 TGeoRotation* rot03 = new TGeoRotation("rot03", 0., 0., 90., 29.,- 90., -61.);
86 TGeoRotation* rot04 = new TGeoRotation("rot04", 90., 61., 90., 151., 0., 0.);
87 TGeoRotation* rot05 = new TGeoRotation("rot05", 90., -61., 90.,-151., 0., 0.);
88 TGeoRotation* rot06 = new TGeoRotation("rot06", 90., 119., 90., 209., 0., 0.);
89 TGeoRotation* rot07 = new TGeoRotation("rot07", 90.,-119., 90.,-209., 0., 0.);
90
91 const Float_t kZDipole = 975.;
92 Float_t dx, dy, dz;
93 //
94 // Mother volume
95 TGeoPcon* shDDIP = new TGeoPcon(0., 360., 4);
96 shDDIP->DefineSection(0, -250.55, 30.1, 570.);
97 shDDIP->DefineSection(1, 37.00, 30.1, 570.);
98 shDDIP->DefineSection(2, 37.00, ( 37.00 + kZDipole) * TMath::Tan(2. * kDegrad), 570.);
99 shDDIP->DefineSection(3, 260.55, (250.55 + kZDipole) * TMath::Tan(2. * kDegrad), 570.);
100 TGeoVolume* voDDIP = new TGeoVolume("DDIP", shDDIP, kMedAir);
101//
102// Yoke
103//
104 Float_t yokeLength = 309.4;
105 Float_t blockLength = yokeLength / 7.;
106 Float_t gapWidthFront = 297.6;
107 Float_t gapWidthRear = 395.4;
108 Float_t dGap = (gapWidthRear - gapWidthFront) / 12.;
109 Float_t gapHeight = 609.1;
110 Float_t blockHeight = 147.1;
111
112
113 TGeoVolumeAssembly* asYoke = new TGeoVolumeAssembly("DYoke");
114// Base
115 char name[32];
116 Float_t lx0 = gapWidthFront + 2. * blockHeight;
117 Float_t lx = lx0;
118
119 TGeoVolumeAssembly* asYokeBase = new TGeoVolumeAssembly("DYokeBase");
120 for (Int_t i = 0; i < 7; i++) {
121 sprintf(name, "DYokeBaseBlock%1d", i);
122 TGeoVolume* voBaseBlock = new TGeoVolume(name,
123 new TGeoBBox(lx/2., blockHeight/2., blockLength/2.),
124 kMedSteel);
125 asYokeBase->AddNode(voBaseBlock, 1, new TGeoTranslation(0., 0., Float_t(i - 3) * blockLength));
126 lx += 2. * dGap;
127 }
128
129 asYoke->AddNode(asYokeBase, 1, new TGeoTranslation(0., -(gapHeight + blockHeight)/2. , 0.));
130 asYoke->AddNode(asYokeBase, 2, new TGeoTranslation(0., +(gapHeight + blockHeight)/2. , 0.));
131
132
133// Side Wall
134 TGeoVolumeAssembly* asYokeSide = new TGeoVolumeAssembly("DYokeSide");
135 TGeoVolume* voSideBlock = new TGeoVolume("DSideBlock",
136 new TGeoBBox(blockHeight/2., gapHeight/2., blockLength/2.),
137 kMedSteel);
138
139 for (Int_t i = 0; i < 7; i++) {
140 asYokeSide->AddNode(voSideBlock, i, new TGeoTranslation(Float_t(i - 3) * dGap, 0., Float_t(i - 3) * blockLength));
141 }
142
143
144 asYoke->AddNode(asYokeSide, 1, new TGeoTranslation(+lx0/2. + 3. * dGap - blockHeight/2., 0., 0.));
145 asYoke->AddNode(asYokeSide, 2, new TGeoCombiTrans( -lx0/2. - 3. * dGap + blockHeight/2., 0., 0., rotxz));
146
147//
148// Coils
149//
150 Float_t coilRi = 207.;
151 Float_t coilD = 70.;
152 Float_t coilRo = coilRi + coilD;
153 Float_t coilH = 77.;
154 Float_t phiMin = -61.;
155 Float_t phiMax = 61.;
156 Float_t lengthSt = 240. + 48.;
157 Float_t phiKnee = phiMax * kDegrad;
158 Float_t rKnee = 25.;
159
160// Circular sections
161 TGeoVolumeAssembly* asCoil = new TGeoVolumeAssembly("DCoil");
162
163 TGeoVolume* voDC1 = new TGeoVolume("DC1",
164 new TGeoTubeSeg(coilRi, coilRo, coilH / 2., phiMin, phiMax),
165 kMedCoil);
166 TGeoVolume* voDC2 = new TGeoVolume("DC2",
167 new TGeoTubeSeg(coilRi + 5., coilRo - 5., coilH / 2., phiMin, phiMax),
168 kMedCoilSh);
169
170 voDC1->AddNode(voDC2, 1, gGeoIdentity);
171 voDC2->SetVisibility(0);
172
173 dz = lengthSt / 2. + coilH / 2. + rKnee;
174 dx = 0.;
175
176 asCoil->AddNode(voDC1, 1, new TGeoTranslation(-dx, 0., -dz));
177 asCoil->AddNode(voDC1, 2, new TGeoCombiTrans( dx, 0., -dz, rotxy180));
178 asCoil->AddNode(voDC1, 3, new TGeoTranslation(-dx, 0., dz));
179 asCoil->AddNode(voDC1, 4, new TGeoCombiTrans( dx, 0., dz, rotxz180));
180
181
182// 90deg Knees
183
184
185 TGeoVolume* voDC11 = new TGeoVolume("DC11",
186 new TGeoTubeSeg(rKnee, rKnee + coilH, coilD/2., 270., 360.),
187 kMedCoil);
188
189
190 dx = - TMath::Cos(phiKnee) * (coilRi + coilD/2.);
191 dy = - TMath::Sin(phiKnee) * (coilRi + coilD/2.);
192 dz = lengthSt / 2.;
193
194 asCoil->AddNode(voDC11, 1, new TGeoCombiTrans( dx, dy, -dz, rot00));
195 asCoil->AddNode(voDC11, 2, new TGeoCombiTrans( dx, dy, dz, rot02));
196 asCoil->AddNode(voDC11, 3, new TGeoCombiTrans(-dx, dy, -dz, rot01));
197 asCoil->AddNode(voDC11, 4, new TGeoCombiTrans(-dx, dy, dz, rot03));
198
199 TGeoVolume* voDC12 = new TGeoVolume("DC12",
200 new TGeoTubeSeg(rKnee, rKnee + coilH, coilD/2., 0., 90.),
201 kMedCoil);
202
203
204 asCoil->AddNode(voDC12, 1, new TGeoCombiTrans( dx, -dy, -dz, rot01));
205 asCoil->AddNode(voDC12, 2, new TGeoCombiTrans( dx, -dy, dz, rot03));
206 asCoil->AddNode(voDC12, 3, new TGeoCombiTrans(-dx, -dy, -dz, rot00));
207 asCoil->AddNode(voDC12, 4, new TGeoCombiTrans(-dx, -dy, dz, rot02));
208
209// Straight sections
210
211
212 TGeoVolume* voDL0 = new TGeoVolume("DL0",
213 new TGeoBBox(coilD / 2. + 2., coilH / 2. + 2., lengthSt / 2.),
214 kMedCoil);
215
216 TGeoVolume* voDL1 = new TGeoVolume("DL1",
217 new TGeoBBox(coilD / 2., coilH / 2., lengthSt / 2.),
218 kMedCoil);
219
220
221 TGeoVolume* voDL2 = new TGeoVolume("DL2",
222 new TGeoBBox(coilD / 2. - 5., coilH / 2. - 5., lengthSt / 2. - 5.),
223 kMedCoilSh);
224 // Sleeves
225 TGeoVolume* voDL3 = new TGeoVolume("DL3",
226 new TGeoBBox(1., coilH / 2., 120.),
227 kMedAlu);
228
229 TGeoVolume* voDL4 = new TGeoVolume("DL4",
230 new TGeoBBox(coilD/2., 1., 120.),
231 kMedAlu);
232
233 voDL0->SetVisibility(0);
234 voDL1->AddNode(voDL2, 1, gGeoIdentity);
235 voDL0->AddNode(voDL1, 1, gGeoIdentity);
236 voDL0->AddNode(voDL3, 1, new TGeoTranslation(-coilD/2. - 1., 0., 0.));
237 voDL0->AddNode(voDL3, 2, new TGeoTranslation(+coilD/2. + 1., 0., 0.));
238 voDL0->AddNode(voDL4, 1, new TGeoTranslation(0., -coilH/2. - 1., 0.));
239 voDL0->AddNode(voDL4, 2, new TGeoTranslation(0., +coilH/2. + 1., 0.));
240
241
242 dx += (rKnee + coilH/2.) * TMath::Sin(phiKnee);
243 dy -= (rKnee + coilH/2.) * TMath::Cos(phiKnee);
244 dz = 0.;
245
246 asCoil->AddNode(voDL0, 1, new TGeoCombiTrans( dx, dy, dz, rot04));
247 asCoil->AddNode(voDL0, 2, new TGeoCombiTrans( dx, -dy, dz, rot05));
248 asCoil->AddNode(voDL0, 3, new TGeoCombiTrans(-dx, dy, dz, rot06));
249 asCoil->AddNode(voDL0, 4, new TGeoCombiTrans(-dx, -dy, dz, rot07));
250
251// Contactor
252// Outer face planes
253
254 TGeoVolumeAssembly* asContactor = new TGeoVolumeAssembly("DContactor");
255 dx = -5.;
256 TGeoVolume* voDC10 = new TGeoVolume("DC10",
257 new TGeoTubeSeg(coilRo + 3.5, coilRo + 83.5, 1., -20., 20.),
258 kMedCable);
259 asContactor->AddNode(voDC10, 1, new TGeoTranslation(dx, 0, -32.325));
260 asContactor->AddNode(voDC10, 2, new TGeoTranslation(dx, 0, +32.325));
261
262
263// Coil Support
264//
265 Float_t sW = 89.;
266
267 TGeoVolumeAssembly* asDCoilSupport = new TGeoVolumeAssembly("DCoilSupport");
268
269 // Steel fixed to the yoke
270 TGeoVolume* voDCS01 = new TGeoVolume("DCS01",
271 new TGeoTubeSeg(coilRo, 325., 1., 21., 51.),
272 kMedAlu);
273
274 // Steel on the coil
275 TGeoVolume* voDCS02 = new TGeoVolume("DCS02",
276 new TGeoTubeSeg(coilRo, coilRo + 2., sW/2., 21., 51.),
277 kMedAlu);
278 TGeoVolume* voDCS021 = new TGeoVolume("DCS021",
279 new TGeoConeSeg(sW/2., coilRo, 320., coilRo, coilRo + 2., 21., 21.4),
280 kMedAlu);
281
282
283 // Sleeves
284 TGeoVolume* voDCS03 = new TGeoVolume("DCS03",
285 new TGeoTubeSeg(coilRi - 2., coilRo + 2., 1., 21., 51.),
286 kMedAlu);
287
288 TGeoVolume* voDCS04 = new TGeoVolume("DCS04",
289 new TGeoTubeSeg(coilRi - 2., coilRi, coilH/2., 21., 51.),
290 kMedAlu);
291
292
293 TGeoVolume* voDCS05 = new TGeoVolume("DCS05",
294 new TGeoTubeSeg(coilRi - 2., coilRo, 1., 21., 51.),
295 kMedAlu);
296 //
297
298
299
300 asDCoilSupport->AddNode(voDCS02, 1, new TGeoTranslation(0., 0., -(sW - coilH)/2.));
301 asDCoilSupport->AddNode(voDCS04, 1, gGeoIdentity);
302 for (Int_t i = 0; i < 9; i++)
303 {
304 char name[16];
305 sprintf(name, "rotdcs%1d", i);
306 Float_t phi = Float_t(i) * 3.75;
307 TGeoRotation* rot = new TGeoRotation(name, 90., phi, 90., 90. + phi, 0., 0.);
308 asDCoilSupport->AddNode(voDCS021, i, new TGeoCombiTrans(0., 0., -(sW - coilH)/2., rot));
309 }
310
311
312
313 asDCoilSupport->AddNode(voDCS01, 1, new TGeoTranslation(0., 0., -sW/2. - (sW - coilH)/2. - 1.));
314 asDCoilSupport->AddNode(voDCS03, 1, new TGeoTranslation(0., 0., +coilH/2. + 1.));
315 asDCoilSupport->AddNode(voDCS05, 1, new TGeoTranslation(0., 0., -coilH/2. - 1.));
316
317 TGeoVolumeAssembly* asDipole = new TGeoVolumeAssembly("Dipole");
318
319 asDipole->AddNode(asYoke, 1, gGeoIdentity);
320 asDipole->AddNode(asCoil, 1, gGeoIdentity);
321 dz = lengthSt / 2. + coilH / 2. + rKnee;
322 asDipole->AddNode(asContactor, 1, new TGeoTranslation(0., 0., dz));
323 asDipole->AddNode(asContactor, 2, new TGeoCombiTrans( 0., 0., dz, rotxy180));
324
325 asDipole->AddNode(asDCoilSupport, 1, new TGeoTranslation(0., 0., dz));
326 asDipole->AddNode(asDCoilSupport, 2, new TGeoCombiTrans( 0., 0., dz, rotxy180));
327 asDipole->AddNode(asDCoilSupport, 3, new TGeoCombiTrans( 0., 0., dz, rotxy108));
328 asDipole->AddNode(asDCoilSupport, 4, new TGeoCombiTrans( 0., 0., dz, rotxy288));
329
330 asDipole->AddNode(asDCoilSupport, 5, new TGeoCombiTrans( 0., 0., -dz, rotxz));
331 asDipole->AddNode(asDCoilSupport, 6, new TGeoCombiTrans( 0., 0., -dz, rotxz108));
332 asDipole->AddNode(asDCoilSupport, 7, new TGeoCombiTrans( 0., 0., -dz, rotxz180));
333 asDipole->AddNode(asDCoilSupport, 8, new TGeoCombiTrans( 0., 0., -dz, rotxz288));
334
335 voDDIP->SetVisContainers();
336 voDDIP->SetVisibility(0);
337 voDDIP->AddNode(asDipole, 1, new TGeoTranslation(0., 0., -0.55));
338 top->AddNode(voDDIP, 1, new TGeoCombiTrans(0., 0., -kZDipole, rotxz));
339
340}
341
342
343
344
345
346
347