ATLAS Offline Software
Loading...
Searching...
No Matches
bsCompare Namespace Reference

Functions

 main ()

Variables

str __author__ = 'Carl Gwilliam'
str __version__ = ''
str __usage__
 parser = OptionParser(usage=__usage__, version=__version__)
 dest
 default
 help
 type
 None
 action
 False
 options
 args
int db1 = 1 else 'COOLOFL_INDET/CONDBR2'
int db2 = 2 else 'COOLOFL_INDET/CONDBR2'

Detailed Description

Compare beamspot DQ defects between various databases and tags

Function Documentation

◆ main()

bsCompare.main ( )

Definition at line 42 of file bsCompare.py.

42def main():
43 f1 = "%s::%s" % (db1, options.folder)
44 f2 = "%s::%s" % (db2, options.folder)
45
46 print ("="*100)
47 print ("Comparing: ")
48 print (" * ", f1, options.tag1)
49 print (" * ", f2, options.tag2)
50 print ("="*100)
51
52 if options.runMin is not None:
53 runs = options.runMin
54 if options.runMax is not None:
55 runs = options.runMin, options.runMax
56
57 tag1iovs = fetch_iovs(f1, runs=runs, tag=options.tag1)
58 tag2iovs = fetch_iovs(f2, runs=runs, tag=options.tag2)
59
60 affected_runs = set()
61 ar2 = set()
62
63 #runiovs = IOVSet()
64 #runiovs.add(RunLumiType((runs << 32)+0), RunLumiType((runs << 32)+(1 << 32)-1))
65
66 # Loop over iovs in the two tags
67 # for since, until, (t1, t2, r) in process_iovs(tag1iovs, tag2iovs, runiovs.solidify(RANGEIOV_VAL)):
68 for since, until, (t1, t2) in process_iovs(tag1iovs, tag2iovs):
69
70 # Ignore IoVs spanning runs
71 if not options.span and since.run != until.run: continue
72
73 # Make sure run exists in both
74 #if not t1.since or not t2.since: continue
75
76 # Only consider runs in the range interested in
77 # if not r: continue
78
79 # Check for IOVs with different status (one of which is non-zero)
80 if (t1.status == 0 or t2.status == 0) and (t1.status != t2.status):
81 if options.statusonly and not options.summary:
82 print (since, until, t1.status, t2.status)
83 ar2.add(since.run)
84
85 # Check for differences in all fields
86 if not options.statusonly:
87 for i, field in enumerate(t1._fields):
88 if t1[i] != t2[i]:
89 #if field in ['posX', 'posY'] and abs(t1[i]-t2[i]) > 0.1e-3:
90 #if field not in ['status'] and t1[i] != 0 and abs(t1[i]-t2[i])/t1[i] > 0.001:
91 #if field in ['posZ'] and t1[i] != 0 and abs(t1[i]-t2[i])/t1[i] > 0.05:
92 #if field in ['sigmaX', 'sigmaY'] and abs(t1[i]-t2[i]) > 0.2e-3:
93 #if field in ['sigmaZ'] and abs(t1[i]-t2[i])/t1[i] > 0.002:
94 if not options.summary:
95 print (since, until, field, t1[i], t2[i])
96 affected_runs.add(since.run)
97
98 # Print results
99 if not options.statusonly:
100 print ("Runs with differences (%s):" % len(affected_runs), ", ".join(map(str, sorted(affected_runs))))
101
102 print ("Runs with different status (and one non-zero):", ", ".join(map(str, sorted(ar2))))
103
STL class.
STL class.
int main()
Definition hello.cxx:18

Variable Documentation

◆ __author__

str bsCompare.__author__ = 'Carl Gwilliam'
private

Definition at line 9 of file bsCompare.py.

◆ __usage__

str bsCompare.__usage__
private
Initial value:
1= '''%prog [options] [database1] [database2]
2
3Database can be either connection string or db file:
4
5 e.g COOLOFL_INDET/CONDBR2 (default)
6 beamspot.db/BEAMSPOT
7
8Example:
9
10 dqCompare.py --rl 190236 ~atlidbs/jobs/data11_7TeV.00190236.express_express/DB_BEAMSPOT.x155_c779/data11_7TeV.00190236.express_express-DB_BEAMSPOT.x155_c779.AveBeamSpot-beamspot.db/BEAMSPOT
11
12'''

Definition at line 11 of file bsCompare.py.

◆ __version__

str bsCompare.__version__ = ''
private

Definition at line 10 of file bsCompare.py.

◆ action

bsCompare.action

Definition at line 34 of file bsCompare.py.

◆ args

bsCompare.args

Definition at line 37 of file bsCompare.py.

◆ db1

int bsCompare.db1 = 1 else 'COOLOFL_INDET/CONDBR2'

Definition at line 39 of file bsCompare.py.

◆ db2

int bsCompare.db2 = 2 else 'COOLOFL_INDET/CONDBR2'

Definition at line 40 of file bsCompare.py.

◆ default

bsCompare.default

Definition at line 29 of file bsCompare.py.

◆ dest

bsCompare.dest

Definition at line 29 of file bsCompare.py.

◆ False

bsCompare.False

Definition at line 34 of file bsCompare.py.

◆ help

bsCompare.help

Definition at line 29 of file bsCompare.py.

◆ None

bsCompare.None

Definition at line 32 of file bsCompare.py.

◆ options

bsCompare.options

Definition at line 37 of file bsCompare.py.

◆ parser

bsCompare.parser = OptionParser(usage=__usage__, version=__version__)

Definition at line 28 of file bsCompare.py.

◆ type

bsCompare.type

Definition at line 32 of file bsCompare.py.