Skip to content

Commit

Permalink
Clean up the pixel local reconstruction code (#602)
Browse files Browse the repository at this point in the history
Address the pixel local reconstruction review comments:
  - remove obsolete comments;
  - consistently use named constants;
  - rename data members and methods to be more descriptive;
  - rename local variables according to the coding rules and for
    consistency with cms-sw#32591;
  - update transient dictionaries to match data types.
  • Loading branch information
fwyzard committed Jan 15, 2021
1 parent 6660b94 commit 1cbb2aa
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions RecoPixelVertexing/PixelTriplets/plugins/gpuPixelDoubletsAlgos.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ namespace gpuPixelDoublets {

bool isOuterLadder = ideal_cond;

using Hist = TrackingRecHit2DSOAView::Hist;
using PhiBinner = TrackingRecHit2DSOAView::PhiBinner;

auto const& __restrict__ hist = hh.phiBinner();
auto const& __restrict__ phiBinner = hh.phiBinner();
uint32_t const* __restrict__ offsets = hh.hitsLayerStart();
assert(offsets);

Expand Down Expand Up @@ -93,7 +93,7 @@ namespace gpuPixelDoublets {
uint8_t outer = layerPairs[2 * pairLayerId + 1];
assert(outer > inner);

auto hoff = Hist::histOff(outer);
auto hoff = PhiBinner::histOff(outer);

auto i = (0 == pairLayerId) ? j : j - innerLayerCumulativeSize[pairLayerId - 1];
i += offsets[inner];
Expand Down Expand Up @@ -175,10 +175,10 @@ namespace gpuPixelDoublets {

auto iphicut = phicuts[pairLayerId];

auto kl = Hist::bin(int16_t(mep - iphicut));
auto kh = Hist::bin(int16_t(mep + iphicut));
auto incr = [](auto& k) { return k = (k + 1) % Hist::nbins(); };
// bool piWrap = std::abs(kh-kl) > Hist::nbins()/2;
auto kl = PhiBinner::bin(int16_t(mep - iphicut));
auto kh = PhiBinner::bin(int16_t(mep + iphicut));
auto incr = [](auto& k) { return k = (k + 1) % PhiBinner::nbins(); };
// bool piWrap = std::abs(kh-kl) > PhiBinner::nbins()/2;

#ifdef GPU_DEBUG
int tot = 0;
Expand All @@ -191,10 +191,10 @@ namespace gpuPixelDoublets {
for (auto kk = kl; kk != khh; incr(kk)) {
#ifdef GPU_DEBUG
if (kk != kl && kk != kh)
nmin += hist.size(kk + hoff);
nmin += phiBinner.size(kk + hoff);
#endif
auto const* __restrict__ p = hist.begin(kk + hoff);
auto const* __restrict__ e = hist.end(kk + hoff);
auto const* __restrict__ p = phiBinner.begin(kk + hoff);
auto const* __restrict__ e = phiBinner.end(kk + hoff);
p += first;
for (; p < e; p += stride) {
auto oi = __ldg(p);
Expand Down

0 comments on commit 1cbb2aa

Please sign in to comment.