Skip to content

Draft: Build Detector Models as Separate Library

Simon Spannagel requested to merge restructure_detectors into master

with more and more different detector models and geometries added, it somehow doesn't feel optimal anymore that these models all live on src/core/geometry. This MR moves them to src/detectors and builds a separate shared library libAllpixDetectors.so for them. This work has mostly been facilitated by @rprivara's nice work of fleshing out a separate PixelDetectorModel class.

This has some implications

  • This library needs to link against libAllpixCore since we still rely on the base DetectorModel class which remains in src/core/geometry.
  • The factory building detector models cannot live in the DetectorModel class anymore, but has to be implemented in the separate library now where all derived model implementations are available.
  • The GeometryManager does not have direct access to that library, otherwise we would have a cyclic linkage dependency (libAllpixDetectors links to libAllpixCore, so libAllpixCore cannot link to libAllpixDetectors).
  • The latter means we have to pass some std::function (or similar) to the GeometryManager to be able to create instances of detector models from the new library. This is a but clunky but I didn't have a better idea (borrowed from !179 (closed))
  • Of course some header inclusion paths and sources to include in the tools/ part of things have changed.

Very likely there are things to improve before this should be merged:

  • Does anyone have a better idea than the current DetectorModelFactory method?
  • Maybe #224 (closed) should be implemented, but this can also happen afterwards
  • I would really love to have !539 (merged) merged before, otherwise this rebase will be a total mess.

Merge request reports