Gain of the LELA free electron laser and characteristics of the optical cavity