Make a custom Service optional through options file
When creating a custom Service as this one: https://github.com/HEP-FCC/FCCSW/blob/edm4hep/Sim/SimG4Components/src/SimG4Svc.cpp
which is then to be used by an Algorithm like here: https://github.com/HEP-FCC/FCCSW/blob/edm4hep/Sim/SimG4Components/src/SimG4Alg.cpp
The service ServiceHandle<ISimG4Svc> m_geantSvc;
will always be used, unless resorting to some sort of flag to indicate whether it should be used or not. If the service is to be optional, enabled by the options file, how would one achieve this?
Like when adding Tools, one can check the tool to be .empty()
and then use it, depending on the configuration in the options file, but I didn't find a way to achieve this with Services.