Theoretical study of back-to-back avalanche photodiodes for mid- and longwave infrared applications