  We perform a detailed simulation of a pixelated CdTe detector using the
GEANT4 toolkit completed with a custom code emulating the detector's electronic
response. We demonstrate that a measured tungsten X-ray spectrum can be majorly
restored back to the original incident spectrum using the developed model,
without requiring the dedicated hardware charge sharing correction.
