FairRoot/PandaRoot
PndMdtMFIron.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 "TFile.h"
8 #include "TTree.h"
9 #include "TParticle.h"
10 #include "TGeoArb8.h"
11 #include "TGeoTrd2.h"
12 #include "TGeoCompositeShape.h"
13 #include "TGeoMatrix.h"
14 #include "TGeoManager.h"
15 #include "TVirtualMC.h"
16 
17 #include "FairVolume.h"
18 #include "FairGeoMedia.h"
19 #include "FairGeoInterface.h"
20 #include "FairGeoLoader.h"
21 #include "FairGeoBuilder.h"
22 #include "FairRuntimeDb.h"
23 #include "FairRun.h"
24 #include "FairModule.h"
25 
26 #include "PndDetectorList.h"
27 #include "PndStack.h"
28 #include "PndMdt.h"
29 #include "PndMdtMFIron.h"
30 
31 using namespace std;
32 
33 
35 {
36  TString vname = "cave";
37  vname = vname.Strip();
38  TGeoVolume* vcave = gGeoManager->FindVolumeFast(vname.Data());
39 
40 //General definitions
41  TGeoVolume* mdtmfi = new TGeoVolumeAssembly("MdtMFIron");
42 
43 //Additional definitions
44  Text_t buffer[30];
45  Text_t longbuffer[250];
46  //Double_t mpx, mpy, mpz;
47  //Double_t mx0, my0, //[R.K. 01/2017] unused variable?
48  Double_t mz0;
49  Double_t my;
50  //int k; //[R.K. 01/2017] unused variable?
51  Double_t dx1, dx2, dy1, dy2, dz;
52  TGeoRotation tRot, tRotSlice;
53  //Double_t angle; //[R.K. 01/2017] unused variable?
54 
55  FairGeoLoader*geoLoad = FairGeoLoader::Instance();
56  FairGeoInterface *geoFace = geoLoad->getGeoInterface();
57  FairGeoMedia *Media = geoFace->getMedia();
58  FairGeoBuilder *geobuild=geoLoad->getGeoBuilder();
59  FairGeoMedium *medIron = Media->getMedium("iron");
60  geobuild->createMedium(medIron);
61 
62 //creating the holes
63  new TGeoBBox("mfihbox2",((Double_t)PndMdtMFIron_H02_H)/10.0,10.0+((Double_t)PndMdtMFIron_Th2)/10.0,((Double_t)PndMdtMFIron_H02_V)/10.0,0);
64  new TGeoBBox("mfihbox3",((Double_t)PndMdtMFIron_H03_H)/10.0,10.0+((Double_t)PndMdtMFIron_Th2)/10.0,((Double_t)PndMdtMFIron_H03_V)/10.0,0);
65  new TGeoBBox("mfihbox4",((Double_t)PndMdtMFIron_H04_H)/10.0,10.0+((Double_t)PndMdtMFIron_Th2)/10.0,((Double_t)PndMdtMFIron_H04_V)/10.0,0);
66  new TGeoBBox("mfihbox5",((Double_t)PndMdtMFIron_H05_H)/10.0,10.0+((Double_t)PndMdtMFIron_Th2)/10.0,((Double_t)PndMdtMFIron_H05_V)/10.0,0);
67  new TGeoBBox("mfihbox6",((Double_t)PndMdtMFIron_H06_H)/10.0,10.0+((Double_t)PndMdtMFIron_Th2)/10.0,((Double_t)PndMdtMFIron_H06_V)/10.0,0);
68  new TGeoBBox("mfihboxpmp2",((Double_t)PndMdtMFIron_PUMP_H)/10.0,10.0+((Double_t)PndMdtMFIron_Th2)/10.0,((Double_t)PndMdtMFIron_PUMP_V)/10.0,0);
69  new TGeoBBox("mfihboxpmp3",((Double_t)PndMdtMFIron_PUMP_H)/10.0,10.0+((Double_t)PndMdtMFIron_Th2)/10.0,((Double_t)PndMdtMFIron_PUMP_V)/10.0,0);
70  new TGeoBBox("mfihboxpmp4",((Double_t)PndMdtMFIron_PUMP_H)/10.0,10.0+((Double_t)PndMdtMFIron_Th2)/10.0,((Double_t)PndMdtMFIron_PUMP_V)/10.0,0);
71  new TGeoBBox("mfihboxpmp5",((Double_t)PndMdtMFIron_PUMP_H)/10.0,10.0+((Double_t)PndMdtMFIron_Th2)/10.0,((Double_t)PndMdtMFIron_PUMP_V)/10.0,0);
72  new TGeoBBox("mfihboxpmp6",((Double_t)PndMdtMFIron_PUMP_H)/10.0,10.0+((Double_t)PndMdtMFIron_Th2)/10.0,((Double_t)PndMdtMFIron_PUMP_V)/10.0,0);
73 
74 
75 
76 //MdtMF
77  tRot.RotateX(90.0);
78  TGeoRotation mfitgrl;
79  mfitgrl.RotateY(0.0);
80  TGeoRotation* mfitgr0 = new TGeoRotation(mfitgrl);
81  mfitgr0->SetName("mfitgr0");
82  mfitgr0->RegisterYourself();
83  mfitgrl.RotateY(45.0);
84  TGeoRotation* mfitgr1 = new TGeoRotation(mfitgrl);
85  mfitgr1->SetName("mfitgr1");
86  mfitgr1->RegisterYourself();
87  mfitgrl.RotateY(45.0);
88  TGeoRotation* mfitgr2 = new TGeoRotation(mfitgrl);
89  mfitgr2->SetName("mfitgr2");
90  mfitgr2->RegisterYourself();
91  mfitgrl.RotateY(45.0);
92  TGeoRotation* mfitgr3 = new TGeoRotation(mfitgrl);
93  mfitgr3->SetName("mfitgr3");
94  mfitgr3->RegisterYourself();
95  mfitgrl.RotateY(45.0);
96  TGeoRotation* mfitgr4 = new TGeoRotation(mfitgrl);
97  mfitgr4->SetName("mfitgr4");
98  mfitgr4->RegisterYourself();
99  mfitgrl.RotateY(45.0);
100  TGeoRotation* mfitgr5 = new TGeoRotation(mfitgrl);
101  mfitgr5->SetName("mfitgr5");
102  mfitgr5->RegisterYourself();
103  mfitgrl.RotateY(45.0);
104  TGeoRotation* mfitgr6 = new TGeoRotation(mfitgrl);
105  mfitgr6->SetName("mfitgr6");
106  mfitgr6->RegisterYourself();
107  mfitgrl.RotateY(45.0);
108  TGeoRotation* mfitgr7 = new TGeoRotation(mfitgrl);
109  mfitgr7->SetName("mfitgr7");
110  mfitgr7->RegisterYourself();
111 
112  dx2 = 0.0;
113  dy1 = (Double_t)PndMdtMFIron_Th2;
114  dy2 = (Double_t)PndMdtMFIron_Th2;
115  dx1 = ((Double_t)PndMdtMFIron_Height)*(TMath::Tan(TMath::ACos(-1.0)/8.0));
116  my = ((Double_t)PndMdtMFIron_Height)/2.0;
117  dz = ((Double_t)PndMdtMFIron_Height)/2.0;
118  TGeoTranslation* mfitgt = new TGeoTranslation(0.0,0.0,my/(-10.0));
119  mfitgt->SetName("mfitgt");
120  mfitgt->RegisterYourself();
121  new TGeoTrd2("mfitrd",dx1/10.0,dx2/10.0,dy1/10.0,dy2/10.0,dz/10.0);
122 
123  for(int i=0; i<5; i++)
124  {
125  switch(i)
126  {
127  case 0:
129  break;
130  case 1:
132  break;
133  case 2:
135  break;
136  case 3:
138  break;
139  case 4:
141  break;
142  };
143  for(int j=0; j<8; j++)
144  {
145  sprintf(buffer,"mfitgcs%i",(8*i)+j);
146  sprintf(longbuffer,"mfitrd:mfitgt-mfihbox%i:mfitgr%i-mfihboxpmp%i:mfitgr%i",i+2,j,i+2,j);
147  TGeoCompositeShape* mfitgcs = new TGeoCompositeShape(buffer,longbuffer);
148  sprintf(buffer,"mag%i",600+8*i+j);
149  TGeoVolume* volume = new TGeoVolume(buffer,mfitgcs,gGeoManager->GetMedium("iron"));
150  volume->SetLineColor(3);
151  mdtmfi->AddNode(volume,600+8*i+j,new TGeoCombiTrans(0.0,0.0,mz0/10.0,new TGeoRotation(tRot)));
152  tRot.RotateZ(-45.0);
153  };
154  };
155 
156  vcave->AddNode(mdtmfi,1);
157 
158  return;
159 }
160 
#define PndMdtMFIron_Th2
Definition: PndMdtMFIron.h:10
FairGeoLoader * geoLoad
Int_t i
Definition: run_full.C:25
FairGeoMedia * Media
#define PndMdtMFIron_H03_V
Definition: PndMdtMFIron.h:24
float Tan(float x)
Definition: PndCAMath.h:165
void PndMdtMFIron()
TGeoManager * gGeoManager
#define PndMdtMFIron_H05_H
Definition: PndMdtMFIron.h:29
#define PndMdtMFIron_PUMP_V
Definition: PndMdtMFIron.h:34
#define PndMdtMFIron_PUMP_H
Definition: PndMdtMFIron.h:35
#define PndMdtMFIron_H06_V
Definition: PndMdtMFIron.h:30
FairGeoBuilder * geobuild
#define PndMdtMFIron_L201
Definition: PndMdtMFIron.h:16
Double_t
#define PndMdtMFIron_H02_V
Definition: PndMdtMFIron.h:22
#define PndMdtMFIron_H03_H
Definition: PndMdtMFIron.h:25
#define PndMdtMFIron_L202
Definition: PndMdtMFIron.h:17
#define PndMdtMFIron_Height
Definition: PndMdtMFIron.h:13
#define PndMdtMFIron_L204
Definition: PndMdtMFIron.h:19
#define PndMdtMFIron_H05_V
Definition: PndMdtMFIron.h:28
#define PndMdtMFIron_H04_V
Definition: PndMdtMFIron.h:26
#define PndMdtMFIron_L200
Definition: PndMdtMFIron.h:15
Definition: PndMdt.h:20
ClassImp(PndAnaContFact)
#define PndMdtMFIron_L203
Definition: PndMdtMFIron.h:18
FairGeoInterface * geoFace
#define PndMdtMFIron_H02_H
Definition: PndMdtMFIron.h:23
#define PndMdtMFIron_H06_H
Definition: PndMdtMFIron.h:31
#define PndMdtMFIron_H04_H
Definition: PndMdtMFIron.h:27