Skip to main content
By default, no control plots are produced. You enable them by calling plotting functions directly in workflow.py at any point in the reconstruction loop.
The raw data is structured in DAQ channel ordering, which can mix views within a single module. Use the per-view functions wherever possible for more physically meaningful output.
All plots are saved automatically to the directory specified by $LARDON_PLOT. The filename encodes the detector, run, subfile, flow/writer/server numbers, event number, and trigger number for traceability.

Common Options

Every plotting function accepts these two keyword arguments:
OptionDefaultDescription
optionNoneExtra string appended to the output filename (e.g. option="after_noise_filter")
to_be_shownFalseIf True, opens the plot interactively via plt.show()
# Example: save with a custom suffix and display interactively
plot.plot_event_display_per_view(option="before_hits", to_be_shown=True)

Event Displays

Event displays render the full 2-D ADC map (channel vs. time tick) for the current event and module.
Renders the event display in DAQ channel ordering — the raw hardware channel numbering. Because DAQ channels can interleave views within a single module, this view can appear discontinuous.
plot.event_display_per_daqch(
    adc_range=[-10, 10],
    option=None,
    to_be_shown=False,
)
  • adc_range[min, max] ADC scale for the color map (default [-10, 10]).
Saved as ED_daqch_<module>_...png.
Renders the event display in view channel ordering — channels within a single view, which gives a more natural and readable layout. Separate sub-panels are drawn for each view, with dedicated color scales for induction (diverging) and collection (sequential).
plot.event_display_per_view(
    adc_ind=[-10, 10],
    adc_coll=[-5, 30],
    option=None,
    to_be_shown=False,
)
  • adc_ind — ADC scale for induction views (default [-10, 10]).
  • adc_coll — ADC scale for collection views (default [-5, 30]).
Saved as ED_vch_<module>_...png.
Same layout as event_display_per_view(), but only the signal ROI (Region Of Interest) is shown — the noise mask is applied so that only samples flagged as signal are visible. Useful for checking ROI finding quality.
plot.event_display_per_view_roi(
    adc_ind=[-10, 10],
    adc_coll=[-5, 30],
    option=None,
    to_be_shown=False,
)
Saved as ED_vch_<module>_...png.
Same layout as event_display_per_view(), but only the noise regions are shown — the signal ROI is masked out so that only samples flagged as background remain. Useful for verifying the noise filter.
plot.event_display_per_view_noise(
    adc_ind=[-10, 10],
    adc_coll=[-5, 30],
    option=None,
    to_be_shown=False,
)
Saved as ED_vch_<module>_...png.
Same layout as event_display_per_view(), but overlays rectangles for every found hit on top of the ADC image. Hit colors reflect their matching status:
  • Grey — unmatched (noise)
  • Blue — attached to a 2D track
  • Green — delta ray hits
  • Orange — single hits (blips)
plot.event_display_per_view_hits_found(
    adc_ind=[-10, 10],
    adc_coll=[-5, 30],
    option=None,
    to_be_shown=False,
)
Saved as ED_vch_hits_found_<module>_...png.

Waveforms

Plots the waveform for one or more DAQ channel numbers. Each channel is shown in its own sub-panel, stacked vertically and sharing the time axis. The legend includes the corresponding view and view-channel number.
plot.plot_wvf_current_daqch(
    [daq_ch_1, daq_ch_2, ...],
    option=None,
    to_be_shown=False,
)
  • daqch_list — list of integer DAQ channel numbers.
Saved as waveforms_...png.
Plots the waveform for one or more channels identified by (view, view-channel) pairs. Otherwise identical layout to the DAQ-channel version.
plot.plot_wvf_current_vch(
    [(view, ch1), (view, ch2), ...],
    option=None,
    to_be_shown=False,
)
  • vch_list — list of (view_index, channel_number) tuples.
Saved as waveforms_...png.

Noise

Scatter plot of the pedestal RMS for every channel in the current module, plotted against the DAQ channel number.
plot.plot_noise_daqch(
    noise_type='raw',   # or 'filt'
    vrange=[0, 10],
    option=None,
    to_be_shown=False,
)
  • noise_type'raw' for the pre-filter RMS or 'filt' for the post-filter RMS.
  • vrange[min, max] of the y-axis (ADC, default [0, 10]).
Saved as ped_<noise_type>_rms_daqch_...png.
Same as plot_noise_daqch, but channels are re-mapped into view channel ordering — one sub-panel per view — which makes it easier to spot view-specific problems.
plot.plot_noise_vch(
    noise_type='raw',   # or 'filt'
    vrange=[0, 10],
    option=None,
    to_be_shown=False,
)
  • noise_type'raw' or 'filt'.
  • vrange[min, max] of the y-axis (default [0, 10]).
Saved as ped_<noise_type>_ADC_rms_vch_...png.

Reconstruction Visualization

These plots show the results of the track-finding stage and require -trk reconstruction to have run.
Scatter plot of all found hits in physical (position, drift) space, one panel per view. Hit markers are colored by their maximum ADC amplitude.
plot.plot_2dview_hits(
    modules,
    max_adc=100,
    option=None,
    to_be_shown=False,
)
  • modules — list of module indices to include.
Saved as hits_view_...png.
Shows all hits (light grey) overlaid with 2D reconstructed tracks in physical coordinates, one panel per view.
plot.plot_2dview_2dtracks(
    modules,
    option=None,
    to_be_shown=False,
)
Saved as track2D_hits_...png.
Comprehensive 2D projection showing hits color-coded by their reconstruction category (noise, track hit, delta ray, single hit) alongside both 2D and 3D tracks projected onto each view plane.
plot.plot_2dview_hits_3dtracks(
    modules,
    option=None,
    to_be_shown=False,
)
Hit color legend:
  • Grey — unmatched (noise)
  • Blue — attached to 2D track
  • Green — delta ray hits
  • Orange — single hits (blips)
  • Teal line — 3D track projection
Saved as reco2D_module_<N>_...png.
Full 3D visualization of reconstructed tracks using matplotlib’s 3D projection. The figure contains four sub-panels: a 3D scatter view plus three 2D projections (x–y, x–z, y–z). Track endpoints are marked with star and pentagon markers. Single hits (blips) and ghost tracks are also included.
Unlike other plotting functions, plot_3d defaults to to_be_shown=True — it will open an interactive window unless you explicitly pass to_be_shown=False.
plot.plot_3d(
    option=None,
    to_be_shown=True,   # NOTE: default is True for this function
)
Saved as track3D_...png.

Photon Detection System (PDS)

Available when -pds reconstruction is used.
Plots PDS waveforms for the specified global channel list as a function of time relative to the trigger (in microseconds). Solid and dashed lines show aligned and offset-corrected versions respectively.
plot.draw_pds_ED(
    glob_chans,          # list of global PDS channel indices
    option=None,
    to_be_shown=False,
    draw_peak=False,     # overlay reconstructed peak positions
    draw_cluster=False,
    draw_roi=False,      # shade signal ROI regions
)
  • glob_chans — list of global PDS channel indices to display.
  • draw_peak — if True, overlays markers at reconstructed peak positions.
  • draw_cluster — if True, overlays cluster boundaries.
  • draw_roi — if True, shades the signal ROI regions in the waveform.
Saved as ED_pds_<data_type>_...png.
Draws a grid of all PDS channels for a given data stream type ("stream" or "trigger"). Each sub-panel shows the waveform for one channel with noise RMS threshold lines.
plot.draw_all_pds_ED(
    data_type="stream",   # or "trigger"
    option=None,
    to_be_shown=False,
    draw_peak=False,
    draw_roi=False,
)
Saved as ED_pds_<data_type>_...png.

Gallery mode is a special display mode for PDVD data that uses an effective channel mapping so that tracks crossing CRP boundaries do not appear broken. It is activated with the -gallery command-line option.
lardon -det pdvd -run <N> -sub <N> -gallery beam   # beam-relevant channels, zoomed to beam arrival time
lardon -det pdvd -run <N> -sub <N> -gallery top     # top drift volume only
lardon -det pdvd -run <N> -sub <N> -gallery bottom  # bottom drift volume only
lardon -det pdvd -run <N> -sub <N> -gallery both    # produces two separate images (top + bottom)
The both option generates two separate image files — one for the top volume and one for the bottom volume.
Publication-quality images: Open src/lardon/gallery/pdvd.py and set self.conference_style = True in the effective_chan class constructor. This removes all tick and channel number labels from the output images.
# src/lardon/gallery/pdvd.py
class effective_chan:
    def __init__(self, gallery):
        ...
        self.conference_style = True  # removes axis labels for publication

Build docs developers (and LLMs) love