CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
HiggsJPC.py
Go to the documentation of this file.
2 
3 ### This base class implements signal yields by production and decay mode
4 ### Specific models can be obtained redefining getHiggsSignalYieldScale
6  def __init__(self):
7  self.mHRange = []
8  self.muAsPOI = False
9  self.muFloating = False
10  self.altSignal = "ALT"
11  def getYieldScale(self,bin,process):
12  "Split in production and decay, and call getHiggsSignalYieldScale; return 1 for backgrounds "
13  if not self.DC.isSignal[process]: return 1
14  #print "Process ",process," will get norm ",self.sigNorms[self.altSignal in process]
15  return self.sigNorms[self.altSignal in process]
16  def setPhysicsOptions(self,physOptions):
17  for po in physOptions:
18  if po == "muAsPOI":
19  print "Will consider the signal strength as a parameter of interest"
20  self.muAsPOI = True
21  self.muFloating = True
22  if po == "muFloating":
23  print "Will consider the signal strength as a floating parameter (as a parameter of interest if --PO muAsPOI is specified, as a nuisance otherwise)"
24  self.muFloating = True
25  if po.startswith("altSignal="): self.altSignal = po.split(",")[1]
26  if po.startswith("higgsMassRange="):
27  self.mHRange = po.replace("higgsMassRange=","").split(",")
28  if len(self.mHRange) != 2:
29  raise RuntimeError, "Higgs mass range definition requires two extrema"
30  elif float(self.mHRange[0]) >= float(self.mHRange[1]):
31  raise RuntimeError, "Extrema for Higgs mass range defined with inverterd order. Second must be larger the first"
33  """Create POI and other parameters, and define the POI set."""
34  self.modelBuilder.doVar("x[0,0,1]");
35  poi = "x"
36  if self.muFloating:
37  self.modelBuilder.doVar("r[1,0,10]");
38  if self.muAsPOI: poi += ",r"
39  self.modelBuilder.factory_("expr::r_times_not_x(\"@0*(1-@1)\", r, x)")
40  self.modelBuilder.factory_("expr::r_times_x(\"@0*@1\", r, x)")
41  self.sigNorms = { True:'r_times_x', False:'r_times_not_x' }
42  else:
43  self.modelBuilder.factory_("expr::not_x(\"(1-@1)\", x)")
44  self.sigNorms = { True:'x', False:'not_x' }
45  if self.modelBuilder.out.var("MH"):
46  if len(self.mHRange):
47  print 'MH will be left floating within', self.mHRange[0], 'and', self.mHRange[1]
48  self.modelBuilder.out.var("MH").setRange(float(self.mHRange[0]),float(self.mHRange[1]))
49  self.modelBuilder.out.var("MH").setConstant(False)
50  poi+=',MH'
51  else:
52  print 'MH will be assumed to be', self.options.mass
53  self.modelBuilder.out.var("MH").removeRange()
54  self.modelBuilder.out.var("MH").setVal(self.options.mass)
55  else:
56  if len(self.mHRange):
57  print 'MH will be left floating within', self.mHRange[0], 'and', self.mHRange[1]
58  self.modelBuilder.doVar("MH[%s,%s]" % (self.mHRange[0],self.mHRange[1]))
59  poi+=',MH'
60  else:
61  print 'MH (not there before) will be assumed to be', self.options.mass
62  self.modelBuilder.doVar("MH[%g]" % self.options.mass)
63  self.modelBuilder.doSet("POI",poi)
64 
65 twoHypothesisHiggs = TwoHypotesisHiggs()
66 
This base class implements signal yields by production and decay mode Specific models can be obtained...
Definition: HiggsJPC.py:5
double split
Definition: MVATrainer.cc:139