1 |
import sys
|
2 |
from colors import *
|
3 |
write = sys.stdout.write
|
4 |
|
5 |
def MoreTableInfo(PSColumnByLS,LiveLumiByLS,DeliveredLumiByLS,StartLS,LastLS):
|
6 |
StartLS=10
|
7 |
LastLS=20
|
8 |
PrescaleColumnString=''
|
9 |
|
10 |
if min(list(PSColumnByLS.values())[StartLS:LastLS]) == max(list(PSColumnByLS.values())[StartLS:LastLS]):
|
11 |
PrescaleColumnString = str(PSColumnByLS[StartLS])
|
12 |
|
13 |
else:
|
14 |
PrescaleColumnString = str(max(PSColumnByLS[StartLS]))+" and "+str(min(PSColumnByLS[LastLS]))
|
15 |
|
16 |
|
17 |
AvLiveLumi = 1000 * ( max(list(LiveLumiByLS.values()[StartLS:LastLS])) - LiveLumiByLS.values()[StartLS]) / ( ( len(list(LiveLumiByLS.values()[StartLS:LastLS])) - 1 ) * 23.3 )
|
18 |
|
19 |
AvDeliveredLumi = 1000 * ( max(list(DeliveredLumiByLS.values()[StartLS:LastLS])) - DeliveredLumiByLS.values()[StartLS] ) / ( ( len(list(DeliveredLumiByLS.values()[StartLS:LastLS])) - 1 ) * 23.3 )
|
20 |
|
21 |
AvDeadtime = 100 * (AvDeliveredLumi - AvLiveLumi) / (AvDeliveredLumi + 0.1)
|
22 |
|
23 |
##nameBufLen=60
|
24 |
## RateBuffLen=10
|
25 |
## write('*'*(nameBufLen+3*RateBuffLen+10))
|
26 |
## write ('\nCalculation using FirstLS = %s to LastLS = %s of run %s \n' % (HeadParser.FirstLS, HeadParser.LastLS, CompareRunNum))
|
27 |
|
28 |
write("The average delivered lumi of these lumi sections is: ")
|
29 |
write(str(round(AvDeliveredLumi,1))+"e30"+"\n")
|
30 |
write("The average live (recorded) lumi of these lumi sections is: ")
|
31 |
if AvLiveLumi==0:
|
32 |
write(bcolors.FAIL)
|
33 |
elif AvLiveLumi<100:
|
34 |
write(bcolors.WARNING)
|
35 |
|
36 |
write(str(round(AvLiveLumi,1))+"e30")
|
37 |
write(bcolors.ENDC+"\n")
|
38 |
write("The average deadtime of these lumi sections is: ")
|
39 |
if AvDeadtime > 5:
|
40 |
write(bcolors.FAIL)
|
41 |
elif AvDeadtime > 10:
|
42 |
write(bcolors.WARNING)
|
43 |
else:
|
44 |
write(bcolors.OKBLUE)
|
45 |
write(str(round(AvDeadtime,1))+"%")
|
46 |
write(bcolors.ENDC+"\n")
|
47 |
|
48 |
print "Using prescale column "+str(PrescaleColumnString)
|