-
Notifications
You must be signed in to change notification settings - Fork 1.5k
GDML module not working with Tessellated solid #9744
Description
- Checked for duplicates
Describe the bug
This issue report follows my post in the ROOT forums https://root-forum.cern.ch/t/gdml-multiple-files-error-with-define/48581. Please refer to the forum post for additional details.
In summary, when using the GDML modules feature as described on the manual (or so I think), the <define/> section of the child file is not being accessed correctly when the volume is a tessellated solid. This does not happen with a simple volume such as a box. On top of that I have managed to load the problematic GDML into Geant4 without problems, so that lead me to believe it is a ROOT bug.
Expected behavior
Geometry should load without throwing an exception.
To Reproduce
I load the GDML the following way:
TGeoManager::Import("mother.gdml");
mother.gdml:
<?xml version="1.0" encoding="UTF-8"?>
<gdml xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://service-spi.web.cern.ch/service-spi/app/releases/GDML/schema/gdml.xsd">
<define />
<solids>
<box name="world_solid" x="100" y="100" z="100" />
</solids>
<structure>
<volume name="world">
<physvol>
<file name="child.gdml" />
</physvol>
<materialref ref="world_material" />
<solidref ref="world_solid" />
</volume>
</structure>
<setup name="Default" version="1.0">
<world ref="world" />
</setup>
</gdml>
child.gdml:
<?xml version="1.0" encoding="UTF-8"?>
<gdml xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://service-spi.web.cern.ch/service-spi/app/releases/GDML/schema/gdml.xsd">
<define>
<position name="cube_v0" unit="mm" x="10.0" y="-10.0" z="10.0"/>
<position name="cube_v1" unit="mm" x="10.0" y="0.0" z="10.0"/>
<position name="cube_v2" unit="mm" x="0.0" y="-10.0" z="10.0"/>
<position name="cube_v3" unit="mm" x="0.0" y="0.0" z="10.0"/>
<position name="cube_v4" unit="mm" x="0.0" y="-10.0" z="0.0"/>
<position name="cube_v5" unit="mm" x="0.0" y="0.0" z="0.0"/>
<position name="cube_v6" unit="mm" x="10.0" y="-10.0" z="0.0"/>
<position name="cube_v7" unit="mm" x="10.0" y="0.0" z="0.0"/>
</define>
<solids>
<box name="world_solid" x="100" y="100" z="100"/>
<tessellated name="child_solid" aunit="deg" lunit="mm">
<triangular vertex1="cube_v0" vertex2="cube_v1" vertex3="cube_v2"/>
<triangular vertex1="cube_v2" vertex2="cube_v1" vertex3="cube_v3"/>
<triangular vertex1="cube_v4" vertex2="cube_v5" vertex3="cube_v6"/>
<triangular vertex1="cube_v6" vertex2="cube_v5" vertex3="cube_v7"/>
<triangular vertex1="cube_v3" vertex2="cube_v5" vertex3="cube_v2"/>
<triangular vertex1="cube_v2" vertex2="cube_v5" vertex3="cube_v4"/>
<triangular vertex1="cube_v1" vertex2="cube_v7" vertex3="cube_v3"/>
<triangular vertex1="cube_v3" vertex2="cube_v7" vertex3="cube_v5"/>
<triangular vertex1="cube_v0" vertex2="cube_v6" vertex3="cube_v1"/>
<triangular vertex1="cube_v1" vertex2="cube_v6" vertex3="cube_v7"/>
<triangular vertex1="cube_v2" vertex2="cube_v4" vertex3="cube_v0"/>
<triangular vertex1="cube_v0" vertex2="cube_v4" vertex3="cube_v6"/>
</tessellated>
</solids>
<structure>
<volume name="child">
<materialref ref="G4_Pb"/>
<solidref ref="child_solid"/>
</volume>
</structure>
<setup name="Default" version="1.0">
<world ref="child"/>
</setup>
</gdml>
Both files should be at the same directory and the ROOT REPL should be initialized in this directory too.
Setup
ROOT Version: 6.25/01
OS: Linux
I build root myself from the GitHub source.
I think this issue should be reproducible from all recent root versions though.