Geometry optimization of a muon-electron scattering detector