50 Double_t dz, Int_t colour,
51 TGeoMedium* material) {
52 [[maybe_unused]] TGeoBBox* ms =
new TGeoBBox(
"ms", hwidth, hheight - 1., dz);
54 Double_t swidth = 30.;
56 Double_t r25 = hheight - swidth / 2.;
57 Double_t r1346 = hwidth - swidth / 2;
58 Double_t alpha = atan(hheight / hwidth) * 180. / TMath::Pi();
59 [[maybe_unused]] TGeoTubeSeg* FL1 =
60 new TGeoTubeSeg(
"FL1", swidth, r1346, dz + 1., 5., alpha - 5.);
61 [[maybe_unused]] TGeoTubeSeg* FL3 =
62 new TGeoTubeSeg(
"FL3", swidth, r1346, dz + 1., 180 - alpha + 5., 175.);
63 [[maybe_unused]] TGeoTubeSeg* FL4 =
64 new TGeoTubeSeg(
"FL4", swidth, r1346, dz + 1., 185., 180. + alpha - 5.);
65 [[maybe_unused]] TGeoTubeSeg* FL6 =
66 new TGeoTubeSeg(
"FL6", swidth, r1346, dz + 1., 360. - alpha + 5., 355.);
67 [[maybe_unused]] TGeoTubeSeg* FL2 =
new TGeoTubeSeg(
68 "FL2", swidth, r25, dz + 1., alpha + 5., 180 - alpha - 5.);
69 [[maybe_unused]] TGeoTubeSeg* FL5 =
new TGeoTubeSeg(
70 "FL5", swidth, r25, dz + 1., 180. + alpha + 5., 360. - alpha - 5.);
73 r1346 = dz - swidth / 2;
74 alpha = atan(hheight / dz) * 180. / TMath::Pi();
77 [[maybe_unused]] TGeoTubeSeg* SL1 =
78 new TGeoTubeSeg(
"SL1", swidth, r1346, hwidth + 1., 5., alpha - 5.);
79 [[maybe_unused]] TGeoTubeSeg* SL3 =
new TGeoTubeSeg(
80 "SL3", swidth, r1346, hwidth + 1., 180 - alpha + 5., 175.);
81 [[maybe_unused]] TGeoTubeSeg* SL4 =
new TGeoTubeSeg(
82 "SL4", swidth, r1346, hwidth + 1., 185., 180. + alpha - 5.);
83 [[maybe_unused]] TGeoTubeSeg* SL6 =
new TGeoTubeSeg(
84 "SL6", swidth, r1346, hwidth + 1., 360. - alpha + 5., 355.);
85 [[maybe_unused]] TGeoTubeSeg* SL2 =
new TGeoTubeSeg(
86 "SL2", swidth, r25, hwidth + 1., alpha + 5., 180 - alpha - 5.);
87 [[maybe_unused]] TGeoTubeSeg* SL5 =
new TGeoTubeSeg(
88 "SL5", swidth, r25, hwidth + 1., 180. + alpha + 5., 360. - alpha - 5.);
89 TGeoRotation* r =
new TGeoRotation(
"r");
91 r->RegisterYourself();
93 TGeoCompositeShape* TS =
new TGeoCompositeShape(
94 "TS",
"ms-FL1-FL2-FL3-FL4-FL5-FL6-SL1:r-SL2:r-SL3:r-SL4:r-SL5:r-SL6:r");
96 TGeoVolume* T =
new TGeoVolume(
"TSUP", TS, material);
97 T->SetLineColor(colour);
101 TGeoVolume* top = gGeoManager->GetTopVolume();
103 TGeoMedium* Fe = gGeoManager->GetMedium(
"iron");
105 TGeoMedium* Al = gGeoManager->GetMedium(
"Aluminium");
106 TGeoVolumeAssembly* tMagnet =
new TGeoVolumeAssembly(
"SHiPMagnet");
107 top->AddNode(tMagnet, 1,
new TGeoTranslation(0, 0, 0));
110 Double_t
m = 100 *
cm;
113 [[maybe_unused]] TGeoBBox* magyoke1 =
114 new TGeoBBox(
"magyoke1", 350, 350, 125);
115 [[maybe_unused]] TGeoBBox* magyoke2 =
116 new TGeoBBox(
"magyoke2", 250, 250, 126);
118 TGeoCompositeShape* magyokec =
119 new TGeoCompositeShape(
"magyokec",
"magyoke1-magyoke2");
120 TGeoVolume* magyoke =
new TGeoVolume(
"magyoke", magyokec, Fe);
121 magyoke->SetLineColor(kBlue);
123 tMagnet->AddNode(magyoke, 1,
new TGeoTranslation(0, 0, 1940));
126 [[maybe_unused]] TGeoTubeSeg* magnet1a =
127 new TGeoTubeSeg(
"magnet1a", 250, 300, 35, 45, 135);
128 [[maybe_unused]] TGeoTubeSeg* magnet1b =
129 new TGeoTubeSeg(
"magnet1b", 250, 300, 35, 45, 135);
130 [[maybe_unused]] TGeoTubeSeg* magnet1c =
131 new TGeoTubeSeg(
"magnet1c", 250, 270, 125, 45, 60);
132 [[maybe_unused]] TGeoTubeSeg* magnet1d =
133 new TGeoTubeSeg(
"magnet1d", 250, 270, 125, 120, 135);
136 TGeoTranslation* m1 =
new TGeoTranslation(0, 0, 160);
138 m1->RegisterYourself();
139 TGeoTranslation* m2 =
new TGeoTranslation(0, 0, -160);
141 m2->RegisterYourself();
143 TGeoCompositeShape* magcomp1 =
new TGeoCompositeShape(
144 "magcomp1",
"magnet1a:m1+magnet1b:m2+magnet1c+magnet1d");
145 TGeoVolume* magnet1 =
new TGeoVolume(
"magnet1", magcomp1, Fe);
146 magnet1->SetLineColor(kYellow);
147 tMagnet->AddNode(magnet1, 1,
151 m3.SetAngles(180, 0, 0);
153 TGeoCombiTrans m5(m4, m3);
154 TGeoHMatrix* m6 =
new TGeoHMatrix(m5);
155 tMagnet->AddNode(magnet1, 2, m6);
159 Double_t Yokel = 1.25 *
m;
160 Double_t magnetIncrease = 100. *
cm;
162 Double_t bradius =
fDy / 2.;
163 [[maybe_unused]] TGeoBBox* magyoke1 =
164 new TGeoBBox(
"magyoke1",
fDx + 0.7 *
m, bradius + 1.2 *
m, Yokel);
165 [[maybe_unused]] TGeoBBox* magyoke2 =
new TGeoBBox(
166 "magyoke2",
fDx - 0.3 *
m, bradius + 0.2 *
m, Yokel + 0.01 *
cm);
168 TGeoCompositeShape* magyokec =
169 new TGeoCompositeShape(
"magyokec",
"magyoke1-magyoke2");
170 TGeoVolume* magyoke =
new TGeoVolume(
"magyoke", magyokec, Fe);
171 magyoke->SetLineColor(kBlue);
172 tMagnet->AddNode(magyoke, 1,
new TGeoTranslation(0, 0,
fSpecMagz));
174 Double_t hsupport = (10. *
m - (bradius + 1.2 *
m) -
floorheight) / 2.;
178 new TGeoTranslation(0, -bradius - 1.2 *
m - hsupport,
fSpecMagz));
181 TGeoCompositeShape* MCoilc;
183 [[maybe_unused]] TGeoEltu* C2 =
new TGeoEltu(
184 "C2",
fDx, bradius + 0.5 *
m, Yokel + 0.6 *
m + magnetIncrease / 2.);
185 [[maybe_unused]] TGeoEltu* C1 =
186 new TGeoEltu(
"C1",
fDx - 0.3 *
m, bradius + 0.2 *
m,
187 Yokel + 0.601 *
m + magnetIncrease / 2.);
188 [[maybe_unused]] TGeoBBox* Box1 =
189 new TGeoBBox(
"Box1", 1. *
m, bradius + 0.51 *
m,
190 Yokel + 0.61 *
m + magnetIncrease / 2.);
191 [[maybe_unused]] TGeoBBox* Box2 =
192 new TGeoBBox(
"Box2",
fDx + 0.01 *
m, bradius - 0.5 *
m,
193 Yokel + 0.01 *
m + magnetIncrease / 2.);
194 MCoilc =
new TGeoCompositeShape(
"MCoilc",
"C2-C1-magyokec-Box1-Box2");
196 [[maybe_unused]] TGeoBBox* C2 =
new TGeoBBox(
197 "C2",
fDx, bradius + 0.5 *
m, Yokel + 0.6 *
m + magnetIncrease / 2.);
198 [[maybe_unused]] TGeoBBox* C1 =
199 new TGeoBBox(
"C1",
fDx - 0.3 *
m, bradius + 0.2 *
m,
200 Yokel + 0.601 *
m + magnetIncrease / 2.);
201 MCoilc =
new TGeoCompositeShape(
"MCoilc",
"C2-C1-magyokec");
203 TGeoVolume* MCoil =
new TGeoVolume(
"MCoil", MCoilc, Al);
204 MCoil->SetLineColor(kYellow);
206 tMagnet->AddNode(MCoil, 1,
new TGeoTranslation(0, 0,
fSpecMagz));
210 Double_t xaperture =
fDx;
211 Double_t yaperture =
fDy;
213 [[maybe_unused]] TGeoBBox* magyoke1 =
new TGeoBBox(
215 [[maybe_unused]] TGeoBBox* magyoke2 =
216 new TGeoBBox(
"magyoke2", xaperture, yaperture,
YokeDepth + 1.);
217 TGeoCompositeShape* magyokec =
218 new TGeoCompositeShape(
"magyokec",
"magyoke1-magyoke2");
220 [[maybe_unused]] TGeoBBox* my1 =
223 [[maybe_unused]] TGeoBBox* my2 =
new TGeoBBox(
224 "my2", xaperture - 0.1 *
cm, yaperture - 0.1 *
cm,
YokeDepth + 1.);
225 [[maybe_unused]] TGeoCompositeShape* myc =
226 new TGeoCompositeShape(
"myc",
"my1-my2");
227 TGeoVolume* magyoke =
new TGeoVolume(
"magyoke", magyokec, Fe);
228 magyoke->SetLineColor(kBlue);
229 tMagnet->AddNode(magyoke, 1,
new TGeoTranslation(0, 0,
fSpecMagz));
231 [[maybe_unused]] TGeoTubeSeg* CTop =
new TGeoTubeSeg(
233 TGeoTranslation* t1 =
234 new TGeoTranslation(
"t1", xaperture, yaperture -
CoilThick, 0.);
235 t1->RegisterYourself();
236 TGeoTranslation* t2 =
237 new TGeoTranslation(
"t2", -xaperture, yaperture -
CoilThick, 0.);
238 t2->RegisterYourself();
239 TGeoCompositeShape* CTop1 =
new TGeoCompositeShape(
"CTop1",
"CTop:t1-myc");
240 TGeoCompositeShape* CTop2 =
new TGeoCompositeShape(
"CTop2",
"CTop:t2-myc");
241 TGeoVolume* MCoil1 =
new TGeoVolume(
"MCoil1", CTop1, Al);
242 TGeoVolume* MCoil2 =
new TGeoVolume(
"MCoil2", CTop2, Al);
243 MCoil1->SetLineColor(kYellow);
244 tMagnet->AddNode(MCoil1, 1,
new TGeoTranslation(0, 0,
fSpecMagz));
245 MCoil2->SetLineColor(kYellow);
246 tMagnet->AddNode(MCoil2, 1,
new TGeoTranslation(0, 0,
fSpecMagz));
248 [[maybe_unused]] TGeoTubeSeg* CBot =
251 TGeoTranslation* b1 =
252 new TGeoTranslation(
"b1", xaperture, -yaperture +
CoilThick, 0.);
253 b1->RegisterYourself();
254 TGeoTranslation* b2 =
255 new TGeoTranslation(
"b2", -xaperture, -yaperture +
CoilThick, 0.);
256 b2->RegisterYourself();
257 TGeoCompositeShape* CBot1 =
new TGeoCompositeShape(
"CBot1",
"CBot:b1-myc");
258 TGeoCompositeShape* CBot2 =
new TGeoCompositeShape(
"CBot2",
"CBot:b2-myc");
259 TGeoVolume* MCoil3 =
new TGeoVolume(
"MCoil3", CBot1, Al);
260 TGeoVolume* MCoil4 =
new TGeoVolume(
"MCoil4", CBot2, Al);
261 MCoil3->SetLineColor(kYellow);
262 tMagnet->AddNode(MCoil3, 1,
new TGeoTranslation(0, 0,
fSpecMagz));
263 MCoil4->SetLineColor(kYellow);
264 tMagnet->AddNode(MCoil4, 1,
new TGeoTranslation(0, 0,
fSpecMagz));
266 TGeoBBox* CVert =
new TGeoBBox(
"CVert",
YokeWidth / 2.,
268 TGeoVolume* CV =
new TGeoVolume(
"CV", CVert, Al);
269 CV->SetLineColor(kYellow);
272 new TGeoTranslation(xaperture +
YokeWidth / 2., 0,
276 new TGeoTranslation(-xaperture -
YokeWidth / 2., 0,
280 new TGeoTranslation(xaperture +
YokeWidth / 2., 0,
284 new TGeoTranslation(-xaperture -
YokeWidth / 2., 0,