Tgeo 2 gdml

Hi, I am trying to export my TGeo geometry to gdml using gGeoManager->Export(“test.gdml”)
I have declare -x PYTHONPATH="/opt/alice/root/v5-27-04/lib:/opt/alice/root/v5-27-04/geom/gdml"
What could be the problem? Thanks,
filimon

root [2] gGeoManager->Export(“test.gdml”)
Info in TGeoManager::Export: Exporting mygeometry as gdml code
Error: Function Exec(“from math import *”) is not defined in current scope (tmpfile):1:
*** Interpreter error recovered ***
Error: Function Exec(“import writer”) is not defined in current scope (tmpfile):1:
*** Interpreter error recovered ***
Error: Function Exec(“import ROOTwriter”) is not defined in current scope (tmpfile):1:
*** Interpreter error recovered ***
Error: Function Exec(“geomgr = ROOT.gGeoManager”) is not defined in current scope (tmpfile):1:
*** Interpreter error recovered ***
Error: Function Exec(“topV = geomgr.GetTopVolume()”) is not defined in current scope (tmpfile):1:
*** Interpreter error recovered ***
Error: Function Exec(“gdmlwriter = writer.writer(‘test.gdml’)”) is not defined in current scope (tmpfile):1:
*** Interpreter error recovered ***
Error: Function Exec(“binding = ROOTwriter.ROOTwriter(gdmlwriter)”) is not defined in current scope (tmpfile):1:
*** Interpreter error recovered ***
Error: Function Exec(“matlist = geomgr.GetListOfMaterials()”) is not defined in current scope (tmpfile):1:
*** Interpreter error recovered ***
Error: Function Exec(“binding.dumpMaterials(matlist)”) is not defined in current scope (tmpfile):1:
*** Interpreter error recovered ***
Error: Function Exec(“shapelist = geomgr.GetListOfShapes()”) is not defined in current scope (tmpfile):1:
*** Interpreter error recovered ***
Error: Function Exec(“binding.dumpSolids(shapelist)”) is not defined in current scope (tmpfile):1:
*** Interpreter error recovered ***
Error: Function Exec>: Traversing geometry tree’") is not defined in $Exec("print 'Info in <TPython (tmpfile):1:
*** Interpreter error recovered ***
Error: Function Exec(“gdmlwriter.addSetup(‘default’, ‘1.0’, topV.GetName())”) is not defined in current scope (tmpfile):1:
*** Interpreter error recovered ***
Error: Function Exec(“binding.examineVol(topV)”) is not defined in current scope (tmpfile):1:
*** Interpreter error recovered ***
Error: Function Exec(“gdmlwriter.writeFile()”) is not defined in current scope (tmpfile):1:
*** Interpreter error recovered ***
Info in TPython::Exec: GDML Export complete - test.gdml is ready
(Int_t)1
root [3]

Could you post your geom.root file and tell us your version of ROOT ?

Rene

Hi Rene,
the problem is reproducible in my case even in this simple geometry (world box+1 box inside). Is there a command-line utility to do the conversion directly maybe from the shell prompt? Maybe this will bypass path issues…

p.s. root version is 5-27-04
geom.root (8.24 KB)

Hi Filimon,

In my setup I compile root using:
–enable-gdml
–enable-python
and I put in my .bashrc:
export PYTHONPATH=$ROOTSYS/lib:$ROOTSYS/geom/gdml

Cheers,

Hi Andrei,
in fact I had all the flags and options but in ubuntu python-dev is not installed by default as in slc, so root was not in fact configured with python. As I don’t use it normally and -wrongly- assuming from the error output I wrote above that the root code just calls python executable I did not think of checking root-config output. I should have checked this. Now it works for me. Thanks,
filimon