diff --git a/L1Trigger/TrackFindingTracklet/interface/MatchEngineUnit.h b/L1Trigger/TrackFindingTracklet/interface/MatchEngineUnit.h index 2fbd253507b51..b084b72158623 100644 --- a/L1Trigger/TrackFindingTracklet/interface/MatchEngineUnit.h +++ b/L1Trigger/TrackFindingTracklet/interface/MatchEngineUnit.h @@ -80,7 +80,7 @@ namespace trklet { VMStubsMEMemory* vmstubsmemory_; unsigned int nrzbins_; - unsigned int rzbin_; + unsigned int rzbin_, rzbin__, rzbin___, rzbin__t; unsigned int phibin_; int shift_; @@ -99,6 +99,9 @@ namespace trklet { unsigned int layerdisk_; + //The minimum radius for 2s disks in projection bins + unsigned int ir2smin_; + //Save state at the start of istep bool almostfullsave_; diff --git a/L1Trigger/TrackFindingTracklet/src/MatchEngineUnit.cc b/L1Trigger/TrackFindingTracklet/src/MatchEngineUnit.cc index 496cf98b2e0e7..678415d5288b3 100644 --- a/L1Trigger/TrackFindingTracklet/src/MatchEngineUnit.cc +++ b/L1Trigger/TrackFindingTracklet/src/MatchEngineUnit.cc @@ -18,6 +18,12 @@ MatchEngineUnit::MatchEngineUnit(const Settings& settings, good__ = false; good__t = false; good___ = false; + ir2smin_ = 0; + if (layerdisk_ >= N_LAYER) { + double rmin2s = (layerdisk_ < N_LAYER + 2) ? settings_.rDSSinner(0) : settings_.rDSSouter(0); + ir2smin_ = (1 << (N_RZBITS + NFINERZBITS)) * (rmin2s - settings_.rmindiskvm()) / + (settings_.rmaxdisk() - settings_.rmindiskvm()); + } } void MatchEngineUnit::setAlmostFull() { almostfullsave_ = candmatches_.nearfull(); } @@ -89,6 +95,7 @@ void MatchEngineUnit::step() { } vmstub__ = vmstubsmemory_->getVMStubMEBin(slot, istub_); + rzbin__ = rzbin_ + use_[iuse_].first; isPSseed__ = isPSseed_; projrinv__ = projrinv_; @@ -107,9 +114,21 @@ void MatchEngineUnit::step() { void MatchEngineUnit::processPipeline() { if (good___) { - bool isPSmodule = vmstub___.isPSmodule(); int stubfinerz = vmstub___.finerz().value(); int stubfinephi = vmstub___.finephi().value(); + bool isPSmodule = false; + + if (barrel_) { + isPSmodule = layerdisk_ < N_PSLAYER; + } else { + const int absz = (1 << settings_.MEBinsBits()) - 1; + unsigned int irstub = ((rzbin___ & absz) << NFINERZBITS) + stubfinerz; + + //Verify that ir2smin_ is initialized and check if irstub is less than radius of innermost 2s module + assert(ir2smin_ > 0); + isPSmodule = irstub < ir2smin_; + } + assert(isPSmodule == vmstub___.isPSmodule()); int deltaphi = stubfinephi - projfinephi___; @@ -162,6 +181,7 @@ void MatchEngineUnit::processPipeline() { isPSseed___ = isPSseed__t; good___ = good__t; vmstub___ = vmstub__t; + rzbin___ = rzbin__t; proj__t = proj__; projfinephi__t = projfinephi__; @@ -170,6 +190,7 @@ void MatchEngineUnit::processPipeline() { isPSseed__t = isPSseed__; good__t = good__; vmstub__t = vmstub__; + rzbin__t = rzbin__; } void MatchEngineUnit::reset() {