3 from __future__
import print_function
8 import checkBTagCalibrationConsistency
as checker
13 flav_b_data = [e
for e
in loaded_data.entries
if e.params.jetFlavor == 0]
14 flav_b_data = sorted(flav_b_data, key=
lambda e: e.params.operatingPoint)
15 flav_b_data = sorted(flav_b_data, key=
lambda e: e.params.measurementType)
16 flav_b_data = sorted(flav_b_data, key=
lambda e: e.params.etaMin)
17 flav_b_data = sorted(flav_b_data, key=
lambda e: e.params.ptMin)
18 flav_b_data = sorted(flav_b_data, key=
lambda e: e.params.discrMin)
19 sys_groups = itertools.groupby(
21 key=
lambda e:
'%d, %s, %.02f, %.02f, %.02f' % (
22 e.params.operatingPoint,
23 e.params.measurementType,
30 def gen_entry_dict(groups):
33 entries_by_sys =
dict((e.params.sysType, e)
for e
in grp)
34 assert len(grp) == len(entries_by_sys)
36 sys_dicts = gen_entry_dict(sys_groups)
38 def gen_flavb_csv_line(dicts):
40 central = d.pop(
'central')
41 central.params.jetFlavor = 1
42 yield central.makeCSVLine()
43 for e
in six.itervalues(d):
44 e.params.jetFlavor = 1
45 e.formula =
'2*(%s)-(%s)' % (e.formula, central.formula)
47 csv_lines = gen_flavb_csv_line(sys_dicts)
49 return list(l
for l
in csv_lines)
54 print(
'Need input/output filenames as first/second arguments. Exit.')
56 if os.path.exists(sys.argv[2]):
57 print(
'Output file exists. Exit.')
60 print(
'\nChecking input file consistency...')
62 checks = checker.run_check_data(loaders,
True,
True,
False)
66 print(
'FLAV_C already present in input file for %s. Exit.' % typ)
68 if not any(0
in data.flavs
for data
in loaders):
69 print(
'FLAV_B not found in input file. Exit.')
73 print(
'\nGenerating new csv content...')
74 new_csv_data =
list(itertools.chain.from_iterable(
80 with open(sys.argv[1])
as f:
81 old_csv_data = f.readlines()
83 with open(sys.argv[2],
'w')
as f:
84 f.writelines(old_csv_data)
86 f.writelines(new_csv_data)
91 if __name__ ==
'__main__':
bool any(const std::vector< T > &v, const T &what)
S & print(S &os, JobReport::InputFile const &f)
def generate_flav_c(loaded_data)
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger list("!*","!HLTx*"if it matches 2 triggers or more) will accept the event if all the matching triggers are FAIL.It will reject the event if any of the triggers are PASS or EXCEPTION(this matches the behavior of"!*"before the partial wildcard feature was incorporated).Triggers which are in the READY state are completely ignored.(READY should never be returned since the trigger paths have been run