Skip to content

Commit

Permalink
TrackDistanceValueMapProducer: check the size of the reference vector…
Browse files Browse the repository at this point in the history
… before copying
  • Loading branch information
mmusich committed May 6, 2021
1 parent 601fbc5 commit 6f649b3
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,9 @@ void TrackDistanceValueMapProducer::produce(edm::StreamID streamID,

// just copy the first nth
std::vector<float> reduced_vdR2;
std::copy(v_dR2.begin(), v_dR2.begin() + nthClosestTrack_, std::back_inserter(reduced_vdR2));
if (v_dR2.size() > 0){
std::copy(v_dR2.begin(), v_dR2.begin() + nthClosestTrack_, std::back_inserter(reduced_vdR2));
}
v2_dR2.push_back(reduced_vdR2);
}

Expand Down

0 comments on commit 6f649b3

Please sign in to comment.