74 TGeoBBox *ms =
new TGeoBBox(
"ms", hwidth,hheight-1.,dz);
78 Double_t r25=hheight-swidth/2.;
79 Double_t r1346=hwidth-swidth/2;
80 Double_t alpha=atan(hheight/hwidth)*180./TMath::Pi();
81 TGeoTubeSeg *FL1 =
new TGeoTubeSeg(
"FL1",swidth,r1346,dz+1.,5.,alpha-5.);
82 TGeoTubeSeg *FL3 =
new TGeoTubeSeg(
"FL3",swidth,r1346,dz+1.,180-alpha+5.,175.);
83 TGeoTubeSeg *FL4 =
new TGeoTubeSeg(
"FL4",swidth,r1346,dz+1.,185.,180.+alpha-5.);
84 TGeoTubeSeg *FL6 =
new TGeoTubeSeg(
"FL6",swidth,r1346,dz+1.,360.-alpha+5.,355.);
85 TGeoTubeSeg *FL2 =
new TGeoTubeSeg(
"FL2",swidth,r25,dz+1.,alpha+5.,180-alpha-5.);
86 TGeoTubeSeg *FL5 =
new TGeoTubeSeg(
"FL5",swidth,r25,dz+1.,180.+alpha+5.,360.-alpha-5.);
90 alpha=atan(hheight/dz)*180./TMath::Pi();
92 TGeoTubeSeg *SL1 =
new TGeoTubeSeg(
"SL1",swidth,r1346,hwidth+1.,5.,alpha-5.);
93 TGeoTubeSeg *SL3 =
new TGeoTubeSeg(
"SL3",swidth,r1346,hwidth+1.,180-alpha+5.,175.);
94 TGeoTubeSeg *SL4 =
new TGeoTubeSeg(
"SL4",swidth,r1346,hwidth+1.,185.,180.+alpha-5.);
95 TGeoTubeSeg *SL6 =
new TGeoTubeSeg(
"SL6",swidth,r1346,hwidth+1.,360.-alpha+5.,355.);
96 TGeoTubeSeg *SL2 =
new TGeoTubeSeg(
"SL2",swidth,r25,hwidth+1.,alpha+5.,180-alpha-5.);
97 TGeoTubeSeg *SL5 =
new TGeoTubeSeg(
"SL5",swidth,r25,hwidth+1.,180.+alpha+5.,360.-alpha-5.);
98 TGeoRotation *r =
new TGeoRotation(
"r"); r->RotateY(90.); r->RegisterYourself();
100 TGeoCompositeShape *TS =
new TGeoCompositeShape(
"TS",\
101 "ms-FL1-FL2-FL3-FL4-FL5-FL6-SL1:r-SL2:r-SL3:r-SL4:r-SL5:r-SL6:r");
103 TGeoVolume *T =
new TGeoVolume(
"TSUP", TS, material);
104 T->SetLineColor(colour);
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));
122 TGeoBBox *magyoke1 =
new TGeoBBox(
"magyoke1", 350, 350, 125);
123 TGeoBBox *magyoke2 =
new TGeoBBox(
"magyoke2", 250, 250, 126);
125 TGeoCompositeShape *magyokec =
new TGeoCompositeShape(
"magyokec",
"magyoke1-magyoke2");
126 TGeoVolume *magyoke =
new TGeoVolume(
"magyoke", magyokec, Fe);
127 magyoke->SetLineColor(kBlue);
129 tMagnet->AddNode(magyoke, 1,
new TGeoTranslation(0, 0, 1940));
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);
138 TGeoTranslation *m1 =
new TGeoTranslation(0, 0, 160);
140 m1->RegisterYourself();
141 TGeoTranslation *m2 =
new TGeoTranslation(0, 0, -160);
143 m2->RegisterYourself();
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));
151 m3.SetAngles(180, 0, 0);
153 TGeoCombiTrans m5(m4, m3);
154 TGeoHMatrix *m6 =
new TGeoHMatrix(m5);
155 tMagnet->AddNode(magnet1, 2, m6);
157 else if(fDesign==2 || fDesign==3) {
158 Double_t Yokel = 1.25*
m;
159 Double_t magnetIncrease = 100.*
cm;
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);
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));
172 tMagnet->AddNode(SMS, 1,
new TGeoTranslation(0, -bradius-1.2*
m-hsupport,
fSpecMagz));
175 TGeoCompositeShape *MCoilc;
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");
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");
187 TGeoVolume *MCoil =
new TGeoVolume(
"MCoil", MCoilc, Al);
188 MCoil->SetLineColor(kYellow);
190 tMagnet->AddNode(MCoil, 1,
new TGeoTranslation(0, 0,
fSpecMagz));
192 }
else if(fDesign==4) {
194 Double_t xaperture=
fDx;
195 Double_t yaperture=
fDy;
198 TGeoBBox *magyoke2 =
new TGeoBBox(
"magyoke2", xaperture,yaperture,
YokeDepth+1.);
199 TGeoCompositeShape *magyokec =
new TGeoCompositeShape(
"magyokec",
"magyoke1-magyoke2");
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));
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));
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));
233 TGeoVolume *CV =
new TGeoVolume(
"CV", CVert, Al);
234 CV->SetLineColor(kYellow);