File indexing completed on 2026-05-22 08:40:52
0001
0002 set -Eu
0003 trap 's=$?; echo "$0: Error on line "$LINENO": $BASH_COMMAND"; exit $s' ERR
0004 IFS=$'\n\t'
0005
0006 out=${1?Specify output}
0007 file=${2?Specify filename}
0008 ext=${3?Specify extension}
0009 nevents=${4:-}
0010 n_lines_per_event=${5:-}
0011
0012 xrootd="root://dtn-eic.jlab.org//volatile/eic/EPIC/EVGEN"
0013
0014
0015 if [[ "${ext}" =~ ^hepmc3\.tree.root$ ]] ; then
0016
0017 if [[ -n "${nevents}" ]] && [[ "${nevents}" -gt 0 ]] ; then
0018
0019 true
0020 else
0021
0022 nevents=$(root -l -b -q ${xrootd}/${file}.${ext} -e 'cout << hepmc3_tree->GetEntries() << endl;' | tail -n1)
0023 fi
0024 n_lines_per_event=0
0025 elif [[ "${ext}" =~ ^steer$ ]] ; then
0026 true
0027 else
0028 echo "Error: Input extension is not recognized. Only '.hepmc3.tree.root' or '.steer' format is accepted. Please see the input pre-processing policy https://eic.github.io/epic-prod/documentation/input_preprocessing.html"
0029 exit -1
0030 fi
0031
0032
0033 echo "$file,$ext,$nevents,$n_lines_per_event" | tee -a "${out}"