Skip to content

Commit

Permalink
Added PS/2S logic to MEU (#213)
Browse files Browse the repository at this point in the history
* Added PS/2S logic to MEU

* Removed debug printout

* Updated MC file

* Rewrite code to determine if VM stub is ps or 2s to avoid hardcoded numbers

---------

Co-authored-by: bryates <brent.yates@email.ucr.edu>
Co-authored-by: Anders <aryd@cern.ch>
  • Loading branch information
3 people authored and tomalin committed Nov 15, 2023
1 parent a9ee1f5 commit cae7f4c
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 2 deletions.
5 changes: 4 additions & 1 deletion L1Trigger/TrackFindingTracklet/interface/MatchEngineUnit.h
Expand Up @@ -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_;

Expand All @@ -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_;

Expand Down
23 changes: 22 additions & 1 deletion L1Trigger/TrackFindingTracklet/src/MatchEngineUnit.cc
Expand Up @@ -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(); }
Expand Down Expand Up @@ -89,6 +95,7 @@ void MatchEngineUnit::step() {
}

vmstub__ = vmstubsmemory_->getVMStubMEBin(slot, istub_);
rzbin__ = rzbin_ + use_[iuse_].first;

isPSseed__ = isPSseed_;
projrinv__ = projrinv_;
Expand All @@ -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___;

Expand Down Expand Up @@ -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__;
Expand All @@ -170,6 +190,7 @@ void MatchEngineUnit::processPipeline() {
isPSseed__t = isPSseed__;
good__t = good__;
vmstub__t = vmstub__;
rzbin__t = rzbin__;
}

void MatchEngineUnit::reset() {
Expand Down

0 comments on commit cae7f4c

Please sign in to comment.