Make IVF code templated (btag fwk migration)

This PR makes some parts of IVF code templated on the input particles to be used either with tracks or candidates.

This is part of the ongoing btag fwk migration.

this is already like this in the release, this PR is about moving the code to template, not about cleaning up the code from ifdefs or cout. let's not mix the things.