  Gamma sources are routinely used to calibrate the energy scale and resolution
of liquid scintillator detectors. However, non-scintillating material
surrounding the source introduces energy losses, which may bias the
determination of the centroid and width of the full absorption peak. In this
paper, we present a general method to determine the true gamma centroid and
width to a relative precision of 0.03\% and 0.50\%, respectively, using energy
losses predicted by the Monte Carlo simulation. In particular, the accuracy of
the assumed source geometry is readily obtained from the fit. The method
performs well with experimental data in the Daya Bay detector.
