67def verifyGRL(xmlfile):
68
69 CWD = os.getcwd()
70
73 from ROOT import gSystem
74 os.chdir(CWD)
75
76 gSystem.Load('libGoodRunsListsLib')
77 from ROOT import Root
78
80
81 reader.SetXMLFile(xmlfile)
82 reader.Interpret()
83
84 grlcollection = reader.GetMergedGRLCollection()
85 print (">> Found %d independent good-run list(s). Now checking content." % len(grlcollection))
86
87 allOk = True
88
89
90 for idx in range(len(grlcollection)):
91 grl = grlcollection[idx]
92 grlName = grl.GetName()
93 grlVersion = grl.GetVersion()
94 grlMDSize = grl.GetMetaDataSize()
95 grlIsEmpty = grl.IsEmpty()
96 if len(grlName)==0:
97 print (">> ERROR: good run list %d has no name." % (idx))
98 allOk = False
99 if len(grlVersion)==0:
100 print (">> ERROR: good run list %d, with name \'%s\', has no version." % (idx,grlName))
101 allOk = False
102 if grlMDSize==0:
103 print (">> ERROR: good run list %d, with name \'%s\', has no metadata." % (idx,grlName))
104 allOk = False
105 if grlIsEmpty:
106 print (">> ERROR: good run list %d, with name \'%s\', has no run(s) and lumi-block range(s)." % (idx,grlName))
107 allOk = False
108
109 if allOk:
110 print (">> Content okay.")
111
112 return allOk
113