24 throw std::invalid_argument(
"Missing input truth particles collection");
27 throw std::invalid_argument(
"Missing output proto vertices collection");
34 const auto& particles =
39 auto addProtoVertex = [&](SimParticleContainer::const_iterator begin,
40 SimParticleContainer::const_iterator end) {
42 protoVertex.reserve(std::distance(begin, end));
44 for (; begin != end; ++begin) {
45 protoVertex.push_back(std::distance(particles.begin(), begin));
47 protoVertices.push_back(std::move(protoVertex));
50 if (m_cfg.excludeSecondaries) {
54 if (vtxId.vertexSecondary() != 0
u) {
57 addProtoVertex(vtxParticles.begin(), vtxParticles.end());
61 if (m_cfg.separateSecondaries) {
64 addProtoVertex(vtxParticles.begin(), vtxParticles.end());
69 addProtoVertex(vtxParticles.begin(), vtxParticles.end());
74 ctx.
eventStore.
add(m_cfg.outputProtoVertices, std::move(protoVertices));