Skip to content

Commit

Permalink
Merge pull request #45297 from mandrenguyen/pvAssNullV2_140X
Browse files Browse the repository at this point in the history
[14_0_X] Protect against null `VertexRef` in `deep_helpers.cc`
  • Loading branch information
cmsbuild authored Jul 1, 2024
2 parents 5cc9d1a + 62f7732 commit 45ba902
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 45ba902

Please sign in to comment.