From de2b85d9683491c910d1e789df065f805c69b658 Mon Sep 17 00:00:00 2001 From: Martina Date: Wed, 20 Nov 2024 17:58:02 +0100 Subject: [PATCH 1/2] save correct outermost hit position also for tracks w/o last hit in mtd --- .../TrackExtender/plugins/TrackExtenderWithMTD.cc | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/RecoMTD/TrackExtender/plugins/TrackExtenderWithMTD.cc b/RecoMTD/TrackExtender/plugins/TrackExtenderWithMTD.cc index 454d084b242d5..1a0292195b83a 100644 --- a/RecoMTD/TrackExtender/plugins/TrackExtenderWithMTD.cc +++ b/RecoMTD/TrackExtender/plugins/TrackExtenderWithMTD.cc @@ -1004,9 +1004,15 @@ void TrackExtenderWithMTDT::produce(edm::Event& ev, const edm:: #endif npixBarrel.push_back(backtrack.hitPattern().numberOfValidPixelBarrelHits()); npixEndcap.push_back(backtrack.hitPattern().numberOfValidPixelEndcapHits()); - outermostHitPosition.push_back( - mBTL.hit ? (float)(*track).outerRadius() - : (float)(*track).outerZ()); // save R of the outermost hit for BTL, z for ETL. + + if (mBTL.hit || mETL.hit) { + outermostHitPosition.push_back( + mBTL.hit ? (float)(*track).outerRadius() + : (float)(*track).outerZ()); // save R of the outermost hit for BTL, z for ETL. + } else { + outermostHitPosition.push_back(std::abs(track->eta()) < 1.48 ? (float)(*track).outerRadius() + : (float)(*track).outerZ()); + } LogTrace("TrackExtenderWithMTD") << "TrackExtenderWithMTD: tmtd " << tmtdMap << " +/- " << sigmatmtdMap << " t0 " << t0Map << " +/- " << sigmat0Map << " tof pi/K/p " << tofpiMap From 550e9be8bdbc181a9f66297eba711e69ee16d883 Mon Sep 17 00:00:00 2001 From: Martina Date: Thu, 21 Nov 2024 14:52:13 +0100 Subject: [PATCH 2/2] code-format --- RecoMTD/TrackExtender/plugins/TrackExtenderWithMTD.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/RecoMTD/TrackExtender/plugins/TrackExtenderWithMTD.cc b/RecoMTD/TrackExtender/plugins/TrackExtenderWithMTD.cc index 1a0292195b83a..5c13f5a5a6695 100644 --- a/RecoMTD/TrackExtender/plugins/TrackExtenderWithMTD.cc +++ b/RecoMTD/TrackExtender/plugins/TrackExtenderWithMTD.cc @@ -620,6 +620,8 @@ class TrackExtenderWithMTDT : public edm::stream::EDProducer<> { const bool useSimVertex_; const float dzCut_; const float bsTimeSpread_; + + static constexpr float trackMaxBtlEta_ = 1.5; }; template @@ -1010,8 +1012,8 @@ void TrackExtenderWithMTDT::produce(edm::Event& ev, const edm:: mBTL.hit ? (float)(*track).outerRadius() : (float)(*track).outerZ()); // save R of the outermost hit for BTL, z for ETL. } else { - outermostHitPosition.push_back(std::abs(track->eta()) < 1.48 ? (float)(*track).outerRadius() - : (float)(*track).outerZ()); + outermostHitPosition.push_back(std::abs(track->eta()) < trackMaxBtlEta_ ? (float)(*track).outerRadius() + : (float)(*track).outerZ()); } LogTrace("TrackExtenderWithMTD") << "TrackExtenderWithMTD: tmtd " << tmtdMap << " +/- " << sigmatmtdMap