ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/Jeng/tools/make_table0.py
Revision: 1.2
Committed: Thu Sep 30 07:17:24 2010 UTC (14 years, 7 months ago) by jengbou
Content type: text/x-python
Branch: MAIN
CVS Tags: gregj-20101005
Changes since 1.1: +4 -4 lines
Log Message:
update

File Contents

# User Rev Content
1 jengbou 1.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    
12     if len(argv) < 1:
13     sys.exit()
14    
15     categories = []
16     ## print argv
17     path = sys.argv[1]
18     for arg in argv[2:]:
19     categories.append(arg)
20    
21     outName = "Summary_Results0.txt"
22     outfile = open(path+outName, 'w')
23     outfile.write("<STYLE type=\"text/css\">\n")
24     outfile.write("td.alr {text-align: right}\n")
25     outfile.write("</STYLE>\n")
26     outfile.write("<table border=\"1\">\n")
27    
28     outfile.write("<tr>")
29     outfile.write("<th rowspan=2 BGCOLOR=\"#99CCFF\"> Njets </th>")
30     outfile.write("<th rowspan=2 BGCOLOR=\"#99CCFF\"> Nevt </th>")
31 jengbou 1.2 outfile.write("<th colspan=2 BGCOLOR=\"#99CCFF\" width=220> Nevt(MCpred) </th>")
32 jengbou 1.1 for category in categories:
33 jengbou 1.2 outfile.write("<th colspan=2 BGCOLOR=\"#99CCFF\" width=220>")
34 jengbou 1.1 outfile.write(category)
35     outfile.write("</th>")
36     outfile.write("</tr>\n")
37     outfile.write("<tr>")
38 jengbou 1.2 outfile.write("<th BGCOLOR=\"#99CC00\" width=110> Nevt </th>")
39 jengbou 1.1 outfile.write("<th BGCOLOR=\"#99CC00\"> stat. err. </th>")
40     for category in categories:
41 jengbou 1.2 outfile.write("<th BGCOLOR=\"#99CC00\" width=110> Nevt </th>")
42 jengbou 1.1 outfile.write("<th BGCOLOR=\"#99CC00\"> stat. err. </th>")
43     outfile.write("</tr>\n")
44    
45     outfile.close()
46    
47    
48     if __name__ =='__main__':
49     main(sys.argv)
50     sys.exit(main(sys.argv))
51