An atomic beam polarimeter to measure the nuclear polarization in the HERMES gaseous polarized hydrogen and deuterium target