Characterisation and Simulation of Linear and Geiger Mode Avalanche Photodiodes