The Unified Solids library for VecGeom
Gabriele Cosmo, 29/05/2017
Fig 1: Full interactive Geant4 application featuring parallel geometries, parameterisations and scoring with VecGeom primitives (Image: Geant4 Collaboration)
Understanding the structure of a detector or its set up is key to accurately simulating how particles move through and interact with matter. Detector simulation software relies on a process known as Solids Modelling to help describe the geometric structures of detector elements. Flexibility in the requirements and algorithms help to understand both simple and complex setups and provide precision and efficiency.
Researchers at CERN created the Unified Solids Library , originally an AIDA project in 2011. The library aims to enhance the algorithms provided by Geant4  simulation software, which is widely used in high-energy and nuclear physics, medical applications, space science and the ROOT  analysis framework.
The library provides a large collection of primitives ranging from simple 3D shapes, such as boxes, tubes and cones, to more complex shapes and the creation of Boolean combinations; which allow the finest details of a setup to be described.
The library’s code, written in the C++ programming language, includes algorithms which help tracking particles in a large variety of geometrical setups. The library also includes a comprehensive testing suite to monitor the performance of new algorithms.
The primitives Unified Solids Library has been integrated into the VecGeom  package, a new software toolkit for geometry modelling, which aims to exploit fine-grained parallelism for computing. The VecGeom algorithms are currently being reviewed to make use of vector instructions (single instruction, multiple data, SIMD) of the processor and to support different kernels and architectures, including computing accelerators such as Intel Xeon Phi® and GPU devices. The package’s code has been amended to make better use of C++ template techniques, which allows for increased specialization.
The new primitives can be used in the latest versions of Geant4 and ROOT software; replacing the native types without affecting the code, thus making it transparent for the user to benefit from the enhanced computing power. Specific adapter patterns have been added to Geant4 and ROOT to make this possible.
Components of the VecGeom library are being tested using different setups and realistic detector data, such as in the LHC detectors, to verify its correctness and robustness under different conditions.
When considering the full physics of a set-up, including its electro-magnetic field, the toolkit shows benefits to CPU time, leading to faster processing. VecGeom supports all the features from the Geant4 geometry modeler, including the ability to amend the shapes and perform simulation in parallel geometries (see Fig.1).
The VecGeom geometry modeler has been adopted by GeantV  to exploit vectorised transport on CPU, GPUs and Intel Xeon Phi®, aiming to lead to even faster processing. There are also plans to provide hooks within both Geant4 and ROOT for the use of the navigation system provided by VecGeom, with the aim of eventually boosting speed of the scalar mode.
People currently involved in the development of the VecGeom library are: G.Amadio, J.Apostolakis, F.Carminati, G.Cosmo, A.Gheata, W.Pokorski, E.Tcherniaev and S.Wenzel from CERN; M.Gheata (AIDA-2020 fellow), G.Lima (FNAL); R.Sehgal (BARC).
- M.Gayer et al., J. Phys.: Conf. Ser., 396 (2012) 052029
- J.Allison et al., NIM A 835 (2016), 186-225
- R.Brun et al. NIM A 389 (1997) 81 – 86
- J.Apostolakis et al., J. Phys.: Conf. Ser., 608 (2015) 012023
- J.Apostolakis et al., J. Phys.: Conf. Ser., 396 (2012) 022014