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 and below are clearly for debugging - why not using LogDebug? Otherwise it is yet another way of hidden cout in the code which is not allowed by default.