1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
18 #include <TVirtualMC.h>
19 #include <TGeoManager.h>
20 #include <TGeoVolume.h>
21 #include <TGeoMedium.h>
22 #include <TGeoMatrix.h>
29 #include "AliDIPOv3.h"
35 //_____________________________________________________________________________
36 AliDIPOv3::AliDIPOv3()
39 // Last design of magnetic dipole version 2
43 //_____________________________________________________________________________
44 AliDIPOv3::AliDIPOv3(const char *name, const char *title)
45 : AliDIPOv2(name,title)
48 // Standard constructor for the magnetic dipole version 2
52 //_____________________________________________________________________________
53 void AliDIPOv3::CreateSpectrometerDipole()
55 // Detailed dipole geometry as built
60 TGeoVolume* top = gGeoManager->GetVolume("ALIC");
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");
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.);
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.);
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.);
91 const Float_t kZDipole = 975.;
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);
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;
113 TGeoVolumeAssembly* asYoke = new TGeoVolumeAssembly("DYoke");
116 Float_t lx0 = gapWidthFront + 2. * blockHeight;
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.),
125 asYokeBase->AddNode(voBaseBlock, 1, new TGeoTranslation(0., 0., Float_t(i - 3) * blockLength));
129 asYoke->AddNode(asYokeBase, 1, new TGeoTranslation(0., -(gapHeight + blockHeight)/2. , 0.));
130 asYoke->AddNode(asYokeBase, 2, new TGeoTranslation(0., +(gapHeight + blockHeight)/2. , 0.));
134 TGeoVolumeAssembly* asYokeSide = new TGeoVolumeAssembly("DYokeSide");
135 TGeoVolume* voSideBlock = new TGeoVolume("DSideBlock",
136 new TGeoBBox(blockHeight/2., gapHeight/2., blockLength/2.),
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));
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));
150 Float_t coilRi = 207.;
152 Float_t coilRo = coilRi + coilD;
154 Float_t phiMin = -61.;
155 Float_t phiMax = 61.;
156 Float_t lengthSt = 240. + 48.;
157 Float_t phiKnee = phiMax * kDegrad;
161 TGeoVolumeAssembly* asCoil = new TGeoVolumeAssembly("DCoil");
163 TGeoVolume* voDC1 = new TGeoVolume("DC1",
164 new TGeoTubeSeg(coilRi, coilRo, coilH / 2., phiMin, phiMax),
166 TGeoVolume* voDC2 = new TGeoVolume("DC2",
167 new TGeoTubeSeg(coilRi + 5., coilRo - 5., coilH / 2., phiMin, phiMax),
170 voDC1->AddNode(voDC2, 1, gGeoIdentity);
171 voDC2->SetVisibility(0);
173 dz = lengthSt / 2. + coilH / 2. + rKnee;
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));
185 TGeoVolume* voDC11 = new TGeoVolume("DC11",
186 new TGeoTubeSeg(rKnee, rKnee + coilH, coilD/2., 270., 360.),
190 dx = - TMath::Cos(phiKnee) * (coilRi + coilD/2.);
191 dy = - TMath::Sin(phiKnee) * (coilRi + coilD/2.);
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));
199 TGeoVolume* voDC12 = new TGeoVolume("DC12",
200 new TGeoTubeSeg(rKnee, rKnee + coilH, coilD/2., 0., 90.),
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));
212 TGeoVolume* voDL0 = new TGeoVolume("DL0",
213 new TGeoBBox(coilD / 2. + 2., coilH / 2. + 2., lengthSt / 2.),
216 TGeoVolume* voDL1 = new TGeoVolume("DL1",
217 new TGeoBBox(coilD / 2., coilH / 2., lengthSt / 2.),
221 TGeoVolume* voDL2 = new TGeoVolume("DL2",
222 new TGeoBBox(coilD / 2. - 5., coilH / 2. - 5., lengthSt / 2. - 5.),
225 TGeoVolume* voDL3 = new TGeoVolume("DL3",
226 new TGeoBBox(1., coilH / 2., 120.),
229 TGeoVolume* voDL4 = new TGeoVolume("DL4",
230 new TGeoBBox(coilD/2., 1., 120.),
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.));
242 dx += (rKnee + coilH/2.) * TMath::Sin(phiKnee);
243 dy -= (rKnee + coilH/2.) * TMath::Cos(phiKnee);
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));
254 TGeoVolumeAssembly* asContactor = new TGeoVolumeAssembly("DContactor");
256 TGeoVolume* voDC10 = new TGeoVolume("DC10",
257 new TGeoTubeSeg(coilRo + 3.5, coilRo + 83.5, 1., -20., 20.),
259 asContactor->AddNode(voDC10, 1, new TGeoTranslation(dx, 0, -32.325));
260 asContactor->AddNode(voDC10, 2, new TGeoTranslation(dx, 0, +32.325));
267 TGeoVolumeAssembly* asDCoilSupport = new TGeoVolumeAssembly("DCoilSupport");
269 // Steel fixed to the yoke
270 TGeoVolume* voDCS01 = new TGeoVolume("DCS01",
271 new TGeoTubeSeg(coilRo, 325., 1., 21., 51.),
275 TGeoVolume* voDCS02 = new TGeoVolume("DCS02",
276 new TGeoTubeSeg(coilRo, coilRo + 2., sW/2., 21., 51.),
278 TGeoVolume* voDCS021 = new TGeoVolume("DCS021",
279 new TGeoConeSeg(sW/2., coilRo, 320., coilRo, coilRo + 2., 21., 21.4),
284 TGeoVolume* voDCS03 = new TGeoVolume("DCS03",
285 new TGeoTubeSeg(coilRi - 2., coilRo + 2., 1., 21., 51.),
288 TGeoVolume* voDCS04 = new TGeoVolume("DCS04",
289 new TGeoTubeSeg(coilRi - 2., coilRi, coilH/2., 21., 51.),
293 TGeoVolume* voDCS05 = new TGeoVolume("DCS05",
294 new TGeoTubeSeg(coilRi - 2., coilRo, 1., 21., 51.),
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++)
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));
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.));
317 TGeoVolumeAssembly* asDipole = new TGeoVolumeAssembly("Dipole");
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));
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));
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));
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));