CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_5_3_13_patch3/src/HiggsAnalysis/CombinedLimit/python/HiggsCouplings.py

Go to the documentation of this file.
00001 from HiggsAnalysis.CombinedLimit.PhysicsModel import *
00002 from HiggsAnalysis.CombinedLimit.SMHiggsBuilder import SMHiggsBuilder
00003 
00004 class CvCfHiggs(SMLikeHiggsModel):
00005     "assume the SM coupling but let the Higgs mass to float"
00006     def __init__(self):
00007         SMLikeHiggsModel.__init__(self) # not using 'super(x,self).__init__' since I don't understand it
00008         self.floatMass = False
00009     def setPhysicsOptions(self,physOptions):
00010         for po in physOptions:
00011             if po.startswith("higgsMassRange="):
00012                 self.floatMass = True
00013                 self.mHRange = po.replace("higgsMassRange=","").split(",")
00014                 print 'The Higgs mass range:', self.mHRange
00015                 if len(self.mHRange) != 2:
00016                     raise RuntimeError, "Higgs mass range definition requires two extrema."
00017                 elif float(self.mHRange[0]) >= float(self.mHRange[1]):
00018                     raise RuntimeError, "Extrema for Higgs mass range defined with inverterd order. Second must be larger the first."
00019     def doParametersOfInterest(self):
00020         """Create POI out of signal strength and MH"""
00021         # --- Signal Strength as only POI --- 
00022         self.modelBuilder.doVar("CV[1,-5,5]")
00023         self.modelBuilder.doVar("CF[1,-5,5]")
00024         if self.floatMass:
00025             if self.modelBuilder.out.var("MH"):
00026                 self.modelBuilder.out.var("MH").setRange(float(self.mHRange[0]),float(self.mHRange[1]))
00027                 self.modelBuilder.out.var("MH").setConstant(False)
00028             else:
00029                 self.modelBuilder.doVar("MH[%s,%s]" % (self.mHRange[0],self.mHRange[1])) 
00030             self.modelBuilder.doSet("POI",'CV,CF,MH')
00031         else:
00032             if self.modelBuilder.out.var("MH"):
00033                 self.modelBuilder.out.var("MH").setVal(self.options.mass)
00034                 self.modelBuilder.out.var("MH").setConstant(True)
00035             else:
00036                 self.modelBuilder.doVar("MH[%g]" % self.options.mass) 
00037             self.modelBuilder.doSet("POI",'CV,CF')
00038         self.SMH = SMHiggsBuilder(self.modelBuilder)
00039         #self.doDebugDump()
00040         self.setup()
00041     def doDebugDump(self):
00042         self.modelBuilder.out.var("MH").setConstant(False)
00043         self.modelBuilder.out.var("MH").removeRange()
00044         MHvals = [ 110 + (600.-110.)*i/4900. for i in xrange(4900+1) ]
00045         for p in [ "ggH", "qqH", "WH", "ZH" ]: 
00046             self.SMH.makeXS(p)
00047             self.SMH.dump("SM_XS_"+p, "MH", MHvals, "dump.XS_"+p+".txt")
00048         for p in [ "htt", "hbb", "hww", "hzz", "hgg", "hgluglu", "htoptop" ]:
00049             self.SMH.makeBR(p)
00050             self.SMH.dump("SM_BR_"+p, "MH", MHvals, "dump.BR_"+p+".txt")
00051         self.SMH.makeTotalWidth()
00052         self.SMH.dump("SM_GammaTot", "MH", MHvals, "dump.GammaTot.txt")
00053     def setup(self):
00054         ## Coefficient for couplings to photons
00055         #      Based on Eq 1--4 of Nuclear Physics B 453 (1995)17-82
00056         #      ignoring b quark contributions
00057         # Taylor series around MH=125 including terms up to O(MH-125)^2 in Horner polynomial form
00058         self.modelBuilder.factory_('expr::CvCf_cgamma("\
00059         @0*@0*(1.524292518396496 + (0.005166702799572456 - 0.00003355715038472727*@2)*@2) + \
00060         @1*(@1*(0.07244520735564258 + (0.0008318872718720393 - 6.16997610275555e-6*@2)*@2) + \
00061         @0*(-0.5967377257521194 + (-0.005998590071444782 + 0.00003972712648748393*@2)*@2))\
00062         ",CV,CF,MH)')
00063         ## partial witdhs, normalized to the SM one, for decays scaling with F, V and total
00064         for d in [ "htt", "hbb", "hcc", "hww", "hzz", "hgluglu", "htoptop", "hgg", "hZg", "hmm", "hss" ]:
00065             self.SMH.makeBR(d)
00066         self.modelBuilder.factory_("expr::CvCf_Gscal_sumf(\"@0*@0 * (@1+@2+@3+@4+@5+@6+@7)\", CF, SM_BR_hbb, SM_BR_htt, SM_BR_hcc, SM_BR_htoptop, SM_BR_hgluglu, SM_BR_hmm, SM_BR_hss)") 
00067         self.modelBuilder.factory_("expr::CvCf_Gscal_sumv(\"@0*@0 * (@1+@2+@3)\", CV, SM_BR_hww, SM_BR_hzz, SM_BR_hZg)") 
00068         self.modelBuilder.factory_("expr::CvCf_Gscal_gg(\"@0*@0 * @1\", CvCf_cgamma, SM_BR_hgg)") 
00069         self.modelBuilder.factory_( "sum::CvCf_Gscal_tot(CvCf_Gscal_sumf, CvCf_Gscal_sumv, CvCf_Gscal_gg)")
00070         ## BRs, normalized to the SM ones: they scale as (coupling/coupling_SM)^2 / (totWidth/totWidthSM)^2 
00071         self.modelBuilder.factory_("expr::CvCf_BRscal_hgg(\"@0*@0/@1\", CvCf_cgamma, CvCf_Gscal_tot)")
00072         self.modelBuilder.factory_("expr::CvCf_BRscal_hf(\"@0*@0/@1\", CF, CvCf_Gscal_tot)")
00073         self.modelBuilder.factory_("expr::CvCf_BRscal_hv(\"@0*@0/@1\", CV, CvCf_Gscal_tot)")
00074         ## XS*BR scales
00075     def getHiggsSignalYieldScale(self,production,decay,energy):
00076         name = "CvCf_XSBRscal_%s_%s" % (production,decay)
00077         if self.modelBuilder.out.function(name) == None: 
00078             XSscal = 'CF' if production in ["ggH","ttH"] else 'CV'
00079             BRscal = "hgg"
00080             if decay in ["hww", "hzz"]: BRscal = "hv"
00081             if decay in ["hbb", "htt"]: BRscal = "hf"
00082             self.modelBuilder.factory_('expr::%s("@0*@0 * @1", %s, CvCf_BRscal_%s)' % (name, XSscal, BRscal))
00083         return name
00084 
00085 class C5Higgs(SMLikeHiggsModel):
00086     "assume the SM coupling but let the Higgs mass to float"
00087     def __init__(self):
00088         SMLikeHiggsModel.__init__(self) # not using 'super(x,self).__init__' since I don't understand it
00089         self.floatMass = False
00090         self.universalCF = False
00091         self.fix = []
00092     def setPhysicsOptions(self,physOptions):
00093         for po in physOptions:
00094             if po == "universalCF": universalCF = True
00095             if po.startswith("fix="): self.fix = po.replace("fix=","").split(",")
00096             if po.startswith("higgsMassRange="):
00097                 self.floatMass = True
00098                 self.mHRange = po.replace("higgsMassRange=","").split(",")
00099                 print 'The Higgs mass range:', self.mHRange
00100                 if len(self.mHRange) != 2:
00101                     raise RuntimeError, "Higgs mass range definition requires two extrema"
00102                 elif float(self.mHRange[0]) >= float(self.mHRange[1]):
00103                     raise RuntimeError, "Extrama for Higgs mass range defined with inverterd order. Second must be larger the first"
00104     def doParametersOfInterest(self):
00105         """Create POI out of signal strength and MH"""
00106         # --- Signal Strength as only POI --- 
00107         self.modelBuilder.doVar("Cgg[1,0,10]")
00108         self.modelBuilder.doVar("Cvv[1,0,10]")
00109         self.modelBuilder.doVar("Cgluglu[1,0,10]")
00110         POI = "Cgg,Cvv,Cgluglu"
00111         if self.universalCF:
00112             self.modelBuilder.doVar("Cff[1,0,10]")
00113             POI += ",Cff"
00114         else:
00115             self.modelBuilder.doVar("Cbb[1,0,10]")
00116             self.modelBuilder.doVar("Ctt[1,0,10]")
00117             POI += ",Cbb,Ctt"
00118         if self.floatMass:
00119             if self.modelBuilder.out.var("MH"):
00120                 self.modelBuilder.out.var("MH").setRange(float(self.mHRange[0]),float(self.mHRange[1]))
00121                 self.modelBuilder.out.var("MH").setConstant(False)
00122             else:
00123                 self.modelBuilder.doVar("MH[%s,%s]" % (self.mHRange[0],self.mHRange[1])) 
00124             POI += ",MH"
00125         else:
00126             if self.modelBuilder.out.var("MH"):
00127                 self.modelBuilder.out.var("MH").setVal(self.options.mass)
00128                 self.modelBuilder.out.var("MH").setConstant(True)
00129             else:
00130                 self.modelBuilder.doVar("MH[%g]" % self.options.mass) 
00131         for F in self.fix:
00132            self.modelBuilder.out.var(F).setConstant(True)
00133            if F+"," in POI: POI = POI.replace(F+",", "")
00134            else:            POI = POI.replace(","+F, "")
00135         self.modelBuilder.doSet("POI",POI)
00136         self.SMH = SMHiggsBuilder(self.modelBuilder)
00137         #self.doDebugDump()
00138         self.setup()
00139     def setup(self):
00140         for d in [ "htt", "hbb", "hcc", "hww", "hzz", "hgluglu", "htoptop", "hgg", "hZg", "hmm", "hss" ]:
00141             self.SMH.makeBR(d)
00142         ## total witdhs, normalized to the SM one
00143         if self.universalCF:
00144             self.modelBuilder.factory_("expr::C5_Gscal_tot(\"@0*@1 + @2*(@3+@4+@5+@9+@10+@11) + @6*(@7+@8)\","+
00145                                        " Cgluglu, SM_BR_hgluglu, Cff, SM_BR_hbb, SM_BR_hcc, SM_BR_htt,"+
00146                                        " Cvv, SM_BR_hww, SM_BR_hzz,   SM_BR_hss, SM_BR_hmm, SM_BR_htoptop)")
00147         else:
00148             self.modelBuilder.factory_("expr::C5_Gscal_tot(\"@0*@1 + @2*@3 + @4 + @5*@6 + @7*(@8+@9)\","+
00149                                        " Cgluglu, SM_BR_hgluglu, Cbb, SM_BR_hbb, SM_BR_hcc, Ctt, SM_BR_htt,"+
00150                                        " Cvv, SM_BR_hww, SM_BR_hzz)")
00151         ## BRs, normalized to the SM ones: they scale as (partial/partial_SM) / (total/total_SM) 
00152         self.modelBuilder.factory_("expr::C5_BRscal_hgg(\"@0/@1\", Cgg, C5_Gscal_tot)")
00153         self.modelBuilder.factory_("expr::C5_BRscal_hv(\"@0/@1\",  Cvv, C5_Gscal_tot)")
00154         if self.universalCF:
00155             self.modelBuilder.factory_("expr::C5_BRscal_hf(\"@0/@1\", Cff, C5_Gscal_tot)")
00156         else:
00157             self.modelBuilder.factory_("expr::C5_BRscal_hbb(\"@0/@1\", Cbb, C5_Gscal_tot)")
00158             self.modelBuilder.factory_("expr::C5_BRscal_htt(\"@0/@1\", Ctt, C5_Gscal_tot)")
00159     def getHiggsSignalYieldScale(self,production,decay,energy):
00160         name = "C5_XSBRscal_%s_%s" % (production,decay)
00161         if self.modelBuilder.out.function(name) == None: 
00162             XSscal = "Cgluglu" if production in ["ggH"] else "Cvv"
00163             BRscal = "hgg"
00164             if decay in ["hww", "hzz"]: BRscal = "hv"
00165             if decay in ["hbb", "htt"]: BRscal = ("hf" if self.universalCF else decay)
00166             self.modelBuilder.factory_('expr::%s("@0*@0 * @1", %s, C5_BRscal_%s)' % (name, XSscal, BRscal))
00167         return name
00168 
00169 cVcF = CvCfHiggs()
00170 c5   = C5Higgs()