From 319c2835d4c4cb4ce16b3461cc7c5ef5b779b8ae Mon Sep 17 00:00:00 2001 From: Emil Bols Date: Thu, 12 Jul 2018 13:43:04 +0200 Subject: [PATCH] Use sv momentum for deltaR calculation --- RecoBTag/TensorFlow/plugins/DeepFlavourTagInfoProducer.cc | 2 +- RecoBTag/TensorFlow/src/SecondaryVertexConverter.cc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/RecoBTag/TensorFlow/plugins/DeepFlavourTagInfoProducer.cc b/RecoBTag/TensorFlow/plugins/DeepFlavourTagInfoProducer.cc index eee80348b943f..20e27736b3ba5 100644 --- a/RecoBTag/TensorFlow/plugins/DeepFlavourTagInfoProducer.cc +++ b/RecoBTag/TensorFlow/plugins/DeepFlavourTagInfoProducer.cc @@ -218,7 +218,7 @@ void DeepFlavourTagInfoProducer::produce(edm::Event& iEvent, const edm::EventSet { return btagbtvdeep::sv_vertex_comparator(sva, svb, pv); }); // fill features from secondary vertices for (const auto & sv : svs_sorted) { - if (reco::deltaR2(sv.position() - pv.position(), flip_ ? -jet_dir : jet_dir) > (jet_radius_*jet_radius_)) continue; + if (reco::deltaR2(sv, jet_dir) > (jet_radius_*jet_radius_)) continue; else { features.sv_features.emplace_back(); // in C++17 could just get from emplace_back output diff --git a/RecoBTag/TensorFlow/src/SecondaryVertexConverter.cc b/RecoBTag/TensorFlow/src/SecondaryVertexConverter.cc index 01bab93f452e9..1770e7c423487 100644 --- a/RecoBTag/TensorFlow/src/SecondaryVertexConverter.cc +++ b/RecoBTag/TensorFlow/src/SecondaryVertexConverter.cc @@ -17,7 +17,7 @@ namespace btagbtvdeep { math::XYZVector jet_dir = jet.momentum().Unit(); sv_features.pt = sv.pt(); - sv_features.deltaR = catch_infs_and_bound(std::fabs(reco::deltaR(sv.position() - pv.position(), flip ? -jet_dir : jet_dir))-0.5, + sv_features.deltaR = catch_infs_and_bound(std::fabs(reco::deltaR(sv, jet_dir))-0.5, 0,-2,0); sv_features.mass = sv.mass(); sv_features.ntracks = sv.numberOfDaughters();