|
ATLAS Offline Software
|
|
def | GRL_IOV () |
|
def | grl_from_dir (xmldir) |
|
def | load_grl_iovs_any (*files) |
|
def | load_grl (xml_file, IOVSet_class=IOVSet) |
|
def | load_grl_string (data, IOVSet_class=IOVSet) |
|
def | make_grl (iovset, name="unknown", version="unknown") |
|
def | grl_contains_run_lb (grl, runlb) |
|
def | grl_iovs_from_xml (*args, **kwargs) |
|
def | test () |
|
def | _do_import_and_get_obj (grlconfmod, grlobj=None) |
|
def | _deep_get_grl_info (grlconf, cooltag, folder) |
|
def | _get_grl_info (grlconf, cooltag, folder, queue=None) |
|
def | _get_cool_tags_for_folder (folder) |
|
def | _get_list_of_grl_classes () |
|
◆ _deep_get_grl_info()
def python.grl._deep_get_grl_info |
( |
|
grlconf, |
|
|
|
cooltag, |
|
|
|
folder |
|
) |
| |
|
private |
Definition at line 21 of file GoodRunsLists/python/grl.py.
22 from CoolRunQuery.AtlRunQueryLib
import AtlRunQuery, AtlRunQueryOptions
23 from CoolRunQuery.AtlRunQueryParser
import ArgumentParser
27 config.setdqfolder(folder)
28 config.setdqctag(cooltag)
31 query = config.getsearchquery()
32 print (
">> Calling cmd equivalent of: ")
33 print (
"%s \"%s\"" % (config.querytool,query))
37 atlqueryarg = config.querytool +
" " + ap.ParseArgument( query )
38 (options, args) = AtlRunQueryOptions().
parse(atlqueryarg)
44 proc = multiprocessing.Process(target=AtlRunQuery, args=(options,),
45 kwargs={
'html':
"NO",
'origQuery':query,
'loglevel':0})
48 xmlfile =
'data/'+config.listname
◆ _do_import_and_get_obj()
def python.grl._do_import_and_get_obj |
( |
|
grlconfmod, |
|
|
|
grlobj = None |
|
) |
| |
|
private |
Definition at line 14 of file GoodRunsLists/python/grl.py.
15 __import__(grlconfmod)
16 m = sys.modules[grlconfmod]
18 grlobj = grlconfmod.rsplit(
'.')[-1]
19 return m.__dict__[grlobj]()
◆ _get_cool_tags_for_folder()
def python.grl._get_cool_tags_for_folder |
( |
|
folder | ) |
|
|
private |
Definition at line 66 of file GoodRunsLists/python/grl.py.
67 tagxml = urllib.urlopen(
'http://voatlas11.cern.ch:8080/cooldb/ATLAS_COOLPROD/ATLAS_COOLOFL_GLOBAL/COMP200/GLOBAL/DETSTATUS/%s/tags'
69 xml = ET.parse(tagxml)
71 for t
in xml.findall(
'tag'):
73 lock = t.attrib.get(
'lock',
'unlocked')
74 description = t.attrib.get(
'description')
75 rv.append((text, description, lock))
78 GRL_DIRECTORY=
'/afs/cern.ch/user/a/atlasdqm/grl'
◆ _get_grl_info()
def python.grl._get_grl_info |
( |
|
grlconf, |
|
|
|
cooltag, |
|
|
|
folder, |
|
|
|
queue = None |
|
) |
| |
|
private |
Definition at line 53 of file GoodRunsLists/python/grl.py.
54 sys.path.append(os.path.dirname(grlconf))
56 tmpdir = tempfile.mkdtemp()
60 os.chdir(os.environ[
'TMPDIR'])
63 queue.put((rv, rfile))
◆ _get_list_of_grl_classes()
def python.grl._get_list_of_grl_classes |
( |
| ) |
|
|
private |
Definition at line 88 of file GoodRunsLists/python/grl.py.
90 def walker(rl, d, children):
91 for child
in children:
92 if child[-3:] ==
'.py' and child !=
'__init__.py':
93 fullpath = os.path.join(d, child)
94 classname = fullpath.replace(GRL_DIRECTORY,
'')[:-3].lstrip(
'/').
replace(
'/',
'.')
95 rl.append((fullpath, classname))
96 os.path.walk(GRL_DIRECTORY, walker, rl)
◆ grl_contains_run_lb()
def python.grl.grl_contains_run_lb |
( |
|
grl, |
|
|
|
runlb |
|
) |
| |
Definition at line 84 of file DQUtils/python/grl.py.
87 if isinstance(runlb, RunLumiType):
91 return any(_.contains_point(runlb_)
for _
in grl)
◆ grl_from_dir()
def python.grl.grl_from_dir |
( |
|
xmldir | ) |
|
Loads valid IOV ranges if they appear in any grl file whose name ends with ".xml"
Definition at line 16 of file DQUtils/python/grl.py.
18 Loads valid IOV ranges if they appear in any grl file whose name ends with ".xml"
21 for f
in listdir(xmldir)
if f.endswith(
".xml")))
◆ GRL_IOV()
def python.grl.GRL_IOV |
( |
| ) |
|
◆ grl_iovs_from_xml()
def python.grl.grl_iovs_from_xml |
( |
* |
args, |
|
|
** |
kwargs |
|
) |
| |
Definition at line 94 of file DQUtils/python/grl.py.
95 from warnings
import warn
96 warn(
"grl_iovs_from_xml was renamed to load_grl", DeprecationWarning)
◆ load_grl()
def python.grl.load_grl |
( |
|
xml_file, |
|
|
|
IOVSet_class = IOVSet |
|
) |
| |
◆ load_grl_iovs_any()
def python.grl.load_grl_iovs_any |
( |
* |
files | ) |
|
Use IOV ranges from the input `files` xmls if the lumirange is set in any file
Definition at line 23 of file DQUtils/python/grl.py.
25 Use IOV ranges from the input `files` xmls if the lumirange is set in any file
29 assert all(i.ordered
for i
in grl_iovsets)
32 for since, until, grl_states
in process_iovs(*grl_iovsets):
34 result.add(since, until)
36 return result.solidify(GRL_IOV)
◆ load_grl_string()
def python.grl.load_grl_string |
( |
|
data, |
|
|
|
IOVSet_class = IOVSet |
|
) |
| |
Definition at line 42 of file DQUtils/python/grl.py.
43 xml = cElementTree.fromstring(data)
46 for lbc
in xml.iter(
'LumiBlockCollection'):
47 run =
int(lbc.find(
'Run').text)
48 for lbr
in lbc.findall(
'LBRange'):
49 since, until =
int(lbr.get(
'Start')),
int(lbr.get(
'End')) + 1
53 return IOVSet_class(map(GRL_IOV._make,
sorted(result)))
◆ make_grl()
def python.grl.make_grl |
( |
|
iovset, |
|
|
|
name = "unknown" , |
|
|
|
version = "unknown" |
|
) |
| |
Definition at line 55 of file DQUtils/python/grl.py.
55 def make_grl(iovset, name="unknown", version="unknown"):
56 assert len(iovset.channels) <= 1
58 from datetime
import datetime
59 from textwrap
import dedent
62 <?xml version="1.0" ?>
63 <!DOCTYPE LumiRangeCollection
64 SYSTEM 'http://atlas-runquery.cern.ch/LumiRangeCollection.dtd'>
65 <!-- Good-runs-list created by DQUtils on {time} -->
69 <Version>{version}</Version>""".
format(
70 name=name, version=version,
71 time=datetime.now().strftime(
"%Y-%m-%d %H:%M:%S.%f"))).strip()]
73 for run, iovs
in sorted(iovset.by_run.items()):
74 result.append(
" <LumiBlockCollection>")
75 result.append(
" <Run>%i</Run>" % run)
77 arg = iov.since.lumi, iov.until.lumi-1
78 result.append(
' <LBRange Start="%i" End="%i"/>' % arg)
79 result.append(
" </LumiBlockCollection>")
80 result.append(
" </NamedLumiRange>")
81 result.append(
"</LumiRangeCollection>")
82 return "\n".
join(result)
◆ test()
Definition at line 99 of file DQUtils/python/grl.py.
100 path =
"/afs/cern.ch/user/b/beate/public/DQAna/StableBeams-periodC1.xml"
103 from pprint
import pprint
◆ TAGS_TO_SUPPRESS
list python.grl.TAGS_TO_SUPPRESS |
Initial value: 1 = [
'DetStatusLBSumm_m4initial',
2 'DetStatusLBSumm-cos08-01',
3 'DetStatusLBSumm-cos09-01',
4 'DetStatusLBSumm-cos08-02',
6 'DetStatusLBSumm_RECP']
Definition at line 81 of file GoodRunsLists/python/grl.py.
IovVectorMap_t read(const Folder &theFolder, const SelectionCriterion &choice, const unsigned int limit=10)
std::string replace(std::string s, const std::string &s2, const std::string &s3)
def load_grl(xml_file, IOVSet_class=IOVSet)
def load_grl_string(data, IOVSet_class=IOVSet)
def load_grl_iovs_any(*files)
def _do_import_and_get_obj(grlconfmod, grlobj=None)
def grl_iovs_from_xml(*args, **kwargs)
def process_iovs(*iovsets)
std::vector< typename T::value_type > sorted(T begin, T end)
Helper function to create a sorted vector from an unsorted one.
def _get_cool_tags_for_folder(folder)
std::string join(const std::vector< std::string > &v, const char c=',')
def _get_list_of_grl_classes()
def make_grl(iovset, name="unknown", version="unknown")
def _deep_get_grl_info(grlconf, cooltag, folder)
def grl_contains_run_lb(grl, runlb)
def _get_grl_info(grlconf, cooltag, folder, queue=None)