Skip to content

Commit a798a28

Browse files
faster reversing of DC translation table (#886)
1 parent e6435dc commit a798a28

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
@@ -515,10 +515,10 @@ public synchronized IndexedTable getReverseTT(int run, IndexedTable tt) {
515515
private void addReverseTT(int run, IndexedTable tt) {
516516
LOGGER.info("Reversing translation table for run " + run);
517517
IndexedTable reverse = new IndexedTable(4, "crate/I:slot/I:channel/I");
518-
for(int row=0; row<tt.getRowCount(); row++) {
519-
int crate = Integer.valueOf((String)tt.getValueAt(row,0));
520-
int slot = Integer.valueOf((String)tt.getValueAt(row,1));
521-
int channel = Integer.valueOf((String)tt.getValueAt(row,2));
518+
for(Object key : tt.getList().getMap().keySet()) {
519+
int crate = tt.getList().getIndexGenerator().getIndex((long)key, 0);
520+
int slot = tt.getList().getIndexGenerator().getIndex((long)key, 1);
521+
int channel = tt.getList().getIndexGenerator().getIndex((long)key, 2);
522522
int sector = tt.getIntValue("sector", crate,slot,channel);
523523
int layer = tt.getIntValue("layer", crate,slot,channel);
524524
int comp = tt.getIntValue("component", crate,slot,channel);

0 commit comments

Comments
 (0)