Determination of the total absorption peak in an electromagnetic calorimeter