1 |
|
2 |
import sys,os,math
|
3 |
#################################
|
4 |
# Modify selection accordingly to
|
5 |
# read $path/Results_${sel}.txt
|
6 |
# and make table
|
7 |
#################################
|
8 |
|
9 |
#________________________________________________________________
|
10 |
def main(argv):
|
11 |
## print argv
|
12 |
if len(argv) < 3:
|
13 |
sys.exit()
|
14 |
|
15 |
categories = []
|
16 |
path = sys.argv[1]
|
17 |
for arg in argv[2:]:
|
18 |
categories.append(arg)
|
19 |
|
20 |
outName = "Summary_Results0.txt"
|
21 |
outfile = open(path+outName, 'w')
|
22 |
outfile.write("<STYLE type=\"text/css\">\n")
|
23 |
outfile.write("td.alr {text-align: right}\n")
|
24 |
outfile.write("</STYLE>\n")
|
25 |
outfile.write("<table border=\"1\">\n")
|
26 |
|
27 |
outfile.write("<tr>")
|
28 |
outfile.write("<th rowspan=2 BGCOLOR=\"#99CCFF\"> Njets </th>")
|
29 |
outfile.write("<th rowspan=2 BGCOLOR=\"#99CCFF\"> Nevt </th>")
|
30 |
outfile.write("<th colspan=2 BGCOLOR=\"#99CCFF\" width=200> Nevt(MCpred) </th>")
|
31 |
for category in categories:
|
32 |
outfile.write("<th colspan=3 BGCOLOR=\"#99CCFF\" width=300>")
|
33 |
outfile.write(category)
|
34 |
outfile.write("</th>")
|
35 |
outfile.write("</tr>\n")
|
36 |
outfile.write("<tr>")
|
37 |
outfile.write("<th BGCOLOR=\"#99CC00\" width=100> Nevt </th>")
|
38 |
outfile.write("<th BGCOLOR=\"#99CC00\"> stat. err. </th>")
|
39 |
for category in categories:
|
40 |
outfile.write("<th BGCOLOR=\"#99CC00\" width=100> Nevt </th>")
|
41 |
outfile.write("<th BGCOLOR=\"#99CC00\" width=100> stat. err. </th>")
|
42 |
outfile.write("<th BGCOLOR=\"#99CC00\"> Scale Factor </th>")
|
43 |
outfile.write("</tr>\n")
|
44 |
|
45 |
outfile.close()
|
46 |
|
47 |
|
48 |
if __name__ =='__main__':
|
49 |
main(sys.argv)
|
50 |
sys.exit()
|
51 |
|