From 62f7732475e46621349fb540b474d658f740c346 Mon Sep 17 00:00:00 2001 From: Matthew Date: Tue, 25 Jun 2024 04:34:52 +0200 Subject: [PATCH] Protect against null VertexRef in deep_helpers.cc --- RecoBTag/FeatureTools/src/deep_helpers.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/RecoBTag/FeatureTools/src/deep_helpers.cc b/RecoBTag/FeatureTools/src/deep_helpers.cc index 76b443542b334..0c149d59df562 100644 --- a/RecoBTag/FeatureTools/src/deep_helpers.cc +++ b/RecoBTag/FeatureTools/src/deep_helpers.cc @@ -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;