From 80fa51e083a2ea7ae2d949e2734ea64dff388f6b Mon Sep 17 00:00:00 2001 From: Nathan Baltzell Date: Thu, 27 Feb 2025 13:49:34 -0500 Subject: [PATCH] timestamp kludge --- .../detector/decode/CodaEventDecoder.java | 30 +++++++++++-------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/common-tools/clas-detector/src/main/java/org/jlab/detector/decode/CodaEventDecoder.java b/common-tools/clas-detector/src/main/java/org/jlab/detector/decode/CodaEventDecoder.java index ccd68ca5cb..4d39ad1077 100644 --- a/common-tools/clas-detector/src/main/java/org/jlab/detector/decode/CodaEventDecoder.java +++ b/common-tools/clas-detector/src/main/java/org/jlab/detector/decode/CodaEventDecoder.java @@ -2,6 +2,7 @@ import java.nio.ByteBuffer; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; import java.util.logging.Level; import java.util.logging.Logger; @@ -10,7 +11,6 @@ import org.jlab.coda.jevio.DataType; import org.jlab.coda.jevio.EvioException; import org.jlab.coda.jevio.EvioNode; -import org.jlab.detector.base.DetectorType; import org.jlab.detector.decode.DetectorDataDgtz.ADCData; import org.jlab.detector.decode.DetectorDataDgtz.HelicityDecoderData; import org.jlab.detector.decode.DetectorDataDgtz.SCALERData; @@ -37,12 +37,14 @@ public class CodaEventDecoder { private int timeStampErrors = 0; private long triggerBits = 0; private byte helicityLevel3 = HelicityBit.UDF.value(); - private List triggerWords = new ArrayList<>(); + private final List triggerWords = new ArrayList<>(); JsonObject epicsData = new JsonObject(); - private final long timeStampTolerance = 0L; private int tiMaster = -1; - + + // FIXME: move this to CCDB, e.g., meanwhile cannot reuse ROC id + private static final List PCIE_ROCS = Arrays.asList(new Integer[]{78}); + public CodaEventDecoder(){ } @@ -66,7 +68,6 @@ public List getDataEntries(EvioDataEvent event){ // zero out the trigger bits, but let the others properties inherit // from the previous event, in the case where there's no HEAD bank: this.setTriggerBits(0); - List rawEntries = new ArrayList(); List branches = this.getEventBranches(event); this.setTimeStamp(event); @@ -86,7 +87,6 @@ public List getDataEntries(EvioDataEvent event){ this.getDataEntries_EPICS(event); this.getDataEntries_HelicityDecoder(event); - return rawEntries; } @@ -142,18 +142,22 @@ else if(tiEntries.size()>1) { // check sychronization boolean tiSync=true; int i0 = -1; - // set reference timestamp from first entry which is not the tiMaster + // set reference timestamp from first entry which is not the tiMaster nor PCIE: for(int i=0; ideltaTS) { tiSync=false; if(this.timeStampErrors<100) {