Skip to content

Commit c9cf010

Browse files
baltzelltongtongcao
authored andcommitted
remove rogue clara jar (#1148)
1 parent eccd59f commit c9cf010

File tree

6 files changed

+59
-144
lines changed

6 files changed

+59
-144
lines changed

build-coatjava.sh

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -311,10 +311,6 @@ cp -r libexec $prefix_dir/
311311
which python3 >& /dev/null && python=python3 || python=python
312312
$python etc/bankdefs/util/bankSplit.py $prefix_dir/etc/bankdefs/hipo4 || exit 1
313313

314-
# FIXME: this is still needed by one of the tests
315-
mkdir -p $prefix_dir/lib/utils
316-
cp external-dependencies/jclara-4.3-SNAPSHOT.jar $prefix_dir/lib/utils
317-
318314
# build (and test)
319315
unset CLAS12DIR
320316
if $runUnitTests; then
@@ -359,6 +355,11 @@ for pom in $(find common-tools -name pom.xml); do
359355
# install_jars $pom $prefix_dir/lib/services
360356
fi
361357
done
358+
359+
# install CLARA jar in separate directory:
360+
mvn org.apache.maven.plugins:maven-dependency-plugin:3.10.0:copy \
361+
-Dartifact=org.jlab.coda:jclara:4.3:jar -DoutputDirectory=$prefix_dir/lib/utils -DstripVersion=false
362+
362363
echo "installed coatjava to: $prefix_dir"
363364

364365
# install clara

common-tools/coat-libs/pom.xml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,8 +203,6 @@
203203
<artifactSet>
204204
<excludes>
205205
<exclude>cnuphys:cnuphys</exclude>
206-
<exclude>cnuphys:bCNU</exclude>
207-
<exclude>cnuphys:bCNU3D</exclude>
208206
<exclude>cnuphys:jogl-all</exclude>
209207
<exclude>cnuphys:jogl</exclude>
210208
<exclude>cnuphys:gluegen</exclude>
-420 KB
Binary file not shown.

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@
131131
<dependency>
132132
<groupId>org.jlab.coda</groupId>
133133
<artifactId>jclara</artifactId>
134-
<version>4.3-SNAPSHOT</version> <!-- WARNING: if changed, check the `com.google.code.gson:gson` version; see `docs/dependency_conflicts.md` -->
134+
<version>4.3</version>
135135
</dependency>
136136

137137
<dependency>
Lines changed: 32 additions & 131 deletions
Original file line numberDiff line numberDiff line change
@@ -1,162 +1,63 @@
11
#!/bin/bash
22

3-
webDir=http://clasweb.jlab.org/clas12offline/distribution/coatjava/validation_files/eb
4-
webVersion=5.11-fid-tm-dc2-r11
5-
webDir=$webDir/$webVersion
6-
webDir=./data/$webVersion
7-
83
# coatjava must already be built at ../../coatjava/
94
# and input test data files at ./data
105

11-
# whether to use CLARA (0=no)
12-
useClara=0
13-
14-
# if non-zero, don't redownload dependencies, don't run reconstruction:
15-
runTestOnly=0
6+
#set -x # print every command executed
167

17-
# gemc default solenoid (changed in 4a.2.4):
18-
gemcSolenoidDefault=-1.0
19-
if [[ $webVersion = *"4a.2.2"* ]] || [[ $webVersion = *"4a.2.3"* ]]
20-
then
21-
gemcSolenoidDefault=1.0
22-
fi
8+
input_dir=./data/5.11-fid-tm-dc2-r11
239

24-
# geometry variation for DC
25-
geoDbVariation="default"
26-
if [[ $webVersion = *"4a.2.2"* ]] || [[ $webVersion = *"4a.2.3"* ]] || [[ $webVersion = *"4a.2.4"* ]]
27-
then
28-
geoDbVariation="dc_geo_gemc424"
29-
fi
10+
source ../../coatjava/libexec/env.sh
3011

31-
nEvents=-1
12+
classPath="${COATJAVA_CLASSPATH}:../lib/*:src/"
3213

14+
# check arguments:
3315
for arg in $@
3416
do
35-
if [ "$arg" == "-t" ]
17+
if [[ $arg == "-100" ]]
3618
then
37-
runTestOnly=1
38-
elif [[ $arg == "-100" ]]
39-
then
40-
webDir=${webDir}-100
19+
input_dir=${input_dir}-100
4120
fi
4221
done
4322

4423
# last argument is input file stub:
4524
stub="${@: -1}"
4625

47-
# sanity check on filestub name,
48-
# just to error with reasonable message before proceeding:
26+
# check (file)stub name:
4927
case $stub in
50-
# electron in forward, hadron in forward:
51-
electronproton)
52-
;;
53-
electronkaon)
54-
;;
55-
electronpion)
56-
;;
57-
electrongamma)
58-
;;
59-
electronneutron)
60-
;;
61-
electronFTproton)
62-
;;
63-
electronFTkaon)
64-
;;
65-
electronFTpion)
66-
;;
67-
electronFTgamma)
68-
;;
69-
electrongammaFT)
70-
;;
71-
electronprotonC)
72-
;;
73-
electronkaonC)
74-
;;
75-
electronpionC)
76-
;;
77-
electrongammaC)
78-
;;
79-
electronneutronC)
80-
;;
81-
electrondeuteronC)
82-
;;
28+
electronproton) ;;
29+
electronkaon) ;;
30+
electronpion) ;;
31+
electrongamma) ;;
32+
electronneutron) ;;
33+
electronFTproton) ;;
34+
electronFTkaon) ;;
35+
electronFTpion) ;;
36+
electronFTgamma) ;;
37+
electrongammaFT) ;;
38+
electronprotonC) ;;
39+
electronkaonC) ;;
40+
electronpionC) ;;
41+
electrongammaC) ;;
42+
electronneutronC) ;;
43+
electrondeuteronC) ;;
8344
*)
8445
echo Invalid input evio file: $stub
8546
exit 1
8647
esac
8748

88-
# set up environment
89-
if [ $useClara -eq 0 ]
90-
then
91-
COAT=../../coatjava
92-
source $COAT/libexec/env.sh
93-
else
94-
CLARA_HOME=$PWD/clara_installation/
95-
COAT=$CLARA_HOME/plugins/clas12/
96-
source $COAT/libexec/env.sh
97-
export CLARA_HOME
98-
fi
99-
100-
classPath="${COATJAVA_CLASSPATH}:../lib/*:src/"
101-
102-
# make sure test code compiles before anything else:
49+
# compile test code:
10350
javac -cp $classPath src/eb/EBTwoTrackTest.java
10451
if [ $? != 0 ] ; then echo "EBTwoTrackTest compilation failure" ; exit 1 ; fi
10552

106-
# download and setup dependencies, run reconstruction:
107-
if [ $runTestOnly -eq 0 ]
108-
then
109-
110-
if ! [ $useClara -eq 0 ]
111-
then
112-
# tar the local coatjava build so it can be installed with clara
113-
cd ../..
114-
tar -zcvf coatjava-local.tar.gz coatjava
115-
mv coatjava-local.tar.gz validation/advanced-tests/
116-
cd -
53+
# run reconstruction:
54+
rm -f out_${stub}.hipo
55+
../../coatjava/bin/recon-util -l FINE -i ${input_dir}/${stub}.hipo -o out_${stub}.hipo -c 2
11756

118-
# install clara
119-
if ! [ -d clara_installation ]
120-
then
121-
../../bin/install-clara clara_installation
122-
fi
123-
fi
124-
125-
# download test files, if necessary:
126-
#wget -N --no-check-certificate $webDir/${stub}.hipo
127-
#if [ $? != 0 ] ; then echo "wget validation files failure" ; exit 1 ; fi
128-
129-
# update the schema dictionary: (no longer necessary now that recon-util does it)
130-
#rm -f up_${stub}.hipo
131-
#../../coatjava/bin/hipo-utils -update -d ../../coatjava/etc/bankdefs/hipo4/ -o up_${stub}.hipo ${stub}.hipo
132-
133-
# run reconstruction:
134-
rm -f out_${stub}.hipo
135-
if [ $useClara -eq 0 ]
136-
then
137-
GEOMDBVAR=$geoDbVariation
138-
export GEOMDBVAR
139-
../../coatjava/bin/recon-util -l FINE -i ${webDir}/${stub}.hipo -o out_${stub}.hipo -c 2
140-
else
141-
echo "set inputDir $PWD/" > cook.clara
142-
echo "set outputDir $PWD/" >> cook.clara
143-
echo "set threads 7" >> cook.clara
144-
echo "set javaMemory 2" >> cook.clara
145-
echo "set session s_cook" >> cook.clara
146-
echo "set description d_cook" >> cook.clara
147-
ls ${stub}.hipo > files.list
148-
echo "set fileList $PWD/files.list" >> cook.clara
149-
echo "run local" >> cook.clara
150-
echo "exit" >> cook.clara
151-
$CLARA_HOME/bin/clara-shell cook.clara
152-
fi
153-
fi
154-
155-
# run Event Builder tests:
156-
java -DCLAS12DIR="$COAT" -Xmx1536m -Xms1024m -cp $classPath -DINPUTFILE=out_${stub}.hipo org.junit.runner.JUnitCore eb.EBTwoTrackTest
57+
# run EB tests:
58+
java -DCLAS12DIR="$COAT" -Xmx1536m -Xms1024m -cp $classPath -DINPUTFILE=out_${stub}.hipo eb.EBTwoTrackTest
15759
if [ $? != 0 ] ; then echo "EBTwoTrackTest unit test failure" ; exit 1 ; else echo "EBTwoTrackTest passed unit tests" ; fi
15860

159-
$COAT/bin/trutheff ./out_${stub}.hipo
160-
161-
exit 0
61+
# run truth-efficiency calculator:
62+
../../coatjava/bin/trutheff ./out_${stub}.hipo
16263

validation/advanced-tests/src/eb/EBTwoTrackTest.java

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
package eb;
22

33
import java.io.File;
4-
import org.junit.Test;
54
import java.util.Map;
65
import java.util.HashMap;
76
import java.util.List;
87
import java.util.ArrayList;
9-
import static org.junit.Assert.*;
108

119
import org.jlab.io.base.DataBank;
1210
import org.jlab.io.base.DataEvent;
@@ -21,8 +19,6 @@
2119
*
2220
* Analyze EB efficiencies based on Joseph's 2-particle test events.
2321
*
24-
* TODO: Inherit process/checkResults to subclasses for FD/CD/FT
25-
* TODO: Write a more general purpose test based on MC::Particle bank.
2622
* TODO: Rewrite this from scratch. Meanwhile, can't live without it.
2723
*
2824
* @author baltzell
@@ -78,10 +74,29 @@ public class EBTwoTrackTest {
7874
Map <Integer,List<Integer>> recSciMap=new HashMap<Integer,List<Integer>>();
7975
Map <Integer,List<Integer>> recTrkMap=new HashMap<Integer,List<Integer>>();
8076

81-
@Test
82-
public void main() {
77+
static void assertEquals(boolean a, boolean b) {
78+
if (a!=b) {
79+
System.err.println("Assertion Failed!");
80+
System.exit(3);
81+
}
82+
}
83+
static void assertEquals(String msg, int a, int b) {
84+
if (a!=b) {
85+
System.err.println(msg);
86+
System.exit(3);
87+
}
88+
}
89+
90+
public static void main(String[] args) {
91+
EBTwoTrackTest t = new EBTwoTrackTest();
92+
t.go();
93+
}
94+
95+
public void go() {
96+
8397
String fileName=System.getProperty("INPUTFILE");
8498
File file = new File(fileName);
99+
85100
if (!file.exists() || file.isDirectory()) {
86101
System.err.println("Cannot find input file.");
87102
assertEquals(false, true);

0 commit comments

Comments
 (0)