Geometry validation

Once the desired geometry is implemented in DD4hep, one need a way to compare it with the existing descriptions from Mokka or GeomConverter. This wiki describes several options for doing this. Lots of thanks to Andrei Gheață and Nikiforos Nikiforou for demonstrating how various tools work.

or use dumpHits.py (attached, modify at will) to print various hit parameters. For this to run, SLIC must be built with BUILD_ROOTDICT=ON.

Stress tests

There is a TGeo tool for checking geometries. Although written for testing actual TGeo class implementations, one could use this to compare for example two descriptions produced let's say via different frameworks, and spot if any differences were introduced. A good description of how it actually works can be found in the header of the C++ source file

Go to directory $ROOTSYS/test and edit stressGeometry.cxx to add a custom entry. In my case a diff shows these changes:

where the original geometry file clicd.root was created with gGeoManager->Export("clicd.root"); after importing it from another format, e.g. GDML (and removing for this example everything but the ECal).

Troubleshooting

You might have to delete ROOT's local cache of the geometry file (clicd.root in the above example), or simply store it locally in order to make sure the newest version is loaded for comparison with the reference. Once created, the reference remains in $ROOTSYS/test/files/ and you will have to delete it to force the creation of a new one.