#rm results_run*.root export DATASET="27Al" export flip180="0" export flipa=0 export reactiondata=1 export anode_offset=0 export pressure_in_torr=250 root -l -q -x -e ".L MakeVertex.C++" rm 27Al_output/*.root function run_once() { wrun=$(printf "%02d" $1) file_exists=$(test -f ../ANASEN_analysis/data/27Al_Data/Run_0"$wrun"_mapped.root) if [[ $file_exists -ne 0 ]]; then return; fi root -q -l -b -x ../ANASEN_analysis/data/27Al_Data/Run_0"$wrun"_mapped.root -e $(printf 'tree->Process("MakeVertex.C+O","analyzed_run%s.root")' "$wrun"); mv analyzed_run$wrun.root 27Al_output/results_run$wrun.root; } export -f run_once function run_all() { time parallel -j 6 --ctag run_once {1} ::: {24..41} time parallel -j 6 --ctag run_once {1} ::: 44 45 46 time parallel -j 6 --ctag run_once {1} ::: {50..59} time parallel -j 6 --ctag run_once {1} ::: 62 63 66 67 73 74 time parallel -j 1 --ctag run_once {1} ::: 68 time parallel -j 6 --ctag run_once {1} ::: {78..89} } export -f run_all time run_all rm output.root hadd -k -j 4 output.root 27Al_output/results_run*.root mv output.root output_27Al.root rootbrowse output_27Al.root unset souce_vertex unset DATASET unset flip180 unset pressure_in_torr