FairRoot/PandaRoot
create_scit_rootgeo_noGaps.C
Go to the documentation of this file.
1 int create_scit_rootgeo_noGaps(Double_t distance = 750){
2  // Forward tof geometry parameters
3  //-----------------------------
4  //-- macro created by Alicia S. based on step file
5  //-- barrel-SciTil_18122012
6  //-- edited by D. Steinschaden
7  //-- last update 05.2015
8 
9 
10  //--------------------------------------------------------------------
11  gROOT->Macro("$VMCWORKDIR/gconfig/rootlogon.C");
12 
13  // Load this libraries
14  gSystem->Load("libGeoBase");
15  gSystem->Load("libParBase");
16  gSystem->Load("libBase");
17  gSystem->Load("libPndData");
18  gSystem->Load("libPassive");
19 
20  TString outfile= "../../../geometry/SciTil_noGaps.root";
21  TFile* fi = new TFile(outfile,"RECREATE");
22 
23  FairGeoLoader* geoLoad = new FairGeoLoader("TGeo","FairGeoLoader");
24  FairGeoInterface *geoFace = geoLoad->getGeoInterface();
25  geoFace->setMediaFile("../../../geometry/media_pnd.geo");
26  geoFace->readMedia();
27  geoFace->print();
28 
29  FairGeoMedia *Media = geoFace->getMedia();
30  FairGeoBuilder *geobuild=geoLoad->getGeoBuilder();
31 
32  FairGeoMedium *MediumSci = Media->getMedium("polyvinyltoluene");
33  FairGeoMedium *MediumSiPm = Media->getMedium("silicon");
34  FairGeoMedium *MediumCard = Media->getMedium("pcbmvd");
35 
36  const Double_t pi = 3.1415926535;
37  Int_t nmed=geobuild->createMedium(MediumSci); // ----why is the return value saved?
38  nmed=geobuild->createMedium(MediumSiPm);
39  nmed=geobuild->createMedium(MediumCard);
40 
41  TGeoManager* gGeoMan = (TGeoManager*)gROOT->FindObject("FAIRGeom");
42  TGeoVolume *top = new TGeoVolumeAssembly("SciT");
43 
44 
45  gGeoMan->SetTopVolume(top);
46 
47 
48 //-------------------- creating Tile and SiPm and Readout Card --------------------
49 
50  //Volumes containing SENSOR in the name will be taken into account in the MC hit production
51  //check PndSciT.h and PndSciT.cxx and the listofsensitives
52 
53  TGeoTube* TileShape;
54  TileShape = new TGeoTube("SciTil_logicTile", 50.3, 50.8, 90.);// dimension is always given from the mid to the end e.g. only the half length
55 
56  TGeoVolume* TileVol;
57  TileVol = new TGeoVolume("SciTil_SENSOR",TileShape, gGeoMan->GetMedium("polyvinyltoluene"));
58  TileVol->SetLineColor(kBlue);
59 
60 
61 
62  // --------------creating module (Line)-------------
63 
64  TGeoVolumeAssembly* AssVol = new TGeoVolumeAssembly("SciTil_Line");// 2 tiles + 16 SiPm + 3 connection cards
65 
66 
67  AssVol->AddNode(TileVol,0,new TGeoCombiTrans(0., 0., 0., new TGeoRotation (0)));
68 
69 
70 
71  top->AddNode(AssVol,0, new TGeoCombiTrans(0.,0.,32.,new TGeoRotation()));
72 
73 
74  gGeoMan->SetVisLevel(5);
75  gGeoMan->CloseGeometry();
76  top->Write();
77  fi->Close();
78  // gGeoManager->Export(outfile);
79  top->Draw("ogl");
80 
81  return 0;
82  }
83 
FairGeoLoader * geoLoad
FairGeoMedia * Media
TGeoManager * gGeoMan
#define pi
Definition: createSTT.C:60
TGeoVolume * top
FairGeoBuilder * geobuild
TFile * fi
Double_t
int create_scit_rootgeo_noGaps(Double_t distance=750)
FairGeoInterface * geoFace
TString outfile