Loss function to optimise signal significance in particle physics