Skip to content

Commit

Permalink
Added full-chain script, more events, and Raffaella\'s tracking test
Browse files Browse the repository at this point in the history
  • Loading branch information
naharrison committed Aug 30, 2018
1 parent 0b913a5 commit e70cebb
Show file tree
Hide file tree
Showing 11 changed files with 190,047 additions and 9,555 deletions.
3 changes: 3 additions & 0 deletions release-validation-1/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,7 @@ install-claracre-clas.sh
myclara
*.evio
*.hipo
*.class
*.swp
target
trackingPics
189,199 changes: 189,199 additions & 0 deletions release-validation-1/11gev_sidis_10000.dat

Large diffs are not rendered by default.

9,522 changes: 0 additions & 9,522 deletions release-validation-1/11gev_sidis_500.dat

This file was deleted.

15 changes: 15 additions & 0 deletions release-validation-1/cleanup.csh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/csh -f

rm -f trimmed_lund*dat
rm -f gemcout*evio
rm -f gemcout*hipo
rm -f install-claracre-clas.sh
rm -rf myclara
rm -f coatjava*tar.gz
rm -f clara-cre.tar.gz
rm -f gemcout.hipo
rm -f files.list
rm -f cook.clara
rm -f out_gemcout.hipo
rm -rf trackingPics
rm -rf target
88 changes: 88 additions & 0 deletions release-validation-1/full-chain.csh
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
#!/bin/csh -f

./cleanup.csh

setenv gemcversion 4a.2.4
setenv coatversion 5b.6.1

setenv lundfile 11gev_sidis_10000.dat
setenv nevents 10000

setenv ngemccores 2 # might not be safe to go above 2-3
setenv nclaracores `getconf _NPROCESSORS_ONLN`


### gemc/docker ###
setenv eventsPerCore `echo "$nevents / $ngemccores" | bc`
setenv ngemccoresMinus1 `echo "$ngemccores - 1" | bc`

foreach N (`seq 0 $ngemccoresMinus1`)

setenv min `echo "$N * $eventsPerCore" | bc`
setenv max `echo "($N + 1) * $eventsPerCore" | bc`

echo "" > temp.txt # start with empty file
awk -v min=$min -v max=$max '{ if(NF == 10) i++; if(i > min && i <= max) print $0 }' $lundfile >> temp.txt
tail -n +2 temp.txt > trimmed_lund_$N.dat # remove first blank line and give real filename
rm temp.txt

docker run -it --detach --name gemc_$N -v $PWD/:/jlab/workdir/shared --rm jeffersonlab/clas12tags:$gemcversion tcsh -c "shared/gemc-docker.csh $N $eventsPerCore"

echo $N

end

# wait for docker containers to finish before moving on:
setenv loopcount 0
while(`docker ps | wc -l` > 1)
setenv loopcount `echo "$loopcount + 1" | bc`
sleep 4
if($loopcount % 10 == 0) then
echo "gemc/docker still running..."
endif
end
sleep 1
### end gemc/docker ###


### coat/clara ###
wget --no-check-certificate https://claraweb.jlab.org/clara/_downloads/install-claracre-clas.sh
chmod +x install-claracre-clas.sh
setenv CLARA_HOME $PWD/myclara/
setenv COATJAVA $CLARA_HOME/plugins/clas12/
./install-claracre-clas.sh -v $coatversion

foreach N (`seq 0 $ngemccoresMinus1`)

$COATJAVA/bin/evio2hipo -r 11 -t -1.0 -s -1.0 -o gemcout_$N.hipo gemcout_$N.evio

end

$COATJAVA/bin/hipo-utils -merge -o gemcout.hipo gemcout_*.hipo
rm gemcout_*.evio gemcout_*hipo trimmed_lund_*.dat

echo "set inputDir $PWD/" > cook.clara
echo "set outputDir $PWD/" >> cook.clara
echo "set threads $nclaracores" >> cook.clara
echo "set javaMemory 2" >> cook.clara
echo "set session s_cook" >> cook.clara
echo "set description d_cook" >> cook.clara
ls gemcout.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
### end coat/clara ###


### analysis ###
javac -cp "$COATJAVA/lib/services/*:$COATJAVA/lib/clas/*:$COATJAVA/lib/utils/*" src/main/java/org/jlab/c12val/ParticleCounter.java
java -Xmx1536m -Xms1024m -cp "$COATJAVA/lib/services/*:$COATJAVA/lib/clas/*:$COATJAVA/lib/utils/*:src/main/java/" org.jlab.c12val.ParticleCounter

if(!(-e trackingPics)) then
mkdir trackingPics
endif
javac -cp "$COATJAVA/lib/services/*:$COATJAVA/lib/clas/*:$COATJAVA/lib/utils/*:lib/*" src/main/java/org/jlab/c12val/TrackingTest.java
java -Xmx1536m -Xms1024m -DCLAS12DIR="$COATJAVA" -DINPUTFILE="gemcout" -DRESULTS="trackingPics" -cp "$COATJAVA/lib/services/*:$COATJAVA/lib/clas/*:$COATJAVA/lib/utils/*:lib/*:src/main/java/" org.jlab.c12val.TrackingTest
### end analysis ###

6 changes: 6 additions & 0 deletions release-validation-1/gemc-docker.csh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/tcsh

setenv filenumber $1
setenv nevents $2

gemc clas12.gcard -INPUT_GEN_FILE="LUND, shared/trimmed_lund_$filenumber.dat" -USE_GUI=0 -N=$nevents -PRINT_EVENT=20 -RUNNO=11 -OUTPUT="evio, shared/gemcout_$filenumber.evio"
Binary file added release-validation-1/lib/hamcrest-core-1.3.jar
Binary file not shown.
Binary file added release-validation-1/lib/junit-4.12.jar
Binary file not shown.
32 changes: 0 additions & 32 deletions release-validation-1/pom.xml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public void printResults() {
public static void main(String[] args) {
ParticleCounter pcounter = new ParticleCounter(11, 211, -211, 2212, 321, 22, 2112);
HipoDataSource reader = new HipoDataSource();
reader.open("out_out.hipo");
reader.open("out_gemcout.hipo");
while(reader.hasEvent()) {
DataEvent event = reader.getNextEvent();
pcounter.processEvent(event);
Expand Down
Loading

0 comments on commit e70cebb

Please sign in to comment.