An analytical model of energy response function for CdTe-based photon counting detectors with inter-pixel communication for anti-coincidence corrections