Electron scattering and charged pion photoproduction on12C and13C