FairShip
Loading...
Searching...
No Matches
ShipMagnet Class Reference

#include <ShipMagnet.h>

Inheritance diagram for ShipMagnet:
[legend]
Collaboration diagram for ShipMagnet:
[legend]

Public Member Functions

 ShipMagnet (const char *name, const char *Title="SHiP Magnet", Double_t z=2018., Int_t c=2, Double_t dx=3, Double_t dy=5, Double_t fl=2, Double_t YW=1., Double_t YD=1., Double_t CT=1.)
 ShipMagnet ()
 ~ShipMagnet () override
void ConstructGeometry () override

Protected Member Functions

TGeoVolume * MagnetSupport (Double_t hwidth, Double_t hheight, Double_t dz, Int_t colour, TGeoMedium *material)

Protected Attributes

Int_t fDesign
Int_t fSpecMagz
Double_t fDy
Double_t fDx
Double_t YokeWidth
Double_t YokeDepth
Double_t CoilThick
Double_t floorheight

Detailed Description

Definition at line 14 of file ShipMagnet.h.

Constructor & Destructor Documentation

◆ ShipMagnet() [1/2]

ShipMagnet::ShipMagnet ( const char * name,
const char * Title = "SHiP Magnet",
Double_t z = 2018.,
Int_t c = 2,
Double_t dx = 3,
Double_t dy = 5,
Double_t fl = 2,
Double_t YW = 1.,
Double_t YD = 1.,
Double_t CT = 1. )
explicit

Definition at line 34 of file ShipMagnet.cxx.

37 : FairModule(name, Title) {
38 fDesign = c;
39 fSpecMagz = z;
40 fDy = dy;
41 fDx = dx;
43 YokeWidth = YW;
44 YokeDepth = YD;
45 CoilThick = CT;
46}
Double_t floorheight
Definition ShipMagnet.h:30
Double_t YokeWidth
Definition ShipMagnet.h:29
Int_t fSpecMagz
Definition ShipMagnet.h:26
Double_t fDy
Definition ShipMagnet.h:27
Double_t fDx
Definition ShipMagnet.h:28
Double_t CoilThick
Definition ShipMagnet.h:29
Int_t fDesign
Definition ShipMagnet.h:25
Double_t YokeDepth
Definition ShipMagnet.h:29
c
Definition hnl.py:116
fl
Definition radio.py:13

◆ ShipMagnet() [2/2]

ShipMagnet::ShipMagnet ( )

Definition at line 32 of file ShipMagnet.cxx.

32: FairModule("ShipMagnet", "") {}

◆ ~ShipMagnet()

ShipMagnet::~ShipMagnet ( )
overridedefault

Member Function Documentation

◆ ConstructGeometry()

void ShipMagnet::ConstructGeometry ( )
override

Definition at line 100 of file ShipMagnet.cxx.

100 {
101 TGeoVolume* top = gGeoManager->GetTopVolume();
102 ShipGeo::InitMedium("iron");
103 TGeoMedium* Fe = gGeoManager->GetMedium("iron");
104 ShipGeo::InitMedium("Aluminium");
105 TGeoMedium* Al = gGeoManager->GetMedium("Aluminium");
106 TGeoVolumeAssembly* tMagnet = new TGeoVolumeAssembly("SHiPMagnet");
107 top->AddNode(tMagnet, 1, new TGeoTranslation(0, 0, 0));
108
109 Double_t cm = 1;
110 Double_t m = 100 * cm;
111 if (fDesign == 1) {
112 // magnet yoke
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 // magyoke->SetTransparency(50);
123 tMagnet->AddNode(magyoke, 1, new TGeoTranslation(0, 0, 1940));
124
125 // magnet
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 // magnet composite shape matrices
136 TGeoTranslation* m1 = new TGeoTranslation(0, 0, 160);
137 m1->SetName("m1");
138 m1->RegisterYourself();
139 TGeoTranslation* m2 = new TGeoTranslation(0, 0, -160);
140 m2->SetName("m2");
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,
148 new TGeoTranslation(0, 0, fSpecMagz)); // was 1940
149
150 TGeoRotation m3;
151 m3.SetAngles(180, 0, 0);
152 TGeoTranslation m4(0, 0, fSpecMagz); // was 1940
153 TGeoCombiTrans m5(m4, m3);
154 TGeoHMatrix* m6 = new TGeoHMatrix(m5);
155 tMagnet->AddNode(magnet1, 2, m6);
156 } else if (fDesign == 2 ||
157 fDesign ==
158 3) { // fDesign==2 TP version, fDesign==3, rectangular version
159 Double_t Yokel = 1.25 * m;
160 Double_t magnetIncrease = 100. * cm;
161 // magnet yoke
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.;
175 TGeoVolume* SMS = MagnetSupport(fDx + 0.7 * m, hsupport, Yokel, 15, Fe);
176 tMagnet->AddNode(
177 SMS, 1,
178 new TGeoTranslation(0, -bradius - 1.2 * m - hsupport, fSpecMagz));
179
180 // Attempt to make Al coils...
181 TGeoCompositeShape* MCoilc;
182 if (fDesign == 2) {
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
208 } else if (fDesign == 4) { // rectangular a la MISIS, full opening for vessel
209 // define dimensions
210 Double_t xaperture = fDx; // half apertures
211 Double_t yaperture = fDy;
212 // built the yoke
213 [[maybe_unused]] TGeoBBox* magyoke1 = new TGeoBBox(
214 "magyoke1", xaperture + YokeWidth, yaperture + YokeWidth, YokeDepth);
215 [[maybe_unused]] TGeoBBox* magyoke2 =
216 new TGeoBBox("magyoke2", xaperture, yaperture, YokeDepth + 1.);
217 TGeoCompositeShape* magyokec =
218 new TGeoCompositeShape("magyokec", "magyoke1-magyoke2");
219 // and a epsilon larger yoke to subtract while making the coils
220 [[maybe_unused]] TGeoBBox* my1 =
221 new TGeoBBox("my1", xaperture + YokeWidth, yaperture + YokeWidth,
222 YokeDepth + 0.1 * cm);
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 // and the coils: top
231 [[maybe_unused]] TGeoTubeSeg* CTop = new TGeoTubeSeg(
232 "CTop", 1. * cm, YokeWidth, YokeDepth + CoilThick + 1. * cm, 0., 180.);
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 // coils bottom
248 [[maybe_unused]] TGeoTubeSeg* CBot =
249 new TGeoTubeSeg("CBot", 1. * cm, YokeWidth,
250 YokeDepth + CoilThick + 1. * cm, 180., 360.);
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 // add vertical coils
266 TGeoBBox* CVert = new TGeoBBox("CVert", YokeWidth / 2.,
267 yaperture - CoilThick, CoilThick / 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,
273 fSpecMagz - YokeDepth - CoilThick / 2.));
274 tMagnet->AddNode(
275 CV, 2,
276 new TGeoTranslation(-xaperture - YokeWidth / 2., 0,
277 fSpecMagz - YokeDepth - CoilThick / 2.));
278 tMagnet->AddNode(
279 CV, 3,
280 new TGeoTranslation(xaperture + YokeWidth / 2., 0,
281 fSpecMagz + YokeDepth + CoilThick / 2.));
282 tMagnet->AddNode(
283 CV, 4,
284 new TGeoTranslation(-xaperture - YokeWidth / 2., 0,
285 fSpecMagz + YokeDepth + CoilThick / 2.));
286 }
287}
constexpr Double_t cm
constexpr Double_t m
TGeoVolume * MagnetSupport(Double_t hwidth, Double_t hheight, Double_t dz, Int_t colour, TGeoMedium *material)
Int_t InitMedium(const char *name)
Definition ShipGeoUtil.h:22
float m3
Definition hepunit.py:59
float m2
Definition hepunit.py:58

◆ MagnetSupport()

TGeoVolume * ShipMagnet::MagnetSupport ( Double_t hwidth,
Double_t hheight,
Double_t dz,
Int_t colour,
TGeoMedium * material )
protected

Definition at line 49 of file ShipMagnet.cxx.

51 {
52 [[maybe_unused]] TGeoBBox* ms = new TGeoBBox("ms", hwidth, hheight - 1., dz);
53 // try to make SHiP like logo in support
54 Double_t swidth = 30.; //
55 // 6 cutouts from the front
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.);
71
72 // 6 cutouts from the side
73 r1346 = dz - swidth / 2;
74 alpha = atan(hheight / dz) * 180. / TMath::Pi();
75 // cout << "magsupport: "<< swidth<<", "<<r25<<", "<< r1346<<", "<<alpha
76 // <<endl;
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");
90 r->RotateY(90.);
91 r->RegisterYourself();
92
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");
95
96 TGeoVolume* T = new TGeoVolume("TSUP", TS, material);
97 T->SetLineColor(colour);
98 return T;
99}
float ms
Definition hepunit.py:98

Member Data Documentation

◆ CoilThick

Double_t ShipMagnet::CoilThick
protected

Definition at line 29 of file ShipMagnet.h.

◆ fDesign

Int_t ShipMagnet::fDesign
protected

Definition at line 25 of file ShipMagnet.h.

◆ fDx

Double_t ShipMagnet::fDx
protected

Definition at line 28 of file ShipMagnet.h.

◆ fDy

Double_t ShipMagnet::fDy
protected

Definition at line 27 of file ShipMagnet.h.

◆ floorheight

Double_t ShipMagnet::floorheight
protected

Definition at line 30 of file ShipMagnet.h.

◆ fSpecMagz

Int_t ShipMagnet::fSpecMagz
protected

Definition at line 26 of file ShipMagnet.h.

◆ YokeDepth

Double_t ShipMagnet::YokeDepth
protected

Definition at line 29 of file ShipMagnet.h.

◆ YokeWidth

Double_t ShipMagnet::YokeWidth
protected

Definition at line 29 of file ShipMagnet.h.


The documentation for this class was generated from the following files: