Skip to content

Commit c07e2df

Browse files
committed
keep aux files around
1 parent 5eb78a8 commit c07e2df

File tree

11 files changed

+608
-193
lines changed

11 files changed

+608
-193
lines changed

README.md

Lines changed: 49 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,9 @@ cd higgstocharm
4646
# Must chose --data or --MC, other options get printed
4747
# python new_Hxx.py --data --unblind --year 2017 --templates n2nano/templates_nskim17_CC.root -o Test17
4848
python new_Hxx.py --data --unblind --year 2017 -t tau/templates_new17_CC.root -o Test17 --degs 0,0 --fast 1
49-
python new_Hxx.py --data --unblind --year 2016 -t temps/templates_corr16_CC.root --mut temps/templatesmuCR_corr16_CC.root -o Correct16 --degs 2,0
49+
python new_Hxx.py --data --unblind --year 2016 -t temps/templates_corr16_CC.root --mut temps/templatesmuCR_corr16_CC.root -o Correct16 --degs 1,0
50+
51+
python new_Hxx.py --data --unblind --year 2016 -t temps/templates_corr16_CC.root --mut temps/templatesmuCR_corr16_CC.root -o Unblind16mod --degs 1,0
5052
```
5153

5254
## Fitting
@@ -58,9 +60,8 @@ bash build.sh
5860
# text2workspace.py -P HiggsAnalysis.CombinedLimit.PhysicsModel:multiSignalModel --PO verbose --PO 'map=.*/*hcc*:r[1,-500,500]' model_combined.txt
5961
# text2workspace.py -P HiggsAnalysis.CombinedLimit.PhysicsModel:multiSignalModel --PO verbose --PO 'map=.*/zcc:r[1,-5,5]' model_combined.txt
6062
61-
combine -M FitDiagnostics -d model_combined.root --cminDefaultMinimizerStrategy 0 --robustFit=1
62-
--setParameters z=1,r=1 -n "" -t -1 --toysFrequentist
63-
combine -M FitDiagnostics --expectSignal 1 -d model_combined.root --cminDefaultMinimizerStrategy 0 --robustFit=1 --saveShapes --saveWithUncertainties -t -1 --toysFrequentist --setParameters z=1 -n ""
63+
combine -M FitDiagnostics -d model_combined.root --cminDefaultMinimizerStrategy 0 --robustFit=1 --setParameters z=1,r=1 -n "" -t -1 --toysFrequentist
64+
combine -M FitDiagnostics --expectSignal 1 -d model_combined.root --cminDefaultMinimizerStrategy 0 --robustFit=1 --saveShapes --saveWithUncertainties -n "" -t -1 --toysFrequentist --setParameters z=1
6465
combine -M Significance model_combined.root --expectSignal 1 --redefineSignalPOIs z -t -1 --toysFrequentist
6566
combineTool.py -M AsymptoticLimits -m 125 -d model_combined.root --expectSignal 1 --setParameters z=1 --redefineSignalPOIs r -t -1 --toysFrequentist
6667
python ../../../HiggsAnalysis/CombinedLimit/test/diffNuisances.py fitDiagnostics.root
@@ -87,9 +88,9 @@ plotImpacts.py -i impactsZ.json -o plots/impacts_out_Z
8788
Fitting Z unblinding
8889
```
8990
# Baseline
90-
combineTool.py -M Impacts -d model_combined.root -m 125 --doInitialFit --robustFit 1 --setParameterRanges r=-1,5 --cminDefaultMinimizerStrategy 0 --X-rtd FITTER_DYN_STEP --expectSignal 1 --redefineSignalPOIs z
91+
combineTool.py -M Impacts -d model_combined.root -m 125 --doInitialFit --robustFit 1 --setParameterRanges r=-100,100 --cminDefaultMinimizerStrategy 0 --X-rtd FITTER_DYN_STEP --expectSignal 1 --redefineSignalPOIs z
9192
# Condor
92-
combineTool.py -M Impacts -d model_combined.root -m 125 --doFits --robustFit 1 --allPars --setParameterRanges r=-1,5 --redefineSignalPOIs z --cminDefaultMinimizerStrategy 0 --X-rtd MINIMIZER_analytic --job-mode condor --sub-opts='+JobFlavour = "workday"' --task-name ggHccZ --exclude 'rgx{qcdparams*}'
93+
combineTool.py -M Impacts -d model_combined.root -m 125 --doFits --robustFit 1 --allPars --setParameterRanges r=-100,100 --redefineSignalPOIs z --cminDefaultMinimizerStrategy 0 --X-rtd MINIMIZER_analytic --job-mode condor --sub-opts='+JobFlavour = "workday"' --task-name ggHccZ --exclude 'rgx{qcdparams*}'
9394
# Collect
9495
combineTool.py -M Impacts -d model_combined.root -m 125 --redefineSignalPOIs z -o impactsZunbl.json
9596
plotImpacts.py -i impactsZunbl.json -o plots/impacts_out_Zunbl --blind
@@ -160,7 +161,47 @@ tf2017_MCtempl_deco0=1.62,tf2017_MCtempl_deco1=-5.34e-02,tf2017_MCtempl_deco2=-1
160161

161162
### Running likelihood scan
162163
```
163-
combineTool.py -M MultiDimFit -d model_combined.root --cminDefaultMinimizerStrategy 0 --expectSignal 1 --robustFit 1 --algo grid --points 40 --setParameterRanges r=-20,20 -m 125 -t -1 --toysFrequentist
164+
combineTool.py -M MultiDimFit -d model_combined.root --cminDefaultMinimizerStrategy 0 --expectSignal 1 --robustFit 1 --algo grid --points 40 --setParameterRanges z=0.2,1.8 -m 125 --redefineSignalPOIs=z
165+
plot1DScan.py higgsCombine.Test.MultiDimFit.mH125.root -o plots/LScan_data_Z_unbl --y-max 10 --y-cut 10 --POI=z
166+
167+
# Split year form full fit
168+
text2workspace.py -P HiggsAnalysis.CombinedLimit.PhysicsModel:multiSignalModel --PO verbose --PO 'map=.*/*hcc*:r[1,-500,500]' --PO 'map=.*2016/zcc:z16[1,0,2]' --PO 'map=.*2017/zcc:z17[1,0,2]' --PO 'map=.*2018/zcc:z18[1,0,2]' model_combined.txt
169+
170+
combineTool.py -M MultiDimFit -d model_combined.root --cminDefaultMinimizerStrategy 0 --expectSignal 1 --robustFit 1 --algo grid --points 40 --setParameterRanges z16=0.2,1.8 -m 125 --redefineSignalPOIs=z16 -n .z16scan
171+
plot1DScan.py higgsCombine.z16scan.MultiDimFit.mH125.root -o plots/LScan_data_Z_unbl16 --y-max 10 --y-cut 10 --POI=z16
172+
173+
combineTool.py -M MultiDimFit -d model_combined.root --cminDefaultMinimizerStrategy 0 --expectSignal 1 --robustFit 1 --algo grid --points 40 --setParameterRanges z16=0.2,1.8 -m 125 --redefineSignalPOIs=z16 -n .z16scan
174+
plot1DScan.py higgsCombine.z16scan.MultiDimFit.mH125.root -o plots/LScan_data_Z_unbl16 --y-max 10 --y-cut 10 --POI=z16
175+
176+
combineTool.py -M MultiDimFit -d model_combined.root --cminDefaultMinimizerStrategy 0 --expectSignal 1 --robustFit 1 --algo grid --points 40 --setParameterRanges z16=0.2,1.8 -m 125 --redefineSignalPOIs=z16 -n .z16scan
177+
plot1DScan.py higgsCombine.z16scan.MultiDimFit.mH125.root -o plots/LScan_data_Z_unbl16 --y-max 10 --y-cut 10 --POI=z16
178+
179+
```
180+
181+
### Channel (year) compatibility
182+
183+
```bash
184+
combineTool.py -M MultiDimFit -d model_combined.root --algo singles --cminDefaultMinimizerStrategy 0 --setParameters r=1,z=1 --redefineSignalPOIs z -n .cmb
164185

165-
plot1DScan.py higgsCombine.Test.MultiDimFit.mH125.root -o plots/LScan_data_Zexp1 --y-max 30 --y-cut 30
186+
# Split year form full fit
187+
text2workspace.py -P HiggsAnalysis.CombinedLimit.PhysicsModel:multiSignalModel --PO verbose --PO 'map=.*/*hcc*:r[1,-500,500]' --PO 'map=.*2016/zcc:z16[1,0,2]' --PO 'map=.*2017/zcc:z17[1,0,2]' --PO 'map=.*2018/zcc:z18[1,0,2]' model_combined.txt
188+
189+
combineTool.py -M MultiDimFit -d model_combined.root --algo singles --cminDefaultMinimizerStrategy 0 --setParameters r=1,z16=1,z17=1,z18=1 --redefineSignalPOIs z16 -n .z16
190+
combineTool.py -M MultiDimFit -d model_combined.root --algo singles --cminDefaultMinimizerStrategy 0 --setParameters r=1,z16=1,z17=1,z18=1 --redefineSignalPOIs z17 -n .z17
191+
combineTool.py -M MultiDimFit -d model_combined.root --algo singles --cminDefaultMinimizerStrategy 0 --setParameters r=1,z16=1,z17=1,z18=1 --redefineSignalPOIs z18 -n .z18
192+
```
193+
194+
```bash
195+
combineTool.py -M PrintFit --json MultiDimFit_ccc.json -P z -i higgsCombine.cmb.MultiDimFit.mH120.root --algo singles
196+
197+
combineTool.py -M PrintFit --json MultiDimFit_ccc.json -P z16 -i higgsCombine.z16.MultiDimFit.mH120.root --algo singles
198+
combineTool.py -M PrintFit --json MultiDimFit_ccc.json -P z17 -i higgsCombine.z17.MultiDimFit.mH120.root --algo singles
199+
combineTool.py -M PrintFit --json MultiDimFit_ccc.json -P z18 -i higgsCombine.z18.MultiDimFit.mH120.root --algo singles
200+
201+
python ../plotCCC.py -i MultiDimFit_ccc.json -o plots/ccc_corr
202+
```
203+
204+
```bash
205+
bash build.sh
206+
combine -M ChannelCompatibilityCheck -d model_combined.root --setParameters z=1 --redefineSignalPOIs=z -g 2016 -g 2017 -g 2018
166207
```

config_Hxx.py

Lines changed: 35 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,41 @@
11
import numpy as np
22

33
# Define Bins
4-
ptbins = np.array([450, 500, 550, 600, 675, 800, 1200])
5-
npt = len(ptbins) - 1
6-
msdbins = np.linspace(40, 201, 24)
7-
8-
# Define pt/msd/rho grids
9-
ptpts, msdpts = np.meshgrid(ptbins[:-1] + 0.3 * np.diff(ptbins),
10-
msdbins[:-1] + 0.5 * np.diff(msdbins),
11-
indexing='ij')
12-
rhopts = 2*np.log(msdpts/ptpts)
13-
ptscaled = (ptpts - 450.) / (1200. - 450.)
14-
rhoscaled = (rhopts - (-6)) / ((-2.1) - (-6))
15-
validbins = (rhoscaled >= 0) & (rhoscaled <= 1)
16-
rhoscaled[~validbins] = 1 # we will mask these out later
17-
18-
# Define fine bins for smooth TF plots
19-
fptbins = np.arange(450, 1202, 2)
20-
fmsdbins = np.arange(40, 201.5, .5)
21-
22-
fptpts, fmsdpts = np.meshgrid(fptbins[:-1] + 0.3 * np.diff(fptbins),
23-
fmsdbins[:-1] + 0.5 * np.diff(fmsdbins),
24-
indexing='ij')
25-
frhopts = 2*np.log(fmsdpts/fptpts)
26-
fptscaled = (fptpts - 450.) / (1200. - 450.)
27-
frhoscaled = (frhopts - (-6)) / ((-2.1) - (-6))
28-
fvalidbins = (frhoscaled >= 0) & (frhoscaled <= 1)
29-
frhoscaled[~fvalidbins] = 1 # we will mask these out later
4+
def get_bins(year="2017"):
5+
if year == "2017":
6+
ptbins = np.array([475, 500, 550, 600, 675, 800, 1200])
7+
else:
8+
ptbins = np.array([450, 500, 550, 600, 675, 800, 1200])
9+
msdbins = np.linspace(40, 201, 24)
10+
11+
npt = len(ptbins) - 1
12+
13+
# Define pt/msd/rho grids
14+
ptpts, msdpts = np.meshgrid(ptbins[:-1] + 0.3 * np.diff(ptbins),
15+
msdbins[:-1] + 0.5 * np.diff(msdbins),
16+
indexing='ij')
17+
rhopts = 2*np.log(msdpts/ptpts)
18+
ptscaled = (ptpts - ptbins[0]) / (ptbins[-1] - ptbins[0])
19+
rhoscaled = (rhopts - (-6)) / ((-2.1) - (-6))
20+
validbins = (rhoscaled >= 0) & (rhoscaled <= 1)
21+
rhoscaled[~validbins] = 1 # we will mask these out later
22+
23+
# Define fine bins for smooth TF plots
24+
fptbins = np.arange(ptbins[0], ptbins[0]+2, 2)
25+
fmsdbins = np.arange(40, 201.5, .5)
26+
27+
fptpts, fmsdpts = np.meshgrid(fptbins[:-1] + 0.3 * np.diff(fptbins),
28+
fmsdbins[:-1] + 0.5 * np.diff(fmsdbins),
29+
indexing='ij')
30+
frhopts = 2*np.log(fmsdpts/fptpts)
31+
fptscaled = (fptpts - ptbins[0]) / (ptbins[-1] - ptbins[0])
32+
frhoscaled = (frhopts - (-6)) / ((-2.1) - (-6))
33+
fvalidbins = (frhoscaled >= 0) & (frhoscaled <= 1)
34+
frhoscaled[~fvalidbins] = 1 # we will mask these out later
35+
36+
return msdbins, ptbins, ptscaled, rhoscaled, validbins
37+
38+
msdbins, ptbins, ptscaled, rhoscaled, validbins = get_bins(year="2016")
3039

3140

3241
def TF_params(xparlist, xparnames=None, nrho=None, npt=None):

do_gof.sh

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/bin/bash
2+
3+
if [[ "$2" -eq 0 ]]; then
4+
ALGO=saturated
5+
elif [[ "$2" -eq 1 ]]; then
6+
ALGO=KS
7+
fi
8+
echo "Using algo:" $ALGO
9+
10+
if [[ "$1" -eq 0 ]]; then
11+
combine -M FitDiagnostics -d model_combined.root --cminDefaultMinimizerStrategy 0 --robustFit=1 --setParameters z=1,r=1 -n "" --saveShapes --saveWithUncertainties #-t -1 --toysFrequentist --robustHesse 1
12+
elif [[ "$1" -eq 1 ]]; then
13+
combine -M GoodnessOfFit model_combined.root --algo $ALGO --expectSignal 1 --redefineSignalPOIs z -n DataGoF$ALGO
14+
elif [[ "$1" -eq 2 ]]; then
15+
combineTool.py -M GoodnessOfFit model_combined.root --algo $ALGO --expectSignal 1 -t 5 --toysFrequentist --redefineSignalPOIs z -n GoFs$ALGO --job-mode condor --sub-opts='+JobFlavour = "workday"' --task-name ggHcc$ALGO -s 1:"$3":1
16+
elif [[ "$1" -eq 3 ]]; then
17+
hadd -f allgofs$ALGO.root higgsCombineGoFs$ALGO.GoodnessOfFit.mH120.*.root
18+
elif [[ "$1" -eq 4 ]]; then
19+
python ../plot_single_gof.py higgsCombineDataGoF$ALGO.GoodnessOfFit.mH120.root allgofs$ALGO.root --algo $ALGO --year "$3"
20+
fi
21+
22+
23+
# combineTool.py -M GoodnessOfFit --algorithm $ALGO -m 125 --there -d model_combined.root -n ".$ALGO.toys" --expectSignal 1 -t 500 --toysFrequentist
24+
# combineTool.py -M GoodnessOfFit --algorithm $ALGO -m 125 --there -d model_combined.root -n ".$ALGO"
25+
# combineTool.py -M CollectGoodnessOfFit --input higgsCombine.$ALGO.GoodnessOfFit.mH125.root higgsCombine.$ALGO.toys.GoodnessOfFit.mH125.*.root -o cmb_$ALGO.json
26+
# python ../../../CombineHarvester/CombineTools/scripts/plotGof.py --statistic $ALGO --mass 125.0 cmb_$ALGO.json --title-right="35.9 fb^{-1} (13 TeV)" --output='-$ALGO'

0 commit comments

Comments
 (0)