2 from __future__
import print_function
3 from Page1Parser
import Page1Parser
6 import cPickle
as pickle
8 from TablePrint
import *
10 WBMPageTemplate =
"http://cmswbm/cmsdb/servlet/TriggerMode?KEY=l1_hlt_collisions/v%s" 13 print(
"%s [Options] KeyVersion" % sys.argv[0])
14 print(
"--IgnoreCols=<cols> List of columns to ignore from the prescale checker (format is 1,2,3,4 etc.)")
19 opt, args = getopt.getopt(sys.argv[1:],
"",[
"IgnoreCols="])
20 except getopt.GetoptError
as err:
31 if o ==
"--IgnoreCols":
35 IgnoreCols.append(
int(e))
37 print(
"Invalid argument to '--IgnoreCols' ")
40 print(
"Invalid option "+o)
44 WBMPage = WBMPageTemplate % args[0]
47 Parser._Parse(WBMPage)
48 Parser.ParseTrigModePage()
49 Parser.ComputeTotalPrescales()
51 Header=[
"Path Name",
"L1 Seed"]+Parser.ColumnLumi
52 ColWidths=[70,30]+[10]*len(Parser.ColumnLumi)
54 TOTAL L1*HLT PRESCALE TABLE: 59 Weird Looking L1*HLT Prescales 61 WARNING: paths seeded by the OR of several L1 bits may not be calculated properly (they assume an L1 prescale of 1 in all columns) 69 for line
in PrescaleTable:
74 for lumi,ps
in zip(ColLumi,prescales):
76 ratios.append(lumi/ps)
79 RatioTable.append([name,l1]+ratios)
85 for entry,i
in zip(array[0:],range(len(array[0:]))):
88 if lastEntry<entry
and lastEntry!=0:
97 for line
in PrescaleTable:
100 anomalies.append(line)
102 if __name__==
'__main__':
def findAnomalies(PrescaleTable, ignoreCols)
def isMonotonic(array, ignoreCols)
def TrendingWithLumi(ColLumi, PrescaleTable)
S & print(S &os, JobReport::InputFile const &f)
OutputIterator zip(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, InputIterator2 last2, OutputIterator result, Compare comp)
def PrettyPrintTable(Headers, Data, ColWidths, WarningCol=[], border='*')