7 if len(objectName)==0: objectName=className
9 modname =
'%s.%s' % (moduleName,className)
13 mod = importlib.import_module (modname)
14 return getattr (mod, objectName)
17 moduleArr = moduleName.split(
".")
19 libraryName = moduleArr[0]
20 else: libraryName =
"GoodRunsLists"
21 configModule = moduleArr[len(moduleArr)-1]
22 if len(className)==0: className=configModule
25 cls = importModule (libraryName,configModule,className)
28 cls = importModule (configModule,className)
30 print (
"Could not import configuration module \'" + configModule +
"\'")
38 return (allOk,xmlfile)
41 from CoolRunQuery.AtlRunQueryLib
import AtlRunQuery
42 from CoolRunQuery.AtlRunQueryOptions
import AtlRunQueryOptions
43 from CoolRunQuery.AtlRunQueryParser
import ArgumentParser
47 config.setPrefix(prefix)
48 query = config.getsearchquery()
49 print (
">> Calling cmd equivalent of: ")
50 print (
"%s \"%s\"" % (config.querytool,query))
54 atlqueryarg = config.querytool +
" " + ap.ParseArgument( query )
55 (options, args) = AtlRunQueryOptions().
parse(atlqueryarg)
63 xmlfile =
'data/'+config.listname
64 print (
">> Good-run list stored as: \'%s\'" % xmlfile)
73 from ROOT
import gSystem
76 gSystem.Load(
'libGoodRunsListsLib')
81 reader.SetXMLFile(xmlfile)
84 grlcollection = reader.GetMergedGRLCollection()
85 print (
">> Found %d independent good-run list(s). Now checking content." % len(grlcollection))
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()
97 print (
">> ERROR: good run list %d has no name." % (idx))
99 if len(grlVersion)==0:
100 print (
">> ERROR: good run list %d, with name \'%s\', has no version." % (idx,grlName))
103 print (
">> ERROR: good run list %d, with name \'%s\', has no metadata." % (idx,grlName))
106 print (
">> ERROR: good run list %d, with name \'%s\', has no run(s) and lumi-block range(s)." % (idx,grlName))
110 print (
">> Content okay.")