#rm results_run*.root export DATASET="27Al" export flip180="0" export flipa=0 export reactiondata=1 export anode_offset=0 root -l -q -x -e ".L MakeVertex.C++" rm 27Al_output/*.root #declare -i run=28 #while [[ $run -lt 34 ]]; do #runs 1 to 84 # wrun=$(printf "%03d" $run) # root -q -l -b -x ../ANASEN_analysis/data/27Al_Data/Run_"$wrun"_mapped.root -e 'tree->Process("Make#Vertex.C+O")'; mv Analyzer_SX3.root 27Al_output/results_run$wrun.root; # run=run+1 #done declare -i run=78 while [[ $run -lt 89 ]]; do #runs 1 to 84 wrun=$(printf "%03d" $run) #root -q -l -b -x ../ANASEN_analysis/data/27Al_Data/Run_"$wrun"_mapped.root -e 'tree->Process("MakeVertex.C+O","Analyzer_27Al.root")'; mv Analyzer_27Al.root 27Al_output/results_run$wrun.root; run=run+1 done 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 time parallel -j 2 --ctag run_once {1} ::: {50..59} time parallel -j 2 --ctag run_once {1} ::: 62 63 66 67 68 73 74 #time parallel -j 2 --ctag run_once {1} ::: {78..89} 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