Skip to content

Commit 7d14ed9

Browse files
raffaelladevitatongtongcao
authored andcommitted
faster reversing of DC translation table (#886)
1 parent bddffe9 commit 7d14ed9

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

reconstruction/dc/src/main/java/org/jlab/rec/dc/Constants.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -579,10 +579,10 @@ public synchronized IndexedTable getReverseTT(int run, IndexedTable tt) {
579579
private void addReverseTT(int run, IndexedTable tt) {
580580
LOGGER.info("Reversing translation table for run " + run);
581581
IndexedTable reverse = new IndexedTable(4, "crate/I:slot/I:channel/I");
582-
for(int row=0; row<tt.getRowCount(); row++) {
583-
int crate = Integer.valueOf((String)tt.getValueAt(row,0));
584-
int slot = Integer.valueOf((String)tt.getValueAt(row,1));
585-
int channel = Integer.valueOf((String)tt.getValueAt(row,2));
582+
for(Object key : tt.getList().getMap().keySet()) {
583+
int crate = tt.getList().getIndexGenerator().getIndex((long)key, 0);
584+
int slot = tt.getList().getIndexGenerator().getIndex((long)key, 1);
585+
int channel = tt.getList().getIndexGenerator().getIndex((long)key, 2);
586586
int sector = tt.getIntValue("sector", crate,slot,channel);
587587
int layer = tt.getIntValue("layer", crate,slot,channel);
588588
int comp = tt.getIntValue("component", crate,slot,channel);

0 commit comments

Comments
 (0)