FairRoot/PandaRoot
Lars/geotester.C
Go to the documentation of this file.
1 {
2 
3  gROOT->LoadMacro("$VMCWORKDIR/gconfig/basiclibs.C");
4  basiclibs();
5 
6  gSystem->Load("libGeoBase");
7  gSystem->Load("libParBase");
8  gSystem->Load("libBase");
9  gSystem->Load("libField");
10  gSystem->Load("libGen");
11  gSystem->Load("libPassive");
12  gSystem->Load("libPndData");
13 // gSystem->Load("libStt1");
15 // gSystem->Load("libMuo");
16 // gSystem->Load("libEmc");
17 // gSystem->Load("libMvd");
18 // gSystem->Load("libDrc");
19 
20  TFile* file = new TFile("teststation.root");
21 
22  //A
23 // TGeoManager *geoMan = (TGeoManager*) file->Get("CADtoROOT");
24 // TGeoVolume* topvol = geoMan->GetMasterVolume();
25 
26  //B
27  TGeoManager *geoMan = new TGeoManager();
28  TGeoVolume* topvol = (TGeoVolume*)file->Get("top");
29  if(!topvol) cout<<"Error: topvolume is not there"<<endl;
30  geoMan->SetTopVolume(topvol);
31 
32  //C
33 // TGeoManager *geoMan = (TGeoManager*) file->Get("FAIRGeom");
34 
35  // Number of folded geo levels; 8 for mvd.
36  // Try to change the number and to see how the geometry changes.
37 
38 
39  geoMan->SetVisLevel(100);
40  geoMan->DefaultColors();
41  topvol->Draw("ogl");
42 
43 std::cout<<"------------------------------"<<std::endl;
44 std::cout<<"------------------------------"<<std::endl;
45 std::cout<<"------------------------------"<<std::endl;
46 
47  geoMan->GetListOfVolumes()->Print();
48 
49 // geoMan->CheckOverlaps();
50 // geoMan->PrintOverlaps();
51 }
52 
basiclibs()
TFile * file
TGeoManager * geoMan
TGeoVolume * topvol