Optimization of response of BGO sectors for a 4 π electromagnetic calorimeter