FairRoot/PandaRoot
createGeoJuelichSetup1.C
Go to the documentation of this file.
1  // Tracking station for the MVD of PANDA
2  // Setup Nr. 1 used in Beamtime Feb/02 to Feb/06/2010
3  // setup was used at Feb/02 and from Feb/04 until Feb/06
4 
5  // Simone Bianco 15/12/2009
6 
7  {
8  // Sizes of the detectors
9 
10  // Detectors defined as TGeoBBoxes, so the following kDx,kDy and kDz
11  // are half of the real sizes of the boxes
12 
13  const Double_t kDx = 0.96; // in cm!!
14  const Double_t kDy = 0.96; // in cm!!
15  const Double_t kDz = 0.015; // in cm!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
16 
17  // Positions of the detector
18 
19  // Sensors displaced along z, laying on perpendicular xy plane,
20  // there centered in (0,0)
21 
22  // 2 double sided sensors
23 
24  const Double_t kPos1 = 11.0; // (cm) Box 1
25  const Double_t kPos2 = 183.2; // (cm) Box 4
26 
27  // single sided sensors
28  // this is the position of the center of the system
29  // containing the two single sides detectors
30 
31  const Double_t kPos3 = 80.7; // (cm) Box 2
32  const Double_t kPos4 = 139.0; // (cm) Box 3
33 
34  // Gap between the two single sides sensors
35 
36  const Double_t kGap3 = 0.45; // (cm)
37  const Double_t kGap4 = 0.45; // (cm)
38 
39 
40  //##################################################
41 
42 
43  gROOT->Macro("$VMCWORKDIR/gconfig/rootlogon.C");
44 
45  // Load this libraries
46  gSystem->Load("libGeoBase");
47  gSystem->Load("libParBase");
48  gSystem->Load("libBase");
49  gSystem->Load("libPndData");
50  gSystem->Load("libPassive");
51 
52  TString outfile= "TrackingStation.root";
53  //TFile* fi = new TFile(outfile,"RECREATE");
54 
55  FairGeoLoader* geoLoad = new FairGeoLoader("TGeo","FairGeoLoader");
56  FairGeoInterface *geoFace = geoLoad->getGeoInterface();
57  geoFace->setMediaFile("../../../geometry/media_pnd.geo");
58  geoFace->readMedia();
59  geoFace->print();
60 
61  //##################################################
62 
63  FairGeoMedia *Media = geoFace->getMedia();
64  FairGeoBuilder *geobuild=geoLoad->getGeoBuilder();
65 
66  FairGeoMedium *CbmMediumAir = Media->getMedium("air");
67  FairGeoMedium *CbmMediumSilicon = Media->getMedium("silicon");
68 
69  Int_t nmed=geobuild->createMedium(CbmMediumAir);
70  nmed=geobuild->createMedium(CbmMediumSilicon);
71 
72  TGeoManager* gGeoMan = (TGeoManager*)gROOT->FindObject("FAIRGeom");
73 
74  TGeoVolume *top = new TGeoVolumeAssembly("TS");
75 
76  gGeoMan->SetTopVolume(top);
77 
78  TGeoShape *BoxDouble1 = new TGeoBBox("StripActiveTD1", kDx, kDy, kDz);
79  TGeoShape *BoxDouble2 = new TGeoBBox("StripActiveTD2", kDx, kDy, kDz);
80  TGeoShape *BoxSingle1 = new TGeoBBox("StripActiveTS1", kDx, kDy, kDz);
81  TGeoShape *BoxSingle2 = new TGeoBBox("StripActiveTS2", kDx, kDy, kDz);
82  TGeoShape *BoxSingle3 = new TGeoBBox("StripActiveTS3", kDx, kDy, kDz);
83  TGeoShape *BoxSingle4 = new TGeoBBox("StripActiveTS4", kDx, kDy, kDz);
84 
85  TGeoVolume* BoxVolDouble1 = new TGeoVolume("StripActiveTD1",BoxDouble1,gGeoMan->GetMedium("silicon"));
86  TGeoVolume* BoxVolDouble2 = new TGeoVolume("StripActiveTD2",BoxDouble2,gGeoMan->GetMedium("silicon"));
87  TGeoVolume* BoxVolSingle3a = new TGeoVolume("StripActiveTS3a",BoxSingle1,gGeoMan->GetMedium("silicon"));
88  TGeoVolume* BoxVolSingle3b = new TGeoVolume("StripActiveTS3b",BoxSingle2,gGeoMan->GetMedium("silicon"));
89  TGeoVolume* BoxVolSingle4a = new TGeoVolume("StripActiveTS4a",BoxSingle3,gGeoMan->GetMedium("silicon"));
90  TGeoVolume* BoxVolSingle4b = new TGeoVolume("StripActiveTS4b",BoxSingle4,gGeoMan->GetMedium("silicon"));
91 
92 
93  TGeoTranslation* trt1 = new TGeoTranslation(0.,0.,kPos1);
94  TGeoTranslation* trt2 = new TGeoTranslation(0.,0.,kPos2);
95  TGeoTranslation* trt3a = new TGeoTranslation(0.,0.,kPos3 - 0.5*kGap3 - kDz/2.);
96  TGeoTranslation* trt3b = new TGeoTranslation(0.,0.,kPos3 + 0.5*kGap3 + kDz/2.);
97  TGeoTranslation* trt4a = new TGeoTranslation(0.,0.,kPos4 - 0.5*kGap4 - kDz/2.);
98  TGeoTranslation* trt4b = new TGeoTranslation(0.,0.,kPos4 + 0.5*kGap4 + kDz/2.);
99 
100  TGeoRotation* dummyrot = new TGeoRotation();
101  TGeoRotation* rot1 = new TGeoRotation("",90.,0.,0.);
102 
103  TGeoCombiTrans* trc1= new TGeoCombiTrans(*trt1,*dummyrot);
104  trc1->SetName("Sensor1");
105  trc1->RegisterYourself();
106 
107  TGeoCombiTrans* trc2= new TGeoCombiTrans(*trt2,*dummyrot);
108  trc2->SetName("Sensor2");
109  trc2->RegisterYourself();
110 
111  TGeoCombiTrans* trc3a= new TGeoCombiTrans(*trt3a,*dummyrot);
112  trc3a->SetName("Sensor3a");
113  trc3a->RegisterYourself();
114 
115  // TGeoCombiTrans* trc3b= new TGeoCombiTrans(*trt3b,*dummyrot);
116  TGeoCombiTrans* trc3b= new TGeoCombiTrans(*trt3b,*rot1);
117  trc3b->SetName("Sensor3b");
118  trc3b->RegisterYourself();
119 
120  TGeoCombiTrans* trc4a= new TGeoCombiTrans(*trt4a,*dummyrot);
121  trc4a->SetName("Sensor4a");
122  trc4a->RegisterYourself();
123 
124  // TGeoCombiTrans* trc4b= new TGeoCombiTrans(*trt4b,*dummyrot);
125  TGeoCombiTrans* trc4b= new TGeoCombiTrans(*trt4b,*rot1);
126  trc4b->SetName("Sensor4b");
127  trc4b->RegisterYourself();
128 
129  TGeoVolumeAssembly* SubunitVol = new TGeoVolumeAssembly("TTVol");
130 
131  TGeoVolumeAssembly* SubunitDouble = new TGeoVolumeAssembly("TTDouble");
132 
133  SubunitDouble->AddNode(BoxVolDouble1,0,trc1);
134  SubunitDouble->AddNode(BoxVolDouble2,0,trc2);
135 
136  TGeoVolumeAssembly* SubunitSingle = new TGeoVolumeAssembly("TTSingle");
137 
138  SubunitSingle->AddNode(BoxVolSingle3a,0,trc3a);
139  SubunitSingle->AddNode(BoxVolSingle3b,0,trc3b);
140  SubunitSingle->AddNode(BoxVolSingle4a,0,trc4a);
141  SubunitSingle->AddNode(BoxVolSingle4b,0,trc4b);
142 
143  SubunitVol->AddNode(SubunitDouble,0,new TGeoCombiTrans());
144  SubunitVol->AddNode(SubunitSingle,0,new TGeoCombiTrans());
145 
146  top->AddNode(SubunitVol,0,new TGeoCombiTrans());
147 
148  gGeoMan->CloseGeometry();
149  gGeoMan->Export(outfile.Data());
150  //top->Write();
151  //fi->Close();
152  //gGeoManager->Export(outfile);
153  //top->Draw("ogl");
154 }
155 
TGeoVolume * BoxVolSingle4a
TGeoRotation * dummyrot
TGeoTranslation * trt4b
TGeoVolume * BoxVolSingle3b
FairGeoLoader * geoLoad
FairGeoMedia * Media
TGeoVolumeAssembly * SubunitDouble
TGeoManager * gGeoMan
TGeoTranslation * trt2
TGeoShape * BoxSingle4
const Double_t kPos4
const Double_t kGap3
TGeoCombiTrans * trc3b
TGeoTranslation * trt1
TGeoVolume * top
TGeoRotation * rot1
TGeoVolume * SubunitVol
TGeoVolume * BoxVolSingle4b
TGeoShape * BoxDouble1
TGeoShape * BoxDouble2
TGeoShape * BoxSingle3
TGeoVolume * BoxVolDouble1
FairGeoMedium * CbmMediumSilicon
const Double_t kDy
FairGeoBuilder * geobuild
const Double_t kDz
Double_t
const Double_t kPos2
TGeoTranslation * trt4a
TGeoCombiTrans * trc4a
TGeoVolumeAssembly * SubunitSingle
TGeoTranslation * trt3b
FairGeoMedium * CbmMediumAir
TGeoCombiTrans * trc1
TGeoVolume * BoxVolDouble2
TGeoVolume * BoxVolSingle3a
const Double_t kGap4
TGeoCombiTrans * trc4b
FairGeoInterface * geoFace
const Double_t kPos3
TGeoShape * BoxSingle1
TGeoCombiTrans * trc2
TGeoTranslation * trt3a
TGeoCombiTrans * trc3a
const Double_t kPos1
TString outfile
TGeoShape * BoxSingle2