KDetSim: A tool to simulate signal in semiconductor detectors