SND@LHC Software
Loading...
Searching...
No Matches
ShipMagnet Class Reference

#include <ShipMagnet.h>

Inheritance diagram for ShipMagnet:
Collaboration diagram for ShipMagnet:

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 ()
 
virtual ~ShipMagnet ()
 
void ConstructGeometry ()
 
TGeoVolume * MagnetSupport (Double_t hwidth, Double_t hheight, Double_t dz, Int_t colour, TGeoMedium *material)
 
Int_t InitMedium (const char *name)
 

Public Attributes

ClassDef(ShipMagnet, 5) protected 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 11 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. 
)

Definition at line 36 of file ShipMagnet.cxx.

37 : FairModule(name ,Title)
38{
39 fDesign = c;
40 fSpecMagz = z;
41 fDy = dy;
42 fDx = dx;
44 YokeWidth = YW;
45 YokeDepth = YD;
46 CoilThick = CT;
47}
Double_t floorheight
Definition ShipMagnet.h:26
Double_t YokeWidth
Definition ShipMagnet.h:25
ClassDef(ShipMagnet, 5) protected Int_t fSpecMagz
Definition ShipMagnet.h:18
Double_t fDy
Definition ShipMagnet.h:23
Double_t fDx
Definition ShipMagnet.h:24
Double_t CoilThick
Definition ShipMagnet.h:25
Double_t YokeDepth
Definition ShipMagnet.h:25
int fDesign
Definition ShipGeo.py:4
c
Definition hnl.py:100

◆ ShipMagnet() [2/2]

ShipMagnet::ShipMagnet ( )

Definition at line 31 of file ShipMagnet.cxx.

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

◆ ~ShipMagnet()

ShipMagnet::~ShipMagnet ( )
virtual

Definition at line 28 of file ShipMagnet.cxx.

29{
30}

Member Function Documentation

◆ ConstructGeometry()

void ShipMagnet::ConstructGeometry ( )

Definition at line 107 of file ShipMagnet.cxx.

108{
109
110 TGeoVolume *top=gGeoManager->GetTopVolume();
111 InitMedium("iron");
112 TGeoMedium *Fe =gGeoManager->GetMedium("iron");
113 InitMedium("Aluminum");
114 TGeoMedium *Al =gGeoManager->GetMedium("Aluminum");
115 TGeoVolumeAssembly *tMagnet = new TGeoVolumeAssembly("SHiPMagnet");
116 top->AddNode(tMagnet, 1, new TGeoTranslation(0, 0, 0));
117
118 Double_t cm = 1;
119 Double_t m = 100*cm;
120 if (fDesign==1){
121 // magnet yoke
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 //magyoke->SetTransparency(50);
129 tMagnet->AddNode(magyoke, 1, new TGeoTranslation(0, 0, 1940));
130
131 // magnet
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 // magnet composite shape matrices
138 TGeoTranslation *m1 = new TGeoTranslation(0, 0, 160);
139 m1->SetName("m1");
140 m1->RegisterYourself();
141 TGeoTranslation *m2 = new TGeoTranslation(0, 0, -160);
142 m2->SetName("m2");
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)); // 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 }
157 else if(fDesign==2 || fDesign==3) { // fDesign==2 TP version, fDesign==3, rectangular version
158 Double_t Yokel = 1.25*m;
159 Double_t magnetIncrease = 100.*cm;
160 // magnet yoke
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
170 Double_t hsupport=(10.*m-(bradius+1.2*m)-floorheight)/2.;
171 TGeoVolume* SMS =MagnetSupport(fDx+0.7*m, hsupport, Yokel,15,Fe);
172 tMagnet->AddNode(SMS, 1, new TGeoTranslation(0, -bradius-1.2*m-hsupport, fSpecMagz));
173
174 //Attempt to make Al coils...
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) { // rectangular a la MISIS, full opening for vessel
193 //define dimensions
194 Double_t xaperture=fDx; //half apertures
195 Double_t yaperture=fDy;
196 //built the yoke
197 TGeoBBox *magyoke1 = new TGeoBBox("magyoke1", xaperture+YokeWidth,yaperture+YokeWidth,YokeDepth);
198 TGeoBBox *magyoke2 = new TGeoBBox("magyoke2", xaperture,yaperture,YokeDepth+1.);
199 TGeoCompositeShape *magyokec = new TGeoCompositeShape("magyokec", "magyoke1-magyoke2");
200 //and a epsilon larger yoke to subtract while making the coils
201 TGeoBBox *my1 = new TGeoBBox("my1", xaperture+YokeWidth,yaperture+YokeWidth,YokeDepth+0.1*cm);
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 //and the coils: top
208 TGeoTubeSeg *CTop = new TGeoTubeSeg("CTop",1.*cm,YokeWidth,YokeDepth+CoilThick+1.*cm,0.,180.);
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 //coils bottom
220 TGeoTubeSeg *CBot = new TGeoTubeSeg("CBot",1.*cm,YokeWidth,YokeDepth+CoilThick+1.*cm,180.,360.);
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 //add vertical coils
232 TGeoBBox *CVert = new TGeoBBox("CVert",YokeWidth/2.,yaperture-CoilThick,CoilThick/2.);
233 TGeoVolume *CV = new TGeoVolume("CV", CVert, Al);
234 CV->SetLineColor(kYellow);
235 tMagnet->AddNode(CV, 1, new TGeoTranslation(xaperture+YokeWidth/2., 0, fSpecMagz-YokeDepth-CoilThick/2.));
236 tMagnet->AddNode(CV, 2, new TGeoTranslation(-xaperture-YokeWidth/2., 0, fSpecMagz-YokeDepth-CoilThick/2.));
237 tMagnet->AddNode(CV, 3, new TGeoTranslation(xaperture+YokeWidth/2., 0, fSpecMagz+YokeDepth+CoilThick/2.));
238 tMagnet->AddNode(CV, 4, new TGeoTranslation(-xaperture-YokeWidth/2., 0, fSpecMagz+YokeDepth+CoilThick/2.));
239
240
241 }
242}
Double_t cm
Double_t m
Int_t InitMedium(const char *name)
TGeoVolume * MagnetSupport(Double_t hwidth, Double_t hheight, Double_t dz, Int_t colour, TGeoMedium *material)
t1
Definition g4Ex.py:302
int m3
Definition hepunit.py:58
int m2
Definition hepunit.py:57

◆ InitMedium()

Int_t ShipMagnet::InitMedium ( const char *  name)

Definition at line 50 of file ShipMagnet.cxx.

51{
52 static FairGeoLoader *geoLoad=FairGeoLoader::Instance();
53 static FairGeoInterface *geoFace=geoLoad->getGeoInterface();
54 static FairGeoMedia *media=geoFace->getMedia();
55 static FairGeoBuilder *geoBuild=geoLoad->getGeoBuilder();
56
57 FairGeoMedium *ShipMedium=media->getMedium(name);
58
59 if (!ShipMedium)
60 {
61 Fatal("InitMedium","Material %s not defined in media file.", name);
62 return -1111;
63 }
64 TGeoMedium* medium=gGeoManager->GetMedium(name);
65 if (medium!=NULL)
66 return ShipMedium->getMediumIndex();
67
68 return geoBuild->createMedium(ShipMedium);
69}

◆ MagnetSupport()

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

Definition at line 71 of file ShipMagnet.cxx.

72{
73
74 TGeoBBox *ms = new TGeoBBox("ms", hwidth,hheight-1.,dz);
75 //try to make SHiP like logo in support
76 Double_t swidth=30.; //
77 //6 cutouts from the front
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.);
87
88 //6 cutouts from the side
89 r1346=dz-swidth/2;
90 alpha=atan(hheight/dz)*180./TMath::Pi();
91 //cout << "magsupport: "<< swidth<<", "<<r25<<", "<< r1346<<", "<<alpha <<endl;
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();
99
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");
102
103 TGeoVolume *T = new TGeoVolume("TSUP", TS, material);
104 T->SetLineColor(colour);
105 return T;
106}
int ms
Definition hepunit.py:97

Member Data Documentation

◆ CoilThick

Double_t ShipMagnet::CoilThick

Definition at line 25 of file ShipMagnet.h.

◆ fDx

Double_t ShipMagnet::fDx

Definition at line 24 of file ShipMagnet.h.

◆ fDy

Double_t ShipMagnet::fDy

Definition at line 23 of file ShipMagnet.h.

◆ floorheight

Double_t ShipMagnet::floorheight

Definition at line 26 of file ShipMagnet.h.

◆ fSpecMagz

ClassDef (ShipMagnet,5) protected Int_t ShipMagnet::fSpecMagz

Definition at line 22 of file ShipMagnet.h.

◆ YokeDepth

Double_t ShipMagnet::YokeDepth

Definition at line 25 of file ShipMagnet.h.

◆ YokeWidth

Double_t ShipMagnet::YokeWidth

Definition at line 25 of file ShipMagnet.h.


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