31 auto& serviceSvc = algorithms::ServiceSvc::instance();
39 m_log = m_log_service->logger(
"AlgorithmsInit");
42 [[maybe_unused]]
auto& geoSvc = algorithms::GeoSvc::instance();
43 serviceSvc.setInit<algorithms::GeoSvc>([
this](
auto&& g) {
44 this->m_log->debug(
"Initializing algorithms::GeoSvc");
45 g.init(
const_cast<dd4hep::Detector*
>(this->m_dd4hep_service->detector().get()));
49 [[maybe_unused]]
auto& actsSvc = algorithms::ActsSvc::instance();
51 this->m_log->debug(
"Initializing algorithms::ActsSvc");
53 g.init(this->m_actsgeo_service->actsGeoProvider());
55 g.init(std::move(std::current_exception()));
60 const algorithms::LogLevel level{
static_cast<algorithms::LogLevel
>(m_log->level())};
61 serviceSvc.setInit<algorithms::LogSvc>([
this, level](
auto&& logger) {
62 this->m_log->debug(
"Initializing algorithms::LogSvc");
64 [
this](
const algorithms::LogLevel l, std::string_view caller, std::string_view msg) {
66 std::lock_guard<std::mutex> lock(m);
68 static std::map<std::string, std::shared_ptr<spdlog::logger>> loggers;
69 if (!loggers.contains(std::string(caller))) {
70 this->m_log->debug(
"Initializing algorithms::LogSvc logger {}", caller);
71 loggers[std::string(caller)] = this->m_log_service->logger(std::string(caller));
73 loggers[std::string(caller)]->log(
static_cast<spdlog::level::level_enum
>(l), msg);
75 logger.defaultLevel(level);
79 [[maybe_unused]]
auto& randomSvc = algorithms::RandomSvc::instance();
80 serviceSvc.setInit<algorithms::RandomSvc>([
this](
auto&& r) {
81 this->m_log->debug(
"Initializing algorithms::RandomSvc");
82 r.setProperty(
"seed",
static_cast<std::size_t
>(1));
87 [[maybe_unused]]
auto& particleSvc = algorithms::ParticleSvc::instance();
91 [[maybe_unused]]
auto& uniqueIDGenSvc = algorithms::UniqueIDGenSvc::instance();
92 for (
const auto& [key, prop] : uniqueIDGenSvc.getProperties()) {
94 [
this, &uniqueIDGenSvc, key = key](
auto&& val) {
95 this->GetApplication()->SetDefaultParameter(std::string(key),
97 uniqueIDGenSvc.setProperty(key, val);