Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2025-07-01 00:07:24

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 = f[kCmsGuid]
0012 
0013 f.Close()
0014 
0015 guid_report = None
0016 with open(fname_report) as f:
0017     guid_re = re.compile("<GUID>(?P<guid>.*)</GUID>")
0018     for line in f:
0019         m = guid_re.search(line)
0020         if m:
0021             guid_report = m.group("guid")
0022             break
0023 
0024 if guid_report is None:
0025     print("Did not find GUID from %s" % fname_report)
0026     sys.exit(1)
0027 if guid_file != guid_report:
0028     print("GUID from file %s differs from GUID from job report %s" % (guid_file, guid_report))
0029     sys.exit(1)
0030 
0031 print("SUCCEEDED")