ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/Jeng/tools/make_table0.py
Revision: 1.4
Committed: Tue Nov 2 04:08:28 2010 UTC (14 years, 6 months ago) by jengbou
Content type: text/x-python
Branch: MAIN
CVS Tags: gregj-20110224, gregj-20110223-v1, gregj-20110223, gregj-20110205, gregj-20110114, gregj-20110107, gregj-20101223, gregj-20101212, gregj-20101211, gregj-20101210-new, gregj-20101210, gregj-20101121, gregj-20101113-NEW, gregj-20101113, gregj-20101111-JES_JETONLY, gregj-20101103, HEAD
Changes since 1.3: +6 -5 lines
Log Message:
update to include scale factors

File Contents

# Content
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