VecGeom [1] is a new software toolkit for geometry modeling, which aims to exploit fine-grained parallelism for computing and provide a standard for geometry description in a range of HEP toolkits including GeantV and ROOT. The Geometry Description Markup Language (GDML) [2] is a specialized XML-based language designed as an application-independent readable persistent format for describing the geometries of detectors associated with physics measurements. Currently I/O of VecGeom geometry is possible via ROOT geometry. We need to implement a standalone GDML I/O module to have geometry persistency without ROOT.
GDML is an XML schema, thus we can use standard tools for handling files and process the in-memory representation. Since the size of the files is relatively small and we need both reading and writing files, it is more convenient to work with the DOM XML representation. Also the validation of GDML files before processing allows to omit some checks, thus it is more convenient to use a validating XML parser. All the above motivates us to build the I/O on top of Xerces-C [3] parser. The Xerces-C library is distributed under the Apache 2.0 license which coincides with the most probable license of VecGeom (private communication).
The library will be split into the backend and the frontend. The Xerces-C backend will be used to read GDML files into DomDocument objects and to write them back. The backend can be tested by comparing loaded and then saved files with the original ones. Later one can add a backend based on libxml2, which is a bit faster and spread more widely, but lacks the validation capability.
The frontend will traverse the DomDocument to construct VecGeom geometry when loading, and visit all volumes in GeoManager to add them to the DomDocument when saving. The frontend can be implemented gradually starting from a small subset of GDML and finishing with the full GDML schema. The progress can be tracked by a set of test examples from a single sphere to the full CMS geometry.
[1] J. Apostolakis, M. Bandieramonte, G. Bitzes, R. Brun, P. Canal, F. Carminati, G. Cosmo, J. C. D. F. Licht, L. Duhem, V. D. Elvira, A. Gheata, S. Y. Jun, G. Lima, T. Nikitina, M. Novak, R. Sehgal, O. Shadura, and S. Wenzel, “Towards a high performance geometry library for particle-detector simulations,” Journal of Physics: Conference Series, vol. 608, no. 1, p. 012023, 2015.
[2] R. Chytracek, J. McCormick, W. Pokorski, and G. Santin, “Geometry description markup language for physics simulation and analysis applications,” vol. 53, pp. 2892 – 2896, 11 2006.