当前位置: 首页>>代码示例>>Python>>正文


Python SMHiggsBuilder.makeXS方法代码示例

本文整理汇总了Python中HiggsAnalysis.CombinedLimit.SMHiggsBuilder.SMHiggsBuilder.makeXS方法的典型用法代码示例。如果您正苦于以下问题:Python SMHiggsBuilder.makeXS方法的具体用法?Python SMHiggsBuilder.makeXS怎么用?Python SMHiggsBuilder.makeXS使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在HiggsAnalysis.CombinedLimit.SMHiggsBuilder.SMHiggsBuilder的用法示例。


在下文中一共展示了SMHiggsBuilder.makeXS方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: CwzHiggs

# 需要导入模块: from HiggsAnalysis.CombinedLimit.SMHiggsBuilder import SMHiggsBuilder [as 别名]
# 或者: from HiggsAnalysis.CombinedLimit.SMHiggsBuilder.SMHiggsBuilder import makeXS [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
开发者ID:emanueledimarco,项目名称:HiggsAnalysis-CombinedLimit,代码行数:72,代码来源:CustodialSymmetryModels.py

示例2: CvCfHiggs

# 需要导入模块: from HiggsAnalysis.CombinedLimit.SMHiggsBuilder import SMHiggsBuilder [as 别名]
# 或者: from HiggsAnalysis.CombinedLimit.SMHiggsBuilder.SMHiggsBuilder import makeXS [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
开发者ID:12345ieee,项目名称:cmg-cmssw,代码行数:82,代码来源:HiggsCouplings.py


注:本文中的HiggsAnalysis.CombinedLimit.SMHiggsBuilder.SMHiggsBuilder.makeXS方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。