-
Notifications
You must be signed in to change notification settings - Fork 3
/
addModuleSummaryPlots.py
executable file
·28 lines (22 loc) · 1.2 KB
/
addModuleSummaryPlots.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
#!/usr/bin/env python
import sys
from optparse import OptionParser
parser = OptionParser()
parser.add_option("-i", "--file", dest="inputFileName",
help="path to input file")
parser.add_option("-m", "--mode", dest="mode", default = "pxar",
help="supported modes are 'pxar' (which is default) and 'pos' (pixel online software)")
parser.add_option("-s", "--savePlots", action="store_true", dest="savePlots", default = False,
help="saves 2D summary maps as png files in a directory called 'INPUT_FILE_2DModuleSummaryPlots'")
(arguments, args) = parser.parse_args()
if not arguments.inputFileName:
print "please specify input file";
sys.exit(0)
from moduleSummaryPlottingTools import *
gROOT.SetBatch()
# add together appropriate 1D plots per ROC into a single 1D summary
dictionary1D = produce1DHistogramDictionary(arguments.inputFileName, arguments.mode)
add1DSummaryPlots(arguments.inputFileName, dictionary1D, arguments.mode)
# arrange 2D ROC plots into a single 2D summary plot
dictionary2D = produce2DHistogramDictionary(arguments.inputFileName, arguments.mode)
add2DSummaryPlots(arguments.inputFileName, dictionary2D, arguments.mode, arguments.savePlots)