File indexing completed on 2026-04-07 08:15:43
0001
0002 export USER="$(id -u -n)"
0003 export LOGNAME=${USER}
0004 export HOME=/sphenix/u/${LOGNAME}
0005
0006 source /opt/sphenix/core/bin/sphenix_setup.sh -n new
0007
0008 f4a_macro=${1}
0009 input=${2}
0010 QAhist=${3}
0011 QVecCalibHist=${4}
0012 pass=${5}
0013 dst_tag=${6}
0014 submitDir=${7}
0015
0016
0017 run=$(echo "$input" | grep -oP 'output/\K\d+(?=/tree)')
0018 if [[ -z "$run" ]]; then
0019 echo "Failed to parse run number from input: $input" >&2
0020 exit 1
0021 fi
0022
0023 QAhist_file=$(basename "$QAhist")
0024 QVecCalibHist_file=$(basename "$QVecCalibHist")
0025
0026 if [[ -n "$_CONDOR_SCRATCH_DIR" && -d "$_CONDOR_SCRATCH_DIR" ]]
0027 then
0028 cd "$_CONDOR_SCRATCH_DIR" || { echo "Failed to cd to $_CONDOR_SCRATCH_DIR" >&2; exit 1; }
0029
0030 cp -rv "$input" input
0031 readlink -f input/* > input.list
0032
0033 cp -v "$QAhist" .
0034 test -e "$QVecCalibHist" && cp -v "$QVecCalibHist" .
0035 ls -lah
0036 else
0037 echo "condor scratch NOT set" >&2
0038 exit 1
0039 fi
0040
0041
0042 printenv
0043
0044 mkdir -p "output/hist"
0045
0046 if [ "$pass" -eq 2 ]; then
0047 mkdir -p "output/CDB/$run"
0048 fi
0049
0050 root -b -l -q "$f4a_macro(\"input.list\", \"$QAhist_file\", \"$QVecCalibHist_file\", $pass, 0, \"output/hist/QVecCalib-$run.root\", \"$dst_tag\", \"output/CDB/$run\")"
0051
0052 echo "All Done and Transferring Files Back"
0053 cp -rv output/* "$submitDir"
0054
0055 echo "Finished"