Skip to content

Instantly share code, notes, and snippets.

@stwunsch
Last active January 31, 2019 09:50
Show Gist options
  • Save stwunsch/19b6f1daf56c9f59b204ccba402d2d18 to your computer and use it in GitHub Desktop.
Save stwunsch/19b6f1daf56c9f59b204ccba402d2d18 to your computer and use it in GitHub Desktop.
#!/bin/bash
ERA=2016
CHANNEL=mt
BIN=12
ALGO=saturated
for ALGO in saturated AD KS; do
# Clean ROOT files
rm -f higgs*.root *.json *.pdf *.png ${PWD}/workspace.root
# Make workspace
combineTool.py -M T2W -o ${PWD}/workspace.root -i output/${ERA}_smhtt/cmb/125/htt_${CHANNEL}_[${BIN}]_Run${ERA}.txt --parallel 20
# Get test statistic
combineTool.py -M GoodnessOfFit --algorithm $ALGO -m 125 -d ${PWD}/workspace.root \
-n ".$ALGO" --plots \
--X-rtd MINIMIZER_analytic --cminDefaultMinimizerStrategy 0
# Throw toys
combineTool.py -M GoodnessOfFit --algorithm $ALGO -m 125 --there -d ${PWD}/workspace.root \
-n ".$ALGO.toys" -t 50 -s 1230:1249:1 --parallel 20 --verbose 0 \
--X-rtd MINIMIZER_analytic --cminDefaultMinimizerStrategy 0
# Collect results
combineTool.py -M CollectGoodnessOfFit \
--input higgsCombine.${ALGO}.GoodnessOfFit.mH125.root \
higgsCombine.${ALGO}.toys.GoodnessOfFit.mH125.*.root -o ${CHANNEL}_${ERA}_${BIN}.${ALGO}.json
# Plot
plotGof.py --statistic ${ALGO} --mass 125.0 --output ${CHANNEL}_${ERA}_${BIN}.${ALGO} ${CHANNEL}_${ERA}_${BIN}.${ALGO}.json
# Save results
mkdir -p results/
cp *${ALGO}.png *${ALGO}.pdf results/
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment