Skip to content

[REMI] Add support for virtual trailing trigger

Philipp Schmidt requested to merge feat/REMI-virtual-trailing-pulse into master

Description

The REMI/DLD notebook is fundamentally built around dividing the train into triggers around FEL or PPL pulses, as in a REMI experiment the TOF signals are squeezed between the exciting pulse and the next. The recent !889 (merged) added a special mode for debugging/characterization purposes where the entire train is treated as a single trigger if both FEL and PPL are disabled.

A recent experiment (p4455) however was not so much interested in the signal immediately following each FEL pulse, but long-living metastable states arriving long after all the entire FEL pulse train. The debug solution from !889 (merged) could've been applied in theory, but caused single triggers with an excessive amount of individual hits (> 1000), which the reconstruction code cannot handle. Among other things, it tries to find the right permutation of up to seven signals, i.e. scales with some O(x^n), n > 2. The input traces could've been restricted to the region after the FEL train, but this creates a dependency on the number of pulses.

Instead, this MR adds a new trailing-trigger toggle that when enabled inserts another virtual trigger after the last regular one until the end of the trace. For p4455, this virtual trigger then contains the signal from metastable species without any signal from the FEL pulses itself. If there is no regular FEL/PPL triggers, the trailing trigger is the only one thus superseding the prior debug feature as well. It can be identified in the result since both the fel and ppl colums are False, as well as the pulse == -1.

Also fixes/improves some minor plotting things like y limits, as well as adds a warning if maximum number of hits is exceeded.

How Has This Been Tested?

run = 292
in_folder = '/gpfs/exfel/exp/SQS/202302/p004455/raw'
calib_config_path = '/gpfs/exfel/exp/SQS/202302/p004455/usr/dld_proc_config.yaml'
karabo_id = 'SQS_AQS_DLD4'
out_aggregator = 'DLD01'

quad_anode = True
ignore_fel = False
ignore_ppl = True
trailing_trigger = True
first_pulse_offset = 9700

Types of changes

  • New feature (non-breaking change which adds functionality) -->

Reviewers

@ahmedk @kluyvert

Merge request reports