diff --git a/RecoMTD/TrackExtender/plugins/TrackExtenderWithMTD.cc b/RecoMTD/TrackExtender/plugins/TrackExtenderWithMTD.cc index 454d084b242d5..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 @@ -1004,9 +1006,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()) < trackMaxBtlEta_ ? (float)(*track).outerRadius() + : (float)(*track).outerZ()); + } LogTrace("TrackExtenderWithMTD") << "TrackExtenderWithMTD: tmtd " << tmtdMap << " +/- " << sigmatmtdMap << " t0 " << t0Map << " +/- " << sigmat0Map << " tof pi/K/p " << tofpiMap