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()
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)
def generate_flav_c(loaded_data)