Skip to content

Commit

Permalink
Merge pull request cms-sw#145 from cms-analysis/mschen
Browse files Browse the repository at this point in the history
merged
  • Loading branch information
chenmingshui committed Sep 2, 2014
2 parents 509fc20 + 182b7cb commit 807e6b3
Show file tree
Hide file tree
Showing 2 changed files with 79 additions and 6 deletions.
67 changes: 67 additions & 0 deletions data/lhc-hxswg/BRU_rules
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
=================================
# grand combination has processes
# non-ttH htt: qqH_hww ggH_hww WH_hww WH_htt ZH_hww ZH_htt
# non-ttH hww3l: WH_htt WH_hww
# ttH(bbttww): ttH_[cc,bb,tt,gg,gluglu,ww,zz,zg]
# keep also in mind processes like ggH_SM in two state searches

# first drop old BR unc implementation from individual analyses
nuisance edit drop * * BRhiggs_htt
nuisance edit drop * * BRhiggs_hvv
nuisance edit drop * * BRhiggs_hzz4l
nuisance edit drop * * CMS_hgg_BR

# adding nuisances according to
# https://indico.cern.ch/event/317643/contribution/0/material/0/0.pdf#6

# Lines come in pairs:
# - first line takes care of all signal names we know only in cards for given decays
# - second line takes care of special signal names that involve the decay and does it in all cards

#param_alphaS
nuisance edit add ^((W|qq|tt|Z|V|gg)H|VBF)(|_SM)$ h(ww|zz|gg|tt|zg|mm) param_alphaS lnN 1.012
nuisance edit add h(tt|ww|zz|zg|gg|mm) * param_alphaS lnN 1.012
nuisance edit add ^((W|qq|tt|Z|V|gg)H|VBF)(|_SM)$ hbb param_alphaS lnN 0.989
nuisance edit add hbb * param_alphaS lnN 0.989
nuisance edit add ^((W|qq|tt|Z|V|gg)H|VBF)(|_SM)$ hcc param_alphaS lnN 0.942
nuisance edit add hcc * param_alphaS lnN 0.942
nuisance edit add ^((W|qq|tt|Z|V|gg)H|VBF)(|_SM)$ hgluglu param_alphaS lnN 1.055
nuisance edit add hgluglu * param_alphaS lnN 1.055

#param_mB
nuisance edit add ^((W|qq|tt|Z|V|gg)H|VBF)(|_SM)$ h(ww|zz|gg|tt|zg|mm|cc|gluglu) param_mB lnN 0.981
nuisance edit add h(ww|zz|gg|tt|zg|mm|cc|gluglu) * param_mB lnN 0.981
nuisance edit add ^((W|qq|tt|Z|V|gg)H|VBF)(|_SM)$ hbb param_mB lnN 1.014
nuisance edit add hbb * param_mB lnN 1.014

#param_mC
nuisance edit add ^((W|qq|tt|Z|V|gg)H|VBF)(|_SM)$ hcc param_mC lnN 1.062
nuisance edit add hcc * param_mC lnN 1.062

#param_mt

#HiggsDecayWidthTHU_hqq
nuisance edit add ^((W|qq|tt|Z|V|gg)H|VBF)(|_SM)$ h(ww|zz|gg|tt|zg|mm|gluglu) HiggsDecayWidthTHU_hqq lnN 0.988
nuisance edit add h(ww|zz|gg|tt|zg|mm|gluglu) * HiggsDecayWidthTHU_hqq lnN 0.988
nuisance edit add ^((W|qq|tt|Z|V|gg)H|VBF)$ h(bb|cc) HiggsDecayWidthTHU_hqq lnN 1.008
nuisance edit add h(bb|cc) * HiggsDecayWidthTHU_hqq lnN 1.008

#HiggsDecayWidthTHU_hvv
nuisance edit add ^((W|qq|tt|Z|V|gg)H|VBF)(|_SM)$ h(ww|zz) HiggsDecayWidthTHU_hvv lnN 1.004
nuisance edit add h(ww|zz) * HiggsDecayWidthTHU_hvv lnN 1.004

#HiggsDecayWidthTHU_hll
nuisance edit add ^((W|qq|tt|Z|V|gg)H|VBF)(|_SM)$ h(tt|mm) HiggsDecayWidthTHU_hll lnN 1.019
nuisance edit add h(tt|mm) * HiggsDecayWidthTHU_hll lnN 1.019

#HiggsDecayWidthTHU_hgg
nuisance edit add ^((W|qq|tt|Z|V|gg)H|VBF)(|_SM)$ hgg HiggsDecayWidthTHU_hgg lnN 1.010
nuisance edit add hgg * HiggsDecayWidthTHU_hgg lnN 1.010

#HiggsDecayWidthTHU_hzg
nuisance edit add ^((W|qq|tt|Z|V|gg)H|VBF)(|_SM)$ hzg HiggsDecayWidthTHU_hzg lnN 1.051
nuisance edit add hzg * HiggsDecayWidthTHU_hzg lnN 1.051

#HiggsDecayWidthTHU_hgluglu
nuisance edit add ^((W|qq|tt|Z|V|gg)H|VBF)(|_SM)$ hgluglu HiggsDecayWidthTHU_hgluglu lnN 1.028
nuisance edit add hgluglu * HiggsDecayWidthTHU_hgluglu lnN 1.028
18 changes: 12 additions & 6 deletions python/NuisanceModifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ def doAddNuisance(datacard, args):
if len(args) < 5:
raise RuntimeError, "Missing arguments: the syntax is: nuisance edit add process channel name pdf value [ options ]"
(process, channel, name, pdf, value) = args[:5]
if process != "*": cprocess = re.compile(process)
if channel != "*": cchannel = re.compile(channel)
opts = args[5:]
found = False
errline = dict([(b,dict([(p,0) for p in datacard.exp[b]])) for b in datacard.bins])
Expand All @@ -37,10 +39,10 @@ def doAddNuisance(datacard, args):
value = float(value)
foundChann, foundProc = False, False
for b in errline.keys():
if channel == "*" or re.match(channel,b):
if channel == "*" or cchannel.search(b):
foundChann = True
for p in datacard.exp[b]:
if process == "*" or re.match(process,p):
if process == "*" or cprocess.search(p):
foundProc = True
if p in errline[b] and errline[b][p] not in [ 0.0, 1.0 ]:
if "addq" in opts:
Expand All @@ -60,15 +62,17 @@ def doDropNuisance(datacard, args):
if len(args) < 3:
raise RuntimeError, "Missing arguments: the syntax is: nuisance edit drop process channel name [ options ]"
(process, channel, name) = args[:3]
if process != "*": cprocess = re.compile(process)
if channel != "*": cchannel = re.compile(channel)
opts = args[3:]
foundProc = False
for lsyst,nofloat,pdf,args0,errline in datacard.systs:
if re.match(name,lsyst):
for b in errline.keys():
if channel == "*" or re.match(channel,b):
if channel == "*" or cchannel.search(b):
#if channel != "*": foundProc = False
for p in datacard.exp[b]:
if process == "*" or re.match(process,p):
if process == "*" or cprocess.search(p):
foundProc = True
errline[b][p] = 0
#if channel != "*" and foundProc == False:
Expand All @@ -87,6 +91,8 @@ def doRenameNuisance(datacard, args):
if len(args) < 4:
raise RuntimeError, "Missing arguments: the syntax is: nuisance edit rename process channel oldname newname"
(process, channel, oldname, newname) = args[:4]
if process != "*": cprocess = re.compile(process)
if channel != "*": cchannel = re.compile(channel)
opts = args[5:]
for lsyst,nofloat,pdf0,args0,errline0 in datacard.systs[:]:
lsystnew = re.sub(oldname,newname,lsyst)
Expand All @@ -102,11 +108,11 @@ def doRenameNuisance(datacard, args):
datacard.systs.append([lsystnew,nofloat,pdf0,args0,errline2])
foundChann, foundProc = False, False
for b in errline0.keys():
if channel == "*" or re.match(channel,b):
if channel == "*" or cchannel.search(b):
foundChann = True
if channel != "*": foundProc = False
for p in datacard.exp[b].keys():
if process == "*" or re.match(process,p):
if process == "*" or cprocess.search(p):
foundProc = True
if p in errline0[b] and errline2[b][p] not in [ 0.0, 1.0 ]:
if "addq" in opts:
Expand Down

0 comments on commit 807e6b3

Please sign in to comment.