GDML import broken in 6.16.00-patches

ROOT Version: 6.16.00-patches from git
Platform: Mac OS
Compiler: clang-1000.11.45.5

Synopsis: With 6.16.00 when importing a GDML file, all the volumes are placed at the origin instead of in there proper location.

I compare directly the version 6.16.00-patches from git, 6.16/01, against the identically compiled 6.14/09. Both use same compiler (llvm clang-1000.11.45.5), same operating system (Mac OS 10.14.3), same Python version (3.7.2).

With the 6.14/09 version of ROOT, the GDML file imports correctly and renders correctly. I also exported that geometry as a root file. With 6.16/01, if I import the same GDML files, all the volumes are in the wrong place, it looks like they are all translated to the origin. If I open the geometry as root file (exported by 6.14/09 version), the geometry looks fine with either version.

Hi, can you share the GDML file you are using to test?

Linked is the detector that works in 6.14 but fails in 6.16
I put the GDML up here:
You can see what it should look like (using JSROOT) here:

OK, thanks, looking into it

OK, the problem comes from the commit f7239c0 “Added support for quantity tag in the GDML parser”. While adding support for the “quantity” tag, I cleaned up the parser code replacing the hard-coded default units (mm/rad) with the user preference, using the methods TGDMLParse::SetDefaultROOTUnits() or TGDMLParse::SetDefaultG4Units(), and put as default units the ROOT ones (cm/degree). I overlooked that during TGeoManager::Import the parser is internally instantiated so one never gets the chance to set the actual units. Since the default is now changed, parsing any length or angle constants is now broken (will assume cm/deg)

I will fix the defaults to the previous mm/rad (G4) and expose the units preference as a setter in TGeoManager. Thanks for reporting this, I will let you know in this thread when the fix is done.

1 Like

Hi, I committed a fix in master and in 6.16.00-patches

Great. I just compiled the new 6.16-patches, and indeed all looks like it should again.
Thanks for the fix.

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