Skip to content

Commit

Permalink
Fixed magic numbers in PurgeDuplicate
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Ally committed Jan 6, 2025
1 parent c8338bf commit f9e06d8
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions L1Trigger/TrackFindingTracklet/src/PurgeDuplicate.cc
Original file line number Diff line number Diff line change
Expand Up @@ -220,10 +220,10 @@ void PurgeDuplicate::execute(std::vector<Track>& outputtracks, unsigned int iSec
if (st1.first == st2.first && st1.second == st2.second) { // tracks share stub
// Converts layer/disk encoded in st1->first to an index in the layer array
int i = st1.first; // layer/disk
bool barrel = (i > 0 && i < 10);
bool endcapA = (i > 10);
bool barrel = (i > 0 && i <= N_LAYER);
bool endcapA = (i > N_LAYER);
bool endcapB = (i < 0);
int lay = barrel * (i - 1) + endcapA * (i - 5) - endcapB * i; // encode in range 0-15
int lay = barrel * (i - 1) + endcapA * (i - (N_LAYER - 1)) - endcapB * i; // encode in range 0-15
if (!layerArr[lay]) {
nShareLay++;
layerArr[lay] = true;
Expand Down Expand Up @@ -260,10 +260,10 @@ void PurgeDuplicate::execute(std::vector<Track>& outputtracks, unsigned int iSec
// For each stub on the second track, find the stub with the best residual and store its index in the layStubidsTrk1 array
for (unsigned int stcount = 0; stcount < stubsTrk2.size(); stcount++) {
int i = stubsTrk2[stcount].first; // layer/disk
bool barrel = (i > 0 && i < 10);
bool endcapA = (i > 10);
bool barrel = (i > 0 && i <= N_LAYER);
bool endcapA = (i > N_LAYER);
bool endcapB = (i < 0);
int lay = barrel * (i - 1) + endcapA * (i - 5) - endcapB * i; // encode in range 0-15
int lay = barrel * (i - 1) + endcapA * (i - (N_LAYER - 1)) - endcapB * i; // encode in range 0-15
double nres = getPhiRes(inputtracklets_[jtrk], fullStubslistsTrk2[stcount]);
double ores = 0;
if (layStubidsTrk2[lay] != -1)
Expand Down

0 comments on commit f9e06d8

Please sign in to comment.