Title: A general model for the gain of gas avalanche counters