Inelastic electron scattering and pion photoproduction on 12C