File indexing completed on 2024-11-26 02:34:13
0001 import re
0002 import sys
0003 import ROOT
0004
0005 fname_root = "dqm_file1.root"
0006 fname_report = "dqm_file1_jobreport.xml"
0007
0008 kCmsGuid = "cms::edm::GUID"
0009
0010 f = ROOT.TFile.Open(fname_root)
0011 guid_file = getattr(f, kCmsGuid)
0012 f.Close()
0013
0014 guid_report = None
0015 with open(fname_report) as f:
0016 guid_re = re.compile("<GUID>(?P<guid>.*)</GUID>")
0017 for line in f:
0018 m = guid_re.search(line)
0019 if m:
0020 guid_report = m.group("guid")
0021 break
0022
0023 if guid_report is None:
0024 print("Did not find GUID from %s" % fname_report)
0025 sys.exit(1)
0026 if guid_file != guid_report:
0027 print("GUID from file %s differs from GUID from job report %s" % (guid_file, guid_report))
0028 sys.exit(1)
0029
0030 print("SUCCEEDED")