#!/bin/bash
echo "This will take a while ... grab a coffee/tea/water"
mkdir -p logs
mkdir -p plots
N_JOBS=4

i=0
# for var in MET HT ST WPT lepton_pt abs_lepton_eta NJets; do
# 	echo "Tabulating diff. x-section for distribution: $var"
# 	nohup time python dps/analysis/xsection/05_make_tables.py -v $var -c 13 -p /hdfs/TopQuarkGroup/run2/dpsData/data/normalisation/background_subtraction/ -a -o tables/background_subtraction &> logs/05_${var}_table_13TeV.log &
# 	let i+=1
# 	if (( $i % N_JOBS == 0 ))
# 	then
# 		echo "Waiting on the above to finish."
#     	wait;
# 	fi
# done

echo "Now visible phase space"

for var in MET HT ST WPT lepton_pt abs_lepton_eta NJets; do
	echo "Tabulating diff. x-section for distribution: $var"
	nohup time python dps/analysis/xsection/05_make_tables.py -v $var -c 13 -p data/normalisation/background_subtraction/ -a --visiblePS -o tables/background_subtraction &> logs/05_${var}_table_13TeV.log &
	let i+=1
	if (( $i % N_JOBS == 0 ))
	then
		echo "Waiting on the above to finish."
    	wait;
	fi
done

wait;
echo "All done!"
