From 1562902914d96c7c3b66eefb52dbd7f09bb8ebd9 Mon Sep 17 00:00:00 2001 From: Nathan Baltzell Date: Wed, 10 May 2023 07:44:11 -0400 Subject: [PATCH] add comments --- .../src/main/java/org/jlab/detector/swaps/SwapManager.java | 3 +++ .../swaps/src/main/java/org/jlab/service/swaps/SwapEngine.java | 1 + 2 files changed, 4 insertions(+) diff --git a/common-tools/clas-detector/src/main/java/org/jlab/detector/swaps/SwapManager.java b/common-tools/clas-detector/src/main/java/org/jlab/detector/swaps/SwapManager.java index 8750de799..b5a9f4f2c 100644 --- a/common-tools/clas-detector/src/main/java/org/jlab/detector/swaps/SwapManager.java +++ b/common-tools/clas-detector/src/main/java/org/jlab/detector/swaps/SwapManager.java @@ -162,6 +162,9 @@ public int[] get(int run, DataBank bank, int row) { final int sector = bank.getByte("sector", row); final int layer = bank.getByte("layer", row); final int comp = bank.getShort("component", row); + // Get the order that would be in the translation tables: + // FIXME: could use RawDataBank instead of modulus, but this service + // should never filter rows and always needs all of them. final int order = bank.getByte("order", row) % 10; return this.get(run,banksToTables.get(bank.getDescriptor().getName()),sector,layer,comp,order); } diff --git a/reconstruction/swaps/src/main/java/org/jlab/service/swaps/SwapEngine.java b/reconstruction/swaps/src/main/java/org/jlab/service/swaps/SwapEngine.java index 15ff4fbfc..3a132431d 100644 --- a/reconstruction/swaps/src/main/java/org/jlab/service/swaps/SwapEngine.java +++ b/reconstruction/swaps/src/main/java/org/jlab/service/swaps/SwapEngine.java @@ -29,6 +29,7 @@ private void updateBank(int run,DataBank bank) { bank.setByte("sector",irow,(byte)slco[0]); bank.setByte("layer",irow,(byte)slco[1]); bank.setShort("component",irow,(short)slco[2]); + // Restore the original order decade to the new unswapped, true order: final byte decade = (byte) (bank.getByte("order", irow)/10); final byte order = (byte) (10*decade + (byte)slco[3]); bank.setByte("order",irow, order);