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.25 by grchrist, Mon Apr 9 10:53:10 2012 UTC vs.
Revision 1.28 by amott, Thu May 10 14:27:53 2012 UTC

# Line 10 | Line 10 | NHighStreamA=0
10   def MoreTableInfo(parser,LumiRange,config,isCol=True):
11      print "Monitoring Run %d" % (parser.RunNumber,)
12      print "len=",len(LumiRange)
13 +    print "LSRange=", LumiRange
14      if len(LumiRange)>0:
15          
16          [AvInstLumi, AvLiveLumi, AvDeliveredLumi, AvDeadTime,PSCols] = parser.GetAvLumiInfo(LumiRange)
# Line 25 | Line 26 | def MoreTableInfo(parser,LumiRange,confi
26      if isCol:
27          
28          aRates = parser.GetTriggerRatesByLS("AOutput")
29 +        bRates = parser.GetTriggerRatesByLS("BOutput")
30 +        if len(bRates) == 0:
31 +            realARates = aRates
32 +        else:
33 +            realARates={}
34 +            for k,v in bRates.iteritems():
35 +                realARates[k]=aRates[k]-bRates[k]
36 +                #realARates = aRates - bRates*20;
37      else:
38          if len(parser.GetTriggerRatesByLS("AOutput"))>0:
39              aRates = parser.GetTriggerRatesByLS("AOutput")
# Line 48 | Line 57 | def MoreTableInfo(parser,LumiRange,confi
57      PeakRateA=0
58      AvgRateA=0
59      
60 +    realARate=0
61 +    realPeakRateA=0
62 +    realAvgRateA=0
63 +    
64      if len(expressRates.values()) > 20:
65          AvgExpRate = sum(expressRates.values())/len(expressRates.values())
66  
# Line 61 | Line 74 | def MoreTableInfo(parser,LumiRange,confi
74          ARate+=thisRateA
75          if thisRateA>PeakRateA:
76              PeakRateA=thisRateA
77 <        
77 >
78 >        thisRealRateA = aRates.get(ls,0) - bRates.get(ls,0)
79 >        realARate+=thisRealRateA
80 >        if thisRealRateA > realPeakRateA:
81 >            realReakRateA = thisRealRateA
82          #ARate+=aRates.get(ls,0)
83      ## Print Stream A Rate --moved see below
84      ##print "Current Steam A Rate is: %0.1f Hz" % (ARate/len(LumiRange),)
# Line 102 | Line 119 | def MoreTableInfo(parser,LumiRange,confi
119      ##Check if Stream A is too high
120      #########################################
121      global NHighStreamA
122 <    badStreamA =ARate/len(LumiRange) > config.MaxStreamARate ##Cosmics Express Rate 300 Hz max
122 >    badStreamA =realARate/len(LumiRange) > config.MaxStreamARate ##Cosmics Express Rate 300 Hz max
123      baseTextA= "\nCurrent Steam A Rate is: %0.1f Hz" % (ARate/len(LumiRange),)
124 +    baseTextRealA= "\nCurrent PROMPT Steam A Rate is: %0.1f Hz" % (realARate/len(LumiRange),)
125      if badStreamA:
126          textA=colored(baseTextA,'red',attrs=['reverse'])  ## bad, make the text white on red
127 +        textRealA=colored(baseTextRealA,'red',attrs=['reverse'])  ## bad, make the text white on red
128          NHighStreamA+=1
129      else:
130          textA=baseTextA
131 +        textRealA=baseTextRealA
132          NHighStreamA=0
133  
134      write(textA)
135 +    write(textRealA)
136      if badStreamA:
137          if len(LumiRange)>1:
138 <            if (ARate-PeakRateA)/(len(LumiRange)-1) <=config.MaxStreamARate: ## one lumisection causes this
138 >            if (realARate-realPeakRateA)/(len(LumiRange)-1) <=config.MaxStreamARate: ## one lumisection causes this
139                  write("  <<  This appears to be due to a 1 lumisection spike, please monitor\n")
140              else:
141                  if NHighStreamA >1: ##Call HLT doc!
# Line 156 | Line 177 | def MoreTableInfo(parser,LumiRange,confi
177              write(bcolors.OKBLUE)
178          write(str(round(deadtimebeamactive,2))+"%")
179          write(bcolors.ENDC+"\n")
180 <
181 <    print "Used prescale column(s): "+str(PrescaleColumnString)    
182 <    write("Lumisections: ")
180 >    write("Used prescale column(s): %s  " % (str(PrescaleColumnString),) )
181 >    if LastPSCol in config.ForbiddenCols and isCol:
182 >        write( colored("<< Using column %d! Please check in the documentation that this is the correct column" % (LastPSCol),'red',attrs=['reverse']) )
183 >    write("\nLumisections: ")
184      if not isSequential(LumiRange):
185          write(str(LumiRange)+"   Lumisections are not sequential (bad LS skipped)\n")
186      else:

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines