gaps_online.tof.visual#

Variable plot visualization FIXME - might get moved around

Functions

eventbld_hb_plots([reader, heartbeats])

Plot the relevant quantities from the event builder heartbeats

mtb_rate_plot([datafiles, mtbmonidata, ...])

Show the rate and lost_rate as read from MTB register over time

plot_hg_lg_hits([reader, events, h_nhits, ...])

Plot the HG vs the LG (trigger) hits

plot_ltb_threshold_timeseries(times, ltb_hk)

The LTB thresholds over the given times.

plot_paddle_charge2d([reader, charge_a, ...])

Plot the paddle charge (from the TofHits) in a symmetric 2d histogram

plot_rb_paddles(rb)

Create the TOF projection plots and mark the respective panels corresponding to the ReadoutBoard

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

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

timeseries_multiplot(times, variables, labels)

Create a general timeseries plot for multiple variables over the mission elapsed time.

timeseries_plot(times, data[, title, ...])

Create a general timeseries plot for a variable over the mission elapsed time

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, ...])

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.

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.

gaps_online.tof.visual.timeseries_plot(times, data, title='', xlabel='', ylabel='', savename='')#

Create a general timeseries plot for a variable over the mission elapsed time

# Arguments:
  • times : gcutimes, ideally re-normalized to run start time

  • data : quantity to plot over time

# Keyword Arguments:

title : axis title xlabel : label for the x-axis ylabel : label for the y-axis savevname : save plot with this filename,

if None, don't save

gaps_online.tof.visual.timeseries_multiplot(times, variables, labels, title='', xlabel='', ylabel='', savename='')#

Create a general timeseries plot for multiple variables over the mission elapsed time. This is basically the same as timeseries_plot, however, for multiple variables which will all be plotted in the same axis.

# Arguments:
  • times : gcutimes, ideally re-normalized to run start time

  • variablesquantities to plot over time. This should be a list

    of lists (or arrays)

  • labelsindividual labels for the variables, same ordering

    structure

# Keyword Arguments:

title : axis title xlabel : label for the x-axis ylabel : label for the y-axis savevname : save plot with this filename,

if None, don't save

gaps_online.tof.visual.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

gaps_online.tof.visual.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')#

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 or TofEventSummary cmap : Colormap - can be lambda function

to return color value based on 'occupancy' numbker

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.

gaps_online.tof.visual.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' 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.

gaps_online.tof.visual.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.

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

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

# Returns:

list of figures, xy, xz, xy projections

gaps_online.tof.visual.plot_rb_paddles(rb)#

Create the TOF projection plots and mark the respective panels corresponding to the ReadoutBoard

# Arguments:

rb : go.db.ReadoutBoard

gaps_online.tof.visual.tof_hits_time_evolution(ev, line_color='k', t_err=0.35, twindows=None)#

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

# Return:

gaps_online.tof.visual.plot_ltb_threshold_timeseries(times, ltb_hk, savename=None)#

The LTB thresholds over the given times.

# Arguments:
  • times : mission elapsed time

  • ltb_hk : a list of LTBMoniData

# Keyword Arguments:
  • savename : filename of the plot to save

gaps_online.tof.visual.plot_paddle_charge2d(reader=None, charge_a=[], charge_b=[], paddle_id=0, charge_bins=array([0., 1.44927536, 2.89855072, 4.34782609, 5.79710145, 7.24637681, 8.69565217, 10.14492754, 11.5942029, 13.04347826, 14.49275362, 15.94202899, 17.39130435, 18.84057971, 20.28985507, 21.73913043, 23.1884058, 24.63768116, 26.08695652, 27.53623188, 28.98550725, 30.43478261, 31.88405797, 33.33333333, 34.7826087, 36.23188406, 37.68115942, 39.13043478, 40.57971014, 42.02898551, 43.47826087, 44.92753623, 46.37681159, 47.82608696, 49.27536232, 50.72463768, 52.17391304, 53.62318841, 55.07246377, 56.52173913, 57.97101449, 59.42028986, 60.86956522, 62.31884058, 63.76811594, 65.2173913, 66.66666667, 68.11594203, 69.56521739, 71.01449275, 72.46376812, 73.91304348, 75.36231884, 76.8115942, 78.26086957, 79.71014493, 81.15942029, 82.60869565, 84.05797101, 85.50724638, 86.95652174, 88.4057971, 89.85507246, 91.30434783, 92.75362319, 94.20289855, 95.65217391, 97.10144928, 98.55072464, 100.]), plot_dir=None)#

Plot the paddle charge (from the TofHits) in a symmetric 2d histogram

gaps_online.tof.visual.mtb_rate_plot(datafiles: str = None, mtbmonidata=[], use_gcutime=False, mtb_moni_interval=10, plot_dir=None)#

Show the rate and lost_rate as read from MTB register over time

# Arguments

  • datafilse : Either a single filename or a directory with files

  • mtbmonidataInstead of a list of files, a list of tuples (gcutime, MTBMoniData)

    can be given.

  • mtb_moni_intervalIn case we don't have a gcu time, specify the sampling interval

    for MTBMoniData (this can be obtained from the run<runid>.toml file

  • plot_dir : To save the plot as a .webp, specify a directory

gaps_online.tof.visual.plot_hg_lg_hits(reader=None, events=[], h_nhits=None, h_nthits=None, h_nrblnk=None, n_events=None, no_hitmissing=None, one_hitmissing=None, lttwo_hitmissing=None, extra_hits=None, plot_dir=None, split_by_threshold=False)#

Plot the HG vs the LG (trigger) hits

gaps_online.tof.visual.eventbld_hb_plots(reader=None, heartbeats=[])#

Plot the relevant quantities from the event builder heartbeats