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.

To save some CPU it could be j=i and cov(i, j) = cov(j, i) = ... later.