2 from __future__
import print_function
3 from __future__
import absolute_import
4 from .Page1Parser
import Page1Parser
7 import cPickle
as pickle
9 from .TablePrint
import *
11 WBMPageTemplate =
"http://cmswbm/cmsdb/servlet/TriggerMode?KEY=l1_hlt_collisions/v%s" 14 print(
"%s [Options] KeyVersion" % sys.argv[0])
15 print(
"--IgnoreCols=<cols> List of columns to ignore from the prescale checker (format is 1,2,3,4 etc.)")
20 opt, args = getopt.getopt(sys.argv[1:],
"",[
"IgnoreCols="])
21 except getopt.GetoptError
as err:
32 if o ==
"--IgnoreCols":
36 IgnoreCols.append(
int(e))
38 print(
"Invalid argument to '--IgnoreCols' ")
41 print(
"Invalid option "+o)
45 WBMPage = WBMPageTemplate % args[0]
48 Parser._Parse(WBMPage)
49 Parser.ParseTrigModePage()
50 Parser.ComputeTotalPrescales()
52 Header=[
"Path Name",
"L1 Seed"]+Parser.ColumnLumi
53 ColWidths=[70,30]+[10]*len(Parser.ColumnLumi)
55 TOTAL L1*HLT PRESCALE TABLE: 60 Weird Looking L1*HLT Prescales 62 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) 70 for line
in PrescaleTable:
75 for lumi,ps
in zip(ColLumi,prescales):
77 ratios.append(lumi/ps)
80 RatioTable.append([name,l1]+ratios)
86 for entry,i
in zip(array[0:],
range(len(array[0:]))):
89 if lastEntry<entry
and lastEntry!=0:
98 for line
in PrescaleTable:
101 anomalies.append(line)
103 if __name__==
'__main__':
def findAnomalies(PrescaleTable, ignoreCols)
def isMonotonic(array, ignoreCols)
def TrendingWithLumi(ColLumi, PrescaleTable)
OutputIterator zip(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, InputIterator2 last2, OutputIterator result, Compare comp)
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
def PrettyPrintTable(Headers, Data, ColWidths, WarningCol=[], border=' *')