Draft: Build Detector Models as Separate Library
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 baseDetectorModel
class which remains insrc/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 tolibAllpixCore
, solibAllpixCore
cannot link tolibAllpixDetectors
). - The latter means we have to pass some
std::function
(or similar) to theGeometryManager
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.