From 3e37fc58549e5df2ea0cdb5617240e2d631debd4 Mon Sep 17 00:00:00 2001 From: francescobrivio Date: Tue, 30 Apr 2024 12:15:05 +0200 Subject: [PATCH] Propagate downstream the valid state check in PATLeptonTimeLifeInfoProducer --- .../PatAlgos/plugins/PATLeptonTimeLifeInfoProducer.cc | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/PhysicsTools/PatAlgos/plugins/PATLeptonTimeLifeInfoProducer.cc b/PhysicsTools/PatAlgos/plugins/PATLeptonTimeLifeInfoProducer.cc index 9b8f4f8450254..978aa180c3252 100644 --- a/PhysicsTools/PatAlgos/plugins/PATLeptonTimeLifeInfoProducer.cc +++ b/PhysicsTools/PatAlgos/plugins/PATLeptonTimeLifeInfoProducer.cc @@ -162,9 +162,6 @@ void PATLeptonTimeLifeInfoProducer::produceAndFillIPInfo(const T& lepton, TrackTimeLifeInfo& info) { const reco::Track* track = getTrack(lepton); if (track != nullptr) { - info.setTrack(track); - info.setBField_z(transTrackBuilder.field()->inInverseGeV(GlobalPoint(track->vx(), track->vy(), track->vz())).z()); - // Extrapolate track to the point closest to PV reco::TransientTrack transTrack = transTrackBuilder.build(track); AnalyticalImpactPointExtrapolator extrapolator(transTrack.field()); @@ -187,7 +184,9 @@ void PATLeptonTimeLifeInfoProducer::produceAndFillIPInfo(const T& lepton, if (ip_vec.dot(GlobalVector(lepton.px(), lepton.py(), lepton.pz())) < 0) ip_mes = Measurement1D(-1. * ip_mes.value(), ip_mes.error()); - // Store PCA info + // Store Track and PCA info + info.setTrack(track); + info.setBField_z(transTrackBuilder.field()->inInverseGeV(GlobalPoint(track->vx(), track->vy(), track->vz())).z()); info.setPCA(pca, pca_cov); info.setIP(ip_vec, ip_cov); info.setIPLength(ip_mes);