Photoconductive gain of a longitudinal detector with an arbitrary absorption profile