Skip to content

Commit

Permalink
Include KLambda fit (#40)
Browse files Browse the repository at this point in the history
* ReReco validation

* kLambda

Co-authored-by: Alessandro <alessandro.tarabini@gmail.com>
  • Loading branch information
bonanomi and AlessandroTarabini authored Mar 16, 2022
1 parent 01694ac commit 231ad87
Show file tree
Hide file tree
Showing 13 changed files with 242 additions and 46 deletions.
104 changes: 81 additions & 23 deletions LHScans/plot_LLScan.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,23 +128,29 @@ def BuildScan(scan, param, files, color, yvals, ycut):

yvals = [1., 4.]

obsName = opt.OBSNAME

channel = ["Expected","Expected - no syst.","Observed","Observed - no syst."]

inputPath = '../combine_files/'

fileList = [ "higgsCombine_BIN_OBS.MultiDimFit.mH125.38.123456.root",
"higgsCombine_BIN_OBS_NoSys_exp.MultiDimFit.mH125.38.123456.root",
]

if(opt.UNBLIND):
if 'kL' in obsName:
fileList = [ "higgsCombine_BIN_grid.MultiDimFit.mH125.38.123456.root",
"higgsCombine_BIN_NoSys_grid.MultiDimFit.mH125.38.123456.root"]
else:
fileList = [ "higgsCombine_BIN_OBS.MultiDimFit.mH125.38.123456.root",
"higgsCombine_BIN_OBS_NoSys_exp.MultiDimFit.mH125.38.123456.root",
"higgsCombine_BIN_OBS.MultiDimFit.mH125.38.root",
"higgsCombine_BIN_OBS_NoSys.MultiDimFit.mH125.38.root"
]

outString = "test"
"higgsCombine_BIN_OBS_NoSys_exp.MultiDimFit.mH125.38.123456.root"]

if(opt.UNBLIND and 'kL' in obsName):
fileList = [ "higgsCombine_BIN_grid.MultiDimFit.mH125.38.123456.root",
"higgsCombine_BIN_NoSys_grid.MultiDimFit.mH125.38.123456.root",
"higgsCombine_BIN_grid.MultiDimFit.mH125.38.root",
"higgsCombine_BIN_NoSys_grid.MultiDimFit.mH125.38.root"]
elif(opt.UNBLIND):
fileList = [ "higgsCombine_BIN_OBS.MultiDimFit.mH125.38.123456.root",
"higgsCombine_BIN_OBS_NoSys_exp.MultiDimFit.mH125.38.123456.root",
"higgsCombine_BIN_OBS.MultiDimFit.mH125.38.root",
"higgsCombine_BIN_OBS_NoSys.MultiDimFit.mH125.38.root"]

titles = ["Expected","Expected - stat-only"]
idx_max = 1
Expand Down Expand Up @@ -176,14 +182,14 @@ def BuildScan(scan, param, files, color, yvals, ycut):
_lumi = '137'

_poi = 'SigmaBin'
obsName = opt.OBSNAME
v4_flag = opt.V4

doubleDiff = False
if(obsName == 'mass4l'): label = 'm_{4l}'
elif(obsName == 'mass4l_zzfloating'): label = 'm_{4l}'
elif(obsName == 'njets_pt30_eta4p7'): label = 'N_{jet}, pT>30 GeV, |#eta|<4.7'
elif(obsName == 'pT4l'): label = 'p_{T}^{H} (GeV)'
elif(obsName == 'pT4l_kL'): label = ''
elif(obsName == 'rapidity4l'): label = '|y_{H}|'
elif(obsName == 'costhetaZ1'): label = 'cos(#theta_{1})'
elif(obsName == 'costhetaZ2'): label = 'cos(#theta_{2})'
Expand Down Expand Up @@ -256,6 +262,7 @@ def BuildScan(scan, param, files, color, yvals, ycut):
if not doubleDiff: nBins = nBins-1 #in case of 1D measurement the number of bins is -1 the length of the list of bin boundaries
if obsName.startswith("mass4l"): nBins = nBins + 3 #in case of mass4l len(obs_bins)=1, we need to add +3 for cross section in the three different final states
if v4_flag: nBins = (len(obs_bins)-1)*2
if 'kL' in obsName: nBins = 1


for i in range(nBins):
Expand All @@ -275,6 +282,10 @@ def BuildScan(scan, param, files, color, yvals, ycut):
_obs_bin = 'r2e2muBin'+str(i/2)
else:
_obs_bin = 'r4lBin'+str((i-1)/2)

if 'kL' in obsName:
_obs_bin = 'kappa_lambda'

print _obs_bin

graphs = []
Expand All @@ -295,6 +306,8 @@ def BuildScan(scan, param, files, color, yvals, ycut):
if _bin == 0:
if v4_flag:
graphs[ifile].SetPoint(ipoint,entry.r2e2muBin0,2.0*entry.deltaNLL)
elif 'kL' in obsName:
graphs[ifile].SetPoint(ipoint,entry.kappa_lambda,2.0*entry.deltaNLL)
else:
graphs[ifile].SetPoint(ipoint,entry.SigmaBin0,2.0*entry.deltaNLL)
ipoint = ipoint+1
Expand Down Expand Up @@ -476,6 +489,8 @@ def BuildScan(scan, param, files, color, yvals, ycut):
elif _bin == 19: xtitle = "#sigma_{bin 4l 9}"
elif _bin == 20: xtitle = "#sigma_{bin 2e2mu 10}"
elif _bin == 21: xtitle = "#sigma_{bin 4l 10}"
elif 'kL' in obsName:
xtitle = "k_{#lambda}"
else:
xtitle = "#sigma_{bin " + str(_bin) + "}"
graphs[0].GetXaxis().SetTitle(xtitle)
Expand Down Expand Up @@ -528,26 +543,65 @@ def BuildScan(scan, param, files, color, yvals, ycut):
leg.Draw("SAME")

poi = _obs_bin
fname = inputPath + "higgsCombine_"+obsName+"_"+poi+".MultiDimFit.mH125.38.123456.root"
exp_scan = BuildScan('scan', poi, [fname], 2, yvals, 7.)
exp_nom = exp_scan['val']
exp_2sig = exp_scan['val_2sig']

fname = inputPath + "higgsCombine_"+obsName+"_"+poi+"_NoSys_exp.MultiDimFit.mH125.38.123456.root"
exp_scan_stat = BuildScan('scan', poi, [fname], 2, yvals, 7.)
exp_nom_stat = exp_scan_stat['val']
exp_2sig_stat = exp_scan_stat['val_2sig']
if 'kL' in obsName:
fname = inputPath + "higgsCombine_"+obsName+".MultiDimFit.mH125.38.123456.root"
if plot.TFileIsGood(fname):
goodFile = TFile(fname)
else:
print('File is not good')
break
limit = goodFile.Get('limit')
kappa_lambda = []
for entry in limit:
kappa_lambda.append(entry.kappa_lambda)
print(kappa_lambda)
exp_nom = []
exp_nom.append(kappa_lambda[0])
exp_nom.append(kappa_lambda[2]-kappa_lambda[0])
exp_nom.append(kappa_lambda[0]-kappa_lambda[1])
else:
fname = inputPath + "higgsCombine_"+obsName+"_"+poi+".MultiDimFit.mH125.38.123456.root"
exp_scan = BuildScan('scan', poi, [fname], 2, yvals, 7.)
exp_nom = exp_scan['val']
# exp_2sig = exp_scan['val_2sig']

if 'kL' in obsName:
fname = inputPath + "higgsCombine_"+obsName+"_NoSys.MultiDimFit.mH125.38.123456.root"
if plot.TFileIsGood(fname):
goodFile = TFile(fname)
else:
print('File is not good')
break
limit = goodFile.Get('limit')
kappa_lambda = []
for entry in limit:
kappa_lambda.append(entry.kappa_lambda)
exp_nom_stat = []
exp_nom_stat.append(kappa_lambda[0])
exp_nom_stat.append(kappa_lambda[2]-kappa_lambda[0])
exp_nom_stat.append(kappa_lambda[0]-kappa_lambda[1])
else:
fname = inputPath + "higgsCombine_"+obsName+"_"+poi+"_NoSys_exp.MultiDimFit.mH125.38.123456.root"
exp_scan_stat = BuildScan('scan', poi, [fname], 2, yvals, 7.)
exp_nom_stat = exp_scan_stat['val']
# exp_2sig_stat = exp_scan_stat['val_2sig']

exp_up_sys = np.sqrt(exp_nom[1]**2 - exp_nom_stat[1]**2)
exp_do_sys = np.sqrt(abs(exp_nom[2])**2 - abs(exp_nom_stat[2])**2)

if (opt.UNBLIND):
fname = inputPath + "higgsCombine_"+obsName+"_"+poi+".MultiDimFit.mH125.38.root"
if 'kL' in obsName:
fname = inputPath + "higgsCombine_"+obsName+".MultiDimFit.mH125.38.root"
else:
fname = inputPath + "higgsCombine_"+obsName+"_"+poi+".MultiDimFit.mH125.38.root"
obs_scan = BuildScan('scan', poi, [fname], 2, yvals, 7.)
obs_nom = obs_scan['val']
obs_2sig = obs_scan['val_2sig']

fname = inputPath + "higgsCombine_"+obsName+"_"+poi+"_NoSys.MultiDimFit.mH125.38.root"
if 'kL' in obsName:
fname = inputPath + "higgsCombine_"+obsName+"_NoSys.MultiDimFit.mH125.38.root"
else:
fname = inputPath + "higgsCombine_"+obsName+"_"+poi+"_NoSys_exp.MultiDimFit.mH125.38.root"
obs_scan_stat = BuildScan('scan', poi, [fname], 2, yvals, 7.)
obs_nom_stat = obs_scan_stat['val']
obs_2sig_stat = obs_scan_stat['val_2sig']
Expand Down Expand Up @@ -581,6 +635,8 @@ def BuildScan(scan, param, files, color, yvals, ycut):
if _bin == 19: exp_fit = 'Exp. #sigma_{bin, 4l, 9} = %.2f^{#plus %.2f}_{#minus %.2f} (stat)^{#plus %.2f}_{#minus %.2f} (syst)' % (exp_nom[0], exp_nom_stat[1], abs(exp_nom_stat[2]), exp_up_sys, exp_do_sys)
if _bin == 20: exp_fit = 'Exp. #sigma_{bin, 2e2mu, 10} = %.2f^{#plus %.2f}_{#minus %.2f} (stat)^{#plus %.2f}_{#minus %.2f} (syst)' % (exp_nom[0], exp_nom_stat[1], abs(exp_nom_stat[2]), exp_up_sys, exp_do_sys)
if _bin == 21: exp_fit = 'Exp. #sigma_{bin, 4l, 10} = %.2f^{#plus %.2f}_{#minus %.2f} (stat)^{#plus %.2f}_{#minus %.2f} (syst)' % (exp_nom[0], exp_nom_stat[1], abs(exp_nom_stat[2]), exp_up_sys, exp_do_sys)
elif 'kL' in obsName:
exp_fit = 'Exp. k_{#lambda} = %.2f^{#plus %.2f}_{#minus %.2f} (stat)^{#plus %.2f}_{#minus %.2f} (syst)' % (exp_nom[0], exp_nom_stat[1], abs(exp_nom_stat[2]), exp_up_sys, exp_do_sys)
else:
exp_fit = 'Exp. #sigma_{bin, %d} = %.2f^{#plus %.2f}_{#minus %.2f} (stat)^{#plus %.2f}_{#minus %.2f} (syst)' % (_bin, exp_nom[0], exp_nom_stat[1], abs(exp_nom_stat[2]), exp_up_sys, exp_do_sys)
Text3.SetTextAlign(12);
Expand Down Expand Up @@ -636,6 +692,8 @@ def BuildScan(scan, param, files, color, yvals, ycut):
elif doubleDiff:
latex2.DrawLatex(0.55,0.65, str(obs_bins[_bin][0])+' < '+label+' < '+str(obs_bins[_bin][1]))
latex2.DrawLatex(0.55,0.60, str(obs_bins[_bin][2])+' < '+label_2nd+' < '+str(obs_bins[_bin][3]))
elif 'kL' in obsName:
latex2.DrawLatex(0.55,0.60, '')
elif v4_flag:
if _bin == 0: latex2.DrawLatex(0.55,0.65, str(obs_bins[0])+' < '+label+' < '+str(obs_bins[1]))
if _bin == 1: latex2.DrawLatex(0.55,0.65, str(obs_bins[0])+' < '+label+' < '+str(obs_bins[1]))
Expand Down
5 changes: 4 additions & 1 deletion coefficients/JES/PrintJES.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,14 @@ def parseOptions():
if not os.path.exists('tables/'+obsname_out):
os.makedirs('tables/'+obsname_out)

if doubleDiff: nBins = len(obs_bins)
else: nBins = len(obs_bins)-1

# Tables with numerical values
tables = {}
inclusiveJES = {}
for fState in ['2e2mu', '4e', '4mu']:
for recobin in range(len(obs_bins)-1):
for recobin in range(nBins):
table = []
for jesName in jesNames:
# nominal_incl = 0
Expand Down
3 changes: 3 additions & 0 deletions coefficients/JES/RunJES.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,10 @@ def getJes(channel, m4l_low, m4l_high, obs_reco, obs_gen, obs_bins, recobin, obs
cutobs_reco &= (datafr[obs_reco_2nd] >= obs_reco_2nd_low) & (datafr[obs_reco_2nd] < obs_reco_2nd_high)
cutobs_reco_jesup &= (datafr[obs_reco_2nd+'_jesup_'+i] >= obs_reco_2nd_low) & (datafr[obs_reco_2nd+'_jesup_'+i] < obs_reco_2nd_high)
cutobs_reco_jesdn &= (datafr[obs_reco_2nd+'_jesdn_'+i] >= obs_reco_2nd_low) & (datafr[obs_reco_2nd+'_jesdn_'+i] < obs_reco_2nd_high)
cutobs_reco_qqzz &= (datafr_qqzz[obs_reco_2nd] >= obs_reco_2nd_low) & (datafr_qqzz[obs_reco_2nd] < obs_reco_2nd_high)
cutobs_reco_jesup_qqzz &= (datafr_qqzz[obs_reco_2nd+'_jesup_'+i] >= obs_reco_2nd_low) & (datafr_qqzz[obs_reco_2nd+'_jesup_'+i] < obs_reco_2nd_high)
cutobs_reco_jesdn_qqzz &= (datafr_qqzz[obs_reco_2nd+'_jesdn_'+i] >= obs_reco_2nd_low) & (datafr_qqzz[obs_reco_2nd+'_jesdn_'+i] < obs_reco_2nd_high)
cutobs_reco_ggzz &= (datafr_ggzz[obs_reco_2nd] >= obs_reco_2nd_low) & (datafr_ggzz[obs_reco_2nd] < obs_reco_2nd_high)
cutobs_reco_jesup_ggzz &= (datafr_ggzz[obs_reco_2nd+'_jesup_'+i] >= obs_reco_2nd_low) & (datafr_ggzz[obs_reco_2nd+'_jesup_'+i] < obs_reco_2nd_high)
cutobs_reco_jesdn_ggzz &= (datafr_ggzz[obs_reco_2nd+'_jesdn_'+i] >= obs_reco_2nd_low) & (datafr_ggzz[obs_reco_2nd+'_jesdn_'+i] < obs_reco_2nd_high)

Expand Down Expand Up @@ -224,6 +226,7 @@ def doGetJes(obs_reco, obs_gen, obs_name, obs_bins, obs_reco_2nd = 'None', obs_g
m4l_low = opt.LOWER_BOUND
m4l_high = opt.UPPER_BOUND


print (obsname, years, m4l_low, m4l_high, obsname_out)

obs_bins, doubleDiff = binning(opt.OBSNAME)
Expand Down
Binary file modified condor_submission/CMSSW_10_2_13_withCombine.tgz
Binary file not shown.
21 changes: 14 additions & 7 deletions condor_submission/batchScript.sh
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,14 @@ cp /home/llr/cms/tarabini/CMSSW_10_2_13/src/HiggsAnalysis/FiducialXSFWK/fit/crea
cp /home/llr/cms/tarabini/CMSSW_10_2_13/src/HiggsAnalysis/FiducialXSFWK/fit/createXSworkspace.py .
cp /home/llr/cms/tarabini/CMSSW_10_2_13/src/HiggsAnalysis/FiducialXSFWK/fit/addConstrainedModel.py .
cp /home/llr/cms/tarabini/CMSSW_10_2_13/src/HiggsAnalysis/FiducialXSFWK/fit/impacts.py .
cp /home/llr/cms/tarabini/CMSSW_10_2_13/src/HiggsAnalysis/FiducialXSFWK/fit/impacts_klambda.sh .
python RunFiducialXS.py --obsName 'VAR' --year 'Full' UNBLIND ZZFLOATING
python impacts.py --obsName 'VAR' --year 'Full' UNBLIND
FIFTH UNBLIND
if [[ "VAR" == "pT4l_kL" ]]; then
sh impacts_klambda.sh
else
python impacts.py --obsName 'VAR' --year 'Full' UNBLIND
FIFTH UNBLIND
fi

cd ../LHScans
cp /home/llr/cms/tarabini/CMSSW_10_2_13/src/HiggsAnalysis/FiducialXSFWK/LHScans/plot_LLScan.py .
Expand All @@ -87,11 +92,13 @@ python plot_LLScan.py --obsName 'VAR' --year 'Full' UNBLIND
FOURTH UNBLIND

cd ..
cp /home/llr/cms/tarabini/CMSSW_10_2_13/src/HiggsAnalysis/FiducialXSFWK/tdrStyle.py .
cp /home/llr/cms/tarabini/CMSSW_10_2_13/src/HiggsAnalysis/FiducialXSFWK/producePlots.py .
cp /home/llr/cms/tarabini/CMSSW_10_2_13/src/HiggsAnalysis/FiducialXSFWK/producePlots_v4.py .
python producePlots.py --obsName 'VAR' --year 'Full' UNBLIND
THIRD UNBLIND
if [[ "VAR" != "pT4l_kL" ]]; then
cp /home/llr/cms/tarabini/CMSSW_10_2_13/src/HiggsAnalysis/FiducialXSFWK/tdrStyle.py .
cp /home/llr/cms/tarabini/CMSSW_10_2_13/src/HiggsAnalysis/FiducialXSFWK/producePlots.py .
cp /home/llr/cms/tarabini/CMSSW_10_2_13/src/HiggsAnalysis/FiducialXSFWK/producePlots_v4.py .
python producePlots.py --obsName 'VAR' --year 'Full' UNBLIND
THIRD UNBLIND
fi

## ----- Moving all outputs ----- ##
# Outputs from RunCoefficients
Expand Down
3 changes: 2 additions & 1 deletion condor_submission/sub.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@

declare -a obs=(
# "mass4l noJES"
"mass4l_zzfloating noJES"
# "mass4l_zzfloating noJES"
# "njets_pt30_eta4p7 JES"
# "pT4l noJES"
"pT4l_kL noJES"
# "rapidity4l noJES"
# "costhetaZ1 noJES"
# "costhetaZ2 noJES"
Expand Down
2 changes: 1 addition & 1 deletion copy_to_www.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ mv datacard/datacard_2017/hzz4l_*_13TeV_xs_SM_125_${1}_v* $path/${1}/datacard_20
mv datacard/datacard_2018/hzz4l_*_13TeV_xs_SM_125_${1}_v* $path/${1}/datacard_2018/.

mv plots/${1}/asimov/${1}_unfoldwith* $path/${1}/.
mv impacts/impacts_*_${1}_*_asimov* $path/${1}/.
cp impacts/${1}/impacts_*_${1}_*_asimov* $path/${1}/.
mv LHScans/plots/lhscan_compare_${1}_* $path/${1}/.

mv fit/commands_${1}.py $path/${1}/.
Expand Down
39 changes: 38 additions & 1 deletion fit/RunFiducialXS.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,8 @@ def runFiducialXS():
PhysicalModels = ['v2','v3']
elif obsName == 'D0m' or obsName == 'Dcp' or obsName == 'D0hp' or obsName == 'Dint' or obsName == 'DL1' or obsName == 'DL1Zg' or obsName == 'costhetaZ1' or obsName == 'costhetaZ2'or obsName == 'costhetastar' or obsName == 'phi' or obsName == 'phistar' or obsName == 'massZ1' or obsName == 'massZ2':
PhysicalModels = ['v3','v4']
elif 'kL' in obsName:
PhysicalModels = ['kLambda']
else:
PhysicalModels = ['v3']

Expand Down Expand Up @@ -240,7 +242,7 @@ def runFiducialXS():
cmds.append(cmd)
print cmd, '\n'

# text-to-workspace
# text-to-workspace (No text-to-ws for kLambda)
if (physicalModel=="v3"):
cmd = 'text2workspace.py hzz4l_all_13TeV_xs_'+obsName+'_bin_'+physicalModel+'.txt -P HiggsAnalysis.CombinedLimit.HZZ4L_Fiducial:differentialFiducialV3 --PO higgsMassRange=115,135 --PO nBin='+str(nBins)+' -o hzz4l_all_13TeV_xs_'+obsName+'_bin_'+physicalModel+'.root'
print cmd, '\n'
Expand All @@ -256,6 +258,11 @@ def runFiducialXS():
print cmd, '\n'
processCmd(cmd)
cmds.append(cmd)
elif (physicalModel=="kLambda"):
cmd = 'text2workspace.py hzz4l_all_13TeV_xs_'+obsName+'_bin_'+physicalModel+'.txt -o hzz4l_all_13TeV_xs_'+obsName+'_bin_'+physicalModel+'.root'
print cmd, '\n'
processCmd(cmd)
cmds.append(cmd)


# The workspace got from text2workspace changes name from hzz4l_ to SM_125 and it is transferred to the combine_files directory
Expand Down Expand Up @@ -457,6 +464,36 @@ def runFiducialXS():
output = processCmd(cmd)
cmds.append(cmd)

elif physicalModel == 'kLambda':
#Stat+sys singles
cmd = 'combine SM_125_all_13TeV_xs_'+obsName+'_bin_'+physicalModel+'.root -n _'+obsName+' -M MultiDimFit --algo=singles -P kappa_lambda --redefineSignalPOIs kappa_lambda -m 125.38 --freezeParameters MH,r --saveWorkspace --saveToys --setParameterRanges kappa_lambda=-10,20:r=1,1 --setParameters kappa_lambda=1.0,r=1.0 -t -1 --cminDefaultMinimizerStrategy 0 --robustFit 1'
output = processCmd(cmd)
cmds.append(cmd)

#Stat+sys grid
cmd = 'combine SM_125_all_13TeV_xs_'+obsName+'_bin_'+physicalModel+'.root -n _'+obsName+'_grid -M MultiDimFit --algo=grid --points=300 -P kappa_lambda --redefineSignalPOIs kappa_lambda -m 125.38 --freezeParameters MH,r --saveWorkspace --saveToys --setParameterRanges kappa_lambda=-10,20:r=1,1 --setParameters kappa_lambda=1.0,r=1.0 -t -1 --cminDefaultMinimizerStrategy 0 --robustFit 1'
output = processCmd(cmd)
cmds.append(cmd)

#Stat-only singles
cmd = 'combine higgsCombine_'+obsName+'.MultiDimFit.mH125.38'
if(not opt.UNBLIND): cmd += '.123456'
cmd += '.root -n _'+obsName+'_NoSys -M MultiDimFit -w w --snapshotName "MultiDimFit" --algo=singles -P kappa_lambda --redefineSignalPOIs kappa_lambda -m 125.38 --saveWorkspace --saveToys --setParameterRanges kappa_lambda=-10,20:r=1,1 --setParameters kappa_lambda=1.0,r=1.0 -t -1 --cminDefaultMinimizerStrategy 0 --robustFit 1 --freezeNuisanceGroups nuis'
if (opt.YEAR == 'Full'): cmd += ' --freezeParameters MH,r,CMS_fakeH_p1_12018,CMS_fakeH_p3_12018,CMS_fakeH_p1_22018,CMS_fakeH_p3_22018,CMS_fakeH_p1_32018,CMS_fakeH_p3_32018,CMS_fakeH_p1_12017,CMS_fakeH_p3_12017,CMS_fakeH_p1_22017,CMS_fakeH_p3_22017,CMS_fakeH_p1_32017,CMS_fakeH_p3_32017,CMS_fakeH_p1_12016,CMS_fakeH_p3_12016,CMS_fakeH_p1_22016,CMS_fakeH_p3_22016,CMS_fakeH_p1_32016,CMS_fakeH_p3_32016'
else: cmd += ' --freezeParameters MH,CMS_fakeH_p1_1'+str(opt.YEAR)+',CMS_fakeH_p3_1'+str(opt.YEAR)+',CMS_fakeH_p1_2'+str(opt.YEAR)+',CMS_fakeH_p3_2'+str(opt.YEAR)+',CMS_fakeH_p1_3'+str(opt.YEAR)+',CMS_fakeH_p3_3'+str(opt.YEAR)
output = processCmd(cmd)
cmds.append(cmd)

#Stat-only grid
cmd = 'combine higgsCombine_'+obsName+'_grid.MultiDimFit.mH125.38'
if(not opt.UNBLIND): cmd += '.123456'
cmd += '.root -n _'+obsName+'_NoSys_grid -M MultiDimFit -w w --snapshotName "MultiDimFit" --algo=grid --points=300 -P kappa_lambda --redefineSignalPOIs kappa_lambda -m 125.38 --saveWorkspace --saveToys --setParameterRanges kappa_lambda=-10,20:r=1,1 --setParameters kappa_lambda=1.0,r=1.0 -t -1 --cminDefaultMinimizerStrategy 0 --robustFit 1 --freezeNuisanceGroups nuis'
if (opt.YEAR == 'Full'): cmd += ' --freezeParameters MH,r,CMS_fakeH_p1_12018,CMS_fakeH_p3_12018,CMS_fakeH_p1_22018,CMS_fakeH_p3_22018,CMS_fakeH_p1_32018,CMS_fakeH_p3_32018,CMS_fakeH_p1_12017,CMS_fakeH_p3_12017,CMS_fakeH_p1_22017,CMS_fakeH_p3_22017,CMS_fakeH_p1_32017,CMS_fakeH_p3_32017,CMS_fakeH_p1_12016,CMS_fakeH_p3_12016,CMS_fakeH_p1_22016,CMS_fakeH_p3_22016,CMS_fakeH_p1_32016,CMS_fakeH_p3_32016'
else: cmd += ' --freezeParameters MH,CMS_fakeH_p1_1'+str(opt.YEAR)+',CMS_fakeH_p3_1'+str(opt.YEAR)+',CMS_fakeH_p1_2'+str(opt.YEAR)+',CMS_fakeH_p3_2'+str(opt.YEAR)+',CMS_fakeH_p1_3'+str(opt.YEAR)+',CMS_fakeH_p3_3'+str(opt.YEAR)
output = processCmd(cmd)
cmds.append(cmd)


# ----------------- Main -----------------
_fit_dir = os.getcwd()
cmds = [] #List of all cmds
Expand Down
Loading

0 comments on commit 231ad87

Please sign in to comment.