-
Notifications
You must be signed in to change notification settings - Fork 34
/
Copy pathplot.py
45 lines (38 loc) · 928 Bytes
/
plot.py
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
41
42
43
44
45
import ROOT
import hftools.plotting
import sys
def main():
filename = sys.argv[1]
preplot = sys.argv[2]
postplot = sys.argv[3]
f = ROOT.TFile.Open(filename)
ws = f.Get('combined')
hftools.plotting.quickplot(
ws,
'channel1',
'x',
['background','signal'],
filename = preplot,
title = 'Event Regions (pre-fit)',
xaxis = 'region',
yaxis = 'Events',
singlebin = False,
dimensions='600x600',
logy = False
)
ws.pdf('simPdf').fitTo(ws.data('obsData'))
hftools.plotting.quickplot(
ws,
'channel1',
'x',
['background','signal'],
filename = postplot,
title = 'Event Regions (post-fit)',
xaxis = 'region',
yaxis = 'Events',
singlebin = False,
dimensions='600x600',
logy = False
)
if __name__ == '__main__':
main()