本文整理汇总了Python中HiggsAnalysis.CombinedLimit.SMHiggsBuilder.SMHiggsBuilder.dump方法的典型用法代码示例。如果您正苦于以下问题:Python SMHiggsBuilder.dump方法的具体用法?Python SMHiggsBuilder.dump怎么用?Python SMHiggsBuilder.dump使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HiggsAnalysis.CombinedLimit.SMHiggsBuilder.SMHiggsBuilder
的用法示例。
在下文中一共展示了SMHiggsBuilder.dump方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: CvCfHiggs
# 需要导入模块: from HiggsAnalysis.CombinedLimit.SMHiggsBuilder import SMHiggsBuilder [as 别名]
# 或者: from HiggsAnalysis.CombinedLimit.SMHiggsBuilder.SMHiggsBuilder import dump [as 别名]
class CvCfHiggs(SMLikeHiggsModel):
"assume the SM coupling but let the Higgs mass to float"
def __init__(self):
SMLikeHiggsModel.__init__(self) # not using 'super(x,self).__init__' since I don't understand it
self.floatMass = False
def setPhysicsOptions(self,physOptions):
for po in physOptions:
if po.startswith("higgsMassRange="):
self.floatMass = True
self.mHRange = po.replace("higgsMassRange=","").split(",")
print 'The Higgs mass range:', self.mHRange
if len(self.mHRange) != 2:
raise RuntimeError, "Higgs mass range definition requires two extrema."
elif float(self.mHRange[0]) >= float(self.mHRange[1]):
raise RuntimeError, "Extrema for Higgs mass range defined with inverterd order. Second must be larger the first."
def doParametersOfInterest(self):
"""Create POI out of signal strength and MH"""
# --- Signal Strength as only POI ---
self.modelBuilder.doVar("CV[1,-5,5]")
self.modelBuilder.doVar("CF[1,-5,5]")
if self.floatMass:
if self.modelBuilder.out.var("MH"):
self.modelBuilder.out.var("MH").setRange(float(self.mHRange[0]),float(self.mHRange[1]))
self.modelBuilder.out.var("MH").setConstant(False)
else:
self.modelBuilder.doVar("MH[%s,%s]" % (self.mHRange[0],self.mHRange[1]))
self.modelBuilder.doSet("POI",'CV,CF,MH')
else:
if self.modelBuilder.out.var("MH"):
self.modelBuilder.out.var("MH").setVal(self.options.mass)
self.modelBuilder.out.var("MH").setConstant(True)
else:
self.modelBuilder.doVar("MH[%g]" % self.options.mass)
self.modelBuilder.doSet("POI",'CV,CF')
self.SMH = SMHiggsBuilder(self.modelBuilder)
#self.doDebugDump()
self.setup()
def doDebugDump(self):
self.modelBuilder.out.var("MH").setConstant(False)
self.modelBuilder.out.var("MH").removeRange()
MHvals = [ 110 + (600.-110.)*i/4900. for i in xrange(4900+1) ]
for p in [ "ggH", "qqH", "WH", "ZH" ]:
self.SMH.makeXS(p)
self.SMH.dump("SM_XS_"+p, "MH", MHvals, "dump.XS_"+p+".txt")
for p in [ "htt", "hbb", "hww", "hzz", "hgg", "hgluglu", "htoptop" ]:
self.SMH.makeBR(p)
self.SMH.dump("SM_BR_"+p, "MH", MHvals, "dump.BR_"+p+".txt")
self.SMH.makeTotalWidth()
self.SMH.dump("SM_GammaTot", "MH", MHvals, "dump.GammaTot.txt")
def setup(self):
## Coefficient for couplings to photons
# Based on Eq 1--4 of Nuclear Physics B 453 (1995)17-82
# ignoring b quark contributions
# Taylor series around MH=125 including terms up to O(MH-125)^2 in Horner polynomial form
self.modelBuilder.factory_('expr::CvCf_cgamma("\
@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)')
## partial witdhs, normalized to the SM one, for decays scaling with F, V and total
for d in [ "htt", "hbb", "hcc", "hww", "hzz", "hgluglu", "htoptop", "hgg", "hZg", "hmm", "hss" ]:
self.SMH.makeBR(d)
self.modelBuilder.factory_("expr::CvCf_Gscal_sumf(\"@0*@0 * (@[email protected][email protected][email protected][email protected][email protected][email protected])\", CF, SM_BR_hbb, SM_BR_htt, SM_BR_hcc, SM_BR_htoptop, SM_BR_hgluglu, SM_BR_hmm, SM_BR_hss)")
self.modelBuilder.factory_("expr::CvCf_Gscal_sumv(\"@0*@0 * (@[email protected][email protected])\", CV, SM_BR_hww, SM_BR_hzz, SM_BR_hZg)")
self.modelBuilder.factory_("expr::CvCf_Gscal_gg(\"@0*@0 * @1\", CvCf_cgamma, SM_BR_hgg)")
self.modelBuilder.factory_( "sum::CvCf_Gscal_tot(CvCf_Gscal_sumf, CvCf_Gscal_sumv, CvCf_Gscal_gg)")
## BRs, normalized to the SM ones: they scale as (coupling/coupling_SM)^2 / (totWidth/totWidthSM)^2
self.modelBuilder.factory_("expr::CvCf_BRscal_hgg(\"@0*@0/@1\", CvCf_cgamma, CvCf_Gscal_tot)")
self.modelBuilder.factory_("expr::CvCf_BRscal_hf(\"@0*@0/@1\", CF, CvCf_Gscal_tot)")
self.modelBuilder.factory_("expr::CvCf_BRscal_hv(\"@0*@0/@1\", CV, CvCf_Gscal_tot)")
## XS*BR scales
def getHiggsSignalYieldScale(self,production,decay,energy):
name = "CvCf_XSBRscal_%s_%s" % (production,decay)
if self.modelBuilder.out.function(name) == None:
XSscal = 'CF' if production in ["ggH","ttH"] else 'CV'
BRscal = "hgg"
if decay in ["hww", "hzz"]: BRscal = "hv"
if decay in ["hbb", "htt"]: BRscal = "hf"
self.modelBuilder.factory_('expr::%s("@0*@0 * @1", %s, CvCf_BRscal_%s)' % (name, XSscal, BRscal))
return name