Problem 2317 - Units from GDML file ignored for arb8 (G4GenericTrap).
Summary: Units from GDML file ignored for arb8 (G4GenericTrap).
Status: RESOLVED FIXED
Alias: None
Product: Geant4
Classification: Unclassified
Component: persistency/gdml (show other problems)
Version: 10.7
Hardware: PC Linux
: P4 normal
Assignee: Gabriele Cosmo
URL:
Depends on:
Blocks:
 
Reported: 2021-01-29 20:23 CET by Jonas
Modified: 2021-02-03 09:09 CET (History)
0 users

See Also:


Attachments
GDML-file and pictures. (8.55 KB, application/gzip)
2021-01-29 20:23 CET, Jonas
Details

Note You need to log in before you can comment on or make changes to this problem.
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!