本文整理汇总了Python中HiggsAnalysis.CombinedLimit.SMHiggsBuilder.SMHiggsBuilder.textToSpline方法的典型用法代码示例。如果您正苦于以下问题:Python SMHiggsBuilder.textToSpline方法的具体用法?Python SMHiggsBuilder.textToSpline怎么用?Python SMHiggsBuilder.textToSpline使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HiggsAnalysis.CombinedLimit.SMHiggsBuilder.SMHiggsBuilder
的用法示例。
在下文中一共展示了SMHiggsBuilder.textToSpline方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: FermiophobicHiggs
# 需要导入模块: from HiggsAnalysis.CombinedLimit.SMHiggsBuilder import SMHiggsBuilder [as 别名]
# 或者: from HiggsAnalysis.CombinedLimit.SMHiggsBuilder.SMHiggsBuilder import textToSpline [as 别名]
class FermiophobicHiggs(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.mHRange = ['115','135'] # default
def setPhysicsOptions(self,physOptions):
for po in physOptions:
if po.startswith("higgsMassRange="):
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, "Extrama 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("r[1,0,20]")
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",'r,MH')
self.SMH = SMHiggsBuilder(self.modelBuilder)
self.setup()
def setup(self):
## Add FP BRs
datadir = os.environ['CMSSW_BASE']+'/src/HiggsAnalysis/CombinedLimit/data/lhc-hxswg'
self.SMH.textToSpline( 'FP_BR_hww', os.path.join(datadir, 'fp/BR.txt'), ycol=4 );
self.SMH.textToSpline( 'FP_BR_hzz', os.path.join(datadir, 'fp/BR.txt'), ycol=5 );
self.SMH.textToSpline( 'FP_BR_hgg', os.path.join(datadir, 'fp/BR.txt'), ycol=2 );
self.SMH.textToSpline( 'FP_BR_hzg', os.path.join(datadir, 'fp/BR.txt'), ycol=3 );
for decay in ['hww','hzz','hgg','hzg']:
self.SMH.makeBR(decay)
self.modelBuilder.factory_('expr::FP_BRScal_%s("@0*@1/@2",r,FP_BR_%s,SM_BR_%s)'%(decay,decay,decay))
self.modelBuilder.out.Print()
def getHiggsSignalYieldScale(self,production,decay,energy):
if production not in ['VH', 'WH', 'ZH', 'qqH']:
return 0
if decay not in ['hww','hzz','hgg','hzg']:
return 0
return 'FP_BRScal_%s' % decay
示例2: CwzHiggs
# 需要导入模块: from HiggsAnalysis.CombinedLimit.SMHiggsBuilder import SMHiggsBuilder [as 别名]
# 或者: from HiggsAnalysis.CombinedLimit.SMHiggsBuilder.SMHiggsBuilder import textToSpline [as 别名]
class CwzHiggs(SMLikeHiggsModel):
"Scale w and z and touch nothing else"
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"""
self.modelBuilder.doVar("Cz[1,0,10]")
self.modelBuilder.doVar("Cwz[1,0,10]")
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",'Cwz,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",'Cwz')
self.SMH = SMHiggsBuilder(self.modelBuilder)
self.setup()
def setup(self):
for d in [ "hww", "hzz" ]:
self.SMH.makeBR(d)
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 + ([email protected]@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)')
datadir = os.environ['CMSSW_BASE']+'/src/HiggsAnalysis/CombinedLimit/data/lhc-hxswg'
for e in ['7TeV', '8TeV']:
print 'build for %s'%e
self.SMH.textToSpline( 'RqqH_%s'%e, os.path.join(datadir, 'couplings/R_VBF_%s.txt'%e), ycol=1 );
self.modelBuilder.factory_('expr::Cwz_XSscal_qqH_%s("(@0 + @1*@2) / (1.0 + @2) ", Cw, Cz, RqqH_%s)'%(e,e))
self.modelBuilder.factory_('expr::Cwz_XSscal_WH_%s("@0", Cw)'%e)
self.modelBuilder.factory_('expr::Cwz_XSscal_ZH_%s("@0", Cz)'%e)
self.SMH.makeXS('WH',e)
self.SMH.makeXS('ZH',e)
self.modelBuilder.factory_('expr::Cwz_XSscal_VH_%s("(@0*@1 + @2*@3) / (@1 + @3) ", Cw, SM_XS_WH_%s, Cz, SM_XS_ZH_%s)'%(e,e,e))
def getHiggsSignalYieldScale(self,production,decay,energy):
if decay not in ['hww', 'hzz']:
return 0
name = "Cwz_XSBRscal_%s_%s_%s" % (production,decay,energy)
if self.modelBuilder.out.function(name) == None:
if production in ["ggH","ttH"]:
self.modelBuilder.factory_('expr::%s("@0", Cwz_BRscal_%s)' % (name, decay))
else:
self.modelBuilder.factory_('expr::%s("@0 * @1", Cwz_XSscal_%s_%s, Cwz_BRscal_%s)' % (name, production, energy, decay))
return name
示例3: CfXgHiggs
# 需要导入模块: from HiggsAnalysis.CombinedLimit.SMHiggsBuilder import SMHiggsBuilder [as 别名]
# 或者: from HiggsAnalysis.CombinedLimit.SMHiggsBuilder.SMHiggsBuilder import textToSpline [as 别名]
class CfXgHiggs(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]")
self.modelBuilder.doVar("CF[1,-1.5,1.5]")
self.modelBuilder.doVar("XG[0,-4,4]")
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",'CF,XG,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",'CF,XG')
self.SMH = SMHiggsBuilder(self.modelBuilder)
self.setup()
def setup(self):
## Add some common ingredients
datadir = os.environ['CMSSW_BASE']+'/src/HiggsAnalysis/CombinedLimit/data/lhc-hxswg'
self.SMH.textToSpline( 'mb', os.path.join(datadir, 'running_constants.txt'), ycol=2 );
mb = self.modelBuilder.out.function('mb')
mH = self.modelBuilder.out.var('MH')
CF = self.modelBuilder.out.var('CF')
CV = self.modelBuilder.out.var('CV')
XG = self.modelBuilder.out.var('XG')
RHggCfXg = ROOT.RooScaleHGamGamLOSMPlusX('CfXg_cgammaSq', 'LO SM Hgamgam scaling', mH, CF, CV, mb, CF, XG)
self.modelBuilder.out._import(RHggCfXg)
#Rgluglu = ROOT.RooScaleHGluGluLOSMPlusX('Rgluglu', 'LO SM Hgluglu scaling', mH, CF, mb, CF)
#self.modelBuilder.out._import(Rgluglu)
## 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::CfXg_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_('sum::CfXg_Gscal_sumv(SM_BR_hww, SM_BR_hzz, SM_BR_hzg)')
self.modelBuilder.factory_('expr::CfXg_Gscal_gg("@0 * @1", CfXg_cgammaSq, SM_BR_hgg)')
self.modelBuilder.factory_('sum::CfXg_Gscal_tot(CfXg_Gscal_sumf, CfXg_Gscal_sumv, CfXg_Gscal_gg)')
## BRs, normalized to the SM ones: they scale as (coupling/coupling_SM)^2 / (totWidth/totWidthSM)^2
self.modelBuilder.factory_('expr::CfXg_BRscal_hgg("@0/@1", CfXg_cgammaSq, CfXg_Gscal_tot)')
self.modelBuilder.factory_('expr::CfXg_BRscal_hf("@0*@0/@1", CF, CfXg_Gscal_tot)')
self.modelBuilder.factory_('expr::CfXg_BRscal_hv("1.0/@0", CfXg_Gscal_tot)')
self.modelBuilder.out.Print()
def getHiggsSignalYieldScale(self,production,decay,energy):
name = "CfXg_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, CfXg_BRscal_%s)' % (name, XSscal, BRscal))
return name