100 {
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));
108
110 Double_t
m = 100 *
cm;
112
113 [[maybe_unused]] TGeoBBox* magyoke1 =
114 new TGeoBBox("magyoke1", 350, 350, 125);
115 [[maybe_unused]] TGeoBBox* magyoke2 =
116 new TGeoBBox("magyoke2", 250, 250, 126);
117
118 TGeoCompositeShape* magyokec =
119 new TGeoCompositeShape("magyokec", "magyoke1-magyoke2");
120 TGeoVolume* magyoke = new TGeoVolume("magyoke", magyokec, Fe);
121 magyoke->SetLineColor(kBlue);
122
123 tMagnet->AddNode(magyoke, 1, new TGeoTranslation(0, 0, 1940));
124
125
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);
134
135
136 TGeoTranslation* m1 = new TGeoTranslation(0, 0, 160);
137 m1->SetName("m1");
138 m1->RegisterYourself();
139 TGeoTranslation*
m2 =
new TGeoTranslation(0, 0, -160);
141 m2->RegisterYourself();
142
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,
149
151 m3.SetAngles(180, 0, 0);
153 TGeoCombiTrans m5(m4, m3);
154 TGeoHMatrix* m6 = new TGeoHMatrix(m5);
155 tMagnet->AddNode(magnet1, 2, m6);
158 3) {
159 Double_t Yokel = 1.25 *
m;
160 Double_t magnetIncrease = 100. *
cm;
161
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);
167
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));
173
174 Double_t hsupport = (10. *
m - (bradius + 1.2 *
m) -
floorheight) / 2.;
176 tMagnet->AddNode(
177 SMS, 1,
178 new TGeoTranslation(0, -bradius - 1.2 *
m - hsupport,
fSpecMagz));
179
180
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");
195 } else {
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");
202 }
203 TGeoVolume* MCoil = new TGeoVolume("MCoil", MCoilc, Al);
204 MCoil->SetLineColor(kYellow);
205
206 tMagnet->AddNode(MCoil, 1,
new TGeoTranslation(0, 0,
fSpecMagz));
207
209
210 Double_t xaperture =
fDx;
211 Double_t yaperture =
fDy;
212
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");
219
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));
230
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));
247
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));
265
266 TGeoBBox* CVert =
new TGeoBBox(
"CVert",
YokeWidth / 2.,
268 TGeoVolume* CV = new TGeoVolume("CV", CVert, Al);
269 CV->SetLineColor(kYellow);
270 tMagnet->AddNode(
271 CV, 1,
272 new TGeoTranslation(xaperture +
YokeWidth / 2., 0,
274 tMagnet->AddNode(
275 CV, 2,
276 new TGeoTranslation(-xaperture -
YokeWidth / 2., 0,
278 tMagnet->AddNode(
279 CV, 3,
280 new TGeoTranslation(xaperture +
YokeWidth / 2., 0,
282 tMagnet->AddNode(
283 CV, 4,
284 new TGeoTranslation(-xaperture -
YokeWidth / 2., 0,
286 }
287}
TGeoVolume * MagnetSupport(Double_t hwidth, Double_t hheight, Double_t dz, Int_t colour, TGeoMedium *material)
Int_t InitMedium(const char *name)