Skip to content

Commit eba60c1

Browse files
baltzelltongtongcao
authored andcommitted
use index-based accessors for waveform (#883)
1 parent abb17b2 commit eba60c1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

common-tools/clas-detector/src/main/java/org/jlab/detector/pulse/HipoExtractor.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ protected List<Pulse> getPulses(int n, IndexedTable it, DataBank wfBank) {
128128
short[] samples = new short[n];
129129
for (int i=0; i<wfBank.rows(); ++i) {
130130
for (int j=0; j<n; ++j)
131-
samples[j] = wfBank.getShort(String.format("s%d",j+1), i);
131+
samples[j] = wfBank.getShort(j+5, i);
132132
long timestamp = wfBank.getLong("timestamp",i);
133133
int time = wfBank.getInt("time",i);
134134
List<Pulse> p = it==null ? extract(null, i, timestamp, time, samples) :
@@ -146,7 +146,7 @@ protected List<Pulse> getPulses(int n, IndexedTable it, Bank wfBank) {
146146
short[] samples = new short[n];
147147
for (int i=0; i<wfBank.getRows(); ++i) {
148148
for (int j=0; j<n; ++j)
149-
samples[j] = wfBank.getShort(String.format("s%d",j+1), i);
149+
samples[j] = wfBank.getShort(j+5, i);
150150
// FIXME: Can speed this up (but looks like not for DataBank?):
151151
//samples[j] = wfBank.getShort(String.format(5+j,j+1), i);
152152
int time = wfBank.getInt("time",i);

0 commit comments

Comments
 (0)