Primary ionization and energy loss calculation for helium, neon, argon and krypton