diff --git a/build-coatjava.sh b/build-coatjava.sh index dcb6bdf617..121b0f78e2 100755 --- a/build-coatjava.sh +++ b/build-coatjava.sh @@ -311,10 +311,6 @@ cp -r libexec $prefix_dir/ which python3 >& /dev/null && python=python3 || python=python $python etc/bankdefs/util/bankSplit.py $prefix_dir/etc/bankdefs/hipo4 || exit 1 -# FIXME: this is still needed by one of the tests -mkdir -p $prefix_dir/lib/utils -cp external-dependencies/jclara-4.3-SNAPSHOT.jar $prefix_dir/lib/utils - # build (and test) unset CLAS12DIR if $runUnitTests; then diff --git a/common-tools/coat-libs/pom.xml b/common-tools/coat-libs/pom.xml index a7dafd7878..4aab08fa8b 100644 --- a/common-tools/coat-libs/pom.xml +++ b/common-tools/coat-libs/pom.xml @@ -203,12 +203,9 @@ cnuphys:cnuphys - cnuphys:bCNU - cnuphys:bCNU3D cnuphys:jogl-all cnuphys:jogl cnuphys:gluegen - org.jlab.coda:jclara org.jacoco diff --git a/external-dependencies/jclara-4.3-SNAPSHOT.jar b/external-dependencies/jclara-4.3-SNAPSHOT.jar deleted file mode 100644 index 65cc502dab..0000000000 Binary files a/external-dependencies/jclara-4.3-SNAPSHOT.jar and /dev/null differ diff --git a/pom.xml b/pom.xml index 78f8f8a96d..75e1343339 100644 --- a/pom.xml +++ b/pom.xml @@ -131,7 +131,7 @@ org.jlab.coda jclara - 4.3-SNAPSHOT + 4.3 diff --git a/validation/advanced-tests/run-eb-tests.sh b/validation/advanced-tests/run-eb-tests.sh index 02e8909afb..7a78f73285 100755 --- a/validation/advanced-tests/run-eb-tests.sh +++ b/validation/advanced-tests/run-eb-tests.sh @@ -1,162 +1,63 @@ #!/bin/bash -webDir=http://clasweb.jlab.org/clas12offline/distribution/coatjava/validation_files/eb -webVersion=5.11-fid-tm-dc2-r11 -webDir=$webDir/$webVersion -webDir=./data/$webVersion - # coatjava must already be built at ../../coatjava/ # and input test data files at ./data -# whether to use CLARA (0=no) -useClara=0 - -# if non-zero, don't redownload dependencies, don't run reconstruction: -runTestOnly=0 +#set -x # print every command executed -# 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 +input_dir=./data/5.11-fid-tm-dc2-r11 -# 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 +source ../../coatjava/libexec/env.sh -nEvents=-1 +classPath="${COATJAVA_CLASSPATH}:../lib/*:src/" +# check arguments: for arg in $@ do - if [ "$arg" == "-t" ] + if [[ $arg == "-100" ]] then - runTestOnly=1 - elif [[ $arg == "-100" ]] - then - webDir=${webDir}-100 + input_dir=${input_dir}-100 fi done # last argument is input file stub: stub="${@: -1}" -# sanity check on filestub name, -# just to error with reasonable message before proceeding: +# check (file)stub name: 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) - ;; + 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 -# 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/ - source $COAT/libexec/env.sh - export CLARA_HOME -fi - -classPath="${COATJAVA_CLASSPATH}:../lib/*:src/" - -# make sure test code compiles before anything else: +# compile test code: javac -cp $classPath src/eb/EBTwoTrackTest.java if [ $? != 0 ] ; then echo "EBTwoTrackTest compilation failure" ; exit 1 ; fi -# 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 - +# run reconstruction: +rm -f out_${stub}.hipo +../../coatjava/bin/recon-util -l FINE -i ${input_dir}/${stub}.hipo -o out_${stub}.hipo -c 2 - # install clara - if ! [ -d clara_installation ] - then - ../../bin/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 -l FINE -i ${webDir}/${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 -fi - -# run Event Builder tests: +# run EB tests: java -DCLAS12DIR="$COAT" -Xmx1536m -Xms1024m -cp $classPath -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 +# run truth-efficiency calculator: $COAT/bin/trutheff ./out_${stub}.hipo -exit 0 - diff --git a/validation/advanced-tests/src/eb/EBTwoTrackTest.java b/validation/advanced-tests/src/eb/EBTwoTrackTest.java index a0e4b26f40..92112431d2 100644 --- a/validation/advanced-tests/src/eb/EBTwoTrackTest.java +++ b/validation/advanced-tests/src/eb/EBTwoTrackTest.java @@ -1,12 +1,10 @@ package eb; import java.io.File; -import org.junit.Test; import java.util.Map; import java.util.HashMap; import java.util.List; import java.util.ArrayList; -import static org.junit.Assert.*; import org.jlab.io.base.DataBank; import org.jlab.io.base.DataEvent; @@ -78,7 +76,19 @@ public class EBTwoTrackTest { Map > recSciMap=new HashMap>(); Map > recTrkMap=new HashMap>(); - @Test + void assertEquals(boolean a, boolean b) { + if (a!=b) { + System.err.println("Assertion Failed!"); + System.exit(3); + } + } + void assertEquals(String msg, int a, int b) { + if (a!=b) { + System.err.println(msg); + System.exit(3); + } + } + public void main() { String fileName=System.getProperty("INPUTFILE"); File file = new File(fileName);