FairRoot/PandaRoot
MvdTBGeometry.C
Go to the documentation of this file.
1 /*
2  * CreateLambdaGeometry.C
3  *
4  * Created on: Mar 21, 2013
5  * Author: stockman
6  */
8 {
9  //-----------------------------
10  Double_t positionStage1 = 10.0; //in cm
11  Double_t positionStage2 = 16.0; //in cm
12  Double_t positionStage3 = 22.0; //in cm
13  Double_t positionStage4 = 28.0; //in cm
14 
15  //--------------------------------------------------------------------
16 
17 
18  TString outfile= "../../geometry/MvdTBGeometry.root";
19  TFile* fi = new TFile(outfile,"RECREATE");
20 
21  FairGeoLoader* geoLoad = new FairGeoLoader("TGeo","FairGeoLoader");
22  FairGeoInterface *geoFace = geoLoad->getGeoInterface();
23  geoFace->setMediaFile("../../geometry/media_pnd.geo");
24  geoFace->readMedia();
25  geoFace->print();
26 
27  FairGeoMedia *Media = geoFace->getMedia();
28  FairGeoBuilder *geobuild=geoLoad->getGeoBuilder();
29 
30  FairGeoMedium *CbmMediumSilicon = Media->getMedium("silicon");
31 
32  Int_t nmed=geobuild->createMedium(CbmMediumSilicon);
33 
34  TGeoManager* gGeoMan = (TGeoManager*)gROOT->FindObject("FAIRGeom");
35 
36  TGeoVolume *top = new TGeoVolumeAssembly("top");
37 
38  gGeoMan->SetTopVolume(top);
39 
40 
41  TGeoVolumeAssembly* TBSetup = new TGeoVolumeAssembly("MvdTestbeamSetup");
42  TGeoVolumeAssembly* module = new TGeoVolumeAssembly("ToPix4Module");
43 
44  TGeoShape* ToPix4Shape = new TGeoBBox("ToPix4Shape", 0.2/2, 0.32/2, 0.0285/2); //todo: fix dimensions of ToPix4
45  TGeoVolume* ToPix4Volume = new TGeoVolume("ToPix4Volume", ToPix4Shape, gGeoMan->GetMedium("silicon"));
46 
47  TGeoShape* EpiSensorShape = new TGeoBBox("EpiSensorShape", 0.2/2, 0.32/2, 0.0100/2);
48  TGeoVolume* EpiSensorVolume = new TGeoVolume("EpiSensorVolume", EpiSensorShape, gGeoMan->GetMedium("silicon"));
49 
50 
51  TGeoTranslation transToPix("ToPixTranslation", .0, .0, 0.0285/2 + 0.0100/2 + 0.002);
52 
53  module->AddNode(EpiSensorVolume, 0);
54  module->AddNode(ToPix4Volume, 0, new TGeoHMatrix(transToPix));
55 
56  TBSetup->AddNode(module, 0, new TGeoTranslation(.0,.0,positionStage1));
57  TBSetup->AddNode(module, 1, new TGeoTranslation(.0,.0,positionStage2));
58  TBSetup->AddNode(module, 2, new TGeoTranslation(.0,.0,positionStage3));
59  TBSetup->AddNode(module, 3, new TGeoTranslation(.0,.0,positionStage4));
60 
61  top->AddNode(TBSetup,0);
62 
63  gGeoMan->CloseGeometry();
64  top->Write();
65  fi->Close();
66  // gGeoManager->Export(outfile);
67  gGeoManager->SetVisLevel(30);
68  top->Draw("ogl");
69 }
70 
71 
72 
73 
74 
75 
76 
77 
78 
79 
80 
81 
82 
83 
84 
FairGeoLoader * geoLoad
FairGeoMedia * Media
TGeoManager * gGeoMan
TGeoManager * gGeoManager
TGeoVolume * top
FairGeoMedium * CbmMediumSilicon
FairGeoBuilder * geobuild
TFile * fi
Double_t
MvdTBGeometry()
Definition: MvdTBGeometry.C:7
FairGeoInterface * geoFace
TString outfile