ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/RateMonShiftTool_dev/AddTableInfo.py
Revision: 1.1
Committed: Fri Dec 16 19:43:51 2011 UTC (13 years, 4 months ago) by grchrist
Content type: text/x-python
Branch: MAIN
CVS Tags: V00-02-05, V00-02-04, V00-02-03, V00-02-01, V00-01-10, V-00-01-10, V00-01-09, V00-01-08, V00-01-07, V00-01-06, V00-01-05, V00-01-04, V00-01-03, V00-01-02, V00-01-01, V00-00-34, V00-00-33, MenuAnalyzer_V00-00-02, MenuAnalyzer_V00-00-01, MenuAnalyzer_V1, V00-00-32, V00-00-31, V00-00-30, V00-00-29, V00-00-28, V00-00-27, V00-00-26, V00-00-24, V00-00-23, V00-00-22, V00-00-21, V00-00-20, V00-00-19, V00-00-18, V00-00-17, V00-00-16, V00-00-15, V00-00-14, V00-00-13, V00-00-12, V00-00-11, V00-00-10, V00-00-09, V00-00-08, V00-00-07, V00-00-05, V00-00-04, V00-00-03, V00-00-02, V00-00-01
Branch point for: V00-00-06
Log Message:
More integration: adeded extra table info. fixed bug in ref runs.


File Contents

# User Rev Content
1 grchrist 1.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)