Skip to content

Commit

Permalink
Protect against null VertexRef in deep_helpers.cc
Browse files Browse the repository at this point in the history
  • Loading branch information
mandrenguyen committed Jun 25, 2024
1 parent a6c951a commit 62f7732
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion RecoBTag/FeatureTools/src/deep_helpers.cc
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,8 @@ namespace btagbtvdeep {

float vtx_ass_from_pfcand(const reco::PFCandidate &pfcand, int pv_ass_quality, const reco::VertexRef &pv) {
float vtx_ass = pat::PackedCandidate::PVAssociationQuality(qualityMap[pv_ass_quality]);
if (pfcand.trackRef().isNonnull() && pv->trackWeight(pfcand.trackRef()) > 0.5 && pv_ass_quality == 7) {
if (pv.isNonnull() && pfcand.trackRef().isNonnull() && pv->trackWeight(pfcand.trackRef()) > 0.5 &&
pv_ass_quality == 7) {
vtx_ass = pat::PackedCandidate::UsedInFitTight;
}
return vtx_ass;
Expand Down

0 comments on commit 62f7732

Please sign in to comment.