21 throw std::invalid_argument(
"Missing input simulated hits collection");
24 throw std::invalid_argument(
"Missing output source links collection");
27 throw std::invalid_argument(
"Invalid resolution setting");
30 throw std::invalid_argument(
"Missing tracking geometry");
33 throw std::invalid_argument(
"Missing random numbers tool");
50 sourceLinks.reserve(
hits.size());
53 auto rng = m_cfg.randomNumbers->spawnGenerator(ctx);
54 std::normal_distribution<double> stdNormal(0.0, 1.0);
64 const auto is = m_surfaces.find(moduleGeoId);
65 if (is == m_surfaces.end()) {
71 for (
const auto& hit : moduleHits) {
75 hit.unitDirection(),
pos);
79 loc[
Acts::eLOC_0] = pos[0] + m_cfg.sigmaLoc0 * stdNormal(rng);
80 loc[
Acts::eLOC_1] = pos[1] + m_cfg.sigmaLoc1 * stdNormal(rng);
83 auto it = sourceLinks.emplace_hint(sourceLinks.end(), *
surface, hit, 2,
86 if (std::next(
it) != sourceLinks.end()) {
87 ACTS_FATAL(
"The hit ordering broke. Run for your life.");
88 return ProcessCode::ABORT;
93 ctx.
eventStore.
add(m_cfg.outputSourceLinks, std::move(sourceLinks));