Skip to content

Commit

Permalink
fix: Fix TruthVertexFinder for not reconstructed particles (#2979)
Browse files Browse the repository at this point in the history
This fixes an overlook in #2937. Non reconstructed particles result in an exception which is fixed here
  • Loading branch information
andiwand authored Feb 26, 2024
1 parent 032dd9a commit e06342c
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 e06342c

Please sign in to comment.