ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/RateMonShiftTool_dev/AddTableInfo_db.py
(Generate patch)

Comparing UserCode/RateMonShiftTool_dev/AddTableInfo_db.py (file contents):
Revision 1.16 by grchrist, Mon Mar 19 16:43:03 2012 UTC vs.
Revision 1.19 by grchrist, Thu Apr 5 05:03:24 2012 UTC

# Line 10 | Line 10 | NHighStreamA=0
10   def MoreTableInfo(parser,LumiRange,config,isCol=True):
11      print "Monitoring Run %d" % (parser.RunNumber,)
12      [AvInstLumi, AvLiveLumi, AvDeliveredLumi, AvDeadTime,PSCols] = parser.GetAvLumiInfo(LumiRange)
13 +    deadtimebeamactive=parser.GetDeadTimeBeamActive(LumiRange)
14      try:
15          LastPSCol = PSCols[-1]
16      except:
17          LastPSCol = -1
18 +    if isCol:
19          
20 <    aRates = parser.GetTriggerRatesByLS("AOutput")
20 >        aRates = parser.GetTriggerRatesByLS("AOutput")
21 >    else:
22 >        if len(parser.GetTriggerRatesByLS("AOutput"))>0:
23 >            aRates = parser.GetTriggerRatesByLS("AOutput")
24 >        else:
25 >            aRates = parser.GetTriggerRatesByLS("AForPPOutput")
26 >            
27 >    
28      expressRates = {}
29      if isCol:
30          expressRates = parser.GetTriggerRatesByLS("ExpressOutput")
31      else:
32 <        expressRates = parser.GetTriggerRatesByLS("ExpressCosmicsOutput")
32 >        if len(parser.GetTriggerRatesByLS("ExpressOutput"))>0:
33 >            expressRates=parser.GetTriggerRatesByLS("ExpressOutput")
34 >        else:
35 >            expressRates = parser.GetTriggerRatesByLS("ExpressForCosmicsOutput")
36      ExpRate=0
37      PeakRate=0
38      AvgExpRate=0
# Line 112 | Line 124 | def MoreTableInfo(parser,LumiRange,confi
124          write( colored(line,'red',attrs=['reverse','blink']) )
125          write( colored("*"*cols+"\n",'red',attrs=['reverse','blink']) )
126      
127 <    if AvDeadTime==0:  ## For some reason the dead time in the DB is occasionally broken
116 <        try:
117 <            AvDeadTime = AvLiveLumi/AvDeliveredLumi * 100
118 <        except:
119 <            AvDeadTime = 100
127 >    
128      PrescaleColumnString=''
129      PSCols = list(set(PSCols))
130      for c in PSCols:
# Line 130 | Line 138 | def MoreTableInfo(parser,LumiRange,confi
138          write("The live (recorded) lumi of these lumi sections is:      ")
139          write(str(round(len(LumiRange)*AvLiveLumi,1))+"e30\n\n")
140          write("The average deadtime of these lumi sections is:          ")
141 <        if AvDeadTime > 5:
141 >        if deadtimebeamactive > 5:
142              write(bcolors.FAIL)
143 <        elif AvDeadTime > 10:
143 >        elif deadtimebeamactive > 10:
144              write(bcolors.WARNING)
145          else:
146              write(bcolors.OKBLUE)
147 <        write(str(round(AvDeadTime,2))+"%")
147 >        write(str(round(deadtimebeamactive,2))+"%")
148          write(bcolors.ENDC+"\n")
149  
150      print "Used prescale column(s): "+str(PrescaleColumnString)    
# Line 146 | Line 154 | def MoreTableInfo(parser,LumiRange,confi
154      else:
155          write("%d - %d\n" % (min(LumiRange),max(LumiRange),))
156      print "\nLast Lumisection of the run is:        "+str(parser.GetLastLS())
157 <    write(  "Last Lumisection good for physics is:  "+str(parser.GetLastLS(True)) )
157 >    write(  "Last Lumisection good where DAQ is active is:  "+str(parser.GetLastLS(isCol)) )
158 >    ##write(  "Last Lumisection where DAQ is active is:  "+str(parser.GetLastLS(True)) )
159      write("\n\n\n")
160  
161      if isCol:

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines