File indexing completed on 2026-08-31 08:24:38
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020 usage() {
0021
0022 echo "Usage: $0 <runnumber> [--nevents N] [-n fun4all_nevents] [--trkdst clus|tracks] [--listdir DIR]" >&2
0023 exit 1
0024 }
0025
0026 echo "PWD=${PWD}"
0027 echo "HOST=$(hostname)"
0028 ORIG_DIR="${PWD}"
0029
0030 ulimit -c 0
0031
0032 SCRIPTDIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
0033
0034 runnumber=""
0035
0036 trkseg=0
0037 list_nevents=1000
0038 nevents=0
0039 trkdst="tracks"
0040 listdir=""
0041
0042 while [[ $
0043 case "$1" in
0044
0045
0046
0047 --trkseg|--trkseg=*)
0048 if [[ "$1" == *=* ]]; then trkseg="${1#*=}"; shift
0049 else [[ $
0050 --nevents|--nevents=*)
0051 if [[ "$1" == *=* ]]; then nevents="${1#*=}"; shift
0052 else [[ $
0053 --trkdst|--trkdst=*)
0054 if [[ "$1" == *=* ]]; then trkdst="${1#*=}"; shift
0055 else [[ $
0056 [[ "$trkdst" == "clus" || "$trkdst" == "tracks" ]] || { echo "ERROR: --trkdst must be clus or tracks" >&2; exit 1; } ;;
0057 --listdir|--listdir=*)
0058 if [[ "$1" == *=* ]]; then listdir="${1#*=}"; shift
0059 else [[ $
0060 --nevtperjob|--nevtperjob=*)
0061 if [[ "$1" == *=* ]]; then list_nevents="${1#*=}"; shift
0062 else [[ $
0063 -*) usage ;;
0064 *) [[ -n "$runnumber" ]] && usage; runnumber=$1; shift ;;
0065 esac
0066 done
0067
0068 [[ -z "$runnumber" ]] && usage
0069
0070 subdir="${ORIG_DIR}/MBDTRKZ/${runnumber}/$(printf '%04d' ${trkseg})"
0071 echo $subdir
0072 mkdir -p "${subdir}"
0073
0074 cd "${subdir}"
0075
0076 ln -sf "${SCRIPTDIR}/Fun4All_MBD_TrackVertex.C" .
0077 ln -sf "${SCRIPTDIR}/Fun4All_MBD_TrackSeeding.C" .
0078 ln -sf "${SCRIPTDIR}/Fun4All_MBD_TrackFitting.C" .
0079 ln -sf /pdata/chiu/25_CALIBPRODUCTION/results/ .
0080
0081 python3 "${SCRIPTDIR}/make_mbdtrkz_lists.py" "$runnumber" --trkseg "$trkseg" --nevents "$list_nevents" --trkdst "$trkdst" \
0082 ${listdir:+--listdir "$listdir"} || exit 1
0083
0084
0085 if [[ -n "${_CONDOR_SCRATCH_DIR}" ]]; then
0086 mkdir -p "${_CONDOR_SCRATCH_DIR}"
0087 cp -p *.C *.list "${_CONDOR_SCRATCH_DIR}/"
0088 cd "${_CONDOR_SCRATCH_DIR}"
0089 ln -sf /pdata/chiu/25_CALIBPRODUCTION/results/ .
0090 time getinputfiles.pl --filelist fit.list
0091 [[ -f clus.list ]] && time getinputfiles.pl --filelist clus.list
0092 [[ -f seed.list ]] && time getinputfiles.pl --filelist seed.list
0093 [[ -f tracks.list ]] && time getinputfiles.pl --filelist tracks.list
0094 fi
0095
0096 if [[ "$trkdst" == "clus" ]]; then
0097
0098 while IFS= read -r clusfile; do
0099 [[ -z "$clusfile" ]] && continue
0100 echo root.exe -b -q "Fun4All_MBD_TrackSeeding.C(${nevents},\"${clusfile}\")"
0101 root.exe -b -q "Fun4All_MBD_TrackSeeding.C(${nevents},\"${clusfile}\")" || exit 1
0102 seedfile=DST_TRKR_SEED${clusfile
0103 echo root.exe -b -q "Fun4All_MBD_TrackFitting.C(${nevents},\"${seedfile}\")"
0104 root.exe -b -q "Fun4All_MBD_TrackFitting.C(${nevents},\"${seedfile}\")" || exit 1
0105 done < clus.list
0106
0107 ls DST_TRKR_TRACK*.root > tracks.list
0108 else
0109 if [[ -n "${_CONDOR_SCRATCH_DIR}" ]]; then
0110 time getinputfiles.pl --filelist tracks.list
0111 fi
0112 fi
0113
0114 [[ -s tracks.list ]] || { echo "ERROR: tracks.list is empty" >&2; exit 1; }
0115 [[ -s fit.list ]] || { echo "ERROR: fit.list is empty" >&2; exit 1; }
0116
0117 tracks_dst_file=$(head -1 tracks.list)
0118 mbd_dst_file=$(head -1 fit.list)
0119 echo root.exe -b -q Fun4All_MBD_TrackVertex.C\(${nevents},\"${tracks_dst_file}\",\"${mbd_dst_file}\"\)
0120 root.exe -b -q Fun4All_MBD_TrackVertex.C\(${nevents},\"${tracks_dst_file}\",\"${mbd_dst_file}\"\) || exit 1
0121
0122 if [[ -n "${_CONDOR_SCRATCH_DIR}" ]]; then
0123 pwd
0124 df -h
0125 ls -l
0126 cp -p mbdtrk_*.root "${subdir}/"
0127 cd "${ORIG_DIR}"
0128 fi