Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions build-coatjava.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 0 additions & 3 deletions common-tools/coat-libs/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -203,12 +203,9 @@
<artifactSet>
<excludes>
<exclude>cnuphys:cnuphys</exclude>
<exclude>cnuphys:bCNU</exclude>
<exclude>cnuphys:bCNU3D</exclude>
<exclude>cnuphys:jogl-all</exclude>
<exclude>cnuphys:jogl</exclude>
<exclude>cnuphys:gluegen</exclude>
<exclude>org.jlab.coda:jclara</exclude>
<exclude>org.jacoco</exclude>
</excludes>
</artifactSet>
Expand Down
Binary file removed external-dependencies/jclara-4.3-SNAPSHOT.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@
<dependency>
<groupId>org.jlab.coda</groupId>
<artifactId>jclara</artifactId>
<version>4.3-SNAPSHOT</version> <!-- WARNING: if changed, check the `com.google.code.gson:gson` version; see `docs/dependency_conflicts.md` -->
<version>4.3</version>
</dependency>

<dependency>
Expand Down
159 changes: 30 additions & 129 deletions validation/advanced-tests/run-eb-tests.sh
Original file line number Diff line number Diff line change
@@ -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

16 changes: 13 additions & 3 deletions validation/advanced-tests/src/eb/EBTwoTrackTest.java
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -78,7 +76,19 @@ public class EBTwoTrackTest {
Map <Integer,List<Integer>> recSciMap=new HashMap<Integer,List<Integer>>();
Map <Integer,List<Integer>> recTrkMap=new HashMap<Integer,List<Integer>>();

@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);
Expand Down
Loading