Fix bug in output file name.
Automatically detect extra detectors (e.g. RE4 and GEM)