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

Comparing UserCode/RateMonShiftTool_dev/CheckPrescales.py (file contents):
Revision 1.4 by amott, Mon Mar 26 09:40:56 2012 UTC vs.
Revision 1.6 by fwyzard, Tue Nov 13 01:15:23 2012 UTC

# Line 3 | Line 3
3   import sys
4   import os
5   import getopt
6 + import copy
7  
8   from DatabaseParser import ConnectDB
9  
# Line 96 | Line 97 | def GetPrescaleTable(HLT_Key,GT_Key,GTRS
97      HLTSeed = {}
98      for HLTPath,L1Seed in curs.fetchall():
99          if not HLTSeed.has_key(HLTPath): ## this should protect us from L1_SingleMuOpen
100 <            HLTSeed[HLTPath] = L1Seed.lstrip('"').rstrip('"')
100 >            tmp = L1Seed.lstrip('"').rstrip('"')
101 >            HLTSeed[HLTPath] = tmp.rstrip(' ')
102              
103      HLTPrescales = GetHLTPrescaleMatrix(curs,HLT_Key)
104  
# Line 112 | Line 114 | def GetPrescaleTable(HLT_Key,GT_Key,GTRS
114      L1Prescales = GetL1AlgoPrescales(curs,GTRS_Key)
115  
116      FullPrescales = {}
117 <    formatString = "%55s%30s%45s%45s%45s"
117 >    formatString = "%-60s%-40s%90s%80s%80s"
118      if doPrint:
119          print "List of triggers with non-sequential prescales:"
120          print formatString % ("HLT Name","L1 Name","Total","HLT","L1",)
# Line 123 | Line 125 | def GetPrescaleTable(HLT_Key,GT_Key,GTRS
125              continue
126          thisL1PS = []
127          for seed in L1Seeds.split(' OR '): ## unwind the OR of multiple seeds
128 +            seed = seed.lstrip(' ').rstrip(' ')
129              if seed.isdigit():
130                  continue
131              if not L1Names.has_key(seed):
132                  print "WARNING: %s uses non-existant L1 seed: %s" % (HLTName,seed,)
133              tmp = L1Prescales[L1Names[seed]]
134              if len(thisL1PS)==0:
135 <                thisL1PS = tmp ## just set it for the first one
135 >                thisL1PS = copy.copy(tmp) ## just set it for the first one
136              else:
137                  for i,a,b in zip(range(len(tmp)),thisL1PS,tmp):
138                      if b<a:

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines