File indexing completed on 2026-05-20 08:28:44
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029 function print_step_options_help {
0030 echo " The default behavior is to run all steps (sim, rec, analysis)."
0031 echo "STEP OPTIONS:"
0032 echo " --data-init Download the input event data"
0033 echo " --sim, -s Run the Geant4 simulation"
0034 echo " --rec, -r Run the reconstruction"
0035 echo " --analysis, -a Run the analysis scripts"
0036 echo " --all (default) Run all steps"
0037 echo " -h, --help Print this message"
0038 }
0039
0040 function parse_step_options {
0041 DO_ALL=1
0042 DATA_INIT=
0043 DO_SIM=
0044 DO_REC=
0045 DO_ANALYSIS=
0046
0047 while [[ $
0048 key="$1"
0049 case $key in
0050 -h|--help)
0051 print_the_help
0052 ;;
0053 --all)
0054 DO_ALL=1
0055 if [[ -n "${DO_REC}${DO_SIM}${DO_ANALYSIS}" ]]; then
0056 echo "Error: cannot use --all with other step arguments." 1>&2
0057 print_the_help
0058 exit 1
0059 fi
0060 shift
0061 ;;
0062 -s|--sim)
0063 DO_SIM=1
0064 DO_ALL=
0065 shift
0066 ;;
0067 --data-init)
0068 DATA_INIT=1
0069 DO_ALL=
0070 shift
0071 ;;
0072 -r|--rec)
0073 DO_REC=1
0074 DO_ALL=
0075 shift
0076 ;;
0077 -a|--analysis)
0078 DO_ANALYSIS=1
0079 DO_ALL=
0080 shift
0081 ;;
0082 *)
0083 echo "unknown option '$1'" 1>&2
0084 print_the_help
0085 exit 1
0086 ;;
0087 esac
0088 done
0089 }