Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions data/hbb/scaleCards.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
default="BDT",
help="flavour of datacard (vhbb_DC_ALL_<FLAVOUR>.<MASS.DECIMAL>.txt)",
)
(options, args) = parser.parse_args()
options, args = parser.parse_args()
options.bin = True
options.stat = False
if len(args) not in [1]:
Expand Down Expand Up @@ -166,7 +166,7 @@ def file2map(x):
sysnamesSorted = list(systlines.keys())
sysnamesSorted.sort()
for name in sysnamesSorted:
(pdf, pdfargs, effect, nofloat) = systlines[name]
pdf, pdfargs, effect, nofloat = systlines[name]
if nofloat:
name += "[nofloat]"
systline = []
Expand Down
2 changes: 1 addition & 1 deletion data/hww/errorMatrix2Lands.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
parser.add_option("-o", "--optimize", dest="optimize", default=False, action="store_true")
parser.add_option("-l", "--label", dest="label", type="string", default="hww")
parser.add_option("-4", "--4th-gen", dest="sm4", default=False, action="store_true")
(options, args) = parser.parse_args()
options, args = parser.parse_args()

if len(args) < 1:
raise RuntimeError("Usage: errorMatrix2Lands.py [options] errorMatrix.txt ")
Expand Down
2 changes: 1 addition & 1 deletion data/hww/errorMatrix2Lands_multiChannel.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
parser.add_option("-4", "--4th-gen", dest="sm4", default=False, action="store_true")
parser.add_option("-n", "--nch", dest="nch", type="int", default=1)
parser.add_option("-B", "--b-fluct", dest="bfluct", type="float", default=0)
(options, args) = parser.parse_args()
options, args = parser.parse_args()

if len(args) < 1:
raise RuntimeError("Usage: errorMatrix2Lands.py [options] errorMatrix.txt ")
Expand Down
6 changes: 3 additions & 3 deletions data/hww/interpolateCardsSimple.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
default="",
help="Postfix to add to datacard name",
)
(options, args) = parser.parse_args()
options, args = parser.parse_args()
options.bin = True
options.stat = False
if len(args) not in [1, 3]:
Expand All @@ -73,7 +73,7 @@
dm1 = abs(mass1 - mass)
dm2 = abs(mass2 - mass)
if (dm2 < dm1) or (dm2 == dm1 and abs(mass1 - 164) < abs(mass2 - 164)):
(mass1, mass2) = (mass2, mass1)
mass1, mass2 = (mass2, mass1)


xsbr1 = {"ggH": 1.0, "qqH": 1.0}
Expand Down Expand Up @@ -255,7 +255,7 @@ def file2map(x):
sysnamesSorted = list(systlines.keys())
sysnamesSorted.sort()
for name in sysnamesSorted:
(pdf, pdfargs, effect, nofloat) = systlines[name]
pdf, pdfargs, effect, nofloat = systlines[name]
if nofloat:
name += "[nofloat]"
systline = []
Expand Down
4 changes: 2 additions & 2 deletions data/hww/interpolateCardsSimple4G.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
default="",
help="Postfix to add to datacard name",
)
(options, args) = parser.parse_args()
options, args = parser.parse_args()
options.bin = True
options.stat = False
if len(args) not in [1, 3]:
Expand Down Expand Up @@ -211,7 +211,7 @@ def file2map(x):
sysnamesSorted = list(systlines.keys())
sysnamesSorted.sort()
for name in sysnamesSorted:
(pdf, pdfargs, effect, nofloat) = systlines[name]
pdf, pdfargs, effect, nofloat = systlines[name]
if nofloat:
name += "[nofloat]"
systline = []
Expand Down
4 changes: 2 additions & 2 deletions data/hww/interpolateCardsSimpleSMto4G.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
default=0.0,
help="Add this amount linearly to gg->H cross section uncertainties",
)
(options, args) = parser.parse_args()
options, args = parser.parse_args()
options.bin = True
options.stat = False
if len(args) not in [1, 3]:
Expand Down Expand Up @@ -233,7 +233,7 @@ def file2map(x):
sysnamesSorted = list(systlines.keys())
sysnamesSorted.sort()
for name in sysnamesSorted:
(pdf, pdfargs, effect, nofloat) = systlines[name]
pdf, pdfargs, effect, nofloat = systlines[name]
if nofloat:
name += "[nofloat]"
systline = []
Expand Down
4 changes: 2 additions & 2 deletions data/lhc-hxswg/makeSMtables.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ def main(o):
# dump heading
heading = props["heading"]
table.append(heading)
(startRow, endRow) = spec["rows"]
startRow, endRow = spec["rows"]
for r in range(startRow - 1, endRow):
offset = col2num(props["col"]) - 1
vals = s.row_values(r)[offset : offset + len(heading)]
Expand Down Expand Up @@ -262,7 +262,7 @@ def main(o):
help="Set the minimum logging level.",
)

(o, args) = parser.parse_args()
o, args = parser.parse_args()

if not o.input:
parser.error("Please specify an input Excel file from the LHC HXSWG.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
parser.add_option(
"--deplete_crs_from_signal", dest="deplete_crs_from_signal", help="Deplete the control regions from signal", action="store_true", default=False
)
(opt, args) = parser.parse_args()
opt, args = parser.parse_args()


# main code starting here
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
parser.add_option(
"--deplete_crs_from_signal", dest="deplete_crs_from_signal", help="Deplete the control regions from signal", action="store_true", default=False
)
(opt, args) = parser.parse_args()
opt, args = parser.parse_args()


# Get histograms from input file for a given process and all regions
Expand Down
8 changes: 3 additions & 5 deletions data/tutorials/longexercise/diffNuisances.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@
help="Choose the definition of the pull, see python/calculate_pulls.py for options",
)

(options, args) = parser.parse_args()
options, args = parser.parse_args()
if len(args) == 0:
parser.print_usage()
exit(1)
Expand Down Expand Up @@ -441,8 +441,7 @@ def getGraph(hist,shift):
sigsub = ("sig", r"&sigma;")
highlight = "<b>%s</b>"
morelight = "<strong>%s</strong>"
print(
"""
print("""
<html><head><title>Comparison of nuisances</title>
<style type="text/css">
td, th { border-bottom: 1px solid black; padding: 1px 1em; }
Expand All @@ -451,8 +450,7 @@ def getGraph(hist,shift):
</style>
</head><body style="font-family: 'Verdana', sans-serif; font-size: 10pt;"><h1>Comparison of nuisances</h1>
<table>
"""
)
""")
if options.pullDef:
print("<tr><th>nuisance</th><th>background fit pull </th><th>signal fit pull</th><th>correlation</th></tr>")
fmtstring = "<tr><td><tt>%-40s</tt> </td><td> %-30s </td><td> %-30s </td><td> %-15s </td></tr>"
Expand Down
12 changes: 4 additions & 8 deletions python/Datacard.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,7 @@ def print_structure(self):
"""
Print the contents of the container -> should allow for direct text2workspace on python config
"""
print(
"""
print("""
from HiggsAnalysis.CombinedLimit.DatacardParser import *
from HiggsAnalysis.CombinedLimit.ModelTools import *
from HiggsAnalysis.CombinedLimit.ShapeTools import *
Expand All @@ -85,8 +84,7 @@ def print_structure(self):
MB = None

############## Setup the datacard (must be filled in) ###########################
"""
)
""")

print("DC.bins = ", self.bins, "#", type(self.bins))
print("DC.obs = ", self.obs, "#", type(self.obs))
Expand Down Expand Up @@ -143,8 +141,7 @@ def print_structure(self):
print("DC.pdfnorms = ", self.pdfnorms, "#", type(self.pdfnorms))
print("DC.toCreateFlatParam = ", self.toCreateFlatParam, "#", type(self.toCreateFlatParam))

print(
"""
print("""

###### User defined options #############################################

Expand All @@ -162,8 +159,7 @@ def print_structure(self):
# Set physics models
MB.setPhysics(defaultModel)
MB.doModel()
"""
)
""")

# map of which bins should have automated Barlow-Beeston parameters
self.binParFlags = {}
Expand Down
2 changes: 1 addition & 1 deletion python/DatacardParser.py
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ def parseCard(file, options):
continue
sigline = f[1:] # second line contains ids
if re.match("-?[0-9]+", processline[0]) and not re.match("-?[0-9]+", sigline[0]):
(processline, sigline) = (sigline, processline)
processline, sigline = (sigline, processline)
if len(sigline) != len(processline):
raise RuntimeError("'bin' line has a different length than 'process' line.")
hadBins = len(ret.bins) > 0
Expand Down
12 changes: 4 additions & 8 deletions python/HiggsBenchmarkModels/CustodialSymmetryModels.py
Original file line number Diff line number Diff line change
Expand Up @@ -290,10 +290,8 @@ def setup(self):
self.modelBuilder.factory_('expr::Cz("@0*@1",Cw, Czw)')

## total witdhs, normalized to the SM one
self.modelBuilder.factory_(
'expr::Czw_Gscal_tot("@0*@1 + @2*@3 + (1.0-@1-@3)", \
Cw, SM_BR_hww, Cz, SM_BR_hzz)'
)
self.modelBuilder.factory_('expr::Czw_Gscal_tot("@0*@1 + @2*@3 + (1.0-@1-@3)", \
Cw, SM_BR_hww, Cz, SM_BR_hzz)')
## BRs, normalized to the SM ones: they scale as (partial/partial_SM) / (total/total_SM)
self.modelBuilder.factory_('expr::Czw_BRscal_hww("@0/@1", Cw, Czw_Gscal_tot)')
self.modelBuilder.factory_('expr::Czw_BRscal_hzz("@0/@1", Cz, Czw_Gscal_tot)')
Expand Down Expand Up @@ -371,10 +369,8 @@ def setup(self):
self.modelBuilder.factory_('expr::Cw("@0*@1",Cz, Cwz)')

## total witdhs, normalized to the SM one
self.modelBuilder.factory_(
'expr::Cwz_Gscal_tot("@0*@1 + @2*@3 + (1.0-@1-@3)", \
Cw, SM_BR_hww, Cz, SM_BR_hzz)'
)
self.modelBuilder.factory_('expr::Cwz_Gscal_tot("@0*@1 + @2*@3 + (1.0-@1-@3)", \
Cw, SM_BR_hww, Cz, SM_BR_hzz)')
## BRs, normalized to the SM ones: they scale as (partial/partial_SM) / (total/total_SM)
self.modelBuilder.factory_('expr::Cwz_BRscal_hww("@0/@1", Cw, Cwz_Gscal_tot)')
self.modelBuilder.factory_('expr::Cwz_BRscal_hzz("@0/@1", Cz, Cwz_Gscal_tot)')
Expand Down
24 changes: 8 additions & 16 deletions python/HiggsBenchmarkModels/FermionSectorModels.py
Original file line number Diff line number Diff line change
Expand Up @@ -330,16 +330,12 @@ def setup(self):
self.modelBuilder.factory_('expr::C5ql_Gscal_sumg("@0*@0 * @1", Cg, SM_BR_hgg)')
self.modelBuilder.factory_('expr::C5ql_Gscal_sumv("@0*@0 * (@1+@2+@3)", Cv, SM_BR_hww, SM_BR_hzz, SM_BR_hzg )')
if self.universalCF:
self.modelBuilder.factory_(
'expr::C5ql_Gscal_sumf("@0*@0 * (@1+@2+@3+@4+@5+@6)",\
Cf, SM_BR_hbb, SM_BR_htt, SM_BR_hcc, SM_BR_htoptop, SM_BR_hmm, SM_BR_hss)'
)
self.modelBuilder.factory_('expr::C5ql_Gscal_sumf("@0*@0 * (@1+@2+@3+@4+@5+@6)",\
Cf, SM_BR_hbb, SM_BR_htt, SM_BR_hcc, SM_BR_htoptop, SM_BR_hmm, SM_BR_hss)')
else:
self.modelBuilder.factory_(
'expr::C5ql_Gscal_sumf("@0*@0 * (@1+@2+@3+@4) + @5*@5 * (@6+@7)",\
self.modelBuilder.factory_('expr::C5ql_Gscal_sumf("@0*@0 * (@1+@2+@3+@4) + @5*@5 * (@6+@7)",\
Cq, SM_BR_hbb, SM_BR_hcc, SM_BR_htoptop, SM_BR_hss,\
Cl, SM_BR_htt, SM_BR_hmm)'
)
Cl, SM_BR_htt, SM_BR_hmm)')
self.modelBuilder.factory_("sum::C5ql_Gscal_tot(C5ql_Gscal_sumglu, C5ql_Gscal_sumg, C5ql_Gscal_sumv, C5ql_Gscal_sumf)")

## BRs, normalized to the SM ones: they scale as (partial/partial_SM)^2 / (total/total_SM)^2
Expand Down Expand Up @@ -447,16 +443,12 @@ def setup(self):
self.modelBuilder.factory_('expr::C5ud_Gscal_sumg("@0*@0 * @1", Cg, SM_BR_hgg)')
self.modelBuilder.factory_('expr::C5ud_Gscal_sumv("@0*@0 * (@1+@2+@3)", Cv, SM_BR_hww, SM_BR_hzz, SM_BR_hzg )')
if self.universalCF:
self.modelBuilder.factory_(
'expr::C5ud_Gscal_sumf("@0*@0 * (@1+@2+@3+@4+@5+@6)",\
Cf, SM_BR_hbb, SM_BR_htt, SM_BR_hcc, SM_BR_htoptop, SM_BR_hmm, SM_BR_hss)'
)
self.modelBuilder.factory_('expr::C5ud_Gscal_sumf("@0*@0 * (@1+@2+@3+@4+@5+@6)",\
Cf, SM_BR_hbb, SM_BR_htt, SM_BR_hcc, SM_BR_htoptop, SM_BR_hmm, SM_BR_hss)')
else:
self.modelBuilder.factory_(
'expr::C5ud_Gscal_sumf("@0*@0 * (@1+@2+@3+@4) + @5*@5 * (@6+@7)",\
self.modelBuilder.factory_('expr::C5ud_Gscal_sumf("@0*@0 * (@1+@2+@3+@4) + @5*@5 * (@6+@7)",\
Cd, SM_BR_hbb, SM_BR_hcc, SM_BR_htt, SM_BR_hmm,\
Cu, SM_BR_htoptop, SM_BR_hss)'
)
Cu, SM_BR_htoptop, SM_BR_hss)')
self.modelBuilder.factory_("sum::C5ud_Gscal_tot(C5ud_Gscal_sumglu, C5ud_Gscal_sumg, C5ud_Gscal_sumv, C5ud_Gscal_sumf)")

## BRs, normalized to the SM ones: they scale as (partial/partial_SM)^2 / (total/total_SM)^2
Expand Down
42 changes: 14 additions & 28 deletions python/HiggsCouplings_ICHEP12.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,11 @@ def setup(self):
# Taylor series around MH=125 including terms up to O(MH-125)^2 in Horner polynomial form
CF = self.modelBuilder.out.function("CF")
CF.setVal(1.0)
self.modelBuilder.factory_(
'expr::CvCf_cgammaSq("\
self.modelBuilder.factory_('expr::CvCf_cgammaSq("\
@0*@0*(1.524292518396496 + (0.005166702799572456 - 0.00003355715038472727*@2)*@2) + \
@1*(@1*(0.07244520735564258 + (0.0008318872718720393 - 6.16997610275555e-6*@2)*@2) + \
@0*(-0.5967377257521194 + (-0.005998590071444782 + 0.00003972712648748393*@2)*@2))\
",CV,CF,MH)'
)
",CV,CF,MH)')
## partial witdhs, normalized to the SM one, for decays scaling with F, V and total
for d in [
"htt",
Expand Down Expand Up @@ -185,16 +183,12 @@ def setup(self):
self.modelBuilder.factory_('expr::C5ql_Gscal_sumg("@0*@0 * @1", Cg, SM_BR_hgg)')
self.modelBuilder.factory_('expr::C5ql_Gscal_sumv("@0*@0 * (@1+@2+@3)", Cv, SM_BR_hww, SM_BR_hzz, SM_BR_hzg )')
if self.universalCF:
self.modelBuilder.factory_(
'expr::C5ql_Gscal_sumf("@0*@0 * (@1+@2+@3+@4+@5+@6)",\
Cf, SM_BR_hbb, SM_BR_htt, SM_BR_hcc, SM_BR_htoptop, SM_BR_hmm, SM_BR_hss)'
)
self.modelBuilder.factory_('expr::C5ql_Gscal_sumf("@0*@0 * (@1+@2+@3+@4+@5+@6)",\
Cf, SM_BR_hbb, SM_BR_htt, SM_BR_hcc, SM_BR_htoptop, SM_BR_hmm, SM_BR_hss)')
else:
self.modelBuilder.factory_(
'expr::C5ql_Gscal_sumf("@0*@0 * (@1+@2+@3+@4) + @5*@5 * (@6+@7)",\
self.modelBuilder.factory_('expr::C5ql_Gscal_sumf("@0*@0 * (@1+@2+@3+@4) + @5*@5 * (@6+@7)",\
Cq, SM_BR_hbb, SM_BR_hcc, SM_BR_htoptop, SM_BR_hss,\
Cl, SM_BR_htt, SM_BR_hmm)'
)
Cl, SM_BR_htt, SM_BR_hmm)')
self.modelBuilder.factory_("sum::C5ql_Gscal_tot(C5ql_Gscal_sumglu, C5ql_Gscal_sumg, C5ql_Gscal_sumv, C5ql_Gscal_sumf)")

## BRs, normalized to the SM ones: they scale as (partial/partial_SM)^2 / (total/total_SM)^2
Expand Down Expand Up @@ -302,16 +296,12 @@ def setup(self):
self.modelBuilder.factory_('expr::C5ud_Gscal_sumg("@0*@0 * @1", Cg, SM_BR_hgg)')
self.modelBuilder.factory_('expr::C5ud_Gscal_sumv("@0*@0 * (@1+@2+@3)", Cv, SM_BR_hww, SM_BR_hzz, SM_BR_hzg )')
if self.universalCF:
self.modelBuilder.factory_(
'expr::C5ud_Gscal_sumf("@0*@0 * (@1+@2+@3+@4+@5+@6)",\
Cf, SM_BR_hbb, SM_BR_htt, SM_BR_hcc, SM_BR_htoptop, SM_BR_hmm, SM_BR_hss)'
)
self.modelBuilder.factory_('expr::C5ud_Gscal_sumf("@0*@0 * (@1+@2+@3+@4+@5+@6)",\
Cf, SM_BR_hbb, SM_BR_htt, SM_BR_hcc, SM_BR_htoptop, SM_BR_hmm, SM_BR_hss)')
else:
self.modelBuilder.factory_(
'expr::C5ud_Gscal_sumf("@0*@0 * (@1+@2+@3+@4) + @5*@5 * (@6+@7)",\
self.modelBuilder.factory_('expr::C5ud_Gscal_sumf("@0*@0 * (@1+@2+@3+@4) + @5*@5 * (@6+@7)",\
Cd, SM_BR_hbb, SM_BR_hcc, SM_BR_htt, SM_BR_hmm,\
Cu, SM_BR_htoptop, SM_BR_hss)'
)
Cu, SM_BR_htoptop, SM_BR_hss)')
self.modelBuilder.factory_("sum::C5ud_Gscal_tot(C5ud_Gscal_sumglu, C5ud_Gscal_sumg, C5ud_Gscal_sumv, C5ud_Gscal_sumf)")

## BRs, normalized to the SM ones: they scale as (partial/partial_SM)^2 / (total/total_SM)^2
Expand Down Expand Up @@ -488,10 +478,8 @@ def setup(self):
self.modelBuilder.factory_('expr::Cz("@0*@1",Cw, Czw)')

## total witdhs, normalized to the SM one
self.modelBuilder.factory_(
'expr::Czw_Gscal_tot("@0*@1 + @2*@3 + (1.0-@1-@3)", \
Cw, SM_BR_hww, Cz, SM_BR_hzz)'
)
self.modelBuilder.factory_('expr::Czw_Gscal_tot("@0*@1 + @2*@3 + (1.0-@1-@3)", \
Cw, SM_BR_hww, Cz, SM_BR_hzz)')
## BRs, normalized to the SM ones: they scale as (partial/partial_SM) / (total/total_SM)
self.modelBuilder.factory_('expr::Czw_BRscal_hww("@0/@1", Cw, Czw_Gscal_tot)')
self.modelBuilder.factory_('expr::Czw_BRscal_hzz("@0/@1", Cz, Czw_Gscal_tot)')
Expand Down Expand Up @@ -570,10 +558,8 @@ def setup(self):
self.modelBuilder.factory_('expr::Cw("@0*@1",Cz, Cwz)')

## total witdhs, normalized to the SM one
self.modelBuilder.factory_(
'expr::Cwz_Gscal_tot("@0*@1 + @2*@3 + (1.0-@1-@3)", \
Cw, SM_BR_hww, Cz, SM_BR_hzz)'
)
self.modelBuilder.factory_('expr::Cwz_Gscal_tot("@0*@1 + @2*@3 + (1.0-@1-@3)", \
Cw, SM_BR_hww, Cz, SM_BR_hzz)')
## BRs, normalized to the SM ones: they scale as (partial/partial_SM) / (total/total_SM)
self.modelBuilder.factory_('expr::Cwz_BRscal_hww("@0/@1", Cw, Cwz_Gscal_tot)')
self.modelBuilder.factory_('expr::Cwz_BRscal_hzz("@0/@1", Cz, Cwz_Gscal_tot)')
Expand Down
2 changes: 1 addition & 1 deletion python/HiggsJPC.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def setPhysicsOptions(self, physOptions):
self.verbose = True
if po.startswith("map="):
self.muFloating = True
(maplist, poi) = po.replace("map=", "").split(":")
maplist, poi = po.replace("map=", "").split(":")
maps = maplist.split(",")
poiname = re.sub(r"\[.*", "", poi)
if poiname not in self.pois:
Expand Down
Loading
Loading