Measuring the gain of a photomultiplier tube