FairRoot/PandaRoot
Functions
Ralf/geotester.C File Reference

Go to the source code of this file.

Functions

int geotester (TString filename="../../../geometry/MVD_v1.0_woPassiveTraps.root")
 

Function Documentation

int geotester ( TString  filename = "../../../geometry/MVD_v1.0_woPassiveTraps.root")

Definition at line 1 of file Ralf/geotester.C.

References file, filename, geoMan, and topvol.

2 {
3 
4  gROOT->Macro("$VMCWORKDIR/gconfig/rootlogon.C");
5 
6  TFile* file = new TFile(filename.Data());
7 
8  //A
9 // TGeoManager *geoMan = (TGeoManager*) file->Get("CADtoROOT");
10 // TGeoVolume* topvol = geoMan->GetMasterVolume();
11 
12  //B
13  TGeoManager *geoMan = new TGeoManager();
14  TGeoVolume* topvol = (TGeoVolume*)file->Get("topNode");
15  if(!topvol) cout<<"Error: topvolume is not there"<<endl;
16  geoMan->SetTopVolume(topvol);
17 
18  //C
19 // TGeoManager *geoMan = (TGeoManager*) file->Get("FAIRGeom");
20 
21  // Number of folded geo levels; 8 for mvd.
22  // Try to change the number and to see how the geometry changes.
23 
24 
25  geoMan->SetVisLevel(100);
26  geoMan->DefaultColors();
27  topvol->Draw("ogl");
28 
29 std::cout<<"------------------------------"<<std::endl;
30 std::cout<<"------------------------------"<<std::endl;
31 std::cout<<"------------------------------"<<std::endl;
32 
33  geoMan->GetListOfVolumes()->Print();
34 
35 // geoMan->CheckOverlaps();
36 // geoMan->PrintOverlaps();
37  return 0;
38 }
TFile * file
TGeoManager * geoMan
TGeoVolume * topvol
const string filename