-
Notifications
You must be signed in to change notification settings - Fork 1
/
makeTable.py
executable file
·38 lines (27 loc) · 1.01 KB
/
makeTable.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
#!/usr/bin/env python
import sys
searchStr="resMass=0,cat0,withCorr=0"
if len(sys.argv)>1:
searchStr=sys.argv[1]
file=open('resultsBias2D.txt','r')
printStr="Truth Model & Exp1,Exp1 & Pow1,Pow1 & Ber1,Ber1 & Ber1,Ber2 & Ber1,Ber3 & Ber1,Ber4 & Ber2,Ber1 \\\\ \hline \n"
expexpBiasList=[]
highBiasFlag=False
for line in file:
if line.find(searchStr)<0:
continue
data=line.replace(searchStr,'').replace('Mgg','').replace('Mjj','').replace('N','').replace('\n','').replace('\x00','').split()
expexpBiasList.append(float(data[1]))
for i in data[1:]:
if float(i)>1.0 or highBiasFlag:
highBiasFlag=True
break
for i in data[:-1]:
printStr+=i+" & "
printStr+=data[-1]+" \\\\ \n"
aveBias = sum(expexpBiasList)/float(len(expexpBiasList))
print "\nThe table:"
print printStr
print "\nExp1,Exp1 has an average bias of %.1f\\%%.\n" % (100*sum(expexpBiasList)/float(len(expexpBiasList)))
if highBiasFlag:
print "Note that some entries show a high bias\n"