Converting GDML geometries with parameterisations to root geometries

_ROOT Version: 6.24/08
_Platform: CentOS7
_Compiler: g++ 4.8.5

Dear ROOT experts,

i am building detector structures with GEANT4 and want to export these geometries to ROOT geometries. I am building straw like chambers which are very repetitive and i am using my own parameterisation to place these chambers within a holding volume, i.e. i have my own class build on G4VPVParameterisation.

I now export this geometry to a gdml file and want to read this gdml file again with ROOT. This is needed, because the analysis program i use is requiring ROOT and can not be linked against GEANT4. Therefore, the geometry has to be exported to ROOT.

GDMLGeometry.tar.gz (6.2 KB)
The gdml file is to large to be posted here so i wraped it in a tar archive.

You may visualize the geometry with the following code:


And if you want to have a look within the ROOT geometry, you may export to ROOT and use rootbrowse.


Unfortunately, the parameterised structures are not visible / present anymore, after the root import.

If you are courious, you may find a way to visualize the structure with geant4 in the next tar archive to be convinced, that there are indeed sub structures within the gdml geometry. Instructions on how to compile are in the It is super light weight and only requires a geant4 installation.
VisGDMLGeometry.tar.gz (8.5 KB)

My question is now, if there is a way to convert this GEANT4 structures to ROOT?
Or is there something i missed?

Thank you for your help!

May be @agheata has an idea how that to do.

Hi, ROOT geometry does not support Geant4 parameterisations, so neither the GDML reader does. If you create the geometry yourself, the way around would be to replace parameterisations with shapes having non-parametric dimensions, which may bring also benefits runtime.

Hi agheata,

thank you for this information. Unfortunately, i need the parameterisation since each shape represents a detector and therefore has its own readout. Is there maybe a third party program that supports these kind of conversions out of the box, i.e. converting parameterised volumes to singe TGeoNodes? I guess this would be the way to go about this.

I already tried VGM but there, the parametereisations are also not supported.

Thank you!

Hi again,

@agheata is there any other way for me to convert gdml to root that you know of? Or did anyone else run into similar problems then me and fixed it somehow?

Best regards

Hi Henri, as I said, parameterisations are not supported, so you cannot read them into TGeo classes. But it may be not so difficult to describe your modules without, by just explicitly giving values for the parameters when you create each module.

Hi @agheata ,

we have implemented conversion of parameterised volumes in VGM from tag 5-2 on. The tag was released yesterday. From my knowledge this is the only way to convert this volumes if someone else is curious about it in the future.

Best regards