In Track::ChiSquare use chi2 and not chi2/dof
The struct that has been introduced to store the chi2 and a number of DOFs for tracks_v2 and which is used in RecVertex_v2, stores internally the chi2/ndof and ndof:
https://gitlab.cern.ch/lhcb/LHCb/-/blob/master/Event/TrackEvent/include/Event/Track_v2.h#L187
That's not great because ndof can be zero, or even negative, for unconstrained problems. For ndof=0, chi2/dof is not well defined. Therefore, it is better just to store chi2, and not chi2/ndof. (See for instance the existing one in TrackEvent and DecayTreeFitter:
https://gitlab.cern.ch/lhcb/LHCb/-/blob/master/Event/TrackEvent/include/Event/ChiSquare.h https://gitlab.cern.ch/lhcb/Phys/-/blob/master/Phys/DecayTreeFitter/include/DecayTreeFitter/ChiSquare.h
Of course, it would be good to use a single implementation throughout.)