Update MC related algorithms to work with functional algorithms
Many if not most of our algorithms that use MC information still do so via direct TES access.
Some of the algorithms are already Gaudi::Functional
algorithms and may even have been modernized e.g. algorithms in Tr/TrackCheckers
.
However, even those often make one of the two most common mistakes:
-
Use a class like
LinkedTo
orLinkedFrom
to access mc-linking information.
These are easy to spot by simply searching the codebase forevtSvc()
which has to be passed to the constructor of these classes and indicates a forbidden direct TES access. -
More subtle are what I'd like to call chained MC accesses. These are possible because a
MCHit
has a pointer to itsMCParticle
which has a pointer itsMCVertex
. These often don't cause a crash because we often unpack all of these anyhow but can cause a crash in certain configurations. Thus, if any of these access are used we should properly add the container to the input. In the long run it might be best to remove these explicit pointers and rely on linker input for the connection.