FairRoot/PandaRoot
createJuelichSetup1.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 sided sensors
35 
36  const Double_t kGap3 = 0.45; // (cm)
37  const Double_t kGap4 = 0.45; // (cm)
38 
39  // positional corrections (displacement) of each sensor
40  // these values are obtained by the software alignment procedure
41  const Double_t offs1x = 0.;
42  const Double_t offs1y = 0.;
43 
44  const Double_t offs2x = 0.;
45  const Double_t offs2y = 0.;
46 
47  const Double_t offs3x = -0.1698;
48  const Double_t offs3y = -0.1658;
49 
50  const Double_t offs4x = -0.0366;
51  const Double_t offs4y = -0.1855;
52 
53 
54  //##################################################
55 
56 
57  gROOT->Macro("$VMCWORKDIR/gconfig/rootlogon.C");
58 
59  // Load this libraries
60  gSystem->Load("libGeoBase");
61  gSystem->Load("libParBase");
62  gSystem->Load("libBase");
63  gSystem->Load("libPndData");
64  gSystem->Load("libPassive");
65 
66  TString outfile= "TrackingStation.root";
67  //TFile* fi = new TFile(outfile,"RECREATE");
68 
69  FairGeoLoader* geoLoad = new FairGeoLoader("TGeo","FairGeoLoader");
70  FairGeoInterface *geoFace = geoLoad->getGeoInterface();
71  geoFace->setMediaFile("../../../geometry/media_pnd.geo");
72  geoFace->readMedia();
73  geoFace->print();
74 
75  //##################################################
76 
77  FairGeoMedia *Media = geoFace->getMedia();
78  FairGeoBuilder *geobuild=geoLoad->getGeoBuilder();
79 
80  FairGeoMedium *CbmMediumAir = Media->getMedium("air");
81  FairGeoMedium *CbmMediumSilicon = Media->getMedium("silicon");
82 
83  Int_t nmed=geobuild->createMedium(CbmMediumAir);
84  nmed=geobuild->createMedium(CbmMediumSilicon);
85 
86  TGeoManager* gGeoMan = (TGeoManager*)gROOT->FindObject("FAIRGeom");
87 
88  TGeoVolume *top = new TGeoVolumeAssembly("TS");
89 
90  gGeoMan->SetTopVolume(top);
91 
92  TGeoShape *BoxDouble1 = new TGeoBBox("StripActiveTD1", kDx, kDy, kDz);
93  TGeoShape *BoxDouble2 = new TGeoBBox("StripActiveTD2", kDx, kDy, kDz);
94  TGeoShape *BoxSingle1 = new TGeoBBox("StripActiveTS1", kDx, kDy, kDz);
95  TGeoShape *BoxSingle2 = new TGeoBBox("StripActiveTS2", kDx, kDy, kDz);
96  TGeoShape *BoxSingle3 = new TGeoBBox("StripActiveTS3", kDx, kDy, kDz);
97  TGeoShape *BoxSingle4 = new TGeoBBox("StripActiveTS4", kDx, kDy, kDz);
98 
99  TGeoVolume* BoxVolDouble1 = new TGeoVolume("StripActiveTD1",BoxDouble1,gGeoMan->GetMedium("silicon"));
100  TGeoVolume* BoxVolDouble2 = new TGeoVolume("StripActiveTD2",BoxDouble2,gGeoMan->GetMedium("silicon"));
101  TGeoVolume* BoxVolSingle3a = new TGeoVolume("StripActiveTS3a",BoxSingle1,gGeoMan->GetMedium("silicon"));
102  TGeoVolume* BoxVolSingle3b = new TGeoVolume("StripActiveTS3b",BoxSingle2,gGeoMan->GetMedium("silicon"));
103  TGeoVolume* BoxVolSingle4a = new TGeoVolume("StripActiveTS4a",BoxSingle3,gGeoMan->GetMedium("silicon"));
104  TGeoVolume* BoxVolSingle4b = new TGeoVolume("StripActiveTS4b",BoxSingle4,gGeoMan->GetMedium("silicon"));
105 
106 
107  TGeoTranslation* trt1 = new TGeoTranslation(offs1x,offs1y,kPos1);
108  TGeoTranslation* trt2 = new TGeoTranslation(offs2x,offs2y,kPos2);
109  TGeoTranslation* trt3a = new TGeoTranslation(offs3x,offs3y,kPos3 - 0.5*kGap3 - kDz/2.);
110  TGeoTranslation* trt3b = new TGeoTranslation(offs3x,offs3y,kPos3 + 0.5*kGap3 + kDz/2.);
111  TGeoTranslation* trt4a = new TGeoTranslation(offs4x,offs4y,kPos4 - 0.5*kGap4 - kDz/2.);
112  TGeoTranslation* trt4b = new TGeoTranslation(offs4x,offs4y,kPos4 + 0.5*kGap4 + kDz/2.);
113 
114  TGeoRotation* dummyrot = new TGeoRotation();
115  TGeoRotation* rot1 = new TGeoRotation("",90.,0.,0.);
116 
117  TGeoCombiTrans* trc1= new TGeoCombiTrans(*trt1,*dummyrot);
118  trc1->SetName("Sensor1");
119  trc1->RegisterYourself();
120 
121  TGeoCombiTrans* trc2= new TGeoCombiTrans(*trt2,*dummyrot);
122  trc2->SetName("Sensor2");
123  trc2->RegisterYourself();
124 
125  TGeoCombiTrans* trc3a= new TGeoCombiTrans(*trt3a,*dummyrot);
126  trc3a->SetName("Sensor3a");
127  trc3a->RegisterYourself();
128 
129  // TGeoCombiTrans* trc3b= new TGeoCombiTrans(*trt3b,*dummyrot);
130  TGeoCombiTrans* trc3b= new TGeoCombiTrans(*trt3b,*rot1);
131  trc3b->SetName("Sensor3b");
132  trc3b->RegisterYourself();
133 
134  TGeoCombiTrans* trc4a= new TGeoCombiTrans(*trt4a,*dummyrot);
135  trc4a->SetName("Sensor4a");
136  trc4a->RegisterYourself();
137 
138  // TGeoCombiTrans* trc4b= new TGeoCombiTrans(*trt4b,*dummyrot);
139  TGeoCombiTrans* trc4b= new TGeoCombiTrans(*trt4b,*rot1);
140  trc4b->SetName("Sensor4b");
141  trc4b->RegisterYourself();
142 
143  TGeoVolumeAssembly* SubunitVol = new TGeoVolumeAssembly("TTVol");
144 
145  TGeoVolumeAssembly* SubunitDouble = new TGeoVolumeAssembly("TTDouble");
146 
147  SubunitDouble->AddNode(BoxVolDouble1,0,trc1);
148  SubunitDouble->AddNode(BoxVolDouble2,0,trc2);
149 
150  TGeoVolumeAssembly* SubunitSingle = new TGeoVolumeAssembly("TTSingle");
151 
152  SubunitSingle->AddNode(BoxVolSingle3a,0,trc3a);
153  SubunitSingle->AddNode(BoxVolSingle3b,0,trc3b);
154  SubunitSingle->AddNode(BoxVolSingle4a,0,trc4a);
155  SubunitSingle->AddNode(BoxVolSingle4b,0,trc4b);
156 
157  SubunitVol->AddNode(SubunitDouble,0,new TGeoCombiTrans());
158  SubunitVol->AddNode(SubunitSingle,0,new TGeoCombiTrans());
159 
160  top->AddNode(SubunitVol,0,new TGeoCombiTrans());
161 
162  gGeoMan->CloseGeometry();
163  gGeoMan->Export(outfile.Data());
164  //top->Write();
165  //fi->Close();
166  //gGeoManager->Export(outfile);
167  //top->Draw("ogl");
168 }
169 
TGeoVolume * BoxVolSingle4a
const Double_t offs1y
TGeoRotation * dummyrot
TGeoTranslation * trt4b
const Double_t offs3x
TGeoVolume * BoxVolSingle3b
FairGeoLoader * geoLoad
FairGeoMedia * Media
TGeoVolumeAssembly * SubunitDouble
TGeoManager * gGeoMan
const Double_t offs4x
TGeoTranslation * trt2
TGeoShape * BoxSingle4
const Double_t kPos4
const Double_t offs1x
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
const Double_t offs4y
FairGeoBuilder * geobuild
const Double_t kDz
Double_t
const Double_t kPos2
TGeoTranslation * trt4a
TGeoCombiTrans * trc4a
TGeoVolumeAssembly * SubunitSingle
const Double_t offs2x
const Double_t offs3y
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
const Double_t offs2y
TGeoTranslation * trt3a
TGeoCombiTrans * trc3a
const Double_t kPos1
TString outfile
TGeoShape * BoxSingle2