CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
HiggsCouplings.py
Go to the documentation of this file.
2 from HiggsAnalysis.CombinedLimit.SMHiggsBuilder import SMHiggsBuilder
3 
4 class CvCfHiggs(SMLikeHiggsModel):
5  "assume the SM coupling but let the Higgs mass to float"
6  def __init__(self):
7  SMLikeHiggsModel.__init__(self) # not using 'super(x,self).__init__' since I don't understand it
8  self.floatMass = False
9  def setPhysicsOptions(self,physOptions):
10  for po in physOptions:
11  if po.startswith("higgsMassRange="):
12  self.floatMass = True
13  self.mHRange = po.replace("higgsMassRange=","").split(",")
14  print 'The Higgs mass range:', self.mHRange
15  if len(self.mHRange) != 2:
16  raise RuntimeError, "Higgs mass range definition requires two extrema."
17  elif float(self.mHRange[0]) >= float(self.mHRange[1]):
18  raise RuntimeError, "Extrema for Higgs mass range defined with inverterd order. Second must be larger the first."
20  """Create POI out of signal strength and MH"""
21  # --- Signal Strength as only POI ---
22  self.modelBuilder.doVar("CV[1,-5,5]")
23  self.modelBuilder.doVar("CF[1,-5,5]")
24  if self.floatMass:
25  if self.modelBuilder.out.var("MH"):
26  self.modelBuilder.out.var("MH").setRange(float(self.mHRange[0]),float(self.mHRange[1]))
27  self.modelBuilder.out.var("MH").setConstant(False)
28  else:
29  self.modelBuilder.doVar("MH[%s,%s]" % (self.mHRange[0],self.mHRange[1]))
30  self.modelBuilder.doSet("POI",'CV,CF,MH')
31  else:
32  if self.modelBuilder.out.var("MH"):
33  self.modelBuilder.out.var("MH").setVal(self.options.mass)
34  self.modelBuilder.out.var("MH").setConstant(True)
35  else:
36  self.modelBuilder.doVar("MH[%g]" % self.options.mass)
37  self.modelBuilder.doSet("POI",'CV,CF')
38  self.SMH = SMHiggsBuilder(self.modelBuilder)
39  #self.doDebugDump()
40  self.setup()
41  def doDebugDump(self):
42  self.modelBuilder.out.var("MH").setConstant(False)
43  self.modelBuilder.out.var("MH").removeRange()
44  MHvals = [ 110 + (600.-110.)*i/4900. for i in xrange(4900+1) ]
45  for p in [ "ggH", "qqH", "WH", "ZH" ]:
46  self.SMH.makeXS(p)
47  self.SMH.dump("SM_XS_"+p, "MH", MHvals, "dump.XS_"+p+".txt")
48  for p in [ "htt", "hbb", "hww", "hzz", "hgg", "hgluglu", "htoptop" ]:
49  self.SMH.makeBR(p)
50  self.SMH.dump("SM_BR_"+p, "MH", MHvals, "dump.BR_"+p+".txt")
51  self.SMH.makeTotalWidth()
52  self.SMH.dump("SM_GammaTot", "MH", MHvals, "dump.GammaTot.txt")
53  def setup(self):
54  ## Coefficient for couplings to photons
55  # Based on Eq 1--4 of Nuclear Physics B 453 (1995)17-82
56  # ignoring b quark contributions
57  # Taylor series around MH=125 including terms up to O(MH-125)^2 in Horner polynomial form
58  self.modelBuilder.factory_('expr::CvCf_cgamma("\
59  @0*@0*(1.524292518396496 + (0.005166702799572456 - 0.00003355715038472727*@2)*@2) + \
60  @1*(@1*(0.07244520735564258 + (0.0008318872718720393 - 6.16997610275555e-6*@2)*@2) + \
61  @0*(-0.5967377257521194 + (-0.005998590071444782 + 0.00003972712648748393*@2)*@2))\
62  ",CV,CF,MH)')
63  ## partial witdhs, normalized to the SM one, for decays scaling with F, V and total
64  for d in [ "htt", "hbb", "hcc", "hww", "hzz", "hgluglu", "htoptop", "hgg", "hZg", "hmm", "hss" ]:
65  self.SMH.makeBR(d)
66  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)")
67  self.modelBuilder.factory_("expr::CvCf_Gscal_sumv(\"@0*@0 * (@1+@2+@3)\", CV, SM_BR_hww, SM_BR_hzz, SM_BR_hZg)")
68  self.modelBuilder.factory_("expr::CvCf_Gscal_gg(\"@0*@0 * @1\", CvCf_cgamma, SM_BR_hgg)")
69  self.modelBuilder.factory_( "sum::CvCf_Gscal_tot(CvCf_Gscal_sumf, CvCf_Gscal_sumv, CvCf_Gscal_gg)")
70  ## BRs, normalized to the SM ones: they scale as (coupling/coupling_SM)^2 / (totWidth/totWidthSM)^2
71  self.modelBuilder.factory_("expr::CvCf_BRscal_hgg(\"@0*@0/@1\", CvCf_cgamma, CvCf_Gscal_tot)")
72  self.modelBuilder.factory_("expr::CvCf_BRscal_hf(\"@0*@0/@1\", CF, CvCf_Gscal_tot)")
73  self.modelBuilder.factory_("expr::CvCf_BRscal_hv(\"@0*@0/@1\", CV, CvCf_Gscal_tot)")
74  ## XS*BR scales
75  def getHiggsSignalYieldScale(self,production,decay,energy):
76  name = "CvCf_XSBRscal_%s_%s" % (production,decay)
77  if self.modelBuilder.out.function(name) == None:
78  XSscal = 'CF' if production in ["ggH","ttH"] else 'CV'
79  BRscal = "hgg"
80  if decay in ["hww", "hzz"]: BRscal = "hv"
81  if decay in ["hbb", "htt"]: BRscal = "hf"
82  self.modelBuilder.factory_('expr::%s("@0*@0 * @1", %s, CvCf_BRscal_%s)' % (name, XSscal, BRscal))
83  return name
84 
85 class C5Higgs(SMLikeHiggsModel):
86  "assume the SM coupling but let the Higgs mass to float"
87  def __init__(self):
88  SMLikeHiggsModel.__init__(self) # not using 'super(x,self).__init__' since I don't understand it
89  self.floatMass = False
90  self.universalCF = False
91  self.fix = []
92  def setPhysicsOptions(self,physOptions):
93  for po in physOptions:
94  if po == "universalCF": universalCF = True
95  if po.startswith("fix="): self.fix = po.replace("fix=","").split(",")
96  if po.startswith("higgsMassRange="):
97  self.floatMass = True
98  self.mHRange = po.replace("higgsMassRange=","").split(",")
99  print 'The Higgs mass range:', self.mHRange
100  if len(self.mHRange) != 2:
101  raise RuntimeError, "Higgs mass range definition requires two extrema"
102  elif float(self.mHRange[0]) >= float(self.mHRange[1]):
103  raise RuntimeError, "Extrama for Higgs mass range defined with inverterd order. Second must be larger the first"
105  """Create POI out of signal strength and MH"""
106  # --- Signal Strength as only POI ---
107  self.modelBuilder.doVar("Cgg[1,0,10]")
108  self.modelBuilder.doVar("Cvv[1,0,10]")
109  self.modelBuilder.doVar("Cgluglu[1,0,10]")
110  POI = "Cgg,Cvv,Cgluglu"
111  if self.universalCF:
112  self.modelBuilder.doVar("Cff[1,0,10]")
113  POI += ",Cff"
114  else:
115  self.modelBuilder.doVar("Cbb[1,0,10]")
116  self.modelBuilder.doVar("Ctt[1,0,10]")
117  POI += ",Cbb,Ctt"
118  if self.floatMass:
119  if self.modelBuilder.out.var("MH"):
120  self.modelBuilder.out.var("MH").setRange(float(self.mHRange[0]),float(self.mHRange[1]))
121  self.modelBuilder.out.var("MH").setConstant(False)
122  else:
123  self.modelBuilder.doVar("MH[%s,%s]" % (self.mHRange[0],self.mHRange[1]))
124  POI += ",MH"
125  else:
126  if self.modelBuilder.out.var("MH"):
127  self.modelBuilder.out.var("MH").setVal(self.options.mass)
128  self.modelBuilder.out.var("MH").setConstant(True)
129  else:
130  self.modelBuilder.doVar("MH[%g]" % self.options.mass)
131  for F in self.fix:
132  self.modelBuilder.out.var(F).setConstant(True)
133  if F+"," in POI: POI = POI.replace(F+",", "")
134  else: POI = POI.replace(","+F, "")
135  self.modelBuilder.doSet("POI",POI)
136  self.SMH = SMHiggsBuilder(self.modelBuilder)
137  #self.doDebugDump()
138  self.setup()
139  def setup(self):
140  for d in [ "htt", "hbb", "hcc", "hww", "hzz", "hgluglu", "htoptop", "hgg", "hZg", "hmm", "hss" ]:
141  self.SMH.makeBR(d)
142  ## total witdhs, normalized to the SM one
143  if self.universalCF:
144  self.modelBuilder.factory_("expr::C5_Gscal_tot(\"@0*@1 + @2*(@3+@4+@5+@9+@10+@11) + @6*(@7+@8)\","+
145  " Cgluglu, SM_BR_hgluglu, Cff, SM_BR_hbb, SM_BR_hcc, SM_BR_htt,"+
146  " Cvv, SM_BR_hww, SM_BR_hzz, SM_BR_hss, SM_BR_hmm, SM_BR_htoptop)")
147  else:
148  self.modelBuilder.factory_("expr::C5_Gscal_tot(\"@0*@1 + @2*@3 + @4 + @5*@6 + @7*(@8+@9)\","+
149  " Cgluglu, SM_BR_hgluglu, Cbb, SM_BR_hbb, SM_BR_hcc, Ctt, SM_BR_htt,"+
150  " Cvv, SM_BR_hww, SM_BR_hzz)")
151  ## BRs, normalized to the SM ones: they scale as (partial/partial_SM) / (total/total_SM)
152  self.modelBuilder.factory_("expr::C5_BRscal_hgg(\"@0/@1\", Cgg, C5_Gscal_tot)")
153  self.modelBuilder.factory_("expr::C5_BRscal_hv(\"@0/@1\", Cvv, C5_Gscal_tot)")
154  if self.universalCF:
155  self.modelBuilder.factory_("expr::C5_BRscal_hf(\"@0/@1\", Cff, C5_Gscal_tot)")
156  else:
157  self.modelBuilder.factory_("expr::C5_BRscal_hbb(\"@0/@1\", Cbb, C5_Gscal_tot)")
158  self.modelBuilder.factory_("expr::C5_BRscal_htt(\"@0/@1\", Ctt, C5_Gscal_tot)")
159  def getHiggsSignalYieldScale(self,production,decay,energy):
160  name = "C5_XSBRscal_%s_%s" % (production,decay)
161  if self.modelBuilder.out.function(name) == None:
162  XSscal = "Cgluglu" if production in ["ggH"] else "Cvv"
163  BRscal = "hgg"
164  if decay in ["hww", "hzz"]: BRscal = "hv"
165  if decay in ["hbb", "htt"]: BRscal = ("hf" if self.universalCF else decay)
166  self.modelBuilder.factory_('expr::%s("@0*@0 * @1", %s, C5_BRscal_%s)' % (name, XSscal, BRscal))
167  return name
168 
169 cVcF = CvCfHiggs()
170 c5 = C5Higgs()
double split
Definition: MVATrainer.cc:139