Importing and visualizing gdml with tessellated solids

Hi all,
I am new to root and am trying to importing a gdml with triangulated solids using TGeoManager. I get the following errors:

Error in TGeoVolume::SortNodes: Bounding box not valid
Error in TGeoVolume::Voxelize: Bounding box not valid
Error in TGeoVolume::FindOverlaps: Bounding box not valid

While inspecting, I found that TGeoTessellated had 0 vertices and 0 facets, however the name of the solid is read correctly. In TBrowser, I do see the solid in the tree but I cannot draw. Root crashes on trying to draw.

In a 2017 post ( Errors importing GDML tessellated solid with ROOT ) in this forum, I saw that tessellated solids were not supported, but I do not see the same error in the latest root. I want to confirm if root supports reading and visualization of tessellated solids now.

Any help will be highly appreciated.

Thank you.


Please read tips for efficient and successful posting and posting code

_ROOT Version:master
_Platform:macos
Compiler: Not Provided


Nevermind. My gdml did not have “type” attribute.

Hi all,

I run into the same issue as mentioned before:

Info in <TGeoManager::CheckGeometry>: Fixing runtime shapes...
Info in <TGeoManager::CheckGeometry>: ...Nothing to fix
Info in <TGeoManager::CloseGeometry>: Counting nodes...
Info in <TGeoManager::Voxelize>: Voxelizing...
Error in <TGeoVolume::SortNodes>: Bounding box not valid
Error in <TGeoVolume::Voxelize>: Bounding box not valid
Error in <TGeoVolume::FindOverlaps>: Bounding box not valid
Info in <TGeoManager::CloseGeometry>: Building cache...

What exactly is meant by “type” attribute in the GDML file?

I use an CAD based STL file as input for a G4 geometry and then use the G4 GDML export to create a GDML file to later import it into ROOT and convert it into a ROOT geometry:

G4:

auto mesh = CADMesh::TessellatedMesh::FromSTL(_cadFile);
...
G4GDMLParser outputParser;
outputParser.Write((outputFileName + ".gdml").c_str(), exportWorld);

ROOT:

TGeoManager* myGeo = new TGeoManager();
myGeo->Import(outputFile);

I tested it with a “simple” cube object - no difference.
Also exporting / importing it with G4 works without any issues.

Hi all,

problem is understood:

In the GDML file:

<tessellated aunit="deg" lunit="mm" name="TestCube0x5ba10b0">
    <triangular vertex1="TestCube_v0" vertex2="TestCube_v1" vertex3="TestCube_v2" type="XXXX"/>
</tessellated>

the type attribute is not set when exporting the geometry via G4 (V 10.5.0) - only the vertexX attributes are present.
Adding the type attribute solves the issue.

Geant4 and root do not implement the same set of gdml solids.

Root does not have tessellated solids or triangular surface elements.

It does… The issue is fixed on the master: PR#6353

Okay but what are we supposed to put in type? Just XXXX?

As far as I remember correctly after two years it was either „relative“ or „absolute“ as definition for the values. But it should be fixed in the mention PR and the recent ROOT version >6.2X.

Nevertheless, keep in mind that tessellated objects are not used as material etc in the ROOT geometry and do not contribute to any particle interactions. At least that’s my latest information.

1 Like