22 throw std::invalid_argument(
"Missing input simulated hits collection");
25 throw std::invalid_argument(
"Missing output source links collection");
28 throw std::invalid_argument(
"Invalid resolution setting");
31 throw std::invalid_argument(
"Missing tracking geometry");
34 throw std::invalid_argument(
"Missing random numbers tool");
52 sourceLinks.reserve(hits.size());
55 auto rng = m_cfg.randomNumbers->spawnGenerator(ctx);
56 std::normal_distribution<double> stdNormal(0.0, 1.0);
64 for (
auto&& [moduleGeoId, moduleHits] :
groupByModule(hits)) {
66 const auto is = m_surfaces.find(moduleGeoId);
67 if (is == m_surfaces.end()) {
73 for (
const auto& hit : moduleHits) {
78 if (not lpResult.ok()) {
79 ACTS_ERROR(
"Global to local transformation did not succeed.");
80 return ProcessCode::ABORT;
82 lp = lpResult.value();
91 auto it = sourceLinks.emplace_hint(sourceLinks.end(), *
surface, hit, 2,
94 if (std::next(
it) != sourceLinks.end()) {
95 ACTS_FATAL(
"The hit ordering broke. Run for your life.");
96 return ProcessCode::ABORT;
101 ctx.
eventStore.
add(m_cfg.outputSourceLinks, std::move(sourceLinks));