ATLAS Offline Software
Functions | Variables
bsCompare Namespace Reference

Functions

def main ()
 

Variables

string __author__ = 'Carl Gwilliam'
 
string __version__ = ''
 
string __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'
 

Function Documentation

◆ main()

def bsCompare.main ( )

Definition at line 43 of file bsCompare.py.

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

Variable Documentation

◆ __author__

string bsCompare.__author__ = 'Carl Gwilliam'
private

Definition at line 10 of file bsCompare.py.

◆ __usage__

string bsCompare.__usage__
private
Initial value:
1 = '''%prog [options] [database1] [database2]
2 
3 Database can be either connection string or db file:
4 
5  e.g COOLOFL_INDET/CONDBR2 (default)
6  beamspot.db/BEAMSPOT
7 
8 Example:
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 12 of file bsCompare.py.

◆ __version__

string bsCompare.__version__ = ''
private

Definition at line 11 of file bsCompare.py.

◆ action

bsCompare.action

Definition at line 35 of file bsCompare.py.

◆ args

bsCompare.args

Definition at line 38 of file bsCompare.py.

◆ db1

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

Definition at line 40 of file bsCompare.py.

◆ db2

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

Definition at line 41 of file bsCompare.py.

◆ default

bsCompare.default

Definition at line 30 of file bsCompare.py.

◆ dest

bsCompare.dest

Definition at line 30 of file bsCompare.py.

◆ False

bsCompare.False

Definition at line 35 of file bsCompare.py.

◆ help

bsCompare.help

Definition at line 30 of file bsCompare.py.

◆ None

bsCompare.None

Definition at line 33 of file bsCompare.py.

◆ options

bsCompare.options

Definition at line 38 of file bsCompare.py.

◆ parser

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

Definition at line 29 of file bsCompare.py.

◆ type

bsCompare.type

Definition at line 33 of file bsCompare.py.

bsCompare.main
def main()
Definition: bsCompare.py:43
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
python.events.process_iovs
def process_iovs(*iovsets)
Definition: events.py:30
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.
CxxUtils::set
constexpr std::enable_if_t< is_bitmask_v< E >, E & > set(E &lhs, E rhs)
Convenience function to set bits in a class enum bitmask.
Definition: bitmask.h:232
TCS::join
std::string join(const std::vector< std::string > &v, const char c=',')
Definition: Trigger/TrigT1/L1Topo/L1TopoCommon/Root/StringUtils.cxx:10