Skip to content

Commit

Permalink
fix: Fix TruthVertexFinder for not reconstructed particles (acts-pr…
Browse files Browse the repository at this point in the history
…oject#2979)

This fixes an overlook in acts-project#2937. Non reconstructed particles result in an exception which is fixed here
  • Loading branch information
andiwand authored and asalzburger committed May 21, 2024
1 parent 009bc69 commit f244397
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -151,10 +151,11 @@ ProcessCode TruthVertexFinder::execute(const AlgorithmContext& ctx) const {
std::unordered_map<SimBarcode, std::vector<TrackIndex>> protoVertexTrackMap;

for (const auto& [particle, trackMatch] : particleTrackMatching) {
auto vtxId =
SimBarcode(particle).setParticle(0).setGeneration(0).setSubParticle(0);
auto vtxId = SimBarcode(particle).setParticle(0).setSubParticle(0);

protoVertexTrackMap[vtxId].push_back(trackMatch.track.value());
if (trackMatch.track) {
protoVertexTrackMap[vtxId].push_back(trackMatch.track.value());
}
}

ProtoVertexContainer protoVertices;
Expand Down

0 comments on commit f244397

Please sign in to comment.