Exporting root geometry to gdml


I exported the ATLAS detector described in TGeo (http://root.cern.ch/files/atlas.root) to an gdml file by simply doing:


I can view the result and it looks fine. Although I get already a view warnings when doing that.
When I try to use it in Geant4 I get a Fatal Exception due to an invalid length unit.
I tried the same with the cms detector and got the same problem.
Is this a known problem? Do you know a solution for it?

Thank you,


Maybe @agheata can help…

Cheers, Bertrand.

Hi Julia,

What is the actual error you are getting?

Hi Andrei,

when I run geant4 I get:

-------- EEEE ------- G4Exception-START -------- EEEE -------

*** ExceptionHandler is not defined ***
*** G4Exception : InvalidRead
issued by : G4GDMLReadStructure::DivisionvolRead()
Invalid unit for length!
*** Fatal Exception ***
-------- EEEE -------- G4Exception-END --------- EEEE -------

*** G4Exception: Aborting execution ***

Program received signal SIGABRT, Aborted.
0x000000339c232495 in raise () from /lib64/libc.so.6


Thanks Julia,
Looks like since Geant4 v10.3.1 divisionvol tags must have the unit specified. I will fix this in TGeo and let you know.

Cheers, Andrei

Thank you very much!


Hi Julia,

I checked and ROOT 6 (master) is actually generating <unit=“cm”> tags, e.g:

which are perfectly readable with v10.3.1

Which version of ROOT are you using? Can you send a snippet of the failing lines or the entire generated gdml file?

Cheers, Andrei

Hi Andrei,

I am using the LCG_88 release on cvmfs. So I am using root version 6.08.06 and the Geant4 version 10.02.p02.
I can send the gdml file.

atlas.zip (1.6 MB)

Hi Andrei,

could you try it with the file I attached?


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