File indexing completed on 2025-01-30 10:30:50
0001
0002 source strict-mode.sh
0003
0004 function print_the_help {
0005 echo "USAGE: ${0} [--rec] [--sim] [--analysis] [--all] "
0006 echo " The default options are to run all steps (sim,rec,analysis) "
0007 echo "OPTIONS: "
0008 echo " --data-init download the input event data"
0009 echo " --sim,-s Runs the Geant4 simulation"
0010 echo " --rec,-r Run the juggler reconstruction"
0011 echo " --analysis,-a Run the analysis scripts"
0012 echo " --all (default) Do all steps. Argument is included so usage can convey intent."
0013 exit
0014 }
0015
0016 DO_ALL=1
0017 DATA_INIT=
0018 DO_SIM=
0019 DO_REC=
0020 DO_ANALYSIS=
0021
0022 POSITIONAL=()
0023 while [[ $
0024 do
0025 key="$1"
0026
0027 case $key in
0028 -h|--help)
0029 shift
0030 print_the_help
0031 ;;
0032 --all)
0033 DO_ALL=2
0034 if [[ ! "${DO_REC}${DO_SIM}${DO_ANALYSIS}" -eq "" ]] ; then
0035 echo "Error: cannot use --all with other arguments." 1>&2
0036 print_the_help
0037 exit 1
0038 fi
0039 shift
0040 ;;
0041 -s|--sim)
0042 DO_SIM=1
0043 DO_ALL=
0044 shift
0045 ;;
0046 --data-init)
0047 DATA_INIT=1
0048 DO_ALL=
0049 shift
0050 ;;
0051 -r|--rec)
0052 DO_REC=1
0053 DO_ALL=
0054 shift
0055 ;;
0056 -a|--analysis)
0057 DO_ANALYSIS=1
0058 DO_ALL=
0059 shift
0060 ;;
0061 *)
0062
0063 echo "unknown option $1"
0064 print_the_help
0065 shift
0066 ;;
0067 esac
0068 done
0069 set -- "${POSITIONAL[@]}"
0070
0071
0072 print_env.sh
0073
0074 FILE_NAME_TAG="dvcs"
0075 XROOTD_BASEURL="root://dtn-eic.jlab.org//work/eic2/EPIC"
0076 INPUT_FILE="EVGEN/EXCLUSIVE/DVCS_ABCONV/10x100/DVCS.1.ab.hiDiv.10x100.hepmc3.tree.root"
0077
0078 export JUGGLER_MC_FILE="${XROOTD_BASEURL}/${INPUT_FILE}"
0079 export JUGGLER_SIM_FILE="${LOCAL_DATA_PATH}/sim_${FILE_NAME_TAG}.edm4hep.root"
0080 export JUGGLER_REC_FILE="${LOCAL_DATA_PATH}/rec_${FILE_NAME_TAG}.root"
0081
0082 echo "FILE_NAME_TAG = ${FILE_NAME_TAG}"
0083 echo "JUGGLER_N_EVENTS = ${JUGGLER_N_EVENTS}"
0084 echo "DETECTOR = ${DETECTOR}"
0085
0086
0087
0088
0089
0090
0091
0092 if [[ -n "${DO_SIM}" || -n "${DO_ALL}" ]] ; then
0093
0094 ddsim --runType batch \
0095 --part.minimalKineticEnergy 1000*GeV \
0096 --filter.tracker edep0 \
0097 -v ERROR \
0098 --numberOfEvents ${JUGGLER_N_EVENTS} \
0099 --compactFile ${DETECTOR_PATH}/${DETECTOR_CONFIG}.xml \
0100 --inputFiles "${JUGGLER_MC_FILE}" \
0101 --outputFile ${JUGGLER_SIM_FILE}
0102 if [[ "$?" -ne "0" ]] ; then
0103 echo "ERROR running ddsim"
0104 exit 1
0105 fi
0106 fi
0107
0108
0109 if [[ -n "${DO_REC}" || -n "${DO_ALL}" ]] ; then
0110 if [ ${RECO} == "eicrecon" ] ; then
0111 eicrecon ${JUGGLER_SIM_FILE} -Ppodio:output_file=${JUGGLER_REC_FILE}
0112 if [[ "$?" -ne "0" ]] ; then
0113 echo "ERROR running eicrecon"
0114 exit 1
0115 fi
0116 fi
0117
0118 if [[ ${RECO} == "juggler" ]] ; then
0119 gaudirun.py options/reconstruction.py || [ $? -eq 4 ]
0120 if [ "$?" -ne "0" ] ; then
0121 echo "ERROR running juggler"
0122 exit 1
0123 fi
0124 fi
0125 root_filesize=$(stat --format=%s "${JUGGLER_REC_FILE}")
0126 if [[ "${JUGGLER_N_EVENTS}" -lt "500" ]] ; then
0127
0128 if [[ "${root_filesize}" -lt "10000000" ]] ; then
0129 cp ${JUGGLER_REC_FILE} results/.
0130 fi
0131 fi
0132 fi
0133
0134
0135 if [[ -n "${DO_ANALYSIS}" || -n "${DO_ALL}" ]] ; then
0136 echo "Running analysis scripts"
0137 rootls -t ${JUGGLER_REC_FILE}
0138
0139
0140 mkdir -p results/dvcs
0141
0142
0143 root -b -q "benchmarks/Exclusive-Diffraction-Tagging/dvcs/analysis/dvcs_tests.cxx+(\"${JUGGLER_REC_FILE}\")"
0144 if [[ "$?" -ne "0" ]] ; then
0145 echo "ERROR running root script"
0146 exit 1
0147 fi
0148 fi
0149
0150
0151