GEMC and ROOT TGeo

GEMC geometry to ROOT

The geometry loaded in GEMC can be exported to a root file into TGeo objects.

Using the GUI, first save it to the GDML format by clicking the “to gdml” button:

../_images/saveToGDML.png

Then inside root you can [1], [2]:

  1. load it:

    TGeoManager *geom = TGeoManager::Import("root.gdml")
    
  2. visualize it:

    geom->GetTopVolume()->Draw("ogl")
    
  3. save it to a ROOT file:

    TFile f("geo.root", "RECREATE")
    geom->Write()
    

You can then use various ROOT tools to navigate it, for example a TBrowser or the TGeoManager.


Footnotes