-
Notifications
You must be signed in to change notification settings - Fork 429
Expand file tree
/
Copy pathTagAndProbeModel.py
More file actions
40 lines (34 loc) · 1.49 KB
/
TagAndProbeModel.py
File metadata and controls
40 lines (34 loc) · 1.49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import re
from HiggsAnalysis.CombinedLimit.PhysicsModel import *
class TagAndProbe(PhysicsModel):
def doParametersOfInterest(self):
"""Create POI and other parameters, and define the POI set."""
self.modelBuilder.doVar("SF[1.0,0.0,2.0]")
self.modelBuilder.doSet("POI", "SF")
if self.options.mass != 0:
if self.modelBuilder.out.var("MH"):
var = self.modelBuilder.out.var("MH")
var.removeMin()
var.removeMax()
var.setVal(self.options.mass)
else:
self.modelBuilder.doVar("MH[%g]" % self.options.mass)
exp_pass = 1
exp_fail = 1
for b in self.DC.bins:
for p in self.DC.exp[b].keys():
if self.DC.isSignal[p]:
if re.search("pass", b):
exp_pass = self.DC.exp[b][p]
if re.search("fail", b):
exp_fail = self.DC.exp[b][p]
self.modelBuilder.factory_(f'expr::fail_scale("({exp_pass:f}+{exp_fail:f}-({exp_pass:f}*@0))/{exp_fail:f}", SF)')
def getYieldScale(self, bin, process):
"Return the name of a RooAbsReal to scale this yield by, or the two special values 1 and 0 (do not scale, and set to zero)"
if self.DC.isSignal[process]:
if re.search("pass", bin):
return "SF"
elif re.search("fail", bin):
return "fail_scale"
return 1
tagAndProbe = TagAndProbe()