Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-11-26 02:34:21

0001 #!/usr/bin/env python 
0002 
0003 # https://twiki.cern.ch/twiki/bin/viewauth/CMS/DqmRrApi
0004 
0005 from sys import stderr, exit
0006 import xml.dom.minidom
0007 from .rrapi import RRApi, RRApiError
0008 
0009 def queryRR(firstRun,lastRun,groupName):
0010     rrurl = "http://runregistry.web.cern.ch/runregistry/"
0011     stderr.write("Querying run registry for range [%d, %d], group name like %s ...\n" % (firstRun, lastRun, groupName))
0012     server = RRApi(rrurl)
0013     mycolumns = ['number', 'hltKeyDescription', 'runClassName']
0014     run_data = server.data(workspace = 'GLOBAL', table = 'runsummary', template = 'xml', columns = mycolumns, filter = {'datasetExists': '= true', 'number':'>= %d and <= %d'%(firstRun,lastRun), 'runClassName':"like '%%%s%%'"%groupName})
0015     ret = {}
0016     xml_data = xml.dom.minidom.parseString(run_data)
0017     xml_runs = xml_data.documentElement.getElementsByTagName("RunSummaryRowGlobal")
0018     for xml_run in xml_runs:
0019         ret[xml_run.getElementsByTagName("number")[0].firstChild.nodeValue] = xml_run.getElementsByTagName("hltKeyDescription")[0].firstChild.nodeValue
0020     return ret