From 69a292bdece39f2858686e9d9568d790420cade0 Mon Sep 17 00:00:00 2001 From: Whitney Armstrong Date: Tue, 22 Oct 2024 13:43:56 -0500 Subject: [PATCH 1/5] Adding ATOF Coda Decoder - Added ALERT detector types - AHDC=24 and ATOF=25 - modified: base/DetectorType.java - modified: decode/CLASDecoder4.java - modified: decode/CodaEventDecoder.java - modified: decode/DetectorEventDecoder.java - modified: etc/bankdefs/hipo/DATA.json - modified: etc/bankdefs/hipo4/data.json modified: base/DetectorType.java modified: data.json modified: CodaEventDecoder.java modified: CodaEventDecoder.java modified: DetectorDataDgtz.java modified: CLASDecoder4.java modified: DetectorDataDgtz.java modified: DetectorEventDecoder.java modified: CodaEventDecoder.java modified: DetectorDataDgtz.java modified: CLASDecoder4.java modified: DetectorDataDgtz.java modified: CLASDecoder4.java modified: CodaEventDecoder.java modified: CLASDecoder4.java modified: CodaEventDecoder.java modified: CLASDecoder4.java new file: .containers/coatjava.Dockerfile new file: .gitlab-ci.yml modified: .gitlab-ci.yml modified: .gitlab-ci.yml modified: .gitlab-ci.yml modified: common-tools/clas-detector/src/main/java/org/jlab/detector/decode/CLASDecoder4.java modified: common-tools/clas-detector/src/main/java/org/jlab/detector/decode/CodaEventDecoder.java --- .containers/coatjava.Dockerfile | 25 ++++++ .gitlab-ci.yml | 31 +++++++ .../org/jlab/detector/base/DetectorType.java | 2 + .../jlab/detector/decode/CLASDecoder4.java | 78 +++++++++++++++--- .../detector/decode/CodaEventDecoder.java | 82 ++++++++++++++++++- .../detector/decode/DetectorDataDgtz.java | 31 +++---- .../detector/decode/DetectorEventDecoder.java | 27 +++--- etc/bankdefs/hipo/DATA.json | 26 ++++++ etc/bankdefs/hipo4/data.json | 29 ++++--- 9 files changed, 275 insertions(+), 56 deletions(-) create mode 100644 .containers/coatjava.Dockerfile create mode 100644 .gitlab-ci.yml diff --git a/.containers/coatjava.Dockerfile b/.containers/coatjava.Dockerfile new file mode 100644 index 0000000000..4d079d132a --- /dev/null +++ b/.containers/coatjava.Dockerfile @@ -0,0 +1,25 @@ +#syntax=docker/dockerfile:1 + +FROM ubuntu:noble + +LABEL name="coatjava" +LABEL maintainer="Whitney Armstrong " +LABEL architecture="amd64" + +USER root + + +RUN apt update && apt upgrade -y +RUN apt install cmake vim maven groovy git ca-certificates wget curl python-is-python3 \ + openjdk-17-jdk openjdk-17-jre openjdk-17-jdk-headless openjdk-17-jre-headless \ + python3-sqlalchemy -y && update-ca-certificates + +# CA certificates +ADD https://pki.jlab.org/JLabCA.crt /etc/ssl/certs/JLabCA.crt +#RUN trust anchor --store /image/JLabCA.crt + +ARG REF_NAME=development +# build coatjava +RUN java --version && cd /opt && \ + git clone https://code.jlab.org/hallb/alert/coatjava.git && cd coatjava && \ + git fetch origin && git checkout ${REF_NAME} && ./build-coatjava.sh --nomaps diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000000..d089cb1daa --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,31 @@ +workflow: + rules: + - if: '$CI_PIPELINE_SOURCE == "merge_request_event"' + - if: '$CI_PIPELINE_SOURCE == "web"' + - if: '$CI_PIPELINE_SOURCE == "webide"' + - if: '$CI_COMMIT_BRANCH == "master"' + - if: '$CI_COMMIT_BRANCH == "development"' + - if: '$CI_COMMIT_TAG' + +default: + image: ubuntu:noble + retry: 2 + +coatjava_build: + image: gcr.io/kaniko-project/executor:debug + script: + - echo "${CI_COMMIT_REF_NAME}" + - >- + /kaniko/executor + --context $CI_PROJECT_DIR/docker + --dockerfile $CI_PROJECT_DIR/.containers/coatjava.Dockerfile + --destination $CI_REGISTRY_IMAGE/coatjava:${CI_COMMIT_REF_NAME} + --build-arg REF_NAME=${CI_COMMIT_REF_NAME} + +alert_testing: + needs: ["coatjava_build"] + variables: + REF_NAME: "$CI_COMMIT_REF_NAME" + trigger: + project: hallb/alert/c12 + strategy: depend diff --git a/common-tools/clas-detector/src/main/java/org/jlab/detector/base/DetectorType.java b/common-tools/clas-detector/src/main/java/org/jlab/detector/base/DetectorType.java index 9aed37f7e6..8695d88845 100644 --- a/common-tools/clas-detector/src/main/java/org/jlab/detector/base/DetectorType.java +++ b/common-tools/clas-detector/src/main/java/org/jlab/detector/base/DetectorType.java @@ -29,6 +29,8 @@ public enum DetectorType { BAND (21, "BAND"), RASTER (22, "RASTER"), URWELL (23, "URWELL"), + AHDC (24, "AHDC"), + ATOF (25, "ATOF"), TARGET (100, "TARGET"), MAGNETS (101, "MAGNETS"), ECIN (110, "ECIN"), diff --git a/common-tools/clas-detector/src/main/java/org/jlab/detector/decode/CLASDecoder4.java b/common-tools/clas-detector/src/main/java/org/jlab/detector/decode/CLASDecoder4.java index 0796b64e00..ccc36f4fcd 100644 --- a/common-tools/clas-detector/src/main/java/org/jlab/detector/decode/CLASDecoder4.java +++ b/common-tools/clas-detector/src/main/java/org/jlab/detector/decode/CLASDecoder4.java @@ -181,6 +181,7 @@ public List getEntriesADC(DetectorType type, public List getEntriesTDC(DetectorType type){ return getEntriesTDC(type,dataList); } + /** * returns TDC entries from decoded data for given detector type * @param type detector type @@ -275,7 +276,10 @@ public Bank getDataBankADC(String name, DetectorType type){ public Bank getDataBankTDC(String name, DetectorType type){ List tdcDGTZ = this.getEntriesTDC(type); - if(schemaFactory.hasSchema(name)==false) return null; + if(schemaFactory.hasSchema(name)==false){ + System.out.println("WARNING: No schema for TDC type : " + type); + return null; + } Bank tdcBANK = new Bank(schemaFactory.getSchema(name), tdcDGTZ.size()); if(tdcBANK==null) return null; @@ -290,6 +294,31 @@ public Bank getDataBankTDC(String name, DetectorType type){ return tdcBANK; } + public Bank getDataBankTDCPetiroc(String name, DetectorType type){ + + List tdcDGTZ = this.getEntriesTDC(type); + if(schemaFactory.hasSchema(name)==false){ + System.out.println("WARNING: No schema for TDC type : " + type); + return null; + } + Bank tdcBANK = new Bank(schemaFactory.getSchema(name), tdcDGTZ.size()); + + if(tdcBANK==null) return null; + + // Not sure why the schemea information isn't used here. + for(int i = 0; i < tdcDGTZ.size(); i++){ + tdcBANK.putByte("sector", i, (byte) tdcDGTZ.get(i).getDescriptor().getSector()); + tdcBANK.putByte("layer", i, (byte) tdcDGTZ.get(i).getDescriptor().getLayer()); + tdcBANK.putShort("component", i, (short) tdcDGTZ.get(i).getDescriptor().getComponent()); + tdcBANK.putByte("order", i, (byte) tdcDGTZ.get(i).getDescriptor().getOrder()); + tdcBANK.putInt("TDC", i, tdcDGTZ.get(i).getTDCData(0).getTime()); + tdcBANK.putInt("ToT", i, tdcDGTZ.get(i).getTDCData(0).getToT()); + //System.err.println("event: " + tdcDGTZ.get(i).toString()); + } + return tdcBANK; + } + + public Bank getDataBankTimeStamp(String name, DetectorType type) { List tdcDGTZ = this.getEntriesTDC(type); @@ -300,7 +329,8 @@ public Bank getDataBankTimeStamp(String name, DetectorType type) { int hash = ((desc.getCrate()<<8)&0xFF00) | (desc.getSlot()&0x00FF); if(tsMap.containsKey(hash)) { if(tsMap.get(hash).getTimeStamp() != tdc.getTimeStamp()) - System.out.println("WARNING: inconsistent timestamp for DCRB crate/slot " + desc.getCrate() + "/" + desc.getSlot()); + System.out.println("WARNING: inconsistent timestamp for DCRB crate/slot " + + desc.getCrate() + "/" + desc.getSlot()); } else { tsMap.put(hash, tdc); @@ -393,16 +423,24 @@ public Event getDataEvent(){ Event event = new Event(); - String[] adcBankNames = new String[]{"FTOF::adc","ECAL::adc","FTCAL::adc","FTHODO::adc","FTTRK::adc", + String[] adcBankNames = new String[]{"FTOF::adc","ECAL::adc","FTCAL::adc","FTHODO::adc","FTTRK::adc", "HTCC::adc","BST::adc","CTOF::adc","CND::adc","LTCC::adc","BMT::adc", "FMT::adc","HEL::adc","RF::adc","BAND::adc","RASTER::adc"}; - DetectorType[] adcBankTypes = new DetectorType[]{DetectorType.FTOF,DetectorType.ECAL,DetectorType.FTCAL,DetectorType.FTHODO,DetectorType.FTTRK, - DetectorType.HTCC,DetectorType.BST,DetectorType.CTOF,DetectorType.CND,DetectorType.LTCC,DetectorType.BMT, - DetectorType.FMT,DetectorType.HEL,DetectorType.RF,DetectorType.BAND, DetectorType.RASTER}; - - String[] tdcBankNames = new String[]{"FTOF::tdc","ECAL::tdc","DC::tdc","HTCC::tdc","LTCC::tdc","CTOF::tdc","CND::tdc","RF::tdc","RICH::tdc","BAND::tdc"}; - DetectorType[] tdcBankTypes = new DetectorType[]{DetectorType.FTOF,DetectorType.ECAL, - DetectorType.DC,DetectorType.HTCC,DetectorType.LTCC,DetectorType.CTOF,DetectorType.CND,DetectorType.RF,DetectorType.RICH,DetectorType.BAND}; + DetectorType[] adcBankTypes = new DetectorType[]{DetectorType.FTOF,DetectorType.ECAL,DetectorType.FTCAL, + DetectorType.FTHODO,DetectorType.FTTRK, + DetectorType.HTCC,DetectorType.BST,DetectorType.CTOF, + DetectorType.CND,DetectorType.LTCC,DetectorType.BMT, + DetectorType.FMT,DetectorType.HEL,DetectorType.RF, + DetectorType.BAND, DetectorType.RASTER}; + + String[] tdcBankNames = new String[]{"FTOF::tdc","ECAL::tdc","DC::tdc", + "HTCC::tdc","LTCC::tdc","CTOF::tdc", + "CND::tdc","RF::tdc","RICH::tdc", + "BAND::tdc"}; + DetectorType[] tdcBankTypes = new DetectorType[]{DetectorType.FTOF,DetectorType.ECAL, + DetectorType.DC,DetectorType.HTCC,DetectorType.LTCC, + DetectorType.CTOF,DetectorType.CND,DetectorType.RF, + DetectorType.RICH,DetectorType.BAND}; for(int i = 0; i < adcBankTypes.length; i++){ Bank adcBank = getDataBankADC(adcBankNames[i],adcBankTypes[i]); @@ -421,6 +459,18 @@ public Event getDataEvent(){ } } } + try { + // Do ATOF + Bank tdcBank = getDataBankTDCPetiroc("ATOF::tdc",DetectorType.ATOF); + if(tdcBank!=null){ + if(tdcBank.getRows()>0){ + event.write(tdcBank); + } + } + } catch(Exception e) { + e.printStackTrace(); + } + try { Bank tsBank = getDataBankTimeStamp("DC::jitter", DetectorType.DC); @@ -432,10 +482,10 @@ public Event getDataEvent(){ } catch(Exception e) { e.printStackTrace(); } + /** * Adding un-decoded banks to the event */ - try { Bank adcBankUD = this.getDataBankUndecodedADC("RAW::adc", DetectorType.UNDEFINED); if(adcBankUD!=null){ @@ -671,6 +721,8 @@ public Bank createHelicityDecoderBank(EvioDataEvent event) { public static void main(String[] args){ OptionParser parser = new OptionParser("decoder"); + + parser.setDescription("CLAS12 Data Decoder"); parser.addOption("-n", "-1", "maximum number of events to process"); parser.addOption("-c", "2", "compression type (0-NONE, 1-LZ4 Fast, 2-LZ4 Best, 3-GZIP)"); parser.addOption("-d", "0","debug mode, set >0 for more verbose output"); @@ -721,8 +773,8 @@ public static void main(String[] args){ writer.setCompressionType(compression); writer.getSchemaFactory().initFromDirectory(ClasUtilsFile.getResourceDir("CLAS12DIR", "etc/bankdefs/hipo4")); - Bank rawScaler = new Bank(writer.getSchemaFactory().getSchema("RAW::scaler")); - Bank rawRunConf = new Bank(writer.getSchemaFactory().getSchema("RUN::config")); + Bank rawScaler = new Bank(writer.getSchemaFactory().getSchema("RAW::scaler")); + Bank rawRunConf = new Bank(writer.getSchemaFactory().getSchema("RUN::config")); Bank helicityAdc = new Bank(writer.getSchemaFactory().getSchema("HEL::adc")); Event scalerEvent = new Event(); 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 6fce0dceab..40f54563d9 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 @@ -280,9 +280,12 @@ else if(node.getTag()==57622){ else if(node.getTag()==57636){ // RICH TDC data return this.getDataEntries_57636(crate, node, event); - } else if(node.getTag()==57641){ - // RTPC data decoding - return this.getDataEntries_57641(crate, node, event); + } else if (node.getTag() == 57657) { + // ATOF Petiroc TDC data + return this.getDataEntries_57657(crate, node, event); + } else if (node.getTag() == 57641) { + // RTPC data decoding + return this.getDataEntries_57641(crate, node, event); } } return bankEntries; @@ -1013,6 +1016,79 @@ public List getDataEntries_57636(Integer crate, EvioNode node return entries; } + /** + * Bank TAG=57657 used for ATOF PETIROC TDC values + * @param crate + * @param node + * @param event + * @return + * + * + * + * c "slot number" + * i "trigger number" + * l "time stamp" + * N "number of channels fired" + * c "channel number" + * i "tdc value" + * i "width value" + * + * + */ + public List getDataEntries_57657(Integer crate, EvioNode node, EvioDataEvent event){ + + ArrayList entries = new ArrayList<>(); + + if(node.getTag()==57657){ + try { + //System.err.println("Decoding ATOF PETIROC event!"); + ByteBuffer compBuffer = node.getByteData(true); + CompositeData compData = new CompositeData(compBuffer.array(),event.getByteOrder()); + + List cdatatypes = compData.getTypes(); + List cdataitems = compData.getItems(); + + if(cdatatypes.get(3) != DataType.NVALUE){ + System.err.println("[EvioRawDataSource] ** error ** corrupted " + + " bank. tag = " + node.getTag() + " num = " + node.getNum()); + return null; + } + + int position = 0; + while(position branches = this.getEventBranches(event); diff --git a/common-tools/clas-detector/src/main/java/org/jlab/detector/decode/DetectorDataDgtz.java b/common-tools/clas-detector/src/main/java/org/jlab/detector/decode/DetectorDataDgtz.java index 9d2979289f..375c322b3d 100644 --- a/common-tools/clas-detector/src/main/java/org/jlab/detector/decode/DetectorDataDgtz.java +++ b/common-tools/clas-detector/src/main/java/org/jlab/detector/decode/DetectorDataDgtz.java @@ -8,7 +8,7 @@ import org.jlab.detector.helicity.HelicityState; import org.jlab.utils.data.DataUtils; -/** +/** * * @author gavalian */ @@ -162,10 +162,9 @@ public static List getDataADC(List list,Det return filtered; } - /** - * a class to hold ADC values + /** ADC Data holder. + * A class to hold ADC values (FADC) */ - public static class ADCData implements Comparable { private int adcOrder = 0; @@ -325,25 +324,29 @@ public int compareTo(ADCData o) { } } - /** - * a class to hold TDC data - */ - + /** TDC Data. + * A class to hold Multihit TDC data + * + */ public static class TDCData implements Comparable{ - private int tdcOrder = 0; - private int tdcTime = 0; + private int tdcOrder = 0; // Used for sorting + private int tdcTime = 0; + private int tdcToT = 0; // Time over threshold public TDCData() {} public TDCData(int time) { this.tdcTime = time;} + public TDCData(int time, int ToT) { this.tdcTime = time; this.tdcToT = ToT;} public int getTime() { return this.tdcTime;} - public int getOrder() { return tdcOrder;} - public TDCData setOrder(int order) { tdcOrder = order;return this;} - public TDCData setTime(short time) { tdcTime = time;return this;} + public int getToT() { return this.tdcToT;} + public int getOrder() { return tdcOrder;} + public TDCData setOrder(int order) { tdcOrder = order;return this;} + public TDCData setTime(short time) { tdcTime = time;return this;} + public TDCData setToT(short ToT) { tdcToT = ToT;return this;} @Override public String toString(){ - return String.format("TDC (%d) : %5d", getOrder(),getTime()); + return String.format("TDC (%d) : %5d : %5d", getOrder(),getTime(),getToT()); } public int compareTo(TDCData o) { diff --git a/common-tools/clas-detector/src/main/java/org/jlab/detector/decode/DetectorEventDecoder.java b/common-tools/clas-detector/src/main/java/org/jlab/detector/decode/DetectorEventDecoder.java index f1e9f86737..2abb2f552e 100644 --- a/common-tools/clas-detector/src/main/java/org/jlab/detector/decode/DetectorEventDecoder.java +++ b/common-tools/clas-detector/src/main/java/org/jlab/detector/decode/DetectorEventDecoder.java @@ -76,31 +76,37 @@ public final void initDecoderDev(){ tablesFitter = Arrays.asList(new String[]{"/daq/fadc/clasdev/htcc"}); translationManager.init(keysTrans,tablesTrans); fitterManager.init(keysFitter, tablesFitter); - scalerManager.init(Arrays.asList(new String[]{"/runcontrol/fcup","/runcontrol/slm","/runcontrol/hwp","/runcontrol/helicity","/daq/config/scalers/dsc1"})); + scalerManager.init(Arrays.asList(new String[]{"/runcontrol/fcup","/runcontrol/slm","/runcontrol/hwp", + "/runcontrol/helicity","/daq/config/scalers/dsc1"})); } public final void initDecoder(){ - keysTrans = Arrays.asList(new String[]{ - "FTCAL","FTHODO","FTTRK","LTCC","ECAL","FTOF","HTCC","DC","CTOF","CND","BST","RF","BMT","FMT","RICH","HEL","BAND","RTPC","RASTER" - }); + // Detector translation table + keysTrans = Arrays.asList(new String[]{"FTCAL","FTHODO","FTTRK","LTCC","ECAL","FTOF", + "HTCC","DC","CTOF","CND","BST","RF","BMT","FMT", + "RICH","HEL","BAND","RTPC","RASTER","ATOF" + }); tablesTrans = Arrays.asList(new String[]{ "/daq/tt/ftcal","/daq/tt/fthodo","/daq/tt/fttrk","/daq/tt/ltcc", "/daq/tt/ec","/daq/tt/ftof","/daq/tt/htcc","/daq/tt/dc","/daq/tt/ctof","/daq/tt/cnd","/daq/tt/svt", "/daq/tt/rf","/daq/tt/bmt","/daq/tt/fmt","/daq/tt/rich2","/daq/tt/hel","/daq/tt/band","/daq/tt/rtpc", - "/daq/tt/raster" + "/daq/tt/raster","/daq/tt/atof2" }); - translationManager.init(keysTrans,tablesTrans); - keysFitter = Arrays.asList(new String[]{"FTCAL","FTHODO","FTTRK","FTOF","LTCC","ECAL","HTCC","CTOF","CND","BMT","FMT","HEL","RF","BAND","RASTER"}); + // ADC waveform fitter translation table + keysFitter = Arrays.asList(new String[]{"FTCAL","FTHODO","FTTRK","FTOF","LTCC","ECAL", + "HTCC","CTOF","CND","BMT","FMT","HEL","RF","BAND","RASTER"}); tablesFitter = Arrays.asList(new String[]{ - "/daq/fadc/ftcal","/daq/fadc/fthodo","/daq/config/fttrk","/daq/fadc/ftof","/daq/fadc/ltcc","/daq/fadc/ec", - "/daq/fadc/htcc","/daq/fadc/ctof","/daq/fadc/cnd","/daq/config/bmt","/daq/config/fmt","/daq/fadc/hel","/daq/fadc/rf","/daq/fadc/band","/daq/fadc/raster" + "/daq/fadc/ftcal","/daq/fadc/fthodo","/daq/config/fttrk","/daq/fadc/ftof","/daq/fadc/ltcc", + "/daq/fadc/ec", "/daq/fadc/htcc","/daq/fadc/ctof","/daq/fadc/cnd","/daq/config/bmt", + "/daq/config/fmt","/daq/fadc/hel","/daq/fadc/rf","/daq/fadc/band","/daq/fadc/raster" }); fitterManager.init(keysFitter, tablesFitter); - scalerManager.init(Arrays.asList(new String[]{"/runcontrol/fcup","/runcontrol/slm","/runcontrol/hwp","/runcontrol/helicity","/daq/config/scalers/dsc1"})); + scalerManager.init(Arrays.asList(new String[]{"/runcontrol/fcup","/runcontrol/slm","/runcontrol/hwp", + "/runcontrol/helicity","/daq/config/scalers/dsc1"})); } /** @@ -119,7 +125,6 @@ public void translate(List detectorData){ for(String table : keysTrans){ IndexedTable tt = translationManager.getConstants(runNumber, table); DetectorType type = DetectorType.getType(table); - if(tt.hasEntry(crate,slot,channel)==true){ int sector = tt.getIntValue("sector", crate,slot,channel); int layer = tt.getIntValue("layer", crate,slot,channel); diff --git a/etc/bankdefs/hipo/DATA.json b/etc/bankdefs/hipo/DATA.json index 35062f2b83..a969659b6e 100644 --- a/etc/bankdefs/hipo/DATA.json +++ b/etc/bankdefs/hipo/DATA.json @@ -390,6 +390,32 @@ {"name":"TDC", "id":5, "type":"int32", "info":"TDC value"} ] }, + { + "bank": "ATOF::adc", + "group": 22411, + "info": "digitized bank ALERT TOF", + "items": [ + {"name":"sector", "id":1, "type":"int8", "info":"sector of ATOF"}, + {"name":"layer", "id":2, "type":"int8", "info":"layer id of ATOF"}, + {"name":"component", "id":3, "type":"int16", "info":"paddle id of ATOF"}, + {"name":"order", "id":4, "type":"int8", "info":"order of (0 - ADCD , 1 - ADCN)"}, + {"name":"ADC", "id":5, "type":"int32", "info":"ADC integral from fit"}, + {"name":"time", "id":6, "type":"float", "info":"time from fitting the pulse"}, + {"name":"ped", "id":7, "type":"int16", "info":"pedestal from pulse"} + ] + }, + { + "bank": "ATOF::tdc", + "group": 22412, + "info": "digitized bank ALERT TOF", + "items": [ + {"name":"sector", "id":1, "type":"int8", "info":"sector of ATOF"}, + {"name":"layer", "id":2, "type":"int8", "info":"layer id of ATOF"}, + {"name":"component", "id":3, "type":"int16", "info":"paddle id of ATOF"}, + {"name":"order", "id":4, "type":"int8", "info":"order of (0 - TDCD , 1 - TDCN)"}, + {"name":"TDC", "id":5, "type":"int32", "info":"TDC value"} + ] + }, { "bank": "RAW::adc", "group": 20011, diff --git a/etc/bankdefs/hipo4/data.json b/etc/bankdefs/hipo4/data.json index a1ef21a083..f203f9757e 100644 --- a/etc/bankdefs/hipo4/data.json +++ b/etc/bankdefs/hipo4/data.json @@ -1,19 +1,4 @@ [ - { - "name" : "ATOF::adc", - "group": 22500, - "item" : 11, - "info": "ADC bank for the ALERT time-of-flight detector", - "entries":[ - { "name":"sector" , "type":"B", "info":"sector (0-14) clockwise looking downstream, 0 = 12 o'clock"}, - { "name":"layer" , "type":"B", "info":"subsector (0-3) clockwise looking downstream"}, - { "name":"component" , "type":"S", "info":"PMT in row (0 = upstream)"}, - { "name":"order" , "type":"B", "info":"order: (0-1), 0 = inner, 1 = outer"}, - { "name":"ADC" , "type":"I", "info":"ADC maximum"}, - { "name":"time" , "type":"F", "info":"time from pulse fit"}, - { "name":"ped" , "type":"S", "info":"pedestal from pulse analysis"} - ] - }, { "name" : "AHDC::tdc", "group": 22400, @@ -27,6 +12,20 @@ { "name":"TDC" , "type":"I", "info":"TDC value"} ] }, + { + "name" : "ATOF::tdc", + "group": 22500, + "item" : 12, + "info": "TDC bank for the ALERT TOF", + "entries":[ + { "name":"sector" , "type":"B", "info":"sector (=1)"}, + { "name":"layer" , "type":"B", "info":"layer (=1)"}, + { "name":"component" , "type":"S", "info":"signal (1-2)"}, + { "name":"order" , "type":"B", "info":"order: 2 - TDCL , 3 - TDCR"}, + { "name":"TDC" , "type":"I", "info":"TDC value"}, + { "name":"ToT" , "type":"I", "info":"Time Over Threshold"} + ] + }, { "name" : "BMT::adc", "group": 20100, From c5eeaff00c3c43b658a898e0bdc7da732f8e37d9 Mon Sep 17 00:00:00 2001 From: Nathan Baltzell Date: Tue, 29 Oct 2024 17:22:07 -0400 Subject: [PATCH 2/5] remove new printout in non-ALERT-specific code --- .../src/main/java/org/jlab/detector/decode/CLASDecoder4.java | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/common-tools/clas-detector/src/main/java/org/jlab/detector/decode/CLASDecoder4.java b/common-tools/clas-detector/src/main/java/org/jlab/detector/decode/CLASDecoder4.java index ccc36f4fcd..d506e5b0fc 100644 --- a/common-tools/clas-detector/src/main/java/org/jlab/detector/decode/CLASDecoder4.java +++ b/common-tools/clas-detector/src/main/java/org/jlab/detector/decode/CLASDecoder4.java @@ -276,10 +276,7 @@ public Bank getDataBankADC(String name, DetectorType type){ public Bank getDataBankTDC(String name, DetectorType type){ List tdcDGTZ = this.getEntriesTDC(type); - if(schemaFactory.hasSchema(name)==false){ - System.out.println("WARNING: No schema for TDC type : " + type); - return null; - } + if(schemaFactory.hasSchema(name)==false) return null; Bank tdcBANK = new Bank(schemaFactory.getSchema(name), tdcDGTZ.size()); if(tdcBANK==null) return null; From 1eb726f076aa8735cbe1c40160fe080f7806246c Mon Sep 17 00:00:00 2001 From: Nathan Baltzell Date: Tue, 29 Oct 2024 17:22:51 -0400 Subject: [PATCH 3/5] remove hipo3 additions --- etc/bankdefs/hipo/DATA.json | 26 -------------------------- 1 file changed, 26 deletions(-) diff --git a/etc/bankdefs/hipo/DATA.json b/etc/bankdefs/hipo/DATA.json index a969659b6e..35062f2b83 100644 --- a/etc/bankdefs/hipo/DATA.json +++ b/etc/bankdefs/hipo/DATA.json @@ -390,32 +390,6 @@ {"name":"TDC", "id":5, "type":"int32", "info":"TDC value"} ] }, - { - "bank": "ATOF::adc", - "group": 22411, - "info": "digitized bank ALERT TOF", - "items": [ - {"name":"sector", "id":1, "type":"int8", "info":"sector of ATOF"}, - {"name":"layer", "id":2, "type":"int8", "info":"layer id of ATOF"}, - {"name":"component", "id":3, "type":"int16", "info":"paddle id of ATOF"}, - {"name":"order", "id":4, "type":"int8", "info":"order of (0 - ADCD , 1 - ADCN)"}, - {"name":"ADC", "id":5, "type":"int32", "info":"ADC integral from fit"}, - {"name":"time", "id":6, "type":"float", "info":"time from fitting the pulse"}, - {"name":"ped", "id":7, "type":"int16", "info":"pedestal from pulse"} - ] - }, - { - "bank": "ATOF::tdc", - "group": 22412, - "info": "digitized bank ALERT TOF", - "items": [ - {"name":"sector", "id":1, "type":"int8", "info":"sector of ATOF"}, - {"name":"layer", "id":2, "type":"int8", "info":"layer id of ATOF"}, - {"name":"component", "id":3, "type":"int16", "info":"paddle id of ATOF"}, - {"name":"order", "id":4, "type":"int8", "info":"order of (0 - TDCD , 1 - TDCN)"}, - {"name":"TDC", "id":5, "type":"int32", "info":"TDC value"} - ] - }, { "bank": "RAW::adc", "group": 20011, From f8e5a2f1464711ea91006b869259ecb85210fbf3 Mon Sep 17 00:00:00 2001 From: Nathan Baltzell Date: Tue, 29 Oct 2024 17:23:07 -0400 Subject: [PATCH 4/5] rename directory for clarity --- etc/bankdefs/{hipo => hipo3}/BAND.json | 0 etc/bankdefs/{hipo => hipo3}/BMT.json | 0 etc/bankdefs/{hipo => hipo3}/BST.json | 0 etc/bankdefs/{hipo => hipo3}/CLAS6EVENT.json | 0 etc/bankdefs/{hipo => hipo3}/CND.json | 0 etc/bankdefs/{hipo => hipo3}/CVT.json | 0 etc/bankdefs/{hipo => hipo3}/DATA.json | 0 etc/bankdefs/{hipo => hipo3}/DC.json | 0 etc/bankdefs/{hipo => hipo3}/DETECTOR.json | 0 etc/bankdefs/{hipo => hipo3}/ECAL.json | 0 etc/bankdefs/{hipo => hipo3}/EVENT.json | 0 etc/bankdefs/{hipo => hipo3}/FMT.json | 0 etc/bankdefs/{hipo => hipo3}/FT.json | 0 etc/bankdefs/{hipo => hipo3}/HEADER.json | 0 etc/bankdefs/{hipo => hipo3}/HTCC.json | 0 etc/bankdefs/{hipo => hipo3}/LTCC.json | 0 etc/bankdefs/{hipo => hipo3}/MC.json | 0 etc/bankdefs/{hipo => hipo3}/RICH.json | 0 etc/bankdefs/{hipo => hipo3}/RTPC.json | 0 etc/bankdefs/{hipo => hipo3}/TOF.json | 0 20 files changed, 0 insertions(+), 0 deletions(-) rename etc/bankdefs/{hipo => hipo3}/BAND.json (100%) rename etc/bankdefs/{hipo => hipo3}/BMT.json (100%) rename etc/bankdefs/{hipo => hipo3}/BST.json (100%) rename etc/bankdefs/{hipo => hipo3}/CLAS6EVENT.json (100%) rename etc/bankdefs/{hipo => hipo3}/CND.json (100%) rename etc/bankdefs/{hipo => hipo3}/CVT.json (100%) rename etc/bankdefs/{hipo => hipo3}/DATA.json (100%) rename etc/bankdefs/{hipo => hipo3}/DC.json (100%) rename etc/bankdefs/{hipo => hipo3}/DETECTOR.json (100%) rename etc/bankdefs/{hipo => hipo3}/ECAL.json (100%) rename etc/bankdefs/{hipo => hipo3}/EVENT.json (100%) rename etc/bankdefs/{hipo => hipo3}/FMT.json (100%) rename etc/bankdefs/{hipo => hipo3}/FT.json (100%) rename etc/bankdefs/{hipo => hipo3}/HEADER.json (100%) rename etc/bankdefs/{hipo => hipo3}/HTCC.json (100%) rename etc/bankdefs/{hipo => hipo3}/LTCC.json (100%) rename etc/bankdefs/{hipo => hipo3}/MC.json (100%) rename etc/bankdefs/{hipo => hipo3}/RICH.json (100%) rename etc/bankdefs/{hipo => hipo3}/RTPC.json (100%) rename etc/bankdefs/{hipo => hipo3}/TOF.json (100%) diff --git a/etc/bankdefs/hipo/BAND.json b/etc/bankdefs/hipo3/BAND.json similarity index 100% rename from etc/bankdefs/hipo/BAND.json rename to etc/bankdefs/hipo3/BAND.json diff --git a/etc/bankdefs/hipo/BMT.json b/etc/bankdefs/hipo3/BMT.json similarity index 100% rename from etc/bankdefs/hipo/BMT.json rename to etc/bankdefs/hipo3/BMT.json diff --git a/etc/bankdefs/hipo/BST.json b/etc/bankdefs/hipo3/BST.json similarity index 100% rename from etc/bankdefs/hipo/BST.json rename to etc/bankdefs/hipo3/BST.json diff --git a/etc/bankdefs/hipo/CLAS6EVENT.json b/etc/bankdefs/hipo3/CLAS6EVENT.json similarity index 100% rename from etc/bankdefs/hipo/CLAS6EVENT.json rename to etc/bankdefs/hipo3/CLAS6EVENT.json diff --git a/etc/bankdefs/hipo/CND.json b/etc/bankdefs/hipo3/CND.json similarity index 100% rename from etc/bankdefs/hipo/CND.json rename to etc/bankdefs/hipo3/CND.json diff --git a/etc/bankdefs/hipo/CVT.json b/etc/bankdefs/hipo3/CVT.json similarity index 100% rename from etc/bankdefs/hipo/CVT.json rename to etc/bankdefs/hipo3/CVT.json diff --git a/etc/bankdefs/hipo/DATA.json b/etc/bankdefs/hipo3/DATA.json similarity index 100% rename from etc/bankdefs/hipo/DATA.json rename to etc/bankdefs/hipo3/DATA.json diff --git a/etc/bankdefs/hipo/DC.json b/etc/bankdefs/hipo3/DC.json similarity index 100% rename from etc/bankdefs/hipo/DC.json rename to etc/bankdefs/hipo3/DC.json diff --git a/etc/bankdefs/hipo/DETECTOR.json b/etc/bankdefs/hipo3/DETECTOR.json similarity index 100% rename from etc/bankdefs/hipo/DETECTOR.json rename to etc/bankdefs/hipo3/DETECTOR.json diff --git a/etc/bankdefs/hipo/ECAL.json b/etc/bankdefs/hipo3/ECAL.json similarity index 100% rename from etc/bankdefs/hipo/ECAL.json rename to etc/bankdefs/hipo3/ECAL.json diff --git a/etc/bankdefs/hipo/EVENT.json b/etc/bankdefs/hipo3/EVENT.json similarity index 100% rename from etc/bankdefs/hipo/EVENT.json rename to etc/bankdefs/hipo3/EVENT.json diff --git a/etc/bankdefs/hipo/FMT.json b/etc/bankdefs/hipo3/FMT.json similarity index 100% rename from etc/bankdefs/hipo/FMT.json rename to etc/bankdefs/hipo3/FMT.json diff --git a/etc/bankdefs/hipo/FT.json b/etc/bankdefs/hipo3/FT.json similarity index 100% rename from etc/bankdefs/hipo/FT.json rename to etc/bankdefs/hipo3/FT.json diff --git a/etc/bankdefs/hipo/HEADER.json b/etc/bankdefs/hipo3/HEADER.json similarity index 100% rename from etc/bankdefs/hipo/HEADER.json rename to etc/bankdefs/hipo3/HEADER.json diff --git a/etc/bankdefs/hipo/HTCC.json b/etc/bankdefs/hipo3/HTCC.json similarity index 100% rename from etc/bankdefs/hipo/HTCC.json rename to etc/bankdefs/hipo3/HTCC.json diff --git a/etc/bankdefs/hipo/LTCC.json b/etc/bankdefs/hipo3/LTCC.json similarity index 100% rename from etc/bankdefs/hipo/LTCC.json rename to etc/bankdefs/hipo3/LTCC.json diff --git a/etc/bankdefs/hipo/MC.json b/etc/bankdefs/hipo3/MC.json similarity index 100% rename from etc/bankdefs/hipo/MC.json rename to etc/bankdefs/hipo3/MC.json diff --git a/etc/bankdefs/hipo/RICH.json b/etc/bankdefs/hipo3/RICH.json similarity index 100% rename from etc/bankdefs/hipo/RICH.json rename to etc/bankdefs/hipo3/RICH.json diff --git a/etc/bankdefs/hipo/RTPC.json b/etc/bankdefs/hipo3/RTPC.json similarity index 100% rename from etc/bankdefs/hipo/RTPC.json rename to etc/bankdefs/hipo3/RTPC.json diff --git a/etc/bankdefs/hipo/TOF.json b/etc/bankdefs/hipo3/TOF.json similarity index 100% rename from etc/bankdefs/hipo/TOF.json rename to etc/bankdefs/hipo3/TOF.json From dbb691d380fbf4b0bff4049b18275a42a90ff1b0 Mon Sep 17 00:00:00 2001 From: Nathan Baltzell Date: Tue, 29 Oct 2024 20:47:32 -0400 Subject: [PATCH 5/5] finalize ccdb table name --- .../java/org/jlab/detector/decode/DetectorEventDecoder.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common-tools/clas-detector/src/main/java/org/jlab/detector/decode/DetectorEventDecoder.java b/common-tools/clas-detector/src/main/java/org/jlab/detector/decode/DetectorEventDecoder.java index 2abb2f552e..56ebbe9c77 100644 --- a/common-tools/clas-detector/src/main/java/org/jlab/detector/decode/DetectorEventDecoder.java +++ b/common-tools/clas-detector/src/main/java/org/jlab/detector/decode/DetectorEventDecoder.java @@ -91,7 +91,7 @@ public final void initDecoder(){ "/daq/tt/ftcal","/daq/tt/fthodo","/daq/tt/fttrk","/daq/tt/ltcc", "/daq/tt/ec","/daq/tt/ftof","/daq/tt/htcc","/daq/tt/dc","/daq/tt/ctof","/daq/tt/cnd","/daq/tt/svt", "/daq/tt/rf","/daq/tt/bmt","/daq/tt/fmt","/daq/tt/rich2","/daq/tt/hel","/daq/tt/band","/daq/tt/rtpc", - "/daq/tt/raster","/daq/tt/atof2" + "/daq/tt/raster","/daq/tt/atof" }); translationManager.init(keysTrans,tablesTrans);