6 return np.repeat(var, nbroadcast)
10 flat_var = var.flatten()
11 flat_nbroadcast = np.repeat(nbroadcast, var.counts)
13 flat_var_repeat = np.repeat(flat_var, flat_nbroadcast)
16 reindex = np.hstack([np.add.outer(np.arange(0, var.counts[i]) * nbroadcast[i], np.arange(0, nbroadcast[i])).flatten(
"F")
for i
in range(len(nbroadcast))])
18 reindex += np.repeat(np.hstack([[0], np.cumsum(nbroadcast * var.counts)[:-1]]), nbroadcast * var.counts)
19 flat_var_repeat_ordered = flat_var_repeat[reindex]
20 return group(flat_var_repeat_ordered, np.repeat(var.counts, nbroadcast))
24 return ak.JaggedArray.fromcounts(ngroup, var)
28 _, ind = np.unique(data[
"hdr.subrun"] + data[
"hdr.run"]*100, return_index=
True)
29 return np.sum(data[
"hdr.pot"][ind])
32 _, ind = np.unique(data[
"hdr.subrun"] + data[
"hdr.run"]*100, return_index=
True)
33 return np.sum(data[
"hdr.ngenevt"][ind])
36 return len(data[
"hdr.evt"])
42 _, ind = np.unique(nu[
"hdr.subrun"] + nu[
"hdr.run"]*100, return_index=
True)
44 return n_cosmic_evt * POT_PER_SPILL / (1. - neutrino_per_spill)