Skip to content
Snippets Groups Projects

Added track_finding

Merged Whitney Armstrong requested to merge track_finding into master
1 file
+ 1
1
Compare changes
  • Side-by-side
  • Inline
+ 105
0
 
#!/bin/bash
 
 
function print_the_help {
 
echo "USAGE: ${0} "
 
echo " OPTIONS: "
 
exit
 
}
 
 
POSITIONAL=()
 
while [[ $# -gt 0 ]]
 
do
 
key="$1"
 
 
case $key in
 
-h|--help)
 
shift # past argument
 
print_the_help
 
;;
 
#--ana-only)
 
# ANALYSIS_ONLY=1
 
# shift # past value
 
# ;;
 
*) # unknown option
 
#POSITIONAL+=("$1") # save it in an array for later
 
echo "unknown option $1"
 
print_the_help
 
shift # past argument
 
;;
 
esac
 
done
 
set -- "${POSITIONAL[@]}" # restore positional parameters
 
 
 
print_env.sh
 
 
## To run the reconstruction, we need the following global variables:
 
## - JUGGLER_INSTALL_PREFIX: Install prefix for Juggler (simu/recon)
 
## - JUGGLER_DETECTOR: the detector package we want to use for this benchmark
 
## - JUGGLER_DETECTOR_VERSION: the detector package we want to use for this benchmark
 
## - DETECTOR_PATH: full path to the detector definitions
 
 
if [[ ! -n "${JUGGLER_N_EVENTS}" ]] ; then
 
export JUGGLER_N_EVENTS=100
 
fi
 
#export JUGGLER_N_EVENTS=$(expr ${JUGGLER_N_EVENTS} \* 1)
 
 
 
export JUGGLER_FILE_NAME_TAG="multiple_tracks"
 
export JUGGLER_GEN_FILE="${JUGGLER_FILE_NAME_TAG}.hepmc"
 
 
export JUGGLER_SIM_FILE="sim_${JUGGLER_FILE_NAME_TAG}.root"
 
export JUGGLER_REC_FILE="rec_${JUGGLER_FILE_NAME_TAG}.root"
 
 
echo "JUGGLER_N_EVENTS = ${JUGGLER_N_EVENTS}"
 
echo "JUGGLER_DETECTOR = ${JUGGLER_DETECTOR}"
 
 
## generate the input events
 
root -b -q "benchmarks/track_finding/scripts/gen_multiple_tracks.cxx(${JUGGLER_N_EVENTS}, \"${JUGGLER_FILE_NAME_TAG}.hepmc\")"
 
if [[ "$?" -ne "0" ]] ; then
 
echo "ERROR running script"
 
exit 1
 
fi
 
 
echo "Running geant4 simulation"
 
## run geant4 simulations
 
npsim --runType batch \
 
--part.minimalKineticEnergy 1000*GeV \
 
-v WARNING \
 
--numberOfEvents ${JUGGLER_N_EVENTS} \
 
--compactFile ${DETECTOR_PATH}/${JUGGLER_DETECTOR}.xml \
 
--inputFiles ${JUGGLER_FILE_NAME_TAG}.hepmc \
 
--outputFile ${JUGGLER_SIM_FILE}
 
if [[ "$?" -ne "0" ]] ; then
 
echo "ERROR running script"
 
exit 1
 
fi
 
 
rootls -t ${JUGGLER_SIM_FILE}
 
 
if [[ -z "${ANALYSIS_ONLY}" ]] ;
 
then
 
# Need to figure out how to pass file name to juggler from the commandline
 
gaudirun.py benchmarks/tracking/options/track_reconstruction.py
 
if [[ "$?" -ne "0" ]] ; then
 
echo "ERROR running juggler"
 
exit 1
 
fi
 
fi
 
 
mkdir -p results/track_finding
 
 
root -b -q "benchmarks/track_finding/scripts/rec_multiple_tracks.cxx(\"${JUGGLER_REC_FILE}\")"
 
if [[ "$?" -ne "0" ]] ; then
 
echo "ERROR running root script"
 
exit 1
 
fi
 
 
root_filesize=$(stat --format=%s "${JUGGLER_REC_FILE}")
 
if [[ "${JUGGLER_N_EVENTS}" -lt "500" ]] ; then
 
# file must be less than 10 MB to upload
 
if [[ "${root_filesize}" -lt "10000000" ]] ; then
 
cp ${JUGGLER_REC_FILE} results/.
 
fi
 
fi
 
Loading