FairRoot/PandaRoot
lmd_geohandler_benchmark.C
Go to the documentation of this file.
1 // compile with
2 // g++ $(root-config --cflags --glibs) -lGeom -I${PANDAROOT}/geobase -L${PANDAROOT}/buildPanda/lib -lGeoBase create_Lmd_HV_MAPS.C -o /tmp/create_geometry -I${PANDAROOT}/lmd/LmdMC
3 // and run with
4 // /tmp/create_geometry
5 
6 #include<TROOT.h>
7 #include<FairGeoLoader.h>
8 #include<FairGeoInterface.h>
9 #include<FairGeoBuilder.h>
10 #include<FairGeoPcon.h>
11 #include<FairGeoMedia.h>
12 #include<TGeoCompositeShape.h>
13 #include<TGeoMatrix.h>
14 #include<TGeoVolume.h>
15 #include<TGeoTube.h>
16 #include<TGeoArb8.h>
17 #include<TGeoPara.h>
18 #include<TSystem.h>
19 #include<TFile.h>
20 #include<TGeoPcon.h>
21 #include<TGeoManager.h>
22 #include<TGeoTorus.h>
23 #include<TGeoSphere.h>
24 #include<TMath.h>
25 #include<TRandom.h>
26 #include<PndLmdDim.h>
27 #include<TGeoPhysicalNode.h>
28 #include<TGeoCone.h>
29 #include<PndGeoHandling.h>
30 
31 #include<iostream>
32 #include<cmath>
33 #include<sstream>
34 
35 //using namespace LmdDim;
36 
37 // to check the position and dimensions
38 // one may enable a beam pipe dummy to be displayed
39 const bool show_beam_pipe_dummy = true;
40 
41 const bool include_box = false;
42 
43 void create_HV_MAPS(bool misalign = false) {
44 
45 // TString outfile= "geo/HV_MAPS-Design.root";
46 // TFile* fi = new TFile(outfile,"RECREATE");
47 
48  FairGeoLoader* geoLoad = new FairGeoLoader("TGeo","FairGeoLoader");
49  FairGeoInterface *geoFace = geoLoad->getGeoInterface();
50  geoFace->setMediaFile("../../geometry/media_pnd.geo");
51  geoFace->readMedia();
52  geoFace->print();
53 
54  FairGeoMedia *Media = geoFace->getMedia();
55  FairGeoBuilder *geobuild=geoLoad->getGeoBuilder();
56 
57  FairGeoMedium *FairMediumSilicon = Media->getMedium("silicon");
58 
59  Int_t nmed=geobuild->createMedium(FairMediumSilicon);
60 
61  TGeoManager* gGeoMan = (TGeoManager*)gROOT->FindObject("FAIRGeom");
62 
63  TGeoVolume *top = new TGeoVolumeAssembly("lum");
64 
65  gGeoMan->SetTopVolume(top);
66 
68 
69  // for testing purposes
70  lmddim.Generate_rootgeom(*top, misalign);
71 
72  //gGeoMan->LocalToMaster();
73  LocalToMasterShortId
74 
75  gGeoMan->CloseGeometry();
76 // top->Write();
77 // fi->Close();
78  // gGeoManager->Export(outfile);
79  gGeoMan->SetVisLevel(20);
80  top->Draw("ogl");
81  // gGeoManager->Export(outfile);
82  //gGeoMan->SetVisLevel(20);
83  //top->Draw("ogl");
84  //top->RandomPoints(100000);
85 }
86 
87 #include<TApplication.h>
88 
89 int main() {
90  TApplication myapp("myapp", 0, 0);
92  myapp.Run();
93  return 0;
94 }
int create_HV_MAPS()
int main(int argc, char **argv)
FairGeoLoader * geoLoad
FairGeoMedia * Media
TGeoManager * gGeoMan
const bool include_box
TGeoVolume * top
const bool show_beam_pipe_dummy
FairGeoBuilder * geobuild
void Generate_rootgeom(TGeoVolume &mothervol, bool misaligned=false)
Definition: PndLmdDim.cxx:331
static PndLmdDim & Get_instance()
Definition: PndLmdDim.cxx:242
FairGeoInterface * geoFace