|
1 | 1 | #!/bin/bash |
2 | 2 |
|
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 | | - |
8 | 3 | # coatjava must already be built at ../../coatjava/ |
9 | 4 | # and input test data files at ./data |
10 | 5 |
|
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 |
16 | 7 |
|
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 |
23 | 9 |
|
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 |
30 | 11 |
|
31 | | -nEvents=-1 |
| 12 | +classPath="${COATJAVA_CLASSPATH}:../lib/*:src/" |
32 | 13 |
|
| 14 | +# check arguments: |
33 | 15 | for arg in $@ |
34 | 16 | do |
35 | | - if [ "$arg" == "-t" ] |
| 17 | + if [[ $arg == "-100" ]] |
36 | 18 | then |
37 | | - runTestOnly=1 |
38 | | - elif [[ $arg == "-100" ]] |
39 | | - then |
40 | | - webDir=${webDir}-100 |
| 19 | + input_dir=${input_dir}-100 |
41 | 20 | fi |
42 | 21 | done |
43 | 22 |
|
44 | 23 | # last argument is input file stub: |
45 | 24 | stub="${@: -1}" |
46 | 25 |
|
47 | | -# sanity check on filestub name, |
48 | | -# just to error with reasonable message before proceeding: |
| 26 | +# check (file)stub name: |
49 | 27 | 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) ;; |
83 | 44 | *) |
84 | 45 | echo Invalid input evio file: $stub |
85 | 46 | exit 1 |
86 | 47 | esac |
87 | 48 |
|
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: |
103 | 50 | javac -cp $classPath src/eb/EBTwoTrackTest.java |
104 | 51 | if [ $? != 0 ] ; then echo "EBTwoTrackTest compilation failure" ; exit 1 ; fi |
105 | 52 |
|
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 |
117 | 56 |
|
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 |
157 | 59 | if [ $? != 0 ] ; then echo "EBTwoTrackTest unit test failure" ; exit 1 ; else echo "EBTwoTrackTest passed unit tests" ; fi |
158 | 60 |
|
159 | | -$COAT/bin/trutheff ./out_${stub}.hipo |
160 | | - |
161 | | -exit 0 |
| 61 | +# run truth-efficiency calculator: |
| 62 | +../../coatjava/bin/trutheff ./out_${stub}.hipo |
162 | 63 |
|
0 commit comments