<jupyter_start><jupyter_text>Beam Energy Plot<jupyter_code>import hgc_testbeam as hgc
from concurrent.futures import ThreadPoolExecutor
executor = ThreadPoolExecutor(max_workers=32)
runlist = hgc.runlist.set_index("Run")
columns = ["event", "rechit_energy"]
def get_nevents_and_energy_mean_median(run):
    df = hgc.load_run(run, columns=columns)
    nevents = int(df.event.nunique())
    energy_sums = df.groupby("event").rechit_energy.sum()
    return nevents, energy_sums.mean(), energy_sums.median()
%%time
for run in runlist.index:
    print(run, end =" ")
    runlist.loc[run, "future"] = executor.submit(get_nevents_and_energy_mean_median, run)
print("")
%%time
for run in runlist.index:
    print(run, end =" ")
    result = runlist.loc[run, "future"].result()
    runlist.loc[run, "NeventsInFile"] = result[0]
    runlist.loc[run, "RechitEnergySumMean"] = result[1]
    runlist.loc[run, "RechitEnergySumMedian"] = result[2]
print("")
runlist = runlist.drop("future", axis=1)
runlist.to_csv("runlist_augmented.csv")
import matplotlib.pyplot as plt
runlist.query("Particle == 'electron' and CaloConfiguration == 1").plot.scatter(x="Energy", y="RechitEnergySumMean")
runlist.query("Particle == 'electron' and CaloConfiguration == 1 and Factor > 150")<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1469673405909798, 'fraction_numerical': 0.008553654743390357, 'mean_word_length': 6.271186440677966, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '546084', 'license': 'MIT', 'n_tokens_mistral': 485, 'n_tokens_neox': 460, 'n_words': 84, 'path': 'examples/hgcal/06_energy_sum_over_beam_energies.ipynb', 'repo_name': 'guitargeek/geeksw', 'size': '1286'}