diff --git a/L1Trigger/TrackFindingTracklet/interface/MatchEngineUnit.h b/L1Trigger/TrackFindingTracklet/interface/MatchEngineUnit.h index 8b352d38c9246..f562dc0f24bf1 100644 --- a/L1Trigger/TrackFindingTracklet/interface/MatchEngineUnit.h +++ b/L1Trigger/TrackFindingTracklet/interface/MatchEngineUnit.h @@ -36,7 +36,8 @@ namespace trklet { bool usesecondPlus, bool isPSseed, Tracklet* proj, - bool print); + bool print, + int imeu); bool empty() const { return candmatches_.empty(); } @@ -55,6 +56,8 @@ namespace trklet { //needed for consistency with HLS FW version ("_" vs "__" indicating different pipelining stages) bool have_() const { return havepair_; } + void setAlmostFull(); + void reset(); unsigned int rptr() const { return candmatches_.rptr(); } @@ -69,6 +72,7 @@ namespace trklet { unsigned int rzbin_; unsigned int phibin_; int shift_; + int imeu_; unsigned int istub_; unsigned int iuse_; @@ -85,6 +89,9 @@ namespace trklet { unsigned int layerdisk_; + //Save state at the start of istep + bool almostfullsave_; + //LUT for bend consistency with rinv const TrackletLUT& luttable_; diff --git a/L1Trigger/TrackFindingTracklet/src/MatchEngineUnit.cc b/L1Trigger/TrackFindingTracklet/src/MatchEngineUnit.cc index 028e9317ad0b2..83c2d6d3d5aa7 100644 --- a/L1Trigger/TrackFindingTracklet/src/MatchEngineUnit.cc +++ b/L1Trigger/TrackFindingTracklet/src/MatchEngineUnit.cc @@ -27,9 +27,11 @@ void MatchEngineUnit::init(VMStubsMEMemory* vmstubsmemory, bool usesecondPlus, bool isPSseed, Tracklet* proj, - bool print) { + bool print, + int imeu) { vmstubsmemory_ = vmstubsmemory; idle_ = false; + imeu_ = imeu; nrzbins_ = nrzbins; rzbin_ = rzbin; phibin_ = phibin; @@ -69,8 +71,11 @@ void MatchEngineUnit::init(VMStubsMEMemory* vmstubsmemory, goodpair_ = false; } +void MatchEngineUnit::setAlmostFull() { + almostfullsave_ = candmatches_.nearfull(); +} + void MatchEngineUnit::step(bool print) { - bool almostfull = candmatches_.nearfull(); if (goodpair_) { if (print) @@ -82,7 +87,7 @@ void MatchEngineUnit::step(bool print) { havepair_ = false; goodpair_ = false; - if (idle() || almostfull) + if (idle() || almostfullsave_) return; unsigned int slot = (phibin_ + use_[iuse_].second) * nrzbins_ + rzbin_ + use_[iuse_].first; diff --git a/L1Trigger/TrackFindingTracklet/src/MatchProcessor.cc b/L1Trigger/TrackFindingTracklet/src/MatchProcessor.cc index db02830a02125..d5cfa5fe6a59d 100644 --- a/L1Trigger/TrackFindingTracklet/src/MatchProcessor.cc +++ b/L1Trigger/TrackFindingTracklet/src/MatchProcessor.cc @@ -135,8 +135,7 @@ void MatchProcessor::execute(unsigned int iSector, double phimin) { /* The code is organized in three 'steps' corresponding to the PR, ME, and MC functions. The output from - the PR step is buffered in a 'circular' buffer, and similarly the ME output is put in a circular buffer. - + the PR step is buffered in a 'circular' buffer, and similarly the ME output is put in a circular buffer. The implementation is done in steps, emulating what can be done in firmware. One each step we do: 1) A projection is read and if there is space it is insert into the inputProjBuffer_ @@ -192,7 +191,6 @@ void MatchProcessor::execute(unsigned int iSector, double phimin) { for (auto& matchengine : matchengines_) { cout <<" MEU"<ofstream("matchprocessor.txt") << getName() << " " << istep << " " << countall << " " << countsel << " " << countme << " " << countinputproj << endl;