ATLAS Offline Software
Functions | Variables
dq_defect_virtual_defect_validation Namespace Reference

Functions

def truncate_iovs_to_runs (iovs, runends)
 
def get_runends ()
 
def do_compact (iovs)
 

Variables

 parser = optparse.OptionParser()
 
 default
 
 help
 
 opts
 
 args
 
 end
 
 vfdb = DQUtils.db.Databases.get_folder(opts.vfdb)
 
 vff = VirtualFlags.VirtualFlagFolder(vfdb)
 
 mapping = vff.get_flag_name_id_mapping()
 
 ddb = DefectsDB(opts.defectdb, read_only=True)
 
 defectids
 
 defectnames
 
 defectdict
 
def runends = get_runends()
 
 key
 
def vfiovs = do_compact(vff.browseObjects((152166,0), (167845,0), [key], 'DetStatus-v03-repro05-01', selection=lambda x: x.Code < 3))
 
 d1 = set([((x.since.run, x.since.lumi), (x.until.run, x.until.lumi)) for x in truncate_iovs_to_runs(vfiovs, runends) if x.since.run != 152220])
 
def diovs = do_compact(ddb.retrieve((152166,0), (167845,0), [key]))
 
 d2 = set([((x.since.run, x.since.lumi), (x.until.run, x.until.lumi)) for x in truncate_iovs_to_runs(diovs, runends) if x.since.run != 152220])
 
 d1a = dict([(((x.since.run, x.since.lumi), (x.until.run, x.until.lumi)), x.Comment) for x in truncate_iovs_to_runs(vfiovs, runends)])
 
 d2a = dict([(((x.since.run, x.since.lumi), (x.until.run, x.until.lumi)), x.comment) for x in truncate_iovs_to_runs(diovs, runends)])
 

Function Documentation

◆ do_compact()

def dq_defect_virtual_defect_validation.do_compact (   iovs)

Definition at line 25 of file dq_defect_virtual_defect_validation.py.

25 def do_compact(iovs):
26  iovs = sorted(iovs)
27  rv = []
28  pos = 0
29  while pos < len(iovs):
30  tiov = iovs[pos]
31  pos += 1
32  while pos < len(iovs):
33  niov = iovs[pos]
34  if niov.since != tiov.until:
35  break
36  tiov = tiov._replace(until=niov.until)
37  pos += 1
38  rv.append(tiov)
39  return rv
40 

◆ get_runends()

def dq_defect_virtual_defect_validation.get_runends ( )

Definition at line 14 of file dq_defect_virtual_defect_validation.py.

14 def get_runends():
15  from DQUtils.db import fetch_iovs
16  from DQUtils.sugar import RunLumi
17  eor_params = fetch_iovs('EOR_Params',
18  with_channel=False, what=[])
19  runends = {}
20  for iov in eor_params:
21  if iov.since.lumi == 0: iov = iov._replace(since=RunLumi(iov.since.run, 1))
22  runends[iov.since.run] = iov
23  return runends
24 

◆ truncate_iovs_to_runs()

def dq_defect_virtual_defect_validation.truncate_iovs_to_runs (   iovs,
  runends 
)

Definition at line 3 of file dq_defect_virtual_defect_validation.py.

3 def truncate_iovs_to_runs(iovs, runends):
4  for iov in iovs:
5  if iov.since.run not in runends:
6  print('Missing run', iov.since.run, 'from EOR_Params')
7 
8  rv = filter(None, [iov.intersect(runends[iov.since.run])
9  for iov in iovs if iov.since.run in runends])
10  rv = filter(lambda x: not(x.until.lumi-x.since.lumi == 0),
11  rv)
12  return rv
13 

Variable Documentation

◆ args

dq_defect_virtual_defect_validation.args

Definition at line 50 of file dq_defect_virtual_defect_validation.py.

◆ d1

dq_defect_virtual_defect_validation.d1 = set([((x.since.run, x.since.lumi), (x.until.run, x.until.lumi)) for x in truncate_iovs_to_runs(vfiovs, runends) if x.since.run != 152220])

Definition at line 79 of file dq_defect_virtual_defect_validation.py.

◆ d1a

dq_defect_virtual_defect_validation.d1a = dict([(((x.since.run, x.since.lumi), (x.until.run, x.until.lumi)), x.Comment) for x in truncate_iovs_to_runs(vfiovs, runends)])

Definition at line 85 of file dq_defect_virtual_defect_validation.py.

◆ d2

dq_defect_virtual_defect_validation.d2 = set([((x.since.run, x.since.lumi), (x.until.run, x.until.lumi)) for x in truncate_iovs_to_runs(diovs, runends) if x.since.run != 152220])

Definition at line 81 of file dq_defect_virtual_defect_validation.py.

◆ d2a

dq_defect_virtual_defect_validation.d2a = dict([(((x.since.run, x.since.lumi), (x.until.run, x.until.lumi)), x.comment) for x in truncate_iovs_to_runs(diovs, runends)])

Definition at line 86 of file dq_defect_virtual_defect_validation.py.

◆ ddb

dq_defect_virtual_defect_validation.ddb = DefectsDB(opts.defectdb, read_only=True)

Definition at line 62 of file dq_defect_virtual_defect_validation.py.

◆ default

dq_defect_virtual_defect_validation.default

Definition at line 45 of file dq_defect_virtual_defect_validation.py.

◆ defectdict

dq_defect_virtual_defect_validation.defectdict

Definition at line 63 of file dq_defect_virtual_defect_validation.py.

◆ defectids

dq_defect_virtual_defect_validation.defectids

Definition at line 63 of file dq_defect_virtual_defect_validation.py.

◆ defectnames

dq_defect_virtual_defect_validation.defectnames

Definition at line 63 of file dq_defect_virtual_defect_validation.py.

◆ diovs

def dq_defect_virtual_defect_validation.diovs = do_compact(ddb.retrieve((152166,0), (167845,0), [key]))

Definition at line 80 of file dq_defect_virtual_defect_validation.py.

◆ end

dq_defect_virtual_defect_validation.end

Definition at line 55 of file dq_defect_virtual_defect_validation.py.

◆ help

dq_defect_virtual_defect_validation.help

Definition at line 46 of file dq_defect_virtual_defect_validation.py.

◆ key

dq_defect_virtual_defect_validation.key

Definition at line 76 of file dq_defect_virtual_defect_validation.py.

◆ mapping

dq_defect_virtual_defect_validation.mapping = vff.get_flag_name_id_mapping()

Definition at line 58 of file dq_defect_virtual_defect_validation.py.

◆ opts

dq_defect_virtual_defect_validation.opts

Definition at line 50 of file dq_defect_virtual_defect_validation.py.

◆ parser

dq_defect_virtual_defect_validation.parser = optparse.OptionParser()

Definition at line 44 of file dq_defect_virtual_defect_validation.py.

◆ runends

def dq_defect_virtual_defect_validation.runends = get_runends()

Definition at line 67 of file dq_defect_virtual_defect_validation.py.

◆ vfdb

dq_defect_virtual_defect_validation.vfdb = DQUtils.db.Databases.get_folder(opts.vfdb)

Definition at line 56 of file dq_defect_virtual_defect_validation.py.

◆ vff

dq_defect_virtual_defect_validation.vff = VirtualFlags.VirtualFlagFolder(vfdb)

Definition at line 57 of file dq_defect_virtual_defect_validation.py.

◆ vfiovs

def dq_defect_virtual_defect_validation.vfiovs = do_compact(vff.browseObjects((152166,0), (167845,0), [key], 'DetStatus-v03-repro05-01', selection=lambda x: x.Code < 3))

Definition at line 77 of file dq_defect_virtual_defect_validation.py.

dq_defect_virtual_defect_validation.do_compact
def do_compact(iovs)
Definition: dq_defect_virtual_defect_validation.py:25
python.db.fetch_iovs
def fetch_iovs(folder_name, since=None, until=None, channels=None, tag="", what="all", max_records=-1, with_channel=True, loud=False, database=None, convert_time=False, named_channels=False, selection=None, runs=None, with_time=False, unicode_strings=False)
Definition: DQUtils/python/db.py:67
covarianceTool.filter
filter
Definition: covarianceTool.py:514
python.sugar.runlumi.RunLumi
RunLumi
Definition: runlumi.py:131
dq_defect_virtual_defect_validation.truncate_iovs_to_runs
def truncate_iovs_to_runs(iovs, runends)
Definition: dq_defect_virtual_defect_validation.py:3
dq_defect_virtual_defect_validation.get_runends
def get_runends()
Definition: dq_defect_virtual_defect_validation.py:14
DerivationFramework::TriggerMatchingUtils::sorted
std::vector< typename T::value_type > sorted(T begin, T end)
Helper function to create a sorted vector from an unsorted one.
dbg::print
void print(std::FILE *stream, std::format_string< Args... > fmt, Args &&... args)
Definition: SGImplSvc.cxx:70