diff --git a/.gitignore b/.gitignore
index b36994d9a6..1a1360a8fa 100644
--- a/.gitignore
+++ b/.gitignore
@@ -33,4 +33,7 @@ hs_err_pid*
# no log files:
*.log
+*.evio
+bin/evio2hipotest
+export.sh
\ No newline at end of file
diff --git a/.travis.yml b/.travis.yml
index c86c4a70da..ac345fa687 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -5,13 +5,12 @@ sudo: required
language: java
jdk:
- - oraclejdk9
+ - openjdk11
-# this affects which java version is used:
addons:
apt:
packages:
- - oracle-java9-installer
+ - openjfx
before_install:
- ls -lthra
@@ -32,6 +31,7 @@ script:
- ./run-eb-tests.sh -100 electrongamma || travis_terminate 1;
- ./run-eb-tests.sh -100 electronprotonC || travis_terminate 1;
- ./run-eb-tests.sh -100 electronneutronC || travis_terminate 1;
+ - ./run-eb-tests.sh -100 electronFTpion || travis_terminate 1;
- cd -
- echo "finished advanced tests"
# - mvn cobertura:cobertura &> /dev/null # for codecov
diff --git a/bin.old/calibration b/bin.old/calibration
new file mode 100755
index 0000000000..f30041ab7f
--- /dev/null
+++ b/bin.old/calibration
@@ -0,0 +1,5 @@
+#!/bin/sh -f
+
+source `dirname $0`/env.sh
+
+java -XX:+UseSerialGC -Xmx2048m -Xms2048m -cp "$CLAS12DIR/lib/clas/*:$CLAS12DIR/lib/plugins/*" org.jlab.calib.services.TOFCalibration $*
diff --git a/bin/clara-rec b/bin.old/clara-rec
similarity index 100%
rename from bin/clara-rec
rename to bin.old/clara-rec
diff --git a/bin.old/convertor b/bin.old/convertor
new file mode 100755
index 0000000000..650ae2470e
--- /dev/null
+++ b/bin.old/convertor
@@ -0,0 +1,5 @@
+#!/bin/sh -f
+
+source `dirname $0`/env.sh
+
+java -Xms1024m -cp "$CLAS12DIR/lib/clas/*:$CLAS12DIR/lib/plugins/*" org.jlab.clas.reco.io.HipoConvertor $*
diff --git a/bin.old/ddr b/bin.old/ddr
new file mode 100755
index 0000000000..759fe005d9
--- /dev/null
+++ b/bin.old/ddr
@@ -0,0 +1,5 @@
+#!/bin/sh -f
+
+source `dirname $0`/env.sh
+
+java -Xms1024m -cp "$CLAS12DIR/lib/clas/*:$CLAS12DIR/lib/plugins/*" org.jlab.clas.service.DataDistributionService -type et -host localhost -file /tmp/et_sys_$SESSION
diff --git a/bin.old/decoder-debugger b/bin.old/decoder-debugger
new file mode 100755
index 0000000000..0d613a4ec7
--- /dev/null
+++ b/bin.old/decoder-debugger
@@ -0,0 +1,8 @@
+#!/bin/bash
+
+# This doesn't work in dash (Travis's /bin/sh):
+source `dirname $0`/env.sh
+
+MALLOC_ARENA_MAX=1; export MALLOC_ARENA_MAX
+
+java -Xmx1536m -Xms1024m -cp "$CLAS12DIR/lib/clas/*:$CLAS12DIR/lib/plugins/*" org.jlab.detector.decode.DetectorDecoderDebug $*
diff --git a/bin.old/decoder3 b/bin.old/decoder3
new file mode 100755
index 0000000000..2f968b71c6
--- /dev/null
+++ b/bin.old/decoder3
@@ -0,0 +1,7 @@
+#!/bin/bash
+
+source `dirname $0`/env.sh
+
+MALLOC_ARENA_MAX=1; export MALLOC_ARENA_MAX
+
+java -Xmx1536m -Xms1024m -cp "$CLAS12DIR/lib/clas/*:$CLAS12DIR/lib/plugins/*" org.jlab.detector.decode.CLASDecoder $*
diff --git a/bin.old/grid b/bin.old/grid
new file mode 100755
index 0000000000..1b5ffbb7c3
--- /dev/null
+++ b/bin.old/grid
@@ -0,0 +1,5 @@
+#!/bin/sh -f
+
+source `dirname $0`/env.sh
+
+java -Xms1024m -cp "$CLAS12DIR/lib/clas/*:$CLAS12DIR/lib/plugins/*" org.jlab.groot.matrix.SparseGridIO $*
diff --git a/bin.old/hipo-writer b/bin.old/hipo-writer
new file mode 100755
index 0000000000..6ac8133e92
--- /dev/null
+++ b/bin.old/hipo-writer
@@ -0,0 +1,5 @@
+#!/bin/sh -f
+
+source `dirname $0`/env.sh
+
+java -Xms1024m -cp "$CLAS12DIR/lib/clas/*:$CLAS12DIR/lib/plugins/*" org.jlab.io.utils.Evio2HipoConverter $*
diff --git a/bin.old/hipo3utils b/bin.old/hipo3utils
new file mode 100755
index 0000000000..5fe21358d5
--- /dev/null
+++ b/bin.old/hipo3utils
@@ -0,0 +1,7 @@
+#!/bin/sh -f
+
+source `dirname $0`/env.sh
+
+MALLOC_ARENA_MAX=1; export MALLOC_ARENA_MAX
+
+java -Xmx2048m -Xms1024m -cp "$CLAS12DIR/lib/clas/*:$CLAS12DIR/lib/plugins/*" org.jlab.jnp.hipo.utils.HipoUtilities $*
diff --git a/bin.old/rec-monitor b/bin.old/rec-monitor
new file mode 100755
index 0000000000..2641c037aa
--- /dev/null
+++ b/bin.old/rec-monitor
@@ -0,0 +1,5 @@
+#!/bin/sh -f
+
+source `dirname $0`/env.sh
+
+java -Xms1024m -cp "$CLAS12DIR/lib/clas/*:$CLAS12DIR/lib/plugins/*" org.jlab.monitor.eb.ReconstructionMonitor $*
diff --git a/bin.old/studio b/bin.old/studio
new file mode 100755
index 0000000000..39a00e472a
--- /dev/null
+++ b/bin.old/studio
@@ -0,0 +1,5 @@
+#!/bin/sh -f
+
+source `dirname $0`/env.sh
+
+java -Xms1024m -Xmx2048m -cp "$CLAS12DIR/lib/clas/*:$CLAS12DIR/lib/plugins/*" org.jlab.clas.physics.EventTree $*
diff --git a/bin.old/update b/bin.old/update
new file mode 100755
index 0000000000..ac4a0d5f98
--- /dev/null
+++ b/bin.old/update
@@ -0,0 +1,9 @@
+#!/bin/sh -f
+
+source `dirname $0`/env.sh
+
+java -cp "$CLAS12DIR/lib/clas/*:$CLAS12DIR/lib/utils/*:$CLAS12DIR/lib/plugins/*" org.jlab.clas.update.UpdateManager link http://clasweb.jlab.org/clas12maven/org/jlab/coat/coat-libs/3.0-SNAPSHOT/ coat-libs-3.0-SNAPSHOT.jar $CLAS12DIR/lib/clas
+
+java -cp "$CLAS12DIR/lib/clas/*:$CLAS12DIR/lib/utils/*:$CLAS12DIR/lib/plugins/*" org.jlab.clas.update.UpdateManager link https://userweb.jlab.org/~devita/kpp/ KPP-Plots-1.0.jar $CLAS12DIR/lib/utils
+
+java -cp "$CLAS12DIR/lib/clas/*:$CLAS12DIR/lib/utils/*:$CLAS12DIR/lib/plugins/*" org.jlab.clas.update.UpdateManager link https://userweb.jlab.org/~devita/kpp/ KPP-Monitoring-1.0.jar $CLAS12DIR/lib/utils
diff --git a/bin.old/x-client b/bin.old/x-client
new file mode 100755
index 0000000000..e51c06ea1f
--- /dev/null
+++ b/bin.old/x-client
@@ -0,0 +1,5 @@
+#!/bin/sh -f
+
+source `dirname $0`/env.sh
+
+java -Xms1024m -cp "$CLAS12DIR/lib/clas/*:$CLAS12DIR/lib/plugins/*" org.jlab.io.hipo.HipoRingSource $*
diff --git a/bin.old/x-client-evio b/bin.old/x-client-evio
new file mode 100755
index 0000000000..f873691079
--- /dev/null
+++ b/bin.old/x-client-evio
@@ -0,0 +1,5 @@
+#!/bin/sh -f
+
+source `dirname $0`/env.sh
+
+java -Xms1024m -cp "$CLAS12DIR/lib/clas/*:$CLAS12DIR/lib/plugins/*" org.jlab.io.evio.EvioRingSource $*
diff --git a/bin.old/x-server b/bin.old/x-server
new file mode 100755
index 0000000000..5dc9385ea6
--- /dev/null
+++ b/bin.old/x-server
@@ -0,0 +1,5 @@
+#!/bin/sh -f
+
+source `dirname $0`/env.sh
+
+java -Xms1024m -cp "$CLAS12DIR/lib/clas/*:$CLAS12DIR/lib/plugins/*" org.jlab.clas.service.DataDistributionService $*
diff --git a/bin/analyzer b/bin/analyzer
deleted file mode 100755
index 446f4ba71b..0000000000
--- a/bin/analyzer
+++ /dev/null
@@ -1,19 +0,0 @@
-#!/bin/sh -f
-
-source `dirname $0`/env.sh
-
-#CLARA_HOME=`dirname $0`
-#CLARA_SERVICES=`dirname $0`
-#DATAMINING=`dirname $0`
-
-echo +-------------------------------------------------------------------------
-echo "| Starting CLARA-PLATFORM with CLARA_SERVICES = " $CLARA_SERVICES
-echo +-------------------------------------------------------------------------
-echo "\n"
-
-echo "INSTALLATION DIRECTORY = " $CLARA_HOME
-echo "LIBRARY DIRECTORY = " $DATAMINING/lib/clas/
-
-#java -cp "$DATAMINING/lib/clas/core/*" org.jlab.coda.eventViewer.EventTreeFrame $*
-#java -Xms1024m -cp "$DATAMINING/lib/clas/*:$DATAMINING/lib/plugins/*" org.jlab.io.hipo.HipoDataSync $*
-java -Xms1024m -cp "$DATAMINING/lib/clas/*:$DATAMINING/lib/plugins/*" org.jlab.clas.physics.DataAnalysis $*
diff --git a/bin/bos2hipo b/bin/bos2hipo
index 5b2b9141f6..4730acd9d1 100755
--- a/bin/bos2hipo
+++ b/bin/bos2hipo
@@ -2,18 +2,4 @@
source `dirname $0`/env.sh
-#CLARA_HOME=`dirname $0`
-#CLARA_SERVICES=`dirname $0`
-#DATAMINING=`dirname $0`
-
-echo +-------------------------------------------------------------------------
-echo "| Starting CLARA-PLATFORM with CLARA_SERVICES = " $CLARA_SERVICES
-echo +-------------------------------------------------------------------------
-echo "\n"
-
-echo "INSTALLATION DIRECTORY = " $CLARA_HOME
-echo "LIBRARY DIRECTORY = " $DATAMINING/lib/clas/
-
-#java -cp "$DATAMINING/lib/clas/core/*" org.jlab.coda.eventViewer.EventTreeFrame $*
-#java -Xms1024m -cp "$DATAMINING/lib/clas/*:$DATAMINING/lib/plugins/*" org.jlab.io.hipo.HipoDataSync $*
-java -Xms1024m -cp "$DATAMINING/lib/clas/*:$DATAMINING/lib/plugins/*" org.jlab.io.utils.Bos2HipoEventBank $*
+java -Xms1024m -cp "$CLAS12DIR/lib/clas/*:$CLAS12DIR/lib/plugins/*" org.jlab.io.utils.Bos2HipoEventBank $*
diff --git a/bin/browser b/bin/browser
deleted file mode 100755
index 1b2bce5c31..0000000000
--- a/bin/browser
+++ /dev/null
@@ -1,18 +0,0 @@
-#!/bin/sh -f
-
-source `dirname $0`/env.sh
-
-#CLARA_HOME=`dirname $0`
-#CLARA_SERVICES=`dirname $0`
-#DATAMINING=`dirname $0`
-
-echo +-------------------------------------------------------------------------
-echo "| Starting CLARA-PLATFORM with CLARA_SERVICES = " $CLARA_SERVICES
-echo +-------------------------------------------------------------------------
-echo "\n"
-
-echo "INSTALLATION DIRECTORY = " $CLARA_HOME
-echo "LIBRARY DIRECTORY = " $DATAMINING/lib/clas/
-
-#java -cp "$DATAMINING/lib/clas/core/*" org.jlab.coda.eventViewer.EventTreeFrame $*
-java -Xms1024m -cp "$DATAMINING/lib/clas/*:$DATAMINING/lib/plugins/*" org.jlab.groot.ui.TBrowser $*
diff --git a/bin/calibration b/bin/calibration
deleted file mode 100755
index 091339cd42..0000000000
--- a/bin/calibration
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/bin/sh -f
-
-source `dirname $0`/env.sh
-
-#CLARA_HOME=`dirname $0`
-#CLARA_SERVICES=`dirname $0`
-#DATAMINING=`dirname $0`
-
-echo +-------------------------------------------------------------------------
-echo "| Starting CLARA-PLATFORM with CLARA_SERVICES = " $CLARA_SERVICES
-echo +-------------------------------------------------------------------------
-echo "\n"
-
-echo "INSTALLATION DIRECTORY = " $CLARA_HOME
-echo "LIBRARY DIRECTORY = " $DATAMINING/lib/clas/
-
-#java -cp "$DATAMINING/lib/clas/core/*" org.jlab.coda.eventViewer.EventTreeFrame $*
-#java -XX:+UseSerialGC -Xms1024m -cp "$DATAMINING/lib/clas/*:$DATAMINING/lib/plugins/*" org.jlab.clasrec.rec.CLASReconstruction $*
-#java -XX:+UseSerialGC -Xmx2048m -Xms2048m -cp "$DATAMINING/lib/clas/*:$DATAMINING/lib/plugins/*" org.jlab.detector.calib.tasks.CalibrationEngineTask $*
-java -XX:+UseSerialGC -Xmx2048m -Xms2048m -cp "$DATAMINING/lib/clas/*:$DATAMINING/lib/plugins/*" org.jlab.calib.services.TOFCalibration $*
diff --git a/bin/convertor b/bin/convertor
deleted file mode 100755
index 76a9afed03..0000000000
--- a/bin/convertor
+++ /dev/null
@@ -1,19 +0,0 @@
-#!/bin/sh -f
-
-source `dirname $0`/env.sh
-
-#CLARA_HOME=`dirname $0`
-#CLARA_SERVICES=`dirname $0`
-#DATAMINING=`dirname $0`
-
-echo +-------------------------------------------------------------------------
-echo "| Starting CLARA-PLATFORM with CLARA_SERVICES = " $CLARA_SERVICES
-echo +-------------------------------------------------------------------------
-echo "\n"
-
-echo "INSTALLATION DIRECTORY = " $CLARA_HOME
-echo "LIBRARY DIRECTORY = " $DATAMINING/lib/clas/
-
-#java -cp "$DATAMINING/lib/clas/core/*" org.jlab.coda.eventViewer.EventTreeFrame $*
-#java -Xms1024m -cp "$DATAMINING/lib/clas/*:$DATAMINING/lib/plugins/*" org.jlab.io.hipo.HipoDataSync $*
-java -Xms1024m -cp "$DATAMINING/lib/clas/*:$DATAMINING/lib/plugins/*" org.jlab.clas.reco.io.HipoConvertor $*
diff --git a/bin/daq-monitor b/bin/daq-monitor
deleted file mode 100755
index 55be7c9ae0..0000000000
--- a/bin/daq-monitor
+++ /dev/null
@@ -1,18 +0,0 @@
-#!/bin/sh -f
-
-source `dirname $0`/env.sh
-
-#CLARA_HOME=`dirname $0`
-#CLARA_SERVICES=`dirname $0`
-#DATAMINING=`dirname $0`
-
-echo +-------------------------------------------------------------------------
-echo "| Starting CLARA-PLATFORM with CLARA_SERVICES = " $CLARA_SERVICES
-echo +-------------------------------------------------------------------------
-echo "\n"
-
-echo "INSTALLATION DIRECTORY = " $CLARA_HOME
-echo "LIBRARY DIRECTORY = " $DATAMINING/lib/clas/
-
-#java -cp "$DATAMINING/lib/clas/core/*" org.jlab.coda.eventViewer.EventTreeFrame $*
-java -Xms1024m -cp "$DATAMINING/lib/clas/*:$DATAMINING/lib/services/*:$DATAMINING/lib/utils/*" org.jlab.detector.examples.DaqPulsePlotter $*
diff --git a/bin/daqEventViewer b/bin/daqEventViewer
index 6ad1aaa55d..b91ebbfbc4 100755
--- a/bin/daqEventViewer
+++ b/bin/daqEventViewer
@@ -2,17 +2,4 @@
source `dirname $0`/env.sh
-#CLARA_HOME=`dirname $0`
-#CLARA_SERVICES=`dirname $0`
-#DATAMINING=`dirname $0`
-
-echo +-------------------------------------------------------------------------
-echo "| Starting CLARA-PLATFORM with CLARA_SERVICES = " $CLARA_SERVICES
-echo +-------------------------------------------------------------------------
-echo "\n"
-
-echo "INSTALLATION DIRECTORY = " $CLARA_HOME
-echo "LIBRARY DIRECTORY = " $DATAMINING/lib/clas/
-
-#java -cp "$DATAMINING/lib/clas/core/*" org.jlab.coda.eventViewer.EventTreeFrame $*
-java -Xms1024m -cp "$DATAMINING/lib/clas/*:$DATAMINING/lib/services/*:$DATAMINING/lib/utils/*" org.jlab.detector.examples.RawEventViewer $*
+java -Xms1024m -cp "$CLAS12DIR/lib/clas/*:$CLAS12DIR/lib/services/*:$CLAS12DIR/lib/utils/*" org.jlab.detector.examples.RawEventViewer $*
diff --git a/bin/dclayereffs-ana b/bin/dclayereffs-ana
new file mode 100755
index 0000000000..7db7d2ed02
--- /dev/null
+++ b/bin/dclayereffs-ana
@@ -0,0 +1,5 @@
+#!/bin/sh -f
+
+source `dirname $0`/env.sh
+
+java -Dsun.java2d.pmoffscreen=false -Xmx2048m -Xms1024m -cp "$CLAS12DIR/lib/clas/*:$CLAS12DIR/lib/utils/*:$CLAS12DIR/lib/services/*" org.jlab.service.dc.LayerEfficiencyAnalyzer $*
diff --git a/bin/dclayereffs-anal b/bin/dclayereffs-anal
deleted file mode 100755
index 024abb172e..0000000000
--- a/bin/dclayereffs-anal
+++ /dev/null
@@ -1,19 +0,0 @@
-#!/bin/sh -f
-
-source `dirname $0`/env.sh
-
-#CLARA_HOME=`dirname $0`
-#CLARA_SERVICES=`dirname $0`
-#DATAMINING=`dirname $0`
-
-echo +-------------------------------------------------------------------------
-echo "| Starting CLARA-PLATFORM with CLARA_SERVICES = " $CLARA_SERVICES
-echo +-------------------------------------------------------------------------
-echo "\n"
-
-echo "INSTALLATION DIRECTORY = " $CLARA_HOME
-echo "LIBRARY DIRECTORY = " $DATAMINING/lib/clas/
-
-#java -cp "$DATAMINING/lib/clas/core/*" org.jlab.coda.eventViewer.EventTreeFrame $*
-#java -Xms1024m -cp "$DATAMINING/lib/clas/*:$DATAMINING/lib/plugins/*" org.jlab.io.hipo.HipoDataSync $*
-java -Dsun.java2d.pmoffscreen=false -Xmx2048m -Xms1024m -cp "$DATAMINING/lib/clas/*:$DATAMINING/lib/utils/*:$DATAMINING/lib/services/*" org.jlab.service.dc.LayerEfficiencyAnalyzer $*
diff --git a/bin/ddr b/bin/ddr
deleted file mode 100755
index 26f9faa8dd..0000000000
--- a/bin/ddr
+++ /dev/null
@@ -1,21 +0,0 @@
-#!/bin/sh -f
-
-source `dirname $0`/env.sh
-
-#CLARA_HOME=`dirname $0`
-#CLARA_SERVICES=`dirname $0`
-#DATAMINING=`dirname $0`
-
-echo +-------------------------------------------------------------------------
-echo "| Starting CLARA-PLATFORM with CLARA_SERVICES = " $CLARA_SERVICES
-echo +-------------------------------------------------------------------------
-echo "\n"
-
-echo "INSTALLATION DIRECTORY = " $CLARA_HOME
-echo "LIBRARY DIRECTORY = " $DATAMINING/lib/clas/
-
-#java -cp "$DATAMINING/lib/clas/core/*" org.jlab.coda.eventViewer.EventTreeFrame $*
-#java -Xms1024m -cp "$DATAMINING/lib/clas/*:$DATAMINING/lib/plugins/*" org.jlab.io.hipo.HipoDataSync $*
-#java -XX:+UseNUMA -XX:+UseBiasedLocking -cp "$DATAMINING/lib/clas/*:$DATAMINING/lib/plugins/*" org.jlab.coda.xmsg.sys.xMsgProxy &
-#java -cp "$DATAMINING/lib/clas/*:$DATAMINING/lib/plugins/*" org.jlab.coda.xmsg.sys.xMsgProxy
-java -Xms1024m -cp "$DATAMINING/lib/clas/*:$DATAMINING/lib/plugins/*" org.jlab.clas.service.DataDistributionService -type et -host localhost -file /tmp/et_sys_$SESSION
diff --git a/bin/debug_ec.sh b/bin/debug_ec.sh
deleted file mode 100755
index 85c00bd8eb..0000000000
--- a/bin/debug_ec.sh
+++ /dev/null
@@ -1,18 +0,0 @@
-#!/bin/sh -f
-
-source `dirname $0`/env.sh
-
-#CLARA_HOME=`dirname $0`
-#CLARA_SERVICES=`dirname $0`
-#DATAMINING=`dirname $0`
-
-echo +-------------------------------------------------------------------------
-echo "| Starting CLARA-PLATFORM with CLARA_SERVICES = " $CLARA_SERVICES
-echo +-------------------------------------------------------------------------
-echo "\n"
-
-echo "INSTALLATION DIRECTORY = " $CLARA_HOME
-echo "LIBRARY DIRECTORY = " $DATAMINING/lib/clas/
-
-#java -cp "$DATAMINING/lib/clas/core/*" org.jlab.coda.eventViewer.EventTreeFrame $*
-java -Xms1024m -cp "$DATAMINING/lib/clas/*:$DATAMINING/lib/plugins/*" org.jlab.display.ec.ECPion $*
diff --git a/bin/decoder b/bin/decoder
index 7c7850098b..760071bdbe 100755
--- a/bin/decoder
+++ b/bin/decoder
@@ -5,18 +5,8 @@ source `dirname $0`/env.sh
MALLOC_ARENA_MAX=1; export MALLOC_ARENA_MAX
-#CLARA_HOME=`dirname $0`
-#CLARA_SERVICES=`dirname $0`
-#DATAMINING=`dirname $0`
-
echo +-------------------------------------------------------------------------
echo "| DECODER GENERATION 4 (using HIPO-4 Library)"
echo +-------------------------------------------------------------------------
-echo "\n"
-
-echo "INSTALLATION DIRECTORY = " $CLARA_HOME
-echo "LIBRARY DIRECTORY = " $DATAMINING/lib/clas/
-#java -cp "$DATAMINING/lib/clas/core/*" org.jlab.coda.eventViewer.EventTreeFrame $*
-#java -Xms1024m -cp "$DATAMINING/lib/clas/*:$DATAMINING/lib/plugins/*" org.jlab.io.hipo.HipoDataSync $*
-java -Xmx1536m -Xms1024m -cp "$DATAMINING/lib/clas/*:$DATAMINING/lib/plugins/*" org.jlab.detector.decode.CLASDecoder4 $*
+java -Xmx1536m -Xms1024m -cp "$CLAS12DIR/lib/clas/*:$CLAS12DIR/lib/plugins/*" org.jlab.detector.decode.CLASDecoder4 $*
diff --git a/bin/decoder-debugger b/bin/decoder-debugger
deleted file mode 100755
index 2716be2193..0000000000
--- a/bin/decoder-debugger
+++ /dev/null
@@ -1,22 +0,0 @@
-#!/bin/bash
-
-# This doesn't work in dash (Travis's /bin/sh):
-source `dirname $0`/env.sh
-
-MALLOC_ARENA_MAX=1; export MALLOC_ARENA_MAX
-
-#CLARA_HOME=`dirname $0`
-#CLARA_SERVICES=`dirname $0`
-#DATAMINING=`dirname $0`
-
-echo +-------------------------------------------------------------------------
-echo "| Starting CLARA-PLATFORM with CLARA_SERVICES = " $CLARA_SERVICES
-echo +-------------------------------------------------------------------------
-echo "\n"
-
-echo "INSTALLATION DIRECTORY = " $CLARA_HOME
-echo "LIBRARY DIRECTORY = " $DATAMINING/lib/clas/
-
-#java -cp "$DATAMINING/lib/clas/core/*" org.jlab.coda.eventViewer.EventTreeFrame $*
-#java -Xms1024m -cp "$DATAMINING/lib/clas/*:$DATAMINING/lib/plugins/*" org.jlab.io.hipo.HipoDataSync $*
-java -Xmx1536m -Xms1024m -cp "$DATAMINING/lib/clas/*:$DATAMINING/lib/plugins/*" org.jlab.detector.decode.DetectorDecoderDebug $*
diff --git a/bin/decoder3 b/bin/decoder3
deleted file mode 100755
index 0402b19e52..0000000000
--- a/bin/decoder3
+++ /dev/null
@@ -1,22 +0,0 @@
-#!/bin/bash
-
-# This doesn't work in dash (Travis's /bin/sh):
-source `dirname $0`/env.sh
-
-MALLOC_ARENA_MAX=1; export MALLOC_ARENA_MAX
-
-#CLARA_HOME=`dirname $0`
-#CLARA_SERVICES=`dirname $0`
-#DATAMINING=`dirname $0`
-
-echo +-------------------------------------------------------------------------
-echo "| Starting CLARA-PLATFORM with CLARA_SERVICES = " $CLARA_SERVICES
-echo +-------------------------------------------------------------------------
-echo "\n"
-
-echo "INSTALLATION DIRECTORY = " $CLARA_HOME
-echo "LIBRARY DIRECTORY = " $DATAMINING/lib/clas/
-
-#java -cp "$DATAMINING/lib/clas/core/*" org.jlab.coda.eventViewer.EventTreeFrame $*
-#java -Xms1024m -cp "$DATAMINING/lib/clas/*:$DATAMINING/lib/plugins/*" org.jlab.io.hipo.HipoDataSync $*
-java -Xmx1536m -Xms1024m -cp "$DATAMINING/lib/clas/*:$DATAMINING/lib/plugins/*" org.jlab.detector.decode.CLASDecoder $*
diff --git a/bin/dict-maker b/bin/dict-maker
index 174feb9ebb..28af7f0001 100755
--- a/bin/dict-maker
+++ b/bin/dict-maker
@@ -3,18 +3,5 @@
source `dirname $0`/env.sh
MALLOC_ARENA_MAX=1; export MALLOC_ARENA_MAX
-#CLARA_HOME=`dirname $0`
-#CLARA_SERVICES=`dirname $0`
-#DATAMINING=`dirname $0`
-echo +-------------------------------------------------------------------------
-echo "| Starting CLARA-PLATFORM with CLARA_SERVICES = " $CLARA_SERVICES
-echo +-------------------------------------------------------------------------
-echo "\n"
-
-echo "INSTALLATION DIRECTORY = " $CLARA_HOME
-echo "LIBRARY DIRECTORY = " $DATAMINING/lib/clas/
-
-#java -cp "$DATAMINING/lib/clas/core/*" org.jlab.coda.eventViewer.EventTreeFrame $*
-#java -Xms1024m -cp "$DATAMINING/lib/clas/*:$DATAMINING/lib/plugins/*" org.jlab.io.hipo.HipoDataSync $*
-java -Xmx1536m -Xms1024m -cp "$DATAMINING/lib/clas/*:$DATAMINING/lib/services/*:$DATAMINING/lib/utils/*" org.jlab.service.dc.TrackDictionaryMakerRNG $*
+java -Xmx1536m -Xms1024m -cp "$CLAS12DIR/lib/clas/*:$CLAS12DIR/lib/services/*:$CLAS12DIR/lib/utils/*" org.jlab.service.dc.TrackDictionaryMakerRNG $*
diff --git a/bin/dict-merge b/bin/dict-merge
index 2252ecf882..e58c4f22b4 100755
--- a/bin/dict-merge
+++ b/bin/dict-merge
@@ -3,18 +3,5 @@
source `dirname $0`/env.sh
MALLOC_ARENA_MAX=1; export MALLOC_ARENA_MAX
-#CLARA_HOME=`dirname $0`
-#CLARA_SERVICES=`dirname $0`
-#DATAMINING=`dirname $0`
-echo +-------------------------------------------------------------------------
-echo "| Starting CLARA-PLATFORM with CLARA_SERVICES = " $CLARA_SERVICES
-echo +-------------------------------------------------------------------------
-echo "\n"
-
-echo "INSTALLATION DIRECTORY = " $CLARA_HOME
-echo "LIBRARY DIRECTORY = " $DATAMINING/lib/clas/
-
-#java -cp "$DATAMINING/lib/clas/core/*" org.jlab.coda.eventViewer.EventTreeFrame $*
-#java -Xms1024m -cp "$DATAMINING/lib/clas/*:$DATAMINING/lib/plugins/*" org.jlab.io.hipo.HipoDataSync $*
-java -Xmx1536m -Xms1024m -cp "$DATAMINING/lib/clas/*:$DATAMINING/lib/services/*:$DATAMINING/lib/utils/*" org.jlab.service.dc.TrackDictionaryMerger $*
+java -Xmx1536m -Xms1024m -cp "$CLAS12DIR/lib/clas/*:$CLAS12DIR/lib/services/*:$CLAS12DIR/lib/utils/*" org.jlab.service.dc.TrackDictionaryMerger $*
diff --git a/bin/dict-validate b/bin/dict-validate
index e227208bdb..5d70ba8581 100755
--- a/bin/dict-validate
+++ b/bin/dict-validate
@@ -3,18 +3,5 @@
source `dirname $0`/env.sh
MALLOC_ARENA_MAX=1; export MALLOC_ARENA_MAX
-#CLARA_HOME=`dirname $0`
-#CLARA_SERVICES=`dirname $0`
-#DATAMINING=`dirname $0`
-echo +-------------------------------------------------------------------------
-echo "| Starting CLARA-PLATFORM with CLARA_SERVICES = " $CLARA_SERVICES
-echo +-------------------------------------------------------------------------
-echo "\n"
-
-echo "INSTALLATION DIRECTORY = " $CLARA_HOME
-echo "LIBRARY DIRECTORY = " $DATAMINING/lib/clas/
-
-#java -cp "$DATAMINING/lib/clas/core/*" org.jlab.coda.eventViewer.EventTreeFrame $*
-#java -Xms1024m -cp "$DATAMINING/lib/clas/*:$DATAMINING/lib/plugins/*" org.jlab.io.hipo.HipoDataSync $*
-java -Xmx1536m -Xms1024m -cp "$DATAMINING/lib/clas/*:$DATAMINING/lib/services/*:$DATAMINING/lib/utils/*" org.jlab.service.dc.TrackDictionaryValidation $*
+java -Xmx1536m -Xms1024m -cp "$CLAS12DIR/lib/clas/*:$CLAS12DIR/lib/services/*:$CLAS12DIR/lib/utils/*" org.jlab.service.dc.TrackDictionaryValidation $*
diff --git a/bin/dst-maker b/bin/dst-maker
new file mode 100755
index 0000000000..81aca6fac8
--- /dev/null
+++ b/bin/dst-maker
@@ -0,0 +1,32 @@
+#!/bin/sh
+
+usage="\nUsage: dst-maker -o outputfile inputfile [inputfile [...]]\n"
+
+if [ "$#" -lt 3 ]; then
+ echo -e $usage
+ exit
+elif [ "$1" != "-o" ]; then
+ echo -e $usage
+ exit
+elif [ -e $2 ]; then
+ echo -e $usage
+ echo File already exists: $2
+ exit
+else
+ for x in ${@:3}
+ do
+ if ! [ -e $x ]; then
+ echo -e $usage
+ echo File does not exist: $x
+ exit
+ fi
+ done
+fi
+
+hipo-utils \
+ -filter \
+ -b 'RUN::*,RAW::epics,RAW::scaler,HEL::flip,HEL::online,REC::*,RECFT::*,MC::*' \
+ -merge \
+ -o $2 \
+ ${@:3}
+
diff --git a/bin/eb-monitor b/bin/eb-monitor
deleted file mode 100755
index 9d8b6d29d0..0000000000
--- a/bin/eb-monitor
+++ /dev/null
@@ -1,18 +0,0 @@
-#!/bin/sh -f
-
-source `dirname $0`/env.sh
-
-#CLARA_HOME=`dirname $0`
-#CLARA_SERVICES=`dirname $0`
-#DATAMINING=`dirname $0`
-
-echo +-------------------------------------------------------------------------
-echo "| Starting CLARA-PLATFORM with CLARA_SERVICES = " $CLARA_SERVICES
-echo +-------------------------------------------------------------------------
-echo "\n"
-
-echo "INSTALLATION DIRECTORY = " $CLARA_HOME
-echo "LIBRARY DIRECTORY = " $DATAMINING/lib/clas/
-
-#java -cp "$DATAMINING/lib/clas/core/*" org.jlab.coda.eventViewer.EventTreeFrame $*
-java -Xms1024m -cp "$DATAMINING/lib/clas/*:$DATAMINING/lib/services/*:$DATAMINING/lib/utils/*" org.jlab.service.eb.EBDebug $*
diff --git a/bin/ec-monitor b/bin/ec-monitor
deleted file mode 100755
index 2ac2584b1d..0000000000
--- a/bin/ec-monitor
+++ /dev/null
@@ -1,18 +0,0 @@
-#!/bin/sh -f
-
-source `dirname $0`/env.sh
-
-#CLARA_HOME=`dirname $0`
-#CLARA_SERVICES=`dirname $0`
-#DATAMINING=`dirname $0`
-
-echo +-------------------------------------------------------------------------
-echo "| Starting CLARA-PLATFORM with CLARA_SERVICES = " $CLARA_SERVICES
-echo +-------------------------------------------------------------------------
-echo "\n"
-
-echo "INSTALLATION DIRECTORY = " $CLARA_HOME
-echo "LIBRARY DIRECTORY = " $DATAMINING/lib/clas/
-
-#java -cp "$DATAMINING/lib/clas/core/*" org.jlab.coda.eventViewer.EventTreeFrame $*
-java -Xms1024m -cp "$DATAMINING/lib/clas/*:$DATAMINING/lib/services/*:$DATAMINING/lib/utils/*" org.jlab.display.ec.ECMonitor $*
diff --git a/bin/env.sh b/bin/env.sh
index b0b6c9a2bb..200f78ccdb 100644
--- a/bin/env.sh
+++ b/bin/env.sh
@@ -1,10 +1,7 @@
#!/bin/bash
SCRIPT_DIR=`dirname $0`
-DISTRO_DIR=$SCRIPT_DIR/../ ; export DISTRO_DIR
CLAS12DIR=$SCRIPT_DIR/../ ; export CLAS12DIR
-CLARA_SERVICES=$DISTRO_DIR/lib/services; export CLARA_SERVICES
-DATAMINING=$DISTRO_DIR ; export DATAMINING
# Set default field maps (but do not override user's env):
if [ -z "$COAT_MAGFIELD_TORUSMAP" ]; then
@@ -17,3 +14,7 @@ if [ -z "$COAT_MAGFIELD_SOLENOIDMAP" ]; then
export COAT_MAGFIELD_SOLENOIDMAP=Symm_solenoid_r601_phi1_z1201_13June2018.dat
fi
+echo +-------------------------------------------------------------------------
+echo "| COATJAVA LIBRARY DIRECTORY = " $CLAS12DIR/lib/clas/
+echo +-------------------------------------------------------------------------
+
diff --git a/bin/evio-viewer b/bin/evio-viewer
index 8d41a5d774..8d659aaf39 100755
--- a/bin/evio-viewer
+++ b/bin/evio-viewer
@@ -2,18 +2,4 @@
source `dirname $0`/env.sh
-#CLARA_HOME=`dirname $0`
-#CLARA_SERVICES=`dirname $0`
-#DATAMINING=`dirname $0`
-
-echo +-------------------------------------------------------------------------
-echo "| Starting CLARA-PLATFORM with CLARA_SERVICES = " $CLARA_SERVICES
-echo +-------------------------------------------------------------------------
-echo "\n"
-
-echo "INSTALLATION DIRECTORY = " $CLARA_HOME
-echo "LIBRARY DIRECTORY = " $DATAMINING/lib/clas/
-
-java -cp "$DATAMINING/lib/clas/*" org.jlab.coda.eventViewer.EventTreeFrame $*
-#java -cp "$DATAMINING/lib/clas/*" org.jlab.coda.jevio.graphics.EventTreeFrame $*
-#java -cp "$DATAMINING/lib/clas/*" org.jlab.coda.jevio.graphics.EventTreeFrame $*
+java -cp "$CLAS12DIR/lib/clas/*" org.jlab.coda.eventViewer.EventTreeFrame $*
diff --git a/bin/evio2hipo b/bin/evio2hipo
index b64a8c82ac..ceda619f9b 100755
--- a/bin/evio2hipo
+++ b/bin/evio2hipo
@@ -4,18 +4,4 @@ source `dirname $0`/env.sh
MALLOC_ARENA_MAX=1; export MALLOC_ARENA_MAX
-#CLARA_HOME=`dirname $0`
-#CLARA_SERVICES=`dirname $0`
-#DATAMINING=`dirname $0`
-
-echo +-------------------------------------------------------------------------
-echo "| Starting CLARA-PLATFORM with CLARA_SERVICES = " $CLARA_SERVICES
-echo +-------------------------------------------------------------------------
-echo "\n"
-
-echo "INSTALLATION DIRECTORY = " $CLARA_HOME
-echo "LIBRARY DIRECTORY = " $DATAMINING/lib/clas/
-
-#java -cp "$DATAMINING/lib/clas/core/*" org.jlab.coda.eventViewer.EventTreeFrame $*
-#java -Xms1024m -cp "$DATAMINING/lib/clas/*:$DATAMINING/lib/plugins/*" org.jlab.io.hipo.HipoDataSync $*
-java -Xmx1536m -Xms1024m -cp "$DATAMINING/lib/clas/*:$DATAMINING/lib/plugins/*" org.jlab.clas.reco.io.EvioHipoEvent4 $*
+java -Xmx1536m -Xms1024m -cp "$CLAS12DIR/lib/clas/*:$CLAS12DIR/lib/plugins/*" org.jlab.clas.reco.io.EvioHipoEvent4 $*
diff --git a/bin/eviocure b/bin/eviocure
index 258a4bf05e..d2e0768d3f 100755
--- a/bin/eviocure
+++ b/bin/eviocure
@@ -4,18 +4,4 @@ source `dirname $0`/env.sh
MALLOC_ARENA_MAX=1; export MALLOC_ARENA_MAX
-#CLARA_HOME=`dirname $0`
-#CLARA_SERVICES=`dirname $0`
-#DATAMINING=`dirname $0`
-
-echo +-------------------------------------------------------------------------
-echo "| Starting CLARA-PLATFORM with CLARA_SERVICES = " $CLARA_SERVICES
-echo +-------------------------------------------------------------------------
-echo "\n"
-
-echo "INSTALLATION DIRECTORY = " $CLARA_HOME
-echo "LIBRARY DIRECTORY = " $DATAMINING/lib/clas/
-
-#java -cp "$DATAMINING/lib/clas/core/*" org.jlab.coda.eventViewer.EventTreeFrame $*
-#java -Xms1024m -cp "$DATAMINING/lib/clas/*:$DATAMINING/lib/plugins/*" org.jlab.io.hipo.HipoDataSync $*
-java -Xmx1536m -Xms1024m -cp "$DATAMINING/lib/clas/*:$DATAMINING/lib/plugins/*" org.jlab.io.utils.EvioCure $*
+java -Xmx1536m -Xms1024m -cp "$CLAS12DIR/lib/clas/*:$CLAS12DIR/lib/plugins/*" org.jlab.io.utils.EvioCure $*
diff --git a/bin/eviodump b/bin/eviodump
index be98a29fef..db4f7b0c4f 100755
--- a/bin/eviodump
+++ b/bin/eviodump
@@ -2,17 +2,4 @@
source `dirname $0`/env.sh
-#CLARA_HOME=`dirname $0`
-#CLARA_SERVICES=`dirname $0`
-#DATAMINING=`dirname $0`
-
-echo +-------------------------------------------------------------------------
-echo "| Starting CLARA-PLATFORM with CLARA_SERVICES = " $CLARA_SERVICES
-echo +-------------------------------------------------------------------------
-echo "\n"
-
-echo "INSTALLATION DIRECTORY = " $CLARA_HOME
-echo "LIBRARY DIRECTORY = " $DATAMINING/lib/clas/
-
-#java -cp "$DATAMINING/lib/clas/core/*" org.jlab.coda.eventViewer.EventTreeFrame $*
-java -Xms1024m -cp "$DATAMINING/lib/clas/*:$DATAMINING/lib/plugins/*" org.jlab.io.utils.DataSourceDump $*
+java -Xms1024m -cp "$CLAS12DIR/lib/clas/*:$CLAS12DIR/lib/plugins/*" org.jlab.io.utils.DataSourceDump $*
diff --git a/bin/gemc-evio b/bin/gemc-evio
deleted file mode 100755
index 82f5e8f76f..0000000000
--- a/bin/gemc-evio
+++ /dev/null
@@ -1,18 +0,0 @@
-#!/bin/sh -f
-
-source `dirname $0`/env.sh
-
-#CLARA_HOME=`dirname $0`
-#CLARA_SERVICES=`dirname $0`
-#DATAMINING=`dirname $0`
-
-echo +-------------------------------------------------------------------------
-echo "| Starting CLARA-PLATFORM with CLARA_SERVICES = " $CLARA_SERVICES
-echo +-------------------------------------------------------------------------
-echo "\n"
-
-echo "INSTALLATION DIRECTORY = " $CLARA_HOME
-echo "LIBRARY DIRECTORY = " $DATAMINING/lib/clas/
-
-#java -cp "$DATAMINING/lib/clas/core/*" org.jlab.coda.eventViewer.EventTreeFrame $*
-java -Xms1024m -cp "$DATAMINING/lib/clas/*:$DATAMINING/lib/plugins/*" org.jlab.clas.reco.io.ReconstructionIO $*
diff --git a/bin/grid b/bin/grid
deleted file mode 100755
index 68a7685fb2..0000000000
--- a/bin/grid
+++ /dev/null
@@ -1,18 +0,0 @@
-#!/bin/sh -f
-
-source `dirname $0`/env.sh
-
-#CLARA_HOME=`dirname $0`
-#CLARA_SERVICES=`dirname $0`
-#DATAMINING=`dirname $0`
-
-echo +-------------------------------------------------------------------------
-echo "| Starting CLARA-PLATFORM with CLARA_SERVICES = " $CLARA_SERVICES
-echo +-------------------------------------------------------------------------
-echo "\n"
-
-echo "INSTALLATION DIRECTORY = " $CLARA_HOME
-echo "LIBRARY DIRECTORY = " $DATAMINING/lib/clas/
-
-#java -cp "$DATAMINING/lib/clas/core/*" org.jlab.coda.eventViewer.EventTreeFrame $*
-java -Xms1024m -cp "$DATAMINING/lib/clas/*:$DATAMINING/lib/plugins/*" org.jlab.groot.matrix.SparseGridIO $*
diff --git a/bin/hadd b/bin/hadd
index 2c045d5696..87673aade6 100755
--- a/bin/hadd
+++ b/bin/hadd
@@ -2,17 +2,4 @@
source `dirname $0`/env.sh
-#CLARA_HOME=`dirname $0`
-#CLARA_SERVICES=`dirname $0`
-#DATAMINING=`dirname $0`
-
-echo +-------------------------------------------------------------------------
-echo "| Starting CLARA-PLATFORM with CLARA_SERVICES = " $CLARA_SERVICES
-echo +-------------------------------------------------------------------------
-echo "\n"
-
-echo "INSTALLATION DIRECTORY = " $CLARA_HOME
-echo "LIBRARY DIRECTORY = " $DATAMINING/lib/clas/
-
-#java -cp "$DATAMINING/lib/clas/core/*" org.jlab.coda.eventViewer.EventTreeFrame $*
-java -Xms1024m -cp "$DATAMINING/lib/clas/*:$DATAMINING/lib/plugins/*" org.jlab.groot.data.TDirectory $*
+java -Xms1024m -cp "$CLAS12DIR/lib/clas/*:$CLAS12DIR/lib/plugins/*" org.jlab.groot.data.TDirectory $*
diff --git a/bin/hipo-browser b/bin/hipo-browser
new file mode 100755
index 0000000000..820bf4995d
--- /dev/null
+++ b/bin/hipo-browser
@@ -0,0 +1,5 @@
+#!/bin/sh -f
+
+source `dirname $0`/env.sh
+
+java -Xms1024m -cp "$CLAS12DIR/lib/clas/*:$CLAS12DIR/lib/plugins/*" org.jlab.groot.ui.TBrowser $*
diff --git a/bin/hipo-utils b/bin/hipo-utils
index 2871f0ad81..4b48c1deac 100755
--- a/bin/hipo-utils
+++ b/bin/hipo-utils
@@ -4,19 +4,4 @@ source `dirname $0`/env.sh
MALLOC_ARENA_MAX=1; export MALLOC_ARENA_MAX
-#CLARA_HOME=`dirname $0`
-#CLARA_SERVICES=`dirname $0`
-#DATAMINING=`dirname $0`
-
-echo +-------------------------------------------------------------------------
-echo "| Starting CLARA-PLATFORM with CLARA_SERVICES = " $CLARA_SERVICES
-echo +-------------------------------------------------------------------------
-echo "\n"
-
-echo "INSTALLATION DIRECTORY = " $CLARA_HOME
-echo "LIBRARY DIRECTORY = " $DATAMINING/lib/clas/
-
-#java -cp "$DATAMINING/lib/clas/core/*" org.jlab.coda.eventViewer.EventTreeFrame $*
-#java -Xms1024m -cp "$DATAMINING/lib/clas/*:$DATAMINING/lib/plugins/*" org.jlab.io.hipo.HipoDataSync $*
-#java -Xms1024m -cp "$DATAMINING/lib/clas/*:$DATAMINING/lib/plugins/*" org.jlab.clas.reco.io.HipoFileUtils $*
-java -Xmx2048m -Xms1024m -cp "$DATAMINING/lib/clas/*:$DATAMINING/lib/plugins/*" org.jlab.jnp.hipo4.utils.HipoUtilities $*
+java -Xmx2048m -Xms1024m -cp "$CLAS12DIR/lib/clas/*:$CLAS12DIR/lib/plugins/*" org.jlab.jnp.hipo4.utils.HipoUtilities $*
diff --git a/bin/hipo-writer b/bin/hipo-writer
deleted file mode 100755
index eae747fceb..0000000000
--- a/bin/hipo-writer
+++ /dev/null
@@ -1,19 +0,0 @@
-#!/bin/sh -f
-
-source `dirname $0`/env.sh
-
-#CLARA_HOME=`dirname $0`
-#CLARA_SERVICES=`dirname $0`
-#DATAMINING=`dirname $0`
-
-echo +-------------------------------------------------------------------------
-echo "| Starting CLARA-PLATFORM with CLARA_SERVICES = " $CLARA_SERVICES
-echo +-------------------------------------------------------------------------
-echo "\n"
-
-echo "INSTALLATION DIRECTORY = " $CLARA_HOME
-echo "LIBRARY DIRECTORY = " $DATAMINING/lib/clas/
-
-#java -cp "$DATAMINING/lib/clas/core/*" org.jlab.coda.eventViewer.EventTreeFrame $*
-#java -Xms1024m -cp "$DATAMINING/lib/clas/*:$DATAMINING/lib/plugins/*" org.jlab.io.hipo.HipoDataSync $*
-java -Xms1024m -cp "$DATAMINING/lib/clas/*:$DATAMINING/lib/plugins/*" org.jlab.io.utils.Evio2HipoConverter $*
diff --git a/bin/hipo3utils b/bin/hipo3utils
deleted file mode 100755
index 569279e187..0000000000
--- a/bin/hipo3utils
+++ /dev/null
@@ -1,22 +0,0 @@
-#!/bin/sh -f
-
-source `dirname $0`/env.sh
-
-MALLOC_ARENA_MAX=1; export MALLOC_ARENA_MAX
-
-#CLARA_HOME=`dirname $0`
-#CLARA_SERVICES=`dirname $0`
-#DATAMINING=`dirname $0`
-
-echo +-------------------------------------------------------------------------
-echo "| Starting CLARA-PLATFORM with CLARA_SERVICES = " $CLARA_SERVICES
-echo +-------------------------------------------------------------------------
-echo "\n"
-
-echo "INSTALLATION DIRECTORY = " $CLARA_HOME
-echo "LIBRARY DIRECTORY = " $DATAMINING/lib/clas/
-
-#java -cp "$DATAMINING/lib/clas/core/*" org.jlab.coda.eventViewer.EventTreeFrame $*
-#java -Xms1024m -cp "$DATAMINING/lib/clas/*:$DATAMINING/lib/plugins/*" org.jlab.io.hipo.HipoDataSync $*
-#java -Xms1024m -cp "$DATAMINING/lib/clas/*:$DATAMINING/lib/plugins/*" org.jlab.clas.reco.io.HipoFileUtils $*
-java -Xmx2048m -Xms1024m -cp "$DATAMINING/lib/clas/*:$DATAMINING/lib/plugins/*" org.jlab.jnp.hipo.utils.HipoUtilities $*
diff --git a/bin/jaw b/bin/jaw
deleted file mode 100755
index 84955d6b99..0000000000
--- a/bin/jaw
+++ /dev/null
@@ -1,11 +0,0 @@
-#!/bin/sh -f
-
-source `dirname $0`/env.sh
-
-java -Dsun.java2d.pmoffscreen=false -Xms1024m -Xmx2048m -cp "$DATAMINING/lib/utils/*" org.jlab.jnp.math.cli.MathCli $*
-
-#*********************************************************
-#---------------------------------------------------------
-# JHEP math CLI interface.
-#---------------------------------------------------------
-#java -cp "target/jnp-math-1.0-SNAPSHOT-jar-with-dependencies.jar" org.jlab.jnp.math.cli.MathCli $*
diff --git a/bin/kpp-plots b/bin/kpp-plots
index 6f4135adce..f33f426b58 100755
--- a/bin/kpp-plots
+++ b/bin/kpp-plots
@@ -2,18 +2,4 @@
source `dirname $0`/env.sh
-#CLARA_HOME=`dirname $0`
-#CLARA_SERVICES=`dirname $0`
-#DATAMINING=`dirname $0`
-
-echo +-------------------------------------------------------------------------
-echo "| Starting CLARA-PLATFORM with CLARA_SERVICES = " $CLARA_SERVICES
-echo +-------------------------------------------------------------------------
-echo "\n"
-
-echo "INSTALLATION DIRECTORY = " $CLARA_HOME
-echo "LIBRARY DIRECTORY = " $DATAMINING/lib/clas/
-
-#java -cp "$DATAMINING/lib/clas/core/*" org.jlab.coda.eventViewer.EventTreeFrame $*
-#java -Xms1024m -cp "$DATAMINING/lib/clas/*:$DATAMINING/lib/plugins/*" org.jlab.io.hipo.HipoDataSync $*
-java -Dsun.java2d.pmoffscreen=false -Xmx2048m -Xms1024m -cp "$DATAMINING/lib/clas/*:$DATAMINING/lib/utils/*:$DATAMINING/lib/services/*" org.clas.viewer.KPPViewer $*
+java -Dsun.java2d.pmoffscreen=false -Xmx2048m -Xms1024m -cp "$CLAS12DIR/lib/clas/*:$CLAS12DIR/lib/utils/*:$CLAS12DIR/lib/services/*" org.clas.viewer.KPPViewer $*
diff --git a/bin/mon12 b/bin/mon12
index 02e50f2583..fc693331c2 100755
--- a/bin/mon12
+++ b/bin/mon12
@@ -2,18 +2,4 @@
source `dirname $0`/env.sh
-#CLARA_HOME=`dirname $0`
-#CLARA_SERVICES=`dirname $0`
-#DATAMINING=`dirname $0`
-
-echo +-------------------------------------------------------------------------
-echo "| Starting CLARA-PLATFORM with CLARA_SERVICES = " $CLARA_SERVICES
-echo +-------------------------------------------------------------------------
-echo "\n"
-
-echo "INSTALLATION DIRECTORY = " $CLARA_HOME
-echo "LIBRARY DIRECTORY = " $DATAMINING/lib/clas/
-
-#java -cp "$DATAMINING/lib/clas/core/*" org.jlab.coda.eventViewer.EventTreeFrame $*
-#java -Xms1024m -cp "$DATAMINING/lib/clas/*:$DATAMINING/lib/plugins/*" org.jlab.io.hipo.HipoDataSync $*
-java -Dsun.java2d.pmoffscreen=false -Xmx2048m -Xms1024m -cp "$DATAMINING/lib/clas/*:$DATAMINING/lib/utils/*:$DATAMINING/lib/services/*" org.clas.viewer.EventViewer $*
+java -Dsun.java2d.pmoffscreen=false -Xmx2048m -Xms1024m -cp "$CLAS12DIR/lib/clas/*:$CLAS12DIR/lib/utils/*:$CLAS12DIR/lib/services/*" org.clas.viewer.EventViewer $*
diff --git a/bin/pion b/bin/pion
deleted file mode 100755
index 7ee68900fa..0000000000
--- a/bin/pion
+++ /dev/null
@@ -1,19 +0,0 @@
-#!/bin/sh -f
-
-source `dirname $0`/env.sh
-
-#CLARA_HOME=`dirname $0`
-#CLARA_SERVICES=`dirname $0`
-#DATAMINING=`dirname $0`
-
-echo +-------------------------------------------------------------------------
-echo "| Starting CLARA-PLATFORM with CLARA_SERVICES = " $CLARA_SERVICES
-echo +-------------------------------------------------------------------------
-echo "\n"
-
-echo "INSTALLATION DIRECTORY = " $CLARA_HOME
-echo "LIBRARY DIRECTORY = " $DATAMINING/lib/clas/
-
-#java -cp "$DATAMINING/lib/clas/core/*" org.jlab.coda.eventViewer.EventTreeFrame $*
-#java -Xms1024m -cp "$DATAMINING/lib/clas/*:$DATAMINING/lib/plugins/*" org.jlab.io.hipo.HipoDataSync $*
-java -Xms1024m -cp "$DATAMINING/lib/clas/*:$DATAMINING/lib/services/*" org.jlab.display.ec.ECPionFinder $*
diff --git a/bin/postprocess b/bin/postprocess
new file mode 100755
index 0000000000..b3d44933ad
--- /dev/null
+++ b/bin/postprocess
@@ -0,0 +1,7 @@
+#!/bin/bash
+
+source `dirname $0`/env.sh
+
+MALLOC_ARENA_MAX=1; export MALLOC_ARENA_MAX
+
+java -Xmx768m -Xms768m -cp "$CLAS12DIR/lib/clas/*:$CLAS12DIR/lib/services/*:$CLAS12DIR/lib/utils/*" org.jlab.analysis.postprocess.Tag1ToEvent $*
diff --git a/bin/rec-monitor b/bin/rec-monitor
deleted file mode 100755
index 1257139a79..0000000000
--- a/bin/rec-monitor
+++ /dev/null
@@ -1,18 +0,0 @@
-#!/bin/sh -f
-
-source `dirname $0`/env.sh
-
-#CLARA_HOME=`dirname $0`
-#CLARA_SERVICES=`dirname $0`
-#DATAMINING=`dirname $0`
-
-echo +-------------------------------------------------------------------------
-echo "| Starting CLARA-PLATFORM with CLARA_SERVICES = " $CLARA_SERVICES
-echo +-------------------------------------------------------------------------
-echo "\n"
-
-echo "INSTALLATION DIRECTORY = " $CLARA_HOME
-echo "LIBRARY DIRECTORY = " $DATAMINING/lib/clas/
-
-#java -cp "$DATAMINING/lib/clas/core/*" org.jlab.coda.eventViewer.EventTreeFrame $*
-java -Xms1024m -cp "$DATAMINING/lib/clas/*:$DATAMINING/lib/plugins/*" org.jlab.monitor.eb.ReconstructionMonitor $*
diff --git a/bin/recon-util b/bin/recon-util
index 0fe6c5e885..763324174c 100755
--- a/bin/recon-util
+++ b/bin/recon-util
@@ -3,18 +3,5 @@
source `dirname $0`/env.sh
MALLOC_ARENA_MAX=1; export MALLOC_ARENA_MAX
-#CLARA_HOME=`dirname $0`
-#CLARA_SERVICES=`dirname $0`
-#DATAMINING=`dirname $0`
-echo +-------------------------------------------------------------------------
-echo "| Starting CLARA-PLATFORM with CLARA_SERVICES = " $CLARA_SERVICES
-echo +-------------------------------------------------------------------------
-echo "\n"
-
-echo "INSTALLATION DIRECTORY = " $CLARA_HOME
-echo "LIBRARY DIRECTORY = " $DATAMINING/lib/clas/
-
-#java -cp "$DATAMINING/lib/clas/core/*" org.jlab.coda.eventViewer.EventTreeFrame $*
-#java -Xms1024m -cp "$DATAMINING/lib/clas/*:$DATAMINING/lib/plugins/*" org.jlab.io.hipo.HipoDataSync $*
-java -Xmx1536m -Xms1024m -cp "$DATAMINING/lib/clas/*:$DATAMINING/lib/services/*:$DATAMINING/lib/utils/*" org.jlab.clas.reco.EngineProcessor $*
+java -Xmx1536m -Xms1024m -cp "$CLAS12DIR/lib/clas/*:$CLAS12DIR/lib/services/*:$CLAS12DIR/lib/utils/*" org.jlab.clas.reco.EngineProcessor $*
diff --git a/bin/run-groovy b/bin/run-groovy
index b36fe48fe1..6a93a9ea5e 100755
--- a/bin/run-groovy
+++ b/bin/run-groovy
@@ -3,17 +3,17 @@
source `dirname $0`/env.sh
CLARA_HOME=`dirname $0`/..
-DATAMINING=`dirname $0`/..
+CLAS12DIR=`dirname $0`/..
CLAS12DIR=`dirname $0`/.. ; export CLAS12DIR
CLARA_SERVICES=$CLAS12DIR/lib/services ; export CLARA_SERVICES
-#JYTHONPATH=${DATAMINING}/lib/jython
+#JYTHONPATH=${CLAS12DIR}/lib/jython
#echo ${JYTHONPATH}
#--------------------------------------------------------------
# Adding supporting COAT jar files
-for i in `ls -a $DATAMINING/lib/clas/*.jar`
+for i in `ls -a $CLAS12DIR/lib/clas/*.jar`
do
#echo "$i"
if [ -z "${JYPATH}" ] ; then
@@ -24,7 +24,7 @@ fi
done
#--------------------------------------------------------------
# Adding supporting plugins directory
-for i in `ls -a $DATAMINING/lib/services/*.jar`
+for i in `ls -a $CLAS12DIR/lib/services/*.jar`
do
if [ -z "${JYPATH}" ] ; then
JYPATH="$i"
@@ -38,7 +38,7 @@ done
# Done loading plugins
#--------------------------------------------------------------
# Adding supporting plugins directory
-for i in `ls -a $DATAMINING/lib/utils/*.jar`
+for i in `ls -a $CLAS12DIR/lib/utils/*.jar`
do
if [ -z "${JYPATH}" ] ; then
JYPATH="$i"
@@ -47,7 +47,7 @@ JYPATH=${JYPATH}:"$i"
fi
done
#-------------------------------------------------------------
-JYPATH=${JYPATH}:${DATAMINING}/lib/packages
+JYPATH=${JYPATH}:${CLAS12DIR}/lib/packages
echo " "
echo " "
echo "*****************************************"
diff --git a/bin/studio b/bin/studio
deleted file mode 100755
index 8afb445e32..0000000000
--- a/bin/studio
+++ /dev/null
@@ -1,18 +0,0 @@
-#!/bin/sh -f
-
-source `dirname $0`/env.sh
-
-#CLARA_HOME=`dirname $0`
-#CLARA_SERVICES=`dirname $0`
-#DATAMINING=`dirname $0`
-
-echo +-------------------------------------------------------------------------
-echo "| Starting CLARA-PLATFORM with CLARA_SERVICES = " $CLARA_SERVICES
-echo +-------------------------------------------------------------------------
-echo "\n"
-
-echo "INSTALLATION DIRECTORY = " $CLARA_HOME
-echo "LIBRARY DIRECTORY = " $DATAMINING/lib/clas/
-
-#java -cp "$DATAMINING/lib/clas/core/*" org.jlab.coda.eventViewer.EventTreeFrame $*
-java -Xms1024m -Xmx2048m -cp "$DATAMINING/lib/clas/*:$DATAMINING/lib/plugins/*" org.jlab.clas.physics.EventTree $*
diff --git a/bin/update b/bin/update
deleted file mode 100755
index 7f9704a2c6..0000000000
--- a/bin/update
+++ /dev/null
@@ -1,22 +0,0 @@
-#!/bin/sh -f
-
-source `dirname $0`/env.sh
-
-#CLARA_HOME=`dirname $0`
-#CLARA_SERVICES=`dirname $0`
-#DATAMINING=`dirname $0`
-#echo +-------------------------------------------------------------------------
-#echo "| Starting CLARA-PLATFORM with CLARA_SERVICES = " $CLARA_SERVICES
-#echo +-------------------------------------------------------------------------
-#echo "\n"
-#echo "INSTALLATION DIRECTORY = " $CLARA_HOME
-#echo "LIBRARY DIRECTORY = " $DATAMINING/lib/clas/
-#java -cp "$DATAMINING/lib/clas/core/*" org.jlab.coda.eventViewer.EventTreeFrame $*
-#java -cp "$DATAMINING/lib/clas/*:$DATAMINING/lib/plugins/*" org.jlab.clas.tools.utils.StringTable
-#java -cp "$DATAMINING/lib/clas/*:$DATAMINING/lib/utils/*:$DATAMINING/lib/plugins/*" org.jlab.clas.update.UpdateManager $*
-
-java -cp "$DATAMINING/lib/clas/*:$DATAMINING/lib/utils/*:$DATAMINING/lib/plugins/*" org.jlab.clas.update.UpdateManager link http://clasweb.jlab.org/clas12maven/org/jlab/coat/coat-libs/3.0-SNAPSHOT/ coat-libs-3.0-SNAPSHOT.jar $CLAS12DIR/lib/clas
-
-java -cp "$DATAMINING/lib/clas/*:$DATAMINING/lib/utils/*:$DATAMINING/lib/plugins/*" org.jlab.clas.update.UpdateManager link https://userweb.jlab.org/~devita/kpp/ KPP-Plots-1.0.jar $CLAS12DIR/lib/utils
-
-java -cp "$DATAMINING/lib/clas/*:$DATAMINING/lib/utils/*:$DATAMINING/lib/plugins/*" org.jlab.clas.update.UpdateManager link https://userweb.jlab.org/~devita/kpp/ KPP-Monitoring-1.0.jar $CLAS12DIR/lib/utils
diff --git a/bin/x-client b/bin/x-client
deleted file mode 100755
index cab1bef627..0000000000
--- a/bin/x-client
+++ /dev/null
@@ -1,17 +0,0 @@
-#!/bin/sh -f
-
-source `dirname $0`/env.sh
-
-#CLARA_HOME=`dirname $0`
-#CLARA_SERVICES=`dirname $0`
-#DATAMINING=`dirname $0`
-
-echo +-------------------------------------------------------------------------
-echo "| Starting CLARA-PLATFORM with CLARA_SERVICES = " $CLARA_SERVICES
-echo +-------------------------------------------------------------------------
-echo "\n"
-
-echo "INSTALLATION DIRECTORY = " $CLARA_HOME
-echo "LIBRARY DIRECTORY = " $DATAMINING/lib/clas/
-
-java -Xms1024m -cp "$DATAMINING/lib/clas/*:$DATAMINING/lib/plugins/*" org.jlab.io.hipo.HipoRingSource $*
diff --git a/bin/x-client-evio b/bin/x-client-evio
deleted file mode 100755
index 9c2150a3fd..0000000000
--- a/bin/x-client-evio
+++ /dev/null
@@ -1,17 +0,0 @@
-#!/bin/sh -f
-
-source `dirname $0`/env.sh
-
-#CLARA_HOME=`dirname $0`
-#CLARA_SERVICES=`dirname $0`
-#DATAMINING=`dirname $0`
-
-echo +-------------------------------------------------------------------------
-echo "| Starting CLARA-PLATFORM with CLARA_SERVICES = " $CLARA_SERVICES
-echo +-------------------------------------------------------------------------
-echo "\n"
-
-echo "INSTALLATION DIRECTORY = " $CLARA_HOME
-echo "LIBRARY DIRECTORY = " $DATAMINING/lib/clas/
-
-java -Xms1024m -cp "$DATAMINING/lib/clas/*:$DATAMINING/lib/plugins/*" org.jlab.io.evio.EvioRingSource $*
diff --git a/bin/x-server b/bin/x-server
deleted file mode 100755
index f3e2c73090..0000000000
--- a/bin/x-server
+++ /dev/null
@@ -1,21 +0,0 @@
-#!/bin/sh -f
-
-source `dirname $0`/env.sh
-
-#CLARA_HOME=`dirname $0`
-#CLARA_SERVICES=`dirname $0`
-#DATAMINING=`dirname $0`
-
-echo +-------------------------------------------------------------------------
-echo "| Starting CLARA-PLATFORM with CLARA_SERVICES = " $CLARA_SERVICES
-echo +-------------------------------------------------------------------------
-echo "\n"
-
-echo "INSTALLATION DIRECTORY = " $CLARA_HOME
-echo "LIBRARY DIRECTORY = " $DATAMINING/lib/clas/
-
-#java -cp "$DATAMINING/lib/clas/core/*" org.jlab.coda.eventViewer.EventTreeFrame $*
-#java -Xms1024m -cp "$DATAMINING/lib/clas/*:$DATAMINING/lib/plugins/*" org.jlab.io.hipo.HipoDataSync $*
-#java -XX:+UseNUMA -XX:+UseBiasedLocking -cp "$DATAMINING/lib/clas/*:$DATAMINING/lib/plugins/*" org.jlab.coda.xmsg.sys.xMsgProxy &
-#java -cp "$DATAMINING/lib/clas/*:$DATAMINING/lib/plugins/*" org.jlab.coda.xmsg.sys.xMsgProxy
-java -Xms1024m -cp "$DATAMINING/lib/clas/*:$DATAMINING/lib/plugins/*" org.jlab.clas.service.DataDistributionService $*
diff --git a/build-coatjava.sh b/build-coatjava.sh
index e5abbc3485..bf11ae5644 100755
--- a/build-coatjava.sh
+++ b/build-coatjava.sh
@@ -66,7 +66,7 @@ cp external-dependencies/vecmath-1.3.1-2.jar coatjava/lib/clas/
mkdir -p coatjava/lib/utils
cp external-dependencies/jclara-4.3-SNAPSHOT.jar coatjava/lib/utils
cp external-dependencies/clas12mon-3.1.jar coatjava/lib/utils
-cp external-dependencies/KPP-Plots-3.1.jar coatjava/lib/utils
+cp external-dependencies/KPP-Plots-3.2.jar coatjava/lib/utils
#cp external-dependencies/jaw-1.0.jar coatjava/lib/utils
mkdir -p coatjava/lib/services
@@ -109,5 +109,6 @@ cp reconstruction/rich/target/clas12detector-rich-*-SNAPSHOT.jar coatjava/lib/se
cp reconstruction/fvt/target/clas12detector-fmt-*-SNAPSHOT.jar coatjava/lib/services/
cp reconstruction/eb/target/clas12detector-eb-*-SNAPSHOT.jar coatjava/lib/services/
cp reconstruction/band/target/clas12detector-band-*-SNAPSHOT.jar coatjava/lib/services/
+cp reconstruction/rtpc/target/clas12detector-rtpc-*-SNAPSHOT.jar coatjava/lib/services/
echo "COATJAVA SUCCESSFULLY BUILT !"
diff --git a/common-tools/clas-analysis/pom.xml b/common-tools/clas-analysis/pom.xml
index 6724843558..96b5060d95 100644
--- a/common-tools/clas-analysis/pom.xml
+++ b/common-tools/clas-analysis/pom.xml
@@ -3,14 +3,14 @@
4.0.0
org.jlab.clas
clas-analysis
- 6.3.1-SNAPSHOT
+ 6.5.3-SNAPSHOT
jar
org.jlab.clas
clas12rec
../../parent/pom.xml
- 6.3.1-SNAPSHOT
+ 6.5.3-SNAPSHOT
@@ -30,31 +30,31 @@
org.jlab.clas
clas-utils
- 6.3.1-SNAPSHOT
+ 6.5.3-SNAPSHOT
org.jlab.clas
clas-physics
- 6.3.1-SNAPSHOT
+ 6.5.3-SNAPSHOT
org.jlab.clas
clas-io
- 6.3.1-SNAPSHOT
+ 6.5.3-SNAPSHOT
org.jlab.clas
clas-geometry
- 6.3.1-SNAPSHOT
+ 6.5.3-SNAPSHOT
org.jlab.clas
clas-detector
- 6.3.1-SNAPSHOT
+ 6.5.3-SNAPSHOT
diff --git a/common-tools/clas-analysis/src/main/java/org/jlab/analysis/physics/TestEvent.java b/common-tools/clas-analysis/src/main/java/org/jlab/analysis/physics/TestEvent.java
index c8d9ea864b..a18f04bec0 100644
--- a/common-tools/clas-analysis/src/main/java/org/jlab/analysis/physics/TestEvent.java
+++ b/common-tools/clas-analysis/src/main/java/org/jlab/analysis/physics/TestEvent.java
@@ -15,49 +15,53 @@ public class TestEvent {
public static HipoDataEvent getDCSector1ElectronEvent(SchemaFactory schemaFactory) {
Event testEvent = new Event();
+
+
// this event is based on a gemc event with
- // one generated electron with p=2.5, th=25, ph=0
- // (i.e. px=1.057, py=0, pz=2.266)
- // torus = -1.0 , solenoid = 0.0
- // updated to use non-linear t2d
- // updated to include mini-stagger
+ // one generated electron with p=2.5, th=25, ph=0
+ // (i.e. px=1.057, py=0, pz=2.266)
+ // torus = -1.0 , solenoid = 0.0
- Bank config = new Bank(schemaFactory.getSchema("RUN::config"), 1);
- config.putInt("run", 0, (int) 11);
- config.putInt("event", 0, (int) 1);
- config.putInt("unixtime", 0, (int) 0);
- config.putLong("trigger", 0, (long) 0);
- config.putLong("timestamp", 0, (long) 0);
- config.putByte("type", 0, (byte) 0);
- config.putByte("mode", 0, (byte) 0);
- config.putFloat("torus", 0, (float) -1.0);
- config.putFloat("solenoid", 0, (float) 0.0);
-
- Bank event = new Bank(schemaFactory.getSchema("RECHB::Event"), 1);
- event.putFloat("startTime", 0, (float) 124.25);
+ Bank config = new Bank(schemaFactory.getSchema("RUN::config"), 1);
+ config.putInt("run", 0, (int) 11);
+ config.putInt("event", 0, (int) 1);
+ config.putInt("unixtime", 0, (int) 0);
+ config.putLong("trigger", 0, (long) 0);
+ config.putLong("timestamp", 0, (long) 0);
+ config.putByte("type", 0, (byte) 0);
+ config.putByte("mode", 0, (byte) 0);
+ config.putFloat("torus", 0, (float) -1.0);
+ config.putFloat("solenoid", 0, (float) 0.0);
+
+ Bank event = new Bank(schemaFactory.getSchema("RECHB::Event"), 1);
+ event.putFloat("startTime", 0, (float) 124.25);
+ int[] layer = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10
+ , 11, 12, 13, 14, 15, 16, 16, 17, 18, 19
+ , 20, 21, 22, 23, 24, 25, 25, 26, 27, 28
+ , 29, 30, 30, 31, 32, 33, 33, 34, 35, 26};
+
- int[] layer = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10
- , 11, 12, 13, 14, 15, 16, 17, 18, 19, 20
- , 21, 22, 23, 24, 25, 26, 26, 27, 28, 29
- , 30, 31, 31, 32, 33, 34, 35, 36};
- int[] component = { 63, 64, 63, 64, 63, 64, 64, 64, 64, 64
- , 64, 64, 59, 60, 59, 60, 59, 60, 59, 59
- , 59, 59, 59, 59, 52, 53, 52, 52, 52, 52
- , 52, 52, 51, 52, 51, 52, 51, 51};
- int[] TDC = { 73, 74, 79, 72, 77, 75, 21, 145, 27, 136
- , 29, 136, 149, 124, 99, 192, 43, 260, 89, 142
- , 159, 69, 243, 3, 88, 456, 547, 67, 256, 280
- , 56, 537, 484, 96, 220, 312, 18, 423};
+ int[] component = { 66, 67, 66, 67, 66, 67, 67, 67, 67, 67
+ , 67, 67, 62, 63, 62, 63, 62, 62, 62, 61
+ , 62, 61, 62, 61, 62, 55, 54, 55, 54, 55
+ , 54, 55, 54, 54, 54, 54, 53, 54, 53, 54};
+
+
+ int[] TDC = { 86, 60, 95, 52, 103, 39, 80, 75, 74, 84
+ , 67, 93, 60, 228, 21, 285, 341, 16, 229, 253
+ , 68, 175, 125, 104, 196, 470, 558, 48, 269, 237
+ , 85, 462, 518, 326, 51, 644, 450, 104, 210, 338};
+
- Bank DCtdc = new Bank(schemaFactory.getSchema("DC::tdc"), layer.length);
- for(int i = 0; i < layer.length; i++) {
- DCtdc.putByte("sector", i, (byte) 1);
- DCtdc.putByte("order", i, (byte) 2);
- DCtdc.putByte("layer", i, (byte) layer[i]);
- DCtdc.putShort("component", i, (short) component[i]);
- DCtdc.putInt("TDC", i, TDC[i]);
- }
+ Bank DCtdc = new Bank(schemaFactory.getSchema("DC::tdc"), layer.length);
+ for(int i = 0; i < layer.length; i++) {
+ DCtdc.putByte("sector", i, (byte) 1);
+ DCtdc.putByte("order", i, (byte) 2);
+ DCtdc.putByte("layer", i, (byte) layer[i]);
+ DCtdc.putShort("component", i, (short) component[i]);
+ DCtdc.putInt("TDC", i, TDC[i]);
+ }
diff --git a/common-tools/clas-analysis/src/main/java/org/jlab/analysis/postprocess/Tag1ToEvent.java b/common-tools/clas-analysis/src/main/java/org/jlab/analysis/postprocess/Tag1ToEvent.java
new file mode 100644
index 0000000000..5f5bf6026b
--- /dev/null
+++ b/common-tools/clas-analysis/src/main/java/org/jlab/analysis/postprocess/Tag1ToEvent.java
@@ -0,0 +1,134 @@
+package org.jlab.analysis.postprocess;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.jlab.jnp.hipo4.data.Bank;
+import org.jlab.jnp.hipo4.data.Event;
+
+import org.jlab.jnp.hipo4.io.HipoReader;
+import org.jlab.jnp.hipo4.io.HipoWriterSorted;
+
+import org.jlab.utils.system.ClasUtilsFile;
+
+import org.jlab.detector.decode.DaqScalers;
+import org.jlab.detector.decode.DaqScalersSequence;
+
+import org.jlab.detector.helicity.HelicityBit;
+import org.jlab.detector.helicity.HelicitySequenceManager;
+
+import org.jlab.utils.options.OptionParser;
+
+/**
+ * Calls routines to do analysis and per-event lookup of delayed helicity
+ * and beam charge from tag-1 events, and outputs a file with modified
+ * REC::Event.helicity/beamCharge/liveTime.
+ *
+ * Usage: Tag1ToEvent outputFile inputFile1 [inputFile2 [inputFile3 [...]]]
+ *
+ * FIXME: DaqScalersSequence doesn't manage run numbers. Until then, we
+ * cannot mix run numbers here.
+ *
+ * @author wphelps
+ * @author baltzell
+ */
+
+public class Tag1ToEvent {
+
+ public static void main(String[] args) {
+
+ OptionParser parser = new OptionParser("postprocess");
+ parser.addOption("-q","0","do beam charge and livetime (0/1=false/true)");
+ parser.addOption("-d","0","do delayed helicity (0/1=false/true)");
+ parser.addRequired("-o","output.hipo");
+ parser.parse(args);
+
+ // input files:
+ List inputList = parser.getInputList();
+ if(inputList.isEmpty()==true){
+ parser.printUsage();
+ System.err.println("\n >>>> error : no input file is specified....\n");
+ System.exit(1);
+ }
+
+ // output file:
+ String fileout = parser.getOption("-o").stringValue();
+
+ // helicity / beamcharge options:
+ final boolean doHelicity = parser.getOption("-d").intValue() != 0;
+ final boolean doBeamCharge = parser.getOption("-q").intValue() != 0;
+ if (!doHelicity && !doBeamCharge) {
+ parser.printUsage();
+ System.err.println("\n >>>>> error : at least one of -q/-d must be specified\n");
+ System.exit(1);
+ }
+
+ HelicitySequenceManager helSeq = new HelicitySequenceManager(8,inputList);
+ DaqScalersSequence chargeSeq = DaqScalersSequence.readSequence(inputList);
+
+ HipoWriterSorted writer = new HipoWriterSorted();
+ writer.getSchemaFactory().initFromDirectory(ClasUtilsFile.getResourceDir("COATJAVA", "etc/bankdefs/hipo4"));
+ writer.setCompressionType(1);
+ writer.open(fileout);
+
+ Event event = new Event();
+
+ // we're going to modify this bank:
+ Bank recEventBank = new Bank(writer.getSchemaFactory().getSchema("REC::Event"));
+
+ // FIXME: we shouldn't need this bank, but just the event:
+ Bank runConfigBank = new Bank(writer.getSchemaFactory().getSchema("RUN::config"));
+
+ long badCharge = 0;
+ long goodCharge = 0;
+ long badHelicity = 0;
+ long goodHelicity = 0;
+
+ for (String filename : inputList) {
+
+ HipoReader reader = new HipoReader();
+ reader.open(filename);
+
+ while (reader.hasNext()) {
+
+ reader.nextEvent(event);
+ event.read(recEventBank);
+ event.remove(recEventBank.getSchema());
+
+ // FIXME: we shouldn't need this bank, but just the event:
+ event.read(runConfigBank);
+ final long timestamp = runConfigBank.getLong("timestamp", 0);
+
+ // do the lookups:
+ HelicityBit hb = helSeq.search(event);
+ DaqScalers ds = chargeSeq.get(timestamp);
+
+ // write heliicty to REC::Event:
+ if (Math.abs(hb.value())==1) goodHelicity++;
+ else badHelicity++;
+ if (doHelicity) {
+ recEventBank.putByte("helicity",0,hb.value());
+ }
+
+ // write beam charge to REC::Event:
+ if (ds==null) badCharge++;
+ else {
+ goodCharge++;
+ if (doBeamCharge) {
+ recEventBank.putFloat("beamCharge",0,ds.getBeamCharge());
+ recEventBank.putDouble("liveTime",0,ds.getLivetime());
+ }
+ }
+
+ // update the output file:
+ event.write(recEventBank);
+ writer.addEvent(event, event.getEventTag());
+ }
+ reader.close();
+ }
+ writer.close();
+
+ System.out.println(String.format("Tag1ToEvent: Good Helicity Fraction: %.2f%%",100*(float)goodHelicity/(goodHelicity+badHelicity)));
+ System.out.println(String.format("Tag1ToEvent: Good Charge Fraction: %.2f%%",100*(float)goodCharge/(goodCharge+badCharge)));
+ }
+}
diff --git a/common-tools/clas-detector/pom.xml b/common-tools/clas-detector/pom.xml
index 6cbfa77191..bbf38fb4ea 100644
--- a/common-tools/clas-detector/pom.xml
+++ b/common-tools/clas-detector/pom.xml
@@ -3,14 +3,14 @@
4.0.0
org.jlab.clas
clas-detector
- 6.3.1-SNAPSHOT
+ 6.5.3-SNAPSHOT
jar
org.jlab.clas
clas12rec
../../parent/pom.xml
- 6.3.1-SNAPSHOT
+ 6.5.3-SNAPSHOT
@@ -30,7 +30,7 @@
org.jlab.clas
clas-utils
- 6.3.1-SNAPSHOT
+ 6.5.3-SNAPSHOT
@@ -42,13 +42,13 @@
org.jlab.clas
clas-io
- 6.3.1-SNAPSHOT
+ 6.5.3-SNAPSHOT
org.jlab.clas
clas-geometry
- 6.3.1-SNAPSHOT
+ 6.5.3-SNAPSHOT
diff --git a/common-tools/clas-detector/src/main/java/org/jlab/detector/base/DetectorDescriptor.java b/common-tools/clas-detector/src/main/java/org/jlab/detector/base/DetectorDescriptor.java
index c20ad2d7b9..81d12615df 100644
--- a/common-tools/clas-detector/src/main/java/org/jlab/detector/base/DetectorDescriptor.java
+++ b/common-tools/clas-detector/src/main/java/org/jlab/detector/base/DetectorDescriptor.java
@@ -69,20 +69,23 @@ public void setOrder(int order){
public final void setType(DetectorType type){
this.detectorType = type;
}
-
+
+ public final void setLayer(int layer) {
+ this.dt_LAYER = layer;
+ }
+
public final void setCrateSlotChannel(int crate, int slot, int channel){
this.hw_CRATE = crate;
this.hw_SLOT = slot;
this.hw_CHANNEL = channel;
}
-
+
public final void setSectorLayerComponent(int sector, int layer, int comp){
this.dt_SECTOR = sector;
this.dt_LAYER = layer;
this.dt_COMPONENT = comp;
}
-
-
+
public static int generateHashCode(int s, int l, int c){
return ((s<<24)&0xFF000000)|
((l<<16)&0x00FF0000)|(c&0x0000FFFF);
@@ -94,8 +97,7 @@ public int getHashCode(){
(this.dt_COMPONENT&0x00000FFF);
return hash;
}
-
-
+
public void copy(DetectorDescriptor desc){
this.hw_SLOT = desc.hw_SLOT;
diff --git a/common-tools/clas-detector/src/main/java/org/jlab/detector/base/DetectorLayer.java b/common-tools/clas-detector/src/main/java/org/jlab/detector/base/DetectorLayer.java
index b3b2564ef5..1f2241a221 100644
--- a/common-tools/clas-detector/src/main/java/org/jlab/detector/base/DetectorLayer.java
+++ b/common-tools/clas-detector/src/main/java/org/jlab/detector/base/DetectorLayer.java
@@ -9,14 +9,17 @@ public class DetectorLayer {
public static final byte PCAL_U=1;
public static final byte PCAL_V=2;
public static final byte PCAL_W=3;
+ public static final byte PCAL_Z=9; // layer number used to define the longitudinal coordinate of the cluster
public static final byte EC_INNER_U=4;
public static final byte EC_INNER_V=5;
public static final byte EC_INNER_W=6;
+ public static final byte EC_INNER_Z=0; // layer number used to define the longitudinal coordinate of the cluster
public static final byte EC_OUTER_U=7;
public static final byte EC_OUTER_V=8;
public static final byte EC_OUTER_W=9;
+ public static final byte EC_OUTER_Z=0; // layer number used to define the longitudinal coordinate of the cluster
public static final byte PCAL=PCAL_U;
public static final byte EC_INNER=EC_INNER_U;
diff --git a/common-tools/clas-detector/src/main/java/org/jlab/detector/base/GeometryFactory.java b/common-tools/clas-detector/src/main/java/org/jlab/detector/base/GeometryFactory.java
index c8cf35c2de..32fd485b3e 100644
--- a/common-tools/clas-detector/src/main/java/org/jlab/detector/base/GeometryFactory.java
+++ b/common-tools/clas-detector/src/main/java/org/jlab/detector/base/GeometryFactory.java
@@ -46,6 +46,7 @@ public static ConstantProvider getConstants(DetectorType type, int run, String v
provider.loadTable("/geometry/dc/layer");
provider.loadTable("/geometry/dc/alignment");
provider.loadTable("/geometry/dc/ministagger");
+ provider.loadTable("/geometry/dc/endplatesbow");
}
if(type==DetectorType.ECAL){
@@ -101,6 +102,7 @@ public static ConstantProvider getConstants(DetectorType type, int run, String v
provider.loadTable("/geometry/cvt/svt/material/box");
provider.loadTable("/geometry/cvt/svt/material/tube");
provider.loadTable("/geometry/cvt/svt/alignment");
+ provider.loadTable("/geometry/target");
}
if(type==DetectorType.TARGET){
diff --git a/common-tools/clas-detector/src/main/java/org/jlab/detector/calib/utils/ConstantsManager.java b/common-tools/clas-detector/src/main/java/org/jlab/detector/calib/utils/ConstantsManager.java
index 7d40695e0f..8e76419037 100644
--- a/common-tools/clas-detector/src/main/java/org/jlab/detector/calib/utils/ConstantsManager.java
+++ b/common-tools/clas-detector/src/main/java/org/jlab/detector/calib/utils/ConstantsManager.java
@@ -22,8 +22,12 @@ public class ConstantsManager {
private DatabaseConstantsDescriptor defaultDescriptor = new DatabaseConstantsDescriptor();
private volatile Map runConstants = new LinkedHashMap();
+ private volatile Map runConstantRequestHistory = new LinkedHashMap();
+
private String databaseVariation = "default";
private String timeStamp = "";
+ private int requestStatus = 0;
+ private int maxRequests = 2;
private volatile Map rcdbConstants = new LinkedHashMap();
@@ -51,6 +55,10 @@ public synchronized void init(List tables){
this.defaultDescriptor.addTables(tables);
}
+ public int getRequestStatus(){
+ return requestStatus;
+ }
+
public synchronized void init(List keys, List tables){
Set keysSet = new LinkedHashSet(keys);
Set tablesSet = new LinkedHashSet(tables);
@@ -85,6 +93,18 @@ private synchronized void loadConstantsForRun(int run){
if(this.runConstants.containsKey(run)==true) return;
+ if(this.runConstantRequestHistory.containsKey(run)==false){
+ runConstantRequestHistory.put(run, 1);
+ } else {
+ int requests = runConstantRequestHistory.get(run);
+ runConstantRequestHistory.put(run, requests+1);
+ if(requests>maxRequests) {
+ requestStatus = -1;
+ System.out.println("[ConstantsManager] exceeded maximum requests " + requests + " for run " + run);
+ }
+ }
+ //String historyString =
+ //if()
System.out.println("[ConstantsManager] ---> loading table for run = " + run);
DatabaseConstantsDescriptor desc = defaultDescriptor.getCopy(run);
DatabaseConstantProvider provider = new DatabaseConstantProvider(run,
@@ -118,6 +138,10 @@ private synchronized void loadConstantsForRun(int run){
rcdbpro.disconnect();
}
+ public void reset(){
+ this.runConstants.clear();
+ }
+
@Override
public String toString(){
StringBuilder str = new StringBuilder();
@@ -229,9 +253,12 @@ public static void main(String[] args){
manager.init(Arrays.asList(new String[]{
"/daq/fadc/ec",
"/daq/fadc/ftof","/daq/fadc/htcc"}));
-
- IndexedTable table1 = manager.getConstants(10, "/daq/fadc/htcc");
- IndexedTable table2 = manager.getConstants(10, "/daq/fadc/ec");
- IndexedTable table3 = manager.getConstants(12, "/daq/fadc/htcc");
+ for(int i = 0; i < 5 ; i++){
+ IndexedTable table1 = manager.getConstants(10, "/daq/fadc/htcc");
+ IndexedTable table2 = manager.getConstants(10, "/daq/fadc/ec");
+ IndexedTable table3 = manager.getConstants(12, "/daq/fadc/htcc");
+ manager.reset();
+ System.out.println("\n\n STATUS = " + manager.getRequestStatus());
+ }
}
}
diff --git a/common-tools/clas-detector/src/main/java/org/jlab/detector/calib/utils/RCDBConstants.java b/common-tools/clas-detector/src/main/java/org/jlab/detector/calib/utils/RCDBConstants.java
index 2372350831..429be436b2 100644
--- a/common-tools/clas-detector/src/main/java/org/jlab/detector/calib/utils/RCDBConstants.java
+++ b/common-tools/clas-detector/src/main/java/org/jlab/detector/calib/utils/RCDBConstants.java
@@ -70,7 +70,7 @@ public Long getLong(String key) {
}
public Time getTime(String key) {
if (data.containsKey(key)) {
- if (data.get(key).getValue() instanceof Double) {
+ if (data.get(key).getValue() instanceof Time) {
return (Time) data.get(key).getValue();
}
}
diff --git a/common-tools/clas-detector/src/main/java/org/jlab/detector/decode/BonusDecoder.java b/common-tools/clas-detector/src/main/java/org/jlab/detector/decode/BonusDecoder.java
new file mode 100644
index 0000000000..d71b693fcf
--- /dev/null
+++ b/common-tools/clas-detector/src/main/java/org/jlab/detector/decode/BonusDecoder.java
@@ -0,0 +1,101 @@
+/*
+ * 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.detector.decode;
+
+import java.util.ArrayList;
+import java.util.List;
+import org.jlab.coda.jevio.EvioNode;
+import org.jlab.io.evio.EvioDataEvent;
+import org.jlab.io.evio.EvioTreeBranch;
+import org.jlab.io.evio.EvioSource;
+/**
+ *
+ * @author gavalian
+ */
+public class BonusDecoder {
+ private CodaEventDecoder codaDecoder = null;
+ private EvioSource reader = new EvioSource();
+
+ public BonusDecoder(){
+ codaDecoder = new CodaEventDecoder();
+ }
+
+ public void open(String filename){
+ reader.open(filename);
+ }
+
+ public boolean hasEvent(){
+ return reader.hasEvent();
+ }
+
+ public List nextEvent(int crate){
+
+ EvioDataEvent event = (EvioDataEvent) reader.getNextEvent();
+ List branches = codaDecoder.getEventBranches(event);
+ //System.out.println("Next Event-----");
+ for(int i = 0; i < branches.size(); i++){
+ EvioTreeBranch branch = branches.get(i);
+ //System.out.println("node found : tag = " + branch.getTag() + " num = " + branch.getNum());
+ if(branch.getTag()==crate){
+ for(EvioNode node : branch.getNodes()){
+ /*System.out.println("\t ["+branch.getTag()+"] : node : tag = "
+ + node.getTag() + " , num = " + node.getNum() + ", type = " +
+ node.getDataTypeObj());*/
+ if(node.getTag()==57641){
+ //System.out.println("analyzing data----");
+ List data = codaDecoder.getDataEntries_57641(crate, node, event);
+ return data;
+ //System.out.println("data size = " + data.size());
+ /*for(int d = 0; d < data.size(); d++){
+ System.out.println(data.get(d).toString());
+ //data.get(i).
+ }*/
+ }
+ }
+ }
+ }
+ return new ArrayList();
+ //EvioTreeBranch cbranch = codaDecoder.getEventBranch(branches, crate);
+ //if(cbranch == null ) return ;
+/*
+ for (EvioNode node : cbranch.getNodes()) {
+ if(node.getTag()==57641){
+ // This is bit-packed PULSE mode for BONUS
+ System.err.println("found tag = " + node.getTag() + " " + node.getNum());
+ //getDataEntries_57640(crate, node, event);
+ }
+ }*/
+ }
+
+ public static void main(String[] args){
+ String filename = "/Users/gavalian/Work/DataSpace/clas12/bonus/bonustest_000002.evio.00000";
+ BonusDecoder decoder = new BonusDecoder();
+ decoder.open(filename);
+ int counter = 0;
+ while(decoder.hasEvent()==true&&counter<100){
+ counter++;
+ decoder.nextEvent(63);
+
+ List data = decoder.nextEvent(63);
+ System.out.println("printout event # " + counter);
+ for(int i = 0; i < data.size(); i++){
+ DetectorDataDgtz bonusData = data.get(i);
+ long timestamp = bonusData.getADCData(0).getTimeStamp();
+ short[] pulse = bonusData.getADCData(0).getPulseArray();
+ System.out.println("TIME STAMP = " + timestamp);
+ int crate = bonusData.getDescriptor().getCrate();
+ int slot = bonusData.getDescriptor().getSlot();
+ int channel = bonusData.getDescriptor().getChannel();
+ System.out.printf("CRATE : %5d , SLOT : %5d , CHANNEL = %5d \n",crate,slot,channel);
+ System.out.printf("%6d : ",pulse.length);
+ for(int p = 0; p < pulse.length; p++){
+ System.out.printf("%6d ", pulse[p]);
+ }
+ System.out.println();
+ }
+ }
+ }
+}
diff --git a/common-tools/clas-detector/src/main/java/org/jlab/detector/decode/CLASDecoder4.java b/common-tools/clas-detector/src/main/java/org/jlab/detector/decode/CLASDecoder4.java
index 3b98499074..d6443a8731 100644
--- a/common-tools/clas-detector/src/main/java/org/jlab/detector/decode/CLASDecoder4.java
+++ b/common-tools/clas-detector/src/main/java/org/jlab/detector/decode/CLASDecoder4.java
@@ -273,6 +273,7 @@ public Bank getDataBankADC(String name, DetectorType type){
adcBANK.putInt("integral", i, adcDGTZ.get(i).getADCData(0).getIntegral());
adcBANK.putLong("timestamp", i, adcDGTZ.get(i).getADCData(0).getTimeStamp());
}
+ if(name == "BAND::adc") adcBANK.putInt("amplitude", i, adcDGTZ.get(i).getADCData(0).getHeight());
}
return adcBANK;
}
@@ -451,7 +452,20 @@ public Event getDataEvent(){
} catch(Exception e) {
e.printStackTrace();
}
-
+ //-----------------------------------------------------
+ // CREATING BONUS BANK --------------------------------
+ //-----------------------------------------------------
+ try {
+ //System.out.println("creating bonus bank....");
+ Bank bonusBank = this.createBonusBank();
+ if(bonusBank!=null){
+ if(bonusBank.getRows()>0){
+ event.write(bonusBank);
+ }
+ }
+ } catch(Exception e) {
+ e.printStackTrace();
+ }
return event;
}
@@ -602,7 +616,51 @@ public Bank createReconScalerBank(Event event){
return scalerBank;
}
-
+
+ public Bank createBonusBank(){
+ //System.out.println("create bonus bank function...");
+ if(schemaFactory.hasSchema("RTPC::adc")==false) return null;
+ //System.out.println("bank descriptor does exist");
+ List bonusData = this.getEntriesADC(DetectorType.RTPC);
+ //System.out.println("number of entries in the list = " + bonusData.size()
+ //+ " data list size = " + dataList.size());
+ int totalSize = 0;
+ for(int i = 0; i < bonusData.size(); i++){
+ short[] pulse = bonusData.get(i).getADCData(0).getPulseArray();
+ totalSize += pulse.length;
+ }
+
+ Bank bonusBank = new Bank(schemaFactory.getSchema("RTPC::adc"), totalSize);
+ int currentRow = 0;
+ for(int i = 0; i < bonusData.size(); i++){
+
+ DetectorDataDgtz bonus = bonusData.get(i);
+
+ short[] pulses = bonus.getADCData(0).getPulseArray();
+ long timestamp = bonus.getADCData(0).getTimeStamp();
+ double time = bonus.getADCData(0).getTime();
+ double coeff = time*120.0;
+
+ double offset1 = 0.0;
+ double offset2 = (double) (8*(timestamp%8));
+
+ for(int k = 0; k < pulses.length; k++){
+
+ double pulseTime = coeff + offset1 + offset2 + k*120.0;
+
+ bonusBank.putByte("sector", currentRow, (byte) bonus.getDescriptor().getSector());
+ bonusBank.putByte("layer" , currentRow, (byte) bonus.getDescriptor().getLayer());
+ bonusBank.putShort("component", currentRow, (short) bonus.getDescriptor().getComponent());
+ bonusBank.putByte("order", currentRow, (byte) bonus.getDescriptor().getOrder());
+ bonusBank.putInt("ADC", currentRow, pulses[k]);
+ bonusBank.putFloat("time", currentRow, (float) pulseTime);
+ bonusBank.putShort("ped", currentRow, (short) 0);
+ currentRow++;
+ }
+ }
+
+ return bonusBank;
+ }
public Bank createHelicityFlipBank(Event event,HelicityState state) {
IndexedTable hwpTable=this.detectorDecoder.scalerManager.getConstants(
this.detectorDecoder.getRunNumber(),"/runcontrol/hwp");
@@ -769,6 +827,9 @@ public static void main(String[] args){
counter++;
progress.updateStatus();
+ if(counter%25000==0){
+ System.gc();
+ }
if(nevents>0){
if(counter>=nevents) break;
}
diff --git a/common-tools/clas-detector/src/main/java/org/jlab/detector/decode/CodaEventDecoder.java b/common-tools/clas-detector/src/main/java/org/jlab/detector/decode/CodaEventDecoder.java
index 2622173406..f42791afda 100644
--- a/common-tools/clas-detector/src/main/java/org/jlab/detector/decode/CodaEventDecoder.java
+++ b/common-tools/clas-detector/src/main/java/org/jlab/detector/decode/CodaEventDecoder.java
@@ -44,9 +44,11 @@ public class CodaEventDecoder {
private int timeStampErrors = 0;
private long triggerBits = 0;
private byte helicityLevel3 = HelicityBit.UDF.value();
- private List triggerWords = new ArrayList<>();
+ private List triggerWords = new ArrayList<>();
JsonObject epicsData = new JsonObject();
+ private final long timeStampTolerance = 0L;
+
public CodaEventDecoder(){
}
@@ -86,7 +88,7 @@ public JsonObject getEpicsData(){
public List getTriggerWords(){
return this.triggerWords;
}
-
+
private void printByteBuffer(ByteBuffer buffer, int max, int columns){
int n = max;
if(buffer.capacity()0) {
long ts = tiEntries.get(0).getTimeStamp();
for(int i=1; ithis.timeStampTolerance) {
tiSync=false;
if(this.timeStampErrors<100) {
System.out.println("WARNING: mismatch in TI time stamps: crate "
+ tiEntries.get(i).getDescriptor().getCrate() + " reports "
- + tiEntries.get(i).getTimeStamp() + " instead of " + ts);
+ + tiEntries.get(i).getTimeStamp() + " instead of the " + ts
+ + " from crate " + tiEntries.get(0).getDescriptor().getCrate());
this.timeStampErrors++;
}
}
@@ -151,7 +154,7 @@ public void setTriggerBits(long triggerBits) {
this.triggerBits = triggerBits;
}
-
+
public List getADCEntries(EvioDataEvent event){
List entries = new ArrayList();
List branches = this.getEventBranches(event);
@@ -163,38 +166,38 @@ public List getADCEntries(EvioDataEvent event){
}
return entries;
}
-
+
public List getADCEntries(EvioDataEvent event, int crate){
List entries = new ArrayList();
-
+
List branches = this.getEventBranches(event);
EvioTreeBranch cbranch = this.getEventBranch(branches, crate);
-
+
if(cbranch == null ) return null;
-
+
for(EvioNode node : cbranch.getNodes()){
if(node.getTag()==57638){
//System.out.println(" NODE = " + node.getTag() + " , " + node.getNum() +
- // " , " + node.getTypeObj().name());
+ // " , " + node.getTypeObj().name());
return this.getDataEntries_57638(crate, node, event);
}
}
-
+
return entries;
}
-
+
public List getADCEntries(EvioDataEvent event, int crate, int tagid){
-
+
List adc = new ArrayList();
List branches = this.getEventBranches(event);
-
+
EvioTreeBranch cbranch = this.getEventBranch(branches, crate);
if(cbranch == null ) return null;
-
+
for(EvioNode node : cbranch.getNodes()){
-//
+//
//if(node.getTag()==57638){
if(node.getTag()==tagid){
// This is regular integrated pulse mode, used for FTOF
@@ -202,11 +205,11 @@ public List getADCEntries(EvioDataEvent event, int crate, int tagid){
return this.getADCEntries_Tag(crate, node, event,tagid);
//return this.getDataEntriesMode_7(crate,node, event);
}
-
+
}
return adc;
}
-
+
/**
* returns list of decoded data in the event for given crate.
* @param event
@@ -226,7 +229,7 @@ public List getDataEntries(EvioDataEvent event, int crate){
// This is regular integrated pulse mode, used for FTOF
// FTCAL and EC/PCAL
//return this.getDataEntries_57602(crate, node, event);
-
+
this.readHeaderBank(crate, node, event);
//return this.getDataEntriesMode_7(crate,node, event);
}
@@ -245,7 +248,7 @@ public List getDataEntries(EvioDataEvent event, int crate){
// This is regular integrated pulse mode, used for FTOF
// FTCAL and EC/PCAL
//return this.getDataEntries_57602(crate, node, event);
-
+
return this.getDataEntries_57617(crate, node, event);
//return this.getDataEntriesMode_7(crate,node, event);
}
@@ -253,33 +256,33 @@ else if(node.getTag()==57602){
// This is regular integrated pulse mode, used for FTOF
// FTCAL and EC/PCAL
//return this.getDataEntries_57602(crate, node, event);
-
+
return this.getDataEntries_57602(crate, node, event);
//return this.getDataEntriesMode_7(crate,node, event);
}
else if(node.getTag()==57601){
// This is regular integrated pulse mode, used for FTOF
// FTCAL and EC/PCAL
-
+
return this.getDataEntries_57601(crate, node, event);
//return this.getDataEntriesMode_7(crate,node, event);
}
else if(node.getTag()==57627){
// This is regular integrated pulse mode, used for MM
-
+
return this.getDataEntries_57627(crate, node, event);
//return this.getDataEntriesMode_7(crate,node, event);
}
else if(node.getTag()==57640){
// This is bit-packed pulse mode, used for MM
-
+
return this.getDataEntries_57640(crate, node, event);
//return this.getDataEntriesMode_7(crate,node, event);
}
else if(node.getTag()==57622){
// This is regular integrated pulse mode, used for FTOF
// FTCAL and EC/PCAL
-
+
return this.getDataEntries_57622(crate, node, event);
//return this.getDataEntriesMode_7(crate,node, event);
}
@@ -287,6 +290,10 @@ else if(node.getTag()==57636){
// RICH TDC data
return this.getDataEntries_57636(crate, node, event);
//return this.getDataEntriesMode_7(crate,node, event);
+ } else if(node.getTag()==57641){
+ // RTPC data decoding
+ return this.getDataEntries_57641(crate, node, event);
+ //return this.getDataEntriesMode_7(crate,node, event);
}
}
return bankEntries;
@@ -431,7 +438,7 @@ public ArrayList getDataEntries_57617(Integer crate, EvioNode
int halfID = DataUtils.getInteger(halfWord, 3, 3);
int adc = adcbyte;
Integer channelKey = ((half<<8) | (channel & 0xff));
-
+
// System.err.println( "Half/chip = " + half + " CHIP = " + chipID + " HALF = " + halfID + " CHANNEL = " + channel + " KEY = " + channelKey );
// TDC data entry
@@ -441,7 +448,7 @@ public ArrayList getDataEntries_57617(Integer crate, EvioNode
chipID = DataUtils.getInteger(halfWord, 0, 1) + 1;
channel = 0;
channelKey = 0;
- tdc = (short) ((adcbyte<<8) | (tdcbyte & 0xff));
+ tdc = (short) ((adcbyte<<8) | (tdcbyte & 0xff));
// System.err.println( "Half/chip = " + half + " CHIP = " + chipID + " HALF = " + halfID + " TDC = " + tdcbyte + " ADC = " + adc + " Time = " + tdc );
adc = -1;
}
@@ -476,7 +483,7 @@ public ArrayList getDataEntries_57617(Integer crate, EvioNode
}
return rawdata;
}
-
+
public List getADCEntries_Tag(Integer crate, EvioNode node, EvioDataEvent event, int tagid){
List entries = new ArrayList();
if(node.getTag()==tagid){
@@ -570,7 +577,7 @@ public void decodeComposite(ByteBuffer buffer, int offset, List ctypes
citems.add(counter);
ctypes.add(DataType.NVALUE);
position++;
-
+
for(int i = 0; i < counter; i++){
Short channel = (short) (0x00FF&(buffer.get(position)));
position++;
@@ -592,7 +599,7 @@ public void decodeComposite(ByteBuffer buffer, int offset, List ctypes
System.out.println("Exception : Length = " + length + " position = " + position);
}
}
-
+
public List getDataEntries_57638(Integer crate, EvioNode node, EvioDataEvent event){
List entries = new ArrayList();
if(node.getTag()==57638){
@@ -600,7 +607,7 @@ public List getDataEntries_57638(Integer crate, EvioNode node, EvioDa
ByteBuffer compBuffer = node.getByteData(true);
//System.out.println(" COMPOSITE TYPE = " + node.getTypeObj().name() + " " + node.getDataTypeObj().name());
//System.out.println(" COMPOSITE BUFFER = " + compBuffer.array().length);
-
+
/*for(int i = 0; i < compBuffer.array().length; i++){
short value = (short) (0x00FF&(compBuffer.array()[i]));
System.out.println(String.format("%4d %4d ",i,value));
@@ -609,7 +616,7 @@ public List getDataEntries_57638(Integer crate, EvioNode node, EvioDa
List cdatatypes = new ArrayList();
List