Test and characterization of a prototype silicon–tungsten electromagnetic calorimeter