6 import checkBTagCalibrationConsistency
as checker
10 res = checker.run_check_csv(csv_data,
False,
False,
False)
12 print 'Checks on csv data failed. Exit.'
18 print 'Need at least two input- and one output-filename. Exit.'
20 if os.path.exists(sys.argv[-1]):
21 print 'Output file exists. Exit.'
27 for fname
in sys.argv[1:-1]:
28 with open(fname)
as f:
29 all_csv_data[fname] = f.readlines()
30 header = all_csv_data[fname].
pop(0)
31 tggr = header.split(
'/')[0]
32 if tagger
and tggr != tagger:
33 print 'Found different taggers: %s vs. %s Exit.' % (tagger, tggr)
39 print 'Checking consistency of individual input files...'
41 for fname, csv_data
in all_csv_data.iteritems():
42 print '\nChecking file:', fname
47 print 'Checking consistency of combinations...'
49 for one, two
in itertools.combinations(all_csv_data.iteritems(), 2):
50 print '\nChecking combination:', one[0], two[0]
54 print '\nCombining data...'
56 with open(sys.argv[-1],
'w')
as f:
58 for csv_data
in all_csv_data.itervalues():
60 f.writelines(csv_data)
65 if __name__ ==
'__main__':