108{
109
110 TGeoVolume *
top=gGeoManager->GetTopVolume();
112 TGeoMedium *Fe =gGeoManager->GetMedium("iron");
114 TGeoMedium *Al =gGeoManager->GetMedium("Aluminum");
115 TGeoVolumeAssembly *tMagnet = new TGeoVolumeAssembly("SHiPMagnet");
116 top->AddNode(tMagnet, 1,
new TGeoTranslation(0, 0, 0));
117
120 if (fDesign==1){
121
122 TGeoBBox *magyoke1 = new TGeoBBox("magyoke1", 350, 350, 125);
123 TGeoBBox *magyoke2 = new TGeoBBox("magyoke2", 250, 250, 126);
124
125 TGeoCompositeShape *magyokec = new TGeoCompositeShape("magyokec", "magyoke1-magyoke2");
126 TGeoVolume *magyoke = new TGeoVolume("magyoke", magyokec, Fe);
127 magyoke->SetLineColor(kBlue);
128
129 tMagnet->AddNode(magyoke, 1, new TGeoTranslation(0, 0, 1940));
130
131
132 TGeoTubeSeg *magnet1a = new TGeoTubeSeg("magnet1a", 250, 300, 35, 45, 135);
133 TGeoTubeSeg *magnet1b = new TGeoTubeSeg("magnet1b", 250, 300, 35, 45, 135);
134 TGeoTubeSeg *magnet1c = new TGeoTubeSeg("magnet1c", 250, 270, 125, 45, 60);
135 TGeoTubeSeg *magnet1d = new TGeoTubeSeg("magnet1d", 250, 270, 125, 120, 135);
136
137
138 TGeoTranslation *m1 = new TGeoTranslation(0, 0, 160);
139 m1->SetName("m1");
140 m1->RegisterYourself();
141 TGeoTranslation *
m2 =
new TGeoTranslation(0, 0, -160);
143 m2->RegisterYourself();
144
145 TGeoCompositeShape *magcomp1 = new TGeoCompositeShape("magcomp1", "magnet1a:m1+magnet1b:m2+magnet1c+magnet1d");
146 TGeoVolume *magnet1 = new TGeoVolume("magnet1", magcomp1, Fe);
147 magnet1->SetLineColor(kYellow);
148 tMagnet->AddNode(magnet1, 1,
new TGeoTranslation(0, 0,
fSpecMagz));
149
151 m3.SetAngles(180, 0, 0);
153 TGeoCombiTrans m5(m4, m3);
154 TGeoHMatrix *m6 = new TGeoHMatrix(m5);
155 tMagnet->AddNode(magnet1, 2, m6);
156 }
157 else if(fDesign==2 || fDesign==3) {
158 Double_t Yokel = 1.25*
m;
160
161 Double_t bradius =
fDy/2.;
162 TGeoBBox *magyoke1 =
new TGeoBBox(
"magyoke1",
fDx+0.7*
m, bradius+1.2*
m, Yokel);
163 TGeoBBox *magyoke2 =
new TGeoBBox(
"magyoke2",
fDx-0.3*
m, bradius+0.2*
m, Yokel+0.01*cm);
164
165 TGeoCompositeShape *magyokec = new TGeoCompositeShape("magyokec", "magyoke1-magyoke2");
166 TGeoVolume *magyoke = new TGeoVolume("magyoke", magyokec, Fe);
167 magyoke->SetLineColor(kBlue);
168 tMagnet->AddNode(magyoke, 1,
new TGeoTranslation(0, 0,
fSpecMagz));
169
172 tMagnet->AddNode(SMS, 1,
new TGeoTranslation(0, -bradius-1.2*
m-hsupport,
fSpecMagz));
173
174
175 TGeoCompositeShape *MCoilc;
176 if(fDesign==2){
177 TGeoEltu *C2 =
new TGeoEltu(
"C2",
fDx,bradius+0.5*
m,Yokel+0.6*
m+magnetIncrease/2.);
178 TGeoEltu *C1 =
new TGeoEltu(
"C1",
fDx-0.3*
m,bradius+0.2*
m,Yokel+0.601*
m+magnetIncrease/2.);
179 TGeoBBox *Box1 =
new TGeoBBox(
"Box1", 1.*
m, bradius+0.51*
m, Yokel+0.61*
m+magnetIncrease/2.);
180 TGeoBBox *Box2 =
new TGeoBBox(
"Box2",
fDx+0.01*
m, bradius-0.5*
m, Yokel+0.01*
m+magnetIncrease/2.);
181 MCoilc = new TGeoCompositeShape("MCoilc", "C2-C1-magyokec-Box1-Box2");
182 }else{
183 TGeoBBox *C2 =
new TGeoBBox(
"C2",
fDx, bradius+0.5*
m, Yokel+0.6*
m+magnetIncrease/2.);
184 TGeoBBox *C1 =
new TGeoBBox(
"C1",
fDx-0.3*
m, bradius+0.2*
m, Yokel+0.601*
m+magnetIncrease/2.);
185 MCoilc = new TGeoCompositeShape("MCoilc", "C2-C1-magyokec");
186 }
187 TGeoVolume *MCoil = new TGeoVolume("MCoil", MCoilc, Al);
188 MCoil->SetLineColor(kYellow);
189
190 tMagnet->AddNode(MCoil, 1,
new TGeoTranslation(0, 0,
fSpecMagz));
191
192 }else if(fDesign==4) {
193
194 Double_t xaperture=
fDx;
195 Double_t yaperture=
fDy;
196
198 TGeoBBox *magyoke2 =
new TGeoBBox(
"magyoke2", xaperture,yaperture,
YokeDepth+1.);
199 TGeoCompositeShape *magyokec = new TGeoCompositeShape("magyokec", "magyoke1-magyoke2");
200
202 TGeoBBox *my2 =
new TGeoBBox(
"my2", xaperture-0.1*cm,yaperture-0.1*cm,
YokeDepth+1.);
203 TGeoCompositeShape *myc = new TGeoCompositeShape("myc", "my1-my2");
204 TGeoVolume *magyoke = new TGeoVolume("magyoke", magyokec, Fe);
205 magyoke->SetLineColor(kBlue);
206 tMagnet->AddNode(magyoke, 1,
new TGeoTranslation(0, 0,
fSpecMagz));
207
209 TGeoTranslation *
t1 =
new TGeoTranslation(
"t1",xaperture,yaperture-
CoilThick,0.);
t1->RegisterYourself();
210 TGeoTranslation *t2 =
new TGeoTranslation(
"t2",-xaperture,yaperture-
CoilThick,0.); t2->RegisterYourself();
211 TGeoCompositeShape *CTop1 = new TGeoCompositeShape("CTop1", "CTop:t1-myc");
212 TGeoCompositeShape *CTop2 = new TGeoCompositeShape("CTop2", "CTop:t2-myc");
213 TGeoVolume *MCoil1 = new TGeoVolume("MCoil1", CTop1, Al);
214 TGeoVolume *MCoil2 = new TGeoVolume("MCoil2", CTop2, Al);
215 MCoil1->SetLineColor(kYellow);
216 tMagnet->AddNode(MCoil1, 1,
new TGeoTranslation(0, 0,
fSpecMagz));
217 MCoil2->SetLineColor(kYellow);
218 tMagnet->AddNode(MCoil2, 1,
new TGeoTranslation(0, 0,
fSpecMagz));
219
221 TGeoTranslation *b1 =
new TGeoTranslation(
"b1",xaperture,-yaperture+
CoilThick,0.); b1->RegisterYourself();
222 TGeoTranslation *b2 =
new TGeoTranslation(
"b2",-xaperture,-yaperture+
CoilThick,0.); b2->RegisterYourself();
223 TGeoCompositeShape *CBot1 = new TGeoCompositeShape("CBot1", "CBot:b1-myc");
224 TGeoCompositeShape *CBot2 = new TGeoCompositeShape("CBot2", "CBot:b2-myc");
225 TGeoVolume *MCoil3 = new TGeoVolume("MCoil3", CBot1, Al);
226 TGeoVolume *MCoil4 = new TGeoVolume("MCoil4", CBot2, Al);
227 MCoil3->SetLineColor(kYellow);
228 tMagnet->AddNode(MCoil3, 1,
new TGeoTranslation(0, 0,
fSpecMagz));
229 MCoil4->SetLineColor(kYellow);
230 tMagnet->AddNode(MCoil4, 1,
new TGeoTranslation(0, 0,
fSpecMagz));
231
233 TGeoVolume *CV = new TGeoVolume("CV", CVert, Al);
234 CV->SetLineColor(kYellow);
239
240
241 }
242}
Int_t InitMedium(const char *name)
TGeoVolume * MagnetSupport(Double_t hwidth, Double_t hheight, Double_t dz, Int_t colour, TGeoMedium *material)