-
Notifications
You must be signed in to change notification settings - Fork 8
/
run_impacts.sh
executable file
·111 lines (94 loc) · 4.23 KB
/
run_impacts.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
#!/bin/bash
# Ensure stack size is large enough
ulimit -s unlimited
TAG=$1
MODE=$2
MASS=$3
PROCESS=$4
ERA=$5
CHANNEL=$6
# Sanity checks on input
[[ ! -z $1 && ! -z $2 && ! -z $3 && ! -z $4 ]] || ( echo "[ERROR] Number of given parameters is too small."; exit 1 )
[[ -z $5 ]] && echo "[INFO] Era not set. Will use combined dataset." && ERA="combined"
[[ -z $6 ]] && echo "[INFO] Channel not set. Will use combination of channels." && CHANNEL="cmb"
if [[ "${TAG}" == "auto" ]]; then
TAG=${ERA}_${CHANNEL}
fi
defaultdir="${CMSSW_BASE}/src/CombineHarvester/MSSMvsSMRun2Legacy/analysis/cmb_ind_unblinding"
[[ ! -d ${defaultdir} ]] && mkdir -p ${defaultdir}
defaultdir=$(readlink -f ${defaultdir})
[[ ! -d ${defaultdir} ]] && mkdir -p ${defaultdir}
[[ ! -d ${defaultdir}/logs ]] && mkdir -p ${defaultdir}/logs
[[ ! -d ${defaultdir}/impacts_${PROCESS}_mH${MASS}/condor ]] && mkdir -p ${defaultdir}/impacts_${PROCESS}_mH${MASS}/condor
if [[ "$PROCESS" == "r_ggH" ]]; then
signal_process=$PROCESS
freeze_process=r_bbH
elif [[ "$PROCESS" == "r_bbH" ]]; then
signal_process=$PROCESS
freeze_process=r_ggH
else
echo "[ERROR] Process not known aborting."
exit 1
fi
datacarddir=${defaultdir}/datacards_bsm-model-indep
taskname="impacts_${TAG}_${PROCESS}_mH${MASS}"
case $MODE in
prepare-submit)
pushd ${defaultdir}/impacts_${PROCESS}_mH${MASS}/condor
combineTool.py -M Impacts -d ${datacarddir}/${ERA}/${CHANNEL}/ws.root \
--X-rtd MINIMIZER_analytic --cminDefaultMinimizerStrategy 0 \
--doInitialFit --robustFit 1 \
-t -1 -m $MASS \
--setParameters r_ggH=0,r_bbH=0 --setParameterRanges r_ggH=-1.0,1.0:r_bbH=-1.0,1.0 \
--redefineSignalPOIs ${signal_process} --freezeParameters ${freeze_process} -v 0 # --stepSize 0.01
# --rAbsAcc 0 --rRelAcc 0.0005 \
combineTool.py -M Impacts -d ${datacarddir}/${ERA}/${CHANNEL}/ws.root \
--X-rtd MINIMIZER_analytic --cminDefaultMinimizerStrategy 0 \
--robustFit 1 --doFits \
-t -1 -m $MASS \
--setParameters r_ggH=0,r_bbH=0 --setParameterRanges r_ggH=-1.0,1.0:r_bbH=-1.0,1.0 \
--redefineSignalPOIs ${signal_process} --freezeParameters ${freeze_process} \
--job-mode condor --task-name ${taskname} --dry-run --merge 5
# --rAbsAcc 0 --rRelAcc 0.0005 \
popd
;;
submit)
############
# job submission
############
pushd ${defaultdir}/impacts_${PROCESS}_mH${MASS}/condor
condor_submit condor_${taskname}.sub
popd
;;
submit-gc)
############
# job submission
############
python scripts/build_gc_job.py \
--combine-script ${defaultdir}/impacts_${PROCESS}_mH${MASS}/condor/condor_${taskname}.sh \
--workspace ${datacarddir}/${ERA}/${CHANNEL}/ws.root \
--workdir /work/mburkart/workdirs/combine/${taskname} \
--tag ${taskname} \
--se-path /storage/gridka-nrg/mburkart/gc_storage/combine/${TAG}/${taskname}
${CMSSW_BASE}/src/grid-control/go.py /work/mburkart/workdirs/combine/${taskname}/${taskname}.conf -Gc -m 3
;;
copy-results-gc)
############
# job submission
############
rsync -avhP /storage/gridka-nrg/mburkart/gc_storage/combine/${TAG}/${taskname}/output/ ${defaultdir}/impacts_${PROCESS}_mH${MASS}/condor
;;
collect)
############
# job collection
############
pushd ${defaultdir}/impacts_${PROCESS}_mH${MASS}/condor
combineTool.py -M Impacts -d ${datacarddir}/${ERA}/${CHANNEL}/ws.root -m $MASS -o ${ERA}_${CHANNEL}_${signal_process}_${MASS}_impacts.json --redefineSignalPOIs ${signal_process} --exclude ${freeze_process}
plotImpacts.py -i ${ERA}_${CHANNEL}_${signal_process}_${MASS}_impacts.json -o ${ERA}_${CHANNEL}_${signal_process}_${MASS}_impacts --transparent --translate ${CMSSW_BASE}/src/translate.json --blind # _nobbb --no-bbb
popd
;;
*)
echo "[ERROR] Given mode not known. Skipping."
exit 1
;;
esac