ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/RateMonShiftTool_dev/AddTableInfo_db.py
Revision: 1.1
Committed: Mon Feb 13 19:33:53 2012 UTC (13 years, 2 months ago) by amott
Content type: text/x-python
Branch: MAIN
Log Message:
first working version

File Contents

# User Rev Content
1 amott 1.1 import sys
2     from colors import *
3     from DatabaseParser import *
4     write = sys.stdout.write
5    
6     def MoreTableInfo(parser,LumiRange):
7     [AvInstLumi, AvLiveLumi, AvDeliveredLumi, AvDeadTime,PSCols] = parser.GetAvLumiInfo(LumiRange)
8    
9     if AvDeadTime==0: ## For some reason the dead time in the DB is occasionally broken
10     AvDeadTime = AvLiveLumi/AvDeliveredLumi * 100
11    
12     PrescaleColumnString=''
13     for c in PSCols:
14     PrescaleColumnString = PrescaleColumnString + str(c) + ","
15    
16     write("The average instantaneous lumi of these lumisections is: ")
17     write(str(round(AvInstLumi,1))+"e30\n")
18     write("The delivered lumi of these lumi sections is: ")
19     write(str(round(1000*AvDeliveredLumi,1))+"e30"+"\n")
20     write("The live (recorded) lumi of these lumi sections is: ")
21     write(str(round(1000*AvLiveLumi,1))+"e30\n\n")
22     write("The average deadtime of these lumi sections is: ")
23     if AvDeadTime > 5:
24     write(bcolors.FAIL)
25     elif AvDeadTime > 10:
26     write(bcolors.WARNING)
27     else:
28     write(bcolors.OKBLUE)
29     write(str(round(AvDeadTime,1))+"%")
30     write(bcolors.ENDC+"\n")
31    
32     print "Used prescale column(s): "+str(PrescaleColumnString)
33     print "Lumisections: "+str(LumiRange)