Optimal width of barrier region in X/γ-ray Schottky diode detectors based on CdTe and CdZnTe