gondola.visual.tof#

TOF visualizations

Functions

grace_tof_projection_xy([paddle_occupancy, ...])

grace_unroll_cbe_sides([paddle_occupancy, ...])

grace_unroll_cor([paddle_occupancy, event, ...])

plot_hg_lg_hits(h_nhits, h_nthits, n_events)

Plot the HG vs the LG (trigger) hits with extra annotations.

plot_waveforms(tof_ev[, calib, with_hits, ...])

Return a list of figures with all the waveforms from a specific tof event

tof_2dproj([event, cmap, paddle_style, ...])

Plots the entire TOF system in 2d projection, that is all panels overlaid on each other

tof_hits_time_evolution(ev[, line_color, t_err])

A simple plot plotting normalized event times on the x axis and the energy deposition for each hit on the y axis.

tof_projection_xy([paddle_occupancy, event, ...])

Show the projection of all paddles which are facing in z-direction These are the whole Umbrella as well as CBE TOP + Bottom.

tof_projection_xy_paddles([stack_panels, ...])

Plot the outline of the xy projection of the z-normal TOF panels (UMB, CBE top and bot).

unroll_cbe_sides([paddle_occupancy, event, ...])

Project the sides of the cube on xz and yz as well as add the 'edge' paddles.

unroll_cor([paddle_occupancy, event, cmap, ...])

Project the cortina on xz and yz as well as add the 'edge' paddles.

unroll_tof([paddle_occupancy, cmap, ...])

gondola.visual.tof.plot_hg_lg_hits(h_nhits: hist1d, h_nthits: hist1d, n_events: int, no_hitmissing=None, one_hitmissing=None, lttwo_hitmissing=None, extra_hits=None, markercolor='w') -> (<class 'matplotlib.figure.Figure'>, <class 'matplotlib.figure.Figure'>)#

Plot the HG vs the LG (trigger) hits with extra annotations. The nhit histograms and missing hit data has to be obtained previously.

# Returns:

Two figures, the actual histogram and the ratio plot

# Arguments:

  • h_nhits : histogram of number of HG hits

  • h_nthitshistogram of number of LG hits
    (hits with come from the trigger system

    = 'Trigger hits')

  • n_eventsThe number of events from which the

    hits were obtained

  • no_hitmissingThe number of events which had zero

    hits missing

  • one_hitmissingThe number of events which had one HG

    hit. missing

  • two_hitmissingThe number of events which had two HG

    hits missing

gondola.visual.tof.grace_tof_projection_xy(paddle_occupancy={}, event=None, cmap='coolwarm', paddle_style={'edgecolor': 'w', 'lw': 0.4}, show_cbar=True, overlay_panels=False, indicate_empty='', axs=None, norm=None)#
gondola.visual.tof.tof_projection_xy_paddles(stack_panels=False, title='TOF UMB/CBE TOP/CBE BOT xy projection', show_pids=False, edgecolor='k')#

Plot the outline of the xy projection of the z-normal TOF panels (UMB, CBE top and bot).

There are 2 'modes': Plot the 3 panels side-by-side or have them stacked on top of each other for a 'true' 2d project for these 3 panels.

This by itself, will just outline the TOF paddles. This then can be used in combination with other data to show event displays or occupancy data.

# Keyword Args:
  • stack_panelsStack panels (overlay them) on top of each other

    to create a true 2d projection

  • titleTitle for the whole axes arangement, appears in

    the upper right

  • show_pids : Show paddle ids on the paddles

  • edgecolorUse this color to draw the outlines of the paddles

    as well as the text for the pids (if show_pids == True)

# Returns:

(matplotlib.Figure, dict[paddld id] -> matplotlib

gondola.visual.tof.tof_projection_xy(paddle_occupancy={}, event=None, cmap=<matplotlib.colors.LinearSegmentedColormap object>, paddle_style={'edgecolor': 'w', 'lw': 0.4}, show_cbar=True, overlay_panels=False, indicate_empty='gray', umbrella_only=False, lognorm=False, norm='lin')#

Show the projection of all paddles which are facing in z-direction These are the whole Umbrella as well as CBE TOP + Bottom. While this plot can show the occupancy of TOF paddles, it can also be 'hijacked' to just highlight certain paddles.

# Keyword Arguments:

paddle_occupancy : The number of events per paddle event : Plot hits from TofEvent as circles cmap : Colormap - can be lambda function

to return color value based on 'occupancy' number

show_cbar : Show the colorbar on the figure overlay_panels : Only return one axes, have the TOF CBE bottom

and CBE TOP panels overlaid over the umbrella (or under it)

indicate_emptyIn case we are using this for paddle occupancy,

indicate empty paddles with the given color instead using a value from the color map. If this behavior is not desired, set this to an empty string.

umbrella_only : Show only the umbrella, add the colorbar next to it lognorm : Same as norm = 'log' [DEPRECATED] norm : 'lin', 'log' or 'none'. This allows to set the

normalization of the colormap. 'lin' - linear normalization for all panels to min/max(occupancy) 'log' - logarithmic normalization for all panels to min/max(occupancy) 'nono' - no normalization, plot absolute values

gondola.visual.tof.grace_unroll_cbe_sides(paddle_occupancy={}, event=None, cmap=<matplotlib.colors.LinearSegmentedColormap object>, paddle_style={'edgecolor': 'w', 'lw': 0.4}, show_cbar=True, indicate_empty='gray', axs=None, norm=None)#
gondola.visual.tof.unroll_cbe_sides(paddle_occupancy={}, event=None, cmap=<matplotlib.colors.LinearSegmentedColormap object>, paddle_style={'edgecolor': 'w', 'lw': 0.4}, show_cbar=True, indicate_empty='gray')#

Project the sides of the cube on xz and yz as well as add the 'edge' paddles.

While this plot can show the occupancy of TOF paddles, it can also be 'hijacked' to just highlight certain paddles.

# Keyword Arguments:

paddle_occupancy : The number of events per paddle event : Plot a tof event cmap : Colormap - can be lambda function

to return color value based on 'occupancy' number

show_cbar : Show the colorbar on the figure indicate_empty : In case we are using this for paddle occupancy,

indicate empty paddles with the given color instead using a value from the color map. If this behavior is not desired, set this to an empty string.

gondola.visual.tof.grace_unroll_cor(paddle_occupancy={}, event=None, cmap=<matplotlib.colors.LinearSegmentedColormap object>, paddle_style={'edgecolor': 'w', 'lw': 0.4}, show_cbar=True, indicate_empty='gray', axs=None, norm=None)#
gondola.visual.tof.unroll_tof(paddle_occupancy={}, cmap='bwr', paddle_style={'edgecolor': 'k', 'lw': 0.4})#
gondola.visual.tof.unroll_cor(paddle_occupancy={}, event=None, cmap=<matplotlib.colors.LinearSegmentedColormap object>, paddle_style={'edgecolor': 'w', 'lw': 0.4}, show_cbar=True, indicate_empty='gray')#

Project the cortina on xz and yz as well as add the 'edge' paddles.

While this plot can show the occupancy of TOF paddles, it can also be 'hijacked' to just highlight certain paddles.

# Keyword Arguments:

paddle_occupancy : The number of events per paddle cmap : Colormap - can be lambda function

to return color value based on 'occupancy' numbker

show_cbar : Show the colorbar on the figure indicate_empty : In case we are using this for paddle occupancy,

indicate empty paddles with the given color instead using a value from the color map. If this behavior is not desired, set this to an empty string.

gondola.visual.tof.tof_2dproj(event=None, cmap=<matplotlib.colors.LinearSegmentedColormap object>, paddle_style={'edgecolor': 'w', 'lw': 0.4}, show_cbar=True, no_ax_no_ticks=False, cs_is_energy=False, cnorm_max=None) list#

Plots the entire TOF system in 2d projection, that is all panels overlaid on each other

# Keyword Arguments:
eventA TofEvent. If not None, then the hits will be shown

on top of the 2d projections

cs_is_energy : Use the colorscale for energy instead of timing no_ax_no_ticks : Don't show any axis or axis ticks for a plain view

# Returns:

list of figures, xy, xz, xy projections

gondola.visual.tof.tof_hits_time_evolution(ev, line_color='k', t_err=0.35) Figure#

A simple plot plotting normalized event times on the x axis and the energy deposition for each hit on the y axis.

# Return:

gondola.visual.tof.plot_waveforms(tof_ev, calib: dict = None, with_hits=False, skip_bins=0)#

Return a list of figures with all the waveforms from a specific tof event

# Arguments:

tof_ev : TofEvent with waveforms calib : A dictionary with RB calibrations with_hits : Indicate extracted hit time in the plots skip_bins : Zero the first [skip_bins]. This might be a

helpful option in case there is a big spike in the beginning