3 from __future__
import print_function
8 if len(objectName)==0: objectName=className
10 modname =
'%s.%s' % (moduleName,className)
14 mod = importlib.import_module (modname)
15 return getattr (mod, objectName)
18 moduleArr = moduleName.split(
".")
20 libraryName = moduleArr[0]
21 else: libraryName =
"GoodRunsLists"
22 configModule = moduleArr[len(moduleArr)-1]
23 if len(className)==0: className=configModule
26 cls = importModule (libraryName,configModule,className)
29 cls = importModule (configModule,className)
31 print (
"Could not import configuration module \'" + configModule +
"\'")
39 return (allOk,xmlfile)
42 from CoolRunQuery.AtlRunQueryLib
import AtlRunQuery
43 from CoolRunQuery.AtlRunQueryOptions
import AtlRunQueryOptions
44 from CoolRunQuery.AtlRunQueryParser
import ArgumentParser
48 config.setPrefix(prefix)
49 query = config.getsearchquery()
50 print (
">> Calling cmd equivalent of: ")
51 print (
"%s \"%s\"" % (config.querytool,query))
55 atlqueryarg = config.querytool +
" " + ap.ParseArgument( query )
56 (options, args) = AtlRunQueryOptions().
parse(atlqueryarg)
64 xmlfile =
'data/'+config.listname
65 print (
">> Good-run list stored as: \'%s\'" % xmlfile)
74 from ROOT
import gSystem
77 gSystem.Load(
'libGoodRunsListsLib')
82 reader.SetXMLFile(xmlfile)
85 grlcollection = reader.GetMergedGRLCollection()
86 print (
">> Found %d independent good-run list(s). Now checking content." % len(grlcollection))
91 for idx
in range(len(grlcollection)):
92 grl = grlcollection[idx]
93 grlName = grl.GetName()
94 grlVersion = grl.GetVersion()
95 grlMDSize = grl.GetMetaDataSize()
96 grlIsEmpty = grl.IsEmpty()
98 print (
">> ERROR: good run list %d has no name." % (idx))
100 if len(grlVersion)==0:
101 print (
">> ERROR: good run list %d, with name \'%s\', has no version." % (idx,grlName))
104 print (
">> ERROR: good run list %d, with name \'%s\', has no metadata." % (idx,grlName))
107 print (
">> ERROR: good run list %d, with name \'%s\', has no run(s) and lumi-block range(s)." % (idx,grlName))
111 print (
">> Content okay.")