Skip to content

Commit e4f3dfb

Browse files
committed
truncate-ahdc-waveforms
1 parent 57de464 commit e4f3dfb

File tree

1 file changed

+4
-1
lines changed
  • common-tools/clas-detector/src/main/java/org/jlab/detector/decode

1 file changed

+4
-1
lines changed

common-tools/clas-detector/src/main/java/org/jlab/detector/decode/CLASDecoder.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@
3030
* @author gavalian
3131
*/
3232
public class CLASDecoder {
33+
34+
// truncate EVIO waveforms longer than this:
35+
final static int MAX_BANK_WF_LENGTH = 30;
3336

3437
protected DetectorEventDecoder detectorDecoder = null;
3538
protected SchemaFactory schemaFactory = new SchemaFactory();
@@ -203,7 +206,7 @@ public Bank getDataBankWF(String name, DetectorType type) {
203206
b.putLong( 4, i, a.get(i).getADCData(0).getTimeStamp());
204207
b.putInt("time", i, (int)a.get(i).getADCData(0).getTime());
205208
DetectorDataDgtz.ADCData xxx = a.get(i).getADCData(0);
206-
for (int j=0; j<xxx.getPulseSize(); ++j)
209+
for (int j=0; j<xxx.getPulseSize() && j<MAX_BANK_WF_LENGTH; ++j)
207210
b.putShort(j+5, i, xxx.getPulseValue(j));
208211
}
209212
return b;

0 commit comments

Comments
 (0)