Geometry isn't checked for unused config parameters
Bit of a rabbit hole while looking into !1042 (merged):
I noticed that we do not check if there are unused parameters in the geometry or model files, like we do for Modules. However, I quickly noticed that this is not entirely straight forward.
The detectors itself never gets a config, that's all done in GeometryManager::load()
. However, the config is not check for unused parameters since they might forwarded to the model (see https://allpix-squared.docs.cern.ch/docs/05_geometry_detectors/02_models/#specializing-detector-models).
Now you might think this is actually fine, since we can just implement the check for all the forwarded config entries and check then if they are unused. Not the most pretty thing in the world, but it should work, right?
Welp, first the forwarding has a bug here: it misses to filter some parameters that are allowed (see manual, namely alignment_precision_position
, alignment_precision_orientation
and role
).
But ignoring this minor bug, let's get back to our original problem. What we want is to simply grab the config from the detector model, right? Yes, and we can do it, but unfortunately these given back as constructed copies, not as reference (not even as carbon-copy), thus the access markers are not copied at all. The relevant code is here: https://gitlab.cern.ch/allpix-squared/allpix-squared/-/blob/46b3ef2476cf2703023f692e0ca8fe3fdf24a84b/src/core/geometry/DetectorModel.cpp#L198-L216
To be honest, I don't get why this is done in this way.