Problem 2317

Summary: Units from GDML file ignored for arb8 (G4GenericTrap).
Product: Geant4 Reporter: Jonas <jrefsgaard>
Component: persistency/gdmlAssignee: Gabriele Cosmo <Gabriele.Cosmo>
Status: RESOLVED FIXED    
Severity: normal    
Priority: P4    
Version: 10.7   
Hardware: PC   
OS: Linux   
Attachments: GDML-file and pictures.

Description Jonas 2021-01-29 20:23:18 CET
Created attachment 665 [details]
GDML-file and pictures.

Hi there,
I'm having trouble reading an arb8 shape from a gdml-file, using the executable built from 'examples/extended/persistency/gdml/G01'. It looks like the gdml-parser interprets the coordinates in mm, even though the lunit is specified as cm in the input file. I attached my gdml-file as 'test.gdml', as well as a picture of the geometry visualisation (geant_vis.png).

The gdml-file was exported from the ROOT geometry package, and I attached the corresponding visualisation from ROOT (root_vis.png), just for comparison.

The test.gdml describes an arb8 and a tube, and it looks like that the arb8 is scaled down by a factor of 10, when it is loaded into Geant4.

Any help with this would be much appreciated.
Comment 1 Jonas 2021-02-02 02:13:48 CET
Hi again,
I found a workaround that solved my immediate problem:
In the G4GDMLReadSolids.cc file I replaced the line

...
  else if(attName == "lunit")
  {
    G4UnitDefinition::GetValueOf(attValue);
...

with

...
  else if(attName == "lunit")
  {
    lunit = G4UnitDefinition::GetValueOf(attValue);
...

in the GenTrapRead()-method. This also seems to be what is done in the other XXXRead()-methods.
Comment 2 Gabriele Cosmo 2021-02-03 09:09:15 CET
Thanks for spotting the problem. The fix will be included in the next patch release!