An automatic gain stabilizer for scintillation counters