Formation of different charge states and the charge state fractions of sputtered Ti and Ni