85 def _do_process(rootf, branches, vars, whens, bins):
88 dfW =
_makedf(rootf[names.folderW][names.tname].arrays(branches, library=
"pd"))
89 dfE =
_makedf(rootf[names.folderE][names.tname].arrays(branches, library=
"pd"))
91 valW = [v(dfW)
for v
in vars]
92 valE = [v(dfE)
for v
in vars]
94 wW = [
w(dfW)
if w
else None for w
in whens]
95 wE = [
w(dfE)
if w
else None for w
in whens]
97 runs = dfW.meta.run.unique()
102 for val, var
in zip(valW, vars):
103 hists[
"W"][r][var.name] = {}
104 for w, when
in zip(wW, whens):
106 hist = np.histogram(val[dfW.meta.run == r], bins=bins)
108 hist = np.histogram(val[w & (dfW.meta.run == r)], bins=bins)
110 hists[
"W"][r][var.name][when.name] = hist
115 for val, var
in zip(valE, vars):
116 hists[
"E"][r][var.name] = {}
117 for w, when
in zip(wE, whens):
119 hist = np.histogram(val[dfE.meta.run == r], bins=bins)
121 hist = np.histogram(val[w & (dfE.meta.run == r)], bins=bins)
123 hists[
"E"][r][var.name][when.name] = hist