Trouble Importing GDML File

I am trying to import a .gdml file into root but cannot seem to make it work. The code will work with a .root geometry when loaded in with the lines below:

  new TGeoManager("Geometry", "Geane geometry");
  TGeoManager::Import("Geom.root");

This works fine but is a general blank geometry. I want to use the geant4 geometry which I have saved as g4Geom.gdml. This code below compiles but causes a segmentation violation

  new TGeoManager("Geometry", "Geane geometry");
  TGeoManager::Import("g4Geom.gdml");

I saw from the documentation (https://root.cern.ch/doc/master/classTGeoManager.html#a6af8240b3f299a438b245654bc5b2a84) that the PYTHONPATH must be defined like export PYTHONPATH=$ROOTSYS/lib:$ROOTSYS/gdml and I added that line to my .bashrc but it didn’t seem to make any difference. Anybody know what might be the problem or how I could fix it? Or if anyone know how to convert .gdml to .root that would also work. Thanks in advance.

Hi, just drop the lines “new TGeoManager”, Import is a static method not requiring an object. If it does not work send me the root/gdml files
Best

It looks like ROOT-7980.

I tried this but am still getting the segmentation violation. I PM’d you the root and gdml files. Could there be a problem with the export PYTHONPATH command in the bashrc? I did modify it from the command above because I wasn’t exactly sure how

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.