From 515ddd7f13aa87b94ff6673f8166faef503d2c62 Mon Sep 17 00:00:00 2001 From: Nathan Baltzell Date: Mon, 6 Jan 2025 10:38:59 -0500 Subject: [PATCH 01/37] Customize validation jobs, reducing run-group combos (#416) * customize validation jobs * remove invalid config --- .github/workflows/validation.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/.github/workflows/validation.yml b/.github/workflows/validation.yml index c790023594..6c42d6d924 100644 --- a/.github/workflows/validation.yml +++ b/.github/workflows/validation.yml @@ -10,3 +10,17 @@ on: jobs: validation: uses: JeffersonLab/clas12-validation/.github/workflows/ci.yml@main + with: + matrix_evgen: >- + [ + "e_p", + "e_n", + "e_g", + "e_pC", + "eFT_K", + "e_gFT" + ] + matrix_config: >- + [ + "rgb_fall2019" + ] From aba9579ab825b772b6d921acf3453f7a6550e217 Mon Sep 17 00:00:00 2001 From: Nathan Baltzell Date: Mon, 6 Jan 2025 15:10:42 -0500 Subject: [PATCH 02/37] show undefined efficiency --- .../src/main/java/org/jlab/analysis/efficiency/Truth.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/common-tools/clas-analysis/src/main/java/org/jlab/analysis/efficiency/Truth.java b/common-tools/clas-analysis/src/main/java/org/jlab/analysis/efficiency/Truth.java index 6442e69d31..0376174c96 100644 --- a/common-tools/clas-analysis/src/main/java/org/jlab/analysis/efficiency/Truth.java +++ b/common-tools/clas-analysis/src/main/java/org/jlab/analysis/efficiency/Truth.java @@ -154,7 +154,10 @@ public String toTable() { for (int i=0; i 0) + s.append(String.format("%7.4f",get(validPids.get(i),validPids.get(j)))); + else + s.append(String.format("%7s","-")); if (validPids.size()==j+1) s.append("\n"); } } From 65efc48e8b6d535a6fee0a740ed4e55272f7e604 Mon Sep 17 00:00:00 2001 From: Nathan Baltzell Date: Mon, 6 Jan 2025 15:16:01 -0500 Subject: [PATCH 03/37] export efficiency denominator --- .../src/main/java/org/jlab/analysis/efficiency/Truth.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/common-tools/clas-analysis/src/main/java/org/jlab/analysis/efficiency/Truth.java b/common-tools/clas-analysis/src/main/java/org/jlab/analysis/efficiency/Truth.java index 0376174c96..80fb2041a2 100644 --- a/common-tools/clas-analysis/src/main/java/org/jlab/analysis/efficiency/Truth.java +++ b/common-tools/clas-analysis/src/main/java/org/jlab/analysis/efficiency/Truth.java @@ -171,16 +171,19 @@ public String toTable() { public JsonObject toJson() { JsonObject effs = new JsonObject(); JsonArray pids = new JsonArray(); + JsonObject gens = new JsonObject(); for (int i=0; i Date: Mon, 6 Jan 2025 16:03:48 -0500 Subject: [PATCH 04/37] bugfix --- .../src/main/java/org/jlab/analysis/efficiency/Truth.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common-tools/clas-analysis/src/main/java/org/jlab/analysis/efficiency/Truth.java b/common-tools/clas-analysis/src/main/java/org/jlab/analysis/efficiency/Truth.java index 80fb2041a2..a99865570c 100644 --- a/common-tools/clas-analysis/src/main/java/org/jlab/analysis/efficiency/Truth.java +++ b/common-tools/clas-analysis/src/main/java/org/jlab/analysis/efficiency/Truth.java @@ -154,7 +154,7 @@ public String toTable() { for (int i=0; i 0) + if (mcTallies[i] > 0) s.append(String.format("%7.4f",get(validPids.get(i),validPids.get(j)))); else s.append(String.format("%7s","-")); @@ -178,7 +178,7 @@ public JsonObject toJson() { for (int j=0; j Date: Tue, 7 Jan 2025 17:24:29 -0500 Subject: [PATCH 05/37] silence transformer warnings (#417) --- common-tools/coat-lib/pom.xml | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/common-tools/coat-lib/pom.xml b/common-tools/coat-lib/pom.xml index 7056fc47f6..eb73b73ca7 100644 --- a/common-tools/coat-lib/pom.xml +++ b/common-tools/coat-lib/pom.xml @@ -225,17 +225,15 @@ - - - - ${project.artifactId} - ${project.version} - ${project.artifactId} - ${project.version} - ${project.groupId} - - - + + + ${project.artifactId} + ${project.version} + ${project.artifactId} + ${project.version} + ${project.groupId} + + From 9806724f62d1373aa2bb619b6504dbb329e61172 Mon Sep 17 00:00:00 2001 From: Nathan Baltzell Date: Tue, 22 Aug 2023 09:45:00 -0400 Subject: [PATCH 06/37] remove unused stuff --- .../jlab/clas/reco/ReconstructionEngine.java | 47 +------------------ 1 file changed, 1 insertion(+), 46 deletions(-) diff --git a/common-tools/clas-reco/src/main/java/org/jlab/clas/reco/ReconstructionEngine.java b/common-tools/clas-reco/src/main/java/org/jlab/clas/reco/ReconstructionEngine.java index cce8c4301b..99a1e77e99 100644 --- a/common-tools/clas-reco/src/main/java/org/jlab/clas/reco/ReconstructionEngine.java +++ b/common-tools/clas-reco/src/main/java/org/jlab/clas/reco/ReconstructionEngine.java @@ -227,8 +227,7 @@ public EngineData configure(EngineData ed) { } protected String getStringConfigParameter(String jsonString, - String key) throws Exception { - Object js; + String key) throws Exception { String variation = ""; try { JSONObject base = new JSONObject(jsonString); @@ -238,13 +237,6 @@ protected String getStringConfigParameter(String jsonString, } else { LOGGER.log(Level.WARNING,"[JSON]" + this.getName() + " **** warning **** does not contain key = " + key); } - /* - js = base.get(key); - if (js instanceof String) { - return (String) js; - } else { - throw new Exception("JSONObject[" + "] not a string."); - }*/ } catch (JSONException e) { throw new Exception(e.getMessage()); } @@ -446,42 +438,6 @@ public EngineData execute(EngineData input) { } return input; - /* - if (!mt.equalsIgnoreCase()) { - String msg = String.format("Wrong input type: %s", mt); - output.setStatus(EngineStatus.ERROR); - output.setDescription(msg); - return output; - }*/ - /* - EvioDataEvent dataevent = null; - - try { - ByteBuffer bb = (ByteBuffer) input.getData(); - byte[] buffer = bb.array(); - ByteOrder endianness = bb.order(); - dataevent = new EvioDataEvent(buffer, endianness, EvioFactory.getDictionary()); - } catch (Exception e) { - String msg = String.format("Error reading input event%n%n%s", ClaraUtil.reportException(e)); - output.setStatus(EngineStatus.ERROR); - output.setDescription(msg); - return output; - } - - try { - this.processDataEvent(dataevent); - ByteBuffer bbo = dataevent.getEventBuffer(); - //byte[] buffero = bbo.array(); - output.setData(mt, bbo); - } catch (Exception e) { - String msg = String.format("Error processing input event%n%n%s", ClaraUtil.reportException(e)); - output.setStatus(EngineStatus.ERROR); - output.setDescription(msg); - return output; - } - - return output; - */ } @Override @@ -586,7 +542,6 @@ public static void main(String[] args){ "\"timestamp\":333\n" + "}"; System.out.println(json); - //json = "{ \"ccdb\":{\"run\":10,\"variation\":\"default\"}, \"variation\":\"cosmic\"}"; Reco reco = new Reco(); String variation = reco.getStringConfigParameter(json, "variation"); System.out.println(" Variation : " + variation); From 287d9ce7df44d9c519e3cdc9ec49b6ce6759a917 Mon Sep 17 00:00:00 2001 From: Nathan Baltzell Date: Tue, 22 Aug 2023 10:23:16 -0400 Subject: [PATCH 07/37] add detectorChanged method (and remove unused imports) --- .../org/jlab/clas/reco/EngineProcessor.java | 2 +- .../jlab/clas/reco/ReconstructionEngine.java | 30 ++++++++++++------- .../jlab/clas/swimtools/MagFieldsEngine.java | 3 ++ .../java/org/jlab/rec/service/AHDCEngine.java | 5 ++++ .../org/jlab/service/band/BANDEngine.java | 11 ++++--- .../service/cnd/CNDCalibrationEngine.java | 19 +++++------- .../org/jlab/rec/cvt/services/CVTEngine.java | 6 ++-- .../java/org/jlab/service/eb/EBEngine.java | 4 ++- .../org/jlab/service/eb/VersionEngine.java | 3 ++ .../java/org/jlab/service/ec/ECEngine.java | 5 ++++ .../java/org/jlab/service/fmt/FMTEngine.java | 5 ++++ .../main/java/org/jlab/rec/ft/FTEBEngine.java | 6 +++- .../java/org/jlab/rec/ft/cal/FTCALEngine.java | 6 +++- .../org/jlab/rec/ft/hodo/FTHODOEngine.java | 6 +++- .../java/org/jlab/rec/ft/trk/FTTRKEngine.java | 5 ++++ .../org/jlab/service/ft/FTEBEngineTest.java | 5 ++++ .../org/jlab/service/ft/FTTRKEngineTest.java | 10 +++---- .../htcc/HTCCReconstructionService.java | 5 ++++ .../org/jlab/service/ltcc/LTCCEngine.java | 6 +++- .../java/org/jlab/service/mc/TruthMatch.java | 5 ++++ .../org/jlab/service/mltn/MLTDEngine.java | 5 ++++ .../org/jlab/service/mltn/MLTNEngine.java | 10 +++---- .../org/jlab/service/raster/RasterEngine.java | 5 ++++ .../java/org/jlab/rec/rich/RICHEBEngine.java | 22 +++++--------- .../org/jlab/service/rtpc/RTPCEngine.java | 12 ++++---- .../org/jlab/service/swaps/SwapEngine.java | 3 ++ .../org/jlab/service/ctof/CTOFEngine.java | 8 +++-- .../org/jlab/service/ftof/FTOFEngine.java | 5 ++++ .../org/jlab/service/urwell/URWellEngine.java | 5 ++++ .../rec/service/vtx/VTXReconstruction.java | 9 +++--- 30 files changed, 156 insertions(+), 75 deletions(-) diff --git a/common-tools/clas-reco/src/main/java/org/jlab/clas/reco/EngineProcessor.java b/common-tools/clas-reco/src/main/java/org/jlab/clas/reco/EngineProcessor.java index ff1fc6ab2a..650affb8ee 100644 --- a/common-tools/clas-reco/src/main/java/org/jlab/clas/reco/EngineProcessor.java +++ b/common-tools/clas-reco/src/main/java/org/jlab/clas/reco/EngineProcessor.java @@ -267,7 +267,7 @@ public void init(){ public void processEvent(DataEvent event){ for(Map.Entry engine : this.processorEngines.entrySet()){ try { - engine.getValue().filterEvent(event); + engine.getValue().processEvent(event); } catch (Exception e){ LOGGER.log(Level.SEVERE, "[Exception] >>>>> engine : {0}\n\n", engine.getKey()); e.printStackTrace(); diff --git a/common-tools/clas-reco/src/main/java/org/jlab/clas/reco/ReconstructionEngine.java b/common-tools/clas-reco/src/main/java/org/jlab/clas/reco/ReconstructionEngine.java index 99a1e77e99..8ddf487061 100644 --- a/common-tools/clas-reco/src/main/java/org/jlab/clas/reco/ReconstructionEngine.java +++ b/common-tools/clas-reco/src/main/java/org/jlab/clas/reco/ReconstructionEngine.java @@ -60,6 +60,7 @@ public abstract class ReconstructionEngine implements Engine { volatile boolean dropOutputBanks = false; private final Set outputBanks = new HashSet<>(); + private volatile int runNumber = 0; private boolean ignoreInvalidRunNumbers = true; volatile long triggerMask = 0xFFFFFFFFFFFFFFFFL; @@ -337,17 +338,21 @@ public void dropBanks(DataEvent event) { } } } + + public abstract void detectorChanged(int runNumber); public boolean checkRunNumber(DataEvent event) { - if (!this.ignoreInvalidRunNumbers) return true; - int run = 0; if (event.hasBank("RUN::config")) { - run = event.getBank("RUN::config").getInt("run",0); + int r = event.getBank("RUN::config").getInt("run",0); + if (r != this.runNumber) { + this.runNumber = r; + this.detectorChanged(r); + } } - return run>0; + return !this.ignoreInvalidRunNumbers && this.runNumber>0; } - public void filterEvent(DataEvent dataEvent) { + public void processEvent(DataEvent dataEvent) { if (!this.wroteConfig) { this.wroteConfig = true; JsonUtils.extend(dataEvent, CONFIG_BANK_NAME, "json", this.generateConfig()); @@ -396,7 +401,7 @@ public EngineData execute(EngineData input) { } try { - this.filterEvent(dataEventHipo); + this.processEvent(dataEventHipo); output.setData(mt, dataEventHipo.getHipoEvent()); } catch (Exception e) { String msg = String.format("Error processing input event%n%n%s", ClaraUtil.reportException(e)); @@ -513,15 +518,20 @@ public Reco(){ } @Override public boolean processDataEvent(DataEvent event) { - throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. + throw new UnsupportedOperationException("Not supported yet."); } @Override public boolean init() { - throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. + throw new UnsupportedOperationException("Not supported yet."); } - -} + + @Override + public void detectorChanged(int runNumber) { + throw new UnsupportedOperationException("Not supported yet."); + } + } + public static void main(String[] args){ System.setProperty("CLAS12DIR", "/Users/gavalian/Work/Software/project-3a.0.0/Distribution/clas12-offline-software/coatjava"); try { diff --git a/common-tools/swim-tools/src/main/java/org/jlab/clas/swimtools/MagFieldsEngine.java b/common-tools/swim-tools/src/main/java/org/jlab/clas/swimtools/MagFieldsEngine.java index ceab50389a..2480da3128 100644 --- a/common-tools/swim-tools/src/main/java/org/jlab/clas/swimtools/MagFieldsEngine.java +++ b/common-tools/swim-tools/src/main/java/org/jlab/clas/swimtools/MagFieldsEngine.java @@ -195,4 +195,7 @@ public boolean init() { return true; } + @Override + public void detectorChanged(int runNumber) {} + } diff --git a/reconstruction/alert/src/main/java/org/jlab/rec/service/AHDCEngine.java b/reconstruction/alert/src/main/java/org/jlab/rec/service/AHDCEngine.java index ed27d104e9..14a45a40f5 100644 --- a/reconstruction/alert/src/main/java/org/jlab/rec/service/AHDCEngine.java +++ b/reconstruction/alert/src/main/java/org/jlab/rec/service/AHDCEngine.java @@ -285,4 +285,9 @@ public static void main(String[] args) { System.out.println("finished " + (System.nanoTime() - starttime) * Math.pow(10, -9)); } + + @Override + public void detectorChanged(int runNumber) { + throw new UnsupportedOperationException("Not supported yet."); + } } diff --git a/reconstruction/band/src/main/java/org/jlab/service/band/BANDEngine.java b/reconstruction/band/src/main/java/org/jlab/service/band/BANDEngine.java index 636d4a8dcb..d321a831d0 100644 --- a/reconstruction/band/src/main/java/org/jlab/service/band/BANDEngine.java +++ b/reconstruction/band/src/main/java/org/jlab/service/band/BANDEngine.java @@ -1,11 +1,7 @@ package org.jlab.service.band; - import java.util.ArrayList; import java.util.Arrays; - -import javax.naming.event.NamingEvent; - import org.jlab.clas.reco.ReconstructionEngine; import org.jlab.io.base.DataBank; import org.jlab.io.base.DataEvent; @@ -26,14 +22,12 @@ public class BANDEngine extends ReconstructionEngine { - public BANDEngine() { super("BAND", "hauensteinsegarra", "1.0"); } int Run = -1; - @Override public boolean processDataEvent(DataEvent event) { //System.out.println("**** NEW EVENT ****"); @@ -143,4 +137,9 @@ public static void main (String arg[]) { } + @Override + public void detectorChanged(int runNumber) { + throw new UnsupportedOperationException("Not supported yet."); + } + } diff --git a/reconstruction/cnd/src/main/java/org/jlab/service/cnd/CNDCalibrationEngine.java b/reconstruction/cnd/src/main/java/org/jlab/service/cnd/CNDCalibrationEngine.java index 2670f6f1a9..4604220fc4 100644 --- a/reconstruction/cnd/src/main/java/org/jlab/service/cnd/CNDCalibrationEngine.java +++ b/reconstruction/cnd/src/main/java/org/jlab/service/cnd/CNDCalibrationEngine.java @@ -1,7 +1,8 @@ package org.jlab.service.cnd; -import java.io.IOException; +import java.util.Arrays; import java.util.ArrayList; +import java.util.concurrent.atomic.AtomicInteger; import org.jlab.clas.reco.ReconstructionEngine; import org.jlab.io.base.DataBank; @@ -15,17 +16,8 @@ import org.jlab.rec.cnd.hit.CvtGetHTrack; import org.jlab.rec.cnd.hit.HalfHit; import org.jlab.rec.cnd.hit.CndHitFinder; - -import java.lang.String; -import java.util.Arrays; -import java.util.List; -import java.util.Optional; -import java.util.concurrent.atomic.AtomicInteger; -import org.jlab.clas.physics.LorentzVector; - import org.jlab.rec.cnd.cluster.CNDCluster; import org.jlab.rec.cnd.cluster.CNDClusterFinder; -import org.jlab.utils.groups.IndexedTable; /** * Service to return reconstructed CND Hits - the output is in Hipo format @@ -33,10 +25,8 @@ * * */ - public class CNDCalibrationEngine extends ReconstructionEngine { - public CNDCalibrationEngine() { super("CND", "chatagnon & WANG", "1.0"); @@ -266,5 +256,10 @@ public static void main (String arg[]) { } } + @Override + public void detectorChanged(int runNumber) { + throw new UnsupportedOperationException("Not supported yet."); + } + } diff --git a/reconstruction/cvt/src/main/java/org/jlab/rec/cvt/services/CVTEngine.java b/reconstruction/cvt/src/main/java/org/jlab/rec/cvt/services/CVTEngine.java index e278b0c9c7..a15c089c52 100644 --- a/reconstruction/cvt/src/main/java/org/jlab/rec/cvt/services/CVTEngine.java +++ b/reconstruction/cvt/src/main/java/org/jlab/rec/cvt/services/CVTEngine.java @@ -28,7 +28,6 @@ */ public class CVTEngine extends ReconstructionEngine { - /** * @param docacutsum the docacutsum to set */ @@ -609,6 +608,9 @@ public void printConfiguration() { } - + @Override + public void detectorChanged(int runNumber) { + throw new UnsupportedOperationException("Not supported yet."); + } } diff --git a/reconstruction/eb/src/main/java/org/jlab/service/eb/EBEngine.java b/reconstruction/eb/src/main/java/org/jlab/service/eb/EBEngine.java index 4899368aef..f49f89f5ae 100644 --- a/reconstruction/eb/src/main/java/org/jlab/service/eb/EBEngine.java +++ b/reconstruction/eb/src/main/java/org/jlab/service/eb/EBEngine.java @@ -1,6 +1,5 @@ package org.jlab.service.eb; -import java.util.Collections; import java.util.List; import java.util.logging.Logger; @@ -353,5 +352,8 @@ public boolean init() { return true; } + + @Override + public void detectorChanged(int runNumber) {} } diff --git a/reconstruction/eb/src/main/java/org/jlab/service/eb/VersionEngine.java b/reconstruction/eb/src/main/java/org/jlab/service/eb/VersionEngine.java index 12016d5951..dea21ae21d 100644 --- a/reconstruction/eb/src/main/java/org/jlab/service/eb/VersionEngine.java +++ b/reconstruction/eb/src/main/java/org/jlab/service/eb/VersionEngine.java @@ -44,4 +44,7 @@ public boolean init() { return true; } + @Override + public void detectorChanged(int runNumber) {} + } diff --git a/reconstruction/ec/src/main/java/org/jlab/service/ec/ECEngine.java b/reconstruction/ec/src/main/java/org/jlab/service/ec/ECEngine.java index 0657f1db26..93d4436e5a 100644 --- a/reconstruction/ec/src/main/java/org/jlab/service/ec/ECEngine.java +++ b/reconstruction/ec/src/main/java/org/jlab/service/ec/ECEngine.java @@ -466,5 +466,10 @@ public boolean init() { return true; } + + @Override + public void detectorChanged(int runNumber) { + throw new UnsupportedOperationException("Not supported yet."); + } } diff --git a/reconstruction/fmt/src/main/java/org/jlab/service/fmt/FMTEngine.java b/reconstruction/fmt/src/main/java/org/jlab/service/fmt/FMTEngine.java index de6e67e4d5..c87a9afcb2 100644 --- a/reconstruction/fmt/src/main/java/org/jlab/service/fmt/FMTEngine.java +++ b/reconstruction/fmt/src/main/java/org/jlab/service/fmt/FMTEngine.java @@ -233,4 +233,9 @@ public boolean processDataEvent(DataEvent event) { return true; } + @Override + public void detectorChanged(int runNumber) { + throw new UnsupportedOperationException("Not supported yet."); + } + } diff --git a/reconstruction/ft/src/main/java/org/jlab/rec/ft/FTEBEngine.java b/reconstruction/ft/src/main/java/org/jlab/rec/ft/FTEBEngine.java index f9acd60a40..ce785ed257 100644 --- a/reconstruction/ft/src/main/java/org/jlab/rec/ft/FTEBEngine.java +++ b/reconstruction/ft/src/main/java/org/jlab/rec/ft/FTEBEngine.java @@ -1,6 +1,5 @@ package org.jlab.rec.ft; -import java.util.ArrayList; import java.util.Arrays; import java.util.List; @@ -1006,4 +1005,9 @@ public static void main(String arg[]){ frameCALTRK.setVisible(true); } + + @Override + public void detectorChanged(int runNumber) { + throw new UnsupportedOperationException("Not supported yet."); + } } diff --git a/reconstruction/ft/src/main/java/org/jlab/rec/ft/cal/FTCALEngine.java b/reconstruction/ft/src/main/java/org/jlab/rec/ft/cal/FTCALEngine.java index cf41a2ef5b..cc8596e573 100644 --- a/reconstruction/ft/src/main/java/org/jlab/rec/ft/cal/FTCALEngine.java +++ b/reconstruction/ft/src/main/java/org/jlab/rec/ft/cal/FTCALEngine.java @@ -19,7 +19,6 @@ import org.jlab.io.evio.EvioDataEvent; import org.jlab.io.hipo.HipoDataSource; - public class FTCALEngine extends ReconstructionEngine { public FTCALEngine() { @@ -179,5 +178,10 @@ public static void main (String arg[]) { frame.setVisible(true); } + + @Override + public void detectorChanged(int runNumber) { + throw new UnsupportedOperationException("Not supported yet."); + } } diff --git a/reconstruction/ft/src/main/java/org/jlab/rec/ft/hodo/FTHODOEngine.java b/reconstruction/ft/src/main/java/org/jlab/rec/ft/hodo/FTHODOEngine.java index 26166c562e..e381aaab0d 100644 --- a/reconstruction/ft/src/main/java/org/jlab/rec/ft/hodo/FTHODOEngine.java +++ b/reconstruction/ft/src/main/java/org/jlab/rec/ft/hodo/FTHODOEngine.java @@ -1,6 +1,5 @@ package org.jlab.rec.ft.hodo; -import java.util.ArrayList; import java.util.Arrays; import java.util.List; import javax.swing.JFrame; @@ -134,4 +133,9 @@ public static void main (String arg[]) { frame.setVisible(true); } + + @Override + public void detectorChanged(int runNumber) { + throw new UnsupportedOperationException("Not supported yet."); + } } diff --git a/reconstruction/ft/src/main/java/org/jlab/rec/ft/trk/FTTRKEngine.java b/reconstruction/ft/src/main/java/org/jlab/rec/ft/trk/FTTRKEngine.java index c052f62283..c19e4a95c2 100644 --- a/reconstruction/ft/src/main/java/org/jlab/rec/ft/trk/FTTRKEngine.java +++ b/reconstruction/ft/src/main/java/org/jlab/rec/ft/trk/FTTRKEngine.java @@ -362,6 +362,11 @@ public static void main (String arg[]) { frame3.setVisible(true); } + + @Override + public void detectorChanged(int runNumber) { + throw new UnsupportedOperationException("Not supported yet."); + } } diff --git a/reconstruction/ft/src/test/java/org/jlab/service/ft/FTEBEngineTest.java b/reconstruction/ft/src/test/java/org/jlab/service/ft/FTEBEngineTest.java index 4156f882b5..015f78b873 100644 --- a/reconstruction/ft/src/test/java/org/jlab/service/ft/FTEBEngineTest.java +++ b/reconstruction/ft/src/test/java/org/jlab/service/ft/FTEBEngineTest.java @@ -1676,4 +1676,9 @@ public static void main(String arg[]){ frametrkonlyresVsCoord.setLocationRelativeTo(null); frametrkonlyresVsCoord.setVisible(true); } + + @Override + public void detectorChanged(int runNumber) { + throw new UnsupportedOperationException("Not supported yet."); + } } diff --git a/reconstruction/ft/src/test/java/org/jlab/service/ft/FTTRKEngineTest.java b/reconstruction/ft/src/test/java/org/jlab/service/ft/FTTRKEngineTest.java index 0023082b20..52ee4e9ac2 100644 --- a/reconstruction/ft/src/test/java/org/jlab/service/ft/FTTRKEngineTest.java +++ b/reconstruction/ft/src/test/java/org/jlab/service/ft/FTTRKEngineTest.java @@ -1,8 +1,3 @@ -/* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. - */ package org.jlab.service.ft; import java.util.ArrayList; @@ -561,6 +556,11 @@ public static void main (String arg[]) { frame3.setVisible(true); } + + @Override + public void detectorChanged(int runNumber) { + throw new UnsupportedOperationException("Not supported yet."); + } } diff --git a/reconstruction/htcc/src/main/java/org/jlab/service/htcc/HTCCReconstructionService.java b/reconstruction/htcc/src/main/java/org/jlab/service/htcc/HTCCReconstructionService.java index bb7816c7d3..55e9be3c3d 100644 --- a/reconstruction/htcc/src/main/java/org/jlab/service/htcc/HTCCReconstructionService.java +++ b/reconstruction/htcc/src/main/java/org/jlab/service/htcc/HTCCReconstructionService.java @@ -66,6 +66,11 @@ public boolean init() { return true; } + @Override + public void detectorChanged(int runNumber) { + throw new UnsupportedOperationException("Not supported yet."); + } + } diff --git a/reconstruction/ltcc/src/main/java/org/jlab/service/ltcc/LTCCEngine.java b/reconstruction/ltcc/src/main/java/org/jlab/service/ltcc/LTCCEngine.java index 0a1f2380e3..3093047d79 100644 --- a/reconstruction/ltcc/src/main/java/org/jlab/service/ltcc/LTCCEngine.java +++ b/reconstruction/ltcc/src/main/java/org/jlab/service/ltcc/LTCCEngine.java @@ -4,7 +4,6 @@ import org.jlab.io.base.DataEvent; import java.util.List; import java.util.Arrays; -import java.util.logging.Level; import java.util.logging.Logger; /** @@ -51,5 +50,10 @@ public boolean init() { this.registerOutputBank("LTCC::clusters"); return true; } + + @Override + public void detectorChanged(int runNumber) { + throw new UnsupportedOperationException("Not supported yet."); + } } diff --git a/reconstruction/mc/src/main/java/org/jlab/service/mc/TruthMatch.java b/reconstruction/mc/src/main/java/org/jlab/service/mc/TruthMatch.java index a8c4b9b189..65b9bf27fb 100644 --- a/reconstruction/mc/src/main/java/org/jlab/service/mc/TruthMatch.java +++ b/reconstruction/mc/src/main/java/org/jlab/service/mc/TruthMatch.java @@ -233,6 +233,11 @@ public boolean processDataEvent(DataEvent event) { } + @Override + public void detectorChanged(int runNumber) { + throw new UnsupportedOperationException("Not supported yet."); + } + /** * ************************************************************************ * Defining objects that will be needed int the matching process diff --git a/reconstruction/mltn/src/main/java/org/jlab/service/mltn/MLTDEngine.java b/reconstruction/mltn/src/main/java/org/jlab/service/mltn/MLTDEngine.java index 21cbf1c358..4e4b0fc709 100644 --- a/reconstruction/mltn/src/main/java/org/jlab/service/mltn/MLTDEngine.java +++ b/reconstruction/mltn/src/main/java/org/jlab/service/mltn/MLTDEngine.java @@ -141,5 +141,10 @@ public void writeBank(DataEvent event, ClusterCombinations combi){ //System.out.println("appending bank"); event.appendBank(bank); }*/ + + @Override + public void detectorChanged(int runNumber) { + throw new UnsupportedOperationException("Not supported yet."); + } } diff --git a/reconstruction/mltn/src/main/java/org/jlab/service/mltn/MLTNEngine.java b/reconstruction/mltn/src/main/java/org/jlab/service/mltn/MLTNEngine.java index 2181fd561e..9aaae0784e 100644 --- a/reconstruction/mltn/src/main/java/org/jlab/service/mltn/MLTNEngine.java +++ b/reconstruction/mltn/src/main/java/org/jlab/service/mltn/MLTNEngine.java @@ -1,8 +1,3 @@ -/* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. - */ package org.jlab.service.mltn; import j4ml.clas12.Clas12TrackAnalyzer; @@ -96,5 +91,10 @@ public void writeBank(DataEvent event, ClusterCombinations combi){ //System.out.println("appending bank"); event.appendBank(bank); }*/ + + @Override + public void detectorChanged(int runNumber) { + throw new UnsupportedOperationException("Not supported yet."); + } } diff --git a/reconstruction/raster/src/main/java/org/jlab/service/raster/RasterEngine.java b/reconstruction/raster/src/main/java/org/jlab/service/raster/RasterEngine.java index 20d7619e1f..86930455e7 100644 --- a/reconstruction/raster/src/main/java/org/jlab/service/raster/RasterEngine.java +++ b/reconstruction/raster/src/main/java/org/jlab/service/raster/RasterEngine.java @@ -157,4 +157,9 @@ public static void main(String arg[]) { frame.setVisible(true); } + + @Override + public void detectorChanged(int runNumber) { + throw new UnsupportedOperationException("Not supported yet."); + } } diff --git a/reconstruction/rich/src/main/java/org/jlab/rec/rich/RICHEBEngine.java b/reconstruction/rich/src/main/java/org/jlab/rec/rich/RICHEBEngine.java index 56540d6335..38beb50219 100644 --- a/reconstruction/rich/src/main/java/org/jlab/rec/rich/RICHEBEngine.java +++ b/reconstruction/rich/src/main/java/org/jlab/rec/rich/RICHEBEngine.java @@ -1,22 +1,9 @@ package org.jlab.rec.rich; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; - -import javax.swing.JFrame; - -import org.jlab.clas.reco.ReconstructionEngine; -import org.jlab.io.base.DataEvent; -import org.jlab.io.base.DataBank; - -import org.jlab.utils.groups.IndexedTable; import java.util.Arrays; import java.util.Optional; - -import org.jlab.geom.prim.Plane3D; -import org.jlab.geom.prim.Line3D; - +import org.jlab.clas.reco.ReconstructionEngine; +import org.jlab.io.base.DataEvent; import org.jlab.detector.geom.RICH.RICHGeoFactory; public class RICHEBEngine extends ReconstructionEngine { @@ -160,4 +147,9 @@ public boolean processDataEvent(DataEvent event) { } + @Override + public void detectorChanged(int runNumber) { + throw new UnsupportedOperationException("Not supported yet."); + } + } diff --git a/reconstruction/rtpc/src/main/java/org/jlab/service/rtpc/RTPCEngine.java b/reconstruction/rtpc/src/main/java/org/jlab/service/rtpc/RTPCEngine.java index b6231f34be..b7b43668b0 100644 --- a/reconstruction/rtpc/src/main/java/org/jlab/service/rtpc/RTPCEngine.java +++ b/reconstruction/rtpc/src/main/java/org/jlab/service/rtpc/RTPCEngine.java @@ -1,9 +1,6 @@ package org.jlab.service.rtpc; import java.io.File; - - - import java.util.ArrayList; import java.util.Arrays; import java.util.List; @@ -26,16 +23,12 @@ import org.jlab.rec.rtpc.hit.TrackFinder; import org.jlab.rec.rtpc.hit.TrackHitReco; import org.jlab.rec.rtpc.hit.HelixFitTest; -import org.jlab.detector.calib.utils.ConstantsManager; import org.jlab.utils.groups.IndexedTable; import org.jlab.clas.tracking.kalmanfilter.Material; - - public class RTPCEngine extends ReconstructionEngine{ - public RTPCEngine() { super("RTPC","davidp","3.0"); } @@ -293,4 +286,9 @@ private static HashMap generateMaterials() { } }; } + + @Override + public void detectorChanged(int runNumber) { + throw new UnsupportedOperationException("Not supported yet."); + } } diff --git a/reconstruction/swaps/src/main/java/org/jlab/service/swaps/SwapEngine.java b/reconstruction/swaps/src/main/java/org/jlab/service/swaps/SwapEngine.java index 3a132431da..6e2b4914aa 100644 --- a/reconstruction/swaps/src/main/java/org/jlab/service/swaps/SwapEngine.java +++ b/reconstruction/swaps/src/main/java/org/jlab/service/swaps/SwapEngine.java @@ -87,4 +87,7 @@ public boolean init() { return true; } + @Override + public void detectorChanged(int runNumber) {} + } diff --git a/reconstruction/tof/src/main/java/org/jlab/service/ctof/CTOFEngine.java b/reconstruction/tof/src/main/java/org/jlab/service/ctof/CTOFEngine.java index 8fb79d5b51..ccda0438eb 100644 --- a/reconstruction/tof/src/main/java/org/jlab/service/ctof/CTOFEngine.java +++ b/reconstruction/tof/src/main/java/org/jlab/service/ctof/CTOFEngine.java @@ -1,6 +1,5 @@ package org.jlab.service.ctof; -import java.io.FileNotFoundException; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; @@ -8,12 +7,10 @@ import java.util.Optional; import org.jlab.clas.reco.ReconstructionEngine; -import org.jlab.coda.jevio.EvioException; import org.jlab.detector.base.DetectorType; import org.jlab.detector.base.GeometryFactory; import org.jlab.detector.geant4.v2.CTOFGeant4Factory; import org.jlab.geom.base.ConstantProvider; -import org.jlab.geometry.prim.Line3d; import org.jlab.io.base.DataBank; import org.jlab.io.base.DataEvent; import org.jlab.io.hipo.HipoDataSource; @@ -232,4 +229,9 @@ public static void main(String[] args) { writer.close(); } + @Override + public void detectorChanged(int runNumber) { + throw new UnsupportedOperationException("Not supported yet."); + } + } diff --git a/reconstruction/tof/src/main/java/org/jlab/service/ftof/FTOFEngine.java b/reconstruction/tof/src/main/java/org/jlab/service/ftof/FTOFEngine.java index 4a0c24d2c3..5f10812cf1 100644 --- a/reconstruction/tof/src/main/java/org/jlab/service/ftof/FTOFEngine.java +++ b/reconstruction/tof/src/main/java/org/jlab/service/ftof/FTOFEngine.java @@ -284,4 +284,9 @@ public static void main(String arg[]) { System.out.println(t1 + " TOTAL PROCESSING TIME = " + (t / (float) counter)); } + + @Override + public void detectorChanged(int runNumber) { + throw new UnsupportedOperationException("Not supported yet."); + } } diff --git a/reconstruction/urwell/src/main/java/org/jlab/service/urwell/URWellEngine.java b/reconstruction/urwell/src/main/java/org/jlab/service/urwell/URWellEngine.java index fcb53c5ad1..eea377a552 100644 --- a/reconstruction/urwell/src/main/java/org/jlab/service/urwell/URWellEngine.java +++ b/reconstruction/urwell/src/main/java/org/jlab/service/urwell/URWellEngine.java @@ -242,4 +242,9 @@ public static void main (String arg[]) { frame.setVisible(true); } + + @Override + public void detectorChanged(int runNumber) { + throw new UnsupportedOperationException("Not supported yet."); + } } diff --git a/reconstruction/vtx/src/main/java/org/jlab/rec/service/vtx/VTXReconstruction.java b/reconstruction/vtx/src/main/java/org/jlab/rec/service/vtx/VTXReconstruction.java index fb993b7721..e5facbeac1 100644 --- a/reconstruction/vtx/src/main/java/org/jlab/rec/service/vtx/VTXReconstruction.java +++ b/reconstruction/vtx/src/main/java/org/jlab/rec/service/vtx/VTXReconstruction.java @@ -7,11 +7,7 @@ import org.jlab.clas.reco.ReconstructionEngine; import org.jlab.clas.swimtools.Swim; -import org.jlab.detector.base.DetectorType; -import org.jlab.detector.base.GeometryFactory; import org.jlab.detector.calib.utils.DatabaseConstantProvider; -import org.jlab.geom.base.ConstantProvider; -import org.jlab.io.base.DataBank; import org.jlab.io.base.DataEvent; import org.jlab.rec.vtx.TrackParsHelix; import org.jlab.rec.vtx.Vertex; @@ -111,4 +107,9 @@ private void registerBanks() { } public static void main(String[] args) { } + + @Override + public void detectorChanged(int runNumber) { + throw new UnsupportedOperationException("Not supported yet."); + } } From b6a1bcaba9074452376225fc21d7d8298e4a4f2b Mon Sep 17 00:00:00 2001 From: Nathan Baltzell Date: Tue, 22 Aug 2023 10:37:32 -0400 Subject: [PATCH 08/37] fix formatting --- .../java/org/jlab/rec/ft/trk/FTTRKEngine.java | 97 ++++++++----------- 1 file changed, 40 insertions(+), 57 deletions(-) diff --git a/reconstruction/ft/src/main/java/org/jlab/rec/ft/trk/FTTRKEngine.java b/reconstruction/ft/src/main/java/org/jlab/rec/ft/trk/FTTRKEngine.java index c19e4a95c2..d6e288a58c 100644 --- a/reconstruction/ft/src/main/java/org/jlab/rec/ft/trk/FTTRKEngine.java +++ b/reconstruction/ft/src/main/java/org/jlab/rec/ft/trk/FTTRKEngine.java @@ -48,70 +48,57 @@ public boolean init() { // use 11 provisionally as run number to download the basic FTTK geometry constants FTTRKConstantsLoader.Load(11, this.getConstantsManager().getVariation()); reco = new FTTRKReconstruction(); - reco.debugMode=0; + reco.debugMode=0; if(this.getEngineConfigString("fall18TT")!=null) { FTTRKConstantsLoader.ADJUSTTT = Boolean.parseBoolean(this.getEngineConfigString("fall18TT")); } -/* - String[] tables = new String[]{ - "/calibration/ft/fthodo/charge_to_energy", - "/calibration/ft/fthodo/time_offsets", - "/calibration/ft/fthodo/status", - "/geometry/ft/fthodo", - "/geometry/ft/fttrk" - }; - requireConstants(Arrays.asList(tables)); - this.getConstantsManager().setVariation("default"); -*/ - return true; } @Override public boolean processDataEvent(DataEvent event) { - // update calibration constants based on run number if changed - int run = setRunConditionsParameters(event); + // update calibration constants based on run number if changed + int run = setRunConditionsParameters(event); + if(run>=0) { + // get hits fron banks + List allHits = reco.initFTTRK(event,this.getConstantsManager(), run); + // create clusters + List clusters = reco.findClusters(allHits); + // create crosses + List crosses = reco.findCrosses(clusters); + // update hit banks with associated clusters/crosses information + reco.updateAllHitsWithAssociatedIDs(allHits, clusters); + // write output banks + reco.writeBanks(event, allHits, clusters, crosses); + } + return true; + } + + public ArrayList processDataEventAndGetClusters(DataEvent event) { + List allHits = new ArrayList(); + ArrayList clusters = new ArrayList(); // era ArrayList + ArrayList crosses = new ArrayList(); - if(run>=0) { - // get hits fron banks - List allHits = reco.initFTTRK(event,this.getConstantsManager(), run); + // update calibration constants based on run number if changed + int run = setRunConditionsParameters(event); + + if(run>=0) { + // get hits from banks + allHits = reco.initFTTRK(event,this.getConstantsManager(), run); + if(allHits.size()>0){ // create clusters - List clusters = reco.findClusters(allHits); + clusters = reco.findClusters(allHits); // create crosses - List crosses = reco.findCrosses(clusters); + crosses = reco.findCrosses(clusters); // update hit banks with associated clusters/crosses information reco.updateAllHitsWithAssociatedIDs(allHits, clusters); // write output banks reco.writeBanks(event, allHits, clusters, crosses); } - return true; - } - - public ArrayList processDataEventAndGetClusters(DataEvent event) { - List allHits = new ArrayList(); - ArrayList clusters = new ArrayList(); // era ArrayList - ArrayList crosses = new ArrayList(); - - // update calibration constants based on run number if changed - int run = setRunConditionsParameters(event); - - if(run>=0) { - // get hits from banks - allHits = reco.initFTTRK(event,this.getConstantsManager(), run); - if(allHits.size()>0){ - // create clusters - clusters = reco.findClusters(allHits); - // create crosses - crosses = reco.findCrosses(clusters); - // update hit banks with associated clusters/crosses information - reco.updateAllHitsWithAssociatedIDs(allHits, clusters); - // write output banks - reco.writeBanks(event, allHits, clusters, crosses); - } - } - return clusters; + } + return clusters; } public int setRunConditionsParameters(DataEvent event) { @@ -119,25 +106,22 @@ public int setRunConditionsParameters(DataEvent event) { if(event.hasBank("RUN::config")==false) { System.out.println("RUN CONDITIONS NOT READ!"); } - DataBank bank = event.getBank("RUN::config"); - run = bank.getInt("run")[0]; - - return run; + run = bank.getInt("run")[0]; + return run; } - public static void main (String arg[]) { int debug = FTTRKReconstruction.debugMode; - FTTRKEngine trk = new FTTRKEngine(); - trk.init(); + FTTRKEngine trk = new FTTRKEngine(); + trk.init(); // insert input filename here String input = "/home/filippi/clas12/fttrkDev/clas12-offline-software-6.5.13-fttrkDev/filter_005418_newbanks.hipo"; System.out.println("input file " + input); - HipoDataSource reader = new HipoDataSource(); - reader.open(input); + HipoDataSource reader = new HipoDataSource(); + reader.open(input); - // initialize histos + // initialize histos H2F h1 = new H2F("h1", "Layer vs. Component", 768, 0., 769., 4, 0.5, 4.5); h1.setTitleX("Component"); h1.setTitleY("Layer"); @@ -177,7 +161,6 @@ public static void main (String arg[]) { int nc1 = 0, nc2 = 0, ncmatch = 0; int nev=0; while(reader.hasEvent()){ -// int nev1 = 0; int nev2 = 20000; for(nev=nev1; nev=1) System.out.println("~~~~~~~~~~~~~~~~~~~~~~~~ processing event ~~~~~~~~~~~ " + nev); From 45e81787f5ea1f6ed0b5e92fd078362fdd00c85c Mon Sep 17 00:00:00 2001 From: Nathan Baltzell Date: Tue, 22 Aug 2023 11:14:49 -0400 Subject: [PATCH 09/37] implement all detectorChanged hooks (and cleanup/formatting) --- .../jlab/clas/swimtools/MagFieldsEngine.java | 1 - .../java/org/jlab/rec/service/AHDCEngine.java | 7 +- .../org/jlab/service/band/BANDEngine.java | 25 ++-- .../service/cnd/CNDCalibrationEngine.java | 124 ++++-------------- .../org/jlab/rec/cvt/services/CVTEngine.java | 12 +- .../java/org/jlab/service/dc/DCEngine.java | 6 +- .../java/org/jlab/service/ec/ECEngine.java | 11 +- .../java/org/jlab/service/fmt/FMTEngine.java | 20 ++- .../main/java/org/jlab/rec/ft/FTEBEngine.java | 10 +- .../java/org/jlab/rec/ft/cal/FTCALEngine.java | 37 +++--- .../org/jlab/rec/ft/hodo/FTHODOEngine.java | 30 ++--- .../java/org/jlab/rec/ft/trk/FTTRKEngine.java | 14 +- .../htcc/HTCCReconstructionService.java | 12 +- .../org/jlab/service/ltcc/LTCCEngine.java | 47 +++---- .../java/org/jlab/service/mc/TruthMatch.java | 4 +- .../org/jlab/service/mltn/MLTDEngine.java | 9 +- .../org/jlab/service/mltn/MLTNEngine.java | 12 +- .../org/jlab/service/raster/RasterEngine.java | 7 +- .../java/org/jlab/rec/rich/RICHEBEngine.java | 29 +--- .../org/jlab/service/rtpc/RTPCEngine.java | 13 +- .../org/jlab/service/ctof/CTOFEngine.java | 29 ++-- .../org/jlab/service/ftof/FTOFEngine.java | 22 +--- .../org/jlab/service/urwell/URWellEngine.java | 17 +-- .../rec/service/vtx/VTXReconstruction.java | 16 +-- 24 files changed, 165 insertions(+), 349 deletions(-) diff --git a/common-tools/swim-tools/src/main/java/org/jlab/clas/swimtools/MagFieldsEngine.java b/common-tools/swim-tools/src/main/java/org/jlab/clas/swimtools/MagFieldsEngine.java index 2480da3128..25db8321a4 100644 --- a/common-tools/swim-tools/src/main/java/org/jlab/clas/swimtools/MagFieldsEngine.java +++ b/common-tools/swim-tools/src/main/java/org/jlab/clas/swimtools/MagFieldsEngine.java @@ -197,5 +197,4 @@ public boolean init() { @Override public void detectorChanged(int runNumber) {} - } diff --git a/reconstruction/alert/src/main/java/org/jlab/rec/service/AHDCEngine.java b/reconstruction/alert/src/main/java/org/jlab/rec/service/AHDCEngine.java index 14a45a40f5..4dfa45e1d0 100644 --- a/reconstruction/alert/src/main/java/org/jlab/rec/service/AHDCEngine.java +++ b/reconstruction/alert/src/main/java/org/jlab/rec/service/AHDCEngine.java @@ -99,6 +99,8 @@ public NDList processInput(TranslatorContext translatorContext, float[] floats) return true; } + @Override + public void detectorChanged(int runNumber) {} @Override public boolean processDataEvent(DataEvent event) { @@ -285,9 +287,4 @@ public static void main(String[] args) { System.out.println("finished " + (System.nanoTime() - starttime) * Math.pow(10, -9)); } - - @Override - public void detectorChanged(int runNumber) { - throw new UnsupportedOperationException("Not supported yet."); - } } diff --git a/reconstruction/band/src/main/java/org/jlab/service/band/BANDEngine.java b/reconstruction/band/src/main/java/org/jlab/service/band/BANDEngine.java index d321a831d0..9e92894684 100644 --- a/reconstruction/band/src/main/java/org/jlab/service/band/BANDEngine.java +++ b/reconstruction/band/src/main/java/org/jlab/service/band/BANDEngine.java @@ -55,9 +55,9 @@ public boolean processDataEvent(DataEvent event) { } @Override - public boolean init() { + public boolean init() { - String[] bandTables = new String[]{ + String[] bandTables = new String[]{ "/calibration/band/time_jitter", "/calibration/band/lr_offsets", "/calibration/band/effective_velocity", @@ -73,14 +73,15 @@ public boolean init() { "/calibration/band/energy_conversion" //"/calibration/band/time_walk_corr_left", //"/calibration/band/time_walk_corr_right", - }; + }; - requireConstants(Arrays.asList(bandTables)); - - this.registerOutputBank("BAND::hits","BAND::rawhits","BAND::laser"); - - return true; - } + requireConstants(Arrays.asList(bandTables)); + this.registerOutputBank("BAND::hits","BAND::rawhits","BAND::laser"); + return true; + } + + @Override + public void detectorChanged(int runNumber) {} public void setRunConditionsParameters(DataEvent event) { if(event.hasBank("RUN::config")==false) { @@ -136,10 +137,4 @@ public static void main (String arg[]) { } - - @Override - public void detectorChanged(int runNumber) { - throw new UnsupportedOperationException("Not supported yet."); - } - } diff --git a/reconstruction/cnd/src/main/java/org/jlab/service/cnd/CNDCalibrationEngine.java b/reconstruction/cnd/src/main/java/org/jlab/service/cnd/CNDCalibrationEngine.java index 4604220fc4..4c5d3e5c36 100644 --- a/reconstruction/cnd/src/main/java/org/jlab/service/cnd/CNDCalibrationEngine.java +++ b/reconstruction/cnd/src/main/java/org/jlab/service/cnd/CNDCalibrationEngine.java @@ -32,9 +32,7 @@ public CNDCalibrationEngine() { } - //int Run = -1; RecoBankWriter rbc; - //test static int enb =0; static int ecnd=0; static int hcvt=0; @@ -43,41 +41,33 @@ public CNDCalibrationEngine() { static int ctof=0; static int ctoftot=0; - private AtomicInteger Run = new AtomicInteger(0); - private int newRun = 0; + private AtomicInteger Run = new AtomicInteger(0); + private int newRun = 0; @Override public boolean processDataEvent(DataEvent event) { - - if (!event.hasBank("RUN::config")) { + if (!event.hasBank("RUN::config")) { return true; - } - - DataBank bank = event.getBank("RUN::config"); - - // Load the constants - //------------------- - int newRun = bank.getInt("run", 0); - if (newRun == 0) - return true; - - if (Run.get() == 0 || (Run.get() != 0 && Run.get() != newRun)) { - Run.set(newRun); - } - - CalibrationConstantsLoader constantsLoader = new CalibrationConstantsLoader(newRun, this.getConstantsManager()); - //event.show(); - //System.out.println("in data process "); + } + + DataBank bank = event.getBank("RUN::config"); + + // Load the constants + int newRun = bank.getInt("run", 0); + if (newRun == 0) + return true; + if (Run.get() == 0 || (Run.get() != 0 && Run.get() != newRun)) { + Run.set(newRun); + } + CalibrationConstantsLoader constantsLoader = new CalibrationConstantsLoader(newRun, this.getConstantsManager()); - ArrayList halfhits = new ArrayList(); + ArrayList halfhits = new ArrayList(); ArrayList hits = new ArrayList(); halfhits = HitReader.getCndHalfHits(event, constantsLoader); //1) exit if halfhit list is empty if(halfhits.size()==0 ){ - // System.out.println("fin de process (0) : "); - // event.show(); return true; } @@ -93,89 +83,32 @@ public boolean processDataEvent(DataEvent event) { double length =hitFinder.findLength(hit, cvttry.getHelices(),0,constantsLoader); if (length!=0){ hit.set_tLength(length); // the path length is non zero only when there is a match with cvt track - //if(flag==0){match++;} - //flag=1; } - } - // GetVertex getVertex = new GetVertex(); - // Point3D vertex = getVertex.getVertex(event); - // for (CndHit hit : hits){ // check findlengthneutral - // hitFinder.findLengthNeutral( vertex, hit); - // } - // - - // if(hits.size()!=0){ - // - // DataBank outbank = RecoBankWriter.fillCndHitBanks(event, hits); - //// System.out.println("event before process : "); - //// event.show(); - // event.appendBanks(outbank); - // //System.out.println("event after process : "); - // //event.show(); - // ecnd++; - // if(event.hasBank("CVT::Tracks")){ - // posmatch++; - // //event.getBank("MC::Particle").show(); - // //outbank.show(); - // } - // - // } - //// System.out.println("fin de process : "); - //// event.show(); - // return true; - // } - - - - //// clustering of the CND hits CNDClusterFinder cndclusterFinder = new CNDClusterFinder(); ArrayList cndclusters = cndclusterFinder.findClusters(hits,constantsLoader); - - - - - if(hits.size()!=0){ - // DataBank outbank = RecoBankWriter.fillCndHitBanks(event, hits); - // event.appendBanks(outbank); - // event.show(); - // System.out.println("in process event "); + if(hits.size()!=0){ rbc.appendCNDBanks(event,hits,cndclusters); - // ecnd++; - // if(event.hasBank("CVT::Tracks")){ - // posmatch++; - //event.getBank("MC::Particle").show(); - //outbank.show(); - // } - // event.show(); - } - - - - return true; - } @Override public boolean init() { - rbc = new RecoBankWriter(); - - requireConstants(Arrays.asList(CalibrationConstantsLoader.getCndTables())); - this.getConstantsManager().setVariation("default"); - - this.registerOutputBank("CND::hits","CND::clusters"); - - return true; + rbc = new RecoBankWriter(); + requireConstants(Arrays.asList(CalibrationConstantsLoader.getCndTables())); + this.getConstantsManager().setVariation("default"); + this.registerOutputBank("CND::hits","CND::clusters"); + return true; } + + @Override + public void detectorChanged(int runNumber) {} - - public static void main (String arg[]) { CNDCalibrationEngine en = new CNDCalibrationEngine(); @@ -198,7 +131,6 @@ public static void main (String arg[]) { HipoDataSync writer = new HipoDataSync(); writer.open(outputFile); - while(reader.hasEvent()) { enb++; DataEvent event = (DataEvent) reader.getNextEvent(); @@ -255,11 +187,5 @@ public static void main (String arg[]) { } } - - @Override - public void detectorChanged(int runNumber) { - throw new UnsupportedOperationException("Not supported yet."); - } - } diff --git a/reconstruction/cvt/src/main/java/org/jlab/rec/cvt/services/CVTEngine.java b/reconstruction/cvt/src/main/java/org/jlab/rec/cvt/services/CVTEngine.java index a15c089c52..2a09539f4b 100644 --- a/reconstruction/cvt/src/main/java/org/jlab/rec/cvt/services/CVTEngine.java +++ b/reconstruction/cvt/src/main/java/org/jlab/rec/cvt/services/CVTEngine.java @@ -135,6 +135,11 @@ public boolean init() { this.printConfiguration(); return true; } + + @Override + public void detectorChanged(int runNumber) { + throw new UnsupportedOperationException("Not supported yet."); + } public final void setOutputBankPrefix(String prefix) { this.bankPrefix = prefix; @@ -574,7 +579,6 @@ public String getCovMat() { return cvtCovMatBank; } - public void printConfiguration() { System.out.println("["+this.getName()+"] run with cosmics setting set to "+Constants.getInstance().isCosmics); @@ -607,10 +611,4 @@ public void printConfiguration() { } - - @Override - public void detectorChanged(int runNumber) { - throw new UnsupportedOperationException("Not supported yet."); - } - } diff --git a/reconstruction/dc/src/main/java/org/jlab/service/dc/DCEngine.java b/reconstruction/dc/src/main/java/org/jlab/service/dc/DCEngine.java index cdc44a3724..17f3b4e9d3 100644 --- a/reconstruction/dc/src/main/java/org/jlab/service/dc/DCEngine.java +++ b/reconstruction/dc/src/main/java/org/jlab/service/dc/DCEngine.java @@ -41,7 +41,6 @@ public class DCEngine extends ReconstructionEngine { public static final Logger LOGGER = Logger.getLogger(ReconstructionEngine.class.getName()); - public DCEngine(String name) { super(name,"ziegler","5.0"); } @@ -197,6 +196,11 @@ public boolean init() { return true; } + @Override + public void detectorChanged(int runNumber) { + throw new UnsupportedOperationException("Not supported yet."); + } + private void initBanks() { if(inBankPrefix==null && outBankPrefix!=null) this.getBanks().init(outBankPrefix); diff --git a/reconstruction/ec/src/main/java/org/jlab/service/ec/ECEngine.java b/reconstruction/ec/src/main/java/org/jlab/service/ec/ECEngine.java index 93d4436e5a..e364966048 100644 --- a/reconstruction/ec/src/main/java/org/jlab/service/ec/ECEngine.java +++ b/reconstruction/ec/src/main/java/org/jlab/service/ec/ECEngine.java @@ -423,12 +423,8 @@ public boolean init() { requireConstants(Arrays.asList(ecTables)); - + getConstantsManager().setVariation(ECCommon.variation); - String variationName = Optional.ofNullable(this.getEngineConfigString("variation")).orElse("default"); - if(!(ECCommon.geomVariation.equals("default"))) variationName = ECCommon.geomVariation; - LOGGER.log(Level.INFO,"GEOMETRY VARIATION IS "+variationName); - ECCommon.ecDetector = GeometryFactory.getDetector(DetectorType.ECAL,11,variationName); setConfig("test"); @@ -469,7 +465,10 @@ public boolean init() { @Override public void detectorChanged(int runNumber) { - throw new UnsupportedOperationException("Not supported yet."); + String variationName = Optional.ofNullable(this.getEngineConfigString("variation")).orElse("default"); + if(!(ECCommon.geomVariation.equals("default"))) variationName = ECCommon.geomVariation; + LOGGER.log(Level.INFO,"GEOMETRY VARIATION IS "+variationName); + ECCommon.ecDetector = GeometryFactory.getDetector(DetectorType.ECAL,11,variationName); } } diff --git a/reconstruction/fmt/src/main/java/org/jlab/service/fmt/FMTEngine.java b/reconstruction/fmt/src/main/java/org/jlab/service/fmt/FMTEngine.java index c87a9afcb2..edcb3f6468 100644 --- a/reconstruction/fmt/src/main/java/org/jlab/service/fmt/FMTEngine.java +++ b/reconstruction/fmt/src/main/java/org/jlab/service/fmt/FMTEngine.java @@ -26,6 +26,7 @@ */ public class FMTEngine extends ReconstructionEngine { + String variation = null; boolean debug = false; public FMTEngine() { @@ -36,7 +37,7 @@ public FMTEngine() { public boolean init() { // Get the constants for the correct variation - String variation = this.getEngineConfigString("variation"); + variation = this.getEngineConfigString("variation"); if (variation!=null) { System.out.println("["+this.getName()+"] " + "run with FMT geometry variation based on yaml = " + variation); @@ -45,7 +46,6 @@ public boolean init() { variation = "default"; System.out.println("["+this.getName()+"] run with FMT default geometry"); } - String[] tables = new String[]{ "/geometry/beam/position", @@ -55,10 +55,6 @@ public boolean init() { requireConstants(Arrays.asList(tables)); this.getConstantsManager().setVariation(variation); - // Load the geometry - int run = 10; - Constants.setDetector(GeometryFactory.getDetector(DetectorType.FMT,run, variation)); - // Register output banks super.registerOutputBank("FMT::Hits"); super.registerOutputBank("FMT::Clusters"); @@ -69,6 +65,12 @@ public boolean init() { return true; } + @Override + public void detectorChanged(int runNumber) { + Constants.setDetector(GeometryFactory.getDetector(DetectorType.FMT,runNumber, + getConstantsManager().getVariation())); + } + @Override public boolean processDataEvent(DataEvent event) { // Initial setup. @@ -232,10 +234,4 @@ public boolean processDataEvent(DataEvent event) { return true; } - - @Override - public void detectorChanged(int runNumber) { - throw new UnsupportedOperationException("Not supported yet."); - } - } diff --git a/reconstruction/ft/src/main/java/org/jlab/rec/ft/FTEBEngine.java b/reconstruction/ft/src/main/java/org/jlab/rec/ft/FTEBEngine.java index ce785ed257..4a81616a77 100644 --- a/reconstruction/ft/src/main/java/org/jlab/rec/ft/FTEBEngine.java +++ b/reconstruction/ft/src/main/java/org/jlab/rec/ft/FTEBEngine.java @@ -53,12 +53,13 @@ public boolean init() { }; requireConstants(Arrays.asList(tables)); this.getConstantsManager().setVariation("default"); - this.registerOutputBank("FT::particles"); - return true; } + @Override + public void detectorChanged(int runNumber) {} + @Override public boolean processDataEvent(DataEvent event) { @@ -1005,9 +1006,4 @@ public static void main(String arg[]){ frameCALTRK.setVisible(true); } - - @Override - public void detectorChanged(int runNumber) { - throw new UnsupportedOperationException("Not supported yet."); - } } diff --git a/reconstruction/ft/src/main/java/org/jlab/rec/ft/cal/FTCALEngine.java b/reconstruction/ft/src/main/java/org/jlab/rec/ft/cal/FTCALEngine.java index cc8596e573..c652b1fa43 100644 --- a/reconstruction/ft/src/main/java/org/jlab/rec/ft/cal/FTCALEngine.java +++ b/reconstruction/ft/src/main/java/org/jlab/rec/ft/cal/FTCALEngine.java @@ -32,23 +32,24 @@ public boolean init() { reco = new FTCALReconstruction(); reco.debugMode=0; - String[] tables = new String[]{ - "/calibration/ft/ftcal/charge_to_energy", - "/calibration/ft/ftcal/time_offsets", - "/calibration/ft/ftcal/time_walk", - "/calibration/ft/ftcal/status", - "/calibration/ft/ftcal/thresholds", - "/calibration/ft/ftcal/cluster", - "/calibration/ft/ftcal/energycorr" - }; - requireConstants(Arrays.asList(tables)); - this.getConstantsManager().setVariation("default"); - - this.registerOutputBank("FTCAL::hits","FTCAL::clusters"); - - return true; + String[] tables = new String[]{ + "/calibration/ft/ftcal/charge_to_energy", + "/calibration/ft/ftcal/time_offsets", + "/calibration/ft/ftcal/time_walk", + "/calibration/ft/ftcal/status", + "/calibration/ft/ftcal/thresholds", + "/calibration/ft/ftcal/cluster", + "/calibration/ft/ftcal/energycorr" + }; + requireConstants(Arrays.asList(tables)); + this.getConstantsManager().setVariation("default"); + this.registerOutputBank("FTCAL::hits","FTCAL::clusters"); + return true; } + @Override + public void detectorChanged(int runNumber) {} + @Override public boolean processDataEvent(DataEvent event) { List allHits = new ArrayList(); @@ -178,10 +179,4 @@ public static void main (String arg[]) { frame.setVisible(true); } - - @Override - public void detectorChanged(int runNumber) { - throw new UnsupportedOperationException("Not supported yet."); - } - } diff --git a/reconstruction/ft/src/main/java/org/jlab/rec/ft/hodo/FTHODOEngine.java b/reconstruction/ft/src/main/java/org/jlab/rec/ft/hodo/FTHODOEngine.java index e381aaab0d..ac8a42f687 100644 --- a/reconstruction/ft/src/main/java/org/jlab/rec/ft/hodo/FTHODOEngine.java +++ b/reconstruction/ft/src/main/java/org/jlab/rec/ft/hodo/FTHODOEngine.java @@ -29,20 +29,21 @@ public boolean init() { reco = new FTHODOReconstruction(); reco.debugMode=0; - String[] tables = new String[]{ - "/calibration/ft/fthodo/charge_to_energy", - "/calibration/ft/fthodo/time_offsets", - "/calibration/ft/fthodo/status", - "/geometry/ft/fthodo" - }; - requireConstants(Arrays.asList(tables)); - this.getConstantsManager().setVariation("default"); - - this.registerOutputBank("FTHODO::hits","FTHODO::clusters"); - - return true; + String[] tables = new String[]{ + "/calibration/ft/fthodo/charge_to_energy", + "/calibration/ft/fthodo/time_offsets", + "/calibration/ft/fthodo/status", + "/geometry/ft/fthodo" + }; + requireConstants(Arrays.asList(tables)); + this.getConstantsManager().setVariation("default"); + this.registerOutputBank("FTHODO::hits","FTHODO::clusters"); + return true; } + @Override + public void detectorChanged(int runNumber) {} + @Override public boolean processDataEvent(DataEvent event) { @@ -133,9 +134,4 @@ public static void main (String arg[]) { frame.setVisible(true); } - - @Override - public void detectorChanged(int runNumber) { - throw new UnsupportedOperationException("Not supported yet."); - } } diff --git a/reconstruction/ft/src/main/java/org/jlab/rec/ft/trk/FTTRKEngine.java b/reconstruction/ft/src/main/java/org/jlab/rec/ft/trk/FTTRKEngine.java index d6e288a58c..c8ffd09eb8 100644 --- a/reconstruction/ft/src/main/java/org/jlab/rec/ft/trk/FTTRKEngine.java +++ b/reconstruction/ft/src/main/java/org/jlab/rec/ft/trk/FTTRKEngine.java @@ -44,9 +44,7 @@ public boolean init() { }; requireConstants(Arrays.asList(tables)); this.getConstantsManager().setVariation("default"); - - // use 11 provisionally as run number to download the basic FTTK geometry constants - FTTRKConstantsLoader.Load(11, this.getConstantsManager().getVariation()); + reco = new FTTRKReconstruction(); reco.debugMode=0; @@ -57,6 +55,11 @@ public boolean init() { return true; } + @Override + public void detectorChanged(int runNumber) { + FTTRKConstantsLoader.Load(runNumber, this.getConstantsManager().getVariation()); + } + @Override public boolean processDataEvent(DataEvent event) { // update calibration constants based on run number if changed @@ -345,11 +348,6 @@ public static void main (String arg[]) { frame3.setVisible(true); } - - @Override - public void detectorChanged(int runNumber) { - throw new UnsupportedOperationException("Not supported yet."); - } } diff --git a/reconstruction/htcc/src/main/java/org/jlab/service/htcc/HTCCReconstructionService.java b/reconstruction/htcc/src/main/java/org/jlab/service/htcc/HTCCReconstructionService.java index 55e9be3c3d..0f8f9917ad 100644 --- a/reconstruction/htcc/src/main/java/org/jlab/service/htcc/HTCCReconstructionService.java +++ b/reconstruction/htcc/src/main/java/org/jlab/service/htcc/HTCCReconstructionService.java @@ -48,9 +48,7 @@ public boolean processDataEvent(DataEvent event) { @Override public boolean init() { - - - String[] htccTables = new String[]{ + String[] htccTables = new String[]{ "/calibration/htcc/gain", "/calibration/htcc/time", "/calibration/htcc/ring_time", @@ -59,18 +57,12 @@ public boolean init() { "/geometry/htcc/htcc", }; - this.registerOutputBank("HTCC::rec"); - requireConstants(Arrays.asList(htccTables)); return true; } @Override - public void detectorChanged(int runNumber) { - throw new UnsupportedOperationException("Not supported yet."); - } - - + public void detectorChanged(int runNumber) {} } diff --git a/reconstruction/ltcc/src/main/java/org/jlab/service/ltcc/LTCCEngine.java b/reconstruction/ltcc/src/main/java/org/jlab/service/ltcc/LTCCEngine.java index 3093047d79..2c30003971 100644 --- a/reconstruction/ltcc/src/main/java/org/jlab/service/ltcc/LTCCEngine.java +++ b/reconstruction/ltcc/src/main/java/org/jlab/service/ltcc/LTCCEngine.java @@ -17,9 +17,7 @@ public class LTCCEngine extends ReconstructionEngine { private static final boolean DEBUG = false; private static final List CC_TABLES = - Arrays.asList("/calibration/ltcc/spe", - "/calibration/ltcc/status" - ); + Arrays.asList("/calibration/ltcc/spe","/calibration/ltcc/status"); public LTCCEngine() { super("LTCC", "joosten", "1.0"); @@ -27,33 +25,28 @@ public LTCCEngine() { @Override public boolean processDataEvent(DataEvent event) { - if (DEBUG) event.show(); - // only process the event if the LTCC bank is present - if (event.hasBank("LTCC::adc")) { - if (DEBUG) event.getBank("LTCC::adc").show(); - List hits = - LTCCHit.loadHits(event, this.getConstantsManager()); - List clusters = - LTCCClusterFinder.findClusters(hits); - LTCCCluster.saveClusters(event, clusters); - if (DEBUG) { - event.getBank("LTCC::clusters").show(); - } - } - - return true; - } + if (DEBUG) event.show(); + // only process the event if the LTCC bank is present + if (event.hasBank("LTCC::adc")) { + if (DEBUG) event.getBank("LTCC::adc").show(); + List hits = + LTCCHit.loadHits(event, this.getConstantsManager()); + List clusters = + LTCCClusterFinder.findClusters(hits); + LTCCCluster.saveClusters(event, clusters); + if (DEBUG) event.getBank("LTCC::clusters").show(); + } + return true; + } @Override - public boolean init() { - this.requireConstants(CC_TABLES); - this.registerOutputBank("LTCC::clusters"); - return true; - } + public boolean init() { + this.requireConstants(CC_TABLES); + this.registerOutputBank("LTCC::clusters"); + return true; + } @Override - public void detectorChanged(int runNumber) { - throw new UnsupportedOperationException("Not supported yet."); - } + public void detectorChanged(int runNumber) {} } diff --git a/reconstruction/mc/src/main/java/org/jlab/service/mc/TruthMatch.java b/reconstruction/mc/src/main/java/org/jlab/service/mc/TruthMatch.java index 65b9bf27fb..dee68be30f 100644 --- a/reconstruction/mc/src/main/java/org/jlab/service/mc/TruthMatch.java +++ b/reconstruction/mc/src/main/java/org/jlab/service/mc/TruthMatch.java @@ -234,9 +234,7 @@ public boolean processDataEvent(DataEvent event) { } @Override - public void detectorChanged(int runNumber) { - throw new UnsupportedOperationException("Not supported yet."); - } + public void detectorChanged(int runNumber) {} /** * ************************************************************************ diff --git a/reconstruction/mltn/src/main/java/org/jlab/service/mltn/MLTDEngine.java b/reconstruction/mltn/src/main/java/org/jlab/service/mltn/MLTDEngine.java index 4e4b0fc709..d7a139ea82 100644 --- a/reconstruction/mltn/src/main/java/org/jlab/service/mltn/MLTDEngine.java +++ b/reconstruction/mltn/src/main/java/org/jlab/service/mltn/MLTDEngine.java @@ -79,6 +79,9 @@ public boolean init() { return true; } + @Override + public void detectorChanged(int runNumber) {} + @Override public boolean processDataEvent(DataEvent de) { if(de.hasBank(inputBank)==true){ @@ -141,10 +144,4 @@ public void writeBank(DataEvent event, ClusterCombinations combi){ //System.out.println("appending bank"); event.appendBank(bank); }*/ - - @Override - public void detectorChanged(int runNumber) { - throw new UnsupportedOperationException("Not supported yet."); - } - } diff --git a/reconstruction/mltn/src/main/java/org/jlab/service/mltn/MLTNEngine.java b/reconstruction/mltn/src/main/java/org/jlab/service/mltn/MLTNEngine.java index 9aaae0784e..2617df06ac 100644 --- a/reconstruction/mltn/src/main/java/org/jlab/service/mltn/MLTNEngine.java +++ b/reconstruction/mltn/src/main/java/org/jlab/service/mltn/MLTNEngine.java @@ -11,7 +11,7 @@ /** * * @author gavalian - @deprecated + @Deprecated */ public class MLTNEngine extends ReconstructionEngine { @@ -27,10 +27,12 @@ public boolean init() { classifier.setEnvPath("etc/nnet/neuroph"); classifier.load("trackClassifier.nnet", "trackFixer.nnet"); System.out.println("Loading neural network files done..."); - //throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. return true; } + @Override + public void detectorChanged(int runNumber) {} + @Override public boolean processDataEvent(DataEvent de) { if(de.hasBank("HitBasedTrkg::Clusters")==true){ @@ -91,10 +93,4 @@ public void writeBank(DataEvent event, ClusterCombinations combi){ //System.out.println("appending bank"); event.appendBank(bank); }*/ - - @Override - public void detectorChanged(int runNumber) { - throw new UnsupportedOperationException("Not supported yet."); - } - } diff --git a/reconstruction/raster/src/main/java/org/jlab/service/raster/RasterEngine.java b/reconstruction/raster/src/main/java/org/jlab/service/raster/RasterEngine.java index 86930455e7..03d545b974 100644 --- a/reconstruction/raster/src/main/java/org/jlab/service/raster/RasterEngine.java +++ b/reconstruction/raster/src/main/java/org/jlab/service/raster/RasterEngine.java @@ -47,6 +47,8 @@ public boolean init() { return true; } + @Override + public void detectorChanged(int runNumber) {} @Override public boolean processDataEvent(DataEvent event) { @@ -157,9 +159,4 @@ public static void main(String arg[]) { frame.setVisible(true); } - - @Override - public void detectorChanged(int runNumber) { - throw new UnsupportedOperationException("Not supported yet."); - } } diff --git a/reconstruction/rich/src/main/java/org/jlab/rec/rich/RICHEBEngine.java b/reconstruction/rich/src/main/java/org/jlab/rec/rich/RICHEBEngine.java index 38beb50219..d50d937ea0 100644 --- a/reconstruction/rich/src/main/java/org/jlab/rec/rich/RICHEBEngine.java +++ b/reconstruction/rich/src/main/java/org/jlab/rec/rich/RICHEBEngine.java @@ -10,31 +10,21 @@ public class RICHEBEngine extends ReconstructionEngine { private int Run = -1; private int Ncalls = 0; - private long EBRICH_start_time; - private RICHGeoFactory richgeo; private RICHTime richtime = new RICHTime(); private boolean engineDebug = false; - - // ---------------- public RICHEBEngine() { - // ---------------- super("RICHEB", "mcontalb", "3.0"); - } - @Override - // ---------------- public boolean init() { - // ---------------- int debugMode = 0; if(debugMode>=1)System.out.format("I am in RICHEBEngine init \n"); - String[] richTables = new String[]{ "/geometry/rich/setup", "/geometry/rich/geo_parameter", @@ -70,16 +60,15 @@ public boolean init() { if(this.getEngineConfigString("debug")!=null) this.engineDebug = Boolean.parseBoolean(this.getEngineConfigString("debug")); - // Get the constant tables for reconstruction parameters, geometry and optical characterization - int run = 11; - - richgeo = new RICHGeoFactory(1, this.getConstantsManager(), run, engineDebug); - richtime.init_ProcessTime(); - return true; } - + + @Override + public void detectorChanged(int runNumber) { + richgeo = new RICHGeoFactory(1, this.getConstantsManager(), runNumber, engineDebug); + richtime.init_ProcessTime(); + } @Override // ---------------- @@ -146,10 +135,4 @@ public boolean processDataEvent(DataEvent event) { return true; } - - @Override - public void detectorChanged(int runNumber) { - throw new UnsupportedOperationException("Not supported yet."); - } - } diff --git a/reconstruction/rtpc/src/main/java/org/jlab/service/rtpc/RTPCEngine.java b/reconstruction/rtpc/src/main/java/org/jlab/service/rtpc/RTPCEngine.java index b7b43668b0..eb91e33584 100644 --- a/reconstruction/rtpc/src/main/java/org/jlab/service/rtpc/RTPCEngine.java +++ b/reconstruction/rtpc/src/main/java/org/jlab/service/rtpc/RTPCEngine.java @@ -47,8 +47,7 @@ public boolean init() { String cosm = this.getEngineConfigString("rtpcCosmic"); String beamfit = this.getEngineConfigString("rtpcBeamlineFit"); String disentangler = this.getEngineConfigString("rtpcDisentangler"); - String chi2cull = this.getEngineConfigString("rtpcChi2Cull"); - //System.out.println(sim + " " + cosm + " " + beamfit); + String chi2cull = this.getEngineConfigString("rtpcChi2Cull"); String kfstatus = this.getEngineConfigString("rtpcKF"); if(sim != null){ @@ -91,8 +90,9 @@ public boolean init() { return true; } - - + + @Override + public void detectorChanged(int runNumber) {} @Override public boolean processDataEvent(DataEvent event) { @@ -286,9 +286,4 @@ private static HashMap generateMaterials() { } }; } - - @Override - public void detectorChanged(int runNumber) { - throw new UnsupportedOperationException("Not supported yet."); - } } diff --git a/reconstruction/tof/src/main/java/org/jlab/service/ctof/CTOFEngine.java b/reconstruction/tof/src/main/java/org/jlab/service/ctof/CTOFEngine.java index ccda0438eb..64abee57e5 100644 --- a/reconstruction/tof/src/main/java/org/jlab/service/ctof/CTOFEngine.java +++ b/reconstruction/tof/src/main/java/org/jlab/service/ctof/CTOFEngine.java @@ -43,13 +43,9 @@ public CTOFEngine() { @Override public boolean init() { - // Load the Constants - // if (Constants.CSTLOADED == false) { Constants.Load(); - // } rbc = new RecoBankWriter(); - // CalibrationConstantsLoader.Load(); - // } + String[] ctofTables = new String[]{ "/calibration/ctof/attenuation", "/calibration/ctof/effective_velocity", @@ -65,17 +61,18 @@ public boolean init() { }; requireConstants(Arrays.asList(ctofTables)); - - // Get the constants for the correct variation this.getConstantsManager().setVariation("default"); - String engineVariation = Optional.ofNullable(this.getEngineConfigString("variation")).orElse("default"); - ConstantProvider cp = GeometryFactory.getConstants(DetectorType.CTOF, 11, engineVariation); - geometry = new CTOFGeant4Factory(cp); - this.registerOutputBank("CTOF::rawhits","CTOF::hits","CTOF::clusters"); - return true; } + + + @Override + public void detectorChanged(int runNumber) { + String engineVariation = Optional.ofNullable(this.getEngineConfigString("variation")).orElse("default"); + ConstantProvider cp = GeometryFactory.getConstants(DetectorType.CTOF, runNumber, engineVariation); + geometry = new CTOFGeant4Factory(cp); + } @Override public boolean processDataEvent(DataEvent event) { @@ -86,8 +83,6 @@ public boolean processDataEvent(DataEvent event) { } DataBank bank = event.getBank("RUN::config"); -// System.out.println(); -// System.out.println(bank.getInt("event", 0)); // Load the constants //------------------- @@ -228,10 +223,4 @@ public static void main(String[] args) { System.out.println("TOTAL PROCESSING TIME = " + t); writer.close(); } - - @Override - public void detectorChanged(int runNumber) { - throw new UnsupportedOperationException("Not supported yet."); - } - } diff --git a/reconstruction/tof/src/main/java/org/jlab/service/ftof/FTOFEngine.java b/reconstruction/tof/src/main/java/org/jlab/service/ftof/FTOFEngine.java index 5f10812cf1..287669f0d3 100644 --- a/reconstruction/tof/src/main/java/org/jlab/service/ftof/FTOFEngine.java +++ b/reconstruction/tof/src/main/java/org/jlab/service/ftof/FTOFEngine.java @@ -45,9 +45,6 @@ public FTOFEngine(String name) { @Override public boolean init() { - - // Load the Constants - // if (Constants.CSTLOADED == false) { Constants.Load(); rbc = new RecoBankWriter(); @@ -68,20 +65,20 @@ public boolean init() { }; requireConstants(Arrays.asList(ftofTables)); - - // Get the constants for the correct variation this.getConstantsManager().setVariation("default"); - - // Get geometry database provider, load the geometry tables and create geometry - String engineVariation = Optional.ofNullable(this.getEngineConfigString("variation")).orElse("default"); - ConstantProvider db = GeometryFactory.getConstants(DetectorType.FTOF, 11, engineVariation); - geometry = new FTOFGeant4Factory(db); this.registerOutputBank("FTOF::rawhits","FTOF::hbhits","FTOF::hbclusters"); this.registerOutputBank("FTOF::hits","FTIF::clusters","FTOF::matchedClusters"); return true; } + + @Override + public void detectorChanged(int runNumber) { + String engineVariation = Optional.ofNullable(this.getEngineConfigString("variation")).orElse("default"); + ConstantProvider db = GeometryFactory.getConstants(DetectorType.FTOF, runNumber, engineVariation); + geometry = new FTOFGeant4Factory(db); + } @Override public boolean processDataEvent(DataEvent event) { @@ -284,9 +281,4 @@ public static void main(String arg[]) { System.out.println(t1 + " TOTAL PROCESSING TIME = " + (t / (float) counter)); } - - @Override - public void detectorChanged(int runNumber) { - throw new UnsupportedOperationException("Not supported yet."); - } } diff --git a/reconstruction/urwell/src/main/java/org/jlab/service/urwell/URWellEngine.java b/reconstruction/urwell/src/main/java/org/jlab/service/urwell/URWellEngine.java index eea377a552..761cb30290 100644 --- a/reconstruction/urwell/src/main/java/org/jlab/service/urwell/URWellEngine.java +++ b/reconstruction/urwell/src/main/java/org/jlab/service/urwell/URWellEngine.java @@ -38,10 +38,6 @@ public URWellEngine() { @Override public boolean init() { - // init ConstantsManager to read constants from CCDB - String variationName = Optional.ofNullable(this.getEngineConfigString("variation")).orElse("default"); - DatabaseConstantProvider cp = new DatabaseConstantProvider(11, variationName); - factory.init(cp, false, URWellConstants.NREGION); // register output banks for drop option this.registerOutputBank("URWELL::hits"); this.registerOutputBank("URWELL::clusters"); @@ -51,8 +47,12 @@ public boolean init() { return true; } - - + @Override + public void detectorChanged(int runNumber) { + String variationName = Optional.ofNullable(this.getEngineConfigString("variation")).orElse("default"); + DatabaseConstantProvider cp = new DatabaseConstantProvider(runNumber, variationName); + factory.init(cp, false, URWellConstants.NREGION); + } @Override public boolean processDataEvent(DataEvent event) { @@ -242,9 +242,4 @@ public static void main (String arg[]) { frame.setVisible(true); } - - @Override - public void detectorChanged(int runNumber) { - throw new UnsupportedOperationException("Not supported yet."); - } } diff --git a/reconstruction/vtx/src/main/java/org/jlab/rec/service/vtx/VTXReconstruction.java b/reconstruction/vtx/src/main/java/org/jlab/rec/service/vtx/VTXReconstruction.java index e5facbeac1..44eaaa1039 100644 --- a/reconstruction/vtx/src/main/java/org/jlab/rec/service/vtx/VTXReconstruction.java +++ b/reconstruction/vtx/src/main/java/org/jlab/rec/service/vtx/VTXReconstruction.java @@ -30,8 +30,6 @@ public VTXReconstruction() { String FieldsConfig = ""; private int Run = -1; - - public int getRun() { return Run; @@ -55,6 +53,7 @@ private void initConstantsTables() { requireConstants(Arrays.asList(tables)); this.getConstantsManager().setVariation("default"); } + @Override public boolean processDataEvent(DataEvent event) { this.FieldsConfig = this.getFieldsConfig(); @@ -97,19 +96,10 @@ public boolean processDataEvent(DataEvent event) { public boolean init() { this.initConstantsTables(); String variation = Optional.ofNullable(this.getEngineConfigString("variation")).orElse("default"); - //beam offset table - DatabaseConstantProvider dbprovider = new DatabaseConstantProvider(11, variation); - dbprovider.loadTable("/geometry/beam/position"); + registerOutputBank("REC::VertDoca"); return true; } - private void registerBanks() { - super.registerOutputBank("REC::VertDoca"); - } - public static void main(String[] args) { - } @Override - public void detectorChanged(int runNumber) { - throw new UnsupportedOperationException("Not supported yet."); - } + public void detectorChanged(int runNumber) {} } From bd0a8a4cd45da813fdca22336ebc14c9da9c7819 Mon Sep 17 00:00:00 2001 From: Nathan Baltzell Date: Tue, 22 Aug 2023 11:22:23 -0400 Subject: [PATCH 10/37] synchronize and count changes --- .../org/jlab/clas/reco/ReconstructionEngine.java | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/common-tools/clas-reco/src/main/java/org/jlab/clas/reco/ReconstructionEngine.java b/common-tools/clas-reco/src/main/java/org/jlab/clas/reco/ReconstructionEngine.java index 8ddf487061..a23500812d 100644 --- a/common-tools/clas-reco/src/main/java/org/jlab/clas/reco/ReconstructionEngine.java +++ b/common-tools/clas-reco/src/main/java/org/jlab/clas/reco/ReconstructionEngine.java @@ -2,6 +2,7 @@ import java.nio.ByteBuffer; import java.nio.ByteOrder; +import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; import java.util.HashSet; @@ -60,7 +61,8 @@ public abstract class ReconstructionEngine implements Engine { volatile boolean dropOutputBanks = false; private final Set outputBanks = new HashSet<>(); - private volatile int runNumber = 0; + private volatile List runNumbers = new ArrayList<>(); + private boolean ignoreInvalidRunNumbers = true; volatile long triggerMask = 0xFFFFFFFFFFFFFFFFL; @@ -341,15 +343,16 @@ public void dropBanks(DataEvent event) { public abstract void detectorChanged(int runNumber); - public boolean checkRunNumber(DataEvent event) { + public synchronized boolean checkRunNumber(DataEvent event) { + int r = 0; if (event.hasBank("RUN::config")) { - int r = event.getBank("RUN::config").getInt("run",0); - if (r != this.runNumber) { - this.runNumber = r; + r = event.getBank("RUN::config").getInt("run",0); + if (r != this.runNumbers.get(this.runNumbers.size()-1)) { + this.runNumbers.add(r); this.detectorChanged(r); } } - return !this.ignoreInvalidRunNumbers && this.runNumber>0; + return !this.ignoreInvalidRunNumbers && r>0; } public void processEvent(DataEvent dataEvent) { From 4f11001933ea38cc0311f2813f5b4345c154ac10 Mon Sep 17 00:00:00 2001 From: Nathan Baltzell Date: Tue, 22 Aug 2023 15:54:17 -0400 Subject: [PATCH 11/37] allow nulls --- .../clas-io/src/main/java/org/jlab/utils/JsonUtils.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common-tools/clas-io/src/main/java/org/jlab/utils/JsonUtils.java b/common-tools/clas-io/src/main/java/org/jlab/utils/JsonUtils.java index b2a6903aea..ef28fbb2ed 100644 --- a/common-tools/clas-io/src/main/java/org/jlab/utils/JsonUtils.java +++ b/common-tools/clas-io/src/main/java/org/jlab/utils/JsonUtils.java @@ -113,7 +113,7 @@ public static JsonObject Map2Json(Map map) { ret.add(topKey,Map2Json((Map)entry.getValue())); } else { - ret.add(topKey, entry.getValue().toString()); + ret.add(topKey, entry.getValue() == null ? null : entry.getValue().toString()); } } return ret; From a7a662d5a968930b56ab42332ba43412049c87b8 Mon Sep 17 00:00:00 2001 From: Nathan Baltzell Date: Tue, 22 Aug 2023 15:54:36 -0400 Subject: [PATCH 12/37] add empty list check --- .../main/java/org/jlab/clas/reco/ReconstructionEngine.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common-tools/clas-reco/src/main/java/org/jlab/clas/reco/ReconstructionEngine.java b/common-tools/clas-reco/src/main/java/org/jlab/clas/reco/ReconstructionEngine.java index a23500812d..5fab7b000a 100644 --- a/common-tools/clas-reco/src/main/java/org/jlab/clas/reco/ReconstructionEngine.java +++ b/common-tools/clas-reco/src/main/java/org/jlab/clas/reco/ReconstructionEngine.java @@ -347,9 +347,9 @@ public synchronized boolean checkRunNumber(DataEvent event) { int r = 0; if (event.hasBank("RUN::config")) { r = event.getBank("RUN::config").getInt("run",0); - if (r != this.runNumbers.get(this.runNumbers.size()-1)) { + if (this.runNumbers.isEmpty() || r != this.runNumbers.get(this.runNumbers.size()-1)) { this.runNumbers.add(r); - this.detectorChanged(r); + this.detectorChanged(r); } } return !this.ignoreInvalidRunNumbers && r>0; From 1e5b979c01ca2c62556ab3e496be0d9dfc2a0a69 Mon Sep 17 00:00:00 2001 From: Nathan Baltzell Date: Tue, 22 Aug 2023 15:55:04 -0400 Subject: [PATCH 13/37] cleanup/formatting --- .../org/jlab/service/ftof/FTOFEngine.java | 23 +++---------------- 1 file changed, 3 insertions(+), 20 deletions(-) diff --git a/reconstruction/tof/src/main/java/org/jlab/service/ftof/FTOFEngine.java b/reconstruction/tof/src/main/java/org/jlab/service/ftof/FTOFEngine.java index 287669f0d3..662d0e9d5d 100644 --- a/reconstruction/tof/src/main/java/org/jlab/service/ftof/FTOFEngine.java +++ b/reconstruction/tof/src/main/java/org/jlab/service/ftof/FTOFEngine.java @@ -82,13 +82,10 @@ public void detectorChanged(int runNumber) { @Override public boolean processDataEvent(DataEvent event) { - // System.out.println(" PROCESSING EVENT ...."); - // Constants.DEBUGMODE = true; - //setRunConditionsParameters( event) ; if(event.hasBank("RUN::config")==false ) { - System.err.println("RUN CONDITIONS NOT READ!"); - return true; - } + System.err.println("RUN CONDITIONS NOT READ!"); + return true; + } DataBank bank = event.getBank("RUN::config"); @@ -212,24 +209,10 @@ public boolean processDataEvent(DataEvent event) { // 3.4) exit if cluster list is empty but save the hits rbc.appendFTOFBanks(event, hits, clusters, matchedClusters, TrkType); -// if (event.hasBank("FTOF::adc")) { -// if (event.hasBank("FTOF::adc")) { -// event.getBank("FTOF::adc").show(); -// } -// if (event.hasBank("FTOF::tdc")) { -// event.getBank("FTOF::tdc").show(); -// } -// if (event.hasBank("FTOF::hits")) { -// event.getBank("FTOF::hits").show(); -// } -// } - return true; } - - public static void main(String arg[]) { FTOFHBEngine en = new FTOFHBEngine(); en.init(); From d8025876d306d8505d67fa00e7b1eaf6bf6d5827 Mon Sep 17 00:00:00 2001 From: Nathan Baltzell Date: Tue, 22 Aug 2023 15:55:34 -0400 Subject: [PATCH 14/37] use the same wrapper used in clara/recon-util --- .../src/test/java/org/jlab/service/ec/ECReconstructionTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reconstruction/ec/src/test/java/org/jlab/service/ec/ECReconstructionTest.java b/reconstruction/ec/src/test/java/org/jlab/service/ec/ECReconstructionTest.java index 9294001a21..cb6eb87dd7 100644 --- a/reconstruction/ec/src/test/java/org/jlab/service/ec/ECReconstructionTest.java +++ b/reconstruction/ec/src/test/java/org/jlab/service/ec/ECReconstructionTest.java @@ -30,7 +30,7 @@ public void testECReconstruction() { ECEngine engineEC = new ECEngine(); engineEC.init(); - engineEC.processDataEvent(testEvent); + engineEC.processEvent(testEvent); testEvent.show(); testEvent.getBank("ECAL::hits").show(); From 5174d522826473e9753357e629418144bac69834 Mon Sep 17 00:00:00 2001 From: Nathan Baltzell Date: Tue, 22 Aug 2023 16:09:13 -0400 Subject: [PATCH 15/37] hardcode it to 11 for now --- .../src/main/java/org/jlab/clas/reco/ReconstructionEngine.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common-tools/clas-reco/src/main/java/org/jlab/clas/reco/ReconstructionEngine.java b/common-tools/clas-reco/src/main/java/org/jlab/clas/reco/ReconstructionEngine.java index 5fab7b000a..c585058b60 100644 --- a/common-tools/clas-reco/src/main/java/org/jlab/clas/reco/ReconstructionEngine.java +++ b/common-tools/clas-reco/src/main/java/org/jlab/clas/reco/ReconstructionEngine.java @@ -349,7 +349,7 @@ public synchronized boolean checkRunNumber(DataEvent event) { r = event.getBank("RUN::config").getInt("run",0); if (this.runNumbers.isEmpty() || r != this.runNumbers.get(this.runNumbers.size()-1)) { this.runNumbers.add(r); - this.detectorChanged(r); + this.detectorChanged(11); } } return !this.ignoreInvalidRunNumbers && r>0; From bb222a8e6e57505fbf0282059d92eac229ad1680 Mon Sep 17 00:00:00 2001 From: Nathan Baltzell Date: Tue, 22 Aug 2023 16:09:47 -0400 Subject: [PATCH 16/37] implement detectorChanged for cvt --- .../main/java/org/jlab/rec/cvt/services/CVTEngine.java | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/reconstruction/cvt/src/main/java/org/jlab/rec/cvt/services/CVTEngine.java b/reconstruction/cvt/src/main/java/org/jlab/rec/cvt/services/CVTEngine.java index 2a09539f4b..a3758671bf 100644 --- a/reconstruction/cvt/src/main/java/org/jlab/rec/cvt/services/CVTEngine.java +++ b/reconstruction/cvt/src/main/java/org/jlab/rec/cvt/services/CVTEngine.java @@ -133,12 +133,14 @@ public boolean init() { this.initConstantsTables(); this.registerBanks(); this.printConfiguration(); - return true; + return true; } @Override public void detectorChanged(int runNumber) { - throw new UnsupportedOperationException("Not supported yet."); + IndexedTable svtLorentz = this.getConstantsManager().getConstants(runNumber, "/calibration/svt/lorentz_angle"); + IndexedTable bmtVoltage = this.getConstantsManager().getConstants(runNumber, "/calibration/mvt/bmt_voltage"); + Geometry.initialize(this.getConstantsManager().getVariation(), runNumber, svtLorentz, bmtVoltage); } public final void setOutputBankPrefix(String prefix) { @@ -286,16 +288,12 @@ public boolean processDataEvent(DataEvent event) { int run = this.getRun(event); IndexedTable svtStatus = this.getConstantsManager().getConstants(run, "/calibration/svt/status"); - IndexedTable svtLorentz = this.getConstantsManager().getConstants(run, "/calibration/svt/lorentz_angle"); IndexedTable bmtStatus = this.getConstantsManager().getConstants(run, "/calibration/mvt/bmt_status"); IndexedTable bmtTime = this.getConstantsManager().getConstants(run, "/calibration/mvt/bmt_time"); - IndexedTable bmtVoltage = this.getConstantsManager().getConstants(run, "/calibration/mvt/bmt_voltage"); IndexedTable bmtStripVoltage = this.getConstantsManager().getConstants(run, "/calibration/mvt/bmt_strip_voltage"); IndexedTable bmtStripThreshold = this.getConstantsManager().getConstants(run, "/calibration/mvt/bmt_strip_voltage_thresholds"); IndexedTable beamPos = this.getConstantsManager().getConstants(run, "/geometry/beam/position"); - Geometry.getInstance().initialize(this.getConstantsManager().getVariation(), run, svtLorentz, bmtVoltage); - CVTReconstruction reco = new CVTReconstruction(swimmer); List> hits = reco.readHits(event, svtStatus, bmtStatus, bmtTime, From 0bc0d3f28336fbd0e0f355a007661c7df0de694e Mon Sep 17 00:00:00 2001 From: Nathan Baltzell Date: Tue, 22 Aug 2023 16:09:57 -0400 Subject: [PATCH 17/37] implement detector changed for dc --- .../main/java/org/jlab/rec/dc/Constants.java | 25 ++++++++----------- .../java/org/jlab/service/dc/DCEngine.java | 2 +- 2 files changed, 11 insertions(+), 16 deletions(-) diff --git a/reconstruction/dc/src/main/java/org/jlab/rec/dc/Constants.java b/reconstruction/dc/src/main/java/org/jlab/rec/dc/Constants.java index d020322477..a80f39411c 100644 --- a/reconstruction/dc/src/main/java/org/jlab/rec/dc/Constants.java +++ b/reconstruction/dc/src/main/java/org/jlab/rec/dc/Constants.java @@ -49,6 +49,8 @@ public static Constants getInstance() { public static boolean DEBUG = false; + public static double[][] SHIFTS = null; + // CONSTATNS for TRANSFORMATION public static final double SIN25 = Math.sin(Math.toRadians(25.)); public static final double COS25 = Math.cos(Math.toRadians(25.)); @@ -366,7 +368,6 @@ public boolean isSWAPDCRBBITS() { public void setSWAPDCRBBITS(boolean SWAPDCRBBITS) { this.SWAPDCRBBITS = SWAPDCRBBITS; } - public synchronized void initialize(String engine, String variation, @@ -400,9 +401,6 @@ public synchronized void initialize(String engine, SECTORSELECT = selectedSector; LoadConstants(); - - LoadGeometry(GEOVARIATION, shifts); - ConstantsLoaded = true; printConfig(engine); } @@ -414,9 +412,6 @@ public synchronized void initialize(String engine) { } else { LoadConstants(); - - LoadGeometry(GEOVARIATION, null); - ConstantsLoaded = true; printConfig(engine); } @@ -531,24 +526,24 @@ private void addReverseTT(int run, IndexedTable tt) { reverseTTs.put(run, reverse); } - private synchronized void LoadGeometry(String geoVariation, double[][] shifts) { + public synchronized void LoadGeometry(int runNumber, String geoVariation, double[][] shifts) { // Load the geometry - ConstantProvider provider = GeometryFactory.getConstants(DetectorType.DC, 11, geoVariation); + ConstantProvider provider = GeometryFactory.getConstants(DetectorType.DC, runNumber, geoVariation); dcDetector = new DCGeant4Factory(provider, MINISTAGGERSTATUS, FEEDTHROUGHSSTATUS, ENDPLATESBOWING, shifts); for(int l=0; l<6; l++) { wpdist[l] = provider.getDouble("/geometry/dc/superlayer/wpdist", l); } // Load target - ConstantProvider providerTG = GeometryFactory.getConstants(DetectorType.TARGET, 11, geoVariation); + ConstantProvider providerTG = GeometryFactory.getConstants(DetectorType.TARGET, runNumber, geoVariation); double targetPosition = providerTG.getDouble("/geometry/shifts/target/z",0); double targetLength = providerTG.getDouble("/geometry/materials/target/length",0); // Load other geometries - ConstantProvider providerFTOF = GeometryFactory.getConstants(DetectorType.FTOF, 11, geoVariation); + ConstantProvider providerFTOF = GeometryFactory.getConstants(DetectorType.FTOF, runNumber, geoVariation); ftofDetector = new FTOFGeant4Factory(providerFTOF); - ecalDetector = GeometryFactory.getDetector(DetectorType.ECAL, 11, geoVariation); - fmtDetector = GeometryFactory.getDetector(DetectorType.FMT, 11, geoVariation); - ConstantsManager managerRICH = new ConstantsManager(geoVariation);; - richDetector = new RICHGeoFactory(0, managerRICH, 11, false); + ecalDetector = GeometryFactory.getDetector(DetectorType.ECAL, runNumber, geoVariation); + fmtDetector = GeometryFactory.getDetector(DetectorType.FMT, runNumber, geoVariation); + ConstantsManager managerRICH = new ConstantsManager(geoVariation); + richDetector = new RICHGeoFactory(0, managerRICH, runNumber, false); // create the surfaces trajSurfaces = new TrajectorySurfaces(); trajSurfaces.loadSurface(targetPosition, targetLength, dcDetector, ftofDetector, ecalDetector, fmtDetector, richDetector); diff --git a/reconstruction/dc/src/main/java/org/jlab/service/dc/DCEngine.java b/reconstruction/dc/src/main/java/org/jlab/service/dc/DCEngine.java index 17f3b4e9d3..44cfd40a1c 100644 --- a/reconstruction/dc/src/main/java/org/jlab/service/dc/DCEngine.java +++ b/reconstruction/dc/src/main/java/org/jlab/service/dc/DCEngine.java @@ -198,7 +198,7 @@ public boolean init() { @Override public void detectorChanged(int runNumber) { - throw new UnsupportedOperationException("Not supported yet."); + Constants.getInstance().LoadGeometry(runNumber, geoVariation, shifts); } private void initBanks() { From 747e590e92ac79ceabdee31496613c226e1da771 Mon Sep 17 00:00:00 2001 From: Nathan Baltzell Date: Tue, 22 Aug 2023 16:25:32 -0400 Subject: [PATCH 18/37] use the same wrapper used in clara/recon-util --- .../test/java/org/jlab/service/dc/DCReconstructionTest.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reconstruction/dc/src/test/java/org/jlab/service/dc/DCReconstructionTest.java b/reconstruction/dc/src/test/java/org/jlab/service/dc/DCReconstructionTest.java index 0954c9cd3a..acfa8711a4 100644 --- a/reconstruction/dc/src/test/java/org/jlab/service/dc/DCReconstructionTest.java +++ b/reconstruction/dc/src/test/java/org/jlab/service/dc/DCReconstructionTest.java @@ -50,8 +50,8 @@ public void testDCReconstruction() { DCHBPostClusterConv engineHB = new DCHBPostClusterConv(); engineCL.init(); engineHB.init(); - engineCL.processDataEvent(testEvent); - engineHB.processDataEvent(testEvent); + engineCL.processEvent(testEvent); + engineHB.processEvent(testEvent); if(testEvent.hasBank("HitBasedTrkg::HBTracks")) { testEvent.getBank("HitBasedTrkg::HBTracks").show(); } From 76ce9670788606b4f25761c6dc34d93345c307b5 Mon Sep 17 00:00:00 2001 From: Nathan Baltzell Date: Tue, 22 Aug 2023 16:38:19 -0400 Subject: [PATCH 19/37] fix logic oops --- .../main/java/org/jlab/clas/reco/ReconstructionEngine.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common-tools/clas-reco/src/main/java/org/jlab/clas/reco/ReconstructionEngine.java b/common-tools/clas-reco/src/main/java/org/jlab/clas/reco/ReconstructionEngine.java index c585058b60..837f86f994 100644 --- a/common-tools/clas-reco/src/main/java/org/jlab/clas/reco/ReconstructionEngine.java +++ b/common-tools/clas-reco/src/main/java/org/jlab/clas/reco/ReconstructionEngine.java @@ -349,10 +349,10 @@ public synchronized boolean checkRunNumber(DataEvent event) { r = event.getBank("RUN::config").getInt("run",0); if (this.runNumbers.isEmpty() || r != this.runNumbers.get(this.runNumbers.size()-1)) { this.runNumbers.add(r); - this.detectorChanged(11); + this.detectorChanged(11); } } - return !this.ignoreInvalidRunNumbers && r>0; + return !this.ignoreInvalidRunNumbers || r>0; } public void processEvent(DataEvent dataEvent) { From 380e71c35f66fb68ae1e7fca1d3674e586546c67 Mon Sep 17 00:00:00 2001 From: Nathan Baltzell Date: Mon, 28 Aug 2023 09:42:17 -0400 Subject: [PATCH 20/37] rename processDataEvent/processEvent --- .../org/jlab/clas/reco/EngineProcessor.java | 2 +- .../jlab/clas/reco/ReconstructionEngine.java | 25 +++++++++---------- .../jlab/clas/swimtools/MagFieldsEngine.java | 2 +- .../java/org/jlab/rec/service/AHDCEngine.java | 4 +-- .../org/jlab/service/band/BANDEngine.java | 4 +-- .../service/cnd/CNDCalibrationEngine.java | 4 +-- .../org/jlab/rec/cvt/services/CVTEngine.java | 2 +- .../rec/cvt/services/CVTSecondPassEngine.java | 2 +- .../java/org/jlab/service/dc/DCEngine.java | 2 +- .../org/jlab/service/dc/DCHBClustering.java | 2 +- .../java/org/jlab/service/dc/DCHBEngine.java | 2 +- .../jlab/service/dc/DCHBPostClusterAI.java | 2 +- .../jlab/service/dc/DCHBPostClusterConv.java | 2 +- .../java/org/jlab/service/dc/DCTBEngine.java | 3 ++- .../service/dc/LayerEfficiencyAnalyzer.java | 4 +-- .../jlab/service/dc/DCReconstructionTest.java | 4 +-- .../java/org/jlab/service/eb/EBEngine.java | 4 +-- .../org/jlab/service/eb/EBHBAIEngine.java | 4 +-- .../java/org/jlab/service/eb/EBHBEngine.java | 4 +-- .../org/jlab/service/eb/EBTBAIEngine.java | 4 +-- .../java/org/jlab/service/eb/EBTBEngine.java | 4 +-- .../org/jlab/service/eb/VersionEngine.java | 2 +- .../java/org/jlab/service/ec/ECEngine.java | 2 +- .../org/jlab/service/swim/SwimEngine.java.old | 2 +- .../jlab/service/ec/ECReconstructionTest.java | 2 +- .../java/org/jlab/service/fmt/FMTEngine.java | 2 +- .../main/java/org/jlab/rec/ft/FTEBEngine.java | 10 ++++---- .../java/org/jlab/rec/ft/cal/FTCALEngine.java | 4 +-- .../org/jlab/rec/ft/hodo/FTHODOEngine.java | 4 +-- .../java/org/jlab/rec/ft/trk/FTTRKEngine.java | 2 +- .../org/jlab/service/ft/FTEBEngineTest.java | 4 +-- .../org/jlab/service/ft/FTTRKEngineTest.java | 2 +- .../htcc/HTCCReconstructionService.java | 2 +- .../org/jlab/service/ltcc/LTCCEngine.java | 2 +- .../java/org/jlab/service/mc/TruthMatch.java | 2 +- .../org/jlab/service/mltn/MLTDEngine.java | 2 +- .../org/jlab/service/mltn/MLTNEngine.java | 2 +- .../org/jlab/service/raster/RasterEngine.java | 4 +-- .../java/org/jlab/rec/rich/RICHEBEngine.java | 4 +-- .../org/jlab/service/rtpc/RTPCEngine.java | 4 +-- .../org/jlab/service/swaps/SwapEngine.java | 2 +- .../org/jlab/service/ctof/CTOFEngine.java | 4 +-- .../org/jlab/service/ftof/FTOFEngine.java | 10 ++++---- .../org/jlab/service/urwell/URWellEngine.java | 4 +-- .../rec/service/vtx/VTXReconstruction.java | 2 +- 45 files changed, 83 insertions(+), 83 deletions(-) diff --git a/common-tools/clas-reco/src/main/java/org/jlab/clas/reco/EngineProcessor.java b/common-tools/clas-reco/src/main/java/org/jlab/clas/reco/EngineProcessor.java index 650affb8ee..b30a42ac54 100644 --- a/common-tools/clas-reco/src/main/java/org/jlab/clas/reco/EngineProcessor.java +++ b/common-tools/clas-reco/src/main/java/org/jlab/clas/reco/EngineProcessor.java @@ -267,7 +267,7 @@ public void init(){ public void processEvent(DataEvent event){ for(Map.Entry engine : this.processorEngines.entrySet()){ try { - engine.getValue().processEvent(event); + engine.getValue().processDataEvent(event); } catch (Exception e){ LOGGER.log(Level.SEVERE, "[Exception] >>>>> engine : {0}\n\n", engine.getKey()); e.printStackTrace(); diff --git a/common-tools/clas-reco/src/main/java/org/jlab/clas/reco/ReconstructionEngine.java b/common-tools/clas-reco/src/main/java/org/jlab/clas/reco/ReconstructionEngine.java index 837f86f994..2e9277db1e 100644 --- a/common-tools/clas-reco/src/main/java/org/jlab/clas/reco/ReconstructionEngine.java +++ b/common-tools/clas-reco/src/main/java/org/jlab/clas/reco/ReconstructionEngine.java @@ -67,10 +67,14 @@ public abstract class ReconstructionEngine implements Engine { volatile long triggerMask = 0xFFFFFFFFFFFFFFFFL; - String engineName = "UnknownEngine"; - String engineAuthor = "N.T."; - String engineVersion = "0.0"; - String engineDescription = "CLARA Engine"; + String engineName = "UnknownEngine"; + String engineAuthor = "N.T."; + String engineVersion = "0.0"; + String engineDescription = "CLARA Engine"; + + abstract public boolean processDataEventUser(DataEvent event); + abstract public boolean init(); + abstract public void detectorChanged(int runNumber); public ReconstructionEngine(String name, String author, String version){ engineName = name; @@ -111,9 +115,6 @@ protected RawBank getRawBankReader(String bankName, OrderType... order) { return new RawDataBank(bankName, order); } - abstract public boolean processDataEvent(DataEvent event); - abstract public boolean init(); - /** * Use a map just to avoid name clash in ConstantsManager. * @param tables map of table names to #indices @@ -341,8 +342,6 @@ public void dropBanks(DataEvent event) { } } - public abstract void detectorChanged(int runNumber); - public synchronized boolean checkRunNumber(DataEvent event) { int r = 0; if (event.hasBank("RUN::config")) { @@ -355,7 +354,7 @@ public synchronized boolean checkRunNumber(DataEvent event) { return !this.ignoreInvalidRunNumbers || r>0; } - public void processEvent(DataEvent dataEvent) { + public void processDataEvent(DataEvent dataEvent) { if (!this.wroteConfig) { this.wroteConfig = true; JsonUtils.extend(dataEvent, CONFIG_BANK_NAME, "json", this.generateConfig()); @@ -365,7 +364,7 @@ public void processEvent(DataEvent dataEvent) { } if(this.applyTriggerMask(dataEvent)) { if (this.checkRunNumber(dataEvent)) { - this.processDataEvent(dataEvent); + this.processDataEventUser(dataEvent); } } } @@ -404,7 +403,7 @@ public EngineData execute(EngineData input) { } try { - this.processEvent(dataEventHipo); + this.processDataEvent(dataEventHipo); output.setData(mt, dataEventHipo.getHipoEvent()); } catch (Exception e) { String msg = String.format("Error processing input event%n%n%s", ClaraUtil.reportException(e)); @@ -520,7 +519,7 @@ public Reco(){ super("a","b","c"); } @Override - public boolean processDataEvent(DataEvent event) { + public boolean processDataEventUser(DataEvent event) { throw new UnsupportedOperationException("Not supported yet."); } diff --git a/common-tools/swim-tools/src/main/java/org/jlab/clas/swimtools/MagFieldsEngine.java b/common-tools/swim-tools/src/main/java/org/jlab/clas/swimtools/MagFieldsEngine.java index 25db8321a4..24a2a9b585 100644 --- a/common-tools/swim-tools/src/main/java/org/jlab/clas/swimtools/MagFieldsEngine.java +++ b/common-tools/swim-tools/src/main/java/org/jlab/clas/swimtools/MagFieldsEngine.java @@ -162,7 +162,7 @@ private void loadTables() { } @Override - public boolean processDataEvent(DataEvent event) { + public boolean processDataEventUser(DataEvent event) { DataBank bank = event.getBank("RUN::config"); // Load the constants // ------------------- diff --git a/reconstruction/alert/src/main/java/org/jlab/rec/service/AHDCEngine.java b/reconstruction/alert/src/main/java/org/jlab/rec/service/AHDCEngine.java index 4dfa45e1d0..17d5ef73ae 100644 --- a/reconstruction/alert/src/main/java/org/jlab/rec/service/AHDCEngine.java +++ b/reconstruction/alert/src/main/java/org/jlab/rec/service/AHDCEngine.java @@ -103,7 +103,7 @@ public NDList processInput(TranslatorContext translatorContext, float[] floats) public void detectorChanged(int runNumber) {} @Override - public boolean processDataEvent(DataEvent event) { + public boolean processDataEventUser(DataEvent event) { int runNo = 10; int eventNo = 777; @@ -279,7 +279,7 @@ public static void main(String[] args) { // System.out.println("*********** NEXT EVENT ************"); // event.show(); - en.processDataEvent(event); + en.processDataEventUser(event); writer.writeEvent(event); } diff --git a/reconstruction/band/src/main/java/org/jlab/service/band/BANDEngine.java b/reconstruction/band/src/main/java/org/jlab/service/band/BANDEngine.java index 9e92894684..b1b3e27d9b 100644 --- a/reconstruction/band/src/main/java/org/jlab/service/band/BANDEngine.java +++ b/reconstruction/band/src/main/java/org/jlab/service/band/BANDEngine.java @@ -29,7 +29,7 @@ public BANDEngine() { int Run = -1; @Override - public boolean processDataEvent(DataEvent event) { + public boolean processDataEventUser(DataEvent event) { //System.out.println("**** NEW EVENT ****"); // update calibration constants based on run number if changed setRunConditionsParameters(event); @@ -127,7 +127,7 @@ public static void main (String arg[]) { // event.getBank("band::adc").show(); // event.getBank("band::tdc").show(); //} - en.processDataEvent(event); + en.processDataEventUser(event); writer.writeEvent(event); //event.getBank("band::hits").show(); nevent++; diff --git a/reconstruction/cnd/src/main/java/org/jlab/service/cnd/CNDCalibrationEngine.java b/reconstruction/cnd/src/main/java/org/jlab/service/cnd/CNDCalibrationEngine.java index 4c5d3e5c36..902e1f0565 100644 --- a/reconstruction/cnd/src/main/java/org/jlab/service/cnd/CNDCalibrationEngine.java +++ b/reconstruction/cnd/src/main/java/org/jlab/service/cnd/CNDCalibrationEngine.java @@ -45,7 +45,7 @@ public CNDCalibrationEngine() { private int newRun = 0; @Override - public boolean processDataEvent(DataEvent event) { + public boolean processDataEventUser(DataEvent event) { if (!event.hasBank("RUN::config")) { return true; @@ -142,7 +142,7 @@ public static void main (String arg[]) { //event.getBank("MC::Particle").show(); //if(event.hasBank("CVT::Tracks")){event.getBank("CVT::Tracks").show();}; - en.processDataEvent(event); + en.processDataEventUser(event); // System.out.println("event après process "); // event.show(); diff --git a/reconstruction/cvt/src/main/java/org/jlab/rec/cvt/services/CVTEngine.java b/reconstruction/cvt/src/main/java/org/jlab/rec/cvt/services/CVTEngine.java index a3758671bf..c466709256 100644 --- a/reconstruction/cvt/src/main/java/org/jlab/rec/cvt/services/CVTEngine.java +++ b/reconstruction/cvt/src/main/java/org/jlab/rec/cvt/services/CVTEngine.java @@ -281,7 +281,7 @@ public void setBmtzmaxclussize(int bmtzmaxclussize) { } @Override - public boolean processDataEvent(DataEvent event) { + public boolean processDataEventUser(DataEvent event) { Swim swimmer = new Swim(); diff --git a/reconstruction/cvt/src/main/java/org/jlab/rec/cvt/services/CVTSecondPassEngine.java b/reconstruction/cvt/src/main/java/org/jlab/rec/cvt/services/CVTSecondPassEngine.java index 645974c313..dd9d219e76 100644 --- a/reconstruction/cvt/src/main/java/org/jlab/rec/cvt/services/CVTSecondPassEngine.java +++ b/reconstruction/cvt/src/main/java/org/jlab/rec/cvt/services/CVTSecondPassEngine.java @@ -30,7 +30,7 @@ public CVTSecondPassEngine() { @Override - public boolean processDataEvent(DataEvent event) { + public boolean processDataEventUser(DataEvent event) { int run = this.getRun(event); if(Constants.getInstance().seedingDebugMode) diff --git a/reconstruction/dc/src/main/java/org/jlab/service/dc/DCEngine.java b/reconstruction/dc/src/main/java/org/jlab/service/dc/DCEngine.java index 44cfd40a1c..a0780539a7 100644 --- a/reconstruction/dc/src/main/java/org/jlab/service/dc/DCEngine.java +++ b/reconstruction/dc/src/main/java/org/jlab/service/dc/DCEngine.java @@ -169,7 +169,7 @@ public void LoadTables() { @Override - public boolean processDataEvent(DataEvent event) { + public boolean processDataEventUser(DataEvent event) { return true; } diff --git a/reconstruction/dc/src/main/java/org/jlab/service/dc/DCHBClustering.java b/reconstruction/dc/src/main/java/org/jlab/service/dc/DCHBClustering.java index c527befa37..5ebf7c2ecc 100644 --- a/reconstruction/dc/src/main/java/org/jlab/service/dc/DCHBClustering.java +++ b/reconstruction/dc/src/main/java/org/jlab/service/dc/DCHBClustering.java @@ -36,7 +36,7 @@ public void setDropBanks() { @Override - public boolean processDataEvent(DataEvent event) { + public boolean processDataEventUser(DataEvent event) { int run = this.getRun(event); if(run==0) return true; diff --git a/reconstruction/dc/src/main/java/org/jlab/service/dc/DCHBEngine.java b/reconstruction/dc/src/main/java/org/jlab/service/dc/DCHBEngine.java index 868608395b..9034c47513 100644 --- a/reconstruction/dc/src/main/java/org/jlab/service/dc/DCHBEngine.java +++ b/reconstruction/dc/src/main/java/org/jlab/service/dc/DCHBEngine.java @@ -55,7 +55,7 @@ public void setDropBanks() { } @Override - public boolean processDataEvent(DataEvent event) { + public boolean processDataEventUser(DataEvent event) { int run = this.getRun(event); if(run==0) return true; diff --git a/reconstruction/dc/src/main/java/org/jlab/service/dc/DCHBPostClusterAI.java b/reconstruction/dc/src/main/java/org/jlab/service/dc/DCHBPostClusterAI.java index 0b63a3310b..14e6ae4e01 100644 --- a/reconstruction/dc/src/main/java/org/jlab/service/dc/DCHBPostClusterAI.java +++ b/reconstruction/dc/src/main/java/org/jlab/service/dc/DCHBPostClusterAI.java @@ -44,7 +44,7 @@ public void setDropBanks() { } @Override - public boolean processDataEvent(DataEvent event) { + public boolean processDataEventUser(DataEvent event) { int run = this.getRun(event); if(run==0) { diff --git a/reconstruction/dc/src/main/java/org/jlab/service/dc/DCHBPostClusterConv.java b/reconstruction/dc/src/main/java/org/jlab/service/dc/DCHBPostClusterConv.java index 2078cedb9b..a24f1681e2 100644 --- a/reconstruction/dc/src/main/java/org/jlab/service/dc/DCHBPostClusterConv.java +++ b/reconstruction/dc/src/main/java/org/jlab/service/dc/DCHBPostClusterConv.java @@ -46,7 +46,7 @@ public void setDropBanks() { } @Override - public boolean processDataEvent(DataEvent event) { + public boolean processDataEventUser(DataEvent event) { int run = this.getRun(event); if(run==0) return true; diff --git a/reconstruction/dc/src/main/java/org/jlab/service/dc/DCTBEngine.java b/reconstruction/dc/src/main/java/org/jlab/service/dc/DCTBEngine.java index 2bd9d1e9f9..0d0e72426d 100644 --- a/reconstruction/dc/src/main/java/org/jlab/service/dc/DCTBEngine.java +++ b/reconstruction/dc/src/main/java/org/jlab/service/dc/DCTBEngine.java @@ -70,7 +70,8 @@ public void setDropBanks() { } @Override - public boolean processDataEvent(DataEvent event) { + public boolean processDataEventUser(DataEvent event) { + int run = this.getRun(event); if(run==0) return true; diff --git a/reconstruction/dc/src/main/java/org/jlab/service/dc/LayerEfficiencyAnalyzer.java b/reconstruction/dc/src/main/java/org/jlab/service/dc/LayerEfficiencyAnalyzer.java index 1a2d7002e1..7f18e1006d 100644 --- a/reconstruction/dc/src/main/java/org/jlab/service/dc/LayerEfficiencyAnalyzer.java +++ b/reconstruction/dc/src/main/java/org/jlab/service/dc/LayerEfficiencyAnalyzer.java @@ -214,7 +214,7 @@ public boolean equals(Object obj) { private final ArrayList> LayerEffsTrkD = new ArrayList>(); @Override - public boolean processDataEvent(DataEvent event) { + public boolean processDataEventUser(DataEvent event) { int run = this.getRun(event); if(run==0) return true; @@ -449,7 +449,7 @@ public static void main(String[] args) { while (reader.hasEvent()) { counter++; DataEvent event = reader.getNextEvent(); - tm.processDataEvent(event); + tm.processDataEventUser(event); tm.ProcessLayerEffs(event); //event.show(); if(counter%1000==0) { diff --git a/reconstruction/dc/src/test/java/org/jlab/service/dc/DCReconstructionTest.java b/reconstruction/dc/src/test/java/org/jlab/service/dc/DCReconstructionTest.java index acfa8711a4..0954c9cd3a 100644 --- a/reconstruction/dc/src/test/java/org/jlab/service/dc/DCReconstructionTest.java +++ b/reconstruction/dc/src/test/java/org/jlab/service/dc/DCReconstructionTest.java @@ -50,8 +50,8 @@ public void testDCReconstruction() { DCHBPostClusterConv engineHB = new DCHBPostClusterConv(); engineCL.init(); engineHB.init(); - engineCL.processEvent(testEvent); - engineHB.processEvent(testEvent); + engineCL.processDataEvent(testEvent); + engineHB.processDataEvent(testEvent); if(testEvent.hasBank("HitBasedTrkg::HBTracks")) { testEvent.getBank("HitBasedTrkg::HBTracks").show(); } diff --git a/reconstruction/eb/src/main/java/org/jlab/service/eb/EBEngine.java b/reconstruction/eb/src/main/java/org/jlab/service/eb/EBEngine.java index f49f89f5ae..aaf3e1582e 100644 --- a/reconstruction/eb/src/main/java/org/jlab/service/eb/EBEngine.java +++ b/reconstruction/eb/src/main/java/org/jlab/service/eb/EBEngine.java @@ -65,7 +65,7 @@ public void setUsePOCA(boolean val) { } @Override - public boolean processDataEvent(DataEvent de) { + public boolean processDataEventUser(DataEvent de) { throw new RuntimeException("EBEngine cannot be used directly. Use EBTBEngine/EBHBEngine instead."); } @@ -90,7 +90,7 @@ public void setOutputBankPrefix(String prefix) { } } - public boolean processDataEvent(DataEvent de,EBScalers ebs) { + public boolean processDataEventUser(DataEvent de,EBScalers ebs) { // check run number, get constants from CCDB: int run=-1; diff --git a/reconstruction/eb/src/main/java/org/jlab/service/eb/EBHBAIEngine.java b/reconstruction/eb/src/main/java/org/jlab/service/eb/EBHBAIEngine.java index 2533e6d275..62cd991cec 100644 --- a/reconstruction/eb/src/main/java/org/jlab/service/eb/EBHBAIEngine.java +++ b/reconstruction/eb/src/main/java/org/jlab/service/eb/EBHBAIEngine.java @@ -18,8 +18,8 @@ public EBHBAIEngine(){ } @Override - public boolean processDataEvent(DataEvent de) { - return super.processDataEvent(de,ebScalers); + public boolean processDataEventUser(DataEvent de) { + return super.processDataEventUser(de,ebScalers); } @Override diff --git a/reconstruction/eb/src/main/java/org/jlab/service/eb/EBHBEngine.java b/reconstruction/eb/src/main/java/org/jlab/service/eb/EBHBEngine.java index c255b63bfa..d570d39b06 100644 --- a/reconstruction/eb/src/main/java/org/jlab/service/eb/EBHBEngine.java +++ b/reconstruction/eb/src/main/java/org/jlab/service/eb/EBHBEngine.java @@ -18,8 +18,8 @@ public EBHBEngine(){ } @Override - public boolean processDataEvent(DataEvent de) { - return super.processDataEvent(de,ebScalers); + public boolean processDataEventUser(DataEvent de) { + return super.processDataEventUser(de,ebScalers); } @Override diff --git a/reconstruction/eb/src/main/java/org/jlab/service/eb/EBTBAIEngine.java b/reconstruction/eb/src/main/java/org/jlab/service/eb/EBTBAIEngine.java index 033bac510e..6a41226838 100644 --- a/reconstruction/eb/src/main/java/org/jlab/service/eb/EBTBAIEngine.java +++ b/reconstruction/eb/src/main/java/org/jlab/service/eb/EBTBAIEngine.java @@ -18,8 +18,8 @@ public EBTBAIEngine(){ } @Override - public boolean processDataEvent(DataEvent de) { - return super.processDataEvent(de,ebScalers); + public boolean processDataEventUser(DataEvent de) { + return super.processDataEventUser(de,ebScalers); } @Override diff --git a/reconstruction/eb/src/main/java/org/jlab/service/eb/EBTBEngine.java b/reconstruction/eb/src/main/java/org/jlab/service/eb/EBTBEngine.java index 550d72b4ea..d009f13aff 100644 --- a/reconstruction/eb/src/main/java/org/jlab/service/eb/EBTBEngine.java +++ b/reconstruction/eb/src/main/java/org/jlab/service/eb/EBTBEngine.java @@ -24,8 +24,8 @@ public EBTBEngine(){ } @Override - public boolean processDataEvent(DataEvent de) { - final boolean ret = super.processDataEvent(de,ebScalers); + public boolean processDataEventUser(DataEvent de) { + final boolean ret = super.processDataEventUser(de,ebScalers); this.linkTracks(de); return ret; } diff --git a/reconstruction/eb/src/main/java/org/jlab/service/eb/VersionEngine.java b/reconstruction/eb/src/main/java/org/jlab/service/eb/VersionEngine.java index dea21ae21d..29ed6c8673 100644 --- a/reconstruction/eb/src/main/java/org/jlab/service/eb/VersionEngine.java +++ b/reconstruction/eb/src/main/java/org/jlab/service/eb/VersionEngine.java @@ -25,7 +25,7 @@ public static void show(DataBank bank) { } @Override - public boolean processDataEvent(DataEvent event) { + public boolean processDataEventUser(DataEvent event) { if (!done) { JsonObject versions = Versions.getVersionsJson(); JsonObject config = new JsonObject(); diff --git a/reconstruction/ec/src/main/java/org/jlab/service/ec/ECEngine.java b/reconstruction/ec/src/main/java/org/jlab/service/ec/ECEngine.java index e364966048..2fcecad6ca 100644 --- a/reconstruction/ec/src/main/java/org/jlab/service/ec/ECEngine.java +++ b/reconstruction/ec/src/main/java/org/jlab/service/ec/ECEngine.java @@ -30,7 +30,7 @@ public ECEngine(){ } @Override - public boolean processDataEvent(DataEvent de) { + public boolean processDataEventUser(DataEvent de) { List ecStrips = ECCommon.initEC(de, this.getConstantsManager()); // thresholds, ADC/TDC match List ecPeaks = ECCommon.processPeaks(ECCommon.createPeaks(ecStrips)); // thresholds, split peaks -> update peak-lines diff --git a/reconstruction/ec/src/main/java/org/jlab/service/swim/SwimEngine.java.old b/reconstruction/ec/src/main/java/org/jlab/service/swim/SwimEngine.java.old index 3fb2364af2..961a050968 100644 --- a/reconstruction/ec/src/main/java/org/jlab/service/swim/SwimEngine.java.old +++ b/reconstruction/ec/src/main/java/org/jlab/service/swim/SwimEngine.java.old @@ -48,7 +48,7 @@ public class SwimEngine extends ReconstructionEngine { } @Override - public boolean processDataEvent(DataEvent event) { + public boolean processDataEventUser(DataEvent event) { //this.test_caching_index(); //this.test_caching(); this.swimParticles(event); diff --git a/reconstruction/ec/src/test/java/org/jlab/service/ec/ECReconstructionTest.java b/reconstruction/ec/src/test/java/org/jlab/service/ec/ECReconstructionTest.java index cb6eb87dd7..9294001a21 100644 --- a/reconstruction/ec/src/test/java/org/jlab/service/ec/ECReconstructionTest.java +++ b/reconstruction/ec/src/test/java/org/jlab/service/ec/ECReconstructionTest.java @@ -30,7 +30,7 @@ public void testECReconstruction() { ECEngine engineEC = new ECEngine(); engineEC.init(); - engineEC.processEvent(testEvent); + engineEC.processDataEvent(testEvent); testEvent.show(); testEvent.getBank("ECAL::hits").show(); diff --git a/reconstruction/fmt/src/main/java/org/jlab/service/fmt/FMTEngine.java b/reconstruction/fmt/src/main/java/org/jlab/service/fmt/FMTEngine.java index edcb3f6468..053cdd47c9 100644 --- a/reconstruction/fmt/src/main/java/org/jlab/service/fmt/FMTEngine.java +++ b/reconstruction/fmt/src/main/java/org/jlab/service/fmt/FMTEngine.java @@ -72,7 +72,7 @@ public void detectorChanged(int runNumber) { } @Override - public boolean processDataEvent(DataEvent event) { + public boolean processDataEventUser(DataEvent event) { // Initial setup. if(debug) System.out.println("\nNew event"); diff --git a/reconstruction/ft/src/main/java/org/jlab/rec/ft/FTEBEngine.java b/reconstruction/ft/src/main/java/org/jlab/rec/ft/FTEBEngine.java index 4a81616a77..cc945eba13 100644 --- a/reconstruction/ft/src/main/java/org/jlab/rec/ft/FTEBEngine.java +++ b/reconstruction/ft/src/main/java/org/jlab/rec/ft/FTEBEngine.java @@ -61,7 +61,7 @@ public boolean init() { public void detectorChanged(int runNumber) {} @Override - public boolean processDataEvent(DataEvent event) { + public boolean processDataEventUser(DataEvent event) { int run = this.setRunConditionsParameters(event); if (run>=0) { @@ -376,10 +376,10 @@ public static void main(String arg[]){ // always print to keep track of running if(debugMode>-1) System.out.println("////////////// event read " + bankEvt + " - sequential number " + nev); //if(nev > 10239) System.exit(0); if(nev != 10239) continue; // stop at a given evt number - cal.processDataEvent(event); - hodo.processDataEvent(event); - trk.processDataEventAndGetClusters(event); - en.processDataEvent(event); + cal.processDataEventUser(event); + hodo.processDataEventUser(event); + trk.processDataEventAndGetClusters(event); + en.processDataEventUser(event); if(!event.hasBank("FTCAL::hits")) continue; if (event instanceof EvioDataEvent) { GenericKinematicFitter fitter = new GenericKinematicFitter(11); diff --git a/reconstruction/ft/src/main/java/org/jlab/rec/ft/cal/FTCALEngine.java b/reconstruction/ft/src/main/java/org/jlab/rec/ft/cal/FTCALEngine.java index c652b1fa43..21fcc0e3d1 100644 --- a/reconstruction/ft/src/main/java/org/jlab/rec/ft/cal/FTCALEngine.java +++ b/reconstruction/ft/src/main/java/org/jlab/rec/ft/cal/FTCALEngine.java @@ -51,7 +51,7 @@ public boolean init() { public void detectorChanged(int runNumber) {} @Override - public boolean processDataEvent(DataEvent event) { + public boolean processDataEventUser(DataEvent event) { List allHits = new ArrayList(); List selectedHits = new ArrayList(); List clusters = new ArrayList(); @@ -123,7 +123,7 @@ public static void main (String arg[]) { while(reader.hasEvent()){ // for(int nev=0; nev<2; nev++){ DataEvent event = (DataEvent) reader.getNextEvent(); - cal.processDataEvent(event); + cal.processDataEventUser(event); if(event instanceof EvioDataEvent) { GenericKinematicFitter fitter = new GenericKinematicFitter(11); diff --git a/reconstruction/ft/src/main/java/org/jlab/rec/ft/hodo/FTHODOEngine.java b/reconstruction/ft/src/main/java/org/jlab/rec/ft/hodo/FTHODOEngine.java index ac8a42f687..2b51115e5d 100644 --- a/reconstruction/ft/src/main/java/org/jlab/rec/ft/hodo/FTHODOEngine.java +++ b/reconstruction/ft/src/main/java/org/jlab/rec/ft/hodo/FTHODOEngine.java @@ -45,7 +45,7 @@ public boolean init() { public void detectorChanged(int runNumber) {} @Override - public boolean processDataEvent(DataEvent event) { + public boolean processDataEventUser(DataEvent event) { // update calibration constants based on run number if changed int run = setRunConditionsParameters(event); @@ -104,7 +104,7 @@ public static void main (String arg[]) { while(reader.hasEvent()){ DataEvent event = (DataEvent) reader.getNextEvent(); - cal.processDataEvent(event); + cal.processDataEventUser(event); DetectorEvent detectorEvent = DetectorData.readDetectorEvent(event); PhysicsEvent gen = detectorEvent.getGeneratedEvent(); diff --git a/reconstruction/ft/src/main/java/org/jlab/rec/ft/trk/FTTRKEngine.java b/reconstruction/ft/src/main/java/org/jlab/rec/ft/trk/FTTRKEngine.java index c8ffd09eb8..249ec4442a 100644 --- a/reconstruction/ft/src/main/java/org/jlab/rec/ft/trk/FTTRKEngine.java +++ b/reconstruction/ft/src/main/java/org/jlab/rec/ft/trk/FTTRKEngine.java @@ -61,7 +61,7 @@ public void detectorChanged(int runNumber) { } @Override - public boolean processDataEvent(DataEvent event) { + public boolean processDataEventUser(DataEvent event) { // update calibration constants based on run number if changed int run = setRunConditionsParameters(event); if(run>=0) { diff --git a/reconstruction/ft/src/test/java/org/jlab/service/ft/FTEBEngineTest.java b/reconstruction/ft/src/test/java/org/jlab/service/ft/FTEBEngineTest.java index 015f78b873..d7eaacec96 100644 --- a/reconstruction/ft/src/test/java/org/jlab/service/ft/FTEBEngineTest.java +++ b/reconstruction/ft/src/test/java/org/jlab/service/ft/FTEBEngineTest.java @@ -99,7 +99,7 @@ public boolean init() { } @Override - public boolean processDataEvent(DataEvent event) { + public boolean processDataEventUser(DataEvent event) { List FTparticles = new ArrayList(); List FTresponses = new ArrayList(); @@ -486,7 +486,7 @@ public static void main(String arg[]){ //if(nev > 10239) System.exit(0); if(nev != 10239) continue; // stop at a given evt number cal.processDataEvent(event); hodo.processDataEvent(event); - trk.processDataEventAndGetClusters(event); + trk.processDataEventAndGetClusters(event); en.processDataEvent(event); if(!event.hasBank("FTCAL::hits")) continue; if (event instanceof EvioDataEvent) { diff --git a/reconstruction/ft/src/test/java/org/jlab/service/ft/FTTRKEngineTest.java b/reconstruction/ft/src/test/java/org/jlab/service/ft/FTTRKEngineTest.java index 52ee4e9ac2..753f5faa0b 100644 --- a/reconstruction/ft/src/test/java/org/jlab/service/ft/FTTRKEngineTest.java +++ b/reconstruction/ft/src/test/java/org/jlab/service/ft/FTTRKEngineTest.java @@ -61,7 +61,7 @@ public boolean init() { } @Override - public boolean processDataEvent(DataEvent event) { + public boolean processDataEventUser(DataEvent event) { List allHits = new ArrayList(); ArrayList clusters = new ArrayList(); ArrayList crosses = new ArrayList(); diff --git a/reconstruction/htcc/src/main/java/org/jlab/service/htcc/HTCCReconstructionService.java b/reconstruction/htcc/src/main/java/org/jlab/service/htcc/HTCCReconstructionService.java index 0f8f9917ad..dcb7e68ab3 100644 --- a/reconstruction/htcc/src/main/java/org/jlab/service/htcc/HTCCReconstructionService.java +++ b/reconstruction/htcc/src/main/java/org/jlab/service/htcc/HTCCReconstructionService.java @@ -20,7 +20,7 @@ public HTCCReconstructionService(){ } @Override - public boolean processDataEvent(DataEvent event) { + public boolean processDataEventUser(DataEvent event) { int runNo = 10; if(event.hasBank("RUN::config")==true){ diff --git a/reconstruction/ltcc/src/main/java/org/jlab/service/ltcc/LTCCEngine.java b/reconstruction/ltcc/src/main/java/org/jlab/service/ltcc/LTCCEngine.java index 2c30003971..db518ddfdc 100644 --- a/reconstruction/ltcc/src/main/java/org/jlab/service/ltcc/LTCCEngine.java +++ b/reconstruction/ltcc/src/main/java/org/jlab/service/ltcc/LTCCEngine.java @@ -24,7 +24,7 @@ public LTCCEngine() { } @Override - public boolean processDataEvent(DataEvent event) { + public boolean processDataEventUser(DataEvent event) { if (DEBUG) event.show(); // only process the event if the LTCC bank is present if (event.hasBank("LTCC::adc")) { diff --git a/reconstruction/mc/src/main/java/org/jlab/service/mc/TruthMatch.java b/reconstruction/mc/src/main/java/org/jlab/service/mc/TruthMatch.java index dee68be30f..310c4788cd 100644 --- a/reconstruction/mc/src/main/java/org/jlab/service/mc/TruthMatch.java +++ b/reconstruction/mc/src/main/java/org/jlab/service/mc/TruthMatch.java @@ -46,7 +46,7 @@ public boolean init() { } @Override - public boolean processDataEvent(DataEvent event) { + public boolean processDataEventUser(DataEvent event) { if (event.hasBank("MC::True") == false) { return false; diff --git a/reconstruction/mltn/src/main/java/org/jlab/service/mltn/MLTDEngine.java b/reconstruction/mltn/src/main/java/org/jlab/service/mltn/MLTDEngine.java index d7a139ea82..fa6739c257 100644 --- a/reconstruction/mltn/src/main/java/org/jlab/service/mltn/MLTDEngine.java +++ b/reconstruction/mltn/src/main/java/org/jlab/service/mltn/MLTDEngine.java @@ -83,7 +83,7 @@ public boolean init() { public void detectorChanged(int runNumber) {} @Override - public boolean processDataEvent(DataEvent de) { + public boolean processDataEventUser(DataEvent de) { if(de.hasBank(inputBank)==true){ DataBank bank = de.getBank(inputBank); diff --git a/reconstruction/mltn/src/main/java/org/jlab/service/mltn/MLTNEngine.java b/reconstruction/mltn/src/main/java/org/jlab/service/mltn/MLTNEngine.java index 2617df06ac..fe6c62b715 100644 --- a/reconstruction/mltn/src/main/java/org/jlab/service/mltn/MLTNEngine.java +++ b/reconstruction/mltn/src/main/java/org/jlab/service/mltn/MLTNEngine.java @@ -34,7 +34,7 @@ public boolean init() { public void detectorChanged(int runNumber) {} @Override - public boolean processDataEvent(DataEvent de) { + public boolean processDataEventUser(DataEvent de) { if(de.hasBank("HitBasedTrkg::Clusters")==true){ DataBank bank = de.getBank("HitBasedTrkg::Clusters"); diff --git a/reconstruction/raster/src/main/java/org/jlab/service/raster/RasterEngine.java b/reconstruction/raster/src/main/java/org/jlab/service/raster/RasterEngine.java index 03d545b974..a407e7b361 100644 --- a/reconstruction/raster/src/main/java/org/jlab/service/raster/RasterEngine.java +++ b/reconstruction/raster/src/main/java/org/jlab/service/raster/RasterEngine.java @@ -51,7 +51,7 @@ public boolean init() { public void detectorChanged(int runNumber) {} @Override - public boolean processDataEvent(DataEvent event) { + public boolean processDataEventUser(DataEvent event) { // Read run number from RUN::config bank int run=-1; @@ -131,7 +131,7 @@ public static void main(String arg[]) { System.out.print("MC position read : " + MC_Part.getFloat("vx",0) +"\n"); // run the raster engine - engine.processDataEvent(event); + engine.processDataEventUser(event); // read the output bank and fill the histograms if(event.hasBank("RASTER::position")) { diff --git a/reconstruction/rich/src/main/java/org/jlab/rec/rich/RICHEBEngine.java b/reconstruction/rich/src/main/java/org/jlab/rec/rich/RICHEBEngine.java index d50d937ea0..faff8505dd 100644 --- a/reconstruction/rich/src/main/java/org/jlab/rec/rich/RICHEBEngine.java +++ b/reconstruction/rich/src/main/java/org/jlab/rec/rich/RICHEBEngine.java @@ -72,12 +72,12 @@ public void detectorChanged(int runNumber) { @Override // ---------------- - public boolean processDataEvent(DataEvent event) { + public boolean processDataEventUser(DataEvent event) { // ---------------- int debugMode = 0; - // create instances of all event-dependent classes in processDataEvent to avoid interferences between different threads when running in clara + // create instances of all event-dependent classes in processDataEventUser to avoid interferences between different threads when running in clara RICHEvent richevent = new RICHEvent(); RICHio richio = new RICHio(); RICHCalibration richcal = new RICHCalibration(); diff --git a/reconstruction/rtpc/src/main/java/org/jlab/service/rtpc/RTPCEngine.java b/reconstruction/rtpc/src/main/java/org/jlab/service/rtpc/RTPCEngine.java index eb91e33584..42a5316c93 100644 --- a/reconstruction/rtpc/src/main/java/org/jlab/service/rtpc/RTPCEngine.java +++ b/reconstruction/rtpc/src/main/java/org/jlab/service/rtpc/RTPCEngine.java @@ -95,7 +95,7 @@ public boolean init() { public void detectorChanged(int runNumber) {} @Override - public boolean processDataEvent(DataEvent event) { + public boolean processDataEventUser(DataEvent event) { HitParameters params = new HitParameters(); @@ -223,7 +223,7 @@ public static void main(String[] args){ while(reader.hasEvent()){ DataEvent event = reader.getNextEvent(); //if(eventcount == eventselect){ - en.processDataEvent(event); + en.processDataEventUser(event); writer.writeEvent(event); //}else if(eventcount > eventselect) break; eventcount ++; diff --git a/reconstruction/swaps/src/main/java/org/jlab/service/swaps/SwapEngine.java b/reconstruction/swaps/src/main/java/org/jlab/service/swaps/SwapEngine.java index 6e2b4914aa..5382dd90da 100644 --- a/reconstruction/swaps/src/main/java/org/jlab/service/swaps/SwapEngine.java +++ b/reconstruction/swaps/src/main/java/org/jlab/service/swaps/SwapEngine.java @@ -37,7 +37,7 @@ private void updateBank(int run,DataBank bank) { } @Override - public boolean processDataEvent(DataEvent event) { + public boolean processDataEventUser(DataEvent event) { DataBank bank = event.getBank("RUN::config"); final int run = bank.getInt("run",0); for (String detectorName : this.swapman.getDetectors()) { diff --git a/reconstruction/tof/src/main/java/org/jlab/service/ctof/CTOFEngine.java b/reconstruction/tof/src/main/java/org/jlab/service/ctof/CTOFEngine.java index 64abee57e5..c079a59686 100644 --- a/reconstruction/tof/src/main/java/org/jlab/service/ctof/CTOFEngine.java +++ b/reconstruction/tof/src/main/java/org/jlab/service/ctof/CTOFEngine.java @@ -75,7 +75,7 @@ public void detectorChanged(int runNumber) { } @Override - public boolean processDataEvent(DataEvent event) { + public boolean processDataEventUser(DataEvent event) { //setRunConditionsParameters( event) ; if(event.hasBank("RUN::config")==false ) { System.err.println("RUN CONDITIONS NOT READ!"); @@ -210,7 +210,7 @@ public static void main(String[] args) { counter++; DataEvent event = reader.getNextEvent(); - en.processDataEvent(event); + en.processDataEventUser(event); writer.writeEvent(event); if (counter > 3) { break; diff --git a/reconstruction/tof/src/main/java/org/jlab/service/ftof/FTOFEngine.java b/reconstruction/tof/src/main/java/org/jlab/service/ftof/FTOFEngine.java index 662d0e9d5d..eb08d82226 100644 --- a/reconstruction/tof/src/main/java/org/jlab/service/ftof/FTOFEngine.java +++ b/reconstruction/tof/src/main/java/org/jlab/service/ftof/FTOFEngine.java @@ -81,7 +81,7 @@ public void detectorChanged(int runNumber) { } @Override - public boolean processDataEvent(DataEvent event) { + public boolean processDataEventUser(DataEvent event) { if(event.hasBank("RUN::config")==false ) { System.err.println("RUN CONDITIONS NOT READ!"); return true; @@ -243,11 +243,11 @@ public static void main(String arg[]) { t1 = System.currentTimeMillis(); } - //en0.processDataEvent(event); + //en0.processDataEventUser(event); // if (counter > 3062) - //en0.processDataEvent(event); - //en1.processDataEvent(event); - en.processDataEvent(event); + //en0.processDataEventUser(event); + //en1.processDataEventUser(event); + en.processDataEventUser(event); System.out.println(" EVENT " + counter); //if (counter > 3066) // break; diff --git a/reconstruction/urwell/src/main/java/org/jlab/service/urwell/URWellEngine.java b/reconstruction/urwell/src/main/java/org/jlab/service/urwell/URWellEngine.java index 761cb30290..58c258dc61 100644 --- a/reconstruction/urwell/src/main/java/org/jlab/service/urwell/URWellEngine.java +++ b/reconstruction/urwell/src/main/java/org/jlab/service/urwell/URWellEngine.java @@ -55,7 +55,7 @@ public void detectorChanged(int runNumber) { } @Override - public boolean processDataEvent(DataEvent event) { + public boolean processDataEventUser(DataEvent event) { List strips = URWellStrip.getStrips(event, factory, this.getConstantsManager()); List clusters = URWellCluster.createClusters(strips); @@ -180,7 +180,7 @@ public static void main (String arg[]) { while(reader.hasEvent()) { DataEvent event = reader.getNextEvent(); - engine.processDataEvent(event); + engine.processDataEventUser(event); double xtrue = 0; double ytrue = 0; diff --git a/reconstruction/vtx/src/main/java/org/jlab/rec/service/vtx/VTXReconstruction.java b/reconstruction/vtx/src/main/java/org/jlab/rec/service/vtx/VTXReconstruction.java index 44eaaa1039..1db55889f4 100644 --- a/reconstruction/vtx/src/main/java/org/jlab/rec/service/vtx/VTXReconstruction.java +++ b/reconstruction/vtx/src/main/java/org/jlab/rec/service/vtx/VTXReconstruction.java @@ -55,7 +55,7 @@ private void initConstantsTables() { } @Override - public boolean processDataEvent(DataEvent event) { + public boolean processDataEventUser(DataEvent event) { this.FieldsConfig = this.getFieldsConfig(); if (event.hasBank("RUN::config") == false) { System.err.println("RUN CONDITIONS NOT READ!"); From a7c16c359d48a17d051a04a67111f27c867970ed Mon Sep 17 00:00:00 2001 From: Nathan Baltzell Date: Tue, 19 Sep 2023 13:23:05 -0400 Subject: [PATCH 21/37] make MLTDEngine respect run number like everyone else, unless overriden from YAML --- .../org/jlab/service/mltn/MLTDEngine.java | 65 ++++++------------- 1 file changed, 19 insertions(+), 46 deletions(-) diff --git a/reconstruction/mltn/src/main/java/org/jlab/service/mltn/MLTDEngine.java b/reconstruction/mltn/src/main/java/org/jlab/service/mltn/MLTDEngine.java index fa6739c257..e70e58a920 100644 --- a/reconstruction/mltn/src/main/java/org/jlab/service/mltn/MLTDEngine.java +++ b/reconstruction/mltn/src/main/java/org/jlab/service/mltn/MLTDEngine.java @@ -19,39 +19,37 @@ */ public class MLTDEngine extends ReconstructionEngine { - EJMLTrackNeuralNetwork network = null; private String networkFlavor = "default"; - private Integer networkRun = 5038; + private Integer userRunNumber = -1; private String inputBankPrefix = ""; private String outputBankPrefix = "ai"; private String inputBank = null; private String outputBank = null; - + private ArchiveProvider provider = null; + public MLTDEngine(){ super("MLTD","gavalian","1.0"); } @Override public boolean init() { - - //Set bank names inputBankPrefix = Optional.ofNullable(this.getEngineConfigString("inputBankPrefix")).orElse(""); outputBankPrefix = Optional.ofNullable(this.getEngineConfigString("outputBankPrefix")).orElse("ai"); inputBank = "HitBasedTrkg::"+inputBankPrefix+"Clusters"; outputBank = outputBankPrefix+"::tracks"; - networkFlavor = Optional.ofNullable(this.getEngineConfigString("flavor")).orElse("default"); - String runNumber = Optional.ofNullable(this.getEngineConfigString("run")).orElse("5038"); - networkRun = Integer.parseInt(runNumber); - + userRunNumber = Integer.valueOf(Optional.ofNullable(this.getEngineConfigString("run")).orElse("-1")); + return true; + } + + public boolean load(int run) { String path = CLASResources.getResourcePath("etc/ejml/ejmlclas12.network"); if(this.getEngineConfigString("network")!=null) path = this.getEngineConfigString("network"); System.out.println("[neural-network] info : Loading neural network from " + path); - network = new EJMLTrackNeuralNetwork(); - Map files = new HashMap(); + Map files = new HashMap<>(); files.put("classifier", "trackClassifier.network"); files.put("fixer", "trackFixer.network"); @@ -64,7 +62,7 @@ public boolean init() { //----- however it the provided run # it lower than anything //----- existing in the arhive, it will return the closest run //----- number entry. - int adjustedRun = provider.findEntry(networkRun); + int adjustedRun = provider.findEntry(run); String directory = String.format("network/%d/%s", adjustedRun, networkFlavor); network.initZip(path.trim(),directory, files); @@ -80,26 +78,20 @@ public boolean init() { } @Override - public void detectorChanged(int runNumber) {} + public void detectorChanged(int runNumber) { + if (userRunNumber < 0) { + load(runNumber); + } + else if (network == null) { + load(userRunNumber); + } + } @Override public boolean processDataEventUser(DataEvent de) { if(de.hasBank(inputBank)==true){ - DataBank bank = de.getBank(inputBank); - + DataBank bank = de.getBank(inputBank); HipoDataBank hipoBank = (HipoDataBank) bank; - - //classifier.processBank(hipoBank.getBank()); - - /*Clas12TrackAnalyzer analyzer = new Clas12TrackAnalyzer(); - for(int sector = 1; sector <=6; sector++){ - analyzer.readBank(hipoBank.getBank(), sector); - classifier.evaluate(analyzer.getCombinations()); - //analyzer.getCombinations().analyze(); - //System.out.println(analyzer.getCombinations()); - classifier.evaluate5(analyzer.getCombinationsPartial()); - analyzer.analyze(); - }*/ Clas12TrackFinder trackFinder = new Clas12TrackFinder(); trackFinder.setTrackingNetwork(network); trackFinder.process(hipoBank.getBank()); @@ -109,8 +101,6 @@ public boolean processDataEventUser(DataEvent de) { } public void writeBank(DataEvent event, ClusterCombinations combi){ - //ClusterCombinations combi = cl.getTracks(); - //System.out.println(">>> writing ai bank with entries = " + combi.getSize()); DataBank bank = event.createBank(outputBank, combi.getSize()); for(int i = 0; i < combi.getSize(); i++){ bank.setByte("id", i, (byte) (i+1)); @@ -123,25 +113,8 @@ public void writeBank(DataEvent event, ClusterCombinations combi){ bank.setShort("c"+order, i, (short) ids[c]); } } - //System.out.println("appending bank"); event.removeBank(outputBank); event.appendBank(bank); } - /*public void writeBank(DataEvent event, Clas12TrackClassifier cl){ - ClusterCombinations combi = cl.getTracks(); - //System.out.println(">>> writing ai bank with entries = " + combi.getSize()); - DataBank bank = event.createBank("ai::tracks", combi.getSize()); - for(int i = 0; i < combi.getSize(); i++){ - bank.setByte("id", i, (byte) (i+1)); - bank.setByte("sector", i, (byte) 1); - int[] ids = combi.getLabels(i); - for(int c = 0; c < 6; c++){ - int order = c+1; - bank.setShort("c"+order, i, (short) ids[c]); - } - } - //System.out.println("appending bank"); - event.appendBank(bank); - }*/ } From cd8d2cc5d9f4435964a1a05732d918da0b9531c2 Mon Sep 17 00:00:00 2001 From: Nathan Baltzell Date: Tue, 19 Sep 2023 13:47:01 -0400 Subject: [PATCH 22/37] add newly-required methods --- .../src/main/java/org/jlab/display/ec/ECRECMonitor.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/reconstruction/ec/src/main/java/org/jlab/display/ec/ECRECMonitor.java b/reconstruction/ec/src/main/java/org/jlab/display/ec/ECRECMonitor.java index 7d8d8fe68d..12cc5a4710 100644 --- a/reconstruction/ec/src/main/java/org/jlab/display/ec/ECRECMonitor.java +++ b/reconstruction/ec/src/main/java/org/jlab/display/ec/ECRECMonitor.java @@ -22,9 +22,12 @@ public class ECRECMonitor extends ReconstructionEngine { public ECRECMonitor(){ super("ECMon","gavalian","1.0"); } - + + @Override + public void detectorChanged(int runNumber) {} + @Override - public boolean processDataEvent(DataEvent event) { + public boolean processDataEventUser(DataEvent event) { if(event.hasBank("REC::Particle")==true){ DataBank bank = event.getBank("REC::Particle"); int index1 = this.index(bank, 22, 0); @@ -62,6 +65,7 @@ private int index(DataBank b, int pid, int skip){ } return -1; } + @Override public boolean init() { canvas = new TGCanvas("c","EC Engine Monitoring",500,500); From 3efa7ff2e37281eeeaeaa351b152331de19bb10e Mon Sep 17 00:00:00 2001 From: Nathan Baltzell Date: Tue, 19 Sep 2023 14:45:51 -0400 Subject: [PATCH 23/37] restore initialization --- .../mltn/src/main/java/org/jlab/service/mltn/MLTDEngine.java | 1 - 1 file changed, 1 deletion(-) diff --git a/reconstruction/mltn/src/main/java/org/jlab/service/mltn/MLTDEngine.java b/reconstruction/mltn/src/main/java/org/jlab/service/mltn/MLTDEngine.java index e70e58a920..32e1123aaa 100644 --- a/reconstruction/mltn/src/main/java/org/jlab/service/mltn/MLTDEngine.java +++ b/reconstruction/mltn/src/main/java/org/jlab/service/mltn/MLTDEngine.java @@ -26,7 +26,6 @@ public class MLTDEngine extends ReconstructionEngine { private String outputBankPrefix = "ai"; private String inputBank = null; private String outputBank = null; - private ArchiveProvider provider = null; public MLTDEngine(){ super("MLTD","gavalian","1.0"); From 37014f8a52187dd1b114d5557335df684c07c3ac Mon Sep 17 00:00:00 2001 From: Nathan Baltzell Date: Tue, 17 Oct 2023 12:27:54 -0400 Subject: [PATCH 24/37] allow run number override from YAML --- .../java/org/jlab/clas/reco/ReconstructionEngine.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/common-tools/clas-reco/src/main/java/org/jlab/clas/reco/ReconstructionEngine.java b/common-tools/clas-reco/src/main/java/org/jlab/clas/reco/ReconstructionEngine.java index 2e9277db1e..d9738af988 100644 --- a/common-tools/clas-reco/src/main/java/org/jlab/clas/reco/ReconstructionEngine.java +++ b/common-tools/clas-reco/src/main/java/org/jlab/clas/reco/ReconstructionEngine.java @@ -65,6 +65,8 @@ public abstract class ReconstructionEngine implements Engine { private boolean ignoreInvalidRunNumbers = true; + private int runNumberOverride = -1; + volatile long triggerMask = 0xFFFFFFFFFFFFFFFFL; String engineName = "UnknownEngine"; @@ -191,6 +193,9 @@ public EngineData configure(EngineData ed) { engineDictionary = new SchemaFactory(); LOGGER.log(Level.INFO,"--- engine configuration is called " + this.getDescription()); try { + if (this.getEngineConfigString("runNumberOverride")!=null) { + this.runNumberOverride = Integer.valueOf(this.getEngineConfigString("runNumberOverride")); + } if (this.getEngineConfigString("rawBankGroup")!=null) { this.rawBankOrders = RawBank.getFilterGroup(this.getEngineConfigString("rawBankGroup")); } @@ -343,9 +348,11 @@ public void dropBanks(DataEvent event) { } public synchronized boolean checkRunNumber(DataEvent event) { - int r = 0; - if (event.hasBank("RUN::config")) { + int r = runNumberOverride; + if (r <= 0 && event.hasBank("RUN::config")) { r = event.getBank("RUN::config").getInt("run",0); + } + if (r > 0) { if (this.runNumbers.isEmpty() || r != this.runNumbers.get(this.runNumbers.size()-1)) { this.runNumbers.add(r); this.detectorChanged(11); From f9121529bbc71d8fdef568188030593467d79106 Mon Sep 17 00:00:00 2001 From: Nathan Baltzell Date: Fri, 18 Oct 2024 14:46:11 -0400 Subject: [PATCH 25/37] add missing overrides --- .../src/main/java/org/jlab/service/bg/BackgroundEngine.java | 5 ++++- .../main/java/org/jlab/service/postproc/PostprocEngine.java | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/reconstruction/bg/src/main/java/org/jlab/service/bg/BackgroundEngine.java b/reconstruction/bg/src/main/java/org/jlab/service/bg/BackgroundEngine.java index 1cec83e1e0..0bb00115cb 100644 --- a/reconstruction/bg/src/main/java/org/jlab/service/bg/BackgroundEngine.java +++ b/reconstruction/bg/src/main/java/org/jlab/service/bg/BackgroundEngine.java @@ -40,6 +40,9 @@ public boolean init() { return true; } + @Override + public void detectorChanged(int run){} + public boolean init(String... filenames) { String detectors = getEngineConfigString(CONF_DETECTORS,"DC,FTOF"); String orders = getEngineConfigString(CONF_ORDERS,"NOMINAL"); @@ -52,7 +55,7 @@ public boolean init(String... filenames) { } @Override - public boolean processDataEvent(DataEvent event) { + public boolean processDataEventUser(DataEvent event) { return bgmerger.mergeEvents(event); } diff --git a/reconstruction/postproc/src/main/java/org/jlab/service/postproc/PostprocEngine.java b/reconstruction/postproc/src/main/java/org/jlab/service/postproc/PostprocEngine.java index 3a45e064a1..0aa6145e85 100644 --- a/reconstruction/postproc/src/main/java/org/jlab/service/postproc/PostprocEngine.java +++ b/reconstruction/postproc/src/main/java/org/jlab/service/postproc/PostprocEngine.java @@ -47,7 +47,10 @@ else if (getEngineConfigString(CONF_PRELOAD_DIR) != null) { } @Override - public boolean processDataEvent(DataEvent event) { + public void detectorChanged(int run) {} + + @Override + public boolean processDataEventUser(DataEvent event) { processor.processEvent(event); return true; } From 2661edd6837766458d690939cebbd5223c8e82f0 Mon Sep 17 00:00:00 2001 From: Nathan Baltzell Date: Fri, 18 Oct 2024 16:03:17 -0400 Subject: [PATCH 26/37] remove mc/data check --- .../ec/src/main/java/org/jlab/service/ec/ECCommon.java | 7 +------ .../ec/src/main/java/org/jlab/service/ec/ECEngine.java | 1 - 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/reconstruction/ec/src/main/java/org/jlab/service/ec/ECCommon.java b/reconstruction/ec/src/main/java/org/jlab/service/ec/ECCommon.java index eb85aa18dd..f8dd067894 100644 --- a/reconstruction/ec/src/main/java/org/jlab/service/ec/ECCommon.java +++ b/reconstruction/ec/src/main/java/org/jlab/service/ec/ECCommon.java @@ -42,7 +42,6 @@ public class ECCommon { public static int stripSortMethod = 0; public static int[] splitThresh = new int[3]; - public static Boolean isMC = false; public static Boolean debug = false; public static Boolean debugSplit = false; public static Boolean isSingleThreaded = false; @@ -149,11 +148,7 @@ public static int getRunNumber(DataEvent de) { public static List initEC(DataEvent event, ConstantsManager manager){ int run = getRunNumber(event); - - isMC = run<=100; - - if(isMC) {usePass2Timing = false; useDTCorrections = false; useFTpcal = false;} - + manager.setVariation(variation); IndexedTable atten1 = manager.getConstants(run, "/calibration/ec/attenuation"); diff --git a/reconstruction/ec/src/main/java/org/jlab/service/ec/ECEngine.java b/reconstruction/ec/src/main/java/org/jlab/service/ec/ECEngine.java index 2fcecad6ca..17759ac495 100644 --- a/reconstruction/ec/src/main/java/org/jlab/service/ec/ECEngine.java +++ b/reconstruction/ec/src/main/java/org/jlab/service/ec/ECEngine.java @@ -244,7 +244,6 @@ public void setSingleEvent(boolean val) { } public void setIsMC(boolean val) { - ECCommon.isMC = val; } public void setConfig(String val) { From f4eb9fadb52e398ea4161b6d5dae14ff37cc5437 Mon Sep 17 00:00:00 2001 From: Nathan Baltzell Date: Thu, 7 Nov 2024 14:38:26 -0500 Subject: [PATCH 27/37] test against gemc/dev --- validation/advanced-tests/run-eb-tests.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/validation/advanced-tests/run-eb-tests.sh b/validation/advanced-tests/run-eb-tests.sh index 6f2ba34d58..42df0d09bf 100755 --- a/validation/advanced-tests/run-eb-tests.sh +++ b/validation/advanced-tests/run-eb-tests.sh @@ -1,7 +1,7 @@ #!/bin/bash webDir=http://clasweb.jlab.org/clas12offline/distribution/coatjava/validation_files/eb -webVersion=5.10-fid-tm-r11 +webVersion=dev-fid-r11 webDir=$webDir/$webVersion # coatjava must already be built at ../../coatjava/ From 2a2118c5a7cf5234a6931878606485049b3e128a Mon Sep 17 00:00:00 2001 From: Nathan Baltzell Date: Fri, 3 Jan 2025 12:58:05 -0500 Subject: [PATCH 28/37] fix overrides (maintainence of never-ending PR) --- .../java/org/jlab/clas/service/PulseExtractorEngine.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/common-tools/clas-reco/src/main/java/org/jlab/clas/service/PulseExtractorEngine.java b/common-tools/clas-reco/src/main/java/org/jlab/clas/service/PulseExtractorEngine.java index caf6702f20..dec12e0f44 100644 --- a/common-tools/clas-reco/src/main/java/org/jlab/clas/service/PulseExtractorEngine.java +++ b/common-tools/clas-reco/src/main/java/org/jlab/clas/service/PulseExtractorEngine.java @@ -28,7 +28,7 @@ public boolean init() { } @Override - public boolean processDataEvent(DataEvent event) { + public boolean processDataEventUser(DataEvent event) { // No CCDB table, hardcoded parameters in the extractor: mode3.update(6, null, event, "BMT::wf", "BMT::adc"); @@ -47,4 +47,7 @@ public boolean processDataEvent(DataEvent event) { return true; } + @Override + public void detectorChanged(int runNumber) {} + } From 9101ba9a21524e877ebd83b199bce1f773b5363d Mon Sep 17 00:00:00 2001 From: Nathan Baltzell Date: Fri, 3 Jan 2025 13:14:49 -0500 Subject: [PATCH 29/37] processDataEvent should be final --- .../src/main/java/org/jlab/clas/reco/ReconstructionEngine.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common-tools/clas-reco/src/main/java/org/jlab/clas/reco/ReconstructionEngine.java b/common-tools/clas-reco/src/main/java/org/jlab/clas/reco/ReconstructionEngine.java index d9738af988..a4c4943508 100644 --- a/common-tools/clas-reco/src/main/java/org/jlab/clas/reco/ReconstructionEngine.java +++ b/common-tools/clas-reco/src/main/java/org/jlab/clas/reco/ReconstructionEngine.java @@ -361,7 +361,7 @@ public synchronized boolean checkRunNumber(DataEvent event) { return !this.ignoreInvalidRunNumbers || r>0; } - public void processDataEvent(DataEvent dataEvent) { + public final void processDataEvent(DataEvent dataEvent) { if (!this.wroteConfig) { this.wroteConfig = true; JsonUtils.extend(dataEvent, CONFIG_BANK_NAME, "json", this.generateConfig()); From b456000ba85d1f02cd5e314434f208052a2df872 Mon Sep 17 00:00:00 2001 From: Nathan Baltzell Date: Fri, 3 Jan 2025 15:34:40 -0500 Subject: [PATCH 30/37] cleanup script --- validation/advanced-tests/run-eb-tests.sh | 144 +++------------------- 1 file changed, 16 insertions(+), 128 deletions(-) diff --git a/validation/advanced-tests/run-eb-tests.sh b/validation/advanced-tests/run-eb-tests.sh index 42df0d09bf..9a3dcc3ed5 100755 --- a/validation/advanced-tests/run-eb-tests.sh +++ b/validation/advanced-tests/run-eb-tests.sh @@ -1,33 +1,14 @@ #!/bin/bash +# WARNING: coatjava must already be built at ../../coatjava/ + +set -e webDir=http://clasweb.jlab.org/clas12offline/distribution/coatjava/validation_files/eb webVersion=dev-fid-r11 webDir=$webDir/$webVersion - -# coatjava must already be built at ../../coatjava/ - -# whether to use CLARA (0=no) -useClara=0 - -# if non-zero, don't redownload dependencies, don't run reconstruction: runTestOnly=0 -# gemc default solenoid (changed in 4a.2.4): -gemcSolenoidDefault=-1.0 -if [[ $webVersion = *"4a.2.2"* ]] || [[ $webVersion = *"4a.2.3"* ]] -then - gemcSolenoidDefault=1.0 -fi - -# geometry variation for DC -geoDbVariation="default" -if [[ $webVersion = *"4a.2.2"* ]] || [[ $webVersion = *"4a.2.3"* ]] || [[ $webVersion = *"4a.2.4"* ]] -then - geoDbVariation="dc_geo_gemc424" -fi - -nEvents=-1 - +# check command-line options: for arg in $@ do if [ "$arg" == "-t" ] @@ -42,120 +23,27 @@ done # last argument is input file stub: stub="${@: -1}" -# sanity check on filestub name, -# just to error with reasonable message before proceeding: -case $stub in - # electron in forward, hadron in forward: - electronproton) - ;; - electronkaon) - ;; - electronpion) - ;; - electrongamma) - ;; - electronneutron) - ;; - electronFTproton) - ;; - electronFTkaon) - ;; - electronFTpion) - ;; - electronFTgamma) - ;; - electrongammaFT) - ;; - electronprotonC) - ;; - electronkaonC) - ;; - electronpionC) - ;; - electrongammaC) - ;; - electronneutronC) - ;; - electrondeuteronC) - ;; - *) - echo Invalid input evio file: $stub - exit 1 -esac +# check stub validity: +! grep "^$stub -pid" src/eb/scripts/list.txt && echo Invalid stub: $stub && exit 1 # set up environment -if [ $useClara -eq 0 ] -then - COAT=../../coatjava - source $COAT/libexec/env.sh -else - CLARA_HOME=$PWD/clara_installation/ - COAT=$CLARA_HOME/plugins/clas12/ - export CLARA_HOME -fi +coatjava=../../coatjava +source $coatjava/libexec/env.sh +classPath="$coatjava/lib/services/*:$coatjava/lib/clas/*:$coatjava/lib/utils/*:../lib/*:src/" -classPath="$COAT/lib/services/*:$COAT/lib/clas/*:$COAT/lib/utils/*:../lib/*:src/" - -classPath2="../../coatjava/lib/services/*:../../coatjava/lib/clas/*:../../coatjava/lib/utils/*:../lib/*:src/" - -# make sure test code compiles before anything else: -javac -cp $classPath2 src/eb/EBTwoTrackTest.java -if [ $? != 0 ] ; then echo "EBTwoTrackTest compilation failure" ; exit 1 ; fi +# make sure test code compiles first: +javac -cp $classPath src/eb/EBTwoTrackTest.java # download and setup dependencies, run reconstruction: if [ $runTestOnly -eq 0 ] then - - if ! [ $useClara -eq 0 ] - then - # tar the local coatjava build so it can be installed with clara - cd ../.. - tar -zcvf coatjava-local.tar.gz coatjava - mv coatjava-local.tar.gz validation/advanced-tests/ - cd - - - # install clara - if ! [ -d clara_installation ] - then - ../../install-clara clara_installation - fi - fi - - # download test files, if necessary: wget -N --no-check-certificate $webDir/${stub}.hipo - if [ $? != 0 ] ; then echo "wget validation files failure" ; exit 1 ; fi - - # update the schema dictionary: (no longer necessary now that recon-util does it) - #rm -f up_${stub}.hipo - #../../coatjava/bin/hipo-utils -update -d ../../coatjava/etc/bankdefs/hipo4/ -o up_${stub}.hipo ${stub}.hipo - - # run reconstruction: rm -f out_${stub}.hipo - if [ $useClara -eq 0 ] - then - GEOMDBVAR=$geoDbVariation - export GEOMDBVAR - ../../coatjava/bin/recon-util -i ${stub}.hipo -o out_${stub}.hipo -c 2 - else - echo "set inputDir $PWD/" > cook.clara - echo "set outputDir $PWD/" >> cook.clara - echo "set threads 7" >> cook.clara - echo "set javaMemory 2" >> cook.clara - echo "set session s_cook" >> cook.clara - echo "set description d_cook" >> cook.clara - ls ${stub}.hipo > files.list - echo "set fileList $PWD/files.list" >> cook.clara - echo "run local" >> cook.clara - echo "exit" >> cook.clara - $CLARA_HOME/bin/clara-shell cook.clara - fi + export GEOMDBVAR=default + ../../coatjava/bin/recon-util -i ${stub}.hipo -o out_${stub}.hipo -c 2 fi -# run Event Builder tests: -java -DCLAS12DIR="$COAT" -Xmx1536m -Xms1024m -cp $classPath2 -DINPUTFILE=out_${stub}.hipo org.junit.runner.JUnitCore eb.EBTwoTrackTest -if [ $? != 0 ] ; then echo "EBTwoTrackTest unit test failure" ; exit 1 ; else echo "EBTwoTrackTest passed unit tests" ; fi - -$COAT/bin/trutheff ./out_${stub}.hipo - -exit 0 +# run tests: +$coatjava/bin/trutheff ./out_${stub}.hipo +java -DCLAS12DIR="$coatjava" -Xmx1536m -Xms1024m -cp $classPath -DINPUTFILE=out_${stub}.hipo org.junit.runner.JUnitCore eb.EBTwoTrackTest From 00351701da90c595d4d962a64a4f198eb6f15a8f Mon Sep 17 00:00:00 2001 From: Nathan Baltzell Date: Fri, 3 Jan 2025 15:50:38 -0500 Subject: [PATCH 31/37] remove unused/unnecessary script --- validation/advanced-tests/run-eb-tests-all.sh | 16 ---------------- 1 file changed, 16 deletions(-) delete mode 100755 validation/advanced-tests/run-eb-tests-all.sh diff --git a/validation/advanced-tests/run-eb-tests-all.sh b/validation/advanced-tests/run-eb-tests-all.sh deleted file mode 100755 index ccd5116fd8..0000000000 --- a/validation/advanced-tests/run-eb-tests-all.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/sh -# -# This runs all existing EB tests. -# Requires about 10 minutes to fully succeed (single-threaded), else aborts ASAP. -# - -for xx in `awk '{print$1}' src/eb/scripts/list.txt` -do - ./run-eb-tests.sh -100 $xx - if [ $? != 0 ] - then - echo run-eb-tests.sh: failed on $xx - exit - fi -done - From 9bf356a47df63641f5cb69e8bc1a3425bd8f4591 Mon Sep 17 00:00:00 2001 From: Nathan Baltzell Date: Fri, 3 Jan 2025 15:55:56 -0500 Subject: [PATCH 32/37] disable workflow for now --- .github/workflows/validation.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/validation.yml b/.github/workflows/validation.yml index 6c42d6d924..02c60c97e4 100644 --- a/.github/workflows/validation.yml +++ b/.github/workflows/validation.yml @@ -8,6 +8,7 @@ on: workflow_dispatch: jobs: + if: false validation: uses: JeffersonLab/clas12-validation/.github/workflows/ci.yml@main with: From 544b65ba7ede3dccc58ddc928e2a10e4988f4136 Mon Sep 17 00:00:00 2001 From: Nathan Baltzell Date: Fri, 3 Jan 2025 17:54:52 -0500 Subject: [PATCH 33/37] shorter name, for github web display --- .github/workflows/maven.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index 5fa3267f7a..055071482c 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -68,7 +68,7 @@ jobs: # tests ############################################################################# - test_coatjava: + pid: needs: [ build ] strategy: fail-fast: true From f1627c7b304569439eca36fb05303c6e88a4b179 Mon Sep 17 00:00:00 2001 From: Nathan Baltzell Date: Fri, 3 Jan 2025 17:57:00 -0500 Subject: [PATCH 34/37] add neutron test --- .github/workflows/maven.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index 055071482c..bd2597153d 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -78,14 +78,16 @@ jobs: id: - kpp - eb-ep + - eb-en - eb-eg - eb-epc - eb-enc - eb-eftpi include: - # run all tests on ubuntu + # run selected tests on ubuntu - { id: kpp, cmd: ./run-advanced-tests.sh } - { id: eb-ep, cmd: ./run-eb-tests.sh -100 electronproton } + - { id: eb-en, cmd: ./run-eb-tests.sh -100 electronneutron } - { id: eb-eg, cmd: ./run-eb-tests.sh -100 electrongamma } - { id: eb-epc, cmd: ./run-eb-tests.sh -100 electronprotonC } - { id: eb-enc, cmd: ./run-eb-tests.sh -100 electronneutronC } From b6c5fee2250cfce8f642747c3d2b3bb4c85d5545 Mon Sep 17 00:00:00 2001 From: Nathan Baltzell Date: Wed, 8 Jan 2025 09:51:41 -0500 Subject: [PATCH 35/37] remove leftovers --- validation/advanced-tests/src/eb/scripts/gemc.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/validation/advanced-tests/src/eb/scripts/gemc.sh b/validation/advanced-tests/src/eb/scripts/gemc.sh index a721a35b1a..6758988613 100755 --- a/validation/advanced-tests/src/eb/scripts/gemc.sh +++ b/validation/advanced-tests/src/eb/scripts/gemc.sh @@ -64,8 +64,7 @@ function run_gemc () { for p in "${particles[@]}" do - [ -z ${multithread+} ] && args= || args=-m - run_gemc -r $run -g $gemc -n $nevents -c $gcard -i $p.txt -o $p.hipo $args + run_gemc -r $run -g $gemc -n $nevents -c $gcard -i $p.txt -o $p.hipo done [ -z ${multithread+x} ] || wait From 36f749a4dadd071cbc51fe5a1b2c57ece4c8db4f Mon Sep 17 00:00:00 2001 From: Nathan Baltzell Date: Wed, 8 Jan 2025 19:14:22 -0500 Subject: [PATCH 36/37] abort on error --- validation/advanced-tests/src/eb/scripts/gemc.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/validation/advanced-tests/src/eb/scripts/gemc.sh b/validation/advanced-tests/src/eb/scripts/gemc.sh index 6758988613..0c78304594 100755 --- a/validation/advanced-tests/src/eb/scripts/gemc.sh +++ b/validation/advanced-tests/src/eb/scripts/gemc.sh @@ -1,5 +1,7 @@ #!/bin/sh +set -e + usage() { echo "Usage: $0 [-g GEMC] [-n NEV] [-p PARTS] [-c GCARD] [-m]" 1>&2; exit $1; } run=11 From 7e0a6b47e793c3f1c4f6208d10d2dddbbbe45175 Mon Sep 17 00:00:00 2001 From: Nathan Baltzell Date: Thu, 9 Jan 2025 13:43:10 -0500 Subject: [PATCH 37/37] ci bugfix --- .github/workflows/maven.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index bd2597153d..0cd3983499 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -138,7 +138,7 @@ jobs: final: needs: - build - - test_coatjava + - pid - test_run-groovy runs-on: ubuntu-latest steps: