Electron and photon energy measurement calibration with the ATLAS detector