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.

Why are all the code operations in a header file (this file) and not in a source file?