Electron fluxes over the polar cap, 2. Electron trapping and energization on open field lines