Skip to content

Commit

Permalink
Merge pull request #89 from LPC-HH/fix_combine
Browse files Browse the repository at this point in the history
Fix run_blinded_hh4b.sh
  • Loading branch information
jmduarte authored Apr 16, 2024
2 parents b8e16c8 + 470b1c8 commit 6acb8e2
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
24 changes: 12 additions & 12 deletions src/HH4b/combine/run_blinded_hh4b.sh
Original file line number Diff line number Diff line change
Expand Up @@ -195,8 +195,8 @@ if [ $bfit = 1 ]; then
echo "Blinded background-only fit"
combine -D $dataset -M MultiDimFit --saveWorkspace -m 125 -d ${wsm}.root -v 9 \
--cminDefaultMinimizerStrategy 1 \
--setParameters "${maskunblindedargs}","${setparamsblinded}",r=0 \
--freezeParameters r,"${freezeparamsblinded}" \
--setParameters ${maskunblindedargs},${setparamsblinded},r=0 \
--freezeParameters r,${freezeparamsblinded} \
-n Snapshot 2>&1 | tee $outsdir/MultiDimFit.txt
else
if [ ! -f "higgsCombineSnapshot.MultiDimFit.mH125.root" ]; then
Expand All @@ -211,7 +211,7 @@ if [ $limits = 1 ]; then
combine -M AsymptoticLimits -m 125 -n "" -d ${wsm_snapshot}.root --snapshotName MultiDimFit -v 9 \
--saveWorkspace --saveToys --bypassFrequentistFit \
${unblindedparams},r=0 -s "$seed" \
--floatParameters "${freezeparamsblinded}",r --toysFrequentist --run blind 2>&1 | tee $outsdir/AsymptoticLimits.txt
--floatParameters ${freezeparamsblinded},r --toysFrequentist --run blind 2>&1 | tee $outsdir/AsymptoticLimits.txt
fi


Expand All @@ -220,15 +220,15 @@ if [ $significance = 1 ]; then
combine -M Significance -d ${wsm_snapshot}.root -n "" --significance -m 125 --snapshotName MultiDimFit -v 9 \
-t -1 --expectSignal=1 --saveWorkspace --saveToys --bypassFrequentistFit \
${unblindedparams},r=1 \
--floatParameters "${freezeparamsblinded}",r --toysFrequentist 2>&1 | tee $outsdir/Significance.txt
--floatParameters ${freezeparamsblinded},r --toysFrequentist 2>&1 | tee $outsdir/Significance.txt
fi


if [ $dfit = 1 ]; then
echo "Fit Diagnostics"
combine -M FitDiagnostics -m 125 -d ${wsm}.root \
--setParameters "${maskunblindedargs}","${setparamsblinded}" \
--freezeParameters "${freezeparamsblinded}" \
--setParameters ${maskunblindedargs},${setparamsblinded} \
--freezeParameters ${freezeparamsblinded} \
--cminDefaultMinimizerStrategy 1 \
-n Blinded --ignoreCovWarning -v 9 2>&1 | tee $outsdir/FitDiagnostics.txt
# --saveShapes --saveNormalizations --saveWithUncertainties --saveOverallShapes \
Expand All @@ -243,7 +243,7 @@ if [ $gofdata = 1 ]; then
echo "GoF on data"
combine -M GoodnessOfFit -d ${wsm_snapshot}.root --algo saturated -m 125 \
--snapshotName MultiDimFit --bypassFrequentistFit \
--setParameters "${maskunblindedargs}",r=0 \
--setParameters ${maskunblindedargs},r=0 \
--freezeParameters r \
-n Data -v 9 2>&1 | tee $outsdir/GoF_data.txt
fi
Expand All @@ -253,7 +253,7 @@ if [ "$goftoys" = 1 ]; then
echo "GoF on toys"
combine -M GoodnessOfFit -d ${wsm_snapshot}.root --algo saturated -m 125 \
--snapshotName MultiDimFit --bypassFrequentistFit \
--setParameters "${maskunblindedargs}",r=0 \
--setParameters ${maskunblindedargs},r=0 \
--freezeParameters r --saveToys \
-n Toys -v 9 -s "$seed" -t "$numtoys" --toysFrequentist 2>&1 | tee $outsdir/GoF_toys.txt
fi
Expand All @@ -271,7 +271,7 @@ if [ "$impactsi" = 1 ]; then
combineTool.py -M Impacts --snapshotName MultiDimFit -m 125 -n "impacts" \
-t -1 --bypassFrequentistFit --toysFrequentist --expectSignal 1 \
-d ${wsm_snapshot}.root --doInitialFit --robustFit 1 \
"${unblindedparams}" --floatParameters "${freezeparamsblinded}" \
${unblindedparams} --floatParameters ${freezeparamsblinded} \
--cminDefaultMinimizerStrategy=1 -v 1 2>&1 | tee $outsdir/Impacts_init.txt
fi

Expand All @@ -284,7 +284,7 @@ if [ "$impactsf" != 0 ]; then
combine -M MultiDimFit -n _paramFit_impacts_"$impactsf" --algo impact --redefineSignalPOIs r -P "$impactsf" \
--floatOtherPOIs 1 --saveInactivePOI 1 --snapshotName MultiDimFit -d ${wsm_snapshot}.root \
-t -1 --bypassFrequentistFit --toysFrequentist --expectSignal 1 --robustFit 1 \
"${unblindedparams}" --floatParameters "${freezeparamsblinded}" \
${unblindedparams} --floatParameters ${freezeparamsblinded} \
--setParameterRanges r=-0.5,20 --cminDefaultMinimizerStrategy=1 -v 1 -m 125 | tee $outsdir/Impacts_"$impactsf".txt

# Old Impacts command:
Expand All @@ -301,8 +301,8 @@ if [ "$impactsc" != 0 ]; then
echo "Collecting impacts"
combineTool.py -M Impacts --snapshotName MultiDimFit \
-m 125 -n "impacts" -d ${wsm_snapshot}.root \
--setParameters "${maskblindedargs}" --floatParameters "${freezeparamsblinded}" \
-t -1 --named "$impactsc" \
--setParameters ${maskblindedargs} --floatParameters ${freezeparamsblinded} \
-t -1 --named $impactsc \
--setParameterRanges r=-0.5,20 -v 1 -o impacts.json 2>&1 | tee $outsdir/Impacts_collect.txt

plotImpacts.py -i impacts.json -o impacts
Expand Down
2 changes: 1 addition & 1 deletion src/HH4b/postprocessing/CreateDatacard.py
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,7 @@ def fill_regions(

if bblite and args.mcstats:
# tie MC stats parameters together in blinded and "unblinded" region
channel_name = region
channel_name = region_noblinded
ch.autoMCStats(
channel_name=f"{CMS_PARAMS_LABEL}_{channel_name}",
threshold=args.mcstats_threshold,
Expand Down

0 comments on commit 6acb8e2

Please sign in to comment.