REST_ValidateGeometry tool to check geometry of GDML files

Hi everyone,

For simplicity I am using the basic example found here.
I want to check this geometry for possible overlaps, using the macro ‘REST_ValidateGeometry’.

But I got the following error

root [0] REST_ValidateGeometry("box.gdml")
Info in <TGeoManager::Import>: Reading geometry from file: box.gdml
Info in <TGeoManager::TGeoManager>: Geometry GDMLImport, Geometry imported from GDML created
Error in <TXMLEngine::ParseFile>: Unexpected end of xml file
Error in <TXMLEngine::ParseFile>: Error include external XML file at line 27
Error in <TGeoManager::Import>: Cannot open file
Error in <TGeoManager::CheckOverlaps>: Top node not set
(int) 0

The line 27 corresponds to the beginning of the <solid> section in the box.gdml file.
I tested with other geometries and had the same problem, each time TXMLEngine::ParseFile pointing to the line corresponding to solid definitions.

I opened the REST_ValidateGeometry.C file which is rather simple, but I couldn’t say if the problem comes from here.

Usually, do you use this macro to validate your geometry or do you use another tool?

Thanks for your help,

Actually the macro you are trying to use was obsolete.

The reason is that before we were just reading plain GDML files, while now we do a re-interpretation of the GDML that allows us to introduce system variables such as ${GDML_PRESSURE} or include files that are placed at remote locations such as the that we use in our geometry definitions.

In the following PR REST_ValidateGeometry.C. Updating to new GDML REST format by jgalan · Pull Request #383 · rest-for-physics/framework · GitHub you will see the additional change is a class TRestGDMLParser that is responsible to parse the GDML file and interpret system and download http files. The result file is placed at HOME/.rest/ which is the final GDML file interpreted by ROOT.

Plz, could you approve the PR?

I am not sure if there are other interesting tests that can be done. Perhaps @lobis or @juanan318 know a bit more about.

Thanks for your explanation, it makes more sense now.
Concerning the geometry check, I found some nice package written in Python as pyg4ometry, but maybe there is something in REST that could be interesting.

1 Like