3 from __future__
import print_function
4 from __future__
import absolute_import
8 from .
import checkBTagCalibrationConsistency
as checker
13 res = checker.run_check_csv(csv_data,
False,
False,
False)
15 print(
'Checks on csv data failed. Exit.')
21 print(
'Need at least two input- and one output-filename. Exit.')
23 if os.path.exists(sys.argv[-1]):
24 print(
'Output file exists. Exit.')
30 for fname
in sys.argv[1:-1]:
31 with open(fname)
as f:
32 all_csv_data[fname] = f.readlines()
33 header = all_csv_data[fname].pop(0)
34 tggr = header.split(
'/')[0]
35 if tagger
and tggr != tagger:
36 print(
'Found different taggers: %s vs. %s Exit.' % (tagger, tggr))
42 print(
'Checking consistency of individual input files...')
44 for fname, csv_data
in six.iteritems(all_csv_data):
45 print(
'\nChecking file:', fname)
50 print(
'Checking consistency of combinations...')
52 for one, two
in itertools.combinations(six.iteritems(all_csv_data), 2):
53 print(
'\nChecking combination:', one[0], two[0])
57 print(
'\nCombining data...')
59 with open(sys.argv[-1],
'w')
as f:
61 for csv_data
in six.itervalues(all_csv_data):
63 f.writelines(csv_data)
68 if __name__ ==
'__main__':
def check_csv_data(csv_data)
S & print(S &os, JobReport::InputFile const &f)