<jupyter_start><jupyter_text>Welcome to the tutorial!In this tutorial you will learn how to generate simulations of collisions, as done in the particle detectors such as the LHC.<jupyter_code>import collide<jupyter_output><empty_output><jupyter_text>You can generate an event using a simple interface. Just call ``collide.generate_event()``. You can optionally pass the type of process that you would like to generate, the random seed and now many events you would like to generate.<jupyter_code>help(collide.generate_event)
collide.generate_event('Top')<jupyter_output><empty_output><jupyter_text>You can check the available processes using the ``collide.available_processes()`` function.<jupyter_code>dark_matter_event = collide.generate_event('DarkMatter', seed=3423)[0]
import matplotlib.pyplot as plt
def normalize_var_for_plot(variable):
    normalized = variable/(variable.median())
    normalized.loc[normalized>1.] = 1.
    return normalized
import seaborn as sns

palette = sns.color_palette("flare_r", as_cmap=True)

def plot_line(df, ax):
    ax.plot([df['Vx'], df['Vx_decay']],
            [df['Vy'], df['Vy_decay']], 
             color=df['color'], linewidth=df['width'])
    
def plot_energy_weight(trajectories = dark_matter_event.trajectories):
    color_scale = normalize_var_for_plot(trajectories.E)
    
    trajectories['color'] = color_scale.apply(lambda x: palette.colors[int(255*x)])
    trajectories['width'] = 1 + 1.5*color_scale
    
    fig, ax = plt.subplots(figsize=(7, 7))
    
    trajectories.T.apply(lambda x: plot_line(x, ax))
    
    ax.axis('off')
    ax.axis('tight')
    ax.axis('image')
    return ax
ax = plot_energy_weight()
ax.set_ylim(-1e-4, 1e-4)
ax.set_xlim(-1e-4, 1e-4)
ax.get_figure()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1235827664399093, 'fraction_numerical': 0.013038548752834467, 'mean_word_length': 5.107266435986159, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 14, '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': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '238729', 'license': 'MIT', 'n_tokens_mistral': 617, 'n_tokens_neox': 598, 'n_words': 135, 'path': 'Tutorial.ipynb', 'repo_name': 'GluonCollective/collisions', 'size': '1764'}