FairRoot/PandaRoot
PndMdtCoil.cxx
Go to the documentation of this file.
1 
2 #include <iostream>
3 
4 #include "TClonesArray.h"
5 #include "TLorentzVector.h"
6 #include "TMath.h"
7 #include "TParticle.h"
8 #include "TGeoArb8.h"
9 #include "TGeoTrd2.h"
10 #include "TGeoTube.h"
11 #include "TGeoCompositeShape.h"
12 #include "TGeoMatrix.h"
13 #include "TGeoManager.h"
14 #include "TVirtualMC.h"
15 
16 #include "FairVolume.h"
17 #include "FairGeoMedia.h"
18 #include "FairGeoInterface.h"
19 #include "FairGeoLoader.h"
20 #include "FairGeoBuilder.h"
21 #include "FairRuntimeDb.h"
22 #include "FairRun.h"
23 #include "FairModule.h"
24 
25 #include "PndDetectorList.h"
26 #include "PndStack.h"
27 #include "PndMdt.h"
28 #include "PndMdtCoil.h"
29 
30 using namespace std;
31 
32 
34 {
35  TString vname = "cave";
36  vname = vname.Strip();
37  TGeoVolume* vcave = gGeoManager->FindVolumeFast(vname.Data());
38 
39  //General definitions
40 // TGeoVolume* mag = new TGeoVolumeAssembly("PndMdtMagnet");
41  TGeoVolume* mdtcoi = new TGeoVolumeAssembly("MdtCoil");
42 
43  FairGeoLoader*geoLoad = FairGeoLoader::Instance();
44  FairGeoInterface *geoFace = geoLoad->getGeoInterface();
45  FairGeoMedia *Media = geoFace->getMedia();
46  FairGeoBuilder *geobuild=geoLoad->getGeoBuilder();
47  FairGeoMedium *medmdtiron = Media->getMedium("iron");
48  geobuild->createMedium(medmdtiron);
49 
50 
51 
52 // MdtMagnetCoil ///////////
53 
54 
58 
60  TGeoTube* s_nbti = new TGeoTube("s_nbti",(1075.-1.3)/10,(1075.2+1.3)/10, (900-130)/20);
61  TGeoVolume* s_nbti_vol = new TGeoVolume("s_nbti_vol",s_nbti,gGeoManager->GetMedium("iron"));
62  TGeoTube* s_nbti1 = new TGeoTube("s_nbti1",(1075.-1.3)/10,(1075.2+1.3)/10, (470-130)/20);
63  TGeoVolume* s_nbti_vol1 = new TGeoVolume("s_nbti_vol1",s_nbti1,gGeoManager->GetMedium("iron"));
64  TGeoTube* s_nbti2 = new TGeoTube("s_nbti2",(1075.-1.3)/10,(1075.2+1.3)/10, (1500-730)/20);
65  TGeoVolume* s_nbti_vol2 = new TGeoVolume("s_nbti_vol2",s_nbti2,gGeoManager->GetMedium("iron"));
66 
67  TGeoTube* s_aldown = new TGeoTube("s_aldown",(1057.-15)/10,(1057.+15.)/10, (900-130)/20);
68 // TGeoVolume* s_aldown_vol = new TGeoVolume("s_aldown_vol",s_aldown,gGeoManager->GetMedium("aluminium"));
69  TGeoVolume* s_aldown_vol = new TGeoVolume("s_aldown_vol",s_aldown,gGeoManager->GetMedium("iron"));
70  TGeoTube* s_aldown1 = new TGeoTube("s_aldown1",(1057.-15)/10,(1057.+15.)/10, (470-130)/20);
71 // TGeoVolume* s_aldown_vol1 = new TGeoVolume("s_aldown_vol1",s_aldown1,gGeoManager->GetMedium("aluminium"));
72  TGeoVolume* s_aldown_vol1 = new TGeoVolume("s_aldown_vol1",s_aldown1,gGeoManager->GetMedium("iron"));
73  TGeoTube* s_aldown2 = new TGeoTube("s_aldown2",(1057.-15)/10,(1057.+15.)/10, (1500-730)/20);
74 // TGeoVolume* s_aldown_vol2 = new TGeoVolume("s_aldown_vol2",s_aldown2,gGeoManager->GetMedium("aluminium"));
75  TGeoVolume* s_aldown_vol2 = new TGeoVolume("s_aldown_vol2",s_aldown2,gGeoManager->GetMedium("iron"));
76 
77  TGeoTube* s_alup = new TGeoTube("s_alup",(1097.-15.)/10,(1097.+15.)/10, (900-130)/20);
78 // TGeoVolume* s_alup_vol = new TGeoVolume("s_alup_vol",s_alup,gGeoManager->GetMedium("aluminium"));
79  TGeoVolume* s_alup_vol = new TGeoVolume("s_alup_vol",s_alup,gGeoManager->GetMedium("iron"));
80  TGeoTube* s_alup1 = new TGeoTube("s_alup1",(1097.-15.)/10,(1097.+15.)/10, (470-130)/20);
81 // TGeoVolume* s_alup_vol1 = new TGeoVolume("s_alup_vol1",s_alup1,gGeoManager->GetMedium("aluminium"));
82  TGeoVolume* s_alup_vol1 = new TGeoVolume("s_alup_vol1",s_alup1,gGeoManager->GetMedium("iron"));
83  TGeoTube* s_alup2 = new TGeoTube("s_alup2",(1097.-15.)/10,(1097.+15.)/10, (1500-730)/20);
84 // TGeoVolume* s_alup_vol2 = new TGeoVolume("s_alup_vol2",s_alup2,gGeoManager->GetMedium("aluminium"));
85  TGeoVolume* s_alup_vol2 = new TGeoVolume("s_alup_vol2",s_alup2,gGeoManager->GetMedium("iron"));
86 
87  s_nbti_vol->SetLineColor(4);
88  s_nbti_vol1->SetLineColor(4);
89  s_nbti_vol2->SetLineColor(4);
90  s_alup_vol->SetLineColor(2);
91  s_alup_vol1->SetLineColor(2);
92  s_alup_vol2->SetLineColor(2);
93  s_aldown_vol->SetLineColor(2);
94  s_aldown_vol1->SetLineColor(2);
95  s_aldown_vol2->SetLineColor(2);
96 
97  mdtcoi->AddNode(s_nbti_vol,0, new TGeoTranslation(0.0,0.0,(-77-22.5)/2));
98  mdtcoi->AddNode(s_nbti_vol1,1, new TGeoTranslation(0.0,0.0,(47+17/2)/2));
99  mdtcoi->AddNode(s_nbti_vol2,2, new TGeoTranslation(0.0,0.0,(150+45+77/2)/2));
100 
101  mdtcoi->AddNode(s_aldown_vol,3, new TGeoTranslation(0.0,0.0,(-77-22.5)/2));
102  mdtcoi->AddNode(s_aldown_vol1,4, new TGeoTranslation(0.0,0.0,(47+17/2)/2));
103  mdtcoi->AddNode(s_aldown_vol2,5, new TGeoTranslation(0.0,0.0,(150+45+77/2)/2));
104 
105  mdtcoi->AddNode(s_alup_vol,6, new TGeoTranslation(0.0,0.0,(-77-22.5)/2));
106  mdtcoi->AddNode(s_alup_vol1,7, new TGeoTranslation(0.0,0.0,(47+17/2)/2));
107  mdtcoi->AddNode(s_alup_vol2,8, new TGeoTranslation(0.0,0.0,(150+45+77/2)/2));
108 
110 
112  TGeoTube* cr_fedown = new TGeoTube("cr_fedown",(960-2.)/10,(960+2.)/10, (1100+1790)/20);
113  TGeoVolume* cr_fedown_vol = new TGeoVolume("cr_fedown_vol",cr_fedown,gGeoManager->GetMedium("iron"));
114 
115 
117  TGeoTube* cr_aldown = new TGeoTube("cr_aldown",(990-20.)/10,(990+20.)/10, (1100+1790)/20);
118 // TGeoVolume* cr_aldown_vol = new TGeoVolume("cr_aldown_vol",cr_aldown,gGeoManager->GetMedium("aluminium"));
119  TGeoVolume* cr_aldown_vol = new TGeoVolume("cr_aldown_vol",cr_aldown,gGeoManager->GetMedium("iron"));
120 
121  cr_fedown_vol->SetLineColor(5);
122  cr_aldown_vol->SetLineColor(4);
123 
124  mdtcoi->AddNode(cr_fedown_vol,9, new TGeoTranslation(0.0,0.0,69./2));
125  mdtcoi->AddNode(cr_aldown_vol,10, new TGeoTranslation(0.0,0.0,69./2));
126 
127 
129  TGeoTube* cr_alup = new TGeoTube("cr_alup",(1180-40.)/10,(1180+40.)/10, (1100+1790)/20);
130 // TGeoVolume* cr_alup_vol = new TGeoVolume("cr_alup_vol",cr_alup,gGeoManager->GetMedium("aluminium"));
131  TGeoVolume* cr_alup_vol = new TGeoVolume("cr_alup_vol",cr_alup,gGeoManager->GetMedium("iron"));
132 
134  TGeoTube* cr_feup = new TGeoTube("cr_feup",(1240-6.2)/10,(1240+6.2)/10, (1100+1790)/20);
135  TGeoVolume* cr_feup_vol = new TGeoVolume("cr_feup_vol",cr_feup,gGeoManager->GetMedium("iron"));
136 
137  cr_alup_vol->SetLineColor(5);
138  cr_alup_vol->SetLineColor(4);
139 
140  mdtcoi->AddNode(cr_alup_vol,11, new TGeoTranslation(0.0,0.0,69./2));
141  mdtcoi->AddNode(cr_feup_vol,12, new TGeoTranslation(0.0,0.0,69./2));
143 // mag->AddNode(magCoil,1);
144 // vcave->AddNode(mag,1);
145 
146  vcave->AddNode(mdtcoi,1);
147 
148  return;
149 }
150 
FairGeoLoader * geoLoad
FairGeoMedia * Media
TGeoManager * gGeoManager
FairGeoBuilder * geobuild
Definition: PndMdt.h:20
ClassImp(PndAnaContFact)
FairGeoInterface * geoFace
void PndMdtCoil()
Definition: PndMdtCoil.cxx:33